2001-08-04 22:10:58 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
2015-12-13 03:44:46 +08:00
|
|
|
* gimpicons.c
|
|
|
|
* Copyright (C) 2001-2015 Michael Natterer <mitch@gimp.org>
|
2001-08-04 22:10:58 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2001-08-04 22:10:58 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2001-08-04 22:10:58 +08:00
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2001-08-04 22:10:58 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2014-05-07 04:45:19 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
#undef GIMP_DISABLE_DEPRECATED
|
2015-12-13 03:44:46 +08:00
|
|
|
#include "gimpicons.h"
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2016-01-11 21:48:14 +08:00
|
|
|
#include "icons/Color/gimp-icon-pixbufs.c"
|
2001-08-04 22:10:58 +08:00
|
|
|
|
|
|
|
#include "libgimp/libgimp-intl.h"
|
|
|
|
|
|
|
|
|
2010-07-06 00:01:28 +08:00
|
|
|
/**
|
|
|
|
* SECTION: gimpstock
|
|
|
|
* @title: GimpStock
|
|
|
|
* @short_description: Prebuilt common menu/toolbar items and
|
|
|
|
* corresponding icons
|
|
|
|
*
|
|
|
|
* GIMP registers a set of menu/toolbar items and corresponding icons
|
|
|
|
* in addition to the standard GTK+ stock items. These can be used
|
|
|
|
* just like GTK+ stock items. GIMP also overrides a few of the GTK+
|
|
|
|
* icons (namely the ones in dialog size).
|
|
|
|
*
|
|
|
|
* Stock icons may have a RTL variant which gets used for
|
|
|
|
* right-to-left locales.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2016-01-11 10:03:28 +08:00
|
|
|
#define LIBGIMP_DOMAIN GETTEXT_PACKAGE "-libgimp"
|
|
|
|
#define GIMP_TOILET_PAPER "gimp-toilet-paper"
|
2016-03-26 03:53:22 +08:00
|
|
|
#define GIMP_DEFAULT_ICON_THEME "Symbolic"
|
2003-01-26 20:24:05 +08:00
|
|
|
|
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
static GtkIconFactory *gimp_stock_factory = NULL;
|
|
|
|
|
|
|
|
|
2006-04-06 20:43:58 +08:00
|
|
|
static const GtkStockItem gimp_stock_items[] =
|
2001-08-04 22:10:58 +08:00
|
|
|
{
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_ANCHOR, N_("Anchor"), 0, 0, LIBGIMP_DOMAIN },
|
2004-11-14 09:51:21 +08:00
|
|
|
{ GIMP_STOCK_CENTER, N_("C_enter"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_DUPLICATE, N_("_Duplicate"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LINKED, N_("Linked"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_PASTE_AS_NEW, N_("Paste as New"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_PASTE_INTO, N_("Paste Into"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_RESET, N_("_Reset"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_VISIBLE, N_("Visible"), 0, 0, LIBGIMP_DOMAIN },
|
2016-06-06 02:22:03 +08:00
|
|
|
|
2003-04-05 05:53:54 +08:00
|
|
|
{ GIMP_STOCK_GRADIENT_LINEAR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_BILINEAR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_RADIAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SQUARE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_CONICAL_SYMMETRIC, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_CONICAL_ASYMMETRIC, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SHAPEBURST_ANGULAR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SHAPEBURST_SPHERICAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SHAPEBURST_DIMPLED, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SPIRAL_CLOCKWISE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRADIENT_SPIRAL_ANTICLOCKWISE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-09-12 02:48:00 +08:00
|
|
|
{ GIMP_STOCK_GRAVITY_EAST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-02-01 02:57:10 +08:00
|
|
|
{ GIMP_STOCK_GRAVITY_NORTH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_NORTH_EAST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_NORTH_WEST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_SOUTH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_SOUTH_EAST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_SOUTH_WEST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRAVITY_WEST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2005-06-04 01:05:01 +08:00
|
|
|
{ GIMP_STOCK_HCENTER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_VCENTER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_HCHAIN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_HCHAIN_BROKEN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_VCHAIN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_VCHAIN_BROKEN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-05-31 07:52:24 +08:00
|
|
|
{ GIMP_STOCK_SELECTION, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_SELECTION_REPLACE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_ADD, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_SUBTRACT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_INTERSECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2004-10-23 18:28:56 +08:00
|
|
|
{ GIMP_STOCK_SELECTION_STROKE, N_("_Stroke"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_SELECTION_TO_CHANNEL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_TO_PATH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2004-10-23 18:28:56 +08:00
|
|
|
{ GIMP_STOCK_PATH_STROKE, N_("_Stroke"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
|
2003-03-15 07:24:37 +08:00
|
|
|
{ GIMP_STOCK_CURVE_FREE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CURVE_SMOOTH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-03-07 00:47:34 +08:00
|
|
|
{ GIMP_STOCK_COLOR_PICKER_BLACK, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_COLOR_PICKER_GRAY, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_COLOR_PICKER_WHITE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_COLOR_TRIANGLE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2004-07-07 06:58:33 +08:00
|
|
|
{ GIMP_STOCK_COLOR_PICK_FROM_SCREEN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-07 00:47:34 +08:00
|
|
|
|
|
|
|
{ GIMP_STOCK_CHAR_PICKER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LETTER_SPACING, N_("L_etter Spacing"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LINE_SPACING, N_("L_ine Spacing"), 0, 0, LIBGIMP_DOMAIN },
|
2016-06-04 23:05:13 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
{ GIMP_STOCK_TEXT_DIR_LTR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TEXT_DIR_RTL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2016-06-07 04:37:25 +08:00
|
|
|
{ GIMP_STOCK_PATTERN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2016-06-10 20:37:17 +08:00
|
|
|
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_CONVERT_RGB, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONVERT_GRAYSCALE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONVERT_INDEXED, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_INVERT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_MERGE_DOWN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LAYER_TO_IMAGESIZE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_PLUGIN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_RESHOW_FILTER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_ROTATE_90, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_ROTATE_180, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_ROTATE_270, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2013-05-06 02:15:03 +08:00
|
|
|
{ GIMP_STOCK_RESIZE, N_("Re_size"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_SCALE, N_("_Scale"), 0, 0, LIBGIMP_DOMAIN },
|
2003-05-19 02:48:36 +08:00
|
|
|
{ GIMP_STOCK_FLIP_HORIZONTAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_FLIP_VERTICAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
|
2003-03-06 01:30:34 +08:00
|
|
|
{ GIMP_STOCK_IMAGES, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LAYERS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CHANNELS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_PATHS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-10-23 21:04:44 +08:00
|
|
|
{ GIMP_STOCK_TOOLS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_OPTIONS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DEVICE_STATUS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2010-02-20 04:23:02 +08:00
|
|
|
{ GIMP_STOCK_INPUT_DEVICE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2005-04-02 21:17:59 +08:00
|
|
|
{ GIMP_STOCK_CURSOR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SAMPLE_POINT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2010-08-12 05:32:44 +08:00
|
|
|
{ GIMP_STOCK_DYNAMICS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_PRESET, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-06 01:30:34 +08:00
|
|
|
|
2003-03-24 21:00:53 +08:00
|
|
|
{ GIMP_STOCK_IMAGE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-22 08:48:09 +08:00
|
|
|
{ GIMP_STOCK_LAYER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-27 20:29:54 +08:00
|
|
|
{ GIMP_STOCK_TEXT_LAYER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-09-07 04:47:08 +08:00
|
|
|
{ GIMP_STOCK_FLOATING_SELECTION, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-22 08:48:09 +08:00
|
|
|
{ GIMP_STOCK_CHANNEL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-24 21:00:53 +08:00
|
|
|
{ GIMP_STOCK_CHANNEL_RED, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CHANNEL_GREEN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CHANNEL_BLUE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CHANNEL_GRAY, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2004-01-27 21:48:20 +08:00
|
|
|
{ GIMP_STOCK_CHANNEL_INDEXED, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-24 21:00:53 +08:00
|
|
|
{ GIMP_STOCK_CHANNEL_ALPHA, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2004-01-27 10:51:19 +08:00
|
|
|
{ GIMP_STOCK_LAYER_MASK, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-05-31 07:52:24 +08:00
|
|
|
{ GIMP_STOCK_PATH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-04-04 00:13:12 +08:00
|
|
|
{ GIMP_STOCK_TEMPLATE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-06-16 23:06:57 +08:00
|
|
|
{ GIMP_STOCK_COLORMAP, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-11-01 10:39:34 +08:00
|
|
|
{ GIMP_STOCK_HISTOGRAM, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_HISTOGRAM_LINEAR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_HISTOGRAM_LOGARITHMIC, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-08-20 01:08:06 +08:00
|
|
|
{ GIMP_STOCK_UNDO_HISTORY, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-09-12 02:48:00 +08:00
|
|
|
{ GIMP_STOCK_TRANSPARENCY, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-22 08:48:09 +08:00
|
|
|
|
2003-03-07 00:47:34 +08:00
|
|
|
{ GIMP_STOCK_SELECTION_ALL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_NONE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_GROW, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SELECTION_SHRINK, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2004-01-27 10:51:19 +08:00
|
|
|
{ GIMP_STOCK_SELECTION_BORDER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-07 00:47:34 +08:00
|
|
|
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_NAVIGATION, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2005-09-19 20:44:06 +08:00
|
|
|
{ GIMP_STOCK_QUICK_MASK_OFF, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_QUICK_MASK_ON, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-10-02 01:31:42 +08:00
|
|
|
|
|
|
|
{ GIMP_STOCK_CONTROLLER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONTROLLER_KEYBOARD, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONTROLLER_LINUX_INPUT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONTROLLER_MIDI, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CONTROLLER_WHEEL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER_COLORBLIND, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER_CONTRAST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER_GAMMA, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER_LCMS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_DISPLAY_FILTER_PROOF, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-03-27 20:29:54 +08:00
|
|
|
{ GIMP_STOCK_LIST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_GRID, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-04-10 19:05:17 +08:00
|
|
|
{ GIMP_STOCK_PORTRAIT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_LANDSCAPE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-04-12 00:46:43 +08:00
|
|
|
{ GIMP_TOILET_PAPER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-04-11 23:38:04 +08:00
|
|
|
{ GIMP_STOCK_WEB, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_VIDEO, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2008-02-05 08:38:08 +08:00
|
|
|
{ GIMP_STOCK_GEGL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-04-11 23:38:04 +08:00
|
|
|
|
2004-08-05 02:15:41 +08:00
|
|
|
{ GIMP_STOCK_SHAPE_CIRCLE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SHAPE_DIAMOND, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_SHAPE_SQUARE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-10-02 01:31:42 +08:00
|
|
|
|
2003-09-28 03:05:13 +08:00
|
|
|
{ GIMP_STOCK_CAP_BUTT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CAP_ROUND, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_CAP_SQUARE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-10-02 01:31:42 +08:00
|
|
|
|
2003-09-28 03:05:13 +08:00
|
|
|
{ GIMP_STOCK_JOIN_MITER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_JOIN_ROUND, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_JOIN_BEVEL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-03-07 00:47:34 +08:00
|
|
|
{ GIMP_STOCK_ERROR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_INFO, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-07 00:47:34 +08:00
|
|
|
{ GIMP_STOCK_QUESTION, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2008-06-12 20:59:30 +08:00
|
|
|
{ GIMP_STOCK_USER_MANUAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_WARNING, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_WILBER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-03-07 00:47:34 +08:00
|
|
|
{ GIMP_STOCK_WILBER_EEK, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
|
2004-09-28 03:40:12 +08:00
|
|
|
{ GIMP_STOCK_FRAME, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TEXTURE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_AIRBRUSH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-05-18 05:48:38 +08:00
|
|
|
{ GIMP_STOCK_TOOL_ALIGN, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_BLEND, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_BLUR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_BRIGHTNESS_CONTRAST, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_BUCKET_FILL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_BY_COLOR_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2010-07-01 02:27:52 +08:00
|
|
|
{ GIMP_STOCK_TOOL_CAGE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_CLONE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_COLOR_BALANCE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_COLOR_PICKER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-05-19 22:21:03 +08:00
|
|
|
{ GIMP_STOCK_TOOL_COLORIZE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-10-12 18:08:56 +08:00
|
|
|
{ GIMP_STOCK_TOOL_CROP, N_("Cr_op"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_CURVES, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2010-06-19 04:35:24 +08:00
|
|
|
{ GIMP_STOCK_TOOL_DESATURATE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_DODGE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_ELLIPSE_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_ERASER, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_FLIP, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_FREE_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2014-04-19 04:14:41 +08:00
|
|
|
{ GIMP_STOCK_TOOL_FOREGROUND_SELECT, N_("_Select"), 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_FUZZY_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_HUE_SATURATION, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2006-09-03 02:54:35 +08:00
|
|
|
{ GIMP_STOCK_TOOL_HEAL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_INK, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_ISCISSORS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_LEVELS, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_MEASURE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_MOVE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_PAINTBRUSH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_PATH, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_PENCIL, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_PERSPECTIVE, N_("_Transform"), 0, 0, LIBGIMP_DOMAIN },
|
2006-09-08 01:10:22 +08:00
|
|
|
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
2003-01-26 20:24:05 +08:00
|
|
|
{ GIMP_STOCK_TOOL_POSTERIZE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_RECT_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_ROTATE, N_("_Rotate"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_SCALE, N_("_Scale"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_SHEAR, N_("_Shear"), 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_SMUDGE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_TEXT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_THRESHOLD, NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ GIMP_STOCK_TOOL_ZOOM, NULL, 0, 0, LIBGIMP_DOMAIN }
|
2001-08-06 00:07:02 +08:00
|
|
|
};
|
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
static const GtkStockItem gimp_compat_stock_items[] =
|
2001-08-06 00:07:02 +08:00
|
|
|
{
|
2014-05-20 08:13:28 +08:00
|
|
|
{ "gimp-indexed-palette", NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ "gimp-qmask-off", NULL, 0, 0, LIBGIMP_DOMAIN },
|
|
|
|
{ "gimp-qmask-on", NULL, 0, 0, LIBGIMP_DOMAIN }
|
2001-08-04 22:10:58 +08:00
|
|
|
};
|
|
|
|
|
2001-11-10 00:54:56 +08:00
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
static void
|
|
|
|
register_stock_icon (GtkIconFactory *factory,
|
2017-03-24 12:02:44 +08:00
|
|
|
const gchar *stock_id,
|
2014-05-20 08:13:28 +08:00
|
|
|
const gchar *icon_name)
|
2003-03-27 20:29:54 +08:00
|
|
|
{
|
2014-05-20 08:13:28 +08:00
|
|
|
GtkIconSet *set = gtk_icon_set_new ();
|
|
|
|
GtkIconSource *source = gtk_icon_source_new ();
|
2003-03-27 20:29:54 +08:00
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
gtk_icon_source_set_direction_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_size_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_state_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_icon_name (source, icon_name);
|
|
|
|
|
|
|
|
gtk_icon_set_add_source (set, source);
|
|
|
|
gtk_icon_source_free (source);
|
|
|
|
|
|
|
|
gtk_icon_factory_add (factory, stock_id, set);
|
|
|
|
gtk_icon_set_unref (set);
|
2003-01-10 21:01:41 +08:00
|
|
|
}
|
2001-11-10 00:54:56 +08:00
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
static void
|
|
|
|
register_bidi_stock_icon (GtkIconFactory *factory,
|
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *icon_name_ltr,
|
|
|
|
const gchar *icon_name_rtl)
|
2003-09-23 20:30:53 +08:00
|
|
|
{
|
2014-05-20 08:13:28 +08:00
|
|
|
GtkIconSet *set = gtk_icon_set_new ();
|
|
|
|
GtkIconSource *source = gtk_icon_source_new ();
|
|
|
|
|
|
|
|
gtk_icon_source_set_direction (source, GTK_TEXT_DIR_LTR);
|
|
|
|
gtk_icon_source_set_direction_wildcarded (source, FALSE);
|
|
|
|
gtk_icon_source_set_size_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_state_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_icon_name (source, icon_name_ltr);
|
|
|
|
|
|
|
|
gtk_icon_set_add_source (set, source);
|
|
|
|
gtk_icon_source_free (source);
|
|
|
|
|
|
|
|
source = gtk_icon_source_new ();
|
|
|
|
|
|
|
|
gtk_icon_source_set_direction (source, GTK_TEXT_DIR_RTL);
|
|
|
|
gtk_icon_source_set_direction_wildcarded (source, FALSE);
|
|
|
|
gtk_icon_source_set_size_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_state_wildcarded (source, TRUE);
|
|
|
|
gtk_icon_source_set_icon_name (source, icon_name_rtl);
|
|
|
|
|
|
|
|
gtk_icon_set_add_source (set, source);
|
|
|
|
gtk_icon_source_free (source);
|
|
|
|
|
|
|
|
gtk_icon_factory_add (factory, stock_id, set);
|
|
|
|
gtk_icon_set_unref (set);
|
2003-09-23 20:30:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
static GFile *icon_theme_path = NULL;
|
|
|
|
static GFile *default_search_path = NULL;
|
2015-12-13 02:32:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2016-09-02 18:30:49 +08:00
|
|
|
gimp_icons_change_icon_theme (GFile *new_search_path)
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
GFile *old_search_path = g_file_get_parent (icon_theme_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
if (! default_search_path)
|
|
|
|
default_search_path = gimp_data_directory_file ("icons", NULL);
|
|
|
|
|
|
|
|
if (! g_file_equal (new_search_path, old_search_path))
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
|
|
|
GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
if (g_file_equal (old_search_path, default_search_path))
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
/* if the old icon theme is in the default search path,
|
|
|
|
* simply prepend the new theme's path
|
2015-12-13 02:32:11 +08:00
|
|
|
*/
|
2016-09-02 18:30:49 +08:00
|
|
|
gchar *path_str = g_file_get_path (new_search_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
|
|
|
gtk_icon_theme_prepend_search_path (icon_theme, path_str);
|
|
|
|
g_free (path_str);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
/* if the old theme is not in the default search path,
|
|
|
|
* we need to deal with the search path's first element
|
2015-12-13 02:32:11 +08:00
|
|
|
*/
|
|
|
|
gchar **paths;
|
|
|
|
gint n_paths;
|
|
|
|
|
|
|
|
gtk_icon_theme_get_search_path (icon_theme, &paths, &n_paths);
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
if (g_file_equal (new_search_path, default_search_path))
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
/* when switching to a theme in the default path, remove
|
|
|
|
* the first search path element, the default search path
|
|
|
|
* is still in the search path
|
2015-12-13 02:32:11 +08:00
|
|
|
*/
|
|
|
|
gtk_icon_theme_set_search_path (icon_theme,
|
|
|
|
(const gchar **) paths + 1,
|
|
|
|
n_paths - 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
/* when switching between two non-default search paths, replace
|
2015-12-13 02:32:11 +08:00
|
|
|
* the first element of the search path with the new
|
|
|
|
* theme's path
|
|
|
|
*/
|
|
|
|
g_free (paths[0]);
|
2016-09-02 18:30:49 +08:00
|
|
|
paths[0] = g_file_get_path (new_search_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
|
|
|
gtk_icon_theme_set_search_path (icon_theme,
|
|
|
|
(const gchar **) paths, n_paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_strfreev (paths);
|
|
|
|
}
|
2016-09-02 18:30:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (old_search_path);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_icons_notify_system_icon_theme (GObject *settings,
|
|
|
|
GParamSpec *param,
|
|
|
|
gpointer unused)
|
|
|
|
{
|
|
|
|
GdkScreen *screen = gdk_screen_get_default ();
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
|
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
|
|
|
|
|
|
|
if (gdk_screen_get_setting (screen, "gtk-icon-theme-name", &value))
|
|
|
|
{
|
|
|
|
const gchar *new_system_icon_theme = g_value_get_string (&value);
|
|
|
|
gchar *cur_system_icon_theme = NULL;
|
|
|
|
|
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-fallback-icon-theme", &cur_system_icon_theme,
|
|
|
|
NULL);
|
|
|
|
if (g_strcmp0 (cur_system_icon_theme, new_system_icon_theme))
|
|
|
|
{
|
|
|
|
g_object_set (settings,
|
|
|
|
"gtk-fallback-icon-theme", new_system_icon_theme,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_object_notify (settings, "gtk-icon-theme-name");
|
|
|
|
}
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
g_free (cur_system_icon_theme);
|
2015-12-13 02:32:11 +08:00
|
|
|
}
|
2016-09-02 18:30:49 +08:00
|
|
|
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gimp_icons_sanity_check (GFile *path,
|
|
|
|
const gchar *theme_name)
|
|
|
|
{
|
|
|
|
gboolean exists = FALSE;
|
|
|
|
GFile *child = g_file_get_child (path, theme_name);
|
|
|
|
|
|
|
|
if (g_file_query_exists (child, NULL))
|
|
|
|
{
|
|
|
|
GFile *index = g_file_get_child (child, "index.theme");
|
|
|
|
|
|
|
|
if (g_file_query_exists (index, NULL))
|
|
|
|
exists = TRUE;
|
|
|
|
else
|
|
|
|
g_printerr ("%s: Icon theme path has no '%s/index.theme': %s\n",
|
|
|
|
G_STRFUNC, theme_name, gimp_file_get_utf8_name (path));
|
|
|
|
|
|
|
|
g_object_unref (index);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
g_printerr ("%s: Icon theme path has no '%s' subdirectory: %s\n",
|
|
|
|
G_STRFUNC, theme_name, gimp_file_get_utf8_name (path));
|
|
|
|
|
|
|
|
g_object_unref (child);
|
|
|
|
|
|
|
|
return exists;
|
2015-12-13 02:32:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-12-13 03:44:46 +08:00
|
|
|
gimp_icons_set_icon_theme (GFile *path)
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
gchar *icon_theme_name;
|
|
|
|
GFile *search_path;
|
|
|
|
|
2015-12-13 02:32:11 +08:00
|
|
|
g_return_if_fail (path == NULL || G_IS_FILE (path));
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
path = g_object_ref (path);
|
|
|
|
else
|
2016-09-02 18:30:49 +08:00
|
|
|
path = gimp_data_directory_file ("icons", GIMP_DEFAULT_ICON_THEME, NULL);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
search_path = g_file_get_parent (path);
|
|
|
|
icon_theme_name = g_file_get_basename (path);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
if (gimp_icons_sanity_check (search_path, "hicolor") &&
|
|
|
|
gimp_icons_sanity_check (search_path, icon_theme_name))
|
|
|
|
{
|
|
|
|
if (icon_theme_path)
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
/* this is an icon theme change */
|
|
|
|
gimp_icons_change_icon_theme (search_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
if (! g_file_equal (icon_theme_path, path))
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
g_object_unref (icon_theme_path);
|
|
|
|
icon_theme_path = g_object_ref (path);
|
2015-12-13 02:32:11 +08:00
|
|
|
}
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
|
|
|
|
"gtk-icon-theme-name", icon_theme_name,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* this is the first call upon initialization */
|
|
|
|
icon_theme_path = g_object_ref (path);
|
2015-12-13 02:32:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
g_free (icon_theme_name);
|
|
|
|
g_object_unref (search_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
g_object_unref (path);
|
|
|
|
}
|
|
|
|
|
2004-12-14 09:42:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_stock_init:
|
|
|
|
*
|
|
|
|
* Initializes the GIMP stock icon factory.
|
|
|
|
*
|
|
|
|
* You don't need to call this function as gimp_ui_init() already does
|
|
|
|
* this for you.
|
2015-12-13 03:44:46 +08:00
|
|
|
*
|
2016-06-26 04:54:10 +08:00
|
|
|
* Deprecated: 2.10: Use gimp_icons_init() instead.
|
2004-12-14 09:42:08 +08:00
|
|
|
*/
|
2001-08-04 22:10:58 +08:00
|
|
|
void
|
|
|
|
gimp_stock_init (void)
|
2015-12-13 03:44:46 +08:00
|
|
|
{
|
|
|
|
gimp_icons_init ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_icons_init:
|
|
|
|
*
|
|
|
|
* Initializes the GIMP stock icon factory.
|
|
|
|
*
|
|
|
|
* You don't need to call this function as gimp_ui_init() already does
|
|
|
|
* this for you.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gimp_icons_init (void)
|
2001-08-04 22:10:58 +08:00
|
|
|
{
|
|
|
|
static gboolean initialized = FALSE;
|
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
GtkSettings *settings;
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GError *error = NULL;
|
|
|
|
gchar *icons_dir;
|
|
|
|
gchar *system_icon_theme;
|
|
|
|
gchar *gimp_icon_theme;
|
|
|
|
gint i;
|
2001-08-06 00:07:02 +08:00
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
if (initialized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gimp_stock_factory = gtk_icon_factory_new ();
|
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (gimp_stock_items); i++)
|
2003-03-27 20:29:54 +08:00
|
|
|
{
|
2014-05-20 08:13:28 +08:00
|
|
|
register_stock_icon (gimp_stock_factory,
|
|
|
|
gimp_stock_items[i].stock_id,
|
|
|
|
gimp_stock_items[i].stock_id);
|
2003-03-27 20:29:54 +08:00
|
|
|
}
|
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
register_bidi_stock_icon (gimp_stock_factory,
|
|
|
|
GIMP_STOCK_MENU_LEFT,
|
|
|
|
GIMP_STOCK_MENU_LEFT, GIMP_STOCK_MENU_RIGHT);
|
|
|
|
register_bidi_stock_icon (gimp_stock_factory,
|
|
|
|
GIMP_STOCK_MENU_RIGHT,
|
|
|
|
GIMP_STOCK_MENU_RIGHT, GIMP_STOCK_MENU_LEFT);
|
2001-11-10 00:54:56 +08:00
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
register_stock_icon (gimp_stock_factory,
|
|
|
|
"gimp-indexed-palette", GIMP_STOCK_COLORMAP);
|
|
|
|
register_stock_icon (gimp_stock_factory,
|
|
|
|
"gimp-qmask-off", GIMP_STOCK_QUICK_MASK_OFF);
|
|
|
|
register_stock_icon (gimp_stock_factory,
|
|
|
|
"gimp-qmask-on", GIMP_STOCK_QUICK_MASK_ON);
|
2003-09-23 20:30:53 +08:00
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
gtk_icon_factory_add_default (gimp_stock_factory);
|
|
|
|
|
2014-05-20 08:13:28 +08:00
|
|
|
gtk_stock_add_static (gimp_stock_items,
|
|
|
|
G_N_ELEMENTS (gimp_stock_items));
|
|
|
|
gtk_stock_add_static (gimp_compat_stock_items,
|
|
|
|
G_N_ELEMENTS (gimp_compat_stock_items));
|
2001-08-04 22:10:58 +08:00
|
|
|
|
2015-12-13 02:32:11 +08:00
|
|
|
/* always prepend the default icon theme, it's never removed from
|
|
|
|
* the path again and acts as fallback for missing icons in other
|
|
|
|
* themes.
|
|
|
|
*/
|
2016-09-02 18:30:49 +08:00
|
|
|
if (! default_search_path)
|
|
|
|
default_search_path = gimp_data_directory_file ("icons",
|
|
|
|
NULL);
|
2015-12-09 03:52:12 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
icons_dir = g_file_get_path (default_search_path);
|
2014-05-07 21:02:33 +08:00
|
|
|
gtk_icon_theme_prepend_search_path (gtk_icon_theme_get_default (),
|
|
|
|
icons_dir);
|
2014-05-07 04:45:19 +08:00
|
|
|
g_free (icons_dir);
|
|
|
|
|
2015-12-13 02:32:11 +08:00
|
|
|
/* if an icon theme was chosen before init(), change to it */
|
2016-09-02 18:30:49 +08:00
|
|
|
if (icon_theme_path)
|
2015-12-13 02:32:11 +08:00
|
|
|
{
|
2016-09-02 18:30:49 +08:00
|
|
|
GFile *search_path = g_file_get_parent (icon_theme_path);
|
|
|
|
|
|
|
|
if (!g_file_equal (search_path, default_search_path))
|
|
|
|
{
|
|
|
|
gchar *icon_dir = g_file_get_path (search_path);
|
|
|
|
|
|
|
|
gtk_icon_theme_prepend_search_path (gtk_icon_theme_get_default (),
|
|
|
|
icon_dir);
|
|
|
|
g_free (icon_dir);
|
|
|
|
}
|
|
|
|
g_object_unref (search_path);
|
|
|
|
|
|
|
|
gimp_icon_theme = g_file_get_basename (icon_theme_path);
|
2015-12-13 02:32:11 +08:00
|
|
|
}
|
2016-09-02 18:30:49 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_icon_theme = g_strdup (GIMP_DEFAULT_ICON_THEME);
|
|
|
|
}
|
|
|
|
|
|
|
|
settings = gtk_settings_get_for_screen (gdk_screen_get_default ());
|
|
|
|
|
|
|
|
g_object_get (settings, "gtk-icon-theme-name", &system_icon_theme, NULL);
|
|
|
|
|
|
|
|
g_object_set (settings,
|
|
|
|
"gtk-fallback-icon-theme", system_icon_theme,
|
|
|
|
"gtk-icon-theme-name", gimp_icon_theme,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_free (gimp_icon_theme);
|
|
|
|
g_free (system_icon_theme);
|
2015-12-13 02:32:11 +08:00
|
|
|
|
2016-09-02 18:30:49 +08:00
|
|
|
g_signal_connect (settings, "notify::gtk-icon-theme-name",
|
|
|
|
G_CALLBACK (gimp_icons_notify_system_icon_theme), NULL);
|
2015-04-22 03:55:46 +08:00
|
|
|
pixbuf = gdk_pixbuf_new_from_resource ("/org/gimp/icons/64/gimp-wilber-eek.png",
|
|
|
|
&error);
|
|
|
|
|
|
|
|
if (pixbuf)
|
|
|
|
{
|
|
|
|
gtk_icon_theme_add_builtin_icon (GIMP_STOCK_WILBER_EEK, 64, pixbuf);
|
|
|
|
g_object_unref (pixbuf);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_critical ("Failed to create icon image: %s", error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
2014-05-15 21:39:24 +08:00
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
initialized = TRUE;
|
|
|
|
}
|