]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/window.cpp
Add some version checks to help compiling on OSX.
[wxWidgets.git] / src / palmos / window.cpp
index 7be136109f0c30e0d6090f928ee317016698901d..ca7d5955e34c838bcbe22d4253450653c38d8996 100644 (file)
@@ -1,11 +1,11 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/palmos/windows.cpp
+// Name:        src/palmos/window.cpp
 // Purpose:     wxWindow
 // Purpose:     wxWindow
-// Author:      William Osborne
-// Modified by:
+// Author:      William Osborne - minimal working wxPalmOS port
+// Modified by: Wlodzimierz ABX Skiba - more than minimal functionality
 // Created:     10/13/04
 // Created:     10/13/04
-// RCS-ID:      $Id
-// Copyright:   (c) William Osborne
+// RCS-ID:      $Id$
+// Copyright:   (c) William Osborne, Wlodzimierz Skiba
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // headers
 // ---------------------------------------------------------------------------
 
 // headers
 // ---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "window.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#include "wx/window.h"
+
 #ifndef WX_PRECOMP
 #ifndef WX_PRECOMP
-    #include "wx/window.h"
     #include "wx/accel.h"
     #include "wx/accel.h"
-    #include "wx/setup.h"
     #include "wx/menu.h"
     #include "wx/dc.h"
     #include "wx/dcclient.h"
     #include "wx/menu.h"
     #include "wx/dc.h"
     #include "wx/dcclient.h"
     #include "wx/msgdlg.h"
     #include "wx/settings.h"
     #include "wx/statbox.h"
     #include "wx/msgdlg.h"
     #include "wx/settings.h"
     #include "wx/statbox.h"
+    #include "wx/intl.h"
+    #include "wx/log.h"
+    #include "wx/textctrl.h"
+    #include "wx/menuitem.h"
+    #include "wx/module.h"
 #endif
 
 #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
     #include "wx/ownerdrw.h"
 #endif
 
 #endif
 
 #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
     #include "wx/ownerdrw.h"
 #endif
 
-#include "wx/module.h"
-
 #if wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
 #endif
 #if wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
 #endif
@@ -62,9 +61,6 @@
     #include "wx/access.h"
 #endif
 
     #include "wx/access.h"
 #endif
 
-#include "wx/menuitem.h"
-#include "wx/log.h"
-
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
 #endif
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
 #endif
     #include "wx/spinctrl.h"
 #endif // wxUSE_SPINCTRL
 
     #include "wx/spinctrl.h"
 #endif // wxUSE_SPINCTRL
 
-#include "wx/intl.h"
-#include "wx/log.h"
-
-#include "wx/textctrl.h"
 #include "wx/notebook.h"
 #include "wx/listctrl.h"
 
 #include "wx/notebook.h"
 #include "wx/listctrl.h"
 
-#include <string.h>
-
-#include "wx/palmos/window.h"
+#ifndef __WXUNIVERSAL__
+#include <Window.h>
 
 // ---------------------------------------------------------------------------
 // global variables
 // ---------------------------------------------------------------------------
 
 
 // ---------------------------------------------------------------------------
 // global variables
 // ---------------------------------------------------------------------------
 
-#if wxUSE_MENUS_NATIVE
-wxMenu *wxCurrentPopupMenu = NULL;
-#endif // wxUSE_MENUS_NATIVE
-
-#ifdef __WXWINCE__
-extern       wxChar *wxCanvasClassName;
-#else
-extern const wxChar *wxCanvasClassName;
-#endif
-
-// true if we had already created the std colour map, used by
-// wxGetStdColourMap() and wxWindow::OnSysColourChanged()           (FIXME-MT)
-static bool gs_hasStdCmap = false;
-
 // ---------------------------------------------------------------------------
 // private functions
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // private functions
 // ---------------------------------------------------------------------------
@@ -118,116 +95,10 @@ static bool gs_hasStdCmap = false;
 // method
 #ifdef __WXUNIVERSAL__
     IMPLEMENT_ABSTRACT_CLASS(wxWindowPalm, wxWindowBase)
 // method
 #ifdef __WXUNIVERSAL__
     IMPLEMENT_ABSTRACT_CLASS(wxWindowPalm, wxWindowBase)
