summaryrefslogtreecommitdiff
path: root/openbox/actions.h
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-21 23:17:45 +0000
committerDana Jansens <danakj@orodu.net>2007-06-21 23:17:45 +0000
commit5e8ec2cb781ba07341a5970b3e829cc59a8cf332 (patch)
treef7d9b1e624669e6cf54c8999b3606be14fd3bd79 /openbox/actions.h
parente5b94e6072287d39a777a3cedd0f10a66c58a2b5 (diff)
maybe the new actions framework is kinda there now
Diffstat (limited to 'openbox/actions.h')
-rw-r--r--openbox/actions.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/openbox/actions.h b/openbox/actions.h
index cb1d377f..ca152e28 100644
--- a/openbox/actions.h
+++ b/openbox/actions.h
@@ -22,6 +22,8 @@
#include <glib.h>
typedef struct _ObActionsDefinition ObActionsDefinition;
+typedef struct _ObActionsAct ObActionsAct;
+typedef struct _ObActionsData ObActionsData;
typedef struct _ObActionsAnyData ObActionsAnyData;
typedef struct _ObActionsGlobalData ObActionsGlobalData;
typedef struct _ObActionsClientData ObActionsClientData;
@@ -34,13 +36,11 @@ typedef enum {
OB_NUM_ACTIONS_INTERACTIVE_STATES
} ObActionsInteractiveState;
-typedef gpointer (*ObActionsDataSetupFunc)();
-typedef void (*ObActionsDataParseFunc)(gpointer action_data,
- ObParseInst *i,
+typedef gpointer (*ObActionsDataSetupFunc)(ObParseInst *i,
xmlDocPtr doc, xmlNodePtr node);
-typedef void (*ObActionsDataFreeFunc)(gpointer action_data);
-typedef void (*ObActionsRunFunc)(ObActionsAnyData *data,
- gpointer action_data);
+typedef void (*ObActionsDataFreeFunc)(gpointer options);
+typedef void (*ObActionsRunFunc)(ObActionsData *data,
+ gpointer options);
/*
The theory goes:
@@ -50,6 +50,12 @@ typedef void (*ObActionsRunFunc)(ObActionsAnyData *data,
06:11 (@dana) eg show menu/exit, raise/focus, and cycling/directional/expose
*/
+typedef enum {
+ OB_ACTION_TYPE_GLOBAL,
+ OB_ACTION_TYPE_CLIENT,
+ OB_ACTION_TYPE_SELECTOR
+} ObActionsType;
+
struct _ObActionsAnyData {
ObUserAction uact;
gint x;
@@ -77,12 +83,29 @@ struct _ObActionsSelectorData {
GSList *actions;
};
+struct _ObActionsData {
+ ObActionsType type;
+
+ union {
+ ObActionsAnyData any;
+ ObActionsGlobalData global;
+ ObActionsClientData client;
+ ObActionsSelectorData selector;
+ };
+};
+
void actions_startup(gboolean reconfigure);
void actions_shutdown(gboolean reconfigure);
gboolean actions_register(const gchar *name,
- gboolean interactive,
+ gboolean allow_interactive,
ObActionsDataSetupFunc setup,
- ObActionsDataParseFunc parse,
ObActionsDataFreeFunc free,
ObActionsRunFunc run);
+
+ObActionsAct* actions_parse(ObParseInst *i,
+ xmlDocPtr doc,
+ xmlNodePtr node);
+
+void actions_act_ref(ObActionsAct *act);
+void actions_act_unref(ObActionsAct *act);