[gtk/wip/baedert/for-master] bin: Move vfunc implementations before class_init
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] bin: Move vfunc implementations before class_init
- Date: Thu, 7 Nov 2019 16:52:50 +0000 (UTC)
commit 1b05949ff057042b777431d1f74f5624d7de7ec9
Author: Timm Bäder <mail baedert org>
Date: Thu Nov 7 17:01:59 2019 +0100
bin: Move vfunc implementations before class_init
We can remove all the function prototypes this way.
gtk/gtkbin.c | 70 +++++++++++++++++++++++-------------------------------------
1 file changed, 27 insertions(+), 43 deletions(-)
---
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index 386ac55fd8..6f6e69974d 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -44,23 +44,6 @@ typedef struct
GtkWidget *child;
} GtkBinPrivate;
-static void gtk_bin_add (GtkContainer *container,
- GtkWidget *widget);
-static void gtk_bin_remove (GtkContainer *container,
- GtkWidget *widget);
-static void gtk_bin_forall (GtkContainer *container,
- GtkCallback callback,
- gpointer callback_data);
-static GType gtk_bin_child_type (GtkContainer *container);
-
-static void gtk_bin_measure (GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline);
-
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
static void
@@ -80,26 +63,6 @@ gtk_bin_size_allocate (GtkWidget *widget,
}, baseline);
}
-static void
-gtk_bin_class_init (GtkBinClass *class)
-{
- GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
- GtkContainerClass *container_class = (GtkContainerClass*) class;
-
- widget_class->measure = gtk_bin_measure;
- widget_class->size_allocate = gtk_bin_size_allocate;
-
- container_class->add = gtk_bin_add;
- container_class->remove = gtk_bin_remove;
- container_class->forall = gtk_bin_forall;
- container_class->child_type = gtk_bin_child_type;
-}
-
-static void
-gtk_bin_init (GtkBin *bin)
-{
-}
-
static GType
gtk_bin_child_type (GtkContainer *container)
{
@@ -113,7 +76,7 @@ gtk_bin_child_type (GtkContainer *container)
static void
gtk_bin_add (GtkContainer *container,
- GtkWidget *child)
+ GtkWidget *child)
{
GtkBin *bin = GTK_BIN (container);
GtkBinPrivate *priv = gtk_bin_get_instance_private (bin);
@@ -136,7 +99,7 @@ gtk_bin_add (GtkContainer *container,
static void
gtk_bin_remove (GtkContainer *container,
- GtkWidget *child)
+ GtkWidget *child)
{
GtkBin *bin = GTK_BIN (container);
GtkBinPrivate *priv = gtk_bin_get_instance_private (bin);
@@ -145,10 +108,10 @@ gtk_bin_remove (GtkContainer *container,
g_return_if_fail (priv->child == child);
widget_was_visible = gtk_widget_get_visible (child);
-
+
gtk_widget_unparent (child);
priv->child = NULL;
-
+
/* queue resize regardless of gtk_widget_get_visible (container),
* since that's what is needed by toplevels, which derive from GtkBin.
*/
@@ -158,8 +121,8 @@ gtk_bin_remove (GtkContainer *container,
static void
gtk_bin_forall (GtkContainer *container,
- GtkCallback callback,
- gpointer callback_data)
+ GtkCallback callback,
+ gpointer callback_data)
{
GtkBin *bin = GTK_BIN (container);
GtkBinPrivate *priv = gtk_bin_get_instance_private (bin);
@@ -194,6 +157,27 @@ gtk_bin_measure (GtkWidget *widget,
}
}
+
+static void
+gtk_bin_class_init (GtkBinClass *class)
+{
+ GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
+ GtkContainerClass *container_class = (GtkContainerClass*) class;
+
+ widget_class->measure = gtk_bin_measure;
+ widget_class->size_allocate = gtk_bin_size_allocate;
+
+ container_class->add = gtk_bin_add;
+ container_class->remove = gtk_bin_remove;
+ container_class->forall = gtk_bin_forall;
+ container_class->child_type = gtk_bin_child_type;
+}
+
+static void
+gtk_bin_init (GtkBin *bin)
+{
+}
+
/**
* gtk_bin_get_child:
* @bin: a #GtkBin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]