1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 obt/watch_manual.c 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 /*! This will just do nothing if a better mechanism isn't present, requiring
20 a manual refresh (via obt_watch_refresh()) to see updates in the filesystem.
23 #ifndef HAVE_SYS_INOTIFY_H
26 #include "watch_interface.h"
30 typedef struct _ManualSource ManualSource;
31 typedef struct _ManualFile ManualFile;
33 static gboolean source_check(GSource *source);
34 static gboolean source_prepare(GSource *source, gint *timeout);
35 static gboolean source_read(GSource *source, GSourceFunc cb, gpointer data);
36 static void source_finalize(GSource *source);
38 static GSourceFuncs source_funcs = {
45 GSource* watch_sys_create_source()
47 return g_source_new(&source_funcs, sizeof(GSource));
50 gpointer watch_sys_add_target(ObtWatchTarget *target)
55 void watch_sys_remove_target(ObtWatchTarget *target, gpointer data)
59 gpointer watch_sys_add_file(GSource *source,
60 ObtWatchTarget *target,
67 void watch_sys_remove_file(GSource *source,
68 ObtWatchTarget *target,
74 static gboolean source_prepare(GSource *source, gint *timeout)
80 static gboolean source_check(GSource *source)
85 static gboolean source_read(GSource *source, GSourceFunc cb, gpointer data)
90 static void source_finalize(GSource *source)