diff --git a/ChangeLog b/ChangeLog index 639e8fd79..51d2a56e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-25 Ankit Jain + + * gdk/Gdk.metadata : hide Property.Get for manual impl. + * gdk/Property.custom : manually marshal the data param in Get. + 2007-06-19 Mike Kestner * gdk/Property.custom : obsolete compat overload for Change(). diff --git a/gdk/Gdk.metadata b/gdk/Gdk.metadata index e69cf0242..462b36f1d 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -33,9 +33,7 @@ 1 PangoHelper 1 - out - out - 1 + 1 1 1 ref diff --git a/gdk/Property.custom b/gdk/Property.custom index 1dbaa8564..5b8400361 100644 --- a/gdk/Property.custom +++ b/gdk/Property.custom @@ -29,3 +29,22 @@ return data; } + [DllImport("libgdk-win32-2.0-0.dll")] + static extern bool gdk_property_get(IntPtr window, IntPtr property, IntPtr type, UIntPtr offset, UIntPtr length, int pdelete, out IntPtr actual_property_type, out int actual_format, out int actual_length, out IntPtr data); + + public static bool Get(Gdk.Window window, Gdk.Atom property, Gdk.Atom type, ulong offset, ulong length, int pdelete, out Gdk.Atom actual_property_type, out int actual_format, out int actual_length, out byte[] data) { + IntPtr actual_property_type_as_native; + IntPtr actual_data; + bool raw_ret = gdk_property_get(window == null ? IntPtr.Zero : window.Handle, property == null ? IntPtr.Zero : property.Handle, type == null ? IntPtr.Zero : type.Handle, new UIntPtr (offset), new UIntPtr (length), pdelete, out actual_property_type_as_native, out actual_format, out actual_length, out actual_data); + data = null; + if (raw_ret) { + data = new byte [actual_length]; + Marshal.Copy (actual_data, data, 0, actual_length); + GLib.Marshaller.Free (actual_data); + } + + bool ret = raw_ret; + actual_property_type = actual_property_type_as_native == IntPtr.Zero ? null : (Gdk.Atom) GLib.Opaque.GetOpaque (actual_property_type_as_native, typeof (Gdk.Atom), false); + return ret; + } +