[glib] gio: Rename GNetworkMonitorWindows to GWin32NetworkMonitor



commit 3787e429320815378d480cc3a20de73931427e5e
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jan 17 12:58:40 2018 +0000

    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

 gio/giomodule.c            |    4 +-
 gio/gwin32networkmonitor.c |   68 ++++++++++++++++++++++----------------------
 gio/gwin32networkmonitor.h |   32 ++++++++++----------
 3 files changed, 52 insertions(+), 52 deletions(-)
---
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 1d8043d..1ead84c 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -964,7 +964,7 @@ extern GType g_cocoa_notification_backend_get_type (void);
 #ifdef G_PLATFORM_WIN32
 
 #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;
 
@@ -1182,7 +1182,7 @@ _g_io_modules_ensure_loaded (void)
       g_type_ensure (_g_network_monitor_nm_get_type ());
 #endif
 #ifdef G_OS_WIN32
-      g_type_ensure (_g_network_monitor_windows_get_type ());
+      g_type_ensure (_g_win32_network_monitor_get_type ());
 #endif
     }
 
diff --git a/gio/gwin32networkmonitor.c b/gio/gwin32networkmonitor.c
index 0e38b03..8380f01 100644
--- a/gio/gwin32networkmonitor.c
+++ b/gio/gwin32networkmonitor.c
@@ -40,10 +40,10 @@
 #include "gnetworkmonitor.h"
 #include "gioerror.h"
 
-static void g_network_monitor_windows_iface_init (GNetworkMonitorInterface *iface);
-static void g_network_monitor_windows_initable_iface_init (GInitableIface *iface);
+static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface);
+static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface);
 
-struct _GNetworkMonitorWindowsPrivate
+struct _GWin32NetworkMonitorPrivate
 {
   gboolean initialized;
   GError *init_error;
@@ -52,23 +52,23 @@ struct _GNetworkMonitorWindowsPrivate
   HANDLE handle;
 };
 
-#define g_network_monitor_windows_get_type _g_network_monitor_windows_get_type
-G_DEFINE_TYPE_WITH_CODE (GNetworkMonitorWindows, g_network_monitor_windows, G_TYPE_NETWORK_MONITOR_BASE,
-                         G_ADD_PRIVATE (GNetworkMonitorWindows)
+#define g_win32_network_monitor_get_type _g_win32_network_monitor_get_type
+G_DEFINE_TYPE_WITH_CODE (GWin32NetworkMonitor, g_win32_network_monitor, G_TYPE_NETWORK_MONITOR_BASE,
+                         G_ADD_PRIVATE (GWin32NetworkMonitor)
                          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_network_monitor_windows_initable_iface_init)
+                                                g_win32_network_monitor_initable_iface_init)
                          _g_io_modules_ensure_extension_points_registered ();
                          g_io_extension_point_implement (G_NETWORK_MONITOR_EXTENSION_POINT_NAME,
                                                          g_define_type_id,
-                                                         "windows",
+                                                         "win32",
                                                          20))
 
 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
@@ -118,7 +118,7 @@ get_network_mask (GSocketFamily  family,
 }
 
 static gboolean
