]> Pileus Git - ~andy/gtk/blob - gtk/gtkradiobutton.c
Use canonical names for g_object_notify() as well.
[~andy/gtk] / gtk / gtkradiobutton.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 "gtklabel.h"
29 #include "gtkmarshalers.h"
30 #include "gtkradiobutton.h"
31 #include "gtkprivate.h"
32 #include "gtkintl.h"
33 #include "gtkalias.h"
34
35
36 enum {
37   PROP_0,
38   PROP_GROUP
39 };
40
41
42 static void     gtk_radio_button_class_init     (GtkRadioButtonClass *klass);
43 static void     gtk_radio_button_init           (GtkRadioButton      *radio_button);
44 static void     gtk_radio_button_destroy        (GtkObject           *object);
45 static gboolean gtk_radio_button_focus          (GtkWidget           *widget,
46                                                  GtkDirectionType     direction);
47 static void     gtk_radio_button_clicked        (GtkButton           *button);
48 static void     gtk_radio_button_draw_indicator (GtkCheckButton      *check_button,
49                                                  GdkRectangle        *area);
50 static void     gtk_radio_button_set_property   (GObject             *object,
51                                                  guint                prop_id,
52                                                  const GValue        *value,
53                                                  GParamSpec          *pspec);
54 static void     gtk_radio_button_get_property   (GObject             *object,
55                                                  guint                prop_id,
56                                                  GValue              *value,
57                                                  GParamSpec          *pspec);
58
59 static GtkCheckButtonClass *parent_class = NULL;
60
61 static guint group_changed_signal = 0;
62
63 GType
64 gtk_radio_button_get_type (void)
65 {
66   static GType radio_button_type = 0;
67
68   if (!radio_button_type)
69     {
70       static const GTypeInfo radio_button_info =
71       {
72         sizeof (GtkRadioButtonClass),
73         NULL,           /* base_init */
74         NULL,           /* base_finalize */
75         (GClassInitFunc) gtk_radio_button_class_init,
76         NULL,           /* class_finalize */
77         NULL,           /* class_data */
78         sizeof (GtkRadioButton),
79         0,              /* n_preallocs */
80         (GInstanceInitFunc) gtk_radio_button_init,
81       };
82
83       radio_button_type =
84         g_type_register_static (GTK_TYPE_CHECK_BUTTON, "GtkRadioButton",
85                                 &radio_button_info, 0);
86     }
87
88   return radio_button_type;
89 }
90
91 static void
92 gtk_radio_button_class_init (GtkRadioButtonClass *class)
93 {
94   GObjectClass *gobject_class;
95   GtkObjectClass *object_class;
96   GtkButtonClass *button_class;
97   GtkCheckButtonClass *check_button_class;
98   GtkWidgetClass *widget_class;
99
100   gobject_class = G_OBJECT_CLASS (class);
101   object_class = (GtkObjectClass*) class;
102   widget_class = (GtkWidgetClass*) class;
103   button_class = (GtkButtonClass*) class;
104   check_button_class = (GtkCheckButtonClass*) class;
105
106   parent_class = g_type_class_peek_parent (class);
107
108   gobject_class->set_property = gtk_radio_button_set_property;
109   gobject_class->get_property = gtk_radio_button_get_property;
110
111   g_object_class_install_property (gobject_class,
112                                    PROP_GROUP,
113                                    g_param_spec_object ("group",
114                                                         P_("Group"),
115                                                         P_("The radio button whose group this widget belongs to."),
116                                                         GTK_TYPE_RADIO_BUTTON,
117                                                         GTK_PARAM_WRITABLE));
118   object_class->destroy = gtk_radio_button_destroy;
119
120   widget_class->focus = gtk_radio_button_focus;
121
122   button_class->clicked = gtk_radio_button_clicked;
123
124   check_button_class->draw_indicator = gtk_radio_button_draw_indicator;
125
126   class->group_changed = NULL;
127
128   /**
129    * GtkStyle::group-changed:
130    * @style: the object which received the signal
131    *
132    * Emitted when the group of radio buttons that a radio button belongs
133    * to changes. This is emitted when a radio button switches from
134    * being alone to being part of a group of 2 or more buttons, or
135    * vice-versa, and when a buttton is moved from one group of 2 or
136    * more buttons to a different one, but not when the composition
137    * of the group that a button belongs to changes.
138    *
139    * Since: 2.4
140    */
141   group_changed_signal = g_signal_new ("group-changed",
142                                        G_OBJECT_CLASS_TYPE (object_class),
143                                        G_SIGNAL_RUN_FIRST,
144                                        G_STRUCT_OFFSET (GtkRadioButtonClass, group_changed),
145                                        NULL, NULL,
146                                        _gtk_marshal_VOID__VOID,
147                                        G_TYPE_NONE, 0);
148 }
149
150 static void
151 gtk_radio_button_init (GtkRadioButton *radio_button)
152 {
153   GTK_WIDGET_SET_FLAGS (radio_button, GTK_NO_WINDOW);
154   GTK_WIDGET_UNSET_FLAGS (radio_button, GTK_RECEIVES_DEFAULT);
155
156   GTK_TOGGLE_BUTTON (radio_button)->active = TRUE;
157
158   GTK_BUTTON (radio_button)->depress_on_activate = FALSE;
159
160   radio_button->group = g_slist_prepend (NULL, radio_button);
161
162   _gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE);
163   gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
164 }
165
166 static void
167 gtk_radio_button_set_property (GObject      *object,
168                                guint         prop_id,
169                                const GValue *value,
170                                GParamSpec   *pspec)
171 {
172   GtkRadioButton *radio_button;
173
174   radio_button = GTK_RADIO_BUTTON (object);
175
176   switch (prop_id)
177     {
178       GSList *slist;
179
180     case PROP_GROUP:
181       if (G_VALUE_HOLDS_OBJECT (value))
182         slist = gtk_radio_button_get_group ((GtkRadioButton*) g_value_get_object (value));
183       else
184         slist = NULL;
185       gtk_radio_button_set_group (radio_button, slist);
186       break;
187     default:
188       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
189       break;
190     }
191 }
192
193 static void
194 gtk_radio_button_get_property (GObject    *object,
195                                guint       prop_id,
196                                GValue     *value,
197                                GParamSpec *pspec)
198 {
199   GtkRadioButton *radio_button;
200
201   radio_button = GTK_RADIO_BUTTON (object);
202
203   switch (prop_id)
204     {
205     default:
206       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
207       break;
208     }
209 }
210
211 void
212 gtk_radio_button_set_group (GtkRadioButton *radio_button,
213                             GSList         *group)
214 {
215   GtkWidget *old_group_singleton = NULL;
216   GtkWidget *new_group_singleton = NULL;
217   
218   g_return_if_fail (GTK_IS_RADIO_BUTTON (radio_button));
219   g_return_if_fail (!g_slist_find (group, radio_button));
220
221   if (radio_button->group)
222     {
223       GSList *slist;
224
225       radio_button->group = g_slist_remove (radio_button->group, radio_button);
226       
227       if (radio_button->group && !radio_button->group->next)
228         old_group_singleton = g_object_ref (radio_button->group->data);
229           
230       for (slist = radio_button->group; slist; slist = slist->next)
231         {
232           GtkRadioButton *tmp_button;
233           
234           tmp_button = slist->data;
235           
236           tmp_button->group = radio_button->group;
237         }
238     }
239   
240   if (group && !group->next)
241     new_group_singleton = g_object_ref (group->data);
242   
243   radio_button->group = g_slist_prepend (group, radio_button);
244   
245   if (group)
246     {
247       GSList *slist;
248       
249       for (slist = group; slist; slist = slist->next)
250         {
251           GtkRadioButton *tmp_button;
252           
253           tmp_button = slist->data;
254           
255           tmp_button->group = radio_button->group;
256         }
257     }
258
259   g_object_ref (radio_button);
260   
261   g_signal_emit (radio_button, group_changed_signal, 0);
262   if (old_group_singleton)
263     {
264       g_signal_emit (old_group_singleton, group_changed_signal, 0);
265       g_object_unref (old_group_singleton);
266     }
267   if (new_group_singleton)
268     {
269       g_signal_emit (new_group_singleton, group_changed_signal, 0);
270       g_object_unref (new_group_singleton);
271     }
272
273   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), group == NULL);
274
275   g_object_unref (radio_button);
276 }
277
278 GtkWidget*
279 gtk_radio_button_new (GSList *group)
280 {
281   GtkRadioButton *radio_button;
282
283   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, NULL);
284
285   if (group)
286     gtk_radio_button_set_group (radio_button, group);
287
288   return GTK_WIDGET (radio_button);
289 }
290
291 GtkWidget*
292 gtk_radio_button_new_with_label (GSList      *group,
293                                  const gchar *label)
294 {
295   GtkWidget *radio_button;
296
297   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, NULL) ;
298
299   if (group)
300     gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
301
302   return radio_button;
303 }
304
305
306 /**
307  * gtk_radio_button_new_with_mnemonic:
308  * @group: the radio button group
309  * @label: the text of the button, with an underscore in front of the
310  *         mnemonic character
311  * @returns: a new #GtkRadioButton
312  *
313  * Creates a new #GtkRadioButton containing a label, adding it to the same 
314  * group as @group. The label will be created using 
315  * gtk_label_new_with_mnemonic(), so underscores in @label indicate the 
316  * mnemonic for the button.
317  **/
318 GtkWidget*
319 gtk_radio_button_new_with_mnemonic (GSList      *group,
320                                     const gchar *label)
321 {
322   GtkWidget *radio_button;
323
324   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, 
325                                "label", label, 
326                                "use-underline", TRUE, 
327                                NULL);
328
329   if (group)
330     gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
331
332   return radio_button;
333 }
334
335 GtkWidget*
336 gtk_radio_button_new_from_widget (GtkRadioButton *group)
337 {
338   GSList *l = NULL;
339   if (group)
340     l = gtk_radio_button_get_group (group);
341   return gtk_radio_button_new (l);
342 }
343
344
345 GtkWidget*
346 gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group,
347                                              const gchar    *label)
348 {
349   GSList *l = NULL;
350   if (group)
351     l = gtk_radio_button_get_group (group);
352   return gtk_radio_button_new_with_label (l, label);
353 }
354
355 /**
356  * gtk_radio_button_new_with_mnemonic_from_widget:
357  * @group: widget to get radio group from
358  * @label: the text of the button, with an underscore in front of the
359  *         mnemonic character
360  * @returns: a new #GtkRadioButton
361  *
362  * Creates a new #GtkRadioButton containing a label. The label
363  * will be created using gtk_label_new_with_mnemonic(), so underscores
364  * in @label indicate the mnemonic for the button.
365  **/
366 GtkWidget*
367 gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group,
368                                                 const gchar    *label)
369 {
370   GSList *l = NULL;
371   if (group)
372     l = gtk_radio_button_get_group (group);
373   return gtk_radio_button_new_with_mnemonic (l, label);
374 }
375
376 GSList*
377 gtk_radio_button_get_group (GtkRadioButton *radio_button)
378 {
379   g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), NULL);
380
381   return radio_button->group;
382 }
383
384
385 static void
386 gtk_radio_button_destroy (GtkObject *object)
387 {
388   GtkWidget *old_group_singleton = NULL;
389   GtkRadioButton *radio_button;
390   GtkRadioButton *tmp_button;
391   GSList *tmp_list;
392   gboolean was_in_group;
393   
394   radio_button = GTK_RADIO_BUTTON (object);
395
396   was_in_group = radio_button->group && radio_button->group->next;
397   
398   radio_button->group = g_slist_remove (radio_button->group, radio_button);
399   if (radio_button->group && !radio_button->group->next)
400     old_group_singleton = radio_button->group->data;
401
402   tmp_list = radio_button->group;
403
404   while (tmp_list)
405     {
406       tmp_button = tmp_list->data;
407       tmp_list = tmp_list->next;
408
409       tmp_button->group = radio_button->group;
410     }
411
412   /* this button is no longer in the group */
413   radio_button->group = NULL;
414
415   if (old_group_singleton)
416     g_signal_emit (old_group_singleton, group_changed_signal, 0);
417   if (was_in_group)
418     g_signal_emit (radio_button, group_changed_signal, 0);
419   
420   if (GTK_OBJECT_CLASS (parent_class)->destroy)
421     (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
422 }
423
424 static void
425 get_coordinates (GtkWidget    *widget,
426                  GtkWidget    *reference,
427                  gint         *x,
428                  gint         *y)
429 {
430   *x = widget->allocation.x + widget->allocation.width / 2;
431   *y = widget->allocation.y + widget->allocation.height / 2;
432   
433   gtk_widget_translate_coordinates (widget, reference, *x, *y, x, y);
434 }
435
436 static gint
437 left_right_compare (gconstpointer a,
438                     gconstpointer b,
439                     gpointer      data)
440 {
441   gint x1, y1, x2, y2;
442
443   get_coordinates ((GtkWidget *)a, data, &x1, &y1);
444   get_coordinates ((GtkWidget *)b, data, &x2, &y2);
445
446   if (y1 == y2)
447     return (x1 < x2) ? -1 : ((x1 == x2) ? 0 : 1);
448   else
449     return (y1 < y2) ? -1 : 1;
450 }
451
452 static gint
453 up_down_compare (gconstpointer a,
454                  gconstpointer b,
455                  gpointer      data)
456 {
457   gint x1, y1, x2, y2;
458   
459   get_coordinates ((GtkWidget *)a, data, &x1, &y1);
460   get_coordinates ((GtkWidget *)b, data, &x2, &y2);
461   
462   if (x1 == x2)
463     return (y1 < y2) ? -1 : ((y1 == y2) ? 0 : 1);
464   else
465     return (x1 < x2) ? -1 : 1;
466 }
467
468 static gboolean
469 gtk_radio_button_focus (GtkWidget         *widget,
470                         GtkDirectionType   direction)
471 {
472   GtkRadioButton *radio_button = GTK_RADIO_BUTTON (widget);
473   GSList *tmp_slist;
474
475   /* Radio buttons with draw_indicator unset focus "normally", since
476    * they look like buttons to the user.
477    */
478   if (!GTK_TOGGLE_BUTTON (widget)->draw_indicator)
479     return GTK_WIDGET_CLASS (parent_class)->focus (widget, direction);
480   
481   if (gtk_widget_is_focus (widget))
482     {
483       GSList *focus_list, *tmp_list;
484       GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
485       GtkWidget *new_focus = NULL;
486
487       focus_list = g_slist_copy (radio_button->group);
488       
489       switch (direction)
490         {
491         case GTK_DIR_TAB_FORWARD:
492         case GTK_DIR_TAB_BACKWARD:
493           return FALSE;
494         case GTK_DIR_LEFT:
495         case GTK_DIR_RIGHT:
496           focus_list = g_slist_sort_with_data (focus_list, left_right_compare, toplevel);
497           break;
498         case GTK_DIR_UP:
499         case GTK_DIR_DOWN:
500           focus_list = g_slist_sort_with_data (focus_list, up_down_compare, toplevel);
501           break;
502         }
503
504       if (direction == GTK_DIR_LEFT || direction == GTK_DIR_UP)
505         focus_list = g_slist_reverse (focus_list);
506
507       tmp_list = g_slist_find (focus_list, widget);
508
509       if (tmp_list)
510         {
511           tmp_list = tmp_list->next;
512           
513           while (tmp_list)
514             {
515               GtkWidget *child = tmp_list->data;
516               
517               if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_IS_SENSITIVE (child))
518                 {
519                   new_focus = child;
520                   break;
521                 }
522
523               tmp_list = tmp_list->next;
524             }
525         }
526
527       if (!new_focus)
528         {
529           tmp_list = focus_list;
530
531           while (tmp_list)
532             {
533               GtkWidget *child = tmp_list->data;
534               
535               if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_IS_SENSITIVE (child))
536                 {
537                   new_focus = child;
538                   break;
539                 }
540               
541               tmp_list = tmp_list->next;
542             }
543         }
544       
545       g_slist_free (focus_list);
546
547       if (new_focus)
548         {
549           gtk_widget_grab_focus (new_focus);
550           gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
551         }
552
553       return TRUE;
554     }
555   else
556     {
557       GtkRadioButton *selected_button = NULL;
558       
559       /* We accept the focus if, we don't have the focus and
560        *  - we are the currently active button in the group
561        *  - there is no currently active radio button.
562        */
563       
564       tmp_slist = radio_button->group;
565       while (tmp_slist)
566         {
567           if (GTK_TOGGLE_BUTTON (tmp_slist->data)->active)
568             selected_button = tmp_slist->data;
569           tmp_slist = tmp_slist->next;
570         }
571       
572       if (selected_button && selected_button != radio_button)
573         return FALSE;
574
575       gtk_widget_grab_focus (widget);
576       return TRUE;
577     }
578 }
579
580 static void
581 gtk_radio_button_clicked (GtkButton *button)
582 {
583   GtkToggleButton *toggle_button;
584   GtkRadioButton *radio_button;
585   GtkToggleButton *tmp_button;
586   GtkStateType new_state;
587   GSList *tmp_list;
588   gint toggled;
589   gboolean depressed;
590
591   radio_button = GTK_RADIO_BUTTON (button);
592   toggle_button = GTK_TOGGLE_BUTTON (button);
593   toggled = FALSE;
594
595   g_object_ref (GTK_WIDGET (button));
596
597   if (toggle_button->active)
598     {
599       tmp_button = NULL;
600       tmp_list = radio_button->group;
601
602       while (tmp_list)
603         {
604           tmp_button = tmp_list->data;
605           tmp_list = tmp_list->next;
606
607           if (tmp_button->active && tmp_button != toggle_button)
608             break;
609
610           tmp_button = NULL;
611         }
612
613       if (!tmp_button)
614         {
615           new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
616         }
617       else
618         {
619           toggled = TRUE;
620           toggle_button->active = !toggle_button->active;
621           new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
622         }
623     }
624   else
625     {
626       toggled = TRUE;
627       toggle_button->active = !toggle_button->active;
628
629       tmp_list = radio_button->group;
630       while (tmp_list)
631         {
632           tmp_button = tmp_list->data;
633           tmp_list = tmp_list->next;
634
635           if (tmp_button->active && (tmp_button != toggle_button))
636             {
637               gtk_button_clicked (GTK_BUTTON (tmp_button));
638               break;
639             }
640         }
641
642       new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
643     }
644
645   if (toggle_button->inconsistent)
646     depressed = FALSE;
647   else if (button->in_button && button->button_down)
648     depressed = !toggle_button->active;
649   else
650     depressed = toggle_button->active;
651
652   if (GTK_WIDGET_STATE (button) != new_state)
653     gtk_widget_set_state (GTK_WIDGET (button), new_state);
654
655   if (toggled)
656     gtk_toggle_button_toggled (toggle_button);
657
658   _gtk_button_set_depressed (button, depressed);
659
660   gtk_widget_queue_draw (GTK_WIDGET (button));
661
662   g_object_unref (button);
663 }
664
665 static void
666 gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
667                                  GdkRectangle   *area)
668 {
669   GtkWidget *widget;
670   GtkWidget *child;
671   GtkButton *button;
672   GtkToggleButton *toggle_button;
673   GtkStateType state_type;
674   GtkShadowType shadow_type;
675   gint x, y;
676   gint indicator_size, indicator_spacing;
677   gint focus_width;
678   gint focus_pad;
679   gboolean interior_focus;
680
681   if (GTK_WIDGET_DRAWABLE (check_button))
682     {
683       widget = GTK_WIDGET (check_button);
684       button = GTK_BUTTON (check_button);
685       toggle_button = GTK_TOGGLE_BUTTON (check_button);
686
687       gtk_widget_style_get (widget,
688                             "interior-focus", &interior_focus,
689                             "focus-line-width", &focus_width,
690                             "focus-padding", &focus_pad,
691                             NULL);
692
693       _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
694
695       x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
696       y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
697
698       child = GTK_BIN (check_button)->child;
699       if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
700         x += focus_width + focus_pad;      
701
702       if (toggle_button->inconsistent)
703         shadow_type = GTK_SHADOW_ETCHED_IN;
704       else if (toggle_button->active)
705         shadow_type = GTK_SHADOW_IN;
706       else
707         shadow_type = GTK_SHADOW_OUT;
708
709       if (button->activate_timeout || (button->button_down && button->in_button))
710         state_type = GTK_STATE_ACTIVE;
711       else if (button->in_button)
712         state_type = GTK_STATE_PRELIGHT;
713       else if (!GTK_WIDGET_IS_SENSITIVE (widget))
714         state_type = GTK_STATE_INSENSITIVE;
715       else
716         state_type = GTK_STATE_NORMAL;
717
718       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
719         x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
720
721       if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT)
722         {
723           GdkRectangle restrict_area;
724           GdkRectangle new_area;
725               
726           restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
727           restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
728           restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
729           restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
730           
731           if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
732             {
733               gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT,
734                                   GTK_SHADOW_ETCHED_OUT, 
735                                   area, widget, "checkbutton",
736                                   new_area.x, new_area.y,
737                                   new_area.width, new_area.height);
738             }
739         }
740
741       gtk_paint_option (widget->style, widget->window,
742                         state_type, shadow_type,
743                         area, widget, "radiobutton",
744                         x, y, indicator_size, indicator_size);
745     }
746 }
747
748 #define __GTK_RADIO_BUTTON_C__
749 #include "gtkaliasdef.c"