pidgin/pidgin

Remove registration of all stock icons

2021-10-12, Elliott Sales de Andrade
e0b11d28b39e
Parents 8883d8d17678
Children 94881a28201a
Remove registration of all stock icons

There's still a few things in `pidginstock.[ch]` that we need, but we definitely don't need the stock icons.

Testing Done:
Compile only

Reviewed at https://reviews.imfreedom.org/r/1042/
--- a/ChangeLog.API Tue Oct 12 04:51:46 2021 -0500
+++ b/ChangeLog.API Tue Oct 12 05:05:29 2021 -0500
@@ -609,7 +609,6 @@
* purple_status_type_add_attrs_vargs
* purple_status_type_get_primary_attr
* purple_status_type_set_primary_attr
- * pidgin_stock_id_from_status_primitive
* purple_strlcat
* purple_strlcpy
* purple_str_binary_to_ascii
@@ -842,8 +841,9 @@
* pidgin_status_box_pulse_connecting
* pidgin_status_box_set_buddy_icon
* pidgin_status_box_set_network_available
+ * All PIDGIN_STOCK_* macros
* pidgin_stock_id_from_presence
- * PIDGIN_STOCK_TOOLBAR_SMILEY
+ * pidgin_stock_id_from_status_primitive
* pidgin_text_combo_box_entry_set_text
* pidgin_theme_font_free
* pidgin_theme_font_get_color
--- a/pidgin/gtkblist.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/gtkblist.c Tue Oct 12 05:05:29 2021 -0500
@@ -52,7 +52,6 @@
#include "pidgin/pidginplugininfo.h"
#include "pidginscrollbook.h"
#include "pidgin/pidginstylecontext.h"
-#include "pidginstock.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
--- a/pidgin/gtkconv.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/gtkconv.c Tue Oct 12 05:05:29 2021 -0500
@@ -4771,7 +4771,6 @@
#include "gtkprivacy.h"
#include "gtkutils.h"
#include "pidginmenutray.h"
-#include "pidginstock.h"
static void
do_close(GtkWidget *w, int resp, PidginConvWindow *win)
--- a/pidgin/gtknotify.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/gtknotify.c Tue Oct 12 05:05:29 2021 -0500
@@ -30,7 +30,6 @@
#include "gtknotify.h"
#include "gtkutils.h"
#include "pidgincore.h"
-#include "pidginstock.h"
typedef struct
{
--- a/pidgin/gtkrequest.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/gtkrequest.c Tue Oct 12 05:05:29 2021 -0500
@@ -33,7 +33,6 @@
#include "pidginaccountstore.h"
#include "pidgincore.h"
#include "pidgindialog.h"
-#include "pidginstock.h"
#include <gdk/gdkkeysyms.h>
--- a/pidgin/gtkutils.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/gtkutils.c Tue Oct 12 05:05:29 2021 -0500
@@ -47,7 +47,6 @@
#include "gtkutils.h"
#include "minidialog.h"
#include "pidgincore.h"
-#include "pidginstock.h"
/******************************************************************************
* Enums
--- a/pidgin/pidginstock.c Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/pidginstock.c Tue Oct 12 05:05:29 2021 -0500
@@ -46,325 +46,6 @@
* Structures
**************************************************************************/
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-static struct StockIcon
-{
- const char *name;
- const char *dir;
- const char *filename;
-
-} const stock_icons[] = {
-
- { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE },
- { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT },
- { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO },
- { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR },
- { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE },
- { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES },
- { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN },
- { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT },
- { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" },
- { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT },
- { PIDGIN_STOCK_FILE_CANCELLED, NULL, GTK_STOCK_CANCEL },
- { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY },
- { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR },
- { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO },
- { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES },
- { PIDGIN_STOCK_ADD, NULL, GTK_STOCK_ADD },
- { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE },
- { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
- { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE },
- { PIDGIN_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE },
- { PIDGIN_STOCK_TYPED, "pidgin", "typed.png" },
- { PIDGIN_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP },
- { PIDGIN_STOCK_INFO, NULL, GTK_STOCK_INFO },
- { PIDGIN_STOCK_NEXT, NULL, GTK_STOCK_GO_FORWARD },
-};
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-static const GtkStockItem stock_items[] =
-{
- { PIDGIN_STOCK_ALIAS, N_("_Alias"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_CHAT, N_("_Join"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("I_M"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_MODIFY, N_("_Modify..."), 0, 0, PACKAGE },
- { PIDGIN_STOCK_ADD, N_("_Add..."), 0, 0, PACKAGE },
- { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_EDIT, N_("_Edit"), 0, 0, PACKAGE },
- { PIDGIN_STOCK_NEXT, N_("_Next"), 0, 0, PACKAGE },
-};
-
-typedef struct {
- const char *name;
- const char *dir;
- const char *filename;
- gboolean microscopic;
- gboolean extra_small;
- gboolean small;
- gboolean medium;
- gboolean large;
- gboolean huge;
- gboolean rtl;
- const char *translucent_name;
-} SizedStockIcon;
-
-const SizedStockIcon sized_stock_icons [] = {
-
- { PIDGIN_STOCK_TOOLBAR_BGCOLOR, "actions", "change-bgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_BLOCK, "emblems", "emblem-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_FGCOLOR, "actions", "change-fgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_FONT_FACE, "actions", "font-face.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "actions", "font-size-down.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "actions", "font-size-up.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_INSERT, "actions", "insert.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "actions", "insert-image.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_INSERT_SCREENSHOT, "actions", "insert-screenshot.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "actions", "insert-link.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "actions", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_PENDING, "actions", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_PLUGINS, "actions", "plugins.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "actions", "unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "actions", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "actions", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_TRANSFER, "actions", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
-#ifdef USE_VV
- { PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, "actions", "audio-call.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, "actions", "video-call.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL, "actions", "audio-video-call.png", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
-#endif
- { PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, "actions", "get-attention.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }
-};
-
-const SizedStockIcon sized_status_icons [] = {
-
- { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "user-available.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AVAILABLE_I },
- { PIDGIN_STOCK_STATUS_AWAY, "status", "user-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AWAY_I },
- { PIDGIN_STOCK_STATUS_BUSY, "status", "user-busy.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_BUSY_I },
- { PIDGIN_STOCK_STATUS_CHAT, "status", "chat.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_INVISIBLE, "status", "user-invisible.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_XA, "status", "user-extended-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, PIDGIN_STOCK_STATUS_XA_I },
- { PIDGIN_STOCK_STATUS_LOGIN, "status", "log-in.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
- { PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
- { PIDGIN_STOCK_STATUS_OFFLINE, "status", "user-offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I },
- { PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_MESSAGE, "actions", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }
-};
-
-const SizedStockIcon sized_tray_icons [] = {
-#define SIZED_TRAY_ICON(name) \
- { name, "status", name ".png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_AVAILABLE ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_INVISIBLE ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_AWAY ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_BUSY ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_XA ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_OFFLINE ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_CONNECT ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_PENDING ),
- SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_EMAIL )
-#undef SIZED_TRAY_ICON
-};
-
-/*****************************************************************************
- * Private functions
- *****************************************************************************/
-
-static gchar *
-find_file_common(const char *name)
-{
- gchar *filename;
- const gchar *userdir;
- const gchar * const *sysdirs;
-
- userdir = g_get_user_data_dir();
- filename = g_build_filename(userdir, name, NULL);
- if (g_file_test(filename, G_FILE_TEST_EXISTS))
- return filename;
- g_free(filename);
-
- sysdirs = g_get_system_data_dirs();
- for (; *sysdirs; sysdirs++) {
- filename = g_build_filename(*sysdirs, name, NULL);
- if (g_file_test(filename, G_FILE_TEST_EXISTS))
- return filename;
- g_free(filename);
- }
- filename = g_build_filename(PURPLE_DATADIR, name, NULL);
- if (g_file_test(filename, G_FILE_TEST_EXISTS))
- return filename;
- g_free(filename);
- return NULL;
-}
-
-static gchar *
-find_file(const char *dir, const char *base)
-{
- char *filename;
- char *ret;
-
- if (base == NULL)
- return NULL;
-
- if (purple_strequal(dir, "pidgin"))
- filename = g_build_filename("pixmaps", "pidgin", base, NULL);
- else
- filename = g_build_filename("pixmaps", "pidgin", dir, base, NULL);
-
- ret = find_file_common(filename);
- g_free(filename);
- return ret;
-}
-
-
-/* Altered from do_colorshift in gnome-panel */
-static void
-do_alphashift(GdkPixbuf *pixbuf)
-{
- gint i, j;
- gint width, height, padding;
- guchar *pixels;
- guchar a;
-
- if (!gdk_pixbuf_get_has_alpha(pixbuf))
- return;
-
- width = gdk_pixbuf_get_width(pixbuf);
- height = gdk_pixbuf_get_height(pixbuf);
- padding = gdk_pixbuf_get_rowstride(pixbuf) - width * 4;
- pixels = gdk_pixbuf_get_pixels(pixbuf);
-
- for (i = 0; i < height; i++) {
- for (j = 0; j < width; j++) {
- pixels++;
- pixels++;
- pixels++;
- a = *(pixels);
- *(pixels++) = a / 2;
- }
- pixels += padding;
- }
-}
-
-static gchar *
-find_icon_file(PidginIconTheme *theme, const gchar *size, SizedStockIcon sized_icon, gboolean rtl)
-{
- const gchar *file, *dir;
- gchar *file_full = NULL;
- gchar *tmp;
-
- if (theme != NULL) {
- file = pidgin_icon_theme_get_icon(PIDGIN_ICON_THEME(theme), sized_icon.name);
- dir = purple_theme_get_dir(PURPLE_THEME(theme));
-
- if (rtl)
- file_full = g_build_filename(dir, size, "rtl", file, NULL);
- else
- file_full = g_build_filename(dir, size, file, NULL);
-
- if (g_file_test(file_full, G_FILE_TEST_IS_REGULAR))
- return file_full;
-
- g_free(file_full);
- }
-
- if (rtl)
- tmp = g_build_filename("pixmaps", "pidgin", sized_icon.dir, size, "rtl", sized_icon.filename, NULL);
- else
- tmp = g_build_filename("pixmaps", "pidgin", sized_icon.dir, size, sized_icon.filename, NULL);
-
- file_full = find_file_common(tmp);
- g_free(tmp);
-
- if (file_full == NULL) {
- gchar *size_dir = g_strdup_printf("%sx%s", size, size);
-
- if (rtl)
- tmp = g_build_filename("pidgin", "icons", "hicolor",
- size_dir, sized_icon.dir, "rtl",
- sized_icon.filename, NULL);
- else
- tmp = g_build_filename("pidgin", "icons", "hicolor",
- size_dir, sized_icon.dir,
- sized_icon.filename, NULL);
- g_free(size_dir);
-
- file_full = find_file_common(tmp);
- g_free(tmp);
- }
-
- return file_full;
-}
-
-static void
-add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, PidginIconTheme *theme,
- const char *size, SizedStockIcon sized_icon, gboolean translucent)
-{
- char *filename;
- GtkIconSource *source;
- GdkPixbuf *pixbuf;
-
- filename = find_icon_file(theme, size, sized_icon, FALSE);
- g_return_if_fail(filename != NULL);
- pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
- if (translucent)
- do_alphashift(pixbuf);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- source = gtk_icon_source_new();
- gtk_icon_source_set_pixbuf(source, pixbuf);
- gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR);
- gtk_icon_source_set_direction_wildcarded(source, !sized_icon.rtl);
- gtk_icon_source_set_size(source, sizeid);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
- gtk_icon_source_set_state_wildcarded(source, TRUE);
- gtk_icon_set_add_source(iconset, source);
- gtk_icon_source_free(source);
-
- if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) {
- source = gtk_icon_source_new();
- gtk_icon_source_set_pixbuf(source, pixbuf);
- gtk_icon_source_set_direction_wildcarded(source, TRUE);
- gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
- gtk_icon_source_set_state_wildcarded(source, TRUE);
- gtk_icon_set_add_source(iconset, source);
- gtk_icon_source_free(source);
- }
- g_free(filename);
- g_object_unref(pixbuf);
-
- if (sized_icon.rtl) {
- filename = find_icon_file(theme, size, sized_icon, TRUE);
- g_return_if_fail(filename != NULL);
- pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
- if (translucent)
- do_alphashift(pixbuf);
-
- source = gtk_icon_source_new();
- gtk_icon_source_set_pixbuf(source, pixbuf);
- gtk_icon_source_set_filename(source, filename);
- gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL);
- gtk_icon_source_set_size(source, sizeid);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
- gtk_icon_source_set_state_wildcarded(source, TRUE);
- gtk_icon_set_add_source(iconset, source);
- g_free(filename);
- g_object_unref(pixbuf);
- gtk_icon_source_free(source);
- }
-G_GNUC_END_IGNORE_DEPRECATIONS
-}
-
-static void
-reload_settings(void)
-{
- gtk_style_context_reset_widgets(gdk_screen_get_default());
-}
-
/*****************************************************************************
* Public API functions
*****************************************************************************/
@@ -372,12 +53,6 @@
void
pidgin_stock_load_status_icon_theme(PidginStatusIconTheme *theme)
{
- GtkIconFactory *icon_factory;
- gsize i;
- GtkIconSet *normal;
- GtkIconSet *translucent = NULL;
- GtkWidget *win;
-
if (theme != NULL) {
purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme",
purple_theme_get_name(PURPLE_THEME(theme)));
@@ -388,86 +63,11 @@
purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme", "");
purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir", "");
}
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- icon_factory = gtk_icon_factory_new();
-
- gtk_icon_factory_add_default(icon_factory);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
- win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_realize(win);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- for (i = 0; i < G_N_ELEMENTS(sized_status_icons); i++)
- {
- normal = gtk_icon_set_new();
- if (sized_status_icons[i].translucent_name)
- translucent = gtk_icon_set_new();
-
-#define ADD_SIZED_ICON(name, size) \
- if (sized_status_icons[i].name) { \
- add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], FALSE); \
- if (sized_status_icons[i].translucent_name) \
- add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], TRUE); \
- }
- ADD_SIZED_ICON(microscopic, "11");
- ADD_SIZED_ICON(extra_small, "16");
- ADD_SIZED_ICON(small, "22");
- ADD_SIZED_ICON(medium, "32");
- ADD_SIZED_ICON(large, "48");
- ADD_SIZED_ICON(huge, "64");
-#undef ADD_SIZED_ICON
-
- gtk_icon_factory_add(icon_factory, sized_status_icons[i].name, normal);
- gtk_icon_set_unref(normal);
-
- if (sized_status_icons[i].translucent_name) {
- gtk_icon_factory_add(icon_factory, sized_status_icons[i].translucent_name, translucent);
- gtk_icon_set_unref(translucent);
- }
- }
-
- for (i = 0; i < G_N_ELEMENTS(sized_tray_icons); i++)
- {
- normal = gtk_icon_set_new();
- if (sized_tray_icons[i].translucent_name)
- translucent = gtk_icon_set_new();
-
-#define ADD_SIZED_ICON(name, size) \
- if (sized_tray_icons[i].name) { \
- add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], FALSE); \
- if (sized_tray_icons[i].translucent_name) \
- add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], TRUE); \
- }
- ADD_SIZED_ICON(extra_small, "16");
- ADD_SIZED_ICON(small, "22");
- ADD_SIZED_ICON(medium, "32");
- ADD_SIZED_ICON(large, "48");
-#undef ADD_SIZED_ICON
-
- gtk_icon_factory_add(icon_factory, sized_tray_icons[i].name, normal);
- gtk_icon_set_unref(normal);
-
- if (sized_tray_icons[i].translucent_name) {
- gtk_icon_factory_add(icon_factory, sized_tray_icons[i].translucent_name, translucent);
- gtk_icon_set_unref(translucent);
- }
- }
-G_GNUC_END_IGNORE_DEPRECATIONS
-
- gtk_widget_destroy(win);
- g_object_unref(G_OBJECT(icon_factory));
- reload_settings();
}
void
pidgin_stock_load_stock_icon_theme(PidginStockIconTheme *theme)
{
- GtkIconFactory *icon_factory;
- gsize i;
- GtkWidget *win;
-
if (theme != NULL) {
purple_prefs_set_string(PIDGIN_PREFS_ROOT "/stock/icon-theme",
purple_theme_get_name(PURPLE_THEME(theme)));
@@ -478,75 +78,6 @@
purple_prefs_set_string(PIDGIN_PREFS_ROOT "/stock/icon-theme", "");
purple_prefs_set_path(PIDGIN_PREFS_ROOT "/stock/icon-theme-dir", "");
}
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- icon_factory = gtk_icon_factory_new();
-
- gtk_icon_factory_add_default(icon_factory);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
- win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_realize(win);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- /* All non-sized icons */
- for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) {
- GtkIconSource *source;
- GtkIconSet *iconset;
- gchar *filename;
-
- if (stock_icons[i].dir == NULL) {
- /* GTK Stock icon */
- iconset = gtk_style_context_lookup_icon_set(gtk_widget_get_style_context(win),
- stock_icons[i].filename);
- } else {
- filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
-
- if (filename == NULL)
- continue;
-
- source = gtk_icon_source_new();
- gtk_icon_source_set_filename(source, filename);
- gtk_icon_source_set_direction_wildcarded(source, TRUE);
- gtk_icon_source_set_size_wildcarded(source, TRUE);
- gtk_icon_source_set_state_wildcarded(source, TRUE);
-
- iconset = gtk_icon_set_new();
- gtk_icon_set_add_source(iconset, source);
-
- gtk_icon_source_free(source);
- g_free(filename);
- }
-
- gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);
-
- gtk_icon_set_unref(iconset);
- }
-
- /* All non-status sized icons */
- for (i = 0; i < G_N_ELEMENTS(sized_stock_icons); i++)
- {
- GtkIconSet *iconset = gtk_icon_set_new();
-
-#define ADD_SIZED_ICON(name, size) \
- if (sized_stock_icons[i].name) \
- add_sized_icon(iconset, name, PIDGIN_ICON_THEME(theme), size, sized_stock_icons[i], FALSE);
- ADD_SIZED_ICON(microscopic, "11");
- ADD_SIZED_ICON(extra_small, "16");
- ADD_SIZED_ICON(small, "22");
- ADD_SIZED_ICON(medium, "32");
- ADD_SIZED_ICON(large, "48");
- ADD_SIZED_ICON(huge, "64");
-#undef ADD_SIZED_ICON
-
- gtk_icon_factory_add(icon_factory, sized_stock_icons[i].name, iconset);
- gtk_icon_set_unref(iconset);
- }
-G_GNUC_END_IGNORE_DEPRECATIONS
-
- gtk_widget_destroy(win);
- g_object_unref(G_OBJECT(icon_factory));
- reload_settings();
}
void
@@ -597,11 +128,6 @@
}
else
pidgin_stock_load_status_icon_theme(NULL);
-
- /* Register the stock items. */
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));
-G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
--- a/pidgin/pidginstock.h Tue Oct 12 04:51:46 2021 -0500
+++ b/pidgin/pidginstock.h Tue Oct 12 05:05:29 2021 -0500
@@ -35,98 +35,6 @@
#include <gtk/gtk.h>
#include "gtkstatus-icon-theme.h"
-/**************************************************************************/
-/* Stock images */
-/**************************************************************************/
-
-#ifndef PIDGIN_STOCK_DISABLE
-
-#define PIDGIN_STOCK_ACTION "pidgin-action"
-#define PIDGIN_STOCK_ALIAS "pidgin-alias"
-#define PIDGIN_STOCK_AWAY "pidgin-away"
-#define PIDGIN_STOCK_CHAT "pidgin-chat"
-#define PIDGIN_STOCK_CLEAR "pidgin-clear"
-#define PIDGIN_STOCK_CLOSE_TABS "pidgin-close-tab"
-#define PIDGIN_STOCK_DEBUG "pidgin-debug"
-#define PIDGIN_STOCK_DISCONNECT "pidgin-disconnect"
-#define PIDGIN_STOCK_DOWNLOAD "pidgin-download"
-#define PIDGIN_STOCK_EDIT "pidgin-edit"
-#define PIDGIN_STOCK_FGCOLOR "pidgin-fgcolor"
-#define PIDGIN_STOCK_FILE_CANCELLED "pidgin-file-cancelled"
-#define PIDGIN_STOCK_FILE_DONE "pidgin-file-done"
-#define PIDGIN_STOCK_IGNORE "pidgin-ignore"
-#define PIDGIN_STOCK_INFO "pidgin-info"
-#define PIDGIN_STOCK_INVITE "pidgin-invite"
-#define PIDGIN_STOCK_MODIFY "pidgin-modify"
-#define PIDGIN_STOCK_ADD "pidgin-add"
-#define PIDGIN_STOCK_OPEN_MAIL "pidgin-stock-open-mail"
-#define PIDGIN_STOCK_PAUSE "pidgin-pause"
-#define PIDGIN_STOCK_SIGN_OFF "pidgin-sign-off"
-#define PIDGIN_STOCK_SIGN_ON "pidgin-sign-on"
-#define PIDGIN_STOCK_TEXT_NORMAL "pidgin-text-normal"
-#define PIDGIN_STOCK_TYPED "pidgin-typed"
-#define PIDGIN_STOCK_UPLOAD "pidgin-upload"
-#define PIDGIN_STOCK_NEXT "pidgin-next"
-
-/* Status icons */
-#define PIDGIN_STOCK_STATUS_AVAILABLE "pidgin-status-available"
-#define PIDGIN_STOCK_STATUS_AVAILABLE_I "pidgin-status-available-i"
-#define PIDGIN_STOCK_STATUS_AWAY "pidgin-status-away"
-#define PIDGIN_STOCK_STATUS_AWAY_I "pidgin-status-away-i"
-#define PIDGIN_STOCK_STATUS_BUSY "pidgin-status-busy"
-#define PIDGIN_STOCK_STATUS_BUSY_I "pidgin-status-busy-i"
-#define PIDGIN_STOCK_STATUS_CHAT "pidgin-status-chat"
-#define PIDGIN_STOCK_STATUS_INVISIBLE "pidgin-status-invisible"
-#define PIDGIN_STOCK_STATUS_XA "pidgin-status-xa"
-#define PIDGIN_STOCK_STATUS_XA_I "pidgin-status-xa-i"
-#define PIDGIN_STOCK_STATUS_LOGIN "pidgin-status-login"
-#define PIDGIN_STOCK_STATUS_LOGOUT "pidgin-status-logout"
-#define PIDGIN_STOCK_STATUS_OFFLINE "pidgin-status-offline"
-#define PIDGIN_STOCK_STATUS_OFFLINE_I "pidgin-status-offline"
-#define PIDGIN_STOCK_STATUS_PERSON "pidgin-status-person"
-#define PIDGIN_STOCK_STATUS_MESSAGE "pidgin-status-message"
-
-/* Toolbar (and menu) icons */
-#define PIDGIN_STOCK_TOOLBAR_ACCOUNTS "pidgin-accounts"
-#define PIDGIN_STOCK_TOOLBAR_BGCOLOR "pidgin-bgcolor"
-#define PIDGIN_STOCK_TOOLBAR_BLOCK "pidgin-block"
-#define PIDGIN_STOCK_TOOLBAR_FGCOLOR "pidgin-fgcolor"
-#define PIDGIN_STOCK_TOOLBAR_FONT_FACE "pidgin-font-face"
-#define PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER "pidgin-text-smaller"
-#define PIDGIN_STOCK_TOOLBAR_TEXT_LARGER "pidgin-text-larger"
-#define PIDGIN_STOCK_TOOLBAR_INSERT "pidgin-insert"
-#define PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE "pidgin-insert-image"
-#define PIDGIN_STOCK_TOOLBAR_INSERT_SCREENSHOT "pidgin-insert-screenshot"
-#define PIDGIN_STOCK_TOOLBAR_INSERT_LINK "pidgin-insert-link"
-#define PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW "pidgin-message-new"
-#define PIDGIN_STOCK_TOOLBAR_PENDING "pidgin-pending"
-#define PIDGIN_STOCK_TOOLBAR_PLUGINS "pidgin-plugins"
-#define PIDGIN_STOCK_TOOLBAR_TYPING "pidgin-typing"
-#define PIDGIN_STOCK_TOOLBAR_USER_INFO "pidgin-info"
-#define PIDGIN_STOCK_TOOLBAR_UNBLOCK "pidgin-unblock"
-#define PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR "pidgin-select-avatar"
-#define PIDGIN_STOCK_TOOLBAR_SEND_FILE "pidgin-send-file"
-#define PIDGIN_STOCK_TOOLBAR_TRANSFER "pidgin-transfer"
-#ifdef USE_VV
-#define PIDGIN_STOCK_TOOLBAR_AUDIO_CALL "pidgin-audio-call"
-#define PIDGIN_STOCK_TOOLBAR_VIDEO_CALL "pidgin-video-call"
-#define PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL "pidgin-audio-video-call"
-#endif
-#define PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION "pidgin-send-attention"
-
-/* Tray icons */
-#define PIDGIN_STOCK_TRAY_AVAILABLE "pidgin-tray-available"
-#define PIDGIN_STOCK_TRAY_INVISIBLE "pidgin-tray-invisible"
-#define PIDGIN_STOCK_TRAY_AWAY "pidgin-tray-away"
-#define PIDGIN_STOCK_TRAY_BUSY "pidgin-tray-busy"
-#define PIDGIN_STOCK_TRAY_XA "pidgin-tray-xa"
-#define PIDGIN_STOCK_TRAY_OFFLINE "pidgin-tray-offline"
-#define PIDGIN_STOCK_TRAY_CONNECT "pidgin-tray-connect"
-#define PIDGIN_STOCK_TRAY_PENDING "pidgin-tray-pending"
-#define PIDGIN_STOCK_TRAY_EMAIL "pidgin-tray-email"
-
-#endif /* PIDGIN_STOCK_DISABLE */
-
/*
* For using icons that aren't one of the default GTK_ICON_SIZEs
*/