2 * Buddy List Themes for Pidgin
4 * Pidgin is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 #include "gtkblist-theme.h"
26 #define PIDGIN_BLIST_THEME_GET_PRIVATE(Gobject) \
27 ((PidginBlistThemePrivate *) ((PIDGIN_BLIST_THEME(Gobject))->priv))
29 /******************************************************************************
31 *****************************************************************************/
37 PidginBlistLayout
*layout
;
40 GdkColor
*expanded_color
;
41 PidginThemeFont
*expanded
;
43 GdkColor
*collapsed_color
;
44 PidginThemeFont
*collapsed
;
47 GdkColor
*contact_color
;
49 PidginThemeFont
*contact
;
51 PidginThemeFont
*online
;
52 PidginThemeFont
*away
;
53 PidginThemeFont
*offline
;
54 PidginThemeFont
*idle
;
55 PidginThemeFont
*message
;
56 PidginThemeFont
*message_nick_said
;
58 PidginThemeFont
*status
;
60 } PidginBlistThemePrivate
;
62 struct _PidginThemeFont
69 /******************************************************************************
71 *****************************************************************************/
73 static GObjectClass
*parent_class
= NULL
;
75 /******************************************************************************
77 *****************************************************************************/
81 PROP_BACKGROUND_COLOR
,
95 PROP_MESSAGE_NICK_SAID
,
99 /******************************************************************************
101 *****************************************************************************/
104 pidgin_theme_font_new(const gchar
*face
, GdkColor
*color
)
106 PidginThemeFont
*font
= g_new0(PidginThemeFont
, 1);
107 font
->font
= g_strdup(face
);
109 pidgin_theme_font_set_color(font
, color
);
114 pidgin_theme_font_free(PidginThemeFont
*pair
)
119 gdk_color_free(pair
->gdkcolor
);
124 static PidginThemeFont
*
125 copy_font_and_color(const PidginThemeFont
*pair
)
127 PidginThemeFont
*copy
;
132 copy
= g_new0(PidginThemeFont
, 1);
133 copy
->font
= g_strdup(pair
->font
);
134 strncpy(copy
->color
, pair
->color
, sizeof(copy
->color
) - 1);
136 copy
->gdkcolor
= pair
->gdkcolor
? gdk_color_copy(pair
->gdkcolor
) : NULL
;
141 pidgin_theme_font_set_font_face(PidginThemeFont
*font
, const gchar
*face
)
143 g_return_if_fail(font
);
144 g_return_if_fail(face
);
147 font
->font
= g_strdup(face
);
151 pidgin_theme_font_set_color(PidginThemeFont
*font
, const GdkColor
*color
)
153 g_return_if_fail(font
);
156 gdk_color_free(font
->gdkcolor
);
158 font
->gdkcolor
= color
? gdk_color_copy(color
) : NULL
;
160 g_snprintf(font
->color
, sizeof(font
->color
),
161 "#%02x%02x%02x", color
->red
>> 8, color
->green
>> 8, color
->blue
>> 8);
163 font
->color
[0] = '\0';
167 pidgin_theme_font_get_font_face(PidginThemeFont
*font
)
169 g_return_val_if_fail(font
, NULL
);
174 pidgin_theme_font_get_color(PidginThemeFont
*font
)
176 g_return_val_if_fail(font
, NULL
);
177 return font
->gdkcolor
;
181 pidgin_theme_font_get_color_describe(PidginThemeFont
*font
)
183 g_return_val_if_fail(font
, NULL
);
184 return font
->color
[0] ? font
->color
: NULL
;
187 /******************************************************************************
189 *****************************************************************************/
192 pidgin_blist_theme_init(GTypeInstance
*instance
,
195 (PIDGIN_BLIST_THEME(instance
))->priv
= g_new0(PidginBlistThemePrivate
, 1);
199 pidgin_blist_theme_get_property(GObject
*obj
, guint param_id
, GValue
*value
,
202 PidginBlistTheme
*theme
= PIDGIN_BLIST_THEME(obj
);
205 case PROP_BACKGROUND_COLOR
:
206 g_value_set_boxed(value
, pidgin_blist_theme_get_background_color(theme
));
209 g_value_set_double(value
, pidgin_blist_theme_get_opacity(theme
));
212 g_value_set_pointer(value
, pidgin_blist_theme_get_layout(theme
));
214 case PROP_EXPANDED_COLOR
:
215 g_value_set_boxed(value
, pidgin_blist_theme_get_expanded_background_color(theme
));
217 case PROP_EXPANDED_TEXT
:
218 g_value_set_pointer(value
, pidgin_blist_theme_get_expanded_text_info(theme
));
220 case PROP_COLLAPSED_COLOR
:
221 g_value_set_boxed(value
, pidgin_blist_theme_get_collapsed_background_color(theme
));
223 case PROP_COLLAPSED_TEXT
:
224 g_value_set_pointer(value
, pidgin_blist_theme_get_collapsed_text_info(theme
));
226 case PROP_CONTACT_COLOR
:
227 g_value_set_boxed(value
, pidgin_blist_theme_get_contact_color(theme
));
230 g_value_set_pointer(value
, pidgin_blist_theme_get_contact_text_info(theme
));
233 g_value_set_pointer(value
, pidgin_blist_theme_get_online_text_info(theme
));
236 g_value_set_pointer(value
, pidgin_blist_theme_get_away_text_info(theme
));
239 g_value_set_pointer(value
, pidgin_blist_theme_get_offline_text_info(theme
));
242 g_value_set_pointer(value
, pidgin_blist_theme_get_idle_text_info(theme
));
245 g_value_set_pointer(value
, pidgin_blist_theme_get_unread_message_text_info(theme
));
247 case PROP_MESSAGE_NICK_SAID
:
248 g_value_set_pointer(value
, pidgin_blist_theme_get_unread_message_nick_said_text_info(theme
));
251 g_value_set_pointer(value
, pidgin_blist_theme_get_status_text_info(theme
));
254 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj
, param_id
, psec
);
260 pidgin_blist_theme_set_property(GObject
*obj
, guint param_id
, const GValue
*value
,
263 PidginBlistTheme
*theme
= PIDGIN_BLIST_THEME(obj
);
266 case PROP_BACKGROUND_COLOR
:
267 pidgin_blist_theme_set_background_color(theme
, g_value_get_boxed(value
));
270 pidgin_blist_theme_set_opacity(theme
, g_value_get_double(value
));
273 pidgin_blist_theme_set_layout(theme
, g_value_get_pointer(value
));
275 case PROP_EXPANDED_COLOR
:
276 pidgin_blist_theme_set_expanded_background_color(theme
, g_value_get_boxed(value
));
278 case PROP_EXPANDED_TEXT
:
279 pidgin_blist_theme_set_expanded_text_info(theme
, g_value_get_pointer(value
));
281 case PROP_COLLAPSED_COLOR
:
282 pidgin_blist_theme_set_collapsed_background_color(theme
, g_value_get_boxed(value
));
284 case PROP_COLLAPSED_TEXT
:
285 pidgin_blist_theme_set_collapsed_text_info(theme
, g_value_get_pointer(value
));
287 case PROP_CONTACT_COLOR
:
288 pidgin_blist_theme_set_contact_color(theme
, g_value_get_boxed(value
));
291 pidgin_blist_theme_set_contact_text_info(theme
, g_value_get_pointer(value
));
294 pidgin_blist_theme_set_online_text_info(theme
, g_value_get_pointer(value
));
297 pidgin_blist_theme_set_away_text_info(theme
, g_value_get_pointer(value
));
300 pidgin_blist_theme_set_offline_text_info(theme
, g_value_get_pointer(value
));
303 pidgin_blist_theme_set_idle_text_info(theme
, g_value_get_pointer(value
));
306 pidgin_blist_theme_set_unread_message_text_info(theme
, g_value_get_pointer(value
));
308 case PROP_MESSAGE_NICK_SAID
:
309 pidgin_blist_theme_set_unread_message_nick_said_text_info(theme
, g_value_get_pointer(value
));
312 pidgin_blist_theme_set_status_text_info(theme
, g_value_get_pointer(value
));
315 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj
, param_id
, psec
);
321 pidgin_blist_theme_finalize(GObject
*obj
)
323 PidginBlistThemePrivate
*priv
;
325 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(obj
);
329 gdk_color_free(priv
->bgcolor
);
330 g_free(priv
->layout
);
333 if (priv
->expanded_color
)
334 gdk_color_free(priv
->expanded_color
);
335 pidgin_theme_font_free(priv
->expanded
);
336 if (priv
->collapsed_color
)
337 gdk_color_free(priv
->collapsed_color
);
338 pidgin_theme_font_free(priv
->collapsed
);
341 if (priv
->contact_color
)
342 gdk_color_free(priv
->contact_color
);
343 pidgin_theme_font_free(priv
->contact
);
344 pidgin_theme_font_free(priv
->online
);
345 pidgin_theme_font_free(priv
->away
);
346 pidgin_theme_font_free(priv
->offline
);
347 pidgin_theme_font_free(priv
->idle
);
348 pidgin_theme_font_free(priv
->message
);
349 pidgin_theme_font_free(priv
->message_nick_said
);
350 pidgin_theme_font_free(priv
->status
);
354 parent_class
->finalize (obj
);
358 pidgin_blist_theme_class_init(PidginBlistThemeClass
*klass
)
360 GObjectClass
*obj_class
= G_OBJECT_CLASS(klass
);
363 parent_class
= g_type_class_peek_parent (klass
);
365 obj_class
->get_property
= pidgin_blist_theme_get_property
;
366 obj_class
->set_property
= pidgin_blist_theme_set_property
;
367 obj_class
->finalize
= pidgin_blist_theme_finalize
;
370 pspec
= g_param_spec_boxed("background-color", _("Background Color"),
371 _("The background color for the buddy list"),
372 GDK_TYPE_COLOR
, G_PARAM_READWRITE
);
373 g_object_class_install_property(obj_class
, PROP_BACKGROUND_COLOR
, pspec
);
375 pspec
= g_param_spec_pointer("layout", _("Layout"),
376 _("The layout of icons, name, and status of the buddy list"),
379 g_object_class_install_property(obj_class
, PROP_LAYOUT
, pspec
);
382 /* Note to translators: These two strings refer to the background color
383 of a buddy list group when in its expanded state */
384 pspec
= g_param_spec_boxed("expanded-color", _("Expanded Background Color"),
385 _("The background color of an expanded group"),
386 GDK_TYPE_COLOR
, G_PARAM_READWRITE
);
387 g_object_class_install_property(obj_class
, PROP_EXPANDED_COLOR
, pspec
);
389 /* Note to translators: These two strings refer to the font and color
390 of a buddy list group when in its expanded state */
391 pspec
= g_param_spec_pointer("expanded-text", _("Expanded Text"),
392 _("The text information for when a group is expanded"),
394 g_object_class_install_property(obj_class
, PROP_EXPANDED_TEXT
, pspec
);
396 /* Note to translators: These two strings refer to the background color
397 of a buddy list group when in its collapsed state */
398 pspec
= g_param_spec_boxed("collapsed-color", _("Collapsed Background Color"),
399 _("The background color of a collapsed group"),
400 GDK_TYPE_COLOR
, G_PARAM_READWRITE
);
401 g_object_class_install_property(obj_class
, PROP_COLLAPSED_COLOR
, pspec
);
403 /* Note to translators: These two strings refer to the font and color
404 of a buddy list group when in its collapsed state */
405 pspec
= g_param_spec_pointer("collapsed-text", _("Collapsed Text"),
406 _("The text information for when a group is collapsed"),
408 g_object_class_install_property(obj_class
, PROP_COLLAPSED_TEXT
, pspec
);
411 /* Note to translators: These two strings refer to the background color
412 of a buddy list contact or chat room */
413 pspec
= g_param_spec_boxed("contact-color", _("Contact/Chat Background Color"),
414 _("The background color of a contact or chat"),
415 GDK_TYPE_COLOR
, G_PARAM_READWRITE
);
416 g_object_class_install_property(obj_class
, PROP_CONTACT_COLOR
, pspec
);
418 /* Note to translators: These two strings refer to the font and color
419 of a buddy list contact when in its expanded state */
420 pspec
= g_param_spec_pointer("contact", _("Contact Text"),
421 _("The text information for when a contact is expanded"),
423 g_object_class_install_property(obj_class
, PROP_CONTACT
, pspec
);
425 /* Note to translators: These two strings refer to the font and color
426 of a buddy list buddy when it is online */
427 pspec
= g_param_spec_pointer("online", _("Online Text"),
428 _("The text information for when a buddy is online"),
430 g_object_class_install_property(obj_class
, PROP_ONLINE
, pspec
);
432 /* Note to translators: These two strings refer to the font and color
433 of a buddy list buddy when it is away */
434 pspec
= g_param_spec_pointer("away", _("Away Text"),
435 _("The text information for when a buddy is away"),
437 g_object_class_install_property(obj_class
, PROP_AWAY
, pspec
);
439 /* Note to translators: These two strings refer to the font and color
440 of a buddy list buddy when it is offline */
441 pspec
= g_param_spec_pointer("offline", _("Offline Text"),
442 _("The text information for when a buddy is offline"),
444 g_object_class_install_property(obj_class
, PROP_OFFLINE
, pspec
);
446 /* Note to translators: These two strings refer to the font and color
447 of a buddy list buddy when it is idle */
448 pspec
= g_param_spec_pointer("idle", _("Idle Text"),
449 _("The text information for when a buddy is idle"),
451 g_object_class_install_property(obj_class
, PROP_IDLE
, pspec
);
453 /* Note to translators: These two strings refer to the font and color
454 of a buddy list buddy when they have sent you a new message */
455 pspec
= g_param_spec_pointer("message", _("Message Text"),
456 _("The text information for when a buddy has an unread message"),
458 g_object_class_install_property(obj_class
, PROP_MESSAGE
, pspec
);
460 /* Note to translators: These two strings refer to the font and color
461 of a buddy list buddy when they have sent you a new message */
462 pspec
= g_param_spec_pointer("message_nick_said", _("Message (Nick Said) Text"),
463 _("The text information for when a chat has an unread message that mentions your nickname"),
465 g_object_class_install_property(obj_class
, PROP_MESSAGE_NICK_SAID
, pspec
);
467 pspec
= g_param_spec_pointer("status", _("Status Text"),
468 _("The text information for a buddy's status"),
470 g_object_class_install_property(obj_class
, PROP_STATUS
, pspec
);
474 pidgin_blist_theme_get_type (void)
476 static GType type
= 0;
478 static GTypeInfo info
= {
479 sizeof(PidginBlistThemeClass
),
480 NULL
, /* base_init */
481 NULL
, /* base_finalize */
482 (GClassInitFunc
)pidgin_blist_theme_class_init
, /* class_init */
483 NULL
, /* class_finalize */
484 NULL
, /* class_data */
485 sizeof(PidginBlistTheme
),
487 pidgin_blist_theme_init
, /* instance_init */
488 NULL
, /* value table */
490 type
= g_type_register_static (PURPLE_TYPE_THEME
,
491 "PidginBlistTheme", &info
, 0);
497 /*****************************************************************************
498 * Public API functions
499 *****************************************************************************/
504 pidgin_blist_theme_get_background_color(PidginBlistTheme
*theme
)
506 PidginBlistThemePrivate
*priv
;
508 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
510 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
512 return priv
->bgcolor
;
516 pidgin_blist_theme_get_opacity(PidginBlistTheme
*theme
)
518 PidginBlistThemePrivate
*priv
;
520 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), 1.0);
522 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
524 return priv
->opacity
;
528 pidgin_blist_theme_get_layout(PidginBlistTheme
*theme
)
530 PidginBlistThemePrivate
*priv
;
532 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
534 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
540 pidgin_blist_theme_get_expanded_background_color(PidginBlistTheme
*theme
)
542 PidginBlistThemePrivate
*priv
;
544 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
546 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
548 return priv
->expanded_color
;
552 pidgin_blist_theme_get_expanded_text_info(PidginBlistTheme
*theme
)
554 PidginBlistThemePrivate
*priv
;
556 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
558 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
560 return priv
->expanded
;
564 pidgin_blist_theme_get_collapsed_background_color(PidginBlistTheme
*theme
)
566 PidginBlistThemePrivate
*priv
;
568 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
570 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
572 return priv
->collapsed_color
;
576 pidgin_blist_theme_get_collapsed_text_info(PidginBlistTheme
*theme
)
578 PidginBlistThemePrivate
*priv
;
580 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
582 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
584 return priv
->collapsed
;
588 pidgin_blist_theme_get_contact_color(PidginBlistTheme
*theme
)
590 PidginBlistThemePrivate
*priv
;
592 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
594 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
596 return priv
->contact_color
;
600 pidgin_blist_theme_get_contact_text_info(PidginBlistTheme
*theme
)
602 PidginBlistThemePrivate
*priv
;
604 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
606 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
608 return priv
->contact
;
612 pidgin_blist_theme_get_online_text_info(PidginBlistTheme
*theme
)
614 PidginBlistThemePrivate
*priv
;
616 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
618 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
624 pidgin_blist_theme_get_away_text_info(PidginBlistTheme
*theme
)
626 PidginBlistThemePrivate
*priv
;
628 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
630 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
636 pidgin_blist_theme_get_offline_text_info(PidginBlistTheme
*theme
)
638 PidginBlistThemePrivate
*priv
;
640 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
642 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
644 return priv
->offline
;
648 pidgin_blist_theme_get_idle_text_info(PidginBlistTheme
*theme
)
650 PidginBlistThemePrivate
*priv
;
652 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
654 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
660 pidgin_blist_theme_get_unread_message_text_info(PidginBlistTheme
*theme
)
662 PidginBlistThemePrivate
*priv
;
664 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
666 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
668 return priv
->message
;
672 pidgin_blist_theme_get_unread_message_nick_said_text_info(PidginBlistTheme
*theme
)
674 PidginBlistThemePrivate
*priv
;
676 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
678 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
680 return priv
->message_nick_said
;
684 pidgin_blist_theme_get_status_text_info(PidginBlistTheme
*theme
)
686 PidginBlistThemePrivate
*priv
;
688 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
690 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
697 pidgin_blist_theme_set_background_color(PidginBlistTheme
*theme
, const GdkColor
*color
)
699 PidginBlistThemePrivate
*priv
;
701 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
703 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
706 gdk_color_free(priv
->bgcolor
);
707 priv
->bgcolor
= color
? gdk_color_copy(color
) : NULL
;
711 pidgin_blist_theme_set_opacity(PidginBlistTheme
*theme
, gdouble opacity
)
713 PidginBlistThemePrivate
*priv
;
715 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
) || opacity
< 0.0 || opacity
> 1.0);
717 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
719 priv
->opacity
= opacity
;
723 pidgin_blist_theme_set_layout(PidginBlistTheme
*theme
, const PidginBlistLayout
*layout
)
725 PidginBlistThemePrivate
*priv
;
727 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
729 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
731 g_free(priv
->layout
);
732 priv
->layout
= g_memdup(layout
, sizeof(PidginBlistLayout
));
736 pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme
*theme
, const GdkColor
*color
)
738 PidginBlistThemePrivate
*priv
;
740 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
742 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
744 if (priv
->expanded_color
)
745 gdk_color_free(priv
->expanded_color
);
746 priv
->expanded_color
= color
? gdk_color_copy(color
) : NULL
;
750 pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
752 PidginBlistThemePrivate
*priv
;
754 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
756 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
758 pidgin_theme_font_free(priv
->expanded
);
759 priv
->expanded
= copy_font_and_color(pair
);
763 pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme
*theme
, const GdkColor
*color
)
765 PidginBlistThemePrivate
*priv
;
767 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
769 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
771 if (priv
->collapsed_color
)
772 gdk_color_free(priv
->collapsed_color
);
773 priv
->collapsed_color
= color
? gdk_color_copy(color
) : NULL
;
777 pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
779 PidginBlistThemePrivate
*priv
;
781 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
783 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
785 pidgin_theme_font_free(priv
->collapsed
);
786 priv
->collapsed
= copy_font_and_color(pair
);
790 pidgin_blist_theme_set_contact_color(PidginBlistTheme
*theme
, const GdkColor
*color
)
792 PidginBlistThemePrivate
*priv
;
794 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
796 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
798 if (priv
->contact_color
)
799 gdk_color_free(priv
->contact_color
);
800 priv
->contact_color
= color
? gdk_color_copy(color
) : NULL
;
804 pidgin_blist_theme_set_contact_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
806 PidginBlistThemePrivate
*priv
;
808 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
810 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
812 pidgin_theme_font_free(priv
->contact
);
813 priv
->contact
= copy_font_and_color(pair
);
817 pidgin_blist_theme_set_online_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
819 PidginBlistThemePrivate
*priv
;
821 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
823 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
825 pidgin_theme_font_free(priv
->online
);
826 priv
->online
= copy_font_and_color(pair
);
830 pidgin_blist_theme_set_away_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
832 PidginBlistThemePrivate
*priv
;
834 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
836 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
838 pidgin_theme_font_free(priv
->away
);
839 priv
->away
= copy_font_and_color(pair
);
843 pidgin_blist_theme_set_offline_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
845 PidginBlistThemePrivate
*priv
;
847 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
849 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
851 pidgin_theme_font_free(priv
->offline
);
852 priv
->offline
= copy_font_and_color(pair
);
856 pidgin_blist_theme_set_idle_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
858 PidginBlistThemePrivate
*priv
;
860 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
862 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
864 pidgin_theme_font_free(priv
->idle
);
865 priv
->idle
= copy_font_and_color(pair
);
869 pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
871 PidginBlistThemePrivate
*priv
;
873 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
875 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
877 pidgin_theme_font_free(priv
->message
);
878 priv
->message
= copy_font_and_color(pair
);
882 pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
884 PidginBlistThemePrivate
*priv
;
886 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
888 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
890 pidgin_theme_font_free(priv
->message_nick_said
);
891 priv
->message_nick_said
= copy_font_and_color(pair
);
895 pidgin_blist_theme_set_status_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
897 PidginBlistThemePrivate
*priv
;
899 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
901 priv
= PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme
));
903 pidgin_theme_font_free(priv
->status
);
904 priv
->status
= copy_font_and_color(pair
);