]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkbutton.c
Deprecate widget flag: GTK_WIDGET_VISIBLE
[~andy/gtk] / gtk / gtkbutton.c
index 2f8b98f39a5942dd8b55ac259f0b6301759f4724..8b44900a0703a2a99ba69849a5c038cf004b3101 100644 (file)
@@ -1354,13 +1354,13 @@ gtk_button_size_request (GtkWidget      *widget,
                           GTK_WIDGET (widget)->style->ythickness) * 2 +
                          inner_border.top + inner_border.bottom);
 
-  if (GTK_WIDGET_CAN_DEFAULT (widget))
+  if (gtk_widget_get_can_default (widget))
     {
       requisition->width += default_border.left + default_border.right;
       requisition->height += default_border.top + default_border.bottom;
     }
 
-  if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+  if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
     {
       GtkRequisition child_requisition;
 
@@ -1405,7 +1405,7 @@ gtk_button_size_allocate (GtkWidget     *widget,
                            widget->allocation.width - border_width * 2,
                            widget->allocation.height - border_width * 2);
 
-  if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+  if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
     {
       child_allocation.x = widget->allocation.x + border_width + inner_border.left + xthickness;
       child_allocation.y = widget->allocation.y + border_width + inner_border.top + ythickness;
@@ -1421,7 +1421,7 @@ gtk_button_size_allocate (GtkWidget     *widget,
                                      inner_border.bottom -
                                     border_width * 2);
 
-      if (GTK_WIDGET_CAN_DEFAULT (button))
+      if (gtk_widget_get_can_default (GTK_WIDGET (button)))
        {
          child_allocation.x += default_border.left;
          child_allocation.y += default_border.top;
@@ -1429,7 +1429,7 @@ gtk_button_size_allocate (GtkWidget     *widget,
          child_allocation.height = MAX (1, child_allocation.height - default_border.top - default_border.bottom);
        }
 
-      if (GTK_WIDGET_CAN_FOCUS (button))
+      if (gtk_widget_get_can_focus (GTK_WIDGET (button)))
        {
          child_allocation.x += focus_width + focus_pad;
          child_allocation.y += focus_width + focus_pad;
@@ -1471,14 +1471,15 @@ _gtk_button_paint (GtkButton          *button,
   gboolean interior_focus;
   gint focus_width;
   gint focus_pad;
-   
-  if (GTK_WIDGET_DRAWABLE (button))
+
+  widget = GTK_WIDGET (button);
+
+  if (gtk_widget_is_drawable (widget))
     {
-      widget = GTK_WIDGET (button);
       border_width = GTK_CONTAINER (widget)->border_width;
 
       gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
-      gtk_widget_style_get (GTK_WIDGET (widget),
+      gtk_widget_style_get (widget,
                            "focus-line-width", &focus_width,
                            "focus-padding", &focus_pad,
                            NULL); 
@@ -1488,7 +1489,7 @@ _gtk_button_paint (GtkButton          *button,
       width = widget->allocation.width - border_width * 2;
       height = widget->allocation.height - border_width * 2;
 
-      if (GTK_WIDGET_HAS_DEFAULT (widget) &&
+      if (gtk_widget_has_default (widget) &&
          GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
        {
          gtk_paint_box (widget->style, widget->window,
@@ -1501,7 +1502,7 @@ _gtk_button_paint (GtkButton          *button,
          width -= default_border.left + default_border.right;
          height -= default_border.top + default_border.bottom;
        }
-      else if (GTK_WIDGET_CAN_DEFAULT (widget))
+      else if (gtk_widget_get_can_default (widget))
        {
          x += default_outside_border.left;
          y += default_outside_border.top;
@@ -1509,7 +1510,7 @@ _gtk_button_paint (GtkButton          *button,
          height -= default_outside_border.top + default_outside_border.bottom;
        }
        
-      if (!interior_focus && GTK_WIDGET_HAS_FOCUS (widget))
+      if (!interior_focus && gtk_widget_has_focus (widget))
        {
          x += focus_width + focus_pad;
          y += focus_width + focus_pad;
@@ -1524,13 +1525,13 @@ _gtk_button_paint (GtkButton          *button,
                       shadow_type, area, widget, "button",
                       x, y, width, height);
        
-      if (GTK_WIDGET_HAS_FOCUS (widget))
+      if (gtk_widget_has_focus (widget))
        {
          gint child_displacement_x;
          gint child_displacement_y;
          gboolean displace_focus;
          
-         gtk_widget_style_get (GTK_WIDGET (widget),
+         gtk_widget_style_get (widget,
                                "child-displacement-y", &child_displacement_y,
                                "child-displacement-x", &child_displacement_x,
                                "displace-focus", &displace_focus,
@@ -1568,7 +1569,7 @@ static gboolean
 gtk_button_expose (GtkWidget      *widget,
                   GdkEventExpose *event)
 {
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtk_widget_is_drawable (widget))
     {
       GtkButton *button = GTK_BUTTON (widget);
       
@@ -1593,7 +1594,7 @@ gtk_button_button_press (GtkWidget      *widget,
     {
       button = GTK_BUTTON (widget);
 
-      if (button->focus_on_click && !GTK_WIDGET_HAS_FOCUS (widget))
+      if (button->focus_on_click && !gtk_widget_has_focus (widget))
        gtk_widget_grab_focus (widget);
 
       if (event->button == 1)
@@ -1690,7 +1691,7 @@ gtk_button_leave_notify (GtkWidget        *widget,
 
   if ((event_widget == widget) &&
       (event->detail != GDK_NOTIFY_INFERIOR) &&
-      (GTK_WIDGET_SENSITIVE (event_widget)))
+      (gtk_widget_get_sensitive (event_widget)))
     {
       button->in_button = FALSE;
       gtk_button_leave (button);
@@ -2179,7 +2180,7 @@ gtk_button_state_changed (GtkWidget    *widget,
 {
   GtkButton *button = GTK_BUTTON (widget);
 
-  if (!GTK_WIDGET_IS_SENSITIVE (widget))
+  if (!gtk_widget_is_sensitive (widget))
     {
       button->in_button = FALSE;
       gtk_real_button_released (button);