~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/pdb/help-cmds.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include <glib-object.h>
 
24
 
 
25
#include "pdb-types.h"
 
26
 
 
27
#include "core/gimp.h"
 
28
#include "core/gimpparamspecs.h"
 
29
#include "plug-in/gimpplugin.h"
 
30
#include "plug-in/gimppluginmanager-help-domain.h"
 
31
#include "plug-in/gimppluginmanager.h"
 
32
 
 
33
#include "gimppdb.h"
 
34
#include "gimpprocedure.h"
 
35
#include "internal-procs.h"
 
36
 
 
37
 
 
38
static GValueArray *
 
39
help_invoker (GimpProcedure      *procedure,
 
40
              Gimp               *gimp,
 
41
              GimpContext        *context,
 
42
              GimpProgress       *progress,
 
43
              const GValueArray  *args,
 
44
              GError            **error)
 
45
{
 
46
  gboolean success = TRUE;
 
47
  const gchar *help_domain;
 
48
  const gchar *help_id;
 
49
 
 
50
  help_domain = g_value_get_string (&args->values[0]);
 
51
  help_id = g_value_get_string (&args->values[1]);
 
52
 
 
53
  if (success)
 
54
    {
 
55
      GimpPlugInManager *manager = gimp->plug_in_manager;
 
56
 
 
57
      if (! help_domain && manager->current_plug_in)
 
58
        help_domain = (gchar *)
 
59
          gimp_plug_in_manager_get_help_domain (manager,
 
60
                                                manager->current_plug_in->prog,
 
61
                                                NULL);
 
62
 
 
63
      gimp_help (gimp, progress, help_domain, help_id);
 
64
    }
 
65
 
 
66
  return gimp_procedure_get_return_values (procedure, success,
 
67
                                           error ? *error : NULL);
 
68
}
 
69
 
 
70
void
 
71
register_help_procs (GimpPDB *pdb)
 
72
{
 
73
  GimpProcedure *procedure;
 
74
 
 
75
  /*
 
76
   * gimp-help
 
77
   */
 
78
  procedure = gimp_procedure_new (help_invoker);
 
79
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
80
                               "gimp-help");
 
81
  gimp_procedure_set_static_strings (procedure,
 
82
                                     "gimp-help",
 
83
                                     "Load a help page.",
 
84
                                     "This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the 'gimp-plugin-help-register' procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.",
 
85
                                     "Michael Natterer <mitch@gimp.org>",
 
86
                                     "Michael Natterer",
 
87
                                     "2000",
 
88
                                     NULL);
 
89
  gimp_procedure_add_argument (procedure,
 
90
                               gimp_param_spec_string ("help-domain",
 
91
                                                       "help domain",
 
92
                                                       "The help domain in which help_id is registered",
 
93
                                                       FALSE, TRUE, FALSE,
 
94
                                                       NULL,
 
95
                                                       GIMP_PARAM_READWRITE));
 
96
  gimp_procedure_add_argument (procedure,
 
97
                               gimp_param_spec_string ("help-id",
 
98
                                                       "help id",
 
99
                                                       "The help page's ID",
 
100
                                                       FALSE, FALSE, FALSE,
 
101
                                                       NULL,
 
102
                                                       GIMP_PARAM_READWRITE));
 
103
  gimp_pdb_register_procedure (pdb, procedure);
 
104
  g_object_unref (procedure);
 
105
}