1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 actions.h for the Openbox window manager
4 Copyright (c) 2007 Dana Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
21 #include "parser/parse.h"
25 typedef struct _ObActionsDefinition ObActionsDefinition;
26 typedef struct _ObActionsAct ObActionsAct;
27 typedef struct _ObActionsData ObActionsData;
28 typedef struct _ObActionsAnyData ObActionsAnyData;
29 typedef struct _ObActionsGlobalData ObActionsGlobalData;
30 typedef struct _ObActionsClientData ObActionsClientData;
31 typedef struct _ObActionsSelectorData ObActionsSelectorData;
33 typedef gpointer (*ObActionsDataSetupFunc)(ObParseInst *i,
34 xmlDocPtr doc, xmlNodePtr node);
35 typedef void (*ObActionsDataFreeFunc)(gpointer options);
36 typedef gboolean (*ObActionsRunFunc)(ObActionsData *data,
38 typedef gboolean (*ObActionsInteractiveInputFunc)(guint initial_state,
41 typedef void (*ObActionsInteractiveCancelFunc)(gpointer options);
44 OB_ACTION_TYPE_GLOBAL,
48 /* These structures are all castable as eachother */
50 struct _ObActionsAnyData {
58 struct _ObActionsGlobalData {
63 struct _ObActionsClientData {
68 ObFrameContext context;
71 struct _ObActionsData {
76 ObActionsGlobalData global;
77 ObActionsClientData client;
81 void actions_startup(gboolean reconfigure);
82 void actions_shutdown(gboolean reconfigure);
84 /*! If the action is interactive, then i_input and i_cancel are not NULL.
85 Otherwise, they should both be NULL. */
86 gboolean actions_register(const gchar *name,
88 ObActionsDataSetupFunc setup,
89 ObActionsDataFreeFunc free,
91 ObActionsInteractiveInputFunc i_input,
92 ObActionsInteractiveCancelFunc i_cancel);
94 ObActionsAct* actions_parse(ObParseInst *i,
97 ObActionsAct* actions_parse_string(const gchar *name);
99 gboolean actions_act_is_interactive(ObActionsAct *act);
101 void actions_act_ref(ObActionsAct *act);
102 void actions_act_unref(ObActionsAct *act);
104 /*! Pass in a GSList of ObActionsAct's to be run.
105 @return TRUE if an action is in interactive state, FALSE is none are
107 void actions_run_acts(GSList *acts,
114 struct _ObClient *client);