Commit ba9ec2a2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Sven Neumann <sven@gimp.org>

2000-05-31  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>

	Episode IV...

	* app/Makefile.am

	* app/message_cmds.c: new name
	* app/interface_cmds.c: removed

	* app/help_cmds.c: new name
	* app/gimphelp_cmds.c: removed

	* app/internal_procs.c
	* app/gimphelp_cmds.c
	* app/plug_in_cmds.c: moved gimp_plugin_help_register to
	plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/

	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* libgimp/gimpfileops_pdb.[ch]
	* libgimp/gimpguides_pdb.[ch]
	* libgimp/gimpmessage_pdb.[ch]
	* libgimp/gimpprocedural_db_pdb.[ch]
	* libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers
	moved out of libgimp/gimp.[ch]

	* libgimp/gimpchannel_pdb.c
	* libgimp/gimpdisplay_pdb.[ch]
	* libgimp/gimpdrawable_pdb.[ch]
	* libgimp/gimphelp_pdb.[ch]
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimplayer_pdb.c
	* libgimp/gimpparasite_pdb.c
	* libgimp/gimpselection_pdb.c: various changes.

	* libgimp/gimpunit.c: new file
	* libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed
	with "_" which are called from libgimp/gimpunit.c only.

	* libgimp/gimpunit.h: minor stuff

	* libgimp/gimpcompat.h: declared the following functions obsolete:
	 gimp_query_database
	 gimp_query_images

	* libgimp/gimp.[ch]: removed all PDB wrappers.

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl: changed

	* tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and
	fixed just a few comments.

	* tools/pdbgen/pdb/interface.pdb
	* tools/pdbgen/pdb/gimphelp.pdb: removed

	* tools/pdbgen/pdb/help.pdb
	* tools/pdbgen/pdb/message.pdb: new names

	* plug-ins/script-fu/script-fu.c
	* plug-ins/perl/Gimp/Lib.xs:
	s/gimp_plugin_domain_add/gimp_plugin_domain_register/

2000-05-31  Michael Natterer  <mitch@gimp.org>

	* POTFILES.in: s/gimpunit_pdb/gimpunit/
parent d65f250a
2000-05-31 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
Episode IV...
* app/Makefile.am
* app/message_cmds.c: new name
* app/interface_cmds.c: removed
* app/help_cmds.c: new name
* app/gimphelp_cmds.c: removed
* app/internal_procs.c
* app/gimphelp_cmds.c
* app/plug_in_cmds.c: moved gimp_plugin_help_register to
plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/
* libgimp/Makefile.am
* libgimp/gimp_pdb.h
* libgimp/gimpfileops_pdb.[ch]
* libgimp/gimpguides_pdb.[ch]
* libgimp/gimpmessage_pdb.[ch]
* libgimp/gimpprocedural_db_pdb.[ch]
* libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers
moved out of libgimp/gimp.[ch]
* libgimp/gimpchannel_pdb.c
* libgimp/gimpdisplay_pdb.[ch]
* libgimp/gimpdrawable_pdb.[ch]
* libgimp/gimphelp_pdb.[ch]
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimplayer_pdb.c
* libgimp/gimpparasite_pdb.c
* libgimp/gimpselection_pdb.c: various changes.
* libgimp/gimpunit.c: new file
* libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed
with "_" which are called from libgimp/gimpunit.c only.
* libgimp/gimpunit.h: minor stuff
* libgimp/gimpcompat.h: declared the following functions obsolete:
gimp_query_database
gimp_query_images
* libgimp/gimp.[ch]: removed all PDB wrappers.
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl: changed
* tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and
fixed just a few comments.
* tools/pdbgen/pdb/interface.pdb
* tools/pdbgen/pdb/gimphelp.pdb: removed
* tools/pdbgen/pdb/help.pdb
* tools/pdbgen/pdb/message.pdb: new names
* plug-ins/script-fu/script-fu.c
* plug-ins/perl/Gimp/Lib.xs:
s/gimp_plugin_domain_add/gimp_plugin_domain_register/
2000-05-31 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
......
......@@ -198,7 +198,6 @@ gimp_SOURCES = \
gimpdnd.h \
gimphelp.c \
gimphelp.h \
gimphelp_cmds.c \
gimphistogram.c \
gimphistogram.h \
gimphistogramP.h \
......@@ -240,6 +239,7 @@ gimp_SOURCES = \
guides_cmds.c \
gximage.c \
gximage.h \
help_cmds.c \
histogramwidget.c \
histogramwidget.h \
histogram_tool.c \
......@@ -262,7 +262,6 @@ gimp_SOURCES = \
ink.h \
interface.c \
interface.h \
interface_cmds.c \
internal_procs.c \
internal_procs.h \
invert.c \
......@@ -294,6 +293,7 @@ gimp_SOURCES = \
measure.h \
menus.c \
menus.h \
message_cmds.c \
misc_cmds.c \
module_db.c \
module_db.h \
......
......@@ -21,16 +21,13 @@
#include "procedural_db.h"
#include "gimphelp.h"
#include "plug_in.h"
static ProcRecord help_proc;
static ProcRecord plugin_help_register_proc;
void
register_gimphelp_procs (void)
register_help_procs (void)
{
procedural_db_register (&help_proc);
procedural_db_register (&plugin_help_register_proc);
}
static Argument *
......@@ -83,54 +80,3 @@ static ProcRecord help_proc =
NULL,
{ { help_invoker } }
};
static Argument *
plugin_help_register_invoker (Argument *args)
{
gboolean success = TRUE;
gchar *help_path;
PlugInDef *plug_in_def;
help_path = (gchar *) args[0].value.pdb_pointer;
if (help_path == NULL)
success = FALSE;
if (success)
{
if (current_plug_in && current_plug_in->query)
{
plug_in_def = current_plug_in->user_data;
if (plug_in_def->help_path)
g_free (plug_in_def->help_path);
plug_in_def->help_path = g_strdup (help_path);
}
}
return procedural_db_return_args (&plugin_help_register_proc, success);
}
static ProcArg plugin_help_register_inargs[] =
{
{
PDB_STRING,
"help_path",
"The rootdir of the plug-in's help pages"
}
};
static ProcRecord plugin_help_register_proc =
{
"gimp_plugin_help_register",
"Register a help path for a plug-in.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"2000",
PDB_INTERNAL,
1,
plugin_help_register_inargs,
0,
NULL,
{ { plugin_help_register_invoker } }
};
......@@ -41,12 +41,12 @@ void register_gdisplay_procs (void);
void register_gimage_procs (void);
void register_gimage_mask_procs (void);
void register_gimprc_procs (void);
void register_gimphelp_procs (void);
void register_gradient_procs (void);
void register_gradient_select_procs (void);
void register_guides_procs (void);
void register_interface_procs (void);
void register_help_procs (void);
void register_layer_procs (void);
void register_message_procs (void);
void register_misc_procs (void);
void register_palette_procs (void);
void register_parasite_procs (void);
......@@ -107,43 +107,43 @@ internal_procs_init (void)
app_init_update_status (NULL, _("Gimprc procedures"), 0.517);
register_gimprc_procs ();
app_init_update_status (NULL, _("Help procedures"), 0.526);
register_gimphelp_procs ();
app_init_update_status (NULL, _("Gradients"), 0.533);
app_init_update_status (NULL, _("Gradients"), 0.526);
register_gradient_procs ();
app_init_update_status (NULL, _("Gradient UI"), 0.548);
app_init_update_status (NULL, _("Gradient UI"), 0.542);
register_gradient_select_procs ();
app_init_update_status (NULL, _("Guide procedures"), 0.56);
app_init_update_status (NULL, _("Guide procedures"), 0.554);
register_guides_procs ();
app_init_update_status (NULL, _("Interface"), 0.579);
register_interface_procs ();
app_init_update_status (NULL, _("Help procedures"), 0.573);
register_help_procs ();
app_init_update_status (NULL, _("Layer"), 0.588);
app_init_update_status (NULL, _("Layer"), 0.576);
register_layer_procs ();
app_init_update_status (NULL, _("Miscellaneous"), 0.684);
app_init_update_status (NULL, _("Interface"), 0.672);
register_message_procs ();
app_init_update_status (NULL, _("Miscellaneous"), 0.681);
register_misc_procs ();
app_init_update_status (NULL, _("Palette"), 0.69);
app_init_update_status (NULL, _("Palette"), 0.687);
register_palette_procs ();
app_init_update_status (NULL, _("Parasite procedures"), 0.712);
app_init_update_status (NULL, _("Parasite procedures"), 0.709);
register_parasite_procs ();
app_init_update_status (NULL, _("Paths"), 0.752);
app_init_update_status (NULL, _("Paths"), 0.749);
register_paths_procs ();
app_init_update_status (NULL, _("Pattern UI"), 0.793);
app_init_update_status (NULL, _("Pattern UI"), 0.789);
register_pattern_select_procs ();
app_init_update_status (NULL, _("Patterns"), 0.802);
app_init_update_status (NULL, _("Patterns"), 0.799);
register_patterns_procs ();
app_init_update_status (NULL, _("Plug-in"), 0.814);
app_init_update_status (NULL, _("Plug-in"), 0.811);
register_plug_in_procs ();
app_init_update_status (NULL, _("Procedural database"), 0.83);
......
......@@ -27,7 +27,7 @@ static ProcRecord message_get_handler_proc;
static ProcRecord message_set_handler_proc;
void
register_interface_procs (void)
register_message_procs (void)
{
procedural_db_register (&message_proc);
procedural_db_register (&message_get_handler_proc);
......
......@@ -31,7 +31,8 @@ static ProcRecord progress_init_proc;
static ProcRecord progress_update_proc;
static ProcRecord temp_PDB_name_proc;
static ProcRecord plugins_query_proc;
static ProcRecord plugin_domain_add_proc;
static ProcRecord plugin_domain_register_proc;
static ProcRecord plugin_help_register_proc;
void
register_plug_in_procs (void)
......@@ -40,7 +41,8 @@ register_plug_in_procs (void)
procedural_db_register (&progress_update_proc);
procedural_db_register (&temp_PDB_name_proc);
procedural_db_register (&plugins_query_proc);
procedural_db_register (&plugin_domain_add_proc);
procedural_db_register (&plugin_domain_register_proc);
procedural_db_register (&plugin_help_register_proc);
}
static int
......@@ -387,7 +389,7 @@ static ProcRecord plugins_query_proc =
};
static Argument *
plugin_domain_add_invoker (Argument *args)
plugin_domain_register_invoker (Argument *args)
{
gboolean success = TRUE;
gchar *domain_name;
......@@ -416,10 +418,10 @@ plugin_domain_add_invoker (Argument *args)
}
}
return procedural_db_return_args (&plugin_domain_add_proc, success);
return procedural_db_return_args (&plugin_domain_register_proc, success);
}
static ProcArg plugin_domain_add_inargs[] =
static ProcArg plugin_domain_register_inargs[] =
{
{
PDB_STRING,
......@@ -433,18 +435,69 @@ static ProcArg plugin_domain_add_inargs[] =
}
};
static ProcRecord plugin_domain_add_proc =
static ProcRecord plugin_domain_register_proc =
{
"gimp_plugin_domain_add",
"Adds a textdomain for localisation.",
"gimp_plugin_domain_register",
"Registers a textdomain for localisation.",
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Sven Neumann",
"Sven Neumann",
"2000",
PDB_INTERNAL,
2,
plugin_domain_add_inargs,
plugin_domain_register_inargs,
0,
NULL,
{ { plugin_domain_add_invoker } }
{ { plugin_domain_register_invoker } }
};
static Argument *
plugin_help_register_invoker (Argument *args)
{
gboolean success = TRUE;
gchar *help_path;
PlugInDef *plug_in_def;
help_path = (gchar *) args[0].value.pdb_pointer;
if (help_path == NULL)
success = FALSE;
if (success)
{
if (current_plug_in && current_plug_in->query)
{
plug_in_def = current_plug_in->user_data;
if (plug_in_def->help_path)
g_free (plug_in_def->help_path);
plug_in_def->help_path = g_strdup (help_path);
}
}
return procedural_db_return_args (&plugin_help_register_proc, success);
}
static ProcArg plugin_help_register_inargs[] =
{
{
PDB_STRING,
"help_path",
"The rootdir of the plug-in's help pages"
}
};
static ProcRecord plugin_help_register_proc =
{
"gimp_plugin_help_register",
"Register a help path for a plug-in.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"2000",
PDB_INTERNAL,
1,
plugin_help_register_inargs,
0,
NULL,
{ { plugin_help_register_invoker } }
};
......@@ -80,6 +80,7 @@ endif
libgimp_la_SOURCES = \
gimp.c \
gimp.h \
gimp_pdb.h \
gimpchannel_pdb.h \
gimpchannel_pdb.c \
gimpcolorspace.c \
......@@ -92,7 +93,10 @@ libgimp_la_SOURCES = \
gimpdrawable_pdb.h \
gimpenv.c \
gimpenv.h \
gimpfileops_pdb.c \
gimpfileops_pdb.h \
gimpgradient_pdb.c \
gimpguides_pdb.c \
gimphelp.c \
gimphelp_pdb.c \
gimphelp_pdb.h \
......@@ -102,6 +106,8 @@ libgimp_la_SOURCES = \
gimplayer_pdb.h \
gimpmatrix.c \
gimpmatrix.h \
gimpmessage_pdb.c \
gimpmessage_pdb.h \
gimppalette_pdb.c \
gimpparasite.c \
gimpparasite.h \
......@@ -111,6 +117,10 @@ libgimp_la_SOURCES = \
gimpparasite_pdb.h \
gimppixelrgn.c \
gimppixelrgn.h \
gimpplugin_pdb.c \
gimpplugin_pdb.h \
gimpproceduraldb_pdb.c \
gimpproceduraldb_pdb.h \
gimpprotocol.c \
gimpprotocol.h \
gimpselection_pdb.c \
......@@ -121,6 +131,7 @@ libgimp_la_SOURCES = \
gimptile.h \
gimpunit_pdb.c \
gimpunit_pdb.h \
gimpunit.c \
gimpunit.h \
gimputils.c \
gimputils.h \
......@@ -153,15 +164,20 @@ libgimpui_la_SOURCES = \
gimpinclude_HEADERS = \
gimp.h \
gimp_pdb.h \
gimpchannel_pdb.h \
gimpdisplay_pdb.h \
gimpdrawable_pdb.h \
gimpfileops_pdb.h \
gimpgradient_pdb.h \
gimphelp_pdb.h \
gimpimage_pdb.h \
gimplayer_pdb.h \
gimpmessage_pdb.h \
gimppalette_pdb.h \
gimpparasite_pdb.h \
gimpplugin_pdb.h \
gimpproceduraldb_pdb.h \
gimpselection_pdb.h \
gimpchainbutton.h \
gimpcolorbutton.h \
......@@ -169,6 +185,7 @@ gimpinclude_HEADERS = \
gimpcolorselector.h \
gimpcolorspace.h \
gimpcompat.h \
gimpdrawable.h \
gimpdialog.h \
gimpenums.h \
gimpenv.h \
......@@ -193,7 +210,6 @@ gimpinclude_HEADERS = \
gimptypes.h \
gimpui.h \
gimpunit.h \
gimpunit_pdb.h \
gimpunitmenu.h \
gimputils.h \
gimpvector.h \
......
......@@ -310,100 +310,6 @@ gimp_quit (void)
exit (0);
}
void
gimp_set_data (gchar *id,
gpointer data,
guint32 length)
{
GimpParam *return_vals;
int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_procedural_db_set_data",
&nreturn_vals,
PARAM_STRING, id,
PARAM_INT32, length,
PARAM_INT8ARRAY, data,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
guint32
gimp_get_data_size (gchar *id)
{
GimpParam *return_vals;
gint nreturn_vals;
guint32 length;
return_vals = gimp_run_procedure ("gimp_procedural_db_get_data_size",
&nreturn_vals,
PARAM_STRING, id,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
length= return_vals[1].data.d_int32;
else
length= 0;
gimp_destroy_params (return_vals, nreturn_vals);
return length;
}
void
gimp_get_data (gchar *id,
gpointer data)
{
GimpParam *return_vals;
gint nreturn_vals;
gint length;
gchar *returned_data;
return_vals = gimp_run_procedure ("gimp_procedural_db_get_data",
&nreturn_vals,
PARAM_STRING, id,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
length = return_vals[1].data.d_int32;
returned_data = (gchar *) return_vals[2].data.d_int8array;
memcpy (data, returned_data, length);
}
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_progress_init (char *message)
{
GimpParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_progress_init",
&nreturn_vals,
PARAM_STRING, message,
PARAM_INT32, _gdisp_ID,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_progress_update (gdouble percentage)
{
GimpParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_progress_update",
&nreturn_vals,
PARAM_FLOAT, percentage,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gint32
gimp_default_display (void)
......@@ -411,193 +317,12 @@ gimp_default_display (void)
return _gdisp_ID;
}
void
gimp_message (const gchar *message)
{
GimpParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_message",
&nreturn_vals,
PARAM_STRING, message,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
static void
gimp_message_func (gchar *str)
{
gimp_message (str);
}
void
gimp_query_database (gchar *name_regexp,
gchar *blurb_regexp,
gchar *help_regexp,
gchar *author_regexp,
gchar *copyright_regexp,
gchar *date_regexp,
gchar *proc_type_regexp,
gint *nprocs,
gchar ***proc_names)
{
GimpParam *return_vals;
gint nreturn_vals;
gint i;
return_vals = gimp_run_procedure ("gimp_procedural_db_query",
&nreturn_vals,
PARAM_STRING, name_regexp,
PARAM_STRING, blurb_regexp,
PARAM_STRING, help_regexp,
PARAM_STRING, author_regexp,
PARAM_STRING, copyright_regexp,
PARAM_STRING, date_regexp,
PARAM_STRING, proc_type_regexp,
PARAM_END);
*nprocs = 0;
*proc_names = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*nprocs = return_vals[1].data.d_int32;
*proc_names = g_new (gchar*, *nprocs);
for (i = 0; i < *nprocs; i++)
(*proc_names)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
gimp_destroy_params (return_vals, nreturn_vals);
}
gboolean
gimp_query_procedure (gchar *proc_name,
gchar **proc_blurb,
gchar **proc_help,
gchar **proc_author,
gchar **proc_copyright,
gchar **proc_date,
gint *proc_type,
gint *nparams,
gint *nreturn_vals,
GimpParamDef **params,
GimpParamDef **return_vals)
{
GimpParam *ret_vals;
gint nret_vals;
gint i;
gboolean success = TRUE;
ret_vals = gimp_run_procedure ("gimp_procedural_db_proc_info",
&nret_vals,
PARAM_STRING, proc_name,
PARAM_END);
if (ret_vals[0].data.d_status == STATUS_SUCCESS)
{
*proc_blurb = g_strdup (ret_vals[1].data.d_string);
*proc_help = g_strdup (ret_vals[2].data.d_string);
*proc_author = g_strdup (ret_vals[3].data.d_string);
*proc_copyright = g_strdup (ret_vals[4].data.d_string);
*proc_date = g_strdup (ret_vals[5].data.d_string);
*proc_type = ret_vals[6].data.d_int32;
*nparams = ret_vals[7].data.d_int32;
*nreturn_vals = ret_vals[8].data.d_int32;
*params = g_new (GimpParamDef, *nparams);
*return_vals = g_new (GimpParamDef, *nreturn_vals);
for (i = 0; i < *nparams; i++)
{
GimpParam *rvals;
gint nrvals;
rvals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
&nrvals,
PARAM_STRING, proc_name,
PARAM_INT32, i,
PARAM_END);
if (rvals[0].data.d_status == STATUS_SUCCESS)
{
(* params) [i].type = rvals[1].data.d_int32;
(* params) [i].name = g_strdup (rvals[2].data.d_string);
(* params) [i].description = g_strdup (rvals[3].data.d_string);
}
else
{
g_free (*params);
g_free (*return_vals);
gimp_destroy_params (rvals, nrvals);
return FALSE;
}
gimp_destroy_params (rvals, nrvals);
}
for (i = 0; i < *nreturn_vals; i++)
{
GimpParam *rvals;
gint nrvals;
rvals = gimp_run_procedure ("gimp_procedural_db_proc_val",
&nrvals,
PARAM_STRING, proc_name,
PARAM_INT32, i,
PARAM_END);
if (rvals[0].data.d_status == STATUS_SUCCESS)
{
(* return_vals)[i].type = rvals[1].data.d_int32;
(* return_vals)[i].name = g_strdup (rvals[2].data.d_string);
(* return_vals)[i].description = g_strdup (rvals[3].data.d_string);
}
else
{
g_free (*params);
g_free (*return_vals);
gimp_destroy_params (rvals, nrvals);
return FALSE;
}
gimp_destroy_params (rvals, nrvals);
}
}
else
success = FALSE;
gimp_destroy_params (ret_vals, nret_vals);
return success;
}
gint32 *
gimp_query_images (gint *nimages)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 *images;
return_vals = gimp_run_procedure ("gimp_image_list",
&nreturn_vals,
PARAM_END);
images = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*nimages = return_vals[1].data.d_int32;
images = g_new (gint32, *nimages);
memcpy (images, return_vals[2].data.d_int32array, *nimages * 4);
}
gimp_destroy_params (return_vals, nreturn_vals);
return images;