]> git.saurik.com Git - wxWidgets.git/commitdiff
Some Motif fixes; makefile fixes; added wxTransferStreamToFile/FileToStream for wxWin
authorJulian Smart <julian@anthemion.co.uk>
Thu, 24 Feb 2000 15:04:24 +0000 (15:04 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 24 Feb 2000 15:04:24 +0000 (15:04 +0000)
streams; fixed wxSP_... ids that clashed with wxTextCtrl; added generic GetPixel implementation for GTK/Motif

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

35 files changed:
demos/life/game.cpp
distrib/msw/generic.rsp
distrib/msw/glcanvas.rsp
distrib/msw/gtk.rsp
distrib/msw/makefile.rsp
distrib/msw/motif.rsp
distrib/msw/msw.rsp
distrib/msw/ogl.rsp
distrib/msw/tex2rtf.rsp
docs/motif/issues.txt
include/wx/defs.h
include/wx/docview.h
include/wx/memory.h
samples/wizard/wiztest.cpp
samples/wizard/wiztest.def [new file with mode: 0644]
src/common/docview.cpp
src/common/memory.cpp
src/gtk/dcclient.cpp
src/gtk1/dcclient.cpp
src/html/helpdata.cpp
src/jpeg/makefile.wat [new file with mode: 0644]
src/motif/app.cpp
src/motif/checkbox.cpp
src/motif/dcclient.cpp
src/motif/frame.cpp
src/motif/statbmp.cpp
src/msw/dc.cpp
utils/glcanvas/samples/cube/Makefile
utils/glcanvas/samples/isosurf/Makefile
utils/glcanvas/samples/penguin/Makefile
utils/ogl/samples/ogledit/Makefile [new file with mode: 0644]
utils/ogl/samples/ogledit/doc.cpp
utils/ogl/samples/ogledit/doc.h
utils/ogl/samples/studio/Makefile [new file with mode: 0644]
utils/ogl/samples/studio/symbols.cpp

index d729a82cea9a779d005f751d16def363d214c518..6178c756a92c46a08fd32594d30bf1549307fd07 100644 (file)
@@ -294,7 +294,7 @@ CellBox* Life::LinkBox(wxInt32 x, wxInt32 y, bool create)
         if ((c->m_x == x) && (c->m_y == y)) return c;
 
     // if not found, and (create == TRUE), create a new one
-    return create? CreateBox(x, y, hv) : NULL;
+    return create? CreateBox(x, y, hv) : (CellBox*) NULL;
 }
 
 // KillBox:
index cd6016310209d6a3d415c239bbac8a6bb6db761d..08e45c9cd2e4271c25744226c7b861a3f3fda15a 100644 (file)
@@ -18,7 +18,6 @@ template.mak
 wx-config.in
 makefile.unx.in
 wxinstall
-Makefile
 descrip.mms
 setup.h_vms
 src/common/descrip.mms
@@ -66,10 +65,8 @@ src/make.env
 src/makeprog.env
 src/makelib.env
 
