2005-03-10 Mike Kestner <mkestner@novell.com>

* 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]

svn path=/trunk/gtk-sharp/; revision=41648
This commit is contained in:
Mike Kestner 2005-03-10 16:06:59 +00:00
parent d8ecc52b5e
commit b394413480
3 changed files with 72 additions and 36 deletions

View File

@ -1,3 +1,10 @@
2005-03-10 Mike Kestner <mkestner@novell.com>
* 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 <mkestner@novell.com>
* */*.custom : scrub for string usage in DllImports.

View File

@ -3,8 +3,10 @@
//
// Authors: Rachel Hestilow <hestilow@ximian.com>
// Radek Doulik <rodo@matfyz.cz>
// Mike Kestner <mkestner@novell.com>
//
// 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 void SetForegroundGC (StateType state, Gdk.GC gc)
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 void SetBackgroundGC (StateType state, Gdk.GC gc)
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 Background (StateType state)
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 Foreground (StateType state)
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 Text (StateType state)
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 Base (StateType state)
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 Light (StateType state)
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 Mid (StateType state)
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 Dark (StateType state)
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 @@ public Pango.FontDescription FontDescription {
return ret;
}
}
[DllImport ("gtksharpglue-2")]
static extern IntPtr gtksharp_gtk_style_get_bg_pixmap (IntPtr style, int state);
[DllImport ("gtksharpglue-2")]
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);
}

View File

@ -82,6 +82,11 @@ PangoFontDescription *gtksharp_gtk_style_get_font_description (GtkStyle *style);
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 @@ gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness)
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;
}