From b857dbe6083dfff99ec8d9158d93e0365612c8ef Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 18 Jan 2005 04:11:16 +0000 Subject: [PATCH] 2005-01-17 Mike Kestner * gtk/Style.custom : add Light, LightColors, Mid, MidColors, Dark, and DarkColors. * gtk/glue/style.c : add get_light and get_dark svn path=/trunk/gtk-sharp/; revision=39073 --- ChangeLog | 6 +++ doc/en/Gtk/Style.xml | 107 +++++++++++++++++++++++++++++++++++++++---- gtk/Style.custom | 60 ++++++++++++++++++++++++ gtk/glue/style.c | 16 +++++++ 4 files changed, 180 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index b956b546a..4d8a46d4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-17 Mike Kestner + + * gtk/Style.custom : add Light, LightColors, Mid, MidColors, Dark, + and DarkColors. + * gtk/glue/style.c : add get_light and get_dark + 2005-01-17 Mike Kestner * gtk/Gtk.metadata : hide Stock. diff --git a/doc/en/Gtk/Style.xml b/doc/en/Gtk/Style.xml index d7fd647d6..461a260ef 100644 --- a/doc/en/Gtk/Style.xml +++ b/doc/en/Gtk/Style.xml @@ -584,7 +584,7 @@ color or pixmap specified by this style for . - Draws a resize grip in the given rectangle on using the given parameters. + Draws a resize grip in the given rectangle on using the given parameters. a a a @@ -652,7 +652,7 @@ color or pixmap specified by this style for . - Draws a radio button indicator in the given rectangle on with the given parameters. + Draws a radio button indicator in the given rectangle on with the given parameters. a a @@ -826,7 +826,7 @@ color or pixmap specified by this style for . - Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on using the given parameters. + Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on using the given parameters. a a @@ -1428,9 +1428,9 @@ color or pixmap specified by this style for . Deprecated. a - The to use for a given style. This + The to use for a given style. This is deprecated and should not be used in new code. New code - should use + should use instead. @@ -1449,8 +1449,8 @@ color or pixmap specified by this style for . A connection to this signal can be useful if a widget wants - to cache objects like a as object - data on . This signal provides a + to cache objects like a as object + data on . This signal provides a convenient place to free such cached objects. @@ -1508,7 +1508,8 @@ color or pixmap specified by this style for . Deprecated. Do not use. a - + + @@ -1520,7 +1521,95 @@ color or pixmap specified by this style for . Deprecated. Do not use. - + + + + + + + Property + + Gdk.Color[] + + + + Light colors indexed by state. + a + + + + + + Property + + Gdk.Color[] + + + + Mid colors indexed by state. + a + + + + + + Property + + Gdk.Color[] + + + + Dark colors indexed by state. + a + + + + + + Method + + Gdk.Color + + + + + + Gets the light color for a given state. + a + a + + + + + + Method + + Gdk.Color + + + + + + Gets the mid color for a given state. + a + a + + + + + + Method + + Gdk.Color + + + + + + Gets the dark color for a given state. + a + a + diff --git a/gtk/Style.custom b/gtk/Style.custom index 50b2d8cc9..e0b2c11df 100644 --- a/gtk/Style.custom +++ b/gtk/Style.custom @@ -299,6 +299,66 @@ public Gdk.Color[] BaseColors { } } +[DllImport("gtksharpglue-2")] +static extern IntPtr gtksharp_gtk_style_get_light (IntPtr style, int i); + +public Gdk.Color Light (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_light (Handle, (int) state); + return Gdk.Color.New (raw); +} + +public Gdk.Color[] LightColors { + 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_light (Handle, i)); + } + return ret; + } +} + +[DllImport("gtksharpglue-2")] +static extern IntPtr gtksharp_gtk_style_get_mid (IntPtr style, int i); + +public Gdk.Color Mid (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_mid (Handle, (int) state); + return Gdk.Color.New (raw); +} + +public Gdk.Color[] MidColors { + 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_mid (Handle, i)); + } + return ret; + } +} + +[DllImport("gtksharpglue-2")] +static extern IntPtr gtksharp_gtk_style_get_dark (IntPtr style, int i); + +public Gdk.Color Dark (StateType state) +{ + IntPtr raw = gtksharp_gtk_style_get_dark (Handle, (int) state); + return Gdk.Color.New (raw); +} + +public Gdk.Color[] DarkColors { + 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_dark (Handle, i)); + } + return ret; + } +} + [DllImport ("gtksharpglue-2")] static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis); [DllImport ("gtksharpglue-2")] diff --git a/gtk/glue/style.c b/gtk/glue/style.c index 8bd566b27..87c8ea2ff 100644 --- a/gtk/glue/style.c +++ b/gtk/glue/style.c @@ -67,8 +67,12 @@ 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_light (GtkStyle *style, int i); + GdkColor *gtksharp_gtk_style_get_mid (GtkStyle *style, int i); +GdkColor *gtksharp_gtk_style_get_dark (GtkStyle *style, int i); + GdkColor *gtksharp_gtk_style_get_text (GtkStyle *style, int i); GdkColor *gtksharp_gtk_style_get_base (GtkStyle *style, int i); @@ -225,12 +229,24 @@ gtksharp_gtk_style_get_bg (GtkStyle *style, int i) return &style->bg[i]; } +GdkColor* +gtksharp_gtk_style_get_light (GtkStyle *style, int i) +{ + return &style->light[i]; +} + GdkColor* gtksharp_gtk_style_get_mid (GtkStyle *style, int i) { return &style->mid[i]; } +GdkColor* +gtksharp_gtk_style_get_dark (GtkStyle *style, int i) +{ + return &style->dark[i]; +} + GdkColor* gtksharp_gtk_style_get_text (GtkStyle *style, int i) {