Remove the libpurple support for themes now that all of the ui support has been removed
Testing Done:
Compiled and ran pidgin3
Reviewed at https://reviews.imfreedom.org/r/1117/
--- a/libpurple/core.c Thu Nov 11 23:19:07 2021 -0600
+++ b/libpurple/core.c Mon Nov 15 02:21:18 2021 -0600
@@ -44,7 +44,6 @@
-#include "theme-manager.h"
@@ -152,8 +151,6 @@
- purple_theme_manager_init();
/* The buddy icon code uses the image store, so init it early. */
_purple_image_store_init();
@@ -187,9 +184,6 @@
if (ops != NULL && ops->ui_init != NULL)
- /* The UI may have registered some theme types, so refresh them */
- purple_theme_manager_refresh();
/* Load the buddy list after UI init */
@@ -234,7 +228,6 @@
purple_savedstatuses_uninit();
purple_statuses_uninit();
purple_accounts_uninit();
- purple_theme_manager_uninit();
_purple_image_store_uninit();
--- a/libpurple/meson.build Thu Nov 11 23:19:07 2021 -0600
+++ b/libpurple/meson.build Mon Nov 15 02:21:18 2021 -0600
@@ -87,9 +87,6 @@
@@ -184,9 +181,6 @@
--- a/libpurple/theme-loader.c Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
- * ThemeLoaders for libpurple
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#include "theme-loader.h"
-void purple_theme_loader_set_type_string(PurpleThemeLoader *loader, const gchar *type);
-/******************************************************************************
- *****************************************************************************/
-} PurpleThemeLoaderPrivate;
-/******************************************************************************
- *****************************************************************************/
-/******************************************************************************
- *****************************************************************************/
-static GParamSpec *properties[PROP_LAST];
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(PurpleThemeLoader, purple_theme_loader,
-/******************************************************************************
- *****************************************************************************/
-purple_theme_loader_get_property(GObject *obj, guint param_id, GValue *value,
- PurpleThemeLoader *theme_loader = PURPLE_THEME_LOADER(obj);
- g_value_set_string(value, purple_theme_loader_get_type_string(theme_loader));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
-purple_theme_loader_set_property(GObject *obj, guint param_id, const GValue *value,
- PurpleThemeLoader *loader = PURPLE_THEME_LOADER(obj);
- purple_theme_loader_set_type_string(loader, g_value_get_string(value));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
-purple_theme_loader_probe_directory(PurpleThemeLoader *loader, const gchar *dir)
- const gchar *type = purple_theme_loader_get_type_string(loader);
- /* Checks for directory as $root/purple/$type */
- themedir = g_build_filename(dir, "purple", type, NULL);
- result = g_file_test(themedir, G_FILE_TEST_IS_DIR);
-purple_theme_loader_init(PurpleThemeLoader *loader)
-purple_theme_loader_finalize(GObject *obj)
- PurpleThemeLoader *loader = PURPLE_THEME_LOADER(obj);
- PurpleThemeLoaderPrivate *priv =
- purple_theme_loader_get_instance_private(loader);
- G_OBJECT_CLASS(purple_theme_loader_parent_class)->finalize(obj);
-purple_theme_loader_class_init(PurpleThemeLoaderClass *klass)
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- obj_class->get_property = purple_theme_loader_get_property;
- obj_class->set_property = purple_theme_loader_set_property;
- obj_class->finalize = purple_theme_loader_finalize;
- /* TYPE STRING (read only) */
- properties[PROP_TYPE] = g_param_spec_string("type", "Type",
- "The string representing the type of the theme",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS);
- g_object_class_install_properties(obj_class, PROP_LAST, properties);
-/*****************************************************************************
- *****************************************************************************/
-purple_theme_loader_get_type_string(PurpleThemeLoader *theme_loader)
- PurpleThemeLoaderPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_THEME_LOADER(theme_loader), NULL);
- priv = purple_theme_loader_get_instance_private(theme_loader);
-purple_theme_loader_set_type_string(PurpleThemeLoader *loader, const gchar *type)
- PurpleThemeLoaderPrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME_LOADER(loader));
- priv = purple_theme_loader_get_instance_private(loader);
- priv->type = g_strdup(type);
- g_object_notify_by_pspec(G_OBJECT(loader), properties[PROP_TYPE]);
-purple_theme_loader_build(PurpleThemeLoader *loader, const gchar *dir)
- return PURPLE_THEME_LOADER_GET_CLASS(loader)->purple_theme_loader_build(dir);
-purple_theme_loader_probe(PurpleThemeLoader *loader, const gchar *dir)
- if (PURPLE_THEME_LOADER_GET_CLASS(loader)->probe_directory != NULL)
- return PURPLE_THEME_LOADER_GET_CLASS(loader)->probe_directory(dir);
- return purple_theme_loader_probe_directory(loader, dir);
--- a/libpurple/theme-loader.h Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_THEME_LOADER_H
-#define PURPLE_THEME_LOADER_H
- * @section_id: libpurple-theme-loader
- * @short_description: <filename>theme-loader.h</filename>
- * @title: Theme Loader Abstract Class
- * The base class for all theme loaders.
-#include <glib-object.h>
- * PURPLE_TYPE_THEME_LOADER:
- * The standard _get_type macro for #PurpleThemeLoader.
-#define PURPLE_TYPE_THEME_LOADER purple_theme_loader_get_type()
-struct _PurpleThemeLoaderClass
- GObjectClass parent_class;
- PurpleTheme *(*purple_theme_loader_build)(const gchar *dir);
- gboolean (*probe_directory)(const gchar *dir);
- void (*purple_reserved1)(void);
- void (*purple_reserved2)(void);
- void (*purple_reserved3)(void);
- void (*purple_reserved4)(void);
-/**************************************************************************/
-/* Purple Theme-Loader API */
-/**************************************************************************/
- * purple_theme_loader_get_type:
- * The standard _get_type function for #GType's.
- * Returns: The #GType for theme loader.
-G_DECLARE_DERIVABLE_TYPE(PurpleThemeLoader, purple_theme_loader, PURPLE,
- * purple_theme_loader_get_type_string:
- * @self: The theme loader
- * Returns the string representing the type of the theme loader
- * Returns: The string representing this type
-const gchar *purple_theme_loader_get_type_string(PurpleThemeLoader *self);
- * purple_theme_loader_build:
- * @loader: The theme loader
- * @dir: The directory containing the theme
- * Creates a new PurpleTheme
- * Returns: (transfer full): A PurpleTheme containing the information from the directory
-PurpleTheme *purple_theme_loader_build(PurpleThemeLoader *loader, const gchar *dir);
- * purple_theme_loader_probe:
- * @loader: The theme loader
- * @dir: The directory that may contain the theme
- * Probes a directory to see if it might possibly contain a theme
- * This function might only check for obvious files or directory structure.
- * Loading of a theme may fail for other reasons.
- * The default prober checks for $dir/purple/$type.
- * Returns: TRUE if the directory appears to contain a theme, FALSE otherwise.
-gboolean purple_theme_loader_probe(PurpleThemeLoader *loader, const gchar *dir);
-#endif /* PURPLE_THEME_LOADER_H */
--- a/libpurple/theme-manager.c Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#include "theme-manager.h"
-struct _PurpleThemeManager {
-/******************************************************************************
- *****************************************************************************/
-static GHashTable *theme_table = NULL;
-/*****************************************************************************
- ****************************************************************************/
-purple_theme_manager_get_type(void)
- static const GTypeInfo info = {
- sizeof(PurpleThemeManagerClass),
- NULL, /* base_finalize */
- NULL, /* class_finalize */
- sizeof(PurpleThemeManager),
- NULL, /* instance_init */
- NULL, /* Value Table */
- type = g_type_register_static(G_TYPE_OBJECT,
- "PurpleThemeManager", &info, 0);
-/******************************************************************************
- *****************************************************************************/
-/* makes a key of <type> + '/' + <name> */
-purple_theme_manager_make_key(const gchar *name, const gchar *type)
- g_return_val_if_fail(name && *name, NULL);
- g_return_val_if_fail(type && *type, NULL);
- return g_strconcat(type, "/", name, NULL);
-/* returns TRUE if theme is of type "user_data" */
-purple_theme_manager_is_theme_type(gchar *key,
- return g_str_has_prefix(key, g_strconcat(user_data, "/", NULL));
-check_if_theme_or_loader(gchar *key, gpointer value, GSList **loaders)
- if (PURPLE_IS_THEME(value))
- else if (PURPLE_IS_THEME_LOADER(value))
- *loaders = g_slist_prepend(*loaders, value);
-purple_theme_manager_function_wrapper(gchar *key,
- PurpleThemeFunc user_data)
- if (PURPLE_IS_THEME(value))
-purple_theme_manager_build_dir(GSList *loaders, const gchar *root)
- PurpleThemeLoader *loader;
- rdir = g_dir_open(root, 0, NULL);
- while ((name = g_dir_read_name(rdir))) {
- theme_dir = g_build_filename(root, name, NULL);
- for (tmp = loaders; tmp; tmp = g_slist_next(tmp)) {
- loader = PURPLE_THEME_LOADER(tmp->data);
- if (purple_theme_loader_probe(loader, theme_dir)) {
- PurpleTheme *theme = purple_theme_loader_build(loader, theme_dir);
- if (PURPLE_IS_THEME(theme))
- purple_theme_manager_add_theme(theme);
-/*****************************************************************************
- *****************************************************************************/
-purple_theme_manager_init(void)
- theme_table = g_hash_table_new_full(g_str_hash,
- g_str_equal, g_free, g_object_unref);
-purple_theme_manager_refresh(void)
- const gchar *const *xdg_dirs;
- GSList *loaders = NULL;
- g_hash_table_foreach_remove(theme_table, (GHRFunc)check_if_theme_or_loader,
- /* Add themes from ~/.purple */
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- path = g_build_filename(purple_user_dir(), "themes", NULL);
- G_GNUC_END_IGNORE_DEPRECATIONS
- purple_theme_manager_build_dir(loaders, path);
- /* look for XDG_DATA_HOME */
- /* NOTE: will work on Windows, see g_get_user_data_dir() documentation */
- path = g_build_filename(g_get_user_data_dir(), "themes", NULL);
- purple_theme_manager_build_dir(loaders, path);
- /* now dig through XDG_DATA_DIRS and add those too */
- /* NOTE: will work on Windows, see g_get_system_data_dirs() documentation */
- xdg_dirs = g_get_system_data_dirs();
- for (i = 0; xdg_dirs[i] != NULL; i++) {
- path = g_build_filename(xdg_dirs[i], "themes", NULL);
- purple_theme_manager_build_dir(loaders, path);
-purple_theme_manager_uninit(void)
- g_hash_table_destroy(theme_table);
-purple_theme_manager_register_type(PurpleThemeLoader *loader)
- g_return_if_fail(PURPLE_IS_THEME_LOADER(loader));
- type = g_strdup(purple_theme_loader_get_type_string(loader));
- g_return_if_fail(type);
- /* if something is already there do nothing */
- if (!g_hash_table_lookup(theme_table, type))
- g_hash_table_insert(theme_table, type, loader);
-purple_theme_manager_unregister_type(PurpleThemeLoader *loader)
- g_return_if_fail(PURPLE_IS_THEME_LOADER(loader));
- type = purple_theme_loader_get_type_string(loader);
- g_return_if_fail(type);
- if (g_hash_table_lookup(theme_table, type) == loader)
- g_hash_table_remove(theme_table, type);
- g_hash_table_foreach_remove(theme_table,
- (GHRFunc)purple_theme_manager_is_theme_type, (gpointer)type);
- } /* only free if given registered loader */
-purple_theme_manager_find_theme(const gchar *name,
- key = purple_theme_manager_make_key(name, type);
- g_return_val_if_fail(key, NULL);
- theme = g_hash_table_lookup(theme_table, key);
-purple_theme_manager_add_theme(PurpleTheme *theme)
- g_return_if_fail(PURPLE_IS_THEME(theme));
- key = purple_theme_manager_make_key(purple_theme_get_name(theme),
- purple_theme_get_type_string(theme));
- /* if something is already there do nothing */
- if (g_hash_table_lookup(theme_table, key) == NULL)
- g_hash_table_insert(theme_table, key, theme);
-purple_theme_manager_remove_theme(PurpleTheme *theme)
- g_return_if_fail(PURPLE_IS_THEME(theme));
- key = purple_theme_manager_make_key(purple_theme_get_name(theme),
- purple_theme_get_type_string(theme));
- g_hash_table_remove(theme_table, key);
-purple_theme_manager_for_each_theme(PurpleThemeFunc func)
- g_return_if_fail(func);
- g_hash_table_foreach(theme_table,
- (GHFunc) purple_theme_manager_function_wrapper, func);
-purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type)
- PurpleThemeLoader *loader;
- g_return_val_if_fail(theme_dir != NULL && type != NULL, NULL);
- loader = g_hash_table_lookup(theme_table, type);
- g_return_val_if_fail(PURPLE_IS_THEME_LOADER(loader), NULL);
- return purple_theme_loader_build(loader, theme_dir);
--- a/libpurple/theme-manager.h Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_THEME_MANAGER_H
-#define PURPLE_THEME_MANAGER_H
- * SECTION:theme-manager
- * @section_id: libpurple-theme-manager
- * @short_description: <filename>theme-manager.h</filename>
- * @title: Theme Manager API
- * The theme manager manages of all the available themes and allows you to load
-#include <glib-object.h>
-#include "theme-loader.h"
-typedef void (*PurpleThemeFunc) (PurpleTheme *theme);
- * PURPLE_TYPE_THEME_MANAGER:
- * The standard _get_type macro for #PurpleThemeManager.
-#define PURPLE_TYPE_THEME_MANAGER purple_theme_manager_get_type()
-/**************************************************************************/
-/* Purple Theme Manager API */
-/**************************************************************************/
- * purple_theme_manager_get_type:
- * The standard _get_type function for #GType's.
- * Returns: The #GType for theme manager.
-G_DECLARE_FINAL_TYPE(PurpleThemeManager, purple_theme_manager, PURPLE,
- THEME_MANAGER, GObject)
- * purple_theme_manager_init:
- * Initializes the theme manager.
-void purple_theme_manager_init(void);
- * purple_theme_manager_uninit:
- * Uninitializes the manager then frees all the themes and loaders it is
-void purple_theme_manager_uninit(void);
- * purple_theme_manager_refresh:
- * Rebuilds all the themes in the theme manager.
- * (Removes all current themes but keeps the added loaders.)
-void purple_theme_manager_refresh(void);
- * purple_theme_manager_find_theme:
- * @name: The name of the PurpleTheme.
- * @type: The type of the PurpleTheme.
- * Finds the PurpleTheme object stored by the theme manager.
- * Returns: (transfer none): The PurpleTheme, or NULL if it wasn't found.
-PurpleTheme *purple_theme_manager_find_theme(const gchar *name, const gchar *type);
- * purple_theme_manager_add_theme:
- * @theme: The PurpleTheme to add to the manager.
- * Adds a PurpleTheme to the theme manager. If the theme already exists
- * then this function does nothing.
-void purple_theme_manager_add_theme(PurpleTheme *theme);
- * purple_theme_manager_remove_theme:
- * @theme: The PurpleTheme to remove from the manager.
- * Removes a PurpleTheme from the theme manager and frees the theme.
-void purple_theme_manager_remove_theme(PurpleTheme *theme);
- * purple_theme_manager_register_type:
- * @loader: The PurpleThemeLoader to add.
- * Adds a loader to the theme manager so it knows how to build themes.
-void purple_theme_manager_register_type(PurpleThemeLoader *loader);
- * purple_theme_manager_unregister_type:
- * @loader: The PurpleThemeLoader to be removed.
- * Removes the loader and all themes of the same type from the loader.
-void purple_theme_manager_unregister_type(PurpleThemeLoader *loader);
- * purple_theme_manager_for_each_theme:
- * @func: (scope call): The PurpleThemeFunc to be applied to each theme.
- * Calls the given function on each purple theme.
-void purple_theme_manager_for_each_theme(PurpleThemeFunc func);
- * purple_theme_manager_load_theme:
- * @theme_dir: the directory of the theme to load
- * @type: the type of theme to load
- * Loads a theme of the given type without adding it to the manager
- * Returns: (transfer full): The newly loaded theme.
-PurpleTheme *purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type);
-#endif /* PURPLE_THEME_MANAGER_H */
--- a/libpurple/theme.c Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-void purple_theme_set_type_string(PurpleTheme *theme, const gchar *type);
-/******************************************************************************
- *****************************************************************************/
-/******************************************************************************
- *****************************************************************************/
-/******************************************************************************
- *****************************************************************************/
-static GParamSpec *properties[PROP_LAST];
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(PurpleTheme, purple_theme, G_TYPE_OBJECT);
-/******************************************************************************
- *****************************************************************************/
-purple_theme_get_property(GObject *obj, guint param_id, GValue *value,
- PurpleTheme *theme = PURPLE_THEME(obj);
- g_value_set_string(value, purple_theme_get_name(theme));
- g_value_set_string(value, purple_theme_get_description(theme));
- g_value_set_string(value, purple_theme_get_author(theme));
- g_value_set_string(value, purple_theme_get_type_string(theme));
- g_value_set_string(value, purple_theme_get_dir(theme));
- g_value_set_string(value, purple_theme_get_image(theme));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
-purple_theme_set_property(GObject *obj, guint param_id, const GValue *value,
- PurpleTheme *theme = PURPLE_THEME(obj);
- purple_theme_set_name(theme, g_value_get_string(value));
- purple_theme_set_description(theme, g_value_get_string(value));
- purple_theme_set_author(theme, g_value_get_string(value));
- purple_theme_set_type_string(theme, g_value_get_string(value));
- purple_theme_set_dir(theme, g_value_get_string(value));
- purple_theme_set_image(theme, g_value_get_string(value));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
-purple_theme_init(PurpleTheme *theme)
-purple_theme_finalize(GObject *obj)
- PurpleTheme *theme = PURPLE_THEME(obj);
- PurpleThemePrivate *priv = purple_theme_get_instance_private(theme);
- g_free(priv->description);
- G_OBJECT_CLASS(purple_theme_parent_class)->finalize(obj);
-purple_theme_class_init(PurpleThemeClass *klass)
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- obj_class->get_property = purple_theme_get_property;
- obj_class->set_property = purple_theme_set_property;
- obj_class->finalize = purple_theme_finalize;
- properties[PROP_NAME] = g_param_spec_string("name", "Name",
- "The name of the theme",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- properties[PROP_DESCRIPTION] = g_param_spec_string("description",
- "The description of the theme",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- properties[PROP_AUTHOR] = g_param_spec_string("author", "Author",
- "The author of the theme",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- /* TYPE STRING (read only) */
- properties[PROP_TYPE] = g_param_spec_string("type", "Type",
- "The string representing the type of the theme",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS);
- properties[PROP_DIR] = g_param_spec_string("directory", "Directory",
- "The directory that contains the theme and all its files",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- properties[PROP_IMAGE] = g_param_spec_string("image", "Image",
- "A preview image of the theme",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_properties(obj_class, PROP_LAST, properties);
-/******************************************************************************
- *****************************************************************************/
-theme_clean_text(const gchar *text)
- gchar *clean_text = NULL;
- clean_text = g_markup_escape_text(text, -1);
- g_strdelimit(clean_text, "\n", ' ');
- purple_str_strip_char(clean_text, '\r');
-/*****************************************************************************
- *****************************************************************************/
-purple_theme_get_name(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
-purple_theme_set_name(PurpleTheme *theme, const gchar *name)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- priv->name = theme_clean_text(name);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_NAME]);
-purple_theme_get_description(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
- return priv->description;
-purple_theme_set_description(PurpleTheme *theme, const gchar *description)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- g_free(priv->description);
- priv->description = theme_clean_text(description);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_DESCRIPTION]);
-purple_theme_get_author(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
-purple_theme_set_author(PurpleTheme *theme, const gchar *author)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- priv->author = theme_clean_text(author);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_AUTHOR]);
-purple_theme_get_type_string(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
-purple_theme_set_type_string(PurpleTheme *theme, const gchar *type)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- priv->type = g_strdup(type);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_TYPE]);
-purple_theme_get_dir(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
-purple_theme_set_dir(PurpleTheme *theme, const gchar *dir)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- priv->dir = g_strdup(dir);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_DIR]);
-purple_theme_get_image(PurpleTheme *theme)
- PurpleThemePrivate *priv;
- g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
- priv = purple_theme_get_instance_private(theme);
-purple_theme_get_image_full(PurpleTheme *theme)
- const gchar *filename = purple_theme_get_image(theme);
- return g_build_filename(purple_theme_get_dir(PURPLE_THEME(theme)), filename, NULL);
-purple_theme_set_image(PurpleTheme *theme, const gchar *img)
- PurpleThemePrivate *priv;
- g_return_if_fail(PURPLE_IS_THEME(theme));
- priv = purple_theme_get_instance_private(theme);
- priv->img = g_strdup(img);
- g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_IMAGE]);
--- a/libpurple/theme.h Thu Nov 11 23:19:07 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
- * @section_id: libpurple-theme
- * @short_description: <filename>theme.h</filename>
- * @title: Theme Abstract Class
- * The theme API represents the common abilities for all of our supported
-#include <glib-object.h>
- * The standard _get_type macro for #PurpleTheme.
-#define PURPLE_TYPE_THEME purple_theme_get_type()
-struct _PurpleThemeClass
- GObjectClass parent_class;
- void (*purple_reserved1)(void);
- void (*purple_reserved2)(void);
- void (*purple_reserved3)(void);
- void (*purple_reserved4)(void);
-/**************************************************************************/
-/**************************************************************************/
- * purple_theme_get_type:
- * The standard _get_type function for #GType's.
- * Returns: The #GType for a theme.
-G_DECLARE_DERIVABLE_TYPE(PurpleTheme, purple_theme, PURPLE, THEME, GObject)
- * purple_theme_get_name:
- * @theme: The purple theme.
- * Returns the name of the PurpleTheme object.
- * Returns: The string representing the name of the theme.
-const gchar *purple_theme_get_name(PurpleTheme *theme);
- * purple_theme_set_name:
- * @theme: The purple theme.
- * @name: The name of the PurpleTheme object.
- * Sets the name of the PurpleTheme object.
-void purple_theme_set_name(PurpleTheme *theme, const gchar *name);
- * purple_theme_get_description:
- * @theme: The purple theme.
- * Returns the description of the PurpleTheme object.
- * Returns: A short description of the theme.
-const gchar *purple_theme_get_description(PurpleTheme *theme);
- * purple_theme_set_description:
- * @theme: The purple theme.
- * @description: The description of the PurpleTheme object.
- * Sets the description of the PurpleTheme object.
-void purple_theme_set_description(PurpleTheme *theme, const gchar *description);
- * purple_theme_get_author:
- * @theme: The purple theme.
- * Returns the author of the PurpleTheme object.
- * Returns: The author of the theme.
-const gchar *purple_theme_get_author(PurpleTheme *theme);
- * purple_theme_set_author:
- * @theme: The purple theme.
- * @author: The author of the PurpleTheme object.
- * Sets the author of the PurpleTheme object.
-void purple_theme_set_author(PurpleTheme *theme, const gchar *author);
- * purple_theme_get_type_string:
- * @theme: The purple theme.
- * Returns the type (string) of the PurpleTheme object.
- * Returns: The string representing the type.
-const gchar *purple_theme_get_type_string(PurpleTheme *theme);
- * purple_theme_get_dir:
- * @theme: The purple theme.
- * Returns the directory of the PurpleTheme object.
- * Returns: The string representing the theme directory.
-const gchar *purple_theme_get_dir(PurpleTheme *theme);
- * purple_theme_set_dir:
- * @theme: The purple theme.
- * @dir: The directory of the PurpleTheme object.
- * Sets the directory of the PurpleTheme object.
-void purple_theme_set_dir(PurpleTheme *theme, const gchar *dir);
- * purple_theme_get_image:
- * @theme: The purple theme.
- * Returns the image preview of the PurpleTheme object.
- * Returns: The image preview of the PurpleTheme object.
-const gchar *purple_theme_get_image(PurpleTheme *theme);
- * purple_theme_get_image_full:
- * @theme: The purple theme.
- * Returns the image preview and directory of the PurpleTheme object.
- * Returns: The image preview of the PurpleTheme object.
-gchar *purple_theme_get_image_full(PurpleTheme *theme);
- * purple_theme_set_image:
- * @theme: The purple theme.
- * @img: The image preview of the PurpleTheme object.
- * Sets the directory of the PurpleTheme object.
-void purple_theme_set_image(PurpleTheme *theme, const gchar *img);
-#endif /* PURPLE_THEME_H */
--- a/po/POTFILES.in Thu Nov 11 23:19:07 2021 -0600
+++ b/po/POTFILES.in Mon Nov 15 02:21:18 2021 -0600
@@ -295,9 +295,6 @@
libpurple/tests/test_ui.c
libpurple/tests/test_util.c
libpurple/tests/test_xmlnode.c
-libpurple/theme-loader.c
-libpurple/theme-manager.c