1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 action_filter.h for the Openbox window manager
4 Copyright (c) 2011 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 struct _ObActionValue;
25 typedef struct _ObActionFilter ObActionFilter;
26 typedef struct _ObActionFilterFuncs ObActionFilterFuncs;
27 typedef enum _ObActionFilterDefault ObActionFilterDefault;
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);
41 void action_filter_startup(gboolean reconfig);
42 void action_filter_shutdown(gboolean reconfig);
44 gboolean action_filter_register(const gchar *name,
45 ObActionFilterSetupFunc setup,
46 ObActionFilterDestroyFunc destroy,
47 ObActionFilterReduceFunc reduce,
48 ObActionFilterExpandFunc expand);
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);
54 void action_filter_expand(ObActionFilter *f, struct _ObClientSet *set);
55 void action_filter_reduce(ObActionFilter *f, struct _ObClientSet *set);