1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* gimppluginmanager-menu-branch.c
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.
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.
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.
23
#include <glib-object.h>
25
#include "plug-in-types.h"
27
#include "gimppluginmanager.h"
28
#include "gimppluginmanager-menu-branch.h"
31
/* public functions */
34
gimp_plug_in_manager_menu_branch_exit (GimpPlugInManager *manager)
38
g_return_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager));
40
for (list = manager->menu_branches; list; list = list->next)
42
GimpPlugInMenuBranch *branch = list->data;
44
g_free (branch->prog_name);
45
g_free (branch->menu_path);
46
g_free (branch->menu_label);
50
g_slist_free (manager->menu_branches);
51
manager->menu_branches = NULL;
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)
60
GimpPlugInMenuBranch *branch;
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);
67
branch = g_new (GimpPlugInMenuBranch, 1);
69
branch->prog_name = g_strdup (prog_name);
70
branch->menu_path = g_strdup (menu_path);
71
branch->menu_label = g_strdup (menu_label);
73
manager->menu_branches = g_slist_append (manager->menu_branches, branch);
75
g_signal_emit_by_name (manager, "menu-branch-added",
76
prog_name, menu_path, menu_label);
79
g_print ("added menu branch \"%s\" at path \"%s\"\n",
80
branch->menu_label, branch->menu_path);