]> Pileus Git - ~andy/gtk/blob - gtk/gtkframe.c
Boilerplate reduction
[~andy/gtk] / gtk / gtkframe.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #include <config.h>
28 #include <string.h>
29 #include "gtkframe.h"
30 #include "gtklabel.h"
31 #include "gtkprivate.h"
32 #include "gtkintl.h"
33 #include "gtkalias.h"
34
35 #define LABEL_PAD 1
36 #define LABEL_SIDE_PAD 2
37
38 enum {
39   PROP_0,
40   PROP_LABEL,
41   PROP_LABEL_XALIGN,
42   PROP_LABEL_YALIGN,
43   PROP_SHADOW,
44   PROP_SHADOW_TYPE,
45   PROP_LABEL_WIDGET
46 };
47
48 static void gtk_frame_set_property (GObject      *object,
49                                     guint         param_id,
50                                     const GValue *value,
51                                     GParamSpec   *pspec);
52 static void gtk_frame_get_property (GObject     *object,
53                                     guint        param_id,
54                                     GValue      *value,
55                                     GParamSpec  *pspec);
56 static void gtk_frame_paint         (GtkWidget      *widget,
57                                      GdkRectangle   *area);
58 static gint gtk_frame_expose        (GtkWidget      *widget,
59                                      GdkEventExpose *event);
60 static void gtk_frame_size_request  (GtkWidget      *widget,
61                                      GtkRequisition *requisition);
62 static void gtk_frame_size_allocate (GtkWidget      *widget,
63                                      GtkAllocation  *allocation);
64 static void gtk_frame_remove        (GtkContainer   *container,
65                                      GtkWidget      *child);
66 static void gtk_frame_forall        (GtkContainer   *container,
67                                      gboolean        include_internals,
68                                      GtkCallback     callback,
69                                      gpointer        callback_data);
70
71 static void gtk_frame_compute_child_allocation      (GtkFrame      *frame,
72                                                      GtkAllocation *child_allocation);
73 static void gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
74                                                      GtkAllocation *child_allocation);
75
76 G_DEFINE_TYPE (GtkFrame, gtk_frame, GTK_TYPE_BIN);
77
78 static void
79 gtk_frame_class_init (GtkFrameClass *class)
80 {
81   GObjectClass *gobject_class;
82   GtkWidgetClass *widget_class;
83   GtkContainerClass *container_class;
84
85   gobject_class = (GObjectClass*) class;
86   widget_class = GTK_WIDGET_CLASS (class);
87   container_class = GTK_CONTAINER_CLASS (class);
88
89   gobject_class->set_property = gtk_frame_set_property;
90   gobject_class->get_property = gtk_frame_get_property;
91
92   g_object_class_install_property (gobject_class,
93                                    PROP_LABEL,
94                                    g_param_spec_string ("label",
95                                                         P_("Label"),
96                                                         P_("Text of the frame's label"),
97                                                         NULL,
98                                                         GTK_PARAM_READABLE |
99                                                         GTK_PARAM_WRITABLE));
100   g_object_class_install_property (gobject_class,
101                                    PROP_LABEL_XALIGN,
102                                    g_param_spec_float ("label-xalign",
103                                                        P_("Label xalign"),
104                                                        P_("The horizontal alignment of the label"),
105                                                        0.0,
106                                                        1.0,
107                                                        0.5,
108                                                        GTK_PARAM_READWRITE));
109   g_object_class_install_property (gobject_class,
110                                    PROP_LABEL_YALIGN,
111                                    g_param_spec_float ("label-yalign",
112                                                        P_("Label yalign"),
113                                                        P_("The vertical alignment of the label"),
114                                                        0.0,
115                                                        1.0,
116                                                        0.5,
117                                                        GTK_PARAM_READWRITE));
118   g_object_class_install_property (gobject_class,
119                                    PROP_SHADOW,
120                                    g_param_spec_enum ("shadow", NULL,
121                                                       P_("Deprecated property, use shadow_type instead"),
122                                                       GTK_TYPE_SHADOW_TYPE,
123                                                       GTK_SHADOW_ETCHED_IN,
124                                                       GTK_PARAM_READWRITE));
125   g_object_class_install_property (gobject_class,
126                                    PROP_SHADOW_TYPE,
127                                    g_param_spec_enum ("shadow-type",
128                                                       P_("Frame shadow"),
129                                                       P_("Appearance of the frame border"),
130                                                       GTK_TYPE_SHADOW_TYPE,
131                                                       GTK_SHADOW_ETCHED_IN,
132                                                       GTK_PARAM_READWRITE));
133
134   g_object_class_install_property (gobject_class,
135                                    PROP_LABEL_WIDGET,
136                                    g_param_spec_object ("label-widget",
137                                                         P_("Label widget"),
138                                                         P_("A widget to display in place of the usual frame label"),
139                                                         GTK_TYPE_WIDGET,
140                                                         GTK_PARAM_READWRITE));
141   
142   widget_class->expose_event = gtk_frame_expose;
143   widget_class->size_request = gtk_frame_size_request;
144   widget_class->size_allocate = gtk_frame_size_allocate;
145
146   container_class->remove = gtk_frame_remove;
147   container_class->forall = gtk_frame_forall;
148
149   class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
150 }
151
152 static void
153 gtk_frame_init (GtkFrame *frame)
154 {
155   frame->label_widget = NULL;
156   frame->shadow_type = GTK_SHADOW_ETCHED_IN;
157   frame->label_xalign = 0.0;
158   frame->label_yalign = 0.5;
159 }
160
161 static void 
162 gtk_frame_set_property (GObject         *object,
163                         guint            prop_id,
164                         const GValue    *value,
165                         GParamSpec      *pspec)
166 {
167   GtkFrame *frame;
168
169   frame = GTK_FRAME (object);
170
171   switch (prop_id)
172     {
173     case PROP_LABEL:
174       gtk_frame_set_label (frame, g_value_get_string (value));
175       break;
176     case PROP_LABEL_XALIGN:
177       gtk_frame_set_label_align (frame, g_value_get_float (value), 
178                                  frame->label_yalign);
179       break;
180     case PROP_LABEL_YALIGN:
181       gtk_frame_set_label_align (frame, frame->label_xalign, 
182                                  g_value_get_float (value));
183       break;
184     case PROP_SHADOW:
185     case PROP_SHADOW_TYPE:
186       gtk_frame_set_shadow_type (frame, g_value_get_enum (value));
187       break;
188     case PROP_LABEL_WIDGET:
189       gtk_frame_set_label_widget (frame, g_value_get_object (value));
190       break;
191     default:      
192       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
193       break;
194     }
195 }
196
197 static void 
198 gtk_frame_get_property (GObject         *object,
199                         guint            prop_id,
200                         GValue          *value,
201                         GParamSpec      *pspec)
202 {
203   GtkFrame *frame;
204
205   frame = GTK_FRAME (object);
206
207   switch (prop_id)
208     {
209     case PROP_LABEL:
210       g_value_set_string (value, gtk_frame_get_label (frame));
211       break;
212     case PROP_LABEL_XALIGN:
213       g_value_set_float (value, frame->label_xalign);
214       break;
215     case PROP_LABEL_YALIGN:
216       g_value_set_float (value, frame->label_yalign);
217       break;
218     case PROP_SHADOW:
219     case PROP_SHADOW_TYPE:
220       g_value_set_enum (value, frame->shadow_type);
221       break;
222     case PROP_LABEL_WIDGET:
223       g_value_set_object (value,
224                           frame->label_widget ?
225                           G_OBJECT (frame->label_widget) : NULL);
226       break;
227     default:
228       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
229       break;
230     }
231 }
232
233 /**
234  * gtk_frame_new:
235  * @label: the text to use as the label of the frame
236  * 
237  * Creates a new #GtkFrame, with optional label @label.
238  * If @label is %NULL, the label is omitted.
239  * 
240  * Return value: a new #GtkFrame widget
241  **/
242 GtkWidget*
243 gtk_frame_new (const gchar *label)
244 {
245   return g_object_new (GTK_TYPE_FRAME, "label", label, NULL);
246 }
247
248 static void
249 gtk_frame_remove (GtkContainer *container,
250                   GtkWidget    *child)
251 {
252   GtkFrame *frame = GTK_FRAME (container);
253
254   if (frame->label_widget == child)
255     gtk_frame_set_label_widget (frame, NULL);
256   else
257     GTK_CONTAINER_CLASS (gtk_frame_parent_class)->remove (container, child);
258 }
259
260 static void
261 gtk_frame_forall (GtkContainer *container,
262                   gboolean      include_internals,
263                   GtkCallback   callback,
264                   gpointer      callback_data)
265 {
266   GtkBin *bin = GTK_BIN (container);
267   GtkFrame *frame = GTK_FRAME (container);
268
269   if (bin->child)
270     (* callback) (bin->child, callback_data);
271
272   if (frame->label_widget)
273     (* callback) (frame->label_widget, callback_data);
274 }
275
276 /**
277  * gtk_frame_set_label:
278  * @frame: a #GtkFrame
279  * @label: the text to use as the label of the frame
280  * 
281  * Sets the text of the label. If @label is %NULL,
282  * the current label is removed.
283  **/
284 void
285 gtk_frame_set_label (GtkFrame *frame,
286                      const gchar *label)
287 {
288   g_return_if_fail (GTK_IS_FRAME (frame));
289
290   if (!label)
291     {
292       gtk_frame_set_label_widget (frame, NULL);
293     }
294   else
295     {
296       GtkWidget *child = gtk_label_new (label);
297       gtk_widget_show (child);
298
299       gtk_frame_set_label_widget (frame, child);
300     }
301 }
302
303 /**
304  * gtk_frame_get_label:
305  * @frame: a #GtkFrame
306  * 
307  * If the frame's label widget is a #GtkLabel, returns the
308  * text in the label widget. (The frame will have a #GtkLabel
309  * for the label widget if a non-%NULL argument was passed
310  * to gtk_frame_new().)
311  * 
312  * Return value: the text in the label, or %NULL if there
313  *               was no label widget or the lable widget was not
314  *               a #GtkLabel. This string is owned by GTK+ and
315  *               must not be modified or freed.
316  **/
317 G_CONST_RETURN gchar *
318 gtk_frame_get_label (GtkFrame *frame)
319 {
320   g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
321
322   if (frame->label_widget && GTK_IS_LABEL (frame->label_widget))
323     return gtk_label_get_text (GTK_LABEL (frame->label_widget));
324   else
325     return NULL;
326 }
327
328 /**
329  * gtk_frame_set_label_widget:
330  * @frame: a #GtkFrame
331  * @label_widget: the new label widget
332  * 
333  * Sets the label widget for the frame. This is the widget that
334  * will appear embedded in the top edge of the frame as a
335  * title.
336  **/
337 void
338 gtk_frame_set_label_widget (GtkFrame  *frame,
339                             GtkWidget *label_widget)
340 {
341   gboolean need_resize = FALSE;
342   
343   g_return_if_fail (GTK_IS_FRAME (frame));
344   g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
345   g_return_if_fail (label_widget == NULL || label_widget->parent == NULL);
346   
347   if (frame->label_widget == label_widget)
348     return;
349   
350   if (frame->label_widget)
351     {
352       need_resize = GTK_WIDGET_VISIBLE (frame->label_widget);
353       gtk_widget_unparent (frame->label_widget);
354     }
355
356   frame->label_widget = label_widget;
357     
358   if (label_widget)
359     {
360       frame->label_widget = label_widget;
361       gtk_widget_set_parent (label_widget, GTK_WIDGET (frame));
362       need_resize |= GTK_WIDGET_VISIBLE (label_widget);
363     }
364   
365   if (GTK_WIDGET_VISIBLE (frame) && need_resize)
366     gtk_widget_queue_resize (GTK_WIDGET (frame));
367
368   g_object_freeze_notify (G_OBJECT (frame));
369   g_object_notify (G_OBJECT (frame), "label-widget");
370   g_object_notify (G_OBJECT (frame), "label");
371   g_object_thaw_notify (G_OBJECT (frame));
372 }
373
374 /**
375  * gtk_frame_get_label_widget:
376  * @frame: a #GtkFrame
377  *
378  * Retrieves the label widget for the frame. See
379  * gtk_frame_set_label_widget().
380  *
381  * Return value: the label widget, or %NULL if there is none.
382  **/
383 GtkWidget *
384 gtk_frame_get_label_widget (GtkFrame *frame)
385 {
386   g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
387
388   return frame->label_widget;
389 }
390
391 /**
392  * gtk_frame_set_label_align:
393  * @frame: a #GtkFrame
394  * @xalign: The position of the label along the top edge
395  *   of the widget. A value of 0.0 represents left alignment;
396  *   1.0 represents right alignment.
397  * @yalign: The y alignment of the label. A value of 0.0 aligns under 
398  *   the frame; 1.0 aligns above the frame.
399  * 
400  * Sets the alignment of the frame widget's label. The
401  * default values for a newly created frame are 0.0 and 0.5.
402  **/
403 void
404 gtk_frame_set_label_align (GtkFrame *frame,
405                            gfloat    xalign,
406                            gfloat    yalign)
407 {
408   g_return_if_fail (GTK_IS_FRAME (frame));
409
410   xalign = CLAMP (xalign, 0.0, 1.0);
411   yalign = CLAMP (yalign, 0.0, 1.0);
412
413   g_object_freeze_notify (G_OBJECT (frame));
414   if (xalign != frame->label_xalign)
415     {
416       frame->label_xalign = xalign;
417       g_object_notify (G_OBJECT (frame), "label-xalign");
418     }
419
420   if (yalign != frame->label_yalign)
421     {
422       frame->label_yalign = yalign;
423       g_object_notify (G_OBJECT (frame), "label-yalign");
424     }
425
426   g_object_thaw_notify (G_OBJECT (frame));
427   gtk_widget_queue_resize (GTK_WIDGET (frame));
428 }
429
430 /**
431  * gtk_frame_get_label_align:
432  * @frame: a #GtkFrame
433  * @xalign: location to store X alignment of frame's label, or %NULL
434  * @yalign: location to store X alignment of frame's label, or %NULL
435  * 
436  * Retrieves the X and Y alignment of the frame's label. See
437  * gtk_frame_set_label_align().
438  **/
439 void
440 gtk_frame_get_label_align (GtkFrame *frame,
441                            gfloat   *xalign,
442                            gfloat   *yalign)
443 {
444   g_return_if_fail (GTK_IS_FRAME (frame));
445
446   if (xalign)
447     *xalign = frame->label_xalign;
448   if (yalign)
449     *yalign = frame->label_yalign;
450 }
451
452 /**
453  * gtk_frame_set_shadow_type:
454  * @frame: a #GtkFrame
455  * @type: the new #GtkShadowType
456  * 
457  * Sets the shadow type for @frame.
458  **/
459 void
460 gtk_frame_set_shadow_type (GtkFrame      *frame,
461                            GtkShadowType  type)
462 {
463   g_return_if_fail (GTK_IS_FRAME (frame));
464
465   if ((GtkShadowType) frame->shadow_type != type)
466     {
467       frame->shadow_type = type;
468       g_object_notify (G_OBJECT (frame), "shadow-type");
469
470       if (GTK_WIDGET_DRAWABLE (frame))
471         {
472           gtk_widget_queue_draw (GTK_WIDGET (frame));
473         }
474       
475       gtk_widget_queue_resize (GTK_WIDGET (frame));
476     }
477 }
478
479 /**
480  * gtk_frame_get_shadow_type:
481  * @frame: a #GtkFrame
482  *
483  * Retrieves the shadow type of the frame. See
484  * gtk_frame_set_shadow_type().
485  *
486  * Return value: the current shadow type of the frame.
487  **/
488 GtkShadowType
489 gtk_frame_get_shadow_type (GtkFrame *frame)
490 {
491   g_return_val_if_fail (GTK_IS_FRAME (frame), GTK_SHADOW_ETCHED_IN);
492
493   return frame->shadow_type;
494 }
495
496 static void
497 gtk_frame_paint (GtkWidget    *widget,
498                  GdkRectangle *area)
499 {
500   GtkFrame *frame;
501   gint x, y, width, height;
502
503   if (GTK_WIDGET_DRAWABLE (widget))
504     {
505       frame = GTK_FRAME (widget);
506
507       x = frame->child_allocation.x - widget->style->xthickness;
508       y = frame->child_allocation.y - widget->style->ythickness;
509       width = frame->child_allocation.width + 2 * widget->style->xthickness;
510       height =  frame->child_allocation.height + 2 * widget->style->ythickness;
511
512       if (frame->label_widget)
513         {
514           GtkRequisition child_requisition;
515           gfloat xalign;
516           gint height_extra;
517           gint x2;
518
519           gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
520
521           if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
522             xalign = frame->label_xalign;
523           else
524             xalign = 1 - frame->label_xalign;
525
526           height_extra = MAX (0, child_requisition.height - widget->style->ythickness);
527           height_extra *= (1 - frame->label_yalign);
528           y -= height_extra;
529           height += height_extra;
530           
531           x2 = widget->style->xthickness + (frame->child_allocation.width - child_requisition.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
532
533           
534           gtk_paint_shadow_gap (widget->style, widget->window,
535                                 widget->state, frame->shadow_type,
536                                 area, widget, "frame",
537                                 x, y, width, height,
538                                 GTK_POS_TOP, 
539                                 x2, child_requisition.width + 2 * LABEL_PAD);
540         }
541        else
542          gtk_paint_shadow (widget->style, widget->window,
543                            widget->state, frame->shadow_type,
544                            area, widget, "frame",
545                            x, y, width, height);
546     }
547 }
548
549 static gboolean
550 gtk_frame_expose (GtkWidget      *widget,
551                   GdkEventExpose *event)
552 {
553   if (GTK_WIDGET_DRAWABLE (widget))
554     {
555       gtk_frame_paint (widget, &event->area);
556
557       (* GTK_WIDGET_CLASS (gtk_frame_parent_class)->expose_event) (widget, event);
558     }
559
560   return FALSE;
561 }
562
563 static void
564 gtk_frame_size_request (GtkWidget      *widget,
565                         GtkRequisition *requisition)
566 {
567   GtkFrame *frame = GTK_FRAME (widget);
568   GtkBin *bin = GTK_BIN (widget);
569   GtkRequisition child_requisition;
570   
571   if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
572     {
573       gtk_widget_size_request (frame->label_widget, &child_requisition);
574
575       requisition->width = child_requisition.width + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
576       requisition->height =
577         MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->ythickness);
578     }
579   else
580     {
581       requisition->width = 0;
582       requisition->height = 0;
583     }
584   
585   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
586     {
587       gtk_widget_size_request (bin->child, &child_requisition);
588
589       requisition->width = MAX (requisition->width, child_requisition.width);
590       requisition->height += child_requisition.height;
591     }
592
593   requisition->width += (GTK_CONTAINER (widget)->border_width +
594                          GTK_WIDGET (widget)->style->xthickness) * 2;
595   requisition->height += (GTK_CONTAINER (widget)->border_width +
596                           GTK_WIDGET (widget)->style->ythickness) * 2;
597 }
598
599 static void
600 gtk_frame_size_allocate (GtkWidget     *widget,
601                          GtkAllocation *allocation)
602 {
603   GtkFrame *frame = GTK_FRAME (widget);
604   GtkBin *bin = GTK_BIN (widget);
605   GtkAllocation new_allocation;
606
607   widget->allocation = *allocation;
608
609   gtk_frame_compute_child_allocation (frame, &new_allocation);
610   
611   /* If the child allocation changed, that means that the frame is drawn
612    * in a new place, so we must redraw the entire widget.
613    */
614   if (GTK_WIDGET_MAPPED (widget) &&
615       (new_allocation.x != frame->child_allocation.x ||
616        new_allocation.y != frame->child_allocation.y ||
617        new_allocation.width != frame->child_allocation.width ||
618        new_allocation.height != frame->child_allocation.height))
619     gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
620   
621   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
622     gtk_widget_size_allocate (bin->child, &new_allocation);
623   
624   frame->child_allocation = new_allocation;
625   
626   if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
627     {
628       GtkRequisition child_requisition;
629       GtkAllocation child_allocation;
630       gfloat xalign;
631
632       gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
633
634       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
635         xalign = frame->label_xalign;
636       else
637         xalign = 1 - frame->label_xalign;
638       
639       child_allocation.x = frame->child_allocation.x + LABEL_SIDE_PAD +
640         (frame->child_allocation.width - child_requisition.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_PAD;
641       child_allocation.width = child_requisition.width;
642
643       child_allocation.y = frame->child_allocation.y - child_requisition.height;
644       child_allocation.height = child_requisition.height;
645
646       gtk_widget_size_allocate (frame->label_widget, &child_allocation);
647     }
648 }
649
650 static void
651 gtk_frame_compute_child_allocation (GtkFrame      *frame,
652                                     GtkAllocation *child_allocation)
653 {
654   g_return_if_fail (GTK_IS_FRAME (frame));
655   g_return_if_fail (child_allocation != NULL);
656
657   GTK_FRAME_GET_CLASS (frame)->compute_child_allocation (frame, child_allocation);
658 }
659
660 static void
661 gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
662                                          GtkAllocation *child_allocation)
663 {
664   GtkWidget *widget = GTK_WIDGET (frame);
665   GtkAllocation *allocation = &widget->allocation;
666   GtkRequisition child_requisition;
667   gint top_margin;
668
669   if (frame->label_widget)
670     {
671       gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
672       top_margin = MAX (child_requisition.height, widget->style->ythickness);
673     }
674   else
675     top_margin = widget->style->ythickness;
676   
677   child_allocation->x = (GTK_CONTAINER (frame)->border_width +
678                          widget->style->xthickness);
679   child_allocation->width = MAX(1, (gint)allocation->width - child_allocation->x * 2);
680   
681   child_allocation->y = (GTK_CONTAINER (frame)->border_width + top_margin);
682   child_allocation->height = MAX (1, ((gint)allocation->height - child_allocation->y -
683                                       (gint)GTK_CONTAINER (frame)->border_width -
684                                       (gint)widget->style->ythickness));
685   
686   child_allocation->x += allocation->x;
687   child_allocation->y += allocation->y;
688 }
689
690 #define __GTK_FRAME_C__
691 #include "gtkaliasdef.c"