diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-03-16 16:33:48 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-03-16 16:33:48 -0400 |
commit | 56ff9ed93d1cc9fd091da609304bd153d706d818 (patch) | |
tree | ce54aea35bf50f8f9cd2076d46dfaa43ac35f4d2 /pango-view/viewer-x.c | |
parent | c4f9a30634779bc985a470df2bc9f7e4fa0e6ad0 (diff) | |
download | pango-56ff9ed93d1cc9fd091da609304bd153d706d818.tar.gz |
[pango-view] Add an extra level of mild annotation to cairo backend
Diffstat (limited to 'pango-view/viewer-x.c')
-rw-r--r-- | pango-view/viewer-x.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/pango-view/viewer-x.c b/pango-view/viewer-x.c index 25492f33..ad1c9a8d 100644 --- a/pango-view/viewer-x.c +++ b/pango-view/viewer-x.c @@ -182,11 +182,7 @@ x_view_display (gpointer instance, XRectangle r; Region update_region; unsigned int quit_keycode; - unsigned int borders_keycode; - gboolean show_borders = FALSE; - - if (state) - show_borders = GPOINTER_TO_UINT (state) == 0xdeadbeef; + unsigned int annotate_keycode; /* force a full redraw */ update_region = XCreateRegion (); @@ -196,7 +192,7 @@ x_view_display (gpointer instance, r.height = height; XUnionRectWithRegion (&r, update_region, update_region); - borders_keycode = XKeysymToKeycode(x->display, 'B'); + annotate_keycode = XKeysymToKeycode(x->display, 'B'); quit_keycode = XKeysymToKeycode(x->display, 'Q'); while (1) @@ -208,11 +204,10 @@ x_view_display (gpointer instance, switch (xev.xany.type) { case KeyPress: if (xev.xkey.keycode == quit_keycode) - return NULL; - else if (xev.xkey.keycode == borders_keycode) + return GINT_TO_POINTER (-1); + else if (xev.xkey.keycode == annotate_keycode) { - show_borders = !show_borders; - return GUINT_TO_POINTER (show_borders ? 0xdeadbeef : 0xbe); + return GUINT_TO_POINTER (GPOINTER_TO_INT (state) + 1); } break; case Expose: |