~ubuntu-branches/ubuntu/karmic/gtwitter/karmic

« back to all changes in this revision

Viewing changes to gtwitter/libsexy/UrlLabel.cs

  • Committer: Bazaar Package Importer
  • Author(s): Michael Janssen
  • Date: 2007-08-09 17:14:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20070809171413-28ppa0f2oxmr6qyt
Tags: upstream-1.0~beta
ImportĀ upstreamĀ versionĀ 1.0~beta

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This file was generated by the Gtk# code generator.
 
2
// Any changes made will be lost if regenerated.
 
3
 
 
4
namespace Sexy {
 
5
 
 
6
        using System;
 
7
        using System.Collections;
 
8
        using System.Runtime.InteropServices;
 
9
 
 
10
#region Autogenerated code
 
11
        public  class UrlLabel : Gtk.Label {
 
12
 
 
13
                ~UrlLabel()
 
14
                {
 
15
                        Dispose();
 
16
                }
 
17
 
 
18
                public UrlLabel(IntPtr raw) : base(raw) {}
 
19
 
 
20
                [DllImport("libsexy")]
 
21
                static extern IntPtr sexy_url_label_new();
 
22
 
 
23
                public UrlLabel () : base (IntPtr.Zero)
 
24
                {
 
25
                        if (GetType () != typeof (UrlLabel)) {
 
26
                                CreateNativeObject (new string [0], new GLib.Value[0]);
 
27
                                return;
 
28
                        }
 
29
                        Raw = sexy_url_label_new();
 
30
                }
 
31
 
 
32
                [GLib.CDeclCallback]
 
33
                delegate void UrlActivatedSignalDelegate (IntPtr arg0, IntPtr arg1, IntPtr gch);
 
34
 
 
35
                static void UrlActivatedSignalCallback (IntPtr arg0, IntPtr arg1, IntPtr gch)
 
36
                {
 
37
                        GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
 
38
                        if (sig == null)
 
39
                                throw new Exception("Unknown signal GC handle received " + gch);
 
40
 
 
41
                        Sexy.UrlActivatedArgs args = new Sexy.UrlActivatedArgs ();
 
42
                        args.Args = new object[1];
 
43
                        args.Args[0] = GLib.Marshaller.Utf8PtrToString (arg1);
 
44
                        Sexy.UrlActivatedHandler handler = (Sexy.UrlActivatedHandler) sig.Handler;
 
45
                        handler (GLib.Object.GetObject (arg0), args);
 
46
 
 
47
                }
 
48
 
 
49
                [GLib.CDeclCallback]
 
50
                delegate void UrlActivatedVMDelegate (IntPtr url_label, IntPtr url);
 
51
 
 
52
                static UrlActivatedVMDelegate UrlActivatedVMCallback;
 
53
 
 
54
                static void urlactivated_cb (IntPtr url_label, IntPtr url)
 
55
                {
 
56
                        UrlLabel url_label_managed = GLib.Object.GetObject (url_label, false) as UrlLabel;
 
57
                        url_label_managed.OnUrlActivated (GLib.Marshaller.Utf8PtrToString (url));
 
58
                }
 
59
 
 
60
                private static void OverrideUrlActivated (GLib.GType gtype)
 
61
                {
 
62
                        if (UrlActivatedVMCallback == null)
 
63
                                UrlActivatedVMCallback = new UrlActivatedVMDelegate (urlactivated_cb);
 
64
                        OverrideVirtualMethod (gtype, "url_activated", UrlActivatedVMCallback);
 
65
                }
 
66
 
 
67
                [GLib.DefaultSignalHandler(Type=typeof(Sexy.UrlLabel), ConnectionMethod="OverrideUrlActivated")]
 
68
                protected virtual void OnUrlActivated (string url)
 
69
                {
 
70
                        GLib.Value ret = GLib.Value.Empty;
 
71
                        GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
 
72
                        GLib.Value[] vals = new GLib.Value [2];
 
73
                        vals [0] = new GLib.Value (this);
 
74
                        inst_and_params.Append (vals [0]);
 
75
                        vals [1] = new GLib.Value (url);
 
76
                        inst_and_params.Append (vals [1]);
 
77
                        g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
 
78
                        foreach (GLib.Value v in vals)
 
79
                                v.Dispose ();
 
80
                }
 
81
 
 
82
                [GLib.Signal("url_activated")]
 
83
                public event Sexy.UrlActivatedHandler UrlActivated {
 
84
                        add {
 
85
                                GLib.Signal sig = GLib.Signal.Lookup (this, "url_activated", new UrlActivatedSignalDelegate(UrlActivatedSignalCallback));
 
86
                                sig.AddDelegate (value);
 
87
                        }
 
88
                        remove {
 
89
                                GLib.Signal sig = GLib.Signal.Lookup (this, "url_activated", new UrlActivatedSignalDelegate(UrlActivatedSignalCallback));
 
90
                                sig.RemoveDelegate (value);
 
91
                        }
 
92
                }
 
93
 
 
94
                [DllImport("libsexy")]
 
95
                static extern IntPtr sexy_url_label_get_type();
 
96
 
 
97
                public static new GLib.GType GType { 
 
98
                        get {
 
99
                                IntPtr raw_ret = sexy_url_label_get_type();
 
100
                                GLib.GType ret = new GLib.GType(raw_ret);
 
101
                                return ret;
 
102
                        }
 
103
                }
 
104
 
 
105
                [DllImport("libsexy")]
 
106
                static extern void sexy_url_label_set_markup(IntPtr raw, IntPtr markup);
 
107
 
 
108
                public new string Markup { 
 
109
                        set {
 
110
                                IntPtr markup_as_native = GLib.Marshaller.StringToPtrGStrdup (value);
 
111
                                sexy_url_label_set_markup(Handle, markup_as_native);
 
112
                                GLib.Marshaller.Free (markup_as_native);
 
113
                        }
 
114
                }
 
115
 
 
116
#endregion
 
117
        }
 
118
}