]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/app.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #include <sys/ioctl.h>
18 #include <sys/select.h>
23 #include <sys/types.h>
39 class WXDLLEXPORT wxFrame
;
40 class WXDLLEXPORT wxWindow
;
41 class WXDLLEXPORT wxApp
;
42 class WXDLLEXPORT wxKeyEvent
;
43 class WXDLLEXPORT wxLog
;
45 WXDLLEXPORT_DATA(extern wxApp
*) wxTheApp
;
46 WXDLLEXPORT_DATA(extern HAB
) vHabmain
;
48 // Force an exit from main loop
49 void WXDLLEXPORT
wxExit(void);
51 // Yield to other apps/messages
52 bool WXDLLEXPORT
wxYield(void);
54 extern MRESULT EXPENTRY
wxWndProc( HWND
61 // Represents the application. Derive OnInit and declare
62 // a new App object to start application
63 class WXDLLEXPORT wxApp
: public wxAppBase
65 DECLARE_DYNAMIC_CLASS(wxApp
)
71 virtual bool OnInitGui(void);
73 // override base class (pure) virtuals
74 virtual int MainLoop(void);
75 virtual void ExitMainLoop(void);
76 virtual bool Initialized(void);
77 virtual bool Pending(void) ;
78 virtual void Dispatch(void);
82 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
83 virtual bool ProcessIdle(void);
84 virtual void WakeUpIdle(void);
86 virtual void SetPrintMode(int mode
) { m_nPrintMode
= mode
; }
87 virtual int GetPrintMode(void) const { return m_nPrintMode
; }
89 // implementation only
90 void OnIdle(wxIdleEvent
& rEvent
);
91 void OnEndSession(wxCloseEvent
& rEvent
);
92 void OnQueryEndSession(wxCloseEvent
& rEvent
);
94 // Send idle event to all top-level windows.
95 // Returns TRUE if more idle time is requested.
96 bool SendIdleEvents(void);
98 // Send idle event to window and all subwindows
99 // Returns TRUE if more idle time is requested.
100 bool SendIdleEvents(wxWindow
* pWin
);
102 void SetAuto3D(bool bFlag
) { m_bAuto3D
= bFlag
; }
103 bool GetAuto3D(void) const { return m_bAuto3D
; }
105 int AddSocketHandler(int handle
, int mask
,
106 void (*callback
)(void*), void * gsock
);
107 void RemoveSocketHandler(int handle
);
108 void HandleSockets();
112 int m_nPrintMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
113 bool m_bAuto3D
; // Always use 3D controls, except where overriden
116 // PM-specific wxApp definitions */
119 int m_maxSocketHandles
;
121 int m_lastUsedHandle
;
124 void* m_sockCallbackInfo
;
129 static bool Initialize(HAB vHab
);
130 static void CleanUp(void);
132 static bool RegisterWindowClasses(HAB vHab
);
133 virtual void DoMessage(WXMSG
*pMsg
);
134 virtual bool DoMessage(void);
135 virtual bool ProcessMessage(WXMSG
* pMsg
);
136 void DeletePendingObjects(void);
145 DECLARE_EVENT_TABLE()
148 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );