]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkclist.c
Deprecate widget flag: GTK_WIDGET_MAPPED
[~andy/gtk] / gtk / gtkclist.c
index 2d0f6bc32f0cccc8ec3a9f4c363078fa0c901a15..83a1fa0c5c3139cab74d37d55e893c4c6dd6d66b 100644 (file)
@@ -986,7 +986,7 @@ gtk_clist_get_arg (GtkObject      *object,
       GTK_VALUE_BOOL (*arg) = TRUE;
       for (i = 0; i < clist->columns; i++)
        if (clist->column[i].button &&
-           !GTK_WIDGET_SENSITIVE (clist->column[i].button))
+           !gtk_widget_get_sensitive (clist->column[i].button))
          {
            GTK_VALUE_BOOL (*arg) = FALSE;
            break;
@@ -1010,7 +1010,7 @@ gtk_clist_init (GtkCList *clist)
   clist->flags = 0;
 
   GTK_WIDGET_UNSET_FLAGS (clist, GTK_NO_WINDOW);
-  GTK_WIDGET_SET_FLAGS (clist, GTK_CAN_FOCUS);
+  gtk_widget_set_can_focus (GTK_WIDGET (clist), TRUE);
   GTK_CLIST_SET_FLAG (clist, CLIST_DRAW_DRAG_LINE);
   GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS);
 
@@ -1255,7 +1255,7 @@ gtk_clist_set_shadow_type (GtkCList      *clist,
 
   clist->shadow_type = type;
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)))
     gtk_widget_queue_resize (GTK_WIDGET (clist));
 }
 
@@ -1378,8 +1378,8 @@ gtk_clist_column_title_active (GtkCList *clist,
                                 G_CALLBACK (column_title_passive_func),
                                 NULL);
 
-  GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
-  if (GTK_WIDGET_VISIBLE (clist))
+  gtk_widget_set_can_focus (clist->column[column].button, TRUE);
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)))
     gtk_widget_queue_draw (clist->column[column].button);
 }
 
@@ -1409,8 +1409,8 @@ gtk_clist_column_title_passive (GtkCList *clist,
                      G_CALLBACK (column_title_passive_func),
                       NULL);
 
-  GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
-  if (GTK_WIDGET_VISIBLE (clist))
+  gtk_widget_set_can_focus (clist->column[column].button, FALSE);
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)))
     gtk_widget_queue_draw (clist->column[column].button);
 }
 
@@ -1496,7 +1496,7 @@ gtk_clist_set_column_title (GtkCList    *clist,
 
   /* if this button didn't previously exist, then the
    * column button positions have to be re-computed */
-  if (GTK_WIDGET_VISIBLE (clist) && new_button)
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button)
     size_allocate_title_buttons (clist);
 }
 
@@ -1550,7 +1550,7 @@ gtk_clist_set_column_widget (GtkCList  *clist,
 
   /* if this button didn't previously exist, then the
    * column button positions have to be re-computed */
-  if (GTK_WIDGET_VISIBLE (clist) && new_button)
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button)
     size_allocate_title_buttons (clist);
 }
 
@@ -1671,7 +1671,7 @@ gtk_clist_set_column_resizeable (GtkCList *clist,
   if (resizeable)
     clist->column[column].auto_resize = FALSE;
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)))
     size_allocate_title_buttons (clist);
 }
 
@@ -1700,7 +1700,7 @@ gtk_clist_set_column_auto_resize (GtkCList *clist,
        }
     }
 
-  if (GTK_WIDGET_VISIBLE (clist))
+  if (gtk_widget_get_visible (GTK_WIDGET (clist)))
     size_allocate_title_buttons (clist);
 }
 
@@ -1925,8 +1925,10 @@ abort_column_resize (GtkCList *clist)
 
   if (GTK_CLIST_ADD_MODE(clist))
     {
+      gint8 dashes[] = { 4, 4 };
+
       gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_ON_OFF_DASH, 0,0);
-      gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
+      gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes));
     }
 }
 
@@ -2272,6 +2274,10 @@ gtk_clist_get_text (GtkCList  *clist,
   return 1;
 }
 
