comparison src/layout_image.c @ 1433:b4ad1d201279

Use gboolean where applicable, minor cleanup and indentations fixes.
author zas_
date Sat, 14 Mar 2009 19:25:21 +0000
parents cf4029d10d38
children 96897bd5f6cd
comparison
equal deleted inserted replaced
1432:cf4029d10d38 1433:b4ad1d201279
130 { 130 {
131 layout_image_full_screen_start(lw); 131 layout_image_full_screen_start(lw);
132 } 132 }
133 } 133 }
134 134
135 gint layout_image_full_screen_active(LayoutWindow *lw) 135 gboolean layout_image_full_screen_active(LayoutWindow *lw)
136 { 136 {
137 if (!layout_valid(&lw)) return FALSE; 137 if (!layout_valid(&lw)) return FALSE;
138 138
139 return (lw->full_screen != NULL); 139 return (lw->full_screen != NULL);
140 } 140 }
227 { 227 {
228 layout_image_slideshow_start(lw); 228 layout_image_slideshow_start(lw);
229 } 229 }
230 } 230 }
231 231
232 gint layout_image_slideshow_active(LayoutWindow *lw) 232 gboolean layout_image_slideshow_active(LayoutWindow *lw)
233 { 233 {
234 if (!layout_valid(&lw)) return FALSE; 234 if (!layout_valid(&lw)) return FALSE;
235 235
236 return (lw->slideshow != NULL); 236 return (lw->slideshow != NULL);
237 } 237 }
238 238
239 gint layout_image_slideshow_pause_toggle(LayoutWindow *lw) 239 gboolean layout_image_slideshow_pause_toggle(LayoutWindow *lw)
240 { 240 {
241 gint ret; 241 gboolean ret;
242 242
243 if (!layout_valid(&lw)) return FALSE; 243 if (!layout_valid(&lw)) return FALSE;
244 244
245 ret = slideshow_pause_toggle(lw->slideshow); 245 ret = slideshow_pause_toggle(lw->slideshow);
246 246
247 layout_status_update_info(lw, NULL); 247 layout_status_update_info(lw, NULL);
248 248
249 return ret; 249 return ret;
250 } 250 }
251 251
252 gint layout_image_slideshow_paused(LayoutWindow *lw) 252 gboolean layout_image_slideshow_paused(LayoutWindow *lw)
253 { 253 {
254 if (!layout_valid(&lw)) return FALSE; 254 if (!layout_valid(&lw)) return FALSE;
255 255
256 return (slideshow_paused(lw->slideshow)); 256 return (slideshow_paused(lw->slideshow));
257 } 257 }
258 258
259 static gint layout_image_slideshow_continue_check(LayoutWindow *lw) 259 static gboolean layout_image_slideshow_continue_check(LayoutWindow *lw)
260 { 260 {
261 if (!lw->slideshow) return FALSE; 261 if (!lw->slideshow) return FALSE;
262 262
263 if (!slideshow_should_continue(lw->slideshow)) 263 if (!slideshow_should_continue(lw->slideshow))
264 { 264 {
442 442
443 fd = layout_image_get_fd(lw); 443 fd = layout_image_get_fd(lw);
444 if (fd) layout_set_fd(lw, fd); 444 if (fd) layout_set_fd(lw, fd);
445 } 445 }
446 446
447 static gint li_check_if_current_path(LayoutWindow *lw, const gchar *path) 447 static gboolean li_check_if_current_path(LayoutWindow *lw, const gchar *path)
448 { 448 {
449 gchar *dirname; 449 gchar *dirname;
450 gint ret; 450 gboolean ret;
451 451
452 if (!path || !layout_valid(&lw) || !lw->dir_fd) return FALSE; 452 if (!path || !layout_valid(&lw) || !lw->dir_fd) return FALSE;
453 453
454 dirname = g_path_get_dirname(path); 454 dirname = g_path_get_dirname(path);
455 ret = (strcmp(lw->dir_fd->path, dirname) == 0); 455 ret = (strcmp(lw->dir_fd->path, dirname) == 0);
480 { 480 {
481 GtkWidget *menu; 481 GtkWidget *menu;
482 GtkWidget *item; 482 GtkWidget *item;
483 GtkWidget *submenu; 483 GtkWidget *submenu;
484 const gchar *path; 484 const gchar *path;
485 gint fullscreen; 485 gboolean fullscreen;
486 486
487 path = layout_image_get_path(lw); 487 path = layout_image_get_path(lw);
488 fullscreen = layout_image_full_screen_active(lw); 488 fullscreen = layout_image_full_screen_active(lw);
489 489
490 menu = popup_menu_short_lived(); 490 menu = popup_menu_short_lived();
698 698
699 if (fd) 699 if (fd)
700 { 700 {
701 gchar *text = NULL; 701 gchar *text = NULL;
702 gint len; 702 gint len;
703 gint plain_text; 703 gboolean plain_text;
704 GList *list; 704 GList *list;
705 705
706 switch (info) 706 switch (info)
707 { 707 {
708 case TARGET_URI_LIST: 708 case TARGET_URI_LIST:
1021 } 1021 }
1022 1022
1023 layout_image_set_with_ahead(lw, fd, read_ahead_fd); 1023 layout_image_set_with_ahead(lw, fd, read_ahead_fd);
1024 } 1024 }
1025 1025
1026 static void layout_image_set_collection_real(LayoutWindow *lw, CollectionData *cd, CollectInfo *info, gint forward) 1026 static void layout_image_set_collection_real(LayoutWindow *lw, CollectionData *cd, CollectInfo *info, gboolean forward)
1027 { 1027 {
1028 if (!layout_valid(&lw)) return; 1028 if (!layout_valid(&lw)) return;
1029 1029
1030 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image)); 1030 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image));
1031 if (options->image.enable_read_ahead) 1031 if (options->image.enable_read_ahead)
1506 } 1506 }
1507 1507
1508 /* Returns the length of an integer */ 1508 /* Returns the length of an integer */
1509 static gint num_length(gint num) 1509 static gint num_length(gint num)
1510 { 1510 {
1511 gint len = 0; 1511 gint len = 0;
1512 if (num < 0) num = -num; 1512 if (num < 0) num = -num;
1513 while (num) 1513 while (num)
1514 { 1514 {
1515 num /= 10; 1515 num /= 10;
1516 len++; 1516 len++;
1517 } 1517 }
1518 return len; 1518 return len;
1519 } 1519 }
1520 1520
1521 void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data) 1521 void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data)
1522 { 1522 {
1523 LayoutWindow *lw = data; 1523 LayoutWindow *lw = data;
1609 return lw->split_images[i]->widget; 1609 return lw->split_images[i]->widget;
1610 } 1610 }
1611 1611
1612 void layout_image_deactivate(LayoutWindow *lw, gint i) 1612 void layout_image_deactivate(LayoutWindow *lw, gint i)
1613 { 1613 {
1614
1615 if (!lw->split_images[i]) return; 1614 if (!lw->split_images[i]) return;
1616 image_set_update_func(lw->split_images[i], NULL, NULL); 1615 image_set_update_func(lw->split_images[i], NULL, NULL);
1617 layout_image_set_buttons_inactive(lw, i); 1616 layout_image_set_buttons_inactive(lw, i);
1618 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw); 1617 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw);
1619 1618