]>
Commit | Line | Data |
---|---|---|
7d9f12f3 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/gtk/toplevel.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
7d9f12f3 | 5 | // Copyright: (c) 1998 Robert Roebling, Julian Smart |
65571936 | 6 | // Licence: wxWindows licence |
7d9f12f3 VS |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
b5e31cc8 PC |
9 | #ifndef _WX_GTK_TOPLEVEL_H_ |
10 | #define _WX_GTK_TOPLEVEL_H_ | |
7d9f12f3 | 11 | |
7d9f12f3 VS |
12 | //----------------------------------------------------------------------------- |
13 | // wxTopLevelWindowGTK | |
14 | //----------------------------------------------------------------------------- | |
15 | ||
20123d49 | 16 | class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase |
7d9f12f3 | 17 | { |
3c7620f6 | 18 | typedef wxTopLevelWindowBase base_type; |
7d9f12f3 VS |
19 | public: |
20 | // construction | |
21 | wxTopLevelWindowGTK() { Init(); } | |
22 | wxTopLevelWindowGTK(wxWindow *parent, | |
23 | wxWindowID id, | |
24 | const wxString& title, | |
25 | const wxPoint& pos = wxDefaultPosition, | |
26 | const wxSize& size = wxDefaultSize, | |
27 | long style = wxDEFAULT_FRAME_STYLE, | |
28 | const wxString& name = wxFrameNameStr) | |
29 | { | |
30 | Init(); | |
31 | ||
32 | Create(parent, id, title, pos, size, style, name); | |
33 | } | |
34 | ||
35 | bool Create(wxWindow *parent, | |
36 | wxWindowID id, | |
37 | const wxString& title, | |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, | |
40 | long style = wxDEFAULT_FRAME_STYLE, | |
41 | const wxString& name = wxFrameNameStr); | |
42 | ||
43 | virtual ~wxTopLevelWindowGTK(); | |
44 | ||
45 | // implement base class pure virtuals | |
cb8cc250 | 46 | virtual void Maximize(bool maximize = true); |
7d9f12f3 | 47 | virtual bool IsMaximized() const; |
cb8cc250 | 48 | virtual void Iconize(bool iconize = true); |
7d9f12f3 | 49 | virtual bool IsIconized() const; |
f618020a | 50 | virtual void SetIcons(const wxIconBundle& icons); |
7d9f12f3 VS |
51 | virtual void Restore(); |
52 | ||
0d635035 RR |
53 | virtual bool EnableCloseButton(bool enable = true); |
54 | ||
dbc7ceb9 | 55 | virtual void ShowWithoutActivating(); |
7d9f12f3 | 56 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); |
6dd0883d | 57 | virtual bool IsFullScreen() const { return m_fsIsShowing; } |
7d9f12f3 | 58 | |
dca92ddf MR |
59 | virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); |
60 | ||
015dca24 MR |
61 | virtual void SetWindowStyleFlag( long style ); |
62 | ||
cb8cc250 | 63 | virtual bool Show(bool show = true); |
7d9f12f3 | 64 | |
a2ac55f5 RR |
65 | virtual void Raise(); |
66 | ||
6b30a44e | 67 | virtual bool IsActive(); |
35ff90a0 | 68 | |
7d9f12f3 VS |
69 | virtual void SetTitle( const wxString &title ); |
70 | virtual wxString GetTitle() const { return m_title; } | |
71 | ||
a03b38ef RR |
72 | virtual void SetLabel(const wxString& label) { SetTitle( label ); } |
73 | virtual wxString GetLabel() const { return GetTitle(); } | |
74 | ||
75 | ||
07e49707 MR |
76 | virtual bool SetTransparent(wxByte alpha); |
77 | virtual bool CanSetTransparent(); | |
78 | ||
5152b0e5 JS |
79 | // Experimental, to allow help windows to be |
80 | // viewable from within modal dialogs | |
81 | virtual void AddGrab(); | |
82 | virtual void RemoveGrab(); | |
83 | virtual bool IsGrabbed() const { return m_grabbed; } | |
84 | ||
d0285203 RR |
85 | |
86 | virtual void Refresh( bool eraseBackground = true, | |
87 | const wxRect *rect = (const wxRect *) NULL ); | |
88 | ||
7d9f12f3 VS |
89 | // implementation from now on |
90 | // -------------------------- | |
91 | ||
7d9f12f3 | 92 | // GTK callbacks |
7d9f12f3 VS |
93 | virtual void OnInternalIdle(); |
94 | ||
612515af VZ |
95 | virtual void GTKHandleRealized(); |
96 | ||
7d9f12f3 VS |
97 | // do *not* call this to iconize the frame, this is a private function! |
98 | void SetIconizeState(bool iconic); | |
99 | ||
7d9f12f3 | 100 | GtkWidget *m_mainWidget; |
7d9f12f3 VS |
101 | |
102 | bool m_fsIsShowing; /* full screen */ | |
290cd301 | 103 | int m_fsSaveGdkFunc, m_fsSaveGdkDecor; |
7d9f12f3 | 104 | wxRect m_fsSaveFrame; |
6aeb6f2a VZ |
105 | |
106 | // m_windowStyle translated to GDK's terms | |
290cd301 | 107 | int m_gdkFunc, |
6aeb6f2a | 108 | m_gdkDecor; |
7d9f12f3 | 109 | |
0ab0d0e1 PC |
110 | // size of WM decorations |
111 | wxSize m_decorSize; | |
112 | ||
ef1a9be4 MR |
113 | // private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and |
114 | // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle. | |
115 | int m_urgency_hint; | |
f5c0761f PC |
116 | // timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling |
117 | unsigned m_netFrameExtentsTimerId; | |
ef1a9be4 | 118 | |
290cd301 | 119 | // return the size of the window without WM decorations |
6e264997 VZ |
120 | void GTKDoGetSize(int *width, int *height) const; |
121 | ||
81b0235f PC |
122 | void GTKUpdateDecorSize(const wxSize& decorSize); |
123 | ||
7d9f12f3 | 124 | protected: |
b2e10dac PC |
125 | // give hints to the Window Manager for how the size |
126 | // of the TLW can be changed by dragging | |
127 | virtual void DoSetSizeHints( int minW, int minH, | |
128 | int maxW, int maxH, | |
129 | int incW, int incH); | |
949ff63e | 130 | // move the window to the specified location and resize it |
6f02a879 VZ |
131 | virtual void DoMoveWindow(int x, int y, int width, int height); |
132 | ||
a6cdd521 | 133 | // take into account WM decorations here |
7d9f12f3 VS |
134 | virtual void DoSetSize(int x, int y, |
135 | int width, int height, | |
136 | int sizeFlags = wxSIZE_AUTO); | |
a6cdd521 | 137 | |
428f841b | 138 | virtual void DoSetClientSize(int width, int height); |
a6cdd521 VZ |
139 | virtual void DoGetClientSize(int *width, int *height) const; |
140 | ||
a6cdd521 VZ |
141 | // string shown in the title bar |
142 | wxString m_title; | |
cb8cc250 | 143 | |
11d8dfd2 PC |
144 | bool m_deferShow; |
145 | ||
cca410b3 | 146 | private: |
95dc31e0 | 147 | void Init(); |
fce611e4 PC |
148 | wxSize& GetCachedDecorSize(); |
149 | ||
8f71e657 PC |
150 | // size hint increments |
151 | int m_incWidth, m_incHeight; | |
152 | ||
7d9f12f3 VS |
153 | // is the frame currently iconized? |
154 | bool m_isIconized; | |
a6cdd521 VZ |
155 | |
156 | // is the frame currently grabbed explicitly by the application? | |
5152b0e5 | 157 | bool m_grabbed; |
11d8dfd2 PC |
158 | |
159 | bool m_updateDecorSize; | |
6089c4c8 | 160 | bool m_deferShowAllowed; |
7d9f12f3 VS |
161 | }; |
162 | ||
b5e31cc8 | 163 | #endif // _WX_GTK_TOPLEVEL_H_ |