Commit 107038e5 authored by Manish Singh's avatar Manish Singh
Browse files

pdbgened, header file removed

* app/layer_cmds.[ch]: pdbgened, header file removed

* app/internal_procs.c: use pdbgen register for layer funcs

* app/*_cmds.c: various pdbgen formatting fixes

* app/Makefile.am: removed layer_cmds.h

* app/layer.c
* app/layerF.h: changed AddMaskType enum to capitals

-Yosh
parent be584937
Sat Apr 24 13:28:13 PDT 1999 Manish Singh <yosh@gimp.org>
* app/layer_cmds.[ch]: pdbgened, header file removed
* app/internal_procs.c: use pdbgen register for layer funcs
* app/*_cmds.c: various pdbgen formatting fixes
* app/Makefile.am: removed layer_cmds.h
* app/layer.c
* app/layerF.h: changed AddMaskType enum to capitals
Sat Apr 24 11:30:34 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* app/plug_in.c (plug_in_open): Add OS/2 patches. Setting pipes
......
......@@ -243,7 +243,6 @@ gimp_SOURCES = \
layerF.h \
layer_pvt.h \
layer_cmds.c \
layer_cmds.h \
layer_select.c \
layer_select.h \
layers_dialog.c \
......
......@@ -92,7 +92,7 @@ brushes_popup_invoker (Argument *args)
{
if (brush && strlen (brush))
newdialog = brush_select_new (title, brush, opacity, spacing,
paint_mode);
paint_mode);
else
newdialog = brush_select_new (title, NULL, 0.0, 0, 0);
......@@ -269,11 +269,11 @@ brushes_set_popup_invoker (Argument *args)
bsp->spacing_data->value = bsp->spacing_value;
gtk_signal_emit_by_name (GTK_OBJECT (bsp->spacing_data),
"value_changed");
"value_changed");
bsp->opacity_data->value = bsp->opacity_value * 100.0;
gtk_signal_emit_by_name (GTK_OBJECT (bsp->opacity_data),
"value_changed");
"value_changed");
gtk_option_menu_set_history (GTK_OPTION_MENU (bsp->option_menu), bsp->paint_mode);
......
......@@ -515,10 +515,10 @@ brushes_get_brush_data_invoker (Argument *args)
brushp = (GimpBrushP) list->data;
if (!strcmp (brushp->name, name))
{
success = TRUE;
break;
}
{
success = TRUE;
break;
}
list = list->next;
}
......
......@@ -657,7 +657,7 @@ static ProcArg channel_set_opacity_inargs[] =
{
PDB_FLOAT,
"opacity",
"The new channel opacity"
"The new channel opacity (0 <= opacity <= 100)"
}
};
......
......@@ -98,19 +98,19 @@ brightness_contrast_invoker (Argument *args)
gimage = gimp_drawable_gimage (drawable);
lut = brightness_contrast_lut_new (brightness / 255.0,
contrast / 127.0,
gimp_drawable_bytes (drawable));
contrast / 127.0,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
......@@ -229,19 +229,19 @@ levels_invoker (Argument *args)
/* setup the lut */
lut = levels_lut_new (gamma, low_input, high_input,
low_output, high_output,
gimp_drawable_bytes (drawable));
low_output, high_output,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
......@@ -340,12 +340,12 @@ posterize_invoker (Argument *args)
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
......@@ -575,8 +575,8 @@ curves_spline_invoker (Argument *args)
for (i = 0; i < 5; i++)
for (j = 0; j < 17; j++)
{
cd.points[i][j][0] = -1;
cd.points[i][j][1] = -1;
cd.points[i][j][0] = -1;
cd.points[i][j][1] = -1;
}
cd.drawable = drawable;
......@@ -595,12 +595,12 @@ curves_spline_invoker (Argument *args)
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, cd.lut, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_lut_free (cd.lut);
gimp_drawable_merge_shadow (drawable, TRUE);
......@@ -698,17 +698,17 @@ curves_explicit_invoker (Argument *args)
cd.lut = gimp_lut_new ();
gimp_lut_setup (cd.lut, (GimpLutFunc) curves_lut_func,
(void *) &cd, gimp_drawable_bytes(drawable));
(void *) &cd, gimp_drawable_bytes(drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, cd.lut, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_lut_free (cd.lut);
gimp_drawable_merge_shadow (drawable, TRUE);
......@@ -821,9 +821,9 @@ color_balance_invoker (Argument *args)
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr;
pr = pixel_regions_process (pr))
......@@ -931,11 +931,11 @@ histogram_invoker (Argument *args)
htd.drawable = drawable;
htd.color = gimp_drawable_color (drawable);
htd.histogram = histogram_widget_new (HISTOGRAM_WIDTH,
HISTOGRAM_HEIGHT);
HISTOGRAM_HEIGHT);
gtk_signal_connect (GTK_OBJECT (htd.histogram), "rangechanged",
(GtkSignalFunc) histogram_tool_histogram_range,
(void*) &htd);
(GtkSignalFunc) histogram_tool_histogram_range,
(void*) &htd);
/* The information collection should occur only within selection bounds */
no_mask = (gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2) == FALSE);
......@@ -943,12 +943,12 @@ histogram_invoker (Argument *args)
/* Configure the src from the drawable data */
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
/* Configure the mask from the gimage's selection mask */
mask = gimage_get_mask (drawable_gimage (GIMP_DRAWABLE (drawable)));
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)),
x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE);
x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE);
/* Apply the image transformation to the pixels */
htd.hist = gimp_histogram_new ();
......@@ -959,7 +959,7 @@ histogram_invoker (Argument *args)
/* Calculate the statistics */
histogram_tool_histogram_range (htd.histogram, start_range, end_range,
&htd);
&htd);
}
}
......@@ -1111,9 +1111,9 @@ hue_saturation_invoker (Argument *args)
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr;
pr = pixel_regions_process (pr))
......@@ -1209,12 +1209,12 @@ threshold_invoker (Argument *args)
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) threshold_2, (void*) &td, 2,
&srcPR, &destPR);
&srcPR, &destPR);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
......
......@@ -222,7 +222,7 @@ convert_indexed_palette_invoker (Argument *args)
{
case MAKE_PALETTE:
if (num_cols < 1 || num_cols > MAXNUMCOLORS)
success = FALSE;
success = FALSE;
break;
case REUSE_PALETTE:
......@@ -232,22 +232,22 @@ convert_indexed_palette_invoker (Argument *args)
case CUSTOM_PALETTE:
if (!palette_entries_list)
palette_init_palettes (FALSE);
palette_init_palettes (FALSE);
for (list = palette_entries_list; list; list = list->next)
{
entries = (PaletteEntriesP) list->data;
if (!strcmp (palette_name, entries->name))
{
the_palette = entries;
break;
}
}
{
entries = (PaletteEntriesP) list->data;
if (!strcmp (palette_name, entries->name))
{
the_palette = entries;
break;
}
}
if (the_palette == NULL)
success = FALSE;
success = FALSE;
else
theCustomPalette = the_palette;
theCustomPalette = the_palette;
break;
......
......@@ -493,13 +493,13 @@ layer_create_mask (layer, add_mask_type)
switch (add_mask_type)
{
case WhiteMask:
case ADD_WHITE_MASK:
color_region (&maskPR, &white_mask);
break;
case BlackMask:
case ADD_BLACK_MASK:
color_region (&maskPR, &black_mask);
break;
case AlphaMask:
case ADD_ALPHA_MASK:
/* Extract the layer's alpha channel */
if (layer_has_alpha (layer))
{
......
......@@ -1047,7 +1047,7 @@ drawable_get_pixel_invoker (Argument *args)
pixel = g_new (gint8, num_channels);
tile = tile_manager_get_tile (drawable_data (drawable), x, y,
TRUE, TRUE);
TRUE, TRUE);
x %= TILE_WIDTH;
y %= TILE_WIDTH;
......@@ -1157,7 +1157,7 @@ drawable_set_pixel_invoker (Argument *args)
num_channels == drawable_bytes (drawable))
{
tile = tile_manager_get_tile (drawable_data (drawable), x, y,
TRUE, TRUE);
TRUE, TRUE);
x %= TILE_WIDTH;
y %= TILE_WIDTH;
......
......@@ -493,13 +493,13 @@ layer_create_mask (layer, add_mask_type)
switch (add_mask_type)
{
case WhiteMask:
case ADD_WHITE_MASK:
color_region (&maskPR, &white_mask);
break;
case BlackMask:
case ADD_BLACK_MASK:
color_region (&maskPR, &black_mask);
break;
case AlphaMask:
case ADD_ALPHA_MASK:
/* Extract the layer's alpha channel */
if (layer_has_alpha (layer))
{
......
......@@ -238,7 +238,7 @@ gradients_set_popup_invoker (Argument *args)
active = tmp->data;
if (!strcmp (gradient_name, active->name))
break; /* We found the one we want */
break; /* We found the one we want */
pos++;
tmp = tmp->next;
......@@ -320,10 +320,10 @@ gradients_get_gradient_data_invoker (Argument *args)
grad = list->data;
if (!strcmp (grad->name, name))
{
success = TRUE;
break; /* We found it! */
}
{
success = TRUE;
break; /* We found it! */
}
list = list->next;
}
......
......@@ -3473,7 +3473,7 @@ fill_white_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = WhiteMask;
options->add_mask_type = ADD_WHITE_MASK;
}
static void
......@@ -3483,7 +3483,7 @@ fill_black_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = BlackMask;
options->add_mask_type = ADD_BLACK_MASK;
}
static void
......@@ -3493,7 +3493,7 @@ fill_alpha_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = AlphaMask;
options->add_mask_type = ADD_ALPHA_MASK;
}
static void
......@@ -3528,7 +3528,7 @@ layers_dialog_add_mask_query (Layer *layer)
/* the new options structure */
options = (AddMaskOptions *) g_malloc (sizeof (AddMaskOptions));
options->layer = layer;
options->add_mask_type = WhiteMask;
options->add_mask_type = ADD_WHITE_MASK;
/* the dialog */
options->query_box = gtk_dialog_new ();
......
......@@ -22,7 +22,6 @@
#include "app_procs.h"
#include "gimage_cmds.h"
#include "gimage_mask_cmds.h"
#include "layer_cmds.h"
#include "internal_procs.h"
#include "procedural_db.h"
......@@ -52,6 +51,7 @@ void register_pattern_select_procs (void);
void register_parasite_procs (void);
void register_drawable_procs (void);
void register_procedural_db_procs (void);
void register_layer_procs (void);
void
internal_procs_init (void)
......@@ -178,36 +178,8 @@ internal_procs_init (void)
pcount/total_pcount);
/* Layer procedures */
procedural_db_register (&layer_new_proc); pcount++;
procedural_db_register (&layer_copy_proc); pcount++;
procedural_db_register (&layer_create_mask_proc); pcount++;
procedural_db_register (&layer_scale_proc); pcount++;
procedural_db_register (&layer_resize_proc); pcount++;
procedural_db_register (&layer_delete_proc); pcount++;
procedural_db_register (&layer_translate_proc); pcount++;
procedural_db_register (&layer_add_alpha_proc); pcount++;
procedural_db_register (&layer_get_name_proc); pcount++;
procedural_db_register (&layer_set_name_proc); pcount++;
procedural_db_register (&layer_get_visible_proc); pcount++;
procedural_db_register (&layer_set_visible_proc); pcount++;
procedural_db_register (&layer_get_preserve_trans_proc); pcount++;
procedural_db_register (&layer_set_preserve_trans_proc); pcount++;
procedural_db_register (&layer_get_apply_mask_proc); pcount++;
procedural_db_register (&layer_set_apply_mask_proc); pcount++;
procedural_db_register (&layer_get_show_mask_proc); pcount++;
procedural_db_register (&layer_set_show_mask_proc); pcount++;
procedural_db_register (&layer_get_edit_mask_proc); pcount++;
procedural_db_register (&layer_set_edit_mask_proc); pcount++;
procedural_db_register (&layer_get_opacity_proc); pcount++;
procedural_db_register (&layer_set_opacity_proc); pcount++;
procedural_db_register (&layer_get_mode_proc); pcount++;
procedural_db_register (&layer_set_mode_proc); pcount++;
procedural_db_register (&layer_set_offsets_proc); pcount++;
procedural_db_register (&layer_mask_proc); pcount++;
procedural_db_register (&layer_is_floating_sel_proc); pcount++;
procedural_db_register (&layer_get_tattoo_proc); pcount++;
procedural_db_register (&layer_get_linked_proc); pcount++;
procedural_db_register (&layer_set_linked_proc); pcount++;
register_layer_procs ();
pcount += 30;
app_init_update_status(NULL, _("Channel procedures"),
pcount/total_pcount);
......
......@@ -493,13 +493,13 @@ layer_create_mask (layer, add_mask_type)
switch (add_mask_type)
{
case WhiteMask:
case ADD_WHITE_MASK:
color_region (&maskPR, &white_mask);
break;
case BlackMask:
case ADD_BLACK_MASK:
color_region (&maskPR, &black_mask);
break;
case AlphaMask:
case ADD_ALPHA_MASK:
/* Extract the layer's alpha channel */
if (layer_has_alpha (layer))
{
......
#ifndef __LAYER_F_H__
#define __LAYER_F_H__
typedef enum
typedef enum /*< chop=ADD_ >*/
{
WhiteMask,
BlackMask,
AlphaMask
ADD_WHITE_MASK,
ADD_BLACK_MASK,
ADD_ALPHA_MASK
} AddMaskType;
typedef struct _GimpLayer GimpLayer;
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __LAYER_CMDS_H__
#define __LAYER_CMDS_H__
#include "procedural_db.h"
extern ProcRecord layer_new_proc;
extern ProcRecord layer_copy_proc;
extern ProcRecord layer_create_mask_proc;
extern ProcRecord layer_scale_proc;
extern ProcRecord layer_resize_proc;
extern ProcRecord layer_delete_proc;
extern ProcRecord layer_translate_proc;
extern ProcRecord layer_add_alpha_proc;
extern ProcRecord layer_get_name_proc;
extern ProcRecord layer_set_name_proc;
extern ProcRecord layer_get_visible_proc;
extern ProcRecord layer_set_visible_proc;
extern ProcRecord layer_get_preserve_trans_proc;
extern ProcRecord layer_set_preserve_trans_proc;
extern ProcRecord layer_get_apply_mask_proc;
extern ProcRecord layer_set_apply_mask_proc;
extern ProcRecord layer_get_show_mask_proc;
extern ProcRecord layer_set_show_mask_proc;
extern ProcRecord layer_get_edit_mask_proc;
extern ProcRecord layer_set_edit_mask_proc;
extern ProcRecord layer_get_opacity_proc;
extern ProcRecord layer_set_opacity_proc;
extern ProcRecord layer_get_mode_proc;
extern ProcRecord layer_set_mode_proc;
extern ProcRecord layer_set_offsets_proc;
extern ProcRecord layer_mask_proc;
extern ProcRecord layer_is_floating_sel_proc;
extern ProcRecord layer_get_tattoo_proc;
extern ProcRecord layer_get_linked_proc;
extern ProcRecord layer_set_linked_proc;
#endif /* __LAYER_CMDS_H__ */
......@@ -3473,7 +3473,7 @@ fill_white_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = WhiteMask;
options->add_mask_type = ADD_WHITE_MASK;
}
static void
......@@ -3483,7 +3483,7 @@ fill_black_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = BlackMask;
options->add_mask_type = ADD_BLACK_MASK;
}
static void
......@@ -3493,7 +3493,7 @@ fill_alpha_callback (GtkWidget *w,
AddMaskOptions *options;
options = (AddMaskOptions *) client_data;
options->add_mask_type = AlphaMask;
options->add_mask_type = ADD_ALPHA_MASK;
}
static void
......@@ -3528,7 +3528,7 @@ layers_dialog_add_mask_query (Layer *layer)
/* the new options structure */
options = (AddMaskOptions *) g_malloc (sizeof (AddMaskOptions));
options->layer = layer;
options->add_mask_type = WhiteMask;
options->add_mask_type = ADD_WHITE_MASK;
/* the dialog */
options->query_box = gtk_dialog_new ();
......
......@@ -166,7 +166,7 @@ path_get_points_invoker (Argument *args)