summaryrefslogtreecommitdiff
path: root/src/eom-thumb-nav.c
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2013-10-04 12:07:29 +0200
committerraveit65 <[email protected]>2018-07-17 21:53:38 +0200
commit5a5612ab8ec4fb31464fa35e049a4a3b7cb64393 (patch)
tree0eee4a38e9d5f8f5d39beb5132c57a84c50a0e09 /src/eom-thumb-nav.c
parenta3c97eb293bfff825c43bd10d5584ae5a20f5495 (diff)
downloadeom-5a5612ab8ec4fb31464fa35e049a4a3b7cb64393.tar.bz2
eom-5a5612ab8ec4fb31464fa35e049a4a3b7cb64393.tar.xz
Convert to G_DEFINE_TYPE_WITH_PRIVATE part 1
origin commits: https://gitlab.gnome.org/GNOME/eog/commit/35c3864 https://gitlab.gnome.org/GNOME/eog/commit/842775b https://gitlab.gnome.org/GNOME/eog/commit/3fe0bd4 https://gitlab.gnome.org/GNOME/eog/commit/2b25632 https://gitlab.gnome.org/GNOME/eog/commit/f0c977d https://gitlab.gnome.org/GNOME/eog/commit/5cdb1b8 https://gitlab.gnome.org/GNOME/eog/commit/dba0bd4 https://gitlab.gnome.org/GNOME/eog/commit/8e31683 https://gitlab.gnome.org/GNOME/eog/commit/3945bb1
Diffstat (limited to 'src/eom-thumb-nav.c')
-rw-r--r--src/eom-thumb-nav.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/eom-thumb-nav.c b/src/eom-thumb-nav.c
index 73d2193..54da189 100644
--- a/src/eom-thumb-nav.c
+++ b/src/eom-thumb-nav.c
@@ -33,11 +33,6 @@
#include <math.h>
#include <string.h>
-#define EOM_THUMB_NAV_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_THUMB_NAV, EomThumbNavPrivate))
-
-G_DEFINE_TYPE (EomThumbNav, eom_thumb_nav, GTK_TYPE_BOX);
-
#define EOM_THUMB_NAV_SCROLL_INC 20
#define EOM_THUMB_NAV_SCROLL_MOVE 20
#define EOM_THUMB_NAV_SCROLL_TIMEOUT 20
@@ -65,6 +60,8 @@ struct _EomThumbNavPrivate {
GtkAdjustment *adj;
};
+G_DEFINE_TYPE_WITH_PRIVATE (EomThumbNav, eom_thumb_nav, GTK_TYPE_BOX);
+
static gboolean
eom_thumb_nav_scroll_event (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
@@ -122,7 +119,7 @@ eom_thumb_nav_adj_changed (GtkAdjustment *adj, gpointer user_data)
gboolean ltr;
nav = EOM_THUMB_NAV (user_data);
- priv = EOM_THUMB_NAV_GET_PRIVATE (nav);
+ priv = eom_thumb_nav_get_instance_private (nav);
ltr = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;
gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
@@ -139,7 +136,7 @@ eom_thumb_nav_adj_value_changed (GtkAdjustment *adj, gpointer user_data)
gboolean ltr;
nav = EOM_THUMB_NAV (user_data);
- priv = EOM_THUMB_NAV_GET_PRIVATE (nav);
+ priv = eom_thumb_nav_get_instance_private (nav);
ltr = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;
gtk_widget_set_sensitive (ltr ? priv->button_left : priv->button_right,
@@ -334,8 +331,6 @@ eom_thumb_nav_class_init (EomThumbNavClass *class)
EOM_THUMB_NAV_MODE_MULTIPLE_ROWS,
EOM_THUMB_NAV_MODE_ONE_ROW,
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_type_class_add_private (g_object_class, sizeof (EomThumbNavPrivate));
}
static void
@@ -347,7 +342,7 @@ eom_thumb_nav_init (EomThumbNav *nav)
gtk_orientable_set_orientation (GTK_ORIENTABLE (nav),
GTK_ORIENTATION_HORIZONTAL);
- nav->priv = EOM_THUMB_NAV_GET_PRIVATE (nav);
+ nav->priv = eom_thumb_nav_get_instance_private (nav);
priv = nav->priv;