]> git.saurik.com Git - wxWidgets.git/commitdiff
Chianti, Pinot noir, WINE..
authorRobert Roebling <robert@roebling.de>
Tue, 8 Jun 1999 20:56:50 +0000 (20:56 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 8 Jun 1999 20:56:50 +0000 (20:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
acconfig.h
include/wx/msw/private.h
include/wx/msw/winundef.h
src/common/cmndata.cpp
src/common/filefn.cpp
src/msw/Makefile.am
src/msw/app.cpp
src/msw/dcclient.cpp
src/msw/dcprint.cpp
src/msw/dib.cpp
src/msw/dibutils.cpp
src/msw/window.cpp

index dab575373574dfced3ff698c8fa2267043e86ba7..6615dd3cc85213a805cfc5a4fb1a0f2af051e669 100644 (file)
 /* wxWindows version (not used but required by autoheader)                  */
 /* ------------------------------------------------------------------------ */
 
+#if 0
 #undef PACKAGE
 #undef VERSION
+#endif
 
 /* needed for older automake? */
 #undef WITH_SYMBOL_UNDERSCORE
index 2171b17c59c555eb33eac7351b27fbfc3870fcc6..ff8642533c7efb5b32d9aa840996575565016308 100644 (file)
@@ -50,10 +50,24 @@ WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
 WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
 WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
 
+// ---------------------------------------------------------------------------
+// WINE implements the Win32 API
+// ---------------------------------------------------------------------------
+
+#ifdef __WXWINE__
+  #ifndef __WIN32__
+    #define __WIN32__
+  #endif
+  #ifndef STRICT
+    #define STRICT
+  #endif
+#endif
+
 // ---------------------------------------------------------------------------
 // this defines a CASTWNDPROC macro which casts a pointer to the type of a
 // window proc
 // ---------------------------------------------------------------------------
+
 #if defined(__GNUWIN32__) && !defined(__MINGW32__)
 #  define CASTWNDPROC (long unsigned)
 #else
index 25bcb7d67ed6a1dba616b5a9dca4becf384b5440..4a56ddeb498bc24f5bf24f78a6e412ea94662b33 100644 (file)
    }
 #endif
 
+// For WINE
+
+#if defined(GetWindowStyle) || defined(__WXWINE__)
+  #undef GetWindowStyle
+#endif
 
 // For ming and cygwin
 
index f88c5157fddd194af5cca6e8c18a710f80215ab9..4b9261c7db57ee202590392b5e681c8d89ba7ad1 100644 (file)
         #include <commdlg.h>
     #endif // Win16
 
+    #ifdef __WXWINE__
+        #include <cderr.h>
+        #include <commdlg.h>
+    #endif
+
     #if defined(__WATCOMC__) || defined(__SC__) || defined(__SALFORDC__)
         #include <windowsx.h>
         #include <commdlg.h>
@@ -319,7 +324,9 @@ void wxPrintData::ConvertToNative()
 
         //// Orientation
 
+#ifndef __WXWINE__
         devMode->dmOrientation = m_printOrientation;
+#endif
         devMode->dmFields = DM_ORIENTATION;
 
         //// Collation
@@ -353,6 +360,7 @@ void wxPrintData::ConvertToNative()
 
         devMode->dmFields |= DM_COLOR;
 
+#ifndef __WXWINE__
         //// Paper size
 
         if (m_paperId == wxPAPER_NONE)
@@ -374,6 +382,7 @@ void wxPrintData::ConvertToNative()
                 }
             }
         }
+#endif
 
         //// Duplex
 
@@ -433,10 +442,12 @@ void wxPrintData::ConvertFromNative()
     {
         DEVMODE *devMode = (DEVMODE*) GlobalLock(hDevMode);
 
+#ifndef __WXWINE__
         //// Orientation
 
         if (devMode->dmFields & DM_ORIENTATION)
             m_printOrientation = devMode->dmOrientation;
+#endif
 
         //// Collation
 
@@ -484,6 +495,7 @@ void wxPrintData::ConvertFromNative()
         else
             m_colour = TRUE;
 
+#ifndef __WXWINE__
         //// Paper size
 
         if (devMode->dmFields & DM_PAPERSIZE)
@@ -532,7 +544,7 @@ void wxPrintData::ConvertFromNative()
             m_paperSize.y = 0;
             m_paperId = wxPAPER_NONE;
         }
-
+#endif
 
         //// Duplex
 
index 51d2877c20e299c75a858ce6bf62c58ae31dd66c..33b30d58327dacf4c3a32a6be12b98c9fc01b1fb 100644 (file)
@@ -994,7 +994,7 @@ bool wxMkdir(const wxString& dir, int perm)
 
     // assume mkdir() has 2 args on non Windows platforms and on Windows too
     // for the GNU compiler