-src/Makefile
 src/*.inc
 src/mkdir
-src/Makefile
 src/make.env.in
 src/makeprog.env.in
 src/makelib.env.in
@@ -151,7 +148,7 @@ misc/afm/*.afm
 misc/gs_afm/*.afm
 
 utils/*.txt
-utils/make*
+utils/make*.*
 utils/configure
 utils/configure.in
 
@@ -215,7 +212,6 @@ utils/makegen/*.xpm
 utils/makegen/*.txt
 utils/makegen/templates/make*
 
-utils/dialoged/Makefile
 utils/dialoged/src/bitmaps/*.xbm
 utils/dialoged/src/bitmaps/*.xpm
 utils/dialoged/src/*.h
@@ -1002,6 +998,24 @@ samples/calendar/*.ico
 samples/calendar/*.xpm
 samples/calendar/*.txt
 
+samples/statbar/*.cpp
+samples/statbar/*.h
+samples/statbar/makefile*
+samples/statbar/*.rc
+samples/statbar/*.def
+samples/statbar/*.ico
+samples/statbar/*.xpm
+samples/statbar/*.txt
+
+samples/plot/*.cpp
+samples/plot/*.h
+samples/plot/makefile*
+samples/plot/*.rc
+samples/plot/*.def
+samples/plot/*.ico
+samples/plot/*.xpm
+samples/plot/*.txt
+
 samples/exec/*.cpp
 samples/exec/*.h
 samples/exec/makefile*
index 12a4744fa4266a22f7f35f283734a50954da57ef..923fc507bd3005ade9828a8faa81f46a83de9c65 100644 (file)
@@ -6,12 +6,10 @@ utils/glcanvas/win/make*.*
 utils/glcanvas/gtk/*.cpp
 utils/glcanvas/gtk/*.h
 utils/glcanvas/gtk/make*.*
-utils/glcanvas/gtk/Makefile
 utils/glcanvas/motif/*.cpp
 utils/glcanvas/motif/*.h
 utils/glcanvas/motif/make*.*
 utils/glcanvas/motif/*.txt
-utils/glcanvas/motif/Makefile
 utils/glcanvas/samples/cube/*.cpp
 utils/glcanvas/samples/cube/*.h
 utils/glcanvas/samples/cube/*.rc
index 5b4e32b747e33988f24533c94fd105a2ea737398..25001e7cc2193a2c2b1c2dc20ea1b0ae75132c2e 100644 (file)
@@ -1,5 +1,3 @@
-configure
-
 distrib/gtk/copy_src
 distrib/gtk/README.txt
 distrib/gtk/Setup
@@ -14,7 +12,7 @@ include/wx/gtk/*.xpm
 include/install-sh
 include/wx/install-sh
 
-src/gtk/Makefile
+src/gtk/files.lst
 src/gtk/*.cpp
 src/gtk/*.c
 src/gtk/*.inc
index c8abfe9f2d67c40426ec009f58b56271bca4387c..481f54a8b165629d62bfc8c9a8559f7b60b86212 100644 (file)
@@ -1,5 +1,4 @@
 Makefile.in
-src/Makefile
 locale/Makefile
 samples/Makefile.in
 samples/calendar/Makefile.in
@@ -32,6 +31,7 @@ samples/mdi/Makefile.in
 samples/minifram/Makefile.in
 samples/minimal/Makefile.in
 samples/notebook/Makefile.in
+samples/plot/Makefile.in
 samples/printing/Makefile.in
 samples/proplist/Makefile.in
 samples/propsize/Makefile.in
@@ -40,6 +40,7 @@ samples/sashtest/Makefile.in
 samples/scroll/Makefile.in
 samples/scrollsub/Makefile.in
 samples/splitter/Makefile.in
+samples/statbar/Makefile.in
 samples/text/Makefile.in
 samples/thread/Makefile.in
 samples/toolbar/Makefile.in
@@ -57,6 +58,12 @@ demos/fractal/Makefile.in
 demos/poem/Makefile.in
 demos/life/Makefile.in
 utils/glcanvas/motif/Makefile.in
+utils/HelpGen/Makefile.in
+utils/tex2rtf/Makefile.in
+utils/tex2rtf/src/Makefile.in
+utils/dialoged/Makefile.in
+utils/dialoged/src/Makefile.in
+utils/hhp2cached/Makefile.in
 utils/Makefile.in
 utils/wxMMedia2/Makefile.in
 utils/wxMMedia2/lib/Makefile.in
index 71b76e4d987e9f8cadae9ba4c4ee07e9084b7832..db6bd0600fd0f3c3c3e3880ba7ea6deb4ee9f75d 100644 (file)
@@ -1,5 +1,6 @@
 src/motif.inc
 
+src/motif/files.lst
 src/motif/*.cpp
 src/motif/*.c
 src/motif/*.h
index 4fb8eeb92fb7a1c12dd285ded2cbfc1479ba3ab5..dcdddd05bdb83c28be97ecde3034f566ab4bd95f 100644 (file)
@@ -53,6 +53,7 @@ src/common/doslex.c
 src/common/y_tab.c
 src/common/lex_yy.c
 
+src/msw/files.lst
 src/msw/*.cpp
 src/msw/*.h
 src/msw/makefile.*
index 8a742c2744b4edee32def2207f94e8f6072e6e66..de8ca90dfd068c56909797ea52fadeed77b7d93f 100644 (file)
@@ -1,5 +1,4 @@
 utils/ogl/Makefile.in
-utils/ogl/Makefile
 
 utils/ogl/src/*.cpp
 utils/ogl/src/*.h
@@ -8,7 +7,6 @@ utils/ogl/src/*.def
 utils/ogl/src/*.xbm
 utils/ogl/src/*.xpm
 utils/ogl/src/make*.*
-utils/ogl/src/Makefile
 utils/ogl/src/*.txt
 utils/ogl/src/*.ico
 utils/ogl/src/*.bmp
index 294535d9d6b7cb3181db8780ddc2136052df5166..5f531b87f08856fffbf5d9cb744e0ed872de550d 100644 (file)
@@ -1,7 +1,6 @@
 utils/tex2rtf/src/*.cpp
 utils/tex2rtf/src/*.h
 utils/tex2rtf/src/make*.*
-utils/tex2rtf/src/Makefile
 utils/tex2rtf/src/*.xbm
 utils/tex2rtf/src/*.xpm
 utils/tex2rtf/src/*.sty
index bb4c54218ed0266cce74ed16d284112c0d0a5ab3..743cbdb1e06e5ea05c37a2057562b1c0999e9478 100644 (file)
@@ -10,4 +10,6 @@ Outstanding issues
 - Should scrollbars take on the background colour? Not right for
   e.g. wxScrolledWindows, so maybe have wxSystemSettings value for
   scrollbar colour, and/or ability to set scrollbar colour independently.
+- wxFrame can accept events, but apps cannot draw into it for some reason,
+  so the rotate sample won't work. Workaround: use an embedded wxWindow.
 
index 5a81d4ac0cc45eae5a4df29f050a65e6d444b745..82bfc41fb36c21dfbcf220be3cabe08b5bf5ae0b 100644 (file)
@@ -1102,12 +1102,15 @@ enum wxStretch
 // #define wxLC_SHOW_SEL_ALWAYS
 
 /*
- * wxSpinButton flags
+ * 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       0x0010
-#define wxSP_WRAP             0x0020
+#define wxSP_ARROW_KEYS       0x1000
+#define wxSP_WRAP             0x2000
 
 /*
  * wxSplitterWindow flags
index b2c0b7dedf550d5b7a512942bfaa7b469d2ddaf8..592a7439dbab7fa6b7f32b3b7766f8cc8271bca4 100644 (file)
@@ -619,6 +619,11 @@ protected:
 // converts from/to a stream to/from a temporary file.
 bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream);
 bool WXDLLEXPORT wxTransferStreamToFile(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
 
 #endif // _WX_DOCH__
index 21b9545a961b818e48fd0212b1149c6da340be85..48fb5c449e9277ddba8338c67692ae9449ad0984 100644 (file)
@@ -196,6 +196,8 @@ protected:
     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
index cd078af265df207f614f3863991454041120318b..d6f249de35f98f8e29ee107eef5efa96cfc3fc20 100644 (file)
@@ -146,7 +146,13 @@ public:
     wxRadioboxPage(wxWizard *parent) : wxWizardPageSimple(parent)
     {
         // should correspond to the enum above
-        static wxString choices[] = { "forward", "backward", "both", "neither" };
+        //        static wxString choices[] = { "forward", "backward", "both", "neither" };
+        // The above syntax can cause an internal compiler error with gcc.
+        wxString choices[4];
+        choices[0] = "forward";
+        choices[1] = "backward";
+        choices[2] = "both";
+        choices[3] = "neither";
 
         m_radio = new wxRadioBox(this, -1, "Allow to proceed:",
                                  wxPoint(5, 5), wxDefaultSize,
diff --git a/samples/wizard/wiztest.def b/samples/wizard/wiztest.def
new file mode 100644 (file)
index 0000000..f843fd9
--- /dev/null
@@ -0,0 +1,7 @@
+NAME         Wiztest
+DESCRIPTION  'Wiztest wxWindows application'
+EXETYPE      WINDOWS
+CODE         PRELOAD MOVEABLE DISCARDABLE
+DATA         PRELOAD MOVEABLE MULTIPLE
+HEAPSIZE     4048
+STACKSIZE    16000
index 8f693926e5429ec3a85d7cd34a1b01a5f0a5a817..1f8003aff7ff218e988cb7be9e79bb1b78fdfa90 100644 (file)
@@ -2191,6 +2191,42 @@ bool wxTransferStreamToFile(istream& stream, const wxString& filename)
     fclose (fd1);
     return TRUE;
 }
+#else
+bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
+{
+    FILE *fd1;
+    int ch;
+
+    if ((fd1 = fopen (filename.fn_str(), "rb")) == NULL)
+        return FALSE;
+
+    while ((ch = getc (fd1)) != EOF)
+        stream.PutC((char) ch);
+
+    fclose (fd1);
+    return TRUE;
+}
+
+bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
+{
+    FILE *fd1;
+    char ch;
+
+    if ((fd1 = fopen (filename.fn_str(), "wb")) == NULL)
+    {
+        return FALSE;
+    }
+
+    int len = stream.StreamSize();
+    // TODO: is this the correct test for EOF?
+    while (stream.TellI() < (len - 1))
+    {
+        ch = stream.GetC();
+        putc (ch, fd1);
+    }
+    fclose (fd1);
+    return TRUE;
+}
 #endif
 
 #endif // wxUSE_DOC_VIEW_ARCHITECTURE
index d30fc10ee8b8e9b54e5539fbffc0d65fb48c78d0..a67263d476e9137ccadfb11ccd2104ee5f979b2e 100644 (file)
@@ -473,6 +473,11 @@ 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)
 {
 //  m_streamBuf = new wxDebugStreamBuf;
@@ -596,6 +601,9 @@ char * wxDebugContext::StartPos (const char * caller)
 
   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)
 {
@@ -603,11 +611,22 @@ size_t wxDebugContext::GetPadding (const size_t size)
     return (pad) ? sizeof(wxMarkerType) - pad : 0;
 }
 
-
-
 size_t wxDebugContext::PaddedSize (const size_t size)
 {
+    // Added by Terry Farnham <TJRT@pacbell.net> to replace
+    // slow GetPadding call.
+       int padb;
+
+       padb = size & m_balignmask;
+       if(padb)
+               return(size + m_balign - padb);
+       else
+               return(size);
+
+// Old (slow) code
+#if 0
     return size + GetPadding (size);
+#endif
 }
 
 /*
index 8c72dd103b4888350a1f63d924e772f5795aee70..84ad260e394188ffd668d290a7d9eb2e72ca2c2e 100644 (file)
@@ -342,10 +342,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
     wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
 }
 
-bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
+bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
 {
-    wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
-    return FALSE;
+    // Generic (and therefore rather inefficient) method.
+    // Could be improved.
+    wxMemoryDC memdc;
+    wxBitmap bitmap(1, 1);
+    memdc.SelectObject(bitmap);
+    memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
+    memdc.SelectObject(wxNullBitmap);
+    wxImage image(bitmap);
+    col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
+    return TRUE;
 }
 
 void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
index 8c72dd103b4888350a1f63d924e772f5795aee70..84ad260e394188ffd668d290a7d9eb2e72ca2c2e 100644 (file)
@@ -342,10 +342,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
     wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
 }
 
-bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
+bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
 {
-    wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
-    return FALSE;
+    // Generic (and therefore rather inefficient) method.
+    // Could be improved.
+    wxMemoryDC memdc;
+    wxBitmap bitmap(1, 1);
+    memdc.SelectObject(bitmap);
+    memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
+    memdc.SelectObject(wxNullBitmap);
+    wxImage image(bitmap);
+    col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
+    return TRUE;
 }
 
 void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
index 7c3616de5f19d613c33adf5d7b39e24c8cf030ae..4e186d55f0122459aeeae4ecbd725d297566179f 100644 (file)
@@ -222,7 +222,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, c
     HP_TagHandler *handler = new HP_TagHandler(book);
     parser.AddTagHandler(handler);
 
-    f = ( contentsfile.IsEmpty() ? NULL : fsys.OpenFile(contentsfile) );
+    f = ( contentsfile.IsEmpty() ? (wxFSFile*) NULL : fsys.OpenFile(contentsfile) );
     if (f) {
         sz = f -> GetStream() -> GetSize();
         buf = new char[sz + 1];
@@ -237,7 +237,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, c
     else
         wxLogError(_("Cannot open contents file: %s"), contentsfile.mb_str());
 
-    f = ( indexfile.IsEmpty() ? NULL : fsys.OpenFile(indexfile) );
+    f = ( indexfile.IsEmpty() ? (wxFSFile*) NULL : fsys.OpenFile(indexfile) );
     if (f) {
         sz = f -> GetStream() -> GetSize();
         buf = new char[sz + 1];
diff --git a/src/jpeg/makefile.wat b/src/jpeg/makefile.wat
new file mode 100644 (file)
index 0000000..d953e46
--- /dev/null
@@ -0,0 +1,233 @@
+# Makefile for Independent JPEG Group's software
+
+# This makefile is suitable for Watcom C/C++ 10.0 on MS-DOS (using
+# dos4g extender), OS/2, and Windows NT console mode.
+# Thanks to Janos Haide, jhaide@btrvtech.com.
+
+# Read installation instructions before saying "wmake" !!
+
+# Uncomment line for desired system
+SYSTEM=DOS
+#SYSTEM=OS2
+#SYSTEM=NT
+
+# The name of your C compiler:
+CC= wcl386
+
+# You may need to adjust these cc options:
+CFLAGS= -4r -ort -wx -zq -bt=$(SYSTEM)
+# Caution: avoid -ol or -ox; these generate bad code with 10.0 or 10.0a.
+# Generally, we recommend defining any configuration symbols in jconfig.h,
+# NOT via -D switches here.
+
+# Link-time cc options:
+!ifeq SYSTEM DOS
+LDFLAGS= -zq -l=dos4g
+!else ifeq SYSTEM OS2
+LDFLAGS= -zq -l=os2v2
+!else ifeq SYSTEM NT
+LDFLAGS= -zq -l=nt
+!endif
+
+# Put here the object file name for the correct system-dependent memory
+# manager file.  jmemnobs should work fine for dos4g or OS/2 environment.
+SYSDEPMEM= jmemnobs.obj
+
+# 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
+# compression library object files
+CLIBOBJECTS= 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= 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
+LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
+# object files for sample applications (excluding library files)
+COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj &
+        rdswitch.obj cdjpeg.obj
+DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj &
+        rdcolmap.obj cdjpeg.obj
+TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
+
+
+all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
+
+libjpeg.lib: $(LIBOBJECTS)
+       - del libjpeg.lib
+       * wlib -n libjpeg.lib $(LIBOBJECTS)
+
+cjpeg.exe: $(COBJECTS) libjpeg.lib
+       $(CC) $(LDFLAGS) $(COBJECTS) libjpeg.lib
+
+djpeg.exe: $(DOBJECTS) libjpeg.lib
+       $(CC) $(LDFLAGS) $(DOBJECTS) libjpeg.lib
+
+jpegtran.exe: $(TROBJECTS) libjpeg.lib
+       $(CC) $(LDFLAGS) $(TROBJECTS) libjpeg.lib
+
+rdjpgcom.exe: rdjpgcom.c
+       $(CC) $(CFLAGS) $(LDFLAGS) rdjpgcom.c
+
+wrjpgcom.exe: wrjpgcom.c
+       $(CC) $(CFLAGS) $(LDFLAGS) wrjpgcom.c
+
+.c.obj:
+       $(CC) $(CFLAGS) -c $<
+
+jconfig.h: jconfig.doc
+       echo You must prepare a system-dependent jconfig.h file.
+       echo Please read the installation directions in install.doc.
+       exit 1
+
+clean: .SYMBOLIC
+       - del *.obj
+       - del libjpeg.lib
+       - del cjpeg.exe
+       - del djpeg.exe
+       - del jpegtran.exe
+       - del rdjpgcom.exe
+       - del wrjpgcom.exe
+       - del testout*.*
+
+test: cjpeg.exe djpeg.exe jpegtran.exe  .SYMBOLIC
+       - del testout*.*
+       djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
+       djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
+       cjpeg -dct int -outfile testout.jpg  testimg.ppm
+       djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
+       cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
+       jpegtran -outfile testoutt.jpg testprog.jpg
+!ifeq SYSTEM DOS
+       fc /b testimg.ppm testout.ppm
+       fc /b testimg.bmp testout.bmp
+       fc /b testimg.jpg testout.jpg
+       fc /b testimg.ppm testoutp.ppm
+       fc /b testimgp.jpg testoutp.jpg
+       fc /b testorig.jpg testoutt.jpg
+!else
+       echo n > n.tmp
+       comp testimg.ppm testout.ppm < n.tmp
+       comp testimg.bmp testout.bmp < n.tmp
+       comp testimg.jpg testout.jpg < n.tmp
+       comp testimg.ppm testoutp.ppm < n.tmp
+       comp testimgp.jpg testoutp.jpg < n.tmp
+       comp testorig.jpg testoutt.jpg < n.tmp
+       del n.tmp
+!endif
+
+
+jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
+jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcphuff.obj: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
+jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
+jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
+jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
+jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdphuff.obj: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
+jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
+jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jidctred.obj: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
+jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
+jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
+cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
+djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
+jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
+rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
+wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
+cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
+rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
+wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
index 53b01e0f35c5158c8ec43afb52b7d55a2b55856a..67a241c4e45639acdd62ce5a684c9584dce2faf8 100644 (file)
@@ -349,7 +349,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
 
     if (event->type == KeyPress)
     {
-#ifdef __WXDEBUG__
+#if 0 // def __WXDEBUG__
         Widget widget = XtWindowToWidget(event->xany.display, event->xany.window);
         wxLogDebug("Got key press event for 0x%08x (parent = 0x%08x)",
                    widget, XtParent(widget));
index ac259ac03a9c37119db56b598f02ab3ca839cbe6..32b1413b6a204826d7fffc1f5412d45b5c5b8aee 100644 (file)
@@ -60,8 +60,9 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     char* label1 = (label.IsNull() ? "" : (char*) (const char*) label);
     XmString text = XmStringCreateSimple (label1);
 #endif
+    wxString label1(wxStripMenuCodes(label));
 
-    wxXmString text( label );
+    wxXmString text( label1 );
     
     Widget parentWidget = (Widget) parent->GetClientWidget();
     XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget));
index aa4970ddef22ca0047b9d715959595fba7a30434..8c423913263f28246b286b0e065fa3e1cb3a3c34 100644 (file)
@@ -235,11 +235,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1),
     wxFAIL_MSG("not implemented");
 }
 
-bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
+bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
 {
-    wxFAIL_MSG("not implemented");
-
-    return FALSE;
+    // Generic (and therefore rather inefficient) method.
+    // Could be improved.
+    wxMemoryDC memdc;
+    wxBitmap bitmap(1, 1);
+    memdc.SelectObject(bitmap);
+    memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
+    memdc.SelectObject(wxNullBitmap);
+    wxImage image(bitmap);
+    col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
+    return TRUE;
 }
 
 void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
@@ -1266,7 +1273,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
                 // draw black pixels, ignore white ones (i.e. transparent b/g)
                 if (image.GetRed(sx, sy) == 0)
                 {
-                    DrawPoint(x1 + maxx - rx, cy + y1 - ry);
+                    DrawPoint((wxCoord) (x1 + maxx - rx), (wxCoord) (cy + y1 - ry));
                 }
                 else
                 {
index 3e4095b159068d495122b97ff81eca8fcd1de8d9..fac74a74a7a64a45068afae5398353505ad06218 100644 (file)
 // private functions
 // ----------------------------------------------------------------------------
 
+static void wxFrameEventHandler(Widget    wid,
+                             XtPointer WXUNUSED(client_data),
+                             XEvent*   event,
+                             Boolean*  continueToDispatch);
 static void wxCloseFrameCallback(Widget, XtPointer, XmAnyCallbackStruct *cbs);
 static void wxFrameFocusProc(Widget workArea, XtPointer clientData,
                             XmAnyCallbackStruct *cbs);
@@ -235,6 +239,12 @@ bool wxFrame::Create(wxWindow *parent,
     XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE,
         wxUniversalRepaintProc, (XtPointer) this);
 
+    XtAddEventHandler((Widget) m_clientArea,
+        ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask,
+        FALSE,
+        wxFrameEventHandler,
+        (XtPointer)this);
+
     XtVaSetValues((Widget) m_frameWidget,
         XmNworkWindow, (Widget) m_workArea,
         NULL);
@@ -243,6 +253,7 @@ bool wxFrame::Create(wxWindow *parent,
     XtManageChild((Widget) m_workArea);
 
     wxAddWindowToTable((Widget) m_workArea, this);
+    wxAddWindowToTable((Widget) m_clientArea, this);
 
     XtTranslations ptr;
 
@@ -332,8 +343,14 @@ wxFrame::~wxFrame()
     m_isBeingDeleted = TRUE;
 
     if (m_clientArea)
+    {
       XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, FALSE,
           wxUniversalRepaintProc, (XtPointer) this);
+      XtRemoveEventHandler((Widget) m_clientArea, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask,
+          FALSE,
+          wxFrameEventHandler, (XtPointer) this);
+      wxDeleteWindowFromTable((Widget) m_clientArea);
+    }
 
     if (GetMainWidget())
         Show(FALSE);
@@ -854,3 +871,54 @@ void wxCloseFrameCallback(Widget WXUNUSED(widget), XtPointer client_data, XmAnyC
     frame->GetEventHandler()->ProcessEvent(closeEvent);
 }
 
+static void wxFrameEventHandler(Widget    wid,
+                             XtPointer WXUNUSED(client_data),
+                             XEvent*   event,
+                             Boolean*  continueToDispatch)
+{
+    wxFrame *frame = (wxFrame *)wxGetWindowFromTable(wid);
+    if (frame)
+    {
+        wxMouseEvent wxevent(wxEVT_NULL);
+        if (wxTranslateMouseEvent(wxevent, frame, wid, event))
+        {
+            wxevent.SetEventObject(frame);
+            wxevent.SetId(frame->GetId());
+            frame->GetEventHandler()->ProcessEvent(wxevent);
+        }
+        else
+        {
+            // An attempt to implement OnCharHook by calling OnCharHook first;
+            // if this returns TRUE, set continueToDispatch to False
+            // (don't continue processing).
+            // Otherwise set it to True and call OnChar.
+            wxKeyEvent keyEvent(wxEVT_CHAR);
+            if (wxTranslateKeyEvent(keyEvent, frame, wid, event))
+            {
+                keyEvent.SetEventObject(frame);
+                keyEvent.SetId(frame->GetId());
+                keyEvent.SetEventType(wxEVT_CHAR_HOOK);
+                if (frame->GetEventHandler()->ProcessEvent(keyEvent))
+                {
+                    *continueToDispatch = False;
+                    return;
+                }
+                else
+                {
+                    // For simplicity, OnKeyDown is the same as OnChar
+                    // TODO: filter modifier key presses from OnChar
+                    keyEvent.SetEventType(wxEVT_KEY_DOWN);
+
+                    // Only process OnChar if OnKeyDown didn't swallow it
+                    if (!frame->GetEventHandler()->ProcessEvent (keyEvent))
+                    {
+                        keyEvent.SetEventType(wxEVT_CHAR);
+                        frame->GetEventHandler()->ProcessEvent(keyEvent);
+                    }
+                }
+            }
+        }
+    }
+    *continueToDispatch = True;
+}
+
index 9d8c27fd0030838097ea83740b8a6a27b589967c..3d35638883dc897a87809c70093988a292661f2e 100644 (file)
@@ -74,7 +74,13 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
     ChangeFont(FALSE);
 
     SetCanAddEventHandler(TRUE);
-    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
+
+    wxSize actualSize(size);
+    if (actualSize.x == -1)
+      actualSize.x = bitmap.GetWidth();
+    if (actualSize.y == -1)
+      actualSize.y = bitmap.GetHeight();
+    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, actualSize.x, actualSize.y);
 
     ChangeBackgroundColour ();
 
index 11d5f1aab8f05681fafbc16a2745a7494148df43..354c617418ff9d75cc5c0cbc288e050df19d43cb 100644 (file)
@@ -318,12 +318,15 @@ bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
     // get the color of the pixel
     COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y));
 
+    // JACS: what was this for?
+#if 0
     // get the color of the pen
     COLORREF pencolor = 0x00ffffff;
     if (m_pen.Ok())
     {
         pencolor = m_pen.GetColour().GetPixel();
     }
+#endif
 
     // return the color of the pixel
     if( col )
@@ -335,7 +338,10 @@ bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
 
     // check, if color of the pixels is the same as the color of the current
     // pen and return TRUE if it is, FALSE otherwise
-    return pixelcolor == pencolor;
+    // JACS, 24/02/2000: can't understand the reason for this, so returning TRUE instead.
+    // return pixelcolor == pencolor;
+
+    return TRUE;
 }
 
 void wxDC::DoCrossHair(wxCoord x, wxCoord y)
index 2b48e8478a8587d97f810faddb4af9717cf49f91..f1e4059dadf9acddee178437a8dde0d894857f9a 100644 (file)
 #
 
 CC = gcc
+WXCONFIG=../../../../wx-config
+WXINCLUDE=-I../../../../include
+WXLIB=-L../../../../lib
 
 cube: cube.o glcanvas.o
-       $(CC) -o cube cube.o glcanvas.o `wx-config --libs` -lMesaGL -lMesaGLU
+       $(CC) -o cube cube.o glcanvas.o `$(WXCONFIG) --libs` $(WXLIB) -lMesaGL -lMesaGLU
 
 cube.o: cube.cpp
-       $(CC) `wx-config --cflags` -I../../gtk -c cube.cpp
+       $(CC) `$(WXCONFIG) --cflags` -I../../gtk $(WXINCLUDE) -c cube.cpp
 
 glcanvas.o: ../../gtk/glcanvas.cpp
-       $(CC) `wx-config --cflags` `gtk-config --cflags` -I../../gtk -c ../../gtk/glcanvas.cpp
+       $(CC) `$(WXCONFIG) --cflags` `gtk-config --cflags` -I../../gtk $(WXINCLUDE) -c ../../gtk/glcanvas.cpp
 
 clean: 
        rm -f *.o cube
+
index ca096666db8bb2387d5e62915fe1bb9906090300..97ba2a59b1774edf37c831e24ad732f278b4005f 100644 (file)
 #
 
 CC = g++
+WXCONFIG=../../../../wx-config
+WXINCLUDE=-I../../../../include
+WXLIB=-L../../../../lib
 
 isosurf: isosurf.o glcanvas.o
        $(CC) -o isosurf \
        isosurf.o glcanvas.o \
-       `wx-config --libs` -lMesaGL -lMesaGLU
+       `$(WXCONFIG) --libs` $(WXLIB) -lMesaGL -lMesaGLU
 
 isosurf.o: isosurf.cpp
-       $(CC) `wx-config --cflags` -I../../gtk -c isosurf.cpp
+       $(CC) `$(WXCONFIG) --cflags` -I../../gtk $(WXINCLUDE) -c isosurf.cpp
 
 glcanvas.o: ../../gtk/glcanvas.cpp
-       $(CC) `wx-config --cflags` `gtk-config --cflags` -I../../gtk -c ../../gtk/glcanvas.cpp
+       $(CC) `$(WXCONFIG) --cflags` `gtk-config --cflags` -I../../gtk -c $(WXINCLUDE) ../../gtk/glcanvas.cpp
 
 clean: 
        rm -f *.o isosurf
index 340df1537f0df5b61f3d46cc25c8ceaed8dab6ad..437f7bc1bb1ea32230fee4f1064d26713ab4c03f 100644 (file)
 
 CPP = gcc
 CC = gcc
+WXCONFIG=../../../../wx-config
+WXINCLUDE=-I../../../../include
+WXLIB=-L../../../../lib
 
 Penguin: penguin.o trackball.o lw.o glcanvas.o
-       $(CPP) -o Penguin penguin.o trackball.o lw.o glcanvas.o `wx-config --libs` -lMesaGL -lMesaGLU
+       $(CPP) -o Penguin penguin.o trackball.o lw.o glcanvas.o `$(WXCONFIG) --libs` $(WXLIB) -lMesaGL -lMesaGLU
 
 penguin.o: penguin.cpp
-       $(CPP) `wx-config --cflags` -I../../gtk -c penguin.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../gtk $(WXINCLUDE) -c penguin.cpp
 
 lw.o: lw.cpp
-       $(CPP) `wx-config --cflags` -I../../gtk -c lw.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../gtk $(WXINCLUDE) -c lw.cpp
 
 trackball.o: trackball.c
-       $(CC) `wx-config --cflags` -I../../gtk -c trackball.c
+       $(CC) `$(WXCONFIG) --cflags` -I../../gtk $(WXINCLUDE) -c trackball.c
 
 glcanvas.o: ../../gtk/glcanvas.cpp
-       $(CPP) `wx-config --cflags` `gtk-config --cflags` -g -I../../gtk -c ../../gtk/glcanvas.cpp
+       $(CPP) `$(WXCONFIG) --cflags` `gtk-config --cflags` -g -I../../gtk $(WXINCLUDE) -c ../../gtk/glcanvas.cpp
 
 clean: 
        rm -f *.o Penguin
diff --git a/utils/ogl/samples/ogledit/Makefile b/utils/ogl/samples/ogledit/Makefile
new file mode 100644 (file)
index 0000000..1ed2886
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# File:                Makefile
+# Author:      Julian Smart
+# Created:     1999
+# Updated:     
+# Copyright:   (c) 2000 Julian Smart
+#
+# Makefile for OGL demo (GTK version)
+#
+# This makefile requires wxWindows/GTK to be 
+# installed (possibly using "make install")
+# on your system.
+#
+
+CPP = gcc
+CC = gcc
+WXCONFIG=../../../../wx-config
+WXINCLUDE=-I../../../../include
+WXLIB=-L../../../../lib
+
+OBJECTS=ogledit.o palette.o doc.o view.o
+
+ogledit: $(OBJECTS)
+       $(CPP) -o ogledit $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
+
+ogledit.o: ogledit.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c ogledit.cpp
+
+palette.o: palette.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c palette.cpp
+
+doc.o: doc.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
+
+view.o: view.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
+
+clean: 
+       rm -f *.o ogledit
index 5e11ad2d05dc4dd6876402382c36b452b4aa5523..b5f2ef9e892ad425f53bb51f895b57f29ee7a8f8 100644 (file)
 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
+#include <wx/wxexpr.h>
 #include "ogledit.h"
 #include "doc.h"
-#include <wx/wxexpr.h>
 #include "view.h"
 
+#if wxUSE_STD_IOSTREAM
+#include <iostream.h>
+#endif
+
 IMPLEMENT_DYNAMIC_CLASS(DiagramDocument, wxDocument)
 
 DiagramDocument::DiagramDocument(void)
@@ -49,6 +53,7 @@ bool DiagramDocument::OnCloseDocument(void)
   return TRUE;
 }
 
+#if wxUSE_STD_IOSTREAM
 ostream& DiagramDocument::SaveObject(ostream& stream)
 {
   wxDocument::SaveObject(stream);
@@ -79,6 +84,42 @@ istream& DiagramDocument::LoadObject(istream& stream)
 
   return stream;
 }
+#else
+
+wxOutputStream& DiagramDocument::SaveObject(wxOutputStream& stream)
+{
+  wxDocument::SaveObject(stream);
+  char buf[400];
+  (void) wxGetTempFileName("diag", buf);
+
+  diagram.SaveFile(buf);
+
+  wxTransferFileToStream(buf, stream);
+
+  wxRemoveFile(buf);
+  
+
+  return stream;
+}
+
+wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
+{
+  wxDocument::LoadObject(stream);
+
+
+  char buf[400];
+  (void) wxGetTempFileName("diag", buf);
+
+  wxTransferStreamToFile(stream, buf);
+
+  diagram.DeleteAllShapes();
+  diagram.LoadFile(buf);
+  wxRemoveFile(buf);
+
+  return stream;
+}
+
+#endif
 
 /*
  * Implementation of drawing command
index 968fad13ac5f0db09deb8300263549c01eeac4bf..a16ec0bf72bde4868955408b78826cbf96e0e9cf 100644 (file)
 
 #include "ogl.h"
 
+#if wxUSE_STD_IOSTREAM
+class ostream;
+class istream;
+#endif
+
 /*
  * Override a few members for this application
  */
