Fix some functions descriptions
[pidgin-git.git] / libpurple / smiley-theme.c
blob7f43f43624e94266d37df66d2388693bb9ef6d6e
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #include "smiley-theme.h"
24 static PurpleSmileyTheme *current = NULL;
26 /*******************************************************************************
27 * API implementation
28 ******************************************************************************/
30 PurpleSmileyList *
31 purple_smiley_theme_get_smileys(PurpleSmileyTheme *theme, gpointer ui_data)
33 PurpleSmileyThemeClass *klass;
35 g_return_val_if_fail(PURPLE_IS_SMILEY_THEME(theme), NULL);
36 klass = PURPLE_SMILEY_THEME_GET_CLASS(theme);
37 g_return_val_if_fail(klass != NULL, NULL);
38 g_return_val_if_fail(klass->get_smileys != NULL, NULL);
40 return klass->get_smileys(theme, ui_data);
43 void
44 purple_smiley_theme_set_current(PurpleSmileyTheme *theme)
46 PurpleSmileyThemeClass *klass;
48 g_return_if_fail(theme == NULL || PURPLE_IS_SMILEY_THEME(theme));
50 if (theme)
51 g_object_ref(theme);
52 if (current)
53 g_object_unref(current);
54 current = theme;
56 if (!theme)
57 return;
58 klass = PURPLE_SMILEY_THEME_GET_CLASS(theme);
59 g_return_if_fail(klass != NULL);
60 if (klass->activate)
61 klass->activate(theme);
64 PurpleSmileyTheme *
65 purple_smiley_theme_get_current(void)
67 return current;
70 void
71 _purple_smiley_theme_uninit(void)
73 purple_smiley_theme_set_current(NULL);
77 /*******************************************************************************
78 * Object stuff
79 ******************************************************************************/
81 GType
82 purple_smiley_theme_get_type(void)
84 static GType type = 0;
86 if (G_UNLIKELY(type == 0)) {
87 static const GTypeInfo info = {
88 .class_size = sizeof(PurpleSmileyThemeClass),
89 .instance_size = sizeof(PurpleSmileyTheme),
92 type = g_type_register_static(G_TYPE_OBJECT,
93 "PurpleSmileyTheme", &info, G_TYPE_FLAG_ABSTRACT);
96 return type;