[virt-tools-list] [PATCH 02/22] Remove class signal handlers

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Tue Jul 31 13:24:42 UTC 2018


From: Marc-André Lureau <marcandre.lureau at redhat.com>

We don't use class signal handlers, remove the extra pointers.

g_signal_override_class_handler() could be used instead when needed.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/virt-viewer-display.c | 10 +++++-----
 src/virt-viewer-display.h |  8 --------
 src/virt-viewer-session.c | 26 +++++++++++++-------------
 src/virt-viewer-session.h | 19 -------------------
 4 files changed, 18 insertions(+), 45 deletions(-)

diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
index 2dbaba1..011328e 100644
--- a/src/virt-viewer-display.c
+++ b/src/virt-viewer-display.c
@@ -183,7 +183,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass *class)
     g_signal_new("display-pointer-grab",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -193,7 +193,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass *class)
     g_signal_new("display-pointer-ungrab",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -203,7 +203,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass *class)
     g_signal_new("display-keyboard-grab",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -213,7 +213,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass *class)
     g_signal_new("display-keyboard-ungrab",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -223,7 +223,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass *class)
     g_signal_new("display-desktop-resize",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
diff --git a/src/virt-viewer-display.h b/src/virt-viewer-display.h
index 7b55ca5..7016a85 100644
--- a/src/virt-viewer-display.h
+++ b/src/virt-viewer-display.h
@@ -82,14 +82,6 @@ struct _VirtViewerDisplayClass {
 
     void (*close)(VirtViewerDisplay *display);
     gboolean (*selectable)(VirtViewerDisplay *display);
-
-    /* signals */
-    void (*display_pointer_grab)(VirtViewerDisplay *display);
-    void (*display_pointer_ungrab)(VirtViewerDisplay *display);
-    void (*display_keyboard_grab)(VirtViewerDisplay *display);
-    void (*display_keyboard_ungrab)(VirtViewerDisplay *display);
-
-    void (*display_desktop_resize)(VirtViewerDisplay *display);
     void (*enable)(VirtViewerDisplay *display);
     void (*disable)(VirtViewerDisplay *display);
 };
diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
index 92ffd3f..5bac3d9 100644
--- a/src/virt-viewer-session.c
+++ b/src/virt-viewer-session.c
@@ -259,7 +259,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-connected",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected),
+                 0,
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE,
@@ -268,7 +268,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-initialized",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized),
+                 0,
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE,
@@ -277,7 +277,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-disconnected",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected),
+                 0,
                  NULL, NULL,
                  g_cclosure_marshal_VOID__STRING,
                  G_TYPE_NONE,
@@ -287,7 +287,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-channel-open",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open),
+                 0,
                  NULL, NULL,
                  g_cclosure_marshal_VOID__OBJECT,
                  G_TYPE_NONE,
@@ -297,7 +297,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-auth-refused",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__STRING,
@@ -308,7 +308,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-auth-unsupported",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_unsupported),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__STRING,
@@ -319,7 +319,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-usb-failed",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_usb_failed),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__STRING,
@@ -330,7 +330,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-display-added",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__OBJECT,
@@ -341,7 +341,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-display-removed",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__OBJECT,
@@ -352,7 +352,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-display-updated",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_updated),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -362,7 +362,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-cut-text",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__STRING,
@@ -373,7 +373,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-bell",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell),
+                 0,
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__VOID,
@@ -383,7 +383,7 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
     g_signal_new("session-cancelled",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cancelled),
+                 0,
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE,
diff --git a/src/virt-viewer-session.h b/src/virt-viewer-session.h
index 8ee4d8a..0aab8ca 100644
--- a/src/virt-viewer-session.h
+++ b/src/virt-viewer-session.h
@@ -75,25 +75,6 @@ struct _VirtViewerSessionClass {
     void (* smartcard_remove) (VirtViewerSession* session);
     const gchar* (* mime_type) (VirtViewerSession* session);
 
-    /* signals */
-    void (*session_connected)(VirtViewerSession *session);
-    void (*session_initialized)(VirtViewerSession *session);
-    void (*session_disconnected)(VirtViewerSession *session, const gchar *msg);
-    void (*session_auth_refused)(VirtViewerSession *session, const gchar *msg);
-    void (*session_auth_unsupported)(VirtViewerSession *session, const gchar *msg);
-    void (*session_usb_failed)(VirtViewerSession *session, const gchar *msg);
-
-    void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel);
-
-    void (*session_display_added)(VirtViewerSession *session,
-                                  VirtViewerDisplay *display);
-    void (*session_display_removed)(VirtViewerSession *session,
-                                    VirtViewerDisplay *display);
-    void (*session_display_updated)(VirtViewerSession *session);
-
-    void (*session_cut_text)(VirtViewerSession *session, const gchar *str);
-    void (*session_bell)(VirtViewerSession *session);
-    void (*session_cancelled)(VirtViewerSession *session);
     /* monitors = GHashTable<int, GdkRectangle*> */
     void (*apply_monitor_geometry)(VirtViewerSession *session, GHashTable* monitors);
     gboolean (*can_share_folder)(VirtViewerSession *session);
-- 
2.18.0.321.gffc6fa0e39




More information about the virt-tools-list mailing list