Rename ObActions* to ObAction* and remove more 3.4-compat action stuff that was missed.
authorDana Jansens <danakj@orodu.net>
Thu, 28 Jul 2011 18:43:55 +0000 (14:43 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:55:14 +0000 (18:55 -0400)
62 files changed:
Makefile.am
openbox/action.c [moved from openbox/actions.c with 65% similarity]
openbox/action.h [new file with mode: 0644]
openbox/action_list.c [moved from openbox/actions_list.c with 57% similarity]
openbox/action_list.h [new file with mode: 0644]
openbox/action_parser.c [moved from openbox/actions_parser.c with 78% similarity]
openbox/action_parser.h [moved from openbox/actions_parser.h with 54% similarity]
openbox/action_value.c [moved from openbox/actions_value.c with 64% similarity]
openbox/action_value.h [moved from openbox/actions_value.h with 52% similarity]
openbox/actions.h [deleted file]
openbox/actions/addremovedesktop.c
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/breakchroot.c
openbox/actions/close.c
openbox/actions/cyclewindows.c
openbox/actions/debug.c
openbox/actions/decorations.c
openbox/actions/desktop.c
openbox/actions/directionalwindows.c
openbox/actions/dock.c
openbox/actions/dockautohide.c
openbox/actions/execute.c
openbox/actions/exit.c
openbox/actions/focus.c
openbox/actions/focustobottom.c
openbox/actions/fullscreen.c
openbox/actions/growtoedge.c
openbox/actions/iconify.c
openbox/actions/kill.c
openbox/actions/layer.c
openbox/actions/lower.c
openbox/actions/maximize.c
openbox/actions/move.c
openbox/actions/moverelative.c
openbox/actions/moveresizeto.c
openbox/actions/movetoedge.c
openbox/actions/omnipresent.c
openbox/actions/raise.c
openbox/actions/raiselower.c
openbox/actions/reconfigure.c
openbox/actions/resize.c
openbox/actions/resizerelative.c
openbox/actions/restart.c
openbox/actions/shade.c
openbox/actions/shadelowerraise.c [deleted file]
openbox/actions/showdesktop.c
openbox/actions/showmenu.c
openbox/actions/unfocus.c
openbox/actions_list.h [deleted file]
openbox/config.c
openbox/event.c
openbox/keyboard.c
openbox/keyboard.h
openbox/keytree.c
openbox/keytree.h
openbox/menu.c
openbox/menu.h
openbox/menuframe.c
openbox/mouse.c
openbox/mouse.h
openbox/openbox.c

index 9c281a1e6a2a834af3baacefc006afb5dc9e9989..c9a42e032563c3ac203be49966e204abf52f4807 100644 (file)
@@ -231,18 +231,17 @@ openbox_openbox_SOURCES = \
        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 \
similarity index 65%
rename from openbox/actions.c
rename to openbox/action.c
index 41c0f236ca22364d053405198d9b6f6a4ba2abf8..229a73d2af8496a39decf395d172d2759c084df1 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- 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
@@ -16,8 +16,8 @@
    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);
 
@@ -104,7 +104,7 @@ ObActionsDefinition* do_register(const gchar *name,
             return NULL;
     }
 
-    def = g_slice_new(ObActionsDefinition);
+    def = g_slice_new(ObActionDefinition);
     def->ref = 1;
     def->name = g_strdup(name);
     def->free = free;
@@ -115,12 +115,12 @@ ObActionsDefinition* do_register(const gchar *name,
     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;
@@ -128,12 +128,12 @@ gboolean actions_register_i(const gchar *name,
     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;
@@ -141,11 +141,11 @@ gboolean actions_register(const gchar *name,
     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;
@@ -157,24 +157,24 @@ gboolean actions_set_shutdown(const gchar *name,
     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)) {
@@ -186,10 +186,10 @@ static ObActionsAct* actions_act_find_name(const gchar *name)
 
     /* 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;
@@ -202,11 +202,11 @@ static ObActionsAct* actions_act_find_name(const gchar *name)
     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) {
@@ -226,36 +226,36 @@ ObActionsAct* actions_act_new(const gchar *name, GHashTable *config)
     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;
@@ -266,14 +266,14 @@ static void actions_setup_data(ObActionsData *data,
     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;
@@ -289,8 +289,8 @@ gboolean actions_run_acts(ObActionsList *acts,
     ran_interactive = FALSE;
     update_user_time = FALSE;
     while (acts) {
-        ObActionsAct *act;
-        ObActionsData data;
+        ObAction *act;
+        ObActionData data;
         gboolean ok = TRUE;
 
         if (acts->isfilter) {
@@ -302,23 +302,23 @@ gboolean actions_run_acts(ObActionsList *acts,
             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;
             }
         }
@@ -326,8 +326,8 @@ gboolean actions_run_acts(ObActionsList *acts,
         /* 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 {
@@ -345,25 +345,25 @@ gboolean actions_run_acts(ObActionsList *acts,
     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);
 
@@ -377,10 +377,10 @@ static gboolean actions_interactive_begin_act(ObActionsAct *act, guint 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
@@ -392,11 +392,11 @@ static void actions_interactive_end_act(void)
         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) {
@@ -406,13 +406,13 @@ gboolean actions_interactive_input_event(XEvent *e)
         {
             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)
diff --git a/openbox/action.h b/openbox/action.h
new file mode 100644 (file)
index 0000000..187bf59
--- /dev/null
@@ -0,0 +1,115 @@
+/* -*- 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);
similarity index 57%
rename from openbox/actions_list.c
rename to openbox/action_list.c
index 345f47b917a4d3783b04b16af8cd9b25f4f803af..c6c506080bcca4b0744707a6c82d77211bdaee65 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- 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;
diff --git a/openbox/action_list.h b/openbox/action_list.h
new file mode 100644 (file)
index 0000000..4e2dcb2
--- /dev/null
@@ -0,0 +1,55 @@
+/* -*- 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);
similarity index 78%
rename from openbox/actions_parser.c
rename to openbox/action_parser.c
index 5947378dd44387d228411e4dd2e6ba7c2644d5d5..0424bdbd579f30095c162d261f4995d2c5c91899 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- 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,
@@ -84,27 +84,26 @@ ObActionsParser* actions_parser_new(void)
         .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;
 
@@ -115,9 +114,9 @@ ObActionsList* actions_parser_read_string(ObActionsParser *p,
     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;
@@ -152,7 +151,7 @@ STRING := "TEXT" | (TEXT) |
   \\ \( \) 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);
@@ -160,9 +159,9 @@ gpointer parse_error(ObActionsParser *p, GTokenType exp, const gchar *message,
     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;
@@ -175,7 +174,7 @@ ObActionsList* parse_list(ObActionsParser *p, GTokenType end, gboolean *e)
             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);
@@ -200,10 +199,10 @@ ObActionsList* parse_list(ObActionsParser *p, GTokenType end, gboolean *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;
 
@@ -219,7 +218,7 @@ ObActionsList* parse_action(ObActionsParser *p, gboolean *e)
     /* 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);
@@ -232,7 +231,7 @@ ObActionsList* parse_action(ObActionsParser *p, gboolean *e)
         }
         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 ':' */
@@ -262,26 +261,26 @@ ObActionsList* parse_action(ObActionsParser *p, gboolean *e)
         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;
     }
 
@@ -300,7 +299,7 @@ ObActionsList* parse_filter(ObActionsParser *p, gboolean *e)
         }
     }
 
-    al = g_slice_new(ObActionsList);
+    al = g_slice_new(ObActionList);
     al->ref = 1;
     al->isfilter = TRUE;
     al->u.f.test = test;
@@ -310,13 +309,13 @@ ObActionsList* parse_filter(ObActionsParser *p, gboolean *e)
     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 */
