Commit 52329c57 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added gimp_getpid().

2005-07-25  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/misc.pdb: added gimp_getpid().

	* libgimp/gimp.def: changed accordingly.

	* app/pdb/internal_procs.c
	* app/pdb/misc_cmds.c
	* libgimp/gimpmisc_pdb.[ch]: regenerated.
parent 43d691da
2005-07-25 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/misc.pdb: added gimp_getpid().
* libgimp/gimp.def: changed accordingly.
* app/pdb/internal_procs.c
* app/pdb/misc_cmds.c
* libgimp/gimpmisc_pdb.[ch]: regenerated.
2005-07-25 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpdialog.c (gimp_dialog_add_buttons_valist):
......
......@@ -75,7 +75,7 @@ void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
void register_vectors_procs (Gimp *gimp);
/* 464 procedures registered total */
/* 465 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -105,76 +105,76 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Convert"), 0.17);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.177);
(* status_callback) (NULL, _("Display procedures"), 0.176);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.185);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Transformation procedures"), 0.261);
(* status_callback) (NULL, _("Transformation procedures"), 0.26);
register_drawable_transform_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.295);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.315);
(* status_callback) (NULL, _("File Operations"), 0.314);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.336);
(* status_callback) (NULL, _("Floating selections"), 0.335);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.349);
(* status_callback) (NULL, _("Font UI"), 0.348);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.356);
(* status_callback) (NULL, _("Fonts"), 0.355);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.36);
(* status_callback) (NULL, _("Gimprc procedures"), 0.359);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient"), 0.375);
(* status_callback) (NULL, _("Gradient"), 0.374);
register_gradient_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.44);
(* status_callback) (NULL, _("Gradient UI"), 0.439);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.446);
(* status_callback) (NULL, _("Gradients"), 0.445);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.457);
(* status_callback) (NULL, _("Guide procedures"), 0.456);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.47);
(* status_callback) (NULL, _("Help procedures"), 0.469);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.472);
(* status_callback) (NULL, _("Image"), 0.471);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.608);
(* status_callback) (NULL, _("Layer"), 0.606);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.666);
(* status_callback) (NULL, _("Message procedures"), 0.665);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.672);
(* status_callback) (NULL, _("Miscellaneous"), 0.671);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.677);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.709);
(* status_callback) (NULL, _("Palette"), 0.71);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.739);
(* status_callback) (NULL, _("Palette UI"), 0.74);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.746);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.754);
(* status_callback) (NULL, _("Parasite procedures"), 0.755);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.78);
(* status_callback) (NULL, _("Paths"), 0.781);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern"), 0.815);
......@@ -183,7 +183,7 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Pattern UI"), 0.819);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.825);
(* status_callback) (NULL, _("Patterns"), 0.826);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.834);
......@@ -192,10 +192,10 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Procedural database"), 0.847);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Progress"), 0.866);
(* status_callback) (NULL, _("Progress"), 0.867);
register_progress_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.881);
(* status_callback) (NULL, _("Image mask"), 0.882);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.918);
......@@ -207,7 +207,7 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Transform Tool procedures"), 0.938);
register_transform_tools_procs (gimp);
(* status_callback) (NULL, _("Undo"), 0.95);
(* status_callback) (NULL, _("Undo"), 0.951);
register_undo_procs (gimp);
(* status_callback) (NULL, _("Units"), 0.966);
......
......@@ -20,6 +20,12 @@
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
......@@ -31,12 +37,14 @@
#include "core/gimp.h"
static ProcRecord version_proc;
static ProcRecord getpid_proc;
static ProcRecord quit_proc;
void
register_misc_procs (Gimp *gimp)
{
procedural_db_register (gimp, &version_proc);
procedural_db_register (gimp, &getpid_proc);
procedural_db_register (gimp, &quit_proc);
}
......@@ -80,6 +88,46 @@ static ProcRecord version_proc =
{ { version_invoker } }
};
static Argument *
getpid_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
Argument *return_args;
return_args = procedural_db_return_args (&getpid_proc, TRUE);
return_args[1].value.pdb_int = getpid ();
return return_args;
}
static ProcArg getpid_outargs[] =
{
{
GIMP_PDB_INT32,
"pid",
"The PID"
}
};
static ProcRecord getpid_proc =
{
"gimp_getpid",
"Returns the PID of the host gimp process.",
"This procedure returns the process ID of the currently running gimp.",
"Michael Natterer",
"Michael Natterer",
"2005",
NULL,
GIMP_INTERNAL,
0,
NULL,
1,
getpid_outargs,
{ { getpid_invoker } }
};
static Argument *
quit_invoker (Gimp *gimp,
GimpContext *context,
......
......@@ -207,6 +207,7 @@ EXPORTS
gimp_get_path_by_tattoo
gimp_get_progname
gimp_get_theme_dir
gimp_getpid
gimp_gimprc_query
gimp_gimprc_set
gimp_gradient_delete
......
......@@ -53,3 +53,33 @@ gimp_version (void)
return version;
}
/**
* gimp_getpid:
*
* Returns the PID of the host gimp process.
*
* This procedure returns the process ID of the currently running gimp.
*
* Returns: The PID.
*
* Since: GIMP 2.4
*/
gint
gimp_getpid (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gint pid = 0;
return_vals = gimp_run_procedure ("gimp_getpid",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
pid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return pid;
}
......@@ -30,6 +30,7 @@ G_BEGIN_DECLS
gchar* gimp_version (void);
gint gimp_getpid (void);
G_END_DECLS
......
......@@ -38,6 +38,28 @@ HELP
%invoke = ( headers => [ qw("libgimpbase/gimpbase.h") ] );
}
sub getpid {
$blurb = <<'BLURB';
Returns the PID of the host gimp process.
BLURB
$help = <<'HELP';
This procedure returns the process ID of the currently running gimp.
HELP
$author = $copyright = 'Michael Natterer';
$date = '2005';
$since = '2.4';
@outargs = (
{ name => 'pid', type => 'int32',
desc => 'The PID',
alias => 'getpid ()', no_declare => 1 }
);
%invoke = ( headers => [ qw(<sys/types.h> <unistd.h>) ] );
}
sub quit {
$blurb = 'Causes the gimp to exit gracefully.';
......@@ -62,8 +84,8 @@ HELP
);
}
@procs = qw(version quit);
%exports = (app => [@procs], lib => [$procs[0]]);
@procs = qw(version getpid quit);
%exports = (app => [@procs], lib => [@procs[0..1]]);
$desc = 'Miscellaneous';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment