gimpplugin_pdb.c 5.17 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
3 4 5 6 7 8 9 10 11 12 13
 *
 * 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
14
 * Lesser General Public License for more details.
15 16 17 18 19 20 21
 *
 * 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.
 */

22
/* NOTE: This file is autogenerated by pdbgen.pl */
23

Sven Neumann's avatar
Sven Neumann committed
24 25
#include "config.h"

26
#include "gimp.h"
27

28 29 30 31 32 33 34 35 36 37 38 39
/**
 * 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.
 */
40
gboolean
41 42
gimp_progress_init (gchar *message)
{
43
  GimpParam *return_vals;
44
  gint nreturn_vals;
45
  gboolean success = TRUE;
46 47 48

  return_vals = gimp_run_procedure ("gimp_progress_init",
				    &nreturn_vals,
49 50 51
				    GIMP_PDB_STRING, message,
				    GIMP_PDB_INT32, gimp_default_display (),
				    GIMP_PDB_END);
52

53 54
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

55
  gimp_destroy_params (return_vals, nreturn_vals);
56 57

  return success;
58 59
}

60 61 62 63 64 65 66 67 68 69 70
/**
 * gimp_progress_update:
 * @percentage: Percentage of progress completed.
 *
 * 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.
 */
71
gboolean
72 73
gimp_progress_update (gdouble percentage)
{
74
  GimpParam *return_vals;
75
  gint nreturn_vals;
76
  gboolean success = TRUE;
77 78 79

  return_vals = gimp_run_procedure ("gimp_progress_update",
				    &nreturn_vals,
80 81
				    GIMP_PDB_FLOAT, percentage,
				    GIMP_PDB_END);
82

83 84
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

85
  gimp_destroy_params (return_vals, nreturn_vals);
86 87

  return success;
88 89
}

90 91 92 93 94 95 96 97 98 99 100
/**
 * gimp_temp_PDB_name:
 *
 * Generates a unique temporary PDB name.
 *
 * This procedure generates a temporary PDB entry name that is
 * guaranteed to be unique. It is many used by the interactive popup
 * dialogs to generate a PDB entry name.
 *
 * Returns: A unique temporary name for a temporary PDB entry.
 */
101 102 103
gchar *
gimp_temp_PDB_name (void)
{
104
  GimpParam *return_vals;
105 106 107 108 109
  gint nreturn_vals;
  gchar *temp_name = NULL;

  return_vals = gimp_run_procedure ("gimp_temp_PDB_name",
				    &nreturn_vals,
110
				    GIMP_PDB_END);
111

112
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
113 114 115 116 117 118 119
    temp_name = g_strdup (return_vals[1].data.d_string);

  gimp_destroy_params (return_vals, nreturn_vals);

  return temp_name;
}

120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
/**
 * 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.
 */
138
gboolean
139 140 141
gimp_plugin_domain_register (gchar *domain_name,
			     gchar *domain_path)
{
142
  GimpParam *return_vals;
143
  gint nreturn_vals;
144
  gboolean success = TRUE;
145 146 147

  return_vals = gimp_run_procedure ("gimp_plugin_domain_register",
				    &nreturn_vals,
148 149 150
				    GIMP_PDB_STRING, domain_name,
				    GIMP_PDB_STRING, domain_path,
				    GIMP_PDB_END);
151

152 153
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

154
  gimp_destroy_params (return_vals, nreturn_vals);
155 156

  return success;
157 158
}

159 160 161 162 163 164 165 166 167 168 169 170 171 172
/**
 * gimp_plugin_help_register:
 * @help_path: The rootdir 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. 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.
 */
173
gboolean
174 175
gimp_plugin_help_register (gchar *help_path)
{
176
  GimpParam *return_vals;
177
  gint nreturn_vals;
178
  gboolean success = TRUE;
179 180

  return_vals = gimp_run_procedure ("gimp_plugin_help_register",
181
				    &nreturn_vals,
182 183
				    GIMP_PDB_STRING, help_path,
				    GIMP_PDB_END);
184

185 186
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

187
  gimp_destroy_params (return_vals, nreturn_vals);
188 189

  return success;
190
}