2004-04-04 Mike Kestner <mkestner@ximian.com>
* generator/SymbolTable.cs : don't use StringGen for gunichar. * glib/glue/unichar.c : glue to fetch a gunichar as a utf8 string. * glib/glue/Makefile.am : add unichar.c * glib/glue/makefile.win32 : add unichar.c * gtk/Gtk.metadata : hide TextIter.GetChar * gtk/TextIter.custom : manually impl Char prop. [fixes #53425] svn path=/trunk/gtk-sharp/; revision=25054
This commit is contained in:
parent
c461182425
commit
05e4e0b9d3
7 changed files with 49 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-04-04 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* generator/SymbolTable.cs : don't use StringGen for gunichar.
|
||||
* glib/glue/unichar.c : glue to fetch a gunichar as a utf8 string.
|
||||
* glib/glue/Makefile.am : add unichar.c
|
||||
* glib/glue/makefile.win32 : add unichar.c
|
||||
* gtk/Gtk.metadata : hide TextIter.GetChar
|
||||
* gtk/TextIter.custom : manually impl Char prop. [fixes #53425]
|
||||
|
||||
2004-04-04 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* pango/Layout.custom : increment an indexer. thanks to Moritz Balz
|
||||
|
|
|
@ -66,7 +66,6 @@ namespace GtkSharp.Generation {
|
|||
AddType (new StringGen ("char"));
|
||||
AddType (new SimpleGen ("double", "double"));
|
||||
AddType (new SimpleGen ("float", "float"));
|
||||
AddType (new StringGen ("gunichar"));
|
||||
AddType (new SimpleGen ("uint1", "bool"));
|
||||
AddType (new SimpleGen ("GC", "IntPtr"));
|
||||
AddType (new SimpleGen ("GPtrArray", "IntPtr[]"));
|
||||
|
|
|
@ -9,6 +9,7 @@ libglibsharpglue_la_SOURCES = \
|
|||
slist.c \
|
||||
time_t.c \
|
||||
type.c \
|
||||
unichar.c \
|
||||
value.c \
|
||||
valuearray.c
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ GLUE_OBJS = \
|
|||
slist.o \
|
||||
time_t.o \
|
||||
type.o \
|
||||
unichar.o \
|
||||
value.o \
|
||||
valuearray.o \
|
||||
win32dll.o
|
||||
|
|
23
glib/glue/unichar.c
Normal file
23
glib/glue/unichar.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* unichar.c : Glue to access unichars as strings.
|
||||
*
|
||||
* Author: Mike Kestner <mkestner@ximian.com>
|
||||
*
|
||||
* Copyright <c> 2004 Novell, Inc.
|
||||
*/
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
/* Forward declarations */
|
||||
gchar *gtksharp_unichar_to_utf8_string (gunichar chr);
|
||||
/* */
|
||||
|
||||
gchar *
|
||||
gtksharp_unichar_to_utf8_string (gunichar chr)
|
||||
{
|
||||
gchar *buf = g_new0 (gchar, 7);
|
||||
gint cnt = g_unichar_to_utf8 (chr, buf);
|
||||
buf [cnt] = 0;
|
||||
return buf;
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='BackwardToTagToggle']/*/*[@type='GtkTextTag*']" name="null_ok">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='ForwardSearch']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='ForwardToTagToggle']/*/*[@type='GtkTextTag*']" name="null_ok">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='GetChar']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='GetMarks']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='GetTags']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='GetToggledTags']" name="hidden">1</attr>
|
||||
|
|
|
@ -4,6 +4,20 @@
|
|||
//
|
||||
// Copyright (c) 2004 Novell, Inc.
|
||||
|
||||
[DllImport("glibsharpglue")]
|
||||
static extern IntPtr gtksharp_unichar_to_utf8_string (int raw);
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern int gtk_text_iter_get_char(ref Gtk.TextIter raw);
|
||||
|
||||
public string Char {
|
||||
get {
|
||||
IntPtr raw_ret = gtksharp_unichar_to_utf8_string (gtk_text_iter_get_char (ref this));
|
||||
string ret = GLibSharp.Marshaller.PtrToStringGFree(raw_ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern IntPtr gtk_text_iter_get_marks (ref TextIter iter);
|
||||
|
||||
|
|
Loading…
Reference in a new issue