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 *icon_name,
114 const gchar *text, GCallback func, gpointer data);
116 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
117 GCallback func, gpointer data);
118 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active,
119 GCallback func, gpointer data);
121 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active,
124 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget);
125 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget);
127 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling,
128 const gchar *text, gboolean active,
129 GCallback func, gpointer data);
130 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
131 const gchar *text, gboolean active,
132 GCallback func, gpointer data);
134 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
135 const gchar *text, gboolean active,
136 gboolean *result, gboolean value,
137 GCallback func, gpointer data);
139 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
140 gdouble min, gdouble max, gdouble step, gint digits,
142 GCallback func, gpointer data);
143 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
144 gdouble min, gdouble max, gdouble step, gint digits,
146 GCallback func, gpointer data);
148 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
149 gint min, gint max, gint step,
150 gint value, gint *value_var);
152 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch);
154 void pref_signal_block_data(GtkWidget *widget, gpointer data);
155 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
158 GtkWidget *pref_table_new(GtkWidget *parent_box, gint, gint, gboolean, gboolean);
160 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
161 GtkOrientation orientation, const gchar *text);
163 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
164 const gchar *text, GtkAlign alignment);
166 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
167 const gchar *stock_id, const gchar *text,
168 GCallback func, gpointer data);
170 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
171 const gchar *text, const gchar *suffix,
172 gdouble min, gdouble max, gdouble step, gint digits,
174 GCallback func, gpointer data);
176 GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
177 const gchar *text, const gchar *suffix,
178 gint min, gint max, gint step,
179 gint value, gint *value_var);
182 GtkWidget *pref_toolbar_new(GtkWidget *parent_box);
183 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
184 const gchar *icon_name, const gchar *label, gboolean toggle,
185 const gchar *description,
186 GCallback func, gpointer data);
187 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
188 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
191 GtkWidget *date_selection_new();
193 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
194 GDateTime *date_selection_get(GtkWidget *widget);
196 void date_selection_time_set(GtkWidget *widget, time_t t);
197 time_t date_selection_time_get(GtkWidget *widget);
200 enum SizerPositionType {
201 SIZER_POS_LEFT = 1 << 0,
202 SIZER_POS_RIGHT = 1 << 1,
203 SIZER_POS_TOP = 1 << 2,
204 SIZER_POS_BOTTOM = 1 << 3
207 void sizer_set_limits(GtkWidget *sizer,
208 gint hsize_min, gint hsize_max,
209 gint vsize_min, gint vsize_max);
212 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
213 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
215 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
216 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
218 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
219 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
222 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
223 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
224 const gchar *title, GdkRGBA *color,
225 GCallback func, gpointer data);
227 gchar *text_widget_text_pull(GtkWidget *text_widget);
228 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
232 const gchar *name; /* GtkActionEntry terminology */
234 const gchar *icon_name;
237 GList* get_action_items();
238 void action_items_free(GList *list);
240 gboolean defined_mouse_buttons(GtkWidget *widget, GdkEventButton *event, gpointer data);
242 // Copy pixbuf returned by gtk_icon_theme_load_icon() to avoid GTK+ keeping the old icon theme loaded
243 GdkPixbuf *gq_gtk_icon_theme_load_icon_copy(GtkIconTheme *icon_theme, const gchar *icon_name, gint size, GtkIconLookupFlags flags);
245 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */