Commit bf454012 authored by Guido Gunther's avatar Guido Gunther

lockscreen: use G_DECLARE_FINAL_TYPE

instead of open coding lots of things
parent d71c89b6
......@@ -14,19 +14,18 @@ enum {
};
static guint signals[N_SIGNALS] = { 0 };
struct PhoshLockscreenPrivate {
gint _dummy;
};
G_DEFINE_TYPE(PhoshLockscreen, phosh_lockscreen, GTK_TYPE_WINDOW)
static void
phosh_lockscreen_init (PhoshLockscreen *self)
typedef struct _PhoshLockscreen
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
PHOSH_LOCKSCREEN_TYPE,
PhoshLockscreenPrivate);
}
GtkWindow parent;
} PhoshLockscreen;
typedef struct PhoshLockscreen {
gint _dummy;
} PhoshLockscreenPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (PhoshLockscreen, phosh_lockscreen, GTK_TYPE_WINDOW)
/* FIXME: Temporarily add a button until we interface with pam */
......@@ -89,10 +88,15 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
signals[LOCKSCREEN_UNLOCK] = g_signal_new ("lockscreen-unlock",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
NULL, G_TYPE_NONE, 0);
}
g_type_class_add_private (object_class, sizeof (PhoshLockscreenPrivate));
static void
phosh_lockscreen_init (PhoshLockscreen *self)
{
}
GtkWidget *
phosh_lockscreen_new (void)
{
......
......@@ -10,29 +10,8 @@
#include <gtk/gtk.h>
#define PHOSH_LOCKSCREEN_TYPE (phosh_lockscreen_get_type ())
#define PHOSH_LOCKSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOSH_LOCKSCREEN_TYPE, PhoshLockscreen))
#define PHOSH_LOCKSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOSH_LOCKSCREEN_TYPE, PhoshLockscreenClass))
#define PHOSH_IS_LOCKSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOSH_LOCKSCREEN_TYPE))
#define PHOSH_IS_LOCKSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOSH_LOCKSCREEN_TYPE))
#define PHOSH_LOCKSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOSH_LOCKSCREEN_TYPE, PhoshLockscreenClass))
typedef struct PhoshLockscreen PhoshLockscreen;
typedef struct PhoshLockscreenClass PhoshLockscreenClass;
typedef struct PhoshLockscreenPrivate PhoshLockscreenPrivate;
struct PhoshLockscreen
{
GtkWindow parent;
PhoshLockscreenPrivate *priv;
};
struct PhoshLockscreenClass
{
GtkWindowClass parent_class;
};
GType phosh_lockscreen_get_type (void) G_GNUC_CONST;
G_DECLARE_FINAL_TYPE (PhoshLockscreen, phosh_lockscreen, PHOSH, LOCKSCREEN, GtkWindow)
GtkWidget * phosh_lockscreen_new (void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment