1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk1/app.h
3 // Purpose:
4 // Author:      Robert Roebling
5 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
6 // Licence:     wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8 
9 #ifndef __GTKAPPH__
10 #define __GTKAPPH__
11 
12 #include "wx/frame.h"
13 #include "wx/icon.h"
14 #include "wx/strconv.h"
15 
16 typedef struct _GdkVisual GdkVisual;
17 
18 //-----------------------------------------------------------------------------
19 // classes
20 //-----------------------------------------------------------------------------
21 
22 class WXDLLIMPEXP_FWD_CORE wxApp;
23 class WXDLLIMPEXP_FWD_BASE wxLog;
24 
25 //-----------------------------------------------------------------------------
26 // wxApp
27 //-----------------------------------------------------------------------------
28 
29 class WXDLLIMPEXP_CORE wxApp: public wxAppBase
30 {
31 public:
32     wxApp();
33     virtual ~wxApp();
34 
35     /* override for altering the way wxGTK initializes the GUI
36      * (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
37      * default. when overriding this method, the code in it is likely to be
38      * platform dependent, otherwise use OnInit(). */
39     virtual bool OnInitGui();
40 
41     // override base class (pure) virtuals
42     virtual void WakeUpIdle();
43 
44     virtual bool Initialize(int& argc, wxChar **argv);
45     virtual void CleanUp();
46 
47     static bool InitialzeVisual();
48 
49     virtual void OnAssertFailure(const wxChar *file,
50                                  int line,
51                                  const wxChar *func,
52                                  const wxChar *cond,
53                                  const wxChar *msg);
54 
IsInAssert()55     bool IsInAssert() const { return m_isInAssert; }
56 
57     int             m_idleTag;
58     void RemoveIdleTag();
59 
60     unsigned char  *m_colorCube;
61 
62     // Used by the wxGLApp and wxGLCanvas class for GL-based X visual
63     // selection.
64     void           *m_glVisualInfo; // this is actually an XVisualInfo*
65     void           *m_glFBCInfo; // this is actually an GLXFBConfig*
66     // This returns the current visual: either that used by wxRootWindow
67     // or the XVisualInfo* for SGI.
68     GdkVisual      *GetGdkVisual();
69 
70 private:
71     // true if we're inside an assert modal dialog
72     bool m_isInAssert;
73 
74     DECLARE_DYNAMIC_CLASS(wxApp)
75 };
76 
77 #endif // __GTKAPPH__
78