[goocanvas] gtk4: GooCanvas: Implement measure() instead of get_preferred_width/height().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvas] gtk4: GooCanvas: Implement measure() instead of get_preferred_width/height().
- Date: Fri, 16 Dec 2016 09:21:23 +0000 (UTC)
commit 8571ab05bad51fce223fad7666ebb462bd82740e
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 15 14:20:50 2016 +0100
gtk4: GooCanvas: Implement measure() instead of get_preferred_width/height().
src/goocanvas.c | 39 +++++++++++++++++----------------------
1 files changed, 17 insertions(+), 22 deletions(-)
---
diff --git a/src/goocanvas.c b/src/goocanvas.c
index 4ecc268..422c385 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -171,12 +171,14 @@ static void goo_canvas_finalize (GObject *object);
static void goo_canvas_realize (GtkWidget *widget);
static void goo_canvas_unrealize (GtkWidget *widget);
static void goo_canvas_map (GtkWidget *widget);
-static void goo_canvas_get_preferred_width (GtkWidget *widget,
- gint *minimum,
- gint *natural);
-static void goo_canvas_get_preferred_height (GtkWidget *widget,
- gint *minimum,
- gint *natural);
+
+static void goo_canvas_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint for_size,
+ gint *minimum,
+ gint *natural,
+ gint *minimum_baseline,
+ gint *natural_baseline);
static void goo_canvas_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void goo_canvas_set_hadjustment (GooCanvas *canvas,
@@ -272,8 +274,7 @@ goo_canvas_class_init (GooCanvasClass *klass)
widget_class->realize = goo_canvas_realize;
widget_class->unrealize = goo_canvas_unrealize;
widget_class->map = goo_canvas_map;
- widget_class->get_preferred_width = goo_canvas_get_preferred_width;
- widget_class->get_preferred_height = goo_canvas_get_preferred_height;
+ widget_class->measure = goo_canvas_measure;
widget_class->size_allocate = goo_canvas_size_allocate;
widget_class->draw = goo_canvas_draw;
widget_class->button_press_event = goo_canvas_button_press;
@@ -1965,23 +1966,17 @@ reconfigure_canvas (GooCanvas *canvas,
static void
-goo_canvas_get_preferred_width (GtkWidget *widget,
- gint *minimal_width,
- gint *natural_width)
+goo_canvas_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint for_size,
+ gint *minimum,
+ gint *natural,
+ gint *minimum_baseline,
+ gint *natural_baseline)
{
- *minimal_width = *natural_width = 0;
+ *minimum = *natural = 0;
}
-
-static void
-goo_canvas_get_preferred_height (GtkWidget *widget,
- gint *minimal_height,
- gint *natural_height)
-{
- *minimal_height = *natural_height = 0;
-}
-
-
static void
goo_canvas_allocate_child_widget (GooCanvas *canvas,
GooCanvasWidget *witem)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]