2002-02-03 03:44:10 +00:00
|
|
|
// SList.cs - GSList class wrapper implementation
|
|
|
|
//
|
|
|
|
// Authors: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
2004-06-25 18:42:19 +00:00
|
|
|
// Copyright (c) 2002 Mike Kestner
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2002-02-03 03:44:10 +00:00
|
|
|
|
|
|
|
namespace GLib {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
2002-09-01 04:46:38 +00:00
|
|
|
public class SList : ListBase {
|
2002-02-03 03:44:10 +00:00
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate IntPtr d_g_slist_copy(IntPtr l);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_copy g_slist_copy = FuncLoader.LoadFunction<d_g_slist_copy>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_copy"));
|
2002-09-01 04:46:38 +00:00
|
|
|
|
|
|
|
public override object Clone ()
|
2002-04-25 09:17:54 +00:00
|
|
|
{
|
2002-09-01 04:46:38 +00:00
|
|
|
return new SList (g_slist_copy (Handle));
|
2002-02-03 03:44:10 +00:00
|
|
|
}
|
2002-06-26 Rachel Hestilow <hestilow@ximian.com>
* configure.in, makefile, makefile.win32: add gnome.
* doc/index.html, netdoc.xsl: Add gnome.
* gdk/Event.cs: New manual wrap for GdkEvent.
* generator/ClassBase.cs: Add methods GetProperty,
GetPropertyRecursively, GetMethodRecursively.
Move Parent property here from ObjectGen.cs. Pass this pointer
into Property.
* generator/Ctor.cs: Generate docs.
* generator/Method.cs, Property.cs: Tag method as "new" if a
Method/Property with the same name is found in the class hierarchy.
* generator/SignalHandler.cs: Correctly wrap complex signal argument
types. Add gnome directory.
* generator/SymbolTable.cs: Add manually wrapped types hash
(contains GLib.GSList and Gdk.Event). Add method IsManuallyWrapped.
* glib/SList.cs: Add constructor from IntPtr.
* glue/slist.c, glue/event.c: Added (field accessor glue).
* glue/Makefile.am: Update.
* parser/Gtk.metadata: Add new signal renames for new signals
exposed by GdkEvent changes.
* parser/README, parser/build.pl: Add libgnome, libgnomecanvas,
libgnomeui.
* parser/gapi2xml.pl: Handle literal-length array parameters,
and NULL property doc strings.
* sample/: Add new test GnomeHelloWorld.cs.
* gnome/: Added.
* parser/Gnome.metadata: Added.
svn path=/trunk/gtk-sharp/; revision=5461
2002-06-26 08:36:05 +00:00
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate int d_g_slist_length(IntPtr l);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_length g_slist_length = FuncLoader.LoadFunction<d_g_slist_length>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_length"));
|
2002-09-01 04:46:38 +00:00
|
|
|
|
|
|
|
internal override int Length (IntPtr list)
|
|
|
|
{
|
|
|
|
return g_slist_length (list);
|
|
|
|
}
|
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate void d_g_slist_free(IntPtr l);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_free g_slist_free = FuncLoader.LoadFunction<d_g_slist_free>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_free"));
|
2002-09-01 04:46:38 +00:00
|
|
|
|
|
|
|
internal override void Free (IntPtr list)
|
|
|
|
{
|
|
|
|
if (list != IntPtr.Zero)
|
|
|
|
g_slist_free (list);
|
|
|
|
}
|
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate IntPtr d_g_slist_append(IntPtr l, IntPtr raw);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_append g_slist_append = FuncLoader.LoadFunction<d_g_slist_append>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_append"));
|
2002-10-11 15:43:52 +00:00
|
|
|
|
|
|
|
internal override IntPtr Append (IntPtr list, IntPtr raw)
|
|
|
|
{
|
|
|
|
return g_slist_append (list, raw);
|
|
|
|
}
|
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate IntPtr d_g_slist_prepend(IntPtr l, IntPtr raw);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_prepend g_slist_prepend = FuncLoader.LoadFunction<d_g_slist_prepend>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_prepend"));
|
2002-10-11 15:43:52 +00:00
|
|
|
|
|
|
|
internal override IntPtr Prepend (IntPtr list, IntPtr raw)
|
|
|
|
{
|
|
|
|
return g_slist_prepend (list, raw);
|
|
|
|
}
|
|
|
|
|
2003-10-27 04:58:42 +00:00
|
|
|
|
2018-01-17 20:31:39 +00:00
|
|
|
delegate IntPtr d_g_slist_nth_data(IntPtr l, uint n);
|
2018-01-18 21:54:45 +00:00
|
|
|
static d_g_slist_nth_data g_slist_nth_data = FuncLoader.LoadFunction<d_g_slist_nth_data>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_slist_nth_data"));
|
2003-10-27 04:58:42 +00:00
|
|
|
|
|
|
|
internal override IntPtr NthData (uint n)
|
|
|
|
{
|
|
|
|
return g_slist_nth_data (Handle, n);
|
|
|
|
}
|
|
|
|
|
2005-06-23 22:28:06 +00:00
|
|
|
public SList (IntPtr raw) : this (raw, null) {}
|
2002-09-01 04:46:38 +00:00
|
|
|
|
2005-06-23 22:28:06 +00:00
|
|
|
public SList (System.Type element_type) : this (IntPtr.Zero, element_type) {}
|
2004-02-04 17:21:22 +00:00
|
|
|
|
2005-06-23 22:28:06 +00:00
|
|
|
public SList (IntPtr raw, System.Type element_type) : this (raw, element_type, false, false) {}
|
|
|
|
|
|
|
|
public SList (IntPtr raw, System.Type element_type, bool owned, bool elements_owned) : base (raw, element_type, false, false) {}
|
2007-08-14 18:53:53 +00:00
|
|
|
|
|
|
|
public SList (object[] members, System.Type element_type, bool owned, bool elements_owned) : this (IntPtr.Zero, element_type, owned, elements_owned)
|
|
|
|
{
|
|
|
|
foreach (object o in members)
|
|
|
|
Append (o);
|
|
|
|
}
|
2007-11-02 16:36:26 +00:00
|
|
|
|
|
|
|
public SList (Array members, System.Type element_type, bool owned, bool elements_owned) : this (IntPtr.Zero, element_type, owned, elements_owned)
|
|
|
|
{
|
|
|
|
foreach (object o in members)
|
|
|
|
Append (o);
|
|
|
|
}
|
2002-02-03 03:44:10 +00:00
|
|
|
}
|
|
|
|
}
|