@@ -342,7 +341,7 @@ ObActionsListTest* parse_filter_test(ObActionsParser *p, gboolean *e)
     /* 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;
     }
 
@@ -364,14 +363,14 @@ ObActionsListTest* parse_filter_test(ObActionsParser *p, gboolean *e)
     /* 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;
@@ -380,25 +379,25 @@ ObActionsListTest* parse_filter_test(ObActionsParser *p, gboolean *e)
     }
 }
 
-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);
@@ -406,7 +405,7 @@ ObActionsValue* parse_value(ObActionsParser *p,
 }
 
 
-gchar* parse_string(ObActionsParser *p, guchar end, gboolean *e)
+gchar* parse_string(ObActionParser *p, guchar end, gboolean *e)
 {
     GString *buf;
     GTokenType t;
similarity index 54%
rename from openbox/actions_parser.h
rename to openbox/action_parser.h
index 44a1972358a5da1ea4c03b4982cf397104b3c1e1..1c070bd620570a8e158c05fc68ec40c1167667b4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- 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);
similarity index 64%
rename from openbox/actions_value.c
rename to openbox/action_value.c
index 5603adef52a46cf154d71bfb625aee23cb982fdd..ed8d691a838d716337dc172da6778b26f82fd9e1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- 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 ||
@@ -106,7 +106,7 @@ gboolean actions_value_bool(ObActionsValue *v)
         return FALSE;
 }
 
-gint actions_value_int(ObActionsValue *v)
+gint action_value_int(ObActionValue *v)
 {
     gchar *s;
 
@@ -115,7 +115,7 @@ gint actions_value_int(ObActionsValue *v)
     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;
 
@@ -131,7 +131,7 @@ void actions_value_fraction(ObActionsValue *v, gint *numer, gint *denom)
         *denom = atoi(s+1);
 }
 
-void actions_value_gravity_coord(ObActionsValue *v, GravityCoord *c)
+void action_value_gravity_coord(ObActionValue *v, GravityCoord *c)
 {
     gchar *s;
 
@@ -159,8 +159,8 @@ void actions_value_gravity_coord(ObActionsValue *v, GravityCoord *c)
     }
 }
 
-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;
 }
similarity index 52%
rename from openbox/actions_value.h
rename to openbox/action_value.h
index 681a00cc9e834e88a93964cbdc37e970e8d06201..2a2fd9f0890539ab85331827d099e23daef330db 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- 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);
diff --git a/openbox/actions.h b/openbox/actions.h
deleted file mode 100644 (file)
index 82d3505..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- 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);
index 10458d577804572c183c49aa166907d9727fcfac..85923e390b0429dd00522bd8fd87dda91324fd14 100644 (file)
@@ -1,5 +1,5 @@
-#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>
 
@@ -12,7 +12,7 @@ static gpointer setup_func(GHashTable *config);
 static gpointer setup_add_func(GHashTable *config);
 static gpointer setup_remove_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(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);
@@ -21,30 +21,30 @@ static gpointer setup_removelast_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"))
@@ -74,18 +74,18 @@ static void free_func(gpointer 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;
 
-    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;
 }
index 06e3074a94d43f3c22c74df990b019d3b1a431d4..26bf8bbe17a4f5aa0d66c973195c040ea1b05142 100644 (file)
@@ -1,6 +1,6 @@
 #include "all.h"
 
-void action_all_startup(void)
+void actions_all_startup(void)
 {
     action_execute_startup();
     action_debug_startup();
@@ -38,6 +38,4 @@ void action_all_startup(void)
     action_movetoedge_startup();
     action_growtoedge_startup();
     action_focustobottom_startup();
-    /* 3.4-compatibility */
-    action_shadelowerraise_startup();
 }
index 5bc337aad1471ca01c70e136295b662c1e1f3e14..3fbda6b8595f5db74e9aa4aea39f76c9bb1af363 100644 (file)
@@ -1,7 +1,7 @@
 #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);
@@ -39,7 +39,5 @@ void action_layer_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
index 8c004582cc95b49fe801b94723cc002e542a4e6a..c46fa93018599dc85bb3536f384ff2307f5b7bc7 100644 (file)
@@ -1,17 +1,17 @@
-#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);
index d2bc96c2166e424eacbb9c550f50d3f5bda332ce..b8f799bd80105a3b9c80143ba51d2c502c3696d3 100644 (file)
@@ -1,17 +1,15 @@
-#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);
 
