mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
671292bbb2
This WIP patch moves the Windows Directory Monitoring code to the new GLocalFileMonitor mechanism, and adds file monitoring in the process. Progress from previous patch: -File renames are now properly supported, but G_FILE_MONITOR_EVENT_MOVED_IN and G_FILE_MONITOR_EVENT_MOVED_OUT needs to be investigated, as ReadDirectoryChangesW() seems to send FILE_ACTION_REMOVED when a file is moved out of a directory. -Events are handled for both the long and short (8.3) variants of the filenames, and files monitored will report changes when it is changed via its short or long filenames. Things to be done: -Perhaps find out about attribute changes in files in a monitored directory; if a file is monitored, attribute changes are correctly handled. -Investigate on G_FILE_MONITOR_EVENT_MOVED_OUT, G_FILE_MONITOR_EVENT_MOVED_IN, G_FILE_MONITOR_EVENT_PRE_UNMOUNT, G_FILE_MONITOR_EVENT_UNMOUNTED. -Investigate on the "boredom" algoritm, and see how we can do it on Windows. https://bugzilla.gnome.org/show_bug.cgi?id=730116
63 lines
2.3 KiB
C
63 lines
2.3 KiB
C
/* GIO - GLib Input, Output and Streaming Library
|
|
*
|
|
* Copyright (C) 2006-2007 Red Hat, Inc.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General
|
|
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Author: Chun-wei Fan <fanc999@yahoo.com.tw>
|
|
*
|
|
*/
|
|
#ifndef __G_WIN32_FILE_MONITOR_H__
|
|
#define __G_WIN32_FILE_MONITOR_H__
|
|
|
|
#include <glib.h>
|
|
#include <glib-object.h>
|
|
#include <gio/gio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "gio/gfilemonitor.h"
|
|
#include "gio/glocalfilemonitor.h"
|
|
#include "gio/giomodule.h"
|
|
|
|
#include "gwin32fsmonitorutils.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define G_TYPE_WIN32_FILE_MONITOR (g_win32_file_monitor_get_type ())
|
|
#define G_WIN32_FILE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_WIN32_FILE_MONITOR, GWin32FileMonitor))
|
|
#define G_WIN32_FILE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_WIN32_FILE_MONITOR, GWin32FileMonitorClass))
|
|
#define G_IS_WIN32_FILE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_WIN32_FILE_MONITOR))
|
|
#define G_IS_WIN32_FILE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_WIN32_FILE_MONITOR))
|
|
#define G_WIN32_FILE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_WIN32_FILE_MONITOR, GWin32FileMonitorClass))
|
|
|
|
typedef struct _GWin32FileMonitor GWin32FileMonitor;
|
|
typedef struct _GWin32FileMonitorClass GWin32FileMonitorClass;
|
|
typedef struct _GWin32FileMonitorPrivate GWin32FileMonitorPrivate;
|
|
|
|
struct _GWin32FileMonitor {
|
|
GLocalFileMonitor parent_instance;
|
|
GWin32FSMonitorPrivate * priv;
|
|
};
|
|
struct _GWin32FileMonitorClass {
|
|
GLocalFileMonitorClass parent_class;
|
|
};
|
|
|
|
GType g_win32_file_monitor_get_type (void);
|
|
void g_win32_file_monitor_register (GIOModule *module);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __G_WIN32_FILE_MONITOR_H__ */
|