-#else // __WXPalm__
-#if wxUSE_EXTENDED_RTTI
-
-// windows that are created from a parent window during its Create method, eg. spin controls in a calendar controls
-// must never been streamed out separately otherwise chaos occurs. Right now easiest is to test for negative ids, as
-// windows with negative ids never can be recreated anyway
-
-bool wxWindowStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
-{
-    return false;
-}
-
-IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow, wxWindowBase,"wx/window.h", wxWindowStreamingCallback)
-
-// make wxWindowList known before the property is used
-
-wxCOLLECTION_TYPE_INFO( wxWindow* , wxWindowList ) ;
-
-template<> void wxCollectionToVariantArray( wxWindowList const &theList, wxxVariantArray &value)
-{
-    wxListCollectionToVariantArray<wxWindowList::compatibility_iterator>( theList , value ) ;
-}
-
-WX_DEFINE_FLAGS( wxWindowStyle )
-
-wxBEGIN_FLAGS( wxWindowStyle )
-    // new style border flags, we put them first to
-    // use them for streaming out
-
-    wxFLAGS_MEMBER(wxBORDER_SIMPLE)
-    wxFLAGS_MEMBER(wxBORDER_SUNKEN)
-    wxFLAGS_MEMBER(wxBORDER_DOUBLE)
-    wxFLAGS_MEMBER(wxBORDER_RAISED)
-    wxFLAGS_MEMBER(wxBORDER_STATIC)
-    wxFLAGS_MEMBER(wxBORDER_NONE)
-    
-    // old style border flags
-    wxFLAGS_MEMBER(wxSIMPLE_BORDER)
-    wxFLAGS_MEMBER(wxSUNKEN_BORDER)
-    wxFLAGS_MEMBER(wxDOUBLE_BORDER)
-    wxFLAGS_MEMBER(wxRAISED_BORDER)
-    wxFLAGS_MEMBER(wxSTATIC_BORDER)
-    wxFLAGS_MEMBER(wxBORDER)
-
-    // standard window styles
-    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
-    wxFLAGS_MEMBER(wxCLIP_CHILDREN)
-    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
-    wxFLAGS_MEMBER(wxWANTS_CHARS)
-    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
-    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
-    wxFLAGS_MEMBER(wxVSCROLL)
-    wxFLAGS_MEMBER(wxHSCROLL)
-
-wxEND_FLAGS( wxWindowStyle )
-
-wxBEGIN_PROPERTIES_TABLE(wxWindow)
-    wxEVENT_PROPERTY( Close , wxEVT_CLOSE_WINDOW , wxCloseEvent)
-    wxEVENT_PROPERTY( Create , wxEVT_CREATE , wxWindowCreateEvent )
-    wxEVENT_PROPERTY( Destroy , wxEVT_DESTROY , wxWindowDestroyEvent )
-    // Always constructor Properties first
-
-    wxREADONLY_PROPERTY( Parent,wxWindow*, GetParent, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
-    wxPROPERTY( Id,wxWindowID, SetId, GetId, wxID_ANY, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
-    wxPROPERTY( Position,wxPoint, SetPosition , GetPosition, wxDefaultPosition , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // pos
-    wxPROPERTY( Size,wxSize, SetSize, GetSize, wxDefaultSize , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // size
-    wxPROPERTY( WindowStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
-
-    // Then all relations of the object graph
-
-    wxREADONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetWindowChildren , wxPROP_OBJECT_GRAPH /*flags*/ , wxT("Helpstring") , wxT("group"))
-
-   // and finally all other properties
-
-    wxPROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // extstyle
-    wxPROPERTY( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // bg
-    wxPROPERTY( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // fg
-    wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
-    wxPROPERTY( Shown , bool , Show , IsShown , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
-#if 0
-    // possible property candidates (not in xrc) or not valid in all subclasses
-    wxPROPERTY( Title,wxString, SetTitle, GetTitle, wxT("") )
-    wxPROPERTY( Font , wxFont , SetFont , GetWindowFont  , )
-    wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxT("") )
-    // MaxHeight, Width , MinHeight , Width
-    // TODO switch label to control and title to toplevels
-
-    wxPROPERTY( ThemeEnabled , bool , SetThemeEnabled , GetThemeEnabled , )
-    //wxPROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
-    // wxPROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
-    wxPROPERTY( AutoLayout , bool , SetAutoLayout , GetAutoLayout , )
-
-
-
-#endif
-wxEND_PROPERTIES_TABLE()
-
-wxBEGIN_HANDLERS_TABLE(wxWindow)
-wxEND_HANDLERS_TABLE()
-
-wxCONSTRUCTOR_DUMMY(wxWindow)
-
-#else
-    IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
-#endif
-#endif // __WXUNIVERSAL__/__WXPalm__
+#endif // __WXUNIVERSAL__
 
 BEGIN_EVENT_TABLE(wxWindowPalm, wxWindowBase)
     EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground)
 
 BEGIN_EVENT_TABLE(wxWindowPalm, wxWindowBase)
     EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground)
-    EVT_SYS_COLOUR_CHANGED(wxWindowPalm::OnSysColourChanged)
     EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog)
 END_EVENT_TABLE()
 
     EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog)
 END_EVENT_TABLE()
 
@@ -246,14 +117,19 @@ wxWindow *wxWindowPalm::FindItem(long id) const
 }
 
 // Find an item given the MS Windows handle
 }
 
 // Find an item given the MS Windows handle
