From 20bc5ad8dd419d0d3e524079f8fdbe3d8c14231f Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 1 Jul 2005 19:36:58 +0000 Subject: [PATCH] Global platform header () removed from public wx-headers (but included in wxprec.h) with all consequences in wxPalmOS specific API. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 12 ++++++-- include/wx/palmos/app.h | 9 ++++-- include/wx/palmos/control.h | 12 ++++---- include/wx/palmos/frame.h | 2 +- include/wx/palmos/progdlg.h | 4 +-- include/wx/palmos/radiobut.h | 2 +- include/wx/palmos/slider.h | 2 +- include/wx/palmos/toplevel.h | 10 +++---- include/wx/palmos/window.h | 8 +++--- include/wx/platform.h | 6 ---- include/wx/wxchar.h | 8 ++++-- include/wx/wxprec.h | 5 ++++ src/common/stopwatch.cpp | 6 ++++ src/palmos/button.cpp | 5 +++- src/palmos/checkbox.cpp | 2 ++ src/palmos/colordlg.cpp | 3 ++ src/palmos/control.cpp | 54 +++++++++++++++++++++--------------- src/palmos/datectrl.cpp | 3 ++ src/palmos/evtloop.cpp | 5 ++++ src/palmos/frame.cpp | 14 ++++++---- src/palmos/menu.cpp | 4 +++ src/palmos/msgdlg.cpp | 3 ++ src/palmos/progdlg.cpp | 29 +++++++++++-------- src/palmos/radiobut.cpp | 2 ++ src/palmos/settings.cpp | 2 ++ src/palmos/slider.cpp | 11 +++++--- src/palmos/statbrpalm.cpp | 2 ++ src/palmos/stattext.cpp | 2 ++ src/palmos/tglbtn.cpp | 2 ++ src/palmos/toplevel.cpp | 40 +++++++++++++++----------- src/palmos/utils.cpp | 1 + src/palmos/volume.cpp | 3 +- src/palmos/window.cpp | 10 ++++--- 33 files changed, 183 insertions(+), 100 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 1cc0b17d7b..228bb0d808 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -653,6 +653,10 @@ enum { wxDefaultCoord = -1 }; /* define fixed length types */ /* ---------------------------------------------------------------------------- */ +#if defined(__WXPALMOS__) || defined(__MINGW32__) + #include +#endif + /* chars are always one byte (by definition), shorts are always two (in */ /* practice) */ @@ -952,7 +956,6 @@ inline void *wxUIntToPtr(wxUIntPtr p) /* Make sure ssize_t is defined (a signed type the same size as size_t) */ /* HAVE_SSIZE_T should be defined for compiliers that already have it */ #ifdef __MINGW32__ - #include #if defined(_SSIZE_T_) && !defined(HAVE_SSIZE_T) #define HAVE_SSIZE_T #endif @@ -2452,6 +2455,7 @@ typedef WX_NSView WXWidget; /* wxWidgets BASE definition */ #if defined(__WXPALMOS__) +typedef void * WXHWND; typedef void * WXHANDLE; typedef void * WXHICON; typedef void * WXHFONT; @@ -2474,9 +2478,13 @@ typedef unsigned short WXWORD; typedef unsigned long WXCOLORREF; typedef struct tagMSG WXMSG; -typedef WinHandle WXWINHANDLE; +typedef WXHWND WXWINHANDLE; /* WinHandle of PalmOS */ typedef WXWINHANDLE WXWidget; +typedef void * WXFORMPTR; +typedef void * WXEVENTPTR; +typedef void * WXRECTANGLEPTR; + #endif /* __WXPALMOS__ */ diff --git a/include/wx/palmos/app.h b/include/wx/palmos/app.h index 1b294ed5d8..60dbfb0aa1 100644 --- a/include/wx/palmos/app.h +++ b/include/wx/palmos/app.h @@ -93,16 +93,21 @@ extern int WXDLLEXPORT wxEntry(); #define IMPLEMENT_WXWIN_MAIN \ + \ + extern "C" { \ + \ uint32_t PilotMain(uint16_t cmd, MemPtr cmdPBP, uint16_t launchFlags) \ { \ switch (cmd) { \ - case sysAppLaunchCmdNormalLaunch: \ + case 0 /* sysAppLaunchCmdNormalLaunch */ : \ wxEntry(); \ break; \ default: \ break; \ } \ - return errNone; \ + return 0 /* errNone */ ; \ + } \ + \ } #endif // _WX_APP_H_ diff --git a/include/wx/palmos/control.h b/include/wx/palmos/control.h index 94931bcce2..82cc98bd3e 100644 --- a/include/wx/palmos/control.h +++ b/include/wx/palmos/control.h @@ -74,8 +74,8 @@ public: protected: // regardless how deeply we are in wxWidgets hierarchy always get correct form - FormType* GetParentForm() const; - FormType* GetObjectFormIndex(uint16_t& index) const; + WXFORMPTR GetParentForm() const; + WXFORMPTR GetObjectFormIndex(uint16_t& index) const; void* GetObjectPtr() const; // choose the default border for this window @@ -105,7 +105,7 @@ protected: // size parameter (style parameter is not needed because m_windowStyle is // supposed to had been already set and so is used instead when this // function is called) - bool PalmCreateControl(ControlStyleType style, + bool PalmCreateControl(int palmStyle, const wxString& label, const wxPoint& pos, const wxSize& size, @@ -117,7 +117,7 @@ protected: const wxSize& size, bool editable, bool underlined, - JustificationType justification); + int justification); inline bool IsPalmField() const { return m_palmField; } // this is a helper for the derived class GetClassDefaultAttributes() @@ -148,8 +148,8 @@ private: // common part of all ctors void Init(); - virtual void DoGetBounds( RectangleType &rect ) const; - virtual void DoSetBounds( RectangleType &rect ); + virtual void DoGetBounds( WXRECTANGLEPTR rect ) const; + virtual void DoSetBounds( WXRECTANGLEPTR rect ); DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl) DECLARE_EVENT_TABLE() diff --git a/include/wx/palmos/frame.h b/include/wx/palmos/frame.h index f21d348438..c2a444451d 100644 --- a/include/wx/palmos/frame.h +++ b/include/wx/palmos/frame.h @@ -70,7 +70,7 @@ public: #if wxUSE_MENUS_NATIVE bool HandleMenuOpen(); - bool HandleMenuSelect(EventType* event); + bool HandleMenuSelect(WXEVENTPTR event); #endif // wxUSE_MENUS_NATIVE protected: diff --git a/include/wx/palmos/progdlg.h b/include/wx/palmos/progdlg.h index 0000d901ee..5bb7e35c5d 100644 --- a/include/wx/palmos/progdlg.h +++ b/include/wx/palmos/progdlg.h @@ -37,11 +37,11 @@ public: void Resume(); virtual bool Show( bool show = true ); - Boolean Callback(PrgCallbackData *data); + Boolean Callback(/*PrgCallbackData */ void *data); private: - ProgressType *m_prgFrame; + /*ProgressType*/ void *m_prgFrame; wxString m_msg; int m_max,m_cur; bool m_canSkip; diff --git a/include/wx/palmos/radiobut.h b/include/wx/palmos/radiobut.h index 5e0040e738..21a6701324 100644 --- a/include/wx/palmos/radiobut.h +++ b/include/wx/palmos/radiobut.h @@ -66,7 +66,7 @@ private: uint8_t m_groupID; // pushButtonCtl or checkboxCtl - ControlStyleType m_radioStyle; + int m_radioStyle; DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) }; diff --git a/include/wx/palmos/slider.h b/include/wx/palmos/slider.h index 7cd3bae15d..8ff0a2f47a 100644 --- a/include/wx/palmos/slider.h +++ b/include/wx/palmos/slider.h @@ -76,7 +76,7 @@ public: // send a notification event, return true if processed bool SendUpdatedEvent(); - bool SendScrollEvent(EventType* event); + bool SendScrollEvent(WXEVENTPTR event); protected: diff --git a/include/wx/palmos/toplevel.h b/include/wx/palmos/toplevel.h index 9d2faa7655..f87488145d 100644 --- a/include/wx/palmos/toplevel.h +++ b/include/wx/palmos/toplevel.h @@ -82,12 +82,12 @@ public: wxWindow *GetLastFocus() const { return m_winLastFocused; } // interface to native frame structure - FormType *GetForm() const; + WXFORMPTR GetForm() const; // handle native events - bool HandleControlSelect(EventType* event); - bool HandleControlRepeat(EventType* event); - bool HandleSize(EventType* event); + bool HandleControlSelect(WXEVENTPTR event); + bool HandleControlRepeat(WXEVENTPTR event); + bool HandleSize(WXEVENTPTR event); virtual WXWINHANDLE GetWinHandle() const; @@ -125,7 +125,5 @@ protected: DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm) }; -static Boolean FrameFormHandleEvent(EventType* pEvent); - #endif // _WX_PALMOS_TOPLEVEL_H_ diff --git a/include/wx/palmos/window.h b/include/wx/palmos/window.h index 40749393fe..25e58a866a 100644 --- a/include/wx/palmos/window.h +++ b/include/wx/palmos/window.h @@ -211,11 +211,11 @@ public: protected: // the window handle - WinHandle m_handle; - FormType *FrameForm; + WXWINHANDLE m_handle; + WXFORMPTR FrameForm; - FormType *GetFormPtr(); - void SetFormPtr(FormType *FormPtr); + WXFORMPTR GetFormPtr(); + void SetFormPtr(WXFORMPTR FormPtr); // additional (Palm specific) flags bool m_mouseInWindow:1; diff --git a/include/wx/platform.h b/include/wx/platform.h index c78751eee6..d3f6c0c53e 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -472,12 +472,6 @@ # include "wx/msw/wince/libraries.h" #endif -/* Force inclusion of main PalmOS header: */ -#ifdef __WXPALMOS__ -# include -# undef Abs -#endif - /* This macro can be used to test the gcc version and can be used like this: diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 1d49653fd4..604bc2879c 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -21,7 +21,7 @@ #include "wx/defs.h" /* for wxUSE_UNICODE */ #if defined(HAVE_STRTOK_R) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS - char *strtok_r(char *, const char *, char **); + char *strtok_r(char *, const char *, char **); #endif /* check whether we have wchar_t and which size it is if we do */ @@ -127,7 +127,9 @@ #define wxHAVE_TCHAR_SUPPORT #elif defined(__DMC__) #define wxHAVE_TCHAR_SUPPORT -#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) && !defined(__WXPALMOS__) +#elif defined(__WXPALMOS__) + #include +#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) #define wxHAVE_TCHAR_SUPPORT #include #include @@ -387,7 +389,7 @@ /* time.h functions */ #define wxAsctime _tasctime #define wxCtime _tctime - + #define wxMbstowcs mbstowcs #define wxWcstombs wcstombs #else /* !TCHAR-aware compilers */ diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h index d9491eb3d6..1d3844dd9c 100644 --- a/include/wx/wxprec.h +++ b/include/wx/wxprec.h @@ -45,6 +45,11 @@ #include "wx/msw/wrapwin.h" #endif +// include all PalmOS headers at once +#ifdef __WXPALMOS__ +# include +#endif + // include the most common wx headers #include "wx/wx.h" diff --git a/src/common/stopwatch.cpp b/src/common/stopwatch.cpp index 7575e5ba95..1ace26ef2d 100644 --- a/src/common/stopwatch.cpp +++ b/src/common/stopwatch.cpp @@ -83,6 +83,12 @@ #include #endif +#ifdef __WXPALMOS__ + #include + #include + #include +#endif + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- diff --git a/src/palmos/button.cpp b/src/palmos/button.cpp index 262972367c..254a83750a 100644 --- a/src/palmos/button.cpp +++ b/src/palmos/button.cpp @@ -44,6 +44,9 @@ #include "wx/stockitem.h" +#include +#include + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -198,7 +201,7 @@ wxSize wxButtonBase::GetDefaultSize() void wxButton::SetDefault() { - FormType* form = GetParentForm(); + FormType* form = (FormType* )GetParentForm(); if(form==NULL) return; FrmSetDefaultButtonID(form,GetId()); diff --git a/src/palmos/checkbox.cpp b/src/palmos/checkbox.cpp index e6ebf0bd09..e05cb527cd 100644 --- a/src/palmos/checkbox.cpp +++ b/src/palmos/checkbox.cpp @@ -37,6 +37,8 @@ #include "wx/settings.h" #endif +#include + // ============================================================================ // implementation // ============================================================================ diff --git a/src/palmos/colordlg.cpp b/src/palmos/colordlg.cpp index 59b60aa228..8811a607dd 100644 --- a/src/palmos/colordlg.cpp +++ b/src/palmos/colordlg.cpp @@ -38,6 +38,9 @@ #include "wx/cmndata.h" #include "wx/colordlg.h" +#include +#include + // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- diff --git a/src/palmos/control.cpp b/src/palmos/control.cpp index 3b9b881995..ecd7a74c4a 100644 --- a/src/palmos/control.cpp +++ b/src/palmos/control.cpp @@ -46,6 +46,10 @@ #include "wx/radiobut.h" #include "wx/slider.h" +#include +#include +#include + // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -78,7 +82,7 @@ wxControl::~wxControl() DestroyChildren(); uint16_t index; - FormType* form = GetObjectFormIndex(index); + FormType* form = (FormType*)GetObjectFormIndex(index); if(form!=NULL && index!=frmInvalidObjectId) { FrmRemoveObject((FormType **)&form,index); @@ -107,13 +111,13 @@ bool wxControl::Create(wxWindow *parent, return true; } -bool wxControl::PalmCreateControl(ControlStyleType style, +bool wxControl::PalmCreateControl(int style, const wxString& label, const wxPoint& pos, const wxSize& size, uint8_t groupID) { - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return false; @@ -135,7 +139,7 @@ bool wxControl::PalmCreateControl(ControlStyleType style, ControlType *control = CtlNewControl( (void **)&form, GetId(), - style, + (ControlStyleType)style, wxEmptyString, x, y, @@ -162,9 +166,9 @@ bool wxControl::PalmCreateField(const wxString& label, const wxSize& size, bool editable, bool underlined, - JustificationType justification) + int justification) { - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return false; @@ -190,7 +194,7 @@ bool wxControl::PalmCreateField(const wxString& label, underlined, false, false, - justification, + (JustificationType)justification, false, false, false @@ -211,7 +215,7 @@ bool wxControl::PalmCreateField(const wxString& label, // various accessors // ---------------------------------------------------------------------------- -FormType* wxControl::GetParentForm() const +WXFORMPTR wxControl::GetParentForm() const { wxWindow* parentTLW = GetParent(); while ( parentTLW && !parentTLW->IsTopLevel() ) @@ -224,9 +228,9 @@ FormType* wxControl::GetParentForm() const return tlw->GetForm(); } -FormType* wxControl::GetObjectFormIndex(uint16_t& index) const +WXFORMPTR wxControl::GetObjectFormIndex(uint16_t& index) const { - FormType* form = GetParentForm(); + FormType* form = (FormType* )GetParentForm(); if(form!=NULL) index = FrmGetObjectIndex(form, GetId()); else @@ -237,7 +241,7 @@ FormType* wxControl::GetObjectFormIndex(uint16_t& index) const void* wxControl::GetObjectPtr() const { uint16_t index; - FormType* form = GetObjectFormIndex(index); + FormType* form = (FormType*)GetObjectFormIndex(index); if(form==NULL || index==frmInvalidObjectId)return NULL; return FrmGetObjectPtr(form,index); } @@ -252,7 +256,7 @@ wxBorder wxControl::GetDefaultBorder() const void wxControl::SetIntValue(int val) { - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return; uint16_t index = FrmGetObjectIndex(form, GetId()); @@ -268,7 +272,7 @@ void wxControl::SetBoolValue(bool val) bool wxControl::GetBoolValue() const { - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return false; uint16_t index = FrmGetObjectIndex(form, GetId()); @@ -282,26 +286,30 @@ wxSize wxControl::DoGetBestSize() const return wxSize(16, 16); } -void wxControl::DoGetBounds( RectangleType &rect ) const +void wxControl::DoGetBounds( WXRECTANGLEPTR rect ) const { - FormType* form = GetParentForm(); + if(rect==NULL) + return; + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return; uint16_t index = FrmGetObjectIndex(form,GetId()); if(index==frmInvalidObjectId) return; - FrmGetObjectBounds(form,index,&rect); + FrmGetObjectBounds(form,index,(RectangleType*)rect); } -void wxControl::DoSetBounds( RectangleType &rect ) +void wxControl::DoSetBounds( WXRECTANGLEPTR rect ) { - FormType* form = GetParentForm(); + if(rect==NULL) + return; + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return; uint16_t index = FrmGetObjectIndex(form,GetId()); if(index==frmInvalidObjectId) return; - FrmSetObjectBounds(form,index,&rect); + FrmSetObjectBounds(form,index,(RectangleType*)rect); } void wxControl::DoGetPosition( int *x, int *y ) const @@ -310,7 +318,7 @@ void wxControl::DoGetPosition( int *x, int *y ) const AdjustForParentClientOrigin(ox, oy); RectangleType rect; - DoGetBounds(rect); + DoGetBounds(&rect); if(x) *x = rect.topLeft.x - ox; @@ -321,7 +329,7 @@ void wxControl::DoGetPosition( int *x, int *y ) const void wxControl::DoGetSize( int *width, int *height ) const { RectangleType rect; - DoGetBounds(rect); + DoGetBounds(&rect); if(width) *width = rect.extent.x; @@ -337,7 +345,7 @@ void wxControl::DoMoveWindow(int x, int y, int width, int height) rect.topLeft.y = y; rect.extent.x = width; rect.extent.y = height; - DoSetBounds(rect); + DoSetBounds(&rect); GetParent()->Refresh(true, &area); } @@ -367,7 +375,7 @@ bool wxControl::IsShown() const bool wxControl::Show( bool show ) { - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return false; uint16_t index = FrmGetObjectIndex(form,GetId()); diff --git a/src/palmos/datectrl.cpp b/src/palmos/datectrl.cpp index 88206bc61b..ca11de84da 100644 --- a/src/palmos/datectrl.cpp +++ b/src/palmos/datectrl.cpp @@ -36,6 +36,9 @@ #define _WX_DEFINE_DATE_EVENTS_ #include "wx/dateevt.h" +#include +#include + IMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl, wxControl) // ============================================================================ diff --git a/src/palmos/evtloop.cpp b/src/palmos/evtloop.cpp index 0c872acbbe..8e981300d1 100644 --- a/src/palmos/evtloop.cpp +++ b/src/palmos/evtloop.cpp @@ -50,6 +50,11 @@ WX_DEFINE_OBJARRAY(wxMsgArray); #endif // wxUSE_THREADS +#include +#include +#include +#include + // ---------------------------------------------------------------------------- // helper class // ---------------------------------------------------------------------------- diff --git a/src/palmos/frame.cpp b/src/palmos/frame.cpp index 3704c42d46..631d1ae7d5 100644 --- a/src/palmos/frame.cpp +++ b/src/palmos/frame.cpp @@ -57,6 +57,9 @@ #include "wx/univ/colschem.h" #endif // __WXUNIVERSAL__ +#include +#include + // ---------------------------------------------------------------------------- // globals // ---------------------------------------------------------------------------- @@ -211,15 +214,16 @@ bool wxFrame::HandleMenuOpen() return true; } -bool wxFrame::HandleMenuSelect(EventType* event) +bool wxFrame::HandleMenuSelect(WXEVENTPTR event) { - int ItemID = event->data.menu.itemID; + const EventType *palmEvent = (EventType *)event; + const int ItemID = palmEvent->data.menu.itemID; if (!m_frameMenuBar) return false; - int item=m_frameMenuBar->ProcessCommand(ItemID); - if(item==-1) + const int item = m_frameMenuBar->ProcessCommand(ItemID); + if (item==-1) return false; wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item); @@ -289,7 +293,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const Y = 0; while ( Y < maxY ) { - if(!FrmPointInTitle(GetForm(),X,Y)) + if(!FrmPointInTitle((FormType*)GetForm(),X,Y)) return wxPoint(X,Y+1); Y++; } diff --git a/src/palmos/menu.cpp b/src/palmos/menu.cpp index 74c9861d41..db6fbfc532 100644 --- a/src/palmos/menu.cpp +++ b/src/palmos/menu.cpp @@ -42,6 +42,10 @@ #include "wx/ownerdrw.h" #endif +#include +#include +#include + // ---------------------------------------------------------------------------- // global variables // ---------------------------------------------------------------------------- diff --git a/src/palmos/msgdlg.cpp b/src/palmos/msgdlg.cpp index 63aa1bdd04..1eaa59f52d 100644 --- a/src/palmos/msgdlg.cpp +++ b/src/palmos/msgdlg.cpp @@ -28,6 +28,9 @@ #include "wx/msgdlg.h" #endif +#include +#include + IMPLEMENT_CLASS(wxMessageDialog, wxDialog) wxMessageDialog::wxMessageDialog(wxWindow *parent, diff --git a/src/palmos/progdlg.cpp b/src/palmos/progdlg.cpp index 9641659886..f7be8c1df5 100644 --- a/src/palmos/progdlg.cpp +++ b/src/palmos/progdlg.cpp @@ -29,6 +29,9 @@ #include "wx/progdlg.h" #include "wx/msgdlg.h" +#include +#include + IMPLEMENT_CLASS(wxProgressDialog, wxDialog) static Boolean wxProgressCallback(PrgCallbackData *data) @@ -65,7 +68,7 @@ wxProgressDialog::~wxProgressDialog() { if(m_prgFrame) { - PrgStopDialog(m_prgFrame, false); + PrgStopDialog((ProgressType *)m_prgFrame, false); m_prgFrame = NULL; } } @@ -80,17 +83,18 @@ bool wxProgressDialog::Update(int value, const wxString& newmsg, bool *skip) EventType event; + ProgressType *prg = (ProgressType *)m_prgFrame; do { EvtGetEvent(&event, 0); - Boolean handled = PrgHandleEvent(m_prgFrame, &event); - if (!PrgHandleEvent(m_prgFrame, &event)) - if( PrgUserCancel(m_prgFrame) ) + Boolean handled = PrgHandleEvent(prg, &event); + if (!PrgHandleEvent(prg, &event)) + if( PrgUserCancel(prg) ) return false; } while(event.eType != sysEventNilEvent); - PrgUpdateDialog(m_prgFrame, 0, 0, "", true); + PrgUpdateDialog(prg, 0, 0, "", true); m_activeSkip = m_canSkip && true; @@ -106,14 +110,15 @@ bool wxProgressDialog::Show(bool show) return false; } -Boolean wxProgressDialog::Callback(PrgCallbackData *data) +Boolean wxProgressDialog::Callback(void *data) { - strncpy( data->textP, m_msg.ToAscii() , data->textLen - 1 ); - data->textChanged = true; - data->displaySkipBtn = m_canSkip; - data->barMaxValue = (uint32_t)m_max; - data->barCurValue = (uint32_t)m_cur; - data->delay = (m_max == m_cur); + PrgCallbackData *palmData = (PrgCallbackData *)data; + strncpy( palmData->textP, m_msg.ToAscii() , palmData->textLen - 1 ); + palmData->textChanged = true; + palmData->displaySkipBtn = m_canSkip; + palmData->barMaxValue = (uint32_t)m_max; + palmData->barCurValue = (uint32_t)m_cur; + palmData->delay = (m_max == m_cur); return true; } diff --git a/src/palmos/radiobut.cpp b/src/palmos/radiobut.cpp index 2e008218e0..f210bcdd97 100644 --- a/src/palmos/radiobut.cpp +++ b/src/palmos/radiobut.cpp @@ -36,6 +36,8 @@ #include "wx/dcscreen.h" #endif +#include + // ============================================================================ // wxRadioButton implementation // ============================================================================ diff --git a/src/palmos/settings.cpp b/src/palmos/settings.cpp index bb050eb107..ef2e8e315e 100644 --- a/src/palmos/settings.cpp +++ b/src/palmos/settings.cpp @@ -33,6 +33,8 @@ #include "wx/module.h" #include "wx/fontutil.h" +#include + // ============================================================================ // implementation // ============================================================================ diff --git a/src/palmos/slider.cpp b/src/palmos/slider.cpp index 3776e7de96..a2390e506d 100644 --- a/src/palmos/slider.cpp +++ b/src/palmos/slider.cpp @@ -30,6 +30,9 @@ #include "wx/toplevel.h" +#include +#include + #if wxUSE_EXTENDED_RTTI WX_DEFINE_FLAGS( wxSliderStyle ) @@ -123,7 +126,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if(!wxControl::Create(parent, id, pos, size, style, validator, name)) return false; - FormType* form = GetParentForm(); + FormType* form = (FormType*)GetParentForm(); if(form==NULL) return false; @@ -324,10 +327,10 @@ bool wxSlider::SendUpdatedEvent() return handled; } -bool wxSlider::SendScrollEvent(EventType* event) +bool wxSlider::SendScrollEvent(WXEVENTPTR event) { - wxEventType scrollEvent; - int newPos = ValueInvertOrNot(event->data.ctlRepeat.value); + const EventType* palmEvent = (EventType*)event; + int newPos = ValueInvertOrNot(palmEvent->data.ctlRepeat.value); if ( newPos == m_oldPos ) { // nothing changed since last event diff --git a/src/palmos/statbrpalm.cpp b/src/palmos/statbrpalm.cpp index f662696fdf..c1b71e42c1 100644 --- a/src/palmos/statbrpalm.cpp +++ b/src/palmos/statbrpalm.cpp @@ -33,6 +33,8 @@ #include "wx/log.h" #include "wx/statusbr.h" +#include + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- diff --git a/src/palmos/stattext.cpp b/src/palmos/stattext.cpp index 61ec4eb58c..c2524d62a2 100644 --- a/src/palmos/stattext.cpp +++ b/src/palmos/stattext.cpp @@ -30,6 +30,8 @@ #include "wx/stattext.h" +#include + #if wxUSE_EXTENDED_RTTI WX_DEFINE_FLAGS( wxStaticTextStyle ) diff --git a/src/palmos/tglbtn.cpp b/src/palmos/tglbtn.cpp index 7412efaf5c..d9de36c03f 100644 --- a/src/palmos/tglbtn.cpp +++ b/src/palmos/tglbtn.cpp @@ -37,6 +37,8 @@ #include "wx/tglbtn.h" +#include + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- diff --git a/src/palmos/toplevel.cpp b/src/palmos/toplevel.cpp index 0fe4043a0f..8b02ac1fc4 100644 --- a/src/palmos/toplevel.cpp +++ b/src/palmos/toplevel.cpp @@ -50,6 +50,9 @@ #include "wx/slider.h" #include "wx/datectrl.h" +#include +#include + // ---------------------------------------------------------------------------- // globals // ---------------------------------------------------------------------------- @@ -60,6 +63,8 @@ extern const wxChar *wxCanvasClassName; // Pointer to the currently active frame for the form event handler. wxTopLevelWindowPalm* ActiveParentFrame; +static Boolean FrameFormHandleEvent(EventType *event); + // ============================================================================ // wxTopLevelWindowPalm implementation // ============================================================================ @@ -130,9 +135,9 @@ bool wxTopLevelWindowPalm::Create(wxWindow *parent, if(FrameForm==NULL) return false; - FrmSetEventHandler(FrameForm,FrameFormHandleEvent); + FrmSetEventHandler((FormType *)FrameForm,FrameFormHandleEvent); - FrmSetActiveForm(FrameForm); + FrmSetActiveForm((FormType *)FrameForm); ActiveParentFrame=this; @@ -149,10 +154,10 @@ wxTopLevelWindowPalm::~wxTopLevelWindowPalm() WXWINHANDLE wxTopLevelWindowPalm::GetWinHandle() const { - FormType *form = GetForm(); + FormType *form = (FormType *)GetForm(); if(form) return FrmGetWindowHandle(form); - return 0; + return NULL; } // ---------------------------------------------------------------------------- @@ -165,7 +170,7 @@ void wxTopLevelWindowPalm::DoShowWindow(int nShowCmd) bool wxTopLevelWindowPalm::Show(bool show) { - FrmDrawForm(FrameForm); + FrmDrawForm((FormType *)FrameForm); wxPaintEvent event(m_windowId); event.SetEventObject(this); @@ -203,7 +208,7 @@ void wxTopLevelWindowPalm::Restore() void wxTopLevelWindowPalm::DoGetSize( int *width, int *height ) const { RectangleType rect; - FrmGetFormBounds( GetForm() , &rect ); + FrmGetFormBounds( (FormType *)GetForm() , &rect ); if(width) *width = rect.extent.x; if(height) @@ -236,7 +241,7 @@ bool wxTopLevelWindowPalm::EnableCloseButton(bool enable) return false; } -FormType *wxTopLevelWindowPalm::GetForm() const +WXFORMPTR wxTopLevelWindowPalm::GetForm() const { return FrmGetActiveForm(); } @@ -250,9 +255,10 @@ bool wxTopLevelWindowPalm::SetShape(const wxRegion& region) // wxTopLevelWindow native event handling // ---------------------------------------------------------------------------- -bool wxTopLevelWindowPalm::HandleControlSelect(EventType* event) +bool wxTopLevelWindowPalm::HandleControlSelect(WXEVENTPTR event) { - int id = event->data.ctlSelect.controlID; + const EventType *palmEvent = (EventType *)event; + const int id = palmEvent->data.ctlSelect.controlID; wxWindow* win = FindWindowById(id,this); if(win==NULL) @@ -297,11 +303,12 @@ bool wxTopLevelWindowPalm::HandleControlSelect(EventType* event) return false; } -bool wxTopLevelWindowPalm::HandleControlRepeat(EventType* event) +bool wxTopLevelWindowPalm::HandleControlRepeat(WXEVENTPTR event) { - int id = event->data.ctlRepeat.controlID; + const EventType *palmEvent = (EventType *)event; + const int id = palmEvent->data.ctlRepeat.controlID; - wxWindow* win = FindWindowById(id,this); + wxWindow* win = FindWindowById(id, this); if(win==NULL) return false; @@ -314,10 +321,11 @@ bool wxTopLevelWindowPalm::HandleControlRepeat(EventType* event) return false; } -bool wxTopLevelWindowPalm::HandleSize(EventType* event) +bool wxTopLevelWindowPalm::HandleSize(WXEVENTPTR event) { - wxSize newSize(event->data.winResized.newBounds.extent.x, - event->data.winResized.newBounds.extent.y); + const EventType *palmEvent = (EventType *)event; + wxSize newSize(palmEvent->data.winResized.newBounds.extent.x, + palmEvent->data.winResized.newBounds.extent.y); wxSizeEvent eventWx(newSize,GetId()); eventWx.SetEventObject(this); return GetEventHandler()->ProcessEvent(eventWx); @@ -341,7 +349,7 @@ void wxTopLevelWindowPalm::OnActivate(wxActivateEvent& event) * finds a better solution, please let me know. My email address is * wbo@freeshell.org */ -static Boolean FrameFormHandleEvent(EventType* event) +static Boolean FrameFormHandleEvent(EventType *event) { // frame and tlw point to the same object but they are for convenience // of calling proper structure withiout later dynamic typcasting diff --git a/src/palmos/utils.cpp b/src/palmos/utils.cpp index 81988757ca..3b17093570 100644 --- a/src/palmos/utils.cpp +++ b/src/palmos/utils.cpp @@ -39,6 +39,7 @@ #include #include #include +#include // ============================================================================ // implementation diff --git a/src/palmos/volume.cpp b/src/palmos/volume.cpp index e0530d13d2..dc49c85693 100644 --- a/src/palmos/volume.cpp +++ b/src/palmos/volume.cpp @@ -39,7 +39,8 @@ #include "wx/arrstr.h" #include "wx/volume.h" -#include "VFSMgr.h" +#include +#include #if wxUSE_BASE diff --git a/src/palmos/window.cpp b/src/palmos/window.cpp index 02a43e497a..91ca0184d8 100644 --- a/src/palmos/window.cpp +++ b/src/palmos/window.cpp @@ -85,6 +85,8 @@ #include "wx/listctrl.h" #include "wx/window.h" +#include + // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- @@ -272,13 +274,13 @@ bool wxWindowPalm::Create(wxWindow *parent, return true; } -FormType *wxWindowPalm::GetFormPtr() +WXFORMPTR wxWindowPalm::GetFormPtr() { return FrameForm; } -void wxWindowPalm::SetFormPtr(FormType *FormPtr) +void wxWindowPalm::SetFormPtr(WXFORMPTR FormPtr) { - FrameForm=FormPtr; + FrameForm = FormPtr; } // --------------------------------------------------------------------------- @@ -442,7 +444,7 @@ void wxWindowPalm::Thaw() void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect) { - WinHandle handle = GetWinHandle(); + WinHandle handle = (WinHandle)GetWinHandle(); if(handle) { if(rect) -- 2.47.2