Commit 395cdc5b authored by Manish Singh's avatar Manish Singh
Browse files

#include <gtk/gtk.h>

* tools.h: #include <gtk/gtk.h>

* toolsF.h: #include <gdk/gdk.h>

* perspective_tool.c: #include <stdio.h>

* gimphistogram.c: #ifdefed a var for threads

* gimpimage.h: added chop hint to GimpImageType enum

* paint_funcs.h: made layer mode #defines an enum

* palette.c
* gimpunit.c: removed PDB stuff

* gimpunit_cmds.h: removed

* convert_cmds.c
* paths_cmds.c: pdbgen updates

* palette_cmds.c
* unit_cmds.c: new files

* app/internal_procs.c: use the pdbgen register_foo functions

* app/Makefile.am: changes for the above

-Yosh
parent 9024860b
Sat Apr 3 22:58:17 PST 1999 Manish Singh <yosh@gimp.org>
* tools.h: #include <gtk/gtk.h>
* toolsF.h: #include <gdk/gdk.h>
* perspective_tool.c: #include <stdio.h>
* gimphistogram.c: #ifdefed a var for threads
* gimpimage.h: added chop hint to GimpImageType enum
* paint_funcs.h: made layer mode #defines an enum
* palette.c
* gimpunit.c: removed PDB stuff
* gimpunit_cmds.h: removed
* convert_cmds.c
* paths_cmds.c: pdbgen updates
* palette_cmds.c
* unit_cmds.c: new files
* app/internal_procs.c: use the pdbgen register_foo functions
* app/Makefile.am: changes for the above
Sat Apr 3 20:42:48 1999 ape@spacetec.no (Asbjorn Pettersen)
* app/paintbrush.c: Skip // comments.
......
......@@ -198,7 +198,6 @@ gimp_SOURCES = \
gimphistogram.h \
gimphistogramP.h \
gimpunit.c \
gimpunit_cmds.h \
global_edit.c \
global_edit.h \
gradient.c \
......@@ -261,6 +260,7 @@ gimp_SOURCES = \
palette.c \
palette_entries.h \
palette.h \
palette_cmds.c \
palette_select.c \
palette_select.h \
paint_core.c \
......@@ -350,6 +350,7 @@ gimp_SOURCES = \
undo.h \
undo_cmds.c \
unitrc.h \
unit_cmds.c \
wilber.h \
vector2d.c \
vector2d.h \
......
......@@ -234,7 +234,10 @@ void
gimp_histogram_calculate (GimpHistogram *histogram, PixelRegion *region,
PixelRegion *mask)
{
int i, j, k;
int i, j;
#ifdef ENABLE_MP
int k;
#endif
gimp_histogram_alloc(histogram, region->bytes);
......
......@@ -207,11 +207,9 @@ convert_indexed_palette_invoker (Argument *args)
num_cols = args[3].value.pdb_int;
if (success)
{
palette_name = (gchar *) args[4].value.pdb_pointer;
success = palette_name != NULL;
}
palette_name = (gchar *) args[4].value.pdb_pointer;
if (palette_name == NULL)
success = FALSE;
if (success)
{
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -24,14 +24,14 @@
/* the image types */
typedef enum
typedef enum /*< chop=_GIMAGE >*/
{
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
RGB_GIMAGE,
RGBA_GIMAGE,
GRAY_GIMAGE,
GRAYA_GIMAGE,
INDEXED_GIMAGE,
INDEXEDA_GIMAGE
} GimpImageType;
......
......@@ -30,7 +30,6 @@
#include "libgimp/gimpunit.h"
#include "unitrc.h"
#include "gimpunit_cmds.h"
#include "app_procs.h"
#include "gimprc.h"
......@@ -69,8 +68,6 @@ static GimpUnitDef gimp_unit_defs[UNIT_END] =
static GSList* user_units = NULL;
static gint number_of_user_units = 0;
static int success;
/* private functions */
static GimpUnitDef *
......@@ -295,672 +292,3 @@ void save_unitrc (void)
fclose (fp);
}
/* PDB stuff **********/
/********************************
* GIMP_UNIT_GET_NUMBER_OF_UNITS
*/
static Argument *
gimp_unit_get_number_of_units_invoker (Argument *args)
{
Argument *return_args;
return_args= procedural_db_return_args(&gimp_unit_get_number_of_units_proc,
TRUE);
return_args[1].value.pdb_int = gimp_unit_get_number_of_units ();
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_get_number_of_units_out_args[] =
{
{ PDB_INT32,
"#units",
"the number of units"
}
};
ProcRecord gimp_unit_get_number_of_units_proc =
{
"gimp_unit_get_number_of_units",
"Returns the number of units",
"This procedure returns the number of defined units.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
0, NULL,
1, gimp_unit_get_number_of_units_out_args,
/* Exec method */
{ { gimp_unit_get_number_of_units_invoker } },
};
/******************************
* GIMP_UNIT_NEW
*/
static Argument *
gimp_unit_new_invoker (Argument *args)
{
Argument *return_args;
return_args= procedural_db_return_args(&gimp_unit_new_proc, TRUE);
return_args[1].value.pdb_int =
gimp_unit_new (g_strdup (args[0].value.pdb_pointer),
args[1].value.pdb_float,
args[2].value.pdb_int,
g_strdup (args[3].value.pdb_pointer),
g_strdup (args[4].value.pdb_pointer),
g_strdup (args[5].value.pdb_pointer),
g_strdup (args[6].value.pdb_pointer));
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_new_args[] =
{
{ PDB_STRING,
"identifier",
"the new unit's identifier"
},
{ PDB_FLOAT,
"factor",
"the new unit's factor"
},
{ PDB_INT32,
"digits",
"the new unit's digits"
},
{ PDB_STRING,
"symbol",
"the new unit's symbol"
},
{ PDB_STRING,
"abbreviation",
"the new unit's abbreviation"
},
{ PDB_STRING,
"singular",
"the new unit's singular form"
},
{ PDB_STRING,
"plural",
"the new unit's plural form"
}
};
ProcArg gimp_unit_new_out_args[] =
{
{ PDB_INT32,
"unit ID",
"the new unit's ID",
}
};
ProcRecord gimp_unit_new_proc =
{
"gimp_unit_new",
"Creates a new unit and returns it's integer ID",
"This procedure creates a new unit and returns it's integer ID. Note that the new unit will have it's deletion flag set to TRUE, so you will have to set it to FALSE with gimp_unit_set_deletion_flag to make it persistent.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
7, gimp_unit_new_args,
1, gimp_unit_new_out_args,
/* Exec method */
{ { gimp_unit_new_invoker } },
};
/******************************
* GIMP_UNIT_GET_DELETION_FLAG
*/
static Argument *
gimp_unit_get_deletion_flag_invoker (Argument *args)
{
Argument *return_args;
GUnit unit;
success = TRUE;
unit = args[0].value.pdb_int;
if ((unit < UNIT_PIXEL) || (unit >= gimp_unit_get_number_of_units ()))
success = FALSE;
return_args= procedural_db_return_args(&gimp_unit_get_deletion_flag_proc,
success);
if (success)
return_args[1].value.pdb_int = gimp_unit_get_deletion_flag (unit);
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_get_deletion_flag_args[] =
{
{ PDB_INT32,
"unit ID",
"the unit's integer ID"
}
};
ProcArg gimp_unit_get_deletion_flag_out_args[] =
{
{ PDB_INT32,
"boolean",
"the unit's deletion flag",
}
};
ProcRecord gimp_unit_get_deletion_flag_proc =
{
"gimp_unit_get_deletion_flag",
"Returns the deletion flag of the unit",
"This procedure returns the deletion flag of the unit. If this value is TRUE the unit's definition will not be saved in the user's unitrc file on gimp exit.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
1, gimp_unit_get_deletion_flag_args,
1, gimp_unit_get_deletion_flag_out_args,
/* Exec method */
{ { gimp_unit_get_deletion_flag_invoker } },
};
/******************************
* GIMP_UNIT_SET_DELETION_FLAG
*/
static Argument *
gimp_unit_set_deletion_flag_invoker (Argument *args)
{
Argument *return_args;
GUnit unit;
success = TRUE;
unit = args[0].value.pdb_int;
if ((unit < UNIT_END) || (unit >= gimp_unit_get_number_of_units ()))
success = FALSE;
else
gimp_unit_set_deletion_flag (unit, args[1].value.pdb_int);
return_args= procedural_db_return_args(&gimp_unit_set_deletion_flag_proc,
success);
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_set_deletion_flag_args[] =
{
{ PDB_INT32,
"unit ID",
"the unit's integer ID"
},
{ PDB_INT32,
"boolean",
"the new deletion flag of the unit",
}
};
ProcRecord gimp_unit_set_deletion_flag_proc =
{
"gimp_unit_set_deletion_flag",
"Sets the deletion flag of a unit",
"This procedure sets the unit's deletion flag. If the deletion flag of a unit is TRUE on gimp exit, this unit's definition will not be saved in the user's unitrc.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
2, gimp_unit_set_deletion_flag_args,
0, NULL,
/* Exec method */
{ { gimp_unit_set_deletion_flag_invoker } },
};
/******************************
* GIMP_UNIT_GET_IDENTIFIER
*/
static Argument *
gimp_unit_get_identifier_invoker (Argument *args)
{
Argument *return_args;
GUnit unit;
success = TRUE;
unit = args[0].value.pdb_int;
if ((unit < UNIT_PIXEL) || (unit >= gimp_unit_get_number_of_units ()))
success = FALSE;
return_args= procedural_db_return_args(&gimp_unit_get_identifier_proc,
success);
return_args[1].value.pdb_pointer =
success ? g_strdup (gimp_unit_get_identifier (unit)) : NULL;
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_get_identifier_args[] =
{
{ PDB_INT32,
"unit ID",
"the unit's integer ID"
}
};
ProcArg gimp_unit_get_identifier_out_args[] =
{
{ PDB_STRING,
"string",
"the unit's textual identifier",
}
};
ProcRecord gimp_unit_get_identifier_proc =
{
"gimp_unit_get_identifier",
"Returns the identifier of the unit",
"This procedure returns the textual identifier of the unit. For built-in units it will be the english singular form of the unit's name. For user-defined units this should equal to the singular form.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
1, gimp_unit_get_identifier_args,
1, gimp_unit_get_identifier_out_args,
/* Exec method */
{ { gimp_unit_get_identifier_invoker } },
};
/******************************
* GIMP_UNIT_GET_FACTOR
*/
static Argument *
gimp_unit_get_factor_invoker (Argument *args)
{
Argument *return_args;
GUnit unit;
success = TRUE;
unit = args[0].value.pdb_int;
if ((unit < UNIT_INCH) || (unit >= gimp_unit_get_number_of_units ()))
success = FALSE;
return_args= procedural_db_return_args(&gimp_unit_get_factor_proc, success);
return_args[1].value.pdb_float =
success ? gimp_unit_get_factor (unit) : 1.0;
return return_args;
}
/* The procedure definition */
ProcArg gimp_unit_get_factor_args[] =
{
{ PDB_INT32,
"unit ID",
"the unit's integer ID"
}
};
ProcArg gimp_unit_get_factor_out_args[] =
{
{ PDB_FLOAT,
"float",
"the unit's factor",
}
};
ProcRecord gimp_unit_get_factor_proc =
{
"gimp_unit_get_factor",
"Returns the factor of the unit",
"This procedure returns the unit's factor which indicates how many units make up an inch. Note that asking for the factor of \"pixels\" will produce an error.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input & output arguments */
1, gimp_unit_get_factor_args,
1, gimp_unit_get_factor_out_args,
/* Exec method */
{ { gimp_unit_get_factor_invoker } },
};
/******************************
* GIMP_UNIT_GET_DIGITS
*/