]> git.saurik.com Git - wxWidgets.git/blob - include/wx/app.h
Change SetStringSelection to return bool like in other classes and ports
[wxWidgets.git] / include / wx / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/app.h
3 // Purpose: wxAppBase class and macros used for declaration of wxApp
4 // derived class in the user code
5 // Author: Julian Smart
6 // Modified by:
7 // Created: 01/02/97
8 // RCS-ID: $Id$
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_APP_H_BASE_
14 #define _WX_APP_H_BASE_
15
16 // ----------------------------------------------------------------------------
17 // headers we have to include here
18 // ----------------------------------------------------------------------------
19
20 #include "wx/event.h" // for the base class
21
22 #if wxUSE_GUI
23 #include "wx/window.h" // for wxTopLevelWindows
24
25 #include "wx/vidmode.h"
26 #endif // wxUSE_GUI
27
28 #include "wx/build.h"
29 #include "wx/init.h" // we must declare wxEntry()
30
31 class WXDLLIMPEXP_BASE wxAppConsole;
32 class WXDLLIMPEXP_BASE wxAppTraits;
33 class WXDLLIMPEXP_BASE wxCmdLineParser;
34 class WXDLLIMPEXP_BASE wxLog;
35 class WXDLLIMPEXP_BASE wxMessageOutput;
36
37 // wxUSE_EVTLOOP_IN_APP is a temporary hack needed until all ports are updated
38 // to use wxEventLoop, otherwise we get linking errors on wxMac, it's going to
39 // disappear a.s.a.p.
40 #ifdef __WXMAC__
41 #define wxUSE_EVTLOOP_IN_APP 0
42 #else
43 #define wxUSE_EVTLOOP_IN_APP 1
44 class WXDLLEXPORT wxEventLoop;
45 #endif
46
47 // ----------------------------------------------------------------------------
48 // typedefs
49 // ----------------------------------------------------------------------------
50
51 // the type of the function used to create a wxApp object on program start up
52 typedef wxAppConsole* (*wxAppInitializerFunction)();
53
54 // ----------------------------------------------------------------------------
55 // constants
56 // ----------------------------------------------------------------------------
57
58 enum
59 {
60 wxPRINT_WINDOWS = 1,
61 wxPRINT_POSTSCRIPT = 2
62 };
63
64 // ----------------------------------------------------------------------------
65 // wxAppConsole: wxApp for non-GUI applications
66 // ----------------------------------------------------------------------------
67
68 class WXDLLIMPEXP_BASE wxAppConsole : public wxEvtHandler
69 {
70 public:
71 // ctor and dtor
72 wxAppConsole();
73 virtual ~wxAppConsole();
74
75
76 // the virtual functions which may/must be overridden in the derived class
77 // -----------------------------------------------------------------------
78
79 // This is the very first function called for a newly created wxApp object,
80 // it is used by the library to do the global initialization. If, for some
81 // reason, you must override it (instead of just overriding OnInit(), as
82 // usual, for app-specific initializations), do not forget to call the base
83 // class version!
84 virtual bool Initialize(int& argc, wxChar **argv);
85
86 // This gives wxCocoa a chance to call OnInit() with a memory pool in place
87 virtual bool CallOnInit() { return OnInit(); }
88
89 // Called before OnRun(), this is a good place to do initialization -- if
90 // anything fails, return false from here to prevent the program from
91 // continuing. The command line is normally parsed here, call the base
92 // class OnInit() to do it.
93 virtual bool OnInit();
94
95 // this is here only temproary hopefully (FIXME)
96 virtual bool OnInitGui() { return true; }
97
98 // This is the replacement for the normal main(): all program work should
99 // be done here. When OnRun() returns, the programs starts shutting down.
100 virtual int OnRun() = 0;
101
102 // This is only called if OnInit() returned true so it's a good place to do
103 // any cleanup matching the initializations done there.
104 virtual int OnExit();
105
106 // This is the very last function called on wxApp object before it is
107 // destroyed. If you override it (instead of overriding OnExit() as usual)
108 // do not forget to call the base class version!
109 virtual void CleanUp();
110
111 // Called when a fatal exception occurs, this function should take care not
112 // to do anything which might provoke a nested exception! It may be
113 // overridden if you wish to react somehow in non-default way (core dump
114 // under Unix, application crash under Windows) to fatal program errors,
115 // however extreme care should be taken if you don't want this function to
116 // crash.
117 virtual void OnFatalException() { }
118
119 #if wxUSE_EXCEPTIONS
120 // function called if an uncaught exception is caught inside the main
121 // event loop: it may return true to continue running the event loop or
122 // false to stop it (in the latter case it may rethrow the exception as
123 // well)
124 virtual bool OnExceptionInMainLoop() {
125 throw;
126 #if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200)
127 return false;
128 #endif
129 }
130
131 // Called when an unhandled C++ exception occurs inside OnRun(): note that
132 // the exception type is lost by now, so if you really want to handle the
133 // exception you should override OnRun() and put a try/catch around
134 // MainLoop() call there
135 virtual void OnUnhandledException() { }
136 #endif // wxUSE_EXCEPTIONS
137
138 // Called from wxExit() function, should terminate the application a.s.a.p.
139 virtual void Exit();
140
141
142 // application info: name, description, vendor
143 // -------------------------------------------
144
145 // NB: all these should be set by the application itself, there are no
146 // reasonable default except for the application name which is taken to
147 // be argv[0]
148
149 // set/get the application name
150 wxString GetAppName() const
151 {
152 return m_appName.empty() ? m_className : m_appName;
153 }
154 void SetAppName(const wxString& name) { m_appName = name; }
155
156 // set/get the app class name
157 wxString GetClassName() const { return m_className; }
158 void SetClassName(const wxString& name) { m_className = name; }
159
160 // set/get the vendor name
161 const wxString& GetVendorName() const { return m_vendorName; }
162 void SetVendorName(const wxString& name) { m_vendorName = name; }
163
164
165 // cmd line parsing stuff
166 // ----------------------
167
168 // all of these methods may be overridden in the derived class to
169 // customize the command line parsing (by default only a few standard
170 // options are handled)
171 //
172 // you also need to call wxApp::OnInit() from YourApp::OnInit() for all
173 // this to work
174
175 #if wxUSE_CMDLINE_PARSER
176 // this one is called from OnInit() to add all supported options
177 // to the given parser (don't forget to call the base class version if you
178 // override it!)
179 virtual void OnInitCmdLine(wxCmdLineParser& parser);
180
181 // called after successfully parsing the command line, return TRUE
182 // to continue and FALSE to exit (don't forget to call the base class
183 // version if you override it!)
184 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
185
186 // called if "--help" option was specified, return TRUE to continue
187 // and FALSE to exit
188 virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
189
190 // called if incorrect command line options were given, return
191 // FALSE to abort and TRUE to continue
192 virtual bool OnCmdLineError(wxCmdLineParser& parser);
193 #endif // wxUSE_CMDLINE_PARSER
194
195
196 // miscellaneous customization functions
197 // -------------------------------------
198
199 // create the app traits object to which we delegate for everything which
200 // either should be configurable by the user (then he can change the
201 // default behaviour simply by overriding CreateTraits() and returning his
202 // own traits object) or which is GUI/console dependent as then wxAppTraits
203 // allows us to abstract the differences behind the common façade
204 wxAppTraits *GetTraits();
205
206 // the functions below shouldn't be used now that we have wxAppTraits
207 #if WXWIN_COMPATIBILITY_2_4
208
209 #if wxUSE_LOG
210 // override this function to create default log target of arbitrary
211 // user-defined class (default implementation creates a wxLogGui
212 // object) -- this log object is used by default by all wxLogXXX()
213 // functions.
214 virtual wxLog *CreateLogTarget();
215 #endif // wxUSE_LOG
216
217 // similar to CreateLogTarget() but for the global wxMessageOutput
218 // object
219 virtual wxMessageOutput *CreateMessageOutput();
220
221 #endif // WXWIN_COMPATIBILITY_2_4
222
223
224 // event processing functions
225 // --------------------------
226
227 // this method allows to filter all the events processed by the program, so
228 // you should try to return quickly from it to avoid slowing down the
229 // program to the crawl
230 //
231 // return value should be -1 to continue with the normal event processing,
232 // or TRUE or FALSE to stop further processing and pretend that the event
233 // had been already processed or won't be processed at all, respectively
234 virtual int FilterEvent(wxEvent& event);
235
236 #if wxUSE_EXCEPTIONS
237 // call the specified handler on the given object with the given event
238 //
239 // this method only exists to allow catching the exceptions thrown by any
240 // event handler, it would lead to an extra (useless) virtual function call
241 // if the exceptions were not used, so it doesn't even exist in that case
242 virtual void HandleEvent(wxEvtHandler *handler,
243 wxEventFunction func,
244 wxEvent& event) const;
245 #endif // wxUSE_EXCEPTIONS
246
247 // process all events in the wxPendingEvents list -- it is necessary to
248 // call this function to process posted events. This happens during each
249 // event loop iteration in GUI mode but if there is no main loop, it may be
250 // also called directly.
251 virtual void ProcessPendingEvents();
252
253 // doesn't do anything in this class, just a hook for GUI wxApp
254 virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
255
256 // make sure that idle events are sent again
257 virtual void WakeUpIdle() { }
258
259
260 // debugging support
261 // -----------------
262
263 // this function is called when an assert failure occurs, the base class
264 // version does the normal processing (i.e. shows the usual assert failure
265 // dialog box)
266 //
267 // the arguments are the place where the assert occured, the text of the
268 // assert itself and the user-specified message
269 #ifdef __WXDEBUG__
270 virtual void OnAssert(const wxChar *file,
271 int line,
272 const wxChar *cond,
273 const wxChar *msg);
274 #endif // __WXDEBUG__
275
276 // check that the wxBuildOptions object (constructed in the application
277 // itself, usually the one from IMPLEMENT_APP() macro) matches the build
278 // options of the library and abort if it doesn't
279 static bool CheckBuildOptions(const char *optionsSignature,
280 const char *componentName);
281 #if WXWIN_COMPATIBILITY_2_4
282 static bool CheckBuildOptions(const wxBuildOptions& buildOptions)
283 {
284 return CheckBuildOptions(buildOptions.m_signature, "your program");
285 }
286 #endif
287
288 // implementation only from now on
289 // -------------------------------
290
291 // helpers for dynamic wxApp construction
292 static void SetInitializerFunction(wxAppInitializerFunction fn)
293 { ms_appInitFn = fn; }
294 static wxAppInitializerFunction GetInitializerFunction()
295 { return ms_appInitFn; }
296
297 // accessors for ms_appInstance field (external code might wish to modify
298 // it, this is why we provide a setter here as well, but you should really
299 // know what you're doing if you call it), wxTheApp is usually used instead
300 // of GetInstance()
301 static wxAppConsole *GetInstance() { return ms_appInstance; }
302 static void SetInstance(wxAppConsole *app) { ms_appInstance = app; }
303
304
305 // command line arguments (public for backwards compatibility)
306 int argc;
307 wxChar **argv;
308
309 protected:
310 // the function which creates the traits object when GetTraits() needs it
311 // for the first time
312 virtual wxAppTraits *CreateTraits();
313
314
315 // function used for dynamic wxApp creation
316 static wxAppInitializerFunction ms_appInitFn;
317
318 // the one and only global application object
319 static wxAppConsole *ms_appInstance;
320
321
322 // application info (must be set from the user code)
323 wxString m_vendorName, // vendor name (ACME Inc)
324 m_appName, // app name
325 m_className; // class name
326
327 // the class defining the application behaviour, NULL initially and created
328 // by GetTraits() when first needed
329 wxAppTraits *m_traits;
330
331
332 // the application object is a singleton anyhow, there is no sense in
333 // copying it
334 DECLARE_NO_COPY_CLASS(wxAppConsole)
335 };
336
337 // ----------------------------------------------------------------------------
338 // wxAppBase: the common part of wxApp implementations for all platforms
339 // ----------------------------------------------------------------------------
340
341 #if wxUSE_GUI
342
343 class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole
344 {
345 public:
346 wxAppBase();
347 virtual ~wxAppBase();
348
349 // the virtual functions which may/must be overridden in the derived class
350 // -----------------------------------------------------------------------
351
352 // very first initialization function
353 //
354 // Override: very rarely
355 virtual bool Initialize(int& argc, wxChar **argv);
356
357 // a platform-dependent version of OnInit(): the code here is likely to
358 // depend on the toolkit. default version does nothing.
359 //
360 // Override: rarely.
361 virtual bool OnInitGui();
362
363 // called to start program execution - the default version just enters
364 // the main GUI loop in which events are received and processed until
365 // the last window is not deleted (if GetExitOnFrameDelete) or
366 // ExitMainLoop() is called. In console mode programs, the execution
367 // of the program really starts here
368 //
369 // Override: rarely in GUI applications, always in console ones.
370 virtual int OnRun();
371
372 // a matching function for OnInit()
373 virtual int OnExit();
374
375 // very last clean up function
376 //
377 // Override: very rarely
378 virtual void CleanUp();
379
380
381 // the worker functions - usually not used directly by the user code
382 // -----------------------------------------------------------------
383
384 // execute the main GUI loop, the function returns when the loop ends
385 virtual int MainLoop();
386
387 // exit the main loop thus terminating the application
388 virtual void Exit();
389
390 // exit the main GUI loop during the next iteration (i.e. it does not
391 // stop the program immediately!)
392 virtual void ExitMainLoop();
393
394 // returns TRUE if there are unprocessed events in the event queue
395 virtual bool Pending();
396
397 // process the first event in the event queue (blocks until an event
398 // appears if there are none currently, use Pending() if this is not
399 // wanted), returns false if the event loop should stop and true
400 // otherwise
401 virtual bool Dispatch();
402
403 // process all currently pending events right now
404 //
405 // it is an error to call Yield() recursively unless the value of
406 // onlyIfNeeded is TRUE
407 //
408 // WARNING: this function is dangerous as it can lead to unexpected
409 // reentrancies (i.e. when called from an event handler it
410 // may result in calling the same event handler again), use
411 // with _extreme_ care or, better, don't use at all!
412 virtual bool Yield(bool onlyIfNeeded = FALSE) = 0;
413
414 // this virtual function is called in the GUI mode when the application
415 // becomes idle and normally just sends wxIdleEvent to all interested
416 // parties
417 //
418 // it should return TRUE if more idle events are needed, FALSE if not
419 virtual bool ProcessIdle();
420
421 // Send idle event to window and all subwindows
422 // Returns TRUE if more idle time is requested.
423 virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
424
425 // Perform standard OnIdle behaviour: call from port's OnIdle
426 void OnIdle(wxIdleEvent& event);
427
428
429 // top level window functions
430 // --------------------------
431
432 // return TRUE if our app has focus
433 virtual bool IsActive() const { return m_isActive; }
434
435 // set the "main" top level window
436 void SetTopWindow(wxWindow *win) { m_topWindow = win; }
437
438 // return the "main" top level window (if it hadn't been set previously
439 // with SetTopWindow(), will return just some top level window and, if
440 // there are none, will return NULL)
441 virtual wxWindow *GetTopWindow() const
442 {
443 if (m_topWindow)
444 return m_topWindow;
445 else if (wxTopLevelWindows.GetCount() > 0)
446 return wxTopLevelWindows.GetFirst()->GetData();
447 else
448 return (wxWindow *)NULL;
449 }
450
451 // control the exit behaviour: by default, the program will exit the
452 // main loop (and so, usually, terminate) when the last top-level
453 // program window is deleted. Beware that if you disable this behaviour
454 // (with SetExitOnFrameDelete(FALSE)), you'll have to call
455 // ExitMainLoop() explicitly from somewhere.
456 void SetExitOnFrameDelete(bool flag)
457 { m_exitOnFrameDelete = flag ? Yes : No; }
458 bool GetExitOnFrameDelete() const
459 { return m_exitOnFrameDelete == Yes; }
460
461
462 // display mode, visual, printing mode, ...
463 // ------------------------------------------------------------------------
464
465 // Get display mode that is used use. This is only used in framebuffer
466 // wxWin ports (such as wxMGL).
467 virtual wxVideoMode GetDisplayMode() const { return wxVideoMode(); }
468 // Set display mode to use. This is only used in framebuffer wxWin
469 // ports (such as wxMGL). This method should be called from
470 // wxApp::OnInitGui
471 virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return TRUE; }
472
473 // set use of best visual flag (see below)
474 void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; }
475 bool GetUseBestVisual() const { return m_useBestVisual; }
476
477 // set/get printing mode: see wxPRINT_XXX constants.
478 //
479 // default behaviour is the normal one for Unix: always use PostScript
480 // printing.
481 virtual void SetPrintMode(int WXUNUSED(mode)) { }
482 int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
483
484
485 // command line parsing (GUI-specific)
486 // ------------------------------------------------------------------------
487
488 #if wxUSE_CMDLINE_PARSER
489 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
490 virtual void OnInitCmdLine(wxCmdLineParser& parser);
491 #endif
492
493 // miscellaneous other stuff
494 // ------------------------------------------------------------------------
495
496 // called by toolkit-specific code to set the app status: active (we have
497 // focus) or not and also the last window which had focus before we were
498 // deactivated
499 virtual void SetActive(bool isActive, wxWindow *lastFocus);
500
501 // OBSOLETE: don't use, always returns true
502 //
503 // returns true if the program is successfully initialized
504 bool Initialized() { return true; }
505
506
507 protected:
508 // delete all objects in wxPendingDelete list
509 void DeletePendingObjects();
510
511 // override base class method to use GUI traits
512 virtual wxAppTraits *CreateTraits();
513
514
515 #if wxUSE_EVTLOOP_IN_APP
516 // the main event loop of the application (may be NULL if the loop hasn't
517 // been started yet or has already terminated)
518 wxEventLoop *m_mainLoop;
519 #endif // wxUSE_EVTLOOP_IN_APP
520
521 // the main top level window (may be NULL)
522 wxWindow *m_topWindow;
523
524 // if Yes, exit the main loop when the last top level window is deleted, if
525 // No don't do it and if Later -- only do it once we reach our OnRun()
526 //
527 // the explanation for using this strange scheme is given in appcmn.cpp
528 enum
529 {
530 Later = -1,
531 No,
532 Yes
533 } m_exitOnFrameDelete;
534
535 // TRUE if the apps whats to use the best visual on systems where
536 // more than one are available (Sun, SGI, XFree86 4.0 ?)
537 bool m_useBestVisual;
538
539 // does any of our windows has focus?
540 bool m_isActive;
541
542
543 DECLARE_NO_COPY_CLASS(wxAppBase)
544 };
545
546 #endif // wxUSE_GUI
547
548 // ----------------------------------------------------------------------------
549 // now include the declaration of the real class
550 // ----------------------------------------------------------------------------
551
552 #if wxUSE_GUI
553 #if defined(__WXMSW__)
554 #include "wx/msw/app.h"
555 #elif defined(__WXMOTIF__)
556 #include "wx/motif/app.h"
557 #elif defined(__WXMGL__)
558 #include "wx/mgl/app.h"
559 #elif defined(__WXGTK__)
560 #include "wx/gtk/app.h"
561 #elif defined(__WXX11__)
562 #include "wx/x11/app.h"
563 #elif defined(__WXMAC__)
564 #include "wx/mac/app.h"
565 #elif defined(__WXCOCOA__)
566 #include "wx/cocoa/app.h"
567 #elif defined(__WXPM__)
568 #include "wx/os2/app.h"
569 #endif
570 #else // !GUI
571 // allow using just wxApp (instead of wxAppConsole) in console programs
572 typedef wxAppConsole wxApp;
573 #endif // GUI/!GUI
574
575 // ----------------------------------------------------------------------------
576 // the global data
577 // ----------------------------------------------------------------------------
578
579 // for compatibility, we define this macro to access the global application
580 // object of type wxApp
581 //
582 // note that instead of using of wxTheApp in application code you should
583 // consider using DECLARE_APP() after which you may call wxGetApp() which will
584 // return the object of the correct type (i.e. MyApp and not wxApp)
585 //
586 // the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in
587 // console mode it does nothing at all
588 #define wxTheApp ((wxApp *)wxApp::GetInstance())
589
590 // ----------------------------------------------------------------------------
591 // global functions
592 // ----------------------------------------------------------------------------
593
594 // event loop related functions only work in GUI programs
595 // ------------------------------------------------------
596
597 // Force an exit from main loop
598 extern void WXDLLIMPEXP_BASE wxExit();
599
600 // Yield to other apps/messages
601 extern bool WXDLLIMPEXP_BASE wxYield();
602
603 // Yield to other apps/messages
604 extern void WXDLLIMPEXP_BASE wxWakeUpIdle();
605
606 // ----------------------------------------------------------------------------
607 // macros for dynamic creation of the application object
608 // ----------------------------------------------------------------------------
609
610 // Having a global instance of this class allows wxApp to be aware of the app
611 // creator function. wxApp can then call this function to create a new app
612 // object. Convoluted, but necessary.
613
614 class WXDLLIMPEXP_BASE wxAppInitializer
615 {
616 public:
617 wxAppInitializer(wxAppInitializerFunction fn)
618 { wxApp::SetInitializerFunction(fn); }
619 };
620
621 // Here's a macro you can use if your compiler really, really wants main() to
622 // be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
623 // code if required.
624
625 #define IMPLEMENT_WXWIN_MAIN_CONSOLE \
626 int main(int argc, char **argv) { return wxEntry(argc, argv); }
627
628 #if !wxUSE_GUI || !defined(__WXMSW__)
629 #define IMPLEMENT_WXWIN_MAIN \
630 IMPLEMENT_WXWIN_MAIN_CONSOLE
631 #elif defined(__WXMSW__)
632 // we need HINSTANCE declaration to define WinMain()
633 #include "wx/msw/wrapwin.h"
634
635 #ifndef SW_SHOWNORMAL
636 #define SW_SHOWNORMAL 1
637 #endif
638
639 // WinMain() is always ANSI, even in Unicode build, under normal Windows
640 // but is always Unicode under CE
641 #ifdef __WXWINCE__
642 typedef wchar_t *wxCmdLineArgType;
643 #else
644 typedef char *wxCmdLineArgType;
645 #endif
646
647 #define IMPLEMENT_WXWIN_MAIN \
648 extern int wxEntry(HINSTANCE hInstance, \
649 HINSTANCE hPrevInstance = NULL, \
650 wxCmdLineArgType pCmdLine = NULL, \
651 int nCmdShow = SW_SHOWNORMAL); \
652 extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
653 HINSTANCE hPrevInstance, \
654 wxCmdLineArgType lpCmdLine, \
655 int nCmdShow) \
656 { \
657 return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \
658 }
659 #else
660 #define IMPLEMENT_WXWIN_MAIN
661 #endif
662
663 #ifdef __WXUNIVERSAL__
664 #include "wx/univ/theme.h"
665
666 #define IMPLEMENT_WX_THEME_SUPPORT \
667 WX_USE_THEME(win32); \
668 WX_USE_THEME(gtk);
669 #else
670 #define IMPLEMENT_WX_THEME_SUPPORT
671 #endif
672
673 // Use this macro if you want to define your own main() or WinMain() function
674 // and call wxEntry() from there.
675 #define IMPLEMENT_APP_NO_MAIN(appname) \
676 wxAppConsole *wxCreateApp() \
677 { \
678 wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
679 "your program"); \
680 return new appname; \
681 } \
682 wxAppInitializer \
683 wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
684 appname& wxGetApp() { return *(appname *)wxTheApp; }
685
686 // Same as IMPLEMENT_APP() normally but doesn't include themes support in
687 // wxUniversal builds
688 #define IMPLEMENT_APP_NO_THEMES(appname) \
689 IMPLEMENT_APP_NO_MAIN(appname) \
690 IMPLEMENT_WXWIN_MAIN
691
692 // Use this macro exactly once, the argument is the name of the wxApp-derived
693 // class which is the class of your application.
694 #define IMPLEMENT_APP(appname) \
695 IMPLEMENT_APP_NO_THEMES(appname) \
696 IMPLEMENT_WX_THEME_SUPPORT
697
698 // Same as IMPLEMENT_APP(), but for console applications.
699 #define IMPLEMENT_APP_CONSOLE(appname) \
700 IMPLEMENT_APP_NO_MAIN(appname) \
701 IMPLEMENT_WXWIN_MAIN_CONSOLE
702
703 // this macro can be used multiple times and just allows you to use wxGetApp()
704 // function
705 #define DECLARE_APP(appname) extern appname& wxGetApp();
706
707 #endif // _WX_APP_H_BASE_
708