-wxWindow *wxWindowPalm::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
+wxWindow *wxWindowPalm::FindItemByWinHandle(WXWINHANDLE handle, bool controlOnly) const
 {
 {
+    // TODO
     return NULL;
 }
 
     return NULL;
 }
 
-// Default command handler
-bool wxWindowPalm::PalmCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
+bool wxGetKeyState(wxKeyCode key)
 {
 {
+    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+        WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
+    // TODO
+
     return false;
 }
 
     return false;
 }
 
@@ -263,6 +139,7 @@ bool wxWindowPalm::PalmCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
 
 void wxWindowPalm::Init()
 {
 
 void wxWindowPalm::Init()
 {
+    m_hWnd = 0;
 }
 
 // Destructor
 }
 
 // Destructor
@@ -272,22 +149,31 @@ wxWindowPalm::~wxWindowPalm()
 
 // real construction (Init() must have been called before!)
 bool wxWindowPalm::Create(wxWindow *parent,
 
 // real construction (Init() must have been called before!)
 bool wxWindowPalm::Create(wxWindow *parent,
-                         wxWindowID id,
-                         const wxPoint& pos,
-                         const wxSize& size,
-                         long style,
-                         const wxString& name)
+                          wxWindowID id,
+                          const wxPoint& pos,
+                          const wxSize& size,
+                          long style,
+                          const wxString& name)
 {
 {
-    return false;
+    wxCHECK_MSG( parent, false, wxT("can't create wxWindow without parent") );
+
+    if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
+        return false;
+
+    parent->AddChild(this);
+
+    InheritAttributes();
+
+    return true;
 }
 
 }
 
-FormType *wxWindowPalm::GetFormPtr()
+WXFORMPTR wxWindowPalm::GetFormPtr()
 {
     return FrameForm;
 }
 {
     return FrameForm;
 }
-void wxWindowPalm::SetFormPtr(FormType *FormPtr)
+void wxWindowPalm::SetFormPtr(WXFORMPTR FormPtr)
 {
 {
-    FrameForm=FormPtr;
+    FrameForm = FormPtr;
 }
 
 // ---------------------------------------------------------------------------
 }
 
 // ---------------------------------------------------------------------------
@@ -328,13 +214,13 @@ void wxWindowPalm::Lower()
 {
 }
 
 {
 }
 
-void wxWindowPalm::SetTitle( const wxString& title)
+void wxWindowPalm::SetLabel( const wxString& WXUNUSED(label))
 {
 }
 
 {
 }
 
-wxString wxWindowPalm::GetTitle() const
+wxString wxWindowPalm::GetLabel() const
 {
 {
-    return wxString("");
+    return wxEmptyString;
 }
 
 void wxWindowPalm::DoCaptureMouse()
 }
 
 void wxWindowPalm::DoCaptureMouse()
@@ -417,31 +303,10 @@ bool wxWindowPalm::ScrollPages(int pages)
     return false;
 }
 
     return false;
 }
 
-// ---------------------------------------------------------------------------
-// subclassing
-// ---------------------------------------------------------------------------
-
-void wxWindowPalm::SubclassWin(WXHWND hWnd)
-{
-}
-
-void wxWindowPalm::UnsubclassWin()
-{
-}
-
-bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
-{
-    return false;
-}
-
 // ----------------------------------------------------------------------------
 // Style handling
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 // Style handling
 // ----------------------------------------------------------------------------
 
