2003-05-19 04:46:15 +02:00
|
|
|
// GtkSharp.Generation.ManualGen.cs - The Manually wrapped type Generatable.
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
2004-06-25 18:35:15 +02:00
|
|
|
// Copyright (c) 2003 Mike Kestner
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2003-05-19 04:46:15 +02:00
|
|
|
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
2004-12-26 22:22:50 +01:00
|
|
|
public class ManualGen : SimpleBase {
|
2003-05-19 04:46:15 +02:00
|
|
|
|
2003-12-15 17:59:25 +01:00
|
|
|
string handle;
|
2003-05-19 04:46:15 +02:00
|
|
|
|
2003-12-15 17:59:25 +01:00
|
|
|
public ManualGen (string ctype, string type) : this (ctype, type, "Handle") {}
|
|
|
|
|
2004-12-26 22:22:50 +01:00
|
|
|
public ManualGen (string ctype, string type, string handle) : base (ctype, type)
|
2003-05-19 04:46:15 +02:00
|
|
|
{
|
2003-12-15 17:59:25 +01:00
|
|
|
this.handle = handle;
|
2003-05-19 04:46:15 +02:00
|
|
|
}
|
|
|
|
|
2004-12-26 22:22:50 +01:00
|
|
|
public override string MarshalType {
|
2003-05-19 04:46:15 +02:00
|
|
|
get
|
|
|
|
{
|
|
|
|
return "IntPtr";
|
|
|
|
}
|
|
|
|
}
|
2004-11-18 23:19:31 +01:00
|
|
|
|
2004-12-26 22:22:50 +01:00
|
|
|
public override string CallByName (string var_name)
|
2003-05-19 04:46:15 +02:00
|
|
|
{
|
2003-12-15 17:59:25 +01:00
|
|
|
return var_name + "." + handle;
|
2003-05-19 04:46:15 +02:00
|
|
|
}
|
|
|
|
|
2004-12-26 22:22:50 +01:00
|
|
|
public override string FromNative(string var)
|
2003-05-19 04:46:15 +02:00
|
|
|
{
|
|
|
|
return "new " + QualifiedName + "(" + var + ")";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|