Use gboolean where applicable, minor cleanup and indentations fixes.
authorLaurent Monin <geeqie@norz.org>
Sat, 14 Mar 2009 19:25:21 +0000 (19:25 +0000)
committerLaurent Monin <geeqie@norz.org>
Sat, 14 Mar 2009 19:25:21 +0000 (19:25 +0000)
13 files changed:
src/image-load.c
src/image-load.h
src/image-overlay.c
src/img-view.c
src/img-view.h
src/layout.c
src/layout_image.c
src/layout_image.h
src/layout_util.c
src/layout_util.h
src/slideshow.c
src/slideshow.h
src/typedefs.h

index 8743876..c81c0aa 100644 (file)
@@ -220,7 +220,7 @@ struct _ImageLoaderAreaParam {
 };
 
 
-static gint image_loader_emit_area_ready_cb(gpointer data)
+static gboolean image_loader_emit_area_ready_cb(gpointer data)
 {
        ImageLoaderAreaParam *par = data;
        ImageLoader *il = par->il;
@@ -233,21 +233,21 @@ static gint image_loader_emit_area_ready_cb(gpointer data)
        return FALSE;
 }
 
-static gint image_loader_emit_done_cb(gpointer data)
+static gboolean image_loader_emit_done_cb(gpointer data)
 {
        ImageLoader *il = data;
        g_signal_emit(il, signals[SIGNAL_DONE], 0);
        return FALSE;
 }
 
-static gint image_loader_emit_error_cb(gpointer data)
+static gboolean image_loader_emit_error_cb(gpointer data)
 {
        ImageLoader *il = data;
        g_signal_emit(il, signals[SIGNAL_ERROR], 0);
        return FALSE;
 }
 