index 5325a60a5222418294d5a880de227a5b3107166e..5b91bf6358db2ff95ecf45c3d8eba59272f03e09 100644 (file)
@@ -1,7 +1,7 @@
-#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"
@@ -20,7 +20,7 @@ typedef struct {
     gboolean bar;
     gboolean raise;
     ObFocusCyclePopupMode dialog_mode;
-    ObActionsList *actions;
+    ObActionList *actions;
 
 
     /* options for after we're done */
@@ -29,22 +29,22 @@ typedef struct {
 } 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,
@@ -55,18 +55,18 @@ static void     i_post_func(gpointer options);
 
 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);
@@ -74,11 +74,11 @@ static gpointer setup_func(GHashTable *config,
     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)
@@ -87,36 +87,36 @@ static gpointer setup_func(GHashTable *config,
             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;
@@ -126,10 +126,10 @@ static gpointer setup_func(GHashTable *config,
 }
 
 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;
@@ -137,10 +137,10 @@ static gpointer setup_forward_func(GHashTable *config,
 }
 
 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;
@@ -151,11 +151,11 @@ static void free_func(gpointer options)
 {
     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;
@@ -245,8 +245,8 @@ static void i_post_func(gpointer options)
                      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();
 }
index 2ffd4f6e5344de5f7929471f0d062ba8fe8f9f29..6f72920591f0989f739a21ffa3785bcf5cd18ce3 100644 (file)
@@ -1,5 +1,5 @@
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
 #include <glib.h>
 
 typedef struct {
@@ -8,23 +8,23 @@ 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;
 }
 
@@ -36,7 +36,7 @@ static void free_func(gpointer options)
 }
 
 /* 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;
 
index f6fd2cbeb7762df6a5567a9459d959beefdc14fc..dd80122a7a6bcd81893782e7448b5f6654e1f946 100644 (file)
@@ -1,46 +1,46 @@
-#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;
 }
index 0c08d855cac85764834afb454678f9fcb23d2aef..8980630bf549b41415b7f09721edb8687f0c7018 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -31,17 +31,17 @@ typedef struct {
 } 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,
@@ -54,17 +54,17 @@ static void i_post_func(gpointer options);
 
 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);
@@ -75,8 +75,8 @@ static gpointer setup_func(GHashTable *config,
     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"))
@@ -118,18 +118,18 @@ static gpointer setup_func(GHashTable *config,
     }
 
     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;
 
@@ -145,12 +145,12 @@ static gpointer setup_go_func(GHashTable *config,
 }
 
 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);
@@ -158,8 +158,8 @@ static gpointer setup_send_func(GHashTable *config,
     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;
@@ -176,7 +176,7 @@ static void free_func(gpointer o)
     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;
@@ -204,7 +204,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
          (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;
@@ -216,7 +216,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
                 client_bring_helper_windows(data->client);
         }
 
-        actions_client_move(data, FALSE);
+        action_client_move(data, FALSE);
     }
 
     return o->interactive;
index 46ac6fd7d1b22e9109eed569cdaec0b5d212a4a5..b7f9e3d13a185da8015773088e0b6327bb3c4faf 100644 (file)
@@ -1,7 +1,7 @@
-#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"
@@ -19,20 +19,20 @@ typedef struct {
     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,
@@ -42,100 +42,17 @@ static void     i_cancel_func(gpointer options);
 
 static void     end_cycle(gboolean cancel, guint state, Options *o);
 
-/* 3.4-compatibility */
-static gpointer setup_north_cycle_func(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);
@@ -143,23 +60,23 @@ static gpointer setup_func(GHashTable *config)
     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;
@@ -183,27 +100,27 @@ static gpointer setup_func(GHashTable *config)
     }
 
     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;
@@ -223,11 +140,11 @@ static void free_func(gpointer options)
 {
     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;
 
@@ -314,154 +231,8 @@ static void end_cycle(gboolean cancel, guint state, Options *o)
     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;
-}
-
index a1f6837376fe72c71ba4020611fd2fa75dc13c8a..730e61cc24b740e86933a20fa835da268e3ae2dc 100644 (file)
@@ -1,37 +1,33 @@
-#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;
 }
index 4a750b2c3a368ebea5bcbc03842772db92168578..2ade0278869b8b670179f853d9bca73f7e4142a8 100644 (file)
@@ -1,18 +1,16 @@
-#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();
index c995829aa912f93d7fb34912b130bd0b76c626a1..64945a1aa0fcb7903fc81115985d2e4fb5dc69e5 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -19,12 +19,12 @@ typedef struct {
     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);
 
