]> icculus.org git repositories - dana/openbox.git/blob - openbox/action_filter.h
Actions say what kind of filter they would like by default (one window or all)
[dana/openbox.git] / openbox / action_filter.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    action_filter.h for the Openbox window manager
4    Copyright (c) 2011        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 <glib.h>
20
21 struct _ObActionValue;
22 struct _ObClient;
23 struct _ObClientSet;
24
25 typedef struct _ObActionFilter ObActionFilter;
26 typedef struct _ObActionFilterFuncs ObActionFilterFuncs;
27 typedef enum _ObActionFilterDefault ObActionFilterDefault;
28
29 typedef gpointer (*ObActionFilterSetupFunc)(gboolean invert,
30                                             struct _ObActionValue *v);
31 typedef void (*ObActionFilterDestroyFunc)(gpointer data);
32 /*! Runs the filter and modifies the client set as appropriate.  This function
33   is given a set of clients and may simply remove clients that do not
34   match its criteria. */
35 typedef void (*ObActionFilterReduceFunc)(struct _ObClientSet *set);
36 /*! Runs the filter and creates a new client set as appropriate.  This function
37   is given a set of clients and must add all unlisted clients possible that
38   match its criteria. */
39 typedef void (*ObActionFilterExpandFunc)(struct _ObClientSet *set);
40
41 void action_filter_startup(gboolean reconfig);
42 void action_filter_shutdown(gboolean reconfig);
43
44 gboolean action_filter_register(const gchar *name,
45                                 ObActionFilterSetupFunc setup,
46                                 ObActionFilterDestroyFunc destroy,
47                                 ObActionFilterReduceFunc reduce,
48                                 ObActionFilterExpandFunc expand);
49
50 ObActionFilter* action_filter_new(const gchar *key, struct _ObActionValue *v);
51 void action_filter_ref(ObActionFilter *f);
52 void action_filter_unref(ObActionFilter *f);
53
54 void action_filter_expand(ObActionFilter *f, struct _ObClientSet *set);
55 void action_filter_reduce(ObActionFilter *f, struct _ObClientSet *set);