mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 04:22:29 +00:00
7b943b64b0
2004-05-06 Michael Natterer <mitch@gimp.org> Enabled multiple menu entries per plug-in procedure: * app/plug-in/plug-in-proc.[ch]: changed "gchar *menu_path" to "GList *menu_paths". * app/plug-in/plug-in-message.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in.c * app/plug-in/plug-ins.c * app/menus/menus.c * app/widgets/gimpfiledialog.c * app/xcf/xcf.c: changed accordingly. * app/actions/file-dialog-actions.c * app/actions/plug-in-actions.c: create an action for the first element of proc_def->menu_paths. * app/gui/gui-vtable.c * app/menus/plug-in-menus.[ch]: create proxy widgets for each element of proc_def->menu_paths. * tools/pdbgen/pdb/plug_in.pdb: added new function gimp_plugin_menu_add() which can be called during query() and adds a menu path to a procedure registered by the calling plugin. * app/pdb/internal_procs.c * app/pdb/plug_in_cmds.c * libgimp/gimpplugin_pdb.[ch]: regenerated. * menus/image-menu.xml.in * menus/toolbox-menu.xml.in: added lots of <placeholder>s for logical groups (like Image/Resize, Image/Scale, Image/Crop etc.). Added empty placeholder File/Send for stuff like print and mail. Added an "Acquire" menu under <Image>/File * plug-ins/common/mail.c * plug-ins/print/print.c * plug-ins/common/winprint.c: register under File/Send. * plug-ins/common/screenshot.c * plug-ins/winsnap/winsnap.c: also register under <Image>/File/Acquire. * plug-ins/common/autocrop.c * plug-ins/common/ccanalyze.c * plug-ins/common/colortoalpha.c * plug-ins/common/threshold_alpha.c * plug-ins/common/zealouscrop.c: register additional menu entries under placeholders in the "Image" and "Layer" menus. This is not meant to be final but just a hint to keep in mind when reorganizing the plug-in menus.
195 lines
5.3 KiB
C
195 lines
5.3 KiB
C
/* LIBGIMP - The GIMP Library
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
*
|
|
* gimpplugin_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;
|
|
}
|
|
|
|
/**
|
|
* gimp_plugin_domain_register:
|
|
* @domain_name: The name of the textdomain (must be unique).
|
|
* @domain_path: The absolute path to the compiled message catalog (may be NULL).
|
|
*
|
|
* 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.
|
|
*
|
|
* Returns: TRUE on success.
|
|
*/
|
|
gboolean
|
|
gimp_plugin_domain_register (const gchar *domain_name,
|
|
const gchar *domain_path)
|
|
{
|
|
GimpParam *return_vals;
|
|
gint nreturn_vals;
|
|
gboolean success = TRUE;
|
|
|
|
return_vals = gimp_run_procedure ("gimp_plugin_domain_register",
|
|
&nreturn_vals,
|
|
GIMP_PDB_STRING, domain_name,
|
|
GIMP_PDB_STRING, domain_path,
|
|
GIMP_PDB_END);
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
return success;
|
|
}
|
|
|
|
/**
|
|
* gimp_plugin_help_register:
|
|
* @domain_name: The XML namespace of the plug-in's help pages.
|
|
* @domain_uri: The root URI of the plug-in's help pages.
|
|
*
|
|
* 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.
|
|
*
|
|
* Returns: TRUE on success.
|
|
*/
|
|
gboolean
|
|
gimp_plugin_help_register (const gchar *domain_name,
|
|
const gchar *domain_uri)
|
|
{
|
|
GimpParam *return_vals;
|
|
gint nreturn_vals;
|
|
gboolean success = TRUE;
|
|
|
|
return_vals = gimp_run_procedure ("gimp_plugin_help_register",
|
|
&nreturn_vals,
|
|
GIMP_PDB_STRING, domain_name,
|
|
GIMP_PDB_STRING, domain_uri,
|
|
GIMP_PDB_END);
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
return success;
|
|
}
|
|
|
|
/**
|
|
* gimp_plugin_menu_add:
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
* @menu_path: The procedure's additional menu path.
|
|
*
|
|
* Register an additional menu path for a plug-in procedure.
|
|
*
|
|
* This procedure installs an additional menu entry for the given
|
|
* procedure.
|
|
*
|
|
* Returns: TRUE on success.
|
|
*/
|
|
gboolean
|
|
gimp_plugin_menu_add (const gchar *procedure_name,
|
|
const gchar *menu_path)
|
|
{
|
|
GimpParam *return_vals;
|
|
gint nreturn_vals;
|
|
gboolean success = TRUE;
|
|
|
|
return_vals = gimp_run_procedure ("gimp_plugin_menu_add",
|
|
&nreturn_vals,
|
|
GIMP_PDB_STRING, procedure_name,
|
|
GIMP_PDB_STRING, menu_path,
|
|
GIMP_PDB_END);
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
return success;
|
|
}
|