}
}
-static gint fullscreen_hide_mouse_cb(gpointer data)
+static gboolean fullscreen_hide_mouse_cb(gpointer data)
{
FullScreenData *fs = data;
fs->hide_mouse_id = g_timeout_add(FULL_SCREEN_HIDE_MOUSE_DELAY, fullscreen_hide_mouse_cb, fs);
}
-static gint fullscreen_mouse_moved(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
+static gboolean fullscreen_mouse_moved(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
{
FullScreenData *fs = data;
}
}
-static void fullscreen_mouse_set_busy(FullScreenData *fs, gint busy)
+static void fullscreen_mouse_set_busy(FullScreenData *fs, gboolean busy)
{
fullscreen_busy_mouse_disable(fs);
- if ((fs->cursor_state & FULLSCREEN_CURSOR_BUSY) == (busy)) return;
+ if (!!(fs->cursor_state & FULLSCREEN_CURSOR_BUSY) == (busy)) return;
if (busy)
{
}
}
-static void fullscreen_image_complete_cb(ImageWindow *imd, gint preload, gpointer data)
+static void fullscreen_image_complete_cb(ImageWindow *imd, gboolean preload, gpointer data)
{
FullScreenData *fs = data;
return TRUE;
}
-static gint fullscreen_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
+static gboolean fullscreen_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
{
FullScreenData *fs = data;
{
FullScreenData *fs;
GdkScreen *screen;
- gint same;
+ gboolean same;
gint x, y;
gint w, h;
GdkGeometry geometry;
* same_region: the returned region will overlap the current location of widget.
*/
void fullscreen_prefs_get_geometry(gint screen, GtkWidget *widget, gint *x, gint *y, gint *width, gint *height,
- GdkScreen **dest_screen, gint *same_region)
+ GdkScreen **dest_screen, gboolean *same_region)
{
GList *list;
ScreenData *sd;
FS_MENU_COLUMN_VALUE, value, -1);
}
-GtkWidget *fullscreen_prefs_selection_new(const gchar *text, gint *screen_value, gint *above_value)
+GtkWidget *fullscreen_prefs_selection_new(const gchar *text, gint *screen_value, gboolean *above_value)
{
GtkWidget *vbox;
GtkWidget *hbox;
ScreenData *fullscreen_prefs_list_find(GList *list, gint screen);
void fullscreen_prefs_get_geometry(gint screen, GtkWidget *widget, gint *x, gint *y, gint *width, gint *height,
- GdkScreen **dest_screen, gint *same_region);
+ GdkScreen **dest_screen, gboolean *same_region);
gint fullscreen_prefs_find_screen_for_widget(GtkWidget *widget);
-GtkWidget *fullscreen_prefs_selection_new(const gchar *text, gint *screen_value, gint *above_value);
+GtkWidget *fullscreen_prefs_selection_new(const gchar *text, gint *screen_value, gboolean *above_value);
#endif
}
}
-gint histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height)
+gboolean histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height)
{
/* FIXME: use the coordinates correctly */
gint i;
gint combine = (HISTMAP_SIZE - 1) / width + 1;
gint ypos = y + height;
- if (!histogram || !histmap) return 0;
+ if (!histogram || !histmap) return FALSE;
/* Draw the grid */
histogram_vgrid(histogram, pixbuf, x, y, width, height);
gint histogram_toggle_mode(Histogram *histogram);
const gchar *histogram_label(Histogram *histogram);
const HistMap *histmap_get(FileData *fd);
-gint histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height);
+gboolean histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height);
void histogram_notify_cb(FileData *fd, NotifyType type, gpointer data);
return NULL;
}
-gint history_list_load(const gchar *path)
+gboolean history_list_load(const gchar *path)
{
FILE *f;
gchar *key = NULL;
return TRUE;
}
-gint history_list_save(const gchar *path)
+gboolean history_list_save(const gchar *path)
{
SecureSaveInfo *ssi;
GList *list;
/* history lists */
-gint history_list_load(const gchar *path);
-gint history_list_save(const gchar *path);
+gboolean history_list_load(const gchar *path);
+gboolean history_list_save(const gchar *path);
void history_list_free_key(const gchar *key);
image_update_util(imd);
}
-static void image_complete_util(ImageWindow *imd, gint preload)
+static void image_complete_util(ImageWindow *imd, gboolean preload)
{
if (imd->il && image_get_pixbuf(imd) != image_loader_get_pixbuf(imd->il)) return;
*-------------------------------------------------------------------
*/
-static gint image_post_process_color(ImageWindow *imd, gint start_row, gint run_in_bg)
+static gboolean image_post_process_color(ImageWindow *imd, gint start_row, gboolean run_in_bg)
{
ColorMan *cm;
ColorManProfileType input_type;
/* this read ahead is located here merely for the callbacks, above */
-static gint image_read_ahead_check(ImageWindow *imd)
+static gboolean image_read_ahead_check(ImageWindow *imd)
{
if (!imd->read_ahead_fd) return FALSE;
if (imd->il) return FALSE;
return FALSE;
}
-static gint image_load_begin(ImageWindow *imd, FileData *fd)
+static gboolean image_load_begin(ImageWindow *imd, FileData *fd)
{
DEBUG_1("%s image begin", get_exec_time());
*-------------------------------------------------------------------
*/
-static void image_change_complete(ImageWindow *imd, gdouble zoom, gint new)
+static void image_change_complete(ImageWindow *imd, gdouble zoom)
{
image_reset(imd);
imd->unknown = TRUE;
imd->image_fd = file_data_ref(fd);
- image_change_complete(imd, zoom, TRUE);
+ image_change_complete(imd, zoom);
image_update_title(imd);
image_state_set(imd, IMAGE_STATE_IMAGE);
*-------------------------------------------------------------------
*/
-static void image_focus_paint(ImageWindow *imd, gint has_focus, GdkRectangle *area)
+static void image_focus_paint(ImageWindow *imd, gboolean has_focus, GdkRectangle *area)
{
GtkWidget *widget;
}
}
-static gint image_focus_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+static gboolean image_focus_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
ImageWindow *imd = data;
return TRUE;
}
-static gint image_focus_in_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data)
+static gboolean image_focus_in_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
ImageWindow *imd = data;
return TRUE;
}
-static gint image_focus_out_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data)
+static gboolean image_focus_out_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
ImageWindow *imd = data;
return TRUE;
}
-static gint image_scroll_cb(GtkWidget *widget, GdkEventScroll *event, gpointer data)
+static gboolean image_scroll_cb(GtkWidget *widget, GdkEventScroll *event, gpointer data)
{
ImageWindow *imd = data;
*/
void image_attach_window(ImageWindow *imd, GtkWidget *window,
- const gchar *title, const gchar *title_right, gint show_zoom)
+ const gchar *title, const gchar *title_right, gboolean show_zoom)
{
imd->top_window = window;
g_free(imd->title);
}
void image_set_complete_func(ImageWindow *imd,
- void (*func)(ImageWindow *imd, gint preload, gpointer data),
+ void (*func)(ImageWindow *imd, gboolean preload, gpointer data),
gpointer data)
{
imd->func_complete = func;
image_change_real(imd, fd, NULL, NULL, zoom);
}
-gint image_get_image_size(ImageWindow *imd, gint *width, gint *height)
+gboolean image_get_image_size(ImageWindow *imd, gint *width, gint *height)
{
return pixbuf_renderer_get_image_size(PIXBUF_RENDERER(imd->pr), width, height);
}
return pixbuf_renderer_get_pixbuf((PixbufRenderer *)imd->pr);
}
-void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gint lazy)
+void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy)
{
{
if (pixbuf_renderer_get_tiles((PixbufRenderer *)imd->pr)) return;
- image_change_complete(imd, image_zoom_get(imd), FALSE);
+ image_change_complete(imd, image_zoom_get(imd));
}
void image_scroll(ImageWindow *imd, gint x, gint y)
imd->auto_refresh = enable;
}
-void image_top_window_set_sync(ImageWindow *imd, gint allow_sync)
+void image_top_window_set_sync(ImageWindow *imd, gboolean allow_sync)
{
imd->top_window_sync = allow_sync;
void image_color_profile_set(ImageWindow *imd,
gint input_type, gint screen_type,
- gint use_image)
+ gboolean use_image)
{
if (!imd) return;
imd->color_profile_use_image = use_image;
}
-gint image_color_profile_get(ImageWindow *imd,
- gint *input_type, gint *screen_type,
- gint *use_image)
+gboolean image_color_profile_get(ImageWindow *imd,
+ gint *input_type, gint *screen_type,
+ gboolean *use_image)
{
if (!imd) return FALSE;
return TRUE;
}
-void image_color_profile_set_use(ImageWindow *imd, gint enable)
+void image_color_profile_set_use(ImageWindow *imd, gboolean enable)
{
if (!imd) return;
imd->color_profile_enable = enable;
}
-gint image_color_profile_get_use(ImageWindow *imd)
+gboolean image_color_profile_get_use(ImageWindow *imd)
{
if (!imd) return FALSE;
gint image_color_profile_get_from_image(ImageWindow *imd)
{
- if (!imd) return FALSE;
+ if (!imd) return COLOR_PROFILE_NONE;
return imd->color_profile_from_image;
}
-void image_set_delay_flip(ImageWindow *imd, gint delay)
+void image_set_delay_flip(ImageWindow *imd, gboolean delay)
{
if (!imd ||
imd->delay_flip == delay) return;
}
}
-void image_to_root_window(ImageWindow *imd, gint scaled)
+void image_to_root_window(ImageWindow *imd, gboolean scaled)
{
GdkScreen *screen;
GdkWindow *rootwindow;
imd->has_frame = frame;
}
-ImageWindow *image_new(gint frame)
+ImageWindow *image_new(gboolean frame)
{
ImageWindow *imd;
void image_set_frame(ImageWindow *imd, gboolean frame);
-ImageWindow *image_new(gint frame);
+ImageWindow *image_new(gboolean frame);
/* additional setup */
void image_attach_window(ImageWindow *imd, GtkWidget *window,
- const gchar *title, const gchar *title_right, gint show_zoom);
+ const gchar *title, const gchar *title_right, gboolean show_zoom);
void image_set_update_func(ImageWindow *imd,
void (*func)(ImageWindow *imd, gpointer data),
gpointer data);
/* load a new image */
void image_change_fd(ImageWindow *imd, FileData *fd, gdouble zoom);
-void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gint lazy);
+void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy);
void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom);
CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info);
void image_change_from_image(ImageWindow *imd, ImageWindow *source);
-gint image_get_image_size(ImageWindow *imd, gint *width, gint *height);
+gboolean image_get_image_size(ImageWindow *imd, gint *width, gint *height);
GdkPixbuf *image_get_pixbuf(ImageWindow *imd);
/* manipulation */
void image_auto_refresh_enable(ImageWindow *imd, gboolean enable);
/* allow top window to be resized ? */
-void image_top_window_set_sync(ImageWindow *imd, gint allow_sync);
+void image_top_window_set_sync(ImageWindow *imd, gboolean allow_sync);
/* background of image */
void image_background_set_color(ImageWindow *imd, GdkColor *color);
/* color profiles */
void image_color_profile_set(ImageWindow *imd,
gint input_type, gint screen_type,
- gint use_embedded);
-gint image_color_profile_get(ImageWindow *imd,
+ gboolean use_image);
+gboolean image_color_profile_get(ImageWindow *imd,
gint *input_type, gint *screen_type,
- gint *use_image);
-void image_color_profile_set_use(ImageWindow *imd, gint enable);
-gint image_color_profile_get_use(ImageWindow *imd);
+ gboolean *use_image);
+void image_color_profile_set_use(ImageWindow *imd, gboolean enable);
+gboolean image_color_profile_get_use(ImageWindow *imd);
gint image_color_profile_get_from_image(ImageWindow *imd);
/* set delayed page flipping */
void image_set_delay_flip(ImageWindow *imd, gint delay);
/* wallpaper util */
-void image_to_root_window(ImageWindow *imd, gint scaled);
+void image_to_root_window(ImageWindow *imd, gboolean scaled);
static void layout_color_menu_use_image_cb(GtkWidget *widget, gpointer data)
{
LayoutWindow *lw = data;
- gint input, screen, use_image;
+ gint input, screen;
+ gboolean use_image;
if (!layout_image_color_profile_get(lw, &input, &screen, &use_image)) return;
layout_image_color_profile_set(lw, input, screen, !use_image);
{
LayoutWindow *lw = data;
gint type;
- gint input, screen, use_image;
+ gint input, screen;
+ gboolean use_image;
if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return;
{
LayoutWindow *lw = data;
gint type;
- gint input, screen, use_image;
+ gint input, screen;
+ gboolean use_image;
if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return;
gboolean active;
gint input = 0;
gint screen = 0;
- gint use_image = 0;
- gboolean from_image = FALSE;
+ gboolean use_image = FALSE;
+ gboolean from_image;
gint image_profile;
gint i;
#include "layout_image.h"
#include "collect.h"
+#include "color-man.h"
#include "dnd.h"
#include "editors.h"
#include "filedata.h"
void layout_image_color_profile_set(LayoutWindow *lw,
gint input_type, gint screen_type,
- gint use_image)
+ gboolean use_image)
{
if (!layout_valid(&lw)) return;
image_color_profile_set(lw->image, input_type, screen_type, use_image);
}
-gint layout_image_color_profile_get(LayoutWindow *lw,
- gint *input_type, gint *screen_type,
- gint *use_image)
+gboolean layout_image_color_profile_get(LayoutWindow *lw,
+ gint *input_type, gint *screen_type,
+ gboolean *use_image)
{
if (!layout_valid(&lw)) return FALSE;
return image_color_profile_get(lw->image, input_type, screen_type, use_image);
}
-void layout_image_color_profile_set_use(LayoutWindow *lw, gint enable)
+void layout_image_color_profile_set_use(LayoutWindow *lw, gboolean enable)
{
if (!layout_valid(&lw)) return;
}
}
-gint layout_image_color_profile_get_use(LayoutWindow *lw)
+gboolean layout_image_color_profile_get_use(LayoutWindow *lw)
{
if (!layout_valid(&lw)) return FALSE;
gint layout_image_color_profile_get_from_image(LayoutWindow *lw)
{
- if (!layout_valid(&lw)) return FALSE;
+ if (!layout_valid(&lw)) return COLOR_PROFILE_NONE;
return image_color_profile_get_from_image(lw->image);
}
void layout_image_color_profile_set(LayoutWindow *lw,
gint input_type, gint screen_type,
- gint use_image);
-gint layout_image_color_profile_get(LayoutWindow *lw,
+ gboolean use_image);
+gboolean layout_image_color_profile_get(LayoutWindow *lw,
gint *input_type, gint *screen_type,
- gint *use_image);
+ gboolean *use_image);
void layout_image_color_profile_set_use(LayoutWindow *lw, gint enable);
-gint layout_image_color_profile_get_use(LayoutWindow *lw);
+gboolean layout_image_color_profile_get_use(LayoutWindow *lw);
gint layout_image_color_profile_get_from_image(LayoutWindow *lw);
return TRUE;
}
-gint pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *height)
+gboolean pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *height)
{
g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
g_return_val_if_fail(width != NULL && height != NULL, FALSE);
/* sizes */
-gint pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *height);
+gboolean pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *height);
gint pixbuf_renderer_get_scaled_size(PixbufRenderer *pr, gint *width, gint *height);
/* region of image in pixel coordinates */
FileData *image_fd;
- gint unknown; /* failed to load image */
+ gboolean unknown; /* failed to load image */
ImageLoader *il; /* FIXME - image loader should probably go to FileData, but it must first support
sending callbacks to multiple ImageWindows in parallel */
- gint has_frame;
+ gint has_frame; /* not boolean, see image_new() */
/* top level (not necessarily parent) window */
- gint top_window_sync; /* resize top_window when image dimensions change */
+ gboolean top_window_sync; /* resize top_window when image dimensions change */
GtkWidget *top_window; /* window that gets title, and window to resize when 'fitting' */
gchar *title; /* window title to display left of file name */
gchar *title_right; /* window title to display right of file name */
- gint title_show_zoom; /* option to include zoom in window title */
+ gboolean title_show_zoom; /* option to include zoom in window title */
- gint completed;
+ gboolean completed;
ImageState state; /* mask of IMAGE_STATE_* flags about current image */
void (*func_update)(ImageWindow *imd, gpointer data);
CollectInfo *collection_info;
/* color profiles */
- gint color_profile_enable;
+ gboolean color_profile_enable;
gint color_profile_input;
gint color_profile_screen;
- gint color_profile_use_image;
+ gboolean color_profile_use_image;
gint color_profile_from_image;
gpointer cm;
gint prev_color_row;
- gint auto_refresh;
+ gboolean auto_refresh;
- gint delay_flip;
+ gboolean delay_flip;
gint orientation;
- gint desaturate;
+ gboolean desaturate;
- gint overlay_show_zoom; /* set to true if overlay is showing zoom ratio */
+ gboolean overlay_show_zoom; /* set to true if overlay is showing zoom ratio */
};
#define FILEDATA_MARKS_SIZE 6