gimp/libgimp/gimpgimprc_pdb.c
Michael Natterer e34358d8c3 added new API gimp_color_button_[get|set]_update() which configures the
2003-11-11  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpcolorbutton.[ch]: added new API
	gimp_color_button_[get|set]_update() which configures the button
	to emit "color_changed" continuously while the color in the color
	selection dialog is being changed. Fixes bug #90091.

	Renamed GimpColorButton struct member
	"GtkItemFactory *item_factory" to a /*< private >*/ member named
	"gpointer popup_menu". This is ugly but fixes bug #125115,

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell.c
	* app/widgets/gimpcolorpanel.c: changed accordingly.

	* libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection
	with a handmade GimpDialog instead of GtkColorSelectionDialog.

	Enabled module loading for plug-ins so the color selection
	can show the color selectors which are implemented in modules:

	* libgimpwidgets/gimpwidgets-private.[ch]: added
	GimpEnsureModlesFunc which can be called by modules users.

	* app/gui/gui.c (gui_libs_init): pass NULL as
	GimpEnsureModulesFunc since the core loads the modules itself.

	* libgimp/gimpui.c (gimp_ui_init): pass new private function
	gimp_ensure_modules() which will load the modules upon first
	invocation.

	* libgimp/Makefile.am: link libgimpui against libgimpmodule.

	* libgimpwidgets/gimpcolorselection.c: call
	_gimp_ensure_modules_func() if it is non-NULL so color selector
	modules are available for plug-ins.

	* tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper
	gimp_get_module_load_inhibit().

	* app/pdb/gimprc_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-11 17:55:45 +00:00

227 lines
5.8 KiB
C

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpgimprc_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_gimprc_query:
* @token: The token to query for.
*
* Queries the gimprc file parser for information on a specified token.
*
* This procedure is used to locate additional information contained in
* the gimprc file considered extraneous to the operation of the GIMP.
* Plug-ins that need configuration information can expect it will be
* stored in the user gimprc file and can use this procedure to
* retrieve it. This query procedure will return the value associated
* with the specified token. This corresponds _only_ to entries with
* the format: (&lt;token&gt; &lt;value&gt;). The value must be a
* string. Entries not corresponding to this format will cause warnings
* to be issued on gimprc parsing and will not be queryable.
*
* Returns: The value associated with the queried token.
*/
gchar *
gimp_gimprc_query (const gchar *token)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *value = NULL;
return_vals = gimp_run_procedure ("gimp_gimprc_query",
&nreturn_vals,
GIMP_PDB_STRING, token,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
value = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return value;
}
/**
* gimp_gimprc_set:
* @token: The token to add or modify.
* @value: The value to set the token to.
*
* Sets a gimprc token to a value and saves it in the gimprc.
*
* This procedure is used to add or change additional information in
* the gimprc file that is considered extraneous to the operation of
* the GIMP. Plug-ins that need configuration information can use this
* function to store it, and gimp_gimprc_query to retrieve it. This
* will accept _only_ string values in UTF-8 encoding.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gimprc_set (const gchar *token,
const gchar *value)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_gimprc_set",
&nreturn_vals,
GIMP_PDB_STRING, token,
GIMP_PDB_STRING, value,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_get_default_comment:
*
* Get the default image comment as specified in the Preferences.
*
* Returns a copy of the default image comment.
*
* Returns: Default Image Comment.
*/
gchar *
gimp_get_default_comment (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *comment = NULL;
return_vals = gimp_run_procedure ("gimp_get_default_comment",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
comment = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return comment;
}
/**
* gimp_get_monitor_resolution:
* @xres: X resolution.
* @yres: Y resolution.
*
* Get the monitor resolution as specified in the Preferences.
*
* Returns the resolution of the monitor in pixels/inch. This value is
* taken from the Preferences (or the windowing system if this is set
* in the Preferences) and there's no guarantee for the value to be
* reasonable.
*
* Returns: TRUE on success.
*/
gboolean
gimp_get_monitor_resolution (gdouble *xres,
gdouble *yres)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_get_monitor_resolution",
&nreturn_vals,
GIMP_PDB_END);
*xres = 0.0;
*yres = 0.0;
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
if (success)
{
*xres = return_vals[1].data.d_float;
*yres = return_vals[2].data.d_float;
}
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_get_theme_dir:
*
* Get the directory of the current GUI theme.
*
* Returns a copy of the current GUI theme dir.
*
* Returns: The GUI theme dir.
*/
gchar *
gimp_get_theme_dir (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *theme_dir = NULL;
return_vals = gimp_run_procedure ("gimp_get_theme_dir",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
theme_dir = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return theme_dir;
}
/**
* gimp_get_module_load_inhibit:
*
* Get the list of modules which should not be loaded.
*
* Returns a copy of the list of modules which should not be loaded.
*
* Returns: The list of modules.
*/
gchar *
gimp_get_module_load_inhibit (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *load_inhibit = NULL;
return_vals = gimp_run_procedure ("gimp_get_module_load_inhibit",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
load_inhibit = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return load_inhibit;
}