-void wxWindowPalm::SetWindowStyleFlag(long flags)
-{
-}
-
 WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
 {
     return 0;
 WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
 {
     return 0;
@@ -452,11 +317,6 @@ void wxWindowPalm::SetupColours()
 {
 }
 
 {
 }
 
-bool wxWindowPalm::IsMouseInWindow() const
-{
-    return false;
-}
-
 void wxWindowPalm::OnInternalIdle()
 {
 }
 void wxWindowPalm::OnInternalIdle()
 {
 }
@@ -467,16 +327,30 @@ bool wxWindowPalm::Reparent(wxWindowBase *parent)
     return false;
 }
 
     return false;
 }
 
-void wxWindowPalm::Freeze()
-{
-}
-
-void wxWindowPalm::Thaw()
-{
-}
-
 void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
 {
 void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
 {
+    WinHandle handle = (WinHandle)GetHWND();
+    if(handle)
+    {
+#ifdef __WXPALMOS6__
+        if(rect)
+        {
+            RectangleType dirtyRect;
+            dirtyRect.topLeft.x = rect->GetX() - 1;
+            dirtyRect.topLeft.y = rect->GetY() - 1;
+            dirtyRect.extent.x = rect->GetWidth() + 1;
+            dirtyRect.extent.y = rect->GetHeight() + 1;
+            WinInvalidateRect(handle, &dirtyRect);
+        }
+        else
+        {
+            WinInvalidateWindow(handle);
+        }
+#else // __WXPALMOS5__
+        WinSetActiveWindow (handle);
+#endif
+
+    }
 }
 
 void wxWindowPalm::Update()
 }
 
 void wxWindowPalm::Update()
@@ -528,6 +402,10 @@ void wxWindowPalm::DoGetClientSize(int *x, int *y) const
 
 void wxWindowPalm::DoGetPosition(int *x, int *y) const
 {
 
 void wxWindowPalm::DoGetPosition(int *x, int *y) const
 {
+    if(x)
+        *x = 0;
+    if(y)
+        *y = 0;
 }
 
 void wxWindowPalm::DoScreenToClient(int *x, int *y) const
 }
 
 void wxWindowPalm::DoScreenToClient(int *x, int *y) const
@@ -552,19 +430,67 @@ void wxWindowPalm::DoMoveWindow(int x, int y, int width, int height)
 // width/height
 void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 {
 // width/height
 void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 {
+    // get the current size and position...
+    int currentX, currentY;
+    GetPosition(&currentX, &currentY);
+    int currentW,currentH;
+    GetSize(&currentW, &currentH);
+
+    // ... and don't do anything (avoiding flicker) if it's already ok
+    if ( x == currentX && y == currentY &&
+         width == currentW && height == currentH )
+    {
+        return;
+    }
+
+    if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+        x = currentX;
+    if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+        y = currentY;
+
+    AdjustForParentClientOrigin(x, y, sizeFlags);
+
+    wxSize size = wxDefaultSize;
+    if ( width == wxDefaultCoord )
+    {
+        if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+        {
+            size = DoGetBestSize();
+            width = size.x;
+        }
+        else
+        {
+            // just take the current one
+            width = currentW;
+        }
+    }
+
+    if ( height == wxDefaultCoord )
+    {
+        if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+        {
+            if ( size.x == wxDefaultCoord )
+            {
+                size = DoGetBestSize();
+            }
+            //else: already called DoGetBestSize() above
+
+            height = size.y;
+        }
+        else
+        {
+            // just take the current one
+            height = currentH;
+        }
+    }
+
+    DoMoveWindow(x, y, width, height);
 }
 
 void wxWindowPalm::DoSetClientSize(int width, int height)
 {
 }
 
 }
 
 void wxWindowPalm::DoSetClientSize(int width, int height)
 {
 }
 
-// For implementation purposes - sometimes decorations make the client area
-// smaller
-wxPoint wxWindowPalm::GetClientAreaOrigin() const
-{
-    return wxPoint(0, 0);
-}
-
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------
@@ -579,10 +505,11 @@ int wxWindowPalm::GetCharWidth() const
     return 0;
 }
 
     return 0;
 }
 
