1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #include <sys/types.h>
22 class WXDLLEXPORT wxFrame
;
23 class WXDLLEXPORT wxWindow
;
24 class WXDLLEXPORT wxApp
;
25 class WXDLLEXPORT wxKeyEvent
;
26 class WXDLLEXPORT wxLog
;
28 WXDLLEXPORT_DATA(extern wxApp
*) wxTheApp
;
29 WXDLLEXPORT_DATA(extern HAB
) vHabmain
;
31 // Force an exit from main loop
32 void WXDLLEXPORT
wxExit(void);
34 // Yield to other apps/messages
35 bool WXDLLEXPORT
wxYield(void);
37 extern MRESULT EXPENTRY
wxWndProc( HWND
44 // Represents the application. Derive OnInit and declare
45 // a new App object to start application
46 class WXDLLEXPORT wxApp
: public wxAppBase
48 DECLARE_DYNAMIC_CLASS(wxApp
)
54 virtual bool OnInitGui(void);
56 // override base class (pure) virtuals
57 virtual int MainLoop(void);
58 virtual void ExitMainLoop(void);
59 virtual bool Initialized(void);
60 virtual bool Pending(void) ;
61 virtual void Dispatch(void);
63 virtual wxIcon
GetStdIcon(int which
) const;
65 virtual void SetPrintMode(int mode
) { m_nPrintMode
= mode
; }
66 virtual int GetPrintMode(void) const { return m_nPrintMode
; }
68 // implementation only
69 void OnIdle(wxIdleEvent
& rEvent
);
70 void OnEndSession(wxCloseEvent
& rEvent
);
71 void OnQueryEndSession(wxCloseEvent
& rEvent
);
73 // Send idle event to all top-level windows.
74 // Returns TRUE if more idle time is requested.
75 bool SendIdleEvents(void);
77 // Send idle event to window and all subwindows
78 // Returns TRUE if more idle time is requested.
79 bool SendIdleEvents(wxWindow
* pWin
);
81 void SetAuto3D(bool bFlag
) { m_bAuto3D
= bFlag
; }
82 bool GetAuto3D(void) const { return m_bAuto3D
; }
84 int AddSocketHandler(int handle
, int mask
,
85 void (*callback
)(void*), void * gsock
);
86 void RemoveSocketHandler(int handle
);
91 int m_nPrintMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
92 bool m_bAuto3D
; // Always use 3D controls, except where overriden
95 // PM-specific wxApp definitions */
98 int m_maxSocketHandles
;
100 int m_lastUsedHandle
;
101 fd_set m_readfds
, m_writefds
;
102 void *m_sockCallbackInfo
;
107 static bool Initialize(HAB vHab
);
108 static void CleanUp(void);
110 static bool RegisterWindowClasses(HAB vHab
);
111 virtual bool DoMessage(void);
112 virtual bool ProcessMessage(WXMSG
* pMsg
);
113 void DeletePendingObjects(void);
114 bool ProcessIdle(void);
123 DECLARE_EVENT_TABLE()
126 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );