X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions.h;fp=openbox%2Factions.h;h=2cafa3063ddfcbf0e6e9f0267b1282f62d671ac1;hb=314c0566371d83305d723c883884555a24cc0ad8;hp=548b40b5bc4d17dbeff712946805ebcf94e715af;hpb=828d06f271392abbef75bb37e2635b2085bdef90;p=chaz%2Fopenbox diff --git a/openbox/actions.h b/openbox/actions.h index 548b40b5..2cafa306 100644 --- a/openbox/actions.h +++ b/openbox/actions.h @@ -20,6 +20,7 @@ #include "frame.h" #include "parser/parse.h" #include +#include typedef struct _ObActionsDefinition ObActionsDefinition; typedef struct _ObActionsAct ObActionsAct; @@ -56,21 +57,24 @@ typedef enum { OB_ACTION_TYPE_SELECTOR } ObActionsType; +/* These structures are all castable as eachother */ + struct _ObActionsAnyData { ObUserAction uact; + Time time; + guint state; + guint button; gint x; gint y; - gint button; - Time time; - - ObActionsInteractiveState interactive; }; struct _ObActionsGlobalData { + ObActionsType type; ObActionsAnyData any; }; struct _ObActionsClientData { + ObActionsType type; ObActionsAnyData any; struct _ObClient *c; @@ -78,8 +82,10 @@ struct _ObActionsClientData { }; struct _ObActionsSelectorData { + ObActionsType type; ObActionsAnyData any; + ObActionsInteractiveState interactive; GSList *actions; }; @@ -98,7 +104,7 @@ void actions_startup(gboolean reconfigure); void actions_shutdown(gboolean reconfigure); gboolean actions_register(const gchar *name, - gboolean allow_interactive, + ObActionsType type, ObActionsDataSetupFunc setup, ObActionsDataFreeFunc free, ObActionsRunFunc run); @@ -110,3 +116,15 @@ ObActionsAct* actions_parse_string(const gchar *name); void actions_act_ref(ObActionsAct *act); void actions_act_unref(ObActionsAct *act); + +/*! Pass in a GSList of ObActionsAct's to be run */ +void actions_run_acts(GSList *acts, + ObUserAction uact, + Time time, + guint state, + guint button, + gint x, + gint y, + ObFrameContext con, + struct _ObClient *client, + ObActionsInteractiveState interactive);