2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-04-19 22:54:24 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "actions-types.h"
|
|
|
|
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
|
|
|
|
#include "text/gimpfont.h"
|
|
|
|
|
|
|
|
#include "widgets/gimpactiongroup.h"
|
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
#include "actions.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
#include "fonts-actions.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "fonts-commands.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpActionEntry fonts_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2004-10-18 19:29:58 +08:00
|
|
|
{ "fonts-popup", GIMP_STOCK_FONT,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("fonts-action", "Fonts Menu"), NULL, NULL, NULL,
|
2004-05-02 16:56:07 +08:00
|
|
|
GIMP_HELP_FONT_DIALOG },
|
2004-04-22 00:10:00 +08:00
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
{ "fonts-refresh", GTK_STOCK_REFRESH,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("fonts-action", "_Rescan Font List"), "",
|
2004-05-12 00:05:21 +08:00
|
|
|
N_("Rescan font list"),
|
2004-04-19 22:54:24 +08:00
|
|
|
G_CALLBACK (fonts_refresh_cmd_callback),
|
|
|
|
GIMP_HELP_FONT_REFRESH }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2004-04-27 21:55:26 +08:00
|
|
|
fonts_actions_setup (GimpActionGroup *group)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2008-12-03 23:27:42 +08:00
|
|
|
gimp_action_group_add_actions (group, "fonts-action",
|
2004-04-19 22:54:24 +08:00
|
|
|
fonts_actions,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_N_ELEMENTS (fonts_actions));
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
fonts_actions_update (GimpActionGroup *group,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2004-10-18 19:29:58 +08:00
|
|
|
GimpContext *context = action_data_get_context (data);
|
|
|
|
GimpFont *font = NULL;
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
if (context)
|
|
|
|
font = gimp_context_get_font (context);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#define SET_SENSITIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
|
|
|
|
|
|
|
SET_SENSITIVE ("fonts-refresh", TRUE);
|
|
|
|
|
|
|
|
#undef SET_SENSITIVE
|
|
|
|
}
|