@@ -32,8 +32,8 @@ static GSList *prompt_opts = NULL;
 
 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);
 }
@@ -51,31 +51,31 @@ static void client_dest(ObClient *client, gpointer data)
 
 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;
 }
@@ -97,12 +97,12 @@ static void free_func(gpointer options)
         g_free(o->sn_icon);
         g_free(o->sn_wmclass);
         g_free(o->prompt);
-        if (o->data) g_slice_free(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);
@@ -111,8 +111,8 @@ static Options* dup_options(Options *in, ObActionsData *data)
     o->sn_icon = g_strdup(in->sn_icon);
     o->sn_wmclass = g_strdup(in->sn_wmclass);
     o->prompt = NULL;
-    o->data = g_slice_new(ObActionsData);
-    memcpy(o->data, data, sizeof(ObActionsData));
+    o->data = g_slice_new(ObActionData);
+    memcpy(o->data, data, sizeof(ObActionData));
     return o;
 }
 
@@ -131,7 +131,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer options)
 }
 
 /* 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;
index f27850145b39f2462f1899a50749d6bd12ccf37e..25d410e751b017ca372f5199a35f18f1aeb93d38 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -11,25 +11,24 @@ typedef struct {
 
 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;
 }
@@ -61,7 +60,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer data)
 
 
 /* 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;
 
index e5e5cc537b0c1b9d7d82bf9f13f7a9ae2deb7851..01d367c47ddbad85b223ad5d65136b942961c0dc 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -12,27 +12,27 @@ typedef struct {
 
 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;
 }
 
@@ -42,7 +42,7 @@ static void free_func(gpointer 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;
 
@@ -58,15 +58,15 @@ static gboolean run_func(ObActionsData *data, gpointer 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 */
index a3e5b5aca2f0200cea76f435f7aaa6ea46380d3d..17d635afc873a8555ce40ef2c46c369e39c270f2 100644 (file)
@@ -1,15 +1,15 @@
-#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);
index e1fdf232ab5e80038ada460a7ec1adcedff57f11..9072c8c255cb8438a7201ea4aa8ade69c2025bed 100644 (file)
@@ -1,20 +1,20 @@
-#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;
 }
