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