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>
32 /* these values are per GNOME HIG */
34 /* HIG 2.0 chapter 8 defines: */
38 * space between elements within control (ex: icon and it's text)
40 #define PREF_PAD_GAP 6
44 * space between label and control(s)
46 #define PREF_PAD_SPACE 12
49 * @def PREF_PAD_BORDER
50 * space between window border and controls
52 #define PREF_PAD_BORDER 12
55 * @def PREF_PAD_INDENT
56 * indent for group members
58 #define PREF_PAD_INDENT 12
62 * vertical space between groups
64 #define PREF_PAD_GROUP 18
66 /* HIG 2.0 chapter 3.13 defines: */
69 * @def PREF_PAD_BUTTON_GAP
70 * gap between buttons in a dialog
72 #define PREF_PAD_BUTTON_GAP 6
75 * @def PREF_PAD_BUTTON_SPACE
76 * space between buttons in a dialog and it's contents
78 #define PREF_PAD_BUTTON_SPACE 24
80 /* and these are not in the GNOME HIG */
83 * @def PREF_PAD_TOOLBAR_GAP
84 * gap between similar toolbar items (buttons)
86 #define PREF_PAD_TOOLBAR_GAP 0
89 * @def PREF_PAD_BUTTON_ICON_GAP
90 * HIG 2.0 states 6 pixels between icons and text,
91 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency
93 #define PREF_PAD_BUTTON_ICON_GAP 2
96 GtkWidget *pref_box_new(GtkWidget *parent_box, gboolean fill,
97 GtkOrientation orientation, gboolean padding);
99 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill,
100 const gchar *text, GtkOrientation orientation);
101 GtkWidget *pref_group_parent(GtkWidget *child);
103 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill,
105 GtkOrientation orientation, gboolean padding);
107 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding);
108 GtkWidget *pref_line(GtkWidget *parent_box, gboolean padding);
110 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
111 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
112 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size);
114 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *icon_name,
115 const gchar *text, 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, gint, gboolean, gboolean);
161 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
162 GtkOrientation orientation, const gchar *text);
164 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
165 const gchar *text, GtkAlign alignment);
167 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
168 const gchar *stock_id, const gchar *text,
169 GCallback func, gpointer data);
171 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
172 const gchar *text, const gchar *suffix,
173 gdouble min, gdouble max, gdouble step, gint digits,
175 GCallback func, gpointer data);
177 GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
178 const gchar *text, const gchar *suffix,
179 gint min, gint max, gint step,
180 gint value, gint *value_var);
183 GtkWidget *pref_toolbar_new(GtkWidget *parent_box);
184 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
185 const gchar *icon_name, const gchar *label, gboolean toggle,
186 const gchar *description,
187 GCallback func, gpointer data);
188 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
189 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
192 GtkWidget *date_selection_new();
194 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
195 GDateTime *date_selection_get(GtkWidget *widget);
197 void date_selection_time_set(GtkWidget *widget, time_t t);
198 time_t date_selection_time_get(GtkWidget *widget);
201 enum SizerPositionType {
202 SIZER_POS_LEFT = 1 << 0,
203 SIZER_POS_RIGHT = 1 << 1,
204 SIZER_POS_TOP = 1 << 2,
205 SIZER_POS_BOTTOM = 1 << 3
208 void sizer_set_limits(GtkWidget *sizer,
209 gint hsize_min, gint hsize_max,
210 gint vsize_min, gint vsize_max);
213 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
214 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
216 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
217 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
219 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
220 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
223 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
224 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
225 const gchar *title, GdkRGBA *color,
226 GCallback func, gpointer data);
228 gchar *text_widget_text_pull(GtkWidget *text_widget);
229 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
233 const gchar *name; /* GtkActionEntry terminology */
235 const gchar *icon_name;
238 GList* get_action_items();
239 void action_items_free(GList *list);
241 gboolean defined_mouse_buttons(GtkWidget *widget, GdkEventButton *event, gpointer data);
243 // Copy pixbuf returned by gtk_icon_theme_load_icon() to avoid GTK+ keeping the old icon theme loaded
244 GdkPixbuf *gq_gtk_icon_theme_load_icon_copy(GtkIconTheme *icon_theme, const gchar *icon_name, gint size, GtkIconLookupFlags flags);
246 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */