2003-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* gtk/TreeView.custom:
	(GetPathAtPos): added 3 overloads of this method so that the caller
	does not need to create extra variables that may not use.

	* api/gtk-api.xml:
	* sources/Gtk.metadata: added pass_out attribute for tx and ty
	arguments of TreeView::WidgetToTreeCoords. Hide TreeView::GetPathAtPos.

svn path=/trunk/gtk-sharp/; revision=13677
This commit is contained in:
Gonzalo Paniagua Javier 2003-04-16 02:26:12 +00:00
parent de7ee8c896
commit b5cfb4ba67
4 changed files with 110 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2003-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* gtk/TreeView.custom:
(GetPathAtPos): added 3 overloads of this method so that the caller
does not need to create extra variables that may not use.
* api/gtk-api.xml:
* sources/Gtk.metadata: added pass_out attribute for tx and ty
arguments of TreeView::WidgetToTreeCoords. Hide TreeView::GetPathAtPos.
2003-04-14 Lee Mallabone <gnome@fonicmonkey.net>
* api/gtk-api.xml, sources/Gtk.metadata, gtk/ColorSelection.custom:

View file

@ -8166,7 +8166,7 @@
<method name="GetModel" cname="gtk_tree_view_get_model">
<return-type type="GtkTreeModel*"/>
</method>
<method name="GetPathAtPos" cname="gtk_tree_view_get_path_at_pos">
<method name="GetPathAtPos" cname="gtk_tree_view_get_path_at_pos" hidden="1">
<return-type type="gboolean"/>
<parameters>
<parameter type="gint" name="x"/>
@ -8409,8 +8409,8 @@
<parameters>
<parameter type="gint" name="wx"/>
<parameter type="gint" name="wy"/>
<parameter type="gint*" name="tx"/>
<parameter type="gint*" name="ty"/>
<parameter type="gint*" name="tx" pass_as="out"/>
<parameter type="gint*" name="ty" pass_as="out"/>
</parameters>
</method>
</object>

View file

@ -1,8 +1,11 @@
// Gtk.TreeView.Custom - Gtk TreeView class customizations
//
// Author: Kristian Rietveld <kris@gtk.org>
// Authors:
// Kristian Rietveld <kris@gtk.org>
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (c) 2002 Kristian Rietveld
// (c) 2003 Ximian, Inc. (http://www.ximian.com)
//
// This code is inserted after the automatically generated code.
@ -27,3 +30,68 @@
gtk_tree_view_set_model (Handle, value.Handle);
}
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern bool gtk_tree_view_get_path_at_pos (IntPtr raw,
int x,
int y,
out IntPtr path,
IntPtr column,
out int cell_x,
out int cell_y);
[DllImport("libgtk-win32-2.0-0.dll", EntryPoint="gtk_tree_view_get_path_at_pos")]
static extern bool gtk_tree_view_get_path_at_pos_intptr (IntPtr raw,
int x,
int y,
out IntPtr path,
IntPtr column,
IntPtr cell_x,
IntPtr cell_y);
public bool GetPathAtPos (int x, int y, out Gtk.TreePath path, Gtk.TreeViewColumn column, out int cell_x, out int cell_y)
{
IntPtr col;
if (column == null)
col = IntPtr.Zero;
else
col = column.Handle;
IntPtr pathHandle;
bool raw_ret = gtk_tree_view_get_path_at_pos (Handle, x, y, out pathHandle, col, out cell_x, out cell_y);
if (raw_ret)
path = new TreePath (pathHandle);
else
path = null;
return raw_ret;
}
public bool GetPathAtPos (int x, int y, out Gtk.TreePath path)
{
IntPtr pathHandle;
bool raw_ret = gtk_tree_view_get_path_at_pos_intptr (Handle, x, y, out pathHandle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
if (raw_ret)
path = new TreePath (pathHandle);
else
path = null;
return raw_ret;
}
public bool GetPathAtPos (int x, int y, out Gtk.TreePath path, Gtk.TreeViewColumn column)
{
if (column == null)
return GetPathAtPos (x, y, out path);
IntPtr pathHandle;
bool raw_ret = gtk_tree_view_get_path_at_pos_intptr (Handle, x, y, out pathHandle, column.Handle, IntPtr.Zero, IntPtr.Zero);
if (raw_ret)
path = new TreePath (pathHandle);
else
path = null;
return raw_ret;
}

View file

@ -377,7 +377,23 @@
</attribute>
</data>
</rule>
<rule>
<class name="GtkTreeView">
<method>WidgetToTreeCoords</method>
</class>
<data>
<attribute target="param">
<filter level="name">tx</filter>
<name>pass_as</name>
<value>out</value>
</attribute>
<attribute target="param">
<filter level="name">ty</filter>
<name>pass_as</name>
<value>out</value>
</attribute>
</data>
</rule>
<!-- variable arguments -->
<rule>
@ -1651,6 +1667,17 @@
</attribute>
</data>
</rule>
<rule>
<class name="GtkTreeView">
<method>GetPathAtPos</method>
</class>
<data>
<attribute target="method">
<name>hidden</name>
<value>1</value>
</attribute>
</data>
</rule>
<!-- overloads -->
<rule>