1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "app.h"
20 #include "wx/object.h"
24 class WXDLLEXPORT wxFrame
;
25 class WXDLLEXPORT wxWindow
;
26 class WXDLLEXPORT wxApp
;
27 class WXDLLEXPORT wxKeyEvent
;
28 class WXDLLEXPORT wxLog
;
30 WXDLLEXPORT_DATA(extern wxApp
*) wxTheApp
;
32 // Force an exit from main loop
33 void WXDLLEXPORT
wxExit();
35 // Yield to other apps/messages
36 bool WXDLLEXPORT
wxYield();
38 // Represents the application. Derive OnInit and declare
39 // a new App object to start application
40 class WXDLLEXPORT wxApp
: public wxAppBase
42 DECLARE_DYNAMIC_CLASS(wxApp
)
48 // override base class (pure) virtuals
49 virtual int MainLoop();
50 virtual void ExitMainLoop();
51 virtual bool Initialized();
52 virtual bool Pending() ;
53 virtual void Dispatch() ;
55 virtual wxIcon
GetStdIcon(int which
) const;
57 virtual void SetPrintMode(int mode
) { m_printMode
= mode
; }
58 virtual int GetPrintMode() const { return m_printMode
; }
60 // implementation only
61 void OnIdle(wxIdleEvent
& event
);
62 void OnEndSession(wxCloseEvent
& event
);
63 void OnQueryEndSession(wxCloseEvent
& event
);
65 // Send idle event to all top-level windows.
66 // Returns TRUE if more idle time is requested.
67 bool SendIdleEvents();
69 // Send idle event to window and all subwindows
70 // Returns TRUE if more idle time is requested.
71 bool SendIdleEvents(wxWindow
* win
);
73 void SetAuto3D(bool flag
) { m_auto3D
= flag
; }
74 bool GetAuto3D() const { return m_auto3D
; }
78 int m_printMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
79 bool m_auto3D
; // Always use 3D controls, except where overriden
81 /* Windows-specific wxApp definitions */
86 static bool Initialize();
87 static void CleanUp();
89 static bool RegisterWindowClasses();
90 // Convert Windows to argc, argv style
91 void ConvertToStandardCommandArgs(char* p
);
92 virtual bool DoMessage();
93 virtual bool ProcessMessage(WXMSG
* pMsg
);
94 void DeletePendingObjects();
97 void ProcessPendingEvents();
99 int GetComCtl32Version() const;
107 DECLARE_EVENT_TABLE()
110 #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
111 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
, WXHINSTANCE hPrevInstance
, char *lpszCmdLine
,
112 int nCmdShow
, bool enterLoop
= TRUE
);
114 int WXDLLEXPORT
wxEntry(WXHINSTANCE hInstance
);