-void wxWindowPalm::GetTextExtent(const wxString& string,
-                             int *x, int *y,
-                             int *descent, int *externalLeading,
-                             const wxFont *theFont) const
+void wxWindowPalm::DoGetTextExtent(const wxString& string,
+                                   int *x, int *y,
+                                   int *descent,
+                                   int *externalLeading,
+                                   const wxFont *theFont) const
 {
 }
 
 {
 }
 
@@ -608,60 +535,15 @@ bool wxWindowPalm::DoPopupMenu(wxMenu *menu, int x, int y)
 
 #endif // wxUSE_MENUS_NATIVE
 
 
 #endif // wxUSE_MENUS_NATIVE
 
-// ===========================================================================
-// pre/post message processing
-// ===========================================================================
-
-WXLRESULT wxWindowPalm::PalmDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
-bool wxWindowPalm::PalmProcessMessage(WXMSG* pMsg)
-{
-    return false;
-}
-
-bool wxWindowPalm::PalmTranslateMessage(WXMSG* pMsg)
-{
-    return false;
-}
-
-bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG* WXUNUSED(pMsg))
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// Main wxWidgets window proc and the window proc for wxWindow
-// ---------------------------------------------------------------------------
-
-// Hook for new window just as it's being created, when the window isn't yet
-// associated with the handle
-
-// implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
-// window being created and insures that it's always unset back later
-wxWindowCreationHook::wxWindowCreationHook(wxWindowPalm *winBeingCreated)
-{
-}
-
-wxWindowCreationHook::~wxWindowCreationHook()
-{
-}
-
-WXLRESULT wxWindowPalm::PalmWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
 // ----------------------------------------------------------------------------
 // wxWindow <-> HWND map
 // ----------------------------------------------------------------------------
 
 wxWinHashTable *wxWinHandleHash = NULL;
 
 // ----------------------------------------------------------------------------
 // wxWindow <-> HWND map
 // ----------------------------------------------------------------------------
 
 wxWinHashTable *wxWinHandleHash = NULL;
 
-wxWindow *wxFindWinFromHandle(WXHWND hWnd)
+wxWindow *wxFindWinFromWinHandle(WXWINHANDLE handle)
 {
 {
+    // TODO
     return NULL;
 }
 
     return NULL;
 }
 
@@ -670,34 +552,23 @@ void wxRemoveHandleAssociation(wxWindowPalm *win)
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
-// various Palm speciic class dependent functions
+// various Palm specific class dependent functions
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 
-// Default destroyer - override if you destroy it in some other way
-// (e.g. with MDI child windows)
-void wxWindowPalm::PalmDestroyWindow()
-{
-}
-
 bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
 bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
-                                           const wxSize& size,
-                                           int& x, int& y,
-                                           int& w, int& h) const
+                                             const wxSize& size,
+                                             int& x, int& y,
+                                             int& w, int& h) const
 {
     return false;
 }
 
 {
     return false;
 }
 
-WXHWND wxWindowPalm::PalmGetParent() const
-{
-    return NULL;
-}
-
 bool wxWindowPalm::PalmCreate(const wxChar *wclass,
 bool wxWindowPalm::PalmCreate(const wxChar *wclass,
-                            const wxChar *title,
-                            const wxPoint& pos,
-                            const wxSize& size,
-                            WXDWORD style,
-                            WXDWORD extendedStyle)
+                              const wxChar *title,
+                              const wxPoint& pos,
+                              const wxSize& size,
+                              WXDWORD style,
+                              WXDWORD extendedStyle)
 {
     return false;
 }
 {
     return false;
 }
@@ -706,214 +577,15 @@ bool wxWindowPalm::PalmCreate(const wxChar *wclass,
 // Palm message handlers
 // ===========================================================================
 
 // Palm message handlers
 // ===========================================================================
 
-// ---------------------------------------------------------------------------
-// WM_NOTIFY
-// ---------------------------------------------------------------------------
-
-#ifdef __WIN95__
-
-bool wxWindowPalm::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
-{
-    return false;
-}
-
-#if wxUSE_TOOLTIPS
-
-bool wxWindowPalm::HandleTooltipNotify(WXUINT code,
-                                      WXLPARAM lParam,
-                                      const wxString& ttip)
-{
-    return false;
-}
-
-#endif // wxUSE_TOOLTIPS
-
-bool wxWindowPalm::PalmOnNotify(int WXUNUSED(idCtrl),
-                              WXLPARAM lParam,
-                              WXLPARAM* WXUNUSED(result))
-{
-    return false;
-}
-
-#endif // __WIN95__
-
-// ---------------------------------------------------------------------------
-// end session messages
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleQueryEndSession(long logOff, bool *mayEnd)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleEndSession(bool endSession, long logOff)
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// window creation/destruction
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleDestroy()
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// activation/focus
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleActivate(int state,
-                              bool WXUNUSED(minimized),
-                              WXHWND WXUNUSED(activate))
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleSetFocus(WXHWND hwnd)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleKillFocus(WXHWND hwnd)
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// miscellaneous
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleShow(bool show, int WXUNUSED(status))
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam)
-{
-    return false;
-}
-
-
-bool wxWindowPalm::HandleSetCursor(WXHWND WXUNUSED(hWnd),
-                                  short nHitTest,
-                                  int WXUNUSED(mouseMsg))
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// owner drawn stuff
-// ---------------------------------------------------------------------------
-
-#if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
-        (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
-    #define WXUNUSED_UNLESS_ODRAWN(param) param
-#else
-    #define WXUNUSED_UNLESS_ODRAWN(param)
-#endif
-
-bool
-wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
-                           WXDRAWITEMSTRUCT * WXUNUSED_UNLESS_ODRAWN(itemStruct))
-{
-    return false;
-}
-
-bool
-wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id),
-                              WXMEASUREITEMSTRUCT *
-                                  WXUNUSED_UNLESS_ODRAWN(itemStruct))
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// colours and palettes
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleSysColorChange()
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleDisplayChange()
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleCtlColor(WXHBRUSH *brush,
-                              WXHDC pDC,
-                              WXHWND pWnd,
-                              WXUINT nCtlColor,
-                              WXUINT message,
-                              WXWPARAM wParam,
-                              WXLPARAM lParam)
-{
-    return false;
-}
-
-// Define for each class of dialog and control
-WXHBRUSH wxWindowPalm::OnCtlColor(WXHDC WXUNUSED(hDC),
-                                 WXHWND WXUNUSED(hWnd),
-                                 WXUINT WXUNUSED(nCtlColor),
-                                 WXUINT WXUNUSED(message),
-                                 WXWPARAM WXUNUSED(wParam),
-                                 WXLPARAM WXUNUSED(lParam))
-{
-    return (WXHBRUSH)0;
-}
-
-bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleQueryNewPalette()
-{
-    return false;
-}
-
-// Responds to colour changes: passes event on to children.
-void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
-{
-}
-
 // ---------------------------------------------------------------------------
 // painting
 // ---------------------------------------------------------------------------
 
 // ---------------------------------------------------------------------------
 // painting
 // ---------------------------------------------------------------------------
 
-bool wxWindowPalm::HandlePaint()
-{
-    return false;
-}
-
 // Can be called from an application's OnPaint handler
 void wxWindowPalm::OnPaint(wxPaintEvent& event)
 {
 }
 
 // Can be called from an application's OnPaint handler
 void wxWindowPalm::OnPaint(wxPaintEvent& event)
 {
 }
 
-bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc)
-{
-    return false;
-}
-
 void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
 {
 }
 void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
 {
 }
@@ -922,16 +594,6 @@ void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
 // moving and resizing
 // ---------------------------------------------------------------------------
 
 // moving and resizing
 // ---------------------------------------------------------------------------
 
-bool wxWindowPalm::HandleMinimize()
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleMaximize()
-{
-    return false;
-}
-
 bool wxWindowPalm::HandleMove(int x, int y)
 {
     return false;
 bool wxWindowPalm::HandleMove(int x, int y)
 {
     return false;
@@ -942,111 +604,6 @@ bool wxWindowPalm::HandleMoving(wxRect& rect)
     return false;
 }
 
     return false;
 }
 