-#if !defined(__WXMSW__) || (defined(__GNUWIN32__) && !defined(__MINGW32__))
+#if !defined(__WXMSW__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__)
     if ( mkdir(wxFNCONV(dirname), perm) != 0 )
 #else  // MSW
     if ( mkdir(wxFNCONV(dirname)) != 0 )
index fc8220380fd5f4619aad58b761420c395f22985a..e072cbabb4bf8cd9b9f2467a221fd97e414bcb8c 100644 (file)
@@ -22,10 +22,86 @@ libwx_msw_la_SOURCES = \
  extended.c \
  parser.c \
 \
+ cmndata.cpp \
+ dynarray.cpp \
+ filefn.cpp \
+ hash.cpp \
  list.cpp \
+ matrix.cpp \
+ memory.cpp \
+ module.cpp \
  object.cpp \
+ string.cpp \
+ timercmn.cpp \
+ utilscmn.cpp \
+ tokenzr.cpp \
+ variant.cpp \
+ wxchar.cpp \
 \
  wincmn.cpp \
+\
+ accel.cpp \
+ app.cpp \
+ bitmap.cpp \
+ bmpbuttn.cpp \
+ brush.cpp \
+ button.cpp \
+ caret.cpp \
+ checkbox.cpp \
+ checklst.cpp \
+ choice.cpp \
+ clipbrd.cpp \
+ colour.cpp \
+ combobox.cpp \
+ control.cpp \
+ cursor.cpp \
+ data.cpp \
+ dc.cpp \
+ dcclient.cpp \
+ dcmemory.cpp \
+ dcscreen.cpp \
+ dcprint.cpp \
+ dialog.cpp \
+ dirdlg \
+ filedlg.cpp \
+ font.cpp \
+ frame.cpp \
+ gaugemsw.cpp \
+ gdiobj.cpp \
+ icon.cpp \
+ imaglist.cpp \
+ listbox.cpp \
+ listctrlc.cpp \
+ main.cpp \
+ mdi.cpp \
+ menu.cpp \
+ menuitem.cpp \
+ minifram.cpp \
+ notebook.cpp \
+ ownerdrw.cpp \
+ palette.cpp \
+ pen.cpp \
+ radiobox.cpp \
+ radiobut.cpp \
+ regconf.cpp \
+ region.cpp \
+ registry.cpp \
+ scrolbar.cpp \
+ settings.cpp \
+ slidermsw.cpp \
+ spinbutt.cpp \
+ statbmp.cpp \
+ statbox.cpp \
+ stattext.cpp \
+ tbarmsw.cpp \
+ textctrl.cpp \
+ thread.cpp \
+ timer.cpp \
+ tooltip.cpp \
+ treectrl.cpp \
+ utils.cpp \
+ utilsexc.cpp \
+ wave.cpp \
  window.cpp
 
 # these are the sources which we build by our own rules
index dc629191c1c27c263c8b2eeba29d7bdcd82fd066..6305cb017f97bb23b10986a000e36215dd7a63d5 100644 (file)
@@ -1117,7 +1117,11 @@ bool wxYield()
     MSG msg;
     // We want to go back to the main message loop
     // if we see a WM_QUIT. (?)
+#ifdef __WXWINE__
+    while (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_NOREMOVE) && msg.message != WM_QUIT)
+#else
     while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) && msg.message != WM_QUIT)
+#endif
     {
         if ( !wxTheApp->DoMessage() )
             break;
index 763e70bb579677cd1737db2a7564bda1efbe3dda..e29e8b472fb0cbe85948fd7ad1792d528bd5f9e6 100644 (file)
@@ -143,8 +143,10 @@ wxPaintDC::wxPaintDC()
 wxPaintDC::wxPaintDC(wxWindow *canvas)
 {
   wxCHECK_RET( canvas, "NULL canvas in wxPaintDC ctor" );
-  wxCHECK_RET( g_isPainting,
-               _T("wxPaintDC may be created only in EVT_PAINT handler!") );
+  
+#ifdef __WXDEBUG__
+  wxCHECK_RET( g_isPainting, _T("wxPaintDC may be created only in EVT_PAINT handler!") );
+#endif
 
   m_canvas = canvas;
 
index 55eac864f758522f44d86ac500c7061122ed3eba..0f402ccffbceef56bdb2e660e092b253425c011c 100644 (file)
@@ -30,7 +30,7 @@
 #include "wx/dcprint.h"
 #include "math.h"
 
-#if wxUSE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS || defined(__WXWINE__)
 #include <commdlg.h>
 #endif
 
index 871197195c20f92fb0f3949752378b94f9b29f76..73c68707c884eb997072fe21382eba6473045ecd 100644 (file)
@@ -357,7 +357,7 @@ HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal)
 DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
 {
        DWORD     ulT = ul;
-#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__)
+#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
        BYTE *hp = (BYTE *) pv;
 #else
        BYTE huge *hp = (BYTE huge *) pv;
@@ -387,7 +387,7 @@ DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
 DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul)
 {
        DWORD     ulT = ul;
-#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__)
+#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
        BYTE *hp = (BYTE *) pv;
 #else
        BYTE huge *hp = (BYTE huge *) pv;
@@ -642,6 +642,9 @@ BOOL PASCAL MakeBitmapAndPalette(HDC hDC, HANDLE hDIB,
  ****************************************************************************/
 HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
 {
+#ifdef __WXWINE__
+        return (FALSE);
+#else
     NPLOGPALETTE npPal;
     RGBQUAD far *lpRGB;
     HPALETTE hLogPal;
@@ -658,7 +661,6 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
 */
        npPal = (NPLOGPALETTE)malloc(sizeof(LOGPALETTE) +
                                (WORD)lpInfo->biClrUsed * sizeof(PALETTEENTRY));
-
         if (!npPal)
            return(FALSE);
 
@@ -690,6 +692,8 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
     */
     else
        return((HPALETTE) GetStockObject(DEFAULT_PALETTE));
+#endif
+
 }
 
 bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxPalette **pal)
index 10a61b9249bf8b2e89688567c38447fcbca6bdae..3acbd1fbea7e6f81cff5ea517f3af541e92e788c 100644 (file)
 
 #include "wx/msw/dibutils.h"
 
+#ifdef __WXWINE__
+  #include <module.h>
+#endif
+
 #if defined(__WIN32__)
 #if !defined(__MWERKS__) && !defined(__SALFORDC__)
     #include <memory.h>             // for _fmemcpy()
@@ -78,7 +82,7 @@ void ClearSystemPalette(void)
   BOOL bOK = FALSE;
   int  nOK = 0;
   
-  //*** Reset everything in the system palette to black
+  // *** Reset everything in the system palette to black
   for(Counter = 0; Counter < 256; Counter++)
   {
     Palette.aEntries[Counter].peRed = 0;
@@ -87,8 +91,12 @@ void ClearSystemPalette(void)
     Palette.aEntries[Counter].peFlags = PC_NOCOLLAPSE;
   }
 
-  //*** Create, select, realize, deselect, and delete the palette
+  // *** Create, select, realize, deselect, and delete the palette
+#ifdef __WXWINE__
+  ScreenDC = GetDC((HWND)NULL);
+#else
   ScreenDC = GetDC(NULL);
+#endif
   ScreenPalette = CreatePalette((LOGPALETTE *)&Palette);
 
   if (ScreenPalette)
@@ -99,7 +107,11 @@ void ClearSystemPalette(void)
     bOK = DeleteObject(ScreenPalette);
   }
 
+#ifdef __WXWINE__
+  nOK = ReleaseDC((HWND)NULL, ScreenDC);
+#else
   nOK = ReleaseDC(NULL, ScreenDC);
+#endif
 
   return;
 }
index 7d1f20164780cfb5d8045cfed8500c2fd70e153d..8da3bb78c9696fe8ff61c6f46313cbb33e3b39d4 100644 (file)
@@ -903,7 +903,7 @@ WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D)
     return exStyle;
 }
 
-#if WXWIN_COMPATIBILITY_2
+#if WXWIN_COMPATIBILITY
 // If nothing defined for this, try the parent.
 // E.g. we may be a button loaded from a resource, with no callback function
 // defined.
@@ -1309,7 +1309,7 @@ void wxWindow::GetTextExtent(const wxString& string,
     if ( externalLeading ) *externalLeading = tm.tmExternalLeading;
 }
 
-#if wxUSE_CARET
+#if wxUSE_CARET && WXWIN_COMPATIBILITY
 // ---------------------------------------------------------------------------
 // Caret manipulation
 // ---------------------------------------------------------------------------
@@ -2087,7 +2087,11 @@ bool wxWindow::MSWCreate(int id,
     if ( width > -1 ) width1 = width;
     if ( height > -1 ) height1 = height;
 
+#ifdef __WXWINE__
+    HWND hParent = (HWND)NULL;
+#else
     HWND hParent = NULL;
+#endif
     if ( parent )
         hParent = (HWND) parent->GetHWND();