Mercurial > geeqie
annotate src/ui_misc.h @ 927:d27b4184ceb8
Minor tidy up and optimization.
author | zas_ |
---|---|
date | Fri, 25 Jul 2008 06:35:35 +0000 |
parents | 48c8e49b571c |
children | 1646720364cf |
rev | line source |
---|---|
9 | 1 /* |
2 * (SLIK) SimpLIstic sKin functions | |
3 * (C) 2004 John Ellis | |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef UI_MISC_H | |
15 #define UI_MISC_H | |
16 | |
17 | |
18 #include <sys/time.h> | |
19 #include <sys/types.h> | |
20 #include <time.h> | |
21 | |
22 | |
23 /* these values are per GNOME HIG */ | |
24 | |
25 /* HIG 2.0 chapter 8 defines: */ | |
26 | |
27 /* space between elements within control (ex: icon and it's text) */ | |
28 #define PREF_PAD_GAP 6 | |
29 /* space between label and control(s) */ | |
30 #define PREF_PAD_SPACE 12 | |
31 /* space between window border and controls */ | |
32 #define PREF_PAD_BORDER 12 | |
33 /* indent for group members */ | |
34 #define PREF_PAD_INDENT 12 | |
35 /* vertical space between groups */ | |
36 #define PREF_PAD_GROUP 18 | |
37 | |
38 /* HIG 2.0 chapter 3.13 defines: */ | |
39 | |
40 /* gap between buttons in a dialog */ | |
41 #define PREF_PAD_BUTTON_GAP 6 | |
42 /* space between buttons in a dialog and it's contents */ | |
43 #define PREF_PAD_BUTTON_SPACE 24 | |
44 | |
45 /* and these are not in the GNOME HIG */ | |
46 | |
47 /* gap between similar toolbar items (buttons) */ | |
48 #define PREF_PAD_TOOLBAR_GAP 0 | |
49 | |
50 /* HIG 2.0 states 6 pixels between icons and text, | |
51 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency | |
52 */ | |
53 #define PREF_PAD_BUTTON_ICON_GAP 2 | |
54 | |
55 | |
56 GtkWidget *pref_box_new(GtkWidget *parent_box, gint fill, | |
57 GtkOrientation orientation, gint padding); | |
58 | |
59 GtkWidget *pref_group_new(GtkWidget *parent_box, gint fill, | |
60 const gchar *text, GtkOrientation orientation); | |
61 GtkWidget *pref_group_parent(GtkWidget *child); | |
62 | |
63 GtkWidget *pref_frame_new(GtkWidget *parent_box, gint fill, | |
64 const gchar *text, | |
65 GtkOrientation orientation, gint padding); | |
66 | |
67 GtkWidget *pref_spacer(GtkWidget *parent_box, gint padding); | |
68 GtkWidget *pref_line(GtkWidget *parent_box, gint padding); | |
69 | |
70 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text); | |
71 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget); | |
72 void pref_label_bold(GtkWidget *label, gint bold, gint increase_size); | |
73 | |
74 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id, | |
75 const gchar *text, gint hide_stock_text, | |
76 GCallback func, gpointer data); | |
77 | |
78 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gint active, | |
79 GCallback func, gpointer data); | |
80 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gint active, | |
81 GCallback func, gpointer data); | |
82 | |
83 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gint active, | |
84 gint *result); | |
85 | |
86 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget); | |
87 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget); | |
88 | |
89 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling, | |
90 const gchar *text, gint active, | |
91 GCallback func, gpointer data); | |
92 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling, | |
93 const gchar *text, gint active, | |
94 GCallback func, gpointer data); | |
95 | |
96 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling, | |
97 const gchar *text, gint active, | |
98 gint *result, gint value, | |
99 GCallback func, gpointer data); | |
100 | |
101 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix, | |
102 gdouble min, gdouble max, gdouble step, gint digits, | |
103 gdouble value, | |
104 GCallback func, gpointer data); | |
105 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix, | |
106 gdouble min, gdouble max, gdouble step, gint digits, | |
107 gdouble value, | |
108 GCallback func, gpointer data); | |
109 | |
110 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix, | |
111 gint min, gint max, gint step, | |
112 gint value, gint *value_var); | |
113 | |
114 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch); | |
115 | |
116 void pref_signal_block_data(GtkWidget *widget, gpointer data); | |
117 void pref_signal_unblock_data(GtkWidget *widget, gpointer data); | |
118 | |
119 | |
120 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows, | |
121 gint homogenious, gint fill); | |
122 | |
123 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row, | |
124 GtkOrientation orientation, const gchar *text); | |
125 | |
126 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row, | |
127 const gchar *text, gfloat alignment); | |
128 | |
129 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row, | |
130 const gchar *stock_id, const gchar *text, gint hide_stock_text, | |
131 GCallback func, gpointer data); | |
132 | |
133 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row, | |
134 const gchar *text, const gchar *suffix, | |
135 gdouble min, gdouble max, gdouble step, gint digits, | |
136 gdouble value, | |
137 GCallback func, gpointer data); | |
138 | |
139 | |
140 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style); | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
141 GtkWidget *pref_toolbar_button(GtkWidget *toolbar, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
142 const gchar *stock_id, const gchar *label, gint toggle, |
9 | 143 const gchar *description, |
144 GCallback func, gpointer data); | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
145 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id); |
9 | 146 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar); |
147 | |
148 | |
149 GtkWidget *date_selection_new(void); | |
150 | |
151 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year); | |
152 void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year); | |
153 | |
154 void date_selection_time_set(GtkWidget *widget, time_t t); | |
155 time_t date_selection_time_get(GtkWidget *widget); | |
156 | |
157 | |
158 typedef enum { | |
159 SIZER_POS_LEFT = 1 << 0, | |
160 SIZER_POS_RIGHT = 1 << 1, | |
161 SIZER_POS_TOP = 1 << 2, | |
162 SIZER_POS_BOTTOM = 1 << 3 | |
163 } SizerPositionType; | |
164 | |
165 GtkWidget *sizer_new(GtkWidget *parent, GtkWidget *bounding_widget, | |
166 SizerPositionType position); | |
167 | |
168 void sizer_set_limits(GtkWidget *sizer, | |
442 | 169 gint hsize_min, gint hsize_max, |
170 gint vsize_min, gint vsize_max); | |
9 | 171 |
172 | |
173 void pref_list_int_set(const gchar *group, const gchar *key, gint value); | |
174 gint pref_list_int_get(const gchar *group, const gchar *key, gint *result); | |
175 | |
176 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value); | |
177 gint pref_list_double_get(const gchar *group, const gchar *key, gdouble *result); | |
178 | |
179 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value); | |
180 gint pref_list_string_get(const gchar *group, const gchar *key, const gchar **result); | |
181 | |
182 | |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
208
diff
changeset
|
183 void pref_color_button_set_cb(GtkWidget *widget, gpointer data); |
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
208
diff
changeset
|
184 GtkWidget *pref_color_button_new(GtkWidget *parent_box, |
442 | 185 const gchar *title, const GdkColor *color, |
186 GCallback func, gpointer data); | |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
41
diff
changeset
|
187 |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
41
diff
changeset
|
188 |
9 | 189 #endif |