~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to app/actions/fonts-actions.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995 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
#include "config.h"
 
20
 
 
21
#include <gtk/gtk.h>
 
22
 
 
23
#include "libgimpwidgets/gimpwidgets.h"
 
24
 
 
25
#include "actions-types.h"
 
26
 
 
27
#include "core/gimpcontext.h"
 
28
 
 
29
#include "text/gimpfont.h"
 
30
 
 
31
#include "widgets/gimpactiongroup.h"
 
32
#include "widgets/gimphelp-ids.h"
 
33
 
 
34
#include "actions.h"
 
35
#include "fonts-actions.h"
 
36
#include "fonts-commands.h"
 
37
 
 
38
#include "gimp-intl.h"
 
39
 
 
40
 
 
41
static GimpActionEntry fonts_actions[] =
 
42
{
 
43
  { "fonts-popup", GIMP_STOCK_FONT,
 
44
    N_("Fonts Menu"), NULL, NULL, NULL,
 
45
    GIMP_HELP_FONT_DIALOG },
 
46
 
 
47
  { "fonts-refresh", GTK_STOCK_REFRESH,
 
48
    N_("_Rescan Font List"), "",
 
49
    N_("Rescan font list"),
 
50
    G_CALLBACK (fonts_refresh_cmd_callback),
 
51
    GIMP_HELP_FONT_REFRESH }
 
52
};
 
53
 
 
54
 
 
55
void
 
56
fonts_actions_setup (GimpActionGroup *group)
 
57
{
 
58
  gimp_action_group_add_actions (group,
 
59
                                 fonts_actions,
 
60
                                 G_N_ELEMENTS (fonts_actions));
 
61
}
 
62
 
 
63
void
 
64
fonts_actions_update (GimpActionGroup *group,
 
65
                      gpointer         data)
 
66
{
 
67
  GimpContext *context = action_data_get_context (data);
 
68
  GimpFont    *font    = NULL;
 
69
 
 
70
  if (context)
 
71
    font = gimp_context_get_font (context);
 
72
 
 
73
#define SET_SENSITIVE(action,condition) \
 
74
        gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
 
75
 
 
76
  SET_SENSITIVE ("fonts-refresh", TRUE);
 
77
 
 
78
#undef SET_SENSITIVE
 
79
}