]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/app.h
HTML_xxxx constants changed to wxHTML_xxxx (with backward compatibility through WXWIN...
[wxWidgets.git] / include / wx / motif / app.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: app.h
3// Purpose: wxApp class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
14
15#ifdef __GNUG__
ee31c392 16 #pragma interface "app.h"
9b6dbb09
JS
17#endif
18
ee31c392
VZ
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
9b6dbb09
JS
23#include "wx/gdicmn.h"
24#include "wx/event.h"
25
ee31c392
VZ
26// ----------------------------------------------------------------------------
27// forward declarations
28// ----------------------------------------------------------------------------
29
9b6dbb09
JS
30class WXDLLEXPORT wxFrame;
31class WXDLLEXPORT wxWindow;
32class WXDLLEXPORT wxApp ;
33class WXDLLEXPORT wxKeyEvent;
34class WXDLLEXPORT wxLog;
35
ee31c392
VZ
36// ----------------------------------------------------------------------------
37// the wxApp class for Motif - see wxAppBase for more details
38// ----------------------------------------------------------------------------
9b6dbb09 39
ee31c392 40class WXDLLEXPORT wxApp : public wxAppBase
9b6dbb09 41{
ee31c392 42DECLARE_DYNAMIC_CLASS(wxApp)
9b6dbb09 43
ee31c392
VZ
44public:
45 wxApp();
46 ~wxApp() {}
9b6dbb09 47
ee31c392
VZ
48 // override base class (pure) virtuals
49 // -----------------------------------
9b6dbb09 50
ee31c392
VZ
51 virtual int MainLoop();
52 virtual void ExitMainLoop();
53 virtual bool Initialized();
54 virtual bool Pending() ;
55 virtual void Dispatch() ;
9b6dbb09 56
ee31c392 57 virtual bool OnInitGui();
9b6dbb09 58
ee31c392 59 virtual wxIcon GetStdIcon(int which) const;
9b6dbb09 60
ee31c392
VZ
61 // implementation from now on
62 // --------------------------
9b6dbb09 63
ee31c392 64 void OnIdle(wxIdleEvent& event);
9b6dbb09 65
ee31c392
VZ
66 // Send idle event to all top-level windows.
67 // Returns TRUE if more idle time is requested.
68 bool SendIdleEvents();
9b6dbb09 69
ee31c392
VZ
70 // Send idle event to window and all subwindows
71 // Returns TRUE if more idle time is requested.
72 bool SendIdleEvents(wxWindow* win);
9b6dbb09 73
ee31c392 74 // Motif implementation.
8aa04e8b 75
ee31c392
VZ
76 // Processes an X event.
77 virtual void ProcessXEvent(WXEvent* event);
8aa04e8b 78
ee31c392
VZ
79 // Returns TRUE if an accelerator has been processed
80 virtual bool CheckForAccelerator(WXEvent* event);
8aa04e8b 81
ee31c392
VZ
82 // Returns TRUE if a key down event has been processed
83 virtual bool CheckForKeyDown(WXEvent* event);
9b6dbb09 84
e2e04ea4
MB
85 // Returns TRUE if a key up event has been processed
86 virtual bool CheckForKeyUp(WXEvent* event);
87
9b6dbb09 88protected:
ee31c392 89 bool m_showOnInit;
9b6dbb09
JS
90
91public:
ee31c392
VZ
92 // Implementation
93 static bool Initialize();
94 static void CleanUp();
9b6dbb09 95
ee31c392
VZ
96 void DeletePendingObjects();
97 bool ProcessIdle();
7214297d 98#if wxUSE_THREADS
ee31c392 99 void ProcessPendingEvents();
7214297d 100#endif
9b6dbb09 101
ee31c392
VZ
102 // Motif-specific
103 WXAppContext GetAppContext() const { return m_appContext; }
104 WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
105 WXColormap GetMainColormap(WXDisplay* display) ;
106 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
107 long GetMaxRequestSize() const { return m_maxRequestSize; }
9b6dbb09 108
ee31c392
VZ
109 // This handler is called when a property change event occurs
110 virtual void HandlePropertyChange(WXEvent *event);
9b6dbb09
JS
111
112public:
ee31c392
VZ
113 static long sm_lastMessageTime;
114 int m_nCmdShow;
9b6dbb09
JS
115
116protected:
ee31c392 117 bool m_keepGoing ;
9b6dbb09 118
ee31c392
VZ
119 // Motif-specific
120 WXAppContext m_appContext;
121 WXWidget m_topLevelWidget;
122 WXColormap m_mainColormap;
123 WXDisplay* m_initialDisplay;
124 long m_maxRequestSize;
9b6dbb09 125
ee31c392 126 DECLARE_EVENT_TABLE()
9b6dbb09
JS
127};
128
129int WXDLLEXPORT wxEntry( int argc, char *argv[] );
130
131#endif
132 // _WX_APP_H_
133