From 432ac0983e058133e03885171f266dc4ba07f488 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 17 Mar 2003 01:47:20 +0000 Subject: give engines mouse event notifications. make the openbox engine display pressed buttons --- engines/engineinterface.h | 9 +++++++++ engines/openbox/openbox.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'engines') diff --git a/engines/engineinterface.h b/engines/engineinterface.h index 96796edd..2a364e22 100644 --- a/engines/engineinterface.h +++ b/engines/engineinterface.h @@ -50,4 +50,13 @@ typedef void EngineFrameHide(Frame *self); /* get_context */ typedef GQuark EngineGetContext(Client *client, Window win); +/* frame_mouse_enter */ +typedef void EngineMouseEnter(Frame *self, Window win); +/* frame_mouse_leave */ +typedef void EngineMouseLeave(Frame *self, Window win); +/* frame_mouse_press */ +typedef void EngineMousePress(Frame *self, Window win, int x, int y); +/* frame_mouse_release */ +typedef void EngineMouseRelease(Frame *self, Window win, int x, int y); + #endif diff --git a/engines/openbox/openbox.c b/engines/openbox/openbox.c index 8f101917..f92f46a2 100644 --- a/engines/openbox/openbox.c +++ b/engines/openbox/openbox.c @@ -865,3 +865,51 @@ GQuark get_context(Client *client, Window win) return g_quark_try_string("none"); } + +void frame_mouse_enter(ObFrame *self, Window win) +{ +} + +void frame_mouse_leave(ObFrame *self, Window win) +{ +} + +void frame_mouse_press(ObFrame *self, Window win, int x, int y) +{ + if (win == self->max) { + self->max_press = TRUE; + render_max(self); + } + else if (win == self->close) { + self->close_press = TRUE; + render_close(self); + } + else if (win == self->iconify) { + self->iconify_press = TRUE; + render_iconify(self); + } + else if (win == self->desk) { + self->desk_press = TRUE; + render_desk(self); + } +} + +void frame_mouse_release(ObFrame *self, Window win, int x, int y) +{ + if (win == self->max) { + self->max_press = FALSE; + render_max(self); + } + else if (win == self->close) { + self->close_press = FALSE; + render_close(self); + } + else if (win == self->iconify) { + self->iconify_press = FALSE; + render_iconify(self); + } + else if (win == self->desk) { + self->desk_press = FALSE; + render_desk(self); + } +} -- cgit v1.2.3