From 14b9cd83905167d361a4df8cbaa6373880c9ff17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pekka=20Geh=C3=B6r?= Date: Tue, 16 Dec 2008 15:29:15 +0200 Subject: [PATCH] added irreco_theme_button_set_from_button function. --- irreco/src/core/irreco_theme_button.c | 28 ++++++++++++++++++++++------ irreco/src/core/irreco_theme_button.h | 2 ++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/irreco/src/core/irreco_theme_button.c b/irreco/src/core/irreco_theme_button.c index af3904ae..3bb9de8d 100644 --- a/irreco/src/core/irreco_theme_button.c +++ b/irreco/src/core/irreco_theme_button.c @@ -176,7 +176,23 @@ void irreco_theme_button_set(IrrecoThemeButton *self, IRRECO_RETURN } - +void irreco_theme_button_set_from_button(IrrecoThemeButton *self, + IrrecoThemeButton *button) +{ + IRRECO_ENTER + irreco_theme_button_set(self, + button->style_name->str, + button->name->str, + button->allow_text, + button->image_up->str, + button->image_down->str, + button->text_format_up->str, + button->text_format_down->str, + button->text_padding, + button->text_h_align, + button->text_v_align); + IRRECO_RETURN +} void irreco_theme_button_print(IrrecoThemeButton *self) { IRRECO_ENTER @@ -200,14 +216,14 @@ IrrecoThemeButton *irreco_theme_button_copy(IrrecoThemeButton *self) { IrrecoThemeButton *new = NULL; IRRECO_ENTER - + new = irreco_theme_button_new(self->theme_name->str); irreco_theme_button_set(new, self->style_name->str, self->name->str, self->allow_text, self->image_up->str, self->image_down->str, self->text_format_up->str, self->text_format_down->str, self->text_padding, self->text_h_align, self->text_v_align); - + IRRECO_RETURN_PTR(new); } @@ -220,7 +236,7 @@ IrrecoThemeButton *irreco_theme_button_new_from_dir(const gchar *dir) IrrecoThemeButton *self = NULL; IRRECO_ENTER - + self = irreco_theme_button_new(NULL); irreco_theme_button_read(self, dir); IRRECO_RETURN_PTR(self); @@ -277,7 +293,7 @@ void irreco_theme_button_read(IrrecoThemeButton *self, const gchar *dir) text_padding, text_h_align, text_v_align); - + irreco_theme_button_print(self); end: @@ -290,7 +306,7 @@ void irreco_theme_button_read(IrrecoThemeButton *self, const gchar *dir) g_string_free(style_name, TRUE); - + IRRECO_RETURN } diff --git a/irreco/src/core/irreco_theme_button.h b/irreco/src/core/irreco_theme_button.h index 6538bbf7..ec84da25 100644 --- a/irreco/src/core/irreco_theme_button.h +++ b/irreco/src/core/irreco_theme_button.h @@ -95,6 +95,8 @@ void irreco_theme_button_set(IrrecoThemeButton *self, gint text_padding, gfloat text_h_align, gfloat text_v_align); +void irreco_theme_button_set_from_button(IrrecoThemeButton *self, + IrrecoThemeButton *button); IrrecoThemeButton *irreco_theme_button_new_from_dir(const gchar *dir); void irreco_theme_button_read(IrrecoThemeButton *self, const gchar *dir); void irreco_theme_button_print(IrrecoThemeButton *self); -- 2.11.4.GIT