1
/*
2
 * This file is a part of hildon
3
 *
4
 * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
5
 *
6
 * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public License
10
 * as published by the Free Software Foundation; version 2.1 of
11
 * the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful, but
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
 * 02110-1301 USA
22
 *
23
 */
24
25
/**
26
 * SECTION:hildon-defines
27
 * @Title: Defines
28
 * @Short_Description: Definitions for icon sizes, margins, and hard keys definitions.
29
 *
30
 * The macros of this section should be used for a consistent sizing
31
 * of icons and spacing of between user interface elements.
32
 *
33
 * The icon sizes here presented must be registered during the
34
 * application initialization by calling hildon_init(). It is
35
 * recommended to use these sizes for a consistent look of
36
 * applications in the Hildon platform.
37
 *
38
 * The margin definitions are used internally in the widgets to define the spacing
39
 * and padding between widgets; as well as the margins for dialogs and other windows.
40
 * Using them to create a new interface layout will guarantee it to be consistent
41
 * with the widgets and other applications.
42
 *
43
 * The hardkey macros are mapping between the Hildon supported keys and the GDK
44
 * key definitions.
45
 */
46
47
#ifndef                                         __HILDON_DEFINES_H__
48
#define                                         __HILDON_DEFINES_H__
49
50
#include                                        <gtk/gtk.h>
51
#include                                        <gdk/gdkkeysyms.h>
52
53
G_BEGIN_DECLS
54
55
/* New hildon icon sizes. */
56
57
58
59
/**
60
 * HILDON_ICON_SIZE_XSMALL:
61
 *
62
 * #GtkIconSize for extra small icons.
63
 *
64
 * Since: 2.2
65
 */
66
#define HILDON_ICON_SIZE_XSMALL                  gtk_icon_size_from_name ("hildon-xsmall")
67
68
/**
69
 * HILDON_ICON_SIZE_SMALL:
70
 *
71
 * #GtkIconSize for small icons.
72
 *
73
 * Since: 2.2
74
 */
75
#define HILDON_ICON_SIZE_SMALL                   gtk_icon_size_from_name ("hildon-small")
76
77
/**
78
 * HILDON_ICON_SIZE_STYLUS:
79
 *
80
 * #GtkIconSize for stylus-size icons.
81
 *
82
 * Since: 2.2
83
 */
84
#define HILDON_ICON_SIZE_STYLUS                  gtk_icon_size_from_name ("hildon-stylus")
85
86
/**
87
 * HILDON_ICON_SIZE_FINGER:
88
 *
89
 * #GtkIconSize for finger-size icons.
90
 *
91
 * Since: 2.2
92
 */
93
#define HILDON_ICON_SIZE_FINGER                  gtk_icon_size_from_name ("hildon-finger")
94
95
/**
96
 * HILDON_ICON_SIZE_THUMB:
97
 *
98
 * #GtkIconSize for thumb-size icons.
99
 *
100
 * Since: 2.2
101
 */
102
#define HILDON_ICON_SIZE_THUMB                   gtk_icon_size_from_name ("hildon-thumb")
103
104
/**
105
 * HILDON_ICON_SIZE_LARGE:
106
 *
107
 * #GtkIconSize for large icons.
108
 *
109
 * Since: 2.2
110
 */
111
#define HILDON_ICON_SIZE_LARGE                   gtk_icon_size_from_name ("hildon-large")
112
113
/**
114
 * HILDON_ICON_SIZE_XLARGE:
115
 *
116
 * #GtkIconSize for extra large icons.
117
 *
118
 * Since: 2.2
119
 */
120
#define HILDON_ICON_SIZE_XLARGE                  gtk_icon_size_from_name ("hildon-xlarge")
121
122
/* legacy hildon icon sizes, updated for new hildon */
123
124
/**
125
 * HILDON_ICON_SIZE_TOOLBAR:
126
 *
127
 * #GtkIconSize for toolbar icons.
128
 *
129
 * Deprecated: Use %HILDON_ICON_SIZE_FINGER instead.
130
 */
131
#ifndef HILDON_DISABLE_DEPRECATED
132
#define HILDON_ICON_SIZE_TOOLBAR                 gtk_icon_size_from_name ("hildon-finger")
133
#endif
134
/* Actual icon sizes */
135
136
/* New sizes */
137
/**
138
 * HILDON_ICON_PIXEL_SIZE_XSMALL:
139
 *
140
 * Pixel size for extra small icons.
141
 *
142
 * Since: 2.2
143
 */
144
#define HILDON_ICON_PIXEL_SIZE_XSMALL            hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XSMALL)
145
146
/**
147
 * HILDON_ICON_PIXEL_SIZE_SMALL:
148
 *
149
 * Pixel size for small icons.
150
 *
151
 * Since: 2.2
152
 */
153
#define HILDON_ICON_PIXEL_SIZE_SMALL             hildon_get_icon_pixel_size (HILDON_ICON_SIZE_SMALL)
154
155
/**
156
 * HILDON_ICON_PIXEL_SIZE_STYLUS:
157
 *
158
 * Pixel size for stylus-size icons.
159
 *
160
 * Since: 2.2
161
 */
162
#define HILDON_ICON_PIXEL_SIZE_STYLUS            hildon_get_icon_pixel_size (HILDON_ICON_SIZE_STYLUS)
163
164
/**
165
 * HILDON_ICON_PIXEL_SIZE_FINGER:
166
 *
167
 * Pixel size for finger-size icons.
168
 *
169
 * Since: 2.2
170
 */
