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 \
#include "action.h"
#include "action_list.h"
+#include "action_list_run.h"
#include "action_filter.h"
#include "gettext.h"
#include "grab.h"
#include "event.h"
#include "config.h"
#include "client.h"
+#include "client_set.h"
#include "focus.h"
#include "openbox.h"
#include "debug.h"
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;
}
}
-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();
}
}
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 */
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();
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 */
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)
event_end_ignore_all_enters(ignore_start);
}
}
+
+ObActionDefaultFilter action_default_filter(ObAction *act)
+{
+ return act->def->def_filter;
+}
#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,
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);
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);
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);
*/
#include "action_filter.h"
+#include "action_list_run.h"
+#include "client_set.h"
#include "gettext.h"
#include "filters/_all.h"
gchar *name;
ObActionFilterSetupFunc setup;
ObActionFilterDestroyFunc destroy;
- ObClientSetReduceFunc reduce;
- ObClientSetExpandFunc expand;
+ ObActionFilterFunc set;
};
struct _ObActionFilter {
gint ref;
ObActionFilterDefinition *def;
+ gboolean invert;
gpointer data;
};
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;
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;
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;
}
}
}
-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);
}
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;
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);
#include "action_list.h"
#include "action.h"
+#include "action_filter.h"
#include "action_value.h"
#include <glib.h>
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);
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;
}
#include <glib.h>
struct _ObActionAct;
+struct _ObActionFilter;
struct _ObActionValue;
typedef struct _ObActionList ObActionList;
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 */
};
struct _ObActionListTest {
- gchar *key;
- struct _ObActionValue *value; /* can be null */
+ struct _ObActionFilter *filter;
gboolean and;
ObActionListTest *next;
};
--- /dev/null
+/* -*- 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);
+}
--- /dev/null
+/* -*- 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);
#include "action_parser.h"
#include "action.h"
+#include "action_filter.h"
#include "action_list.h"
#include "action_value.h"
#include "gettext.h"
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);
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;
gchar *key;
ObActionValue *value;
gboolean and;
+ ObActionFilter *filter;
ObActionListTest *next;
t = g_scanner_get_next_token(p->scan);
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 */
/* 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;
}
ObActionListTest *test;
test = g_slice_new(ObActionListTest);
- test->key = key;
- test->value = value;
+ test->filter = filter;
test->and = and;
test->next = next;
return test;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/screen.h"
#include <glib.h>
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)
{
}
/* 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;
#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)
{
}
/* 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);
#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)
{
}
/* 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);
#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"
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,
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;
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();
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include <glib.h>
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)
{
}
/* 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;
#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)
{
}
/* 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);
}
/* 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);
}
/* 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);
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/screen.h"
#include "openbox/client.h"
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,
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;
#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"
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,
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;
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();
#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)
{
}
/* 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();
}
/* 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();
#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)
{
}
/* 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();
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/event.h"
#include "openbox/startupnotify.h"
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);
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);
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;
}
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/openbox.h"
#include "openbox/prompt.h"
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)
{
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/event.h"
#include "openbox/client.h"
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)
{
}
/* 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;
#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)
{
}
/* 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);
#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)
{
}
/* 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);
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/misc.h"
#include "openbox/client.h"
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)
{
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;
}
/* 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;
#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)
{
}
/* 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);
#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)
{
}
/* 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);
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/client.h"
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)
{
}
/* 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;
#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)
{
}
/* 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);
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/client.h"
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)
{
}
/* 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) {
}
/* 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) {
}
/* 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) {
#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)
{
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
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)
{
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
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)
{
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/misc.h"
#include "openbox/client.h"
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)
{
}
/* 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;
#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)
{
}
/* 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);
#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)
{
}
/* 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);
#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)
{
}
/* 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);
#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)
{
}
/* 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();
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/moveresize.h"
#include "openbox/client.h"
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);
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
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)
{
}
/* 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;
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/openbox.h"
#include "obt/paths.h"
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)
{
}
/* 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;
#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)
{
}
/* 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);
}
/* 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);
}
/* 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);
#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)
{
}
/* 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);
#include "openbox/action.h"
+#include "openbox/action_list_run.h"
#include "openbox/action_value.h"
#include "openbox/menu.h"
#include <glib.h>
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)
{
}
/* 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;
#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)
{
}
/* 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);
{
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;
}
*/
#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);
}
*/
#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);
}
#include "client.h"
#include "action.h"
#include "action_list.h"
+#include "action_list_run.h"
#include "menuframe.h"
#include "config.h"
#include "keytree.h"
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);
#include "screen.h"
#include "action.h"
#include "action_list.h"
+#include "action_list_run.h"
#include "event.h"
#include "grab.h"
#include "openbox.h"
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);
}
}
#include "config.h"
#include "action.h"
#include "action_list.h"
+#include "action_list_run.h"
#include "event.h"
#include "client.h"
#include "grab.h"
/* 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;
}