void gimp_toolbox_dnd_init (GimpToolbox *toolbox, GtkWidget *vbox) { GimpContext *context = NULL; g_return_if_fail (GIMP_IS_TOOLBOX (toolbox)); g_return_if_fail (GTK_IS_BOX (vbox)); context = gimp_toolbox_get_context (toolbox); /* Before caling any dnd helper functions, setup the drag * destination manually since we want to handle all drag events * manually, otherwise we would not be able to give the drag handler * a chance to handle drag events */ gtk_drag_dest_set (vbox, 0, NULL, 0, GDK_ACTION_COPY | GDK_ACTION_MOVE); gimp_dnd_viewable_dest_add (vbox, GIMP_TYPE_LAYER, gimp_toolbox_drop_drawable, context); gimp_dnd_viewable_dest_add (vbox, GIMP_TYPE_LAYER_MASK, gimp_toolbox_drop_drawable, context); gimp_dnd_viewable_dest_add (vbox, GIMP_TYPE_CHANNEL, gimp_toolbox_drop_drawable, context); gimp_dnd_viewable_dest_add (vbox, GIMP_TYPE_TOOL_INFO, gimp_toolbox_drop_tool, context); gimp_dnd_viewable_dest_add (vbox, GIMP_TYPE_BUFFER, gimp_toolbox_drop_buffer, context); gimp_dnd_component_dest_add (vbox, gimp_toolbox_drop_component, context); gimp_dnd_uri_list_dest_add (vbox, gimp_toolbox_drop_uri_list, context); gimp_dnd_pixbuf_dest_add (vbox, gimp_toolbox_drop_pixbuf, context); }
void gimp_display_shell_dnd_init (GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); gimp_dnd_uri_list_dest_add (shell->canvas, gimp_display_shell_drop_uri_list, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_LAYER, gimp_display_shell_drop_drawable, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_LAYER_MASK, gimp_display_shell_drop_drawable, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_CHANNEL, gimp_display_shell_drop_drawable, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_VECTORS, gimp_display_shell_drop_vectors, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_PATTERN, gimp_display_shell_drop_pattern, shell); gimp_dnd_viewable_dest_add (shell->canvas, GIMP_TYPE_BUFFER, gimp_display_shell_drop_buffer, shell); gimp_dnd_color_dest_add (shell->canvas, gimp_display_shell_drop_color, shell); gimp_dnd_svg_dest_add (shell->canvas, gimp_display_shell_drop_svg, shell); gimp_dnd_component_dest_add (shell->canvas, gimp_display_shell_drop_component, shell); gimp_dnd_pixbuf_dest_add (shell->canvas, gimp_display_shell_drop_pixbuf, shell); }