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 "glibcompat.h"
26 #include "gtkblist-theme.h"
28 /******************************************************************************
30 *****************************************************************************/
35 * A pidgin buddy list theme.
36 * This is an object for Purple to represent a buddy list theme.
38 * PidginBlistTheme is a PurpleTheme Object.
40 struct _PidginBlistTheme
49 PidginBlistLayout
*layout
;
52 GdkRGBA
*expanded_color
;
53 PidginThemeFont
*expanded
;
55 GdkRGBA
*collapsed_color
;
56 PidginThemeFont
*collapsed
;
59 GdkRGBA
*contact_color
;
61 PidginThemeFont
*contact
;
63 PidginThemeFont
*online
;
64 PidginThemeFont
*away
;
65 PidginThemeFont
*offline
;
66 PidginThemeFont
*idle
;
67 PidginThemeFont
*message
;
68 PidginThemeFont
*message_nick_said
;
70 PidginThemeFont
*status
;
72 } PidginBlistThemePrivate
;
74 struct _PidginThemeFont
81 /******************************************************************************
83 *****************************************************************************/
87 PROP_BACKGROUND_COLOR
,
101 PROP_MESSAGE_NICK_SAID
,
106 /******************************************************************************
108 *****************************************************************************/
110 static GParamSpec
*properties
[PROP_LAST
];
112 G_DEFINE_TYPE_WITH_PRIVATE(PidginBlistTheme
, pidgin_blist_theme
,
115 /******************************************************************************
117 *****************************************************************************/
120 pidgin_theme_font_new(const gchar
*face
, GdkRGBA
*color
)
122 PidginThemeFont
*font
= g_new0(PidginThemeFont
, 1);
123 font
->font
= g_strdup(face
);
125 pidgin_theme_font_set_color(font
, color
);
130 pidgin_theme_font_free(PidginThemeFont
*pair
)
135 gdk_rgba_free(pair
->gdkcolor
);
140 static PidginThemeFont
*
141 copy_font_and_color(const PidginThemeFont
*pair
)
143 PidginThemeFont
*copy
;
148 copy
= g_new0(PidginThemeFont
, 1);
149 copy
->font
= g_strdup(pair
->font
);
150 strncpy(copy
->color
, pair
->color
, sizeof(copy
->color
) - 1);
151 if (pair
->gdkcolor
) {
152 copy
->gdkcolor
= gdk_rgba_copy(pair
->gdkcolor
);
158 pidgin_theme_font_set_font_face(PidginThemeFont
*font
, const gchar
*face
)
160 g_return_if_fail(font
);
161 g_return_if_fail(face
);
164 font
->font
= g_strdup(face
);
168 pidgin_theme_font_set_color(PidginThemeFont
*font
, const GdkRGBA
*color
)
170 g_return_if_fail(font
);
173 gdk_rgba_free(font
->gdkcolor
);
175 font
->gdkcolor
= color
? gdk_rgba_copy(color
) : NULL
;
177 g_snprintf(font
->color
, sizeof(font
->color
),
179 (unsigned int)(color
->red
* 255),
180 (unsigned int)(color
->green
* 255),
181 (unsigned int)(color
->blue
* 255));
183 font
->color
[0] = '\0';
187 pidgin_theme_font_get_font_face(PidginThemeFont
*font
)
189 g_return_val_if_fail(font
, NULL
);
194 pidgin_theme_font_get_color(PidginThemeFont
*font
)
196 g_return_val_if_fail(font
, NULL
);
197 return font
->gdkcolor
;
201 pidgin_theme_font_get_color_describe(PidginThemeFont
*font
)
203 g_return_val_if_fail(font
, NULL
);
204 return font
->color
[0] ? font
->color
: NULL
;
207 /******************************************************************************
209 *****************************************************************************/
212 pidgin_blist_theme_get_property(GObject
*obj
, guint param_id
, GValue
*value
,
215 PidginBlistTheme
*theme
= PIDGIN_BLIST_THEME(obj
);
218 case PROP_BACKGROUND_COLOR
:
219 g_value_set_boxed(value
, pidgin_blist_theme_get_background_color(theme
));
222 g_value_set_double(value
, pidgin_blist_theme_get_opacity(theme
));
225 g_value_set_pointer(value
, pidgin_blist_theme_get_layout(theme
));
227 case PROP_EXPANDED_COLOR
:
228 g_value_set_boxed(value
, pidgin_blist_theme_get_expanded_background_color(theme
));
230 case PROP_EXPANDED_TEXT
:
231 g_value_set_pointer(value
, pidgin_blist_theme_get_expanded_text_info(theme
));
233 case PROP_COLLAPSED_COLOR
:
234 g_value_set_boxed(value
, pidgin_blist_theme_get_collapsed_background_color(theme
));
236 case PROP_COLLAPSED_TEXT
:
237 g_value_set_pointer(value
, pidgin_blist_theme_get_collapsed_text_info(theme
));
239 case PROP_CONTACT_COLOR
:
240 g_value_set_boxed(value
, pidgin_blist_theme_get_contact_color(theme
));
243 g_value_set_pointer(value
, pidgin_blist_theme_get_contact_text_info(theme
));
246 g_value_set_pointer(value
, pidgin_blist_theme_get_online_text_info(theme
));
249 g_value_set_pointer(value
, pidgin_blist_theme_get_away_text_info(theme
));
252 g_value_set_pointer(value
, pidgin_blist_theme_get_offline_text_info(theme
));
255 g_value_set_pointer(value
, pidgin_blist_theme_get_idle_text_info(theme
));
258 g_value_set_pointer(value
, pidgin_blist_theme_get_unread_message_text_info(theme
));
260 case PROP_MESSAGE_NICK_SAID
:
261 g_value_set_pointer(value
, pidgin_blist_theme_get_unread_message_nick_said_text_info(theme
));
264 g_value_set_pointer(value
, pidgin_blist_theme_get_status_text_info(theme
));
267 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj
, param_id
, psec
);
273 pidgin_blist_theme_set_property(GObject
*obj
, guint param_id
, const GValue
*value
,
276 PidginBlistTheme
*theme
= PIDGIN_BLIST_THEME(obj
);
279 case PROP_BACKGROUND_COLOR
:
280 pidgin_blist_theme_set_background_color(theme
, g_value_get_boxed(value
));
283 pidgin_blist_theme_set_opacity(theme
, g_value_get_double(value
));
286 pidgin_blist_theme_set_layout(theme
, g_value_get_pointer(value
));
288 case PROP_EXPANDED_COLOR
:
289 pidgin_blist_theme_set_expanded_background_color(theme
, g_value_get_boxed(value
));
291 case PROP_EXPANDED_TEXT
:
292 pidgin_blist_theme_set_expanded_text_info(theme
, g_value_get_pointer(value
));
294 case PROP_COLLAPSED_COLOR
:
295 pidgin_blist_theme_set_collapsed_background_color(theme
, g_value_get_boxed(value
));
297 case PROP_COLLAPSED_TEXT
:
298 pidgin_blist_theme_set_collapsed_text_info(theme
, g_value_get_pointer(value
));
300 case PROP_CONTACT_COLOR
:
301 pidgin_blist_theme_set_contact_color(theme
, g_value_get_boxed(value
));
304 pidgin_blist_theme_set_contact_text_info(theme
, g_value_get_pointer(value
));
307 pidgin_blist_theme_set_online_text_info(theme
, g_value_get_pointer(value
));
310 pidgin_blist_theme_set_away_text_info(theme
, g_value_get_pointer(value
));
313 pidgin_blist_theme_set_offline_text_info(theme
, g_value_get_pointer(value
));
316 pidgin_blist_theme_set_idle_text_info(theme
, g_value_get_pointer(value
));
319 pidgin_blist_theme_set_unread_message_text_info(theme
, g_value_get_pointer(value
));
321 case PROP_MESSAGE_NICK_SAID
:
322 pidgin_blist_theme_set_unread_message_nick_said_text_info(theme
, g_value_get_pointer(value
));
325 pidgin_blist_theme_set_status_text_info(theme
, g_value_get_pointer(value
));
328 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj
, param_id
, psec
);
334 pidgin_blist_theme_finalize(GObject
*obj
)
336 PidginBlistThemePrivate
*priv
;
338 priv
= pidgin_blist_theme_get_instance_private(
339 PIDGIN_BLIST_THEME(obj
));
343 gdk_rgba_free(priv
->bgcolor
);
344 g_free(priv
->layout
);
347 if (priv
->expanded_color
)
348 gdk_rgba_free(priv
->expanded_color
);
349 pidgin_theme_font_free(priv
->expanded
);
350 if (priv
->collapsed_color
)
351 gdk_rgba_free(priv
->collapsed_color
);
352 pidgin_theme_font_free(priv
->collapsed
);
355 if (priv
->contact_color
)
356 gdk_rgba_free(priv
->contact_color
);
357 pidgin_theme_font_free(priv
->contact
);
358 pidgin_theme_font_free(priv
->online
);
359 pidgin_theme_font_free(priv
->away
);
360 pidgin_theme_font_free(priv
->offline
);
361 pidgin_theme_font_free(priv
->idle
);
362 pidgin_theme_font_free(priv
->message
);
363 pidgin_theme_font_free(priv
->message_nick_said
);
364 pidgin_theme_font_free(priv
->status
);
366 G_OBJECT_CLASS(pidgin_blist_theme_parent_class
)->finalize (obj
);
370 pidgin_blist_theme_init(PidginBlistTheme
*theme
)
372 PidginBlistThemePrivate
*priv
=
373 pidgin_blist_theme_get_instance_private(theme
);
379 pidgin_blist_theme_class_init(PidginBlistThemeClass
*klass
)
381 GObjectClass
*obj_class
= G_OBJECT_CLASS(klass
);
383 obj_class
->get_property
= pidgin_blist_theme_get_property
;
384 obj_class
->set_property
= pidgin_blist_theme_set_property
;
385 obj_class
->finalize
= pidgin_blist_theme_finalize
;
388 properties
[PROP_BACKGROUND_COLOR
] = g_param_spec_boxed("background-color",
390 "The background color for the buddy list",
391 GDK_TYPE_RGBA
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
393 properties
[PROP_OPACITY
] = g_param_spec_double("opacity", "Opacity",
394 "The opacity of the buddy list",
395 0.0, 1.0, 1.0, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
397 properties
[PROP_LAYOUT
] = g_param_spec_pointer("layout", "Layout",
398 "The layout of icons, name, and status of the buddy list",
399 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
402 properties
[PROP_EXPANDED_COLOR
] = g_param_spec_boxed("expanded-color",
403 "Expanded Background Color",
404 "The background color of an expanded group",
405 GDK_TYPE_RGBA
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
407 properties
[PROP_EXPANDED_TEXT
] = g_param_spec_pointer("expanded-text",
409 "The text information for when a group is expanded",
410 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
412 properties
[PROP_COLLAPSED_COLOR
] = g_param_spec_boxed("collapsed-color",
413 "Collapsed Background Color",
414 "The background color of a collapsed group",
415 GDK_TYPE_RGBA
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
417 properties
[PROP_COLLAPSED_TEXT
] = g_param_spec_pointer("collapsed-text",
419 "The text information for when a group is collapsed",
420 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
423 properties
[PROP_CONTACT_COLOR
] = g_param_spec_boxed("contact-color",
424 "Contact/Chat Background Color",
425 "The background color of a contact or chat",
426 GDK_TYPE_RGBA
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
428 properties
[PROP_CONTACT
] = g_param_spec_pointer("contact",
430 "The text information for when a contact is expanded",
431 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
433 properties
[PROP_ONLINE
] = g_param_spec_pointer("online",
435 "The text information for when a buddy is online",
436 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
438 properties
[PROP_AWAY
] = g_param_spec_pointer("away",
440 "The text information for when a buddy is away",
441 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
443 properties
[PROP_OFFLINE
] = g_param_spec_pointer("offline",
445 "The text information for when a buddy is offline",
446 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
448 properties
[PROP_IDLE
] = g_param_spec_pointer("idle",
450 "The text information for when a buddy is idle",
451 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
453 properties
[PROP_MESSAGE
] = g_param_spec_pointer("message",
455 "The text information for when a buddy has an unread message",
456 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
458 properties
[PROP_MESSAGE_NICK_SAID
] = g_param_spec_pointer("message-nick-said",
459 "Message (Nick Said) Text",
460 "The text information for when a chat has an unread message that mentions your nickname",
461 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
463 properties
[PROP_STATUS
] = g_param_spec_pointer("status",
465 "The text information for a buddy's status",
466 G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
);
468 g_object_class_install_properties(obj_class
, PROP_LAST
, properties
);
471 /**************************************************************************
473 **************************************************************************/
475 static PidginThemeFont
*
476 pidgin_theme_font_copy(PidginThemeFont
*font
)
478 g_return_val_if_fail(font
!= NULL
, NULL
);
480 return pidgin_theme_font_new(font
->font
, font
->gdkcolor
);
484 pidgin_theme_font_get_type(void)
486 static GType type
= 0;
489 type
= g_boxed_type_register_static("PidginThemeFont",
490 (GBoxedCopyFunc
)pidgin_theme_font_copy
,
491 (GBoxedFreeFunc
)pidgin_theme_font_free
);
497 static PidginBlistLayout
*
498 pidgin_blist_layout_copy(const PidginBlistLayout
*layout
)
500 g_return_val_if_fail(layout
!= NULL
, NULL
);
502 return g_memdup(layout
, sizeof(PidginBlistLayout
));
506 pidgin_blist_layout_get_type(void)
508 static GType type
= 0;
511 type
= g_boxed_type_register_static("PidginBlistLayout",
512 (GBoxedCopyFunc
)pidgin_blist_layout_copy
,
513 (GBoxedFreeFunc
)g_free
);
520 /*****************************************************************************
521 * Public API functions
522 *****************************************************************************/
527 pidgin_blist_theme_get_background_color(PidginBlistTheme
*theme
)
529 PidginBlistThemePrivate
*priv
;
531 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
533 priv
= pidgin_blist_theme_get_instance_private(theme
);
535 return priv
->bgcolor
;
539 pidgin_blist_theme_get_opacity(PidginBlistTheme
*theme
)
541 PidginBlistThemePrivate
*priv
;
543 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), 1.0);
545 priv
= pidgin_blist_theme_get_instance_private(theme
);
547 return priv
->opacity
;
551 pidgin_blist_theme_get_layout(PidginBlistTheme
*theme
)
553 PidginBlistThemePrivate
*priv
;
555 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
557 priv
= pidgin_blist_theme_get_instance_private(theme
);
563 pidgin_blist_theme_get_expanded_background_color(PidginBlistTheme
*theme
)
565 PidginBlistThemePrivate
*priv
;
567 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
569 priv
= pidgin_blist_theme_get_instance_private(theme
);
571 return priv
->expanded_color
;
575 pidgin_blist_theme_get_expanded_text_info(PidginBlistTheme
*theme
)
577 PidginBlistThemePrivate
*priv
;
579 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
581 priv
= pidgin_blist_theme_get_instance_private(theme
);
583 return priv
->expanded
;
587 pidgin_blist_theme_get_collapsed_background_color(PidginBlistTheme
*theme
)
589 PidginBlistThemePrivate
*priv
;
591 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
593 priv
= pidgin_blist_theme_get_instance_private(theme
);
595 return priv
->collapsed_color
;
599 pidgin_blist_theme_get_collapsed_text_info(PidginBlistTheme
*theme
)
601 PidginBlistThemePrivate
*priv
;
603 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
605 priv
= pidgin_blist_theme_get_instance_private(theme
);
607 return priv
->collapsed
;
611 pidgin_blist_theme_get_contact_color(PidginBlistTheme
*theme
)
613 PidginBlistThemePrivate
*priv
;
615 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
617 priv
= pidgin_blist_theme_get_instance_private(theme
);
619 return priv
->contact_color
;
623 pidgin_blist_theme_get_contact_text_info(PidginBlistTheme
*theme
)
625 PidginBlistThemePrivate
*priv
;
627 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
629 priv
= pidgin_blist_theme_get_instance_private(theme
);
631 return priv
->contact
;
635 pidgin_blist_theme_get_online_text_info(PidginBlistTheme
*theme
)
637 PidginBlistThemePrivate
*priv
;
639 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
641 priv
= pidgin_blist_theme_get_instance_private(theme
);
647 pidgin_blist_theme_get_away_text_info(PidginBlistTheme
*theme
)
649 PidginBlistThemePrivate
*priv
;
651 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
653 priv
= pidgin_blist_theme_get_instance_private(theme
);
659 pidgin_blist_theme_get_offline_text_info(PidginBlistTheme
*theme
)
661 PidginBlistThemePrivate
*priv
;
663 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
665 priv
= pidgin_blist_theme_get_instance_private(theme
);
667 return priv
->offline
;
671 pidgin_blist_theme_get_idle_text_info(PidginBlistTheme
*theme
)
673 PidginBlistThemePrivate
*priv
;
675 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
677 priv
= pidgin_blist_theme_get_instance_private(theme
);
683 pidgin_blist_theme_get_unread_message_text_info(PidginBlistTheme
*theme
)
685 PidginBlistThemePrivate
*priv
;
687 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
689 priv
= pidgin_blist_theme_get_instance_private(theme
);
691 return priv
->message
;
695 pidgin_blist_theme_get_unread_message_nick_said_text_info(PidginBlistTheme
*theme
)
697 PidginBlistThemePrivate
*priv
;
699 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
701 priv
= pidgin_blist_theme_get_instance_private(theme
);
703 return priv
->message_nick_said
;
707 pidgin_blist_theme_get_status_text_info(PidginBlistTheme
*theme
)
709 PidginBlistThemePrivate
*priv
;
711 g_return_val_if_fail(PIDGIN_IS_BLIST_THEME(theme
), NULL
);
713 priv
= pidgin_blist_theme_get_instance_private(theme
);
720 pidgin_blist_theme_set_background_color(PidginBlistTheme
*theme
, const GdkRGBA
*color
)
722 PidginBlistThemePrivate
*priv
;
724 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
726 priv
= pidgin_blist_theme_get_instance_private(theme
);
729 gdk_rgba_free(priv
->bgcolor
);
730 priv
->bgcolor
= color
? gdk_rgba_copy(color
) : NULL
;
732 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_BACKGROUND_COLOR
]);
736 pidgin_blist_theme_set_opacity(PidginBlistTheme
*theme
, gdouble opacity
)
738 PidginBlistThemePrivate
*priv
;
740 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
) || opacity
< 0.0 || opacity
> 1.0);
742 priv
= pidgin_blist_theme_get_instance_private(theme
);
744 priv
->opacity
= opacity
;
746 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_OPACITY
]);
750 pidgin_blist_theme_set_layout(PidginBlistTheme
*theme
, const PidginBlistLayout
*layout
)
752 PidginBlistThemePrivate
*priv
;
754 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
756 priv
= pidgin_blist_theme_get_instance_private(theme
);
758 g_free(priv
->layout
);
759 priv
->layout
= pidgin_blist_layout_copy(layout
);
761 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_LAYOUT
]);
765 pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme
*theme
, const GdkRGBA
*color
)
767 PidginBlistThemePrivate
*priv
;
769 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
771 priv
= pidgin_blist_theme_get_instance_private(theme
);
773 if (priv
->expanded_color
)
774 gdk_rgba_free(priv
->expanded_color
);
775 priv
->expanded_color
= color
? gdk_rgba_copy(color
) : NULL
;
777 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_EXPANDED_COLOR
]);
781 pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
783 PidginBlistThemePrivate
*priv
;
785 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
787 priv
= pidgin_blist_theme_get_instance_private(theme
);
789 pidgin_theme_font_free(priv
->expanded
);
790 priv
->expanded
= copy_font_and_color(pair
);
792 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_EXPANDED_TEXT
]);
796 pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme
*theme
, const GdkRGBA
*color
)
798 PidginBlistThemePrivate
*priv
;
800 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
802 priv
= pidgin_blist_theme_get_instance_private(theme
);
804 if (priv
->collapsed_color
)
805 gdk_rgba_free(priv
->collapsed_color
);
806 priv
->collapsed_color
= color
? gdk_rgba_copy(color
) : NULL
;
808 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_COLLAPSED_COLOR
]);
812 pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
814 PidginBlistThemePrivate
*priv
;
816 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
818 priv
= pidgin_blist_theme_get_instance_private(theme
);
820 pidgin_theme_font_free(priv
->collapsed
);
821 priv
->collapsed
= copy_font_and_color(pair
);
823 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_COLLAPSED_TEXT
]);
827 pidgin_blist_theme_set_contact_color(PidginBlistTheme
*theme
, const GdkRGBA
*color
)
829 PidginBlistThemePrivate
*priv
;
831 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
833 priv
= pidgin_blist_theme_get_instance_private(theme
);
835 if (priv
->contact_color
)
836 gdk_rgba_free(priv
->contact_color
);
837 priv
->contact_color
= color
? gdk_rgba_copy(color
) : NULL
;
839 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_CONTACT_COLOR
]);
843 pidgin_blist_theme_set_contact_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_instance_private(theme
);
851 pidgin_theme_font_free(priv
->contact
);
852 priv
->contact
= copy_font_and_color(pair
);
854 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_CONTACT
]);
858 pidgin_blist_theme_set_online_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
860 PidginBlistThemePrivate
*priv
;
862 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
864 priv
= pidgin_blist_theme_get_instance_private(theme
);
866 pidgin_theme_font_free(priv
->online
);
867 priv
->online
= copy_font_and_color(pair
);
869 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_ONLINE
]);
873 pidgin_blist_theme_set_away_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
875 PidginBlistThemePrivate
*priv
;
877 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
879 priv
= pidgin_blist_theme_get_instance_private(theme
);
881 pidgin_theme_font_free(priv
->away
);
882 priv
->away
= copy_font_and_color(pair
);
884 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_AWAY
]);
888 pidgin_blist_theme_set_offline_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
890 PidginBlistThemePrivate
*priv
;
892 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
894 priv
= pidgin_blist_theme_get_instance_private(theme
);
896 pidgin_theme_font_free(priv
->offline
);
897 priv
->offline
= copy_font_and_color(pair
);
899 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_OFFLINE
]);
903 pidgin_blist_theme_set_idle_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
905 PidginBlistThemePrivate
*priv
;
907 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
909 priv
= pidgin_blist_theme_get_instance_private(theme
);
911 pidgin_theme_font_free(priv
->idle
);
912 priv
->idle
= copy_font_and_color(pair
);
914 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_IDLE
]);
918 pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
920 PidginBlistThemePrivate
*priv
;
922 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
924 priv
= pidgin_blist_theme_get_instance_private(theme
);
926 pidgin_theme_font_free(priv
->message
);
927 priv
->message
= copy_font_and_color(pair
);
929 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_MESSAGE
]);
933 pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
935 PidginBlistThemePrivate
*priv
;
937 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
939 priv
= pidgin_blist_theme_get_instance_private(theme
);
941 pidgin_theme_font_free(priv
->message_nick_said
);
942 priv
->message_nick_said
= copy_font_and_color(pair
);
944 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_MESSAGE_NICK_SAID
]);
948 pidgin_blist_theme_set_status_text_info(PidginBlistTheme
*theme
, const PidginThemeFont
*pair
)
950 PidginBlistThemePrivate
*priv
;
952 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme
));
954 priv
= pidgin_blist_theme_get_instance_private(theme
);
956 pidgin_theme_font_free(priv
->status
);
957 priv
->status
= copy_font_and_color(pair
);
959 g_object_notify_by_pspec(G_OBJECT(theme
), properties
[PROP_STATUS
]);