index d7618321987e793e9fb982ed4de0739988ce0c36..c43e33e6d40ba2c9e8149a6cb201b03451fc883c 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -14,29 +14,17 @@ typedef struct {
 static gpointer setup_func(GHashTable *config);
 static gpointer setup_shrink_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(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);
@@ -44,8 +32,8 @@ static gpointer setup_func(GHashTable *config)
     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;
@@ -73,7 +61,7 @@ static gpointer setup_shrink_func(GHashTable *config)
     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;
 
@@ -90,9 +78,9 @@ static gboolean do_grow(ObActionsData *data, gint x, gint y, gint w, gint h)
         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;
@@ -104,7 +92,7 @@ static void free_func(gpointer 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;
     gint x, y, w, h;
@@ -166,36 +154,3 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
     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;
-}
index e6bdbb7b247f6104a23792195db8e88e49d25c09..7179a78804a48c0399318e4558c120768959d4af 100644 (file)
@@ -1,22 +1,20 @@
-#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;
index b7d547b9d5b1ee6a07f87ceee94dcc5fe4ee7f97..d0b31a1567313f6e16776fb0f2b9adb1c1b184c3 100644 (file)
@@ -1,17 +1,15 @@
-#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);
index 7baa5ab0f817acee40a8164edc31c924f40b2386..ff1832055578e302479c86f34781171afb092699 100644 (file)
@@ -1,5 +1,5 @@
-#include "openbox/actions.h"
-#include "openbox/actions_value.h"
+#include "openbox/action.h"
+#include "openbox/action_value.h"
 #include "openbox/client.h"
 
 typedef struct {
@@ -11,27 +11,16 @@ static gpointer setup_func_top(GHashTable *config);
 static gpointer setup_func_bottom(GHashTable *config);
 static gpointer setup_func_send(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(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)
@@ -52,14 +41,14 @@ static gpointer setup_func_bottom(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;
@@ -80,14 +69,14 @@ static void free_func(gpointer 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;
 
     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)
@@ -100,34 +89,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         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;
-}
-
index 80ca6b8bcf9fc22c2d229e9f1b2cddb4c299769e..b08e6d91741b99fe560d03d472a1c4f595c8c867 100644 (file)
@@ -1,23 +1,21 @@
-#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;
index 2bb6a62bb8ff305476d282f8d35abcf3036bd897..4854492f9b58c0b36385608d4edb146460c7b880 100644 (file)
@@ -1,5 +1,5 @@
-#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 */
@@ -15,28 +15,28 @@ typedef struct {
 
 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;
@@ -54,42 +54,42 @@ static void free_func(gpointer o)
 }
 
 /* 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;
 }
index ba8372a584bb0ad50e21ff35397b04385dfe06e3..14778caf7e1d514eaa27b31026516b46a9d4c5eb 100644 (file)
@@ -1,18 +1,16 @@
-#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;
index 4b3a0c5afdb1f8b87fb12f86b03d68430f969073..059a5cf5a87614b983ca411fe5374bb5a2bf4e54 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -14,26 +14,26 @@ typedef struct {
 
 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;
 }
@@ -44,7 +44,7 @@ static void free_func(gpointer 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;
 
@@ -71,9 +71,9 @@ static gboolean run_func(ObActionsData *data, gpointer 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;
index 410fc7096020c6d8593e819680b662f9dfdad3d6..c443a7a3204b10658c3359238aa896b29883a424 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -24,20 +24,16 @@ typedef struct {
 
 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);
@@ -48,24 +44,24 @@ static gpointer setup_func(GHashTable *config)
     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;
@@ -74,7 +70,7 @@ static gpointer setup_func(GHashTable *config)
             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;
         }
     }
 
@@ -87,7 +83,7 @@ static void free_func(gpointer 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;
 
@@ -159,9 +155,9 @@ static gboolean run_func(ObActionsData *data, gpointer 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);
@@ -169,19 +165,3 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
     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;
-}
index cff299ec663f196ff83cb746f08156d59999fdd9..809c54ed7d9d53bb92e0655747ebd7a716d085fa 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -12,34 +12,24 @@ typedef struct {
 
 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;
@@ -63,7 +53,7 @@ static void free_func(gpointer 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;
 
@@ -72,41 +62,11 @@ static gboolean run_func(ObActionsData *data, gpointer 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;
-}
-
index 4309acc642231a0ee35f555af2108d060a2a9720..042e3bd02506f607b3d47e3a76be32b8f2e154ac 100644 (file)
@@ -1,23 +1,23 @@
-#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;
 }
index f6ac1452a43120cef1b12e41368985eb6fbe1ef3..272b3da6eda0f79627ca2cfce4606f30e8186f5a 100644 (file)
@@ -1,21 +1,21 @@
-#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;
index dbe41d854028e7239c377e1cdb6f21aa410ded28..2e7fbc337ba4ea8e81a72dd01bf05f1bff57f098 100644 (file)
@@ -1,20 +1,20 @@
-#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;
index 813a12210ed3ad763e79c0f5a2cfd5cbd2417dd3..22f104e3e0c195462bb5049673a5591ef52cb62f 100644 (file)
@@ -1,15 +1,15 @@
-#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();
 
index 5d6054d855e86b56e3ce9abe8b7821bc96f062ef..b6b9487ea797c895456e7c8c5652bfe6eb729a4e 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -12,26 +12,26 @@ typedef struct {
 
 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"))
@@ -62,7 +62,7 @@ static void free_func(gpointer 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;
 
index b0e4f71d37232773b0ad11dc61452973e48cabc1..e957e6efcbed048a448becb9c02ca122941231e2 100644 (file)
@@ -1,5 +1,5 @@
-#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"
@@ -18,32 +18,32 @@ 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_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;
 }
@@ -54,7 +54,7 @@ static void free_func(gpointer 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;
 
@@ -89,9 +89,9 @@ static gboolean run_func(ObActionsData *data, gpointer 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;
index 7387ba8395f953143b611c63278b7aa38a76f147..94b5934d0c5fd48c7bcbed6fcdf16e31152cb36e 100644 (file)
@@ -1,5 +1,5 @@
-#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"
 
@@ -9,23 +9,23 @@ 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_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;
 }
 
@@ -37,7 +37,7 @@ static void free_func(gpointer options)
 }
 
 /* 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;
 
index 502781dd9e34a58739d16d8a66b9ccc38d518776..5e8da07b0754236c17e9449988dede5b5e51d1ec 100644 (file)
@@ -1,46 +1,46 @@
-#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;
 }
diff --git a/openbox/actions/shadelowerraise.c b/openbox/actions/shadelowerraise.c
deleted file mode 100644 (file)
index 414e281..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-}
index 6dc77d5e7e65aef08a6e6ff8401b29d7e4eeb8c4..99ca1058339f1c0f0c507f2e43daa9348629e6f9 100644 (file)
@@ -1,15 +1,15 @@
-#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);
 
index 1687f2a4c3538cd5d4f5c4923315e2253e006b26..99aab19ff2160e161f3543dc5aae8c39d20a57c3 100644 (file)
@@ -1,5 +1,5 @@
-#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>
 
@@ -9,23 +9,23 @@ 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_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;
 }
 
@@ -37,7 +37,7 @@ static void free_func(gpointer options)
 }
 
 /* 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;
 
index 3db00ca361400ca780b2678f878632b1e0c8e19b..b1e3335da5cd90f05cedd16cddb8c180c7f589d2 100644 (file)
@@ -1,15 +1,15 @@
-#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);
diff --git a/openbox/actions_list.h b/openbox/actions_list.h
deleted file mode 100644 (file)
index 6b84666..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- 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);
index 8fda459dfd91d781798063f966f373ba5dcbaa5c..d1a2be852e80a2c08ffe687ddf460afba60dcf99 100644 (file)
@@ -20,9 +20,9 @@
 #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"
@@ -422,20 +422,20 @@ static void parse_key(xmlNodePtr node, GList *keylist)
         }
         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");
             }
         }
@@ -546,18 +546,18 @@ static void parse_mouse(xmlNodePtr node, gpointer d)
 
                 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:
@@ -948,16 +948,16 @@ static void bind_default_keyboard(void)
         { "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
@@ -1021,17 +1021,17 @@ static void bind_default_mouse(void)
         { "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)
index cf089b64e3c5212ee3ff70baac9e904f3b82e3f9..8a39ecdb44d9ea8ee49620bdd4476186c7382f8c 100644 (file)
@@ -22,7 +22,7 @@
 #include "window.h"
 #include "openbox.h"
 #include "dock.h"
-#include "actions.h"
+#include "action.h"
 #include "client.h"
 #include "config.h"
 #include "screen.h"
@@ -2044,7 +2044,7 @@ static gboolean event_handle_user_input(ObClient *client, XEvent *e)
 
     /* 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)
@@ -2179,8 +2179,8 @@ static gboolean is_enter_focus_event_ignored(gulong serial)
 
 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) {
index 25d3b310bb7ed540434471b185da42e2df01eaf8..8515ff6448fe96bef024d28a9e13beb157af811c 100644 (file)
@@ -24,8 +24,8 @@
 #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"
@@ -140,7 +140,7 @@ void keyboard_chroot(GList *keylist)
     }
 }
 
-gboolean keyboard_bind(GList *keylist, ObActionsList *actions)
+gboolean keyboard_bind(GList *keylist, ObActionList *actions)
 {
     KeyBindingTree *tree, *t;
     gboolean conflict;
@@ -170,8 +170,8 @@ gboolean keyboard_bind(GList *keylist, ObActionsList *actions)
     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 */
@@ -266,10 +266,10 @@ gboolean keyboard_event(ObClient *client, const XEvent *e)
             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);
             }
index 07059a2610e4c0cd589e5309b34d962e98d845b4..300a9106a35be6475de4344d503253897cfb7fa4 100644 (file)
@@ -27,7 +27,7 @@
 #include <X11/Xlib.h>
 
 struct _ObClient;
-struct _ObActionsAct;
+struct _ObActionList;
 
 extern KeyBindingTree *keyboard_firstnode;
 
@@ -37,7 +37,7 @@ void keyboard_shutdown(gboolean reconfig);
 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);
