diff --git a/ChangeLog b/ChangeLog index 5ce034f89..014714042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-26 Alp Toker + + * glue/style.c: glue and corresponding .custom entries for + BaseGC, plus the ability to set GCs + 2003-08-21 Martin Willemoes Hansen * gnomeprint: diff --git a/glue/style.c b/glue/style.c index 6dfba2a4a..a9a0ea5bd 100644 --- a/glue/style.c +++ b/glue/style.c @@ -17,6 +17,14 @@ GdkGC *gtksharp_gtk_style_get_fg_gc (GtkStyle *style, int i); GdkGC *gtksharp_gtk_style_get_bg_gc (GtkStyle *style, int i); +GdkGC *gtksharp_gtk_style_get_base_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); + GdkColor *gtksharp_gtk_style_get_white (GtkStyle *style); GdkColor *gtksharp_gtk_style_get_black (GtkStyle *style); @@ -62,6 +70,34 @@ gtksharp_gtk_style_get_bg_gc (GtkStyle *style, int i) return style->bg_gc[i]; } +GdkGC* +gtksharp_gtk_style_get_base_gc (GtkStyle *style, int i) +{ + g_object_ref (G_OBJECT (style->base_gc[i])); + return style->base_gc[i]; +} + +void +gtksharp_gtk_style_set_fg_gc (GtkStyle *style, int i, GdkGC *gc) +{ + g_object_ref (G_OBJECT (gc)); + style->fg_gc[i] = gc; +} + +void +gtksharp_gtk_style_set_bg_gc (GtkStyle *style, int i, GdkGC *gc) +{ + g_object_ref (G_OBJECT (gc)); + style->bg_gc[i] = gc; +} + +void +gtksharp_gtk_style_set_base_gc (GtkStyle *style, int i, GdkGC *gc) +{ + g_object_ref (G_OBJECT (gc)); + style->base_gc[i] = gc; +} + GdkColor* gtksharp_gtk_style_get_white (GtkStyle *style) { diff --git a/gtk/Style.custom b/gtk/Style.custom index 359dc0ff1..4b08eac12 100644 --- a/gtk/Style.custom +++ b/gtk/Style.custom @@ -41,6 +41,14 @@ public Gdk.GC ForegroundGC (StateType state) return EnsureGC (raw); } +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_set_fg_gc (IntPtr style, int i, IntPtr gc); + +public void SetForegroundGC (StateType state, Gdk.GC gc) +{ + gtksharp_gtk_style_set_fg_gc (Handle, (int) state, gc.Handle); +} + public Gdk.GC[] ForegroundGCs { get { IntPtr[] raws = new IntPtr[6]; @@ -57,8 +65,16 @@ static extern IntPtr gtksharp_gtk_style_get_bg_gc (IntPtr style, int i); public Gdk.GC BackgroundGC (StateType state) { - IntPtr raw = gtksharp_gtk_style_get_bg_gc (Handle, (int) state); - return EnsureGC (raw); + IntPtr raw = gtksharp_gtk_style_get_bg_gc (Handle, (int) state); + return EnsureGC (raw); +} + +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_set_bg_gc (IntPtr style, int i, IntPtr gc); + +public void SetBackgroundGC (StateType state, Gdk.GC gc) +{ + gtksharp_gtk_style_set_bg_gc (Handle, (int) state, gc.Handle); } public Gdk.GC[] BackgroundGCs { @@ -72,6 +88,23 @@ public Gdk.GC[] BackgroundGCs { } } +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_get_base_gc (IntPtr style, int i); + +public Gdk.GC BaseGC (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_base_gc (Handle, (int) state); + return EnsureGC (raw); +} + +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_set_base_gc (IntPtr style, int i, IntPtr gc); + +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_white (IntPtr style);