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

« back to all changes in this revision

Viewing changes to app/plug-in/gimppluginmanager-menu-branch.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * gimppluginmanager-menu-branch.c
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include <glib-object.h>
 
24
 
 
25
#include "plug-in-types.h"
 
26
 
 
27
#include "gimppluginmanager.h"
 
28
#include "gimppluginmanager-menu-branch.h"
 
29
 
 
30
 
 
31
/*  public functions  */
 
32
 
 
33
void
 
34
gimp_plug_in_manager_menu_branch_exit (GimpPlugInManager *manager)
 
35
{
 
36
  GSList *list;
 
37
 
 
38
  g_return_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager));
 
39
 
 
40
  for (list = manager->menu_branches; list; list = list->next)
 
41
    {
 
42
      GimpPlugInMenuBranch *branch = list->data;
 
43
 
 
44
      g_free (branch->prog_name);
 
45
      g_free (branch->menu_path);
 
46
      g_free (branch->menu_label);
 
47
      g_free (branch);
 
48
    }
 
49
 
 
50
  g_slist_free (manager->menu_branches);
 
51
  manager->menu_branches = NULL;
 
52
}
 
53
 
 
54
void
 
55
gimp_plug_in_manager_add_menu_branch (GimpPlugInManager *manager,
 
56
                                      const gchar       *prog_name,
 
57
                                      const gchar       *menu_path,
 
58
                                      const gchar       *menu_label)
 
59
{
 
60
  GimpPlugInMenuBranch *branch;
 
61
 
 
62
  g_return_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager));
 
63
  g_return_if_fail (prog_name != NULL);
 
64
  g_return_if_fail (menu_path != NULL);
 
65
  g_return_if_fail (menu_label != NULL);
 
66
 
 
67
  branch = g_new (GimpPlugInMenuBranch, 1);
 
68
 
 
69
  branch->prog_name  = g_strdup (prog_name);
 
70
  branch->menu_path  = g_strdup (menu_path);
 
71
  branch->menu_label = g_strdup (menu_label);
 
72
 
 
73
  manager->menu_branches = g_slist_append (manager->menu_branches, branch);
 
74
 
 
75
  g_signal_emit_by_name (manager, "menu-branch-added",
 
76
                         prog_name, menu_path, menu_label);
 
77
 
 
78
#ifdef VERBOSE
 
79
  g_print ("added menu branch \"%s\" at path \"%s\"\n",
 
80
           branch->menu_label, branch->menu_path);
 
81
#endif
 
82
}