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
|
/*
* This file is a part of hildon
*
* Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
*
* Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
*
* 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; version 2.1 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
*
*/
/**
* SECTION:hildon-defines
* @Title: Defines
* @Short_Description: Definitions for icon sizes, margins, and hard keys definitions.
*
* The macros of this section should be used for a consistent sizing
* of icons and spacing of between user interface elements.
*
* The icon sizes here presented must be registered during the
* application initialization by calling hildon_init(). It is
* recommended to use these sizes for a consistent look of
* applications in the Hildon platform.
*
* The margin definitions are used internally in the widgets to define the spacing
* and padding between widgets; as well as the margins for dialogs and other windows.
* Using them to create a new interface layout will guarantee it to be consistent
* with the widgets and other applications.
*
* The hardkey macros are mapping between the Hildon supported keys and the GDK
* key definitions.
*/
#ifndef __HILDON_DEFINES_H__
#define __HILDON_DEFINES_H__
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
G_BEGIN_DECLS
/* New hildon icon sizes. */
/**
* HILDON_ICON_SIZE_XSMALL:
*
* #GtkIconSize for extra small icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_XSMALL gtk_icon_size_from_name ("hildon-xsmall")
/**
* HILDON_ICON_SIZE_SMALL:
*
* #GtkIconSize for small icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_SMALL gtk_icon_size_from_name ("hildon-small")
/**
* HILDON_ICON_SIZE_STYLUS:
*
* #GtkIconSize for stylus-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_STYLUS gtk_icon_size_from_name ("hildon-stylus")
/**
* HILDON_ICON_SIZE_FINGER:
*
* #GtkIconSize for finger-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_FINGER gtk_icon_size_from_name ("hildon-finger")
/**
* HILDON_ICON_SIZE_THUMB:
*
* #GtkIconSize for thumb-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_THUMB gtk_icon_size_from_name ("hildon-thumb")
/**
* HILDON_ICON_SIZE_LARGE:
*
* #GtkIconSize for large icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_LARGE gtk_icon_size_from_name ("hildon-large")
/**
* HILDON_ICON_SIZE_XLARGE:
*
* #GtkIconSize for extra large icons.
*
* Since: 2.2
*/
#define HILDON_ICON_SIZE_XLARGE gtk_icon_size_from_name ("hildon-xlarge")
/* Actual icon sizes */
/* New sizes */
/**
* HILDON_ICON_PIXEL_SIZE_XSMALL:
*
* Pixel size for extra small icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_XSMALL hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XSMALL)
/**
* HILDON_ICON_PIXEL_SIZE_SMALL:
*
* Pixel size for small icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_SMALL hildon_get_icon_pixel_size (HILDON_ICON_SIZE_SMALL)
/**
* HILDON_ICON_PIXEL_SIZE_STYLUS:
*
* Pixel size for stylus-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_STYLUS hildon_get_icon_pixel_size (HILDON_ICON_SIZE_STYLUS)
/**
* HILDON_ICON_PIXEL_SIZE_FINGER:
*
* Pixel size for finger-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_FINGER hildon_get_icon_pixel_size (HILDON_ICON_SIZE_FINGER)
/**
* HILDON_ICON_PIXEL_SIZE_THUMB:
*
* Pixel size for thumb-size icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_THUMB hildon_get_icon_pixel_size (HILDON_ICON_SIZE_THUMB)
/**
* HILDON_ICON_PIXEL_SIZE_LARGE:
*
* Pixel size for large icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_LARGE hildon_get_icon_pixel_size (HILDON_ICON_SIZE_LARGE)
/**
* HILDON_ICON_PIXEL_SIZE_XLARGE:
*
* Pixel size for extra large icons.
*
* Since: 2.2
*/
#define HILDON_ICON_PIXEL_SIZE_XLARGE hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XLARGE)
/* Margins */
/**
* HILDON_MARGIN_HALF:
*
* Half of the default pixel-size margin to be used for padding between widgets.
*
* Since: 2.2
*/
#define HILDON_MARGIN_HALF 4
/**
* HILDON_MARGIN_DEFAULT:
*
* Default pixel-size margin to be used for padding between widgets.
*
* Since: 2.2
*/
#define HILDON_MARGIN_DEFAULT 8
/**
* HILDON_MARGIN_DOUBLE:
*
* Double pixel-size margin to be used for padding between widgets.
*
* Since: 2.2
*/
#define HILDON_MARGIN_DOUBLE 16
/**
* HILDON_MARGIN_TRIPLE:
*
* Triple pixel-size margin to be used for padding between widgets.
*
* Since: 2.2
*/
#define HILDON_MARGIN_TRIPLE 24
/**
* HILDON_WINDOW_TITLEBAR_HEIGHT:
*
* Height of the window titlebar according to Hildon Desktop.
*
* Since: 2.2
*/
#define HILDON_WINDOW_TITLEBAR_HEIGHT 56
/* Hard keys */
/**
* HILDON_HARDKEY_UP:
*
* Key definition for the Up hardkey.
*/
#define HILDON_HARDKEY_UP GDK_KEY_Up
/**
* HILDON_HARDKEY_LEFT:
*
* Key definition for the Left hardkey.
*/
#define HILDON_HARDKEY_LEFT GDK_KEY_Left
/**
* HILDON_HARDKEY_RIGHT:
*
* Key definition for the Right hardkey.
*/
#define HILDON_HARDKEY_RIGHT GDK_KEY_Right
/**
* HILDON_HARDKEY_DOWN:
*
* Key definition for the Down hardkey.
*/
#define HILDON_HARDKEY_DOWN GDK_KEY_Down
/**
* HILDON_HARDKEY_SELECT:
*
* Key definition for the Select hardkey.
*/
#define HILDON_HARDKEY_SELECT GDK_KEY_Return
/**
* HILDON_HARDKEY_Menu:
*
* Key definition for the Menu hardkey.
*/
#define HILDON_HARDKEY_MENU GDK_KEY_F4
/**
* HILDON_HARDKEY_HOME:
*
* Key definition for the Home hardkey.
*/
#define HILDON_HARDKEY_HOME GDK_KEY_F5
/**
* HILDON_HARDKEY_ESC:
*
* Key definition for the Esc hardkey.
*/
#define HILDON_HARDKEY_ESC GDK_KEY_Escape
/**
* HILDON_HARDKEY_FULLSCREEN:
*
* Key definition for the Fullscreen hardkey.
*/
#define HILDON_HARDKEY_FULLSCREEN GDK_KEY_F6
/**
* HILDON_HARDKEY_INCREASE:
*
* Key definition for the Increase hardkey.
*/
#define HILDON_HARDKEY_INCREASE GDK_KEY_F7
/**
* HILDON_HARDKEY_DECREASE:
*
* Key definition for the Decrease hardkey.
*/
#define HILDON_HARDKEY_DECREASE GDK_KEY_F8
gint
hildon_get_icon_pixel_size (GtkIconSize size);
G_END_DECLS
#endif /* HILDON_DEFINES_H */
|