drag and drop additions



Attached is a patch implementing the additions to drag and drop that I
mentioned in my earlier message.  Specifically I added four functions to
gtkdnd.h/.c:
void gtk_drag_dest_set_with_list   (GtkWidget            *widget,
     GtkDestDefaults       flags,
     GtkTargetList   *targets,
     GdkDragAction         actions);
gboolean gtk_drag_dest_get_info (GtkWidget* widget,
    GtkDestDefaults  *flags,
    GtkTargetList  **targets,
    GdkDragAction   *actions);
void gtk_drag_source_set_with_list  (GtkWidget            *widget,
      GdkModifierType       start_button_mask,
      GtkTargetList   *targets,
      GdkDragAction         actions);
gboolean gtk_drag_source_get_info (GtkWidget* widget,
       GdkModifierType       *start_button_mask,
       GtkTargetList   **targets,
       GdkDragAction         *actions);

The gtk_drag_*_set_with_list work just like the existing gtk_drag_*_set
functions except that they take a GtkTargetList argument instead of an
array of GtkTargetEntry's.  The gtk_drag_*_get_info functions return the
drag and drop info in the pointer arguments for the specified widget,
the return value will be TRUE when the widget is a drag destination (for
the dest function) or a source (for the source function) and
FALSE otherwise.  Note that the caller is responsible for freeing the
returned target list with gtk_target_list_unref.
I also added two functions to gtkselection.h/.c:
GtkTargetList *gtk_target_list_new_from_list       (GtkTargetList
*targets);
void           gtk_target_list_add_list (GtkTargetList        *list,
       GtkTargetList* targets);

The first creates a copy of the given target list and the second adds
targets from the given list (second argument) to another list (the first
argument).

Finally I modified testdnd (in the gtk/src directory) to test this new
functionality.
-brett

gtk-dnd-addition.patch.bz2



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]