Mercurial > geeqie
changeset 857:7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
author | zas_ |
---|---|
date | Thu, 26 Jun 2008 12:23:48 +0000 |
parents | ff15a32ad17f |
children | 171dd6e53656 |
files | src/image-overlay.c src/pixbuf-renderer.c src/pixbuf-renderer.h |
diffstat | 3 files changed, 20 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/image-overlay.c Thu Jun 26 11:48:40 2008 +0000 +++ b/src/image-overlay.c Thu Jun 26 12:23:48 2008 +0000 @@ -698,9 +698,9 @@ } static gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y, - gint relative, gint always) + OverlayRendererFlags flags) { - return pixbuf_renderer_overlay_add((PixbufRenderer *)imd->pr, pixbuf, x, y, relative, always); + return pixbuf_renderer_overlay_add((PixbufRenderer *)imd->pr, pixbuf, x, y, flags); } static void image_overlay_set(ImageWindow *imd, gint id, GdkPixbuf *pixbuf, gint x, gint y) @@ -731,7 +731,7 @@ osd->icon_id[flag] = image_overlay_add(osd->imd, pixbuf, osd_icons[flag].x, osd_icons[flag].y, - TRUE, FALSE); + OVL_RELATIVE); } static void image_osd_icon_hide(OverlayStateData *osd, ImageOSDFlag flag) @@ -761,7 +761,7 @@ if (osd->ovl_info == 0) { osd->ovl_info = image_overlay_add(osd->imd, pixbuf, - osd->x, osd->y, TRUE, FALSE); + osd->x, osd->y, OVL_RELATIVE); } else {
--- a/src/pixbuf-renderer.c Thu Jun 26 11:48:40 2008 +0000 +++ b/src/pixbuf-renderer.c Thu Jun 26 12:23:48 2008 +0000 @@ -141,9 +141,8 @@ gint x; gint y; - gint relative; /* x,y coordinates are relative, negative values start bottom right */ - - gint always; /* hide temporarily when scrolling (not yet implemented) */ + + OverlayRendererFlags flags; }; enum { @@ -830,7 +829,7 @@ px = od->x; py = od->y; - if (od->relative) + if (od->flags & OVL_RELATIVE) { if (px < 0) px = pr->window_width - pw + px; if (py < 0) py = pr->window_height - ph + py; @@ -954,8 +953,10 @@ { OverlayData *od = work->data; work = work->next; - - if (od->relative && od->window) + + if (!od->window) continue; + + if (od->flags & OVL_RELATIVE) { gint x, y, w, h; @@ -982,7 +983,7 @@ } gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y, - gint relative, gint always) + OverlayRendererFlags flags) { OverlayData *od; gint id; @@ -1002,8 +1003,7 @@ g_object_ref(G_OBJECT(od->pixbuf)); od->x = x; od->y = y; - od->relative = relative; - od->always = always; + od->flags = flags; pr_overlay_get_position(pr, od, &px, &py, &pw, &ph); @@ -1229,7 +1229,7 @@ w = gdk_pixbuf_get_width(pixbuf); h = gdk_pixbuf_get_height(pixbuf); - pr->scroller_overlay = pixbuf_renderer_overlay_add(pr, pixbuf, x - w / 2, y - h / 2, FALSE, TRUE); + pr->scroller_overlay = pixbuf_renderer_overlay_add(pr, pixbuf, x - w / 2, y - h / 2, OVL_NORMAL); g_object_unref(pixbuf); }
--- a/src/pixbuf-renderer.h Thu Jun 26 11:48:40 2008 +0000 +++ b/src/pixbuf-renderer.h Thu Jun 26 12:23:48 2008 +0000 @@ -238,9 +238,14 @@ void pixbuf_renderer_set_color(PixbufRenderer *pr, GdkColor *color); /* overlay */ +typedef enum { + OVL_NORMAL = 0, + OVL_RELATIVE = 1 << 0, /* x,y coordinates are relative, negative values start bottom right */ + /* OVL_HIDE_ON_SCROLL = 1 << 1*/ /* hide temporarily when scrolling (not yet implemented) */ +} OverlayRendererFlags; gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y, - gint relative, gint always); + OverlayRendererFlags flags); void pixbuf_renderer_overlay_set(PixbufRenderer *pr, gint id, GdkPixbuf *pixbuf, gint x, gint y); gint pixbuf_renderer_overlay_get(PixbufRenderer *pr, gint id, GdkPixbuf **pixbuf, gint *x, gint *y); void pixbuf_renderer_overlay_remove(PixbufRenderer *pr, gint id);