10 gtk_zoom_draw (GtkWidget *widget,
13 gtk_zoom_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
15 gtk_zoom_get_preferred_width (GtkWidget *widget,
19 gtk_zoom_get_preferred_height (GtkWidget *widget,
23 G_DEFINE_TYPE (GtkZoom, gtk_zoom, GTK_TYPE_BIN)
26 gtk_zoom_class_init (GtkZoomClass *class)
28 GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
30 widget_class->draw = gtk_zoom_draw;
31 widget_class->size_allocate = gtk_zoom_size_allocate;
32 widget_class->get_preferred_width = gtk_zoom_get_preferred_width;
33 widget_class->get_preferred_height = gtk_zoom_get_preferred_height;
36 g_type_class_add_private (class, sizeof (GtkZoomPrivate));
40 gtk_zoom_init (GtkZoom *zoom)
44 zoom->priv = G_TYPE_INSTANCE_GET_PRIVATE (zoom,
53 return g_object_new (GTK_TYPE_ZOOM, NULL);
58 gtk_zoom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
60 GtkWidget *main_widget;
62 GTK_WIDGET_CLASS (gtk_zoom_parent_class)->size_allocate (widget, allocation);
64 main_widget = gtk_bin_get_child (GTK_BIN (widget));
65 if (!main_widget || !gtk_widget_get_visible (main_widget))
68 gtk_widget_size_allocate (main_widget, allocation);
72 gtk_zoom_get_preferred_width (GtkWidget *widget,
76 GtkBin *bin = GTK_BIN (widget);
85 child = gtk_bin_get_child (bin);
86 if (child && gtk_widget_get_visible (child))
87 gtk_widget_get_preferred_width (child, minimum, natural);
91 gtk_zoom_get_preferred_height (GtkWidget *widget,
95 GtkBin *bin = GTK_BIN (widget);
104 child = gtk_bin_get_child (bin);
105 if (child && gtk_widget_get_visible (child))
106 gtk_widget_get_preferred_height (child, minimum, natural);
112 gtk_zoom_draw (GtkWidget *widget, cairo_t *cr)
115 child = gtk_bin_get_child (GTK_BIN(widget));
118 cairo_scale(cr, 2, 2);
119 gtk_widget_draw(child, cr);
123 //GTK_WIDGET_CLASS (gtk_zoom_parent_class)->draw (widget, cr);