/* define fixed length types */
/* ---------------------------------------------------------------------------- */
+#if defined(__WXPALMOS__) || defined(__MINGW32__)
+ #include <sys/types.h>
+#endif
+
/* chars are always one byte (by definition), shorts are always two (in */
/* practice) */
/* 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 <sys/types.h>
#if defined(_SSIZE_T_) && !defined(HAVE_SSIZE_T)
#define HAVE_SSIZE_T
#endif
#if defined(__WXPALMOS__)
+typedef void * WXHWND;
typedef void * WXHANDLE;
typedef void * WXHICON;
typedef void * WXHFONT;
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__ */
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_
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
// 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,
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()
// 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()
#if wxUSE_MENUS_NATIVE
bool HandleMenuOpen();
- bool HandleMenuSelect(EventType* event);
+ bool HandleMenuSelect(WXEVENTPTR event);
#endif // wxUSE_MENUS_NATIVE
protected:
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;
uint8_t m_groupID;
// pushButtonCtl or checkboxCtl
- ControlStyleType m_radioStyle;
+ int m_radioStyle;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton)
};
// send a notification event, return true if processed
bool SendUpdatedEvent();
- bool SendScrollEvent(EventType* event);
+ bool SendScrollEvent(WXEVENTPTR event);
protected:
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;
DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm)
};
-static Boolean FrameFormHandleEvent(EventType* pEvent);
-
#endif // _WX_PALMOS_TOPLEVEL_H_
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;
# include "wx/msw/wince/libraries.h"
#endif
-/* Force inclusion of main PalmOS header: */
-#ifdef __WXPALMOS__
-# include <PalmOS.h>
-# undef Abs
-#endif
-
/*
This macro can be used to test the gcc version and can be used like this:
#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 */
#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 <stddef.h>
+#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 )
#define wxHAVE_TCHAR_SUPPORT
#include <stddef.h>
#include <string.h>
/* time.h functions */
#define wxAsctime _tasctime
#define wxCtime _tctime
-
+
#define wxMbstowcs mbstowcs
#define wxWcstombs wcstombs
#else /* !TCHAR-aware compilers */
#include "wx/msw/wrapwin.h"
#endif
+// include all PalmOS headers at once
+#ifdef __WXPALMOS__
+# include <PalmOS.h>
+#endif
+
// include the most common wx headers
#include "wx/wx.h"
#include <DriverServices.h>
#endif
+#ifdef __WXPALMOS__
+ #include <DateTime.h>
+ #include <TimeMgr.h>
+ #include <SystemMgr.h>
+#endif
+
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
#include "wx/stockitem.h"
+#include <Control.h>
+#include <Form.h>
+
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
void wxButton::SetDefault()
{
- FormType* form = GetParentForm();
+ FormType* form = (FormType* )GetParentForm();
if(form==NULL)
return;
FrmSetDefaultButtonID(form,GetId());
#include "wx/settings.h"
#endif
+#include <Control.h>
+
// ============================================================================
// implementation
// ============================================================================
#include "wx/cmndata.h"
#include "wx/colordlg.h"
+#include <UIColor.h>
+#include <UIControls.h>
+
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
#include "wx/radiobut.h"
#include "wx/slider.h"
+#include <Control.h>
+#include <Form.h>
+#include <StatusBar.h>
+
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
DestroyChildren();
uint16_t index;
- FormType* form = GetObjectFormIndex(index);
+ FormType* form = (FormType*)GetObjectFormIndex(index);
if(form!=NULL && index!=frmInvalidObjectId)
{
FrmRemoveObject((FormType **)&form,index);
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;
ControlType *control = CtlNewControl(
(void **)&form,
GetId(),
- style,
+ (ControlStyleType)style,
wxEmptyString,
x,
y,
const wxSize& size,
bool editable,
bool underlined,
- JustificationType justification)
+ int justification)
{
- FormType* form = GetParentForm();
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return false;
underlined,
false,
false,
- justification,
+ (JustificationType)justification,
false,
false,
false
// various accessors
// ----------------------------------------------------------------------------
-FormType* wxControl::GetParentForm() const
+WXFORMPTR wxControl::GetParentForm() const
{
wxWindow* parentTLW = GetParent();
while ( parentTLW && !parentTLW->IsTopLevel() )
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
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);
}
void wxControl::SetIntValue(int val)
{
- FormType* form = GetParentForm();
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form, GetId());
bool wxControl::GetBoolValue() const
{
- FormType* form = GetParentForm();
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form, GetId());
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
AdjustForParentClientOrigin(ox, oy);
RectangleType rect;
- DoGetBounds(rect);
+ DoGetBounds(&rect);
if(x)
*x = rect.topLeft.x - ox;
void wxControl::DoGetSize( int *width, int *height ) const
{
RectangleType rect;
- DoGetBounds(rect);
+ DoGetBounds(&rect);
if(width)
*width = rect.extent.x;
rect.topLeft.y = y;
rect.extent.x = width;
rect.extent.y = height;
- DoSetBounds(rect);
+ DoSetBounds(&rect);
GetParent()->Refresh(true, &area);
}
bool wxControl::Show( bool show )
{
- FormType* form = GetParentForm();
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form,GetId());
#define _WX_DEFINE_DATE_EVENTS_
#include "wx/dateevt.h"
+#include <Control.h>
+#include <SelDay.h>
+
IMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl, wxControl)
// ============================================================================
WX_DEFINE_OBJARRAY(wxMsgArray);
#endif // wxUSE_THREADS
+#include <Event.h>
+#include <SystemMgr.h>
+#include <Menu.h>
+#include <Form.h>
+
// ----------------------------------------------------------------------------
// helper class
// ----------------------------------------------------------------------------
#include "wx/univ/colschem.h"
#endif // __WXUNIVERSAL__
+#include <Event.h>
+#include <Form.h>
+
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
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);
Y = 0;
while ( Y < maxY )
{
- if(!FrmPointInTitle(GetForm(),X,Y))
+ if(!FrmPointInTitle((FormType*)GetForm(),X,Y))
return wxPoint(X,Y+1);
Y++;
}
#include "wx/ownerdrw.h"
#endif
+#include <Loader.h>
+#include <Form.h>
+#include <Menu.h>
+
// ----------------------------------------------------------------------------
// global variables
// ----------------------------------------------------------------------------
#include "wx/msgdlg.h"
#endif
+#include <Loader.h>
+#include <Form.h>
+
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
wxMessageDialog::wxMessageDialog(wxWindow *parent,
#include "wx/progdlg.h"
#include "wx/msgdlg.h"
+#include <Progress.h>
+#include <SysEvtMgr.h>
+
IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
static Boolean wxProgressCallback(PrgCallbackData *data)
{
if(m_prgFrame)
{
- PrgStopDialog(m_prgFrame, false);
+ PrgStopDialog((ProgressType *)m_prgFrame, false);
m_prgFrame = NULL;
}
}
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;
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;
}
#include "wx/dcscreen.h"
#endif
+#include <Control.h>
+
// ============================================================================
// wxRadioButton implementation
// ============================================================================
#include "wx/module.h"
#include "wx/fontutil.h"
+#include <UIColor.h>
+
// ============================================================================
// implementation
// ============================================================================
#include "wx/toplevel.h"
+#include <Form.h>
+#include <Control.h>
+
#if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxSliderStyle )
if(!wxControl::Create(parent, id, pos, size, style, validator, name))
return false;
- FormType* form = GetParentForm();
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return false;
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
#include "wx/log.h"
#include "wx/statusbr.h"
+#include <StatusBar.h>
+
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
#include "wx/stattext.h"
+#include <Field.h>
+
#if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxStaticTextStyle )
#include "wx/tglbtn.h"
+#include <Control.h>
+
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
#include "wx/slider.h"
#include "wx/datectrl.h"
+#include <Window.h>
+#include <Form.h>
+
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
// Pointer to the currently active frame for the form event handler.
wxTopLevelWindowPalm* ActiveParentFrame;
+static Boolean FrameFormHandleEvent(EventType *event);
+
// ============================================================================
// wxTopLevelWindowPalm implementation
// ============================================================================
if(FrameForm==NULL)
return false;
- FrmSetEventHandler(FrameForm,FrameFormHandleEvent);
+ FrmSetEventHandler((FormType *)FrameForm,FrameFormHandleEvent);
- FrmSetActiveForm(FrameForm);
+ FrmSetActiveForm((FormType *)FrameForm);
ActiveParentFrame=this;
WXWINHANDLE wxTopLevelWindowPalm::GetWinHandle() const
{
- FormType *form = GetForm();
+ FormType *form = (FormType *)GetForm();
if(form)
return FrmGetWindowHandle(form);
- return 0;
+ return NULL;
}
// ----------------------------------------------------------------------------
bool wxTopLevelWindowPalm::Show(bool show)
{
- FrmDrawForm(FrameForm);
+ FrmDrawForm((FormType *)FrameForm);
wxPaintEvent event(m_windowId);
event.SetEventObject(this);
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)
return false;
}
-FormType *wxTopLevelWindowPalm::GetForm() const
+WXFORMPTR wxTopLevelWindowPalm::GetForm() const
{
return FrmGetActiveForm();
}
// 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)
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;
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);
* 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
#include <MemoryMgr.h>
#include <DLServer.h>
#include <SoundMgr.h>
+#include <SysUtils.h>
// ============================================================================
// implementation
#include "wx/arrstr.h"
#include "wx/volume.h"
-#include "VFSMgr.h"
+#include <VFSMgr.h>
+#include <PalmTypesCompatibility.h>
#if wxUSE_BASE
#include "wx/listctrl.h"
#include "wx/window.h"
+#include <Window.h>
+
// ---------------------------------------------------------------------------
// global variables
// ---------------------------------------------------------------------------
return true;
}
-FormType *wxWindowPalm::GetFormPtr()
+WXFORMPTR wxWindowPalm::GetFormPtr()
{
return FrameForm;
}
-void wxWindowPalm::SetFormPtr(FormType *FormPtr)
+void wxWindowPalm::SetFormPtr(WXFORMPTR FormPtr)
{
- FrameForm=FormPtr;
+ FrameForm = FormPtr;
}
// ---------------------------------------------------------------------------
void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
{
- WinHandle handle = GetWinHandle();
+ WinHandle handle = (WinHandle)GetWinHandle();
if(handle)
{
if(rect)