Mercurial > geeqie
comparison src/ui_misc.c @ 1448:89dedc61b1bd
gint -> gboolean.
author | zas_ |
---|---|
date | Sun, 15 Mar 2009 20:16:20 +0000 |
parents | 50ae02a4a675 |
children | 956aab097ea7 |
comparison
equal
deleted
inserted
replaced
1447:a10d70ae85e9 | 1448:89dedc61b1bd |
---|---|
32 *----------------------------------------------------------------------------- | 32 *----------------------------------------------------------------------------- |
33 * widget and layout utilities | 33 * widget and layout utilities |
34 *----------------------------------------------------------------------------- | 34 *----------------------------------------------------------------------------- |
35 */ | 35 */ |
36 | 36 |
37 GtkWidget *pref_box_new(GtkWidget *parent_box, gint fill, | 37 GtkWidget *pref_box_new(GtkWidget *parent_box, gboolean fill, |
38 GtkOrientation orientation, gint padding) | 38 GtkOrientation orientation, gboolean padding) |
39 { | 39 { |
40 GtkWidget *box; | 40 GtkWidget *box; |
41 | 41 |
42 if (orientation == GTK_ORIENTATION_HORIZONTAL) | 42 if (orientation == GTK_ORIENTATION_HORIZONTAL) |
43 { | 43 { |
52 gtk_widget_show(box); | 52 gtk_widget_show(box); |
53 | 53 |
54 return box; | 54 return box; |
55 } | 55 } |
56 | 56 |
57 GtkWidget *pref_group_new(GtkWidget *parent_box, gint fill, | 57 GtkWidget *pref_group_new(GtkWidget *parent_box, gboolean fill, |
58 const gchar *text, GtkOrientation orientation) | 58 const gchar *text, GtkOrientation orientation) |
59 { | 59 { |
60 GtkWidget *box; | 60 GtkWidget *box; |
61 GtkWidget *vbox; | 61 GtkWidget *vbox; |
62 GtkWidget *hbox; | 62 GtkWidget *hbox; |
119 } | 119 } |
120 | 120 |
121 return child; | 121 return child; |
122 } | 122 } |
123 | 123 |
124 GtkWidget *pref_frame_new(GtkWidget *parent_box, gint fill, | 124 GtkWidget *pref_frame_new(GtkWidget *parent_box, gboolean fill, |
125 const gchar *text, | 125 const gchar *text, |
126 GtkOrientation orientation, gint padding) | 126 GtkOrientation orientation, gboolean padding) |
127 { | 127 { |
128 GtkWidget *box; | 128 GtkWidget *box; |
129 GtkWidget *frame = NULL; | 129 GtkWidget *frame = NULL; |
130 | 130 |
131 frame = gtk_frame_new(text); | 131 frame = gtk_frame_new(text); |
145 gtk_widget_show(box); | 145 gtk_widget_show(box); |
146 | 146 |
147 return box; | 147 return box; |
148 } | 148 } |
149 | 149 |
150 GtkWidget *pref_spacer(GtkWidget *parent_box, gint padding) | 150 GtkWidget *pref_spacer(GtkWidget *parent_box, gboolean padding) |
151 { | 151 { |
152 GtkWidget *spacer; | 152 GtkWidget *spacer; |
153 | 153 |
154 spacer = gtk_hbox_new(FALSE, 0); | 154 spacer = gtk_hbox_new(FALSE, 0); |
155 gtk_box_pack_start(GTK_BOX(parent_box), spacer, FALSE, FALSE, padding / 2); | 155 gtk_box_pack_start(GTK_BOX(parent_box), spacer, FALSE, FALSE, padding / 2); |
156 gtk_widget_show(spacer); | 156 gtk_widget_show(spacer); |
157 | 157 |
158 return spacer; | 158 return spacer; |
159 } | 159 } |
160 | 160 |
161 GtkWidget *pref_line(GtkWidget *parent_box, gint padding) | 161 GtkWidget *pref_line(GtkWidget *parent_box, gboolean padding) |
162 { | 162 { |
163 GtkWidget *spacer; | 163 GtkWidget *spacer; |
164 | 164 |
165 if (GTK_IS_HBOX(parent_box)) | 165 if (GTK_IS_HBOX(parent_box)) |
166 { | 166 { |
198 gtk_widget_show(label); | 198 gtk_widget_show(label); |
199 | 199 |
200 return label; | 200 return label; |
201 } | 201 } |
202 | 202 |
203 void pref_label_bold(GtkWidget *label, gint bold, gint increase_size) | 203 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size) |
204 { | 204 { |
205 PangoAttrList *pal; | 205 PangoAttrList *pal; |
206 PangoAttribute *pa; | 206 PangoAttribute *pa; |
207 | 207 |
208 if (!bold && !increase_size) return; | 208 if (!bold && !increase_size) return; |
228 gtk_label_set_attributes(GTK_LABEL(label), pal); | 228 gtk_label_set_attributes(GTK_LABEL(label), pal); |
229 pango_attr_list_unref(pal); | 229 pango_attr_list_unref(pal); |
230 } | 230 } |
231 | 231 |
232 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id, | 232 GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id, |
233 const gchar *text, gint hide_stock_text, | 233 const gchar *text, gboolean hide_stock_text, |
234 GCallback func, gpointer data) | 234 GCallback func, gpointer data) |
235 { | 235 { |
236 GtkWidget *button; | 236 GtkWidget *button; |
237 | 237 |
238 if (stock_id && !text && !hide_stock_text) | 238 if (stock_id && !text && !hide_stock_text) |
296 } | 296 } |
297 | 297 |
298 return button; | 298 return button; |
299 } | 299 } |
300 | 300 |
301 static GtkWidget *real_pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gint mnemonic_text, | 301 static GtkWidget *real_pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean mnemonic_text, |
302 gint active, GCallback func, gpointer data) | 302 gboolean active, GCallback func, gpointer data) |
303 { | 303 { |
304 GtkWidget *button; | 304 GtkWidget *button; |
305 | 305 |
306 if (mnemonic_text) | 306 if (mnemonic_text) |
307 { | 307 { |
318 gtk_widget_show(button); | 318 gtk_widget_show(button); |
319 | 319 |
320 return button; | 320 return button; |
321 } | 321 } |
322 | 322 |
323 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gint active, | 323 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active, |
324 GCallback func, gpointer data) | 324 GCallback func, gpointer data) |
325 { | 325 { |
326 return real_pref_checkbox_new(parent_box, text, FALSE, active, func, data); | 326 return real_pref_checkbox_new(parent_box, text, FALSE, active, func, data); |
327 } | 327 } |
328 | 328 |
329 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gint active, | 329 GtkWidget *pref_checkbox_new_mnemonic(GtkWidget *parent_box, const gchar *text, gboolean active, |
330 GCallback func, gpointer data) | 330 GCallback func, gpointer data) |
331 { | 331 { |
332 return real_pref_checkbox_new(parent_box, text, TRUE, active, func, data); | 332 return real_pref_checkbox_new(parent_box, text, TRUE, active, func, data); |
333 } | 333 } |
334 | 334 |
335 static void pref_checkbox_int_cb(GtkWidget *widget, gpointer data) | 335 static void pref_checkbox_int_cb(GtkWidget *widget, gpointer data) |
336 { | 336 { |
337 gint *result = data; | 337 gboolean *result = data; |
338 | 338 |
339 *result = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | 339 *result = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); |
340 } | 340 } |
341 | 341 |
342 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gint active, | 342 GtkWidget *pref_checkbox_new_int(GtkWidget *parent_box, const gchar *text, gboolean active, |
343 gint *result) | 343 gboolean *result) |
344 { | 344 { |
345 GtkWidget *button; | 345 GtkWidget *button; |
346 | 346 |
347 button = pref_checkbox_new(parent_box, text, active, | 347 button = pref_checkbox_new(parent_box, text, active, |
348 G_CALLBACK(pref_checkbox_int_cb), result); | 348 G_CALLBACK(pref_checkbox_int_cb), result); |
380 | 380 |
381 pref_checkbox_link_sensitivity_swap_cb(button, widget); | 381 pref_checkbox_link_sensitivity_swap_cb(button, widget); |
382 } | 382 } |
383 | 383 |
384 static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling, | 384 static GtkWidget *real_pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling, |
385 const gchar *text, gint mnemonic_text, gint active, | 385 const gchar *text, gboolean mnemonic_text, gboolean active, |
386 GCallback func, gpointer data) | 386 GCallback func, gpointer data) |
387 { | 387 { |
388 GtkWidget *button; | 388 GtkWidget *button; |
389 GSList *group; | 389 GSList *group; |
390 | 390 |
414 | 414 |
415 return button; | 415 return button; |
416 } | 416 } |
417 | 417 |
418 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling, | 418 GtkWidget *pref_radiobutton_new(GtkWidget *parent_box, GtkWidget *sibling, |
419 const gchar *text, gint active, | 419 const gchar *text, gboolean active, |
420 GCallback func, gpointer data) | 420 GCallback func, gpointer data) |
421 { | 421 { |
422 return real_pref_radiobutton_new(parent_box, sibling, text, FALSE, active, func, data); | 422 return real_pref_radiobutton_new(parent_box, sibling, text, FALSE, active, func, data); |
423 } | 423 } |
424 | 424 |
425 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling, | 425 GtkWidget *pref_radiobutton_new_mnemonic(GtkWidget *parent_box, GtkWidget *sibling, |
426 const gchar *text, gint active, | 426 const gchar *text, gboolean active, |
427 GCallback func, gpointer data) | 427 GCallback func, gpointer data) |
428 { | 428 { |
429 return real_pref_radiobutton_new(parent_box, sibling, text, TRUE, active, func, data); | 429 return real_pref_radiobutton_new(parent_box, sibling, text, TRUE, active, func, data); |
430 } | 430 } |
431 | 431 |
432 #define PREF_RADIO_VALUE_KEY "pref_radio_value" | 432 #define PREF_RADIO_VALUE_KEY "pref_radio_value" |
433 | 433 |
434 static void pref_radiobutton_int_cb(GtkWidget *widget, gpointer data) | 434 static void pref_radiobutton_int_cb(GtkWidget *widget, gpointer data) |
435 { | 435 { |
436 gint *result = data; | 436 gboolean *result = data; |
437 | 437 |
438 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) | 438 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
439 { | 439 { |
440 *result = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), PREF_RADIO_VALUE_KEY)); | 440 *result = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), PREF_RADIO_VALUE_KEY)); |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
444 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling, | 444 GtkWidget *pref_radiobutton_new_int(GtkWidget *parent_box, GtkWidget *sibling, |
445 const gchar *text, gint active, | 445 const gchar *text, gboolean active, |
446 gint *result, gint value, | 446 gboolean *result, gboolean value, |
447 GCallback func, gpointer data) | 447 GCallback func, gpointer data) |
448 { | 448 { |
449 GtkWidget *button; | 449 GtkWidget *button; |
450 | 450 |
451 button = pref_radiobutton_new(parent_box, sibling, text, active, | 451 button = pref_radiobutton_new(parent_box, sibling, text, active, |
455 | 455 |
456 return button; | 456 return button; |
457 } | 457 } |
458 | 458 |
459 static GtkWidget *real_pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix, | 459 static GtkWidget *real_pref_spin_new(GtkWidget *parent_box, const gchar *text, const gchar *suffix, |
460 gint mnemonic_text, | 460 gboolean mnemonic_text, |
461 gdouble min, gdouble max, gdouble step, gint digits, | 461 gdouble min, gdouble max, gdouble step, gint digits, |
462 gdouble value, | 462 gdouble value, |
463 GCallback func, gpointer data) | 463 GCallback func, gpointer data) |
464 { | 464 { |
465 GtkWidget *spin; | 465 GtkWidget *spin; |
571 g_signal_handlers_unblock_matched(widget, G_SIGNAL_MATCH_DATA, | 571 g_signal_handlers_unblock_matched(widget, G_SIGNAL_MATCH_DATA, |
572 0, 0, NULL, NULL, data); | 572 0, 0, NULL, NULL, data); |
573 } | 573 } |
574 | 574 |
575 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows, | 575 GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows, |
576 gint homogenious, gint fill) | 576 gboolean homogeneous, gboolean fill) |
577 { | 577 { |
578 GtkWidget *table; | 578 GtkWidget *table; |
579 | 579 |
580 table = gtk_table_new(rows, columns, homogenious); | 580 table = gtk_table_new(rows, columns, homogeneous); |
581 gtk_table_set_row_spacings(GTK_TABLE(table), PREF_PAD_GAP); | 581 gtk_table_set_row_spacings(GTK_TABLE(table), PREF_PAD_GAP); |
582 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_SPACE); | 582 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_SPACE); |
583 | 583 |
584 if (parent_box) | 584 if (parent_box) |
585 { | 585 { |
638 | 638 |
639 return label; | 639 return label; |
640 } | 640 } |
641 | 641 |
642 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row, | 642 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row, |
643 const gchar *stock_id, const gchar *text, gint hide_stock_text, | 643 const gchar *stock_id, const gchar *text, gboolean hide_stock_text, |
644 GCallback func, gpointer data) | 644 GCallback func, gpointer data) |
645 { | 645 { |
646 GtkWidget *button; | 646 GtkWidget *button; |
647 | 647 |
648 button = pref_button_new(NULL, stock_id, text, hide_stock_text, func, data); | 648 button = pref_button_new(NULL, stock_id, text, hide_stock_text, func, data); |
767 | 767 |
768 return tbar; | 768 return tbar; |
769 } | 769 } |
770 | 770 |
771 GtkWidget *pref_toolbar_button(GtkWidget *toolbar, | 771 GtkWidget *pref_toolbar_button(GtkWidget *toolbar, |
772 const gchar *stock_id, const gchar *label, gint toggle, | 772 const gchar *stock_id, const gchar *label, gboolean toggle, |
773 const gchar *description, | 773 const gchar *description, |
774 GCallback func, gpointer data) | 774 GCallback func, gpointer data) |
775 { | 775 { |
776 GtkWidget *item; | 776 GtkWidget *item; |
777 | 777 |
890 ds->calendar = NULL; | 890 ds->calendar = NULL; |
891 | 891 |
892 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ds->button), FALSE); | 892 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ds->button), FALSE); |
893 } | 893 } |
894 | 894 |
895 static gint date_selection_popup_release_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) | 895 static gboolean date_selection_popup_release_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) |
896 { | 896 { |
897 DateSelection *ds = data; | 897 DateSelection *ds = data; |
898 | 898 |
899 date_selection_popup_hide(ds); | 899 date_selection_popup_hide(ds); |
900 return TRUE; | 900 return TRUE; |
901 } | 901 } |
902 | 902 |
903 static gint date_selection_popup_press_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) | 903 static gboolean date_selection_popup_press_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) |
904 { | 904 { |
905 DateSelection *ds = data; | 905 DateSelection *ds = data; |
906 gint x, y; | 906 gint x, y; |
907 gint w, h; | 907 gint w, h; |
908 gint xr, yr; | 908 gint xr, yr; |
929 | 929 |
930 gtk_calendar_get_date(GTK_CALENDAR(ds->calendar), &year, &month, &day); | 930 gtk_calendar_get_date(GTK_CALENDAR(ds->calendar), &year, &month, &day); |
931 date_selection_set(ds->box, day, month + 1, year); | 931 date_selection_set(ds->box, day, month + 1, year); |
932 } | 932 } |
933 | 933 |
934 static gint date_selection_popup_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) | 934 static gboolean date_selection_popup_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
935 { | 935 { |
936 DateSelection *ds = data; | 936 DateSelection *ds = data; |
937 | 937 |
938 switch (event->keyval) | 938 switch (event->keyval) |
939 { | 939 { |
1176 gint hsize_min; | 1176 gint hsize_min; |
1177 gint hsize_max; | 1177 gint hsize_max; |
1178 gint vsize_min; | 1178 gint vsize_min; |
1179 gint vsize_max; | 1179 gint vsize_max; |
1180 | 1180 |
1181 gint in_drag; | 1181 gboolean in_drag; |
1182 gint press_x; | 1182 gint press_x; |
1183 gint press_y; | 1183 gint press_y; |
1184 gint press_width; | 1184 gint press_width; |
1185 gint press_height; | 1185 gint press_height; |
1186 | 1186 |
1187 gint handle_prelit; | 1187 gboolean handle_prelit; |
1188 }; | 1188 }; |
1189 | 1189 |
1190 | 1190 |
1191 static gint sizer_default_handle_size(void) | 1191 static gint sizer_default_handle_size(void) |
1192 { | 1192 { |
1203 gtk_widget_destroy(paned); | 1203 gtk_widget_destroy(paned); |
1204 | 1204 |
1205 return handle_size; | 1205 return handle_size; |
1206 } | 1206 } |
1207 | 1207 |
1208 static gint sizer_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 1208 static gboolean sizer_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
1209 { | 1209 { |
1210 SizerData *sd = data; | 1210 SizerData *sd = data; |
1211 gint x, y; | 1211 gint x, y; |
1212 gint w, h; | 1212 gint w, h; |
1213 | 1213 |
1260 if (w > 0 || h > 0) gtk_widget_set_size_request(sd->parent, w, h); | 1260 if (w > 0 || h > 0) gtk_widget_set_size_request(sd->parent, w, h); |
1261 | 1261 |
1262 return TRUE; | 1262 return TRUE; |
1263 } | 1263 } |
1264 | 1264 |
1265 static gint sizer_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 1265 static gboolean sizer_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
1266 { | 1266 { |
1267 SizerData *sd = data; | 1267 SizerData *sd = data; |
1268 | 1268 |
1269 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; | 1269 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; |
1270 | 1270 |
1281 gtk_grab_add(sd->sizer); | 1281 gtk_grab_add(sd->sizer); |
1282 | 1282 |
1283 return TRUE; | 1283 return TRUE; |
1284 } | 1284 } |
1285 | 1285 |
1286 static gint sizer_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 1286 static gboolean sizer_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
1287 { | 1287 { |
1288 SizerData *sd = data; | 1288 SizerData *sd = data; |
1289 | 1289 |
1290 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; | 1290 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; |
1291 | 1291 |
1298 sd->in_drag = FALSE; | 1298 sd->in_drag = FALSE; |
1299 | 1299 |
1300 return TRUE; | 1300 return TRUE; |
1301 } | 1301 } |
1302 | 1302 |
1303 static void sizer_set_prelight(SizerData *sd, gint prelit) | 1303 static void sizer_set_prelight(SizerData *sd, gboolean prelit) |
1304 { | 1304 { |
1305 sd->handle_prelit = prelit; | 1305 sd->handle_prelit = prelit; |
1306 gtk_widget_queue_draw_area(sd->sizer, 0, 0, | 1306 gtk_widget_queue_draw_area(sd->sizer, 0, 0, |
1307 sd->sizer->allocation.width, sd->sizer->allocation.height); | 1307 sd->sizer->allocation.width, sd->sizer->allocation.height); |
1308 } | 1308 } |
1309 | 1309 |
1310 static gint sizer_enter_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) | 1310 static gboolean sizer_enter_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) |
1311 { | 1311 { |
1312 SizerData *sd = data; | 1312 SizerData *sd = data; |
1313 | 1313 |
1314 sizer_set_prelight(sd, TRUE); | 1314 sizer_set_prelight(sd, TRUE); |
1315 return TRUE; | 1315 return TRUE; |
1316 } | 1316 } |
1317 | 1317 |
1318 static gint sizer_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) | 1318 static gboolean sizer_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) |
1319 { | 1319 { |
1320 SizerData *sd = data; | 1320 SizerData *sd = data; |
1321 | 1321 |
1322 sizer_set_prelight(sd, FALSE); | 1322 sizer_set_prelight(sd, FALSE); |
1323 return TRUE; | 1323 return TRUE; |
1324 } | 1324 } |
1325 | 1325 |
1326 static gint sizer_expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data) | 1326 static gboolean sizer_expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data) |
1327 { | 1327 { |
1328 SizerData *sd = data; | 1328 SizerData *sd = data; |
1329 GdkRectangle clip; | 1329 GdkRectangle clip; |
1330 GtkOrientation orientation; | 1330 GtkOrientation orientation; |
1331 GtkStateType state; | 1331 GtkStateType state; |
1492 } | 1492 } |
1493 | 1493 |
1494 return NULL; | 1494 return NULL; |
1495 } | 1495 } |
1496 | 1496 |
1497 static gint pref_list_get(const gchar *group, const gchar *key, const gchar *marker, const gchar **result) | 1497 static gboolean pref_list_get(const gchar *group, const gchar *key, const gchar *marker, const gchar **result) |
1498 { | 1498 { |
1499 gchar *token; | 1499 gchar *token; |
1500 GList *work; | 1500 GList *work; |
1501 gint ret; | 1501 gboolean ret; |
1502 | 1502 |
1503 if (!group || !key || !marker) | 1503 if (!group || !key || !marker) |
1504 { | 1504 { |
1505 *result = NULL; | 1505 *result = NULL; |
1506 return FALSE; | 1506 return FALSE; |
1570 text = g_strdup_printf("%d", value); | 1570 text = g_strdup_printf("%d", value); |
1571 pref_list_set(group, key, PREF_LIST_MARKER_INT, text); | 1571 pref_list_set(group, key, PREF_LIST_MARKER_INT, text); |
1572 g_free(text); | 1572 g_free(text); |
1573 } | 1573 } |
1574 | 1574 |
1575 gint pref_list_int_get(const gchar *group, const gchar *key, gint *result) | 1575 gboolean pref_list_int_get(const gchar *group, const gchar *key, gint *result) |
1576 { | 1576 { |
1577 const gchar *text; | 1577 const gchar *text; |
1578 | 1578 |
1579 if (!group || !key) | 1579 if (!group || !key) |
1580 { | 1580 { |
1598 | 1598 |
1599 g_ascii_dtostr(text, sizeof(text), value); | 1599 g_ascii_dtostr(text, sizeof(text), value); |
1600 pref_list_set(group, key, PREF_LIST_MARKER_DOUBLE, text); | 1600 pref_list_set(group, key, PREF_LIST_MARKER_DOUBLE, text); |
1601 } | 1601 } |
1602 | 1602 |
1603 gint pref_list_double_get(const gchar *group, const gchar *key, gdouble *result) | 1603 gboolean pref_list_double_get(const gchar *group, const gchar *key, gdouble *result) |
1604 { | 1604 { |
1605 const gchar *text; | 1605 const gchar *text; |
1606 | 1606 |
1607 if (!group || !key) | 1607 if (!group || !key) |
1608 { | 1608 { |
1623 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value) | 1623 void pref_list_string_set(const gchar *group, const gchar *key, const gchar *value) |
1624 { | 1624 { |
1625 pref_list_set(group, key, PREF_LIST_MARKER_STRING, value); | 1625 pref_list_set(group, key, PREF_LIST_MARKER_STRING, value); |
1626 } | 1626 } |
1627 | 1627 |
1628 gint pref_list_string_get(const gchar *group, const gchar *key, const gchar **result) | 1628 gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar **result) |
1629 { | 1629 { |
1630 return pref_list_get(group, key, PREF_LIST_MARKER_STRING, result); | 1630 return pref_list_get(group, key, PREF_LIST_MARKER_STRING, result); |
1631 } | 1631 } |
1632 | 1632 |
1633 | 1633 |