2 * Copyright (C) 2004 John Ellis
3 * Copyright (C) 2008 - 2016 The Geeqie Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <sys/types.h>
31 /* these values are per GNOME HIG */
33 /* HIG 2.0 chapter 8 defines: */
37 * space between elements within control (ex: icon and it's text)
39 #define PREF_PAD_GAP 6
43 * space between label and control(s)
45 #define PREF_PAD_SPACE 12
48 * @def PREF_PAD_BORDER
49 * space between window border and controls
51 #define PREF_PAD_BORDER 12
54 * @def PREF_PAD_INDENT
55 * indent for group members
57 #define PREF_PAD_INDENT 12
61 * vertical space between groups
63 #define PREF_PAD_GROUP 18
65 /* HIG 2.0 chapter 3.13 defines: */
68 * @def PREF_PAD_BUTTON_GAP
69 * gap between buttons in a dialog
71 #define PREF_PAD_BUTTON_GAP 6
74 * @def PREF_PAD_BUTTON_SPACE
75 * space between buttons in a dialog and it's contents
77 #define PREF_PAD_BUTTON_SPACE 24
79 /* and these are not in the GNOME HIG */
82 * @def PREF_PAD_TOOLBAR_GAP
83 * gap between similar toolbar items (buttons)
85 #define PREF_PAD_TOOLBAR_GAP 0
88 * @def PREF_PAD_BUTTON_ICON_GAP
89 * HIG 2.0 states 6 pixels between icons and text,
90 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency
92 #define PREF_PAD_BUTTON_ICON_GAP 2
95 GtkWidget *pref_box_new(GtkWidget *parent_box, gboolean fill,
96 GtkOrientation orientation, gboolean padding);
98 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill,
99 const gchar *text, GtkOrientation orientation);
100 GtkWidget *pref_group_parent(GtkWidget *child);
102 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill,
104 GtkOrientation orientation, gboolean padding);
106 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding);
107 GtkWidget *pref_line(GtkWidget *parent_box, gboolean padding);
109 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
110 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
111 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size);
113 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id,
114 const gchar *text, gboolean hide_stock_text,
115 GCallback func, gpointer data);
117 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
118 GCallback func, gpointer data);
119 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active,
120 GCallback func, gpointer data);
122 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active,
125 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget);
126 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget);
128 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling,
129 const gchar *text, gboolean active,
130 GCallback func, gpointer data);
131 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
132 const gchar *text, gboolean active,
133 GCallback func, gpointer data);
135 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
136 const gchar *text, gboolean active,
137 gboolean *result, gboolean value,
138 GCallback func, gpointer data);
140 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
141 gdouble min, gdouble max, gdouble step, gint digits,
143 GCallback func, gpointer data);
144 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
145 gdouble min, gdouble max, gdouble step, gint digits,
147 GCallback func, gpointer data);
149 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
150 gint min, gint max, gint step,
151 gint value, gint *value_var);
153 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch);
155 void pref_signal_block_data(GtkWidget *widget, gpointer data);
156 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
159 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows,
160 gboolean homegeneous, gboolean fill);
162 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
163 GtkOrientation orientation, const gchar *text);
165 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
166 const gchar *text, gfloat alignment);
168 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
169 const gchar *stock_id, const gchar *text, gboolean hide_stock_text,
170 GCallback func, gpointer data);
172 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
173 const gchar *text, const gchar *suffix,
174 gdouble min, gdouble max, gdouble step, gint digits,
176 GCallback func, gpointer data);
178 GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
179 const gchar *text, const gchar *suffix,
180 gint min, gint max, gint step,
181 gint value, gint *value_var);
184 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style);
185 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
186 const gchar *stock_id, const gchar *label, gboolean toggle,
187 const gchar *description,
188 GCallback func, gpointer data);
189 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
190 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
193 GtkWidget *date_selection_new(void);
195 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
196 void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year);
198 void date_selection_time_set(GtkWidget *widget, time_t t);
199 time_t date_selection_time_get(GtkWidget *widget);
203 SIZER_POS_LEFT = 1 << 0,
204 SIZER_POS_RIGHT = 1 << 1,
205 SIZER_POS_TOP = 1 << 2,
206 SIZER_POS_BOTTOM = 1 << 3
209 GtkWidget *sizer_new(GtkWidget *parent, GtkWidget *bounding_widget,
210 SizerPositionType position);
212 void sizer_set_limits(GtkWidget *sizer,
213 gint hsize_min, gint hsize_max,
214 gint vsize_min, gint vsize_max);
217 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
218 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
220 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
221 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
223 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
224 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
227 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
228 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
229 const gchar *title, const GdkColor *color,
230 GCallback func, gpointer data);
232 gchar *text_widget_text_pull(GtkWidget *text_widget);
233 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
235 gboolean defined_mouse_buttons(GtkWidget *widget, GdkEventButton *event, gpointer data);
237 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */