This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via c80b947b60c5cb4af6b5498b070a33b5baa15e69 (commit) via 8b59476b2b8ff0fb22c7a8cfc2c2deba295560c2 (commit) from d64232857f0895b73f637f3985442a2cda23da72 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/c80b947b60c5cb4af6b5498b070a33b5baa15...
commit c80b947b60c5cb4af6b5498b070a33b5baa15e69 Author: Cyril Hrubis metan@ucw.cz Date: Tue May 8 16:35:19 2012 +0200
spiv: A few fixes.
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index 1a1369f..7ecf094 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -77,7 +77,8 @@ static int image_loader_callback(GP_ProgressCallback *self)
size = GP_TextWidth(NULL, buf);
- GP_BackendFlip(backend); + GP_BackendUpdateRect(backend, c->w/2 - size/2 - 1, c->h - 4, + c->w/2 + size/2 + 1, c->h - 4 - GP_TextHeight(NULL));
return 0; } @@ -173,7 +174,8 @@ static void *image_loader(void *ptr) if (rat < 1) { cpu_timer_start(&timer, "Blur"); callback.priv = "Blurring Image"; - if (GP_FilterGaussianBlur(img, img, 0.3/rat, 0.3/rat, &callback) == NULL) + if (GP_FilterGaussianBlur(img, img, 0.4/rat, 0.4/rat, + &callback) == NULL) return NULL; cpu_timer_stop(&timer); } @@ -294,7 +296,7 @@ static void sighandler(int signo)
static void init_backend(const char *backend_opts) { - backend = GP_BackendInit(backend_opts, "FBshow", stderr); + backend = GP_BackendInit(backend_opts, "Spiv", stderr); if (backend == NULL) { fprintf(stderr, "Failed to initalize backend '%s'n", backend_opts);
http://repo.or.cz/w/gfxprim.git/commit/8b59476b2b8ff0fb22c7a8cfc2c2deba29556...
commit 8b59476b2b8ff0fb22c7a8cfc2c2deba295560c2 Author: Cyril Hrubis metan@ucw.cz Date: Tue May 8 16:04:20 2012 +0200
backends: X11 add support for pointer events.
diff --git a/include/input/GP_Event.h b/include/input/GP_Event.h index 8f57588..e12d9ae 100644 --- a/include/input/GP_Event.h +++ b/include/input/GP_Event.h @@ -310,6 +310,11 @@ int GP_EventGet(struct GP_Event *ev); void GP_EventPushRel(int32_t rx, int32_t ry, struct timeval *time);
/* + * Produces relative event that moves to the point x, y + */ +void GP_EventPushRelTo(uint32_t x, uint32_t y, struct timeval *time); + +/* * Inject absolute event. */ void GP_EventPushAbs(uint32_t x, uint32_t y, uint32_t pressure, diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c index f12ade8..a19ea7b 100644 --- a/libs/backends/GP_X11.c +++ b/libs/backends/GP_X11.c @@ -111,8 +111,7 @@ static void x11_poll(GP_Backend *self) case MapNotify: GP_DEBUG(1, "Shown"); break; - case KeyPress: - case KeyRelease: + default: GP_InputDriverX11EventPut(&ev); break; } @@ -174,7 +173,9 @@ GP_Backend *GP_BackendX11Init(const char *display, int x, int y,
/* Select events */ XSelectInput(x11->dpy, x11->win, StructureNotifyMask | ExposureMask | - KeyPressMask | KeyReleaseMask); + KeyPressMask | KeyReleaseMask | + ButtonPressMask | ButtonReleaseMask | + PointerMotionMask);
/* Set window caption */ XmbSetWMProperties(x11->dpy, x11->win, caption, caption, diff --git a/libs/input/GP_Event.c b/libs/input/GP_Event.c index fb8c7d8..161c0de 100644 --- a/libs/input/GP_Event.c +++ b/libs/input/GP_Event.c @@ -129,14 +129,14 @@ const char *GP_EventKeyName(enum GP_EventKeyValue key)
static void dump_rel(struct GP_Event *ev) { - printf("REL "); + printf("Rel ");
switch (ev->code) { case GP_EV_REL_POS: - printf("POSSITION %u %un", ev->cursor_x, ev->cursor_y); + printf("Position %u %un", ev->cursor_x, ev->cursor_y); break; case GP_EV_REL_WHEEL: - printf("WHEEL %in", ev->val.val); + printf("Wheel %in", ev->val.val); break; } } @@ -148,7 +148,7 @@ static void dump_key(struct GP_Event *ev) if (ev->val.key.key < key_names_size) name = key_names[ev->val.key.key];
- printf("KEY %i (Key%s) %sn", + printf("Key %i (Key%s) %sn", ev->val.key.key, name, ev->code ? "down" : "up");
} @@ -157,7 +157,7 @@ static void dump_abs(struct GP_Event *ev) { switch (ev->code) { case GP_EV_ABS_POS: - printf("POSSITION %u %u %un", + printf("Position %u %u %un", ev->cursor_x, ev->cursor_y, ev->val.abs.pressure); break; } @@ -165,7 +165,7 @@ static void dump_abs(struct GP_Event *ev)
void GP_EventDump(struct GP_Event *ev) { - printf("EVENT (%u) ", (unsigned int)ev->time.tv_sec % 10000); + printf("Event (%u) ", (unsigned int)ev->time.tv_sec % 10000);
switch (ev->type) { case GP_EV_KEY: @@ -218,6 +218,14 @@ static uint32_t clip_rel(uint32_t val, uint32_t max, int32_t rel) return val + rel; }
+void GP_EventPushRelTo(uint32_t x, uint32_t y, struct timeval *time) +{ + int32_t rx = x - cur_state.cursor_x; + int32_t ry = y - cur_state.cursor_y; + + GP_EventPushRel(rx, ry, time); +} + void GP_EventPushRel(int32_t rx, int32_t ry, struct timeval *time) { /* event header */ diff --git a/libs/input/GP_InputDriverX11.c b/libs/input/GP_InputDriverX11.c index d3b21c1..719ef3b 100644 --- a/libs/input/GP_InputDriverX11.c +++ b/libs/input/GP_InputDriverX11.c @@ -67,13 +67,10 @@ void GP_InputDriverX11EventPut(XEvent *ev) int key = 0, keycode, press = 0;
switch (ev->type) { - /* - case SDL_MOUSEMOTION: - GP_EventPushRel(ev->motion.xrel, ev->motion.yrel, NULL); - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - switch (ev->button.button) { + case ButtonPress: + press = 1; + case ButtonRelease: + switch (ev->xbutton.button) { case 1: key = GP_BTN_LEFT; break; @@ -83,13 +80,19 @@ void GP_InputDriverX11EventPut(XEvent *ev) case 3: key = GP_BTN_RIGHT; break; - default: + } + + if (key == 0) { + GP_DEBUG(0, "Unmapped X11 button %02x", + ev->xbutton.button); return; }
- GP_EventPush(GP_EV_KEY, key, ev->button.state, NULL); + GP_EventPush(GP_EV_KEY, key, press, NULL); + break; + case MotionNotify: + GP_EventPushRelTo(ev->xmotion.x, ev->xmotion.y, NULL); break; - */ case KeyPress: press = 1; case KeyRelease: @@ -103,7 +106,6 @@ void GP_InputDriverX11EventPut(XEvent *ev) return; } - GP_DEBUG(0, "Mapped X11 keycode %02x", keycode); GP_EventPushKey(key, press, NULL); break; }
-----------------------------------------------------------------------
Summary of changes: demos/spiv/spiv.c | 8 +++++--- include/input/GP_Event.h | 5 +++++ libs/backends/GP_X11.c | 7 ++++--- libs/input/GP_Event.c | 20 ++++++++++++++------ libs/input/GP_InputDriverX11.c | 24 +++++++++++++----------- 5 files changed, 41 insertions(+), 23 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.