Commit 227eea67 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/Makefile.am new file.

2001-01-29  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/undo_history.h: new file.

	* app/apptypes.h: removed the "Channel" typedef.

	* app/channel.[ch]: renamed all functions to gimp_channel_*()

	* app/channel_ops.c
	* app/channels_dialog.c
	* app/commands.c
	* app/disp_callbacks.c
	* app/gdisplay.c
	* app/gimage_mask.[ch]
	* app/gimpdnd.c
	* app/gimphistogram.c
	* app/gimpimage.[ch]
	* app/global_edit.c
	* app/layer.c
	* app/layers_dialog.c
	* app/qmask.c
	* app/scan_convert.c
	* app/scan_convert.h
	* app/toolbox.c
	* app/undo.[ch]
	* app/undo_history.c
	* app/xcf.[ch]
	* app/pdb/channel_cmds.c
	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/pdb_glue.h
	* app/pdb/selection_cmds.c
	* app/pdb/tools_cmds.c
	* app/tools/bezier_select.c
	* app/tools/bezier_selectP.h
	* app/tools/blend.c
	* app/tools/bucket_fill.c
	* app/tools/by_color_select.c
	* app/tools/crop.c
	* app/tools/ellipse_select.c
	* app/tools/free_select.c
	* app/tools/fuzzy_select.c
	* app/tools/fuzzy_select.h
	* app/tools/iscissors.c
	* app/tools/rect_select.c
	* app/tools/text_tool.c
	* app/tools/transform_core.c
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/tools.pdb: changed accordingly.
parent d3dcfadc
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/undo_history.h: new file.
* app/apptypes.h: removed the "Channel" typedef.
* app/channel.[ch]: renamed all functions to gimp_channel_*()
* app/channel_ops.c
* app/channels_dialog.c
* app/commands.c
* app/disp_callbacks.c
* app/gdisplay.c
* app/gimage_mask.[ch]
* app/gimpdnd.c
* app/gimphistogram.c
* app/gimpimage.[ch]
* app/global_edit.c
* app/layer.c
* app/layers_dialog.c
* app/qmask.c
* app/scan_convert.c
* app/scan_convert.h
* app/toolbox.c
* app/undo.[ch]
* app/undo_history.c
* app/xcf.[ch]
* app/pdb/channel_cmds.c
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* app/pdb/pdb_glue.h
* app/pdb/selection_cmds.c
* app/pdb/tools_cmds.c
* app/tools/bezier_select.c
* app/tools/bezier_selectP.h
* app/tools/blend.c
* app/tools/bucket_fill.c
* app/tools/by_color_select.c
* app/tools/crop.c
* app/tools/ellipse_select.c
* app/tools/free_select.c
* app/tools/fuzzy_select.c
* app/tools/fuzzy_select.h
* app/tools/iscissors.c
* app/tools/rect_select.c
* app/tools/text_tool.c
* app/tools/transform_core.c
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/tools.pdb: changed accordingly.
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/pdb/Makefile.am
......
......@@ -276,6 +276,7 @@ gimp_SOURCES = \
undo.c \
undo.h \
undo_history.c \
undo_history.h \
undo_types.h \
unitrc.h \
user_install.c \
......
......@@ -73,6 +73,7 @@
#include "selection.h"
#include "tips_dialog.h"
#include "undo.h"
#include "undo_history.h"
#ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h"
......
......@@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
......@@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg));
gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
......@@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
......@@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
channel->color = color;
channel_update (channel);
gimp_channel_update (channel);
}
}
......
......@@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
......@@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg));
gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
......@@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
......@@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
channel->color = color;
channel_update (channel);
gimp_channel_update (channel);
}
}
......
......@@ -44,7 +44,6 @@ typedef struct _GimpContext GimpContext;
typedef struct _GimpDrawable GimpDrawable;
typedef struct _GimpChannel GimpChannel;
typedef GimpChannel Channel; /* convenience */
typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask;
......
......@@ -365,8 +365,8 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram,
if (!no_mask)
{
Channel *sel_mask;
GimpImage *gimage;
GimpChannel *sel_mask;
GimpImage *gimage;
gimage = gimp_drawable_gimage (drawable);
sel_mask = gimp_image_get_mask (gimage);
......
This diff is collapsed.
......@@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNEL_H__
#define __CHANNEL_H__
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
......@@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
......@@ -63,21 +62,18 @@ struct _GimpChannelClass
};
/* Special undo types */
/* Special undo type */
typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo
{
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */
GimpChannel *prev_channel; /* previous active channel */
};
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo
{
TileManager *tiles; /* the actual mask */
......@@ -87,128 +83,128 @@ struct _MaskUndo
/* function declarations */
GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
Channel * channel_copy (const Channel *channel);
gint channel_get_opacity (const Channel *channel);
void channel_set_opacity (Channel *channel,
gint opacity);
const GimpRGB * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const GimpRGB *color);
void channel_scale (Channel *channel,
gint new_width,
gint new_height);
void channel_resize (Channel *channel,
gint new_width,
gint new_height,
gint offx,
gint offy);
void channel_update (Channel *channel);
GtkType gimp_channel_get_type (void);
GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color);
void gimp_channel_scale (GimpChannel *channel,
gint new_width,
gint new_height);
void gimp_channel_resize (GimpChannel *channel,
gint new_width,
gint new_height,
gint offx,
gint offy);
void gimp_channel_update (GimpChannel *channel);
/* access functions */
gboolean channel_toggle_visibility (Channel *channel);
TempBuf * channel_preview (Channel *channel,
gint width,
gint height);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width,
gint height);
/* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage,
gint width,
gint height);
gboolean channel_boundary (Channel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean channel_bounds (Channel *mask,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint channel_value (Channel *mask,
gint x,
gint y);
gboolean channel_is_empty (Channel *mask);
void channel_add_segment (Channel *mask,
gint x,
gint y,
gint width,
gint value);
void channel_sub_segment (Channel *mask,
gint x,
gint y,
gint width,
gint value);
void channel_combine_rect (Channel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h);
void channel_combine_ellipse (Channel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h,
gboolean antialias);
void channel_combine_mask (Channel *mask,
Channel *add_on,
ChannelOps op,
gint off_x,
gint off_y);
void channel_feather (Channel *input,
Channel *output,
gdouble radius_x,
gdouble radius_y,
ChannelOps op,
gint off_x,
gint off_y);
void channel_push_undo (Channel *mask);
void channel_clear (Channel *mask);
void channel_invert (Channel *mask);
void channel_sharpen (Channel *mask);
void channel_all (Channel *mask);
void channel_border (Channel *mask,
gint radius_x,
gint radius_y);
void channel_grow (Channel *mask,
gint radius_x,
gint radius_y);
void channel_shrink (Channel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock);
void channel_translate (Channel *mask,
gint off_x,
gint off_y);
void channel_load (Channel *mask,
Channel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel);
#endif /* __CHANNEL_H__ */
GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint gimp_channel_value (GimpChannel *mask,
gint x,
gint y);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
gint width,
gint value);
void gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
gint width,
gint value);
void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h);
void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h,
gboolean antialias);
void gimp_channel_combine_mask (GimpChannel *mask,
GimpChannel *add_on,
ChannelOps op,
gint off_x,
gint off_y);
void gimp_channel_feather (GimpChannel *input,
GimpChannel *output,
gdouble radius_x,
gdouble radius_y,
ChannelOps op,
gint off_x,
gint off_y);
void gimp_channel_push_undo (GimpChannel *mask);
void gimp_channel_clear (GimpChannel *mask);
void gimp_channel_invert (GimpChannel *mask);
void gimp_channel_sharpen (GimpChannel *mask);
void gimp_channel_all (GimpChannel *mask);
void gimp_channel_border (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_shrink (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock);
void gimp_channel_translate (GimpChannel *mask,
gint off_x,
gint off_y);
void gimp_channel_load (GimpChannel *mask,
GimpChannel *channel);
void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer);
void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer);
void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __GIMP_CHANNEL_H__ */
......@@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
......@@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
list = g_slist_next (list);
new_channel = channel_copy (channel);
new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel),
......
......@@ -81,7 +81,7 @@ struct _ChannelsDialog
gint base_type;
ChannelType components[3];
Channel *active_channel;
GimpChannel *active_channel;
GimpLayer *floating_sel;
GSList *channel_widgets;
};
......@@ -100,7 +100,7 @@ struct _ChannelWidget
/* state information */
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gint width, height;
ChannelType type;
......@@ -115,9 +115,9 @@ static void channels_dialog_preview_extents (void);
static void channels_dialog_set_menu_sensitivity (void);
static void channels_dialog_set_channel (ChannelWidget *cw);
static void channels_dialog_unset_channel (ChannelWidget *cw);
static void channels_dialog_position_channel (Channel *channel,
static void channels_dialog_position_channel (GimpChannel *channel,
gint position);
static void channels_dialog_add_channel (Channel *channel);
static void channels_dialog_add_channel (GimpChannel *channel);
static void channels_dialog_remove_channel (ChannelWidget *cw);
static gint channel_list_events (GtkWidget *widget,
......@@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback
guint time);
/* channel widget function prototypes */
static ChannelWidget * channel_widget_get_ID (Channel *channel);
static ChannelWidget * channel_widget_get_ID (GimpChannel *channel);
static ChannelWidget * channel_widget_create (GimpImage *gimage,
Channel *channel,
GimpChannel *channel,
ChannelType channel_type);
static gboolean channel_widget_drag_motion_callback
......@@ -410,7 +410,7 @@ void
channels_dialog_free (void)
{
ChannelWidget *cw;
GSList *list;
GSList *list;
if (!channelsD)
return;
......@@ -441,7 +441,7 @@ channels_dialog_free (void)
void
channels_dialog_update (GimpImage* gimage)
{
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
GList *item_list;
......@@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage)
for (list = gimage->channels; list; list = g_slist_next (list))
{
/* create a channel list item */
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL);
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
channelsD->channel_widgets =
g_slist_append (channelsD->channel_widgets, cw);
item_list = g_list_append (item_list, cw->list_item);
}
......@@ -532,7 +534,7 @@ void
channels_dialog_flush (void)
{
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
gint pos;
......@@ -560,7 +562,7 @@ channels_dialog_flush (void)
/* Add any missing channels */
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
cw = channel_widget_get_ID (channel);
/* If the channel isn't in the channel widget list, add it */
......@@ -590,7 +592,7 @@ channels_dialog_flush (void)
pos = 0;
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
channels_dialog_position_channel (channel, pos++);
}
......@@ -659,8 +661,8 @@ static void
channels_dialog_set_menu_sensitivity (void)
{
ChannelWidget *cw;
gint fs_sens;
gint aux_sens;
gint fs_sens;
gint aux_sens;
cw = channel_widget_get_ID (channelsD->active_channel);
fs_sens = (channelsD->floating_sel != NULL);
......@@ -843,11 +845,11 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget)
}
static void
channels_dialog_position_channel (Channel *channel,
gint new_index)
channels_dialog_position_channel (GimpChannel *channel,
gint new_index)
{
ChannelWidget *channel_widget;
GList *list = NULL;
GList *list = NULL;
channel_widget = channel_widget_get_ID (channel);
if (!channelsD || !channel_widget)
......@@ -881,12 +883,12 @@ channels_dialog_position_channel (Channel *channel,
}
static void
channels_dialog_add_channel (Channel *channel)
channels_dialog_add_channel (GimpChannel *channel)
{
ChannelWidget *channel_widget;
GimpImage *gimage;
GList *item_list;
gint position;
GimpImage *gimage;
GList *item_list;
gint position;
if (!channelsD || !channel || !(gimage = channelsD->gimage))
return;
......@@ -1042,16 +1044,16 @@ void
channels_dialog_duplicate_channel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (active_channel);
new_channel = gimp_channel_copy (active_channel);
gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush ();
}
......@@ -1093,20 +1095,20 @@ void
channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;