2009-09-16 Mike Kestner <mkestner@novell.com>

* gtk/Gtk.metadata: hide StatusIcon.GetGeometry for custom impl.
	* gtk/StatusIcon.custom: custom GetGeometry implementation to avoid
	marshaling exceptions on win32.  [Fixes #518169]

svn path=/trunk/gtk-sharp/; revision=142087
This commit is contained in:
Mike Kestner 2009-09-17 00:54:38 +00:00
parent 8c9e862d70
commit e50ee63f0d
3 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2009-09-16 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata: hide StatusIcon.GetGeometry for custom impl.
* gtk/StatusIcon.custom: custom GetGeometry implementation to avoid
marshaling exceptions on win32. [Fixes #518169]
2009-09-11 Mike Kestner <mkestner@novell.com>
* glib/Object.cs: add support for native instantiation of

View file

@ -592,8 +592,7 @@
<attr path="/api/namespace/object[@cname='GtkSizeGroup']/method[@name='GetWidgets']/return-type" name="element_type">GtkWidget*</attr>
<attr path="/api/namespace/object[@cname='GtkSpinButton']/constructor[@cname='gtk_spin_button_new_with_range']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkSpinButton']/signal[@name='Output']" name="manual">true</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='GetGeometry']/*/*[@name='screen']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='GetGeometry']/*/*[@name='area']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='GetGeometry']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='SetFromStock']" name="name">SetStock</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='SetFromPixbuf']" name="name">SetPixbuf</attr>
<attr path="/api/namespace/object[@cname='GtkStatusIcon']/method[@name='SetFromIconName']" name="name">SetIconName</attr>

View file

@ -77,4 +77,25 @@
}
}
[DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_status_icon_get_geometry(IntPtr raw, out IntPtr screen, IntPtr area, out int orientation);
public bool GetGeometry(out Gdk.Screen screen, out Gdk.Rectangle area, out Gtk.Orientation orientation)
{
IntPtr native_screen;
IntPtr native_area = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gdk.Rectangle)));
int native_orientation;
bool ret = gtk_status_icon_get_geometry(Handle, out native_screen, native_area, out native_orientation);
if (ret) {
screen = GLib.Object.GetObject(native_screen) as Gdk.Screen;
area = Gdk.Rectangle.New (native_area);
orientation = (Gtk.Orientation) native_orientation;
} else {
screen = null;
area = Gdk.Rectangle.Zero;
orientation = Gtk.Orientation.Horizontal;
}
Marshal.FreeHGlobal (native_area);
return ret;
}