-win_network_monitor_process_table (GNetworkMonitorWindows  *win,
+win_network_monitor_process_table (GWin32NetworkMonitor  *win,
                                    GError                 **error)
 {
   DWORD ret = 0;
@@ -164,10 +164,10 @@ win_network_monitor_process_table (GNetworkMonitorWindows  *win,
 }
 
 static void
-add_network (GNetworkMonitorWindows *win,
-             GSocketFamily           family,
-             const guint8           *dest,
-             gsize                   dest_len)
+add_network (GWin32NetworkMonitor *win,
+             GSocketFamily         family,
+             const guint8         *dest,
+             gsize                 dest_len)
 {
   GInetAddressMask *network;
 
@@ -180,10 +180,10 @@ add_network (GNetworkMonitorWindows *win,
 }
 
 static void
-remove_network (GNetworkMonitorWindows *win,
-                GSocketFamily           family,
-                const guint8           *dest,
-                gsize                   dest_len)
+remove_network (GWin32NetworkMonitor *win,
+                GSocketFamily         family,
+                const guint8         *dest,
+                gsize                 dest_len)
 {
   GInetAddressMask *network;
 
@@ -198,7 +198,7 @@ remove_network (GNetworkMonitorWindows *win,
 typedef struct {
   PMIB_IPFORWARD_ROW2 route;
   MIB_NOTIFICATION_TYPE type;
-  GNetworkMonitorWindows *win;
+  GWin32NetworkMonitor *win;
 } RouteData;
 
 static gboolean
@@ -236,7 +236,7 @@ win_network_monitor_route_changed_cb (PVOID                 context,
                                       PMIB_IPFORWARD_ROW2   route,
                                       MIB_NOTIFICATION_TYPE type)
 {
-  GNetworkMonitorWindows *win = context;
+  GWin32NetworkMonitor *win = context;
   RouteData *route_data;
 
   route_data = g_new0 (RouteData, 1);
@@ -255,11 +255,11 @@ win_network_monitor_route_changed_cb (PVOID                 context,
 }
 
 static gboolean
-g_network_monitor_windows_initable_init (GInitable     *initable,
-                                         GCancellable  *cancellable,
-                                         GError       **error)
+g_win32_network_monitor_initable_init (GInitable     *initable,
+                                       GCancellable  *cancellable,
+                                       GError       **error)
 {
-  GNetworkMonitorWindows *win = G_NETWORK_MONITOR_WINDOWS (initable);
+  GWin32NetworkMonitor *win = G_WIN32_NETWORK_MONITOR (initable);
   NTSTATUS status;
   gboolean read;
 
@@ -292,9 +292,9 @@ g_network_monitor_windows_initable_init (GInitable     *initable,
 }
 
 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 */
   if (win->priv->handle)
@@ -310,24 +310,24 @@ g_network_monitor_windows_finalize (GObject *object)
 
   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
-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);
 
-  gobject_class->finalize = g_network_monitor_windows_finalize;
+  gobject_class->finalize = g_win32_network_monitor_finalize;
 }
 
 static void
-g_network_monitor_windows_iface_init (GNetworkMonitorInterface *monitor_iface)
+g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface)
 {
 }
 
 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;
 }
diff --git a/gio/gwin32networkmonitor.h b/gio/gwin32networkmonitor.h
index ea8185f..49408cf 100644
--- a/gio/gwin32networkmonitor.h
+++ b/gio/gwin32networkmonitor.h
@@ -18,36 +18,36 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef __G_NETWORK_MONITOR_WINDOWS_H__
-#define __G_NETWORK_MONITOR_WINDOWS_H__
+#ifndef __G_WIN32_NETWORK_MONITOR_H__
+#define __G_WIN32_NETWORK_MONITOR_H__
 
 #include "gnetworkmonitorbase.h"
 
 G_BEGIN_DECLS
 
-#define G_TYPE_NETWORK_MONITOR_WINDOWS         (_g_network_monitor_windows_get_type ())
-#define G_NETWORK_MONITOR_WINDOWS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
G_TYPE_NETWORK_MONITOR_WINDOWS, GNetworkMonitorWindows))
-#define G_NETWORK_MONITOR_WINDOWS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NETWORK_MONITOR_WINDOWS, 
GNetworkMonitorWindowsClass))
-#define G_IS_NETWORK_MONITOR_WINDOWS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
G_TYPE_NETWORK_MONITOR_WINDOWS))
-#define G_IS_NETWORK_MONITOR_WINDOWS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), 
G_TYPE_NETWORK_MONITOR_WINDOWS))
-#define G_NETWORK_MONITOR_WINDOWS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
G_TYPE_NETWORK_MONITOR_WINDOWS, GNetworkMonitorWindowsClass))
+#define G_TYPE_WIN32_NETWORK_MONITOR         (_g_win32_network_monitor_get_type ())
+#define G_WIN32_NETWORK_MONITOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_WIN32_NETWORK_MONITOR, 
GWin32NetworkMonitor))
+#define G_WIN32_NETWORK_MONITOR_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_WIN32_NETWORK_MONITOR, 
GWin32NetworkMonitorClass))
+#define G_IS_WIN32_NETWORK_MONITOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_WIN32_NETWORK_MONITOR))
+#define G_IS_WIN32_NETWORK_MONITOR_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_WIN32_NETWORK_MONITOR))
+#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 _GNetworkMonitorWindowsClass   GNetworkMonitorWindowsClass;
-typedef struct _GNetworkMonitorWindowsPrivate GNetworkMonitorWindowsPrivate;
+typedef struct _GWin32NetworkMonitor        GWin32NetworkMonitor;
+typedef struct _GWin32NetworkMonitorClass   GWin32NetworkMonitorClass;
+typedef struct _GWin32NetworkMonitorPrivate GWin32NetworkMonitorPrivate;
 
-struct _GNetworkMonitorWindows {
+struct _GWin32NetworkMonitor {
   GNetworkMonitorBase parent_instance;
 
-  GNetworkMonitorWindowsPrivate *priv;
+  GWin32NetworkMonitorPrivate *priv;
 };
 
-struct _GNetworkMonitorWindowsClass {
+struct _GWin32NetworkMonitorClass {
   GNetworkMonitorBaseClass parent_class;
 };
 
-GType _g_network_monitor_windows_get_type (void);
+GType _g_win32_network_monitor_get_type (void);
 
 G_END_DECLS
 
-#endif /* __G_NETWORK_MONITOR_WINDOWS_H__ */
+#endif /* __G_WIN32_NETWORK_MONITOR_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]