2012-08-05 16:32:41 +02:00
|
|
|
// TreeSelection.cs - customizations to Gtk.TreeSelection
|
2004-02-11 22:34:32 +01:00
|
|
|
//
|
|
|
|
// Authors: Mike Kestner <mkestner@ximian.com>
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004 Novell, Inc.
|
2004-06-25 20:42:19 +02:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2012-08-05 16:32:41 +02:00
|
|
|
namespace Gtk {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
public partial class TreeSelection {
|
2019-10-02 17:28:33 +02:00
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
2018-01-17 21:31:39 +01:00
|
|
|
delegate IntPtr d_gtk_tree_selection_get_selected_rows2(IntPtr raw, IntPtr model);
|
2018-01-18 22:54:45 +01:00
|
|
|
static d_gtk_tree_selection_get_selected_rows2 gtk_tree_selection_get_selected_rows2 = FuncLoader.LoadFunction<d_gtk_tree_selection_get_selected_rows2>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_tree_selection_get_selected_rows"));
|
2005-01-27 17:56:54 +01:00
|
|
|
|
|
|
|
public TreePath[] GetSelectedRows ()
|
|
|
|
{
|
2018-01-17 21:31:39 +01:00
|
|
|
IntPtr list_ptr = gtk_tree_selection_get_selected_rows2 (Handle, IntPtr.Zero);
|
2005-01-27 17:56:54 +01:00
|
|
|
if (list_ptr == IntPtr.Zero)
|
|
|
|
return new TreePath [0];
|
|
|
|
|
|
|
|
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath));
|
2008-06-28 19:06:06 +02:00
|
|
|
return (TreePath[]) GLib.Marshaller.ListToArray (list, typeof (Gtk.TreePath));
|
2005-01-27 17:56:54 +01:00
|
|
|
}
|
2019-10-02 17:28:33 +02:00
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
2018-01-19 01:29:05 +01:00
|
|
|
delegate bool d_gtk_tree_selection_get_selected2(IntPtr raw, IntPtr model, out Gtk.TreeIter iter);
|
|
|
|
static d_gtk_tree_selection_get_selected2 gtk_tree_selection_get_selected2 = FuncLoader.LoadFunction<d_gtk_tree_selection_get_selected2>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_tree_selection_get_selected"));
|
2005-07-20 19:08:28 +02:00
|
|
|
|
|
|
|
public bool GetSelected (out Gtk.TreeIter iter)
|
|
|
|
{
|
2018-01-19 01:29:05 +01:00
|
|
|
return gtk_tree_selection_get_selected2 (Handle, IntPtr.Zero, out iter);
|
2005-07-20 19:08:28 +02:00
|
|
|
}
|
2012-08-05 16:32:41 +02:00
|
|
|
}
|
|
|
|
}
|
2019-10-02 17:28:33 +02:00
|
|
|
|