summaryrefslogtreecommitdiff
path: root/gtk/gtkrc.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-08-22 03:05:14 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-08-22 03:05:14 +0000
commit92b22465818a783b693aa530274eb2f9b6019fec (patch)
tree88e9b26360363e59635e7376512d8d7bfafa30ad /gtk/gtkrc.c
parentcae2af57d5600b94641540b757dc8e46d92557fa (diff)
downloadgtk+-92b22465818a783b693aa530274eb2f9b6019fec.tar.gz
Add gtk_widget_modify_{fg,bg,text,base,font}.
Mon Aug 21 22:39:18 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.[ch]: Add gtk_widget_modify_{fg,bg,text,base,font}. * gtk/testgtk.c (create_styles): Add a test for modifying the style through gtk_widget_modify_*. * gtk/gtkwidget.c (gtk_widget_get_modifier_style): Add a function to get the current modifier style. * gtk/gtkwidget.c (gtk_widget_modify_style): Make a copy of the passed in GtkRcStyle instead of ref'ing it. * gtk/gtkrc.[ch]: Add gtk_rc_style_copy().
Diffstat (limited to 'gtk/gtkrc.c')
-rw-r--r--gtk/gtkrc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 6b651a75ca..c31fc5062d 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -871,6 +871,29 @@ gtk_rc_style_new (void)
return style;
}
+/**
+ * gtk_rc_style_copy:
+ * @orig: the style to copy
+ *
+ * Make a copy of the specified #GtkRcStyle. This function
+ * will correctly copy an rc style that is a member of a class
+ * derived from #GtkRcStyle.
+ *
+ * Return value: the resulting #GtkRcStyle
+ **/
+GtkRcStyle *
+gtk_rc_style_copy (GtkRcStyle *orig)
+{
+ GtkRcStyle *style;
+
+ g_return_if_fail (GTK_IS_RC_STYLE (orig));
+
+ style = GTK_RC_STYLE_GET_CLASS (orig)->clone (orig);
+ GTK_RC_STYLE_GET_CLASS (style)->merge (style, orig);
+
+ return style;
+}
+
void
gtk_rc_style_ref (GtkRcStyle *rc_style)
{