1
// GtkSharp.Generation.LPUGen.cs - unsugned long/pointer generatable.
3
// Author: Mike Kestner <mkestner@novell.com>
5
// Copyright (c) 2004 Novell, Inc.
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of version 2 of the GNU General Public
9
// License as published by the Free Software Foundation.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
// General Public License for more details.
16
// You should have received a copy of the GNU General Public
17
// License along with this program; if not, write to the
18
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
// Boston, MA 02111-1307, USA.
22
namespace GtkSharp.Generation {
27
public class LPUGen : SimpleGen, IAccessor {
29
public LPUGen (string ctype) : base (ctype, "ulong", "0") {}
31
public override string MarshalType {
37
public override string CallByName (string var_name)
39
return "new UIntPtr (" + var_name + ")";
42
public override string FromNative(string var)
44
return "(ulong) " + var;
47
public void WriteAccessors (StreamWriter sw, string indent, string var)
49
sw.WriteLine (indent + "get {");
50
sw.WriteLine (indent + "\treturn " + FromNative (var) + ";");
51
sw.WriteLine (indent + "}");
52
sw.WriteLine (indent + "set {");
53
sw.WriteLine (indent + "\t" + var + " = " + CallByName ("value") + ";");
54
sw.WriteLine (indent + "}");