Update GitHub actions file (part 2)
[geeqie.git] / src / image.cc
index 6faa00f..6972b2a 100644 (file)
@@ -59,7 +59,7 @@ static gint rect_id = 0;
 
 static void image_click_cb(PixbufRenderer *UNUSED(pr), GdkEventButton *event, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        if (!options->image_lm_click_nav && event->button == MOUSE_BUTTON_MIDDLE)
                {
                imd->mouse_wheel_mode = !imd->mouse_wheel_mode;
@@ -139,7 +139,7 @@ static void switch_coords_orientation(ImageWindow *imd, gint x, gint y, gint wid
 
 static void image_press_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        LayoutWindow *lw;
        gint x_pixel, y_pixel;
 
@@ -185,7 +185,7 @@ static void image_press_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer d
 
 static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        gint width, height;
        gint rect_width;
        gint rect_height;
@@ -254,7 +254,7 @@ static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer da
 
 static void image_scroll_notify_cb(PixbufRenderer *pr, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        if (imd->func_scroll_notify && pr->scale)
                {
@@ -288,7 +288,7 @@ static void image_complete_util(ImageWindow *imd, gboolean preload)
 
 static void image_render_complete_cb(PixbufRenderer *UNUSED(pr), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        image_complete_util(imd, FALSE);
 }
@@ -301,20 +301,20 @@ static void image_state_set(ImageWindow *imd, ImageState state)
                }
        else
                {
-               imd->state |= state;
+               imd->state = static_cast<ImageState>(imd->state | state);
                }
        if (imd->func_state) imd->func_state(imd, state, imd->data_state);
 }
 
 static void image_state_unset(ImageWindow *imd, ImageState state)
 {
-       imd->state &= ~state;
+       imd->state = static_cast<ImageState>(imd->state & ~state);
        if (imd->func_state) imd->func_state(imd, state, imd->data_state);
 }
 
 static void image_zoom_cb(PixbufRenderer *UNUSED(pr), gdouble UNUSED(zoom), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        if (imd->title_show_zoom) image_update_title(imd);
        image_state_set(imd, IMAGE_STATE_IMAGE);
@@ -424,7 +424,7 @@ static gboolean image_post_process_color(ImageWindow *imd, gint start_row, gbool
        else if (imd->color_profile_input >= COLOR_PROFILE_SRGB &&
                 imd->color_profile_input <  COLOR_PROFILE_FILE)
                {
-               input_type = imd->color_profile_input;
+               input_type = static_cast<ColorManProfileType>(imd->color_profile_input);
                input_file = NULL;
                }
        else
@@ -517,7 +517,7 @@ static gboolean image_post_process_color(ImageWindow *imd, gint start_row, gbool
 
                        if (imd->color_profile_use_image && imd->color_profile_from_image != COLOR_PROFILE_NONE)
                                {
-                               input_type = imd->color_profile_from_image;
+                               input_type = static_cast<ColorManProfileType>(imd->color_profile_from_image);
                                input_file = NULL;
                                }
                        }
@@ -566,7 +566,7 @@ static gboolean image_post_process_color(ImageWindow *imd, gint start_row, gbool
 static void image_post_process_tile_color_cb(PixbufRenderer *UNUSED(pr), GdkPixbuf **pixbuf, gint x, gint y, gint w, gint h, gpointer data)
 {
        ImageWindow *imd = (ImageWindow *)data;
-       if (imd->cm) color_man_correct_region(imd->cm, *pixbuf, x, y, w, h);
+       if (imd->cm) color_man_correct_region(static_cast<ColorMan *>(imd->cm), *pixbuf, x, y, w, h);
        if (imd->desaturate) pixbuf_desaturate_rect(*pixbuf, x, y, w, h);
        if (imd->overunderexposed) pixbuf_highlight_overunderexposed(*pixbuf, x, y, w, h);
 }
@@ -731,7 +731,7 @@ static void image_read_ahead_cancel(ImageWindow *imd)
 
 static void image_read_ahead_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        if (!imd->read_ahead_fd || !imd->read_ahead_il) return;
 
@@ -853,7 +853,7 @@ static void image_load_pixbuf_ready(ImageWindow *imd)
 
 static void image_load_area_cb(ImageLoader *il, guint x, guint y, guint w, guint h, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        PixbufRenderer *pr;
 
        pr = (PixbufRenderer *)imd->pr;
@@ -871,13 +871,13 @@ static void image_load_area_cb(ImageLoader *il, guint x, guint y, guint w, guint
 
 static void image_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        DEBUG_1("%s image done", get_exec_time());
 
        if (options->image.enable_read_ahead && imd->image_fd && !imd->image_fd->pixbuf && image_loader_get_pixbuf(imd->il))
                {
-               imd->image_fd->pixbuf = g_object_ref(image_loader_get_pixbuf(imd->il));
+               imd->image_fd->pixbuf = (GdkPixbuf*)g_object_ref(image_loader_get_pixbuf(imd->il));
                image_cache_set(imd, imd->image_fd);
                }
        /* call the callback triggered by image_state after fd->pixbuf is set */
@@ -934,7 +934,7 @@ static void image_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
 
 static void image_load_size_cb(ImageLoader *UNUSED(il), guint width, guint height, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        DEBUG_1("image_load_size_cb: %dx%d", width, height);
        pixbuf_renderer_set_size_early((PixbufRenderer *)imd->pr, width, height);
@@ -1105,6 +1105,10 @@ static void image_change_complete(ImageWindow *imd, gdouble zoom)
        image_reset(imd);
        imd->unknown = TRUE;
 
+       /** @FIXME Might be improved when the wepb animation changes happen */
+       g_object_set(G_OBJECT(imd->pr), "zoom_2pass", options->image.zoom_2pass, NULL);
+       g_object_set(G_OBJECT(imd->pr), "zoom_quality", options->image.zoom_quality, NULL);
+
        if (!imd->image_fd)
                {
                image_change_pixbuf(imd, NULL, zoom, FALSE);
@@ -1178,7 +1182,7 @@ static void image_change_real(ImageWindow *imd, FileData *fd,
 
 static gboolean image_focus_in_cb(GtkWidget *UNUSED(widget), GdkEventFocus *UNUSED(event), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        if (imd->func_focus_in)
                {
@@ -1190,7 +1194,7 @@ static gboolean image_focus_in_cb(GtkWidget *UNUSED(widget), GdkEventFocus *UNUS
 
 static gboolean image_scroll_cb(GtkWidget *UNUSED(widget), GdkEventScroll *event, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        gboolean in_lw = FALSE;
        gint i = 0;
        LayoutWindow *lw = NULL;
@@ -1416,17 +1420,17 @@ void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboo
 
        if (pixbuf)
                {
-               stereo_data = imd->user_stereo;
+               stereo_data = static_cast<StereoPixbufData>(imd->user_stereo);
                if (stereo_data == STEREO_PIXBUF_DEFAULT)
                        {
-                       stereo_data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pixbuf), "stereo_data"));
+                       stereo_data = static_cast<StereoPixbufData>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pixbuf), "stereo_data")));
                        }
                }
 
        pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, NULL, NULL, FALSE);
        if (imd->cm)
                {
-               color_man_free(imd->cm);
+               color_man_free(static_cast<ColorMan *>(imd->cm));
                imd->cm = NULL;
                }
 
@@ -1744,7 +1748,7 @@ gchar *image_zoom_get_as_text(ImageWindow *imd)
        gdouble r = 1.0;
        gint pl = 0;
        gint pr = 0;
-       gchar *approx = " ";
+       const gchar *approx = " ";
 
        zoom = image_zoom_get(imd);
        scale = image_zoom_get_real(imd);
@@ -1816,7 +1820,7 @@ void image_stereo_set(ImageWindow *imd, gint stereo_mode)
 
 StereoPixbufData image_stereo_pixbuf_get(ImageWindow *imd)
 {
-       return imd->user_stereo;
+       return static_cast<StereoPixbufData>(imd->user_stereo);
 }
 
 void image_stereo_pixbuf_set(ImageWindow *imd, StereoPixbufData stereo_mode)
@@ -1846,7 +1850,7 @@ void image_prebuffer_set(ImageWindow *imd, FileData *fd)
 
 static void image_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
 
        if (!imd || !image_get_pixbuf(imd) ||
            /* imd->il || */ /* loading in progress - do not check - it should start from the beginning anyway */
@@ -1967,7 +1971,7 @@ gboolean image_color_profile_get_status(ImageWindow *imd, gchar **image_profile,
        ColorMan *cm;
        if (!imd) return FALSE;
 
-       cm = imd->cm;
+       cm = static_cast<ColorMan *>(imd->cm);
        if (!cm) return FALSE;
        return color_man_get_status(cm, image_profile, screen_profile);
 
@@ -2072,7 +2076,7 @@ void image_options_sync(void)
                {
                ImageWindow *imd;
 
-               imd = work->data;
+               imd = static_cast<ImageWindow *>(work->data);
                work = work->next;
 
                image_options_set(imd);
@@ -2106,7 +2110,7 @@ static void image_free(ImageWindow *imd)
 
 static void image_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
 {
-       ImageWindow *imd = data;
+       ImageWindow *imd = static_cast<ImageWindow *>(data);
        image_free(imd);
 }