openbox/actions/resizerelative.c \
openbox/actions/restart.c \
openbox/actions/shade.c \
- openbox/actions/shadelowerraise.c \
openbox/actions/showdesktop.c \
openbox/actions/showmenu.c \
openbox/actions/unfocus.c \
- openbox/actions.c \
- openbox/actions.h \
- openbox/actions_list.c \
- openbox/actions_list.h \
- openbox/actions_parser.c \
- openbox/actions_parser.h \
- openbox/actions_value.c \
- openbox/actions_value.h \
+ openbox/action.c \
+ openbox/action.h \
+ openbox/action_list.c \
+ openbox/action_list.h \
+ openbox/action_parser.c \
+ openbox/action_parser.h \
+ openbox/action_value.c \
+ openbox/action_value.h \
openbox/apps_menu.c \
openbox/apps_menu.h \
openbox/client.c \
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions.c for the Openbox window manager
- Copyright (c) 2007 Dana Jansens
+ action.c for the Openbox window manager
+ Copyright (c) 2007-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
See the COPYING file for a copy of the GNU General Public License.
*/
-#include "actions.h"
-#include "actions_list.h"
+#include "action.h"
+#include "action_list.h"
#include "gettext.h"
#include "grab.h"
#include "screen.h"
#include "actions/all.h"
-static void actions_definition_ref(ObActionsDefinition *def);
-static void actions_definition_unref(ObActionsDefinition *def);
-static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state);
-static void actions_interactive_end_act();
-static ObActionsAct* actions_act_find_name(const gchar *name);
+static void action_definition_ref(ObActionDefinition *def);
+static void action_definition_unref(ObActionDefinition *def);
+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 ObActionsAct *interactive_act = NULL;
-static guint interactive_initial_state = 0;
+static ObAction *interactive_act = NULL;
+static guint interactive_initial_state = 0;
-struct _ObActionsDefinition {
+struct _ObActionDefinition {
guint ref;
gchar *name;
gboolean canbeinteractive;
union {
- ObActionsIDataSetupFunc i;
- ObActionsDataSetupFunc n;
+ ObActionIDataSetupFunc i;
+ ObActionDataSetupFunc n;
} setup;
- ObActionsDataFreeFunc free;
- ObActionsRunFunc run;
- ObActionsShutdownFunc shutdown;
+ ObActionDataFreeFunc free;
+ ObActionRunFunc run;
+ ObActionShutdownFunc shutdown;
};
-struct _ObActionsAct {
+struct _ObAction {
guint ref;
- ObActionsDefinition *def;
- ObActionsIPreFunc i_pre;
- ObActionsIInputFunc i_input;
- ObActionsICancelFunc i_cancel;
- ObActionsIPostFunc i_post;
+ ObActionDefinition *def;
+ ObActionIPreFunc i_pre;
+ ObActionIInputFunc i_input;
+ ObActionICancelFunc i_cancel;
+ ObActionIPostFunc i_post;
gpointer options;
};
static GSList *registered = NULL;
-void actions_startup(gboolean reconfig)
+void action_startup(gboolean reconfig)
{
if (reconfig) return;
- action_all_startup();
+ actions_all_startup();
}
-void actions_shutdown(gboolean reconfig)
+void action_shutdown(gboolean reconfig)
{
- actions_interactive_cancel_act();
+ action_interactive_cancel_act();
if (reconfig) return;
/* free all the registered actions */
while (registered) {
- ObActionsDefinition *d = registered->data;
+ ObActionDefinition *d = registered->data;
if (d->shutdown) d->shutdown();
- actions_definition_unref(d);
+ action_definition_unref(d);
registered = g_slist_delete_link(registered, registered);
}
}
-ObActionsDefinition* do_register(const gchar *name,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run)
+ObActionDefinition* do_register(const gchar *name,
+ ObActionDataFreeFunc free,
+ ObActionRunFunc run)
{
GSList *it;
- ObActionsDefinition *def;
+ ObActionDefinition *def;
g_assert(run != NULL);
return NULL;
}
- def = g_slice_new(ObActionsDefinition);
+ def = g_slice_new(ObActionDefinition);
def->ref = 1;
def->name = g_strdup(name);
def->free = free;
return def;
}
-gboolean actions_register_i(const gchar *name,
- ObActionsIDataSetupFunc setup,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run)
+gboolean action_register_i(const gchar *name,
+ ObActionIDataSetupFunc setup,
+ ObActionDataFreeFunc free,
+ ObActionRunFunc run)
{
- ObActionsDefinition *def = do_register(name, free, run);
+ ObActionDefinition *def = do_register(name, free, run);
if (def) {
def->canbeinteractive = TRUE;
def->setup.i = setup;
return def != NULL;
}
-gboolean actions_register(const gchar *name,
- ObActionsDataSetupFunc setup,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run)
+gboolean action_register(const gchar *name,
+ ObActionDataSetupFunc setup,
+ ObActionDataFreeFunc free,
+ ObActionRunFunc run)
{
- ObActionsDefinition *def = do_register(name, free, run);
+ ObActionDefinition *def = do_register(name, free, run);
if (def) {
def->canbeinteractive = FALSE;
def->setup.n = setup;
return def != NULL;
}
-gboolean actions_set_shutdown(const gchar *name,
- ObActionsShutdownFunc shutdown)
+gboolean action_set_shutdown(const gchar *name,
+ ObActionShutdownFunc shutdown)
{
GSList *it;
- ObActionsDefinition *def;
+ ObActionDefinition *def;
for (it = registered; it; it = g_slist_next(it)) {
def = it->data;
return FALSE;
}
-static void actions_definition_ref(ObActionsDefinition *def)
+static void action_definition_ref(ObActionDefinition *def)
{
++def->ref;
}
-static void actions_definition_unref(ObActionsDefinition *def)
+static void action_definition_unref(ObActionDefinition *def)
{
if (def && --def->ref == 0) {
g_free(def->name);
- g_slice_free(ObActionsDefinition, def);
+ g_slice_free(ObActionDefinition, def);
}
}
-static ObActionsAct* actions_act_find_name(const gchar *name)
+static ObAction* action_find_by_name(const gchar *name)
{
GSList *it;
- ObActionsDefinition *def = NULL;
- ObActionsAct *act = NULL;
+ ObActionDefinition *def = NULL;
+ ObAction *act = NULL;
/* find the requested action */
for (it = registered; it; it = g_slist_next(it)) {
/* if we found the action */
if (def) {
- act = g_slice_new(ObActionsAct);
+ act = g_slice_new(ObAction);
act->ref = 1;
act->def = def;
- actions_definition_ref(act->def);
+ action_definition_ref(act->def);
act->i_pre = NULL;
act->i_input = NULL;
act->i_cancel = NULL;
return act;
}
-ObActionsAct* actions_act_new(const gchar *name, GHashTable *config)
+ObAction* action_new(const gchar *name, GHashTable *config)
{
- ObActionsAct *act = NULL;
+ ObAction *act = NULL;
- act = actions_act_find_name(name);
+ act = action_find_by_name(name);
if (act) {
/* there is more stuff to parse here */
if (act->def->canbeinteractive) {
return act;
}
-gboolean actions_act_is_interactive(ObActionsAct *act)
+gboolean action_is_interactive(ObAction *act)
{
return act->i_input != NULL;
}
-void actions_act_ref(ObActionsAct *act)
+void action_ref(ObAction *act)
{
++act->ref;
}
-void actions_act_unref(ObActionsAct *act)
+void action_unref(ObAction *act)
{
if (act && --act->ref == 0) {
/* free the action specific options */
if (act->def->free)
act->def->free(act->options);
/* unref the definition */
- actions_definition_unref(act->def);
- g_slice_free(ObActionsAct, act);
+ action_definition_unref(act->def);
+ g_slice_free(ObAction, act);
}
}
-static void actions_setup_data(ObActionsData *data,
- ObUserAction uact,
- guint state,
- gint x,
- gint y,
- gint button,
- ObFrameContext con,
- struct _ObClient *client)
+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->client = client;
}
-gboolean actions_run_acts(ObActionsList *acts,
- ObUserAction uact,
- guint state,
- gint x,
- gint y,
- gint button,
- ObFrameContext con,
- struct _ObClient *client)
+gboolean action_run_acts(ObActionList *acts,
+ ObUserAction uact,
+ guint state,
+ gint x,
+ gint y,
+ gint button,
+ ObFrameContext con,
+ struct _ObClient *client)
{
gboolean ran_interactive;
gboolean update_user_time;
ran_interactive = FALSE;
update_user_time = FALSE;
while (acts) {
- ObActionsAct *act;
- ObActionsData data;
+ ObAction *act;
+ ObActionData data;
gboolean ok = TRUE;
if (acts->isfilter) {
act = acts->u.action;
}
- actions_setup_data(&data, uact, state, x, y, button, con, client);
+ 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 (actions_act_is_interactive(act)) {
+ if (action_is_interactive(act)) {
/* cancel the old one */
if (interactive_act)
- actions_interactive_cancel_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 (actions_act_is_interactive(act)) {
- ok = actions_interactive_begin_act(act, state);
+ if (action_is_interactive(act)) {
+ ok = action_interactive_begin_act(act, state);
ran_interactive = TRUE;
}
}
/* fire the action's run function with this data */
if (ok) {
if (!act->def->run(&data, act->options)) {
- if (actions_act_is_interactive(act))
- actions_interactive_end_act();
+ if (action_is_interactive(act))
+ action_interactive_end_act();
if (client && client == focus_client)
update_user_time = TRUE;
} else {
return ran_interactive;
}
-gboolean actions_interactive_act_running(void)
+gboolean action_interactive_act_running(void)
{
return interactive_act != NULL;
}
-void actions_interactive_cancel_act(void)
+void action_interactive_cancel_act(void)
{
if (interactive_act) {
if (interactive_act->i_cancel)
interactive_act->i_cancel(interactive_act->options);
- actions_interactive_end_act();
+ action_interactive_end_act();
}
}
-static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state)
+static gboolean action_interactive_begin_act(ObAction *act, guint state)
{
if (grab_keyboard()) {
interactive_act = act;
- actions_act_ref(interactive_act);
+ action_ref(interactive_act);
interactive_initial_state = obt_keyboard_only_modmasks(state);
return FALSE;
}
-static void actions_interactive_end_act(void)
+static void action_interactive_end_act(void)
{
if (interactive_act) {
- ObActionsAct *ia = interactive_act;
+ ObAction *ia = interactive_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
if (ia->i_post)
ia->i_post(ia->options);
- actions_act_unref(ia);
+ action_unref(ia);
}
}
-gboolean actions_interactive_input_event(XEvent *e)
+gboolean action_interactive_input_event(XEvent *e)
{
gboolean used = FALSE;
if (interactive_act) {
{
used = TRUE; /* if it cancelled the action then it has to of
been used */
- actions_interactive_end_act();
+ action_interactive_end_act();
}
}
return used;
}
-void actions_client_move(ObActionsData *data, gboolean start)
+void action_client_move(ObActionData *data, gboolean start)
{
static gulong ignore_start = 0;
if (start)
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ action.h for the Openbox window manager
+ Copyright (c) 2007-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 "obt/xml.h"
+#include "obt/keyboard.h"
+
+#include <glib.h>
+#include <X11/Xlib.h>
+
+struct _ObActionList;
+
+typedef struct _ObActionDefinition ObActionDefinition;
+typedef struct _ObAction ObAction;
+typedef struct _ObActionData ObActionData;
+
+typedef void (*ObActionDataFreeFunc)(gpointer options);
+typedef gboolean (*ObActionRunFunc)(ObActionData *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 */
+typedef gboolean (*ObActionIPreFunc)(guint initial_state, gpointer options);
+typedef void (*ObActionIPostFunc)(gpointer options);
+typedef gboolean (*ObActionIInputFunc)(guint initial_state,
+ XEvent *e,
+ ObtIC *ic,
+ gpointer options,
+ gboolean *used);
+typedef void (*ObActionICancelFunc)(gpointer options);
+typedef gpointer (*ObActionIDataSetupFunc)(GHashTable *config,
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post);
+
+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);
+
+/*! Use this if the actions created from this name may be interactive */
+gboolean action_register_i(const gchar *name,
+ ObActionIDataSetupFunc setup,
+ ObActionDataFreeFunc free,
+ ObActionRunFunc run);
+
+gboolean action_register(const gchar *name,
+ ObActionDataSetupFunc setup,
+ ObActionDataFreeFunc free,
+ ObActionRunFunc run);
+
+gboolean action_set_shutdown(const gchar *name,
+ ObActionShutdownFunc shutdown);
+
+gboolean action_is_interactive(ObAction *act);
+
+/*! Create a new ObAction structure.
+ @name The name of the action.
+ @keys The names of the options passed to the action.
+ @values The values of the options passed to the action, paired with the
+ keys. These are ObActionListValue objects.
+*/
+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.
+*/
+gboolean action_run_acts(struct _ObActionList *acts,
+ ObUserAction uact,
+ guint state,
+ gint x,
+ gint y,
+ gint button,
+ ObFrameContext con,
+ struct _ObClient *client);
+
+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);
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions_list.c for the Openbox window manager
+ action_list.c for the Openbox window manager
Copyright (c) 2011 Dana Jansens
This program is free software; you can redistribute it and/or modify
See the COPYING file for a copy of the GNU General Public License.
*/
-#include "actions_list.h"
-#include "actions.h"
-#include "actions_value.h"
+#include "action_list.h"
+#include "action.h"
+#include "action_value.h"
#include <glib.h>
-void actions_list_ref(ObActionsList *l)
+void action_list_ref(ObActionList *l)
{
if (l) ++l->ref;
}
-void actions_list_unref(ObActionsList *l)
+void action_list_unref(ObActionList *l)
{
while (l && --l->ref < 1) {
- ObActionsList *n = l->next;
+ ObActionList *n = l->next;
if (l->isfilter) {
- actions_list_test_destroy(l->u.f.test);
- actions_list_unref(l->u.f.thendo);
- actions_list_unref(l->u.f.elsedo);
+ action_list_test_destroy(l->u.f.test);
+ action_list_unref(l->u.f.thendo);
+ action_list_unref(l->u.f.elsedo);
}
else {
- actions_act_unref(l->u.action);
+ action_unref(l->u.action);
}
- g_slice_free(ObActionsList, l);
+ g_slice_free(ObActionList, l);
l = n;
}
}
-void actions_list_test_destroy(ObActionsListTest *t)
+void action_list_test_destroy(ObActionListTest *t)
{
while (t) {
- ObActionsListTest *n = t->next;
+ ObActionListTest *n = t->next;
g_free(t->key);
- actions_value_unref(t->value);
- g_slice_free(ObActionsListTest, t);
+ action_value_unref(t->value);
+ g_slice_free(ObActionListTest, t);
t = n;
}
}
-ObActionsList* actions_list_concat(ObActionsList *a, ObActionsList *b)
+ObActionList* action_list_concat(ObActionList *a, ObActionList *b)
{
- ObActionsList *start = a;
+ ObActionList *start = a;
if (!start) return b;
while (a->next) a = a->next;
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ action_list.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 <glib.h>
+
+struct _ObActionAct;
+struct _ObActionValue;
+
+typedef struct _ObActionList ObActionList;
+typedef struct _ObActionListTest ObActionListTest;
+
+/*! Each node of the Action list is an action itself (or a filter bound to
+ an action). */
+struct _ObActionList {
+ gint ref;
+ gboolean isfilter;
+ union {
+ struct _ObActionListFilter {
+ ObActionListTest *test; /* can be null */
+ ObActionList *thendo; /* can be null */
+ ObActionList *elsedo; /* can be null */
+ } f;
+ struct _ObAction *action;
+ } u;
+ ObActionList *next;
+};
+
+struct _ObActionListTest {
+ gchar *key;
+ struct _ObActionValue *value; /* can be null */
+ gboolean and;
+ ObActionListTest *next;
+};
+
+void action_list_ref(ObActionList *l);
+void action_list_unref(ObActionList *l);
+
+void action_list_test_destroy(ObActionListTest *t);
+
+ObActionList* action_list_concat(ObActionList *a, ObActionList *b);
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions_parser.c for the Openbox window manager
+ action_parser.c for the Openbox window manager
Copyright (c) 2011 Dana Jansens
This program is free software; you can redistribute it and/or modify
See the COPYING file for a copy of the GNU General Public License.
*/
-#include "actions_parser.h"
-#include "actions.h"
-#include "actions_list.h"
-#include "actions_value.h"
+#include "action_parser.h"
+#include "action.h"
+#include "action_list.h"
+#include "action_value.h"
#include "gettext.h"
#ifdef HAVE_STRING_H
# include <string.h>
#endif
-struct _ObActionsList;
-struct _ObActionsListTest;
-struct _ObActionsValue;
+struct _ObActionList;
+struct _ObActionListTest;
+struct _ObActionValue;
#define SKIP " \t"
#define IDENTIFIER_FIRST G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "-_"
#define IDENTIFIER_NTH IDENTIFIER_FIRST G_CSET_LATINS G_CSET_LATINC
#define ESCAPE_SEQS "\"()"
-struct _ObActionsList* parse_list(ObActionsParser *p,
- GTokenType end,
- gboolean *e);
-struct _ObActionsList* parse_action(ObActionsParser *p, gboolean *e);
-struct _ObActionsList* parse_filter(ObActionsParser *p, gboolean *e);
-struct _ObActionsListTest* parse_filter_test(ObActionsParser *p, gboolean *e);
-struct _ObActionsValue* parse_value(ObActionsParser *p,
- gboolean allow_actions,
- gboolean *e);
-gchar* parse_string(ObActionsParser *p, guchar end, gboolean *e);
-
-struct _ObActionsParser
+struct _ObActionList* parse_list(ObActionParser *p,
+ GTokenType end,
+ gboolean *e);
+struct _ObActionList* parse_action(ObActionParser *p, gboolean *e);
+struct _ObActionList* parse_filter(ObActionParser *p, gboolean *e);
+struct _ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e);
+struct _ObActionValue* parse_value(ObActionParser *p,
+ gboolean allow_actions,
+ gboolean *e);
+gchar* parse_string(ObActionParser *p, guchar end, gboolean *e);
+
+struct _ObActionParser
{
gint ref;
GScanner *scan;
};
-ObActionsParser* actions_parser_new(void)
+ObActionParser* action_parser_new(void)
{
- ObActionsParser *p;
+ ObActionParser *p;
GScannerConfig config = {
.cset_skip_characters = SKIP,
.cset_identifier_first = IDENTIFIER_FIRST,
.store_int64 = FALSE
};
- p = g_slice_new(ObActionsParser);
+ p = g_slice_new(ObActionParser);
p->ref = 1;
p->scan = g_scanner_new(&config);
return p;
}
-void actions_parser_ref(ObActionsParser *p)
+void action_parser_ref(ObActionParser *p)
{
++p->ref;
}
-void actions_parser_unref(ObActionsParser *p)
+void action_parser_unref(ObActionParser *p)
{
if (p && --p->ref < 1) {
g_scanner_destroy(p->scan);
- g_slice_free(ObActionsParser, p);
+ g_slice_free(ObActionParser, p);
}
}
-ObActionsList* actions_parser_read_string(ObActionsParser *p,
- const gchar *text)
+ObActionList* action_parser_read_string(ObActionParser *p, const gchar *text)
{
gboolean e;
return parse_list(p, G_TOKEN_EOF, &e);
}
-ObActionsList* actions_parser_read_file(ObActionsParser *p,
- const gchar *file,
- GError **error)
+ObActionList* actions_parser_read_file(ObActionParser *p,
+ const gchar *file,
+ GError **error)
{
GIOChannel *ch;
gboolean e;
\\ \( \) and \" are all valid escaped characters.
************** ************/
-gpointer parse_error(ObActionsParser *p, GTokenType exp, const gchar *message,
+gpointer parse_error(ObActionParser *p, GTokenType exp, const gchar *message,
gboolean *e)
{
g_scanner_unexp_token(p->scan, exp, NULL, NULL, NULL, message, TRUE);
return NULL;
}
-ObActionsList* parse_list(ObActionsParser *p, GTokenType end, gboolean *e)
+ObActionList* parse_list(ObActionParser *p, GTokenType end, gboolean *e)
{
- ObActionsList *first, *last;
+ ObActionList *first, *last;
GTokenType t;
first = last = NULL;
g_scanner_get_next_token(p->scan); /* separator */
}
else if (t == G_TOKEN_IDENTIFIER) {
- ObActionsList *next;
+ ObActionList *next;
/* parse the next action and stick it on the end of the list */
next = parse_action(p, e);
return first;
}
-ObActionsList* parse_action(ObActionsParser *p, gboolean *e)
+ObActionList* parse_action(ObActionParser *p, gboolean *e)
{
GTokenType t;
- ObActionsList *al;
+ ObActionList *al;
gchar *name;
GHashTable *config;
/* read the action's name */
name = g_strdup(p->scan->value.v_string);
config = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
- (GDestroyNotify)actions_value_unref);
+ (GDestroyNotify)action_value_unref);
/* read the action's options key:value pairs */
t = g_scanner_peek_next_token(p->scan);
}
else {
gchar *key;
- ObActionsValue *value;
+ ObActionValue *value;
g_scanner_get_next_token(p->scan); /* eat the key */
t = g_scanner_peek_next_token(p->scan); /* check for ':' */
t = g_scanner_peek_next_token(p->scan);
}
- al = g_slice_new(ObActionsList);
+ al = g_slice_new(ObActionList);
al->ref = 1;
al->isfilter = FALSE;
- al->u.action = actions_act_new(name, config);
+ al->u.action = action_new(name, config);
al->next = NULL;
g_free(name);
g_hash_table_unref(config);
return al;
}
-ObActionsList* parse_filter(ObActionsParser *p, gboolean *e)
+ObActionList* parse_filter(ObActionParser *p, gboolean *e)
{
GTokenType t;
- ObActionsList *al, *thendo, *elsedo;
- ObActionsListTest *test;
+ ObActionList *al, *thendo, *elsedo;
+ ObActionListTest *test;
/* read the filter tests */
test = parse_filter_test(p, e);
if (*e) {
- actions_list_test_destroy(test);
+ action_list_test_destroy(test);
return NULL;
}
}
}
- al = g_slice_new(ObActionsList);
+ al = g_slice_new(ObActionList);
al->ref = 1;
al->isfilter = TRUE;
al->u.f.test = test;
return al;
}
-ObActionsListTest* parse_filter_test(ObActionsParser *p, gboolean *e)
+ObActionListTest* parse_filter_test(ObActionParser *p, gboolean *e)
{
GTokenType t;
gchar *key;
- ObActionsValue *value;
+ ObActionValue *value;
gboolean and;
- ObActionsListTest *next;
+ ObActionListTest *next;
t = g_scanner_get_next_token(p->scan);
if (t == ']') /* empty */
/* don't allow any errors (but value can be null if not present) */
if (*e) {
g_free(key);
- actions_value_unref(value);
+ action_value_unref(value);
return NULL;
}
/* don't allow any errors */
if (*e) {
g_free(key);
- actions_value_unref(value);
- actions_list_test_destroy(next);
+ action_value_unref(value);
+ action_list_test_destroy(next);
return NULL;
}
else {
- ObActionsListTest *test;
+ ObActionListTest *test;
- test = g_slice_new(ObActionsListTest);
+ test = g_slice_new(ObActionListTest);
test->key = key;
test->value = value;
test->and = and;
}
}
-ObActionsValue* parse_value(ObActionsParser *p,
- gboolean allow_actions,
- gboolean *e)
+ObActionValue* parse_value(ObActionParser *p,
+ gboolean allow_actions,
+ gboolean *e)
{
GTokenType t;
- ObActionsValue *v;
+ ObActionValue *v;
v = NULL;
t = g_scanner_get_next_token(p->scan);
if (t == G_TOKEN_IDENTIFIER) {
- v = actions_value_new_string(p->scan->value.v_string);
+ v = action_value_new_string(p->scan->value.v_string);
}
else if (t == '"')
- v = actions_value_new_string(parse_string(p, '"', e));
+ v = action_value_new_string(parse_string(p, '"', e));
else if (t == '(')
- v = actions_value_new_string(parse_string(p, ')', e));
+ v = action_value_new_string(parse_string(p, ')', e));
else if (t == '{' && allow_actions) {
- ObActionsList *l = parse_list(p, '}', e);
- if (l) v = actions_value_new_actions_list(l);
+ ObActionList *l = parse_list(p, '}', e);
+ if (l) v = action_value_new_action_list(l);
}
else
parse_error(p, G_TOKEN_NONE, _("Expected an option value"), e);
}
-gchar* parse_string(ObActionsParser *p, guchar end, gboolean *e)
+gchar* parse_string(ObActionParser *p, guchar end, gboolean *e)
{
GString *buf;
GTokenType t;
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions_parser.h for the Openbox window manager
+ action_parser.h for the Openbox window manager
Copyright (c) 2011 Dana Jansens
This program is free software; you can redistribute it and/or modify
#include <glib.h>
-struct _ObActionsList;
+struct _ObActionList;
-typedef struct _ObActionsParser ObActionsParser;
+typedef struct _ObActionParser ObActionParser;
-ObActionsParser* actions_parser_new(void);
+ObActionParser* action_parser_new(void);
-void actions_parser_ref(ObActionsParser *p);
-void actions_parser_unref(ObActionsParser *p);
+void action_parser_ref(ObActionParser *p);
+void action_parser_unref(ObActionParser *p);
-struct _ObActionsList* actions_parser_read_string(ObActionsParser *p,
- const gchar *text);
-struct _ObActionsList* actions_parser_read_file(ObActionsParser *p,
- const gchar *file,
- GError **error);
+struct _ObActionList* action_parser_read_string(ObActionParser *p,
+ const gchar *text);
+struct _ObActionList* action_parser_read_file(ObActionParser *p,
+ const gchar *file,
+ GError **error);
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions_value.c for the Openbox window manager
+ action_value.c for the Openbox window manager
Copyright (c) 2011 Dana Jansens
This program is free software; you can redistribute it and/or modify
See the COPYING file for a copy of the GNU General Public License.
*/
-#include "actions_value.h"
-#include "actions_list.h"
+#include "action_value.h"
+#include "action_list.h"
#include "geom.h"
#include "stdlib.h"
-struct _ObActionsValue {
+struct _ObActionValue {
gint ref;
enum {
OB_AV_STRING,
- OB_AV_ACTIONSLIST
+ OB_AV_ACTIONLIST
} type;
union {
gchar *string;
gboolean boolean;
guint integer;
- ObActionsList *actions;
+ ObActionList *actions;
} v;
};
-ObActionsValue* actions_value_new_string(const gchar *s)
+ObActionValue* action_value_new_string(const gchar *s)
{
- return actions_value_new_string_steal(g_strdup(s));
+ return action_value_new_string_steal(g_strdup(s));
}
-ObActionsValue* actions_value_new_string_steal(gchar *s)
+ObActionValue* action_value_new_string_steal(gchar *s)
{
- ObActionsValue *v = g_slice_new(ObActionsValue);
+ ObActionValue *v = g_slice_new(ObActionValue);
v->ref = 1;
v->type = OB_AV_STRING;
v->v.string = s;
return v;
}
-ObActionsValue* actions_value_new_actions_list(ObActionsList *al)
+ObActionValue* action_value_new_action_list(ObActionList *al)
{
- ObActionsValue *v = g_slice_new(ObActionsValue);
+ ObActionValue *v = g_slice_new(ObActionValue);
v->ref = 1;
- v->type = OB_AV_ACTIONSLIST;
+ v->type = OB_AV_ACTIONLIST;
v->v.actions = al;
- actions_list_ref(al);
+ action_list_ref(al);
return v;
}
-void actions_value_ref(ObActionsValue *v)
+void action_value_ref(ObActionValue *v)
{
++v->ref;
}
-void actions_value_unref(ObActionsValue *v)
+void action_value_unref(ObActionValue *v)
{
if (v && --v->ref < 1) {
switch (v->type) {
case OB_AV_STRING:
g_free(v->v.string);
break;
- case OB_AV_ACTIONSLIST:
- actions_list_unref(v->v.actions);
+ case OB_AV_ACTIONLIST:
+ action_list_unref(v->v.actions);
break;
}
- g_slice_free(ObActionsValue, v);
+ g_slice_free(ObActionValue, v);
}
}
-gboolean actions_value_is_string(ObActionsValue *v)
+gboolean action_value_is_string(ObActionValue *v)
{
return v->type == OB_AV_STRING;
}
-gboolean actions_value_is_actions_list(ObActionsValue *v)
+gboolean action_value_is_action_list(ObActionValue *v)
{
- return v->type == OB_AV_ACTIONSLIST;
+ return v->type == OB_AV_ACTIONLIST;
}
-const gchar* actions_value_string(ObActionsValue *v)
+const gchar* action_value_string(ObActionValue *v)
{
g_return_val_if_fail(v->type == OB_AV_STRING, NULL);
return v->v.string;
}
-gboolean actions_value_bool(ObActionsValue *v)
+gboolean action_value_bool(ObActionValue *v)
{
g_return_val_if_fail(v->type == OB_AV_STRING, FALSE);
if (g_strcasecmp(v->v.string, "true") == 0 ||
return FALSE;
}
-gint actions_value_int(ObActionsValue *v)
+gint action_value_int(ObActionValue *v)
{
gchar *s;
return strtol(s, &s, 10);
}
-void actions_value_fraction(ObActionsValue *v, gint *numer, gint *denom)
+void action_value_fraction(ObActionValue *v, gint *numer, gint *denom)
{
gchar *s;
*denom = atoi(s+1);
}
-void actions_value_gravity_coord(ObActionsValue *v, GravityCoord *c)
+void action_value_gravity_coord(ObActionValue *v, GravityCoord *c)
{
gchar *s;
}
}
-ObActionsList* actions_value_actions_list(ObActionsValue *v)
+ObActionList* action_value_action_list(ObActionValue *v)
{
- g_return_val_if_fail(v->type == OB_AV_ACTIONSLIST, NULL);
+ g_return_val_if_fail(v->type == OB_AV_ACTIONLIST, NULL);
return v->v.actions;
}
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
- actions_value.h for the Openbox window manager
+ action_value.h for the Openbox window manager
Copyright (c) 2011 Dana Jansens
This program is free software; you can redistribute it and/or modify
#include <glib.h>
struct _GravityCoord;
-struct _ObActionsList;
+struct _ObActionList;
-typedef struct _ObActionsValue ObActionsValue;
+typedef struct _ObActionValue ObActionValue;
/*! Creates a new value by making a copy of the given string. */
-ObActionsValue* actions_value_new_string(const gchar *s);
+ObActionValue* action_value_new_string(const gchar *s);
/*! Creates a new value from a string, and steals ownership of the string. It
will be freed when then value is destroyed. */
-ObActionsValue* actions_value_new_string_steal(gchar *s);
+ObActionValue* action_value_new_string_steal(gchar *s);
/*! Creates a new value with a given actions list. */
-ObActionsValue* actions_value_new_actions_list(struct _ObActionsList *al);
+ObActionValue* action_value_new_action_list(struct _ObActionList *al);
-void actions_value_ref(ObActionsValue *v);
-void actions_value_unref(ObActionsValue *v);
+void action_value_ref(ObActionValue *v);
+void action_value_unref(ObActionValue *v);
-gboolean actions_value_is_string(ObActionsValue *v);
-gboolean actions_value_is_actions_list(ObActionsValue *v);
+gboolean action_value_is_string(ObActionValue *v);
+gboolean action_value_is_action_list(ObActionValue *v);
-const gchar* actions_value_string(ObActionsValue *v);
-gboolean actions_value_bool(ObActionsValue *v);
-gint actions_value_int(ObActionsValue *v);
-void actions_value_fraction(ObActionsValue *v, gint *numer, gint *denom);
-void actions_value_gravity_coord(ObActionsValue *v, struct _GravityCoord *c);
-struct _ObActionsList* actions_value_actions_list(ObActionsValue *v);
+const gchar* action_value_string(ObActionValue *v);
+gboolean action_value_bool(ObActionValue *v);
+gint action_value_int(ObActionValue *v);
+void action_value_fraction(ObActionValue *v, gint *numer, gint *denom);
+void action_value_gravity_coord(ObActionValue *v, struct _GravityCoord *c);
+struct _ObActionList* action_value_action_list(ObActionValue *v);
+++ /dev/null
-/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-
- actions.h for the Openbox window manager
- Copyright (c) 2007 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 "obt/xml.h"
-#include "obt/keyboard.h"
-
-#include <glib.h>
-#include <X11/Xlib.h>
-
-struct _ObActionsList;
-
-typedef struct _ObActionsDefinition ObActionsDefinition;
-typedef struct _ObActionsAct ObActionsAct;
-typedef struct _ObActionsData ObActionsData;
-
-typedef void (*ObActionsDataFreeFunc)(gpointer options);
-typedef gboolean (*ObActionsRunFunc)(ObActionsData *data,
- gpointer options);
-typedef gpointer (*ObActionsDataSetupFunc)(GHashTable *config);
-typedef void (*ObActionsShutdownFunc)(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 */
-typedef gboolean (*ObActionsIPreFunc)(guint initial_state, gpointer options);
-typedef void (*ObActionsIPostFunc)(gpointer options);
-typedef gboolean (*ObActionsIInputFunc)(guint initial_state,
- XEvent *e,
- ObtIC *ic,
- gpointer options,
- gboolean *used);
-typedef void (*ObActionsICancelFunc)(gpointer options);
-typedef gpointer (*ObActionsIDataSetupFunc)(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post);
-
-struct _ObActionsData {
- ObUserAction uact;
- guint state;
- gint x;
- gint y;
- gint button;
-
- struct _ObClient *client;
- ObFrameContext context;
-};
-
-void actions_startup(gboolean reconfigure);
-void actions_shutdown(gboolean reconfigure);
-
-/*! Use this if the actions created from this name may be interactive */
-gboolean actions_register_i(const gchar *name,
- ObActionsIDataSetupFunc setup,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run);
-
-gboolean actions_register(const gchar *name,
- ObActionsDataSetupFunc setup,
- ObActionsDataFreeFunc free,
- ObActionsRunFunc run);
-
-gboolean actions_set_shutdown(const gchar *name,
- ObActionsShutdownFunc shutdown);
-
-gboolean actions_act_is_interactive(ObActionsAct *act);
-
-/*! Create a new ObActionAct structure.
- @name The name of the action.
- @keys The names of the options passed to the action.
- @values The values of the options passed to the action, paired with the
- keys. These are ObActionsListValue objects.
-*/
-ObActionsAct* actions_act_new(const gchar *name, GHashTable *config);
-
-void actions_act_ref(ObActionsAct *act);
-void actions_act_unref(ObActionsAct *act);
-
-/*! Runs a list of actions.
- @return TRUE if an interactive action was started, FALSE otherwise.
-*/
-gboolean actions_run_acts(struct _ObActionsList *acts,
- ObUserAction uact,
- guint state,
- gint x,
- gint y,
- gint button,
- ObFrameContext con,
- struct _ObClient *client);
-
-gboolean actions_interactive_act_running(void);
-void actions_interactive_cancel_act(void);
-
-gboolean actions_interactive_input_event(XEvent *e);
-
-/*! Function for actions to call when they are moving a client around */
-void actions_client_move(ObActionsData *data, gboolean start);
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.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(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
/* 3.4-compatibility */
static gpointer setup_addcurrent_func(GHashTable *config);
static gpointer setup_addlast_func(GHashTable *config);
void action_addremovedesktop_startup(void)
{
- actions_register("AddDesktop", setup_add_func, free_func, run_func);
- actions_register("RemoveDesktop", setup_remove_func, free_func, run_func);
+ action_register("AddDesktop", setup_add_func, free_func, run_func);
+ action_register("RemoveDesktop", setup_remove_func, free_func, run_func);
/* 3.4-compatibility */
- actions_register("AddDesktopLast", setup_addlast_func,
- free_func, run_func);
- actions_register("RemoveDesktopLast", setup_removelast_func,
- free_func, run_func);
- actions_register("AddDesktopCurrent", setup_addcurrent_func,
- free_func, run_func);
- actions_register("RemoveDesktopCurrent", setup_removecurrent_func,
- free_func, run_func);
+ action_register("AddDesktopLast", setup_addlast_func,
+ free_func, run_func);
+ action_register("RemoveDesktopLast", setup_removelast_func,
+ free_func, run_func);
+ action_register("AddDesktopCurrent", setup_addcurrent_func,
+ free_func, run_func);
+ action_register("RemoveDesktopCurrent", setup_removecurrent_func,
+ free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "where");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "last"))
o->current = FALSE;
else if (!g_ascii_strcasecmp(s, "current"))
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
if (o->add)
screen_add_desktop(o->current);
else
screen_remove_desktop(o->current);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
return FALSE;
}
#include "all.h"
-void action_all_startup(void)
+void actions_all_startup(void)
{
action_execute_startup();
action_debug_startup();
action_movetoedge_startup();
action_growtoedge_startup();
action_focustobottom_startup();
- /* 3.4-compatibility */
- action_shadelowerraise_startup();
}
#ifndef __actions_all_h
#define __actions_all_h
-void action_all_startup(void);
+void actions_all_startup(void);
void action_execute_startup(void);
void action_debug_startup(void);
void action_movetoedge_startup(void);
void action_growtoedge_startup(void);
void action_focustobottom_startup(void);
-/* 3.4-compatibility */
-void action_shadelowerraise_startup(void);
#endif
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/keyboard.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_breakchroot_startup(void)
{
- actions_register("BreakChroot",
- NULL, NULL,
- run_func);
+ action_register("BreakChroot",
+ NULL, NULL,
+ run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
/* break out of one chroot */
keyboard_reset_chains(1);
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_close_startup(void)
{
- actions_register("Close",
- NULL, NULL,
- run_func);
+ action_register("Close", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) client_close(data->client);
-#include "openbox/actions.h"
-#include "openbox/actions_list.h"
-#include "openbox/actions_parser.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_list.h"
+#include "openbox/action_parser.h"
+#include "openbox/action_value.h"
#include "openbox/stacking.h"
#include "openbox/window.h"
#include "openbox/event.h"
gboolean bar;
gboolean raise;
ObFocusCyclePopupMode dialog_mode;
- ObActionsList *actions;
+ ObActionList *actions;
/* options for after we're done */
} Options;
static gpointer setup_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *in,
+ ObActionICancelFunc *c,
+ ObActionIPostFunc *post);
static gpointer setup_forward_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *in,
+ ObActionICancelFunc *c,
+ ObActionIPostFunc *post);
static gpointer setup_backward_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *in,
+ ObActionICancelFunc *c,
+ ObActionIPostFunc *post);
static void free_func(gpointer options);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
static gboolean i_input_func(guint initial_state,
XEvent *e,
ObtIC *ic,
void action_cyclewindows_startup(void)
{
- actions_register_i("NextWindow", setup_forward_func, free_func, run_func);
- actions_register_i("PreviousWindow", setup_backward_func, free_func,
- run_func);
+ action_register_i("NextWindow", setup_forward_func, free_func, run_func);
+ action_register_i("PreviousWindow", setup_backward_func, free_func,
+ run_func);
}
static gpointer setup_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
v = g_hash_table_lookup(config, "linear");
- if (v && actions_value_is_string(v))
- o->linear = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->linear = action_value_bool(v);
v = g_hash_table_lookup(config, "dialog");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (g_strcasecmp(s, "none") == 0)
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_NONE;
else if (g_strcasecmp(s, "no") == 0)
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_ICONS;
}
v = g_hash_table_lookup(config, "bar");
- if (v && actions_value_is_string(v))
- o->bar = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->bar = action_value_bool(v);
v = g_hash_table_lookup(config, "raise");
- if (v && actions_value_is_string(v))
- o->raise = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->raise = action_value_bool(v);
v = g_hash_table_lookup(config, "panels");
- if (v && actions_value_is_string(v))
- o->dock_windows = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->dock_windows = action_value_bool(v);
v = g_hash_table_lookup(config, "hilite");
- if (v && actions_value_is_string(v))
- o->only_hilite_windows = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->only_hilite_windows = action_value_bool(v);
v = g_hash_table_lookup(config, "desktop");
- if (v && actions_value_is_string(v))
- o->desktop_windows = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->desktop_windows = action_value_bool(v);
v = g_hash_table_lookup(config, "allDesktops");
- if (v && actions_value_is_string(v))
- o->all_desktops = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->all_desktops = action_value_bool(v);
v = g_hash_table_lookup(config, "finalactions");
- if (v && actions_value_is_actions_list(v)) {
- o->actions = actions_value_actions_list(v);
- actions_list_ref(o->actions);
+ if (v && action_value_is_action_list(v)) {
+ o->actions = action_value_action_list(v);
+ action_list_ref(o->actions);
}
else {
- ObActionsParser *p = actions_parser_new();
- o->actions = actions_parser_read_string(p,
+ ObActionParser *p = action_parser_new();
+ o->actions = action_parser_read_string(p,
"focus\n"
"raise\n"
"unshade\n");
- actions_parser_unref(p);
+ action_parser_unref(p);
}
*input = i_input_func;
}
static gpointer setup_forward_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
Options *o = setup_func(config, pre, input, cancel, post);
o->forward = TRUE;
}
static gpointer setup_backward_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
Options *o = setup_func(config, pre, input, cancel, post);
o->forward = FALSE;
{
Options *o = options;
- actions_list_unref(o->actions);
+ action_list_unref(o->actions);
g_slice_free(Options, o);
}
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
struct _ObClient *ft;
TRUE, o->cancel);
if (ft)
- actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
- o->state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
+ action_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
+ o->state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
stacking_restore();
}
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include <glib.h>
typedef struct {
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer options);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_debug_startup(void)
{
- actions_register("Debug", setup_func, free_func, run_func);
+ action_register("Debug", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "string");
- if (v && actions_value_is_string(v))
- o->str = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->str = g_strdup(action_value_string(v));
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func_on(ObActionsData *data, gpointer options);
-static gboolean run_func_off(ObActionsData *data, gpointer options);
-static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+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);
void action_decorations_startup(void)
{
- actions_register("Decorate", NULL, NULL, run_func_on);
- actions_register("Undecorate", NULL, NULL, run_func_off);
- actions_register("ToggleDecorations", NULL, NULL, run_func_toggle);
+ action_register("Decorate", NULL, NULL, run_func_on);
+ action_register("Undecorate", NULL, NULL, run_func_off);
+ action_register("ToggleDecorations", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionsData *data, gpointer options)
+static gboolean run_func_on(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_set_undecorated(data->client, FALSE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionsData *data, gpointer options)
+static gboolean run_func_off(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_set_undecorated(data->client, TRUE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionsData *data, gpointer options)
+static gboolean run_func_toggle(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_set_undecorated(data->client, !data->client->undecorated);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/screen.h"
#include "openbox/client.h"
#include "openbox/openbox.h"
} Options;
static gpointer setup_go_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post);
static gpointer setup_send_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
static gboolean i_pre_func(guint state, gpointer options);
static gboolean i_input_func(guint initial_state,
void action_desktop_startup(void)
{
- actions_register_i("GoToDesktop", setup_go_func, free_func, run_func);
- actions_register_i("SendToDesktop", setup_send_func, free_func, run_func);
+ action_register_i("GoToDesktop", setup_go_func, free_func, run_func);
+ action_register_i("SendToDesktop", setup_send_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->u.rel.wrap = TRUE;
v = g_hash_table_lookup(config, "to");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "last"))
o->type = LAST;
else if (!g_ascii_strcasecmp(s, "current"))
}
v = g_hash_table_lookup(config, "wrap");
- if (v && actions_value_is_string(v))
- o->u.rel.wrap = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->u.rel.wrap = action_value_bool(v);
return o;
}
static gpointer setup_go_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
Options *o;
}
static gpointer setup_send_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = setup_func(config, pre, input, cancel, post);
o->follow = TRUE;
v = g_hash_table_lookup(config, "follow");
- if (v && actions_value_is_string(v))
- o->follow = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->follow = action_value_bool(v);
if (o->type == RELATIVE && o->follow) {
o->interactive = TRUE;
g_slice_free(Options, o);
}
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
guint d;
(data->client && data->client->desktop != screen_desktop))) {
gboolean go = TRUE;
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
if (o->send && data->client && client_normal(data->client)) {
client_set_desktop(data->client, d, o->follow, FALSE);
go = o->follow;
client_bring_helper_windows(data->client);
}
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return o->interactive;
-#include "openbox/actions.h"
-#include "openbox/actions_list.h"
-#include "openbox/actions_parser.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_list.h"
+#include "openbox/action_parser.h"
+#include "openbox/action_value.h"
#include "openbox/event.h"
#include "openbox/stacking.h"
#include "openbox/window.h"
ObDirection direction;
gboolean bar;
gboolean raise;
- ObActionsList *actions;
+ ObActionList *actions;
} Options;
static gboolean cycling = FALSE;
static gpointer setup_func(GHashTable *config);
static gpointer setup_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post);
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post);
static gpointer setup_target_func(GHashTable *config);
static void free_func(gpointer options);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
static gboolean i_input_func(guint initial_state,
XEvent *e,
ObtIC *ic,
static void end_cycle(gboolean cancel, guint state, Options *o);
-/* 3.4-compatibility */
-static gpointer setup_north_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_south_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_east_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_west_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_northwest_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_northeast_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_southwest_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_southeast_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *in,
- ObActionsICancelFunc *c,
- ObActionsIPostFunc *post);
-static gpointer setup_north_target_func(GHashTable *config);
-static gpointer setup_south_target_func(GHashTable *config);
-static gpointer setup_east_target_func(GHashTable *config);
-static gpointer setup_west_target_func(GHashTable *config);
-static gpointer setup_northwest_target_func(GHashTable *config);
-static gpointer setup_northeast_target_func(GHashTable *config);
-static gpointer setup_southwest_target_func(GHashTable *config);
-static gpointer setup_southeast_target_func(GHashTable *config);
-
void action_directionalwindows_startup(void)
{
- actions_register_i("DirectionalCycleWindows", setup_cycle_func, free_func,
- run_func);
- actions_register("DirectionalTargetWindow", setup_target_func, free_func,
- run_func);
- /* 3.4-compatibility */
- actions_register_i("DirectionalFocusNorth", setup_north_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusSouth", setup_south_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusWest", setup_west_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusEast", setup_east_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusNorthWest", setup_northwest_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusNorthEast", setup_northeast_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusSouthWest", setup_southwest_cycle_func,
- free_func, run_func);
- actions_register_i("DirectionalFocusSouthEast", setup_southeast_cycle_func,
- free_func, run_func);
- actions_register("DirectionalTargetNorth", setup_north_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetSouth", setup_south_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetWest", setup_west_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetEast", setup_east_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetNorthWest", setup_northwest_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetNorthEast", setup_northeast_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetSouthWest", setup_southwest_target_func,
- free_func, run_func);
- actions_register("DirectionalTargetSouthEast", setup_southeast_target_func,
- free_func, run_func);
+ action_register_i("DirectionalCycleWindows", setup_cycle_func, free_func,
+ run_func);
+ action_register("DirectionalTargetWindow", setup_target_func, free_func,
+ run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->bar = TRUE;
v = g_hash_table_lookup(config, "dialog");
- if (v && actions_value_is_string(v))
- o->dialog = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->dialog = action_value_bool(v);
v = g_hash_table_lookup(config, "bar");
- if (v && actions_value_is_string(v))
- o->bar = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->bar = action_value_bool(v);
v = g_hash_table_lookup(config, "raise");
- if (v && actions_value_is_string(v))
- o->raise = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->raise = action_value_bool(v);
v = g_hash_table_lookup(config, "panels");
- if (v && actions_value_is_string(v))
- o->dock_windows = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->dock_windows = action_value_bool(v);
v = g_hash_table_lookup(config, "desktop");
- if (v && actions_value_is_string(v))
- o->desktop_windows = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->desktop_windows = action_value_bool(v);
v = g_hash_table_lookup(config, "direction");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "north") ||
!g_ascii_strcasecmp(s, "up"))
o->direction = OB_DIRECTION_NORTH;
}
v = g_hash_table_lookup(config, "finalactions");
- if (v && actions_value_is_actions_list(v)) {
- o->actions = actions_value_actions_list(v);
- actions_list_ref(o->actions);
+ if (v && action_value_is_action_list(v)) {
+ o->actions = action_value_action_list(v);
+ action_list_ref(o->actions);
}
else {
- ObActionsParser *p = actions_parser_new();
- o->actions = actions_parser_read_string(p,
+ ObActionParser *p = action_parser_new();
+ o->actions = action_parser_read_string(p,
"focus\n"
"raise\n"
"unshade\n");
- actions_parser_unref(p);
+ action_parser_unref(p);
}
return o;
}
static gpointer setup_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
+ ObActionIPreFunc *pre,
+ ObActionIInputFunc *input,
+ ObActionICancelFunc *cancel,
+ ObActionIPostFunc *post)
{
Options *o = setup_func(config);
o->interactive = TRUE;
{
Options *o = options;
- actions_list_unref(o->actions);
+ action_list_unref(o->actions);
g_slice_free(Options, o);
}
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
cycling = FALSE;
if (ft)
- actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
- state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
+ action_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
+ state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft);
stacking_restore();
}
-
-/* 3.4-compatibility */
-static gpointer setup_north_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_NORTH;
- return o;
-}
-
-static gpointer setup_south_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_SOUTH;
- return o;
-}
-
-static gpointer setup_east_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_EAST;
- return o;
-}
-
-static gpointer setup_west_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_WEST;
- return o;
-}
-
-static gpointer setup_northwest_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_NORTHWEST;
- return o;
-}
-
-static gpointer setup_northeast_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_EAST;
- return o;
-}
-
-static gpointer setup_southwest_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_SOUTHWEST;
- return o;
-}
-
-static gpointer setup_southeast_cycle_func(GHashTable *config,
- ObActionsIPreFunc *pre,
- ObActionsIInputFunc *input,
- ObActionsICancelFunc *cancel,
- ObActionsIPostFunc *post)
-{
- Options *o = setup_cycle_func(config, pre, input, cancel, post);
- o->direction = OB_DIRECTION_SOUTHEAST;
- return o;
-}
-
-static gpointer setup_north_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_NORTH;
- return o;
-}
-
-static gpointer setup_south_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_SOUTH;
- return o;
-}
-
-static gpointer setup_east_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_EAST;
- return o;
-}
-
-static gpointer setup_west_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_WEST;
- return o;
-}
-
-static gpointer setup_northwest_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_NORTHWEST;
- return o;
-}
-
-static gpointer setup_northeast_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_NORTHEAST;
- return o;
-}
-
-static gpointer setup_southwest_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_SOUTHWEST;
- return o;
-}
-
-static gpointer setup_southeast_target_func(GHashTable *config)
-{
- Options *o = setup_target_func(config);
- o->direction = OB_DIRECTION_SOUTHEAST;
- return o;
-}
-
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/stacking.h"
#include "openbox/window.h"
#include "openbox/dock.h"
-static gboolean raise_func(ObActionsData *data, gpointer options);
-static gboolean lower_func(ObActionsData *data, gpointer options);
+static gboolean raise_func(ObActionData *data, gpointer options);
+static gboolean lower_func(ObActionData *data, gpointer options);
void action_dock_startup(void)
{
- actions_register("RaiseDock",
- NULL, NULL,
- raise_func);
- actions_register("LowerDock",
- NULL, NULL,
- lower_func);
+ action_register("RaiseDock", NULL, NULL, raise_func);
+ action_register("LowerDock", NULL, NULL, lower_func);
}
/* Always return FALSE because its not interactive */
-static gboolean raise_func(ObActionsData *data, gpointer options)
+static gboolean raise_func(ObActionData *data, gpointer options)
{
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
dock_raise_dock();
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean lower_func(ObActionsData *data, gpointer options)
+static gboolean lower_func(ObActionData *data, gpointer options)
{
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
dock_lower_dock();
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
return FALSE;
}
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/dock.h"
#include "openbox/config.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_dockautohide_startup(void)
{
- actions_register("ToggleDockAutoHide",
- NULL, NULL,
- run_func);
+ action_register("ToggleDockAutoHide", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
config_dock_hide = !config_dock_hide;
dock_configure();
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/event.h"
#include "openbox/startupnotify.h"
#include "openbox/client.h"
gchar *sn_icon;
gchar *sn_wmclass;
gchar *prompt;
- ObActionsData *data;
+ ObActionData *data;
} Options;
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer options);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
static void shutdown_func(void);
static void client_dest(ObClient *client, gpointer data);
void action_execute_startup(void)
{
- actions_register("Execute", setup_func, free_func, run_func);
- actions_set_shutdown("Execute", shutdown_func);
+ action_register("Execute", setup_func, free_func, run_func);
+ action_set_shutdown("Execute", shutdown_func);
client_add_destroy_notify(client_dest, NULL);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "command");
- if (v && actions_value_is_string(v))
- o->cmd = obt_paths_expand_tilde(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->cmd = obt_paths_expand_tilde(action_value_string(v));
v = g_hash_table_lookup(config, "prompt");
- if (v && actions_value_is_string(v))
- o->prompt = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->prompt = g_strdup(action_value_string(v));
v = g_hash_table_lookup(config, "startupnotify");
- if (v && actions_value_is_string(v) && actions_value_bool(v)) {
+ if (v && action_value_is_string(v) && action_value_bool(v)) {
o->sn = TRUE;
v = g_hash_table_lookup(config, "name");
- if (v && actions_value_is_string(v))
- o->sn_name = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->sn_name = g_strdup(action_value_string(v));
v = g_hash_table_lookup(config, "icon");
- if (v && actions_value_is_string(v))
- o->sn_icon = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->sn_icon = g_strdup(action_value_string(v));
v = g_hash_table_lookup(config, "wmclass");
- if (v && actions_value_is_string(v))
- o->sn_wmclass = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->sn_wmclass = g_strdup(action_value_string(v));
}
return o;
}
g_free(o->sn_icon);
g_free(o->sn_wmclass);
g_free(o->prompt);
- if (o->data) g_slice_free(ObActionsData, o->data);
+ if (o->data) g_slice_free(ObActionData, o->data);
g_slice_free(Options, o);
}
}
-static Options* dup_options(Options *in, ObActionsData *data)
+static Options* dup_options(Options *in, ObActionData *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(ObActionsData);
- memcpy(o->data, data, sizeof(ObActionsData));
+ o->data = g_slice_new(ObActionData);
+ memcpy(o->data, data, sizeof(ObActionData));
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
GError *e;
gchar **argv = NULL;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/openbox.h"
#include "openbox/prompt.h"
#include "openbox/session.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_exit_startup(void)
{
- actions_register("Exit", setup_func, free_func, run_func);
- actions_register("SessionLogout", setup_func, free_func, run_func);
+ action_register("Exit", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->prompt = TRUE;
v = g_hash_table_lookup(config, "prompt");
- if (v && actions_value_is_string(v))
- o->prompt = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->prompt = action_value_bool(v);
return o;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/event.h"
#include "openbox/client.h"
#include "openbox/focus.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_focus_startup(void)
{
- actions_register("Focus", setup_func, free_func, run_func);
+ action_register("Focus", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->stop_int = TRUE;
v = g_hash_table_lookup(config, "here");
- if (v && actions_value_is_string(v))
- o->here = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->here = action_value_bool(v);
v = g_hash_table_lookup(config, "stopInteractive");
- if (v && actions_value_is_string(v))
- o->stop_int = actions_value_bool(v);
+ if (v && action_value_is_string(v))
+ o->stop_int = action_value_bool(v);
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
data->context != OB_FRAME_CONTEXT_FRAME))
{
if (o->stop_int)
- actions_interactive_cancel_act();
+ action_interactive_cancel_act();
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_activate(data->client, TRUE, o->here, FALSE, FALSE, TRUE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
} else if (data->context == OB_FRAME_CONTEXT_DESKTOP) {
if (o->stop_int)
- actions_interactive_cancel_act();
+ action_interactive_cancel_act();
/* focus action on the root window. make keybindings work for this
openbox instance, but don't focus any specific client */
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/focus.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_focustobottom_startup(void)
{
- actions_register("FocusToBottom", NULL, NULL, run_func);
+ action_register("FocusToBottom", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client)
focus_order_to_bottom(data->client);
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+static gboolean run_func_toggle(ObActionData *data, gpointer options);
void action_fullscreen_startup(void)
{
- actions_register("ToggleFullscreen", NULL, NULL, run_func_toggle);
+ action_register("ToggleFullscreen", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionsData *data, gpointer options)
+static gboolean run_func_toggle(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_fullscreen(data->client, !data->client->fullscreen);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/misc.h"
#include "openbox/client.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static gpointer setup_shrink_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
-/* 3.4-compatibility */
-static gpointer setup_north_func(GHashTable *config);
-static gpointer setup_south_func(GHashTable *config);
-static gpointer setup_east_func(GHashTable *config);
-static gpointer setup_west_func(GHashTable *config);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_growtoedge_startup(void)
{
- actions_register("GrowToEdge", setup_func,
- free_func, run_func);
- actions_register("ShrinkToEdge", setup_shrink_func,
- free_func, run_func);
- /* 3.4-compatibility */
- actions_register("GrowToEdgeNorth", setup_north_func, free_func, run_func);
- actions_register("GrowToEdgeSouth", setup_south_func, free_func, run_func);
- actions_register("GrowToEdgeEast", setup_east_func, free_func, run_func);
- actions_register("GrowToEdgeWest", setup_west_func, free_func, run_func);
+ action_register("GrowToEdge", setup_func, free_func, run_func);
+ action_register("ShrinkToEdge", setup_shrink_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->shrink = FALSE;
v = g_hash_table_lookup(config, "direction");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "north") ||
!g_ascii_strcasecmp(s, "up"))
o->dir = OB_DIRECTION_NORTH;
return o;
}
-static gboolean do_grow(ObActionsData *data, gint x, gint y, gint w, gint h)
+static gboolean do_grow(ObActionData *data, gint x, gint y, gint w, gint h)
{
gint realw, realh, lw, lh;
realw != data->client->area.width ||
realh != data->client->area.height)
{
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_move_resize(data->client, x, y, realw, realh);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
return TRUE;
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
gint x, y, w, h;
return FALSE;
}
-
-/* 3.4-compatibility */
-static gpointer setup_north_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->shrink = FALSE;
- o->dir = OB_DIRECTION_NORTH;
- return o;
-}
-
-static gpointer setup_south_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->shrink = FALSE;
- o->dir = OB_DIRECTION_SOUTH;
- return o;
-}
-
-static gpointer setup_east_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->shrink = FALSE;
- o->dir = OB_DIRECTION_EAST;
- return o;
-}
-
-static gpointer setup_west_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->shrink = FALSE;
- o->dir = OB_DIRECTION_WEST;
- return o;
-}
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_iconify_startup(void)
{
- actions_register("Iconify",
- NULL, NULL,
- run_func);
+ action_register("Iconify", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_iconify(data->client, TRUE, TRUE, FALSE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_kill_startup(void)
{
- actions_register("Kill",
- NULL, NULL,
- run_func);
+ action_register("Kill", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client)
client_kill(data->client);
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/client.h"
typedef struct {
static gpointer setup_func_bottom(GHashTable *config);
static gpointer setup_func_send(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
-/* 3.4-compatibility */
-static gpointer setup_sendtop_func(GHashTable *config);
-static gpointer setup_sendbottom_func(GHashTable *config);
-static gpointer setup_sendnormal_func(GHashTable *config);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_layer_startup(void)
{
- actions_register("ToggleAlwaysOnTop", setup_func_top, free_func,
- run_func);
- actions_register("ToggleAlwaysOnBottom", setup_func_bottom, free_func,
- run_func);
- actions_register("SendToLayer", setup_func_send, free_func,
- run_func);
- /* 3.4-compatibility */
- actions_register("SendToTopLayer", setup_sendtop_func, free_func,
- run_func);
- actions_register("SendToBottomLayer", setup_sendbottom_func, free_func,
- run_func);
- actions_register("SendToNormalLayer", setup_sendnormal_func, free_func,
- run_func);
+ action_register("ToggleAlwaysOnTop", setup_func_top, free_func,
+ run_func);
+ action_register("ToggleAlwaysOnBottom", setup_func_bottom, free_func,
+ run_func);
+ action_register("SendToLayer", setup_func_send, free_func,
+ run_func);
}
static gpointer setup_func_top(GHashTable *config)
static gpointer setup_func_send(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "layer");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "above") ||
!g_ascii_strcasecmp(s, "top"))
o->layer = 1;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
if (data->client) {
ObClient *c = data->client;
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
if (o->layer < 0) {
if (o->toggle || !c->below)
else if (c->above || c->below)
client_set_layer(c, 0);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
-
-/* 3.4-compatibility */
-static gpointer setup_sendtop_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->layer = 1;
- o->toggle = FALSE;
- return o;
-}
-
-static gpointer setup_sendbottom_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->layer = -1;
- o->toggle = FALSE;
- return o;
-}
-
-static gpointer setup_sendnormal_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->layer = 0;
- o->toggle = FALSE;
- return o;
-}
-
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/stacking.h"
#include "openbox/window.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_lower_startup(void)
{
- actions_register("Lower",
- NULL, NULL,
- run_func);
+ action_register("Lower", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
stacking_lower(CLIENT_AS_WINDOW(data->client));
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/client.h"
/* These match the values for client_maximize */
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func_on(ObActionsData *data, gpointer options);
-static gboolean run_func_off(ObActionsData *data, gpointer options);
-static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+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);
void action_maximize_startup(void)
{
- actions_register("Maximize", setup_func, free_func, run_func_on);
- actions_register("Unmaximize", setup_func, free_func, run_func_off);
- actions_register("ToggleMaximize", setup_func, free_func, run_func_toggle);
+ action_register("Maximize", setup_func, free_func, run_func_on);
+ action_register("Unmaximize", setup_func, free_func, run_func_off);
+ action_register("ToggleMaximize", setup_func, free_func, run_func_toggle);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->dir = BOTH;
v = g_hash_table_lookup(config, "dir");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "vertical") ||
!g_ascii_strcasecmp(s, "vert"))
o->dir = VERT;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionsData *data, gpointer options)
+static gboolean run_func_on(ObActionData *data, gpointer options)
{
Options *o = options;
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_maximize(data->client, TRUE, o->dir);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionsData *data, gpointer options)
+static gboolean run_func_off(ObActionData *data, gpointer options)
{
Options *o = options;
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_maximize(data->client, FALSE, o->dir);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionsData *data, gpointer options)
+static gboolean run_func_toggle(ObActionData *data, gpointer options)
{
Options *o = options;
if (data->client) {
gboolean toggle;
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
toggle = ((o->dir == HORZ && !data->client->max_horz) ||
(o->dir == VERT && !data->client->max_vert) ||
(o->dir == BOTH &&
!(data->client->max_horz && data->client->max_vert)));
client_maximize(data->client, toggle, o->dir);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/moveresize.h"
#include "obt/prop.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_move_startup(void)
{
- actions_register("Move",
- NULL, NULL,
- run_func);
+ action_register("Move", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) {
guint32 corner;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_moverelative_startup(void)
{
- actions_register("MoveRelative", setup_func, free_func, run_func);
+ action_register("MoveRelative", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "x");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->x, &o->x_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->x, &o->x_denom);
v = g_hash_table_lookup(config, "y");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->y, &o->y_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->y, &o->y_denom);
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
client_find_onscreen(c, &x, &y, w, h, FALSE);
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
-/* 3.4-compatibility */
-static gpointer setup_center_func(GHashTable *config);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_moveresizeto_startup(void)
{
- actions_register("MoveResizeTo", setup_func, free_func, run_func);
- /* 3.4-compatibility */
- actions_register("MoveToCenter", setup_center_func, free_func, run_func);
+ action_register("MoveResizeTo", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->monitor = CURRENT_MONITOR;
v = g_hash_table_lookup(config, "x");
- if (v && actions_value_is_string(v))
- actions_value_gravity_coord(v, &o->x);
+ if (v && action_value_is_string(v))
+ action_value_gravity_coord(v, &o->x);
v = g_hash_table_lookup(config, "y");
- if (v && actions_value_is_string(v))
- actions_value_gravity_coord(v, &o->y);
+ if (v && action_value_is_string(v))
+ action_value_gravity_coord(v, &o->y);
v = g_hash_table_lookup(config, "width");
- if (v && actions_value_is_string(v))
- if (g_ascii_strcasecmp(actions_value_string(v), "current") != 0)
- actions_value_fraction(v, &o->w, &o->w_denom);
+ if (v && action_value_is_string(v))
+ if (g_ascii_strcasecmp(action_value_string(v), "current") != 0)
+ action_value_fraction(v, &o->w, &o->w_denom);
v = g_hash_table_lookup(config, "height");
- if (v && actions_value_is_string(v))
- if (g_ascii_strcasecmp(actions_value_string(v), "current") != 0)
- actions_value_fraction(v, &o->h, &o->h_denom);
+ if (v && action_value_is_string(v))
+ if (g_ascii_strcasecmp(action_value_string(v), "current") != 0)
+ action_value_fraction(v, &o->h, &o->h_denom);
v = g_hash_table_lookup(config, "monitor");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (g_ascii_strcasecmp(s, "current") != 0) {
if (!g_ascii_strcasecmp(s, "all"))
o->monitor = ALL_MONITORS;
else if(!g_ascii_strcasecmp(s, "prev"))
o->monitor = PREV_MONITOR;
else
- o->monitor = actions_value_int(v) - 1;
+ o->monitor = action_value_int(v) - 1;
}
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
/* force it on screen if its moving to another monitor */
client_find_onscreen(c, &x, &y, w, h, mon != cmon);
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
g_slice_free(Rect, area);
g_slice_free(Rect, carea);
return FALSE;
}
-
-/* 3.4-compatibility */
-static gpointer setup_center_func(GHashTable *config)
-{
- Options *o;
-
- o = g_slice_new0(Options);
- o->x.pos = G_MININT;
- o->y.pos = G_MININT;
- o->w = G_MININT;
- o->h = G_MININT;
- o->monitor = -1;
- o->x.center = TRUE;
- o->y.center = TRUE;
- return o;
-}
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/misc.h"
#include "openbox/client.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
-/* 3.4-compatibility */
-static gpointer setup_north_func(GHashTable *config);
-static gpointer setup_south_func(GHashTable *config);
-static gpointer setup_east_func(GHashTable *config);
-static gpointer setup_west_func(GHashTable *config);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_movetoedge_startup(void)
{
- actions_register("MoveToEdge", setup_func, free_func, run_func);
- /* 3.4-compatibility */
- actions_register("MoveToEdgeNorth", setup_north_func, free_func, run_func);
- actions_register("MoveToEdgeSouth", setup_south_func, free_func, run_func);
- actions_register("MoveToEdgeEast", setup_east_func, free_func, run_func);
- actions_register("MoveToEdgeWest", setup_west_func, free_func, run_func);
+ action_register("MoveToEdge", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
o->dir = OB_DIRECTION_NORTH;
v = g_hash_table_lookup(config, "direction");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
if (!g_ascii_strcasecmp(s, "north") ||
!g_ascii_strcasecmp(s, "up"))
o->dir = OB_DIRECTION_NORTH;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
client_find_move_directional(data->client, o->dir, &x, &y);
if (x != data->client->area.x || y != data->client->area.y) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_move(data->client, x, y);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
}
return FALSE;
}
-
-/* 3.4-compatibility */
-static gpointer setup_north_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->dir = OB_DIRECTION_NORTH;
- return o;
-}
-
-static gpointer setup_south_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->dir = OB_DIRECTION_SOUTH;
- return o;
-}
-
-static gpointer setup_east_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->dir = OB_DIRECTION_EAST;
- return o;
-}
-
-static gpointer setup_west_func(GHashTable *config)
-{
- Options *o = g_slice_new0(Options);
- o->dir = OB_DIRECTION_WEST;
- return o;
-}
-
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
#include "openbox/screen.h"
-static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+static gboolean run_func_toggle(ObActionData *data, gpointer options);
void action_omnipresent_startup(void)
{
- actions_register("ToggleOmnipresent", NULL, NULL, run_func_toggle);
+ action_register("ToggleOmnipresent", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionsData *data, gpointer options)
+static gboolean run_func_toggle(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_set_desktop(data->client,
data->client->desktop == DESKTOP_ALL ?
screen_desktop : DESKTOP_ALL, FALSE, TRUE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/stacking.h"
#include "openbox/window.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_raise_startup(void)
{
- actions_register("Raise", NULL, NULL, run_func);
+ action_register("Raise", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
stacking_raise(CLIENT_AS_WINDOW(data->client));
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/stacking.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_raiselower_startup(void)
{
- actions_register("RaiseLower", NULL, NULL, run_func);
+ action_register("RaiseLower", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
stacking_restack_request(data->client, NULL, Opposite);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/openbox.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_reconfigure_startup(void)
{
- actions_register("Reconfigure", NULL, NULL, run_func);
+ action_register("Reconfigure", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
ob_reconfigure();
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/moveresize.h"
#include "openbox/client.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer o);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
gboolean shaded);
void action_resize_startup(void)
{
- actions_register("Resize", setup_func, free_func, run_func);
+ action_register("Resize", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "edge");
- if (v && actions_value_is_string(v)) {
- const gchar *s = actions_value_string(v);
+ if (v && action_value_is_string(v)) {
+ const gchar *s = action_value_string(v);
o->corner_specified = TRUE;
if (!g_ascii_strcasecmp(s, "top"))
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
#include "openbox/client.h"
#include "openbox/screen.h"
#include "openbox/frame.h"
static gpointer setup_func(GHashTable *config);
static void free_func(gpointer options);
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_resizerelative_startup(void)
{
- actions_register("ResizeRelative", setup_func, free_func, run_func);
+ action_register("ResizeRelative", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "left");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->left, &o->left_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->left, &o->left_denom);
v = g_hash_table_lookup(config, "right");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->right, &o->right_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->right, &o->right_denom);
v = g_hash_table_lookup(config, "top");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->top, &o->top_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->top, &o->top_denom);
v = g_hash_table_lookup(config, "bottom");
- if (v && actions_value_is_string(v))
- actions_value_fraction(v, &o->bottom, &o->bottom_denom);
+ if (v && action_value_is_string(v))
+ action_value_fraction(v, &o->bottom, &o->bottom_denom);
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
yoff = yoff == 0 ? 0 :
(yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh));
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_move_resize(c, x + xoff, y + yoff, nw, nh);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.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(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_restart_startup(void)
{
- actions_register("Restart", setup_func, free_func, run_func);
+ action_register("Restart", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "command");
- if (v && actions_value_is_string(v))
- o->cmd = obt_paths_expand_tilde(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->cmd = obt_paths_expand_tilde(action_value_string(v));
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/client.h"
-static gboolean run_func_on(ObActionsData *data, gpointer options);
-static gboolean run_func_off(ObActionsData *data, gpointer options);
-static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+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);
void action_shade_startup(void)
{
- actions_register("Shade", NULL, NULL, run_func_on);
- actions_register("Unshade", NULL, NULL, run_func_off);
- actions_register("ToggleShade", NULL, NULL, run_func_toggle);
+ action_register("Shade", NULL, NULL, run_func_on);
+ action_register("Unshade", NULL, NULL, run_func_off);
+ action_register("ToggleShade", NULL, NULL, run_func_toggle);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_on(ObActionsData *data, gpointer options)
+static gboolean run_func_on(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_shade(data->client, TRUE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_off(ObActionsData *data, gpointer options)
+static gboolean run_func_off(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_shade(data->client, FALSE);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
/* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(ObActionsData *data, gpointer options)
+static gboolean run_func_toggle(ObActionData *data, gpointer options)
{
if (data->client) {
- actions_client_move(data, TRUE);
+ action_client_move(data, TRUE);
client_shade(data->client, !data->client->shaded);
- actions_client_move(data, FALSE);
+ action_client_move(data, FALSE);
}
return FALSE;
}
+++ /dev/null
-#include "openbox/actions.h"
-#include "openbox/client.h"
-
-static gboolean run_func_sl(ObActionsData *data, gpointer options);
-static gboolean run_func_ur(ObActionsData *data, gpointer options);
-
-void action_shadelowerraise_startup()
-{
- /* 3.4-compatibility */
- actions_register("ShadeLower", NULL, NULL, run_func_sl);
- actions_register("UnshadeRaise", NULL, NULL, run_func_ur);
-}
-
-/* Always return FALSE because its not interactive */
-static gboolean run_func_sl(ObActionsData *data, gpointer options)
-{
- if (data->client) {
- actions_client_move(data, TRUE);
- if (data->client->shaded)
- stacking_lower(CLIENT_AS_WINDOW(data->client));
- else
- client_shade(data->client, TRUE);
- actions_client_move(data, FALSE);
- }
- return FALSE;
-}
-
-/* Always return FALSE because its not interactive */
-static gboolean run_func_ur(ObActionsData *data, gpointer options)
-{
- if (data->client) {
- actions_client_move(data, TRUE);
- if (data->client->shaded)
- client_shade(data->client, FALSE);
- else
- stacking_raise(CLIENT_AS_WINDOW(data->client));
- actions_client_move(data, FALSE);
- }
- return FALSE;
-}
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/screen.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_showdesktop_startup(void)
{
- actions_register("ToggleShowDesktop", NULL, NULL, run_func);
+ action_register("ToggleShowDesktop", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
screen_show_desktop(!screen_showing_desktop, NULL);
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.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(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_showmenu_startup(void)
{
- actions_register("ShowMenu", setup_func, free_func, run_func);
+ action_register("ShowMenu", setup_func, free_func, run_func);
}
static gpointer setup_func(GHashTable *config)
{
- ObActionsValue *v;
+ ObActionValue *v;
Options *o;
o = g_slice_new0(Options);
v = g_hash_table_lookup(config, "menu");
- if (v && actions_value_is_string(v))
- o->name = g_strdup(actions_value_string(v));
+ if (v && action_value_is_string(v))
+ o->name = g_strdup(action_value_string(v));
return o;
}
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
Options *o = options;
-#include "openbox/actions.h"
+#include "openbox/action.h"
#include "openbox/focus.h"
-static gboolean run_func(ObActionsData *data, gpointer options);
+static gboolean run_func(ObActionData *data, gpointer options);
void action_unfocus_startup(void)
{
- actions_register("Unfocus", NULL, NULL, run_func);
+ action_register("Unfocus", NULL, NULL, run_func);
}
/* Always return FALSE because its not interactive */
-static gboolean run_func(ObActionsData *data, gpointer options)
+static gboolean run_func(ObActionData *data, gpointer options)
{
if (data->client && data->client == focus_client)
focus_fallback(FALSE, FALSE, TRUE, FALSE);
+++ /dev/null
-/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-
- actions_list.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 <glib.h>
-
-struct _ObActionsAct;
-struct _ObActionsValue;
-
-typedef struct _ObActionsList ObActionsList;
-typedef struct _ObActionsListTest ObActionsListTest;
-
-/*! Each node of the Actions list is an action itself (or a filter bound to
- an action). */
-struct _ObActionsList {
- gint ref;
- gboolean isfilter;
- union {
- struct _ObActionsListFilter {
- ObActionsListTest *test; /* can be null */
- ObActionsList *thendo; /* can be null */
- ObActionsList *elsedo; /* can be null */
- } f;
- struct _ObActionsAct *action;
- } u;
- ObActionsList *next;
-};
-
-struct _ObActionsListTest {
- gchar *key;
- struct _ObActionsValue *value; /* can be null */
- gboolean and;
- ObActionsListTest *next;
-};
-
-void actions_list_ref(ObActionsList *l);
-void actions_list_unref(ObActionsList *l);
-
-void actions_list_test_destroy(ObActionsListTest *t);
-
-ObActionsList* actions_list_concat(ObActionsList *a, ObActionsList *b);
#include "config.h"
#include "keyboard.h"
#include "mouse.h"
-#include "actions.h"
-#include "actions_list.h"
-#include "actions_parser.h"
+#include "action.h"
+#include "action_list.h"
+#include "action_parser.h"
#include "translate.h"
#include "client.h"
#include "screen.h"
}
else if ((n = obt_xml_find_node(node->children, "action"))) {
while (n) {
- ObActionsParser *p;
- ObActionsList *actions;
+ ObActionParser *p;
+ ObActionList *actions;
xmlChar *c;
c = xmlNodeGetContent(node);
- p = actions_parser_new();
- actions = actions_parser_read_string(p, (gchar*)c);
+ p = action_parser_new();
+ actions = action_parser_read_string(p, (gchar*)c);
xmlFree(c);
- actions_parser_unref(p);
+ action_parser_unref(p);
if (actions)
keyboard_bind(keylist, actions);
- actions_list_unref(actions);
+ action_list_unref(actions);
n = obt_xml_find_node(n->next, "action");
}
}
nact = obt_xml_find_node(nbut->children, "action");
while (nact) {
- ObActionsList *actions;
- ObActionsParser *p;
+ ObActionList *actions;
+ ObActionParser *p;
xmlChar *c;
c = xmlNodeGetContent(nact);
- p = actions_parser_new();
- if ((actions = actions_parser_read_string(p, (gchar*)c)))
+ p = action_parser_new();
+ if ((actions = action_parser_read_string(p, (gchar*)c)))
mouse_bind(buttonstr, cx, mact, actions);
nact = obt_xml_find_node(nact->next, "action");
- actions_list_unref(actions);
+ action_list_unref(actions);
xmlFree(c);
- actions_parser_unref(p);
+ action_parser_unref(p);
}
g_free(buttonstr);
next_nbut:
{ "A-F4", "Close" },
{ NULL, NULL }
};
- ObActionsParser *p;
+ ObActionParser *p;
- p = actions_parser_new();
+ p = action_parser_new();
for (it = binds; it->key; ++it) {
GList *l = g_list_append(NULL, g_strdup(it->key));
- ObActionsList *actions = actions_parser_read_string(p, it->actiontext);
+ ObActionList *actions = action_parser_read_string(p, it->actiontext);
keyboard_bind(l, actions);
- actions_list_unref(actions);
+ action_list_unref(actions);
}
- actions_parser_unref(p);
+ action_parser_unref(p);
}
typedef struct
{ "A-Middle", "Frame", OB_MOUSE_ACTION_MOTION, "Resize" },
{ NULL, NULL, 0, NULL }
};
- ObActionsParser *p;
- ObActionsList *actions;
+ ObActionParser *p;
+ ObActionList *actions;
- p = actions_parser_new();
+ p = action_parser_new();
for (it = binds; it->button; ++it) {
- actions = actions_parser_read_string(p, it->actname);
+ actions = action_parser_read_string(p, it->actname);
mouse_bind(it->button, frame_context_from_string(it->context),
it->mact, actions);
- actions_list_unref(actions);
+ action_list_unref(actions);
}
- actions_parser_unref(p);
+ action_parser_unref(p);
}
void config_startup(ObtXmlInst *i)
#include "window.h"
#include "openbox.h"
#include "dock.h"
-#include "actions.h"
+#include "action.h"
#include "client.h"
#include "config.h"
#include "screen.h"
/* if the keyboard interactive action uses the event then dont
use it for bindings. likewise is moveresize uses the event. */
- if (actions_interactive_input_event(e) || moveresize_event(e))
+ if (action_interactive_input_event(e) || moveresize_event(e))
return TRUE;
if (moveresize_in_progress)
void event_cancel_all_key_grabs(void)
{
- if (actions_interactive_act_running()) {
- actions_interactive_cancel_act();
+ if (action_interactive_act_running()) {
+ action_interactive_cancel_act();
ob_debug("KILLED interactive action");
}
else if (menu_frame_visible) {
#include "event.h"
#include "grab.h"
#include "client.h"
-#include "actions.h"
-#include "actions_list.h"
+#include "action.h"
+#include "action_list.h"
#include "menuframe.h"
#include "config.h"
#include "keytree.h"
}
}
-gboolean keyboard_bind(GList *keylist, ObActionsList *actions)
+gboolean keyboard_bind(GList *keylist, ObActionList *actions)
{
KeyBindingTree *tree, *t;
gboolean conflict;
for (; t->first_child; t = t->first_child);
/* set the action */
- actions_list_ref(actions);
- t->actions = actions_list_concat(t->actions, actions);
+ action_list_ref(actions);
+ t->actions = action_list_concat(t->actions, actions);
/* assimilate this built tree into the main tree. assimilation
destroys/uses the tree */
else {
gboolean i;
- i = actions_run_acts(p->actions, OB_USER_ACTION_KEYBOARD_KEY,
- e->xkey.state,
- e->xkey.x_root, e->xkey.y_root,
- 0, OB_FRAME_CONTEXT_NONE, client);
+ i = action_run_acts(p->actions, OB_USER_ACTION_KEYBOARD_KEY,
+ e->xkey.state,
+ e->xkey.x_root, e->xkey.y_root,
+ 0, OB_FRAME_CONTEXT_NONE, client);
if (!i) /* reset if an interactive was not run */
keyboard_reset_chains(0);
}
#include <X11/Xlib.h>
struct _ObClient;
-struct _ObActionsAct;
+struct _ObActionList;
extern KeyBindingTree *keyboard_firstnode;
void keyboard_rebind(void);
void keyboard_chroot(GList *keylist);
-gboolean keyboard_bind(GList *keylist, struct _ObActionsList *actions);
+gboolean keyboard_bind(GList *keylist, struct _ObActionList *actions);
void keyboard_unbind_all(void);
gboolean keyboard_event(struct _ObClient *client, const XEvent *e);
#include "keyboard.h"
#include "translate.h"
-#include "actions.h"
-#include "actions_list.h"
+#include "action.h"
+#include "action_list.h"
#include <glib.h>
void tree_destroy(KeyBindingTree *tree)
for (it = tree->keylist; it != NULL; it = it->next)
g_free(it->data);
g_list_free(tree->keylist);
- actions_list_unref(tree->actions);
+ action_list_unref(tree->actions);
}
g_slice_free(KeyBindingTree, tree);
tree = c;
#include <glib.h>
-struct _ObActionsList;
+struct _ObActionList;
typedef struct KeyBindingTree {
guint state;
guint key;
GList *keylist;
- struct _ObActionsList *actions;
+ struct _ObActionList *actions;
gboolean chroot;
/* the level up in the tree */
#include "grab.h"
#include "client.h"
#include "config.h"
-#include "actions.h"
-#include "actions_list.h"
-#include "actions_parser.h"
+#include "action.h"
+#include "action_list.h"
+#include "action_parser.h"
#include "screen.h"
#include "menuframe.h"
#include "keyboard.h"
if (obt_xml_attr_string(node, "label", &label)) {
xmlNodePtr c;
xmlChar *cc;
- ObActionsList *acts = NULL;
- ObActionsParser *p;
+ ObActionList *acts = NULL;
+ ObActionParser *p;
c = obt_xml_find_node(node->children, "action");
- p = actions_parser_new();
+ p = action_parser_new();
while (c) {
- ObActionsList *al;
+ ObActionList *al;
cc = xmlNodeGetContent(c);
- al = actions_parser_read_string(p, (gchar*)cc);
+ al = action_parser_read_string(p, (gchar*)cc);
xmlFree(cc);
- acts = actions_list_concat(acts, al);
+ acts = action_list_concat(acts, al);
c = obt_xml_find_node(c->next, "action");
}
e = menu_add_normal(state->parent, -1, label, acts, TRUE);
- actions_list_unref(acts);
+ action_list_unref(acts);
if (config_menu_show_icons &&
obt_xml_attr_string(node, "icon", &icon))
RrImageUnref(self->data.normal.icon);
g_free(self->data.normal.label);
g_free(self->data.normal.collate_key);
- actions_list_unref(self->data.normal.actions);
+ action_list_unref(self->data.normal.actions);
break;
case OB_MENU_ENTRY_TYPE_SUBMENU:
RrImageUnref(self->data.submenu.icon);
}
ObMenuEntry* menu_add_normal(ObMenu *self, gint id, const gchar *label,
- ObActionsList *actions, gboolean allow_shortcut)
+ ObActionList *actions, gboolean allow_shortcut)
{
ObMenuEntry *e;
e = menu_entry_new(self, OB_MENU_ENTRY_TYPE_NORMAL, id);
e->data.normal.actions = actions;
- actions_list_ref(actions);
+ action_list_ref(actions);
menu_entry_set_label(e, label, allow_shortcut);
#include <glib.h>
-struct _ObActionsList;
+struct _ObActionList;
struct _ObClient;
struct _ObMenuFrame;
struct _ObMenuEntryFrame;
/* state */
gboolean enabled;
- struct _ObActionsList *actions;
+ struct _ObActionList *actions;
/* Mask icon */
RrPixmapMask *mask;
/*! @param allow_shortcut this should be false when the label is coming from
outside data like window or desktop titles */
ObMenuEntry* menu_add_normal(ObMenu *menu, gint id, const gchar *label,
- struct _ObActionsList *actions,
+ struct _ObActionList *actions,
gboolean allow_shortcut);
ObMenuEntry* menu_add_submenu(ObMenu *menu, gint id, const gchar *submenu);
ObMenuEntry* menu_add_separator(ObMenu *menu, gint id, const gchar *label);
#include "client.h"
#include "menu.h"
#include "screen.h"
-#include "actions.h"
-#include "actions_list.h"
+#include "action.h"
+#include "action_list.h"
#include "event.h"
#include "grab.h"
#include "openbox.h"
ObMenuEntry *entry = self->entry;
ObMenuExecuteFunc func = self->frame->menu->execute_func;
gpointer data = self->frame->menu->data;
- ObActionsList *acts = self->entry->data.normal.actions;
+ ObActionList *acts = self->entry->data.normal.actions;
ObClient *client = self->frame->client;
ObMenuFrame *frame = self->frame;
guint mods = obt_keyboard_only_modmasks(state);
if (func)
func(entry, frame, client, state, data);
else
- actions_run_acts(acts, OB_USER_ACTION_MENU_SELECTION,
- state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, client);
+ action_run_acts(acts, OB_USER_ACTION_MENU_SELECTION,
+ state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, client);
}
}
#include "openbox.h"
#include "config.h"
-#include "actions.h"
-#include "actions_list.h"
+#include "action.h"
+#include "action_list.h"
#include "event.h"
#include "client.h"
#include "grab.h"
typedef struct {
guint state;
guint button;
- ObActionsList *actions[OB_NUM_MOUSE_ACTIONS];
+ ObActionList *actions[OB_NUM_MOUSE_ACTIONS];
} ObMouseBinding;
/* Array of GSList*s of ObMouseBinding*s. */
gint j;
for (j = 0; j < OB_NUM_MOUSE_ACTIONS; ++j)
- actions_list_unref(b->actions[j]);
+ action_list_unref(b->actions[j]);
g_slice_free(ObMouseBinding, b);
}
g_slist_free(bound_contexts[i]);
/* if not bound, then nothing to do! */
if (it == NULL) return FALSE;
- actions_run_acts(b->actions[a], mouse_action_to_user_action(a),
- state, x, y, button, context, c);
+ action_run_acts(b->actions[a], mouse_action_to_user_action(a),
+ state, x, y, button, context, c);
return TRUE;
}
}
gboolean mouse_bind(const gchar *buttonstr, ObFrameContext context,
- ObMouseAction mact, ObActionsList *actions)
+ ObMouseAction mact, ObActionList *actions)
{
guint state, button;
ObMouseBinding *b;
for (it = bound_contexts[context]; it; it = g_slist_next(it)) {
b = it->data;
if (b->state == state && b->button == button) {
- actions_list_ref(actions);
- b->actions[mact] = actions_list_concat(b->actions[mact], actions);
+ action_list_ref(actions);
+ b->actions[mact] = action_list_concat(b->actions[mact], actions);
return TRUE;
}
}
b->state = state;
b->button = button;
b->actions[mact] = actions;
- actions_list_ref(actions);
+ action_list_ref(actions);
bound_contexts[context] = g_slist_append(bound_contexts[context], b);
return TRUE;
#include <X11/Xlib.h>
-struct _ObActionsList;
+struct _ObActionList;
void mouse_startup(gboolean reconfig);
void mouse_shutdown(gboolean reconfig);
gboolean mouse_bind(const gchar *buttonstr, ObFrameContext context,
- ObMouseAction mact, struct _ObActionsList *actions);
+ ObMouseAction mact, struct _ObActionList *actions);
void mouse_unbind_all(void);
gboolean mouse_event(struct _ObClient *client, XEvent *e);
#include "menu.h"
#include "client.h"
#include "screen.h"
-#include "actions.h"
+#include "action.h"
#include "startupnotify.h"
#include "focus.h"
#include "focus_cycle.h"
i = obt_xml_instance_new();
/* register all the available actions */
- actions_startup(reconfigure);
+ action_startup(reconfigure);
/* start up config which sets up with the parser */
config_startup(i);
sn_shutdown(reconfigure);
event_shutdown(reconfigure);
config_shutdown();
- actions_shutdown(reconfigure);
+ action_shutdown(reconfigure);
} while (reconfigure);
}