2 * (SLIK) SimpLIstic sKin functions
7 * This software is released under the GNU General Public License (GNU GPL).
8 * Please read the included file COPYING for more information.
9 * This software comes with no warranty of any kind, use at your own risk!
18 #include <sys/types.h>
22 /* these values are per GNOME HIG */
24 /* HIG 2.0 chapter 8 defines: */
26 /* space between elements within control (ex: icon and it's text) */
27 #define PREF_PAD_GAP 6
28 /* space between label and control(s) */
29 #define PREF_PAD_SPACE 12
30 /* space between window border and controls */
31 #define PREF_PAD_BORDER 12
32 /* indent for group members */
33 #define PREF_PAD_INDENT 12
34 /* vertical space between groups */
35 #define PREF_PAD_GROUP 18
37 /* HIG 2.0 chapter 3.13 defines: */
39 /* gap between buttons in a dialog */
40 #define PREF_PAD_BUTTON_GAP 6
41 /* space between buttons in a dialog and it's contents */
42 #define PREF_PAD_BUTTON_SPACE 24
44 /* and these are not in the GNOME HIG */
46 /* gap between similar toolbar items (buttons) */
47 #define PREF_PAD_TOOLBAR_GAP 0
49 /* HIG 2.0 states 6 pixels between icons and text,
50 * but GTK's stock buttons ignore this (hard coded to 2), we do it too for consistency
52 #define PREF_PAD_BUTTON_ICON_GAP 2
55 GtkWidget *pref_box_new(GtkWidget *parent_box, gint fill,
56 GtkOrientation orientation, gint padding);
58 GtkWidget *pref_group_new(GtkWidget *parent_box, gint fill,
59 const gchar *text, GtkOrientation orientation);
60 GtkWidget *pref_group_parent(GtkWidget *child);
62 GtkWidget *pref_frame_new(GtkWidget *parent_box, gint fill,
64 GtkOrientation orientation, gint padding);
66 GtkWidget *pref_spacer(GtkWidget *parent_box, gint padding);
67 GtkWidget *pref_line(GtkWidget *parent_box, gint padding);
69 GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
70 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
71 void pref_label_bold(GtkWidget *label, gint bold, gint increase_size);
73 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id,
74 const gchar *text, gint hide_stock_text,
75 GCallback func, gpointer data);
77 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gint active,
78 GCallback func, gpointer data);
79 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gint active,
80 GCallback func, gpointer data);
82 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gint active,
85 void pref_checkbox_link_sensitivity(GtkWidget *button, GtkWidget *widget);
86 void pref_checkbox_link_sensitivity_swap(GtkWidget *button, GtkWidget *widget);
88 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling,
89 const gchar *text, gint active,
90 GCallback func, gpointer data);
91 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling,
92 const gchar *text, gint active,
93 GCallback func, gpointer data);
95 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling,
96 const gchar *text, gint active,
97 gint *result, gint value,
98 GCallback func, gpointer data);
100 GtkWidget *pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
101 gdouble min, gdouble max, gdouble step, gint digits,
103 GCallback func, gpointer data);
104 GtkWidget *pref_spin_new_mnemonic(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
105 gdouble min, gdouble max, gdouble step, gint digits,
107 GCallback func, gpointer data);
109 GtkWidget *pref_spin_new_int(GtkWidget *parent_box, const gchar *text, const gchar *suffix,
110 gint min, gint max, gint step,
111 gint value, gint *value_var);
113 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch);
115 void pref_signal_block_data(GtkWidget *widget, gpointer data);
116 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
119 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows,
120 gint homogenious, gint fill);
122 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
123 GtkOrientation orientation, const gchar *text);
125 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
126 const gchar *text, gfloat alignment);
128 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
129 const gchar *stock_id, const gchar *text, gint hide_stock_text,
130 GCallback func, gpointer data);
132 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
133 const gchar *text, const gchar *suffix,
134 gdouble min, gdouble max, gdouble step, gint digits,
136 GCallback func, gpointer data);
139 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style);
140 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
141 const gchar *stock_id, const gchar *label, gint toggle,
142 const gchar *description,
143 GCallback func, gpointer data);
144 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
145 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
148 GtkWidget *date_selection_new(void);
150 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
151 void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year);
153 void date_selection_time_set(GtkWidget *widget, time_t t);
154 time_t date_selection_time_get(GtkWidget *widget);
158 SIZER_POS_LEFT = 1 << 0,
159 SIZER_POS_RIGHT = 1 << 1,
160 SIZER_POS_TOP = 1 << 2,
161 SIZER_POS_BOTTOM = 1 << 3
164 GtkWidget *sizer_new(GtkWidget *parent, GtkWidget *bounding_widget,
165 SizerPositionType position);
167 void sizer_set_limits(GtkWidget *sizer,
168 gint hsize_min, gint hsize_max,
169 gint vsize_min, gint vsize_max);
172 void pref_list_int_set(const gchar *group, const gchar *key, gint value);
173 gint pref_list_int_get(const gchar *group, const gchar *key, gint *result);
175 void pref_list_double_set(const gchar *group, const gchar *key, gdouble value);
176 gint pref_list_double_get(const gchar *group, const gchar *key, gdouble *result);
178 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value);
179 gint pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);