From fa405398a1431564bc16be08e185dc77d0d80e6a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 18 Mar 2003 20:09:07 +0000 Subject: [PATCH] add the mouse plugin --- configure.ac | 1 + plugins/mouse/.cvsignore | 6 ++++++ plugins/mouse/Makefile.am | 17 +++++++++++++++++ plugins/mouse/mouse.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 plugins/mouse/.cvsignore create mode 100644 plugins/mouse/Makefile.am create mode 100644 plugins/mouse/mouse.c diff --git a/configure.ac b/configure.ac index 6953f152..1206cee5 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,7 @@ AC_CONFIG_FILES([Makefile po/Makefile.in engines/openbox/Makefile plugins/Makefile plugins/keyboard/Makefile + plugins/mouse/Makefile doc/Makefile doc/doxygen/Makefile data/Makefile diff --git a/plugins/mouse/.cvsignore b/plugins/mouse/.cvsignore new file mode 100644 index 00000000..e76ce200 --- /dev/null +++ b/plugins/mouse/.cvsignore @@ -0,0 +1,6 @@ +mouse.lo +mouse.la +Makefile +Makefile.in +.libs +.deps diff --git a/plugins/mouse/Makefile.am b/plugins/mouse/Makefile.am new file mode 100644 index 00000000..d2ead23c --- /dev/null +++ b/plugins/mouse/Makefile.am @@ -0,0 +1,17 @@ +plugindir=$(libdir)/openbox/plugins + +CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) @CPPFLAGS@ \ +-DPLUGINDIR=\"$(plugindir)\" \ +-DG_LOG_DOMAIN=\"Plugin-Mouse\" + +plugin_LTLIBRARIES=mouse.la + +mouse_la_LDFLAGS=-module -avoid-version +mouse_la_SOURCES=mouse.c + +noinst_HEADERS= + +MAINTAINERCLEANFILES= Makefile.in + +distclean-local: + $(RM) *\~ *.orig *.rej .\#* diff --git a/plugins/mouse/mouse.c b/plugins/mouse/mouse.c new file mode 100644 index 00000000..7b129c89 --- /dev/null +++ b/plugins/mouse/mouse.c @@ -0,0 +1,29 @@ +#include "../../kernel/dispatch.h" +#include + +void my_powerful_function() {} + +static void event(ObEvent *e, void *foo) +{ + switch (e->type) { + case Event_X_ButtonPress: + break; + case Event_X_ButtonRelease: + break; + case Event_X_MotionNotify: + break; + default: + g_assert_not_reached(); + } +} + +void plugin_startup() +{ + dispatch_register(Event_X_ButtonPress | Event_X_ButtonRelease | + Event_X_MotionNotify, (EventHandler)event, NULL); +} + +void plugin_shutdown() +{ + dispatch_register(0, (EventHandler)event, NULL); +} -- 2.45.2