src: convert VirtViewerApp to G_DECLARE_DERIVABLE_TYPE

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-02-10 12:28:55 +00:00
parent 99f6cd7f87
commit e382c931fd
2 changed files with 212 additions and 162 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,18 +30,11 @@
G_BEGIN_DECLS
#define VIRT_VIEWER_TYPE_APP virt_viewer_app_get_type()
#define VIRT_VIEWER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_APP, VirtViewerApp))
#define VIRT_VIEWER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_APP, VirtViewerAppClass))
#define VIRT_VIEWER_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_APP))
#define VIRT_VIEWER_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_APP))
#define VIRT_VIEWER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_APP, VirtViewerAppClass))
typedef struct _VirtViewerAppPrivate VirtViewerAppPrivate;
typedef struct {
GtkApplication parent;
VirtViewerAppPrivate *priv;
} VirtViewerApp;
G_DECLARE_DERIVABLE_TYPE(VirtViewerApp,
virt_viewer_app,
VIRT_VIEWER,
APP,
GtkApplication)
typedef struct {
guint sourceKey;
@ -50,7 +43,7 @@ typedef struct {
gboolean isLast;
} VirtViewerKeyMapping;
typedef struct {
struct _VirtViewerAppClass {
GtkApplicationClass parent_class;
/*< private >*/
@ -60,7 +53,7 @@ typedef struct {
void (*deactivated) (VirtViewerApp *self, gboolean connect_error);
gboolean (*open_connection)(VirtViewerApp *self, int *fd);
void (*add_option_entries)(VirtViewerApp *self, GOptionContext *context, GOptionGroup *group);
} VirtViewerAppClass;
};
GType virt_viewer_app_get_type (void);