From 6a4b03d57f749c0ee72824efd7d1260f166cb395 Mon Sep 17 00:00:00 2001
From: Dan Winship <danw@mono-cvs.ximian.com>
Date: Thu, 8 Sep 2005 19:01:01 +0000
Subject: [PATCH] 	* gtk/Gtk.metadata: Hide Gtk.Drag.SetIconDefault. Mark
 	Gtk.TreeView.GetVisibleRect's arg as "out".

	* gtk/Drag.custom: gtk_drag_set_icon_default(ctx) should translate
	to Gtk.Drag.SetIconDefault(ctx), not Gtk.Drag.IconDefault = ctx.

	* gtk/TreeView.custom: add obsolete GetVisibleRect()

svn path=/trunk/gtk-sharp/; revision=49723
---
 ChangeLog               | 10 ++++++++++
 doc/en/Gtk/Drag.xml     | 20 +++++++++++++++++---
 doc/en/Gtk/TreeView.xml | 17 +++++++++++++++--
 gtk/Drag.custom         | 35 +++++++++++++++++++++++++++++++++++
 gtk/Gtk.metadata        |  2 ++
 gtk/Makefile.am         |  1 +
 gtk/TreeView.custom     |  5 +++++
 7 files changed, 85 insertions(+), 5 deletions(-)
 create mode 100644 gtk/Drag.custom

diff --git a/ChangeLog b/ChangeLog
index 6d8a780e4..d48e0e1c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-09-08  Dan Winship  <danw@novell.com>
+
+	* gtk/Gtk.metadata: Hide Gtk.Drag.SetIconDefault. Mark
+	Gtk.TreeView.GetVisibleRect's arg as "out".
+
+	* gtk/Drag.custom: gtk_drag_set_icon_default(ctx) should translate
+	to Gtk.Drag.SetIconDefault(ctx), not Gtk.Drag.IconDefault = ctx.
+
+	* gtk/TreeView.custom: add obsolete GetVisibleRect()
+
 2005-09-07  Mike Kestner  <mkestner@novell.com>
 
 	* bootstrap : bump version for beta2.
diff --git a/doc/en/Gtk/Drag.xml b/doc/en/Gtk/Drag.xml
index edab7087e..08600561f 100644
--- a/doc/en/Gtk/Drag.xml
+++ b/doc/en/Gtk/Drag.xml
@@ -456,6 +456,21 @@
         <remarks />
       </Docs>
     </Member>
+    <Member MemberName="SetIconDefault">
+      <MemberSignature Language="C#" Value="public static void SetIconDefault (Gdk.DragContext context);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="context" Type="Gdk.DragContext" />
+      </Parameters>
+      <Docs>
+        <summary>Sets the icon for a particular drag to the default icon.</summary>
+        <param name="context">The context of the drag (this must be called with a context for the source side of a drag).</param>
+        <remarks />
+      </Docs>
+    </Member>
     <Member MemberName="IconDefault">
       <MemberSignature Language="C#" Value="public static Gdk.DragContext IconDefault { set; };" />
       <MemberType>Property</MemberType>
@@ -465,9 +480,8 @@
       <Parameters>
       </Parameters>
       <Docs>
-        <summary>Sets the icon for a particular drag to the default icon.</summary>
-        <value>
-          <see langword="true" /> if the icon has been made the default.</value>
+        <summary>Obsolete. Replaced by <see cref="M:Gtk.Drag.SetIconDefault" /></summary>
+        <value />
         <remarks />
       </Docs>
     </Member>
diff --git a/doc/en/Gtk/TreeView.xml b/doc/en/Gtk/TreeView.xml
index 498ff4a47..f37c2acb0 100644
--- a/doc/en/Gtk/TreeView.xml
+++ b/doc/en/Gtk/TreeView.xml
@@ -376,6 +376,19 @@ For a example how to handle selection events see <see cref="T:Gtk.TreeSelection"
         <remarks>This is useful when you want to focus the attention of the user on a particular row. If <paramref name="focus_column" /> is not <see langword="null" />, then focus is given to the column specified by it. Additionally, if <paramref name="focus_column" /> is specified, and <paramref name="start_editing" /> is <see langword="true" />, then editing should be started in the specified cell. This function is often followed by <see cref="M:Gtk.Widget.GrabFocus()" /> in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.</remarks>
       </Docs>
     </Member>