+/**
+ * gtk_clist_set_pixmap:
+ * @mask: (allow-none):
+ */
 void
 gtk_clist_set_pixmap (GtkCList  *clist,
                      gint       row,
@@ -3666,10 +3672,12 @@ toggle_add_mode (GtkCList *clist)
   gtk_clist_draw_focus (GTK_WIDGET (clist));
   if (!GTK_CLIST_ADD_MODE(clist))
     {
+      gint8 dashes[] = { 4, 4 };
+
       GTK_CLIST_SET_FLAG (clist, CLIST_ADD_MODE);
       gdk_gc_set_line_attributes (clist->xor_gc, 1,
                                  GDK_LINE_ON_OFF_DASH, 0, 0);
-      gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
+      gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes));
     }
   else
     {
@@ -3929,7 +3937,7 @@ real_undo_selection (GtkCList *clist)
                       GPOINTER_TO_INT (work->data), -1, NULL);
     }
 
-  if (GTK_WIDGET_HAS_FOCUS(clist) && clist->focus_row != clist->undo_anchor)
+  if (gtk_widget_has_focus (GTK_WIDGET (clist)) && clist->focus_row != clist->undo_anchor)
     {
       gtk_clist_draw_focus (GTK_WIDGET (clist));
       clist->focus_row = clist->undo_anchor;
@@ -4271,7 +4279,7 @@ end_selection (GtkCList *clist)
   g_return_if_fail (GTK_IS_CLIST (clist));
 
   if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) &&
-      GTK_WIDGET_HAS_FOCUS (clist))
+      gtk_widget_has_focus (GTK_WIDGET (clist)))
     return;
 
   GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
@@ -4607,7 +4615,7 @@ gtk_clist_unrealize (GtkWidget *widget)
   /* freeze the list */
   clist->freeze_count++;
 
-  if (GTK_WIDGET_MAPPED (widget))
+  if (gtk_widget_get_mapped (widget))
     gtk_clist_unmap (widget);
 
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
@@ -4676,7 +4684,7 @@ gtk_clist_map (GtkWidget *widget)
 
   clist = GTK_CLIST (widget);
 
-  if (!GTK_WIDGET_MAPPED (widget))
+  if (!gtk_widget_get_mapped (widget))
     {
       GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
 
@@ -4684,8 +4692,8 @@ gtk_clist_map (GtkWidget *widget)
       for (i = 0; i < clist->columns; i++)
        {
          if (clist->column[i].button &&
-             GTK_WIDGET_VISIBLE (clist->column[i].button) &&
-             !GTK_WIDGET_MAPPED (clist->column[i].button))
+             gtk_widget_get_visible (clist->column[i].button) &&
+             !gtk_widget_get_mapped (clist->column[i].button))
            gtk_widget_map (clist->column[i].button);
        }
       
@@ -4715,7 +4723,7 @@ gtk_clist_unmap (GtkWidget *widget)
 
   clist = GTK_CLIST (widget);
 
-  if (GTK_WIDGET_MAPPED (widget))
+  if (gtk_widget_get_mapped (widget))
     {
       GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
 
@@ -4753,7 +4761,7 @@ gtk_clist_unmap (GtkWidget *widget)
       /* unmap column buttons */
       for (i = 0; i < clist->columns; i++)
        if (clist->column[i].button &&
-           GTK_WIDGET_MAPPED (clist->column[i].button))
+           gtk_widget_get_mapped (clist->column[i].button))
          gtk_widget_unmap (clist->column[i].button);
 
       /* freeze the list */
