From 68261125e91b8c969c256a07442acc3d7f8dc5e7 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 28 Aug 2003 00:19:39 +0000 Subject: [PATCH] 2003-08-28 Alp Toker * glue/style.c: glue and corresponding .custom entries for TextGC svn path=/trunk/gtk-sharp/; revision=17678 --- ChangeLog | 5 +++++ glue/style.c | 18 ++++++++++++++++++ gtk/Style.custom | 17 +++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/ChangeLog b/ChangeLog index 557b8f0cb..d87dbbaff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-28 Alp Toker + + * glue/style.c: glue and corresponding .custom entries for + TextGC + 2003-08-26 John Luke * gtk/ThreadNotify.cs: mark dllimported methods private diff --git a/glue/style.c b/glue/style.c index a9a0ea5bd..12b73fbd3 100644 --- a/glue/style.c +++ b/glue/style.c @@ -19,12 +19,16 @@ GdkGC *gtksharp_gtk_style_get_bg_gc (GtkStyle *style, int i); GdkGC *gtksharp_gtk_style_get_base_gc (GtkStyle *style, int i); +GdkGC *gtksharp_gtk_style_get_text_gc (GtkStyle *style, int i); + void gtksharp_gtk_style_set_fg_gc (GtkStyle *style, int i, GdkGC *gc); void gtksharp_gtk_style_set_bg_gc (GtkStyle *style, int i, GdkGC *gc); void gtksharp_gtk_style_set_base_gc (GtkStyle *style, int i, GdkGC *gc); +void gtksharp_gtk_style_set_text_gc (GtkStyle *style, int i, GdkGC *gc); + GdkColor *gtksharp_gtk_style_get_white (GtkStyle *style); GdkColor *gtksharp_gtk_style_get_black (GtkStyle *style); @@ -77,6 +81,13 @@ gtksharp_gtk_style_get_base_gc (GtkStyle *style, int i) return style->base_gc[i]; } +GdkGC* +gtksharp_gtk_style_get_text_gc (GtkStyle *style, int i) +{ + g_object_ref (G_OBJECT (style->text_gc[i])); + return style->text_gc[i]; +} + void gtksharp_gtk_style_set_fg_gc (GtkStyle *style, int i, GdkGC *gc) { @@ -98,6 +109,13 @@ gtksharp_gtk_style_set_base_gc (GtkStyle *style, int i, GdkGC *gc) style->base_gc[i] = gc; } +void +gtksharp_gtk_style_set_text_gc (GtkStyle *style, int i, GdkGC *gc) +{ + g_object_ref (G_OBJECT (gc)); + style->text_gc[i] = gc; +} + GdkColor* gtksharp_gtk_style_get_white (GtkStyle *style) { diff --git a/gtk/Style.custom b/gtk/Style.custom index 4b08eac12..66b0efc05 100644 --- a/gtk/Style.custom +++ b/gtk/Style.custom @@ -105,6 +105,23 @@ public void SetBaseGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_base_gc (Handle, (int) state, gc.Handle); } +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_get_text_gc (IntPtr style, int i); + +public Gdk.GC TextGC (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_text_gc (Handle, (int) state); + return EnsureGC (raw); +} + +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_set_text_gc (IntPtr style, int i, IntPtr gc); + +public void SetTextGC (StateType state, Gdk.GC gc) +{ + gtksharp_gtk_style_set_text_gc (Handle, (int) state, gc.Handle); +} + [DllImport("gtksharpglue")] static extern IntPtr gtksharp_gtk_style_get_white (IntPtr style);