mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-05-11 21:42:13 +00:00
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:
parent
d8ecc52b5e
commit
b394413480
|
@ -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>
|
2005-03-09 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* */*.custom : scrub for string usage in DllImports.
|
* */*.custom : scrub for string usage in DllImports.
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
//
|
//
|
||||||
// Authors: Rachel Hestilow <hestilow@ximian.com>
|
// Authors: Rachel Hestilow <hestilow@ximian.com>
|
||||||
// Radek Doulik <rodo@matfyz.cz>
|
// Radek Doulik <rodo@matfyz.cz>
|
||||||
|
// Mike Kestner <mkestner@novell.com>
|
||||||
//
|
//
|
||||||
// Copyright (C) 2002, 2003 Rachel Hestilow, Radek Doulik
|
// Copyright (C) 2002, 2003 Rachel Hestilow, Radek Doulik
|
||||||
|
// Copyright (C) 2005 Novell, Inc.
|
||||||
//
|
//
|
||||||
// This code is inserted after the automatically generated code.
|
// 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 {
|
public Gdk.GC[] ForegroundGCs {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.GC[] ret = new Gdk.GC[5];
|
||||||
Gdk.GC[] ret = new Gdk.GC[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = EnsureGC (gtksharp_gtk_style_get_fg_gc (Handle, i));
|
ret[i] = EnsureGC (gtksharp_gtk_style_get_fg_gc (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,11 +94,9 @@ public void SetBackgroundGC (StateType state, Gdk.GC gc)
|
||||||
|
|
||||||
public Gdk.GC[] BackgroundGCs {
|
public Gdk.GC[] BackgroundGCs {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.GC[] ret = new Gdk.GC[5];
|
||||||
Gdk.GC[] ret = new Gdk.GC[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = EnsureGC (gtksharp_gtk_style_get_bg_gc (Handle, i));
|
ret[i] = EnsureGC (gtksharp_gtk_style_get_bg_gc (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,11 +228,9 @@ public Gdk.Color Background (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] Backgrounds {
|
public Gdk.Color[] Backgrounds {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_bg (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_bg (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,11 +246,9 @@ public Gdk.Color Foreground (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] Foregrounds {
|
public Gdk.Color[] Foregrounds {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_fg (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_fg (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,11 +264,9 @@ public Gdk.Color Text (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] TextColors {
|
public Gdk.Color[] TextColors {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,11 +282,9 @@ public Gdk.Color Base (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] BaseColors {
|
public Gdk.Color[] BaseColors {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,11 +300,9 @@ public Gdk.Color Light (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] LightColors {
|
public Gdk.Color[] LightColors {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_light (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_light (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,11 +318,9 @@ public Gdk.Color Mid (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] MidColors {
|
public Gdk.Color[] MidColors {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_mid (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_mid (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,11 +336,9 @@ public Gdk.Color Dark (StateType state)
|
||||||
|
|
||||||
public Gdk.Color[] DarkColors {
|
public Gdk.Color[] DarkColors {
|
||||||
get {
|
get {
|
||||||
IntPtr[] raws = new IntPtr[6];
|
Gdk.Color[] ret = new Gdk.Color[5];
|
||||||
Gdk.Color[] ret = new Gdk.Color[raws.Length];
|
for (int i = 0; i < 5; i++)
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_dark (Handle, i));
|
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_dark (Handle, i));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -399,3 +383,30 @@ public Pango.FontDescription FontDescription {
|
||||||
return ret;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,11 @@ PangoFontDescription *gtksharp_gtk_style_get_font_description (GtkStyle *style);
|
||||||
int gtksharp_gtk_style_get_thickness (GtkStyle *style, int x);
|
int gtksharp_gtk_style_get_thickness (GtkStyle *style, int x);
|
||||||
|
|
||||||
void gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness);
|
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 */
|
/* FIXME: include all fields */
|
||||||
|
@ -282,3 +287,16 @@ gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness)
|
||||||
else
|
else
|
||||||
style->ythickness = -thickness;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue