From a610fb9a79c1cd75867187d5640928e2e145bf0d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 20 Dec 2004 22:05:21 +0000 Subject: [PATCH] * generator/GUnicharGen.cs: generatable for gunichar, using GLib.Marshaller.CharToGUnichar and .GUnicharToChar [#70704] * generator/SymbolTable.cs (SymbolTable): add a GUnicharGen. * generator/Makefile.am (sources): add GUnicharGen.cs * parser/gapi2xml.pl (addPropElem): g_param_spec_unichar() has type "gunichar" not "unichar". * gtk/gtk-api.raw: Regen * glib/Marshaller.cs: Import CharToGUnichar's glue method by the right name svn path=/trunk/gtk-sharp/; revision=37998 --- ChangeLog | 17 ++++++ doc/ChangeLog | 12 ++++ doc/en/Atk/NoOpObject.xml | 16 ++++++ doc/en/Atk/Text.xml | 16 ++++++ doc/en/Gtk/Entry.xml | 13 +++++ doc/en/Gtk/TextCharPredicate.xml | 2 +- doc/en/Pango/Global.xml | 32 +++++++++++ doc/en/Vte/Terminal.xml | 16 ++++++ doc/en/Vte/TerminalAccessible.xml | 16 ++++++ generator/GUnicharGen.cs | 93 +++++++++++++++++++++++++++++++ generator/Makefile.am | 1 + generator/SymbolTable.cs | 1 + glib/Marshaller.cs | 4 +- gtk/gtk-api.raw | 2 +- parser/gapi2xml.pl | 2 +- 15 files changed, 238 insertions(+), 5 deletions(-) create mode 100644 generator/GUnicharGen.cs diff --git a/ChangeLog b/ChangeLog index 5b3fc4445..cfcb31dbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2004-12-20 Dan Winship + + * generator/GUnicharGen.cs: generatable for gunichar, using + GLib.Marshaller.CharToGUnichar and .GUnicharToChar [#70704] + + * generator/SymbolTable.cs (SymbolTable): add a GUnicharGen. + + * generator/Makefile.am (sources): add GUnicharGen.cs + + * parser/gapi2xml.pl (addPropElem): g_param_spec_unichar() has + type "gunichar" not "unichar". + + * gtk/gtk-api.raw: Regen + + * glib/Marshaller.cs: Import CharToGUnichar's glue method by the + right name + 2004-12-20 Dan Winship * gtk/Gtk.metadata: Don't rename GtkStock to StockManager, hide diff --git a/doc/ChangeLog b/doc/ChangeLog index 217fae8ec..d9e37c0e5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,15 @@ +2004-12-20 Dan Winship + + * en/Gtk/TextCharPredicate.xml: update signature... this is usable now + + * en/Atk/NoOpObject.xml (GetCharacterAtOffset): + * en/Atk/Text.xml (GetCharacterAtOffset): + * en/Gtk/Entry.xml (InvisibleChar): + * en/Pango/Global.xml (UnicharDirection, ScriptForUnichar): + * en/Vte/Terminal.xml (IsWordChar): + * en/Vte/TerminalAccessible.xml (GetCharacterAtOffset): document + newly-wrapped methods + 2004-12-20 Dan Winship * en/Gtk/StockManager.xml: gone diff --git a/doc/en/Atk/NoOpObject.xml b/doc/en/Atk/NoOpObject.xml index 025fec28c..bfef5a727 100644 --- a/doc/en/Atk/NoOpObject.xml +++ b/doc/en/Atk/NoOpObject.xml @@ -1892,5 +1892,21 @@ To be added + + + Method + + System.Char + + + + + + Gets the specified text. + position + the character at . + + + \ No newline at end of file diff --git a/doc/en/Atk/Text.xml b/doc/en/Atk/Text.xml index 8c250ba63..c7611c248 100644 --- a/doc/en/Atk/Text.xml +++ b/doc/en/Atk/Text.xml @@ -513,5 +513,21 @@ If the is + + Method + + System.Char + + + + + + Gets the specified text. + position + the character at . + + + \ No newline at end of file diff --git a/doc/en/Gtk/Entry.xml b/doc/en/Gtk/Entry.xml index e1eaddcdd..e4db3d7eb 100644 --- a/doc/en/Gtk/Entry.xml +++ b/doc/en/Gtk/Entry.xml @@ -1105,5 +1105,18 @@ The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts + + + Property + + System.Char + + + + The character to display when is + a + The is the character displayed in the entry in place of the actual characters of when is . The default invisible character is an asterisk ('*'). If you set this to 0, then no characters will be displayed at all. + + \ No newline at end of file diff --git a/doc/en/Gtk/TextCharPredicate.xml b/doc/en/Gtk/TextCharPredicate.xml index a8b04c01c..779e04ce6 100644 --- a/doc/en/Gtk/TextCharPredicate.xml +++ b/doc/en/Gtk/TextCharPredicate.xml @@ -1,5 +1,5 @@ - + gtk-sharp 0.0.0.0 diff --git a/doc/en/Pango/Global.xml b/doc/en/Pango/Global.xml index 68bdaa383..6cecd7717 100644 --- a/doc/en/Pango/Global.xml +++ b/doc/en/Pango/Global.xml @@ -327,5 +327,37 @@ If no delimiters are found, both a To be added + + + Method + + Pango.Direction + + + + + + Determines the direction of a character + a + the direction of the character according to the Unicode bidi algorithm + To be added + + + + + Method + + Pango.Script + + + + + + Determines the script for a character + a + the script for the character according to Unicode Technical Report 24 + No check is made that is valid. If you pass in an invalid character, you will get back an invalid result. + + \ No newline at end of file diff --git a/doc/en/Vte/Terminal.xml b/doc/en/Vte/Terminal.xml index 21408eb88..821b1e1d4 100644 --- a/doc/en/Vte/Terminal.xml +++ b/doc/en/Vte/Terminal.xml @@ -1741,5 +1741,21 @@ class T TERM is automatically set to reflect the terminal widget's emulation setting. If lastlog, utmp, or wtmp are , logs the session to the specified system log files. + + + Method + + System.Boolean + + + + + + Determines if a character is considered to be part of a word + a + if is considered to be a word character according to the current value of . + + + \ No newline at end of file diff --git a/doc/en/Vte/TerminalAccessible.xml b/doc/en/Vte/TerminalAccessible.xml index 8ad4e6f14..02f972ec7 100644 --- a/doc/en/Vte/TerminalAccessible.xml +++ b/doc/en/Vte/TerminalAccessible.xml @@ -768,5 +768,21 @@ To be added + + + Method + + System.Char + + + + + + Gets the specified text. + position + the character at . + + + \ No newline at end of file diff --git a/generator/GUnicharGen.cs b/generator/GUnicharGen.cs new file mode 100644 index 000000000..c555396f7 --- /dev/null +++ b/generator/GUnicharGen.cs @@ -0,0 +1,93 @@ +// GtkSharp.Generation.GUnicharGen.cs - The gunichar Generatable. +// +// Author: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + + +namespace GtkSharp.Generation { + + using System; + + public class GUnicharGen : IGeneratable { + + public string CName { + get { + return "gunichar"; + } + } + + public string Name { + get { + return "char"; + } + } + + public string QualifiedName { + get { + return "char"; + } + } + + public string MarshalType { + get { + return "uint"; + } + } + + public string MarshalReturnType { + get { + return MarshalType; + } + } + + public string ToNativeReturnType { + get { + return MarshalType; + } + } + + public string CallByName (string var_name) + { + return "GLib.Marshaller.CharToGUnichar (" + var_name + ")"; + } + + public virtual string FromNative(string var) + { + return "GLib.Marshaller.GUnicharToChar (" + var + ")"; + } + + public virtual string FromNativeReturn(string var) + { + return FromNative (var); + } + + public virtual string ToNativeReturn(string var) + { + return CallByName (var); + } + + public void Generate () + { + } + + public void Generate (GenerationInfo gen_info) + { + } + } +} + diff --git a/generator/Makefile.am b/generator/Makefile.am index 8f65e6c1b..91b8878c2 100644 --- a/generator/Makefile.am +++ b/generator/Makefile.am @@ -24,6 +24,7 @@ sources = \ GenerationInfo.cs \ GObjectGen.cs \ GStringGen.cs \ + GUnicharGen.cs \ IGeneratable.cs \ ImportSignature.cs \ InterfaceGen.cs \ diff --git a/generator/SymbolTable.cs b/generator/SymbolTable.cs index 338f4a9b7..786803b9b 100644 --- a/generator/SymbolTable.cs +++ b/generator/SymbolTable.cs @@ -91,6 +91,7 @@ namespace GtkSharp.Generation { AddType (new AliasGen ("off_t", "size_t")); AddType (new SizeTGen ()); AddType (new SSizeTGen ()); + AddType (new GUnicharGen ()); // FIXME: These ought to be handled properly. AddType (new SimpleGen ("GMemChunk", "IntPtr")); diff --git a/glib/Marshaller.cs b/glib/Marshaller.cs index 15fc961e0..16210ca9c 100644 --- a/glib/Marshaller.cs +++ b/glib/Marshaller.cs @@ -187,11 +187,11 @@ namespace GLib { } [DllImport("glibsharpglue-2")] - static extern uint glibsharp_utf16_to_gunichar (ushort c); + static extern uint glibsharp_utf16_to_unichar (ushort c); public static uint CharToGUnichar (char c) { - return glibsharp_utf16_to_gunichar ((ushort) c); + return glibsharp_utf16_to_unichar ((ushort) c); } } diff --git a/gtk/gtk-api.raw b/gtk/gtk-api.raw index 7ac2eccf6..b0d9d5c2a 100644 --- a/gtk/gtk-api.raw +++ b/gtk/gtk-api.raw @@ -5194,7 +5194,7 @@ - + diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 09e1e3c58..0fdc182c3 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -801,7 +801,7 @@ sub addPropElem $mode = $params[$#params]; - if ($type =~ /boolean|float|double|^u?int|pointer/) { + if ($type =~ /boolean|float|double|^u?int|pointer|unichar/) { $type = "g$type"; } elsif ($type =~ /string/) { $type = "gchar*";