index 7b4b0f7210665c5663a92829ee3a2d5b52982d49..7e14df821c99d2fbaf243bfdddc6e76789f3dc30 100644 (file)
@@ -19,8 +19,8 @@
 
 #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)
@@ -35,7 +35,7 @@ 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;
index 8504772f4954eae10fbed25834115f9a22659045..1971393c02492e170f40bac2791ba4a2dfaddb28 100644 (file)
 
 #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 */
index 28ac4edba16f3f4b7b96dafd90dbaff2dce4cc2d..1ab876edceb499f0be6299594c232bbdb5f73815 100644 (file)
@@ -24,9 +24,9 @@
 #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"
@@ -287,23 +287,23 @@ static void parse_menu_item(xmlNodePtr node,  gpointer data)
         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))
@@ -558,7 +558,7 @@ void menu_entry_unref(ObMenuEntry *self)
             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);
@@ -602,13 +602,13 @@ void menu_entry_remove(ObMenuEntry *self)
 }
 
 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);
 
index c20addb1ae8d11ca1f6379847441a6ed22de8d80..dfa5131be491208ccd8de35188c05cab08ca63d7 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <glib.h>
 
-struct _ObActionsList;
+struct _ObActionList;
 struct _ObClient;
 struct _ObMenuFrame;
 struct _ObMenuEntryFrame;
