~ubuntu-branches/debian/sid/docky/sid

« back to all changes in this revision

Viewing changes to lib/gio-sharp/generator/ManualGen.cs

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2012-01-19 19:03:38 UTC
  • mfrom: (1.1.14) (10.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20120119190338-n44q7tmqsrkudvk7
Tags: 2.1.3-2
* Upload to unstable
* debian/watch:
  + Look for xz tarballs from now on

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// GtkSharp.Generation.ManualGen.cs - Ungenerated handle type Generatable.
2
 
//
3
 
// Author: Mike Kestner <mkestner@novell.com>
4
 
//
5
 
// Copyright (c) 2003 Mike Kestner
6
 
// Copyright (c) 2004 Novell, Inc.
7
 
//
8
 
// This program is free software; you can redistribute it and/or
9
 
// modify it under the terms of version 2 of the GNU General Public
10
 
// License as published by the Free Software Foundation.
11
 
//
12
 
// This program is distributed in the hope that it will be useful,
13
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
// General Public License for more details.
16
 
//
17
 
// You should have received a copy of the GNU General Public
18
 
// License along with this program; if not, write to the
19
 
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
// Boston, MA 02111-1307, USA.
21
 
 
22
 
 
23
 
namespace GtkSharp.Generation {
24
 
 
25
 
        using System;
26
 
 
27
 
        public class ManualGen : SimpleBase {
28
 
                
29
 
                string from_fmt;
30
 
 
31
 
                public ManualGen (string ctype, string type) : base (ctype, type, "null") 
32
 
                {
33
 
                        from_fmt = "new " + QualifiedName + "({0})";
34
 
                }
35
 
 
36
 
                public ManualGen (string ctype, string type, string from_fmt) : base (ctype, type, "null")
37
 
                {
38
 
                        this.from_fmt = from_fmt;
39
 
                }
40
 
                
41
 
                public override string MarshalType {
42
 
                        get {
43
 
                                return "IntPtr";
44
 
                        }
45
 
                }
46
 
 
47
 
                public override string CallByName (string var_name)
48
 
                {
49
 
                        return var_name + " == null ? IntPtr.Zero : " + var_name + ".Handle";
50
 
                }
51
 
                
52
 
                public override string FromNative(string var)
53
 
                {
54
 
                        return String.Format (from_fmt, var);
55
 
                }
56
 
        }
57
 
}
58