summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-17 01:47:20 +0000
committerDana Jansens <danakj@orodu.net>2003-03-17 01:47:20 +0000
commit432ac0983e058133e03885171f266dc4ba07f488 (patch)
tree960e5f90cc78632b24712c0f0be7b18dc402d331 /engines
parent9a3459e983a11d74ec9f5dc415ce0af551c4b74e (diff)
give engines mouse event notifications. make the openbox engine display pressed buttons
Diffstat (limited to 'engines')
-rw-r--r--engines/engineinterface.h9
-rw-r--r--engines/openbox/openbox.c48
2 files changed, 57 insertions, 0 deletions
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);
+ }
+}