]>
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>
30 class WXDLLEXPORT wxFrame
;
31 class WXDLLEXPORT wxWindow
;
32 class WXDLLEXPORT wxApp
;
33 class WXDLLEXPORT wxKeyEvent
;
34 class WXDLLEXPORT wxLog
;
36 WXDLLEXPORT_DATA(extern wxApp
*) wxTheApp
;
37 WXDLLEXPORT_DATA(extern HAB
) vHabmain
;
39 // Force an exit from main loop
40 void WXDLLEXPORT
wxExit(void);
42 // Yield to other apps/messages
43 bool WXDLLEXPORT
wxYield(void);
45 extern MRESULT EXPENTRY
wxWndProc( HWND
52 // Represents the application. Derive OnInit and declare
53 // a new App object to start application
54 class WXDLLEXPORT wxApp
: public wxAppBase
56 DECLARE_DYNAMIC_CLASS(wxApp
)
62 virtual bool OnInitGui(void);
64 // override base class (pure) virtuals
65 virtual int MainLoop(void);
66 virtual void ExitMainLoop(void);
67 virtual bool Initialized(void);
68 virtual bool Pending(void) ;
69 virtual void Dispatch(void);
71 virtual wxIcon
GetStdIcon(int which
) const;
73 virtual void SetPrintMode(int mode
) { m_nPrintMode
= mode
; }
74 virtual int GetPrintMode(void) const { return m_nPrintMode
; }
76 // implementation only
77 void OnIdle(wxIdleEvent
& rEvent
);
78 void OnEndSession(wxCloseEvent
& rEvent
);
79 void OnQueryEndSession(wxCloseEvent
& rEvent
);
81 // Send idle event to all top-level windows.
82 // Returns TRUE if more idle time is requested.
83 bool SendIdleEvents(void);
85 // Send idle event to window and all subwindows
86 // Returns TRUE if more idle time is requested.
87 bool SendIdleEvents(wxWindow
* pWin
);
89 void SetAuto3D(bool bFlag
) { m_bAuto3D
= bFlag
; }
90 bool GetAuto3D(void) const { return m_bAuto3D
; }
92 int AddSocketHandler(int handle
, int mask
,
93 void (*callback
)(void*), void * gsock
);
94 void RemoveSocketHandler(int handle
);
99 int m_nPrintMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
100 bool m_bAuto3D
; // Always use 3D controls, except where overriden
103 // PM-specific wxApp definitions */
106 int m_maxSocketHandles
;
108 int m_lastUsedHandle
;
111 void* m_sockCallbackInfo
;
116 static bool Initialize(HAB vHab
);
117 static void CleanUp(void);
119 static bool RegisterWindowClasses(HAB vHab
);
120 virtual bool DoMessage(void);
121 virtual bool ProcessMessage(WXMSG
* pMsg
);
122 void DeletePendingObjects(void);
123 bool ProcessIdle(void);
132 DECLARE_EVENT_TABLE()
135 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );