]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/app.h
*** empty log message ***
[wxWidgets.git] / include / wx / msw / app.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: app.h
3// Purpose: wxApp class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc
JS
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
2bda0e17
KB
14
15#ifdef __GNUG__
16#pragma interface "app.h"
17#endif
18
19#include "wx/defs.h"
20#include "wx/object.h"
a3ef5bf5 21#include "wx/event.h"
ebea0891 22#include "wx/icon.h"
2bda0e17
KB
23
24class WXDLLEXPORT wxFrame;
25class WXDLLEXPORT wxWindow;
26class WXDLLEXPORT wxApp ;
27class WXDLLEXPORT wxKeyEvent;
28class WXDLLEXPORT wxLog;
29
2bda0e17
KB
30WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
31
2bda0e17 32// Force an exit from main loop
bb6290e3 33void WXDLLEXPORT wxExit();
2bda0e17
KB
34
35// Yield to other apps/messages
bb6290e3 36bool WXDLLEXPORT wxYield();
2bda0e17
KB
37
38// Represents the application. Derive OnInit and declare
39// a new App object to start application
094637f6 40class WXDLLEXPORT wxApp : public wxAppBase
2bda0e17 41{
094637f6 42 DECLARE_DYNAMIC_CLASS(wxApp)
c085e333 43
094637f6
VZ
44public:
45 wxApp();
46 virtual ~wxApp();
580c10e3 47
094637f6
VZ
48 // override base class (pure) virtuals
49 virtual int MainLoop();
50 virtual void ExitMainLoop();
51 virtual bool Initialized();
52 virtual bool Pending() ;
53 virtual void Dispatch() ;
2bda0e17 54
094637f6 55 virtual wxIcon GetStdIcon(int which) const;
2bda0e17 56
094637f6
VZ
57 virtual void SetPrintMode(int mode) { m_printMode = mode; }
58 virtual int GetPrintMode() const { return m_printMode; }
2bda0e17 59
094637f6
VZ
60 // implementation only
61 void OnIdle(wxIdleEvent& event);
62 void OnEndSession(wxCloseEvent& event);
63 void OnQueryEndSession(wxCloseEvent& event);
2bda0e17 64
094637f6
VZ
65 // Send idle event to all top-level windows.
66 // Returns TRUE if more idle time is requested.
67 bool SendIdleEvents();
2bda0e17 68
094637f6
VZ
69 // Send idle event to window and all subwindows
70 // Returns TRUE if more idle time is requested.
71 bool SendIdleEvents(wxWindow* win);
4e066dd2 72
094637f6
VZ
73 void SetAuto3D(bool flag) { m_auto3D = flag; }
74 bool GetAuto3D() const { return m_auto3D; }
2bda0e17
KB
75
76protected:
094637f6
VZ
77 bool m_showOnInit;
78 int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
79 bool m_auto3D ; // Always use 3D controls, except where overriden
80
81 /* Windows-specific wxApp definitions */
2bda0e17
KB
82
83public:
84
094637f6
VZ
85 // Implementation
86 static bool Initialize();
87 static void CleanUp();
88
89 static bool RegisterWindowClasses();
90 // Convert Windows to argc, argv style
91 void ConvertToStandardCommandArgs(char* p);
92 virtual bool DoMessage();
93 virtual bool ProcessMessage(WXMSG* pMsg);
94 void DeletePendingObjects();
95 bool ProcessIdle();
7214297d 96#if wxUSE_THREADS
094637f6 97 void ProcessPendingEvents();
7214297d 98#endif
094637f6 99 int GetComCtl32Version() const;
2bda0e17
KB
100
101public:
094637f6 102 int m_nCmdShow;
2bda0e17
KB
103
104protected:
094637f6 105 bool m_keepGoing ;
2bda0e17 106
094637f6 107 DECLARE_EVENT_TABLE()
2bda0e17
KB
108};
109
110#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
111int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine,
112 int nCmdShow, bool enterLoop = TRUE);
113#else
114int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
115#endif
116
117#endif
bbcdf8bc 118 // _WX_APP_H_
2bda0e17 119