File: Toolbar.custom

package info (click to toggle)
gtk-sharp 1%3A1.0.10-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,416 kB
  • ctags: 4,465
  • sloc: xml: 224,361; cs: 17,961; sh: 8,422; ansic: 2,724; makefile: 1,604; perl: 1,089
file content (174 lines) | stat: -rw-r--r-- 8,219 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// Gtk.Toolbar.custom - Gtk Toolbar class customizations
//
// Author: Mike Kestner <mkestner@novell.com> 
//
// Copyright (C) 2005 Novell, Inc.
//
// This code is inserted after the automatically generated code.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser 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.

		[DllImport("libgobject-2.0-0.dll")]
		static extern void g_object_weak_ref (IntPtr raw, WeakNotify cb, IntPtr data);

		delegate void WeakNotify (IntPtr handle, IntPtr obj);

		static void ReleaseDelegateCB (IntPtr handle, IntPtr obj)
		{
			GCHandle gch = (GCHandle) handle;
			gch.Free ();
		}

		static WeakNotify on_weak_notify;
		static WeakNotify OnWeakNotify {
			get {
				if (on_weak_notify == null)
					on_weak_notify = new WeakNotify (ReleaseDelegateCB);
				return on_weak_notify;
			}
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_append_element (IntPtr raw, int type, IntPtr widget, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data);

		public Gtk.Widget AppendElement (Gtk.ToolbarChildType type, Gtk.Widget widget, string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_append_element (Handle, (int) type, widget == null ? IntPtr.Zero : widget.Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject (raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_insert_element (IntPtr raw, int type, IntPtr widget, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data, int position);

		public Gtk.Widget InsertElement (Gtk.ToolbarChildType type, Gtk.Widget widget, string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb, IntPtr user_data, int position) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_insert_element (Handle, (int) type, widget == null ? IntPtr.Zero : widget.Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, user_data, position);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject (raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}

			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_prepend_element (IntPtr raw, int type, IntPtr widget, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data);

		public Gtk.Widget PrependElement (Gtk.ToolbarChildType type, Gtk.Widget widget, string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_prepend_element (Handle, (int) type, widget == null ? IntPtr.Zero : widget.Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject (raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_append_item (IntPtr raw, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data);

		public Gtk.Widget AppendItem (string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_append_item (Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject(raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_insert_item (IntPtr raw, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data, int position);

		public Gtk.Widget InsertItem (string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb, IntPtr user_data, int position) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_insert_item (Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, user_data, position);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject(raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_prepend_item (IntPtr raw, string text, string tooltip_text, string tooltip_private_text, IntPtr icon, GtkSharp.SignalFuncNative cb, IntPtr user_data);

		public Gtk.Widget PrependItem (string text, string tooltip_text, string tooltip_private_text, Gtk.Widget icon, Gtk.SignalFunc cb) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_prepend_item (Handle, text, tooltip_text, tooltip_private_text, icon.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject(raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_toolbar_insert_stock (IntPtr raw, string stock_id, string tooltip_text, string tooltip_private_text, GtkSharp.SignalFuncNative cb, IntPtr user_data, int position);

		public Gtk.Widget InsertStock (string stock_id, string tooltip_text, string tooltip_private_text, Gtk.SignalFunc cb, int position) 
		{
			return InsertStock (stock_id, tooltip_text, tooltip_private_text, cb, IntPtr.Zero, position);
		}

		public Gtk.Widget InsertStock (string stock_id, string tooltip_text, string tooltip_private_text, Gtk.SignalFunc cb, IntPtr user_data, int position) 
		{
			GtkSharp.SignalFuncWrapper cb_wrapper = null;
			cb_wrapper = new GtkSharp.SignalFuncWrapper (cb, this);
			IntPtr raw_ret = gtk_toolbar_insert_stock (Handle, stock_id, tooltip_text, tooltip_private_text, cb_wrapper.NativeDelegate, user_data, position);
			Gtk.Widget ret;
			if (raw_ret == IntPtr.Zero)
				ret = null;
			else {
				ret = (Gtk.Widget) GLib.Object.GetObject (raw_ret);
				g_object_weak_ref (raw_ret, OnWeakNotify, (IntPtr) GCHandle.Alloc (cb_wrapper));
			}
			return ret;
		}