]> icculus.org git repositories - dana/openbox.git/blob - obt/watch_interface.h
wip: loading theme stuff
[dana/openbox.git] / obt / watch_interface.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    obt/watch_interface.h for the Openbox window manager
4    Copyright (c) 2010        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 #ifndef __obt_watch_interface_h
20 #define __obt_watch_interface_h
21
22 #include <glib.h>
23
24 G_BEGIN_DECLS
25
26 typedef struct _ObtWatchTarget ObtWatchTarget;
27 typedef struct _ObtWatchFile   ObtWatchFile;
28
29 /*! Initializes the watch subsystem, and returns a GSource for it.
30   @param notify The GSource will call @notify when a watched file is changed.
31   @return Returns a GSource* on success, and a NULL if an error occurred.
32 */
33 GSource* watch_sys_create_source(void);
34
35 /*! Informs the watch system about a new file/dir.
36   It should return a structure that it wants to store inside the file.
37 */
38 gpointer watch_sys_add_file(GSource *source,
39                             ObtWatchTarget *target,
40                             ObtWatchFile *file,
41                             gboolean is_dir);
42
43 /*! Informs the watch system about the destruction of a file.
44   It can free the structure returned from watch_sys_add_file as this is given
45   in @data.
46 */
47 void watch_sys_remove_file(GSource *source,
48                            ObtWatchTarget *target,
49                            ObtWatchFile *file,
50                            gpointer data);
51
52 /* These are in watch.c, they are part of the main watch system */
53 void watch_main_notify_add(ObtWatchTarget *target,
54                            ObtWatchFile *parent,
55                            const gchar *name);
56 void watch_main_notify_remove(ObtWatchTarget *target,
57                               ObtWatchFile *file);
58 void watch_main_notify_modify(ObtWatchTarget *target,
59                               ObtWatchFile *file);
60
61 gboolean watch_main_target_watch_hidden(ObtWatchTarget *target);
62 ObtWatchFile* watch_main_target_root(ObtWatchTarget *target);
63 gchar* watch_main_target_file_full_path(ObtWatchTarget *target,
64                                         ObtWatchFile *file);
65
66 gchar* watch_main_file_sub_path(ObtWatchFile *file);
67 gboolean watch_main_file_is_dir(ObtWatchFile *file);
68 ObtWatchFile* watch_main_file_child(ObtWatchFile *file,
69                                     const gchar *name);
70 GList* watch_main_file_children(ObtWatchFile *file);
71
72 G_END_DECLS
73
74 #endif