Commit 70407d28 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer
Browse files

app/Makefile.am new file. Contains a function which creates dnd preview

1999-08-20  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/Makefile.am
	* app/gimpdnd.c: new file. Contains a function which creates dnd
	preview icons for all kinds of drawables.

	* app/gimpdnd.h: added the new dnd types.

	* app/channels_dialog.c: same dnd functions as in the layers
	dialog. Fixed channels_dialog_flush(). Code cleanup.

	* app/layers_dialog.c: enabled dnd for layer masks.

	* app/disp_callbacks.c
	* app/interface.c: dnd code generalization. The toolbox and the
	display accept drop of any kind of drawable now.

	* app/gimage.h
	* app/gimpimage.[ch]: new function gimp_image_position_channel().

	* app/layer.[ch]: new function layer_mask_get_layer().
parent 643e8f12
1999-08-20 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/Makefile.am
* app/gimpdnd.c: new file. Contains a function which creates dnd
preview icons for all kinds of drawables.
* app/gimpdnd.h: added the new dnd types.
* app/channels_dialog.c: same dnd functions as in the layers
dialog. Fixed channels_dialog_flush(). Code cleanup.
* app/layers_dialog.c: enabled dnd for layer masks.
* app/disp_callbacks.c
* app/interface.c: dnd code generalization. The toolbox and the
display accept drop of any kind of drawable now.
* app/gimage.h
* app/gimpimage.[ch]: new function gimp_image_position_channel().
* app/layer.[ch]: new function layer_mask_get_layer().
Fri Aug 20 02:17:18 1999 Jay Cox (jaycox@earthlink.net)
* app/apptypes.h: added InterpolationType enum.
......
......@@ -197,6 +197,7 @@ gimp_SOURCES = \
gimpbrushlistP.h \
gimpcontext.c \
gimpcontext.h \
gimpdnd.c \
gimpdnd.h \
gimphistogram.c \
gimphistogram.h \
......
This diff is collapsed.
......@@ -2125,7 +2125,6 @@ gimp_image_raise_layer (GimpImage *gimage,
return NULL;
}
Layer *
gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg)
......@@ -3043,7 +3042,7 @@ gimp_image_raise_channel (GimpImage *gimage,
Channel *prev_channel;
GSList *list;
GSList *prev;
int index = -1;
gint index = -1;
list = gimage->channels;
prev = NULL;
......@@ -3061,7 +3060,10 @@ gimp_image_raise_channel (GimpImage *gimage,
{
list->data = prev_channel;
prev->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return prev_channel;
}
else
......@@ -3088,7 +3090,7 @@ gimp_image_lower_channel (GimpImage *gimage,
Channel *next_channel;
GSList *list;
GSList *next;
int index = 0;
gint index = 0;
list = gimage->channels;
next_channel = NULL;
......@@ -3108,8 +3110,10 @@ gimp_image_lower_channel (GimpImage *gimage,
{
list->data = next_channel;
next->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return next_channel;
}
else
......@@ -3126,6 +3130,62 @@ gimp_image_lower_channel (GimpImage *gimage,
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
list = gimage->channels;
list_length = g_slist_length (list);
next = NULL;
channel = NULL;
index = 0;
/* find channel_arg */
while (list)
{
channel = (Channel *) list->data;
if (channel == channel_arg)
{
break;
}
list = g_slist_next (list);
index++;
}
if (channel != channel_arg)
{
/* The requested channel was not found in the channel stack
* Return without changing anything
*/
return NULL;
}
if (new_index < 0)
new_index = 0;
if (new_index >= list_length)
new_index = list_length - 1;
list = g_slist_remove (gimage->channels, channel);
gimage->channels = g_slist_insert (list, channel, new_index);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return channel;
}
Channel *
gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
......
......@@ -198,6 +198,7 @@ LayerMask * gimp_image_add_layer_mask (GimpImage *, Layer *, LayerMa
Channel * gimp_image_remove_layer_mask (GimpImage *, Layer *, int);
Channel * gimp_image_raise_channel (GimpImage *, Channel *);
Channel * gimp_image_lower_channel (GimpImage *, Channel *);
Channel * gimp_image_position_channel (GimpImage *, Channel *, gint);
Channel * gimp_image_add_channel (GimpImage *, Channel *, int);
Channel * gimp_image_remove_channel (GimpImage *, Channel *);
void gimp_image_construct (GimpImage *, int, int, int, int, gboolean);
......
......@@ -2125,7 +2125,6 @@ gimp_image_raise_layer (GimpImage *gimage,
return NULL;
}
Layer *
gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg)
......@@ -3043,7 +3042,7 @@ gimp_image_raise_channel (GimpImage *gimage,
Channel *prev_channel;
GSList *list;
GSList *prev;
int index = -1;
gint index = -1;
list = gimage->channels;
prev = NULL;
......@@ -3061,7 +3060,10 @@ gimp_image_raise_channel (GimpImage *gimage,
{
list->data = prev_channel;
prev->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return prev_channel;
}
else
......@@ -3088,7 +3090,7 @@ gimp_image_lower_channel (GimpImage *gimage,
Channel *next_channel;
GSList *list;
GSList *next;
int index = 0;
gint index = 0;
list = gimage->channels;
next_channel = NULL;
......@@ -3108,8 +3110,10 @@ gimp_image_lower_channel (GimpImage *gimage,
{
list->data = next_channel;
next->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return next_channel;
}
else
......@@ -3126,6 +3130,62 @@ gimp_image_lower_channel (GimpImage *gimage,
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
list = gimage->channels;
list_length = g_slist_length (list);
next = NULL;
channel = NULL;
index = 0;
/* find channel_arg */
while (list)
{
channel = (Channel *) list->data;
if (channel == channel_arg)
{
break;
}
list = g_slist_next (list);
index++;
}
if (channel != channel_arg)
{
/* The requested channel was not found in the channel stack
* Return without changing anything
*/
return NULL;
}
if (new_index < 0)
new_index = 0;
if (new_index >= list_length)
new_index = list_length - 1;
list = g_slist_remove (gimage->channels, channel);
gimage->channels = g_slist_insert (list, channel, new_index);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return channel;
}
Channel *
gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
......
......@@ -198,6 +198,7 @@ LayerMask * gimp_image_add_layer_mask (GimpImage *, Layer *, LayerMa
Channel * gimp_image_remove_layer_mask (GimpImage *, Layer *, int);
Channel * gimp_image_raise_channel (GimpImage *, Channel *);
Channel * gimp_image_lower_channel (GimpImage *, Channel *);
Channel * gimp_image_position_channel (GimpImage *, Channel *, gint);
Channel * gimp_image_add_channel (GimpImage *, Channel *, int);
Channel * gimp_image_remove_channel (GimpImage *, Channel *);
void gimp_image_construct (GimpImage *, int, int, int, int, gboolean);
......
......@@ -2125,7 +2125,6 @@ gimp_image_raise_layer (GimpImage *gimage,
return NULL;
}
Layer *
gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg)
......@@ -3043,7 +3042,7 @@ gimp_image_raise_channel (GimpImage *gimage,
Channel *prev_channel;
GSList *list;
GSList *prev;
int index = -1;
gint index = -1;
list = gimage->channels;
prev = NULL;
......@@ -3061,7 +3060,10 @@ gimp_image_raise_channel (GimpImage *gimage,
{
list->data = prev_channel;
prev->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return prev_channel;
}
else
......@@ -3088,7 +3090,7 @@ gimp_image_lower_channel (GimpImage *gimage,
Channel *next_channel;
GSList *list;
GSList *next;
int index = 0;
gint index = 0;
list = gimage->channels;
next_channel = NULL;
......@@ -3108,8 +3110,10 @@ gimp_image_lower_channel (GimpImage *gimage,
{
list->data = next_channel;
next->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return next_channel;
}
else
......@@ -3126,6 +3130,62 @@ gimp_image_lower_channel (GimpImage *gimage,
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
list = gimage->channels;
list_length = g_slist_length (list);
next = NULL;
channel = NULL;
index = 0;
/* find channel_arg */
while (list)
{
channel = (Channel *) list->data;
if (channel == channel_arg)
{
break;
}
list = g_slist_next (list);
index++;
}
if (channel != channel_arg)
{
/* The requested channel was not found in the channel stack
* Return without changing anything
*/
return NULL;
}
if (new_index < 0)
new_index = 0;
if (new_index >= list_length)
new_index = list_length - 1;
list = g_slist_remove (gimage->channels, channel);
gimage->channels = g_slist_insert (list, channel, new_index);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return channel;
}
Channel *
gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
......
......@@ -198,6 +198,7 @@ LayerMask * gimp_image_add_layer_mask (GimpImage *, Layer *, LayerMa
Channel * gimp_image_remove_layer_mask (GimpImage *, Layer *, int);
Channel * gimp_image_raise_channel (GimpImage *, Channel *);
Channel * gimp_image_lower_channel (GimpImage *, Channel *);
Channel * gimp_image_position_channel (GimpImage *, Channel *, gint);
Channel * gimp_image_add_channel (GimpImage *, Channel *, int);
Channel * gimp_image_remove_channel (GimpImage *, Channel *);
void gimp_image_construct (GimpImage *, int, int, int, int, gboolean);
......
......@@ -2125,7 +2125,6 @@ gimp_image_raise_layer (GimpImage *gimage,
return NULL;
}
Layer *
gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg)
......@@ -3043,7 +3042,7 @@ gimp_image_raise_channel (GimpImage *gimage,
Channel *prev_channel;
GSList *list;
GSList *prev;
int index = -1;
gint index = -1;
list = gimage->channels;
prev = NULL;
......@@ -3061,7 +3060,10 @@ gimp_image_raise_channel (GimpImage *gimage,
{
list->data = prev_channel;
prev->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return prev_channel;
}
else
......@@ -3088,7 +3090,7 @@ gimp_image_lower_channel (GimpImage *gimage,
Channel *next_channel;
GSList *list;
GSList *next;
int index = 0;
gint index = 0;
list = gimage->channels;
next_channel = NULL;
......@@ -3108,8 +3110,10 @@ gimp_image_lower_channel (GimpImage *gimage,
{
list->data = next_channel;
next->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return next_channel;
}
else
......@@ -3126,6 +3130,62 @@ gimp_image_lower_channel (GimpImage *gimage,
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
list = gimage->channels;
list_length = g_slist_length (list);
next = NULL;
channel = NULL;
index = 0;
/* find channel_arg */
while (list)
{
channel = (Channel *) list->data;
if (channel == channel_arg)
{
break;
}
list = g_slist_next (list);
index++;
}
if (channel != channel_arg)
{
/* The requested channel was not found in the channel stack
* Return without changing anything
*/
return NULL;
}
if (new_index < 0)
new_index = 0;
if (new_index >= list_length)
new_index = list_length - 1;
list = g_slist_remove (gimage->channels, channel);
gimage->channels = g_slist_insert (list, channel, new_index);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return channel;
}
Channel *
gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
......
......@@ -198,6 +198,7 @@ LayerMask * gimp_image_add_layer_mask (GimpImage *, Layer *, LayerMa
Channel * gimp_image_remove_layer_mask (GimpImage *, Layer *, int);
Channel * gimp_image_raise_channel (GimpImage *, Channel *);
Channel * gimp_image_lower_channel (GimpImage *, Channel *);
Channel * gimp_image_position_channel (GimpImage *, Channel *, gint);
Channel * gimp_image_add_channel (GimpImage *, Channel *, int);
Channel * gimp_image_remove_channel (GimpImage *, Channel *);
void gimp_image_construct (GimpImage *, int, int, int, int, gboolean);
......
......@@ -2125,7 +2125,6 @@ gimp_image_raise_layer (GimpImage *gimage,
return NULL;
}
Layer *
gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg)
......@@ -3043,7 +3042,7 @@ gimp_image_raise_channel (GimpImage *gimage,
Channel *prev_channel;
GSList *list;
GSList *prev;
int index = -1;
gint index = -1;
list = gimage->channels;
prev = NULL;
......@@ -3061,7 +3060,10 @@ gimp_image_raise_channel (GimpImage *gimage,
{
list->data = prev_channel;
prev->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return prev_channel;
}
else
......@@ -3088,7 +3090,7 @@ gimp_image_lower_channel (GimpImage *gimage,
Channel *next_channel;
GSList *list;
GSList *next;
int index = 0;
gint index = 0;
list = gimage->channels;
next_channel = NULL;
......@@ -3108,8 +3110,10 @@ gimp_image_lower_channel (GimpImage *gimage,
{
list->data = next_channel;
next->data = channel;
drawable_update (GIMP_DRAWABLE(channel), 0, 0, drawable_width (GIMP_DRAWABLE(channel)), drawable_height (GIMP_DRAWABLE(channel)));
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
drawable_width (GIMP_DRAWABLE (channel)),
drawable_height (GIMP_DRAWABLE (channel)));
return next_channel;
}
else
......@@ -3126,6 +3130,62 @@ gimp_image_lower_channel (GimpImage *gimage,
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
list = gimage->channels;
list_length = g_slist_length (list);
next = NULL;
channel = NULL;
index = 0;
/* find channel_arg */
while (list)
{
channel = (Channel *) list->data;
if (channel == channel_arg)
{
break;
}
list = g_slist_next (list);
index++;
}
if (channel != channel_arg)
{
/* The requested channel was not found in the channel stack
* Return without changing anything
*/
return NULL;
}
if (new_index < 0)
new_index = 0;
if (new_index >= list_length)
new_index = list_length - 1;
list = g_slist_remove (gimage->channels, channel);
gimage