Remove commented out code.
[geeqie.git] / src / ui_misc.h
1 /*
2  * (SLIK) SimpLIstic sKin functions
3  * (C) 2004 John Ellis
4  * Copyright (C) 2008 - 2012 The Geeqie Team
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, gboolean fill,
57                         GtkOrientation orientation, gboolean padding);
58
59 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill,
60                           const gchar *text, GtkOrientation orientation);
61 GtkWidget *pref_group_parent(GtkWidget *child);
62
63 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill,
64                           const gchar *text,
65                           GtkOrientation orientation, gboolean padding);
66
67 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding);
68 GtkWidget *pref_line(GtkWidget *parent_box, gboolean 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, gboolean bold, gboolean increase_size);
73
74 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id,
75                            const gchar *text, gboolean hide_stock_text,
76                            GCallback func, gpointer data);
77
78 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
79                              GCallback func, gpointer data);
80 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active,
81                                       GCallback func, gpointer data);
82
83 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active,
84                                  gboolean *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, gboolean active,
91                                 GCallback func, gpointer data);
92 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
93                                          const gchar *text, gboolean active,
94                                          GCallback func, gpointer data);
95
96 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
97                                     const gchar *text, gboolean active,
98                                     gboolean *result, gboolean 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                           gboolean homegeneous, gboolean 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, gboolean 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 GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
140                                    const gchar *text, const gchar *suffix,
141                                    gint min, gint max, gint step,
142                                    gint value, gint *value_var);
143
144
145 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style);
146 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
147                                const gchar *stock_id, const gchar *label, gboolean toggle,
148                                const gchar *description,
149                                GCallback func, gpointer data);
150 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
151 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
152
153
154 GtkWidget *date_selection_new(void);
155
156 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
157 void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year);
158
159 void date_selection_time_set(GtkWidget *widget, time_t t);
160 time_t date_selection_time_get(GtkWidget *widget);
161
162
163 typedef enum {
164         SIZER_POS_LEFT   = 1 << 0,
165         SIZER_POS_RIGHT  = 1 << 1,
166         SIZER_POS_TOP    = 1 << 2,
167         SIZER_POS_BOTTOM = 1 << 3
168 } SizerPositionType;
169
170 GtkWidget *sizer_new(GtkWidget *parent, GtkWidget *bounding_widget,
171                      SizerPositionType position);
172
173 void sizer_set_limits(GtkWidget *sizer,
174                       gint hsize_min, gint hsize_max,
175                       gint vsize_min, gint vsize_max);
176
177
178 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
179 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
180
181 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
182 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
183
184 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
185 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
186
187
188 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
189 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
190                                  const gchar *title, const GdkColor *color,
191                                  GCallback func, gpointer data);
192
193 gchar *text_widget_text_pull(GtkWidget *text_widget);
194
195 #endif
196 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */