Diplay pixel coordinates, and rgb-data / pixel coordinates for editor
Ruben Stein <[email protected]> Sun, 01 Mar 2009 00:38:28 +0100
| Newsgroups | gmane.comp.gnome.apps.gqview.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format.
--=_1g7717l90934
Content-Type: text/plain;
charset=ISO-8859-1;
DelSp="Yes";
format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
I missed a feature in gqview, so I implemented it today. It is an
optional status-bar add-on showing the pixel-coordinates of the mouse
and the rgb-values of this pixel. I also added %x and %y as
editor-macros working together with %p to use the pixel values for a
call to a script. Furthermore I added a checkbox in the view-menu to
turn off the feature as it may be disturbing to see the permanently
changing values if you do not need them.
Referring to former feature requests I think maybe someone might want
to use it:
https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1145036&group_=
id=3D4050&atid=3D354050
https://sourceforge.net/mailarchive/message.php?msg_name=3D40F9E2BE.9080606%=
40techspecs.com
It was my first try adding _senseful_ ;) features to an open source
project, so any advices are appreciated. Unfortunately I did not
recogise that gqview is outdated, so I learned my first lesson. Anyway
... the attached patch applies to GQView 2.1.5 src-dir, diffed against
the svn-tag in the geeqie-repository of that version.
Greetings, Ruben
--=_1g7717l90934
Content-Type: text/x-diff;
charset=UTF-8;
name="pixelbar.diff"
Content-Disposition: attachment;
filename="pixelbar.diff"
Content-Transfer-Encoding: quoted-printable
Index: editors.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- editors.c=09(Revision 1441)
+++ editors.c=09(Arbeitskopie)
@@ -13,6 +13,7 @@
#include "gqview.h"
#include "editors.h"
=20
+#include "pixbuf-renderer.h"
#include "utilops.h"
#include "ui_fileops.h"
#include "ui_spinner.h"
@@ -348,6 +349,48 @@
=09return pathl;
}
=20
+static void editor_replace_mouse_coordinates(GString *result, const gchar *=
path)
+{
+=09gchar *found;
+=09const gchar *ptr;
+=09
+=09LayoutWindow *lw =3D layout_find_by_path(path);
+=09if(layout_valid(&lw))
+=09=09{
+=09=09gint x_mouse, y_mouse;
+=09=09pixbuf_renderer_get_mouse_position(PIXBUF_RENDERER(lw->image->pr), &x=
_mouse, &y_mouse);
+=09=09
+=09=09GString *x_str =3D g_string_new("");
+=09=09GString *y_str =3D g_string_new("");
+=09=09
+=09=09g_string_printf(x_str, "%d", x_mouse);
+=09=09g_string_printf(y_str, "%d", y_mouse);
+=09=09
+=09=09ptr =3D result->str;
+=09=09GString *replaced =3D g_string_new("");
+=09=09while ( (found =3D strstr(ptr, "%x")) )
+=09=09=09{
+=09=09=09replaced =3D g_string_append_len(replaced, ptr, found - ptr);
+=09=09=09ptr =3D found + 2;
+=09=09=09replaced =3D g_string_append(replaced, x_str->str);
+=09=09=09}
+=09=09replaced =3D g_string_append(replaced, ptr);
+=09=09g_string_assign(result, replaced->str);
+=09=09
+=09=09ptr =3D result->str;
+=09=09g_string_erase(replaced, 0, -1);
+=09=09while ( (found =3D strstr(ptr, "%y")) )
+=09=09=09{
+=09=09=09replaced =3D g_string_append_len(replaced, ptr, found - ptr);
+=09=09=09ptr =3D found + 2;
+=09=09=09replaced =3D g_string_append(replaced, y_str->str);
+=09=09=09}
+=09=09replaced =3D g_string_append(replaced, ptr);
+=09=09g_string_assign(result, replaced->str);
+=09=09g_string_free(replaced, TRUE);
+=09=09}
+}
+
static gint editor_command_one(const gchar *template, const gchar *path, Ed=
itorVerboseData *vd)
{
=09GString *result =3D NULL;
@@ -375,6 +418,8 @@
=09=09}
=09result =3D g_string_append(result, ptr);
=20
+=09editor_replace_mouse_coordinates(result, pathl);
+=09
=09if (debug) printf("system command: %s\n", result->str);
=20
=09if (current_path)
@@ -486,6 +531,8 @@
* This macro will BLOCK THE APPLICATION until it completes, since c=
ommand is run once
* for every file in syncronous order. To avoid blocking add the %v =
macro, below.
* ([ls %p] results in [ls "file1"], [ls "file2"] ... [ls "lastfile"=
])
+ * %x is replaced with pixel coordinate of mouse on image. Will only wo=
rk when used with %p
+ * %y is replaced with pixel coordinate of mouse on image. Will only wo=
rk when used with %p
* none if no macro is supplied, the result is equivalent to "command %f"
* ([ls] results in [ls "file1" "file2" ... "lastfile"])
*
@@ -574,7 +621,7 @@
=09=09result =3D g_string_append(result, end);
=09=09if (verbose) result =3D g_string_append(result, " 2>&1 ");
=09=09result =3D g_string_append(result, "&");
-
+ =20
=09=09if (debug) printf("system command: %s\n", result->str);
=20
=09=09if (verbose)
Index: layout.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- layout.c=09(Revision 1441)
+++ layout.c=09(Arbeitskopie)
@@ -40,6 +40,7 @@
#define TOOLWINDOW_DEF_WIDTH 260
#define TOOLWINDOW_DEF_HEIGHT 450
#define PROGRESS_WIDTH 150
+#define PIXEL_LABEL_WIDTH 130
#define ZOOM_LABEL_WIDTH 64
=20
#define PANE_DIVIDER_SIZE 10
@@ -84,6 +85,22 @@
=09return NULL;
}
=20
+LayoutWindow *layout_find_by_path(gchar *path)
+{
+=09GList *work;
+
+=09work =3D layout_window_list;
+=09while (work)
+=09=09{
+=09=09LayoutWindow *lw =3D work->data;
+=09=09work =3D work->next;
+
+=09=09if (lw->path =3D=3D path) return lw;
+=09=09}
+
+=09return NULL;
+}
+
/*
*-------------------------------------------------------------------------=
----
* menu, toolbar, and dir view
@@ -106,7 +123,7 @@
=20
=09layout_set_path(lw, buf);
=20
- g_free(buf);
+=09g_free(buf);
}
=20
static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
@@ -570,11 +587,37 @@
=09g_free(buf);
}
=20
+void layout_status_update_pixel(LayoutWindow *lw)
+{
+=09gchar *text;
+=09
+=09if (!layout_valid(&lw) || !lw->image) return;
+
+=09if (!lw->image->unknown)
+=09=09{
+=09=09gint x_pixel, y_pixel, r_mouse, g_mouse, b_mouse;
+=09=09pixbuf_renderer_get_mouse_position(PIXBUF_RENDERER(lw->image->pr), &x=
_pixel, &y_pixel);
+=09=09pixbuf_renderer_get_mouse_colors(PIXBUF_RENDERER(lw->image->pr), &r_m=
ouse, &g_mouse, &b_mouse);
+=09=09if(x_pixel > 0 && y_pixel > 0)
+=09=09=09{
+=09=09=09text =3D g_strdup_printf(_("pos (%d,%d) rgb (%d,%d,%d)"),=20
+=09=09=09=09x_pixel, y_pixel, r_mouse, g_mouse, b_mouse);
+=09=09=09}
+=09=09else
+=09=09=09{
+=09=09=09text =3D g_strdup_printf(_("pos (X,X) rgb (X,X,X)"),=20
+=09=09=09=09 x_pixel, y_pixel, r_mouse, g_mouse, b_mouse);
+=09=09=09}
+=09=09gtk_label_set_text(GTK_LABEL(lw->info_pixel), text);
+=09=09g_free(text);
+=09=09}
+}
+
void layout_status_update_image(LayoutWindow *lw)
{
=09gchar *text;
=09gchar *b;
-
+=09
=09if (!layout_valid(&lw) || !lw->image) return;
=20
=09text =3D image_zoom_get_as_text(lw->image);
@@ -599,8 +642,7 @@
=09=09gint width, height;
=20
=09=09pixbuf_renderer_get_image_size(PIXBUF_RENDERER(lw->image->pr), &width=
, &height);
-=09=09text =3D g_strdup_printf(_("( %d x %d ) %s bytes"),
-=09=09=09=09 width, height, b);
+=09=09text =3D g_strdup_printf(_("( %d x %d ) %s bytes"), width, height, b)=
;
=09=09}
=20
=09gtk_label_set_text(GTK_LABEL(lw->info_details), text);
@@ -614,6 +656,7 @@
=09layout_status_update_progress(lw, 0.0, NULL);
=09layout_status_update_info(lw, NULL);
=09layout_status_update_image(lw);
+=09layout_status_update_pixel(lw);
}
=20
static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gint sta=
rt, gint size, gint expand)
@@ -696,6 +739,8 @@
=09=09}
=09lw->info_details =3D layout_status_label(NULL, hbox, TRUE, 0, TRUE);
=09if (!small_format) gtk_box_pack_start(GTK_BOX(hbox), lw->info_color, FAL=
SE, FALSE, 0);
+=09lw->info_pixel =3D layout_status_label(NULL, hbox, FALSE, PIXEL_LABEL_WI=
DTH, TRUE);
+=09if(info_pixel_hidden) gtk_widget_hide(gtk_widget_get_parent(lw->info_pix=
el));
=09lw->info_zoom =3D layout_status_label(NULL, hbox, FALSE, ZOOM_LABEL_WIDT=
H, FALSE);
}
=20
@@ -716,6 +761,7 @@
=09LayoutWindow *lw =3D data;
=20
=09layout_status_update_info(lw, NULL);
+=09layout_status_update_pixel(lw);
}
=20
static void layout_list_thumb_cb(ViewFileList *vfl, gdouble val, const gcha=
r *text, gpointer data)
@@ -1596,6 +1642,7 @@
=09lw->info_color =3D NULL;
=09lw->info_status =3D NULL;
=09lw->info_details =3D NULL;
+=09lw->info_pixel =3D NULL;
=09lw->info_zoom =3D NULL;
=20
=09if (lw->ui_manager) g_object_unref(lw->ui_manager);
@@ -1755,6 +1802,31 @@
=09return lw->toolbar_hidden;
}
=20
+void layout_info_pixel_toggle(LayoutWindow *lw)
+{
+=09if (!layout_valid(&lw)) return;
+=09if (!lw->info_pixel) return;
+
+=09lw->info_pixel_hidden =3D !lw->info_pixel_hidden;
+
+=09GtkWidget *frame =3D gtk_widget_get_parent(lw->info_pixel);
+=09if (lw->info_pixel_hidden)
+=09=09{
+=09=09if (GTK_WIDGET_VISIBLE(frame)) gtk_widget_hide(frame);
+=09=09}
+=09else
+=09=09{
+=09=09if (!GTK_WIDGET_VISIBLE(frame)) gtk_widget_show(frame);
+=09=09}
+}
+
+gint layout_info_pixel_hidden(LayoutWindow *lw)
+{
+=09if (!layout_valid(&lw)) return TRUE;
+
+=09return lw->info_pixel_hidden;
+}
+
/*
*-------------------------------------------------------------------------=
----
* base
@@ -1823,6 +1895,7 @@
=09lw->tools_hidden =3D hidden;
=20
=09lw->toolbar_hidden =3D toolbar_hidden;
+=09lw->info_pixel_hidden =3D info_pixel_hidden;
=20
=09lw->utility_box =3D NULL;
=09lw->bar_sort =3D NULL;
Index: layout.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- layout.h=09(Revision 1441)
+++ layout.h=09(Arbeitskopie)
@@ -32,6 +32,7 @@
=20
void layout_status_update_progress(LayoutWindow *lw, gdouble val, const gch=
ar *text);
void layout_status_update_info(LayoutWindow *lw, const gchar *text);
+void layout_status_update_pixel(LayoutWindow *lw);
void layout_status_update_image(LayoutWindow *lw);
void layout_status_update_all(LayoutWindow *lw);
=20
@@ -81,6 +82,8 @@
=20
void layout_toolbar_toggle(LayoutWindow *lw);
gint layout_toolbar_hidden(LayoutWindow *lw);
+void layout_info_pixel_toggle(LayoutWindow *lw);
+gint layout_info_pixel_hidden(LayoutWindow *lw);
=20
=20
void layout_maint_renamed(const gchar *source, const gchar *dest);
Index: main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- main.c=09(Revision 1441)
+++ main.c=09(Arbeitskopie)
@@ -1166,6 +1166,7 @@
=09=09=09=09 &float_window_w, &float_window_h, &float_window_divider);
=09layout_tools_float_get(NULL, &tools_float, &tools_hidden);
=09toolbar_hidden =3D layout_toolbar_hidden(NULL);
+=09info_pixel_hidden =3D layout_info_pixel_hidden(NULL);
=20
=09color_profile_enabled =3D layout_image_color_profile_get_use(NULL);
=09layout_image_color_profile_get(NULL,
Index: pixbuf-renderer.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- pixbuf-renderer.c=09(Revision 1441)
+++ pixbuf-renderer.c=09(Arbeitskopie)
@@ -452,6 +452,12 @@
=20
=09pr->scroller_id =3D -1;
=09pr->scroller_overlay =3D -1;
+=09
+=09pr->x_mouse =3D -1;
+=09pr->y_mouse =3D -1;
+=09pr->r_mouse =3D -1;
+=09pr->g_mouse =3D -1;
+=09pr->b_mouse =3D -1;
=20
=09pr->source_tiles_enabled =3D FALSE;
=09pr->source_tiles =3D NULL;
@@ -2432,6 +2438,7 @@
=09h -=3D (ny - y);
=09w =3D CLAMP(w, 0, pr->width - nx);
=09h =3D CLAMP(h, 0, pr->height - ny);
+ =20
=09if (w < 1 || h < 1) return;
=20
=09if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_ex=
isting) &&
@@ -2487,6 +2494,77 @@
=09=09}
}
=20
+
+/*
+ *-------------------------------------------------------------------
+ * pixel information at mouse position
+ *-------------------------------------------------------------------
+ */
+
+ /* put color information if mouse is on valid pixel */
+static void pr_pixel_color_update(PixbufRenderer *pr)
+{
+=09GdkPixbuf *pb =3D pr->pixbuf;
+=09gint p_alpha;
+=09gint prs;
+=09guchar *p_pix;
+=09guchar *pp;
+
+=09if (!pb) return;
+
+=09if (pr->x_pixel < 0 || pr->x_pixel > pr->image_width) return;
+=09if (pr->y_pixel < 0 || pr->y_pixel > pr->image_height) return;
+
+=09p_alpha =3D gdk_pixbuf_get_has_alpha(pb);
+=09prs =3D gdk_pixbuf_get_rowstride(pb);
+=09p_pix =3D gdk_pixbuf_get_pixels(pb);
+
+=09pp =3D p_pix + pr->y_pixel * prs + (pr->x_pixel * (p_alpha ? 4 : 3));
+=09pr->r_mouse =3D *pp;
+=09pp++;
+=09pr->g_mouse =3D *pp;
+=09pp++;
+=09pr->b_mouse =3D *pp;
+}
+=20
+
+/* update pixel coordinates on layout bar if mouse is above pr*/
+static void pr_pixel_update(PixbufRenderer *pr)
+{
+=09gboolean update =3D FALSE;
+=09gboolean valid =3D FALSE;
+=09gint x_pixel =3D (gint)((gdouble)(pr->x_mouse - pr->x_offset + pr->x_scr=
oll) / pr->scale);
+=09gint y_pixel =3D (gint)((gdouble)(pr->y_mouse - pr->y_offset + pr->y_scr=
oll) / pr->scale);
+=09gint x_pixel_clamped =3D CLAMP(x_pixel, 0, pr->image_width - 1);
+=09gint y_pixel_clamped =3D CLAMP(y_pixel, 0, pr->image_height - 1);
+=09
+=09if(x_pixel =3D=3D x_pixel_clamped && y_pixel =3D=3D y_pixel_clamped)
+=09=09{
+=09=09pr->x_pixel =3D x_pixel;
+=09=09pr->y_pixel =3D y_pixel;
+=09=09update =3D TRUE;
+=09=09valid =3D TRUE;
+=09=09}
+=09else
+=09=09{
+=09=09if(pr->x_pixel !=3D -1 || pr->y_pixel !=3D -1)
+=09=09=09{
+=09=09=09pr->x_pixel =3D pr->y_pixel =3D -1;
+=09=09=09update =3D TRUE;
+=09=09=09}
+=09=09}
+
+=09if(update =3D=3D TRUE)
+=09=09{
+=09=09if(valid =3D=3D TRUE)
+=09=09=09{
+=09=09=09pr_pixel_color_update(pr);
+=09=09=09}
+=09=09/* update status bar */
+=09=09layout_status_update_pixel(pixbuf_renderer_get_parent(pr));
+=09=09}
+}
+
/*
*-------------------------------------------------------------------
* sync and clamp
@@ -2701,12 +2779,14 @@
=09=09=09=09/* center new image */
=09=09=09=09pr->x_scroll =3D ((double)pr->image_width / 2.0 * pr->scale) - =
pr->vis_width / 2;
=09=09=09=09pr->y_scroll =3D ((double)pr->image_height / 2.0 * pr->scale) -=
pr->vis_height / 2;
+=09=09=09=09pr_pixel_update(pr);
=09=09=09=09break;
=09=09=09case PR_SCROLL_RESET_TOPLEFT:
=09=09=09default:
=09=09=09=09/* reset to upper left */
=09=09=09=09pr->x_scroll =3D 0;
=09=09=09=09pr->y_scroll =3D 0;
+=09=09=09=09pr_pixel_update(pr);
=09=09=09=09break;
=09=09=09}
=09=09}
@@ -2975,8 +3055,12 @@
=09=09pr->scroller_xpos =3D bevent->x;
=09=09pr->scroller_ypos =3D bevent->y;
=09=09}
-
-=09if (!pr->in_drag || !gdk_pointer_is_grabbed()) return FALSE;
+=09
+=09pr->x_mouse =3D bevent->x;
+=09pr->y_mouse =3D bevent->y;
+=09pr_pixel_update(pr);
+=09
+=09if (!pr->in_drag || gdk_pointer_is_grabbed) return FALSE;
=20
=09if (pr->drag_moved < PR_DRAG_SCROLL_THRESHHOLD)
=09=09{
@@ -3211,6 +3295,11 @@
=20
=09pr->x_scroll =3D source->x_scroll;
=09pr->y_scroll =3D source->y_scroll;
+=09pr->x_mouse =3D source->x_mouse;
+=09pr->y_mouse =3D source->y_mouse;
+=09pr->r_mouse =3D source->r_mouse;
+=09pr->g_mouse =3D source->g_mouse;
+=09pr->b_mouse =3D source->b_mouse;
=20
=09scroll_reset =3D pr->scroll_reset;
=09pr->scroll_reset =3D PR_SCROLL_RESET_NOCHANGE;
@@ -3329,6 +3418,42 @@
=09=09}
}
=20
+gint pixbuf_renderer_get_mouse_colors(PixbufRenderer *pr, gint *r_mouse, gi=
nt *g_mouse, gint *b_mouse)
+{
+=09g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
+=09g_return_val_if_fail(r_mouse !=3D NULL && g_mouse !=3D NULL && b_mouse !=
=3D NULL, FALSE);
+
+=09if (!pr->pixbuf && !pr->source_tiles_enabled)
+=09=09{
+=09=09*r_mouse =3D -1;
+=09=09*g_mouse =3D -1;
+=09=09*b_mouse =3D -1;
+=09=09return FALSE;
+=09=09}
+
+=09*r_mouse =3D pr->r_mouse;
+=09*g_mouse =3D pr->g_mouse;
+=09*b_mouse =3D pr->b_mouse;
+=09return TRUE;
+}
+
+gint pixbuf_renderer_get_mouse_position(PixbufRenderer *pr, gint *x_pixel, =
gint *y_pixel)
+{
+=09g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
+=09g_return_val_if_fail(x_pixel !=3D NULL && y_pixel !=3D NULL, FALSE);
+
+=09if (!pr->pixbuf && !pr->source_tiles_enabled)
+=09=09{
+=09=09*x_pixel =3D -1;
+=09=09*y_pixel =3D -1;
+=09=09return FALSE;
+=09=09}
+
+=09*x_pixel =3D pr->x_pixel;
+=09*y_pixel =3D pr->y_pixel;
+=09return TRUE;
+}
+
gint pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *=
height)
{
=09g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
@@ -3405,5 +3530,3 @@
=09rect->height =3D pr->vis_height;
=09return TRUE;
}
-
-
Index: pixbuf-renderer.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- pixbuf-renderer.h=09(Revision 1441)
+++ pixbuf-renderer.h=09(Arbeitskopie)
@@ -53,6 +53,16 @@
=09gint x_offset;=09=09/* offset of image start (non-zero when image < wind=
ow) */
=09gint y_offset;
=20
+=09gint x_mouse; /* last position of mouse on image */
+=09gint y_mouse;
+
+=09gint x_pixel; /* pixel coordinates of the mouse */
+=09gint y_pixel;
+
+=09gint r_mouse; /* color information at mouse position */
+=09gint g_mouse;
+=09gint b_mouse;
+
=09gint vis_width;=09=09/* dimensions of visible part of image */
=09gint vis_height;
=20
Index: gqview.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- gqview.h=09(Revision 1441)
+++ gqview.h=09(Arbeitskopie)
@@ -114,6 +114,7 @@
extern gint tools_float;
extern gint tools_hidden;
extern gint toolbar_hidden;
+extern gint info_pixel_hidden;
extern gint progressive_key_scrolling;
=20
extern gint startup_path_enable;
Index: rcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- rcfile.c=09(Revision 1441)
+++ rcfile.c=09(Arbeitskopie)
@@ -265,6 +265,7 @@
=09write_bool_option(f, "restore_tool_state", restore_tool);
=20
=09write_bool_option(f, "toolbar_hidden", toolbar_hidden);
+=09write_bool_option(f, "info_pixel_hidden", info_pixel_hidden);
=20
=09write_bool_option(f, "mouse_wheel_scrolls", mousewheel_scrolls);
=09write_bool_option(f, "in_place_rename", enable_in_place_rename);
@@ -517,7 +518,9 @@
=20
=09=09toolbar_hidden =3D read_bool_option(f, option,
=09=09=09"toolbar_hidden", value, toolbar_hidden);
-
+=09=09info_pixel_hidden =3D read_bool_option(f, option,
+=09=09=09"info_pixel_hidden", value, info_pixel_hidden);
+=09=09
=09=09mousewheel_scrolls =3D read_bool_option(f, option,
=09=09=09"mouse_wheel_scrolls", value, mousewheel_scrolls);
=09=09enable_in_place_rename =3D read_bool_option(f, option,
Index: layout_util.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- layout_util.c=09(Revision 1441)
+++ layout_util.c=09(Arbeitskopie)
@@ -551,6 +551,17 @@
=09=09}
}
=20
+static void layout_menu_info_pixel_cb(GtkToggleAction *action, gpointer dat=
a)
+{
+=09LayoutWindow *lw =3D data;
+
+=09if (lw->info_pixel_hidden !=3D gtk_toggle_action_get_active(action))
+=09=09{
+=09=09layout_info_pixel_toggle(lw);
+=09=09}
+}
+
+
static void layout_menu_bar_info_cb(GtkToggleAction *action, gpointer data)
{
=09LayoutWindow *lw =3D data;
@@ -839,6 +850,7 @@
{ "FolderTree",=09NULL,=09=09N_("Tr_ee"),=09=09"<control>T",=09NULL,=09CB=
(layout_menu_tree_cb) },
{ "FloatTools",=09NULL,=09=09N_("_Float file list"),=09"L",=09=09NULL,=09=
CB(layout_menu_float_cb) },
{ "HideToolbar",=09NULL,=09=09N_("Hide tool_bar"),=09NULL,=09=09NULL,=09C=
B(layout_menu_toolbar_cb) },
+ { "HidePixelinfo",=09NULL,=09=09N_("Hide _pixel info"),=09NULL,=09=09NULL=
,=09CB(layout_menu_info_pixel_cb) },
{ "SBarKeywords",=09NULL,=09=09N_("_Keywords"),=09"<control>K",=09NULL,=
=09CB(layout_menu_bar_info_cb) },
{ "SBarExif",=09=09NULL,=09=09N_("E_xif data"),=09"<control>E",=09NULL,=
=09CB(layout_menu_bar_exif_cb) },
{ "SBarSort",=09=09NULL,=09=09N_("Sort _manager"),=09"<control>S",=09NULL=
,=09CB(layout_menu_bar_sort_cb) }
@@ -922,6 +934,7 @@
" <menuitem action=3D'FloatTools'/>"
" <menuitem action=3D'HideTools'/>"
" <menuitem action=3D'HideToolbar'/>"
+" <menuitem action=3D'HidePixelinfo'/>"
" <separator/>"
" <menuitem action=3D'SBarKeywords'/>"
" <menuitem action=3D'SBarExif'/>"
@@ -1141,6 +1154,9 @@
=20
=09action =3D gtk_action_group_get_action(lw->action_group, "HideToolbar");
=09gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->toolbar_hidd=
en);
+
+=09action =3D gtk_action_group_get_action(lw->action_group, "HidePixelinfo"=
);
+=09gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->info_pixel_h=
idden);
}
=20
void layout_util_sync_thumb(LayoutWindow *lw)
Index: globals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- globals.c=09(Revision 1441)
+++ globals.c=09(Arbeitskopie)
@@ -35,6 +35,7 @@
gint tools_float =3D FALSE;
gint tools_hidden =3D FALSE;
gint toolbar_hidden =3D FALSE;
+gint info_pixel_hidden =3D FALSE;
gint progressive_key_scrolling =3D FALSE;
=20
gint startup_path_enable =3D FALSE;
Index: typedefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- typedefs.h=09(Revision 1441)
+++ typedefs.h=09(Arbeitskopie)
@@ -389,7 +389,9 @@
=09GtkWidget *info_color;
=09GtkWidget *info_status;
=09GtkWidget *info_details;
+=09GtkWidget *info_pixel;
=09GtkWidget *info_zoom;
+=09gint info_pixel_hidden;
=20
=09/* slide show */
=20
--=_1g7717l90934
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--=_1g7717l90934
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Gqview-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gqview-devel
--=_1g7717l90934--