gio: Rename GNetworkMonitorWindows to GWin32NetworkMonitor

This makes it more consistent with other GWin32* objects. No functional
changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=685442
This commit is contained in:
Philip Withnall 2018-01-17 12:58:40 +00:00
parent ba976f13b6
commit 3787e42932
3 changed files with 52 additions and 52 deletions

View File

@ -964,7 +964,7 @@ extern GType g_cocoa_notification_backend_get_type (void);
#ifdef G_PLATFORM_WIN32 #ifdef G_PLATFORM_WIN32
#include <windows.h> #include <windows.h>
extern GType _g_network_monitor_windows_get_type (void); extern GType _g_win32_network_monitor_get_type (void);
static HMODULE gio_dll = NULL; static HMODULE gio_dll = NULL;
@ -1182,7 +1182,7 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (_g_network_monitor_nm_get_type ()); g_type_ensure (_g_network_monitor_nm_get_type ());
#endif #endif
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
g_type_ensure (_g_network_monitor_windows_get_type ()); g_type_ensure (_g_win32_network_monitor_get_type ());
#endif #endif
} }

View File

@ -40,10 +40,10 @@
#include "gnetworkmonitor.h" #include "gnetworkmonitor.h"
#include "gioerror.h" #include "gioerror.h"
static void g_network_monitor_windows_iface_init (GNetworkMonitorInterface *iface); static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface);
static void g_network_monitor_windows_initable_iface_init (GInitableIface *iface); static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface);
struct _GNetworkMonitorWindowsPrivate struct _GWin32NetworkMonitorPrivate
{ {
gboolean initialized; gboolean initialized;
GError *init_error; GError *init_error;
@ -52,23 +52,23 @@ struct _GNetworkMonitorWindowsPrivate
HANDLE handle; HANDLE handle;
}; };
#define g_network_monitor_windows_get_type _g_network_monitor_windows_get_type #define g_win32_network_monitor_get_type _g_win32_network_monitor_get_type
G_DEFINE_TYPE_WITH_CODE (GNetworkMonitorWindows, g_network_monitor_windows, G_TYPE_NETWORK_MONITOR_BASE, G_DEFINE_TYPE_WITH_CODE (GWin32NetworkMonitor, g_win32_network_monitor, G_TYPE_NETWORK_MONITOR_BASE,
G_ADD_PRIVATE (GNetworkMonitorWindows) G_ADD_PRIVATE (GWin32NetworkMonitor)
G_IMPLEMENT_INTERFACE (G_TYPE_NETWORK_MONITOR, G_IMPLEMENT_INTERFACE (G_TYPE_NETWORK_MONITOR,
g_network_monitor_windows_iface_init) g_win32_network_monitor_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
g_network_monitor_windows_initable_iface_init) g_win32_network_monitor_initable_iface_init)
_g_io_modules_ensure_extension_points_registered (); _g_io_modules_ensure_extension_points_registered ();
g_io_extension_point_implement (G_NETWORK_MONITOR_EXTENSION_POINT_NAME, g_io_extension_point_implement (G_NETWORK_MONITOR_EXTENSION_POINT_NAME,
g_define_type_id, g_define_type_id,
"windows", "win32",
20)) 20))
static void static void
g_network_monitor_windows_init (GNetworkMonitorWindows *win) g_win32_network_monitor_init (GWin32NetworkMonitor *win)
{ {
win->priv = g_network_monitor_windows_get_instance_private (win); win->priv = g_win32_network_monitor_get_instance_private (win);
} }
static gboolean static gboolean
@ -118,7 +118,7 @@ get_network_mask (GSocketFamily family,
} }
static gboolean static gboolean
win_network_monitor_process_table (GNetworkMonitorWindows *win, win_network_monitor_process_table (GWin32NetworkMonitor *win,
GError **error) GError **error)
{ {
DWORD ret = 0; DWORD ret = 0;
@ -164,10 +164,10 @@ win_network_monitor_process_table (GNetworkMonitorWindows *win,
} }
static void static void
add_network (GNetworkMonitorWindows *win, add_network (GWin32NetworkMonitor *win,
GSocketFamily family, GSocketFamily family,
const guint8 *dest, const guint8 *dest,
gsize dest_len) gsize dest_len)
{ {
GInetAddressMask *network; GInetAddressMask *network;
@ -180,10 +180,10 @@ add_network (GNetworkMonitorWindows *win,
} }
static void static void
remove_network (GNetworkMonitorWindows *win, remove_network (GWin32NetworkMonitor *win,
GSocketFamily family, GSocketFamily family,
const guint8 *dest, const guint8 *dest,
gsize dest_len) gsize dest_len)
{ {
GInetAddressMask *network; GInetAddressMask *network;
@ -198,7 +198,7 @@ remove_network (GNetworkMonitorWindows *win,
typedef struct { typedef struct {
PMIB_IPFORWARD_ROW2 route; PMIB_IPFORWARD_ROW2 route;
MIB_NOTIFICATION_TYPE type; MIB_NOTIFICATION_TYPE type;
GNetworkMonitorWindows *win; GWin32NetworkMonitor *win;
} RouteData; } RouteData;
static gboolean static gboolean
@ -236,7 +236,7 @@ win_network_monitor_route_changed_cb (PVOID context,
PMIB_IPFORWARD_ROW2 route, PMIB_IPFORWARD_ROW2 route,
MIB_NOTIFICATION_TYPE type) MIB_NOTIFICATION_TYPE type)
{ {
GNetworkMonitorWindows *win = context; GWin32NetworkMonitor *win = context;
RouteData *route_data; RouteData *route_data;
route_data = g_new0 (RouteData, 1); route_data = g_new0 (RouteData, 1);
@ -255,11 +255,11 @@ win_network_monitor_route_changed_cb (PVOID context,
} }
static gboolean static gboolean
g_network_monitor_windows_initable_init (GInitable *initable, g_win32_network_monitor_initable_init (GInitable *initable,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GNetworkMonitorWindows *win = G_NETWORK_MONITOR_WINDOWS (initable); GWin32NetworkMonitor *win = G_WIN32_NETWORK_MONITOR (initable);
NTSTATUS status; NTSTATUS status;
gboolean read; gboolean read;
@ -292,9 +292,9 @@ g_network_monitor_windows_initable_init (GInitable *initable,
} }
static void static void
g_network_monitor_windows_finalize (GObject *object) g_win32_network_monitor_finalize (GObject *object)
{ {
GNetworkMonitorWindows *win = G_NETWORK_MONITOR_WINDOWS (object); GWin32NetworkMonitor *win = G_WIN32_NETWORK_MONITOR (object);
/* Cancel notification event */ /* Cancel notification event */
if (win->priv->handle) if (win->priv->handle)
@ -310,24 +310,24 @@ g_network_monitor_windows_finalize (GObject *object)
g_main_context_unref (win->priv->main_context); g_main_context_unref (win->priv->main_context);
G_OBJECT_CLASS (g_network_monitor_windows_parent_class)->finalize (object); G_OBJECT_CLASS (g_win32_network_monitor_parent_class)->finalize (object);
} }
static void static void
g_network_monitor_windows_class_init (GNetworkMonitorWindowsClass *win_class) g_win32_network_monitor_class_init (GWin32NetworkMonitorClass *win_class)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (win_class); GObjectClass *gobject_class = G_OBJECT_CLASS (win_class);
gobject_class->finalize = g_network_monitor_windows_finalize; gobject_class->finalize = g_win32_network_monitor_finalize;
} }
static void static void
g_network_monitor_windows_iface_init (GNetworkMonitorInterface *monitor_iface) g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface)
{ {
} }
static void static void
g_network_monitor_windows_initable_iface_init (GInitableIface *iface) g_win32_network_monitor_initable_iface_init (GInitableIface *iface)
{ {
iface->init = g_network_monitor_windows_initable_init; iface->init = g_win32_network_monitor_initable_init;
} }

View File

@ -18,36 +18,36 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __G_NETWORK_MONITOR_WINDOWS_H__ #ifndef __G_WIN32_NETWORK_MONITOR_H__
#define __G_NETWORK_MONITOR_WINDOWS_H__ #define __G_WIN32_NETWORK_MONITOR_H__
#include "gnetworkmonitorbase.h" #include "gnetworkmonitorbase.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define G_TYPE_NETWORK_MONITOR_WINDOWS (_g_network_monitor_windows_get_type ()) #define G_TYPE_WIN32_NETWORK_MONITOR (_g_win32_network_monitor_get_type ())
#define G_NETWORK_MONITOR_WINDOWS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_MONITOR_WINDOWS, GNetworkMonitorWindows)) #define G_WIN32_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_WIN32_NETWORK_MONITOR, GWin32NetworkMonitor))
#define G_NETWORK_MONITOR_WINDOWS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NETWORK_MONITOR_WINDOWS, GNetworkMonitorWindowsClass)) #define G_WIN32_NETWORK_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_WIN32_NETWORK_MONITOR, GWin32NetworkMonitorClass))
#define G_IS_NETWORK_MONITOR_WINDOWS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_MONITOR_WINDOWS)) #define G_IS_WIN32_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_WIN32_NETWORK_MONITOR))
#define G_IS_NETWORK_MONITOR_WINDOWS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_NETWORK_MONITOR_WINDOWS)) #define G_IS_WIN32_NETWORK_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_WIN32_NETWORK_MONITOR))
#define G_NETWORK_MONITOR_WINDOWS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_NETWORK_MONITOR_WINDOWS, GNetworkMonitorWindowsClass)) #define G_WIN32_NETWORK_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_WIN32_NETWORK_MONITOR, GWin32NetworkMonitorClass))
typedef struct _GNetworkMonitorWindows GNetworkMonitorWindows; typedef struct _GWin32NetworkMonitor GWin32NetworkMonitor;
typedef struct _GNetworkMonitorWindowsClass GNetworkMonitorWindowsClass; typedef struct _GWin32NetworkMonitorClass GWin32NetworkMonitorClass;
typedef struct _GNetworkMonitorWindowsPrivate GNetworkMonitorWindowsPrivate; typedef struct _GWin32NetworkMonitorPrivate GWin32NetworkMonitorPrivate;
struct _GNetworkMonitorWindows { struct _GWin32NetworkMonitor {
GNetworkMonitorBase parent_instance; GNetworkMonitorBase parent_instance;
GNetworkMonitorWindowsPrivate *priv; GWin32NetworkMonitorPrivate *priv;
}; };
struct _GNetworkMonitorWindowsClass { struct _GWin32NetworkMonitorClass {
GNetworkMonitorBaseClass parent_class; GNetworkMonitorBaseClass parent_class;
}; };
GType _g_network_monitor_windows_get_type (void); GType _g_win32_network_monitor_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __G_NETWORK_MONITOR_WINDOWS_H__ */ #endif /* __G_WIN32_NETWORK_MONITOR_H__ */