summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <Joel.Bosveld@gmail.com>2008-06-03 21:58:22 +0800
committerJoel Bosveld <Joel.Bosveld@gmail.com>2008-06-03 21:58:22 +0800
commita3cf3f0c7e969a70c1ef4124498d1831b44b22aa (patch)
tree392df3a4b8cae1316e6434c5c3caa9d08b6e1894
parent2ddbea151b07bb4829c10c3c40a4d1aed73a8bc6 (diff)
downloadjasper-a3cf3f0c7e969a70c1ef4124498d1831b44b22aa.tar.gz
jasper-a3cf3f0c7e969a70c1ef4124498d1831b44b22aa.tar.bz2
Add handleEvent function
-rw-r--r--include/jasper-functions.h3
-rw-r--r--include/jasper.h1
-rw-r--r--plugins/core.c1
-rw-r--r--src/functions.c3
4 files changed, 8 insertions, 0 deletions
diff --git a/include/jasper-functions.h b/include/jasper-functions.h
index ecba9bb..7057b4f 100644
--- a/include/jasper-functions.h
+++ b/include/jasper-functions.h
@@ -17,6 +17,9 @@ typedef void (*mainLoopFiniProc) (JasperCore *core);
*/
typedef void (*handleToolkitActionProc) (JasperCore *core, XEvent *xevent);
+/* This is called on every event */
+typedef void (*handleEventProc) (JasperCore *core, XEvent *xevent);
+
/* buttonEvents are called by 'core' plugin when the input window of that button recieves an event
* Plugins should WRAP this in order to act on button press/release (for closing windows, resizing, etc)
* NOTE: this is most likely going to change soon
diff --git a/include/jasper.h b/include/jasper.h
index d3d74d9..6597819 100644
--- a/include/jasper.h
+++ b/include/jasper.h
@@ -207,6 +207,7 @@ struct _JasperCore
themeGetBarePropertyProc themeGetBareProperty;
handleToolkitActionProc handleToolkitAction;
+ handleEventProc handleEvent;
JasperTimeoutHandle lastTimeoutHandle;
JasperTimeout *timeouts;
diff --git a/plugins/core.c b/plugins/core.c
index 3db7026..ff64de9 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -490,6 +490,7 @@ coreMainLoopStep (JasperCore *core)
break;
}
}
+ core->handleEvent (core, &event);
}
handleTimeouts (core, 10000);
diff --git a/src/functions.c b/src/functions.c
index a637986..256ccfd 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -40,6 +40,8 @@ static void mainLoopFini (JasperCore *core) {};
static void handleToolkitAction (JasperCore *core, XEvent *xevent) {};
+static void handleEvent (JasperCore *core, XEvent *xevent) {};
+
static void buttonPress (JasperButton *button, XEvent *xevent) {};
static void buttonRelease (JasperButton *button, XEvent *xevent) {};
@@ -136,6 +138,7 @@ JasperObject
c->mainLoopFini = mainLoopFini;
c->handleToolkitAction = handleToolkitAction;
+ c->handleEvent = handleEvent;
c->themeGetActiveProperty = themeGetActiveProperty;
c->themeGetNormalProperty = themeGetNormalProperty;