]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkdnd.c
Deprecate widget flag: GTK_WIDGET_MAPPED
[~andy/gtk] / gtk / gtkdnd.c
index 3b300e16f1575cd276af878395757bbcf133b841..5e7d5a4b90d684811c8d9fedbab76afb0c946074 100644 (file)
@@ -1102,11 +1102,11 @@ gtk_drag_highlight_expose (GtkWidget      *widget,
 {
   gint x, y, width, height;
   
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtk_widget_is_drawable (widget))
     {
       cairo_t *cr;
       
-      if (GTK_WIDGET_NO_WINDOW (widget))
+      if (!gtk_widget_get_has_window (widget))
        {
          x = widget->allocation.x;
          y = widget->allocation.y;
@@ -1341,8 +1341,22 @@ gtk_drag_dest_set_proxy (GtkWidget      *widget,
 void 
 gtk_drag_dest_unset (GtkWidget *widget)
 {
+  GtkDragDestSite *old_site;
+
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
+  old_site = g_object_get_data (G_OBJECT (widget),
+                                "gtk-drag-dest");
+  if (old_site)
+    {
+      g_signal_handlers_disconnect_by_func (widget,
+                                            gtk_drag_dest_realized,
+                                            old_site);
+      g_signal_handlers_disconnect_by_func (widget,
+                                            gtk_drag_dest_hierarchy_changed,
+                                            old_site);
+    }
+
   g_object_set_data (G_OBJECT (widget), I_("gtk-drag-dest"), NULL);
 }
 
@@ -1370,7 +1384,7 @@ gtk_drag_dest_get_target_list (GtkWidget *widget)
 /**
  * gtk_drag_dest_set_target_list:
  * @widget: a #GtkWidget that's a drag destination
- * @target_list: list of droppable targets, or %NULL for none
+ * @target_list: (allow-none): list of droppable targets, or %NULL for none
  * 
  * Sets the target types that this widget can accept from drag-and-drop.
  * The widget must first be made into a drag destination with
@@ -1652,7 +1666,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
  * gtk_drag_dest_find_target:
  * @widget: drag destination widget
  * @context: drag context
- * @target_list: list of droppable targets, or %NULL to use
+ * @target_list: (allow-none): list of droppable targets, or %NULL to use
  *    gtk_drag_dest_get_target_list (@widget).
  * 
  * Looks for a match between @context->targets and the
@@ -1830,7 +1844,7 @@ gtk_drag_find_widget (GtkWidget       *widget,
   gint x_offset = 0;
   gint y_offset = 0;
 
-  if (data->found || !GTK_WIDGET_MAPPED (widget) || !GTK_WIDGET_SENSITIVE (widget))
+  if (data->found || !gtk_widget_get_mapped (widget) || !gtk_widget_get_sensitive (widget))
     return;
 
   /* Note that in the following code, we only count the
@@ -1860,7 +1874,7 @@ gtk_drag_find_widget (GtkWidget       *widget,
       allocation_to_window_x = widget->allocation.x;
       allocation_to_window_y = widget->allocation.y;
 
-      if (!GTK_WIDGET_NO_WINDOW (widget))
+      if (gtk_widget_get_has_window (widget))
        {
          /* The allocation is relative to the parent window for
           * window widgets, not to widget->window.
@@ -1920,7 +1934,7 @@ gtk_drag_find_widget (GtkWidget       *widget,
          gtk_container_forall (GTK_CONTAINER (widget), prepend_and_ref_widget, &children);
          for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
            {
-             if (!new_data.found && GTK_WIDGET_DRAWABLE (tmp_list->data))
+             if (!new_data.found && gtk_widget_is_drawable (tmp_list->data))
                gtk_drag_find_widget (tmp_list->data, &new_data);
              g_object_unref (tmp_list->data);
            }
@@ -2065,7 +2079,7 @@ gtk_drag_dest_realized (GtkWidget *widget)
 {
   GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
 
-  if (GTK_WIDGET_TOPLEVEL (toplevel))
+  if (gtk_widget_is_toplevel (toplevel))
     gdk_window_register_dnd (toplevel->window);
 }
 
@@ -2075,7 +2089,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
 {
   GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
 
-  if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_WIDGET_REALIZED (toplevel))
+  if (gtk_widget_is_toplevel (toplevel) && GTK_WIDGET_REALIZED (toplevel))
     gdk_window_register_dnd (toplevel->window);
 }
 
@@ -2679,7 +2693,7 @@ gtk_drag_source_get_target_list (GtkWidget *widget)
 /**
  * gtk_drag_source_set_target_list:
  * @widget: a #GtkWidget that's a drag source
- * @target_list: list of draggable targets, or %NULL for none
+ * @target_list: (allow-none): list of draggable targets, or %NULL for none
  *
  * Changes the target types that this widget offers for drag-and-drop.
  * The widget must first be made into a drag source with
@@ -3035,7 +3049,7 @@ gtk_drag_update_icon (GtkDragSourceInfo *info)
                       info->cur_x - hot_x, 
                       info->cur_y - hot_y);
 
-      if (GTK_WIDGET_VISIBLE (icon_window))
+      if (gtk_widget_get_visible (icon_window))
        gdk_window_raise (icon_window->window);
       else
        gtk_widget_show (icon_window);
@@ -3257,7 +3271,7 @@ gtk_drag_set_icon_stock  (GdkDragContext *context,
  *            with a  context for the source side of a drag)
  * @colormap: the colormap of the icon 
  * @pixmap: the image data for the icon 
- * @mask: the transparency mask for the icon or %NULL for none.
+ * @mask: (allow-none): the transparency mask for the icon or %NULL for none.
  * @hot_x: the X offset within @pixmap of the hotspot.
  * @hot_y: the Y offset within @pixmap of the hotspot.
  *