1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 obt/watch_interface.h for the Openbox window manager
4 Copyright (c) 2010 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.
19 #ifndef __obt_watch_interface_h
20 #define __obt_watch_interface_h
26 typedef struct _ObtWatchTarget ObtWatchTarget;
27 typedef struct _ObtWatchFile ObtWatchFile;
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.
33 GSource* watch_sys_create_source(void);
35 /*! Informs the watch system about a new file/dir.
36 It should return a structure that it wants to store inside the file.
38 gpointer watch_sys_add_file(GSource *source,
39 ObtWatchTarget *target,
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
47 void watch_sys_remove_file(GSource *source,
48 ObtWatchTarget *target,
52 /* These are in watch.c, they are part of the main watch system */
53 void watch_main_notify_add(ObtWatchTarget *target,
56 void watch_main_notify_remove(ObtWatchTarget *target,
58 void watch_main_notify_modify(ObtWatchTarget *target,
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,
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,
70 GList* watch_main_file_children(ObtWatchFile *file);