2005-05-11 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata : hide IconTheme.GetIconSizes. * gtk/IconTheme.custom : implement GetIconSizes because of its zero terminated array return value. 2.6 only. [Fixes #74844] svn path=/trunk/gtk-sharp/; revision=44414
This commit is contained in:
parent
07df433712
commit
ef52ff2b33
4 changed files with 36 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-05-11 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Gtk.metadata : hide IconTheme.GetIconSizes.
|
||||
* gtk/IconTheme.custom : implement GetIconSizes because of its zero
|
||||
terminated array return value. 2.6 only. [Fixes #74844]
|
||||
|
||||
2005-05-11 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* pango/Makefile.am : add file.
|
||||
|
|
|
@ -404,20 +404,20 @@ In general, if you use <see cref="M:Gtk.IconTheme.AddBuiltinIcon()" /> you shoul
|
|||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIconSizes">
|
||||
<MemberSignature Language="C#" Value="public int GetIconSizes (string icon_name);" />
|
||||
<MemberSignature Language="C#" Value="public int [] GetIconSizes (string icon_name);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Int32</ReturnType>
|
||||
<ReturnType>System.Int32[]</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="icon_name" Type="System.String" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<summary>Gets a list of the sizes for an Icon by name.</summary>
|
||||
<param name="icon_name">a <see cref="T:System.String" /></param>
|
||||
<returns>a <see cref="T:System.Int32" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
<returns>a <see cref="T:System.Int32[]" /></returns>
|
||||
<remarks>An entry of -1 indicates a scalable version of the icon.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
||||
</Type>
|
||||
|
|
|
@ -214,6 +214,7 @@
|
|||
<attr path="/api/namespace/object[@cname='GtkFrame']/method[@name='SetLabelAlign']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkHandleBox']/property[@name='ShadowType']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkHScale']/constructor[@cname='gtk_hscale_new_with_range']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='GetIconSizes']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='GetSearchPath']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='ListIcons']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='SetSearchPath']" name="hidden">1</attr>
|
||||
|
|
|
@ -85,3 +85,26 @@
|
|||
{
|
||||
SearchPath = path;
|
||||
}
|
||||
|
||||
#if GTK_SHARP_2_6
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern IntPtr gtk_icon_theme_get_icon_sizes (IntPtr raw, IntPtr icon_name);
|
||||
|
||||
public int[] GetIconSizes (string icon_name)
|
||||
{
|
||||
IntPtr icon_name_as_native = GLib.Marshaller.StringToPtrGStrdup (icon_name);
|
||||
IntPtr raw_ret = gtk_icon_theme_get_icon_sizes(Handle, icon_name_as_native);
|
||||
ArrayList result = new ArrayList ();
|
||||
int offset = 0;
|
||||
int size = Marshal.ReadInt32 (raw_ret, offset);
|
||||
while (size != 0) {
|
||||
result.Add (size);
|
||||
offset += 4;
|
||||
size = Marshal.ReadInt32 (raw_ret, offset);
|
||||
}
|
||||
GLib.Marshaller.Free (icon_name_as_native);
|
||||
GLib.Marshaller.Free (raw_ret);
|
||||
return (int[]) result.ToArray (typeof (int));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue