diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-16 21:11:39 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-16 21:11:39 +0000 |
| commit | f8a47de5ec444c452093371e3db16857eb39a490 (patch) | |
| tree | 31db2567842d98232775f9980f7a8d2586c0ac71 /openbox/hooks.h | |
| parent | 8ba0586bcbdc7fe9648f1063812126d71a041670 (diff) | |
merge the C branch into HEAD
Diffstat (limited to 'openbox/hooks.h')
| -rw-r--r-- | openbox/hooks.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/openbox/hooks.h b/openbox/hooks.h new file mode 100644 index 00000000..3211d7cf --- /dev/null +++ b/openbox/hooks.h @@ -0,0 +1,56 @@ +#ifndef __hooks_h +#define __hooks_h + +#include "clientwrap.h" +#include <Python.h> + +void hooks_startup(); +void hooks_shutdown(); + +struct HookObject; + +struct HookObject *hooks_create(char *name); + +struct HookObject *hook_startup; +struct HookObject *hook_shutdown; +struct HookObject *hook_visibledesktop; +struct HookObject *hook_numdesktops; +struct HookObject *hook_desktopnames; +struct HookObject *hook_showdesktop; +struct HookObject *hook_screenconfiguration; +struct HookObject *hook_screenarea; +struct HookObject *hook_managed; +struct HookObject *hook_closed; +struct HookObject *hook_bell; +struct HookObject *hook_urgent; +struct HookObject *hook_pointerenter; +struct HookObject *hook_pointerleave; +struct HookObject *hook_focused; +struct HookObject *hook_requestactivate; +struct HookObject *hook_title; +struct HookObject *hook_desktop; +struct HookObject *hook_iconic; +struct HookObject *hook_shaded; +struct HookObject *hook_maximized; +struct HookObject *hook_fullscreen; +struct HookObject *hook_visible; +struct HookObject *hook_configuration; + +#define HOOKFIRE(hook, ...) \ +{ \ + PyObject *args = Py_BuildValue(__VA_ARGS__); \ + g_assert(args != NULL); \ + hooks_fire(hook_##hook, args); \ + Py_DECREF(args); \ +} + +#define HOOKFIRECLIENT(hook, client) \ +{ \ + hooks_fire_client(hook_##hook, client); \ +} + +void hooks_fire(struct HookObject *hook, PyObject *args); + +void hooks_fire_client(struct HookObject *hook, struct Client *client); + +#endif |
