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: */
35 /* space between elements within control (ex: icon and it's text) */
36 #define PREF_PAD_GAP 6
37 /* space between label and control(s) */
38 #define PREF_PAD_SPACE 12
39 /* space between window border and controls */
40 #define PREF_PAD_BORDER 12
41 /* indent for group members */
42 #define PREF_PAD_INDENT 12
43 /* vertical space between groups */
44 #define PREF_PAD_GROUP 18
46 /* HIG 2.0 chapter 3.13 defines: */
48 /* gap between buttons in a dialog */
49 #define PREF_PAD_BUTTON_GAP 6
50 /* space between buttons in a dialog and it's contents */
51 #define PREF_PAD_BUTTON_SPACE 24
53 /* and these are not in the GNOME HIG */
55 /* gap between similar toolbar items (buttons) */
56 #define PREF_PAD_TOOLBAR_GAP 0
58 /* HIG 2.0 states 6 pixels between icons and text,
59 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency
61 #define PREF_PAD_BUTTON_ICON_GAP 2
64 GtkWidget *pref_box_new(GtkWidget *parent_box, gboolean fill,
65 GtkOrientation orientation, gboolean padding);
67 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill,
68 const gchar *text, GtkOrientation orientation);
69 GtkWidget *pref_group_parent(GtkWidget *child);
71 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill,
73 GtkOrientation orientation, gboolean padding);
75 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding);
76 GtkWidget *pref_line(GtkWidget *parent_box, gboolean padding);
78 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
79 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
80 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size);
82 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id,
83 const gchar *text, gboolean hide_stock_text,
84 GCallback func, gpointer data);
86 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
87 GCallback func, gpointer data);
88 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active,
89 GCallback func, gpointer data);
91 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active,
94 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget);
95 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget);
97 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling,
98 const gchar *text, gboolean active,
99 GCallback func, gpointer data);
100 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
101 const gchar *text, gboolean active,
102 GCallback func, gpointer data);
104 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
105 const gchar *text, gboolean active,
106 gboolean *result, gboolean value,
107 GCallback func, gpointer data);
109 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
110 gdouble min, gdouble max, gdouble step, gint digits,
112 GCallback func, gpointer data);
113 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
114 gdouble min, gdouble max, gdouble step, gint digits,
116 GCallback func, gpointer data);
118 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
119 gint min, gint max, gint step,
120 gint value, gint *value_var);
122 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch);
124 void pref_signal_block_data(GtkWidget *widget, gpointer data);
125 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
128 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows,
129 gboolean homegeneous, gboolean fill);
131 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
132 GtkOrientation orientation, const gchar *text);
134 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
135 const gchar *text, gfloat alignment);
137 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
138 const gchar *stock_id, const gchar *text, gboolean hide_stock_text,
139 GCallback func, gpointer data);
141 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
142 const gchar *text, const gchar *suffix,
143 gdouble min, gdouble max, gdouble step, gint digits,
145 GCallback func, gpointer data);
147 GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
148 const gchar *text, const gchar *suffix,
149 gint min, gint max, gint step,
150 gint value, gint *value_var);
153 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style);
154 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
155 const gchar *stock_id, const gchar *label, gboolean toggle,
156 const gchar *description,
157 GCallback func, gpointer data);
158 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
159 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
162 GtkWidget *date_selection_new(void);
164 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
165 void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year);
167 void date_selection_time_set(GtkWidget *widget, time_t t);
168 time_t date_selection_time_get(GtkWidget *widget);
172 SIZER_POS_LEFT = 1 << 0,
173 SIZER_POS_RIGHT = 1 << 1,
174 SIZER_POS_TOP = 1 << 2,
175 SIZER_POS_BOTTOM = 1 << 3
178 GtkWidget *sizer_new(GtkWidget *parent, GtkWidget *bounding_widget,
179 SizerPositionType position);
181 void sizer_set_limits(GtkWidget *sizer,
182 gint hsize_min, gint hsize_max,
183 gint vsize_min, gint vsize_max);
186 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
187 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result);
189 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
190 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
192 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
193 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
196 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
197 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
198 const gchar *title, const GdkColor *color,
199 GCallback func, gpointer data);
201 gchar *text_widget_text_pull(GtkWidget *text_widget);
204 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */