[gnome-photos/gnome-3-16] spinner-box: Make it a final class
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-16] spinner-box: Make it a final class
- Date: Fri, 13 Mar 2015 06:35:31 +0000 (UTC)
commit eef70202fb9da2e0a3792e0f1e3d5144c71f370a
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Mar 12 23:50:44 2015 +0100
spinner-box: Make it a final class
src/photos-spinner-box.c | 28 ++++++++++++++++------------
src/photos-spinner-box.h | 28 ++--------------------------
2 files changed, 18 insertions(+), 38 deletions(-)
---
diff --git a/src/photos-spinner-box.c b/src/photos-spinner-box.c
index 31a5a76..e70ebb7 100644
--- a/src/photos-spinner-box.c
+++ b/src/photos-spinner-box.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013, 2014 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014, 2015 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -31,28 +31,33 @@
#include "photos-spinner-box.h"
-struct _PhotosSpinnerBoxPrivate
+struct _PhotosSpinnerBox
{
+ GtkRevealer parent_instance;
GtkWidget *spinner;
};
+struct _PhotosSpinnerBoxClass
+{
+ GtkRevealerClass parent_class;
+};
+
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosSpinnerBox, photos_spinner_box, GTK_TYPE_REVEALER);
+G_DEFINE_TYPE (PhotosSpinnerBox, photos_spinner_box, GTK_TYPE_REVEALER);
static void
photos_spinner_box_constructed (GObject *object)
{
PhotosSpinnerBox *self = PHOTOS_SPINNER_BOX (object);
- PhotosSpinnerBoxPrivate *priv = self->priv;
G_OBJECT_CLASS (photos_spinner_box_parent_class)->constructed (object);
- priv->spinner = gtk_spinner_new ();
- gtk_widget_set_size_request (priv->spinner, 128, 128);
- gtk_widget_set_halign (priv->spinner, GTK_ALIGN_CENTER);
- gtk_widget_set_valign (priv->spinner, GTK_ALIGN_CENTER);
- gtk_container_add (GTK_CONTAINER (self), priv->spinner);
+ self->spinner = gtk_spinner_new ();
+ gtk_widget_set_size_request (self->spinner, 128, 128);
+ gtk_widget_set_halign (self->spinner, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (self->spinner, GTK_ALIGN_CENTER);
+ gtk_container_add (GTK_CONTAINER (self), self->spinner);
gtk_widget_show_all (GTK_WIDGET (self));
}
@@ -61,7 +66,6 @@ photos_spinner_box_constructed (GObject *object)
static void
photos_spinner_box_init (PhotosSpinnerBox *self)
{
- self->priv = photos_spinner_box_get_instance_private (self);
}
@@ -89,7 +93,7 @@ void
photos_spinner_box_start (PhotosSpinnerBox *self)
{
gtk_revealer_set_reveal_child (GTK_REVEALER (self), TRUE);
- gtk_spinner_start (GTK_SPINNER (self->priv->spinner));
+ gtk_spinner_start (GTK_SPINNER (self->spinner));
}
@@ -97,5 +101,5 @@ void
photos_spinner_box_stop (PhotosSpinnerBox *self)
{
gtk_revealer_set_reveal_child (GTK_REVEALER (self), FALSE);
- gtk_spinner_stop (GTK_SPINNER (self->priv->spinner));
+ gtk_spinner_stop (GTK_SPINNER (self->spinner));
}
diff --git a/src/photos-spinner-box.h b/src/photos-spinner-box.h
index 481e437..6c06776 100644
--- a/src/photos-spinner-box.h
+++ b/src/photos-spinner-box.h
@@ -35,36 +35,12 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
PHOTOS_TYPE_SPINNER_BOX, PhotosSpinnerBox))
-#define PHOTOS_SPINNER_BOX_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), \
- PHOTOS_TYPE_SPINNER_BOX, PhotosSpinnerBoxClass))
-
#define PHOTOS_IS_SPINNER_BOX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
PHOTOS_TYPE_SPINNER_BOX))
-#define PHOTOS_IS_SPINNER_BOX_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), \
- PHOTOS_TYPE_SPINNER_BOX))
-
-#define PHOTOS_SPINNER_BOX_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- PHOTOS_TYPE_SPINNER_BOX, PhotosSpinnerBoxClass))
-
-typedef struct _PhotosSpinnerBox PhotosSpinnerBox;
-typedef struct _PhotosSpinnerBoxClass PhotosSpinnerBoxClass;
-typedef struct _PhotosSpinnerBoxPrivate PhotosSpinnerBoxPrivate;
-
-struct _PhotosSpinnerBox
-{
- GtkRevealer parent_instance;
- PhotosSpinnerBoxPrivate *priv;
-};
-
-struct _PhotosSpinnerBoxClass
-{
- GtkRevealerClass parent_class;
-};
+typedef struct _PhotosSpinnerBox PhotosSpinnerBox;
+typedef struct _PhotosSpinnerBoxClass PhotosSpinnerBoxClass;
GType photos_spinner_box_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]