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

Moved the gimp_progress_init() and gimp_progress_update() PDB functions to

2004-08-27  Michael Natterer  <mitch@gimp.org>

	Moved the gimp_progress_init() and gimp_progress_update() PDB
	functions to their own group because they don't belong to the
	"Plug-In" namespace and will soon get more functions.

	* tools/pdbgen/pdb/plug_in.pdb: removed the progress stuff...

	* tools/pdbgen/pdb/progress.pdb: ...and added it here.

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl
	* app/pdb/Makefile.am
	* libgimp/Makefile.am: changed accordingly.

	* libgimp/gimpprogress_pdb.[ch]: new generated files.

	* app/pdb/internal_procs.c
	* app/pdb/plug_in_cmds.c
	* libgimp/gimp_pdb.h
	* libgimp/gimpplugin_pdb.[ch]: regenerated.
parent 28e1f2a9
2004-08-27 Michael Natterer <mitch@gimp.org>
Moved the gimp_progress_init() and gimp_progress_update() PDB
functions to their own group because they don't belong to the
"Plug-In" namespace and will soon get more functions.
* tools/pdbgen/pdb/plug_in.pdb: removed the progress stuff...
* tools/pdbgen/pdb/progress.pdb: ...and added it here.
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl
* app/pdb/Makefile.am
* libgimp/Makefile.am: changed accordingly.
* libgimp/gimpprogress_pdb.[ch]: new generated files.
* app/pdb/internal_procs.c
* app/pdb/plug_in_cmds.c
* libgimp/gimp_pdb.h
* libgimp/gimpplugin_pdb.[ch]: regenerated.
2004-08-27 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainereditor.c
......
......@@ -41,6 +41,7 @@ libapppdb_a_SOURCES = \
pdb-types.h \
plug_in_cmds.c \
procedural_db_cmds.c \
progress_cmds.c \
selection_cmds.c \
selection_tools_cmds.c \
text_tool_cmds.c \
......
......@@ -62,6 +62,7 @@ void register_pattern_select_procs (Gimp *gimp);
void register_patterns_procs (Gimp *gimp);
void register_plug_in_procs (Gimp *gimp);
void register_procedural_db_procs (Gimp *gimp);
void register_progress_procs (Gimp *gimp);
void register_selection_procs (Gimp *gimp);
void register_selection_tools_procs (Gimp *gimp);
void register_text_tool_procs (Gimp *gimp);
......@@ -171,9 +172,12 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Plug-in"), 0.82);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.838);
(* status_callback) (NULL, _("Procedural database"), 0.833);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Progress"), 0.857);
register_progress_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.862);
register_selection_procs (gimp);
......
......@@ -35,7 +35,6 @@
#include "plug-in/plug-in-def.h"
#include "plug-in/plug-in-params.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in-progress.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-ins.h"
......@@ -45,8 +44,6 @@
#include "regexrepl/regex.h"
#endif
static ProcRecord progress_init_proc;
static ProcRecord progress_update_proc;
static ProcRecord plugins_query_proc;
static ProcRecord plugin_domain_register_proc;
static ProcRecord plugin_help_register_proc;
......@@ -56,8 +53,6 @@ static ProcRecord plugin_icon_register_proc;
void
register_plug_in_procs (Gimp *gimp)
{
procedural_db_register (gimp, &progress_init_proc);
procedural_db_register (gimp, &progress_update_proc);
procedural_db_register (gimp, &plugins_query_proc);
procedural_db_register (gimp, &plugin_domain_register_proc);
procedural_db_register (gimp, &plugin_help_register_proc);
......@@ -72,113 +67,6 @@ match_strings (regex_t *preg,
return regexec (preg, a, 0, NULL, 0);
}
static Argument *
progress_init_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *message;
gint32 gdisplay;
message = (gchar *) args[0].value.pdb_pointer;
if (message && !g_utf8_validate (message, -1, NULL))
success = FALSE;
gdisplay = args[1].value.pdb_int;
if (success)
{
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_start (gimp->current_plug_in, message, gdisplay);
}
else
success = FALSE;
}
return procedural_db_return_args (&progress_init_proc, success);
}
static ProcArg progress_init_inargs[] =
{
{
GIMP_PDB_STRING,
"message",
"Message to use in the progress dialog"
},
{
GIMP_PDB_INT32,
"gdisplay",
"GimpDisplay to update progressbar in, or -1 for a seperate window"
}
};
static ProcRecord progress_init_proc =
{
"gimp_progress_init",
"Initializes the progress bar for the current plug-in.",
"Initializes the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
progress_init_inargs,
0,
NULL,
{ { progress_init_invoker } }
};
static Argument *
progress_update_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gdouble percentage;
percentage = args[0].value.pdb_float;
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_update (gimp->current_plug_in, percentage);
}
else
success = FALSE;
return procedural_db_return_args (&progress_update_proc, success);
}
static ProcArg progress_update_inargs[] =
{
{
GIMP_PDB_FLOAT,
"percentage",
"Percentage of progress completed which must be between 0.0 and 1.0"
}
};
static ProcRecord progress_update_proc =
{
"gimp_progress_update",
"Updates the progress bar for the current plug-in.",
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
1,
progress_update_inargs,
0,
NULL,
{ { progress_update_invoker } }
};
static Argument *
plugins_query_invoker (Gimp *gimp,
GimpContext *context,
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2003 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.
*/
/* NOTE: This file is autogenerated by pdbgen.pl. */
#include "config.h"
#include <glib-object.h>
#include "pdb-types.h"
#include "procedural_db.h"
#include "core/gimp.h"
#include "plug-in/plug-in-progress.h"
#include "plug-in/plug-in.h"
static ProcRecord progress_init_proc;
static ProcRecord progress_update_proc;
void
register_progress_procs (Gimp *gimp)
{
procedural_db_register (gimp, &progress_init_proc);
procedural_db_register (gimp, &progress_update_proc);
}
static Argument *
progress_init_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gchar *message;
gint32 gdisplay;
message = (gchar *) args[0].value.pdb_pointer;
if (message && !g_utf8_validate (message, -1, NULL))
success = FALSE;
gdisplay = args[1].value.pdb_int;
if (success)
{
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_start (gimp->current_plug_in, message, gdisplay);
}
else
success = FALSE;
}
return procedural_db_return_args (&progress_init_proc, success);
}
static ProcArg progress_init_inargs[] =
{
{
GIMP_PDB_STRING,
"message",
"Message to use in the progress dialog"
},
{
GIMP_PDB_INT32,
"gdisplay",
"GimpDisplay to update progressbar in, or -1 for a seperate window"
}
};
static ProcRecord progress_init_proc =
{
"gimp_progress_init",
"Initializes the progress bar for the current plug-in.",
"Initializes the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
progress_init_inargs,
0,
NULL,
{ { progress_init_invoker } }
};
static Argument *
progress_update_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gdouble percentage;
percentage = args[0].value.pdb_float;
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_update (gimp->current_plug_in, percentage);
}
else
success = FALSE;
return procedural_db_return_args (&progress_update_proc, success);
}
static ProcArg progress_update_inargs[] =
{
{
GIMP_PDB_FLOAT,
"percentage",
"Percentage of progress completed which must be between 0.0 and 1.0"
}
};
static ProcRecord progress_update_proc =
{
"gimp_progress_update",
"Updates the progress bar for the current plug-in.",
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
1,
progress_update_inargs,
0,
NULL,
{ { progress_update_invoker } }
};
......@@ -106,6 +106,7 @@ PDB_WRAPPERS_C = \
gimppatternselect_pdb.c \
gimpplugin_pdb.c \
gimpproceduraldb_pdb.c \
gimpprogress_pdb.c \
gimpselection_pdb.c \
gimpselectiontools_pdb.c \
gimptexttool_pdb.c \
......@@ -147,6 +148,7 @@ PDB_WRAPPERS_H = \
gimppatternselect_pdb.h \
gimpplugin_pdb.h \
gimpproceduraldb_pdb.h \
gimpprogress_pdb.h \
gimpselection_pdb.h \
gimpselectiontools_pdb.h \
gimptexttool_pdb.h \
......
......@@ -56,6 +56,7 @@
#include <libgimp/gimppatternselect_pdb.h>
#include <libgimp/gimpplugin_pdb.h>
#include <libgimp/gimpproceduraldb_pdb.h>
#include <libgimp/gimpprogress_pdb.h>
#include <libgimp/gimpselection_pdb.h>
#include <libgimp/gimpselectiontools_pdb.h>
#include <libgimp/gimptexttool_pdb.h>
......
......@@ -25,68 +25,6 @@
#include "gimp.h"
/**
* gimp_progress_init:
* @message: Message to use in the progress dialog.
*
* Initializes the progress bar for the current plug-in.
*
* Initializes the progress bar for the current plug-in. It is only
* valid to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_init (const gchar *message)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_progress_init",
&nreturn_vals,
GIMP_PDB_STRING, message,
GIMP_PDB_INT32, gimp_default_display (),
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_progress_update:
* @percentage: Percentage of progress completed which must be between 0.0 and 1.0.
*
* Updates the progress bar for the current plug-in.
*
* Updates the progress bar for the current plug-in. It is only valid
* to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_update (gdouble percentage)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_progress_update",
&nreturn_vals,
GIMP_PDB_FLOAT, percentage,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_plugin_domain_register:
* @domain_name: The name of the textdomain (must be unique).
......
......@@ -29,8 +29,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_progress_init (const gchar *message);
gboolean gimp_progress_update (gdouble percentage);
gboolean gimp_plugin_domain_register (const gchar *domain_name,
const gchar *domain_path);
gboolean gimp_plugin_help_register (const gchar *domain_name,
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpprogress_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "config.h"
#include "gimp.h"
/**
* gimp_progress_init:
* @message: Message to use in the progress dialog.
*
* Initializes the progress bar for the current plug-in.
*
* Initializes the progress bar for the current plug-in. It is only
* valid to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_init (const gchar *message)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_progress_init",
&nreturn_vals,
GIMP_PDB_STRING, message,
GIMP_PDB_INT32, gimp_default_display (),
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_progress_update:
* @percentage: Percentage of progress completed which must be between 0.0 and 1.0.
*
* Updates the progress bar for the current plug-in.
*
* Updates the progress bar for the current plug-in. It is only valid
* to call this procedure from a plug-in.
*
* Returns: TRUE on success.
*/
gboolean
gimp_progress_update (gdouble percentage)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_progress_update",
&nreturn_vals,
GIMP_PDB_FLOAT, percentage,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpprogress_pdb.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_PROGRESS_PDB_H__
#define __GIMP_PROGRESS_PDB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_progress_init (const gchar *message);
gboolean gimp_progress_update (gdouble percentage);
G_END_DECLS
#endif /* __GIMP_PROGRESS_PDB_H__ */
......@@ -34,6 +34,7 @@ pdb_sources = \
pdb/patterns.pdb \
pdb/plug_in.pdb \
pdb/procedural_db.pdb \
pdb/progress.pdb \
pdb/selection.pdb \
pdb/selection_tools.pdb \
pdb/text_tool.pdb \
......
......@@ -32,6 +32,7 @@
patterns
plug_in
procedural_db
progress
selection
selection_tools
text_tool
......
......@@ -19,70 +19,6 @@
# The defs
sub progress_init {
$blurb = 'Initializes the progress bar for the current plug-in.';
$help = <<'HELP';
Initializes the progress bar for the current plug-in. It is only valid to call
this procedure from a plug-in.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'message', type => 'string', null_ok => 1,
desc => 'Message to use in the progress dialog' },
{ name => 'gdisplay', type => 'int32',
desc => 'GimpDisplay to update progressbar in, or -1 for a seperate
window',
implicit_fill => 'gimp_default_display ()', no_id_lookup => 1 }
);
%invoke = (
code => <<'CODE'
{
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_start (gimp->current_plug_in, message, gdisplay);
}
else
success = FALSE;
}
CODE
);
}
sub progress_update {
$blurb = 'Updates the progress bar for the current plug-in.';
$help = <<'HELP';
Updates the progress bar for the current plug-in. It is only valid to call this
procedure from a plug-in.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'percentage', type => 'float',
desc => 'Percentage of progress completed which must be between 0.0 and 1.0' }
);
%invoke = (
code => <<'CODE'
{
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_update (gimp->current_plug_in, percentage);
}
else
success = FALSE;
}
CODE
);
}
sub plugins_query {
$blurb = 'Queries the plugin database for its contents.';
......@@ -480,12 +416,12 @@ CODE
"libgimpbase/gimpprotocol.h" "core/gimp.h"
"plug-in/plug-in.h" "plug-in/plug-ins.h"
"plug-in/plug-in-def.h" "plug-in/plug-in-params.h"
"plug-in/plug-in-proc.h" "plug-in/plug-in-progress.h");
"plug-in/plug-in-proc.h");
@procs = qw(progress_init progress_update plugins_query
@procs = qw(plugins_query
plugin_domain_register plugin_help_register
plugin_menu_register plugin_icon_register);
%exports = (app => [@procs], lib => [@procs[0,1,3,4,5,6]]);
%exports = (app => [@procs], lib => [@procs[1,2,3,4]]);
$desc = 'Plug-in';
......
# 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.
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# The defs
sub progress_init {
$blurb = 'Initializes the progress bar for the current plug-in.';
$help = <<'HELP';
Initializes the progress bar for the current plug-in. It is only valid to call
this procedure from a plug-in.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'message', type => 'string', null_ok => 1,
desc => 'Message to use in the progress dialog' },
{ name => 'gdisplay', type => 'int32',
desc => 'GimpDisplay to update progressbar in, or -1 for a seperate
window',
implicit_fill => 'gimp_default_display ()', no_id_lookup => 1 }
);
%invoke = (
code => <<'CODE'
{
if (gimp->current_plug_in && gimp->current_plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_start (gimp->current_plug_in, message, gdisplay);
}
else
success = FALSE;
}
CODE
);
}
sub progress_update {
$blurb = 'Updates the progress bar for the current plug-in.';
$help = <<'HELP';
Updates the progress bar for the current plug-in. It is only valid to call this
procedure from a plug-in.
HELP
&std_pdb_misc;
@inargs = (