+    <Member MemberName="VisibleRect">
+      <MemberSignature Language="C#" Value="public Gdk.Rectangle VisibleRect { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>Gdk.Rectangle</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>Returns the currently-visible region of the tree view, in tree view coordinates.</summary>
+        <value>a <see cref="T:Gdk.Rectangle" /></value>
+        <remarks>Convert to widget coordinates with <see cref="M:Gtk.TreeView.TreeToWidgetCoords(System.Int32,System.Int32,System.Int32,System.Int32)" />. Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire scrollable area of the tree.</remarks>
+      </Docs>
+    </Member>
     <Member MemberName="GetVisibleRect">
       <MemberSignature Language="C#" Value="public void GetVisibleRect (Gdk.Rectangle visible_rect);" />
       <MemberType>Method</MemberType>
@@ -386,9 +399,9 @@ For a example how to handle selection events see <see cref="T:Gtk.TreeSelection"
         <Parameter Name="visible_rect" Type="Gdk.Rectangle" />
       </Parameters>
       <Docs>
-        <summary>Fills <paramref name="visible_rect" /> with the currently-visible region of the buffer, in tree coordinates.</summary>
+        <summary>Obsolete (and non-functional). Replaced by <see cref="M:Gtk.TreeView.VisibleRect" />.</summary>
         <param name="visible_rect">an object of type <see cref="T:Gdk.Rectangle" /></param>
-        <remarks>Convert to widget coordinates with <see cref="M:Gtk.TreeView.TreeToWidgetCoords(System.Int32,System.Int32,System.Int32,System.Int32)" />. Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire scrollable area of the tree.</remarks>
+        <remarks />
       </Docs>
     </Member>
     <Member MemberName="InsertColumn">
diff --git a/gtk/Drag.custom b/gtk/Drag.custom
new file mode 100644
index 000000000..190a71c40
--- /dev/null
+++ b/gtk/Drag.custom
@@ -0,0 +1,35 @@
+// Drag.custom - Gtk.Drag class customizations
+//
+// 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("libgtk-win32-2.0-0.dll")]
+		static extern void gtk_drag_set_icon_default(IntPtr context);
+
+		public static void SetIconDefault(Gdk.DragContext context)
+		{
+			gtk_drag_set_icon_default(context == null ? IntPtr.Zero : context.Handle);
+		}
+
+		[Obsolete("Replaced by SetIconDefault(ctx)")]
+		public static Gdk.DragContext IconDefault { 
+			set {
+				gtk_drag_set_icon_default(value == null ? IntPtr.Zero : value.Handle);
+			}
+		}
+
diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata
index 2ffc1469c..43a1e8657 100644
--- a/gtk/Gtk.metadata
+++ b/gtk/Gtk.metadata
@@ -51,6 +51,7 @@
   <attr path="/api/namespace/class[@cname='GtkBindings_']/method[@name='Activate']" name="name">BindingsActivate</attr>
   <attr path="/api/namespace/class[@cname='GtkCtree_']" name="hidden">1</attr>
   <attr path="/api/namespace/class[@cname='GtkDrag_']/method[@name='DestSet']/*/*[@name='targets']" name="array">1</attr>
+  <attr path="/api/namespace/class[@cname='GtkDrag_']/method[@name='SetIconDefault']" name="hidden">1</attr>
   <attr path="/api/namespace/class[@cname='GtkDrag_']/method[@name='SourceSet']/*/*[@name='targets']" name="array">1</attr>
   <attr path="/api/namespace/class[@cname='GtkFile_']" name="hidden">1</attr>
   <attr path="/api/namespace/class[@cname='GtkGlobal']/method[@name='EventsPending']/return-type" name="type">gboolean</attr>
@@ -562,6 +563,7 @@
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='GetDragDestRow']/*/*[@name='pos']" name="pass_as">out</attr>
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='GetBackgroundArea']/*/*[@name='rect']" name="pass_as">out</attr>
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='GetPathAtPos']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='GetVisibleRect']/*/*[@name='visible_rect']" name="pass_as">out</attr>
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='InsertColumnWithAttributes']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='InsertColumnWithDataFunc']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='MapExpandedRows']/*/*[@name='func']" name="scope">call</attr>
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index d518edcae..95a3763f2 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -51,6 +51,7 @@ customs = 				\
 	ComboBoxEntry.custom		\
 	Container.custom		\
 	Dialog.custom			\
+	Drag.custom			\
 	Entry.custom			\
 	EntryCompletion.custom		\
 	FileChooser.custom		\
diff --git a/gtk/TreeView.custom b/gtk/TreeView.custom
index 0e3c817ac..ca998f368 100644
--- a/gtk/TreeView.custom
+++ b/gtk/TreeView.custom
@@ -179,3 +179,8 @@
 		{
 			ColumnDragFunction = func;
 		}
+
+		[Obsolete ("Replaced by VisibleRect property.")]
+		public void GetVisibleRect(Gdk.Rectangle visible_rect) {
+			;
+		}