@@ -92,8 +97,13 @@ class DiagramDocument: public wxDocument
   DiagramDocument(void);
   ~DiagramDocument(void);
 
-  ostream& SaveObject(ostream& stream);
-  istream& LoadObject(istream& stream);
+#if wxUSE_STD_IOSTREAM
+    virtual ostream& SaveObject(ostream& stream);
+    virtual istream& LoadObject(istream& stream);
+#else
+    virtual wxOutputStream& SaveObject(wxOutputStream& stream);
+    virtual wxInputStream& LoadObject(wxInputStream& stream);
+#endif
   
   inline wxDiagram *GetDiagram() { return &diagram; }
   
diff --git a/utils/ogl/samples/studio/Makefile b/utils/ogl/samples/studio/Makefile
new file mode 100644 (file)
index 0000000..a576d54
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# File:                Makefile
+# Author:      Julian Smart
+# Created:     1999
+# Updated:     
+# Copyright:   (c) 2000 Julian Smart
+#
+# Makefile for OGL demo (GTK version)
+#
+# This makefile requires wxWindows/GTK to be 
+# installed (possibly using "make install")
+# on your system.
+#
+
+CPP = gcc
+CC = gcc
+WXCONFIG=../../../../wx-config
+WXINCLUDE=-I../../../../include
+WXLIB=-L../../../../lib
+
+OBJECTS=studio.o cspalette.o csprint.o dialogs.o doc.o mainfrm.o project.o shapes.o symbols.o view.o
+
+studio: $(OBJECTS)
+       $(CPP) -o studio $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
+
+studio.o: studio.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c studio.cpp
+
+cspalette.o: cspalette.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c cspalette.cpp
+
+doc.o: doc.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
+
+view.o: view.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
+
+dialogs.o: dialogs.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c dialogs.cpp
+
+mainfrm.o: mainfrm.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c mainfrm.cpp
+
+project.o: project.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c project.cpp
+
+shapes.o: shapes.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c shapes.cpp
+
+symbols.o: symbols.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c symbols.cpp
+
+csprint.o: csprint.cpp
+       $(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c csprint.cpp
+
+clean: 
+       rm -f *.o studio
index 52ee3a0a590427c914680be048f4d7c5d99c7103..6a422c0702c3928d3d9c4c0c109850f10cc09954 100644 (file)
@@ -189,9 +189,9 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol)
     double centreX = (double)((objectBitmapSize/scaleFactor)/2.0)-1;
     double centreY = centreX;
 
+    memDC.SelectObject(*newBitmap);
     memDC.SetUserScale(scaleFactor, scaleFactor);
 
-    memDC.SelectObject(*newBitmap);
     memDC.SetBackground(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), wxSOLID));
     memDC.Clear();
     symbol->GetShape()->Show(TRUE);