1
// GtkSharp.Generation.SimpleBase.cs - base class for marshaling non-generated types.
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 {
26
public abstract class SimpleBase : IGeneratable {
30
string ns = String.Empty;
31
string default_value = String.Empty;
33
public SimpleBase (string ctype, string type, string default_value)
35
string[] toks = type.Split('.');
37
this.type = toks[toks.Length - 1];
39
this.ns = String.Join (".", toks, 0, toks.Length - 1);
40
else if (toks.Length == 2)
42
this.default_value = default_value;
57
public string QualifiedName {
59
return ns == String.Empty ? type : ns + "." + type;
63
public virtual string MarshalType {
69
public virtual string MarshalReturnType {
75
public virtual string DefaultValue {
81
public virtual string ToNativeReturnType {
87
public virtual string CallByName (string var)
92
public virtual string FromNative(string var)
97
public virtual string FromNativeReturn(string var)
99
return FromNative (var);
102
public virtual string ToNativeReturn(string var)
104
return CallByName (var);
107
public bool Validate ()
112
public void Generate ()
116
public void Generate (GenerationInfo gen_info)