Commit d6116b8d authored by Manish Singh's avatar Manish Singh

new file (from pdbgen)

* text_tool_cmds.c: new file (from pdbgen)

* Makefile.am: add new file, use AM_CPPFLAGS instead of CPPFLAGS

* internal_procs.c: register pdbgened text_tool procs

* text_tool.c: remove PDB stuff, export text_render and
text_get_extents and SizeType and SUPERSAMPLE symbols

* text_tool.c: remove PDB stuff

* blend.[ch]
* bucket_fill.[ch]
* clone.[ch]
* convolve.[ch]: export some enums

* channel.h
* paint_core.h: #define->enum

* channel.c
* gimpparasite.c
* parasitelist.c
* pixel_processor.c: warning cleanup

* convert_cmds.c
* paths_cmds.c: slight pdbgen changes

-Yosh
parent 66c75cb5
Fri Apr 9 21:45:10 PDT 1999 Manish Singh <yosh@gimp.org>
* text_tool_cmds.c: new file (from pdbgen)
* Makefile.am: add new file, use AM_CPPFLAGS instead of CPPFLAGS
* internal_procs.c: register pdbgened text_tool procs
* text_tool.c: remove PDB stuff, export text_render and
text_get_extents and SizeType and SUPERSAMPLE symbols
* text_tool.c: remove PDB stuff
* blend.[ch]
* bucket_fill.[ch]
* clone.[ch]
* convolve.[ch]: export some enums
* channel.h
* paint_core.h: #define->enum
* channel.c
* gimpparasite.c
* parasitelist.c
* pixel_processor.c: warning cleanup
* convert_cmds.c
* paths_cmds.c: slight pdbgen changes
1999-04-09 Jay Cox <jaycox@earthlink.net>
* app/gimphistogramF.h: new file containing typedef for
......
......@@ -331,6 +331,7 @@ gimp_SOURCES = \
temp_buf.h \
text_tool.c \
text_tool.h \
text_tool_cmds.c \
threshold.c \
threshold.h \
tile.c \
......@@ -370,7 +371,7 @@ EXTRA_DIST = \
wilber.ico
CPPFLAGS = \
AM_CPPFLAGS = \
-DLIBDIR=\""$(gimpplugindir)"\" \
-DLOCALEDIR=\""$(localedir)"\" \
-DREGEX_MALLOC \
......
......@@ -133,7 +133,7 @@ do_parallel_regions(PixelProcessor *p_s)
static void
pixel_regions_do_parallel(PixelProcessor *p_s)
{
int i;
IF_THREAD(int i;)
IF_THREAD(int nthreads;)
IF_THREAD(pthread_t threads[MAX_THREADS];)
IF_THREAD(pthread_attr_t pthread_attr;)
......
......@@ -56,39 +56,6 @@
/* the blend structures */
typedef enum
{
Linear,
BiLinear,
Radial,
Square,
ConicalSymmetric,
ConicalAsymmetric,
ShapeburstAngular,
ShapeburstSpherical,
ShapeburstDimpled,
SpiralClockwise,
SpiralAntiClockwise,
GradientTypeLast
} GradientType;
typedef enum
{
FG_BG_RGB_MODE,
FG_BG_HSV_MODE,
FG_TRANS_MODE,
CUSTOM_MODE,
BLEND_MODE_LAST
} BlendMode;
typedef enum
{
REPEAT_NONE,
REPEAT_SAWTOOTH,
REPEAT_TRIANGULAR,
REPEAT_LAST
} RepeatMode;
typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
......
......@@ -21,6 +21,39 @@
#include "tools.h"
#include "procedural_db.h"
typedef enum
{
Linear,
BiLinear,
Radial,
Square,
ConicalSymmetric,
ConicalAsymmetric,
ShapeburstAngular,
ShapeburstSpherical,
ShapeburstDimpled,
SpiralClockwise,
SpiralAntiClockwise,
GradientTypeLast /*< skip >*/
} GradientType;
typedef enum
{
FG_BG_RGB_MODE,
FG_BG_HSV_MODE,
FG_TRANS_MODE,
CUSTOM_MODE,
BLEND_MODE_LAST /*< skip >*/
} BlendMode;
typedef enum
{
REPEAT_NONE,
REPEAT_SAWTOOTH,
REPEAT_TRIANGULAR,
REPEAT_LAST /*< skip >*/
} RepeatMode;
Tool * tools_new_blend (void);
void tools_free_blend (Tool *);
......
......@@ -36,13 +36,6 @@
/* the bucket fill structures */
typedef enum
{
FgColorFill,
BgColorFill,
PatternFill
} FillMode;
typedef struct _BucketTool BucketTool;
struct _BucketTool
{
......
......@@ -21,6 +21,13 @@
#include "tools.h"
#include "procedural_db.h"
typedef enum
{
FgColorFill,
BgColorFill,
PatternFill
} FillMode;
Tool * tools_new_bucket_fill (void);
void tools_free_bucket_fill (Tool *);
......
......@@ -825,7 +825,6 @@ channel_sub_segment (Channel *mask, int x, int y, int width, int value)
void
channel_combine_rect (Channel *mask, int op, int x, int y, int w, int h)
{
int i;
int x2, y2;
PixelRegion maskPR;
unsigned char color;
......
......@@ -27,10 +27,13 @@
/* OPERATIONS */
#define ADD 0
#define SUB 1
#define REPLACE 2
#define INTERSECT 3
typedef enum
{
ADD,
SUB,
REPLACE,
INTERSECT
} ChannelOps;
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......
......@@ -38,12 +38,6 @@
/* the clone structures */
typedef enum
{
ImageClone,
PatternClone
} CloneType;
typedef enum
{
AlignNo,
......
......@@ -22,6 +22,12 @@
#include "procedural_db.h"
#include "tools.h"
typedef enum
{
ImageClone,
PatternClone
} CloneType;
void * clone_paint_func (PaintCore *, GimpDrawable *, int);
Tool * tools_new_clone (void);
void tools_free_clone (Tool *);
......
......@@ -140,7 +140,7 @@ convert_indexed_invoker (Argument *args)
if (success)
{
success = (gimage_base_type (gimage) != INDEXED);
success = gimage_base_type (gimage) != INDEXED;
if (num_cols < 1 || num_cols > MAXNUMCOLORS)
success = FALSE;
......@@ -234,10 +234,10 @@ convert_indexed_palette_invoker (Argument *args)
if (!palette_entries_list)
palette_init_palettes (FALSE);
for (list = palette_entries_list; list; list = g_slist_next (list))
for (list = palette_entries_list; list; list = list->next)
{
entries = (PaletteEntriesP) list->data;
if (strcmp (palette_name, entries->name) == 0)
if (!strcmp (palette_name, entries->name))
{
the_palette = entries;
break;
......@@ -278,7 +278,7 @@ static ProcArg convert_indexed_palette_inargs[] =
{
PDB_INT32,
"palette_type",
"The type of palette to use: MAKE_PALETTE (0), REUSE_PALETTE (1), WEB_PALETTE (2), MONO_PALETTE (3), CUSTOM_PALETTE (4)"
"The type of palette to use: { MAKE_PALETTE (0), REUSE_PALETTE (1), WEB_PALETTE (2), MONO_PALETTE (3), CUSTOM_PALETTE (4) }"
},
{
PDB_INT32,
......
......@@ -39,13 +39,6 @@
/* the convolve structures */
typedef enum
{
Blur,
Sharpen,
Custom
} ConvolveType;
typedef struct _ConvolveOptions ConvolveOptions;
struct _ConvolveOptions
{
......
......@@ -22,6 +22,13 @@
#include "procedural_db.h"
#include "tools.h"
typedef enum
{
Blur,
Sharpen,
Custom
} ConvolveType;
void * convolve_paint_func (PaintCore *, GimpDrawable *, int);
Tool * tools_new_convolve (void);
void tools_free_convolve (Tool *);
......
......@@ -73,7 +73,7 @@ void
gimp_parasiterc_save()
{
FILE *fp;
guint32 num, version = 1;
guint32 version = 1;
if (!(fp = fopen(gimp_personal_rc_file ("#parasiterc.tmp"), "w")))
return;
version = GINT32_TO_BE(version);
......@@ -91,7 +91,7 @@ void
gimp_parasiterc_load()
{
FILE *fp;
guint32 num, version;
guint32 version;
if (!(fp = fopen(gimp_personal_rc_file ("parasiterc"), "r")))
return;
fread(&version, 4, 1, fp);
......
......@@ -825,7 +825,6 @@ channel_sub_segment (Channel *mask, int x, int y, int width, int value)
void
channel_combine_rect (Channel *mask, int op, int x, int y, int w, int h)
{
int i;
int x2, y2;
PixelRegion maskPR;
unsigned char color;
......
......@@ -27,10 +27,13 @@
/* OPERATIONS */
#define ADD 0
#define SUB 1
#define REPLACE 2
#define INTERSECT 3
typedef enum
{
ADD,
SUB,
REPLACE,
INTERSECT
} ChannelOps;
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......
......@@ -825,7 +825,6 @@ channel_sub_segment (Channel *mask, int x, int y, int width, int value)
void
channel_combine_rect (Channel *mask, int op, int x, int y, int w, int h)
{
int i;
int x2, y2;
PixelRegion maskPR;
unsigned char color;
......
......@@ -27,10 +27,13 @@
/* OPERATIONS */
#define ADD 0
#define SUB 1
#define REPLACE 2
#define INTERSECT 3
typedef enum
{
ADD,
SUB,
REPLACE,
INTERSECT
} ChannelOps;
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......
......@@ -56,39 +56,6 @@
/* the blend structures */
typedef enum
{
Linear,
BiLinear,
Radial,
Square,
ConicalSymmetric,
ConicalAsymmetric,
ShapeburstAngular,
ShapeburstSpherical,
ShapeburstDimpled,
SpiralClockwise,
SpiralAntiClockwise,
GradientTypeLast
} GradientType;
typedef enum
{
FG_BG_RGB_MODE,
FG_BG_HSV_MODE,
FG_TRANS_MODE,
CUSTOM_MODE,
BLEND_MODE_LAST
} BlendMode;
typedef enum
{
REPEAT_NONE,
REPEAT_SAWTOOTH,
REPEAT_TRIANGULAR,
REPEAT_LAST
} RepeatMode;
typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
......
......@@ -73,7 +73,7 @@ void
gimp_parasiterc_save()
{
FILE *fp;
guint32 num, version = 1;
guint32 version = 1;
if (!(fp = fopen(gimp_personal_rc_file ("#parasiterc.tmp"), "w")))
return;
version = GINT32_TO_BE(version);
......@@ -91,7 +91,7 @@ void
gimp_parasiterc_load()
{
FILE *fp;
guint32 num, version;
guint32 version;
if (!(fp = fopen(gimp_personal_rc_file ("parasiterc"), "r")))
return;
fread(&version, 4, 1, fp);
......
......@@ -239,7 +239,7 @@ void
parasite_list_load(ParasiteList *list, FILE *fp)
{
Parasite *p;
guint32 num, version;
guint32 num;
num = 0;
fread(&num, 4, 1, fp);
num = GINT32_FROM_BE(num);
......
......@@ -825,7 +825,6 @@ channel_sub_segment (Channel *mask, int x, int y, int width, int value)
void
channel_combine_rect (Channel *mask, int op, int x, int y, int w, int h)
{
int i;
int x2, y2;
PixelRegion maskPR;
unsigned char color;
......
......@@ -27,10 +27,13 @@
/* OPERATIONS */
#define ADD 0
#define SUB 1
#define REPLACE 2
#define INTERSECT 3
typedef enum
{
ADD,
SUB,
REPLACE,
INTERSECT
} ChannelOps;
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......
......@@ -73,7 +73,7 @@ void
gimp_parasiterc_save()
{
FILE *fp;
guint32 num, version = 1;
guint32 version = 1;
if (!(fp = fopen(gimp_personal_rc_file ("#parasiterc.tmp"), "w")))
return;
version = GINT32_TO_BE(version);
......@@ -91,7 +91,7 @@ void
gimp_parasiterc_load()
{
FILE *fp;
guint32 num, version;
guint32 version;
if (!(fp = fopen(gimp_personal_rc_file ("parasiterc"), "r")))
return;
fread(&version, 4, 1, fp);
......
......@@ -61,7 +61,6 @@
#include "rotate_tool.h"
#include "scale_tool.h"
#include "shear_tool.h"
#include "text_tool.h"
#include "threshold.h"
#include "parasite_cmds.h"
#include "procedural_db.h"
......@@ -74,8 +73,9 @@ void register_floating_sel_procs (void);
void register_undo_procs (void);
void register_convert_procs (void);
void register_paths_procs (void);
void register_palette_procs (void);
void register_unit_procs (void);
void register_palette_procs (void);
void register_unit_procs (void);
void register_text_tool_procs (void);
void
internal_procs_init ()
......@@ -111,13 +111,10 @@ internal_procs_init ()
procedural_db_register (&rotate_proc); pcount++;
procedural_db_register (&scale_proc); pcount++;
procedural_db_register (&shear_proc); pcount++;
procedural_db_register (&text_tool_proc); pcount++;
procedural_db_register (&text_tool_proc_ext); pcount++;
procedural_db_register (&text_tool_proc_fontname); pcount++;
procedural_db_register (&text_tool_get_extents_proc); pcount++;
procedural_db_register (&text_tool_get_extents_proc_ext); pcount++;
procedural_db_register (&text_tool_get_extents_proc_fontname); pcount++;
register_text_tool_procs ();
pcount += 6;
app_init_update_status(NULL, _("GDisplay procedures"),
pcount/total_pcount);
......
......@@ -38,12 +38,6 @@
/* the clone structures */
typedef enum
{
ImageClone,
PatternClone
} CloneType;
typedef enum
{
AlignNo,
......
......@@ -22,6 +22,12 @@
#include "procedural_db.h"
#include "tools.h"
typedef enum
{
ImageClone,
PatternClone
} CloneType;
void * clone_paint_func (PaintCore *, GimpDrawable *, int);
Tool * tools_new_clone (void);
void tools_free_clone (Tool *);
......
......@@ -39,13 +39,6 @@
/* the convolve structures */
typedef enum
{
Blur,
Sharpen,
Custom
} ConvolveType;
typedef struct _ConvolveOptions ConvolveOptions;
struct _ConvolveOptions
{
......
......@@ -22,6 +22,13 @@
#include "procedural_db.h"
#include "tools.h"
typedef enum
{
Blur,
Sharpen,
Custom
} ConvolveType;
void * convolve_paint_func (PaintCore *, GimpDrawable *, int);
Tool * tools_new_convolve (void);
void tools_free_convolve (Tool *);
......
......@@ -38,12 +38,6 @@
/* the clone structures */
typedef enum
{
ImageClone,
PatternClone
} CloneType;
typedef enum
{
AlignNo,
......
......@@ -22,6 +22,12 @@
#include "procedural_db.h"
#include "tools.h"
typedef enum
{
ImageClone,
PatternClone
} CloneType;
void * clone_paint_func (PaintCore *, GimpDrawable *, int);
Tool * tools_new_clone (void);
void tools_free_clone (Tool *);
......
......@@ -31,13 +31,19 @@
#define FINISH_PAINT 4
/* brush application types */
#define HARD 0 /* pencil */
#define SOFT 1 /* paintbrush */
#define PRESSURE 2 /* paintbrush with variable pressure */
typedef enum
{
HARD, /* pencil */
SOFT, /* paintbrush */
PRESSURE /* paintbrush with variable pressure */
} BrushApplicationMode;
/* paint application modes */
#define CONSTANT 0 /* pencil, paintbrush, airbrush, clone */
#define INCREMENTAL 1 /* convolve, smudge */
typedef enum
{
CONSTANT, /*< nick=CONTINUOUS >*/ /* pencil, paintbrush, airbrush, clone */
INCREMENTAL /* convolve, smudge */
} PaintApplicationMode;
/* gradient paint modes */
#define ONCE_FORWARD 0 /* paint through once, then stop */
......
......@@ -239,7 +239,7 @@ void
parasite_list_load(ParasiteList *list, FILE *fp)
{
Parasite *p;
guint32 num, version;
guint32 num;
num = 0;
fread(&num, 4, 1, fp);
num = GINT32_FROM_BE(num);
......
......@@ -165,7 +165,7 @@ path_get_points_invoker (Argument *args)
{
pptr = pl->data;
if (strcmp (pname, pptr->name->str) == 0)
if (!strcmp (pname, pptr->name->str))
break; /* Found the path */
pl = pl->next;
......@@ -542,6 +542,8 @@ path_get_point_at_dist_invoker (Argument *args)
gint32 x_point = 0;
gint32 y_point = 0;
gdouble gradient = 0;
PathsList *plist;
PATHP pptr = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
......@@ -551,27 +553,18 @@ path_get_point_at_dist_invoker (Argument *args)
if (success)
{
/* Get the path with the given name */
PathsList *plist = gimage->paths;
if(plist && plist->bz_paths)
{
PATHP pptr = NULL;
if(plist->last_selected_row >= 0)
{
pptr = (PATHP)g_slist_nth_data(plist->bz_paths,plist->last_selected_row);
success = paths_distance(pptr,distance,&x_point,&y_point,&gradient);
}
else
{
success = FALSE;
}
}
else
{
success = FALSE;
}
/* Get the path with the given name */
plist = gimage->paths;
if (plist && plist->bz_paths && plist->last_selected_row >= 0)
{
pptr = (PATHP) g_slist_nth_data (plist->bz_paths,
plist->last_selected_row);
success = paths_distance (pptr, distance, &x_point, &y_point,
&gradient);
}
else
success = FALSE;
}
return_args = procedural_db_return_args (&path_get_point_at_dist_proc, success);
......@@ -622,7 +615,7 @@ static ProcArg path_get_point_at_dist_outargs[] =
static ProcRecord path_get_point_at_dist_proc =
{
"gimp_path_get_point_at_dist",
"Get point on a path at a specified distance along the path",
"Get point on a path at a specified distance along the path.",
"This will return the x,y position of a point at a given distance along the bezier curve. The distance will the obtained by first digitizing the curve internally an then walking along the curve. For a closed curve the start of the path is the first point on the path that was created. This might not be obvious. Note the current path is used.",
"Andy Thomas",
"Andy Thomas",
......@@ -644,6 +637,7 @@ path_get_tattoo_invoker (Argument *args)