diff --git a/ChangeLog b/ChangeLog index 2d2fca47d..750aa4dca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-04-01 Joshua Tauberer + + * gdk/Gdk.metadata : hide Region.GetRectangles + * gdk/Region.custom : implement Rectangles prop [fixes #55811] + 2004-04-01 Mike Kestner * glib/Value.cs : NULL check for g_value_get_string Thanks to Jeroen diff --git a/gdk/Gdk.metadata b/gdk/Gdk.metadata index bbc84aadc..8ecd4cb26 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -1,90 +1,91 @@ - 1 - 1 - 1 - gboolean - ref - 1 - 1 - 1 - EventHelper - 1 - 1 - PangoHelper - 1 - 1 - 1 - GdkDrawable - ref - 1 - 1 - ref - 1 - 1 - 1 - 1 - 1 - out - 1 - 1 - 1 - 1 - 1 - 1 - libgdk-win32-2.0-0.dll - 1 - libgdk-win32-2.0-0.dll - 1 - libgdk-win32-2.0-0.dll - libgdk-win32-2.0-0.dll - libgdk-win32-2.0-0.dll - libgdk-win32-2.0-0.dll - libgdk-win32-2.0-0.dll - 1 - 1 - 1 - GdkDrawable - 1 - out - 1 - 1 - 1 - 1 - 1 - 1 - 1 - GdkDrawable - out - out - out - out - out - 1 - 1 + 1 + 1 + 1 + gboolean + ref + 1 + 1 + 1 + EventHelper + 1 + 1 + PangoHelper + 1 + 1 + 1 + GdkDrawable + ref + 1 + 1 + ref + 1 + 1 + 1 + 1 + 1 + out + 1 + 1 + 1 + 1 + 1 + 1 + libgdk-win32-2.0-0.dll + 1 + libgdk-win32-2.0-0.dll + 1 + libgdk-win32-2.0-0.dll + libgdk-win32-2.0-0.dll + libgdk-win32-2.0-0.dll + libgdk-win32-2.0-0.dll + libgdk-win32-2.0-0.dll + 1 + 1 + 1 + GdkDrawable + 1 + out + 1 + 1 + 1 + 1 + 1 + 1 + 1 + GdkDrawable + out + out + out + out + out + 1 + 1 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 128 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 128 + 1 diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 9d38737b1..81b7b1ed3 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -50,6 +50,7 @@ customs = \ PixbufLoader.custom \ Point.custom \ Rectangle.custom \ + Region.custom \ Screen.custom \ Selection.custom \ Window.custom diff --git a/gdk/Region.custom b/gdk/Region.custom new file mode 100644 index 000000000..af7048d0c --- /dev/null +++ b/gdk/Region.custom @@ -0,0 +1,33 @@ +// Gdk.Region.custom - Gdk Region class customizations +// +// Author: Joshua Tauberer +// +// (c) 2004 Joshua Tauberer +// +// This code is inserted after the automatically generated code. + +[DllImport("libglib-2.0-0.dll")] +static extern void g_free (IntPtr mem); + +[DllImport("libgdk-win32-2.0-0.dll")] +static extern void gdk_region_get_rectangles(IntPtr raw, out IntPtr rectangles, out int n_rectangles); + +public Rectangle[] GetRectangles () +{ + int n; + IntPtr rectangles; + gdk_region_get_rectangles(Handle, out rectangles, out n); + + Rectangle[] ret = new Rectangle[n]; + int step = Marshal.SizeOf(typeof(Rectangle)); + int ptr = (int)rectangles; + for (int i = 0; i < n; i++) { + ret[i] = (Rectangle)Marshal.PtrToStructure((IntPtr)ptr, typeof(Rectangle)); + ptr += step; + } + + g_free(rectangles); + + return ret; +} +