-static gint image_loader_emit_percent_cb(gpointer data)
+static gboolean image_loader_emit_percent_cb(gpointer data)
 {
        ImageLoader *il = data;
        g_signal_emit(il, signals[SIGNAL_PERCENT], 0, image_loader_get_percent(il));
@@ -306,9 +306,9 @@ static void image_loader_queue_delayed_erea_ready(ImageLoader *il, guint x, guin
 
 
 
-static gint image_loader_get_stopping(ImageLoader *il)
+static gboolean image_loader_get_stopping(ImageLoader *il)
 {
-       gint ret;
+       gboolean ret;
        if (!il) return FALSE;
 
        g_mutex_lock(il->data_mutex);
@@ -402,7 +402,7 @@ static void image_loader_size_cb(GdkPixbufLoader *loader,
        ImageLoader *il = data;
        GdkPixbufFormat *format;
        gchar **mime_types;
-       gint scale = FALSE;
+       gboolean scale = FALSE;
        gint n;
 
        g_mutex_lock(il->data_mutex);
@@ -501,7 +501,7 @@ static void image_loader_error(ImageLoader *il)
        image_loader_emit_error(il);
 }
 
-static gint image_loader_continue(ImageLoader *il)
+static gboolean image_loader_continue(ImageLoader *il)
 {
        gint b;
        gint c;
@@ -538,9 +538,9 @@ static gint image_loader_continue(ImageLoader *il)
        return TRUE;
 }
 
-static gint image_loader_begin(ImageLoader *il)
+static gboolean image_loader_begin(ImageLoader *il)
 {
-       gint b;
+       gssize b;
        
        if (il->pixbuf) return FALSE;
 
@@ -594,7 +594,7 @@ static gint image_loader_begin(ImageLoader *il)
 /* the following functions are always executed in the main thread */
 
 
-static gint image_loader_setup_source(ImageLoader *il)
+static gboolean image_loader_setup_source(ImageLoader *il)
 {
        struct stat st;
        gchar *pathl;
@@ -696,7 +696,7 @@ static void image_loader_stop(ImageLoader *il)
        
 }
 
-void image_loader_delay_area_ready(ImageLoader *il, gint enable)
+void image_loader_delay_area_ready(ImageLoader *il, gboolean enable)
 {
        g_mutex_lock(il->data_mutex);
        il->delay_area_ready = enable;
@@ -731,25 +731,29 @@ void image_loader_delay_area_ready(ImageLoader *il, gint enable)
 /**************************************************************************************/
 /* execution via idle calls */
 
-static gint image_loader_idle_cb(gpointer data)
+static gboolean image_loader_idle_cb(gpointer data)
 {
-       gint ret = FALSE;
+       gboolean ret = FALSE;
        ImageLoader *il = data;
+
        if (il->idle_id != -1)
                {
                ret = image_loader_continue(il);
                }
+       
        if (!ret)
                {
                image_loader_stop_source(il);
                }
+       
        return ret;
 }
 
 
-gint image_loader_start_idle(ImageLoader *il)
+static gboolean image_loader_start_idle(ImageLoader *il)
 {
-       gint ret;
+       gboolean ret;
+       
        if (!il) return FALSE;
 
        if (!il->fd) return FALSE;
@@ -798,10 +802,10 @@ static void image_loader_thread_wait_high(void)
 }
 
 
-void image_loader_thread_run(gpointer data, gpointer user_data)
+static void image_loader_thread_run(gpointer data, gpointer user_data)
 {
        ImageLoader *il = data;
-       gint cont;
+       gboolean cont;
        
        if (il->idle_priority > G_PRIORITY_DEFAULT_IDLE) 
                {
@@ -851,7 +855,7 @@ void image_loader_thread_run(gpointer data, gpointer user_data)
 }
 
 
-gint image_loader_start_thread(ImageLoader *il)
+static gboolean image_loader_start_thread(ImageLoader *il)
 {
        if (!il) return FALSE;
 
@@ -881,7 +885,7 @@ gint image_loader_start_thread(ImageLoader *il)
 /* public interface */
 
 
-gint image_loader_start(ImageLoader *il)
+gboolean image_loader_start(ImageLoader *il)
 {
        if (!il) return FALSE;
 
@@ -974,9 +978,9 @@ gdouble image_loader_get_percent(ImageLoader *il)
        return ret;
 }
 
-gint image_loader_get_is_done(ImageLoader *il)
+gboolean image_loader_get_is_done(ImageLoader *il)
 {
-       gint ret;
+       gboolean ret;
        if (!il) return FALSE;
 
        g_mutex_lock(il->data_mutex);
@@ -998,9 +1002,9 @@ FileData *image_loader_get_fd(ImageLoader *il)
        return ret;
 }
 
-gint image_loader_get_shrunk(ImageLoader *il)
+gboolean image_loader_get_shrunk(ImageLoader *il)
 {
-       gint ret;
+       gboolean ret;
        if (!il) return FALSE;
 
        g_mutex_lock(il->data_mutex);
@@ -1011,10 +1015,10 @@ gint image_loader_get_shrunk(ImageLoader *il)
 
 
 /* FIXME - this can be rather slow and blocks until the size is known */
-gint image_load_dimensions(FileData *fd, gint *width, gint *height)
+gboolean image_load_dimensions(FileData *fd, gint *width, gint *height)
 {
        ImageLoader *il;
-       gint success;
+       gboolean success;
 
        il = image_loader_new(fd);
 
index 1e55d68..b5a6e8a 100644 (file)
@@ -31,13 +31,13 @@ struct _ImageLoader
        gsize bytes_read;
        gsize bytes_total;
 
-       gint preview;
+       gboolean preview;
 
        gint requested_width;
        gint requested_height;
-       gint shrunk;
+       gboolean shrunk;
 
-       gint done;
+       gboolean done;
        gint idle_id;
        gint idle_priority;
 
@@ -47,11 +47,11 @@ struct _ImageLoader
        GList *area_param_list;
        GList *area_param_delayed_list;
        
-       gint delay_area_ready;
+       gboolean delay_area_ready;
        
        GMutex *data_mutex;
-       gint stopping;
-       gint can_destroy;
+       gboolean stopping;
+       gboolean can_destroy;
        GCond *can_destroy_cond;
        gboolean thread;
 
@@ -77,7 +77,7 @@ ImageLoader *image_loader_new(FileData *fd);
 void image_loader_free(ImageLoader *il);
 
 /* delay area_ready signals */
-void image_loader_delay_area_ready(ImageLoader *il, gint enable);
+void image_loader_delay_area_ready(ImageLoader *il, gboolean enable);
 
 /* Speed up loading when you only need at most width x height size image,
  * only the jpeg GdkPixbuf loader benefits from it - so there is no
@@ -92,17 +92,17 @@ void image_loader_set_buffer_size(ImageLoader *il, guint size);
  */
 void image_loader_set_priority(ImageLoader *il, gint priority);
 
-gint image_loader_start(ImageLoader *il);
+gboolean image_loader_start(ImageLoader *il);
 
 
 GdkPixbuf *image_loader_get_pixbuf(ImageLoader *il);
 gchar *image_loader_get_format(ImageLoader *il);
 gdouble image_loader_get_percent(ImageLoader *il);
-gint image_loader_get_is_done(ImageLoader *il);
+gboolean image_loader_get_is_done(ImageLoader *il);
 FileData *image_loader_get_fd(ImageLoader *il);
-gint image_loader_get_shrunk(ImageLoader *il);
+gboolean image_loader_get_shrunk(ImageLoader *il);
 
-gint image_load_dimensions(FileData *fd, gint *width, gint *height);
+gboolean image_load_dimensions(FileData *fd, gint *width, gint *height);
 
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index af5db8e..929c0fd 100644 (file)
@@ -58,7 +58,7 @@ struct _OverlayStateData {
 
 typedef struct _OSDIcon OSDIcon;
 struct _OSDIcon {
-       gint reset;     /* reset on new image */
+       gboolean reset; /* reset on new image */
        gint x;         /* x, y offset */
        gint y;
        gchar *key;     /* inline pixbuf */
@@ -818,7 +818,7 @@ static void image_osd_info_hide(OverlayStateData *osd)
        osd->ovl_info = 0;
 }
 
-static gint image_osd_update_cb(gpointer data)
+static gboolean image_osd_update_cb(gpointer data)
 {
        OverlayStateData *osd = data;
 
@@ -888,7 +888,7 @@ static gint image_osd_update_cb(gpointer data)
        return FALSE;
 }
 
-static void image_osd_update_schedule(OverlayStateData *osd, gint force)
+static void image_osd_update_schedule(OverlayStateData *osd, gboolean force)
 {
        if (force) osd->changed_states |= IMAGE_STATE_IMAGE;
 
@@ -907,11 +907,11 @@ void image_osd_update(ImageWindow *imd)
        image_osd_update_schedule(osd, TRUE);
 }
 
-static gint image_osd_timer_cb(gpointer data)
+static gboolean image_osd_timer_cb(gpointer data)
 {
        OverlayStateData *osd = data;
-       gint done = TRUE;
-       gint changed = FALSE;
+       gboolean done = TRUE;
+       gboolean changed = FALSE;
        gint i;
 
        for (i = 0; i < IMAGE_OSD_COUNT; i++)
index 540f0f7..bba5f30 100644 (file)
@@ -59,7 +59,7 @@ static GList *view_window_list = NULL;
 
 
 static GtkWidget *view_popup_menu(ViewWindow *vw);
-static void view_fullscreen_toggle(ViewWindow *vw, gint force_off);
+static void view_fullscreen_toggle(ViewWindow *vw, gboolean force_off);
 static void view_overlay_toggle(ViewWindow *vw);
 
 static void view_slideshow_next(ViewWindow *vw);
@@ -96,7 +96,7 @@ static void view_window_set_list(ViewWindow *vw, GList *list)
        vw->list = filelist_copy(list);
 }
 
-static gint view_window_contains_collection(ViewWindow *vw)
+static gboolean view_window_contains_collection(ViewWindow *vw)
 {
        CollectionData *cd;
        CollectInfo *info;
@@ -106,7 +106,7 @@ static gint view_window_contains_collection(ViewWindow *vw)
        return (cd && info);
 }
 
-static void view_collection_step(ViewWindow *vw, gint next)
+static void view_collection_step(ViewWindow *vw, gboolean next)
 {
        ImageWindow *imd = view_window_active_image(vw);
        CollectionData *cd;
@@ -145,7 +145,7 @@ static void view_collection_step(ViewWindow *vw, gint next)
 
 }
 
-static void view_collection_step_to_end(ViewWindow *vw, gint last)
+static void view_collection_step_to_end(ViewWindow *vw, gboolean last)
 {
        ImageWindow *imd = view_window_active_image(vw);
        CollectionData *cd;
@@ -174,7 +174,7 @@ static void view_collection_step_to_end(ViewWindow *vw, gint last)
                }
 }
 
-static void view_list_step(ViewWindow *vw, gint next)
+static void view_list_step(ViewWindow *vw, gboolean next)
 {
        ImageWindow *imd = view_window_active_image(vw);
        FileData *fd;
@@ -192,7 +192,7 @@ static void view_list_step(ViewWindow *vw, gint next)
                }
        else
                {
-               gint found = FALSE;
+               gboolean found = FALSE;
 
                work = vw->list;
                while (work && !found)
@@ -238,7 +238,7 @@ static void view_list_step(ViewWindow *vw, gint next)
                }
 }
 
-static void view_list_step_to_end(ViewWindow *vw, gint last)
+static void view_list_step_to_end(ViewWindow *vw, gboolean last)
 {
        ImageWindow *imd = view_window_active_image(vw);
        FileData *fd;
@@ -301,7 +301,7 @@ static void view_step_prev(ViewWindow *vw)
                }
 }
 
-static void view_step_to_end(ViewWindow *vw, gint last)
+static void view_step_to_end(ViewWindow *vw, gboolean last)
 {
        if (vw->list)
                {
@@ -329,7 +329,7 @@ static void view_window_menu_pos_cb(GtkMenu *menu, gint *x, gint *y, gboolean *p
        popup_menu_position_clamp(menu, x, y, 0);
 }
 
-static gint view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+static gboolean view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
        ViewWindow *vw = data;
        ImageWindow *imd;
@@ -690,7 +690,7 @@ static void view_fullscreen_stop_func(FullScreenData *fs, gpointer data)
        if (vw->ss) vw->ss->imd = vw->imd;
 }
 
-static void view_fullscreen_toggle(ViewWindow *vw, gint force_off)
+static void view_fullscreen_toggle(ViewWindow *vw, gboolean force_off)
 {
        if (force_off && !vw->fs) return;
 
@@ -818,7 +818,7 @@ static void view_window_close(ViewWindow *vw)
        gtk_widget_destroy(vw->window);
 }
 
-static gint view_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data)
+static gboolean view_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data)
 {
        ViewWindow *vw = data;
 
@@ -1007,7 +1007,7 @@ void view_window_colors_update(void)
                }
 }
 
-gint view_window_find_image(ImageWindow *imd, gint *index, gint *total)
+gboolean view_window_find_image(ImageWindow *imd, gint *index, gint *total)
 {
        GList *work;
 
@@ -1354,7 +1354,7 @@ static void view_dir_list_cancel(GtkWidget *widget, gpointer data)
        /* do nothing */
 }
 
-static void view_dir_list_do(ViewWindow *vw, GList *list, gint skip, gint recurse)
+static void view_dir_list_do(ViewWindow *vw, GList *list, gboolean skip, gboolean recurse)
 {
        GList *work;
 
@@ -1561,7 +1561,7 @@ static void view_window_set_dnd_data(GtkWidget *widget, GdkDragContext *context,
                {
                gchar *text = NULL;
                gint len;
-               gint plain_text;
+               gboolean plain_text;
                GList *list;
 
                switch (info)
index c9ba0fe..aa07bcf 100644 (file)
@@ -21,7 +21,7 @@ void view_window_new_from_collection(CollectionData *cd, CollectInfo *info);
 
 void view_window_colors_update(void);
 
-gint view_window_find_image(ImageWindow *imd, gint *index, gint *total);
+gboolean view_window_find_image(ImageWindow *imd, gint *index, gint *total);
 
 
 
index a2fe8d8..ec1350b 100644 (file)
@@ -726,7 +726,7 @@ void layout_status_update_all(LayoutWindow *lw)
        layout_status_update_write(lw);
 }
 
-static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gint start, gint size, gint expand)
+static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gboolean start, gint size, gboolean expand)
 {
        GtkWidget *label;
        GtkWidget *frame;
@@ -751,7 +751,7 @@ static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gint start, g
        return label;
 }
 
-static void layout_status_setup(LayoutWindow *lw, GtkWidget *box, gint small_format)
+static void layout_status_setup(LayoutWindow *lw, GtkWidget *box, gboolean small_format)
 {
        GtkWidget *hbox;
 
@@ -1374,7 +1374,7 @@ static void layout_tools_hide(LayoutWindow *lw, gboolean hide)
        lw->options.tools_hidden = hide;
 }
 
-static gint layout_tools_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
+static gboolean layout_tools_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
 {
        LayoutWindow *lw = data;
 
@@ -1387,7 +1387,7 @@ static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *fi
 {
        GtkWidget *vbox;
        GtkWidget *w1, *w2;
-       gint vertical;
+       gboolean vertical;
        gboolean new_window = FALSE;
 
        vertical = (layout_location_single(lw->image_location) && !layout_location_vertical(lw->image_location)) ||
@@ -2001,7 +2001,7 @@ void layout_free(LayoutWindow *lw)
        g_free(lw);
 }
 
-static gint layout_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
+static gboolean layout_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
 {
        LayoutWindow *lw = data;
 
index 5ac3bce..d9d9015 100644 (file)
@@ -132,7 +132,7 @@ void layout_image_full_screen_toggle(LayoutWindow *lw)
                }
 }
 
-gint layout_image_full_screen_active(LayoutWindow *lw)
+gboolean layout_image_full_screen_active(LayoutWindow *lw)
 {
        if (!layout_valid(&lw)) return FALSE;
 
@@ -229,16 +229,16 @@ void layout_image_slideshow_toggle(LayoutWindow *lw)
                }
 }
 
-gint layout_image_slideshow_active(LayoutWindow *lw)
+gboolean layout_image_slideshow_active(LayoutWindow *lw)
 {
        if (!layout_valid(&lw)) return FALSE;
 
        return (lw->slideshow != NULL);
 }
 
-gint layout_image_slideshow_pause_toggle(LayoutWindow *lw)
+gboolean layout_image_slideshow_pause_toggle(LayoutWindow *lw)
 {
-       gint ret;
+       gboolean ret;
 
        if (!layout_valid(&lw)) return FALSE;
 
@@ -249,14 +249,14 @@ gint layout_image_slideshow_pause_toggle(LayoutWindow *lw)
        return ret;
 }
 
-gint layout_image_slideshow_paused(LayoutWindow *lw)
+gboolean layout_image_slideshow_paused(LayoutWindow *lw)
 {
        if (!layout_valid(&lw)) return FALSE;
 
        return (slideshow_paused(lw->slideshow));
 }
 
-static gint layout_image_slideshow_continue_check(LayoutWindow *lw)
+static gboolean layout_image_slideshow_continue_check(LayoutWindow *lw)
 {
        if (!lw->slideshow) return FALSE;
 
@@ -444,10 +444,10 @@ static void li_set_layout_path_cb(GtkWidget *widget, gpointer data)
        if (fd) layout_set_fd(lw, fd);
 }
 
-static gint li_check_if_current_path(LayoutWindow *lw, const gchar *path)
+static gboolean li_check_if_current_path(LayoutWindow *lw, const gchar *path)
 {
        gchar *dirname;
-       gint ret;
+       gboolean ret;
 
        if (!path || !layout_valid(&lw) || !lw->dir_fd) return FALSE;
 
@@ -482,7 +482,7 @@ static GtkWidget *layout_image_pop_menu(LayoutWindow *lw)
        GtkWidget *item;
        GtkWidget *submenu;
        const gchar *path;
-       gint fullscreen;
+       gboolean fullscreen;
 
        path = layout_image_get_path(lw);
        fullscreen = layout_image_full_screen_active(lw);
@@ -700,7 +700,7 @@ static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *context,
                {
                gchar *text = NULL;
                gint len;
-               gint plain_text;
+               gboolean plain_text;
                GList *list;
 
                switch (info)
@@ -1023,7 +1023,7 @@ void layout_image_set_index(LayoutWindow *lw, gint index)
        layout_image_set_with_ahead(lw, fd, read_ahead_fd);
 }
 
-static void layout_image_set_collection_real(LayoutWindow *lw, CollectionData *cd, CollectInfo *info, gint forward)
+static void layout_image_set_collection_real(LayoutWindow *lw, CollectionData *cd, CollectInfo *info, gboolean forward)
 {
        if (!layout_valid(&lw)) return;
 
@@ -1508,14 +1508,14 @@ static void layout_image_set_buttons_inactive(LayoutWindow *lw, gint i)
 /* Returns the length of an integer */
 static gint num_length(gint num)
 {
-    gint len = 0;
-    if (num < 0) num = -num;
-    while (num)
-       {
-        num /= 10;
-        len++;
-       }
-    return len;
+       gint len = 0;
+       if (num < 0) num = -num;
+       while (num)
+               {
+               num /= 10;
+               len++;
+               }
+       return len;
 }
 
 void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data)
@@ -1611,7 +1611,6 @@ GtkWidget *layout_image_new(LayoutWindow *lw, gint i)
 
 void layout_image_deactivate(LayoutWindow *lw, gint i)
 {
-
        if (!lw->split_images[i]) return;
        image_set_update_func(lw->split_images[i], NULL, NULL);
        layout_image_set_buttons_inactive(lw, i);
index 240ffae..0589871 100644 (file)
@@ -65,15 +65,15 @@ void layout_image_to_root(LayoutWindow *lw);
 void layout_image_full_screen_start(LayoutWindow *lw);
 void layout_image_full_screen_stop(LayoutWindow *lw);
 void layout_image_full_screen_toggle(LayoutWindow *lw);
-gint layout_image_full_screen_active(LayoutWindow *lw);
+gboolean layout_image_full_screen_active(LayoutWindow *lw);
 
 void layout_image_slideshow_start(LayoutWindow *lw);
 void layout_image_slideshow_start_from_list(LayoutWindow *lw, GList *list);
 void layout_image_slideshow_stop(LayoutWindow *lw);
 void layout_image_slideshow_toggle(LayoutWindow *lw);
-gint layout_image_slideshow_active(LayoutWindow *lw);
-gint layout_image_slideshow_pause_toggle(LayoutWindow *lw);
-gint layout_image_slideshow_paused(LayoutWindow *lw);
+gboolean layout_image_slideshow_active(LayoutWindow *lw);
+gboolean layout_image_slideshow_pause_toggle(LayoutWindow *lw);
+gboolean layout_image_slideshow_paused(LayoutWindow *lw);
 
 
 void layout_image_overlay_toggle(LayoutWindow *lw);
index 7b18f0e..02e87ad 100644 (file)
@@ -78,10 +78,10 @@ static gboolean layout_key_match(guint keyval)
        return FALSE;
 }
 
-gint layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+gboolean layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
        LayoutWindow *lw = data;
-       gint stop_signal = FALSE;
+       gboolean stop_signal = FALSE;
        gint x = 0;
        gint y = 0;
 
@@ -1486,7 +1486,8 @@ static gchar *menu_translate(const gchar *path, gpointer data)
        return (gchar *)(_(path));
 }
 
-static void layout_actions_setup_mark(LayoutWindow *lw, gint mark, gchar *name_tmpl, gchar *label_tmpl, gchar *accel_tmpl,  GCallback cb)
+static void layout_actions_setup_mark(LayoutWindow *lw, gint mark, gchar *name_tmpl,
+                                     gchar *label_tmpl, gchar *accel_tmpl, GCallback cb)
 {
        gchar name[50];
        gchar label[100];
@@ -2140,14 +2141,13 @@ static void layout_exif_window_destroy(GtkWidget *widget, gpointer data)
 
 void layout_exif_window_new(LayoutWindow *lw)
 {
-       if (!lw->exif_window) 
-               {
-               lw->exif_window = advanced_exif_new();
-               if (!lw->exif_window) return;
-               g_signal_connect(G_OBJECT(lw->exif_window), "destroy",
-                                G_CALLBACK(layout_exif_window_destroy), lw);
-               advanced_exif_set_fd(lw->exif_window, layout_image_get_fd(lw));
-               }
+       if (lw->exif_window) return; 
+       
+       lw->exif_window = advanced_exif_new();
+       if (!lw->exif_window) return;
+       g_signal_connect(G_OBJECT(lw->exif_window), "destroy",
+                        G_CALLBACK(layout_exif_window_destroy), lw);
+       advanced_exif_set_fd(lw->exif_window, layout_image_get_fd(lw));
 }
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 3b0dbeb..655007e 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "layout.h"
 
-gint layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
+gboolean layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
 
 void layout_util_sync_thumb(LayoutWindow *lw);
 void layout_util_sync(LayoutWindow *lw);
index 5292de0..42a3bca 100644 (file)
@@ -434,21 +434,21 @@ SlideShowData *slideshow_start(ImageWindow *imd, LayoutWindow *lw, gint start_po
        return real_slideshow_start(imd, lw, NULL, start_point, NULL, NULL, stop_func, stop_data);
 }
 
-gint slideshow_paused(SlideShowData *ss)
+gboolean slideshow_paused(SlideShowData *ss)
 {
        if (!ss) return FALSE;
 
        return ss->paused;
 }
 
-void slideshow_pause_set(SlideShowData *ss, gint paused)
+void slideshow_pause_set(SlideShowData *ss, gboolean paused)
 {
        if (!ss) return;
 
        ss->paused = paused;
 }
 
-gint slideshow_pause_toggle(SlideShowData *ss)
+gboolean slideshow_pause_toggle(SlideShowData *ss)
 {
        slideshow_pause_set(ss, !slideshow_paused(ss));
        return slideshow_paused(ss);
index f5c8add..221295d 100644 (file)
@@ -39,9 +39,9 @@ SlideShowData *slideshow_start_from_collection(ImageWindow *imd, CollectionData
 SlideShowData *slideshow_start(ImageWindow *imd, LayoutWindow *lw, gint start_point,
                               void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data);
 
-gint slideshow_paused(SlideShowData *ss);
-void slideshow_pause_set(SlideShowData *ss, gint paused);
-gint slideshow_pause_toggle(SlideShowData *ss);
+gboolean slideshow_paused(SlideShowData *ss);
+void slideshow_pause_set(SlideShowData *ss, gboolean paused);
+gboolean slideshow_pause_toggle(SlideShowData *ss);
 
 
 #endif
index b19ae04..54bf57f 100644 (file)
@@ -798,7 +798,7 @@ struct _SlideShowData
        void (*stop_func)(SlideShowData *, gpointer);
        gpointer stop_data;
 
-       gint paused;
+       gboolean paused;
 };
 
 struct _FullScreenData