gchar *name;
- ObActionsDataSetupFunc setup;
+ gboolean canbeinteractive;
+ union {
+ ObActionsIDataSetupFunc i;
+ ObActionsDataSetupFunc n;
+ } setup;
ObActionsDataFreeFunc free;
ObActionsRunFunc run;
- ObActionsInteractiveInputFunc i_input;
- ObActionsInteractiveCancelFunc i_cancel;
};
struct _ObActionsAct {
guint ref;
ObActionsDefinition *def;
+ ObActionsIPreFunc i_pre;
+ ObActionsIInputFunc i_input;
+ ObActionsICancelFunc i_cancel;
+ ObActionsIPostFunc i_post;
gpointer options;
};
}
}
-gboolean actions_register(const gchar *name,
- ObActionsDataSetupFunc setup,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run,
- ObActionsInteractiveInputFunc i_input,
- ObActionsInteractiveCancelFunc i_cancel)
+ObActionsDefinition* do_register(const gchar *name,
+ ObActionsDataFreeFunc free,
+ ObActionsRunFunc run)
{
GSList *it;
ObActionsDefinition *def;
g_assert(run != NULL);
- g_assert((i_input == NULL) == (i_cancel == NULL));
for (it = registered; it; it = g_slist_next(it)) {
def = it->data;
if (!g_ascii_strcasecmp(name, def->name)) /* already registered */
- return FALSE;
+ return NULL;
}
def = g_new(ObActionsDefinition, 1);
def->ref = 1;
def->name = g_strdup(name);
- def->setup = setup;
def->free = free;
def->run = run;
- def->i_input = i_input;
- def->i_cancel = i_cancel;
registered = g_slist_prepend(registered, def);
+ return def;
+}
+
+gboolean actions_register_i(const gchar *name,
+ ObActionsIDataSetupFunc setup,
+ ObActionsDataFreeFunc free,
+ ObActionsRunFunc run)
+{
+ ObActionsDefinition *def = do_register(name, free, run);
+ if (def) {
+ def->canbeinteractive = TRUE;
+ def->setup.i = setup;
+ }
+ return def != NULL;
+}
- return TRUE;
+gboolean actions_register(const gchar *name,
+ ObActionsDataSetupFunc setup,
+ ObActionsDataFreeFunc free,
+ ObActionsRunFunc run)
+{
+ ObActionsDefinition *def = do_register(name, free, run);
+ if (def) {
+ def->canbeinteractive = FALSE;
+ def->setup.n = setup;
+ }
+ return def != NULL;
}
static void actions_definition_ref(ObActionsDefinition *def)
act->ref = 1;
act->def = def;
actions_definition_ref(act->def);
+ act->i_pre = NULL;
+ act->i_input = NULL;
+ act->i_cancel = NULL;
+ act->i_post = NULL;
act->options = NULL;
} else
g_message(_("Invalid action \"%s\" requested. No such action exists."),
{
ObActionsAct *act = NULL;
- if ((act = actions_build_act_from_string(name)))
- if (act->def->setup)
- act->options = act->def->setup(NULL);
+ if ((act = actions_build_act_from_string(name))) {
+ if (act->def->canbeinteractive) {
+ if (act->def->setup.i) {
+ act->options = act->def->setup.i(NULL,
+ &act->i_pre,
+ &act->i_input,
+ &act->i_cancel,
+ &act->i_post);
+ g_assert(!!act->i_input == !!act->i_cancel);
+ }
+ }
+ else {
+ if (act->def->setup.n)
+ act->options = act->def->setup.n(NULL);
+ }
+ }
+
return act;
}
ObActionsAct *act = NULL;
if (obt_parse_attr_string(node, "name", &name)) {
- if ((act = actions_build_act_from_string(name)))
+ if ((act = actions_build_act_from_string(name))) {
/* there is more stuff to parse here */
- if (act->def->setup)
- act->options = act->def->setup(node->children);
-
+ if (act->def->canbeinteractive) {
+ if (act->def->setup.i) {
+ act->options = act->def->setup.i(node->children,
+ &act->i_pre,
+ &act->i_input,
+ &act->i_cancel,
+ &act->i_post);
+ g_assert(!!act->i_input == !!act->i_cancel);
+ }
+ }
+ else {
+ if (act->def->setup.n)
+ act->options = act->def->setup.n(node->children);
+ }
+ }
g_free(name);
}
gboolean actions_act_is_interactive(ObActionsAct *act)
{
- return act->def->i_cancel != NULL;
+ return act->i_cancel != NULL;
}
void actions_act_ref(ObActionsAct *act)
/* cancel the old one */
if (interactive_act)
actions_interactive_cancel_act();
+ if (act->i_pre)
+ act->i_pre(act->options);
ok = actions_interactive_begin_act(act, state);
}
}
actions_interactive_end_act();
} else {
/* make sure its interactive if it returned TRUE */
- g_assert(act->def->i_cancel && act->def->i_input);
+ g_assert(act->i_cancel);
/* no actions are run after the interactive one */
break;
void actions_interactive_cancel_act(void)
{
if (interactive_act) {
- interactive_act->def->i_cancel(interactive_act->options);
+ interactive_act->i_cancel(interactive_act->options);
actions_interactive_end_act();
}
}
if (interactive_act) {
ungrab_keyboard();
+ if (interactive_act->i_post)
+ interactive_act->i_post(interactive_act->options);
+
actions_act_unref(interactive_act);
interactive_act = NULL;
}
{
gboolean used = FALSE;
if (interactive_act) {
- if (!interactive_act->def->i_input(interactive_initial_state, e,
- interactive_act->options, &used))
+ if (!interactive_act->i_input(interactive_initial_state, e,
+ interactive_act->options, &used))
{
used = TRUE; /* if it cancelled the action then it has to of
been used */
typedef struct _ObActionsClientData ObActionsClientData;
typedef struct _ObActionsSelectorData ObActionsSelectorData;
-typedef gpointer (*ObActionsDataSetupFunc)(xmlNodePtr node);
typedef void (*ObActionsDataFreeFunc)(gpointer options);
typedef gboolean (*ObActionsRunFunc)(ObActionsData *data,
gpointer options);
-typedef gboolean (*ObActionsInteractiveInputFunc)(guint initial_state,
+typedef gpointer (*ObActionsDataSetupFunc)(xmlNodePtr node);
+
+/* functions for interactive actions */
+typedef void (*ObActionsIPreFunc)(gpointer options);
+typedef void (*ObActionsIPostFunc)(gpointer options);
+typedef gboolean (*ObActionsIInputFunc)(guint initial_state,
XEvent *e,
gpointer options,
gboolean *used);
-typedef void (*ObActionsInteractiveCancelFunc)(gpointer options);
+typedef void (*ObActionsICancelFunc)(gpointer options);
+typedef gpointer (*ObActionsIDataSetupFunc)(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post);
struct _ObActionsData {
ObUserAction uact;
void actions_startup(gboolean reconfigure);
void actions_shutdown(gboolean reconfigure);
-/*! If the action is interactive, then i_input and i_cancel are not NULL.
- Otherwise, they should both be NULL. */
+/*! Use this if the actions created from this name may be interactive */
+gboolean actions_register_i(const gchar *name,
+ ObActionsIDataSetupFunc setup,
+ ObActionsDataFreeFunc free,
+ ObActionsRunFunc run);
+
gboolean actions_register(const gchar *name,
ObActionsDataSetupFunc setup,
ObActionsDataFreeFunc free,
- ObActionsRunFunc run,
- ObActionsInteractiveInputFunc i_input,
- ObActionsInteractiveCancelFunc i_cancel);
+ ObActionsRunFunc run);
ObActionsAct* actions_parse(xmlNodePtr node);
ObActionsAct* actions_parse_string(const gchar *name);
void action_addremovedesktop_startup(void)
{
- actions_register("AddDesktop", setup_add_func, g_free, run_func,
- NULL, NULL);
- actions_register("RemoveDesktop", setup_remove_func, g_free, run_func,
- NULL, NULL);
+ actions_register("AddDesktop", setup_add_func, g_free, run_func);
+ actions_register("RemoveDesktop", setup_remove_func, g_free, run_func);
/* 3.4-compatibility */
- actions_register("AddDesktopLast", setup_addlast_func, g_free, run_func,
- NULL, NULL);
- actions_register("RemoveDesktopLast", setup_removelast_func, g_free, run_func,
- NULL, NULL);
- actions_register("AddDesktopCurrent", setup_addcurrent_func, g_free, run_func,
- NULL, NULL);
- actions_register("RemoveDesktopCurrent", setup_removecurrent_func, g_free, run_func,
- NULL, NULL);
+ actions_register("AddDesktopLast", setup_addlast_func, g_free, run_func);
+ actions_register("RemoveDesktopLast", setup_removelast_func,
+ g_free, run_func);
+ actions_register("AddDesktopCurrent", setup_addcurrent_func,
+ g_free, run_func);
+ actions_register("RemoveDesktopCurrent", setup_removecurrent_func,
+ g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
{
actions_register("BreakChroot",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
{
actions_register("Close",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
gboolean raise;
ObFocusCyclePopupMode dialog_mode;
GSList *actions;
-} Options;
-static gboolean cycling = FALSE;
-static gpointer setup_func(xmlNodePtr node);
-static gpointer setup_forward_func(xmlNodePtr node);
-static gpointer setup_backward_func(xmlNodePtr node);
+ /* options for after we're done */
+ gboolean cancel; /* did the user cancel or not */
+ guint state; /* keyboard state when finished */
+} Options;
+
+static gpointer setup_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPreFunc *post);
+static gpointer setup_forward_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPreFunc *post);
+static gpointer setup_backward_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPreFunc *post);
static void free_func(gpointer options);
static gboolean run_func(ObActionsData *data, gpointer options);
static gboolean i_input_func(guint initial_state,
gpointer options,
gboolean *used);
static void i_cancel_func(gpointer options);
-
-static void end_cycle(gboolean cancel, guint state, Options *o);
+static void i_post_func(gpointer options);
void action_cyclewindows_startup(void)
{
- actions_register("NextWindow", setup_forward_func, free_func,
- run_func, i_input_func, i_cancel_func);
- actions_register("PreviousWindow", setup_backward_func, free_func,
- run_func, i_input_func, i_cancel_func);
+ actions_register_i("NextWindow", setup_forward_func, free_func, run_func);
+ actions_register_i("PreviousWindow", setup_backward_func, free_func,
+ run_func);
}
-static gpointer setup_func(xmlNodePtr node)
+static gpointer setup_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPreFunc *post)
{
xmlNodePtr n;
Options *o;
actions_parse_string("Unshade"));
}
+ *input = i_input_func;
+ *cancel = i_cancel_func;
+ *post = i_post_func;
return o;
}
-static gpointer setup_forward_func(xmlNodePtr node)
+static gpointer setup_forward_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPreFunc *post)
{
- Options *o = setup_func(node);
+ Options *o = setup_func(node, pre, input, cancel, post);
o->forward = TRUE;
return o;
}
-static gpointer setup_backward_func(xmlNodePtr node)
+static gpointer setup_backward_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPreFunc *post)
{
- Options *o = setup_func(node);
+ Options *o = setup_func(node, pre, input, cancel, post);
o->forward = FALSE;
return o;
}
o->bar,
o->dialog_mode,
FALSE, FALSE);
- cycling = TRUE;
stacking_restore();
if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft));
gpointer options,
gboolean *used)
{
+ Options *o = options;
+
if (e->type == KeyPress) {
/* Escape cancels no matter what */
if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) {
- end_cycle(TRUE, e->xkey.state, options);
+ o->cancel = TRUE;
+ o->state = e->xkey.state;
return FALSE;
}
else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) &&
!initial_state)
{
- end_cycle(FALSE, e->xkey.state, options);
+ o->cancel = FALSE;
+ o->state = e->xkey.state;
return FALSE;
}
}
else if (e->type == KeyRelease && initial_state &&
(e->xkey.state & initial_state) == 0)
{
- end_cycle(FALSE, e->xkey.state, options);
+ o->cancel = FALSE;
+ o->state = e->xkey.state;
return FALSE;
}
static void i_cancel_func(gpointer options)
{
- /* we get cancelled when we move focus, but we're not cycling anymore, so
- just ignore that */
- if (cycling)
- end_cycle(TRUE, 0, options);
+ Options *o = options;
+ o->cancel = TRUE;
+ o->state = 0;
}
-static void end_cycle(gboolean cancel, guint state, Options *o)
+static void i_post_func(gpointer options)
{
+ Options *o = options;
struct _ObClient *ft;
ft = focus_cycle(o->forward,
TRUE,
o->bar,
o->dialog_mode,
- TRUE, cancel);
- cycling = FALSE;
+ TRUE, o->cancel);
if (ft)
actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
- state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
+ o->state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
stacking_restore();
}
void action_debug_startup(void)
{
- actions_register("Debug", setup_func, free_func, run_func, NULL, NULL);
+ actions_register("Debug", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_decorations_startup(void)
{
- actions_register("Decorate", NULL, NULL, run_func_on, NULL, NULL);
- actions_register("Undecorate", NULL, NULL, run_func_off, NULL, NULL);
- actions_register("ToggleDecorations", NULL, NULL, run_func_toggle,
- NULL, NULL);
+ actions_register("Decorate", NULL, NULL, run_func_on);
+ actions_register("Undecorate", NULL, NULL, run_func_off);
+ actions_register("ToggleDecorations", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
void action_desktop_startup(void)
{
- actions_register("GoToDesktop", setup_go_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktop", setup_send_func, g_free, run_func,
- NULL, NULL);
+ actions_register("GoToDesktop", setup_go_func, g_free, run_func);
+ actions_register("SendToDesktop", setup_send_func, g_free, run_func);
/* 3.4-compatibility */
- actions_register("DesktopLast", setup_go_last_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopLast", setup_send_last_func, g_free, run_func,
- NULL, NULL);
- actions_register("Desktop", setup_go_abs_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktop", setup_send_abs_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopNext", setup_go_next_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopNext", setup_send_next_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopPrevious", setup_go_prev_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopPrevious", setup_send_prev_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopLeft", setup_go_left_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopLeft", setup_send_left_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopRight", setup_go_right_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopRight", setup_send_right_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopUp", setup_go_up_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopUp", setup_send_up_func, g_free, run_func,
- NULL, NULL);
- actions_register("DesktopDown", setup_go_down_func, g_free, run_func,
- NULL, NULL);
- actions_register("SendToDesktopDown", setup_send_down_func, g_free, run_func,
- NULL, NULL);
+ actions_register("DesktopLast", setup_go_last_func, g_free, run_func);
+ actions_register("SendToDesktopLast", setup_send_last_func,
+ g_free, run_func);
+ actions_register("Desktop", setup_go_abs_func, g_free, run_func);
+ actions_register("SendToDesktop", setup_send_abs_func, g_free, run_func);
+ actions_register("DesktopNext", setup_go_next_func, g_free, run_func);
+ actions_register("SendToDesktopNext", setup_send_next_func,
+ g_free, run_func);
+ actions_register("DesktopPrevious", setup_go_prev_func, g_free, run_func);
+ actions_register("SendToDesktopPrevious", setup_send_prev_func,
+ g_free, run_func);
+ actions_register("DesktopLeft", setup_go_left_func, g_free, run_func);
+ actions_register("SendToDesktopLeft", setup_send_left_func,
+ g_free, run_func);
+ actions_register("DesktopRight", setup_go_right_func, g_free, run_func);
+ actions_register("SendToDesktopRight", setup_send_right_func,
+ g_free, run_func);
+ actions_register("DesktopUp", setup_go_up_func, g_free, run_func);
+ actions_register("SendToDesktopUp", setup_send_up_func, g_free, run_func);
+ actions_register("DesktopDown", setup_go_down_func, g_free, run_func);
+ actions_register("SendToDesktopDown", setup_send_down_func,
+ g_free, run_func);
}
static gpointer setup_go_func(xmlNodePtr node)
static gboolean cycling = FALSE;
static gpointer setup_func(xmlNodePtr node);
-static gpointer setup_cycle_func(xmlNodePtr node);
+static gpointer setup_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post);
static gpointer setup_target_func(xmlNodePtr node);
static void free_func(gpointer options);
static gboolean run_func(ObActionsData *data, gpointer options);
static void end_cycle(gboolean cancel, guint state, Options *o);
/* 3.4-compatibility */
-static gpointer setup_north_cycle_func(xmlNodePtr node);
-static gpointer setup_south_cycle_func(xmlNodePtr node);
-static gpointer setup_east_cycle_func(xmlNodePtr node);
-static gpointer setup_west_cycle_func(xmlNodePtr node);
-static gpointer setup_northwest_cycle_func(xmlNodePtr node);
-static gpointer setup_northeast_cycle_func(xmlNodePtr node);
-static gpointer setup_southwest_cycle_func(xmlNodePtr node);
-static gpointer setup_southeast_cycle_func(xmlNodePtr node);
+static gpointer setup_north_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_south_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_east_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_west_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_northwest_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_northeast_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_southwest_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
+static gpointer setup_southeast_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *in,
+ ObActionsICancelFunc *c,
+ ObActionsIPostFunc *post);
static gpointer setup_north_target_func(xmlNodePtr node);
static gpointer setup_south_target_func(xmlNodePtr node);
static gpointer setup_east_target_func(xmlNodePtr node);
void action_directionalwindows_startup(void)
{
- actions_register("DirectionalCycleWindows", setup_cycle_func, free_func,
- run_func, i_input_func, i_cancel_func);
+ actions_register_i("DirectionalCycleWindows", setup_cycle_func, free_func,
+ run_func);
actions_register("DirectionalTargetWindow", setup_target_func, free_func,
- run_func, NULL, NULL);
+ run_func);
/* 3.4-compatibility */
- actions_register("DirectionalFocusNorth", setup_north_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusSouth", setup_south_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusWest", setup_west_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusEast", setup_east_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusNorthWest", setup_northwest_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusNorthEast", setup_northeast_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusSouthWest", setup_southwest_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
- actions_register("DirectionalFocusSouthEast", setup_southeast_cycle_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ actions_register_i("DirectionalFocusNorth", setup_north_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusSouth", setup_south_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusWest", setup_west_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusEast", setup_east_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusNorthWest", setup_northwest_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusNorthEast", setup_northeast_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusSouthWest", setup_southwest_cycle_func,
+ free_func, run_func);
+ actions_register_i("DirectionalFocusSouthEast", setup_southeast_cycle_func,
+ free_func, run_func);
actions_register("DirectionalTargetNorth", setup_north_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetSouth", setup_south_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetWest", setup_west_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetEast", setup_east_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetNorthWest", setup_northwest_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetNorthEast", setup_northeast_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetSouthWest", setup_southwest_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
actions_register("DirectionalTargetSouthEast", setup_southeast_target_func,
- free_func, run_func, i_input_func, i_cancel_func);
+ free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
return o;
}
-static gpointer setup_cycle_func(xmlNodePtr node)
+static gpointer setup_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
Options *o = setup_func(node);
o->interactive = TRUE;
+ *input = i_input_func;
+ *cancel = i_cancel_func;
return o;
}
}
/* 3.4-compatibility */
-static gpointer setup_north_cycle_func(xmlNodePtr node)
+static gpointer setup_north_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_NORTH;
return o;
}
-static gpointer setup_south_cycle_func(xmlNodePtr node)
+static gpointer setup_south_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_SOUTH;
return o;
}
-static gpointer setup_east_cycle_func(xmlNodePtr node)
+static gpointer setup_east_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_EAST;
return o;
}
-static gpointer setup_west_cycle_func(xmlNodePtr node)
+static gpointer setup_west_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_WEST;
return o;
}
-static gpointer setup_northwest_cycle_func(xmlNodePtr node)
+static gpointer setup_northwest_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_NORTHWEST;
return o;
}
-static gpointer setup_northeast_cycle_func(xmlNodePtr node)
+static gpointer setup_northeast_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_EAST;
return o;
}
-static gpointer setup_southwest_cycle_func(xmlNodePtr node)
+static gpointer setup_southwest_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_SOUTHWEST;
return o;
}
-static gpointer setup_southeast_cycle_func(xmlNodePtr node)
+static gpointer setup_southeast_cycle_func(xmlNodePtr node,
+ ObActionsIPreFunc *pre,
+ ObActionsIInputFunc *input,
+ ObActionsICancelFunc *cancel,
+ ObActionsIPostFunc *post)
{
- Options *o = setup_cycle_func(node);
+ Options *o = setup_cycle_func(node, pre, input, cancel, post);
o->direction = OB_DIRECTION_SOUTHEAST;
return o;
}
{
actions_register("ToggleDockAutoHide",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
void action_execute_startup(void)
{
- actions_register("Execute", setup_func, free_func, run_func, NULL, NULL);
+ actions_register("Execute", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_exit_startup(void)
{
- actions_register("Exit", setup_func, NULL, run_func, NULL, NULL);
- actions_register("SessionLogout", setup_func, NULL, run_func, NULL, NULL);
+ actions_register("Exit", setup_func, NULL, run_func);
+ actions_register("SessionLogout", setup_func, NULL, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_focus_startup(void)
{
- actions_register("Focus", setup_func, g_free, run_func, NULL, NULL);
+ actions_register("Focus", setup_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_focustobottom_startup(void)
{
- actions_register("FocusToBottom", NULL, NULL, run_func, NULL, NULL);
+ actions_register("FocusToBottom", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
void action_fullscreen_startup(void)
{
- actions_register("ToggleFullscreen", NULL, NULL, run_func_toggle,
- NULL, NULL);
+ actions_register("ToggleFullscreen", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
void action_growtoedge_startup(void)
{
actions_register("GrowToEdge", setup_func,
- g_free, run_func, NULL, NULL);
+ g_free, run_func);
actions_register("ShrinkToEdge", setup_shrink_func,
- g_free, run_func, NULL, NULL);
+ g_free, run_func);
/* 3.4-compatibility */
- actions_register("GrowToEdgeNorth", setup_north_func, g_free, run_func,
- NULL, NULL);
- actions_register("GrowToEdgeSouth", setup_south_func, g_free, run_func,
- NULL, NULL);
- actions_register("GrowToEdgeEast", setup_east_func, g_free, run_func,
- NULL, NULL);
- actions_register("GrowToEdgeWest", setup_west_func, g_free, run_func,
- NULL, NULL);
+ actions_register("GrowToEdgeNorth", setup_north_func, g_free, run_func);
+ actions_register("GrowToEdgeSouth", setup_south_func, g_free, run_func);
+ actions_register("GrowToEdgeEast", setup_east_func, g_free, run_func);
+ actions_register("GrowToEdgeWest", setup_west_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
{
actions_register("Iconify",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
void action_if_startup(void)
{
- actions_register("If", setup_func, free_func, run_func, NULL, NULL);
+ actions_register("If", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
{
actions_register("Kill",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
void action_layer_startup(void)
{
actions_register("ToggleAlwaysOnTop", setup_func_top, g_free,
- run_func, NULL, NULL);
+ run_func);
actions_register("ToggleAlwaysOnBottom", setup_func_bottom, g_free,
- run_func, NULL, NULL);
+ run_func);
actions_register("SendToLayer", setup_func_send, g_free,
- run_func, NULL, NULL);
+ run_func);
/* 3.4-compatibility */
actions_register("SendToTopLayer", setup_sendtop_func, g_free,
- run_func, NULL, NULL);
+ run_func);
actions_register("SendToBottomLayer", setup_sendbottom_func, g_free,
- run_func, NULL, NULL);
+ run_func);
actions_register("SendToNormalLayer", setup_sendnormal_func, g_free,
- run_func, NULL, NULL);
+ run_func);
}
static gpointer setup_func_top(xmlNodePtr node)
{
actions_register("Lower",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
void action_maximize_startup(void)
{
- actions_register("Maximize", setup_func, g_free, run_func_on,
- NULL, NULL);
- actions_register("Unmaximize", setup_func, g_free, run_func_off,
- NULL, NULL);
- actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle,
- NULL, NULL);
+ actions_register("Maximize", setup_func, g_free, run_func_on);
+ actions_register("Unmaximize", setup_func, g_free, run_func_off);
+ actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle);
/* 3.4-compatibility */
actions_register("MaximizeFull", setup_both_func, g_free,
- run_func_on, NULL, NULL);
+ run_func_on);
actions_register("UnmaximizeFull", setup_both_func, g_free,
- run_func_off, NULL, NULL);
+ run_func_off);
actions_register("ToggleMaximizeFull", setup_both_func, g_free,
- run_func_toggle, NULL, NULL);
+ run_func_toggle);
actions_register("MaximizeHorz", setup_horz_func, g_free,
- run_func_on, NULL, NULL);
+ run_func_on);
actions_register("UnmaximizeHorz", setup_horz_func, g_free,
- run_func_off, NULL, NULL);
+ run_func_off);
actions_register("ToggleMaximizeHorz", setup_horz_func, g_free,
- run_func_toggle, NULL, NULL);
+ run_func_toggle);
actions_register("MaximizeVert", setup_vert_func, g_free,
- run_func_on, NULL, NULL);
+ run_func_on);
actions_register("UnmaximizeVert", setup_vert_func, g_free,
- run_func_off, NULL, NULL);
+ run_func_off);
actions_register("ToggleMaximizeVert", setup_vert_func, g_free,
- run_func_toggle, NULL, NULL);
+ run_func_toggle);
}
static gpointer setup_func(xmlNodePtr node)
{
actions_register("Move",
NULL, NULL,
- run_func,
- NULL, NULL);
+ run_func);
}
/* Always return FALSE because its not interactive */
void action_moverelative_startup(void)
{
- actions_register("MoveRelative", setup_func, g_free, run_func, NULL, NULL);
+ actions_register("MoveRelative", setup_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_moveresizeto_startup(void)
{
- actions_register("MoveResizeTo", setup_func, g_free, run_func, NULL, NULL);
-/* 3.4-compatibility */
- actions_register("MoveToCenter", setup_center_func, g_free, run_func,
- NULL, NULL);
+ actions_register("MoveResizeTo", setup_func, g_free, run_func);
+ /* 3.4-compatibility */
+ actions_register("MoveToCenter", setup_center_func, g_free, run_func);
}
static void parse_coord(xmlNodePtr n, gint *pos,
void action_movetoedge_startup(void)
{
- actions_register("MoveToEdge", setup_func, g_free, run_func, NULL, NULL);
+ actions_register("MoveToEdge", setup_func, g_free, run_func);
/* 3.4-compatibility */
- actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func,
- NULL, NULL);
- actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func,
- NULL, NULL);
- actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func,
- NULL, NULL);
- actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func,
- NULL, NULL);
+ actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func);
+ actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func);
+ actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func);
+ actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_omnipresent_startup(void)
{
- actions_register("ToggleOmnipresent", NULL, NULL, run_func_toggle,
- NULL, NULL);
+ actions_register("ToggleOmnipresent", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
void action_raise_startup(void)
{
- actions_register("Raise",
- NULL, NULL,
- run_func,
- NULL, NULL);
+ actions_register("Raise", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
void action_raiselower_startup(void)
{
- actions_register("RaiseLower",
- NULL, NULL,
- run_func,
- NULL, NULL);
+ actions_register("RaiseLower", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
void action_reconfigure_startup(void)
{
- actions_register("Reconfigure",
- NULL, NULL,
- run_func,
- NULL, NULL);
+ actions_register("Reconfigure", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
void action_resize_startup(void)
{
- actions_register("Resize", setup_func, g_free, run_func, NULL, NULL);
+ actions_register("Resize", setup_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_resizerelative_startup(void)
{
- actions_register("ResizeRelative", setup_func, g_free, run_func,
- NULL, NULL);
+ actions_register("ResizeRelative", setup_func, g_free, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_restart_startup(void)
{
- actions_register("Restart", setup_func, free_func, run_func, NULL, NULL);
+ actions_register("Restart", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_shade_startup(void)
{
- actions_register("Shade", NULL, NULL, run_func_on, NULL, NULL);
- actions_register("Unshade", NULL, NULL, run_func_off, NULL, NULL);
- actions_register("ToggleShade", NULL, NULL, run_func_toggle, NULL, NULL);
+ actions_register("Shade", NULL, NULL, run_func_on);
+ actions_register("Unshade", NULL, NULL, run_func_off);
+ actions_register("ToggleShade", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
void action_shadelowerraise_startup()
{
/* 3.4-compatibility */
- actions_register("ShadeLower", NULL, NULL, run_func_sl, NULL, NULL);
- actions_register("UnshadeRaise", NULL, NULL, run_func_ur, NULL, NULL);
+ actions_register("ShadeLower", NULL, NULL, run_func_sl);
+ actions_register("UnshadeRaise", NULL, NULL, run_func_ur);
}
/* Always return FALSE because its not interactive */
void action_showdesktop_startup(void)
{
- actions_register("ToggleShowDesktop",
- NULL, NULL,
- run_func,
- NULL, NULL);
+ actions_register("ToggleShowDesktop", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
void action_showmenu_startup(void)
{
- actions_register("ShowMenu", setup_func, free_func, run_func,
- NULL, NULL);
+ actions_register("ShowMenu", setup_func, free_func, run_func);
}
static gpointer setup_func(xmlNodePtr node)
void action_unfocus_startup(void)
{
- actions_register("Unfocus", NULL, NULL, run_func, NULL, NULL);
+ actions_register("Unfocus", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */