]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: app.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Id: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart |
a3622daa | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifndef __GTKAPPH__ | |
11 | #define __GTKAPPH__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
bcf1fa6b | 17 | #include "wx/defs.h" |
c801d85f KB |
18 | #include "wx/window.h" |
19 | #include "wx/frame.h" | |
ebea0891 | 20 | #include "wx/icon.h" |
c801d85f KB |
21 | |
22 | //----------------------------------------------------------------------------- | |
23 | // classes | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
26 | class wxApp; | |
27 | class wxLog; | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | extern wxApp *wxTheApp; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // global functions | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | void wxExit(void); | |
40 | bool wxYield(void); | |
41 | ||
42 | //----------------------------------------------------------------------------- | |
43 | // constants | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | #define wxPRINT_WINDOWS 1 | |
47 | #define wxPRINT_POSTSCRIPT 2 | |
48 | ||
49 | //----------------------------------------------------------------------------- | |
50 | // wxApp | |
51 | //----------------------------------------------------------------------------- | |
52 | ||
094637f6 | 53 | class wxApp: public wxAppBase |
c801d85f | 54 | { |
094637f6 | 55 | DECLARE_DYNAMIC_CLASS(wxApp) |
a3622daa | 56 | |
094637f6 | 57 | public: |
bbe0af5b RR |
58 | wxApp(); |
59 | ~wxApp(); | |
a3622daa | 60 | |
094637f6 VZ |
61 | /* override for altering the way wxGTK intializes the GUI |
62 | * (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by | |
63 | * default. when overriding this method, the code in it is likely to be | |
64 | * platform dependent, otherwise use OnInit(). */ | |
bbe0af5b | 65 | virtual bool OnInitGui(); |
094637f6 VZ |
66 | |
67 | // override base class (pure) virtuals | |
bbe0af5b | 68 | virtual int MainLoop(); |
094637f6 VZ |
69 | virtual void ExitMainLoop(); |
70 | virtual bool Initialized(); | |
bbe0af5b RR |
71 | virtual bool Pending(); |
72 | virtual void Dispatch(); | |
53010e52 | 73 | |
ebea0891 | 74 | virtual wxIcon GetStdIcon(int which) const; |
53010e52 | 75 | |
094637f6 | 76 | // implementation only from now on |
a3622daa | 77 | void OnIdle( wxIdleEvent &event ); |
bbe0af5b | 78 | bool SendIdleEvents(); |
53010e52 | 79 | bool SendIdleEvents( wxWindow* win ); |
a3622daa | 80 | |
0d2a2b60 RR |
81 | static bool Initialize(); |
82 | static bool InitialzeVisual(); | |
83 | static void CleanUp(); | |
a3622daa | 84 | |
bbe0af5b | 85 | bool ProcessIdle(); |
7214297d GL |
86 | #if wxUSE_THREADS |
87 | void ProcessPendingEvents(); | |
88 | #endif | |
bbe0af5b | 89 | void DeletePendingObjects(); |
a3622daa | 90 | |
094637f6 VZ |
91 | // This can be used to suppress the generation of Idle events. |
92 | void SuppressIdleEvents(bool arg = TRUE) { m_suppressIdleEvents = arg; } | |
93 | bool GetSuppressIdleEvents() const { return m_suppressIdleEvents; } | |
94 | ||
f6fcbb63 | 95 | bool m_initialized; |
094637f6 | 96 | |
f6fcbb63 | 97 | gint m_idleTag; |
6b3eb77a | 98 | #if wxUSE_THREADS |
7b90a8f2 | 99 | gint m_wakeUpTimerTag; |
6b3eb77a | 100 | #endif |
f6fcbb63 | 101 | unsigned char *m_colorCube; |
a3622daa | 102 | |
094637f6 | 103 | private: |
53a8af59 KB |
104 | /// Set to TRUE while we are in wxYield(). |
105 | bool m_suppressIdleEvents; | |
094637f6 VZ |
106 | |
107 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
108 | }; |
109 | ||
110 | #endif // __GTKAPPH__ |