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
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 /*******************************************************************************
28 ******************************************************************************/
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
);
44 purple_smiley_theme_set_current(PurpleSmileyTheme
*theme
)
46 PurpleSmileyThemeClass
*klass
;
48 g_return_if_fail(theme
== NULL
|| PURPLE_IS_SMILEY_THEME(theme
));
53 g_object_unref(current
);
58 klass
= PURPLE_SMILEY_THEME_GET_CLASS(theme
);
59 g_return_if_fail(klass
!= NULL
);
61 klass
->activate(theme
);
65 purple_smiley_theme_get_current(void)
71 _purple_smiley_theme_uninit(void)
73 purple_smiley_theme_set_current(NULL
);
77 /*******************************************************************************
79 ******************************************************************************/
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
);