171
#define HILDON_ICON_PIXEL_SIZE_FINGER            hildon_get_icon_pixel_size (HILDON_ICON_SIZE_FINGER)
172
173
/**
174
 * HILDON_ICON_PIXEL_SIZE_THUMB:
175
 *
176
 * Pixel size for thumb-size icons.
177
 *
178
 * Since: 2.2
179
 */
180
#define HILDON_ICON_PIXEL_SIZE_THUMB             hildon_get_icon_pixel_size (HILDON_ICON_SIZE_THUMB)
181
182
/**
183
 * HILDON_ICON_PIXEL_SIZE_LARGE:
184
 *
185
 * Pixel size for large icons.
186
 *
187
 * Since: 2.2
188
 */
189
#define HILDON_ICON_PIXEL_SIZE_LARGE             hildon_get_icon_pixel_size (HILDON_ICON_SIZE_LARGE)
190
191
/**
192
 * HILDON_ICON_PIXEL_SIZE_XLARGE:
193
 *
194
 * Pixel size for extra large icons.
195
 *
196
 * Since: 2.2
197
 */
198
#define HILDON_ICON_PIXEL_SIZE_XLARGE            hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XLARGE)
199
200
/* legacy sizes */
201
/**
202
 * HILDON_ICON_PIXEL_SIZE_TOOLBAR:
203
 *
204
 * Pixel size for toolbar icons.
205
 *
206
 * Deprecated: Use %HILDON_ICON_PIXEL_SIZE_FINGER instead.
207
 */
208
#ifndef HILDON_DISABLE_DEPRECATED
209
#define HILDON_ICON_PIXEL_SIZE_TOOLBAR           hildon_get_icon_pixel_size (HILDON_ICON_SIZE_TOOLBAR)
210
#endif
211
/* Margins */
212
213
/**
214
 * HILDON_MARGIN_HALF:
215
 *
216
 * Half of the default pixel-size margin to be used for padding between widgets.
217
 *
218
 * Since: 2.2
219
 */
220
#define HILDON_MARGIN_HALF                       4
221
222
/**
223
 * HILDON_MARGIN_DEFAULT:
224
 *
225
 * Default pixel-size margin to be used for padding between widgets.
226
 *
227
 * Since: 2.2
228
 */
229
#define HILDON_MARGIN_DEFAULT                    8
230
231
/**
232
 * HILDON_MARGIN_DOUBLE:
233
 *
234
 * Double pixel-size margin to be used for padding between widgets.
235
 *
236
 * Since: 2.2
237
 */
238
#define HILDON_MARGIN_DOUBLE                     16
239
240
/**
241
 * HILDON_MARGIN_TRIPLE:
242
 *
243
 * Triple pixel-size margin to be used for padding between widgets.
244
 *
245
 * Since: 2.2
246
 */
247
#define HILDON_MARGIN_TRIPLE                     24
248
249
/**
250
 * HILDON_WINDOW_TITLEBAR_HEIGHT:
251
 *
252
 * Height of the window titlebar according to Hildon Desktop.
253
 *
254
 * Since: 2.2
255
 */
256
#define HILDON_WINDOW_TITLEBAR_HEIGHT            56
257
258
/* Hard keys */
259
260
/**
261
 * HILDON_HARDKEY_UP:
262
 *
263
 * Key definition for the Up hardkey.
264
 */
265
#define HILDON_HARDKEY_UP                        GDK_Up
266
267
/**
268
 * HILDON_HARDKEY_LEFT:
269
 *
270
 * Key definition for the Left hardkey.
271
 */
272
#define HILDON_HARDKEY_LEFT                      GDK_Left
273
274
/**
275
 * HILDON_HARDKEY_RIGHT:
276
 *
277
 * Key definition for the Right hardkey.
278
 */
279
#define HILDON_HARDKEY_RIGHT                     GDK_Right
280
281
/**
282
 * HILDON_HARDKEY_DOWN:
283
 *
284
 * Key definition for the Down hardkey.
285
 */
286
#define HILDON_HARDKEY_DOWN                      GDK_Down
287
288
/**
289
 * HILDON_HARDKEY_SELECT:
290
 *
291
 * Key definition for the Select hardkey.
292
 */
293
#define HILDON_HARDKEY_SELECT                    GDK_Return
294
295
/**
296
 * HILDON_HARDKEY_Menu:
297
 *
298
 * Key definition for the Menu hardkey.
299
 */
300
#define HILDON_HARDKEY_MENU                      GDK_F4
301
302
/**
303
 * HILDON_HARDKEY_HOME:
304
 *
305
 * Key definition for the Home hardkey.
306
 */
307
#define HILDON_HARDKEY_HOME                      GDK_F5
308
309
/**
310
 * HILDON_HARDKEY_ESC:
311
 *
312
 * Key definition for the Esc hardkey.
313
 */
314
#define HILDON_HARDKEY_ESC                       GDK_Escape
315
316
/**
317
 * HILDON_HARDKEY_FULLSCREEN:
318
 *
319
 * Key definition for the Fullscreen hardkey.
320
 */
321
#define HILDON_HARDKEY_FULLSCREEN                GDK_F6
322
323
/**
324
 * HILDON_HARDKEY_INCREASE:
325
 *
326
 * Key definition for the Increase hardkey.
327
 */
328
#define HILDON_HARDKEY_INCREASE                  GDK_F7
329
330
/**
331
 * HILDON_HARDKEY_DECREASE:
332
 *
333
 * Key definition for the Decrease hardkey.
334
 */
335
#define HILDON_HARDKEY_DECREASE                  GDK_F8
336
337
gint
338
hildon_get_icon_pixel_size                      (GtkIconSize size);
339
340
G_END_DECLS
341
342
#endif                                          /* HILDON_DEFINES_H */