2003-02-08 Radek Doulik <rodo@ximian.com>

* glib/MainContext.cs: beginning of MainContext class, just
	Iteration and Pending methods to be able to refresh Gtk in the
	middle of time consuming function where it's not worth while to
	use threads

	* glue/style.c (gtksharp_gtk_style_get_font_description): new
	function to access style's font_description field

	* gtk/Style.custom: added font description property

svn path=/trunk/gtk-sharp/; revision=11358
This commit is contained in:
Radek Doulik 2003-02-08 17:33:17 +00:00
parent 2270b314f8
commit 395c0cdf6f
4 changed files with 72 additions and 4 deletions

View file

@ -1,5 +1,15 @@
2003-02-08 Radek Doulik <rodo@ximian.com>
* glib/MainContext.cs: beginning of MainContext class, just
Iteration and Pending methods to be able to refresh Gtk in the
middle of time consuming function where it's not worth while to
use threads
* glue/style.c (gtksharp_gtk_style_get_font_description): new
function to access style's font_description field
* gtk/Style.custom: added font description property
* gconf/GConf/Client.cs: added SyggestSync method
2003-02-07 Peter Williams <peterw@ximian.com>

35
glib/MainContext.cs Normal file
View file

@ -0,0 +1,35 @@
// GLib.MainContext.cs - mainContext class implementation
//
// Author: Radek Doulik <rodo@matfyz.cz>
//
// (C) 2003 Radek Doulik
namespace GLib {
using System;
using System.Runtime.InteropServices;
public class MainContext {
[DllImport("glib-2.0")]
static extern bool g_main_context_iteration (IntPtr Raw, bool MayBlock);
public static bool Iteration ()
{
return g_main_context_iteration (IntPtr.Zero, false);
}
public static bool Iteration (bool MayBlock)
{
return g_main_context_iteration (IntPtr.Zero, MayBlock);
}
[DllImport("glib-2.0")]
static extern bool g_main_context_pending (IntPtr Raw);
public static bool Pending ()
{
return g_main_context_pending (IntPtr.Zero);
}
}
}

View file

@ -1,8 +1,9 @@
/* style.c : Glue to access fields in GtkStyle.
*
* Author: Rachel Hestilow <hestilow@ximian.com>
* Radek Doulik <rodo@matfyz.cz>
*
* <c> 2002 Rachel Hestilow, Mike Kestner
* <c> 2002, 2003 Rachel Hestilow, Mike Kestner, Radek Doulik
*/
#include <gtk/gtkstyle.h>
@ -61,6 +62,12 @@ gtksharp_gtk_style_get_bg (GtkStyle *style, int i)
return &style->bg[i];
}
PangoFontDescription *
gtksharp_gtk_style_get_font_description (GtkStyle *style)
{
return style->font_desc;
}
int
gtksharp_gtk_style_get_thickness (GtkStyle *style, int x)
{
@ -78,4 +85,3 @@ gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness)
else
style->ythickness = -thickness;
}

View file

@ -1,9 +1,10 @@
//
// Gtk.Style.custom - Gtk Style class customizations
//
// Author: Rachel Hestilow <hestilow@ximian.com>
// Authors: Rachel Hestilow <hestilow@ximian.com>
// Radek Doulik <rodo@matfyz.cz>
//
// Copyright (C) 2002 Rachel Hestilow
// Copyright (C) 2002, 2003 Rachel Hestilow, Radek Doulik
//
// This code is inserted after the automatically generated code.
//
@ -149,3 +150,19 @@ public int YThickness {
gtksharp_gtk_style_set_thickness (Handle, -value);
}
}
[DllImport ("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_font_description (IntPtr style);
public Pango.FontDescription FontDescription {
get {
IntPtr Raw = gtksharp_gtk_style_get_font_description (Handle);
if (Raw == IntPtr.Zero)
return null;
Pango.FontDescription ret = (Pango.FontDescription) GLib.Opaque.GetOpaque (Raw);
if (ret == null)
ret = new Pango.FontDescription (Raw);
return ret;
}
}