36
36
static GtkMiscClass *parent_class;
39
meta_area_get_type (void)
41
static GType area_type = 0;
45
static const GtkTypeInfo area_info =
49
sizeof (MetaAreaClass),
50
(GtkClassInitFunc) meta_area_class_init,
51
(GtkObjectInitFunc) meta_area_init,
52
/* reserved_1 */ NULL,
53
/* reserved_2 */ NULL,
54
(GtkClassInitFunc) NULL,
57
area_type = gtk_type_unique (GTK_TYPE_MISC, &area_info);
38
G_DEFINE_TYPE (MetaArea, meta_area, GTK_TYPE_MISC);
64
41
meta_area_class_init (MetaAreaClass *class)
66
43
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
67
GtkObjectClass *object_class;
68
44
GtkWidgetClass *widget_class;
70
object_class = (GtkObjectClass*) class;
71
46
widget_class = (GtkWidgetClass*) class;
72
47
parent_class = g_type_class_peek (gtk_misc_get_type ());
111
86
GdkEventExpose *event)
89
GtkAllocation allocation;
90
GtkRequisition requisition;
94
gfloat xalign, yalign;
118
96
g_return_val_if_fail (META_IS_AREA (widget), FALSE);
119
97
g_return_val_if_fail (event != NULL, FALSE);
121
if (GTK_WIDGET_DRAWABLE (widget))
99
if (gtk_widget_is_drawable (widget))
123
101
area = META_AREA (widget);
124
102
misc = GTK_MISC (widget);
126
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
127
xalign = misc->xalign;
129
xalign = 1.0 - misc->xalign;
104
gtk_widget_get_allocation (widget, &allocation);
105
gtk_widget_get_requisition (widget, &requisition);
106
gtk_misc_get_alignment (misc, &xalign, &yalign);
107
gtk_misc_get_padding (misc, &xpad, &ypad);
109
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
110
xalign = 1.0 - xalign;
131
x = floor (widget->allocation.x + misc->xpad
132
+ ((widget->allocation.width - widget->requisition.width) * xalign)
112
x = floor (allocation.x + xpad
113
+ ((allocation.width - requisition.width) * xalign)
134
y = floor (widget->allocation.y + misc->ypad
135
+ ((widget->allocation.height - widget->requisition.height) * misc->yalign)
115
y = floor (allocation.y + ypad
116
+ ((allocation.height - requisition.height) * yalign)
138
119
if (area->expose_func)