From: Robert Roebling Date: Wed, 6 Jan 1999 21:09:17 +0000 (+0000) Subject: Compilation fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/06cfab17389f4bbd38560dd86ee39931e979bb1e?ds=sidebyside;hp=471aebdd3e7aef32773a2a99ff47f8f0cf564696 Compilation fixes Found out how to do wxUSE_XX 0 and 1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/clipbrd.h b/include/wx/gtk/clipbrd.h index ed94d8ef8e..ace437d5d9 100644 --- a/include/wx/gtk/clipbrd.h +++ b/include/wx/gtk/clipbrd.h @@ -17,7 +17,7 @@ #include "wx/defs.h" -#ifdef wxUSE_CLIPBOARD +#if wxUSE_CLIPBOARD #include "wx/object.h" #include "wx/list.h" diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index acabf59f7d..5e9e341fb3 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -18,7 +18,7 @@ #include "wx/defs.h" -#ifdef wxUSE_COMBOBOX +#if wxUSE_COMBOBOX #include "wx/object.h" #include "wx/control.h" diff --git a/include/wx/gtk/dcps.h b/include/wx/gtk/dcps.h index f996001cb8..df8f2d0b09 100644 --- a/include/wx/gtk/dcps.h +++ b/include/wx/gtk/dcps.h @@ -16,11 +16,13 @@ #endif #include "wx/dc.h" + +#if wxUSE_POSTSCRIPT + #include "wx/dialog.h" #include "wx/module.h" #include -#if wxUSE_POSTSCRIPT //----------------------------------------------------------------------------- // classes diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index ba56769328..bd392388ce 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -17,7 +17,7 @@ #include "wx/defs.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/object.h" #include "wx/string.h" diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index 51fe4c30b2..1b24d42c25 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -91,7 +91,7 @@ public: void SetString( int n, const wxString &string ); void SetStringSelection( const wxString &string, bool select = TRUE ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void SetDropTarget( wxDropTarget *dropTarget ); #endif diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index d3951cf464..4b3e3d78d7 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -42,11 +42,11 @@ class wxDC; class wxClientData; class wxVoidClientData; class wxWindow; -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES class wxResourceTable; class wxItemResource; #endif -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP class wxDropTarget; #endif @@ -290,7 +290,7 @@ public: virtual bool PopupMenu( wxMenu *menu, int x, int y ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); virtual wxDropTarget *GetDropTarget() const; #endif @@ -335,7 +335,7 @@ public: int m_retCode; wxEvtHandler *m_eventHandler; wxValidator *m_windowValidator; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP wxDropTarget *m_dropTarget; #endif wxWindowID m_windowId; diff --git a/include/wx/gtk1/clipbrd.h b/include/wx/gtk1/clipbrd.h index ed94d8ef8e..ace437d5d9 100644 --- a/include/wx/gtk1/clipbrd.h +++ b/include/wx/gtk1/clipbrd.h @@ -17,7 +17,7 @@ #include "wx/defs.h" -#ifdef wxUSE_CLIPBOARD +#if wxUSE_CLIPBOARD #include "wx/object.h" #include "wx/list.h" diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index acabf59f7d..5e9e341fb3 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -18,7 +18,7 @@ #include "wx/defs.h" -#ifdef wxUSE_COMBOBOX +#if wxUSE_COMBOBOX #include "wx/object.h" #include "wx/control.h" diff --git a/include/wx/gtk1/dcps.h b/include/wx/gtk1/dcps.h index f996001cb8..df8f2d0b09 100644 --- a/include/wx/gtk1/dcps.h +++ b/include/wx/gtk1/dcps.h @@ -16,11 +16,13 @@ #endif #include "wx/dc.h" + +#if wxUSE_POSTSCRIPT + #include "wx/dialog.h" #include "wx/module.h" #include -#if wxUSE_POSTSCRIPT //----------------------------------------------------------------------------- // classes diff --git a/include/wx/gtk1/dnd.h b/include/wx/gtk1/dnd.h index ba56769328..bd392388ce 100644 --- a/include/wx/gtk1/dnd.h +++ b/include/wx/gtk1/dnd.h @@ -17,7 +17,7 @@ #include "wx/defs.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/object.h" #include "wx/string.h" diff --git a/include/wx/gtk1/listbox.h b/include/wx/gtk1/listbox.h index 51fe4c30b2..1b24d42c25 100644 --- a/include/wx/gtk1/listbox.h +++ b/include/wx/gtk1/listbox.h @@ -91,7 +91,7 @@ public: void SetString( int n, const wxString &string ); void SetStringSelection( const wxString &string, bool select = TRUE ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void SetDropTarget( wxDropTarget *dropTarget ); #endif diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index d3951cf464..4b3e3d78d7 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -42,11 +42,11 @@ class wxDC; class wxClientData; class wxVoidClientData; class wxWindow; -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES class wxResourceTable; class wxItemResource; #endif -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP class wxDropTarget; #endif @@ -290,7 +290,7 @@ public: virtual bool PopupMenu( wxMenu *menu, int x, int y ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); virtual wxDropTarget *GetDropTarget() const; #endif @@ -335,7 +335,7 @@ public: int m_retCode; wxEvtHandler *m_eventHandler; wxValidator *m_windowValidator; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP wxDropTarget *m_dropTarget; #endif wxWindowID m_windowId; diff --git a/include/wx/odbc.h b/include/wx/odbc.h index 607bbcfa18..b33a2f1407 100644 --- a/include/wx/odbc.h +++ b/include/wx/odbc.h @@ -24,11 +24,16 @@ #include #endif + #ifdef __WXGTK__ extern "C" { -#include <../iodbc/postgres/isqlext.h> -#include <../iodbc/postgres/odbc_funcs.h> -#include <../iodbc/postgres/odbc_types.h> +#include <../iodbc/isql.h> +#include <../iodbc/isqlext.h> +#include <../iodbc/odbc_funcs.h> +#include <../iodbc/odbc_types.h> +typedef float SFLOAT; +typedef double SDOUBLE; +#define ULONG UDWORD } #else #include diff --git a/include/wx/thread.h b/include/wx/thread.h index fcdfe7a743..d5cd919400 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -106,6 +106,8 @@ private: wxMutex *m_mutex; }; +#ifdef __WXMSW__ + // ---------------------------------------------------------------------------- // 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 @@ -146,6 +148,8 @@ private: wxCriticalSection *m_critsect; }; +#endif + // ---------------------------------------------------------------------------- // Condition handler. // ---------------------------------------------------------------------------- diff --git a/setup/setup.hin b/setup/setup.hin index 85451593ee..36fb812210 100644 --- a/setup/setup.hin +++ b/setup/setup.hin @@ -42,22 +42,22 @@ /* * Use zlib */ -#undef wxUSE_ZLIB +#define wxUSE_ZLIB 0 /* * Use libpng */ -#undef wxUSE_LIBPNG +#define wxUSE_LIBPNG 0 /* * Use iODBC */ -#undef wxUSE_ODBC +#define wxUSE_ODBC 0 /* * Use Threads */ -#undef wxUSE_THREADS +#define wxUSE_THREADS 0 //------------------------------------------------------------------------ -// GUI control options +// GUI control options (allways enabled in wxGTK) //------------------------------------------------------------------------ /* @@ -84,23 +84,28 @@ /* * Use time and date classes */ -#undef wxUSE_TIMEDATE +#define wxUSE_TIMEDATE 0 /* * Use config system */ -#undef wxUSE_CONFIG +#define wxUSE_CONFIG 0 /* * Use intl system */ -#undef wxUSE_INTL +#define wxUSE_INTL 0 /* * Use streams */ -#undef wxUSE_STREAMS +#define wxUSE_STREAMS 0 /* * Use class serialization */ -#undef wxUSE_SERIAL +#define wxUSE_SERIAL 0 +/* + * Use standard C++ streams if 1. If 0, use wxWin + * streams implementation. + */ +#define wxUSE_STD_IOSTREAM 1 //------------------------------------------------------------------------ // PS options @@ -110,12 +115,12 @@ * Use font metric files in GetTextExtent for wxPostScriptDC * Use consistent PostScript fonts for AFM and printing (!) */ -#undef wxUSE_AFM_FOR_POSTSCRIPT -#undef WX_NORMALIZED_PS_FONTS +#define wxUSE_AFM_FOR_POSTSCRIPT 0 +#define WX_NORMALIZED_PS_FONTS 0 /* * Use PostScript device context */ -#undef wxUSE_POSTSCRIPT +#define wxUSE_POSTSCRIPT 0 //------------------------------------------------------------------------ // wxString options @@ -124,7 +129,7 @@ /* * Compile wxString with wide character (Unicode) support? */ -#undef wxUSE_UNICODE +#define wxUSE_UNICODE 0 /* * Work around a bug in GNU libc 5.x wcstombs() implementation. @@ -133,7 +138,7 @@ * have libc 5 (you should enable this for libc6 where wcsrtombs() is * thread-safe version of wcstombs()). */ -#undef wxUSE_WCSRTOMBS +#define wxUSE_WCSRTOMBS 0 //------------------------------------------------------------------------ // misc options @@ -142,19 +147,19 @@ /* * Use Interprocess communication */ -#undef wxUSE_IPC +#define wxUSE_IPC 0 /* * Use wxGetResource & wxWriteResource (change .Xdefaults) */ -#undef wxUSE_RESOURCES +#define wxUSE_RESOURCES 0 /* * Use clipboard */ -#undef wxUSE_CLIPBOARD +#define wxUSE_CLIPBOARD 0 /* * Use dnd */ -#undef wxUSE_DRAG_AND_DROP +#define wxUSE_DRAG_AND_DROP 0 //------------------------------------------------------------------------ // architecture options @@ -163,15 +168,15 @@ /* * Use the mdi architecture */ -#undef wxUSE_MDI_ARCHITECTURE +#define wxUSE_MDI_ARCHITECTURE 0 /* * Use the document/view architecture */ -#undef wxUSE_DOC_VIEW_ARCHITECTURE +#define wxUSE_DOC_VIEW_ARCHITECTURE 0 /* * Use the print/preview architecture */ -#undef wxUSE_PRINTING_ARCHITECTURE +#define wxUSE_PRINTING_ARCHITECTURE 0 //------------------------------------------------------------------------ // Prolog and wxWindows' resource system options @@ -180,15 +185,15 @@ /* * Use Prolog IO */ -#undef wxUSE_PROLOGIO +#define wxUSE_PROLOGIO 0 /* * Use Remote Procedure Call (Needs wxUSE_IPC and wxUSE_PROLOGIO) */ -#undef wxUSE_RPC +#define wxUSE_RPC 0 /* * Use wxWindows resource loading (.wxr-files) (Needs wxUSE_PROLOGIO 1) */ -#undef wxUSE_WX_RESOURCES +#define wxUSE_WX_RESOURCES 0 //------------------------------------------------------------------------ // the rest @@ -197,15 +202,15 @@ /* * Use wxWindows help facility (needs wxUSE_IPC 1) */ -#undef wxUSE_HELP +#define wxUSE_HELP 0 /* * Use iostream.h rather than iostream */ -#undef wxUSE_IOSTREAMH +#define wxUSE_IOSTREAMH 0 /* * Use Apple Ieee-double converter */ -#undef wxUSE_APPLE_IEEE +#define wxUSE_APPLE_IEEE 0 /* Compatibility with 1.66 API. Level 0: no backward compatibility, all new features Level 1: wxDC, OnSize (etc.) compatibility, but @@ -214,18 +219,18 @@ /* * Enables debugging: memory tracing, assert, etc., contains debug level */ -#undef WXDEBUG +#define WXDEBUG 0 /* * Enables debugging version of wxObject::new and wxObject::delete (IF WXDEBUG) * WARNING: this code may not work with all architectures, especially * if alignment is an issue. */ -#undef wxUSE_MEMORY_TRACING +#define wxUSE_MEMORY_TRACING 0 /* * Enable debugging version of global memory operators new and delete * Disable it, If this causes problems (e.g. link errors) */ -#undef wxUSE_GLOBAL_MEMORY_OPERATORS +#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 /* * Matthews garbage collection (used for MrEd?) */ diff --git a/src/common/image.cpp b/src/common/image.cpp index ab13cbfbd4..7d439e823f 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -722,13 +722,13 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) int height = (int)dbuf[1]; if (width > 32767) { - fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for file\n"); + wxLogError( "Image width > 32767 pixels for file\n" ); fclose(file); return FALSE; } if (height > 32767) { - fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for file\n"); + wxLogError( "Image height > 32767 pixels for file\n" ); fclose(file); return FALSE; } @@ -738,7 +738,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) bpp = (int)word; if (bpp != 1 && bpp != 4 && bpp != 8 && bpp && 16 && bpp != 24 && bpp != 32) { - fprintf(stderr, "IMLIB ERROR: unknown bitdepth in file\n"); + wxLogError( "unknown bitdepth in file\n" ); fclose(file); return FALSE; } @@ -746,7 +746,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) comp = (int)dbuf[0]; if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS) { - fprintf(stderr, "IMLIB ERROR: unknown encoding in Windows BMP file\n"); + wxLogError( "unknown encoding in Windows BMP file\n" ); fclose(file); return FALSE; } @@ -757,7 +757,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) /* some more sanity checks */ if (((comp == BI_RLE4) && (bpp != 4)) || ((comp == BI_RLE8) && (bpp != 8)) || ((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32))) { - fprintf(stderr, "IMLIB ERROR: encoding of BMP doesn't match bitdepth\n"); + wxLogError( "encoding of BMP doesn't match bitdepth\n" ); fclose(file); return FALSE; } @@ -767,7 +767,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) if (!cmap) { - fprintf(stderr, "IMLIB ERROR: Cannot allocate RAM for color map in BMP file\n"); + wxLogError( "Cannot allocate RAM for color map in BMP file\n" ); fclose(file); return FALSE; } @@ -779,7 +779,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) ptr = image->GetData(); if (!ptr) { - fprintf(stderr, "IMLIB ERROR: Cannot allocate RAM for RGB data in file\n"); + wxLogError( "Cannot allocate RAM for RGB data in file\n" ); fclose(file); if (cmap) free(cmap); @@ -894,7 +894,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, const wxString& name ) { if (comp == BI_RLE4) { - fprintf(stderr, "can't deal with 4bit encoded yet.\n"); + wxLogError( "can't deal with 4bit encoded yet.\n"); image->Destroy(); free(cmap); return FALSE; @@ -1296,6 +1296,9 @@ wxBitmap wxImage::ConvertToBitmap() const GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() ); if (visual == NULL) visual = gdk_window_get_visual( (GdkWindow*) &gdk_root_parent ); int bpp = visual->depth; + + bitmap.SetDepth( bpp ); + if ((bpp == 16) && (visual->red_mask != 0xf800)) bpp = 15; if (bpp < 8) bpp = 8; diff --git a/src/common/resource.cpp b/src/common/resource.cpp index cbff8918cf..19f87a2b4a 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -53,6 +53,10 @@ #include "wx/intl.h" #endif +#if wxUSE_RADIOBUTTON +#include "wx/radiobut.h" +#endif + #if wxUSE_SCROLLBAR #include "wx/scrolbar.h" #endif diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index ea8b118df7..5e1c0e5755 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -19,12 +19,12 @@ #include "wx/memory.h" #include "wx/font.h" #include "wx/settings.h" -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES #include "wx/resource.h" #endif #include "wx/module.h" #include "wx/image.h" -#ifdef wxUSE_THREADS +#if wxUSE_THREADS #include "wx/thread.h" #endif #include "unistd.h" @@ -146,11 +146,11 @@ END_EVENT_TABLE() gint wxapp_idle_callback( gpointer WXUNUSED(data) ) { if (wxTheApp) while (wxTheApp->ProcessIdle()) {} -#ifdef wxUSE_THREADS +#if wxUSE_THREADS wxMutexGuiLeave(); #endif usleep(10000); -#ifdef wxUSE_THREADS +#if wxUSE_THREADS wxMutexGuiEnter(); #endif return TRUE; @@ -337,7 +337,7 @@ void wxApp::CommonInit(void) wxInitializeStockLists(); wxInitializeStockObjects(); -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES wxTheResourceCache = new wxResourceCache(wxKEY_STRING); wxInitializeResourceSystem(); @@ -354,7 +354,7 @@ void wxApp::CommonCleanUp(void) wxDELETE(wxTheFontNameDirectory); wxDeleteStockObjects(); -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES wxFlushResources(); wxDELETE(wxTheResourceCache); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 8390bc65f2..4314ac726b 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -13,7 +13,7 @@ #include "wx/clipbrd.h" -#ifdef wxUSE_CLIPBOARD +#if wxUSE_CLIPBOARD #include "glib.h" #include "gdk/gdk.h" diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 4576ffe094..45cf031ba1 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -14,7 +14,7 @@ #include "wx/combobox.h" -#ifdef wxUSE_COMBOBOX +#if wxUSE_COMBOBOX #include diff --git a/src/gtk/dcps.cpp b/src/gtk/dcps.cpp index 8ee9ce5a25..8a82f3cb61 100644 --- a/src/gtk/dcps.cpp +++ b/src/gtk/dcps.cpp @@ -14,6 +14,11 @@ #pragma interface #endif + +#include "wx/defs.h" + +#if wxUSE_POSTSCRIPT + #include "wx/postscrp.h" #include "wx/dcmemory.h" #include "wx/utils.h" @@ -1665,3 +1670,5 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const } } +#endif + // wxUSE_POSTSCRIPT diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 359d8eaad5..b419c04ccb 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -13,7 +13,7 @@ #include "wx/dnd.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/window.h" #include "wx/app.h" diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 0cc5635fc5..b865dba96d 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -18,6 +18,10 @@ #include "wx/intl.h" #include "wx/checklst.h" +#if wxUSE_DRAG_AND_DROP +#include "wx/dnd.h" +#endif + #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -319,7 +323,7 @@ void wxListBox::AppendCommon( const wxString &item ) ConnectWidget( list_item ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #ifndef NEW_GTK_DND_CODE if (m_dropTarget) m_dropTarget->RegisterWidget( list_item ); #endif @@ -652,7 +656,7 @@ int wxListBox::GetIndex( GtkWidget *item ) const return -1; } -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) { wxCHECK_RET( m_list != NULL, "invalid listbox" ); diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 50fff73132..f0c5335454 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -15,6 +15,7 @@ #include "wx/menu.h" #include "wx/log.h" #include "wx/intl.h" +#include "wx/app.h" #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -160,6 +161,8 @@ bool wxMenuBar::Enabled( int id ) const static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) { + wxYield(); + int id = menu->FindMenuIdByMenuItem(widget); /* should find it for normal (not popup) menu */ diff --git a/src/gtk/threadpsx.cpp b/src/gtk/threadpsx.cpp index dd769527e5..a6b760b6f4 100644 --- a/src/gtk/threadpsx.cpp +++ b/src/gtk/threadpsx.cpp @@ -322,7 +322,7 @@ void wxThread::Exit(void *status) pthread_exit(status); } -void wxThread::TestDestroy() +bool wxThread::TestDestroy() { if (p_internal->state == STATE_PAUSING) { @@ -334,6 +334,8 @@ void wxThread::TestDestroy() } } pthread_testcancel(); + + return TRUE; /* what is this for? */ } bool wxThread::IsMain() @@ -375,6 +377,16 @@ void wxThread::OnExit() // 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() diff --git a/src/gtk/threadsgi.cpp b/src/gtk/threadsgi.cpp index f9befcb74e..217f67d7d9 100644 --- a/src/gtk/threadsgi.cpp +++ b/src/gtk/threadsgi.cpp @@ -239,6 +239,16 @@ void wxThread::OnExit() // Global initialization +class wxThreadModule : public wxModule +{ +public: + virtual bool OnInit(); + virtual void OnExit(); + +private: + DECLARE_DYNAMIC_CLASS(wxThreadModule) +}; + IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) bool wxThreadModule::OnInit() diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 142d5100a8..b047fa9083 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -21,7 +21,7 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/msgdlg.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" #endif #include "wx/menu.h" @@ -1167,7 +1167,7 @@ wxWindow::wxWindow() m_isShown = FALSE; m_isEnabled = TRUE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP m_dropTarget = (wxDropTarget*) NULL; #endif m_resizing = FALSE; @@ -1335,7 +1335,7 @@ wxWindow::~wxWindow() { m_hasVMT = FALSE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP if (m_dropTarget) delete m_dropTarget; #endif @@ -1456,7 +1456,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id, m_isShown = FALSE; m_isEnabled = TRUE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP m_dropTarget = (wxDropTarget *) NULL; #endif m_resizing = FALSE; @@ -2495,7 +2495,7 @@ bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) ) return TRUE; } -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void wxWindow::SetDropTarget( wxDropTarget *dropTarget ) { diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index ea8b118df7..5e1c0e5755 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -19,12 +19,12 @@ #include "wx/memory.h" #include "wx/font.h" #include "wx/settings.h" -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES #include "wx/resource.h" #endif #include "wx/module.h" #include "wx/image.h" -#ifdef wxUSE_THREADS +#if wxUSE_THREADS #include "wx/thread.h" #endif #include "unistd.h" @@ -146,11 +146,11 @@ END_EVENT_TABLE() gint wxapp_idle_callback( gpointer WXUNUSED(data) ) { if (wxTheApp) while (wxTheApp->ProcessIdle()) {} -#ifdef wxUSE_THREADS +#if wxUSE_THREADS wxMutexGuiLeave(); #endif usleep(10000); -#ifdef wxUSE_THREADS +#if wxUSE_THREADS wxMutexGuiEnter(); #endif return TRUE; @@ -337,7 +337,7 @@ void wxApp::CommonInit(void) wxInitializeStockLists(); wxInitializeStockObjects(); -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES wxTheResourceCache = new wxResourceCache(wxKEY_STRING); wxInitializeResourceSystem(); @@ -354,7 +354,7 @@ void wxApp::CommonCleanUp(void) wxDELETE(wxTheFontNameDirectory); wxDeleteStockObjects(); -#ifdef wxUSE_WX_RESOURCES +#if wxUSE_WX_RESOURCES wxFlushResources(); wxDELETE(wxTheResourceCache); diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 8390bc65f2..4314ac726b 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -13,7 +13,7 @@ #include "wx/clipbrd.h" -#ifdef wxUSE_CLIPBOARD +#if wxUSE_CLIPBOARD #include "glib.h" #include "gdk/gdk.h" diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 4576ffe094..45cf031ba1 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -14,7 +14,7 @@ #include "wx/combobox.h" -#ifdef wxUSE_COMBOBOX +#if wxUSE_COMBOBOX #include diff --git a/src/gtk1/dcps.cpp b/src/gtk1/dcps.cpp index 8ee9ce5a25..8a82f3cb61 100644 --- a/src/gtk1/dcps.cpp +++ b/src/gtk1/dcps.cpp @@ -14,6 +14,11 @@ #pragma interface #endif + +#include "wx/defs.h" + +#if wxUSE_POSTSCRIPT + #include "wx/postscrp.h" #include "wx/dcmemory.h" #include "wx/utils.h" @@ -1665,3 +1670,5 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const } } +#endif + // wxUSE_POSTSCRIPT diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index 359d8eaad5..b419c04ccb 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -13,7 +13,7 @@ #include "wx/dnd.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/window.h" #include "wx/app.h" diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 0cc5635fc5..b865dba96d 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -18,6 +18,10 @@ #include "wx/intl.h" #include "wx/checklst.h" +#if wxUSE_DRAG_AND_DROP +#include "wx/dnd.h" +#endif + #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -319,7 +323,7 @@ void wxListBox::AppendCommon( const wxString &item ) ConnectWidget( list_item ); -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #ifndef NEW_GTK_DND_CODE if (m_dropTarget) m_dropTarget->RegisterWidget( list_item ); #endif @@ -652,7 +656,7 @@ int wxListBox::GetIndex( GtkWidget *item ) const return -1; } -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) { wxCHECK_RET( m_list != NULL, "invalid listbox" ); diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 50fff73132..f0c5335454 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -15,6 +15,7 @@ #include "wx/menu.h" #include "wx/log.h" #include "wx/intl.h" +#include "wx/app.h" #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -160,6 +161,8 @@ bool wxMenuBar::Enabled( int id ) const static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) { + wxYield(); + int id = menu->FindMenuIdByMenuItem(widget); /* should find it for normal (not popup) menu */ diff --git a/src/gtk1/threadpsx.cpp b/src/gtk1/threadpsx.cpp index dd769527e5..a6b760b6f4 100644 --- a/src/gtk1/threadpsx.cpp +++ b/src/gtk1/threadpsx.cpp @@ -322,7 +322,7 @@ void wxThread::Exit(void *status) pthread_exit(status); } -void wxThread::TestDestroy() +bool wxThread::TestDestroy() { if (p_internal->state == STATE_PAUSING) { @@ -334,6 +334,8 @@ void wxThread::TestDestroy() } } pthread_testcancel(); + + return TRUE; /* what is this for? */ } bool wxThread::IsMain() @@ -375,6 +377,16 @@ void wxThread::OnExit() // 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() diff --git a/src/gtk1/threadsgi.cpp b/src/gtk1/threadsgi.cpp index f9befcb74e..217f67d7d9 100644 --- a/src/gtk1/threadsgi.cpp +++ b/src/gtk1/threadsgi.cpp @@ -239,6 +239,16 @@ void wxThread::OnExit() // Global initialization +class wxThreadModule : public wxModule +{ +public: + virtual bool OnInit(); + virtual void OnExit(); + +private: + DECLARE_DYNAMIC_CLASS(wxThreadModule) +}; + IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) bool wxThreadModule::OnInit() diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 142d5100a8..b047fa9083 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -21,7 +21,7 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/msgdlg.h" -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" #endif #include "wx/menu.h" @@ -1167,7 +1167,7 @@ wxWindow::wxWindow() m_isShown = FALSE; m_isEnabled = TRUE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP m_dropTarget = (wxDropTarget*) NULL; #endif m_resizing = FALSE; @@ -1335,7 +1335,7 @@ wxWindow::~wxWindow() { m_hasVMT = FALSE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP if (m_dropTarget) delete m_dropTarget; #endif @@ -1456,7 +1456,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id, m_isShown = FALSE; m_isEnabled = TRUE; -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP m_dropTarget = (wxDropTarget *) NULL; #endif m_resizing = FALSE; @@ -2495,7 +2495,7 @@ bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) ) return TRUE; } -#ifdef wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void wxWindow::SetDropTarget( wxDropTarget *dropTarget ) { diff --git a/src/motif/thread.cpp b/src/motif/thread.cpp index 3407dd8fe3..96d7af417a 100644 --- a/src/motif/thread.cpp +++ b/src/motif/thread.cpp @@ -414,6 +414,16 @@ void wxThread::OnExit() // 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()