-bool wxWindowPalm::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
-                             WXUINT WXUNUSED(flag))
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleSizing(wxRect& rect)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo)
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// command messages
-// ---------------------------------------------------------------------------
-
-bool wxWindowPalm::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
-{
-    return false;
-}
-
-// ---------------------------------------------------------------------------
-// mouse events
-// ---------------------------------------------------------------------------
-
-void wxWindowPalm::InitMouseEvent(wxMouseEvent& event,
-                                 int x, int y,
-                                 WXUINT flags)
-{
-}
-
-// Windows doesn't send the mouse events to the static controls (which are
-// transparent in the sense that their WM_NCHITTEST handler returns
-// HTTRANSPARENT) at all but we want all controls to receive the mouse events
-// and so we manually check if we don't have a child window under mouse and if
-// we do, send the event to it instead of the window Windows had sent WM_XXX
-// to.
-//
-// Notice that this is not done for the mouse move events because this could
-// (would?) be too slow, but only for clicks which means that the static texts
-// still don't get move, enter nor leave events.
-static wxWindowPalm *FindWindowForMouseEvent(wxWindowPalm *win, int *x, int *y) //TW:REQ:Univ
-{
-    return NULL;
-}
-
-bool wxWindowPalm::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleMouseMove(int x, int y, WXUINT flags)
-{
-    return false;
-}
-
-
-bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
-
-// ---------------------------------------------------------------------------
-// keyboard handling
-// ---------------------------------------------------------------------------
-
-// create the key event of the given type for the given key - used by
-// HandleChar and HandleKeyDown/Up
-wxKeyEvent wxWindowPalm::CreateKeyEvent(wxEventType evType,
-                                       int id,
-                                       WXLPARAM lParam,
-                                       WXWPARAM wParam) const
-{
-    wxKeyEvent event(evType);
-
-    return event;
-}
-
-// isASCII is true only when we're called from WM_CHAR handler and not from
-// WM_KEYDOWN one
-bool wxWindowPalm::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
-bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
-int wxWindowPalm::HandleMenuChar(int chAccel, WXLPARAM lParam)
-{
-    return 0;
-}
-
 // ---------------------------------------------------------------------------
 // joystick
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // joystick
 // ---------------------------------------------------------------------------
@@ -1061,8 +618,9 @@ bool wxWindowPalm::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
 // ---------------------------------------------------------------------------
 
 bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
 // ---------------------------------------------------------------------------
 
 bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
-                              WXWORD pos, WXHWND control)
-{    
+                                WXWORD pos, WXWINHANDLE control)
+{
+    // TODO
     return false;
 }
 
     return false;
 }
 
@@ -1070,68 +628,9 @@ bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
 // global functions
 // ===========================================================================
 
 // global functions
 // ===========================================================================
 
-void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont *the_font)
+void wxGetCharSize(WXWINHANDLE wnd, int *x, int *y, const wxFont *the_font)
 {
 {
-}
-
-// Returns 0 if was a normal ASCII value, not a special key. This indicates that
-// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
-int wxCharCodePalmToWX(int keySym, WXLPARAM lParam)
-{
-    return 0;
-}
-
-int wxCharCodeWXToPalm(int id, bool *isVirtual)
-{
-    return 0;
-}
-
-bool wxGetKeyState(wxKeyCode key)
-{
-    return false;
-}
-
-wxWindow *wxGetActiveWindow()
-{
-    return NULL;
-}
-
-extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
-{
-    return NULL;
-}
-
-#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
-
-void wxSetKeyboardHook(bool doIt)
-{
-}
-
-#endif // !__WXMICROWIN__
-
-#ifdef __WXDEBUG__
-const char *wxGetMessageName(int message)
-{
-    return "";
-}
-#endif //__WXDEBUG__
-
-// Find the wxWindow at the current mouse position, returning the mouse
-// position.
-wxWindow* wxFindWindowAtPointer(wxPoint& pt)
-{
-    return NULL;
-}
-
-wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
-{
-    return NULL;
-}
-
-// Get the current mouse position.
-wxPoint wxGetMousePosition()
-{
-    return wxPoint(0, 0);
+    // TODO
 }
 
 #if wxUSE_HOTKEY
 }
 
 #if wxUSE_HOTKEY
@@ -1145,16 +644,5 @@ bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
 {
     return false;
 }
 {
     return false;
 }
-
-#if wxUSE_ACCEL
-
-bool wxWindowPalm::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
-{
-    return false;
-}
-
-#endif // wxUSE_ACCEL
-
+#endif // # __WXUNIVERSAL__
 #endif // wxUSE_HOTKEY
 #endif // wxUSE_HOTKEY
-
-