mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-23 13:21:07 +00:00
2005-06-08 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : don't write a sem in FromNative. * glib/ListBase.cs : handle GLib.Object explicit element types. * glib/Marshaler.cs : only copy lists if Count > 0. * gtk/Gtk.metadata : unhide Window.ListToplevels with a proper element type for automatic list to array marshaling. * gtk/Window.custom : kill manual ListToplevels impl. svn path=/trunk/gtk-sharp/; revision=45654
This commit is contained in:
parent
a307c78232
commit
e24d72317a
|
@ -1,3 +1,12 @@
|
||||||
|
2005-06-08 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* generator/ReturnValue.cs : don't write a sem in FromNative.
|
||||||
|
* glib/ListBase.cs : handle GLib.Object explicit element types.
|
||||||
|
* glib/Marshaler.cs : only copy lists if Count > 0.
|
||||||
|
* gtk/Gtk.metadata : unhide Window.ListToplevels with a proper element
|
||||||
|
type for automatic list to array marshaling.
|
||||||
|
* gtk/Window.custom : kill manual ListToplevels impl.
|
||||||
|
|
||||||
2005-06-08 Mike Kestner <mkestner@novell.com>
|
2005-06-08 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* generator/ReturnValue.cs : improved list to array marshaling.
|
* generator/ReturnValue.cs : improved list to array marshaling.
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace GtkSharp.Generation {
|
||||||
var += ", true";
|
var += ", true";
|
||||||
else if (ElementType != String.Empty) {
|
else if (ElementType != String.Empty) {
|
||||||
string type_str = "typeof (" + ElementType + ")";
|
string type_str = "typeof (" + ElementType + ")";
|
||||||
return String.Format ("({0}[]) GLib.Marshaller.ListToArray ({1}, {2});", ElementType, IGen.FromNativeReturn (var + ", " + type_str), type_str);
|
return String.Format ("({0}[]) GLib.Marshaller.ListToArray ({1}, {2})", ElementType, IGen.FromNativeReturn (var + ", " + type_str), type_str);
|
||||||
}
|
}
|
||||||
return IGen.FromNativeReturn (var);
|
return IGen.FromNativeReturn (var);
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,8 @@ namespace GLib {
|
||||||
ret = Marshaller.Utf8PtrToString (data);
|
ret = Marshaller.Utf8PtrToString (data);
|
||||||
else if (element_type == typeof (FilenameString))
|
else if (element_type == typeof (FilenameString))
|
||||||
ret = Marshaller.FilenamePtrToString (data);
|
ret = Marshaller.FilenamePtrToString (data);
|
||||||
|
else if (element_type.IsSubclassOf (typeof (GLib.Object)))
|
||||||
|
ret = GLib.Object.GetObject (data, false);
|
||||||
else if (element_type == typeof (int))
|
else if (element_type == typeof (int))
|
||||||
ret = (int) data;
|
ret = (int) data;
|
||||||
else if (element_type.IsValueType)
|
else if (element_type.IsValueType)
|
||||||
|
|
|
@ -282,7 +282,8 @@ namespace GLib {
|
||||||
public static Array ListToArray (ListBase list, System.Type type)
|
public static Array ListToArray (ListBase list, System.Type type)
|
||||||
{
|
{
|
||||||
Array result = Array.CreateInstance (type, list.Count);
|
Array result = Array.CreateInstance (type, list.Count);
|
||||||
list.CopyTo (result, 0);
|
if (list.Count > 0)
|
||||||
|
list.CopyTo (result, 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,7 +549,7 @@
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='GetSize']/*/*[@type='gint*']" name="pass_as">out</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='GetSize']/*/*[@type='gint*']" name="pass_as">out</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='HasToplevelFocus']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='HasToplevelFocus']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='IsActive']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='IsActive']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="element_type">Gtk.Window</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetDefaultIconList']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetDefaultIconList']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetIconList']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetIconList']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@cname='GtkWindow']/property[@name='Screen']" name="new_flag">1</attr>
|
<attr path="/api/namespace/object[@cname='GtkWindow']/property[@name='Screen']" name="new_flag">1</attr>
|
||||||
|
|
|
@ -76,22 +76,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
||||||
static extern IntPtr gtk_window_list_toplevels();
|
|
||||||
|
|
||||||
public static Window[] ListToplevels ()
|
|
||||||
{
|
|
||||||
IntPtr raw_ret = gtk_window_list_toplevels();
|
|
||||||
if (raw_ret == IntPtr.Zero)
|
|
||||||
return new Window [0];
|
|
||||||
|
|
||||||
GLib.List list = new GLib.List(raw_ret);
|
|
||||||
Window[] result = new Window [list.Count];
|
|
||||||
for (int i = 0; i < list.Count; i++)
|
|
||||||
result [i] = list [i] as Window;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Gdk.Size DefaultSize {
|
public Gdk.Size DefaultSize {
|
||||||
get {
|
get {
|
||||||
return new Gdk.Size (DefaultWidth, DefaultHeight);
|
return new Gdk.Size (DefaultWidth, DefaultHeight);
|
||||||
|
|
Loading…
Reference in a new issue