app.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/app.h
  3. // Purpose: wxApp definition for wxGTK
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling, Julian Smart
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_GTK_APP_H_
  9. #define _WX_GTK_APP_H_
  10. //-----------------------------------------------------------------------------
  11. // classes
  12. //-----------------------------------------------------------------------------
  13. #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  14. typedef struct _HildonProgram HildonProgram;
  15. #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  16. //-----------------------------------------------------------------------------
  17. // wxApp
  18. //-----------------------------------------------------------------------------
  19. class WXDLLIMPEXP_CORE wxApp: public wxAppBase
  20. {
  21. public:
  22. wxApp();
  23. virtual ~wxApp();
  24. /* override for altering the way wxGTK intializes the GUI
  25. * (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
  26. * default. when overriding this method, the code in it is likely to be
  27. * platform dependent, otherwise use OnInit(). */
  28. virtual bool SetNativeTheme(const wxString& theme);
  29. virtual bool OnInitGui();
  30. // override base class (pure) virtuals
  31. virtual void WakeUpIdle();
  32. virtual bool Initialize(int& argc, wxChar **argv);
  33. virtual void CleanUp();
  34. virtual void OnAssertFailure(const wxChar *file,
  35. int line,
  36. const wxChar *func,
  37. const wxChar *cond,
  38. const wxChar *msg);
  39. // GTK-specific methods
  40. // -------------------
  41. // this can be overridden to return a specific visual to be used for GTK+
  42. // instead of the default one (it's used by wxGLApp)
  43. //
  44. // must return XVisualInfo pointer (it is not freed by caller)
  45. virtual void *GetXVisualInfo() { return NULL; }
  46. // Check if we're using a global menu. Currently this is only true when
  47. // running under Ubuntu Unity and global menu is not disabled.
  48. //
  49. // This is mostly used in the implementation in order to work around
  50. // various bugs arising due to this.
  51. static bool GTKIsUsingGlobalMenu();
  52. #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  53. // Maemo-specific method: get the main program object
  54. HildonProgram *GetHildonProgram();
  55. #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  56. // implementation only from now on
  57. // -------------------------------
  58. // check for pending events, without interference from our idle source
  59. bool EventsPending();
  60. bool DoIdle();
  61. private:
  62. // true if we're inside an assert modal dialog
  63. bool m_isInAssert;
  64. #if wxUSE_THREADS
  65. wxMutex m_idleMutex;
  66. #endif
  67. unsigned m_idleSourceId;
  68. #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  69. HildonProgram *m_hildonProgram;
  70. #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2
  71. DECLARE_DYNAMIC_CLASS(wxApp)
  72. };
  73. #endif // _WX_GTK_APP_H_