@@ -121,7 +121,7 @@ struct _ObNormalMenuEntry {
     /* state */
     gboolean enabled;
 
-    struct _ObActionsList *actions;
+    struct _ObActionList *actions;
 
     /* Mask icon */
     RrPixmapMask *mask;
@@ -209,7 +209,7 @@ void menu_set_place_func(ObMenu *menu, ObMenuPlaceFunc func);
 /*! @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);
index ab3f3b9f6a7c7a53ed8e810f4511b387d6c45554..3aa0dfee0d432e3ac3e6657cf4cafaf317b619a6 100644 (file)
@@ -21,8 +21,8 @@
 #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"
@@ -1290,7 +1290,7 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)
         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);
@@ -1304,8 +1304,8 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint 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);
     }
 }
 
index 74b8b7603a5eb54ba1ae821fcf9582a357b7147f..f0b869c16db65c30c05088360339dbe93401f457 100644 (file)
@@ -19,8 +19,8 @@
 
 #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"
@@ -35,7 +35,7 @@
 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. */
@@ -151,7 +151,7 @@ void mouse_unbind_all(void)
             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]);
@@ -188,8 +188,8 @@ static gboolean fire_binding(ObMouseAction a, ObFrameContext context,
     /* 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;
 }
 
@@ -366,7 +366,7 @@ gboolean mouse_event(ObClient *client, XEvent *e)
 }
 
 gboolean mouse_bind(const gchar *buttonstr, ObFrameContext context,
-                    ObMouseAction mact, ObActionsList *actions)
+                    ObMouseAction mact, ObActionList *actions)
 {
     guint state, button;
     ObMouseBinding *b;
@@ -382,8 +382,8 @@ gboolean mouse_bind(const gchar *buttonstr, ObFrameContext context,
     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;
         }
     }
@@ -393,7 +393,7 @@ gboolean mouse_bind(const gchar *buttonstr, ObFrameContext context,
     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;
index b683cdf07e5046d549429cf5ec847dcd5d0fb340..5f38c9f48823cfd2bba506a0a9c3151c6818a62c 100644 (file)
 
 #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);
index fdf1c02354e1d49d78fc23312b56b5b122efb1b6..cdd5566aeb2a09dc7bcaea99b4ec52673ea22ad0 100644 (file)
@@ -25,7 +25,7 @@
 #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"
@@ -236,7 +236,7 @@ gint main(gint argc, gchar **argv)
                 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);
 
@@ -407,7 +407,7 @@ gint main(gint argc, gchar **argv)
             sn_shutdown(reconfigure);
             event_shutdown(reconfigure);
             config_shutdown();
-            actions_shutdown(reconfigure);
+            action_shutdown(reconfigure);
         } while (reconfigure);
     }