From 670f9935630beb2123a5ca62894ae92a3f0efa4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 28 Apr 2006 12:44:37 +0000 Subject: [PATCH] Include wx/app.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/combobox.mm | 2 +- src/cocoa/main.cpp | 13 +++--- src/cocoa/utils.cpp | 6 ++- src/common/config.cpp | 2 +- src/common/cshelp.cpp | 2 +- src/common/db.cpp | 2 +- src/common/dbgrid.cpp | 14 +++--- src/common/dynlib.cpp | 4 +- src/common/evtloopcmn.cpp | 5 ++- src/common/fileconf.cpp | 26 +++++------ src/common/gdicmn.cpp | 4 +- src/common/http.cpp | 15 +++---- src/common/intl.cpp | 6 +-- src/common/popupcmn.cpp | 4 +- src/common/socket.cpp | 2 +- src/generic/dcpsg.cpp | 28 ++++++------ src/gtk/cursor.cpp | 8 +++- src/gtk/dataobj.cpp | 14 +++--- src/gtk/dialog.cpp | 8 +++- src/gtk/dnd.cpp | 6 +-- src/gtk/evtloop.cpp | 12 ++--- src/gtk/frame.cpp | 6 ++- src/gtk/glcanvas.cpp | 31 +++++++------ src/gtk/menu.cpp | 22 ++++----- src/gtk/popupwin.cpp | 22 +++++---- src/gtk/toplevel.cpp | 2 +- src/gtk/utilsres.cpp | 2 +- src/gtk/window.cpp | 4 +- src/gtk1/bitmap.cpp | 6 ++- src/gtk1/cursor.cpp | 8 +++- src/gtk1/dataobj.cpp | 14 +++--- src/gtk1/dialog.cpp | 8 +++- src/gtk1/dnd.cpp | 2 +- src/gtk1/evtloop.cpp | 12 ++--- src/gtk1/frame.cpp | 6 ++- src/gtk1/glcanvas.cpp | 33 +++++++------- src/gtk1/menu.cpp | 4 +- src/gtk1/popupwin.cpp | 20 +++++---- src/gtk1/toplevel.cpp | 2 +- src/gtk1/utilsres.cpp | 2 +- src/gtk1/window.cpp | 2 +- src/html/htmlpars.cpp | 2 +- src/mac/carbon/cfsocket.cpp | 2 +- src/mac/carbon/clipbrd.cpp | 2 +- src/mac/carbon/control.cpp | 9 ++-- src/mac/carbon/cursor.cpp | 8 +++- src/mac/carbon/dc.cpp | 2 +- src/mac/carbon/dccg.cpp | 2 +- src/mac/carbon/dialog.cpp | 15 ++++--- src/mac/carbon/dnd.cpp | 10 +++-- src/mac/carbon/evtloop.cpp | 8 ++-- src/mac/carbon/filedlg.cpp | 6 +-- src/mac/carbon/frame.cpp | 9 ++-- src/mac/carbon/listbox.cpp | 2 +- src/mac/carbon/menu.cpp | 2 +- src/mac/carbon/menuitem.cpp | 10 +++-- src/mac/carbon/msgdlg.cpp | 4 +- src/mac/carbon/notebmac.cpp | 2 +- src/mac/carbon/printmac.cpp | 86 ++++++++++++++++++------------------ src/mac/carbon/stattext.cpp | 13 +++--- src/mac/carbon/textctrl.cpp | 6 +-- src/mac/carbon/tooltip.cpp | 67 ++++++++++++++-------------- src/mac/carbon/toplevel.cpp | 10 ++--- src/mac/carbon/utils.cpp | 2 +- src/mac/carbon/window.cpp | 2 +- src/mac/classic/clipbrd.cpp | 20 ++++----- src/mac/classic/control.cpp | 10 +++-- src/mac/classic/cursor.cpp | 6 ++- src/mac/classic/dc.cpp | 2 +- src/mac/classic/dialog.cpp | 37 +++++++++------- src/mac/classic/dnd.cpp | 8 +++- src/mac/classic/filedlg.cpp | 6 +-- src/mac/classic/frame.cpp | 50 ++++++++++++--------- src/mac/classic/listbox.cpp | 2 +- src/mac/classic/menu.cpp | 26 +++++------ src/mac/classic/menuitem.cpp | 66 ++++++++++++++------------- src/mac/classic/metafile.cpp | 11 ++--- src/mac/classic/msgdlg.cpp | 2 +- src/mac/classic/notebmac.cpp | 2 +- src/mac/classic/stattext.cpp | 8 +++- src/mac/classic/textctrl.cpp | 18 +++++--- src/mac/classic/tooltip.cpp | 12 +++-- src/mac/classic/toplevel.cpp | 3 +- src/mac/classic/utils.cpp | 2 +- src/mac/classic/window.cpp | 2 +- src/mgl/app.cpp | 5 +-- src/motif/clipbrd.cpp | 8 +++- src/motif/colour.cpp | 5 ++- src/motif/cursor.cpp | 6 ++- src/motif/dataobj.cpp | 6 ++- src/motif/dcclient.cpp | 2 +- src/motif/dialog.cpp | 6 ++- src/motif/dnd.cpp | 2 +- src/motif/evtloop.cpp | 2 +- src/motif/filedlg.cpp | 2 +- src/motif/frame.cpp | 2 +- src/motif/menu.cpp | 2 +- src/motif/msgdlg.cpp | 2 +- src/motif/palette.cpp | 6 ++- src/motif/popupwin.cpp | 9 ++-- src/motif/settings.cpp | 6 ++- src/motif/timer.cpp | 14 +++--- src/motif/toolbar.cpp | 9 ++-- src/motif/toplevel.cpp | 5 ++- src/motif/utils.cpp | 6 ++- src/motif/window.cpp | 2 +- src/msdos/utilsdos.cpp | 2 +- src/msw/combobox.cpp | 5 ++- src/msw/dialup.cpp | 8 ++-- src/msw/gdiimage.cpp | 6 +-- src/msw/main.cpp | 2 +- src/msw/notebook.cpp | 2 +- src/msw/regconf.cpp | 3 +- src/msw/spinbutt.cpp | 4 +- src/msw/tabctrl.cpp | 6 +-- src/msw/tbar95.cpp | 3 +- src/msw/thread.cpp | 8 ++-- src/msw/treectrl.cpp | 2 +- src/os2/accel.cpp | 24 +++++----- src/os2/dcclient.cpp | 2 +- src/os2/dcmemory.cpp | 16 +++---- src/os2/dnd.cpp | 8 +++- src/os2/gdiimage.cpp | 2 +- src/os2/metafile.cpp | 12 ++--- src/os2/region.cpp | 42 ++++++++---------- src/os2/statbox.cpp | 48 +++++++++----------- src/os2/tabctrl.cpp | 8 ++-- src/os2/textctrl.cpp | 8 ++-- src/os2/thread.cpp | 2 +- src/os2/treectrl.cpp | 2 +- src/palmos/datectrl.cpp | 2 +- src/palmos/gdiimage.cpp | 5 +-- src/palmos/main.cpp | 2 +- src/palmos/spinbutt.cpp | 9 ++-- src/palmos/tabctrl.cpp | 6 +-- src/palmos/toolbar.cpp | 6 +-- src/palmos/treectrl.cpp | 2 +- src/unix/dialup.cpp | 2 +- src/unix/fontenum.cpp | 2 +- src/unix/mediactrl.cpp | 2 +- src/unix/utilsunx.cpp | 2 +- src/unix/utilsx11.cpp | 3 +- src/x11/bitmap.cpp | 2 +- src/x11/colour.cpp | 5 ++- src/x11/cursor.cpp | 21 ++++++--- src/x11/dataobj.cpp | 2 +- src/x11/dcclient.cpp | 29 +++++++----- src/x11/dcscreen.cpp | 29 +++++++----- src/x11/dnd.cpp | 4 +- src/x11/evtloop.cpp | 5 ++- src/x11/glcanvas.cpp | 14 +++--- src/x11/palette.cpp | 9 +++- src/x11/popupwin.cpp | 2 +- src/x11/reparent.cpp | 12 ++--- src/x11/utils.cpp | 16 ++++--- src/x11/window.cpp | 2 +- src/xml/xml.cpp | 2 +- 157 files changed, 837 insertions(+), 657 deletions(-) diff --git a/src/cocoa/combobox.mm b/src/cocoa/combobox.mm index 47619d7d27..406bce80e4 100644 --- a/src/cocoa/combobox.mm +++ b/src/cocoa/combobox.mm @@ -81,6 +81,7 @@ #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/log.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/cocoa/ObjcPose.h" @@ -159,7 +160,6 @@ void wxCocoaNSComboBox::DisassociateNSComboBox(WX_NSComboBox cocoaNSComboBox) @end // implementation wxPoserNSComboBox -#include "wx/app.h" #include "wx/combobox.h" #include "wx/cocoa/autorelease.h" diff --git a/src/cocoa/main.cpp b/src/cocoa/main.cpp index 2acb4871c4..31754e2de8 100644 --- a/src/cocoa/main.cpp +++ b/src/cocoa/main.cpp @@ -1,19 +1,22 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/main.cpp +// Name: src/cocoa/main.cpp // Purpose: Entry point // Author: David Elliott // Modified by: // Created: 2002/11/11 // RCS-ID: $Id: // Copyright: (c) 2002 David Elliott -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// /* DFE: ^^^^^ Was that really necessary :-) */ -#include "wx/app.h" +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP WXDLLEXPORT int main(int argc, char* argv[]) { - return wxEntry(argc, argv); + return wxEntry(argc, argv); } - diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp index e3bb09c2fc..9f18f11023 100644 --- a/src/cocoa/utils.cpp +++ b/src/cocoa/utils.cpp @@ -12,7 +12,11 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/apptrait.h" #include "wx/display.h" diff --git a/src/common/config.cpp b/src/common/config.cpp index 0e176f4f89..b5d811d836 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -29,13 +29,13 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif //WX_PRECOMP #include "wx/arrstr.h" #if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE) -#include "wx/app.h" #include "wx/file.h" #include "wx/utils.h" #include "wx/math.h" diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index ae2a282c3a..82f3383652 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -27,10 +27,10 @@ #if wxUSE_HELP #ifndef WX_PRECOMP + #include "wx/app.h" #endif #include "wx/tipwin.h" -#include "wx/app.h" #include "wx/module.h" #include "wx/cshelp.h" diff --git a/src/common/db.cpp b/src/common/db.cpp index 923ee6a374..d0b9bf6499 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -35,6 +35,7 @@ #include "wx/string.h" #include "wx/utils.h" #include "wx/log.h" + #include "wx/app.h" #endif #ifdef DBDEBUG_CONSOLE @@ -53,7 +54,6 @@ #include "wx/db.h" // DLL options compatibility check: -#include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxODBC") WXDLLIMPEXP_DATA_ODBC(wxDbList*) PtrBegDbList = 0; diff --git a/src/common/dbgrid.cpp b/src/common/dbgrid.cpp index e41f15105a..418d445b16 100644 --- a/src/common/dbgrid.cpp +++ b/src/common/dbgrid.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dbgrid.cpp +// Name: src/common/dbgrid.cpp // Purpose: Displays a wxDbTable in a wxGrid. // Author: Roger Gammans, Paul Gammans // Modified by: @@ -17,20 +17,18 @@ #pragma hdrstop #endif - -#if wxUSE_ODBC -#if wxUSE_GRID +#if wxUSE_ODBC && wxUSE_GRID #ifndef WX_PRECOMP #include "wx/textctrl.h" #include "wx/dc.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/generic/gridctrl.h" #include "wx/dbgrid.h" // DLL options compatibility check: -#include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxDbGrid") @@ -274,7 +272,7 @@ wxString wxDbGridTableBase::GetTypeName(int WXUNUSED(row), int col) case SQL_C_CHAR: #ifdef SQL_C_WCHAR case SQL_C_WCHAR: -#endif +#endif return wxGRID_VALUE_STRING; case SQL_C_SHORT: case SQL_C_SSHORT: @@ -725,6 +723,4 @@ bool wxDbGridTableBase::Writeback() const WX_DEFINE_EXPORTED_OBJARRAY(keyarray) -#endif // #if wxUSE_GRID -#endif // #if wxUSE_ODBC - +#endif // wxUSE_GRID && wxUSE_ODBC diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 099ac32589..65270ac612 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -34,12 +34,12 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif //WX_PRECOMP #include "wx/filefn.h" #include "wx/utils.h" #include "wx/filename.h" // for SplitPath() -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/arrimpl.cpp" @@ -119,7 +119,7 @@ bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) } #elif defined(__WXPM__) || defined(__EMX__) - char err[256] = ""; + char err[256] = ""; DosLoadModule(err, sizeof(err), (PSZ)libname.c_str(), &m_handle); #else // this should be the only remaining branch eventually m_handle = RawLoad(libname, flags); diff --git a/src/common/evtloopcmn.cpp b/src/common/evtloopcmn.cpp index 36ce381b8d..21433e6b06 100644 --- a/src/common/evtloopcmn.cpp +++ b/src/common/evtloopcmn.cpp @@ -25,7 +25,10 @@ #endif #include "wx/evtloop.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif //WX_PRECOMP // ---------------------------------------------------------------------------- // globals diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 983212f6cb..41d46f5fc0 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -28,9 +28,9 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" #include "wx/file.h" #include "wx/textfile.h" #include "wx/memtext.h" @@ -45,16 +45,16 @@ #include "wx/utils.h" // for wxGetHomeDir #if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers - #include "wx/filename.h" // for MacSetTypeAndCreator + #include "wx/mac/private.h" // includes mac headers + #include "wx/filename.h" // for MacSetTypeAndCreator #endif #if defined(__WXMSW__) - #include "wx/msw/private.h" + #include "wx/msw/private.h" #endif //windows.h #if defined(__WXPM__) - #define INCL_DOS - #include + #define INCL_DOS + #include #endif #include @@ -70,7 +70,7 @@ // ---------------------------------------------------------------------------- #ifndef MAX_PATH - #define MAX_PATH 512 + #define MAX_PATH 512 #endif #define FILECONF_TRACE_MASK _T("fileconf") @@ -1902,20 +1902,20 @@ void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser) int CompareEntries(wxFileConfigEntry *p1, wxFileConfigEntry *p2) { - #if wxCONFIG_CASE_SENSITIVE +#if wxCONFIG_CASE_SENSITIVE return wxStrcmp(p1->Name(), p2->Name()); - #else +#else return wxStricmp(p1->Name(), p2->Name()); - #endif +#endif } int CompareGroups(wxFileConfigGroup *p1, wxFileConfigGroup *p2) { - #if wxCONFIG_CASE_SENSITIVE +#if wxCONFIG_CASE_SENSITIVE return wxStrcmp(p1->Name(), p2->Name()); - #else +#else return wxStricmp(p1->Name(), p2->Name()); - #endif +#endif } // ---------------------------------------------------------------------------- diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index db7616879a..bd59e23601 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -17,7 +17,7 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #include "wx/gdicmn.h" @@ -25,6 +25,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif #include "wx/brush.h" @@ -34,7 +35,6 @@ #include "wx/cursor.h" #include "wx/font.h" #include "wx/palette.h" -#include "wx/app.h" #include "wx/dc.h" #include "wx/utils.h" #include "wx/settings.h" diff --git a/src/common/http.cpp b/src/common/http.cpp index 24b6904e2e..af0512f967 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: http.cpp +// Name: src/common/http.cpp // Purpose: HTTP protocol // Author: Guilhem Lavaux // Modified by: Simo Virokannas (authentication, Dec 2005) @@ -13,7 +13,7 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #if wxUSE_PROTOCOL_HTTP @@ -22,8 +22,8 @@ #include #ifndef WX_PRECOMP -#include "wx/string.h" -#include "wx/app.h" + #include "wx/string.h" + #include "wx/app.h" #endif #include "wx/tokenzr.h" @@ -126,7 +126,7 @@ wxString wxHTTP::GenerateAuthString(const wxString& user, const wxString& pass) toencode.Printf(wxT("%s:%s"),user.c_str(),pass.c_str()); - size_t len = toencode.Length(); + size_t len = toencode.length(); const wxChar *from = toencode.c_str(); while (len >= 3) { // encode full blocks first buf << wxString::Format(wxT("%c%c"), base64[(from[0] >> 2) & 0x3f], base64[((from[0] << 4) & 0x30) | ((from[1] >> 4) & 0xf)]); @@ -180,7 +180,7 @@ bool wxHTTP::ParseHeaders() if (m_perr != wxPROTO_NOERR) return false; - if (line.Length() == 0) + if (line.length() == 0) break; wxString left_str = line.BeforeFirst(':'); @@ -261,7 +261,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) SetHeader(wxT("User-Agent"), wxT("wxWidgets 2.x")); // Send authentication information - if (m_username.Length()>0 || m_password.Length()>0) { + if (!m_username.empty() || !m_password.empty()) { SetHeader(wxT("Authorization"), GenerateAuthString(m_username, m_password)); } @@ -420,4 +420,3 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path) } #endif // wxUSE_PROTOCOL_HTTP - diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 7556b41fb2..d61d890e41 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -46,6 +46,7 @@ #include "wx/log.h" #include "wx/debug.h" #include "wx/utils.h" + #include "wx/app.h" #endif // WX_PRECOMP #ifndef __WXWINCE__ @@ -56,7 +57,7 @@ #include #include #ifdef HAVE_LANGINFO_H - #include + #include #endif #ifdef __WIN32__ @@ -73,12 +74,11 @@ #include "wx/encconv.h" #include "wx/hashmap.h" #include "wx/ptr_scpd.h" -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/stdpaths.h" #if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers + #include "wx/mac/private.h" // includes mac headers #endif // ---------------------------------------------------------------------------- diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 3d9f7b0b8d..788e0bdffe 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/popupcmn.cpp +// Name: src/common/popupcmn.cpp // Purpose: implementation of wxPopupTransientWindow // Author: Vadim Zeitlin // Modified by: @@ -32,7 +32,6 @@ #include "wx/combobox.h" // wxComboControl #include "wx/app.h" // wxPostEvent #include "wx/log.h" - #include "wx/app.h" #endif //WX_PRECOMP #ifdef __WXUNIVERSAL__ @@ -570,4 +569,3 @@ void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event) } #endif // wxUSE_POPUPWIN - diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 96e97de4fb..3f7554ef2e 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -30,9 +30,9 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/timer.h" #include "wx/utils.h" diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index a0617a7b5c..0a28ec92b6 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -22,11 +22,11 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/dcmemory.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/image.h" #include "wx/prntbase.h" #include "wx/generic/prntdlgg.h" @@ -1601,20 +1601,20 @@ bool wxPostScriptDC::StartDoc( const wxString& message ) const wxChar *paper; switch (m_printData.GetPaperId()) { - case wxPAPER_LETTER: paper = wxT("Letter"); break; // Letter: paper ""; 8 1/2 by 11 inches - case wxPAPER_LEGAL: paper = wxT("Legal"); break; // Legal, 8 1/2 by 14 inches - case wxPAPER_A4: paper = wxT("A4"); break; // A4 Sheet, 210 by 297 millimeters + case wxPAPER_LETTER: paper = wxT("Letter"); break; // Letter: paper ""; 8 1/2 by 11 inches + case wxPAPER_LEGAL: paper = wxT("Legal"); break; // Legal, 8 1/2 by 14 inches + case wxPAPER_A4: paper = wxT("A4"); break; // A4 Sheet, 210 by 297 millimeters case wxPAPER_TABLOID: paper = wxT("Tabloid"); break; // Tabloid, 11 by 17 inches - case wxPAPER_LEDGER: paper = wxT("Ledger"); break; // Ledger, 17 by 11 inches - case wxPAPER_STATEMENT: paper = wxT("Statement"); break; // Statement, 5 1/2 by 8 1/2 inches - case wxPAPER_EXECUTIVE: paper = wxT("Executive"); break; // Executive, 7 1/4 by 10 1/2 inches - case wxPAPER_A3: paper = wxT("A3"); break; // A3 sheet, 297 by 420 millimeters - case wxPAPER_A5: paper = wxT("A5"); break; // A5 sheet, 148 by 210 millimeters - case wxPAPER_B4: paper = wxT("B4"); break; // B4 sheet, 250 by 354 millimeters - case wxPAPER_B5: paper = wxT("B5"); break; // B5 sheet, 182-by-257-millimeter paper - case wxPAPER_FOLIO: paper = wxT("Folio"); break; // Folio, 8-1/2-by-13-inch paper - case wxPAPER_QUARTO: paper = wxT("Quaro"); break; // Quarto, 215-by-275-millimeter paper - case wxPAPER_10X14: paper = wxT("10x14"); break; // 10-by-14-inch sheet + case wxPAPER_LEDGER: paper = wxT("Ledger"); break; // Ledger, 17 by 11 inches + case wxPAPER_STATEMENT: paper = wxT("Statement"); break; // Statement, 5 1/2 by 8 1/2 inches + case wxPAPER_EXECUTIVE: paper = wxT("Executive"); break; // Executive, 7 1/4 by 10 1/2 inches + case wxPAPER_A3: paper = wxT("A3"); break; // A3 sheet, 297 by 420 millimeters + case wxPAPER_A5: paper = wxT("A5"); break; // A5 sheet, 148 by 210 millimeters + case wxPAPER_B4: paper = wxT("B4"); break; // B4 sheet, 250 by 354 millimeters + case wxPAPER_B5: paper = wxT("B5"); break; // B5 sheet, 182-by-257-millimeter paper + case wxPAPER_FOLIO: paper = wxT("Folio"); break; // Folio, 8-1/2-by-13-inch paper + case wxPAPER_QUARTO: paper = wxT("Quaro"); break; // Quarto, 215-by-275-millimeter paper + case wxPAPER_10X14: paper = wxT("10x14"); break; // 10-by-14-inch sheet default: paper = wxT("A4"); } PsPrintf( wxT("%%%%DocumentPaperSizes: %s\n"), paper ); diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 7c431b8efa..25e4e109ac 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp +// Name: src/gtk/cursor.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,8 +11,12 @@ #include "wx/wxprec.h" #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/utils.h" -#include "wx/app.h" #include "wx/gtk/private.h" //for idle stuff diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index b1a0e714b5..c9e08da558 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/debug.h" #include "wx/mstream.h" #include "wx/image.h" @@ -239,7 +239,7 @@ bool wxFileDataObject::GetDataHere(void *buf) const memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 ); - return TRUE; + return true; } size_t wxFileDataObject::GetDataSize() const @@ -303,7 +303,7 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) } } - return TRUE; + return true; } void wxFileDataObject::AddFile( const wxString &filename ) @@ -348,12 +348,12 @@ bool wxBitmapDataObject::GetDataHere(void *buf) const { wxFAIL_MSG( wxT("attempt to copy empty bitmap failed") ); - return FALSE; + return false; } memcpy(buf, m_pngData, m_pngSize); - return TRUE; + return true; } bool wxBitmapDataObject::SetData(size_t size, const void *buf) @@ -361,7 +361,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) Clear(); wxCHECK_MSG( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL, - FALSE, wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") ); + false, wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") ); m_pngSize = size; m_pngData = malloc(m_pngSize); @@ -372,7 +372,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) wxImage image; if ( !image.LoadFile( mstream, wxBITMAP_TYPE_PNG ) ) { - return FALSE; + return false; } m_bitmap = wxBitmap(image); diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 31df13df6b..1464cc2563 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/gtk/dialog.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,8 +11,12 @@ #include "wx/wxprec.h" #include "wx/dialog.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" -#include "wx/app.h" #include "wx/cursor.h" #include "wx/evtloop.h" diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index b847b0b8ef..946de36ded 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -17,10 +17,10 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/utils.h" @@ -338,7 +338,7 @@ static gboolean target_drag_drop( GtkWidget *widget, } else { - wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned TRUE") ); + wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned true") ); #if wxUSE_THREADS /* disable GUI threads */ @@ -416,7 +416,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) ) { - wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned TRUE") ); + wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned true") ); /* tell GTK that data transfer was successful */ gtk_drag_finish( context, TRUE, FALSE, time ); diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index d684ccb0eb..2c9fe3c6ea 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: gtk/evtloop.cpp +// Name: src/gtk/evtloop.cpp // Purpose: implements wxEventLoop for GTK+ // Author: Vadim Zeitlin // Modified by: @@ -25,7 +25,10 @@ #endif #include "wx/evtloop.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP #include @@ -106,10 +109,9 @@ bool wxEventLoop::Pending() const bool wxEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); gtk_main_iteration(); - return TRUE; + return true; } - diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 1612603a1e..6706922aae 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -19,9 +19,13 @@ // ---------------------------------------------------------------------------- #include "wx/frame.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/dialog.h" #include "wx/control.h" -#include "wx/app.h" #include "wx/menu.h" #if wxUSE_TOOLBAR #include "wx/toolbar.h" diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 98d32c753f..4ef6d70a22 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -16,10 +16,13 @@ #include "wx/glcanvas.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" #include "wx/colour.h" #include "wx/module.h" -#include "wx/app.h" extern "C" { @@ -216,7 +219,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) event.SetEventObject( win ); win->GetEventHandler()->ProcessEvent( event ); - win->m_exposed = FALSE; + win->m_exposed = false; win->GetUpdateRegion().Clear(); } @@ -235,7 +238,7 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e if (g_isIdle) wxapp_install_idle_handler(); - win->m_exposed = TRUE; + win->m_exposed = true; win->GetUpdateRegion().Union( gdk_event->area.x, gdk_event->area.y, @@ -318,9 +321,9 @@ bool wxGLCanvas::Create( wxWindow *parent, m_sharedContextOf = (wxGLCanvas*)shared_context_of; // const_cast m_glContext = (wxGLContext*) NULL; - m_exposed = FALSE; - m_noExpose = TRUE; - m_nativeSizeEvent = TRUE; + m_exposed = false; + m_noExpose = true; + m_nativeSizeEvent = true; m_fbc = NULL; m_vi = NULL; @@ -334,22 +337,22 @@ bool wxGLCanvas::Create( wxWindow *parent, if (wxTheApp->m_glFBCInfo != NULL) { fbc = (GLXFBConfig *) wxTheApp->m_glFBCInfo; - m_canFreeFBC = FALSE; // owned by wxTheApp - don't free upon destruction + m_canFreeFBC = false; // owned by wxTheApp - don't free upon destruction } else { fbc = (GLXFBConfig *) wxGLCanvas::ChooseGLFBC(attribList); - m_canFreeFBC = TRUE; + m_canFreeFBC = true; } m_fbc = fbc; // save for later use - wxCHECK_MSG( m_fbc, FALSE, _T("required FBConfig couldn't be found") ); + wxCHECK_MSG( m_fbc, false, _T("required FBConfig couldn't be found") ); } XVisualInfo *vi = NULL; if (wxTheApp->m_glVisualInfo != NULL) { vi = (XVisualInfo *)wxTheApp->m_glVisualInfo; - m_canFreeVi = FALSE; // owned by wxTheApp - don't free upon destruction + m_canFreeVi = false; // owned by wxTheApp - don't free upon destruction } else { @@ -360,12 +363,12 @@ bool wxGLCanvas::Create( wxWindow *parent, // GLX <= 1.2 vi = (XVisualInfo *) ChooseGLVisual(attribList); - m_canFreeVi = TRUE; + m_canFreeVi = true; } m_vi = vi; // save for later use - wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") ); + wxCHECK_MSG( m_vi, false, _T("required visual couldn't be found") ); GdkVisual *visual; GdkColormap *colormap; @@ -432,7 +435,7 @@ bool wxGLCanvas::Create( wxWindow *parent, if (GTK_WIDGET_MAPPED(m_wxwindow)) gtk_glwindow_map_callback( m_wxwindow, this ); - return TRUE; + return true; } wxGLCanvas::~wxGLCanvas() @@ -630,7 +633,7 @@ void wxGLCanvas::OnInternalIdle() event.SetEventObject( this ); GetEventHandler()->ProcessEvent( event ); - m_exposed = FALSE; + m_exposed = false; GetUpdateRegion().Clear(); } diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 6a60ddb0b4..66ea1d2293 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/bitmap.h" #if wxUSE_ACCEL @@ -151,7 +151,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow) void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style) { // the parent window is known after wxFrame::SetMenu() - m_needParent = FALSE; + m_needParent = false; m_style = style; m_invokingWindow = (wxWindow*) NULL; @@ -286,7 +286,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win ) bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) { if ( !wxMenuBarBase::Append( menu, title ) ) - return FALSE; + return false; return GtkAppend(menu, title); } @@ -332,20 +332,20 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title, int pos) frame->UpdateMenuBarSize(); } - return TRUE; + return true; } bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; + return false; // TODO if ( !GtkAppend(menu, title, (int)pos) ) - return FALSE; + return false; - return TRUE; + return true; } wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) @@ -884,9 +884,9 @@ void wxMenuItem::Enable( bool enable ) bool wxMenuItem::IsChecked() const { - wxCHECK_MSG( m_menuItem, FALSE, wxT("invalid menu item") ); + wxCHECK_MSG( m_menuItem, false, wxT("invalid menu item") ); - wxCHECK_MSG( IsCheckable(), FALSE, + wxCHECK_MSG( IsCheckable(), false, wxT("can't get state of uncheckable item!") ); return ((GtkCheckMenuItem*)m_menuItem)->active != 0; @@ -1086,7 +1086,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) // gtk_widget_lock_accelerators(mitem->GetMenuItem()); } - return TRUE; + return true; } wxMenuItem* wxMenu::DoAppend(wxMenuItem *mitem) @@ -1415,7 +1415,7 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) extern "C" WXDLLIMPEXP_CORE void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting ) { - *is_waiting = FALSE; + *is_waiting = false; } WXDLLIMPEXP_CORE void SetInvokingWindow( wxMenu *menu, wxWindow* win ) diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index f721ea4405..47a877cd71 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: popupwin.cpp +// Name: src/gtk/popupwin.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -13,8 +13,12 @@ #if wxUSE_POPUPWIN #include "wx/popupwin.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" -#include "wx/app.h" #include "wx/cursor.h" #include @@ -165,13 +169,13 @@ wxPopupWindow::~wxPopupWindow() bool wxPopupWindow::Create( wxWindow *parent, int style ) { - m_needParent = FALSE; + m_needParent = false; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { wxFAIL_MSG( wxT("wxPopupWindow creation failed") ); - return FALSE; + return false; } // Unlike windows, top level windows are created hidden by default. @@ -216,7 +220,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) g_signal_connect (m_widget, "button_press_event", G_CALLBACK (gtk_popup_button_press), this); - return TRUE; + return true; } void wxPopupWindow::DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height) ) @@ -230,7 +234,7 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid dialog") ); if (m_resizing) return; /* I don't like recursions */ - m_resizing = TRUE; + m_resizing = true; int old_x = m_x; int old_y = m_y; @@ -292,11 +296,11 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag /* actual resizing is deferred to GtkOnSize in idle time and when showing the dialog */ - m_sizeSet = FALSE; + m_sizeSet = false; } - m_resizing = FALSE; + m_resizing = false; } void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height ) @@ -330,7 +334,7 @@ void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int (GdkWindowHints) flag ); - m_sizeSet = TRUE; + m_sizeSet = true; wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 904220c40b..877082cdc6 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -26,11 +26,11 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/dialog.h" #include "wx/control.h" -#include "wx/app.h" #include "wx/dcclient.h" #include "wx/gtk/private.h" #include "wx/timer.h" diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp index ea43bbd03f..5ae3a6c659 100644 --- a/src/gtk/utilsres.cpp +++ b/src/gtk/utilsres.cpp @@ -16,10 +16,10 @@ #include "wx/list.h" #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/config.h" -#include "wx/app.h" //----------------------------------------------------------------------------- // resource functions diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ebef3383a3..1ab4c6e774 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -19,11 +19,11 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/dcclient.h" #include "wx/frame.h" -#include "wx/app.h" #include "wx/layout.h" #include "wx/utils.h" #include "wx/dialog.h" @@ -1594,7 +1594,7 @@ gtk_window_button_press_callback( GtkWidget *widget, // reset the event object and id in case win changed. event.SetEventObject( win ); event.SetId( win->GetId() ); - + if (win->GetEventHandler()->ProcessEvent( event )) { g_signal_stop_emission_by_name (widget, "button_press_event"); diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index e382abbec1..facb2e7204 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -11,12 +11,16 @@ #include "wx/wxprec.h" #include "wx/bitmap.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/palette.h" #include "wx/icon.h" #include "wx/filefn.h" #include "wx/image.h" #include "wx/dcmemory.h" -#include "wx/app.h" #include #include diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 70a3e24583..6e9d9f33a8 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp +// Name: src/gtk1/cursor.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,8 +11,12 @@ #include "wx/wxprec.h" #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/utils.h" -#include "wx/app.h" #include #include diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 241ac078a0..0ac72c51b0 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/debug.h" #include "wx/mstream.h" #include "wx/image.h" @@ -227,7 +227,7 @@ bool wxFileDataObject::GetDataHere(void *buf) const memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 ); - return TRUE; + return true; } size_t wxFileDataObject::GetDataSize() const @@ -291,7 +291,7 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) } } - return TRUE; + return true; } void wxFileDataObject::AddFile( const wxString &filename ) @@ -336,12 +336,12 @@ bool wxBitmapDataObject::GetDataHere(void *buf) const { wxFAIL_MSG( wxT("attempt to copy empty bitmap failed") ); - return FALSE; + return false; } memcpy(buf, m_pngData, m_pngSize); - return TRUE; + return true; } bool wxBitmapDataObject::SetData(size_t size, const void *buf) @@ -349,7 +349,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) Clear(); wxCHECK_MSG( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL, - FALSE, wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") ); + false, wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") ); m_pngSize = size; m_pngData = malloc(m_pngSize); @@ -360,7 +360,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) wxImage image; if ( !image.LoadFile( mstream, wxBITMAP_TYPE_PNG ) ) { - return FALSE; + return false; } m_bitmap = wxBitmap(image); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index f9f34936ff..eab01d62fd 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/gtk1/dialog.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,8 +11,12 @@ #include "wx/wxprec.h" #include "wx/dialog.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" -#include "wx/app.h" #include "wx/cursor.h" #include "wx/evtloop.h" diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index f1c5971ae6..4da84ef7b0 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -17,10 +17,10 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/utils.h" diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index d684ccb0eb..b610e01a75 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: gtk/evtloop.cpp +// Name: src/gtk1/evtloop.cpp // Purpose: implements wxEventLoop for GTK+ // Author: Vadim Zeitlin // Modified by: @@ -25,7 +25,10 @@ #endif #include "wx/evtloop.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP #include @@ -106,10 +109,9 @@ bool wxEventLoop::Pending() const bool wxEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); gtk_main_iteration(); - return TRUE; + return true; } - diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 7d7824daa4..bd426249ad 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -19,9 +19,13 @@ // ---------------------------------------------------------------------------- #include "wx/frame.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/dialog.h" #include "wx/control.h" -#include "wx/app.h" #include "wx/menu.h" #if wxUSE_TOOLBAR #include "wx/toolbar.h" diff --git a/src/gtk1/glcanvas.cpp b/src/gtk1/glcanvas.cpp index 44fede6bfd..5d4bcc5c82 100644 --- a/src/gtk1/glcanvas.cpp +++ b/src/gtk1/glcanvas.cpp @@ -16,10 +16,13 @@ #include "wx/glcanvas.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" #include "wx/colour.h" #include "wx/module.h" -#include "wx/app.h" extern "C" { @@ -221,7 +224,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) event.SetEventObject( win ); win->GetEventHandler()->ProcessEvent( event ); - win->m_exposed = FALSE; + win->m_exposed = false; win->GetUpdateRegion().Clear(); } @@ -240,7 +243,7 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e if (g_isIdle) wxapp_install_idle_handler(); - win->m_exposed = TRUE; + win->m_exposed = true; win->GetUpdateRegion().Union( gdk_event->area.x, gdk_event->area.y, @@ -260,7 +263,7 @@ gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxG if (g_isIdle) wxapp_install_idle_handler(); - win->m_exposed = TRUE; + win->m_exposed = true; win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height ); @@ -341,9 +344,9 @@ bool wxGLCanvas::Create( wxWindow *parent, m_sharedContextOf = (wxGLCanvas*)shared_context_of; // const_cast m_glContext = (wxGLContext*) NULL; - m_exposed = FALSE; - m_noExpose = TRUE; - m_nativeSizeEvent = TRUE; + m_exposed = false; + m_noExpose = true; + m_nativeSizeEvent = true; m_fbc = NULL; m_vi = NULL; @@ -357,22 +360,22 @@ bool wxGLCanvas::Create( wxWindow *parent, if (wxTheApp->m_glFBCInfo != NULL) { fbc = (GLXFBConfig *) wxTheApp->m_glFBCInfo; - m_canFreeFBC = FALSE; // owned by wxTheApp - don't free upon destruction + m_canFreeFBC = false; // owned by wxTheApp - don't free upon destruction } else { fbc = (GLXFBConfig *) wxGLCanvas::ChooseGLFBC(attribList); - m_canFreeFBC = TRUE; + m_canFreeFBC = true; } m_fbc = fbc; // save for later use - wxCHECK_MSG( m_fbc, FALSE, _T("required FBConfig couldn't be found") ); + wxCHECK_MSG( m_fbc, false, _T("required FBConfig couldn't be found") ); } XVisualInfo *vi = NULL; if (wxTheApp->m_glVisualInfo != NULL) { vi = (XVisualInfo *)wxTheApp->m_glVisualInfo; - m_canFreeVi = FALSE; // owned by wxTheApp - don't free upon destruction + m_canFreeVi = false; // owned by wxTheApp - don't free upon destruction } else { @@ -383,12 +386,12 @@ bool wxGLCanvas::Create( wxWindow *parent, // GLX <= 1.2 vi = (XVisualInfo *) ChooseGLVisual(attribList); - m_canFreeVi = TRUE; + m_canFreeVi = true; } m_vi = vi; // save for later use - wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") ); + wxCHECK_MSG( m_vi, false, _T("required visual couldn't be found") ); GdkVisual *visual; GdkColormap *colormap; @@ -454,7 +457,7 @@ bool wxGLCanvas::Create( wxWindow *parent, if (GTK_WIDGET_MAPPED(m_wxwindow)) gtk_glwindow_map_callback( m_wxwindow, this ); - return TRUE; + return true; } wxGLCanvas::~wxGLCanvas() @@ -652,7 +655,7 @@ void wxGLCanvas::OnInternalIdle() event.SetEventObject( this ); GetEventHandler()->ProcessEvent( event ); - m_exposed = FALSE; + m_exposed = false; GetUpdateRegion().Clear(); } diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index edde839bcf..fecfe0b787 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/bitmap.h" #if wxUSE_ACCEL @@ -1450,7 +1450,7 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) extern "C" WXDLLIMPEXP_CORE void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting ) { - *is_waiting = FALSE; + *is_waiting = false; } WXDLLIMPEXP_CORE void SetInvokingWindow( wxMenu *menu, wxWindow* win ) diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index d595744fab..464ccd4bde 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: popupwin.cpp +// Name: src/gtk1/popupwin.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -13,8 +13,12 @@ #if wxUSE_POPUPWIN #include "wx/popupwin.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/frame.h" -#include "wx/app.h" #include "wx/cursor.h" #include @@ -168,13 +172,13 @@ wxPopupWindow::~wxPopupWindow() bool wxPopupWindow::Create( wxWindow *parent, int style ) { - m_needParent = FALSE; + m_needParent = false; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { wxFAIL_MSG( wxT("wxPopupWindow creation failed") ); - return FALSE; + return false; } // Unlike windows, top level windows are created hidden by default. @@ -231,7 +235,7 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid dialog") ); if (m_resizing) return; /* I don't like recursions */ - m_resizing = TRUE; + m_resizing = true; int old_x = m_x; int old_y = m_y; @@ -292,11 +296,11 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag /* actual resizing is deferred to GtkOnSize in idle time and when showing the dialog */ - m_sizeSet = FALSE; + m_sizeSet = false; } - m_resizing = FALSE; + m_resizing = false; } void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height ) @@ -330,7 +334,7 @@ void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int (GdkWindowHints) flag ); - m_sizeSet = TRUE; + m_sizeSet = true; wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 414790ab21..b34f80b278 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -26,11 +26,11 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/dialog.h" #include "wx/control.h" -#include "wx/app.h" #include "wx/dcclient.h" #include "wx/gtk1/private.h" #include "wx/timer.h" diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index b04e3af62e..aa8b739307 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -16,10 +16,10 @@ #include "wx/list.h" #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/config.h" -#include "wx/app.h" //----------------------------------------------------------------------------- // resource functions diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index d5a37d77f8..738fdc8086 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -19,11 +19,11 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/dcclient.h" #include "wx/frame.h" -#include "wx/app.h" #include "wx/layout.h" #include "wx/utils.h" #include "wx/dialog.h" diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 0abe5400dd..7efb69af34 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -19,6 +19,7 @@ #include "wx/dynarray.h" #include "wx/log.h" #include "wx/intl.h" + #include "wx/app.h" #endif #include "wx/tokenzr.h" @@ -34,7 +35,6 @@ #endif // DLL options compatibility check: -#include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxHTML") const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug"); diff --git a/src/mac/carbon/cfsocket.cpp b/src/mac/carbon/cfsocket.cpp index 0e21467d84..45c8b20ecd 100644 --- a/src/mac/carbon/cfsocket.cpp +++ b/src/mac/carbon/cfsocket.cpp @@ -25,9 +25,9 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/timer.h" #include "wx/utils.h" diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp index c5f05871f0..1e49197c03 100644 --- a/src/mac/carbon/clipbrd.cpp +++ b/src/mac/carbon/clipbrd.cpp @@ -19,9 +19,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/frame.h" #include "wx/bitmap.h" #include "wx/utils.h" diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 7dff26019e..d059e9d917 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: control.cpp +// Name: src/mac/carbon/control.cpp // Purpose: wxControl class // Author: Stefan Csomor // Modified by: @@ -12,8 +12,12 @@ #include "wx/wxprec.h" #include "wx/control.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/panel.h" -#include "wx/app.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/notebook.h" @@ -91,4 +95,3 @@ void wxControl::OnKeyDown( wxKeyEvent &event ) m_peer->HandleKey( keyCode, charCode, modifiers ); } - diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp index caa824901d..4f3f0d47e5 100644 --- a/src/mac/carbon/cursor.cpp +++ b/src/mac/carbon/cursor.cpp @@ -6,13 +6,17 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" -#include "wx/app.h" #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/icon.h" #include "wx/image.h" #include "wx/xpmdecod.h" diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 46d1b080b6..1d07f86074 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -17,9 +17,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/mac/uma.h" #include "wx/dcmemory.h" #include "wx/dcprint.h" diff --git a/src/mac/carbon/dccg.cpp b/src/mac/carbon/dccg.cpp index 7557864d65..2378561aa3 100755 --- a/src/mac/carbon/dccg.cpp +++ b/src/mac/carbon/dccg.cpp @@ -17,9 +17,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/mac/uma.h" #include "wx/dcmemory.h" #include "wx/dcprint.h" diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 402b749e7c..5eeadbf263 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -1,20 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/mac/carbon/dialog.cpp // Purpose: wxDialog class // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #include "wx/dialog.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/utils.h" #include "wx/frame.h" -#include "wx/app.h" #include "wx/settings.h" #include "wx/mac/uma.h" @@ -64,7 +68,7 @@ bool wxDialog::Create( wxWindow *parent, if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) ) return false; - + #if TARGET_API_MAC_OSX HIViewRef growBoxRef = 0 ; OSStatus err = HIViewFindByID( HIViewGetRoot( (WindowRef)m_macWindow ), kHIViewWindowGrowBoxID, &growBoxRef ); @@ -171,7 +175,7 @@ void wxDialog::DoShowModal() wxModalDialogs.Append(this); SetFocus() ; - + #if TARGET_CARBON BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; #else @@ -270,4 +274,3 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); Refresh(); } - diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 86fbae49bc..22cef52744 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dnd.cpp +// Name: src/mac/carbon/dnd.cpp // Purpose: wxDropTarget, wxDropSource implementations // Author: Stefan Csomor // Modified by: @@ -14,9 +14,13 @@ #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/window.h" #include "wx/toplevel.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/mac/private.h" @@ -265,7 +269,7 @@ bool wxDropTarget::GetData() HFSFlavor* theFile = (HFSFlavor*)theData; wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ); - if (!name.IsEmpty()) + if (!name.empty()) filenamesPassed += name + wxT("\n"); } break; diff --git a/src/mac/carbon/evtloop.cpp b/src/mac/carbon/evtloop.cpp index d5a9804e67..0d1ba9532e 100644 --- a/src/mac/carbon/evtloop.cpp +++ b/src/mac/carbon/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: mac/carbon/evtloop.cpp +// Name: src/mac/carbon/evtloop.cpp // Purpose: implementation of wxEventLoop for wxMac // Author: Vadim Zeitlin // Modified by: @@ -25,7 +25,10 @@ #endif #include "wx/evtloop.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP #ifdef __DARWIN__ #include @@ -104,4 +107,3 @@ bool wxEventLoop::Dispatch() wxTheApp->MacDoOneEvent(); return true; } - diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index ec4c14e7f4..5b668fec72 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/filedlg.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/tokenzr.h" @@ -26,8 +26,8 @@ #include "wx/mac/private.h" #ifndef __DARWIN__ - #include - #include "PLStringFuncs.h" + #include + #include "PLStringFuncs.h" #endif #include "MoreFilesX.h" diff --git a/src/mac/carbon/frame.cpp b/src/mac/carbon/frame.cpp index c888e6c41d..47505c64d7 100644 --- a/src/mac/carbon/frame.cpp +++ b/src/mac/carbon/frame.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp +// Name: src/mac/carbon/frame.cpp // Purpose: wxFrame // Author: Stefan Csomor // Modified by: @@ -12,6 +12,11 @@ #include "wx/wxprec.h" #include "wx/frame.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/statusbr.h" #include "wx/toolbar.h" #include "wx/menuitem.h" @@ -19,7 +24,6 @@ #include "wx/dcclient.h" #include "wx/dialog.h" #include "wx/settings.h" -#include "wx/app.h" #include "wx/mac/uma.h" @@ -398,4 +402,3 @@ void wxFrame::PositionBars() } #endif - diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index ace8cfff04..d238da7cd0 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -18,9 +18,9 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index b73db78b20..c4e9815e8a 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -22,9 +22,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/menuitem.h" #include "wx/window.h" #include "wx/log.h" diff --git a/src/mac/carbon/menuitem.cpp b/src/mac/carbon/menuitem.cpp index 6065ff1b92..44b80b1319 100644 --- a/src/mac/carbon/menuitem.cpp +++ b/src/mac/carbon/menuitem.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp +// Name: src/mac/carbon/menuitem.cpp // Purpose: wxMenuItem implementation // Author: Stefan Csomor // Modified by: @@ -11,10 +11,14 @@ #include "wx/wxprec.h" -#include "wx/app.h" -#include "wx/menu.h" #include "wx/menuitem.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + +#include "wx/menu.h" + #include "wx/mac/uma.h" IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) diff --git a/src/mac/carbon/msgdlg.cpp b/src/mac/carbon/msgdlg.cpp index 4068893003..fe6cf21729 100644 --- a/src/mac/carbon/msgdlg.cpp +++ b/src/mac/carbon/msgdlg.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/mac/uma.h" @@ -62,7 +62,7 @@ int wxMessageDialog::ShowModal() wxMacCFStringHolder cfNoString( _("No"), m_font.GetEncoding() ); wxMacCFStringHolder cfYesString( _("Yes"), m_font.GetEncoding() ); - wxMacCFStringHolder cfOKString( _("OK") , m_font.GetEncoding()) ; + wxMacCFStringHolder cfOKString( _("OK") , m_font.GetEncoding()) ; wxMacCFStringHolder cfCancelString( _("Cancel"), m_font.GetEncoding() ); int buttonId[4] = { 0, 0, 0, wxID_CANCEL /* time-out */ }; diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index a14cbd6f7f..28e18d9174 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -18,9 +18,9 @@ #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/string.h" #include "wx/imaglist.h" #include "wx/image.h" diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index 0415a33953..11df02ce13 100644 --- a/src/mac/carbon/printmac.cpp +++ b/src/mac/carbon/printmac.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: printwin.cpp +// Name: src/mac/carbon/printwin.cpp // Purpose: wxMacPrinter framework // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -15,14 +15,14 @@ #if wxUSE_PRINTING_ARCHITECTURE #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/dc.h" -#include "wx/app.h" -#include "wx/msgdlg.h" + #include "wx/utils.h" + #include "wx/dc.h" + #include "wx/app.h" + #include "wx/msgdlg.h" #endif #include "wx/math.h" @@ -41,7 +41,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMacCarbonPrintData, wxPrintNativeDataBase) IMPLEMENT_DYNAMIC_CLASS(wxMacPrinter, wxPrinterBase) IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase) -bool wxMacCarbonPrintData::Ok() const +bool wxMacCarbonPrintData::Ok() const { return (m_macPageFormat != kPMNoPageFormat) && (m_macPrintSettings != kPMNoPrintSettings) && (m_macPrintSession != kPMNoReference); } @@ -66,7 +66,7 @@ wxMacCarbonPrintData::~wxMacCarbonPrintData() (void)PMRelease(m_macPrintSettings); m_macPrintSettings = kPMNoPrintSettings; } - + if ( m_macPrintSession != kPMNoReference ) { (void)PMRelease(m_macPrintSession); @@ -74,7 +74,7 @@ wxMacCarbonPrintData::~wxMacCarbonPrintData() } } -void wxMacCarbonPrintData::ValidateOrCreate() +void wxMacCarbonPrintData::ValidateOrCreate() { OSStatus err = noErr ; if ( m_macPrintSession == kPMNoReference ) @@ -85,7 +85,7 @@ void wxMacCarbonPrintData::ValidateOrCreate() if ( m_macPageFormat == kPMNoPageFormat) { err = PMCreatePageFormat((PMPageFormat *) &m_macPageFormat); - + // Note that PMPageFormat is not session-specific, but calling // PMSessionDefaultPageFormat assigns values specific to the printer // associated with the current printing session. @@ -102,12 +102,12 @@ void wxMacCarbonPrintData::ValidateOrCreate() (PMPageFormat) m_macPageFormat, kPMDontWantBoolean); } - + // Set up a valid PrintSettings object. if ( m_macPrintSettings == kPMNoPrintSettings) { err = PMCreatePrintSettings((PMPrintSettings *) &m_macPrintSettings); - + // Note that PMPrintSettings is not session-specific, but calling // PMSessionDefaultPrintSettings assigns values specific to the printer // associated with the current printing session. @@ -134,7 +134,7 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data ) kPMLandscape : kPMPortrait , false ) ; // collate cannot be set #if 0 // not yet tested - if ( m_printerName.Length() > 0 ) + if ( !m_printerName.empty() ) PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ; #endif PMColorMode color ; @@ -146,7 +146,7 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data ) } else PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMBlackAndWhite ) ; - + // PMDuplexMode not yet accessible via API // PMQualityMode not yet accessible via API // todo paperSize @@ -163,12 +163,12 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data ) bool wxMacCarbonPrintData::TransferTo( wxPrintData &data ) { OSStatus err = noErr ; - + UInt32 copies ; err = PMGetCopies( m_macPrintSettings , &copies ) ; if ( err == noErr ) - data.SetNoCopies( copies ) ; - + data.SetNoCopies( copies ) ; + PMOrientation orientation ; err = PMGetOrientation( m_macPageFormat , &orientation ) ; if ( err == noErr ) @@ -189,16 +189,16 @@ bool wxMacCarbonPrintData::TransferTo( wxPrintData &data ) m_printerName = name.AsString() ; } #endif - + PMColorMode color ; err = PMGetColorMode( m_macPrintSettings, &color ) ; if ( err == noErr ) data.SetColour( !(color == kPMBlackAndWhite) ) ; - + // PMDuplexMode not yet accessible via API // PMQualityMode not yet accessible via API // todo paperSize - PMRect rPaper; + PMRect rPaper; err = PMGetUnadjustedPaperRect( m_macPageFormat, &rPaper); if ( err == noErr ) { @@ -227,10 +227,10 @@ void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data ) if ( err == noErr ) { data->SetMinMarginTopLeft( wxPoint ( - (int)(((double) rPage.left - rPaper.left ) * pt2mm) , - (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; - - data->SetMinMarginBottomRight( wxPoint ( + (int)(((double) rPage.left - rPaper.left ) * pt2mm) , + (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; + + data->SetMinMarginBottomRight( wxPoint ( (wxCoord)(((double) rPaper.right - rPage.right ) * pt2mm), (wxCoord)(((double) rPaper.bottom - rPage.bottom ) * pt2mm)) ) ; @@ -248,8 +248,8 @@ void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data ) if ( data->GetMarginBottomRight().y < data->GetMinMarginBottomRight().y ) data->SetMarginBottomRight( wxPoint( data->GetMarginBottomRight().x , data->GetMinMarginBottomRight().y) ); - } - } + } + } } void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data ) @@ -318,7 +318,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) if (m_printDialogData.GetMaxPage() < 1) m_printDialogData.SetMaxPage(9999); - // Create a suitable device context + // Create a suitable device context wxDC *dc = NULL; if (prompt) { @@ -414,7 +414,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) break; int pn; - for (pn = m_printDialogData.GetFromPage(); + for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn); pn++) { @@ -441,36 +441,36 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) } printout->OnEndDocument(); } - + printout->OnEndPrinting(); - + if (sm_abortWindow) { sm_abortWindow->Show(false); delete sm_abortWindow; sm_abortWindow = NULL; } - + wxEndBusyCursor(); - + delete dc; - + return true; } wxDC* wxMacPrinter::PrintDialog(wxWindow *parent) { wxDC* dc = (wxDC*) NULL; - + wxPrintDialog dialog(parent, & m_printDialogData); int ret = dialog.ShowModal(); - + if (ret == wxID_OK) { dc = dialog.GetPrintDC(); m_printDialogData = dialog.GetPrintDialogData(); } - + return dc; } @@ -479,12 +479,12 @@ bool wxMacPrinter::Setup(wxWindow *parent) #if 0 wxPrintDialog dialog(parent, & m_printDialogData); dialog.GetPrintDialogData().SetSetupDialog(true); - + int ret = dialog.ShowModal(); - + if (ret == wxID_OK) m_printDialogData = dialog.GetPrintDialogData(); - + return (ret == wxID_OK); #endif @@ -526,7 +526,7 @@ void wxMacPrintPreview::DetermineScaling(void) { int screenWidth , screenHeight ; wxDisplaySize( &screenWidth , &screenHeight ) ; - + m_previewPrintout->SetPPIScreen( 72 , 72 ) ; m_previewPrintout->SetPPIPrinter( 72 , 72 ) ; m_previewPrintout->SetPageSizeMM( (int) (8.0 * 25.6), (int) (11.0 * 25.6) ); @@ -534,7 +534,7 @@ void wxMacPrintPreview::DetermineScaling(void) m_pageWidth = 8 * 72 ; m_pageHeight = 11 * 72 ; m_previewScale = 1 ; - + // Get a device context for the currently selected printer wxPrinterDC printerDC(m_printDialogData.GetPrintData()); if (printerDC.Ok()) @@ -558,7 +558,7 @@ void wxMacPrintPreview::DetermineScaling(void) // m_previewScale = (float)((float)screenWidth/(float)printerWidth); // m_previewScale = m_previewScale * (float)((float)screenXRes/(float)printerXRes); - m_previewScale = 1 ; + m_previewScale = 1 ; } #endif diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 3cb7739700..b6bb94d019 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -13,8 +13,12 @@ #if wxUSE_STATTEXT -#include "wx/app.h" #include "wx/stattext.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/notebook.h" #include "wx/tabctrl.h" #include "wx/dc.h" @@ -81,7 +85,7 @@ wxSize wxStaticText::DoGetBestSize() const if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont ) { err = GetThemeTextDimensions( - (m_label.Length() > 0 ? (CFStringRef)str : CFSTR(" ")), + (!m_label.empty() ? (CFStringRef)str : CFSTR(" ")), m_font.MacGetThemeFontID(), kThemeStateActive, false, &bounds, &baseline ); verify_noerr( err ); } @@ -93,12 +97,12 @@ wxSize wxStaticText::DoGetBestSize() const ::TextFace( m_font.MacGetFontStyle() ); err = GetThemeTextDimensions( - (m_label.Length() > 0 ? (CFStringRef)str : CFSTR(" ")), + (!m_label.empty() ? (CFStringRef)str : CFSTR(" ")), kThemeCurrentPortFont, kThemeStateActive, false, &bounds, &baseline ); verify_noerr( err ); } - if ( m_label.Length() == 0 ) + if ( m_label.empty() ) bounds.h = 0; bounds.h += MacGetLeftBorderSize() + MacGetRightBorderSize(); @@ -145,4 +149,3 @@ bool wxStaticText::SetFont(const wxFont& font) } #endif //if wxUSE_STATTEXT - diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index fddd31d2bc..0a622adfb4 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -17,6 +17,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif #ifdef __DARWIN__ @@ -36,7 +37,6 @@ #endif #endif -#include "wx/app.h" #include "wx/dc.h" #include "wx/button.h" #include "wx/toplevel.h" @@ -47,9 +47,9 @@ #include "wx/menu.h" #if defined(__BORLANDC__) && !defined(__WIN32__) - #include + #include #elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__DARWIN__) - #include + #include #endif #ifndef __DARWIN__ diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 30d4ba508d..d2038b876b 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: tooltip.cpp +// Name: src/mac/carbon/tooltip.cpp // Purpose: wxToolTip implementation // Author: Stefan Csomor // Id: $Id$ @@ -11,10 +11,14 @@ #if wxUSE_TOOLTIPS -#include "wx/app.h" +#include "wx/tooltip.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/dc.h" #include "wx/window.h" -#include "wx/tooltip.h" #include "wx/timer.h" #include "wx/geometry.h" #include "wx/mac/uma.h" @@ -30,7 +34,7 @@ class wxMacToolTip public : wxMacToolTip() ; ~wxMacToolTip() ; - + void Setup( WindowRef window , const wxString& text , const wxPoint& localPosition ) ; void Draw() ; void Clear() ; @@ -45,7 +49,7 @@ private : wxString m_label ; wxPoint m_position ; Rect m_rect ; - WindowRef m_window ; + WindowRef m_window ; PicHandle m_backpict ; bool m_shown ; long m_mark ; @@ -66,7 +70,7 @@ public: void Notify() { if ( m_mark == m_tip->GetMark() ) - m_tip->Draw() ; + m_tip->Draw() ; } protected: @@ -100,15 +104,15 @@ wxToolTip::~wxToolTip() void wxToolTip::SetTip( const wxString &tip ) { m_text = tip; - + if ( m_window ) { #if 0 // update it immediately wxToolInfo ti(GetHwndOf(m_window)); ti.lpszText = (wxChar *)m_text.c_str(); - - (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti); + + (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti); #endif } } @@ -123,7 +127,7 @@ void wxToolTip::Enable( bool flag ) if ( s_ShowToolTips != flag ) { s_ShowToolTips = flag ; - + if ( s_ShowToolTips ) { } @@ -158,7 +162,7 @@ void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) s_ToolTip.Clear() ; s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ; s_LastWindowEntered = win ; - + WindowRef window = MAC_WXHWND( win->MacGetTopLevelWindowRef() ) ; int x = event.m_x ; int y = event.m_y ; @@ -194,7 +198,7 @@ wxMacToolTip::wxMacToolTip() m_shown = false ; } -void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& localPosition ) +void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& localPosition ) { m_mark++ ; @@ -211,7 +215,7 @@ void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ; } -wxMacToolTip::~wxMacToolTip() +wxMacToolTip::~wxMacToolTip() { if ( m_timer ) { @@ -219,7 +223,7 @@ wxMacToolTip::~wxMacToolTip() m_timer = NULL; } - if ( m_backpict ) + if ( m_backpict ) Clear() ; } @@ -228,9 +232,9 @@ const short kTipOffset = 5 ; void wxMacToolTip::Draw() { - if ( m_label.Length() == 0 ) + if ( m_label.empty() ) return ; - + if ( m_window == s_ToolTipWindowRef ) { m_shown = true ; @@ -267,7 +271,7 @@ void wxMacToolTip::Draw() short height = 0 ; int i = 0 ; - int length = m_label.Length() ; + int length = m_label.length() ; int width = 0 ; int thiswidth = 0 ; int laststop = 0 ; @@ -325,9 +329,9 @@ void wxMacToolTip::Draw() m_rect.bottom = r.bottom ; } - GWorldPtr port ; - CGrafPtr origPort ; - GDHandle origDevice ; + GWorldPtr port ; + CGrafPtr origPort ; + GDHandle origDevice ; ClipRect( &m_rect ) ; BackColor( whiteColor ) ; @@ -339,11 +343,11 @@ void wxMacToolTip::Draw() m_backpict = OpenPicture(&m_rect); - CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)), - GetPortBitMapForCopyBits(port), - &m_rect, - &m_rect, - srcCopy, + CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)), + GetPortBitMapForCopyBits(port), + &m_rect, + &m_rect, + srcCopy, NULL); ClosePicture(); SetGWorld( origPort , origDevice ) ; @@ -359,11 +363,11 @@ void wxMacToolTip::Draw() FrameRect( &m_rect ) ; SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ; ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder); - + i = 0 ; laststop = 0 ; height = 0 ; - + while ( i < length ) { if ( text[i] == 13 || text[i] == 10) @@ -378,12 +382,12 @@ void wxMacToolTip::Draw() } ::DrawText( text , laststop , i - laststop ) ; - ::TextMode( srcOr ) ; + ::TextMode( srcOr ) ; #endif } } -void wxToolTip::NotifyWindowDelete( WXHWND win ) +void wxToolTip::NotifyWindowDelete( WXHWND win ) { if ( win == s_ToolTipWindowRef ) s_ToolTipWindowRef = NULL ; @@ -401,11 +405,11 @@ void wxMacToolTip::Clear() if ( !m_shown ) return ; - + #if TARGET_CARBON HMHideTag() ; m_helpTextRef.Release() ; -#else +#else if ( m_window == s_ToolTipWindowRef && m_backpict ) { wxMacPortStateHelper help( (GrafPtr)GetWindowPort( m_window ) ) ; @@ -422,4 +426,3 @@ void wxMacToolTip::Clear() } #endif - diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 4af633107f..38bee34358 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -38,7 +38,6 @@ #include "wx/mac/uma.h" #include "wx/mac/aga.h" -#include "wx/app.h" #include "wx/tooltip.h" #include "wx/dnd.h" @@ -123,9 +122,9 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event unsigned char charCode ; wxChar uniChar[2] ; - uniChar[0] = 0; - uniChar[1] = 0; - + uniChar[0] = 0; + uniChar[1] = 0; + UInt32 keyCode ; UInt32 modifiers ; Point point ; @@ -143,7 +142,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event if ( numChars * 2 > 4 ) charBuf = new UniChar[ numChars ] ; GetEventParameter( event, kEventParamKeyUnicodes, typeUnicodeText, NULL, dataSize , NULL , charBuf ) ; - charBuf[ numChars - 1 ] = 0; + charBuf[ numChars - 1 ] = 0; #if SIZEOF_WCHAR_T == 2 uniChar = charBuf[0] ; @@ -1789,4 +1788,3 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 return 0; } - diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 2a71dd2890..9c706e7209 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/apptrait.h" #if wxUSE_GUI diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index e2d732fab8..674afb8bd4 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -15,13 +15,13 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/menu.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/panel.h" #include "wx/layout.h" #include "wx/dialog.h" diff --git a/src/mac/classic/clipbrd.cpp b/src/mac/classic/clipbrd.cpp index a413f827a7..eee39f0f07 100644 --- a/src/mac/classic/clipbrd.cpp +++ b/src/mac/classic/clipbrd.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/frame.h" #include "wx/bitmap.h" #include "wx/utils.h" @@ -190,12 +190,12 @@ void wxClipboard::Clear() bool wxClipboard::Flush() { - return FALSE; + return false; } bool wxClipboard::Open() { - wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") ); + wxCHECK_MSG( !m_open, false, wxT("clipboard already open") ); m_open = true ; return true ; } @@ -207,9 +207,9 @@ bool wxClipboard::IsOpened() const bool wxClipboard::SetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); + wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); + wxCHECK_MSG( data, false, wxT("data is invalid") ); Clear(); // as we can only store one wxDataObject, this is the same in this @@ -219,9 +219,9 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); + wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); + wxCHECK_MSG( data, false, wxT("data is invalid") ); /* we can only store one wxDataObject */ Clear(); @@ -318,11 +318,11 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) { if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) { - return TRUE ; + return true ; } } } - return FALSE; + return false; #else long offset ; @@ -338,7 +338,7 @@ bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) bool wxClipboard::GetData( wxDataObject& data ) { - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); + wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); size_t formatcount = data.GetFormatCount() + 1 ; wxDataFormat *array = new wxDataFormat[ formatcount ]; diff --git a/src/mac/classic/control.cpp b/src/mac/classic/control.cpp index 4d5f5c15ad..8f7ee77cfb 100644 --- a/src/mac/classic/control.cpp +++ b/src/mac/classic/control.cpp @@ -16,8 +16,12 @@ #endif #include "wx/control.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/panel.h" -#include "wx/app.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/notebook.h" @@ -435,13 +439,13 @@ void wxControl::MacAdjustControlRect() { if ( IsKindOf( CLASSINFO( wxButton ) ) ) { - m_width = m_label.Length() * 8 + 12 ; + m_width = m_label.length() * 8 + 12 ; if ( m_width < 70 ) m_width = 70 ; } else if ( IsKindOf( CLASSINFO( wxStaticText ) ) ) { - m_width = m_label.Length() * 8 ; + m_width = m_label.length() * 8 ; } else m_width = bestsize.right - bestsize.left ; diff --git a/src/mac/classic/cursor.cpp b/src/mac/classic/cursor.cpp index 1b90a15ac5..14890766a5 100644 --- a/src/mac/classic/cursor.cpp +++ b/src/mac/classic/cursor.cpp @@ -15,8 +15,12 @@ #pragma hdrstop #endif -#include "wx/app.h" #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/icon.h" #include "wx/image.h" #include "wx/xpmdecod.h" diff --git a/src/mac/classic/dc.cpp b/src/mac/classic/dc.cpp index 57d4a7a48f..e1d53daa38 100644 --- a/src/mac/classic/dc.cpp +++ b/src/mac/classic/dc.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/mac/uma.h" #include "wx/dcmemory.h" #include "wx/dcprint.h" diff --git a/src/mac/classic/dialog.cpp b/src/mac/classic/dialog.cpp index 4de3a891db..7e5599e8ce 100644 --- a/src/mac/classic/dialog.cpp +++ b/src/mac/classic/dialog.cpp @@ -1,18 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/mac/classic/dialog.cpp // Purpose: wxDialog class // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + #include "wx/dialog.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/utils.h" #include "wx/frame.h" -#include "wx/app.h" #include "wx/settings.h" #include "wx/mac/uma.h" @@ -54,14 +60,14 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; + return false; MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) & ~(wxYES|wxOK|wxNO|wxCANCEL) , name ) ; m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ; SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - return TRUE; + return true; } void wxDialog::SetModal(bool flag) @@ -85,8 +91,8 @@ void wxDialog::SetModal(bool flag) wxDialog::~wxDialog() { - m_isBeingDeleted = TRUE; - Show(FALSE); + m_isBeingDeleted = true; + Show(false); } // By default, pressing escape cancels the dialog , on mac command-stop does the same thing @@ -124,7 +130,7 @@ bool wxDialog::Show(bool show) if ( !wxDialogBase::Show(show) ) { // nothing to do - return FALSE; + return false; } if ( show ) @@ -141,13 +147,13 @@ bool wxDialog::Show(bool show) } else // end of modal dialog { - // this will cause IsModalShowing() return FALSE and our local + // this will cause IsModalShowing() return false and our local // message loop will terminate wxModalDialogs.DeleteObject(this); } } - return TRUE; + return true; } #if !TARGET_CARBON @@ -182,15 +188,15 @@ void wxDialog::DoShowModal() } -// Replacement for Show(TRUE) for modal dialogs - returns return code +// Replacement for Show(true) for modal dialogs - returns return code int wxDialog::ShowModal() { if ( !IsModal() ) { - SetModal(TRUE); + SetModal(true); } - Show(TRUE); + Show(true); return GetReturnCode(); } @@ -198,8 +204,8 @@ int wxDialog::ShowModal() // dialogs and should work for both of them void wxDialog::EndModal(int retCode) { - SetReturnCode(retCode); - Show(FALSE); + SetReturnCode(retCode); + Show(false); } // Standard buttons @@ -258,4 +264,3 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); Refresh(); } - diff --git a/src/mac/classic/dnd.cpp b/src/mac/classic/dnd.cpp index 2fa7db53cb..5acd609b19 100644 --- a/src/mac/classic/dnd.cpp +++ b/src/mac/classic/dnd.cpp @@ -18,9 +18,13 @@ #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/window.h" #include "wx/toplevel.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/mac/private.h" @@ -207,7 +211,7 @@ bool wxDropTarget::GetData() { theData[dataSize]=0 ; wxString convert( theData , wxConvLocal ) ; - m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert ); + m_dataObject->SetData( format, convert.length() * sizeof(wxChar), (const wxChar*) convert ); } else if ( theType == kDragFlavorTypeHFS ) { diff --git a/src/mac/classic/filedlg.cpp b/src/mac/classic/filedlg.cpp index 56f87a0735..52ecefe806 100644 --- a/src/mac/classic/filedlg.cpp +++ b/src/mac/classic/filedlg.cpp @@ -19,16 +19,16 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/tokenzr.h" #include "wx/filename.h" #ifndef __DARWIN__ - #include "PLStringFuncs.h" + #include "PLStringFuncs.h" #endif IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase) @@ -320,7 +320,7 @@ pascal Boolean CrossPlatformFilterCallback ( wxString file = wxMacMakeStringFromPascal( spec.name ) ; display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } - #if TARGET_CARBON +#if TARGET_CARBON else if ( theItem->descriptorType == typeFSRef ) { FSRef fsref ; diff --git a/src/mac/classic/frame.cpp b/src/mac/classic/frame.cpp index 30101f3825..b54dda7bf1 100644 --- a/src/mac/classic/frame.cpp +++ b/src/mac/classic/frame.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp +// Name: src/mac/classic/frame.cpp // Purpose: wxFrame // Author: Stefan Csomor // Modified by: @@ -9,7 +9,14 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + #include "wx/frame.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/statusbr.h" #include "wx/toolbar.h" #include "wx/menuitem.h" @@ -17,7 +24,6 @@ #include "wx/dcclient.h" #include "wx/dialog.h" #include "wx/settings.h" -#include "wx/app.h" #include "wx/mac/uma.h" @@ -34,7 +40,7 @@ END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) -#define WX_MAC_STATUSBAR_HEIGHT 15 +#define WX_MAC_STATUSBAR_HEIGHT 15 // ---------------------------------------------------------------------------- // creation/destruction // ---------------------------------------------------------------------------- @@ -42,15 +48,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) void wxFrame::Init() { m_frameMenuBar = NULL; - + #if wxUSE_TOOLBAR m_frameToolBar = NULL ; #endif m_frameStatusBar = NULL; m_winLastFocused = NULL ; - - m_iconized = FALSE; - + + m_iconized = false; + #if wxUSE_TOOLTIPS m_hwndToolTip = 0; #endif @@ -90,23 +96,23 @@ bool wxFrame::Create(wxWindow *parent, const wxString& name) { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - + if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; - + return false; + MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; wxModelessWindows.Append(this); - - return TRUE; + + return true; } wxFrame::~wxFrame() { - m_isBeingDeleted = TRUE; + m_isBeingDeleted = true; DeleteAllBars(); } @@ -114,18 +120,18 @@ wxFrame::~wxFrame() bool wxFrame::Enable(bool enable) { if ( !wxWindow::Enable(enable) ) - return FALSE; + return false; if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) { - int iMaxMenu = m_frameMenuBar->GetMenuCount(); + int iMaxMenu = m_frameMenuBar->GetMenuCount(); for ( int i = 0 ; i < iMaxMenu ; ++ i ) { m_frameMenuBar->EnableTop( i , enable ) ; } } - return TRUE; + return true; } wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, @@ -148,7 +154,7 @@ void wxFrame::PositionStatusBar() GetClientSize(&w, &h); int sw, sh; m_frameStatusBar->GetSize(&sw, &sh); - + // Since we wish the status bar to be directly under the client area, // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. m_frameStatusBar->SetSize(0, h, w, sh); @@ -249,7 +255,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) void wxFrame::DoGetClientSize(int *x, int *y) const { wxWindow::DoGetClientSize( x , y ) ; - + #if wxUSE_STATUSBAR if ( GetStatusBar() && y ) { @@ -258,11 +264,11 @@ void wxFrame::DoGetClientSize(int *x, int *y) const *y -= statusY; } #endif // wxUSE_STATUSBAR - + wxPoint pt(GetClientAreaOrigin()); if ( y ) *y -= pt.y; - if ( x ) + if ( x ) *x -= pt.x; } @@ -270,10 +276,10 @@ void wxFrame::DoSetClientSize(int clientwidth, int clientheight) { int currentclientwidth , currentclientheight ; int currentwidth , currentheight ; - + GetClientSize( ¤tclientwidth , ¤tclientheight ) ; GetSize( ¤twidth , ¤theight ) ; - + // find the current client size // Find the difference between the entire window (title bar and all) diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp index f194f47c69..a34258969c 100644 --- a/src/mac/classic/listbox.cpp +++ b/src/mac/classic/listbox.cpp @@ -18,9 +18,9 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" diff --git a/src/mac/classic/menu.cpp b/src/mac/classic/menu.cpp index 8e4c0163c6..01345794d2 100644 --- a/src/mac/classic/menu.cpp +++ b/src/mac/classic/menu.cpp @@ -22,9 +22,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/menuitem.h" #include "wx/window.h" #include "wx/utils.h" @@ -64,7 +64,7 @@ short wxMenu::s_macNextMenuId = 2 ; void wxMenu::Init() { - m_doBreak = FALSE; + m_doBreak = false; m_startRadioGroup = -1; // create the menu @@ -167,7 +167,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) { GetMenuBar()->Refresh(); } - return TRUE ; + return true ; } void wxMenu::EndRadioGroup() @@ -180,7 +180,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); - bool check = FALSE; + bool check = false; if ( item->GetKind() == wxITEM_RADIO ) { @@ -196,7 +196,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) item->SetRadioGroupEnd(m_startRadioGroup); // ensure that we have a checked item in the radio group - check = TRUE; + check = true; } else // extend the current radio group { @@ -227,7 +227,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) if ( check ) { // check the item initially - item->Check(TRUE); + item->Check(true); } return item; @@ -276,7 +276,7 @@ void wxMenu::SetTitle(const wxString& label) } bool wxMenu::ProcessCommand(wxCommandEvent & event) { - bool processed = FALSE; + bool processed = false; // Try the menu's event handler if ( !processed && GetEventHandler()) @@ -672,7 +672,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) { wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title); if ( !menuOld ) - return FALSE; + return NULL; m_titles[pos] = title; if ( IsAttached() ) @@ -704,7 +704,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; + return false; m_titles.Insert(title, pos); @@ -727,7 +727,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) Refresh(); } - return TRUE; + return true; } wxMenu *wxMenuBar::Remove(size_t pos) @@ -754,10 +754,10 @@ wxMenu *wxMenuBar::Remove(size_t pos) bool wxMenuBar::Append(wxMenu *menu, const wxString& title) { WXHMENU submenu = menu ? menu->GetHMenu() : 0; - wxCHECK_MSG( submenu, FALSE, wxT("can't append invalid menu to menubar") ); + wxCHECK_MSG( submenu, false, wxT("can't append invalid menu to menubar") ); if ( !wxMenuBarBase::Append(menu, title) ) - return FALSE; + return false; m_titles.Add(title); @@ -778,7 +778,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) if (m_invokingWindow) wxMenubarSetInvokingWindow( menu, m_invokingWindow ); - return TRUE; + return true; } static void wxMenubarUnsetInvokingWindow( wxMenu *menu ) diff --git a/src/mac/classic/menuitem.cpp b/src/mac/classic/menuitem.cpp index 321023913d..f08bf177a0 100644 --- a/src/mac/classic/menuitem.cpp +++ b/src/mac/classic/menuitem.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp +// Name: src/mac/classic/menuitem.cpp // Purpose: wxMenuItem implementation // Author: Stefan Csomor -// Modified by: +// Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor @@ -13,10 +13,16 @@ // headers & declarations // ============================================================================ -#include "wx/app.h" -#include "wx/menu.h" +#include "wx/wxprec.h" + #include "wx/menuitem.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + +#include "wx/menu.h" + #include "wx/mac/uma.h" // ============================================================================ // implementation @@ -41,12 +47,12 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, const wxString& text, const wxString& strHelp, wxItemKind kind, - wxMenu *pSubMenu) + wxMenu *pSubMenu) : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) { // TO DISCUSS on dev : whether we can veto id 0 // wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ; - + // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines // therefore these item must not be translated if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) @@ -55,32 +61,32 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, } m_radioGroup.start = -1; - m_isRadioGroupStart = FALSE; + m_isRadioGroupStart = false; } -wxMenuItem::~wxMenuItem() +wxMenuItem::~wxMenuItem() { } // change item state // ----------------- -void wxMenuItem::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; +void wxMenuItem::SetBitmap(const wxBitmap& bitmap) +{ + m_bitmap = bitmap; UpdateItemBitmap() ; } -void wxMenuItem::UpdateItemBitmap() +void wxMenuItem::UpdateItemBitmap() { if ( !m_parentMenu ) return ; - + MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; if( mhandle == NULL || index == 0) return ; - + if ( m_bitmap.Ok() ) { ControlButtonContentInfo info ; @@ -88,18 +94,18 @@ void wxMenuItem::UpdateItemBitmap() if ( info.contentType != kControlNoContent ) { if ( info.contentType == kControlContentCIconHandle ) - SetMenuItemIconHandle( mhandle , index , + SetMenuItemIconHandle( mhandle , index , kMenuColorIconType , (Handle) info.u.cIconHandle ) ; } - + } } -void wxMenuItem::UpdateItemStatus() +void wxMenuItem::UpdateItemStatus() { if ( !m_parentMenu ) return ; - + #if TARGET_CARBON if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId) { @@ -116,7 +122,7 @@ void wxMenuItem::UpdateItemStatus() EnableMenuCommand( NULL , kHICommandQuit ) ; } #endif - { + { MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; if( mhandle == NULL || index == 0) @@ -128,25 +134,25 @@ void wxMenuItem::UpdateItemStatus() else ::SetItemMark( mhandle , index , 0 ) ; // no mark - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; + UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ; delete entry ; } } -void wxMenuItem::UpdateItemText() +void wxMenuItem::UpdateItemText() { if ( !m_parentMenu ) return ; - + MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; if( mhandle == NULL || index == 0) return ; - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; - wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; + UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; + wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ; delete entry ; } @@ -154,7 +160,7 @@ void wxMenuItem::UpdateItemText() void wxMenuItem::Enable(bool bDoEnable) { - if ( m_isEnabled != bDoEnable ) + if ( m_isEnabled != bDoEnable ) { wxMenuItemBase::Enable( bDoEnable ) ; UpdateItemStatus() ; @@ -162,7 +168,7 @@ void wxMenuItem::Enable(bool bDoEnable) } void wxMenuItem::UncheckRadio() { - if ( m_isChecked ) + if ( m_isChecked ) { wxMenuItemBase::Check( false ) ; UpdateItemStatus() ; @@ -173,7 +179,7 @@ void wxMenuItem::Check(bool bDoCheck) { wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); - if ( m_isChecked != bDoCheck ) + if ( m_isChecked != bDoCheck ) { if ( GetKind() == wxITEM_RADIO ) { @@ -181,7 +187,7 @@ void wxMenuItem::Check(bool bDoCheck) { wxMenuItemBase::Check( bDoCheck ) ; UpdateItemStatus() ; - + // get the index of this item in the menu const wxMenuItemList& items = m_parentMenu->GetMenuItems(); int pos = items.IndexOf(this); @@ -232,7 +238,7 @@ void wxMenuItem::SetText(const wxString& text) return; wxMenuItemBase::SetText(text); - + UpdateItemText() ; } @@ -241,7 +247,7 @@ void wxMenuItem::SetText(const wxString& text) void wxMenuItem::SetAsRadioGroupStart() { - m_isRadioGroupStart = TRUE; + m_isRadioGroupStart = true; } void wxMenuItem::SetRadioGroupStart(int start) diff --git a/src/mac/classic/metafile.cpp b/src/mac/classic/metafile.cpp index 1866c8dc0d..82b363f25d 100644 --- a/src/mac/classic/metafile.cpp +++ b/src/mac/classic/metafile.cpp @@ -6,24 +6,25 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_METAFILE +#include "wx/metafile.h" + #ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/app.h" + #include "wx/utils.h" + #include "wx/app.h" #endif -#include "wx/metafile.h" #include "wx/clipbrd.h" #include "wx/mac/private.h" diff --git a/src/mac/classic/msgdlg.cpp b/src/mac/classic/msgdlg.cpp index 787ba68f6c..8ae60e7a4d 100644 --- a/src/mac/classic/msgdlg.cpp +++ b/src/mac/classic/msgdlg.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/mac/uma.h" IMPLEMENT_CLASS(wxMessageDialog, wxDialog) diff --git a/src/mac/classic/notebmac.cpp b/src/mac/classic/notebmac.cpp index ed9c0cf22f..9bd1c41477 100644 --- a/src/mac/classic/notebmac.cpp +++ b/src/mac/classic/notebmac.cpp @@ -24,9 +24,9 @@ #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/imaglist.h" #include "wx/image.h" #include "wx/mac/uma.h" diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp index c989d56afc..dfcfab0a42 100644 --- a/src/mac/classic/stattext.cpp +++ b/src/mac/classic/stattext.cpp @@ -9,8 +9,14 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/app.h" +#include "wx/wxprec.h" + #include "wx/stattext.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/notebook.h" #include "wx/tabctrl.h" #include "wx/dc.h" diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp index 7a5b5c8a92..c482de0f2c 100644 --- a/src/mac/classic/textctrl.cpp +++ b/src/mac/classic/textctrl.cpp @@ -17,11 +17,17 @@ #if wxUSE_TEXTCTRL +#include "wx/textctrl.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #ifdef __DARWIN__ - #include - #include + #include + #include #else - #include + #include #endif #include "wx/msgdlg.h" @@ -34,11 +40,9 @@ #endif #endif -#include "wx/app.h" #include "wx/dc.h" #include "wx/button.h" #include "wx/toplevel.h" -#include "wx/textctrl.h" #include "wx/notebook.h" #include "wx/tabctrl.h" #include "wx/settings.h" @@ -46,9 +50,9 @@ #include "wx/utils.h" #if defined(__BORLANDC__) && !defined(__WIN32__) - #include + #include #elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__DARWIN__) - #include + #include #endif #ifndef __DARWIN__ diff --git a/src/mac/classic/tooltip.cpp b/src/mac/classic/tooltip.cpp index 9c7c664c2a..5c2424b150 100644 --- a/src/mac/classic/tooltip.cpp +++ b/src/mac/classic/tooltip.cpp @@ -15,10 +15,14 @@ #if wxUSE_TOOLTIPS -#include "wx/app.h" +#include "wx/tooltip.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/dc.h" #include "wx/window.h" -#include "wx/tooltip.h" #include "wx/timer.h" #include "wx/geometry.h" #include "wx/mac/uma.h" @@ -217,7 +221,7 @@ const short kTipOffset = 5 ; void wxMacToolTip::Draw() { - if ( m_label.Length() == 0 ) + if ( m_label.empty() ) return ; if ( m_window == s_ToolTipWindowRef ) @@ -258,7 +262,7 @@ void wxMacToolTip::Draw() short height = 0 ; int i = 0 ; - int length = m_label.Length() ; + int length = m_label.length() ; int width = 0 ; int thiswidth = 0 ; int laststop = 0 ; diff --git a/src/mac/classic/toplevel.cpp b/src/mac/classic/toplevel.cpp index 835bf78107..7879d27791 100644 --- a/src/mac/classic/toplevel.cpp +++ b/src/mac/classic/toplevel.cpp @@ -35,7 +35,6 @@ #include "wx/mac/uma.h" #include "wx/mac/aga.h" -#include "wx/app.h" #include "wx/tooltip.h" #include "wx/dnd.h" #if wxUSE_SYSTEM_OPTIONS @@ -510,7 +509,7 @@ void wxTopLevelWindowMac::Init() m_macUsesCompositing = false ; #if TARGET_CARBON m_macEventHandler = NULL ; - #endif +#endif } class wxMacDeferredWindowDeleter : public wxObject diff --git a/src/mac/classic/utils.cpp b/src/mac/classic/utils.cpp index d5e2c91cfb..c44ecc58da 100644 --- a/src/mac/classic/utils.cpp +++ b/src/mac/classic/utils.cpp @@ -15,9 +15,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/apptrait.h" #if wxUSE_GUI diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp index 86acdb173e..73e83de943 100644 --- a/src/mac/classic/window.cpp +++ b/src/mac/classic/window.cpp @@ -15,13 +15,13 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/menu.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/panel.h" #include "wx/layout.h" #include "wx/dialog.h" diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index 97786a24ba..bc64f28457 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp +// Name: src/mgl/app.cpp // Author: Vaclav Slavik // based on GTK and MSW implementations // Id: $Id$ @@ -14,6 +14,7 @@ #pragma hdrstop #endif +#include "wx/app.h" #ifndef WX_PRECOMP #include "wx/settings.h" @@ -23,7 +24,6 @@ #include "wx/intl.h" #endif -#include "wx/app.h" #include "wx/evtloop.h" #include "wx/module.h" #include "wx/fontutil.h" @@ -329,4 +329,3 @@ void wxApp::CleanUp() wxModule::RegisterModule(new wxMGLFinalCleanup); } - diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 9797969ea7..08c3f81d81 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -23,10 +23,14 @@ #if wxUSE_CLIPBOARD -#include "wx/app.h" +#include "wx/clipbrd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/bitmap.h" #include "wx/utils.h" -#include "wx/clipbrd.h" #include "wx/dataobj.h" #include "wx/ptr_scpd.h" diff --git a/src/motif/colour.cpp b/src/motif/colour.cpp index 54a489002a..657bf6b849 100644 --- a/src/motif/colour.cpp +++ b/src/motif/colour.cpp @@ -17,8 +17,11 @@ #include "wx/colour.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/gdicmn.h" -#include "wx/app.h" #ifdef __VMS__ #pragma message disable nosimpint diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp index 37b680dd54..a29a6d608f 100644 --- a/src/motif/cursor.cpp +++ b/src/motif/cursor.cpp @@ -17,7 +17,11 @@ #endif #include "wx/cursor.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/utils.h" #include "wx/window.h" diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index e27b51fab6..bdecb6f26b 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -13,7 +13,11 @@ #if wxUSE_CLIPBOARD #include "wx/dataobj.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/utils.h" #ifdef __VMS__ diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index c68155bd6c..a689189381 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -43,11 +43,11 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/dcmemory.h" #include "wx/window.h" -#include "wx/app.h" #include "wx/image.h" #include "wx/math.h" diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 70b227ac59..11d7ac387c 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -20,8 +20,12 @@ #endif #include "wx/dialog.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/utils.h" -#include "wx/app.h" #include "wx/settings.h" #include "wx/evtloop.h" diff --git a/src/motif/dnd.cpp b/src/motif/dnd.cpp index 5606dea151..3e7014c852 100644 --- a/src/motif/dnd.cpp +++ b/src/motif/dnd.cpp @@ -17,10 +17,10 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/utils.h" diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index d11b4d777f..0d5a12fbf2 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -27,10 +27,10 @@ #ifndef WX_PRECOMP #include "wx/event.h" + #include "wx/app.h" #endif //WX_PRECOMP #include "wx/evtloop.h" -#include "wx/app.h" #include "wx/window.h" #ifdef __VMS__ diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index 428d1789af..42bc27a41c 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -22,10 +22,10 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif #include "wx/utils.h" -#include "wx/app.h" #include "wx/settings.h" #include "wx/tokenzr.h" #include "wx/stockitem.h" diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 2b8b45d396..24b8baf9cc 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -30,6 +30,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/statusbr.h" @@ -37,7 +38,6 @@ #include "wx/menu.h" #include "wx/settings.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/icon.h" #ifdef __VMS__ diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 1f508801cd..b036cac890 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -24,11 +24,11 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/menuitem.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/frame.h" #include "wx/settings.h" diff --git a/src/motif/msgdlg.cpp b/src/motif/msgdlg.cpp index 3ade9492f5..aa820bafc4 100644 --- a/src/motif/msgdlg.cpp +++ b/src/motif/msgdlg.cpp @@ -37,9 +37,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/motif/private.h" #include "wx/settings.h" diff --git a/src/motif/palette.cpp b/src/motif/palette.cpp index 6080c475bc..672cb58071 100644 --- a/src/motif/palette.cpp +++ b/src/motif/palette.cpp @@ -38,8 +38,12 @@ not the functionality that wxPalette::Create() aims to provide. #include "wx/wxprec.h" #include "wx/palette.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/window.h" -#include "wx/app.h" #include "wx/utils.h" #ifdef __VMS__ diff --git a/src/motif/popupwin.cpp b/src/motif/popupwin.cpp index fd60ed2e11..30aab7ea17 100644 --- a/src/motif/popupwin.cpp +++ b/src/motif/popupwin.cpp @@ -1,19 +1,22 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: popupwin.cpp +// Name: src/motif/popupwin.cpp // Purpose: wxPopupWindow implementation // Author: Mattia barbon // Modified by: // Created: 28.08.03 // RCS-ID: $Id$ // Copyright: (c) Mattia barbon -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/popupwin.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint diff --git a/src/motif/settings.cpp b/src/motif/settings.cpp index 1db7bea1f4..eadd07d8a6 100644 --- a/src/motif/settings.cpp +++ b/src/motif/settings.cpp @@ -17,8 +17,12 @@ #include "wx/wxprec.h" #include "wx/settings.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/gdicmn.h" -#include "wx/app.h" #ifdef __VMS__ #pragma message disable nosimpint diff --git a/src/motif/timer.cpp b/src/motif/timer.cpp index edf7f20a5e..3c930989aa 100644 --- a/src/motif/timer.cpp +++ b/src/motif/timer.cpp @@ -1,19 +1,23 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp +// Name: src/motif/timer.cpp // Purpose: wxTimer implementation // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/timer.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/hashmap.h" #ifdef __VMS__ @@ -39,7 +43,7 @@ void wxTimerCallback (wxTimer * timer) return; if (timer->m_id == 0) - return; // Avoid to process spurious timer events + return; // Avoid to process spurious timer events if (!timer->m_oneShot) timer->m_id = XtAppAddTimeOut((XtAppContext) wxTheApp->GetAppContext(), @@ -89,5 +93,3 @@ void wxTimer::Stop() } m_milli = 0 ; } - - diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index b7a1a782aa..774358df50 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -24,10 +24,14 @@ #define XtDisplay XTDISPLAY #endif +#include "wx/toolbar.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/settings.h" -#include "wx/app.h" #include "wx/timer.h" -#include "wx/toolbar.h" #include "wx/frame.h" #ifdef __VMS__ @@ -786,4 +790,3 @@ void wxToolBarTimer::Notify() /************************************************************/ XtPopup (help_popup, XtGrabNone); } - diff --git a/src/motif/toplevel.cpp b/src/motif/toplevel.cpp index a51ad28e8b..5ce626267a 100644 --- a/src/motif/toplevel.cpp +++ b/src/motif/toplevel.cpp @@ -21,7 +21,10 @@ #include "wx/wxprec.h" #include "wx/toplevel.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif #ifdef __VMS__ #define XtDisplay XTDISPLAY diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index fa3ba9073f..dea805a657 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -25,8 +25,12 @@ #endif #include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/apptrait.h" -#include "wx/app.h" #include "wx/dcmemory.h" #include "wx/bitmap.h" #include "wx/evtloop.h" diff --git a/src/motif/window.cpp b/src/motif/window.cpp index b9df787ce5..865e4272fb 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -29,13 +29,13 @@ #ifndef WX_PRECOMP #include "wx/hash.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/menu.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/layout.h" #include "wx/button.h" #include "wx/settings.h" diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index 2507bc711c..189009fdee 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -21,12 +21,12 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/apptrait.h" #include "wx/process.h" #include "wx/confbase.h" // for wxExpandEnvVars() -#include "wx/app.h" #include "wx/cmdline.h" #include "wx/filename.h" #include "wx/wfstream.h" diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 512a567e99..f893200c1a 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -26,15 +26,16 @@ #if wxUSE_COMBOBOX +#include "wx/combobox.h" + #ifndef WX_PRECOMP #include "wx/settings.h" #include "wx/log.h" // for wxEVT_COMMAND_TEXT_ENTER #include "wx/textctrl.h" + #include "wx/app.h" #endif -#include "wx/app.h" -#include "wx/combobox.h" #include "wx/brush.h" #include "wx/clipbrd.h" #include "wx/msw/private.h" diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 074b23c6a5..75bd13098d 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/dialup.cpp +// Name: src/msw/dialup.cpp // Purpose: MSW implementation of network/dialup classes and functions // Author: Vadim Zeitlin // Modified by: @@ -26,18 +26,19 @@ #if wxUSE_DIALUP_MANAGER +#include "wx/dialup.h" + #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/intl.h" #include "wx/event.h" + #include "wx/app.h" #endif #include "wx/timer.h" -#include "wx/app.h" #include "wx/generic/choicdgg.h" #include "wx/dynlib.h" -#include "wx/dialup.h" #include "wx/module.h" DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) @@ -1329,4 +1330,3 @@ static void WINAPI wxRasDialFunc(UINT WXUNUSED(unMsg), #endif // __BORLANDC__ #endif // wxUSE_DIALUP_MANAGER - diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index a8355e703a..65b239a09c 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/gdiimage.cpp +// Name: src/msw/gdiimage.cpp // Purpose: wxGDIImage implementation // Author: Vadim Zeitlin // Modified by: @@ -27,12 +27,11 @@ #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/msw/private.h" -#include "wx/app.h" - #include "wx/bitmap.h" #include "wx/msw/gdiimage.h" @@ -603,4 +602,3 @@ wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon)) } #endif // __WXMICROWIN__ - diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 4e89e478d0..68061d70f3 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -26,9 +26,9 @@ #ifndef WX_PRECOMP #include "wx/event.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" #include "wx/cmdline.h" #include "wx/scopeguard.h" diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 44de7957be..c53ceb0395 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -25,11 +25,11 @@ #include "wx/dc.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/imaglist.h" #include "wx/control.h" -#include "wx/app.h" #include "wx/sysopt.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 13807770df..4c9d9e5fb7 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -25,10 +25,9 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" - #include "wx/msw/registry.h" #include "wx/msw/regconf.h" diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 69e20420fd..d0253de614 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/spinbutt.cpp +// Name: src/msw/spinbutt.cpp // Purpose: wxSpinButton // Author: Julian Smart // Modified by: @@ -25,7 +25,7 @@ #endif #ifndef WX_PRECOMP -#include "wx/app.h" + #include "wx/app.h" #endif #if wxUSE_SPINBTN diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index f8b3ce1bce..a218e6d923 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -13,13 +13,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_TAB_DIALOG #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" + #include "wx/app.h" #endif #include "wx/msw/private.h" @@ -28,7 +29,6 @@ #include "wx/msw/wrapcctl.h" #include "wx/tabctrl.h" -#include "wx/app.h" #include "wx/msw/imaglist.h" IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index b1fe59c5ea..16ccaa00b3 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -35,6 +35,7 @@ #include "wx/bitmap.h" #include "wx/dcmemory.h" #include "wx/control.h" + #include "wx/app.h" // for GetComCtl32Version #endif #include "wx/toolbar.h" @@ -50,8 +51,6 @@ // include "properly" #include "wx/msw/wrapcctl.h" -#include "wx/app.h" // for GetComCtl32Version - // this define controls whether the code for button colours remapping (only // useful for 16 or 256 colour images) is active at all, it's always turned off // for CE where it doesn't compile (and is probably not needed anyhow) and may diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 6053694909..9377f181ab 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -21,13 +21,15 @@ #pragma hdrstop #endif +#if wxUSE_THREADS + +#include "wx/thread.h" + #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/app.h" #endif -#if wxUSE_THREADS - #include "wx/apptrait.h" #include "wx/scopeguard.h" @@ -37,7 +39,6 @@ #include "wx/except.h" #include "wx/module.h" -#include "wx/thread.h" // must have this symbol defined to get _beginthread/_endthread declarations #ifndef _MT @@ -1381,4 +1382,3 @@ bool WXDLLIMPEXP_BASE wxIsWaitingForThread() #include "wx/thrimpl.cpp" #endif // wxUSE_THREADS - diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 67f82e9bbd..c15873cf99 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -31,6 +31,7 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/msw/private.h" @@ -44,7 +45,6 @@ // comctl32.dll versions #define wxUSE_COMCTL32_SAFELY 0 -#include "wx/app.h" #include "wx/imaglist.h" #include "wx/settings.h" #include "wx/msw/dragimag.h" diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index bcc71c83db..ff55bd2203 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -12,15 +12,15 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/accel.h" + #ifndef WX_PRECOMP -#include -#include "wx/window.h" -#include "wx/app.h" -#include "wx/frame.h" + #include + #include "wx/window.h" + #include "wx/app.h" + #include "wx/frame.h" #endif -#include "wx/os2/accel.h" - #include "wx/os2/private.h" @@ -43,7 +43,7 @@ protected: wxAcceleratorRefData::wxAcceleratorRefData() { - m_ok = FALSE; + m_ok = false; m_hAccel = 0; } // end of wxAcceleratorRefData::wxAcceleratorRefData @@ -188,13 +188,11 @@ WXHACCEL wxAcceleratorTable::GetHACCEL() const return (WXHACCEL) M_ACCELDATA->m_hAccel; } -bool wxAcceleratorTable::Translate( - WXHWND hWnd -, WXMSG* pWxmsg -) const +bool wxAcceleratorTable::Translate( WXHWND hWnd, + WXMSG* pWxmsg ) const { - PQMSG pMsg = (PQMSG)pWxmsg; - BOOL rc = FALSE; + PQMSG pMsg = (PQMSG)pWxmsg; + BOOL rc = FALSE; rc = ::WinTranslateAccel( vHabmain ,(HWND)hWnd diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index c313cb51d2..74423dfaf2 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -25,10 +25,10 @@ #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" #include "wx/os2/private.h" diff --git a/src/os2/dcmemory.cpp b/src/os2/dcmemory.cpp index a786f31641..aeeff2c76b 100644 --- a/src/os2/dcmemory.cpp +++ b/src/os2/dcmemory.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.cpp +// Name: src/os2/dcmemory.cpp // Purpose: wxMemoryDC class // Author: David Webster // Modified by: @@ -13,9 +13,9 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/log.h" + #include "wx/utils.h" + #include "wx/app.h" + #include "wx/log.h" #endif #include "wx/os2/private.h" @@ -98,16 +98,16 @@ bool wxMemoryDC::CreateCompatible( wxDC* WXUNUSED(pDC) ) { m_hPS = NULLHANDLE; m_hDC = NULLHANDLE; - m_ok = FALSE; - m_bOwnsDC = FALSE; + m_ok = false; + m_bOwnsDC = false; } } else { m_hPS = NULLHANDLE; m_hDC = NULLHANDLE; - m_ok = FALSE; - m_bOwnsDC = FALSE; + m_ok = false; + m_bOwnsDC = false; } // diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 9100811fc9..9d277bfade 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -14,10 +14,14 @@ #if wxUSE_DRAG_AND_DROP +#include "wx/dnd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" -#include "wx/dnd.h" #define INCL_PM #define INCL_DOS diff --git a/src/os2/gdiimage.cpp b/src/os2/gdiimage.cpp index 80d1cdebef..d19adb7e8b 100644 --- a/src/os2/gdiimage.cpp +++ b/src/os2/gdiimage.cpp @@ -23,10 +23,10 @@ #ifndef WX_PRECOMP #include "wx/string.h" + #include "wx/app.h" #endif // WX_PRECOMP #include "wx/os2/private.h" -#include "wx/app.h" #include "wx/os2/gdiimage.h" #include "wx/listimpl.cpp" diff --git a/src/os2/metafile.cpp b/src/os2/metafile.cpp index 797b023742..020041396f 100644 --- a/src/os2/metafile.cpp +++ b/src/os2/metafile.cpp @@ -15,8 +15,8 @@ #if wxUSE_METAFILE #ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/app.h" + #include "wx/utils.h" + #include "wx/app.h" #endif #include "wx/metafile.h" @@ -80,7 +80,7 @@ bool wxMetafile::SetClipboard(int width, int height) if (!alreadyOpen) { wxOpenClipboard(); - if (!wxEmptyClipboard()) return FALSE; + if (!wxEmptyClipboard()) return false; } bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height); if (!alreadyOpen) wxCloseClipboard(); @@ -91,7 +91,7 @@ bool wxMetafile::SetClipboard(int width, int height) bool wxMetafile::Play(wxDC *dc) { if (!m_refData) - return FALSE; + return false; // if (dc->GetHDC() && M_METAFILEDATA->m_metafile) // PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile); @@ -354,13 +354,13 @@ bool wxMakeMetafilePlaceable(const wxString& WXUNUSED(filename), FILE *fd = fopen(filename.fn_str(), "rb"); if (!fd) - return FALSE; + return false; wxChar tempFileBuf[256]; wxGetTempFileName(wxT("mf"), tempFileBuf); FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb"); if (!fHandle) - return FALSE; + return false; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle); // Calculate origin and extent diff --git a/src/os2/region.cpp b/src/os2/region.cpp index 039534285e..012ed66e87 100644 --- a/src/os2/region.cpp +++ b/src/os2/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// File: region.cpp +// File: src/os2/region.cpp // Purpose: Region class // Author: David Webster // Modified by: @@ -12,15 +12,18 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/app.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/os2/region.h" #include "wx/gdicmn.h" #include "wx/window.h" #include "wx/os2/private.h" - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) +IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) +IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) //----------------------------------------------------------------------------- // wxRegionRefData implementation @@ -236,15 +239,12 @@ wxObjectRefData *wxRegion::CloneData(const wxObjectRefData *data) const //# Modify region //----------------------------------------------------------------------------- -bool wxRegion::Offset( - wxCoord x -, wxCoord y -) +bool wxRegion::Offset( wxCoord x, wxCoord y ) { if ( !x && !y ) { // nothing to do - return TRUE; + return true; } AllocExclusive(); @@ -254,10 +254,10 @@ bool wxRegion::Offset( { wxLogLastError(_T("OffsetRgn")); - return FALSE; + return false; } #endif - return TRUE; + return true; } // @@ -285,10 +285,7 @@ bool wxRegion::Combine( // // Union region with this. // -bool wxRegion::Combine( - const wxRegion& rRegion -, wxRegionOp eOp -) +bool wxRegion::Combine( const wxRegion& rRegion, wxRegionOp eOp ) { // // We can't use the API functions if we don't have a valid region handle @@ -312,7 +309,7 @@ bool wxRegion::Combine( case wxRGN_AND: case wxRGN_DIFF: // leave empty/invalid - return FALSE; + return false; } } else // we have a valid region @@ -350,7 +347,7 @@ bool wxRegion::Combine( ,lMode ) != RGN_ERROR); } - return TRUE; + return true; } // end of wxRegion::Combine bool wxRegion::Combine( @@ -412,13 +409,13 @@ wxRect wxRegion::GetBox() const // bool wxRegion::Empty() const { - wxCoord x; - wxCoord y; - wxCoord vWidth; - wxCoord vHeight; + wxCoord x; + wxCoord y; + wxCoord vWidth; + wxCoord vHeight; if (M_REGION == 0) - return TRUE; + return true; GetBox( x ,y @@ -733,4 +730,3 @@ wxCoord wxRegionIterator::GetH() const return m_pRects[m_lCurrent].height; return 0L; } // end of wxRegionIterator::GetH - diff --git a/src/os2/statbox.cpp b/src/os2/statbox.cpp index 2464ee04b0..ec2bd57eef 100644 --- a/src/os2/statbox.cpp +++ b/src/os2/statbox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp +// Name: src/os2/statbox.cpp // Purpose: wxStaticBox // Author: David Webster // Modified by: @@ -12,27 +12,25 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/window.h" -#include "wx/os2/private.h" +#include "wx/statbox.h" #ifndef WX_PRECOMP -#include "wx/app.h" -#include "wx/dcclient.h" + #include "wx/app.h" + #include "wx/dcclient.h" #endif -#include "wx/statbox.h" +#include "wx/window.h" +#include "wx/os2/private.h" IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) -bool wxStaticBox::Create( - wxWindow* pParent -, wxWindowID vId -, const wxString& rsLabel -, const wxPoint& rPos -, const wxSize& rSize -, long lStyle -, const wxString& rsName -) +bool wxStaticBox::Create( wxWindow* pParent, + wxWindowID vId, + const wxString& rsLabel, + const wxPoint& rPos, + const wxSize& rSize, + long lStyle, + const wxString& rsName ) { if(!CreateControl( pParent ,vId @@ -43,11 +41,11 @@ bool wxStaticBox::Create( ,rsName )) { - return FALSE; + return false; } - wxPoint vPos(0,0); - wxSize vSize(0,0); + wxPoint vPos(0,0); + wxSize vSize(0,0); if (!OS2CreateControl( wxT("STATIC") ,SS_GROUPBOX @@ -56,7 +54,7 @@ bool wxStaticBox::Create( ,rsLabel )) { - return FALSE; + return false; } // @@ -84,7 +82,7 @@ bool wxStaticBox::Create( ,rSize.x ,rSize.y ); - return TRUE; + return true; } // end of wxStaticBox::Create wxSize wxStaticBox::DoGetBestSize() const @@ -108,13 +106,9 @@ wxSize wxStaticBox::DoGetBestSize() const ); } // end of wxStaticBox::DoGetBestSize -MRESULT wxStaticBox::OS2WindowProc( - WXUINT nMsg -, WXWPARAM wParam -, WXLPARAM lParam -) +MRESULT wxStaticBox::OS2WindowProc( WXUINT nMsg, + WXWPARAM wParam, + WXLPARAM lParam ) { return wxControl::OS2WindowProc(nMsg, wParam, lParam); } // end of wxStaticBox::OS2WindowProc - - diff --git a/src/os2/tabctrl.cpp b/src/os2/tabctrl.cpp index 17f9df9127..6371d7a13a 100644 --- a/src/os2/tabctrl.cpp +++ b/src/os2/tabctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.cpp +// Name: src/os2/tabctrl.cpp // Purpose: wxTabCtrl // Author: David Webster // Modified by: @@ -15,7 +15,8 @@ #if wxUSE_TAB_DIALOG #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" + #include "wx/app.h" #endif #include "malloc.h" @@ -25,7 +26,6 @@ //#include "wx/msw/dib.h" #include "wx/os2/tabctrl.h" -#include "wx/app.h" #include "wx/os2/private.h" #include "wx/generic/imaglist.h" @@ -81,7 +81,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons SubclassWin((WXHWND) hWndTabCtrl); - return FALSE; + return false; } wxTabCtrl::~wxTabCtrl() diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index c9bc9d2411..c98efebc7d 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/os2/textctrl.cpp // Purpose: wxTextCtrl // Author: David Webster // Modified by: @@ -16,17 +16,17 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/textctrl.h" + #ifndef WX_PRECOMP - #include "wx/textctrl.h" #include "wx/scrolwin.h" #include "wx/settings.h" #include "wx/brush.h" #include "wx/utils.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" - #if wxUSE_CLIPBOARD #include "wx/clipbrd.h" #endif diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index 33cb46646d..3274b8ef57 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -23,9 +23,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/module.h" #include "wx/utils.h" diff --git a/src/os2/treectrl.cpp b/src/os2/treectrl.cpp index f95caad05b..071a1f83e8 100644 --- a/src/os2/treectrl.cpp +++ b/src/os2/treectrl.cpp @@ -31,11 +31,11 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/os2/private.h" -#include "wx/app.h" #include "wx/imaglist.h" #include "wx/settings.h" diff --git a/src/palmos/datectrl.cpp b/src/palmos/datectrl.cpp index 29bc8cbb5e..c030a4c142 100644 --- a/src/palmos/datectrl.cpp +++ b/src/palmos/datectrl.cpp @@ -29,9 +29,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/dynlib.h" #define _WX_DEFINE_DATE_EVENTS_ diff --git a/src/palmos/gdiimage.cpp b/src/palmos/gdiimage.cpp index b4af31c463..4fdb574a6b 100644 --- a/src/palmos/gdiimage.cpp +++ b/src/palmos/gdiimage.cpp @@ -27,10 +27,9 @@ #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/app.h" #endif // WX_PRECOMP -#include "wx/app.h" - #include "wx/bitmap.h" #include "wx/palmos/gdiimage.h" @@ -111,5 +110,3 @@ void wxGDIImage::CleanUpHandlers() void wxGDIImage::InitStandardHandlers() { } - - diff --git a/src/palmos/main.cpp b/src/palmos/main.cpp index c7658e324f..d1ca479472 100644 --- a/src/palmos/main.cpp +++ b/src/palmos/main.cpp @@ -26,9 +26,9 @@ #ifndef WX_PRECOMP #include "wx/event.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" #include "wx/cmdline.h" #if wxUSE_GUI diff --git a/src/palmos/spinbutt.cpp b/src/palmos/spinbutt.cpp index 5c52674988..d42b461d10 100644 --- a/src/palmos/spinbutt.cpp +++ b/src/palmos/spinbutt.cpp @@ -24,14 +24,14 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#include "wx/app.h" -#endif - #if wxUSE_SPINBTN #include "wx/spinbutt.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) // ============================================================================ @@ -148,4 +148,3 @@ void wxSpinButton::SetRange(int minVal, int maxVal) #endif // wxUSE_SPINCTN - diff --git a/src/palmos/tabctrl.cpp b/src/palmos/tabctrl.cpp index 30933e9d40..17f24e9420 100644 --- a/src/palmos/tabctrl.cpp +++ b/src/palmos/tabctrl.cpp @@ -13,19 +13,19 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_TAB_DIALOG #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" + #include "wx/app.h" #endif #if defined(__WIN95__) #include "wx/tabctrl.h" -#include "wx/app.h" #include "wx/palmos/imaglist.h" IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) diff --git a/src/palmos/toolbar.cpp b/src/palmos/toolbar.cpp index 4eece9ff42..af18c32293 100644 --- a/src/palmos/toolbar.cpp +++ b/src/palmos/toolbar.cpp @@ -26,6 +26,8 @@ #if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE +#include "wx/toolbar.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/frame.h" @@ -35,17 +37,15 @@ #include "wx/bitmap.h" #include "wx/dcmemory.h" #include "wx/control.h" + #include "wx/app.h" // for GetComCtl32Version #endif -#include "wx/toolbar.h" #include "wx/sysopt.h" #include "wx/palmos/private.h" #include "wx/palmos/wrapcctl.h" -#include "wx/app.h" // for GetComCtl32Version - // ---------------------------------------------------------------------------- // conditional compilation // ---------------------------------------------------------------------------- diff --git a/src/palmos/treectrl.cpp b/src/palmos/treectrl.cpp index 45246666e2..0c77b78c30 100644 --- a/src/palmos/treectrl.cpp +++ b/src/palmos/treectrl.cpp @@ -31,11 +31,11 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/palmos/private.h" -#include "wx/app.h" #include "wx/imaglist.h" #include "wx/settings.h" diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index c4f45c070e..e90fc222ec 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -21,6 +21,7 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif // !PCH #include "wx/timer.h" @@ -28,7 +29,6 @@ #include "wx/utils.h" #include "wx/ffile.h" #include "wx/process.h" -#include "wx/app.h" #include "wx/wxchar.h" #include diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index 98215d2945..71ba6d7849 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -25,11 +25,11 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/string.h" + #include "wx/app.h" #endif #include "wx/regex.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/fontmap.h" #include "wx/fontutil.h" #include "wx/encinfo.h" diff --git a/src/unix/mediactrl.cpp b/src/unix/mediactrl.cpp index 3aa6a5a345..8d4cde3400 100644 --- a/src/unix/mediactrl.cpp +++ b/src/unix/mediactrl.cpp @@ -30,9 +30,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" // wxLogDebug/wxLogSysError/wxLogTrace + #include "wx/app.h" // wxTheApp->argc, wxTheApp->argv #endif -#include "wx/app.h" // wxTheApp->argc, wxTheApp->argv #include "wx/thread.h" // wxMutex/wxMutexLocker #include "wx/timer.h" // wxTimer diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 4315f74546..26ae2fbdc7 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -24,9 +24,9 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/apptrait.h" #include "wx/process.h" diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index a410c64770..cb2de81897 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -18,6 +18,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/iconbndl.h" @@ -774,8 +775,6 @@ KeySym wxCharCodeWXToX(int id) // check current state of a key // ---------------------------------------------------------------------------- -#include "wx/app.h" - bool wxGetKeyState(wxKeyCode key) { wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key != diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index d3709d73d9..ae4c2e3f12 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -16,11 +16,11 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/icon.h" #include "wx/image.h" -#include "wx/app.h" #if wxUSE_NANOX #include "wx/dcmemory.h" #endif diff --git a/src/x11/colour.cpp b/src/x11/colour.cpp index ba921cda9d..32d69c30a0 100644 --- a/src/x11/colour.cpp +++ b/src/x11/colour.cpp @@ -14,8 +14,11 @@ #include "wx/colour.h" +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/gdicmn.h" -#include "wx/app.h" #include "wx/x11/private.h" diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index 77ac73f161..b94f974e5a 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -1,18 +1,25 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp +// Name: src/x11/cursor.cpp // Purpose: wxCursor class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/gdicmn.h" #include "wx/icon.h" -#include "wx/app.h" #include "wx/utils.h" #include "wx/x11/private.h" @@ -65,14 +72,14 @@ wxCursor::wxCursor( int cursorId ) #if wxUSE_NANOX // TODO Create some standard cursors from bitmaps. - - + + #else // !wxUSE_NANOX - + M_CURSORDATA->m_display = wxGlobalDisplay(); wxASSERT_MSG( M_CURSORDATA->m_display, wxT("No display") ); - + int x_cur = XC_left_ptr; switch (cursorId) { diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index bd4b3defcc..c32748372e 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -16,10 +16,10 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/mstream.h" -#include "wx/app.h" #include "wx/image.h" #include "wx/utils.h" diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 272cc1dd1a..fe196bc01e 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: x11/dcclient.cpp +// Name: src/x11/dcclient.cpp // Purpose: wxClientDC class // Author: Julian Smart, Robert Roebling // Modified by: @@ -9,10 +9,17 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/dcclient.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/dcmemory.h" #include "wx/window.h" -#include "wx/app.h" #include "wx/image.h" #include "wx/module.h" #include "wx/fontutil.h" @@ -1189,7 +1196,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, GC gc = XCreateGC( xdisplay, new_pixmap, 0, NULL ); XSetForeground( xdisplay, gc, BlackPixel(xdisplay,xscreen) ); - + XSetFillStyle( xdisplay, gc, FillSolid ); XFillRectangle( xdisplay, new_pixmap, gc, 0, 0, ww, hh ); @@ -1685,10 +1692,10 @@ wxCoord wxWindowDC::GetCharWidth() const PangoLayout *layout = pango_layout_new( m_context ); if (m_fontdesc) - pango_layout_set_font_description(layout, m_fontdesc); + pango_layout_set_font_description(layout, m_fontdesc); else - pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); - + pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); + pango_layout_set_text(layout, "H", 1 ); int w,h; pango_layout_get_pixel_size(layout, &w, &h); @@ -1719,10 +1726,10 @@ wxCoord wxWindowDC::GetCharHeight() const PangoLayout *layout = pango_layout_new( m_context ); if (m_fontdesc) - pango_layout_set_font_description(layout, m_fontdesc); + pango_layout_set_font_description(layout, m_fontdesc); else - pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); - + pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description); + pango_layout_set_text(layout, "H", 1 ); int w,h; pango_layout_get_pixel_size(layout, &w, &h); @@ -1780,9 +1787,9 @@ void wxWindowDC::SetFont( const wxFont &font ) wxCHECK_RET( Ok(), wxT("invalid dc") ); m_font = font; - + return; - + #if wxUSE_UNICODE m_fontdesc = font.GetNativeFontInfo()->description; #endif diff --git a/src/x11/dcscreen.cpp b/src/x11/dcscreen.cpp index cd776d963d..989ddd259f 100644 --- a/src/x11/dcscreen.cpp +++ b/src/x11/dcscreen.cpp @@ -1,19 +1,26 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcscreen.cpp +// Name: src/x11/dcscreen.cpp // Purpose: wxScreenDC class // Author: Julian Smart, Robert Roebling // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart, Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#include "wx/dcscreen.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/window.h" #include "wx/frame.h" -#include "wx/dcscreen.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/fontutil.h" #include "wx/x11/private.h" @@ -34,16 +41,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC) wxScreenDC::wxScreenDC() { - m_ok = FALSE; - + m_ok = false; + m_display = (WXDisplay *) wxGlobalDisplay(); - + int screen = DefaultScreen( (Display*) m_display ); m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen ); - + m_window = (WXWindow) RootWindow( (Display*) m_display, screen ); - m_isScreenDC = TRUE; + m_isScreenDC = true; #if wxUSE_UNICODE m_context = wxTheApp->GetPangoContext(); @@ -107,12 +114,12 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rectIn ) } #endif // 0 - return TRUE; + return true; } bool wxScreenDC::EndDrawingOnTop() { - return TRUE; + return true; } void wxScreenDC::DoGetSize(int *width, int *height) const diff --git a/src/x11/dnd.cpp b/src/x11/dnd.cpp index b49f27f66f..ea53b0384c 100644 --- a/src/x11/dnd.cpp +++ b/src/x11/dnd.cpp @@ -21,10 +21,10 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" #include "wx/utils.h" @@ -184,7 +184,7 @@ wxDragResult wxDropSource::DoDragDrop( int WXUNUSED(flags) ) UnregisterWindow(); - g_blockEventsOnDrag = FALSE; + g_blockEventsOnDrag = false; return m_retValue; #endif diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index 85b83d8880..de6b1f8b83 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -20,13 +20,14 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/evtloop.h" + #ifndef WX_PRECOMP #include "wx/hash.h" + #include "wx/app.h" #endif #include "wx/window.h" -#include "wx/app.h" -#include "wx/evtloop.h" #include "wx/tooltip.h" #include "wx/timer.h" #include "wx/module.h" diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp index 1ecdd96f84..a4e41c925d 100644 --- a/src/x11/glcanvas.cpp +++ b/src/x11/glcanvas.cpp @@ -14,7 +14,7 @@ #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_GLCANVAS @@ -23,10 +23,10 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/utils.h" -#include "wx/app.h" #ifdef __VMS # pragma message disable nosimpint @@ -315,7 +315,7 @@ bool wxGLCanvas::Create( wxWindow *parent, attribList = (int*) data; // Get an appropriate visual vi = glXChooseVisual(display, DefaultScreen(display), attribList); - if(!vi) return FALSE; + if(!vi) return false; // Here we should make sure that vi is the same visual as the // one used by the xwindow drawable in wxCanvas. However, @@ -326,9 +326,9 @@ bool wxGLCanvas::Create( wxWindow *parent, XGetWindowAttributes(display, (Window)wxGetClientAreaWindow(this), &xwa); vi_templ.visualid = XVisualIDFromVisual(xwa.visual); vi = XGetVisualInfo(display, VisualIDMask, &vi_templ, &n); - if(!vi) return FALSE; + if(!vi) return false; glXGetConfig(display, vi, GLX_USE_GL, &val); - if(!val) return FALSE; + if(!val) return false; // Basically, this is it. It should be possible to use vi // in glXCreateContext() below. But this fails with Mesa. // I notified the Mesa author about it; there may be a fix. @@ -355,13 +355,13 @@ bool wxGLCanvas::Create( wxWindow *parent, a_list[n] = None; // XFree(vi); vi = glXChooseVisual(display, DefaultScreen(display), a_list); - if(!vi) return FALSE; + if(!vi) return false; #endif /* OLD_MESA */ } m_vi = vi; // safe for later use - wxCHECK_MSG( m_vi, FALSE, wxT("required visual couldn't be found") ); + wxCHECK_MSG( m_vi, false, wxT("required visual couldn't be found") ); // Create the GLX context and make it current diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index 5b0ac77201..aa81fd4ae0 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -34,9 +34,16 @@ recommended; only the window manager should do this... Also, it is not the functionality that wxPalette::Create() aims to provide. */ +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/palette.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/window.h" -#include "wx/app.h" #include "wx/utils.h" #ifdef __VMS__ diff --git a/src/x11/popupwin.cpp b/src/x11/popupwin.cpp index c0c7825226..0bd02ab6ba 100644 --- a/src/x11/popupwin.cpp +++ b/src/x11/popupwin.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif -#include "wx/app.h" #include "wx/settings.h" #include "wx/x11/private.h" diff --git a/src/x11/reparent.cpp b/src/x11/reparent.cpp index be8dbe5324..d43de94906 100644 --- a/src/x11/reparent.cpp +++ b/src/x11/reparent.cpp @@ -30,10 +30,10 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/evtloop.h" -#include "wx/app.h" #include "wx/timer.h" #include "wx/x11/private.h" @@ -62,11 +62,11 @@ wxAdoptedWindow::~wxAdoptedWindow() static bool Xerror; static Atom WM_STATE = 0; -bool wxReparenter::sm_done = FALSE; +bool wxReparenter::sm_done = false; wxAdoptedWindow* wxReparenter::sm_toReparent = NULL; wxWindow* wxReparenter::sm_newParent = NULL; wxString wxReparenter::sm_name; -bool wxReparenter::sm_exactMatch = FALSE; +bool wxReparenter::sm_exactMatch = false; static int ErrorHandler(Display* dpy, XErrorEvent* event) { @@ -131,7 +131,7 @@ bool wxReparenter::Reparent(wxWindow* newParent, wxAdoptedWindow* toReparent) } // Wait for an appropriate window to be created. -// If exactMatch is FALSE, a substring match is OK. +// If exactMatch is false, a substring match is OK. // If windowName is empty, then wait for the next overrideRedirect window. bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent, const wxString& windowName, @@ -155,7 +155,7 @@ bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toRepar wxLogDebug(_T("Waiting for window %s"), windowName.c_str()); #endif - sm_done = FALSE; + sm_done = false; wxEventLoop eventLoop; while (!sm_done) @@ -216,7 +216,7 @@ bool wxReparenter::ProcessXEvent(WXEvent* event) return sm_done; } } - return FALSE; + return false; } WXWindow wxReparenter::FindAClientWindow(WXWindow window, const wxString& name) diff --git a/src/x11/utils.cpp b/src/x11/utils.cpp index 501b9fcaeb..604b5f8100 100644 --- a/src/x11/utils.cpp +++ b/src/x11/utils.cpp @@ -13,7 +13,7 @@ #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop #endif // ============================================================================ @@ -25,7 +25,11 @@ // ---------------------------------------------------------------------------- #include "wx/utils.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + #include "wx/apptrait.h" #include "wx/msgdlg.h" #include "wx/cursor.h" @@ -79,8 +83,8 @@ void wxFlushEvents() bool wxCheckForInterrupt(wxWindow *wnd) { - wxASSERT_MSG(FALSE, wxT("wxCheckForInterrupt not yet implemented.")); - return FALSE; + wxFAIL_MSG(wxT("wxCheckForInterrupt not yet implemented.")); + return false; } // ---------------------------------------------------------------------------- @@ -142,7 +146,7 @@ void wxGetMousePosition( int* x, int* y ) #endif }; -// Return TRUE if we have a colour display +// Return true if we have a colour display bool wxColourDisplay() { return wxDisplayDepth() > 1; @@ -220,7 +224,7 @@ bool wxSetDisplay(const wxString& display_name) return true; } else - return FALSE; + return false; } } diff --git a/src/x11/window.cpp b/src/x11/window.cpp index dccd24f2e9..41032fb7fc 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -29,13 +29,13 @@ #ifndef WX_PRECOMP #include "wx/hash.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/menu.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/utils.h" -#include "wx/app.h" #include "wx/panel.h" #include "wx/layout.h" #include "wx/dialog.h" diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index 28b83e829b..4c6dcdd771 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -22,6 +22,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/wfstream.h" @@ -32,7 +33,6 @@ #include "expat.h" // from Expat // DLL options compatibility check: -#include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxXML") -- 2.45.2