@@ -4915,7 +4923,7 @@ gtk_clist_button_press (GtkWidget      *widget,
              if (GTK_CLIST_ADD_MODE(clist))
                {
                  GTK_CLIST_UNSET_FLAG (clist, CLIST_ADD_MODE);
-                 if (GTK_WIDGET_HAS_FOCUS(widget))
+                 if (gtk_widget_has_focus (widget))
                    {
                      gtk_clist_draw_focus (widget);
                      gdk_gc_set_line_attributes (clist->xor_gc, 1,
@@ -4932,7 +4940,7 @@ gtk_clist_button_press (GtkWidget      *widget,
                }
              else if (row != clist->focus_row)
                {
-                 if (GTK_WIDGET_HAS_FOCUS(widget))
+                 if (gtk_widget_has_focus (widget))
                    {
                      gtk_clist_draw_focus (widget);
                      clist->focus_row = row;
@@ -4943,7 +4951,7 @@ gtk_clist_button_press (GtkWidget      *widget,
                }
            }
 
-         if (!GTK_WIDGET_HAS_FOCUS(widget))
+         if (!gtk_widget_has_focus (widget))
            gtk_widget_grab_focus (widget);
 
          if (button_actions & GTK_BUTTON_SELECTS)
@@ -5050,7 +5058,7 @@ gtk_clist_button_press (GtkWidget      *widget,
        if (drag_data)
          gtk_signal_handler_block_by_data (GTK_OBJECT (clist), drag_data);
 
-       if (!GTK_WIDGET_HAS_FOCUS(widget))
+       if (!gtk_widget_has_focus (widget))
          gtk_widget_grab_focus (widget);
 
        clist->drag_pos = i;
@@ -5109,9 +5117,11 @@ gtk_clist_button_release (GtkWidget      *widget,
 
       if (GTK_CLIST_ADD_MODE(clist))
        {
+         gint8 dashes[] = { 4, 4 };
+
          gdk_gc_set_line_attributes (clist->xor_gc, 1,
                                      GDK_LINE_ON_OFF_DASH, 0, 0);
-         gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
+         gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes));
        }
 
       width = new_column_width (clist, i, &x);
@@ -5857,7 +5867,7 @@ draw_row (GtkCList     *clist,
 
   /* draw focus rectangle */
   if (clist->focus_row == row &&
-      GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS(widget))
+      GTK_WIDGET_CAN_FOCUS (widget) && gtk_widget_has_focus (widget))
     {
       if (!area)
        gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
@@ -6139,7 +6149,7 @@ typedef struct
 
 /* The window to which widget->window is relative */
 #define ALLOCATION_WINDOW(widget)              \
-   (GTK_WIDGET_NO_WINDOW (widget) ?            \
+   (!gtk_widget_get_has_window (widget) ?              \
     (widget)->window :                          \
      gdk_window_get_parent ((widget)->window))
 
@@ -6151,7 +6161,7 @@ adjust_allocation_recurse (GtkWidget *widget,
   
   if (!GTK_WIDGET_REALIZED (widget))
     {
-      if (GTK_WIDGET_VISIBLE (widget))
+      if (gtk_widget_get_visible (widget))
        {
          GdkRectangle tmp_rectangle = widget->allocation;
          tmp_rectangle.x += scroll_data->dx;
@@ -6226,7 +6236,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
 
   if (GTK_WIDGET_DRAWABLE (clist))
     {
-      if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
+      if (GTK_WIDGET_CAN_FOCUS(clist) && gtk_widget_has_focus (GTK_WIDGET (clist)) &&
           !container->focus_child && GTK_CLIST_ADD_MODE(clist))
         {
           y = ROW_TOP_YPIXEL (clist, clist->focus_row);
@@ -6239,7 +6249,7 @@ hadjustment_value_changed (GtkAdjustment *adjustment,
       gdk_window_scroll (clist->clist_window, dx, 0);
       gdk_window_process_updates (clist->clist_window, FALSE);
 
-      if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
+      if (GTK_WIDGET_CAN_FOCUS(clist) && gtk_widget_has_focus (GTK_WIDGET (clist)) &&
           !container->focus_child)
         {
           if (GTK_CLIST_ADD_MODE(clist))
@@ -6437,7 +6447,7 @@ gtk_clist_focus (GtkWidget        *widget,
   GtkWidget *focus_child;
   gboolean is_current_focus;
 
-  if (!GTK_WIDGET_IS_SENSITIVE (widget))
+  if (!gtk_widget_is_sensitive (widget))
     return FALSE;
 
   focus_child = GTK_CONTAINER (widget)->focus_child;
@@ -6683,7 +6693,7 @@ title_focus_move (GtkCList *clist,
   while (!return_val && j >= 0 && j < clist->columns)
     {
       if (clist->column[j].button &&
-         GTK_WIDGET_VISIBLE (clist->column[j].button))
+         gtk_widget_get_visible (clist->column[j].button))
        {
          if (focus_column (clist, j, dir))
            {
@@ -6703,7 +6713,7 @@ title_focus_move (GtkCList *clist,
       while (!return_val && j != i)
        {
          if (clist->column[j].button &&
-             GTK_WIDGET_VISIBLE (clist->column[j].button))
+             gtk_widget_get_visible (clist->column[j].button))
            {
              if (focus_column (clist, j, dir))
                {