Add action_list_run.c/h with action_list_run() and struct ObActionListRun.
authorDana Jansens <danakj@orodu.net>
Tue, 2 Aug 2011 19:55:44 +0000 (15:55 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:55:15 +0000 (18:55 -0400)
This function runs an action list, taking over from the function that used to
live in action.c.  Now the action.c function will simply run a single action.

The actions and filters now take a const ObActionListRun* which describes
the user event which triggered the actions/filters to run.

The action_list_run() function can also run filters, yay.  However...

TODO:
1. the filters' client sets are not passed to actions yet. do this.
2. make action(s) to change config options
   includes key and mouse binding
3. rm -rf *xml*

52 files changed:
Makefile.am
openbox/action.c
openbox/action.h
openbox/action_filter.c
openbox/action_filter.h
openbox/action_list.c
openbox/action_list.h
openbox/action_list_run.c [new file with mode: 0644]
openbox/action_list_run.h [new file with mode: 0644]
openbox/action_parser.c
openbox/actions/addremovedesktop.c
openbox/actions/breakchroot.c
openbox/actions/close.c
openbox/actions/cyclewindows.c
openbox/actions/debug.c
openbox/actions/decorations.c
openbox/actions/desktop.c
openbox/actions/directionalwindows.c
openbox/actions/dock.c
openbox/actions/dockautohide.c
openbox/actions/execute.c
openbox/actions/exit.c
openbox/actions/focus.c
openbox/actions/focustobottom.c
openbox/actions/fullscreen.c
openbox/actions/growtoedge.c
openbox/actions/iconify.c
openbox/actions/kill.c
openbox/actions/layer.c
openbox/actions/lower.c
openbox/actions/maximize.c
openbox/actions/move.c
openbox/actions/moverelative.c
openbox/actions/moveresizeto.c
openbox/actions/movetoedge.c
openbox/actions/omnipresent.c
openbox/actions/raise.c
openbox/actions/raiselower.c
openbox/actions/reconfigure.c
openbox/actions/resize.c
openbox/actions/resizerelative.c
openbox/actions/restart.c
openbox/actions/shade.c
openbox/actions/showdesktop.c
openbox/actions/showmenu.c
openbox/actions/unfocus.c
openbox/client_set.c
openbox/filters/all.c
openbox/filters/target.c
openbox/keyboard.c
openbox/menuframe.c
openbox/mouse.c

index a80a98a575c9fe7e495a4085a593ac2cd9922647..ad173a934ab29249869d508c8209e768685e4c33 100644 (file)
@@ -244,6 +244,8 @@ openbox_openbox_SOURCES = \
        openbox/action_filter.h \
        openbox/action_list.c \
        openbox/action_list.h \
+       openbox/action_list_run.c \
+       openbox/action_list_run.h \
        openbox/action_parser.c \
        openbox/action_parser.h \
        openbox/action_value.c \
index e962fe60984071fb2ad4350cac9c85ee3ff4389f..5810c07c4460bc952985cc096392e9c191bde80d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "action.h"
 #include "action_list.h"
+#include "action_list_run.h"
 #include "action_filter.h"
 #include "gettext.h"
 #include "grab.h"
@@ -25,6 +26,7 @@
 #include "event.h"
 #include "config.h"
 #include "client.h"
+#include "client_set.h"
 #include "focus.h"
 #include "openbox.h"
 #include "debug.h"
@@ -37,8 +39,8 @@ static gboolean action_interactive_begin_act(ObAction *act, guint state);
 static void     action_interactive_end_act();
 static ObAction* action_find_by_name(const gchar *name);
 
-static ObAction *interactive_act = NULL;
-static guint     interactive_initial_state = 0;
+static ObAction *current_i_act = NULL;
+static guint     current_i_initial_state = 0;
 
 struct _ObActionDefinition {
     guint ref;
@@ -255,113 +257,79 @@ void action_unref(ObAction *act)
     }
 }
 
