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 <gdk-pixbuf/gdk-pixbuf.h>
29 #include <glib-object.h>
33 /* these values are per GNOME HIG */
35 /* HIG 2.0 chapter 8 defines: */
39 * space between elements within control (ex: icon and it's text)
41 #define PREF_PAD_GAP 6
45 * space between label and control(s)
47 #define PREF_PAD_SPACE 12
50 * @def PREF_PAD_BORDER
51 * space between window border and controls
53 #define PREF_PAD_BORDER 12
56 * @def PREF_PAD_INDENT
57 * indent for group members
59 #define PREF_PAD_INDENT 12
63 * vertical space between groups
65 #define PREF_PAD_GROUP 18
67 /* HIG 2.0 chapter 3.13 defines: */
70 * @def PREF_PAD_BUTTON_GAP
71 * gap between buttons in a dialog
73 #define PREF_PAD_BUTTON_GAP 6
76 * @def PREF_PAD_BUTTON_SPACE
77 * space between buttons in a dialog and it's contents
79 #define PREF_PAD_BUTTON_SPACE 24
81 /* and these are not in the GNOME HIG */
84 * @def PREF_PAD_TOOLBAR_GAP
85 * gap between similar toolbar items (buttons)
87 #define PREF_PAD_TOOLBAR_GAP 0
90 * @def PREF_PAD_BUTTON_ICON_GAP
91 * HIG 2.0 states 6 pixels between icons and text,
92 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency
94 #define PREF_PAD_BUTTON_ICON_GAP 2
97 GtkWidget *pref_box_new(GtkWidget *parent_box, gboolean fill,
98 GtkOrientation orientation, gboolean padding);
100 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill,
101 const gchar *text, GtkOrientation orientation);
102 GtkWidget *pref_group_parent(GtkWidget *child);
104 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill,
106 GtkOrientation orientation, gboolean padding);
108 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding);
109 GtkWidget *pref_line(GtkWidget *parent_box, gboolean padding);
111 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
112 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
113 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size);
115 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *icon_name,
116 const gchar *text, GCallback func, gpointer data);
118 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
119 GCallback func, gpointer data);
120 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active,
121 GCallback func, gpointer data);
123 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active,
126 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget);
127 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget);
129 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling,
130 const gchar *text, gboolean active,
131 GCallback func, gpointer data);
132 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
133 const gchar *text, gboolean active,
134 GCallback func, gpointer data);
136 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
137 const gchar *text, gboolean active,
138 gboolean *result, gboolean value,
139 GCallback func, gpointer data);
141 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
142 gdouble min, gdouble max, gdouble step, gint digits,
144 GCallback func, gpointer data);
145 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
146 gdouble min, gdouble max, gdouble step, gint digits,
148 GCallback func, gpointer data);
150 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
151 gint min, gint max, gint step,
152 gint value, gint *value_var);
154 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch);
156 void pref_signal_block_data(GtkWidget *widget, gpointer data);
157 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
160 GtkWidget *pref_table_new(GtkWidget *parent_box, gint, gint, gboolean, gboolean);
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, GtkAlign alignment);
168 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
169 const gchar *stock_id, const gchar *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);
185 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
186 const gchar *icon_name, 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();
195 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
196 GDateTime *date_selection_get(GtkWidget *widget);
198 void date_selection_time_set(GtkWidget *widget, time_t t);
199 time_t date_selection_time_get(GtkWidget *widget);
202 enum SizerPositionType {
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 void sizer_set_limits(GtkWidget *sizer,
210 gint hsize_min, gint hsize_max,
211 gint vsize_min, gint vsize_max);
214 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
215 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
217 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
218 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
220 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
221 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
224 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
225 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
226 const gchar *title, GdkRGBA *color,
227 GCallback func, gpointer data);
229 gchar *text_widget_text_pull(GtkWidget *text_widget);
230 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
234 const gchar *name; /* GtkActionEntry terminology */
236 const gchar *icon_name;
239 GList* get_action_items();
240 void action_items_free(GList *list);
242 gboolean defined_mouse_buttons(GtkWidget *widget, GdkEventButton *event, gpointer data);
244 // Copy pixbuf returned by gtk_icon_theme_load_icon() to avoid GTK+ keeping the old icon theme loaded
245 GdkPixbuf *gq_gtk_icon_theme_load_icon_copy(GtkIconTheme *icon_theme, const gchar *icon_name, gint size, GtkIconLookupFlags flags);
247 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */