Author: mkestner
Date: 2005-03-10 11:06:40 -0500 (Thu, 10 Mar 2005)
New Revision: 41647

Modified:
   branches/gtk-sharp-1-0-branch/gtk-sharp/ChangeLog
   branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/Style.custom
   branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/glue/style.c
Log:

2005-03-10  Mike Kestner  <[EMAIL PROTECTED]>

        * gtk/Style.custom : add bg_pixmap accessors. remove IntPtr[] vars
        and s/6/5 for array sizes.
        * gtk/glue/style.c : add bg_pixmap field glue.
        [Fixes #73532]


Modified: branches/gtk-sharp-1-0-branch/gtk-sharp/ChangeLog
===================================================================
--- branches/gtk-sharp-1-0-branch/gtk-sharp/ChangeLog   2005-03-10 15:19:01 UTC 
(rev 41646)
+++ branches/gtk-sharp-1-0-branch/gtk-sharp/ChangeLog   2005-03-10 16:06:40 UTC 
(rev 41647)
@@ -1,3 +1,10 @@
+2005-03-10  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * gtk/Style.custom : add bg_pixmap accessors. remove IntPtr[] vars
+       and s/6/5 for array sizes.
+       * gtk/glue/style.c : add bg_pixmap field glue.
+       [Fixes #73532]
+
 2005-03-09  Mike Kestner  <[EMAIL PROTECTED]>
 
        * glib/Markup.cs : backport the -1 length fix from trunk.

Modified: branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/Style.custom
===================================================================
--- branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/Style.custom    2005-03-10 
15:19:01 UTC (rev 41646)
+++ branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/Style.custom    2005-03-10 
16:06:40 UTC (rev 41647)
@@ -3,8 +3,10 @@
 //
 // Authors: Rachel Hestilow <[EMAIL PROTECTED]> 
 //          Radek Doulik <[EMAIL PROTECTED]> 
+//          Mike Kestner  <[EMAIL PROTECTED]>
 //
 // Copyright (C) 2002, 2003 Rachel Hestilow, Radek Doulik
+// Copyright (C) 2005 Novell, Inc.
 //
 // This code is inserted after the automatically generated code.
 //
@@ -66,11 +68,9 @@
 
 public Gdk.GC[] ForegroundGCs {
        get {
-               IntPtr[] raws = new IntPtr[6];
-               Gdk.GC[] ret = new Gdk.GC[raws.Length];
-               for (int i = 0; i < 6; i++) {
+               Gdk.GC[] ret = new Gdk.GC[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = EnsureGC (gtksharp_gtk_style_get_fg_gc 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -94,11 +94,9 @@
 
 public Gdk.GC[] BackgroundGCs {
        get {
-               IntPtr[] raws = new IntPtr[6];
-               Gdk.GC[] ret = new Gdk.GC[raws.Length];
-               for (int i = 0; i < 6; i++) {
+               Gdk.GC[] ret = new Gdk.GC[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = EnsureGC (gtksharp_gtk_style_get_bg_gc 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -230,11 +228,9 @@
 
 public Gdk.Color[] Backgrounds {
        get {
-               IntPtr[] raws = new IntPtr[6];
-               Gdk.Color[] ret = new Gdk.Color[raws.Length];
-               for (int i = 0; i < 6; i++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_bg 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -250,11 +246,9 @@
 
 public Gdk.Color[] Foregrounds {
        get {
-               IntPtr[] raws = new IntPtr[6];
-               Gdk.Color[] ret = new Gdk.Color[raws.Length];
-               for (int i = 0; i < 6; i++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_fg 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -270,11 +264,9 @@
 
 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++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -290,11 +282,9 @@
 
 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++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -310,11 +300,9 @@
 
 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++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_light 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -330,11 +318,9 @@
 
 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++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_mid 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -350,11 +336,9 @@
 
 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++) {
+               Gdk.Color[] ret = new Gdk.Color[5];
+               for (int i = 0; i < 5; i++)
                        ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_dark 
(Handle, i));
-               }
                return ret;
        }
 }
@@ -399,3 +383,30 @@
                return ret;
        }
 }
+
+[DllImport ("gtksharpglue")]
+static extern IntPtr gtksharp_gtk_style_get_bg_pixmap (IntPtr style, int 
state);
+
+[DllImport ("gtksharpglue")]
+static extern void gtksharp_gtk_style_set_bg_pixmap (IntPtr style, int state, 
IntPtr pixmap);
+
+public Gdk.Pixmap BgPixmap (StateType state)
+{
+       IntPtr raw = gtksharp_gtk_style_get_bg_pixmap (Handle, (int) state);
+       return GLib.Object.GetObject (raw) as Gdk.Pixmap;
+}
+
+public Gdk.Pixmap[] BgPixmaps {
+       get {
+               Gdk.Pixmap[] ret = new Gdk.Pixmap [5];
+               for (int i = 0; i < 5; i++)
+                       ret [i] = GLib.Object.GetObject 
(gtksharp_gtk_style_get_dark (Handle, i)) as Gdk.Pixmap;
+               return ret;
+       }
+}
+
+public void SetBgPixmap (StateType state, Gdk.Pixmap pixmap)
+{
+               gtksharp_gtk_style_set_bg_pixmap (Handle, (int) state, pixmap 
== null ? IntPtr.Zero : pixmap.Handle);
+}
+

Modified: branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/glue/style.c
===================================================================
--- branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/glue/style.c    2005-03-10 
15:19:01 UTC (rev 41646)
+++ branches/gtk-sharp-1-0-branch/gtk-sharp/gtk/glue/style.c    2005-03-10 
16:06:40 UTC (rev 41647)
@@ -82,6 +82,11 @@
 int gtksharp_gtk_style_get_thickness (GtkStyle *style, int x);
 
 void gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness);
+
+GdkPixmap *gtksharp_gtk_style_get_bg_pixmap (GtkStyle *style, int i);
+
+void gtksharp_gtk_style_set_bg_pixmap (GtkStyle *style, int i, GdkPixmap 
*pixmap);
+
 /* */
 
 /* FIXME: include all fields */
@@ -282,3 +287,16 @@
        else
                style->ythickness = -thickness;
 }
+
+GdkPixmap *
+gtksharp_gtk_style_get_bg_pixmap (GtkStyle *style, int i)
+{
+       return style->bg_pixmap[i];
+}
+
+void gtksharp_gtk_style_set_bg_pixmap (GtkStyle *style, int i, GdkPixmap 
*pixmap)
+{
+       g_object_ref (G_OBJECT (pixmap));
+       style->bg_pixmap[i] = pixmap;
+}
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to