]> Dogcows Code - chaz/openbox/blob - openbox/actions.h
make ob_debug use the g_log system, and make openbox log messages to..a log file...
[chaz/openbox] / openbox / actions.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3 actions.h for the Openbox window manager
4 Copyright (c) 2007 Dana Jansens
5
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.
10
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.
15
16 See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #include "misc.h"
20 #include "frame.h"
21 #include "obt/parse.h"
22
23 #include <glib.h>
24 #include <X11/Xlib.h>
25
26 typedef struct _ObActionsDefinition ObActionsDefinition;
27 typedef struct _ObActionsAct ObActionsAct;
28 typedef struct _ObActionsData ObActionsData;
29 typedef struct _ObActionsAnyData ObActionsAnyData;
30 typedef struct _ObActionsGlobalData ObActionsGlobalData;
31 typedef struct _ObActionsClientData ObActionsClientData;
32 typedef struct _ObActionsSelectorData ObActionsSelectorData;
33
34 typedef gpointer (*ObActionsDataSetupFunc)(xmlNodePtr node);
35 typedef void (*ObActionsDataFreeFunc)(gpointer options);
36 typedef gboolean (*ObActionsRunFunc)(ObActionsData *data,
37 gpointer options);
38 typedef gboolean (*ObActionsInteractiveInputFunc)(guint initial_state,
39 XEvent *e,
40 gpointer options,
41 gboolean *used);
42 typedef void (*ObActionsInteractiveCancelFunc)(gpointer options);
43
44 struct _ObActionsData {
45 ObUserAction uact;
46 guint state;
47 gint x;
48 gint y;
49 gint button;
50
51 struct _ObClient *client;
52 ObFrameContext context;
53 };
54
55 void actions_startup(gboolean reconfigure);
56 void actions_shutdown(gboolean reconfigure);
57
58 /*! If the action is interactive, then i_input and i_cancel are not NULL.
59 Otherwise, they should both be NULL. */
60 gboolean actions_register(const gchar *name,
61 ObActionsDataSetupFunc setup,
62 ObActionsDataFreeFunc free,
63 ObActionsRunFunc run,
64 ObActionsInteractiveInputFunc i_input,
65 ObActionsInteractiveCancelFunc i_cancel);
66
67 ObActionsAct* actions_parse(xmlNodePtr node);
68 ObActionsAct* actions_parse_string(const gchar *name);
69
70 gboolean actions_act_is_interactive(ObActionsAct *act);
71
72 void actions_act_ref(ObActionsAct *act);
73 void actions_act_unref(ObActionsAct *act);
74
75 /*! Pass in a GSList of ObActionsAct's to be run.
76 @return TRUE if an action is in interactive state, FALSE is none are
77 */
78 void actions_run_acts(GSList *acts,
79 ObUserAction uact,
80 guint state,
81 gint x,
82 gint y,
83 gint button,
84 ObFrameContext con,
85 struct _ObClient *client);
86
87 gboolean actions_interactive_act_running();
88 void actions_interactive_cancel_act();
89
90 gboolean actions_interactive_input_event(XEvent *e);
91
92 /*! Function for actions to call when they are moving a client around */
93 void actions_client_move(ObActionsData *data, gboolean start);
This page took 0.039938 seconds and 4 git commands to generate.