]>
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 /////////////////////////////////////////////////////////////////////////////
16 #include <sys/types.h>
31 class WXDLLEXPORT wxFrame
;
32 class WXDLLEXPORT wxWindow
;
33 class WXDLLEXPORT wxApp
;
34 class WXDLLEXPORT wxKeyEvent
;
35 class WXDLLEXPORT wxLog
;
37 WXDLLEXPORT_DATA(extern wxApp
*) wxTheApp
;
38 WXDLLEXPORT_DATA(extern HAB
) vHabmain
;
40 // Force an exit from main loop
41 void WXDLLEXPORT
wxExit(void);
43 // Yield to other apps/messages
44 bool WXDLLEXPORT
wxYield(void);
46 extern MRESULT EXPENTRY
wxWndProc( HWND
53 // Represents the application. Derive OnInit and declare
54 // a new App object to start application
55 class WXDLLEXPORT wxApp
: public wxAppBase
57 DECLARE_DYNAMIC_CLASS(wxApp
)
63 virtual bool OnInitGui(void);
65 // override base class (pure) virtuals
66 virtual int MainLoop(void);
67 virtual void ExitMainLoop(void);
68 virtual bool Initialized(void);
69 virtual bool Pending(void) ;
70 virtual void Dispatch(void);
72 virtual wxIcon
GetStdIcon(int which
) const;
74 virtual void SetPrintMode(int mode
) { m_nPrintMode
= mode
; }
75 virtual int GetPrintMode(void) const { return m_nPrintMode
; }
77 // implementation only
78 void OnIdle(wxIdleEvent
& rEvent
);
79 void OnEndSession(wxCloseEvent
& rEvent
);
80 void OnQueryEndSession(wxCloseEvent
& rEvent
);
82 // Send idle event to all top-level windows.
83 // Returns TRUE if more idle time is requested.
84 bool SendIdleEvents(void);
86 // Send idle event to window and all subwindows
87 // Returns TRUE if more idle time is requested.
88 bool SendIdleEvents(wxWindow
* pWin
);
90 void SetAuto3D(bool bFlag
) { m_bAuto3D
= bFlag
; }
91 bool GetAuto3D(void) const { return m_bAuto3D
; }
93 int AddSocketHandler(int handle
, int mask
,
94 void (*callback
)(void*), void * gsock
);
95 void RemoveSocketHandler(int handle
);
100 int m_nPrintMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
101 bool m_bAuto3D
; // Always use 3D controls, except where overriden
104 // PM-specific wxApp definitions */
107 int m_maxSocketHandles
;
109 int m_lastUsedHandle
;
112 void* m_sockCallbackInfo
;
117 static bool Initialize(HAB vHab
);
118 static void CleanUp(void);
120 static bool RegisterWindowClasses(HAB vHab
);
121 virtual bool DoMessage(void);
122 virtual bool ProcessMessage(WXMSG
* pMsg
);
123 void DeletePendingObjects(void);
124 bool ProcessIdle(void);
133 DECLARE_EVENT_TABLE()
136 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );