-SUBDIRS = po data themes doc render kernel engines python
+SUBDIRS = po data themes doc render kernel engines plugins
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
.PHONY: doc
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
-PYTHON_DEVEL
-
AC_PROG_LN_S
AC_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
render/Makefile
engines/Makefile
engines/openbox/Makefile
- python/Makefile
+ plugins/Makefile
doc/Makefile
doc/doxygen/Makefile
data/Makefile
localedir=$(datadir)/locale
themercdir=$(datadir)/openbox
-scriptdir=$(libdir)/openbox/python
enginedir=$(libdir)/openbox/engines
+plugindir=$(libdir)/openbox/plugins
-CPPFLAGS=$(XFT_CFLAGS) $(PYTHON_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) \
@CPPFLAGS@ \
-DLOCALEDIR=\"$(localedir)\" \
-DTHEMERCDIR=\"$(themercdir)\" \
--DSCRIPTDIR=\"$(scriptdir)\" \
+-DPLUGINDIR=\"$(plugindir)\" \
-DENGINEDIR=\"$(enginedir)\" \
-DDEFAULT_ENGINE=\"openbox\" \
-DG_LOG_DOMAIN=\"Openbox\"
-LIBS=$(XFT_LIBS) $(PYTHON_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) @LIBS@
+LIBS=$(XFT_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) @LIBS@
bin_PROGRAMS= ob3
ob3_LDADD=@LIBINTL@ ../render/librender.a
ob3_LDFLAGS=-export-dynamic
ob3_SOURCES=client.c event.c extensions.c focus.c frame.c openbox.c prop.c \
- python.c screen.c stacking.c xerror.c hooks.c themerc.c timer.c \
- clientwrap.c openboxwrap.c pointer.c keyboard.c engine.c configwrap.c
+ screen.c stacking.c xerror.c themerc.c timer.c dispatch.c \
+ engine.c
noinst_HEADERS=client.h event.h extensions.h focus.h frame.h geom.h gettext.h \
- openbox.h prop.h python.h screen.h stacking.h xerror.h themerc.h \
- timer.h hooks.h clientwrap.h openboxwrap.h pointer.h keyboard.h \
- engine.h configwrap.h
+ openbox.h prop.h screen.h stacking.h xerror.h themerc.h dispatch.h \
+ timer.h engine.h
MAINTAINERCLEANFILES= Makefile.in
#include "event.h"
#include "focus.h"
#include "stacking.h"
-#include "pointer.h"
-#include "hooks.h"
-#include "openboxwrap.h"
-#include "clientwrap.h"
+#include <glib.h>
#include <X11/Xutil.h>
/*! The event mask to grab on client windows */
XWindowAttributes attrib;
XSetWindowAttributes attrib_set;
/* XWMHints *wmhint; */
- PyObject *cw;
XGrabServer(ob_display);
XSync(ob_display, FALSE);
screen_update_struts();
- /* add to the python list */
- cw = clientwrap_new(client);
- PyList_Append(openboxwrap_obj->client_list, cw);
- Py_DECREF(cw);
-
- HOOKFIRECLIENT(managed, client);
+ /*HOOKFIRECLIENT(managed, client);XXX*/
client_showhide(client);
/* grab all mouse bindings */
- pointer_grab_all(client, TRUE);
+ /*pointer_grab_all(client, TRUE);XXX*/
/* update the list hints */
client_set_list();
void client_unmanage(Client *client)
{
- int j, seq;
- PyObject *cw;
+ int j;
GSList *it;
g_message("Unmanaging window: %lx", client->window);
- HOOKFIRECLIENT(closed, client);
+ /*HOOKFIRECLIENT(closed, client);XXX*/
/* remove the window from our save set */
XChangeSaveSet(ob_display, client->window, SetModeDelete);
XSelectInput(ob_display, client->window, NoEventMask);
/* ungrab any mouse bindings */
- pointer_grab_all(client, FALSE);
+ /*pointer_grab_all(client, FALSE);XXX*/
engine_frame_hide(client->frame);
influence */
screen_update_struts();
- /* remove from the python list */
- cw = clientwrap_new(client);
- seq = PySequence_Index(openboxwrap_obj->client_list, cw);
- if (seq == -1)
- PyErr_Clear();
- else
- PySequence_DelItem(openboxwrap_obj->client_list, seq);
- Py_DECREF(cw);
-
- /* notify the wrapper that its useless now */
- if (client->wrap != NULL)
- client->wrap->client = NULL;
-
/* tell our parent that we're gone */
if (client->transient_for != NULL)
client->transient_for->transients =
self->disabled_decorations = 0;
self->group = None;
self->nicons = 0;
- self->wrap = NULL;
client_get_area(self);
client_get_desktop(self);
/* fire the urgent callback if we're mapped, otherwise, wait until
after we're mapped */
if (self->frame)
- HOOKFIRECLIENT(urgent, self);
+ /*HOOKFIRECLIENT(urgent, self)XXX*/;
}
}
else
engine_frame_hide(self->frame);
- HOOKFIRECLIENT(visible, self);
+ /*HOOKFIRECLIENT(visible, self);XXX*/
}
gboolean client_normal(Client *self) {
client_shade(self, TRUE);
}
if (self->urgent)
- HOOKFIRECLIENT(urgent, self);
+ /*HOOKFIRECLIENT(urgent, self)XXX*/;
if (self->max_vert && self->max_horz) {
self->max_vert = self->max_horz = FALSE;
#include <glib.h>
#include <X11/Xlib.h>
-struct ClientWrap;
struct Frame;
Pixmap pixmap_icon;
/*! The mask for the pixmap_icon, or None if its not masked */
Pixmap pixmap_icon_mask;
-
- /* The instance of the wrapper class if one exists */
- struct ClientWrap *wrap;
} Client;
extern GSList *client_list;
--- /dev/null
+#include "dispatch.h"
+
+#include <glib.h>
+
+static GSList **funcs;
+
+void dispatch_startup()
+{
+ guint i;
+ EventType j;
+
+ i = 0;
+ j = EVENT_RANGE;
+ while (j > 1) {
+ j >>= 1;
+ ++i;
+ }
+ funcs = g_new(GSList*, i);
+
+ for (i = 0, j = 1; j < EVENT_RANGE; ++i, j <<= 1)
+ funcs[i] = NULL;
+}
+
+void dispatch_shutdown()
+{
+ guint i;
+ EventType j;
+
+ for (i = 0, j = 1; j < EVENT_RANGE; ++i, j <<= 1)
+ g_slist_free(funcs[i]);
+
+ g_free(funcs);
+}
+
+void dispatch_register(EventHandler h, EventMask mask)
+{
+ guint i;
+ EventType j;
+
+ while (mask) {
+ for (i = 0, j = 1; j < EVENT_RANGE; ++i, j <<= 1)
+ if (mask & j) {
+ funcs[i] = g_slist_append(funcs[i], h);
+ mask ^= j; /* remove from the mask */
+ }
+ g_assert(j >= EVENT_RANGE); /* an invalid event is in the mask */
+ }
+}
+
+void dispatch_x(XEvent *xe)
+{
+ EventType e;
+ guint i;
+ GSList *it;
+ ObEvent obe;
+
+ switch (xe->type) {
+ case EnterNotify:
+ e = Event_X_EnterNotify;
+ break;
+ case LeaveNotify:
+ e = Event_X_LeaveNotify;
+ break;
+ case KeyPress:
+ e = Event_X_KeyPress;
+ break;
+ case KeyRelease:
+ e = Event_X_KeyRelease;
+ break;
+ case ButtonPress:
+ e = Event_X_ButtonPress;
+ break;
+ case ButtonRelease:
+ e = Event_X_ButtonRelease;
+ break;
+ case MotionNotify:
+ e = Event_X_MotionNotify;
+ break;
+ default:
+ return;
+ }
+
+ obe.type = e;
+ obe.data.x = xe;
+
+ i = 0;
+ while (e > 1) {
+ e >>= 1;
+ ++i;
+ }
+
+ for (it = funcs[i]; it != NULL; it = it->next)
+ ((EventHandler)it->data)(&obe);
+}
+
+void dispatch_client(EventType e, Client *c)
+{
+ guint i;
+ GSList *it;
+ ObEvent obe;
+
+ obe.type = e;
+ obe.data.client = c;
+
+ i = 0;
+ while (e > 1) {
+ e >>= 1;
+ ++i;
+ }
+
+ for (it = funcs[i]; it != NULL; it = it->next)
+ ((EventHandler)it->data)(&obe);
+}
+
+void dispatch_ob(EventType e)
+{
+ guint i;
+ GSList *it;
+ ObEvent obe;
+
+ obe.type = e;
+
+ i = 0;
+ while (e > 1) {
+ e >>= 1;
+ ++i;
+ }
+
+ for (it = funcs[i]; it != NULL; it = it->next)
+ ((EventHandler)it->data)(&obe);
+}
+
+void dispatch_signal(int signal)
+{
+ guint i;
+ EventType e = Event_Signal;
+ GSList *it;
+ ObEvent obe;
+
+ obe.type = e;
+ obe.data.signal = signal;
+
+ i = 0;
+ while (e > 1) {
+ e >>= 1;
+ ++i;
+ }
+
+ for (it = funcs[i]; it != NULL; it = it->next)
+ ((EventHandler)it->data)(&obe);
+}
--- /dev/null
+#ifndef __dispatch_h
+#define __dispatch_h
+
+#include "client.h"
+#include <X11/Xlib.h>
+
+void dispatch_startup();
+void dispatch_shutdown();
+
+typedef enum {
+ Event_X_EnterNotify = 1 << 0,
+ Event_X_LeaveNotify = 1 << 1,
+ Event_X_KeyPress = 1 << 2,
+ Event_X_KeyRelease = 1 << 3,
+ Event_X_ButtonPress = 1 << 4,
+ Event_X_ButtonRelease = 1 << 5,
+ Event_X_MotionNotify = 1 << 6,
+
+ Event_Client_New = 1 << 7, /* new window, before mapping */
+ Event_Client_Mapped = 1 << 8, /* new window, after mapping */
+ Event_Client_Destroy = 1 << 9, /* unmanaged */
+ Event_Client_Focus = 1 << 10,
+ Event_Client_Unfocus = 1 << 11,
+
+ Event_Ob_Desktop = 1 << 12, /* changed desktops */
+ Event_Ob_NumDesktops = 1 << 13, /* changed the number of desktops */
+ Event_Ob_ShowDesktop = 1 << 14, /* entered/left show-the-desktop mode */
+ Event_Ob_Startup = 1 << 15, /* startup complete */
+ Event_Ob_Shutdown = 1 << 16, /* shutdown about to start */
+
+ Event_Signal = 1 << 17,
+
+ EVENT_RANGE = 1 << 18
+} EventType;
+
+typedef union {
+ XEvent *x; /* for Event_X_* event types */
+ Client *client; /* for Event_Client_* event types */
+ int signal;
+} EventData;
+
+typedef struct {
+ EventType type;
+ EventData data;
+} ObEvent;
+
+typedef void (*EventHandler)(const ObEvent *e);
+
+typedef unsigned int EventMask;
+
+void dispatch_register(EventHandler h, EventMask mask);
+
+void dispatch_x(XEvent *e);
+void dispatch_client(EventType e, Client *c);
+void dispatch_ob(EventType e);
+void dispatch_signal(int signal);
+
+#endif
#include "engine.h"
#include "focus.h"
#include "stacking.h"
-#include "keyboard.h"
-#include "pointer.h"
-#include "hooks.h"
#include "extensions.h"
#include "timer.h"
#include "engine.h"
switch(e->type) {
case EnterNotify:
if (client != NULL) engine_mouse_enter(client->frame, window);
- HOOKFIRECLIENT(pointerenter, client);
+ /*HOOKFIRECLIENT(pointerenter, client);XXX*/
break;
case LeaveNotify:
if (client != NULL) engine_mouse_leave(client->frame, window);
- HOOKFIRECLIENT(pointerleave, client);
+ /*HOOKFIRECLIENT(pointerleave, client);XXX*/
break;
case ButtonPress:
if (client != NULL)
engine_mouse_press(client->frame, window,
e->xbutton.x, e->xbutton.y);
- pointer_event(e, client);
+ /*pointer_event(e, client);XXX*/
break;
case ButtonRelease:
if (client != NULL)
engine_mouse_release(client->frame, window,
e->xbutton.x, e->xbutton.y);
- pointer_event(e, client);
+ /*pointer_event(e, client);XXX*/
break;
case MotionNotify:
- pointer_event(e, client);
+ /*pointer_event(e, client);XXX*/
break;
case KeyPress:
case KeyRelease:
- keyboard_event(&e->xkey);
+ /*keyboard_event(&e->xkey);XXX*/
break;
default:
/* XKB events */
if (e->type == extensions_xkb_event_basep) {
switch (((XkbAnyEvent*)&e)->xkb_type) {
case XkbBellNotify:
- HOOKFIRECLIENT(bell, client);
+ /*HOOKFIRECLIENT(bell, client);XXX*/
break;
}
}
/* we shouldn't be able to get this unless we're iconic */
g_assert(client->iconic);
- HOOKFIRECLIENT(requestactivate, client);
+ /*HOOKFIRECLIENT(requestactivate, client);XXX*/
break;
case ClientMessage:
/* validate cuz we query stuff off the client here */
/* if its not visible for other reasons, then don't mess
with it */
return;
- HOOKFIRECLIENT(requestactivate, client);
+ /*HOOKFIRECLIENT(requestactivate, client);XXX*/
}
break;
case PropertyNotify:
#include "client.h"
#include "screen.h"
#include "prop.h"
-#include "hooks.h"
#include <X11/Xlib.h>
active = client ? client->window : None;
PROP_SET32(ob_root, net_active_window, window, active);
- HOOKFIRECLIENT(focused, client);
+ /*HOOKFIRECLIENT(focused, client);XXX*/
}
#include "openbox.h"
#include "event.h"
#include "client.h"
+#include "dispatch.h"
#include "xerror.h"
#include "prop.h"
#include "screen.h"
#include "focus.h"
#include "extensions.h"
#include "gettext.h"
-#include "keyboard.h"
-#include "pointer.h"
#include "engine.h"
-#include "python.h"
-#include "hooks.h"
-#include "clientwrap.h"
-#include "openboxwrap.h"
-#include "configwrap.h"
#include "themerc.h"
#include "timer.h"
#include "../render/render.h"
if (screen_annex()) { /* it will be ours! */
timer_startup();
+ dispatch_startup();
render_startup();
font_startup();
themerc_startup();
engine_startup(themerc_engine);
- python_startup();
- configwrap_startup();
- openboxwrap_startup();
- clientwrap_startup();
- hooks_startup();
event_startup();
screen_startup();
focus_startup();
client_startup();
- keyboard_startup();
- pointer_startup();
- /* load the user's settings */
- if (!python_import("rc"))
- g_warning("ERROR LOADING RC FILE");
-
- HOOKFIRE(startup, "()");
+ /*HOOKFIRE(startup, "()");XXX*/
/* get all the existing windows */
client_manage_all();
client_unmanage_all();
- HOOKFIRE(shutdown, "()");
+ /*HOOKFIRE(shutdown, "()");XXX*/
- pointer_shutdown();
- keyboard_shutdown();
client_shutdown();
screen_shutdown();
event_shutdown();
- hooks_shutdown();
- clientwrap_shutdown();
- openboxwrap_shutdown();
- configwrap_shutdown();
- python_shutdown();
engine_shutdown();
themerc_shutdown();
render_shutdown();
+ dispatch_shutdown();
timer_shutdown();
}