2005-01-17 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata : hide Stock. * gtk/Makefile.am : add new file. * gtk/StockManager.cs : stock item management methods. svn path=/trunk/gtk-sharp/; revision=39068
This commit is contained in:
parent
7a30d17a4d
commit
41982e431d
5 changed files with 195 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-01-17 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Gtk.metadata : hide Stock.
|
||||
* gtk/Makefile.am : add new file.
|
||||
* gtk/StockManager.cs : stock item management methods.
|
||||
|
||||
2005-01-14 Dan Winship <danw@novell.com>
|
||||
|
||||
* glib/Object.cs (ConnectDefaultHandlers): Don't call a signal's
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
freed.
|
||||
</summary>
|
||||
<param name="items">an array of <see cref="T:Gtk.StockItem" /></param>
|
||||
<remarks></remarks>
|
||||
<remarks>
|
||||
</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName=".ctor">
|
||||
|
@ -51,5 +52,90 @@
|
|||
<remarks>Do not use</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="AddStatic">
|
||||
<MemberSignature Language="C#" Value="public static void AddStatic (Gtk.StockItem items, uint n_items);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="items" Type="Gtk.StockItem" />
|
||||
<Parameter Name="n_items" Type="System.UInt32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Obsolete, do not use.</summary>
|
||||
<param name="items">a <see cref="T:Gtk.StockItem" /></param>
|
||||
<param name="n_items">a <see cref="T:System.UInt32" /></param>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Lookup">
|
||||
<MemberSignature Language="C#" Value="public static bool Lookup (string stock_id, ref Gtk.StockItem item);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="stock_id" Type="System.String" />
|
||||
<Parameter Name="item" Type="Gtk.StockItem&" RefType="ref" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Finds a stock item by stock_id.</summary>
|
||||
<param name="stock_id">a <see cref="T:System.String" /></param>
|
||||
<param name="item">a <see cref="T:Gtk.StockItem" /></param>
|
||||
<returns>a <see cref="T:System.Boolean" /></returns>
|
||||
<remarks>See also <see cref="M:Gtk.StockManager.LookupItem" /></remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="LookupItem">
|
||||
<MemberSignature Language="C#" Value="public static bool LookupItem (string stock_id, out Gtk.StockItem item);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="stock_id" Type="System.String" />
|
||||
<Parameter Name="item" Type="Gtk.StockItem&" RefType="out" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Finds a stock item by stock_id.</summary>
|
||||
<param name="stock_id">a <see cref="T:System.String" /></param>
|
||||
<param name="item">a <see cref="T:Gtk.StockItem" /></param>
|
||||
<returns>a <see cref="T:System.Boolean" /></returns>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Add">
|
||||
<MemberSignature Language="C#" Value="public static void Add (Gtk.StockItem items, uint n_items);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="items" Type="Gtk.StockItem" />
|
||||
<Parameter Name="n_items" Type="System.UInt32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Adds a stock item.</summary>
|
||||
<param name="items">a <see cref="T:Gtk.StockItem" /></param>
|
||||
<param name="n_items">a <see cref="T:System.UInt32" /></param>
|
||||
<remarks>This signature is obsolete, but preserved for backward compatibility. Use the single parameter overload for new code.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Add">
|
||||
<MemberSignature Language="C#" Value="public static void Add (Gtk.StockItem item);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="item" Type="Gtk.StockItem" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>Adds a stock item.</summary>
|
||||
<param name="item">a <see cref="T:Gtk.StockItem" /></param>
|
||||
<remarks />
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
||||
</Type>
|
||||
|
|
|
@ -52,11 +52,7 @@
|
|||
<attr path="/api/namespace/class[@cname='GtkInit_']/method[@name='CheckAbiCheck']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkInit_']/method[@name='AbiCheck']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkSignal_']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']" name="name">StockManager</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']/method[@name='Add']/*/*[@name='items']" name="array">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']/method[@name='AddStatic']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']/method[@name='ListIds']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']/method[@name='Lookup']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkTree_']/method[@name='GetRowDragData']/*/*[@name='tree_model']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkTree_']/method[@name='GetRowDragData']/*/*[@name='path']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkType_']" name="hidden">1</attr>
|
||||
|
|
|
@ -20,6 +20,7 @@ sources = \
|
|||
NodeStore.cs \
|
||||
NodeView.cs \
|
||||
RadioActionEntry.cs \
|
||||
StockManager.cs \
|
||||
ThreadNotify.cs \
|
||||
ToggleActionEntry.cs \
|
||||
TreeNodeAttribute.cs \
|
||||
|
|
99
gtk/StockManager.cs
Normal file
99
gtk/StockManager.cs
Normal file
|
@ -0,0 +1,99 @@
|
|||
// StockManager.cs - Gtk.Stock item manager
|
||||
//
|
||||
// Authors: Mike Kestner <mkestner@ximian.com>
|
||||
//
|
||||
// Copyright (c) 2005 Novell, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
|
||||
namespace Gtk {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class StockManager {
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern void gtk_stock_add_static(ref Gtk.StockItem items, uint n_items);
|
||||
|
||||
[Obsolete ("Use StockManager.Add instead")]
|
||||
public static void AddStatic(Gtk.StockItem items, uint n_items)
|
||||
{
|
||||
gtk_stock_add_static(ref items, n_items);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct ConstStockItem {
|
||||
public IntPtr StockId;
|
||||
public IntPtr Label;
|
||||
public Gdk.ModifierType Modifier;
|
||||
public uint Keyval;
|
||||
public IntPtr TranslationDomain;
|
||||
|
||||
public static explicit operator StockItem (ConstStockItem csi)
|
||||
{
|
||||
Gtk.StockItem item = new Gtk.StockItem ();
|
||||
item.StockId = Marshal.PtrToStringAnsi (csi.StockId);
|
||||
item.Label = Marshal.PtrToStringAnsi (csi.Label);
|
||||
item.Modifier = csi.Modifier;
|
||||
item.Keyval = csi.Keyval;
|
||||
item.TranslationDomain = Marshal.PtrToStringAnsi (csi.TranslationDomain);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern bool gtk_stock_lookup (string stock_id, out ConstStockItem item);
|
||||
|
||||
public static bool Lookup (string stock_id, ref Gtk.StockItem item)
|
||||
{
|
||||
ConstStockItem const_item;
|
||||
if (!gtk_stock_lookup (stock_id, out const_item))
|
||||
return false;
|
||||
item = (StockItem) const_item;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool LookupItem (string stock_id, out Gtk.StockItem item)
|
||||
{
|
||||
item = StockItem.Zero;
|
||||
return Lookup (stock_id, ref item);
|
||||
}
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern void gtk_stock_add(ref Gtk.StockItem item, uint n_items);
|
||||
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern void gtk_stock_add(Gtk.StockItem[] items, uint n_items);
|
||||
|
||||
[Obsolete ("Use the StockItem or StockItem[] overload instead.")]
|
||||
public static void Add (Gtk.StockItem items, uint n_items)
|
||||
{
|
||||
gtk_stock_add(ref items, n_items);
|
||||
}
|
||||
|
||||
public static void Add (Gtk.StockItem item)
|
||||
{
|
||||
gtk_stock_add (ref item, 1);
|
||||
}
|
||||
|
||||
public static void Add (Gtk.StockItem[] items)
|
||||
{
|
||||
gtk_stock_add (items, (uint) items.Length);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue