From 5ea105e0ba20c15e4d83f829e1c4faeb0a4952f0 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 9 Jun 1999 00:32:07 +0000 Subject: [PATCH] WINE is so fine. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 14 +++++++- include/wx/msw/private.h | 13 ------- include/wx/msw/textctrl.h | 2 +- src/common/file.cpp | 2 +- src/generic/prop.cpp | 2 +- src/generic/propform.cpp | 2 +- src/generic/proplist.cpp | 2 +- src/msw/Makefile.am | 76 +++++++++++++++++++++++++++++++++++---- src/msw/accel.cpp | 2 +- src/msw/cursor.cpp | 4 +++ src/msw/filedlg.cpp | 2 +- src/msw/listbox.cpp | 37 +++++++++++++++++-- src/msw/listctrl.cpp | 4 +++ src/msw/palette.cpp | 8 +++++ src/msw/textctrl.cpp | 4 +++ src/msw/utils.cpp | 4 +-- src/msw/utilsexc.cpp | 4 +-- 17 files changed, 149 insertions(+), 33 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 0f823ffd11..2df71e010d 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -124,6 +124,18 @@ #define __WIN32__ #endif +#ifdef __WXWINE__ + #ifndef __WIN32__ + #define __WIN32__ + #endif + #ifndef __WIN95__ + #define __WIN95__ + #endif + #ifndef STRICT + #define STRICT + #endif +#endif + #ifndef __WIN32__ #define __WIN16__ #endif @@ -1286,7 +1298,7 @@ typedef void * WXDRAWITEMSTRUCT; typedef void * WXMEASUREITEMSTRUCT; typedef void * WXLPCREATESTRUCT; -#ifdef __GNUWIN32__ +#if defined(__GNUWIN32__) || defined(__WXWINE__) typedef int (*WXFARPROC)(); #elif defined(__WIN32__) typedef int (__stdcall *WXFARPROC)(); diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index ff8642533c..7e46709d65 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -50,19 +50,6 @@ 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 diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 2ca8490c14..46f240ad91 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -25,7 +25,7 @@ #include #endif -#if defined(__WIN95__) && !defined(__TWIN32__) +#if defined(__WIN95__) && !defined(__TWIN32__) && !defined(__WXWINE__) #define wxUSE_RICHEDIT 1 #else #define wxUSE_RICHEDIT 0 diff --git a/src/common/file.cpp b/src/common/file.cpp index 3cd684587a..9c207aacf2 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -27,7 +27,7 @@ #endif // standard -#if defined(__WXMSW__) && !defined(__GNUWIN32__) +#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXWINE__) #include #ifndef __SALFORDC__ diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index 058a0d5026..6fa86ca2b1 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -30,7 +30,7 @@ #include #if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) +#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXWINE__) #include #else #include diff --git a/src/generic/propform.cpp b/src/generic/propform.cpp index 2a115e5c57..bda34bb83a 100644 --- a/src/generic/propform.cpp +++ b/src/generic/propform.cpp @@ -30,7 +30,7 @@ #include #if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) +#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXWINE__) #include #else #include diff --git a/src/generic/proplist.cpp b/src/generic/proplist.cpp index 6d0d1c2b68..c571468482 100644 --- a/src/generic/proplist.cpp +++ b/src/generic/proplist.cpp @@ -30,7 +30,7 @@ #include #if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) +#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXWINE__) #include #else #include diff --git a/src/msw/Makefile.am b/src/msw/Makefile.am index e072cbabb4..e8295c02f7 100644 --- a/src/msw/Makefile.am +++ b/src/msw/Makefile.am @@ -38,7 +38,73 @@ libwx_msw_la_SOURCES = \ variant.cpp \ wxchar.cpp \ \ + config.cpp \ + date.cpp \ + datstrm.cpp \ + dcbase.cpp \ + docmdi.cpp \ + docview.cpp \ + dynlib.cpp \ + event.cpp \ + file.cpp \ + fileconf.cpp \ + framecmn.cpp \ + ftp.cpp \ + gdicmn.cpp \ + helpbase.cpp \ + http.cpp \ + image.cpp \ + imaggif.cpp \ + imagjpeg.cpp \ + imagpng.cpp \ + intl.cpp \ + ipcbase.cpp \ + layout.cpp \ + log.cpp \ + longlong.cpp \ + mimetype.cpp \ + mstream.cpp \ + objstrm.cpp \ + paper.cpp \ + prntbase.cpp \ + process.cpp \ + protocol.cpp \ + resource.cpp \ + sckaddr.cpp \ + sckfile.cpp \ + sckint.cpp \ + sckipc.cpp \ + sckstrm.cpp \ + serbase.cpp \ + socket.cpp \ + stream.cpp \ + tbarbase.cpp \ + tbarsmpl.cpp \ + textfile.cpp \ + time.cpp \ + url.cpp \ + validate.cpp \ + valtext.cpp \ + wfstream.cpp \ wincmn.cpp \ + wxexpr.cpp \ + zstream.cpp \ +\ + choicdgg.cpp \ + gridg.cpp \ + laywin.cpp \ + panelg.cpp \ + printps.cpp \ + progdlgg.cpp \ + prop.cpp \ + propform.cpp \ + proplist.cpp \ + sashwin.cpp \ + scrolwin.cpp \ + splitter.cpp \ + statusbr.cpp \ + tabg.cpp \ + textdlgg.cpp \ \ accel.cpp \ app.cpp \ @@ -48,7 +114,6 @@ libwx_msw_la_SOURCES = \ button.cpp \ caret.cpp \ checkbox.cpp \ - checklst.cpp \ choice.cpp \ clipbrd.cpp \ colour.cpp \ @@ -66,17 +131,17 @@ libwx_msw_la_SOURCES = \ filedlg.cpp \ font.cpp \ frame.cpp \ - gaugemsw.cpp \ + gauge95.cpp \ gdiobj.cpp \ icon.cpp \ imaglist.cpp \ listbox.cpp \ - listctrlc.cpp \ main.cpp \ mdi.cpp \ menu.cpp \ menuitem.cpp \ minifram.cpp \ + msgdlg.cpp \ notebook.cpp \ ownerdrw.cpp \ palette.cpp \ @@ -88,17 +153,16 @@ libwx_msw_la_SOURCES = \ registry.cpp \ scrolbar.cpp \ settings.cpp \ - slidermsw.cpp \ + slider95.cpp \ spinbutt.cpp \ statbmp.cpp \ statbox.cpp \ stattext.cpp \ - tbarmsw.cpp \ + tbar95.cpp \ textctrl.cpp \ thread.cpp \ timer.cpp \ tooltip.cpp \ - treectrl.cpp \ utils.cpp \ utilsexc.cpp \ wave.cpp \ diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index ea4c2d1f20..f82e7b7d10 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -98,7 +98,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) extern int wxCharCodeWXToMSW(int id, bool *isVirtual); // Create from an array -#if !defined(__WIN16__) && !defined(__TWIN32__) +#if !defined(__WIN16__) && !defined(__TWIN32__) && !defined(__WXWINE__) wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) { // Not available in WIN16 diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 8886f56b8c..d3e67418a9 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -54,7 +54,11 @@ wxCursorRefData::wxCursorRefData(void) wxCursorRefData::~wxCursorRefData(void) { if ( m_hCursor && m_destroyCursor) +#ifdef __WXWINE__ + ::DestroyCursor((HCURSOR) m_hCursor); +#else ::DestroyCursor((HICON) m_hCursor); +#endif } // Cursors diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index cf53ed8159..1aeb326354 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -32,7 +32,7 @@ #include -#if !defined(__WIN32__) || defined(__SALFORDC__) +#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__) #include #endif diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index b7cf16551a..0b4862cb0e 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -20,7 +20,6 @@ #pragma hdrstop #endif -#include #include "wx/window.h" #include "wx/msw/private.h" @@ -32,6 +31,14 @@ #include "wx/dc.h" #endif +#include + +#ifdef __WXWINE__ + #if defined(GetWindowStyle) + #undef GetWindowStyle + #endif +#endif + #include "wx/dynarray.h" #include "wx/log.h" @@ -40,11 +47,37 @@ #endif #ifndef __TWIN32__ - #ifdef __GNUWIN32__ + #if defined(__GNUWIN32__) #include #endif #endif +#ifdef __WXWINE__ + #ifndef ListBox_SetItemData + #define ListBox_SetItemData(hwndCtl, index, data) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_SETITEMDATA, (WPARAM)(int)(index), (LPARAM)(data))) + #endif + #ifndef ListBox_GetHorizontalExtent + #define ListBox_GetHorizontalExtent(hwndCtl) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_GETHORIZONTALEXTENT, 0L, 0L)) + #endif + #ifndef ListBox_GetSelCount + #define ListBox_GetSelCount(hwndCtl) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELCOUNT, 0L, 0L)) + #endif + #ifndef ListBox_GetSelItems + #define ListBox_GetSelItems(hwndCtl, cItems, lpItems) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELITEMS, (WPARAM)(int)(cItems), (LPARAM)(int *)(lpItems))) + #endif + #ifndef ListBox_GetTextLen + #define ListBox_GetTextLen(hwndCtl, index) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXTLEN, (WPARAM)(int)(index), 0L)) + #endif + #ifndef ListBox_GetText + #define ListBox_GetText(hwndCtl, index, lpszBuffer) \ + ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXT, (WPARAM)(int)(index), (LPARAM)(LPCTSTR)(lpszBuffer))) + #endif +#endif #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index a39a97debf..242f9dfab9 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -666,7 +666,11 @@ bool wxListCtrl::GetItemRect(long item, wxRect& rect, int code) const else if ( code == wxLIST_RECT_LABEL ) code2 = LVIR_LABEL; +#ifdef __WXWINE__ + bool success = (ListView_GetItemRect((HWND) GetHWND(), (int) item, &rect2 ) != 0); +#else bool success = (ListView_GetItemRect((HWND) GetHWND(), (int) item, &rect2, code2) != 0); +#endif rect.x = rect2.left; rect.y = rect2.top; diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp index 5da71182f1..77569777f7 100644 --- a/src/msw/palette.cpp +++ b/src/msw/palette.cpp @@ -77,6 +77,12 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre { UnRef(); +#ifdef __WXWINE__ + + return (FALSE); + +#else + m_refData = new wxPaletteRefData; NPLOGPALETTE npPal = (NPLOGPALETTE)LocalAlloc(LMEM_FIXED, sizeof(LOGPALETTE) + @@ -98,6 +104,8 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal); LocalFree((HANDLE)npPal); return TRUE; + +#endif } int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index e2d8369a04..f6a224a163 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1189,7 +1189,11 @@ void wxTextCtrl::AdjustSpaceLimit() { limit = len + 0x8000; // 32Kb +#if wxUSE_RICHEDIT if ( m_isRich || limit > 0xffff ) +#else + if ( limit > 0xffff ) +#endif ::SendMessage(GetHwnd(), EM_LIMITTEXT, 0, limit); else ::SendMessage(GetHwnd(), EM_LIMITTEXT, limit, 0); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 52a8f79891..f41729be61 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -35,7 +35,7 @@ #include -#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) +#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) #include #ifndef __MWERKS__ @@ -56,7 +56,7 @@ #include #endif -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__WXWINE__) #include #ifndef __GNUWIN32__ diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index e54f9811fe..bcb9faf6a3 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -36,7 +36,7 @@ #include -#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) +#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) #include #ifndef __MWERKS__ #include @@ -50,7 +50,7 @@ #endif #endif -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__WXWINE__) #include #ifndef __GNUWIN32__ -- 2.45.2