[gtk+] drawingarea: Clean up
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] drawingarea: Clean up
- Date: Fri, 18 Nov 2016 05:41:57 +0000 (UTC)
commit 100ac17505d3210e2b6ebe44f7b1723b5c3e7972
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 18 02:35:05 2016 +0100
drawingarea: Clean up
No need to send configure events anymore and this should be a no-window
widget.
gtk/gtkdrawingarea.c | 77 +-------------------------------------------------
gtk/gtkdrawingarea.h | 3 --
2 files changed, 1 insertions(+), 79 deletions(-)
---
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index d9f3353..f89d78e 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -119,11 +119,6 @@
* gtk_render_focus() for one way to draw focus.
*/
-static void gtk_drawing_area_realize (GtkWidget *widget);
-static void gtk_drawing_area_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static void gtk_drawing_area_send_configure (GtkDrawingArea *darea);
-
G_DEFINE_TYPE (GtkDrawingArea, gtk_drawing_area, GTK_TYPE_WIDGET)
static void
@@ -131,16 +126,13 @@ gtk_drawing_area_class_init (GtkDrawingAreaClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- widget_class->realize = gtk_drawing_area_realize;
- widget_class->size_allocate = gtk_drawing_area_size_allocate;
-
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DRAWING_AREA);
}
static void
gtk_drawing_area_init (GtkDrawingArea *darea)
{
- gtk_widget_set_has_window (GTK_WIDGET (darea), TRUE);
+ gtk_widget_set_has_window (GTK_WIDGET (darea), FALSE);
}
/**
@@ -155,70 +147,3 @@ gtk_drawing_area_new (void)
{
return g_object_new (GTK_TYPE_DRAWING_AREA, NULL);
}
-
-static void
-gtk_drawing_area_realize (GtkWidget *widget)
-{
- GtkAllocation allocation;
- GdkWindow *window;
-
- if (!gtk_widget_get_has_window (widget))
- {
- GTK_WIDGET_CLASS (gtk_drawing_area_parent_class)->realize (widget);
- }
- else
- {
- gtk_widget_set_realized (widget, TRUE);
-
- gtk_widget_get_allocation (widget, &allocation);
-
- window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
- gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK,
- &allocation);
- gtk_widget_register_window (widget, window);
- gtk_widget_set_window (widget, window);
- }
-
- gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget));
-}
-
-static void
-gtk_drawing_area_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- g_return_if_fail (GTK_IS_DRAWING_AREA (widget));
- g_return_if_fail (allocation != NULL);
-
- gtk_widget_set_allocation (widget, allocation);
-
- if (gtk_widget_get_realized (widget))
- {
- if (gtk_widget_get_has_window (widget))
- gdk_window_move_resize (gtk_widget_get_window (widget),
- allocation->x, allocation->y,
- allocation->width, allocation->height);
-
- gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget));
- }
-}
-
-static void
-gtk_drawing_area_send_configure (GtkDrawingArea *darea)
-{
- GtkAllocation allocation;
- GtkWidget *widget;
- GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
-
- widget = GTK_WIDGET (darea);
- gtk_widget_get_allocation (widget, &allocation);
-
- event->configure.window = g_object_ref (gtk_widget_get_window (widget));
- event->configure.send_event = TRUE;
- event->configure.x = allocation.x;
- event->configure.y = allocation.y;
- event->configure.width = allocation.width;
- event->configure.height = allocation.height;
-
- gtk_widget_event (widget, event);
- gdk_event_free (event);
-}
diff --git a/gtk/gtkdrawingarea.h b/gtk/gtkdrawingarea.h
index 60cda59..8f889e4 100644
--- a/gtk/gtkdrawingarea.h
+++ b/gtk/gtkdrawingarea.h
@@ -49,9 +49,6 @@ typedef struct _GtkDrawingAreaClass GtkDrawingAreaClass;
struct _GtkDrawingArea
{
GtkWidget widget;
-
- /*< private >*/
- gpointer dummy;
};
struct _GtkDrawingAreaClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]