pidgin/gtkblist-theme.c

changeset 35600
a0d221323be1
parent 35082
05a66637ec23
child 37992
0185eb26ac7d
equal deleted inserted replaced
35599:8dd8c949add3 35600:a0d221323be1
473 "PidginBlistTheme", &info, 0); 473 "PidginBlistTheme", &info, 0);
474 } 474 }
475 return type; 475 return type;
476 } 476 }
477 477
478 /**************************************************************************
479 * GBoxed Stuff
480 **************************************************************************/
481
482 static PidginThemeFont *
483 pidgin_theme_font_copy(PidginThemeFont *font)
484 {
485 g_return_val_if_fail(font != NULL, NULL);
486
487 return pidgin_theme_font_new(font->font, font->gdkcolor);
488 }
489
490 GType
491 pidgin_theme_font_get_type(void)
492 {
493 static GType type = 0;
494
495 if (type == 0) {
496 type = g_boxed_type_register_static("PidginThemeFont",
497 (GBoxedCopyFunc)pidgin_theme_font_copy,
498 (GBoxedFreeFunc)pidgin_theme_font_free);
499 }
500
501 return type;
502 }
503
504 static PidginBlistLayout *
505 pidgin_blist_layout_copy(const PidginBlistLayout *layout)
506 {
507 g_return_val_if_fail(layout != NULL, NULL);
508
509 return g_memdup(layout, sizeof(PidginBlistLayout));
510 }
511
512 GType
513 pidgin_blist_layout_get_type(void)
514 {
515 static GType type = 0;
516
517 if (type == 0) {
518 type = g_boxed_type_register_static("PidginBlistLayout",
519 (GBoxedCopyFunc)pidgin_blist_layout_copy,
520 (GBoxedFreeFunc)g_free);
521 }
522
523 return type;
524 }
525
478 526
479 /***************************************************************************** 527 /*****************************************************************************
480 * Public API functions 528 * Public API functions
481 *****************************************************************************/ 529 *****************************************************************************/
482 530
713 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme)); 761 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme));
714 762
715 priv = PIDGIN_BLIST_THEME_GET_PRIVATE(theme); 763 priv = PIDGIN_BLIST_THEME_GET_PRIVATE(theme);
716 764
717 g_free(priv->layout); 765 g_free(priv->layout);
718 priv->layout = g_memdup(layout, sizeof(PidginBlistLayout)); 766 priv->layout = pidgin_blist_layout_copy(layout);
719 767
720 g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_LAYOUT]); 768 g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_LAYOUT]);
721 } 769 }
722 770
723 void 771 void

mercurial