2003-08-26 Alp Toker <alp@atoker.com>

* glue/style.c: glue and corresponding .custom entries for
        BaseGC, plus the ability to set GCs

svn path=/trunk/gtk-sharp/; revision=17605
This commit is contained in:
Alp Toker 2003-08-26 00:48:00 +00:00
parent 4fc7596db5
commit e91763b734
3 changed files with 76 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-08-26 Alp Toker <alp@atoker.com>
* glue/style.c: glue and corresponding .custom entries for
BaseGC, plus the ability to set GCs
2003-08-21 Martin Willemoes Hansen <mwh@sysrq.dk>
* gnomeprint:

View File

@ -17,6 +17,14 @@ GdkGC *gtksharp_gtk_style_get_fg_gc (GtkStyle *style, int i);
GdkGC *gtksharp_gtk_style_get_bg_gc (GtkStyle *style, int i);
GdkGC *gtksharp_gtk_style_get_base_gc (GtkStyle *style, int i);
void gtksharp_gtk_style_set_fg_gc (GtkStyle *style, int i, GdkGC *gc);
void gtksharp_gtk_style_set_bg_gc (GtkStyle *style, int i, GdkGC *gc);
void gtksharp_gtk_style_set_base_gc (GtkStyle *style, int i, GdkGC *gc);
GdkColor *gtksharp_gtk_style_get_white (GtkStyle *style);
GdkColor *gtksharp_gtk_style_get_black (GtkStyle *style);
@ -62,6 +70,34 @@ gtksharp_gtk_style_get_bg_gc (GtkStyle *style, int i)
return style->bg_gc[i];
}
GdkGC*
gtksharp_gtk_style_get_base_gc (GtkStyle *style, int i)
{
g_object_ref (G_OBJECT (style->base_gc[i]));
return style->base_gc[i];
}
void
gtksharp_gtk_style_set_fg_gc (GtkStyle *style, int i, GdkGC *gc)
{
g_object_ref (G_OBJECT (gc));
style->fg_gc[i] = gc;
}
void
gtksharp_gtk_style_set_bg_gc (GtkStyle *style, int i, GdkGC *gc)
{
g_object_ref (G_OBJECT (gc));
style->bg_gc[i] = gc;
}
void
gtksharp_gtk_style_set_base_gc (GtkStyle *style, int i, GdkGC *gc)
{
g_object_ref (G_OBJECT (gc));
style->base_gc[i] = gc;
}
GdkColor*
gtksharp_gtk_style_get_white (GtkStyle *style)
{

View File

@ -41,6 +41,14 @@ public Gdk.GC ForegroundGC (StateType state)
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_fg_gc (IntPtr style, int i, IntPtr gc);
public void SetForegroundGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_fg_gc (Handle, (int) state, gc.Handle);
}
public Gdk.GC[] ForegroundGCs {
get {
IntPtr[] raws = new IntPtr[6];
@ -57,8 +65,16 @@ static extern IntPtr gtksharp_gtk_style_get_bg_gc (IntPtr style, int i);
public Gdk.GC BackgroundGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_bg_gc (Handle, (int) state);
return EnsureGC (raw);
IntPtr raw = gtksharp_gtk_style_get_bg_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_bg_gc (IntPtr style, int i, IntPtr gc);
public void SetBackgroundGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_bg_gc (Handle, (int) state, gc.Handle);
}
public Gdk.GC[] BackgroundGCs {
@ -72,6 +88,23 @@ public Gdk.GC[] BackgroundGCs {
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_base_gc (IntPtr style, int i);
public Gdk.GC BaseGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_base_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_base_gc (IntPtr style, int i, IntPtr gc);
public void SetBaseGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_base_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_white (IntPtr style);