]> icculus.org git repositories - dana/openbox.git/blob - obt/watch_manual.c
Make warnings about parse problems in .desktop files "debug" messages. Most people...
[dana/openbox.git] / obt / watch_manual.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    obt/watch_manual.c 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 /*! 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.
21 */
22
23 #ifndef HAVE_SYS_INOTIFY_H
24
25 #include "watch.h"
26 #include "watch_interface.h"
27
28 #include <glib.h>
29
30 typedef struct _ManualSource ManualSource;
31 typedef struct _ManualFile ManualFile;
32
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);
37
38 static GSourceFuncs source_funcs = {
39     source_prepare,
40     source_check,
41     source_read,
42     source_finalize
43 };
44
45 GSource* watch_sys_create_source()
46 {
47     return g_source_new(&source_funcs, sizeof(GSource));
48 }
49
50 gpointer watch_sys_add_target(ObtWatchTarget *target)
51 {
52     return NULL;
53 }
54
55 void watch_sys_remove_target(ObtWatchTarget *target, gpointer data)
56 {
57 }
58
59 gpointer watch_sys_add_file(GSource *source,
60                             ObtWatchTarget *target,
61                             ObtWatchFile *file,
62                             gboolean is_dir)
63 {
64     return NULL;
65 }
66
67 void watch_sys_remove_file(GSource *source,
68                            ObtWatchTarget *target,
69                            ObtWatchFile *file,
70                            gpointer data)
71 {
72 }
73
74 static gboolean source_prepare(GSource *source, gint *timeout)
75 {
76     *timeout = -1;
77     return FALSE;
78 }
79
80 static gboolean source_check(GSource *source)
81 {
82     return FALSE;
83 }
84
85 static gboolean source_read(GSource *source, GSourceFunc cb, gpointer data)
86 {
87     return TRUE;
88 }
89
90 static void source_finalize(GSource *source)
91 {
92 }
93
94 #endif