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
;
36 OB_ACTION_INTERACTING
,
37 OB_NUM_ACTIONS_INTERACTIVE_STATES
38 } ObActionsInteractiveState
;
40 typedef gpointer (*ObActionsDataSetupFunc
)(ObParseInst
*i
,
41 xmlDocPtr doc
, xmlNodePtr node
);
42 typedef void (*ObActionsDataFreeFunc
)(gpointer options
);
43 typedef void (*ObActionsRunFunc
)(ObActionsData
*data
,
49 06:10 (@dana) hm i think there are 3 types of actions
50 06:10 (@dana) global actions, window actions, and selector actions
51 06:11 (@dana) eg show menu/exit, raise/focus, and cycling/directional/expose
55 OB_ACTION_TYPE_GLOBAL
,
56 OB_ACTION_TYPE_CLIENT
,
57 OB_ACTION_TYPE_SELECTOR
60 /* These structures are all castable as eachother */
62 struct _ObActionsAnyData
{
71 struct _ObActionsGlobalData
{
76 struct _ObActionsClientData
{
81 ObFrameContext context
;
84 struct _ObActionsSelectorData
{
88 ObActionsInteractiveState interactive
;
92 struct _ObActionsData
{
97 ObActionsGlobalData global
;
98 ObActionsClientData client
;
99 ObActionsSelectorData selector
;
103 void actions_startup(gboolean reconfigure
);
104 void actions_shutdown(gboolean reconfigure
);
106 gboolean
actions_register(const gchar
*name
,
108 ObActionsDataSetupFunc setup
,
109 ObActionsDataFreeFunc free
,
110 ObActionsRunFunc run
);
112 ObActionsAct
* actions_parse(ObParseInst
*i
,
115 ObActionsAct
* actions_parse_string(const gchar
*name
);
117 void actions_act_ref(ObActionsAct
*act
);
118 void actions_act_unref(ObActionsAct
*act
);
120 /*! Pass in a GSList of ObActionsAct's to be run */
121 void actions_run_acts(GSList
*acts
,
129 struct _ObClient
*client
,
130 ObActionsInteractiveState interactive
);