app: add multi-vectors drag'n drop ability.

This commit is contained in:
Jehan 2021-06-21 22:32:25 +02:00
parent 5c63c2478f
commit d774a8ff9d
4 changed files with 22 additions and 3 deletions

View File

@ -208,6 +208,7 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
case GIMP_DND_TYPE_CHANNEL_LIST:
case GIMP_DND_TYPE_LAYER_LIST:
case GIMP_DND_TYPE_VECTORS_LIST:
/* Various GimpViewable list (GList) drag data. */
{
GtkWidget *src_widget = gtk_drag_get_source_widget (context);

View File

@ -657,6 +657,20 @@ static const GimpDndDataDef dnd_data_defs[] =
gimp_dnd_set_item_list_data,
},
{
GIMP_TARGET_VECTORS_LIST,
"gimp-dnd-get-vectors-list-func",
"gimp-dnd-get-vectors-list-data",
"gimp-dnd-set-vectors-list-func",
"gimp-dnd-set-vectors-list-data",
gimp_dnd_get_viewable_list_icon,
gimp_dnd_get_item_list_data,
gimp_dnd_set_item_list_data,
},
};
@ -1934,9 +1948,9 @@ gimp_dnd_data_type_get_by_g_type (GType type,
{
dnd_type = list ? GIMP_DND_TYPE_CHANNEL_LIST : GIMP_DND_TYPE_CHANNEL;
}
else if (g_type_is_a (type, GIMP_TYPE_VECTORS) && ! list)
else if (g_type_is_a (type, GIMP_TYPE_VECTORS))
{
dnd_type = GIMP_DND_TYPE_VECTORS;
dnd_type = list ? GIMP_DND_TYPE_VECTORS_LIST : GIMP_DND_TYPE_VECTORS;
}
else if (g_type_is_a (type, GIMP_TYPE_BRUSH) && ! list)
{

View File

@ -100,6 +100,9 @@
#define GIMP_TARGET_CHANNEL_LIST \
{ "application/x-gimp-channel-list", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_CHANNEL_LIST }
#define GIMP_TARGET_VECTORS_LIST \
{ "application/x-gimp-vectors-list", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_VECTORS_LIST }
/* dnd initialization */
void gimp_dnd_init (Gimp *gimp);

View File

@ -169,8 +169,9 @@ typedef enum /*< skip >*/
GIMP_DND_TYPE_LAYER_LIST = 25,
GIMP_DND_TYPE_CHANNEL_LIST = 26,
GIMP_DND_TYPE_VECTORS_LIST = 27,
GIMP_DND_TYPE_LAST = GIMP_DND_TYPE_CHANNEL_LIST
GIMP_DND_TYPE_LAST = GIMP_DND_TYPE_VECTORS_LIST
} GimpDndType;
typedef enum /*< skip >*/