libgimpwidgets: rename gimpstock.[ch] to gimpicons.[ch]

because stock is on its way out, so we better start renaming and
deprecating stuff sooner than later.
This commit is contained in:
Michael Natterer 2015-12-12 20:44:46 +01:00
parent 69f87bcc84
commit 71894bd787
21 changed files with 58 additions and 36 deletions

View File

@ -216,7 +216,7 @@ icons_apply_theme (Gimp *gimp,
if (gimp->be_verbose) if (gimp->be_verbose)
g_print ("Loading icon theme '%s'\n", icon_theme_name); g_print ("Loading icon theme '%s'\n", icon_theme_name);
gimp_stock_set_icon_theme (icon_themes_get_theme_dir (gimp, icon_theme_name)); gimp_icons_set_icon_theme (icon_themes_get_theme_dir (gimp, icon_theme_name));
} }
static void static void
@ -233,7 +233,7 @@ icons_list_icons_foreach (gpointer key,
static gint static gint
icons_name_compare (const void *p1, icons_name_compare (const void *p1,
const void *p2) const void *p2)
{ {
return strcmp (* (char **) p1, * (char **) p2); return strcmp (* (char **) p1, * (char **) p2);
} }

View File

@ -94,7 +94,7 @@
<xi:include href="xml/gimpcairo-utils.xml" /> <xi:include href="xml/gimpcairo-utils.xml" />
<xi:include href="xml/gimphelpui.xml" /> <xi:include href="xml/gimphelpui.xml" />
<xi:include href="xml/gimpquerybox.xml" /> <xi:include href="xml/gimpquerybox.xml" />
<xi:include href="xml/gimpstock.xml" /> <xi:include href="xml/gimpicons.xml" />
<xi:include href="xml/gimpenumwidgets.xml" /> <xi:include href="xml/gimpenumwidgets.xml" />
<xi:include href="xml/gimppropwidgets.xml" /> <xi:include href="xml/gimppropwidgets.xml" />
<xi:include href="xml/gimpwidgets.xml" /> <xi:include href="xml/gimpwidgets.xml" />

View File

@ -762,9 +762,11 @@ GIMP_QUERY_BOX_VBOX
</SECTION> </SECTION>
<SECTION> <SECTION>
<FILE>gimpstock</FILE> <FILE>gimpicons</FILE>
<TITLE>GimpStock</TITLE> <TITLE>GimpIcons</TITLE>
gimp_stock_init gimp_stock_init
gimp_icons_init
gimp_icons_set_icon_theme
<SUBSECTION Stock IDs> <SUBSECTION Stock IDs>
GIMP_STOCK_ANCHOR GIMP_STOCK_ANCHOR
GIMP_STOCK_CENTER GIMP_STOCK_CENTER

View File

@ -139,7 +139,7 @@ gimp_ui_init (const gchar *prog_name,
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen)); gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
icon_theme = g_file_new_for_path (gimp_get_icon_theme_dir ()); icon_theme = g_file_new_for_path (gimp_get_icon_theme_dir ());
gimp_stock_set_icon_theme (icon_theme); gimp_icons_set_icon_theme (icon_theme);
g_object_unref (icon_theme); g_object_unref (icon_theme);
gimp_widgets_init (gimp_ui_help_func, gimp_widgets_init (gimp_ui_help_func,

View File

@ -125,6 +125,8 @@ libgimpwidgets_sources = \
gimphelpui.h \ gimphelpui.h \
gimphintbox.c \ gimphintbox.c \
gimphintbox.h \ gimphintbox.h \
gimpicons.c \
gimpicons.h \
gimpintcombobox.c \ gimpintcombobox.c \
gimpintcombobox.h \ gimpintcombobox.h \
gimpintstore.c \ gimpintstore.c \
@ -161,8 +163,6 @@ libgimpwidgets_sources = \
gimpscrolledpreview.h \ gimpscrolledpreview.h \
gimpsizeentry.c \ gimpsizeentry.c \
gimpsizeentry.h \ gimpsizeentry.h \
gimpstock.c \
gimpstock.h \
gimpstringcombobox.c \ gimpstringcombobox.c \
gimpstringcombobox.h \ gimpstringcombobox.h \
gimpunitcombobox.c \ gimpunitcombobox.c \
@ -229,6 +229,7 @@ libgimpwidgetsinclude_HEADERS = \
gimpframe.h \ gimpframe.h \
gimphelpui.h \ gimphelpui.h \
gimphintbox.h \ gimphintbox.h \
gimpicons.h \
gimpintcombobox.h \ gimpintcombobox.h \
gimpintstore.h \ gimpintstore.h \
gimpmemsizeentry.h \ gimpmemsizeentry.h \
@ -247,7 +248,6 @@ libgimpwidgetsinclude_HEADERS = \
gimpscaleentry.h \ gimpscaleentry.h \
gimpscrolledpreview.h \ gimpscrolledpreview.h \
gimpsizeentry.h \ gimpsizeentry.h \
gimpstock.h \
gimpstringcombobox.h \ gimpstringcombobox.h \
gimpunitcombobox.h \ gimpunitcombobox.h \
gimpunitmenu.h \ gimpunitmenu.h \

View File

@ -26,7 +26,7 @@
#include "gimpwidgetstypes.h" #include "gimpwidgetstypes.h"
#include "gimpchainbutton.h" #include "gimpchainbutton.h"
#include "gimpstock.h" #include "gimpicons.h"
/** /**

View File

@ -36,7 +36,7 @@
#include "gimpcolorselection.h" #include "gimpcolorselection.h"
#include "gimpdialog.h" #include "gimpdialog.h"
#include "gimphelpui.h" #include "gimphelpui.h"
#include "gimpstock.h" #include "gimpicons.h"
#include "gimpwidgets-private.h" #include "gimpwidgets-private.h"
#include "gimp3migration.h" #include "gimp3migration.h"

View File

@ -32,8 +32,8 @@
#include "gimpwidgetstypes.h" #include "gimpwidgetstypes.h"
#include "gimpstock.h"
#include "gimpcolordisplay.h" #include "gimpcolordisplay.h"
#include "gimpicons.h"
/** /**

View File

@ -36,8 +36,8 @@
#include "gimpcolorselector.h" #include "gimpcolorselector.h"
#include "gimpcolorselect.h" #include "gimpcolorselect.h"
#include "gimphelpui.h" #include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppreviewarea.h" #include "gimppreviewarea.h"
#include "gimpstock.h"
#include "gimp3migration.h" #include "gimp3migration.h"
#include "libgimp/libgimp-intl.h" #include "libgimp/libgimp-intl.h"

View File

@ -35,7 +35,7 @@
#include "gimpcolorselect.h" #include "gimpcolorselect.h"
#include "gimpcolorselection.h" #include "gimpcolorselection.h"
#include "gimphelpui.h" #include "gimphelpui.h"
#include "gimpstock.h" #include "gimpicons.h"
#include "gimpwidgets.h" #include "gimpwidgets.h"
#include "gimpwidgets-private.h" #include "gimpwidgets-private.h"

View File

@ -33,7 +33,7 @@
#define GIMP_ENABLE_CONTROLLER_UNDER_CONSTRUCTION #define GIMP_ENABLE_CONTROLLER_UNDER_CONSTRUCTION
#include "gimpcontroller.h" #include "gimpcontroller.h"
#include "gimpstock.h" #include "gimpicons.h"
/** /**

View File

@ -1,8 +1,8 @@
/* LIBGIMP - The GIMP Library /* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* *
* gimpstock.c * gimpicons.c
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org> * Copyright (C) 2001-2015 Michael Natterer <mitch@gimp.org>
* *
* This library is free software: you can redistribute it and/or * This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -25,7 +25,7 @@
#include "libgimpbase/gimpbase.h" #include "libgimpbase/gimpbase.h"
#include "gimpstock.h" #include "gimpicons.h"
#include "icons/Default/gimp-icon-pixbufs.c" #include "icons/Default/gimp-icon-pixbufs.c"
@ -351,7 +351,7 @@ static GFile *default_icon_theme_path = NULL;
static void static void
gimp_stock_change_icon_theme (GFile *path) gimp_icons_change_icon_theme (GFile *path)
{ {
if (! default_icon_theme_path) if (! default_icon_theme_path)
default_icon_theme_path = gimp_data_directory_file ("icons", "Default", default_icon_theme_path = gimp_data_directory_file ("icons", "Default",
@ -413,7 +413,7 @@ gimp_stock_change_icon_theme (GFile *path)
} }
void void
gimp_stock_set_icon_theme (GFile *path) gimp_icons_set_icon_theme (GFile *path)
{ {
g_return_if_fail (path == NULL || G_IS_FILE (path)); g_return_if_fail (path == NULL || G_IS_FILE (path));
@ -453,7 +453,7 @@ gimp_stock_set_icon_theme (GFile *path)
if (icon_theme_path) if (icon_theme_path)
{ {
/* this is an icon theme change */ /* this is an icon theme change */
gimp_stock_change_icon_theme (path); gimp_icons_change_icon_theme (path);
} }
else else
{ {
@ -478,9 +478,25 @@ gimp_stock_set_icon_theme (GFile *path)
* *
* You don't need to call this function as gimp_ui_init() already does * You don't need to call this function as gimp_ui_init() already does
* this for you. * this for you.
*
* Deprecated: 2.10: USe gimp_icons_init() instead.
*/ */
void void
gimp_stock_init (void) gimp_stock_init (void)
{
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)
{ {
static gboolean initialized = FALSE; static gboolean initialized = FALSE;

View File

@ -1,8 +1,8 @@
/* LIBGIMP - The GIMP Library /* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* *
* gimpstock.h * gimpicons.h
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org> * Copyright (C) 2001-2015 Michael Natterer <mitch@gimp.org>
* *
* This library is free software: you can redistribute it and/or * This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,8 +23,8 @@
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly." #error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
#endif #endif
#ifndef __GIMP_STOCK_H__ #ifndef __GIMP_ICONS_H__
#define __GIMP_STOCK_H__ #define __GIMP_ICONS_H__
G_BEGIN_DECLS G_BEGIN_DECLS
@ -296,11 +296,14 @@ G_BEGIN_DECLS
#define GIMP_STOCK_CONVERT_PRECISION GIMP_STOCK_CONVERT_RGB #define GIMP_STOCK_CONVERT_PRECISION GIMP_STOCK_CONVERT_RGB
GIMP_DEPRECATED_FOR(gimp_icons_init)
void gimp_stock_init (void); void gimp_stock_init (void);
void gimp_stock_set_icon_theme (GFile *path); void gimp_icons_init (void);
void gimp_icons_set_icon_theme (GFile *path);
G_END_DECLS G_END_DECLS
#endif /* __GIMP_STOCK_H__ */ #endif /* __GIMP_ICONS_H__ */

View File

@ -29,9 +29,9 @@
#include "gimpwidgetstypes.h" #include "gimpwidgetstypes.h"
#include "gimpicons.h"
#include "gimppageselector.h" #include "gimppageselector.h"
#include "gimppropwidgets.h" #include "gimppropwidgets.h"
#include "gimpstock.h"
#include "gimpwidgets.h" #include "gimpwidgets.h"
#include "gimp3migration.h" #include "gimp3migration.h"

View File

@ -28,8 +28,8 @@
#include "gimpcairo-utils.h" #include "gimpcairo-utils.h"
#include "gimphelpui.h" #include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppickbutton.h" #include "gimppickbutton.h"
#include "gimpstock.h"
#include "cursors/gimp-color-picker-cursors.c" #include "cursors/gimp-color-picker-cursors.c"

View File

@ -28,8 +28,8 @@
#include "gimpcairo-utils.h" #include "gimpcairo-utils.h"
#include "gimphelpui.h" #include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppickbutton.h" #include "gimppickbutton.h"
#include "gimpstock.h"
#include "libgimp/libgimp-intl.h" #include "libgimp/libgimp-intl.h"

View File

@ -26,9 +26,9 @@
#include "gimpwidgetstypes.h" #include "gimpwidgetstypes.h"
#include "gimpicons.h"
#include "gimppreviewarea.h" #include "gimppreviewarea.h"
#include "gimpscrolledpreview.h" #include "gimpscrolledpreview.h"
#include "gimpstock.h"
#include "gimp3migration.h" #include "gimp3migration.h"
#include "libgimp/libgimp-intl.h" #include "libgimp/libgimp-intl.h"

View File

@ -27,7 +27,7 @@
#include "gimpwidgetstypes.h" #include "gimpwidgetstypes.h"
#include "gimpstock.h" #include "gimpicons.h"
#include "gimpwidgets-private.h" #include "gimpwidgets-private.h"
#include "libgimp/libgimp-intl.h" #include "libgimp/libgimp-intl.h"
@ -74,7 +74,7 @@ gimp_widgets_init (GimpHelpFunc standard_help_func,
_gimp_get_background_func = get_background_func; _gimp_get_background_func = get_background_func;
_gimp_ensure_modules_func = ensure_modules_func; _gimp_ensure_modules_func = ensure_modules_func;
gimp_stock_init (); gimp_icons_init ();
gtk_window_set_default_icon_name (GIMP_STOCK_WILBER); gtk_window_set_default_icon_name (GIMP_STOCK_WILBER);

View File

@ -181,6 +181,8 @@ EXPORTS
gimp_hint_box_get_type gimp_hint_box_get_type
gimp_hint_box_new gimp_hint_box_new
gimp_icon_pixbufs_get_resource gimp_icon_pixbufs_get_resource
gimp_icons_init
gimp_icons_set_icon_theme
gimp_int_adjustment_update gimp_int_adjustment_update
gimp_int_combo_box_append gimp_int_combo_box_append
gimp_int_combo_box_connect gimp_int_combo_box_connect
@ -373,7 +375,6 @@ EXPORTS
gimp_spin_button_new gimp_spin_button_new
gimp_standard_help_func gimp_standard_help_func
gimp_stock_init gimp_stock_init
gimp_stock_set_icon_theme
gimp_string_combo_box_get_active gimp_string_combo_box_get_active
gimp_string_combo_box_get_type gimp_string_combo_box_get_type
gimp_string_combo_box_new gimp_string_combo_box_new

View File

@ -56,6 +56,7 @@
#include <libgimpwidgets/gimpframe.h> #include <libgimpwidgets/gimpframe.h>
#include <libgimpwidgets/gimphelpui.h> #include <libgimpwidgets/gimphelpui.h>
#include <libgimpwidgets/gimphintbox.h> #include <libgimpwidgets/gimphintbox.h>
#include <libgimpwidgets/gimpicons.h>
#include <libgimpwidgets/gimpintcombobox.h> #include <libgimpwidgets/gimpintcombobox.h>
#include <libgimpwidgets/gimpintstore.h> #include <libgimpwidgets/gimpintstore.h>
#include <libgimpwidgets/gimpmemsizeentry.h> #include <libgimpwidgets/gimpmemsizeentry.h>
@ -73,7 +74,6 @@
#include <libgimpwidgets/gimpscaleentry.h> #include <libgimpwidgets/gimpscaleentry.h>
#include <libgimpwidgets/gimpscrolledpreview.h> #include <libgimpwidgets/gimpscrolledpreview.h>
#include <libgimpwidgets/gimpsizeentry.h> #include <libgimpwidgets/gimpsizeentry.h>
#include <libgimpwidgets/gimpstock.h>
#include <libgimpwidgets/gimpstringcombobox.h> #include <libgimpwidgets/gimpstringcombobox.h>
#include <libgimpwidgets/gimpunitcombobox.h> #include <libgimpwidgets/gimpunitcombobox.h>
#include <libgimpwidgets/gimpunitmenu.h> #include <libgimpwidgets/gimpunitmenu.h>

View File

@ -51,6 +51,7 @@ libgimpwidgets/gimpcolorselect.c
libgimpwidgets/gimpcolorselection.c libgimpwidgets/gimpcolorselection.c
libgimpwidgets/gimpfileentry.c libgimpwidgets/gimpfileentry.c
libgimpwidgets/gimphelpui.c libgimpwidgets/gimphelpui.c
libgimpwidgets/gimpicons.c
libgimpwidgets/gimpintstore.c libgimpwidgets/gimpintstore.c
libgimpwidgets/gimpmemsizeentry.c libgimpwidgets/gimpmemsizeentry.c
libgimpwidgets/gimppageselector.c libgimpwidgets/gimppageselector.c
@ -60,7 +61,6 @@ libgimpwidgets/gimppreview.c
libgimpwidgets/gimppreviewarea.c libgimpwidgets/gimppreviewarea.c
libgimpwidgets/gimppropwidgets.c libgimpwidgets/gimppropwidgets.c
libgimpwidgets/gimpquerybox.c libgimpwidgets/gimpquerybox.c
libgimpwidgets/gimpstock.c
libgimpwidgets/gimpunitmenu.c libgimpwidgets/gimpunitmenu.c
libgimpwidgets/gimpwidgets.c libgimpwidgets/gimpwidgets.c
libgimpwidgets/gimpwidgets-private.c libgimpwidgets/gimpwidgets-private.c