-static void action_setup_data(ObActionData *data,
-                              ObUserAction uact,
-                              guint state,
-                              gint x,
-                              gint y,
-                              gint button,
-                              ObFrameContext con,
-                              struct _ObClient *client)
-{
-    data->uact = uact;
-    data->state = state;
-    data->x = x;
-    data->y = y;
-    data->button = button;
-    data->context = con;
-    data->client = client;
-}
-
-gboolean action_run_acts(ObActionList *acts,
-                         ObUserAction uact,
-                         guint state,
-                         gint x,
-                         gint y,
-                         gint button,
-                         ObFrameContext con,
-                         struct _ObClient *client)
+gboolean action_run(ObAction *act, const ObActionListRun *data,
+                    struct _ObClientSet *set)
 {
     gboolean ran_interactive;
     gboolean update_user_time;
-
-    /* Don't allow saving the initial state when running things from the
-       menu */
-    if (uact == OB_USER_ACTION_MENU_SELECTION)
-        state = 0;
-    /* If x and y are < 0 then use the current pointer position */
-    if (x < 0 && y < 0)
-        screen_pointer_pos(&x, &y);
+    gboolean run, run_i;
 
     ran_interactive = FALSE;
     update_user_time = FALSE;
-    while (acts) {
-        ObAction *act;
-        ObActionData data;
-        gboolean ok = TRUE;
-
-        if (acts->isfilter) {
-            g_warning("filters not implemented!");
-            acts = acts->next;
-            continue;
-        }
-        else {
-            act = acts->u.action;
-        }
 
-        action_setup_data(&data, uact, state, x, y, button, con, client);
-
-        /* if they have the same run function, then we'll assume they are
-           cooperating and not cancel eachother out */
-        if (!interactive_act || interactive_act->def->run != act->def->run) {
-            if (action_is_interactive(act)) {
-                /* cancel the old one */
-                if (interactive_act)
-                    action_interactive_cancel_act();
-                if (act->i_pre)
-                    if (!act->i_pre(state, act->options))
-                        act->i_input = NULL; /* remove the interactivity */
-                ran_interactive = TRUE;
-            }
-            /* check again cuz it might have been cancelled */
-            if (action_is_interactive(act)) {
-                ok = action_interactive_begin_act(act, state);
-                ran_interactive = TRUE;
-            }
-        }
+    /* If we're starting an interactive action:
+       - if the current interactive action is the same, do nothing and
+         just use the run function.
+       - otherwise...
+       - cancel the current interactive action (if any)
+       - run the pre function. if it returns false then the action will
+         not be treated as interactive.
+       - set up for a new interactive action with action_interactive_begin_act.
+         this may fail in which case we don't run the action at all.
+       Then execute the action's run function.
+       If the action is doing something to the currently focused window,
+         then we want to update its user_time to indicate it was used by a
+         human now.
+    */
+
+    run_i = FALSE;
+    if (action_is_interactive(act)) {
+        ObActionRunFunc this_run = act->def->run;
+        ObActionRunFunc i_run = (current_i_act ?
+                                 current_i_act->def->run : NULL);
+
+        if (i_run && i_run != this_run)
+            action_interactive_cancel_act();
+        run_i = TRUE;
+        if (i_run != this_run && act->i_pre)
+            run_i = act->i_pre(data->state, act->options);
+    }
 
-        /* fire the action's run function with this data */
-        if (ok) {
-            if (!act->def->run(&data, act->options)) {
-                if (action_is_interactive(act))
-                    action_interactive_end_act();
-                if (client && client == focus_client)
-                    update_user_time = TRUE;
-            } else {
-                /* make sure its interactive if it returned TRUE */
-                g_assert(act->i_input);
-
-                /* no actions are run after the interactive one */
-                break;
-            }
+    run = TRUE;
+    if (run_i) {
+        run = action_interactive_begin_act(act, data->state);
+        ran_interactive = TRUE;
+    }
+
+    if (run) {
+        gboolean end;
+
+        /* XXX pass the set here */
+        end = !act->def->run(data, act->options);
+        g_assert(end || action_is_interactive(act));
+
+        if (end) {
+            if (action_is_interactive(act))
+                action_interactive_end_act();
+            /* XXX else if (client_set_contains(focus_client)) */
+            else if (data->client && data->client == focus_client)
+                event_update_user_time();
         }
-        acts = acts->next;
     }
-    if (update_user_time)
-        event_update_user_time();
+
     return ran_interactive;
 }
 
 gboolean action_interactive_act_running(void)
 {
-    return interactive_act != NULL;
+    return current_i_act != NULL;
 }
 
 void action_interactive_cancel_act(void)
 {
-    if (interactive_act) {
-        if (interactive_act->i_cancel)
-            interactive_act->i_cancel(interactive_act->options);
+    if (current_i_act) {
+        if (current_i_act->i_cancel)
+            current_i_act->i_cancel(current_i_act->options);
         action_interactive_end_act();
     }
 }
@@ -369,10 +337,10 @@ void action_interactive_cancel_act(void)
 static gboolean action_interactive_begin_act(ObAction *act, guint state)
 {
     if (grab_keyboard()) {
-        interactive_act = act;
-        action_ref(interactive_act);
+        current_i_act = act;
+        action_ref(current_i_act);
 
-        interactive_initial_state = obt_keyboard_only_modmasks(state);
+        current_i_initial_state = obt_keyboard_only_modmasks(state);
 
         /* if using focus_delay, stop the timer now so that focus doesn't go
            moving on us, which would kill the action */
@@ -386,13 +354,13 @@ static gboolean action_interactive_begin_act(ObAction *act, guint state)
 
 static void action_interactive_end_act(void)
 {
-    if (interactive_act) {
-        ObAction *ia = interactive_act;
+    if (current_i_act) {
+        ObAction *ia = current_i_act;
 
         /* set this to NULL first so the i_post() function can't cause this to
            get called again (if it decides it wants to cancel any ongoing
            interactive action). */
-        interactive_act = NULL;
+        current_i_act = NULL;
 
         ungrab_keyboard();
 
@@ -406,10 +374,10 @@ static void action_interactive_end_act(void)
 gboolean action_interactive_input_event(XEvent *e)
 {
     gboolean used = FALSE;
-    if (interactive_act) {
-        if (!interactive_act->i_input(interactive_initial_state, e,
-                                      grab_input_context(),
-                                      interactive_act->options, &used))
+    if (current_i_act) {
+        if (!current_i_act->i_input(current_i_initial_state, e,
+                                    grab_input_context(),
+                                    current_i_act->options, &used))
         {
             used = TRUE; /* if it cancelled the action then it has to of
                             been used */
@@ -419,7 +387,7 @@ gboolean action_interactive_input_event(XEvent *e)
     return used;
 }
 
-void action_client_move(ObActionData *data, gboolean start)
+void action_client_move(const ObActionListRun *data, gboolean start)
 {
     static gulong ignore_start = 0;
     if (start)
@@ -458,3 +426,8 @@ void action_client_move(ObActionData *data, gboolean start)
             event_end_ignore_all_enters(ignore_start);
     }
 }
+
+ObActionDefaultFilter action_default_filter(ObAction *act)
+{
+    return act->def->def_filter;
+}
index 2163154d4294d0a592427cb7165d60bb2cac6177..e6ec7de5b2611fb47e8a8b953059e5fc8f6fb834 100644 (file)
 #include <X11/Xlib.h>
 
 struct _ObActionList;
+struct _ObActionListRun;
+struct _ObClientSet;
 
 typedef struct _ObActionDefinition   ObActionDefinition;
 typedef struct _ObAction             ObAction;
 typedef struct _ObActionData         ObActionData;
 
 typedef void     (*ObActionDataFreeFunc)(gpointer options);
-typedef gboolean (*ObActionRunFunc)(ObActionData *data,
+typedef gboolean (*ObActionRunFunc)(const struct _ObActionListRun *data,
                                     gpointer options);
 typedef gpointer (*ObActionDataSetupFunc)(GHashTable *config);
 typedef void     (*ObActionShutdownFunc)(void);
 
 /* functions for interactive actions */
-/* return TRUE if the action is going to be interactive, or false to change
-   your mind and make it not */
+/*! Returns TRUE if the action is going to be interactive, or FALSE to change
+  your mind and make it not. */
 typedef gboolean (*ObActionIPreFunc)(guint initial_state, gpointer options);
 typedef void     (*ObActionIPostFunc)(gpointer options);
+/*! Returns TRUE to continue the interactive action, and FALSE to end it. */
 typedef gboolean (*ObActionIInputFunc)(guint initial_state,
                                        XEvent *e,
                                        ObtIC *ic,
@@ -62,17 +65,6 @@ typedef enum {
     OB_NUM_ACTION_DEFAULT_FILTERS
 } ObActionDefaultFilter;
 
-struct _ObActionData {
-    ObUserAction uact;
-    guint state;
-    gint x;
-    gint y;
-    gint button;
-
-    struct _ObClient *client;
-    ObFrameContext context;
-};
-
 void action_startup(gboolean reconfigure);
 void action_shutdown(gboolean reconfigure);
 
@@ -105,17 +97,13 @@ ObAction* action_new(const gchar *name, GHashTable *config);
 void action_ref(ObAction *act);
 void action_unref(ObAction *act);
 
-/*! Runs a list of actions.
- @return TRUE if an interactive action was started, FALSE otherwise.
+ObActionDefaultFilter action_default_filter(ObAction *act);
+
+/*! Runs an action.
+  @return TRUE if an interactive action was started, FALSE otherwise.
 */
-gboolean action_run_acts(struct _ObActionList *acts,
-                         ObUserAction uact,
-                         guint state,
-                         gint x,
-                         gint y,
-                         gint button,
-                         ObFrameContext con,
-                         struct _ObClient *client);
+gboolean action_run(ObAction *act, const struct _ObActionListRun *data,
+                    struct _ObClientSet *set);
 
 gboolean action_interactive_act_running(void);
 void action_interactive_cancel_act(void);
@@ -123,4 +111,5 @@ void action_interactive_cancel_act(void);
 gboolean action_interactive_input_event(XEvent *e);
 
 /*! Function for actions to call when they are moving a client around */
-void action_client_move(ObActionData *data, gboolean start);
+void action_client_move(const struct _ObActionListRun *data,
+                        gboolean start);
index 0d6c08de969bdebde223782fe7aa7ab39c64440b..9401fe93a987059c44dfe9bc9a116f86214468cf 100644 (file)
@@ -17,6 +17,8 @@
 */
 
 #include "action_filter.h"
+#include "action_list_run.h"
+#include "client_set.h"
 #include "gettext.h"
 
 #include "filters/_all.h"
@@ -27,14 +29,14 @@ struct _ObActionFilterDefinition {
     gchar *name;
     ObActionFilterSetupFunc setup;
     ObActionFilterDestroyFunc destroy;
-    ObClientSetReduceFunc reduce;
-    ObClientSetExpandFunc expand;
+    ObActionFilterFunc set;
 };
 
 struct _ObActionFilter {
     gint ref;
 
     ObActionFilterDefinition *def;
+    gboolean invert;
     gpointer data;
 };
 
@@ -60,15 +62,13 @@ void action_filter_shutdown(gboolean reconfig)
 gboolean action_filter_register(const gchar *name,
                                 ObActionFilterSetupFunc setup,
                                 ObActionFilterDestroyFunc destroy,
-                                ObClientSetReduceFunc reduce,
-                                ObClientSetExpandFunc expand)
+                                ObActionFilterFunc set)
 {
     ObActionFilterDefinition *def;
     GSList *it;
 
     g_return_val_if_fail(name != NULL, FALSE);
-    g_return_val_if_fail(reduce != NULL, FALSE);
-    g_return_val_if_fail(expand != NULL, FALSE);
+    g_return_val_if_fail(set != NULL, FALSE);
 
     for (it = registered; it; it = it->next) {
         def = it->data;
@@ -80,8 +80,7 @@ gboolean action_filter_register(const gchar *name,
     def->name = g_strdup(name);
     def->setup = setup;
     def->destroy = destroy;
-    def->reduce = reduce;
-    def->expand = expand;
+    def->set = set;
     registered = g_slist_prepend(registered, def);
 
     return TRUE;
@@ -123,6 +122,7 @@ ObActionFilter* action_filter_new(const gchar *key, struct _ObActionValue *v)
     filter = g_slice_new(ObActionFilter);
     filter->ref = 1;
     filter->def = def;
+    filter->invert = invert;
     filter->data = def->setup ? def->setup(invert, v) : NULL;
     return filter;
 }
@@ -140,14 +140,8 @@ void action_filter_unref(ObActionFilter *f)
     }
 }
 
-void action_filter_expand(ObActionFilter *f, struct _ObClientSet *set)
-{
-    g_return_if_fail(f != NULL);
-    client_set_expand(set, f->def->expand, f->data);
-}
-
-void action_filter_reduce(ObActionFilter *f, struct _ObClientSet *set)
+struct _ObClientSet* action_filter_set(ObActionFilter *f,
+                                       const ObActionListRun *run)
 {
-    g_return_if_fail(f != NULL);
-    client_set_reduce(set, f->def->reduce, f->data);
+    return f->def->set(f->invert, run, f->data);
 }
index 4060878bc70b3713eadef6e7156af6f2f2e9e0c7..71375e313841d81cdc610d4a7a6a73ae55222e96 100644 (file)
    See the COPYING file for a copy of the GNU General Public License.
 */
 
-#include "client_set.h"
-
 #include <glib.h>
 
+struct _ObActionListRun;
 struct _ObActionValue;
 struct _ObClient;
+struct _ObClientSet;
 
 typedef struct _ObActionFilter ObActionFilter;
 typedef struct _ObActionFilterFuncs ObActionFilterFuncs;
@@ -30,19 +30,35 @@ typedef enum _ObActionFilterDefault ObActionFilterDefault;
 typedef gpointer (*ObActionFilterSetupFunc)(gboolean invert,
                                             struct _ObActionValue *v);
 typedef void (*ObActionFilterDestroyFunc)(gpointer data);
+typedef struct _ObClientSet* (*ObActionFilterFunc)(
+    gboolean invert, const struct _ObActionListRun *run, gpointer data);
 
 void action_filter_startup(gboolean reconfig);
 void action_filter_shutdown(gboolean reconfig);
 
+/*! Registers a filter test in the system.
+  @name The name of the key for the filter. [foo] or [foo=bar] would register
+    "foo" as its name.
+  @setup A setup function which takes the parameter given to the filter.
+    This would receive the bar in [foo=bar].  This returns a pointer to data
+    used by the filter.
+  @destroy Destroys the data returned from @setup.
+  @filter A function that returns an ObClientSet* of clients that this filter
+    includes.
+  @return TRUE if the registration was successful.
+*/
 gboolean action_filter_register(const gchar *name,
                                 ObActionFilterSetupFunc setup,
                                 ObActionFilterDestroyFunc destroy,
-                                ObClientSetReduceFunc reduce,
-                                ObClientSetExpandFunc expand);
+                                ObActionFilterFunc set);
 
 ObActionFilter* action_filter_new(const gchar *key, struct _ObActionValue *v);
 void action_filter_ref(ObActionFilter *f);
 void action_filter_unref(ObActionFilter *f);
 
-void action_filter_expand(ObActionFilter *f, ObClientSet *set);
-void action_filter_reduce(ObActionFilter *f, ObClientSet *set);
+/*! Returns a set of clients for a filter.
+  @f The filter.
+  @run Data for the user event which caused this filter to be run.
+*/
+struct _ObClientSet* action_filter_set(ObActionFilter *f,
+                                       const struct _ObActionListRun *run);
index c6c506080bcca4b0744707a6c82d77211bdaee65..30b46fed93fd9efb30db5d156240e772f2979478 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "action_list.h"
 #include "action.h"
+#include "action_filter.h"
 #include "action_value.h"
 
 #include <glib.h>
@@ -32,7 +33,7 @@ void action_list_unref(ObActionList *l)
     while (l && --l->ref < 1) {
         ObActionList *n = l->next;
 
-        if (l->isfilter) {
+        if (l->isfilterset) {
             action_list_test_destroy(l->u.f.test);
             action_list_unref(l->u.f.thendo);
             action_list_unref(l->u.f.elsedo);
@@ -50,8 +51,7 @@ void action_list_test_destroy(ObActionListTest *t)
     while (t) {
         ObActionListTest *n = t->next;
 
-        g_free(t->key);
-        action_value_unref(t->value);
+        action_filter_unref(t->filter);
         g_slice_free(ObActionListTest, t);
         t = n;
     }
index 4e2dcb2e2965a9ff61d06ac3dc9e7b0b97c3490a..b3ead24a794f1b1623f4d856494f45de4f6cfb19 100644 (file)
@@ -19,6 +19,7 @@
 #include <glib.h>
 
 struct _ObActionAct;
+struct _ObActionFilter;
 struct _ObActionValue;
 
 typedef struct _ObActionList      ObActionList;
@@ -28,9 +29,9 @@ typedef struct _ObActionListTest  ObActionListTest;
   an action). */
 struct _ObActionList {
     gint ref;
-    gboolean isfilter;
+    gboolean isfilterset;
     union {
-        struct _ObActionListFilter {
+        struct _ObActionListFilterSet {
             ObActionListTest *test; /* can be null */
             ObActionList *thendo; /* can be null */
             ObActionList *elsedo; /* can be null */
@@ -41,8 +42,7 @@ struct _ObActionList {
 };
 
 struct _ObActionListTest {
-    gchar *key;
-    struct _ObActionValue *value; /* can be null */
+    struct _ObActionFilter *filter;
     gboolean and;
     ObActionListTest *next;
 };
diff --git a/openbox/action_list_run.c b/openbox/action_list_run.c
new file mode 100644 (file)
index 0000000..5e2af95
--- /dev/null
@@ -0,0 +1,168 @@
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+   action_list_run.c for the Openbox window manager
+   Copyright (c) 2011        Dana Jansens
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#include "action_list_run.h"
+#include "action.h"
+#include "action_filter.h"
+#include "action_list.h"
+#include "client.h"
+#include "client_set.h"
+#include "event.h"
+#include "screen.h"
+
+static gboolean run_list(ObActionList *acts, const ObActionListRun *data,
+                         ObClientSet *set);
+static gboolean run_filter(ObActionList *acts, const ObActionListRun *data,
+                           ObClientSet *set);
+
+gboolean action_list_run(ObActionList *acts,
+                         ObUserAction uact,
+                         guint state,
+                         gint x,
+                         gint y,
+                         gint button,
+                         ObFrameContext con,
+                         struct _ObClient *client)
+{
+    ObActionListRun action_data;
+
+    g_return_val_if_fail(acts != NULL, FALSE);
+    if (acts == NULL) return FALSE;
+
+    /* Don't save the initial mod state when running things from the menu */
+    if (uact == OB_USER_ACTION_MENU_SELECTION)
+        state = 0;
+    /* If x and y are < 0 then use the current pointer position */
+    if (x < 0 && y < 0)
+        screen_pointer_pos(&x, &y);
+
+    action_data.uact = uact;
+    action_data.state = state;
+    action_data.x = x;
+    action_data.y = y;
+    action_data.button = button;
+    action_data.context = con;
+    action_data.client = client;
+    /* if a pointer started the event clicking on a window, it must be under
+       the pointer */
+    action_data.pointer_over = client ? client : client_under_pointer();
+
+    return run_list(acts, &action_data, NULL);
+}
+
+static gboolean run_list(ObActionList *acts, const ObActionListRun *data,
+                         ObClientSet *set)
+{
+    gboolean interactive;
+    ObClientSet *myset;
+
+    if (!acts) return FALSE;
+    if (acts->isfilterset) return run_filter(acts, data, set);
+
+    /* if we're not given a filter, then make a default filter set,
+       but don't pass it on to our siblings in the list. */
+    myset = set;
+    if (!myset) {
+        switch (action_default_filter(acts->u.action)) {
+        case OB_ACTION_DEFAULT_FILTER_SINGLE:
+            myset = client_set_single(data->client); break;
+        case OB_ACTION_DEFAULT_FILTER_EMPTY:
+            myset = client_set_empty(); break;
+        case OB_ACTION_DEFAULT_FILTER_ALL:
+            myset = client_set_all(); break;
+        case OB_NUM_ACTION_DEFAULT_FILTERS:
+        default: g_assert_not_reached();
+        }
+    }
+
+    interactive = action_run(acts->u.action, data, myset);
+    if (set != myset) client_set_destroy(myset);
+
+    if (interactive) return TRUE;
+    return run_list(acts->next, data, set);
+}
+
+static gboolean run_filter(ObActionList *acts, const ObActionListRun *data,
+                           ObClientSet *incoming_set)
+{
+    ObActionListTest *test = acts->u.f.test;
+    ObClientSet *set, *and_set;
+    gboolean prev_and;
+    gboolean interactive;
+
+    /* (a ^ b) | c | (d ^ e ^ f) | (g ^ h)
+
+       - for each test in the filter:
+         1) when we are at the first test, we make the test's set our current
+            set
+         2) when we are between two ORs, we add the test's set to our current
+            set
+         3) when we are to the left of an OR (or at the last test), we
+            intersect our test's set to the and_set, and then add the add_set
+            to our current set
+         4) otherwise, we are to the left of an AND
+            a) if we are to the right of an OR, we make and_set our test's set
+            b) else we are between two ANDs, so we intersect and_set with
+               the test's set
+       - finally, we take the intersection of our created set with the
+         incoming set.
+    */
+
+    g_assert(test != NULL);
+
+    and_set = NULL;
+
+    set = action_filter_set(test->filter, data);
+    prev_and = test->and;
+    test = test->next;
+    while (test) {
+        ObClientSet *const test_set = action_filter_set(test->filter, data);
+
+        if (!prev_and && test->next && !test->and)
+            set = client_set_union(set, test_set);
+        else if (!test->and || !test->next) {
+            if (and_set)
+                and_set = client_set_intersection(and_set, test_set);
+            else 
+                and_set = test_set;
+            set = client_set_union(set, and_set);
+            and_set = NULL;
+        }
+        else {
+            if (and_set)
+                and_set = client_set_intersection(and_set, test_set);
+            else
+                and_set = test_set;
+        }
+        test = test->next;
+    }
+
+    if (incoming_set) {
+        /* we don't want to destroy the incoming set so make a copy of it */
+        set = client_set_intersection(set, client_set_clone(incoming_set));
+    }
+
+    if (client_set_test_boolean(set))
+        interactive = run_list(acts->u.f.thendo, data, set);
+    else
+        interactive = run_list(acts->u.f.elsedo, data, set);
+    client_set_destroy(set);
+
+    if (interactive) return TRUE;
+    return run_list(acts->next, data, incoming_set);
+}
diff --git a/openbox/action_list_run.h b/openbox/action_list_run.h
new file mode 100644 (file)
index 0000000..044af78
--- /dev/null
@@ -0,0 +1,65 @@
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+   action_list_run.h for the Openbox window manager
+   Copyright (c) 2011        Dana Jansens
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#include "misc.h"
+#include "frame.h"
+
+#include <glib.h>
+
+typedef struct _ObActionListRun ObActionListRun;
+
+struct _ObActionList;
+
+/*! This structure holds data about the user event which triggers running an
+  action list and the filters/actions within it.
+  All action list executions must come from some user event, and this describes
+  it.
+*/
+struct _ObActionListRun {
+    ObUserAction uact;
+    guint state;
+
+    gint x;
+    gint y;
+    gint button;
+    ObFrameContext context;
+    struct _ObClient *client;
+    struct _ObClient *pointer_over;
+};
+
+/*! Run an action list.
+  @acts The list of actions to run.
+  @state The current state of the keyboard modifiers.
+  @x The x coordinate of the pointer.
+  @y The y coordinate of the pointer.
+  @button The button used to initiate the action list (if a pointer
+    initiated it).
+  @con The frame context on which the pointer button was used to initiate the
+    action list.
+  @client The client on which the pointer button was used to initiate the
+    action list.
+  @return TRUE if an interactive action was started, or FALSE otherwise.
+*/
+gboolean action_list_run(struct _ObActionList *acts,
+                         ObUserAction uact,
+                         guint state,
+                         gint x,
+                         gint y,
+                         gint button,
+                         ObFrameContext con,
+                         struct _ObClient *client);
index 0424bdbd579f30095c162d261f4995d2c5c91899..2b328cd1f809f0a599060f29fc7ff217cbfd9366 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "action_parser.h"
 #include "action.h"
+#include "action_filter.h"
 #include "action_list.h"
 #include "action_value.h"
 #include "gettext.h"
@@ -263,7 +264,7 @@ ObActionList* parse_action(ObActionParser *p, gboolean *e)
 
     al = g_slice_new(ObActionList);
     al->ref = 1;
-    al->isfilter = FALSE;
+    al->isfilterset = FALSE;
     al->u.action = action_new(name, config);
     al->next = NULL;
     g_free(name);
@@ -301,7 +302,7 @@ ObActionList* parse_filter(ObActionParser *p, gboolean *e)
 
     al = g_slice_new(ObActionList);
     al->ref = 1;
-    al->isfilter = TRUE;
+    al->isfilterset = TRUE;
     al->u.f.test = test;
     al->u.f.thendo = thendo;
     al->u.f.elsedo = elsedo;
@@ -315,6 +316,7 @@ ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e)
     gchar *key;
     ObActionValue *value;
     gboolean and;
+    ObActionFilter *filter;
     ObActionListTest *next;
 
     t = g_scanner_get_next_token(p->scan);
@@ -345,6 +347,19 @@ ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e)
         return NULL;
     }
 
+    filter = action_filter_new(key, value);
+    if (!filter) {
+        gchar *m;
+        m = g_strdup_printf(_("Unable to create filter: %s"), key);
+        parse_error(p, G_TOKEN_NONE, m, e);
+        g_free(m);
+    }
+
+    g_free(key);
+    action_value_unref(value);
+    if (!filter)
+        return NULL;
+
     /* check if there is another test and how we're connected */
     t = g_scanner_get_next_token(p->scan);
     if (t == ',') { /* and */
@@ -362,8 +377,7 @@ ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e)
 
     /* don't allow any errors */
     if (*e) {
-        g_free(key);
-        action_value_unref(value);
+        action_filter_unref(filter);
         action_list_test_destroy(next);
         return NULL;
     }
@@ -371,8 +385,7 @@ ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e)
         ObActionListTest *test;
 
         test = g_slice_new(ObActionListTest);
-        test->key = key;
-        test->value = value;
+        test->filter = filter;
         test->and = and;
         test->next = next;
         return test;
index 6c4593a9e1f28c1d698d8e6aeddeb2155eca8b5e..22158daf1c3aa9813c2e76f948de84ac579ab88a 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/screen.h"
 #include <glib.h>
@@ -12,7 +13,7 @@ static gpointer setup_func(GHashTable *config);
 static gpointer setup_add_func(GHashTable *config);
 static gpointer setup_remove_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_addremovedesktop_startup(void)
 {
@@ -61,7 +62,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 56e90a466f16aab7d4225a8e0a56faff3753253d..de2da715f473ec3739dab14cf220ab3a35df2c23 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/keyboard.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_breakchroot_startup(void)
 {
@@ -12,7 +13,7 @@ void action_breakchroot_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     /* break out of one chroot */
     keyboard_reset_chains(1);
index d3e5770ccbbb186bdd2fc59e2eb6d2670f0354eb..250bd1f2e0a9d6b84cff5ba1f404c9992b19e0bb 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_close_startup(void)
 {
@@ -10,7 +11,7 @@ void action_close_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) client_close(data->client);
 
index 9ce5f5fec4ba4529b9bae10b5aba665f485494e5..0087f8d50ee2ae835b3db5d1097926b60c21be5f 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox/action.h"
 #include "openbox/action_list.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_parser.h"
 #include "openbox/action_value.h"
 #include "openbox/stacking.h"
@@ -44,7 +45,7 @@ static gpointer setup_backward_func(GHashTable *config,
                                     ObActionICancelFunc *c,
                                     ObActionIPostFunc *post);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 static gboolean i_input_func(guint initial_state,
                              XEvent *e,
                              ObtIC *ic,
@@ -156,7 +157,7 @@ static void free_func(gpointer options)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     struct _ObClient *ft;
@@ -246,7 +247,7 @@ static void i_post_func(gpointer options)
                      TRUE, o->cancel);
 
     if (ft)
-        action_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
+        action_list_run(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
                         o->state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
 
     stacking_restore();
index c575a0220ea8cf3aad1a3d81be2bec6a8cf4594a..74e47232e69a3b03439f6a319024d0edcb5c89bb 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include <glib.h>
 
@@ -8,7 +9,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_debug_startup(void)
 {
@@ -37,7 +38,7 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index c75ca11b42ea43283eaba2c4fef5d615d8c8006e..5e1f956b5c7e84111a4e15b40dd5ec2372ac9dc9 100644 (file)
@@ -1,9 +1,10 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func_on(ObActionData *data, gpointer options);
-static gboolean run_func_off(ObActionData *data, gpointer options);
-static gboolean run_func_toggle(ObActionData *data, gpointer options);
+static gboolean run_func_on(const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
 
 void action_decorations_startup(void)
 {
@@ -16,7 +17,7 @@ void action_decorations_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionData *data, gpointer options)
+static gboolean run_func_on(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
@@ -27,7 +28,7 @@ static gboolean run_func_on(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionData *data, gpointer options)
+static gboolean run_func_off(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
@@ -38,7 +39,7 @@ static gboolean run_func_off(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionData *data, gpointer options)
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 3f926e6444c909ac0a4f251b520ecd857c60877f..e86b73784eae93bcce600f154f16767558a36c65 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/screen.h"
 #include "openbox/client.h"
@@ -41,7 +42,7 @@ static gpointer setup_send_func(GHashTable *config,
                                 ObActionICancelFunc *cancel,
                                 ObActionIPostFunc *post);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 static gboolean i_pre_func(guint state, gpointer options);
 static gboolean i_input_func(guint initial_state,
@@ -178,7 +179,7 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     guint d;
index 102594d1923d8a5455272c587627d7a1ca725526..05777d4e8bacc86feb28f1a89c5bb5a4c8201463 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox/action.h"
 #include "openbox/action_list.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_parser.h"
 #include "openbox/action_value.h"
 #include "openbox/event.h"
@@ -32,7 +33,7 @@ static gpointer setup_cycle_func(GHashTable *config,
                                  ObActionIPostFunc *post);
 static gpointer setup_target_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 static gboolean i_input_func(guint initial_state,
                              XEvent *e,
                              ObtIC *ic,
@@ -144,7 +145,7 @@ static void free_func(gpointer options)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
@@ -231,7 +232,7 @@ static void end_cycle(gboolean cancel, guint state, Options *o)
     cycling = FALSE;
 
     if (ft)
-        action_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
+        action_list_run(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
                         state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
 
     stacking_restore();
index b20dd7e5d4fd4cb8950788b6f515396a9dd2ec9d..d3aa2258fb6c9b5b94d0d32563ca6f942b1bd913 100644 (file)
@@ -1,10 +1,11 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 #include "openbox/dock.h"
 
-static gboolean raise_func(ObActionData *data, gpointer options);
-static gboolean lower_func(ObActionData *data, gpointer options);
+static gboolean raise_func(const ObActionListRun *data, gpointer options);
+static gboolean lower_func(const ObActionListRun *data, gpointer options);
 
 void action_dock_startup(void)
 {
@@ -15,7 +16,7 @@ void action_dock_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean raise_func(ObActionData *data, gpointer options)
+static gboolean raise_func(const ObActionListRun *data, gpointer options)
 {
     action_client_move(data, TRUE);
     dock_raise_dock();
@@ -25,7 +26,7 @@ static gboolean raise_func(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean lower_func(ObActionData *data, gpointer options)
+static gboolean lower_func(const ObActionListRun *data, gpointer options)
 {
     action_client_move(data, TRUE);
     dock_lower_dock();
index 163cd948cf0947d10e6c35d21a5e6aacc04fdc53..6b31d87310538a259a012cf17b6c2a2109bfb361 100644 (file)
@@ -1,8 +1,9 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/dock.h"
 #include "openbox/config.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_dockautohide_startup(void)
 {
@@ -11,7 +12,7 @@ void action_dockautohide_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     config_dock_hide = !config_dock_hide;
     dock_configure();
index 43463d5234bc0bfbf64ccfb6c6866e4e7028067e..f7825fb14c68d7d3c0f4c6cba15c762da0239bf3 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/event.h"
 #include "openbox/startupnotify.h"
@@ -19,12 +20,12 @@ typedef struct {
     gchar   *sn_icon;
     gchar   *sn_wmclass;
     gchar   *prompt;
-    ObActionData *data;
+    ObActionListRun *data;
 } Options;
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 static void shutdown_func(void);
 static void client_dest(ObClient *client, gpointer data);
 
@@ -98,12 +99,12 @@ static void free_func(gpointer options)
         g_free(o->sn_icon);
         g_free(o->sn_wmclass);
         g_free(o->prompt);
-        if (o->data) g_slice_free(ObActionData, o->data);
+        if (o->data) g_slice_free(ObActionListRun, o->data);
         g_slice_free(Options, o);
     }
 }
 
-static Options* dup_options(Options *in, ObActionData *data)
+static Options* dup_options(Options *in, const ObActionListRun *data)
 {
     Options *o = g_slice_new(Options);
     o->cmd = g_strdup(in->cmd);
@@ -112,8 +113,8 @@ static Options* dup_options(Options *in, ObActionData *data)
     o->sn_icon = g_strdup(in->sn_icon);
     o->sn_wmclass = g_strdup(in->sn_wmclass);
     o->prompt = NULL;
-    o->data = g_slice_new(ObActionData);
-    memcpy(o->data, data, sizeof(ObActionData));
+    o->data = g_slice_new(ObActionListRun);
+    memcpy(o->data, data, sizeof(ObActionListRun));
     return o;
 }
 
@@ -132,7 +133,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     GError *e;
     gchar **argv = NULL;
index 8c9636b1e4585444f6ae0cd42f8c607b1da2bc0c..5be209e34074156871e5a2bf6b01a6d3f72437c6 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/openbox.h"
 #include "openbox/prompt.h"
@@ -11,7 +12,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_exit_startup(void)
 {
@@ -61,7 +62,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer data)
 
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index ebf55c8dae6af30bd067b8a66be42e025ef18a72..9bc5c09cc1e507d8b8a9ce72b88854580a1b839b 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/event.h"
 #include "openbox/client.h"
@@ -12,7 +13,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_focus_startup(void)
 {
@@ -43,7 +44,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 4e0af5e1d7f437564423213b6ca1fd67cbbb1e53..afaa80ef3cde39629a9c66070459292a59a4086f 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/focus.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_focustobottom_startup(void)
 {
@@ -10,7 +11,7 @@ void action_focustobottom_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client)
         focus_order_to_bottom(data->client);
index f87a1d89c34424c7e9d9ae499c491275d0ad6d15..25a94fa85fdffbf0d72c98ce3e1d1830f968d04a 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func_toggle(ObActionData *data, gpointer options);
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
 
 void action_fullscreen_startup(void)
 {
@@ -10,7 +11,7 @@ void action_fullscreen_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionData *data, gpointer options)
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 8ddc2cadf630030ae5568d3d4ca23f140e760ec0..c254474b58ebf7c82c1b4cdd9ce28df7d704d136 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/misc.h"
 #include "openbox/client.h"
@@ -14,7 +15,7 @@ typedef struct {
 static gpointer setup_func(GHashTable *config);
 static gpointer setup_shrink_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_growtoedge_startup(void)
 {
@@ -63,7 +64,7 @@ static gpointer setup_shrink_func(GHashTable *config)
     return o;
 }
 
-static gboolean do_grow(ObActionData *data, gint x, gint y, gint w, gint h)
+static gboolean do_grow(const ObActionListRun *data, gint x, gint y, gint w, gint h)
 {
     gint realw, realh, lw, lh;
 
@@ -94,7 +95,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     gint x, y, w, h;
index 9b46720000fb11533aac5cf05e2efc1f3e5e45b2..1bfc9cc8e05f05636fae11e94d1759e9ada79b4f 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_iconify_startup(void)
 {
@@ -10,7 +11,7 @@ void action_iconify_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 925f02f97d087fc011d5eb074d0bb403e530aa46..b2d56cc74ae77f305517e55825c065b7f8d5a785 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_kill_startup(void)
 {
@@ -10,7 +11,7 @@ void action_kill_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client)
         client_kill(data->client);
index 21e7b4cc9e8cb5dac3aadbe1f6efa2256d9b3f55..33d896122df1223d6c47dca8060697e7d5be708a 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
 
@@ -11,7 +12,7 @@ static gpointer setup_func_top(GHashTable *config);
 static gpointer setup_func_bottom(GHashTable *config);
 static gpointer setup_func_send(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_layer_startup(void)
 {
@@ -69,7 +70,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index b468cb2957911bbceb57819c09cfdab4e8bf6037..06896c550397be7b95d33da50fa4b8f91a5bff2d 100644 (file)
@@ -1,8 +1,9 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_lower_startup(void)
 {
@@ -11,7 +12,7 @@ void action_lower_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index b2f958723bd057a97783d1766338bc1b9f0f3e77..b8543a1bab5f0de4349973e85f209309e736d3b9 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
 
@@ -15,9 +16,9 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func_on(ObActionData *data, gpointer options);
-static gboolean run_func_off(ObActionData *data, gpointer options);
-static gboolean run_func_toggle(ObActionData *data, gpointer options);
+static gboolean run_func_on(const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
 
 void action_maximize_startup(void)
 {
@@ -57,7 +58,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionData *data, gpointer options)
+static gboolean run_func_on(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     if (data->client) {
@@ -69,7 +70,7 @@ static gboolean run_func_on(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionData *data, gpointer options)
+static gboolean run_func_off(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     if (data->client) {
@@ -81,7 +82,7 @@ static gboolean run_func_off(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionData *data, gpointer options)
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     if (data->client) {
index 4707de3581e8201fbbb5049fc924df814a3cb597..7ec72739c201ce17c816d2b9b1d00ea38cd6489b 100644 (file)
@@ -1,8 +1,9 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/moveresize.h"
 #include "obt/prop.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_move_startup(void)
 {
@@ -11,7 +12,7 @@ void action_move_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         guint32 corner;
index e1125abdc271a8777cfb91e031b79d089b6d027b..47d5a8a06b2d6135906a1a741a24ea518a798c28 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
 #include "openbox/screen.h"
@@ -14,7 +15,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_moverelative_startup(void)
 {
@@ -45,7 +46,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index af3202dcd5d578126418b5cbf56bec13e2c74f97..da300e6200f3dc2e7df2cdd6de24f6c11fd7bf52 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
 #include "openbox/screen.h"
@@ -24,7 +25,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_moveresizeto_startup(void)
 {
@@ -84,7 +85,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index cd99d1b86ed16dca1b70a530519ba6eb362cc616..018a075ce4bf6cd84d066eaf40d8ac38c68783f3 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/misc.h"
 #include "openbox/client.h"
@@ -12,7 +13,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_movetoedge_startup(void)
 {
@@ -54,7 +55,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 3121fac3281fa3512d4e0a5c47642b9f6d80f6a8..1a6c91d5c8d3d09c19077b9455af3cb6653d9929 100644 (file)
@@ -1,8 +1,9 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 #include "openbox/screen.h"
 
-static gboolean run_func_toggle(ObActionData *data, gpointer options);
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
 
 void action_omnipresent_startup(void)
 {
@@ -11,7 +12,7 @@ void action_omnipresent_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionData *data, gpointer options)
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 283b07bebec3e405cd53dd94efe6531037feadd9..da5389beb92d481b6a1dbb681b3ba90c22654418 100644 (file)
@@ -1,8 +1,9 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_raise_startup(void)
 {
@@ -11,7 +12,7 @@ void action_raise_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 9231b6081d4cda09f02de83c7bb6c7a795872e6c..63f471a69b7c42b63877948a5dec3d6aaeac4380 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/stacking.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_raiselower_startup(void)
 {
@@ -10,7 +11,7 @@ void action_raiselower_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 66f4a80b7429bda3881e946ad7020d513e7370ad..13966c4d34aebbcf5f424439f3a4c29b93774000 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/openbox.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_reconfigure_startup(void)
 {
@@ -10,7 +11,7 @@ void action_reconfigure_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     ob_reconfigure();
 
index b193864f59002db52057fffd4fe7ecb91f18304c..c479f755b7821b63410f8379a70ab3d28a15a884 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/moveresize.h"
 #include "openbox/client.h"
@@ -12,7 +13,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
                            gboolean shaded);
@@ -63,7 +64,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 50741fa00b97ecb3fdd1af4f13076c9a28606fa5..b6bd1ff2656543a91dbd12f06a8633d283a3e2a5 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
 #include "openbox/screen.h"
@@ -18,7 +19,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_resizerelative_startup(void)
 {
@@ -55,7 +56,7 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 33369211a567a96e9f2ef692e25fd0f06e7e602b..9521e814bbb1e334d8927eb538aa87814bc8a722 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/openbox.h"
 #include "obt/paths.h"
@@ -9,7 +10,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_restart_startup(void)
 {
@@ -38,7 +39,7 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 6e1b61a5ec13c579995e9607de1a4d26a3548415..752220f483e29ce02345b6f7dd2078d6dadf4176 100644 (file)
@@ -1,9 +1,10 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/client.h"
 
-static gboolean run_func_on(ObActionData *data, gpointer options);
-static gboolean run_func_off(ObActionData *data, gpointer options);
-static gboolean run_func_toggle(ObActionData *data, gpointer options);
+static gboolean run_func_on(const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
 
 void action_shade_startup(void)
 {
@@ -16,7 +17,7 @@ void action_shade_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionData *data, gpointer options)
+static gboolean run_func_on(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
@@ -27,7 +28,7 @@ static gboolean run_func_on(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionData *data, gpointer options)
+static gboolean run_func_off(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
@@ -38,7 +39,7 @@ static gboolean run_func_off(ObActionData *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionData *data, gpointer options)
+static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
 {
     if (data->client) {
         action_client_move(data, TRUE);
index 647fa6485c5ddd0e40b46d98d5701cc0f7551f2f..3b31a955d59f72f76be96f52bed394095f531005 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/screen.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_showdesktop_startup(void)
 {
@@ -10,7 +11,7 @@ void action_showdesktop_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     screen_show_desktop(!screen_showing_desktop, NULL);
 
index ca1464c86b79be15743974ee96def9b2c4607c2b..a7ef2985e340b0af2806920749fe388a09ca9f60 100644 (file)
@@ -1,4 +1,5 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/menu.h"
 #include <glib.h>
@@ -9,7 +10,7 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_showmenu_startup(void)
 {
@@ -38,7 +39,7 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 26c1b3cd0d69f9a3da7d32b100413552785a788c..bc26dfef93f475bbbc90199e7e4d2a8c41d03842 100644 (file)
@@ -1,7 +1,8 @@
 #include "openbox/action.h"
+#include "openbox/action_list_run.h"
 #include "openbox/focus.h"
 
-static gboolean run_func(ObActionData *data, gpointer options);
+static gboolean run_func(const ObActionListRun *data, gpointer options);
 
 void action_unfocus_startup(void)
 {
@@ -10,7 +11,7 @@ void action_unfocus_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionData *data, gpointer options)
+static gboolean run_func(const ObActionListRun *data, gpointer options)
 {
     if (data->client && data->client == focus_client)
         focus_fallback(FALSE, FALSE, TRUE, FALSE);
index f29709392e16c8f076c452f08efc92354a14efa9..5388d153041046c5db7497a48067cb06f792b2b8 100644 (file)
@@ -61,11 +61,11 @@ ObClientSet* client_set_single(ObClient *c)
 {
     ObClientSet *set;
 
-    if (!c) return NULL;
-    set = g_slice_new(ObClientSet);
-    set->all = FALSE;
-    client_set_create_hash(set);
-    g_hash_table_insert(set->h, &c->window, c);
+    set = client_set_empty();
+    if (c) {
+        client_set_create_hash(set);
+        g_hash_table_insert(set->h, &c->window, c);
+    }
     return set;
 }
 
index dd0f4d7d3ce1ccc6e0194f0bdbfba2cf9b65c18e..c35e09531efd90779e4c3dd02cef489d48bacbfe 100644 (file)
 */
 
 #include "openbox/action_filter.h"
+#include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 
-static gboolean reduce(struct _ObClient *c, gpointer data)
+static ObClientSet* filter(gboolean invert, const ObActionListRun *data,
+                           gpointer setup_data)
 {
-    return FALSE; /* remove nothing */
-}
-static gboolean expand(struct _ObClient *c, gpointer data)
-{
-    return TRUE; /* add everything */
+    return invert ? client_set_empty() : client_set_all();
 }
 
 void filter_all_startup(void)
 {
-    action_filter_register("all", NULL, NULL, reduce, expand);
+    action_filter_register("all", NULL, NULL, filter);
 }
index cb6b33a93fc034a622c29200a9bf2d32fd20a5f7..4905997571c59ecd1d1f079590a02c21a986bf48 100644 (file)
 */
 
 #include "openbox/action_filter.h"
-#include "openbox/event.h"
+#include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 
-static gboolean reduce(struct _ObClient *c, gpointer data)
+static ObClientSet* filter(gboolean invert, const ObActionListRun *data,
+                           gpointer setup_data)
 {
-    return c != event_current_target(); /* remove anything not the target */
-}
-static gboolean expand(struct _ObClient *c, gpointer data)
-{
-    return c == event_current_target(); /* add only the target */
+    ObClientSet *set = client_set_single(data->client);
+    if (invert) set = client_set_minus(client_set_all(), set);
+    return set;
 }
 
 void filter_target_startup(void)
 {
-    action_filter_register("target", NULL, NULL, reduce, expand);
+    action_filter_register("target", NULL, NULL, filter);
 }
index 8515ff6448fe96bef024d28a9e13beb157af811c..b3ec2ad5d84c01498439d61d0afa1f91aa41b2f5 100644 (file)
@@ -26,6 +26,7 @@
 #include "client.h"
 #include "action.h"
 #include "action_list.h"
+#include "action_list_run.h"
 #include "menuframe.h"
 #include "config.h"
 #include "keytree.h"
@@ -266,7 +267,7 @@ gboolean keyboard_event(ObClient *client, const XEvent *e)
             else {
                 gboolean i;
 
-                i = action_run_acts(p->actions, OB_USER_ACTION_KEYBOARD_KEY,
+                i = action_list_run(p->actions, OB_USER_ACTION_KEYBOARD_KEY,
                                     e->xkey.state,
                                     e->xkey.x_root, e->xkey.y_root,
                                     0, OB_FRAME_CONTEXT_NONE, client);
index 3aa0dfee0d432e3ac3e6657cf4cafaf317b619a6..9c5e54b2a33e1f899ede3b37cd29a993f42fb579 100644 (file)
@@ -23,6 +23,7 @@
 #include "screen.h"
 #include "action.h"
 #include "action_list.h"
+#include "action_list_run.h"
 #include "event.h"
 #include "grab.h"
 #include "openbox.h"
@@ -1304,7 +1305,7 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)
         if (func)
             func(entry, frame, client, state, data);
         else
-            action_run_acts(acts, OB_USER_ACTION_MENU_SELECTION,
+            action_list_run(acts, OB_USER_ACTION_MENU_SELECTION,
                             state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, client);
     }
 }
index f0b869c16db65c30c05088360339dbe93401f457..df34184b23c6ed9983b323c214fa529fa3d66548 100644 (file)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "action.h"
 #include "action_list.h"
+#include "action_list_run.h"
 #include "event.h"
 #include "client.h"
 #include "grab.h"
@@ -188,7 +189,7 @@ static gboolean fire_binding(ObMouseAction a, ObFrameContext context,
     /* if not bound, then nothing to do! */
     if (it == NULL) return FALSE;
 
-    action_run_acts(b->actions[a], mouse_action_to_user_action(a),
+    action_list_run(b->actions[a], mouse_action_to_user_action(a),
                     state, x, y, button, context, c);
     return TRUE;
 }