1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
#ifndef tdegtk_animations_h
#define tdegtk_animations_h
/*
* this file was largely taken from the oxygen gtk engine
* Copyright (c) 2010 Hugo Pereira Da Costa <hugo@oxygen-icons.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or(at your option ) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
// #include "tdegtk-arrowstateengine.h"
// #include "tdegtk-backgroundhintengine.h"
#include "tdegtk-baseengine.h"
// #include "tdegtk-comboboxengine.h"
// #include "tdegtk-comboboxentryengine.h"
// #include "tdegtk-dialogengine.h"
// #include "tdegtk-groupboxengine.h"
// #include "tdegtk-groupboxlabelengine.h"
#include "tdegtk-hooks.h"
// #include "tdegtk-hoverengine.h"
// #include "tdegtk-mainwindowengine.h"
// #include "tdegtk-menubarstateengine.h"
// #include "tdegtk-menuitemengine.h"
// #include "tdegtk-menustateengine.h"
// #include "tdegtk-panedengine.h"
// #include "tdegtk-scrollbarengine.h"
// #include "tdegtk-scrollbarstateengine.h"
// #include "tdegtk-scrolledwindowengine.h"
// #include "tdegtk-innershadowengine.h"
#include "tdegtk-signals.h"
#include "tdegtk-tabwidgetengine.h"
// #include "tdegtk-tabwidgetstateengine.h"
// #include "tdegtk-toolbarstateengine.h"
// #include "tdegtk-treeviewengine.h"
// #include "tdegtk-treeviewstateengine.h"
// #include "tdegtk-widgetsizeengine.h"
// #include "tdegtk-widgetstateengine.h"
#include <gtk/gtk.h>
#include <vector>
#include <map>
//! keeps track of all animation engines
class Animations
{
public:
//! constructor
Animations( void );
//! destructor
virtual ~Animations( void );
//! initialize settings
// void initialize( const QtSettings& );
//! initialize hooks
void initializeHooks( void );
//! unregister widget
bool registerWidget( GtkWidget* );
//! unregister widget
void unregisterWidget( GtkWidget* );
//! enabled state
void setEnabled( bool value );
#if 0
//! inner shadow enabled state
void setInnerShadowsEnabled( bool value )
{ _innerShadowsEnabled = value; }
//! inner shadow enabled state
bool innerShadowsEnabled( void ) const
{ return _innerShadowsEnabled; }
//! combobox engine
ComboBoxEngine& comboBoxEngine( void ) const
{ return *_comboBoxEngine; }
//! comboboxentry engine
ComboBoxEntryEngine& comboBoxEntryEngine( void ) const
{ return *_comboBoxEntryEngine; }
//! dialog engine
DialogEngine& dialogEngine( void ) const
{ return *_dialogEngine; }
//! groupbox engine
GroupBoxEngine& groupBoxEngine( void ) const
{ return *_groupBoxEngine; }
//! background hint
BackgroundHintEngine& backgroundHintEngine( void ) const
{ return *_backgroundHintEngine; }
//! main window engine
MainWindowEngine& mainWindowEngine( void ) const
{ return *_mainWindowEngine; }
//! menu item engine
MenuItemEngine& menuItemEngine( void ) const
{ return *_menuItemEngine; }
//! hover engine
HoverEngine& hoverEngine( void ) const
{ return *_hoverEngine; }
//! paned (splitter) engine
PanedEngine& panedEngine( void ) const
{ return *_panedEngine; }
//! scrollbar engine
ScrollBarEngine& scrollBarEngine( void ) const
{ return *_scrollBarEngine; }
//! scrolled window engine
ScrolledWindowEngine& scrolledWindowEngine( void ) const
{ return *_scrolledWindowEngine; }
//! inner shadow engine
InnerShadowEngine& innerShadowEngine( void ) const
{ return *_innerShadowEngine; }
#endif
//! tab widget engine
TabWidgetEngine& tabWidgetEngine( void ) const
{ return *_tabWidgetEngine; }
#if 0
//! tree view engine
TreeViewEngine& treeViewEngine( void ) const
{ return *_treeViewEngine; }
//! window size engine
WidgetSizeEngine& widgetSizeEngine( void ) const
{ return *_widgetSizeEngine; }
//!@name animations specific engines
//@{
//! widget mouse-over and focus animations engine
WidgetStateEngine& widgetStateEngine( void ) const
{ return *_widgetStateEngine; }
//! arrow mouse-over animations engine
ArrowStateEngine& arrowStateEngine( void ) const
{ return *_arrowStateEngine; }
//! scrollbar arrow mouse-over animations engine
ScrollBarStateEngine& scrollBarStateEngine( void ) const
{ return *_scrollBarStateEngine; }
//! notebook tabs mouse-over animations engine
TabWidgetStateEngine& tabWidgetStateEngine( void ) const
{ return *_tabWidgetStateEngine; }
//! tree view mouse-over animation engine
TreeViewStateEngine& treeViewStateEngine( void ) const
{ return *_treeViewStateEngine; }
//! menubar mouse-over animation engine
MenuBarStateEngine& menuBarStateEngine( void ) const
{ return *_menuBarStateEngine; }
//! menu mouse-over animation engine
MenuStateEngine& menuStateEngine( void ) const
{ return *_menuStateEngine; }
//! toolbar mouse-over animation engine
ToolBarStateEngine& toolBarStateEngine( void ) const
{ return *_toolBarStateEngine; }
#endif
//@}
protected:
//! register new engine
void registerEngine( BaseEngine* engine )
{ _engines.push_back( engine ); }
#if 0
//! groupbox engine
GroupBoxLabelEngine& groupBoxLabelEngine( void ) const
{ return *_groupBoxLabelEngine; }
#endif
//! destruction callback
static gboolean destroyNotifyEvent( GtkWidget*, gpointer );
//! combobox list size adjustment hook
static gboolean sizeAllocationHook( GSignalInvocationHint*, guint, const GValue*, gpointer );
#if 0
//! background hint setting hook
static gboolean backgroundHintHook( GSignalInvocationHint*, guint, const GValue*, gpointer );
//! inner shadow composited mode enabling hook
static gboolean innerShadowHook( GSignalInvocationHint*, guint, const GValue*, gpointer );
#endif
//! widget realize hook
static gboolean realizationHook( GSignalInvocationHint*, guint, const GValue*, gpointer );
private:
//! inner shadow enabled state
bool _innerShadowsEnabled;
//! list of engines
BaseEngine::List _engines;
#if 0
//! background hint engine
BackgroundHintEngine* _backgroundHintEngine;
//! combobox engine
ComboBoxEngine* _comboBoxEngine;
//! combobox entry engine
ComboBoxEntryEngine* _comboBoxEntryEngine;
//! dialog engine
DialogEngine* _dialogEngine;
//! groupbox engine
GroupBoxEngine* _groupBoxEngine;
//! groupbox engine
GroupBoxLabelEngine* _groupBoxLabelEngine;
//! hover engine
HoverEngine* _hoverEngine;
//! main window engine
MainWindowEngine* _mainWindowEngine;
//! menu item engine
MenuItemEngine* _menuItemEngine;
//! paned engine
PanedEngine* _panedEngine;
//! scrollbar engine
ScrollBarEngine* _scrollBarEngine;
//! scrolled window engine
ScrolledWindowEngine* _scrolledWindowEngine;
//! inner shadow engine
InnerShadowEngine* _innerShadowEngine;
#endif
//! tab widget engine
TabWidgetEngine* _tabWidgetEngine;
#if 0
//! tree view engine
TreeViewEngine* _treeViewEngine;
//! widget size engine
WidgetSizeEngine* _widgetSizeEngine;
//!@name Animation specific engines
//@{
//! widget mouse-over and focus animations engine
WidgetStateEngine* _widgetStateEngine;
//! arrow mouse-over animations engine
ArrowStateEngine* _arrowStateEngine;
//! scrollbar arrow mouse-over animations engine
ScrollBarStateEngine* _scrollBarStateEngine;
//! notebook tabs mouse-over animations engine
TabWidgetStateEngine* _tabWidgetStateEngine;
//! tree view mouse-over animation engine
TreeViewStateEngine* _treeViewStateEngine;
//! menubar mouse-over animation engine
MenuBarStateEngine* _menuBarStateEngine;
//! menu mouse-over animation engine
MenuStateEngine* _menuStateEngine;
//! toolbar mouse-over animation engine
ToolBarStateEngine* _toolBarStateEngine;
#endif
//@}
//!@name hooks
//@{
//! true when hooks are initialized
bool _hooksInitialized;
//! realization hook
Hook _realizationHook;
//! size allocation hook
Hook _sizeAllocationHook;
//! background hint hook
Hook _backgroundHintHook;
//! inner shadows hook
Hook _innerShadowHook;
//@}
//! keep track of all registered widgets, and associated destroy callback
typedef std::map< GtkWidget*, Signal > WidgetMap;
WidgetMap _allWidgets;
};
#endif
|