From: Dana Jansens Date: Thu, 17 Dec 2009 15:23:48 +0000 (-0500) Subject: Make it possible for an action name to choose whether it is interactive or not based... X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=d18d9c9379e3387073fc9346e9857fdde077b985;p=chaz%2Fopenbox Make it possible for an action name to choose whether it is interactive or not based on its options. This way we can use the same name with options for an interactive action and a non-interactive action. Shorten the names of the ObActionsInteractive* functions to ObActionsI* Add a ObActionsIPreFunc that is called for interactive actions before the interactivity (key/mouse grab) is started. Add a ObActionsIPostFunc that is called for interactive actions after the interactiviti (key/mouse grab) has ended. --- diff --git a/openbox/actions.c b/openbox/actions.c index 1ec53287..26def978 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -42,17 +42,23 @@ struct _ObActionsDefinition { 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; }; @@ -78,37 +84,55 @@ void actions_shutdown(gboolean reconfig) } } -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) @@ -144,6 +168,10 @@ static ObActionsAct* actions_build_act_from_string(const gchar *name) 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."), @@ -156,9 +184,23 @@ ObActionsAct* actions_parse_string(const gchar *name) { 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; } @@ -169,11 +211,23 @@ ObActionsAct* actions_parse(xmlNodePtr node) 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); } @@ -182,7 +236,7 @@ ObActionsAct* actions_parse(xmlNodePtr node) gboolean actions_act_is_interactive(ObActionsAct *act) { - return act->def->i_cancel != NULL; + return act->i_cancel != NULL; } void actions_act_ref(ObActionsAct *act) @@ -253,6 +307,8 @@ void actions_run_acts(GSList *acts, /* 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); } } @@ -264,7 +320,7 @@ void actions_run_acts(GSList *acts, 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; @@ -281,7 +337,7 @@ gboolean actions_interactive_act_running(void) 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(); } } @@ -309,6 +365,9 @@ static void actions_interactive_end_act(void) 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; } @@ -318,8 +377,8 @@ gboolean actions_interactive_input_event(XEvent *e) { 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 */ diff --git a/openbox/actions.h b/openbox/actions.h index 7a09a665..de86b9e1 100644 --- a/openbox/actions.h +++ b/openbox/actions.h @@ -31,15 +31,24 @@ typedef struct _ObActionsGlobalData ObActionsGlobalData; 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; @@ -55,14 +64,16 @@ struct _ObActionsData { 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); diff --git a/openbox/actions/addremovedesktop.c b/openbox/actions/addremovedesktop.c index 1e7f0b57..111742c1 100644 --- a/openbox/actions/addremovedesktop.c +++ b/openbox/actions/addremovedesktop.c @@ -19,20 +19,17 @@ static gpointer setup_removelast_func(xmlNodePtr node); 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) diff --git a/openbox/actions/breakchroot.c b/openbox/actions/breakchroot.c index 9804091b..8c004582 100644 --- a/openbox/actions/breakchroot.c +++ b/openbox/actions/breakchroot.c @@ -7,8 +7,7 @@ void action_breakchroot_startup(void) { actions_register("BreakChroot", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/close.c b/openbox/actions/close.c index ab75e05d..d2bc96c2 100644 --- a/openbox/actions/close.c +++ b/openbox/actions/close.c @@ -7,8 +7,7 @@ void action_close_startup(void) { actions_register("Close", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 6d847837..3d021bda 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -16,13 +16,28 @@ typedef struct { 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, @@ -30,18 +45,20 @@ 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; @@ -88,19 +105,30 @@ static gpointer setup_func(xmlNodePtr node) 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; } @@ -131,7 +159,6 @@ static gboolean run_func(ObActionsData *data, gpointer options) o->bar, o->dialog_mode, FALSE, FALSE); - cycling = TRUE; stacking_restore(); if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); @@ -144,10 +171,13 @@ static gboolean i_input_func(guint initial_state, 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; } @@ -155,7 +185,8 @@ static gboolean i_input_func(guint initial_state, 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; } } @@ -163,7 +194,8 @@ static gboolean i_input_func(guint initial_state, 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; } @@ -172,14 +204,14 @@ static gboolean i_input_func(guint initial_state, 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, @@ -190,12 +222,11 @@ static void end_cycle(gboolean cancel, guint state, Options *o) 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(); } diff --git a/openbox/actions/debug.c b/openbox/actions/debug.c index 99e838a6..3ae09016 100644 --- a/openbox/actions/debug.c +++ b/openbox/actions/debug.c @@ -11,7 +11,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/decorations.c b/openbox/actions/decorations.c index e85fb8ef..f6fd2cbe 100644 --- a/openbox/actions/decorations.c +++ b/openbox/actions/decorations.c @@ -7,10 +7,9 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 3b33afbd..27b717b1 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -49,43 +49,31 @@ static gpointer setup_send_down_func(xmlNodePtr node); 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) diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index 3d997aef..0d1476c7 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -21,7 +21,11 @@ typedef struct { 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); @@ -34,14 +38,46 @@ static void i_cancel_func(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); @@ -53,43 +89,43 @@ static gpointer setup_southeast_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) @@ -158,10 +194,16 @@ 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; } @@ -269,58 +311,90 @@ static void end_cycle(gboolean cancel, guint state, Options *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; } diff --git a/openbox/actions/dockautohide.c b/openbox/actions/dockautohide.c index 5e5382d4..4a750b2c 100644 --- a/openbox/actions/dockautohide.c +++ b/openbox/actions/dockautohide.c @@ -8,8 +8,7 @@ void action_dockautohide_startup(void) { actions_register("ToggleDockAutoHide", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index 4d29fc19..bde7f5d2 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -33,7 +33,7 @@ static void i_cancel_func(gpointer options); 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) diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 3bfebbce..55d89a0b 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -13,8 +13,8 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/focus.c b/openbox/actions/focus.c index e25a79ea..0e546dea 100644 --- a/openbox/actions/focus.c +++ b/openbox/actions/focus.c @@ -13,7 +13,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/focustobottom.c b/openbox/actions/focustobottom.c index 49c945b9..a3e5b5ac 100644 --- a/openbox/actions/focustobottom.c +++ b/openbox/actions/focustobottom.c @@ -5,7 +5,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/fullscreen.c b/openbox/actions/fullscreen.c index 7579b95d..e1fdf232 100644 --- a/openbox/actions/fullscreen.c +++ b/openbox/actions/fullscreen.c @@ -5,8 +5,7 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 2a31496a..0c39a63e 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -22,18 +22,14 @@ static gpointer setup_west_func(xmlNodePtr node); 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) diff --git a/openbox/actions/iconify.c b/openbox/actions/iconify.c index 6f14a2e0..e6bdbb7b 100644 --- a/openbox/actions/iconify.c +++ b/openbox/actions/iconify.c @@ -7,8 +7,7 @@ void action_iconify_startup(void) { actions_register("Iconify", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/if.c b/openbox/actions/if.c index 833bdd3a..47ff2fd5 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -29,7 +29,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/kill.c b/openbox/actions/kill.c index 68244407..b7d547b9 100644 --- a/openbox/actions/kill.c +++ b/openbox/actions/kill.c @@ -7,8 +7,7 @@ void action_kill_startup(void) { actions_register("Kill", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/layer.c b/openbox/actions/layer.c index 1d522bbc..1dc7c4cf 100644 --- a/openbox/actions/layer.c +++ b/openbox/actions/layer.c @@ -18,18 +18,18 @@ static gpointer setup_sendnormal_func(xmlNodePtr node); 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) diff --git a/openbox/actions/lower.c b/openbox/actions/lower.c index d34e933b..80ca6b8b 100644 --- a/openbox/actions/lower.c +++ b/openbox/actions/lower.c @@ -8,8 +8,7 @@ void action_lower_startup(void) { actions_register("Lower", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/maximize.c b/openbox/actions/maximize.c index 5cc7141b..90a84039 100644 --- a/openbox/actions/maximize.c +++ b/openbox/actions/maximize.c @@ -23,31 +23,28 @@ static gpointer setup_vert_func(xmlNodePtr node); 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) diff --git a/openbox/actions/move.c b/openbox/actions/move.c index ddd3f59a..ba8372a5 100644 --- a/openbox/actions/move.c +++ b/openbox/actions/move.c @@ -8,8 +8,7 @@ void action_move_startup(void) { actions_register("Move", NULL, NULL, - run_func, - NULL, NULL); + run_func); } /* Always return FALSE because its not interactive */ diff --git a/openbox/actions/moverelative.c b/openbox/actions/moverelative.c index 4e6e5998..5bcdda44 100644 --- a/openbox/actions/moverelative.c +++ b/openbox/actions/moverelative.c @@ -14,7 +14,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index fc171fcc..3c135c89 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -30,10 +30,9 @@ static gpointer setup_center_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, diff --git a/openbox/actions/movetoedge.c b/openbox/actions/movetoedge.c index 51215fd2..e7384dad 100644 --- a/openbox/actions/movetoedge.c +++ b/openbox/actions/movetoedge.c @@ -19,16 +19,12 @@ static gpointer setup_west_func(xmlNodePtr node); 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) diff --git a/openbox/actions/omnipresent.c b/openbox/actions/omnipresent.c index 030a0159..4309acc6 100644 --- a/openbox/actions/omnipresent.c +++ b/openbox/actions/omnipresent.c @@ -6,8 +6,7 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/raise.c b/openbox/actions/raise.c index 6837bce2..f6ac1452 100644 --- a/openbox/actions/raise.c +++ b/openbox/actions/raise.c @@ -6,10 +6,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/raiselower.c b/openbox/actions/raiselower.c index 80fc917f..dbe41d85 100644 --- a/openbox/actions/raiselower.c +++ b/openbox/actions/raiselower.c @@ -5,10 +5,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/reconfigure.c b/openbox/actions/reconfigure.c index cef81414..813a1221 100644 --- a/openbox/actions/reconfigure.c +++ b/openbox/actions/reconfigure.c @@ -5,10 +5,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/resize.c b/openbox/actions/resize.c index 47f45f5b..3df44b6c 100644 --- a/openbox/actions/resize.c +++ b/openbox/actions/resize.c @@ -17,7 +17,7 @@ static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch, 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) diff --git a/openbox/actions/resizerelative.c b/openbox/actions/resizerelative.c index 5742e1fc..b4db73b7 100644 --- a/openbox/actions/resizerelative.c +++ b/openbox/actions/resizerelative.c @@ -16,8 +16,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/restart.c b/openbox/actions/restart.c index 47f332b1..01de4f9a 100644 --- a/openbox/actions/restart.c +++ b/openbox/actions/restart.c @@ -12,7 +12,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/shade.c b/openbox/actions/shade.c index 2342067f..502781dd 100644 --- a/openbox/actions/shade.c +++ b/openbox/actions/shade.c @@ -7,9 +7,9 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c index 1070a965..414e2817 100644 --- a/openbox/actions/shadelowerraise.c +++ b/openbox/actions/shadelowerraise.c @@ -7,8 +7,8 @@ static gboolean run_func_ur(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/showdesktop.c b/openbox/actions/showdesktop.c index c9ba86c4..6dc77d5e 100644 --- a/openbox/actions/showdesktop.c +++ b/openbox/actions/showdesktop.c @@ -5,10 +5,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */ diff --git a/openbox/actions/showmenu.c b/openbox/actions/showmenu.c index 9590bd15..546be5a8 100644 --- a/openbox/actions/showmenu.c +++ b/openbox/actions/showmenu.c @@ -12,8 +12,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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) diff --git a/openbox/actions/unfocus.c b/openbox/actions/unfocus.c index 22a9378c..3db00ca3 100644 --- a/openbox/actions/unfocus.c +++ b/openbox/actions/unfocus.c @@ -5,7 +5,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); 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 */