diff --git a/ChangeLog b/ChangeLog index ab84aa314..c67b1dfbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-04-01 Jorn Baayen + + * gtk/Style.custom : wrappers for Text[] and Base[] + * gtk/glue/style.c : glue to access text[] and base[] + [fixes #54805] + 2004-04-01 Jeroen Zwartepoorte * gnome/IconTheme.custom : GetSearchPath impl [fixes #51599]. diff --git a/gtk/Style.custom b/gtk/Style.custom index 66b0efc05..c8a617d59 100644 --- a/gtk/Style.custom +++ b/gtk/Style.custom @@ -176,6 +176,46 @@ public Gdk.Color[] Foregrounds { } } +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_get_text (IntPtr style, int i); + +public Gdk.Color Text (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_text (Handle, (int) state); + return Gdk.Color.New (raw); +} + +public Gdk.Color[] TextColors { + get { + IntPtr[] raws = new IntPtr[6]; + Gdk.Color[] ret = new Gdk.Color[raws.Length]; + for (int i = 0; i < 6; i++) { + ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text (Handle, i)); + } + return ret; + } +} + +[DllImport("gtksharpglue")] +static extern IntPtr gtksharp_gtk_style_get_base (IntPtr style, int i); + +public Gdk.Color Base (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_base (Handle, (int) state); + return Gdk.Color.New (raw); +} + +public Gdk.Color[] BaseColors { + get { + IntPtr[] raws = new IntPtr[6]; + Gdk.Color[] ret = new Gdk.Color[raws.Length]; + for (int i = 0; i < 6; i++) { + ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base (Handle, i)); + } + return ret; + } +} + [DllImport ("gtksharpglue")] static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis); [DllImport ("gtksharpglue")] diff --git a/gtk/glue/style.c b/gtk/glue/style.c index 12b73fbd3..dc1f2f413 100644 --- a/gtk/glue/style.c +++ b/gtk/glue/style.c @@ -37,6 +37,10 @@ GdkColor *gtksharp_gtk_style_get_fg (GtkStyle *style, int i); GdkColor *gtksharp_gtk_style_get_bg (GtkStyle *style, int i); +GdkColor *gtksharp_gtk_style_get_text (GtkStyle *style, int i); + +GdkColor *gtksharp_gtk_style_get_base (GtkStyle *style, int i); + PangoFontDescription *gtksharp_gtk_style_get_font_description (GtkStyle *style); int gtksharp_gtk_style_get_thickness (GtkStyle *style, int x); @@ -140,6 +144,18 @@ gtksharp_gtk_style_get_bg (GtkStyle *style, int i) return &style->bg[i]; } +GdkColor* +gtksharp_gtk_style_get_text (GtkStyle *style, int i) +{ + return &style->text[i]; +} + +GdkColor* +gtksharp_gtk_style_get_base (GtkStyle *style, int i) +{ + return &style->base[i]; +} + PangoFontDescription * gtksharp_gtk_style_get_font_description (GtkStyle *style) {