mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-22 19:00:59 +00:00
2004-12-09 Mike Kestner <mkestner@novell.com>
* generator/Makefile.am : new files. * generator/MethodBody.cs : fix for length param code. * generator/SizeTGen.cs : smarter size_t marshaling. * generator/SSizeTGen.cs : smarter ssize_t marshaling. * generator/SymbolTable.cs : use the new generatables. svn path=/trunk/gtk-sharp/; revision=37509
This commit is contained in:
parent
c7166115dd
commit
62977484e6
|
@ -1,3 +1,11 @@
|
|||
2004-12-09 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* generator/Makefile.am : new files.
|
||||
* generator/MethodBody.cs : fix for length param code.
|
||||
* generator/SizeTGen.cs : smarter size_t marshaling.
|
||||
* generator/SSizeTGen.cs : smarter ssize_t marshaling.
|
||||
* generator/SymbolTable.cs : use the new generatables.
|
||||
|
||||
2004-12-08 John Luke <john.luke@gmail.com>
|
||||
|
||||
* sources/README: update versions of the libs
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2004-12-09 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* en/Gtk/HTML*.xml : size_t marshaling updates.
|
||||
|
||||
2004-12-08 John Luke <john.luke@gmail.com>
|
||||
|
||||
* en/Gtk/IconLookupFlags.xml
|
||||
|
|
|
@ -277,7 +277,7 @@ namespace HtmlTest
|
|||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Write">
|
||||
<MemberSignature Language="C#" Value="public void Write (Gtk.HTMLStream handle, string buffer, UIntPtr size);" />
|
||||
<MemberSignature Language="C#" Value="public void Write (Gtk.HTMLStream handle, string buffer, ulong size);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
|
@ -285,13 +285,13 @@ namespace HtmlTest
|
|||
<Parameters>
|
||||
<Parameter Name="handle" Type="Gtk.HTMLStream" />
|
||||
<Parameter Name="buffer" Type="System.String" />
|
||||
<Parameter Name="size" Type="System.UIntPtr" />
|
||||
<Parameter Name="size" Type="System.UInt64" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Writes <paramref name="size" /> bytes of content from <paramref name="buffer" /> to <paramref name="handle" />.</summary>
|
||||
<param name="handle">a <see cref="T:Gtk.HTMLStream" /></param>
|
||||
<param name="buffer">a <see cref="T:System.String" /></param>
|
||||
<param name="size">a <see cref="T:System.UIntPtr" /></param>
|
||||
<param name="size">a <see cref="T:System.UInt64" /></param>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Type Name="HTMLSaveReceiverFn" FullName="Gtk.HTMLSaveReceiverFn">
|
||||
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed delegate bool HTMLSaveReceiverFn (IntPtr engine, string data, UIntPtr len);" />
|
||||
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed delegate bool HTMLSaveReceiverFn (IntPtr engine, string data);" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>gtkhtml-sharp</AssemblyName>
|
||||
<AssemblyVersion>0.0.0.0</AssemblyVersion>
|
||||
|
|
|
@ -98,19 +98,19 @@
|
|||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Write">
|
||||
<MemberSignature Language="C#" Value="public void Write (byte [] buffer, UIntPtr size);" />
|
||||
<MemberSignature Language="C#" Value="public void Write (byte [] buffer, ulong size);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="buffer" Type="System.Byte[]" />
|
||||
<Parameter Name="size" Type="System.UIntPtr" />
|
||||
<Parameter Name="size" Type="System.UInt64" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Write the HTML to <paramref name="buffer" />.</summary>
|
||||
<param name="buffer">a <see cref="T:System.Byte" /></param>
|
||||
<param name="size">a <see cref="T:System.UIntPtr" /></param>
|
||||
<param name="size">a <see cref="T:System.UInt64" /></param>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Type Name="HTMLStreamWriteFunc" FullName="Gtk.HTMLStreamWriteFunc">
|
||||
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed delegate void HTMLStreamWriteFunc (Gtk.HTMLStream stream, string buffer, UIntPtr size);" />
|
||||
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed delegate void HTMLStreamWriteFunc (Gtk.HTMLStream stream, string buffer, ulong size);" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>gtkhtml-sharp</AssemblyName>
|
||||
<AssemblyVersion>0.0.0.0</AssemblyVersion>
|
||||
|
|
|
@ -242,7 +242,7 @@
|
|||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="ParseCssbuffer">
|
||||
<MemberSignature Language="C#" Value="public static void ParseCssbuffer (Rsvg.Handle ctx, string buff, UIntPtr buflen);" />
|
||||
<MemberSignature Language="C#" Value="public static void ParseCssbuffer (Rsvg.Handle ctx, string buff);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
|
@ -250,13 +250,11 @@
|
|||
<Parameters>
|
||||
<Parameter Name="ctx" Type="Rsvg.Handle" />
|
||||
<Parameter Name="buff" Type="System.String" />
|
||||
<Parameter Name="buflen" Type="System.UIntPtr" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<param name="ctx">a <see cref="T:Rsvg.Handle" /></param>
|
||||
<param name="buff">a <see cref="T:System.String" /></param>
|
||||
<param name="buflen">a <see cref="T:System.UIntPtr" /></param>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
|
|
|
@ -41,6 +41,8 @@ sources = \
|
|||
SignalHandler.cs \
|
||||
Signature.cs \
|
||||
SimpleGen.cs \
|
||||
SizeTGen.cs \
|
||||
SSizeTGen.cs \
|
||||
Statistics.cs \
|
||||
StringGen.cs \
|
||||
StructBase.cs \
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace GtkSharp.Generation {
|
|||
string result = array.NullOk ? array.Name + " != null ? " : "";
|
||||
result += CastFromInt (length.CSType) + array.Name + ".Length";
|
||||
result += array.NullOk ? ": 0" : "";
|
||||
return result;
|
||||
return length.Generatable.CallByName (result);
|
||||
}
|
||||
|
||||
public string GetCallString (bool is_set)
|
||||
|
@ -74,7 +74,7 @@ namespace GtkSharp.Generation {
|
|||
continue;
|
||||
}
|
||||
} else if (i > 0 && parameters [i - 1].IsString && p.IsLength) {
|
||||
result[i] = CastFromInt (p.CSType) + parameters [i - 1].Name + ".Length";
|
||||
result[i] = igen.CallByName (CastFromInt (p.CSType) + parameters [i - 1].Name + ".Length");
|
||||
continue;
|
||||
} else if (p.IsArray && p.MarshalType != p.CSType) {
|
||||
result[i] = (is_set && i == 0 ? "native_value" : "native_" + p.Name);
|
||||
|
|
98
generator/SSizeTGen.cs
Normal file
98
generator/SSizeTGen.cs
Normal file
|
@ -0,0 +1,98 @@
|
|||
// GtkSharp.Generation.SizeTGen.cs - The size_t Generatable.
|
||||
//
|
||||
// Author: Mike Kestner <mkestner@novell.com>
|
||||
//
|
||||
// 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 SSizeTGen : IGeneratable {
|
||||
|
||||
string ctype;
|
||||
string type;
|
||||
|
||||
public string CName {
|
||||
get {
|
||||
return "ssize_t";
|
||||
}
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get {
|
||||
return "long";
|
||||
}
|
||||
}
|
||||
|
||||
public string QualifiedName {
|
||||
get {
|
||||
return "long";
|
||||
}
|
||||
}
|
||||
|
||||
public string MarshalType {
|
||||
get {
|
||||
return "IntPtr";
|
||||
}
|
||||
}
|
||||
|
||||
public string MarshalReturnType {
|
||||
get
|
||||
{
|
||||
return MarshalType;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToNativeReturnType {
|
||||
get
|
||||
{
|
||||
return MarshalType;
|
||||
}
|
||||
}
|
||||
|
||||
public string CallByName (string var_name)
|
||||
{
|
||||
return "new IntPtr (" + var_name + ")";
|
||||
}
|
||||
|
||||
public virtual string FromNative(string var)
|
||||
{
|
||||
return "(long) " + 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
99
generator/SizeTGen.cs
Normal file
99
generator/SizeTGen.cs
Normal file
|
@ -0,0 +1,99 @@
|
|||
// GtkSharp.Generation.SizeTGen.cs - The size_t Generatable.
|
||||
//
|
||||
// Author: Mike Kestner <mkestner@novell.com>
|
||||
//
|
||||
// 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 SizeTGen : IGeneratable {
|
||||
|
||||
string ctype;
|
||||
string type;
|
||||
string ns = "";
|
||||
|
||||
public string CName {
|
||||
get {
|
||||
return "size_t";
|
||||
}
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get {
|
||||
return "ulong";
|
||||
}
|
||||
}
|
||||
|
||||
public string QualifiedName {
|
||||
get {
|
||||
return "ulong";
|
||||
}
|
||||
}
|
||||
|
||||
public string MarshalType {
|
||||
get {
|
||||
return "UIntPtr";
|
||||
}
|
||||
}
|
||||
|
||||
public string MarshalReturnType {
|
||||
get
|
||||
{
|
||||
return MarshalType;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToNativeReturnType {
|
||||
get
|
||||
{
|
||||
return MarshalType;
|
||||
}
|
||||
}
|
||||
|
||||
public string CallByName (string var_name)
|
||||
{
|
||||
return "new UIntPtr (" + var_name + ")";
|
||||
}
|
||||
|
||||
public virtual string FromNative(string var)
|
||||
{
|
||||
return "(ulong) " + 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,6 @@ namespace GtkSharp.Generation {
|
|||
|
||||
static SymbolTable table = null;
|
||||
|
||||
Hashtable alias = new Hashtable ();
|
||||
Hashtable types = new Hashtable ();
|
||||
|
||||
public static SymbolTable Table {
|
||||
|
@ -43,9 +42,6 @@ namespace GtkSharp.Generation {
|
|||
|
||||
public SymbolTable ()
|
||||
{
|
||||
Hashtable alias = new Hashtable ();
|
||||
Hashtable types = new Hashtable ();
|
||||
|
||||
AddType (new SimpleGen ("void", "void"));
|
||||
AddType (new SimpleGen ("gboolean", "bool"));
|
||||
AddType (new SimpleGen ("gint", "int"));
|
||||
|
@ -92,9 +88,9 @@ namespace GtkSharp.Generation {
|
|||
// but this should work for now
|
||||
AddType (new SimpleGen ("gsize", "uint"));
|
||||
AddType (new SimpleGen ("gssize", "int"));
|
||||
AddType (new SimpleGen ("off_t", "System.UIntPtr"));
|
||||
AddType (new SimpleGen ("size_t", "System.UIntPtr"));
|
||||
AddType (new SimpleGen ("ssize_t", "System.IntPtr"));
|
||||
AddType (new AliasGen ("off_t", "size_t"));
|
||||
AddType (new SizeTGen ());
|
||||
AddType (new SSizeTGen ());
|
||||
|
||||
// FIXME: These ought to be handled properly.
|
||||
AddType (new SimpleGen ("GMemChunk", "IntPtr"));
|
||||
|
|
Loading…
Reference in a new issue