From d54f9804945d37715a2fa4447ce27a4defb34bd5 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 12 Feb 2004 18:45:19 +0000 Subject: [PATCH] 2004-02-12 Mike Kestner * gdk/Gdk.metadata : hide the GList API * gdk/*.custom : manually wrap GList api using typed arrays * gdk/gdk-api.xml : regen. svn path=/trunk/gtk-sharp/; revision=23035 --- ChangeLog | 6 ++++++ gdk/Display.custom | 21 +++++++++++++++++++++ gdk/Gdk.metadata | 10 ++++++++++ gdk/Global.custom | 36 ++++++++++++++++++++++++++++++++++++ gdk/Screen.custom | 38 ++++++++++++++++++++++++++++++++++++++ gdk/Window.custom | 46 ++++++++++++++++++++++++++++++++++++++++++++++ gdk/gdk-api.xml | 20 ++++++++++---------- 7 files changed, 167 insertions(+), 10 deletions(-) create mode 100644 gdk/Display.custom create mode 100644 gdk/Global.custom create mode 100644 gdk/Screen.custom diff --git a/ChangeLog b/ChangeLog index 50377646c..90dc97e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-02-12 Mike Kestner + + * gdk/Gdk.metadata : hide the GList API + * gdk/*.custom : manually wrap GList api using typed arrays + * gdk/gdk-api.xml : regen. + 2004-02-12 Mike Kestner * gdk/Gdk.metadata : hide the GSList API diff --git a/gdk/Display.custom b/gdk/Display.custom new file mode 100644 index 000000000..97d299d2a --- /dev/null +++ b/gdk/Display.custom @@ -0,0 +1,21 @@ +// Display.custom - customizations to Gdk.Display +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_display_list_devices (IntPtr raw); + + public Device[] ListDevices () + { + IntPtr raw_ret = gdk_display_list_devices (Handle); + if (raw_ret == IntPtr.Zero) + return new Device [0]; + GLib.List list = new GLib.List(raw_ret); + Device[] result = new Device [list.Count]; + for (int i = 0; i < list.Count; i++) + result [i] = list [i] as Device; + return result; + } + diff --git a/gdk/Gdk.metadata b/gdk/Gdk.metadata index 104d06c88..c3ac25179 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -7,7 +7,10 @@ ref 1 1 + 1 EventHelper + 1 + 1 PangoHelper 1 1 @@ -18,6 +21,7 @@ 1 ref 1 + 1 1 1 1 @@ -42,16 +46,22 @@ 1 GdkDrawable 1 + 1 1 1 + 1 1 1 + 1 GdkDrawable out out out out out + 1 + 1 + 1 1 128 1 diff --git a/gdk/Global.custom b/gdk/Global.custom new file mode 100644 index 000000000..b1d3b54fa --- /dev/null +++ b/gdk/Global.custom @@ -0,0 +1,36 @@ +// Global.custom - customizations to Gdk.Global +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_devices_list (); + + public static Device[] DevicesList () + { + IntPtr raw_ret = gdk_devices_list (); + if (raw_ret == IntPtr.Zero) + return new Device [0]; + GLib.List list = new GLib.List(raw_ret); + Device[] result = new Device [list.Count]; + for (int i = 0; i < list.Count; i++) + result [i] = list [i] as Device; + return result; + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_list_visuals (); + + public static Visual[] ListVisuals () + { + IntPtr raw_ret = gdk_list_visuals (); + if (raw_ret == IntPtr.Zero) + return new Visual [0]; + GLib.List list = new GLib.List(raw_ret); + Visual[] result = new Visual [list.Count]; + for (int i = 0; i < list.Count; i++) + result [i] = list [i] as Visual; + return result; + } + diff --git a/gdk/Screen.custom b/gdk/Screen.custom new file mode 100644 index 000000000..e5ae3eb87 --- /dev/null +++ b/gdk/Screen.custom @@ -0,0 +1,38 @@ +// Screen.custom - customizations to Gdk.Screen +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_screen_get_toplevel_windows (IntPtr raw); + + public Window[] ToplevelWindows + { + get { + IntPtr raw_ret = gdk_screen_get_toplevel_windows (Handle); + 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; + } + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_screen_list_visuals (IntPtr raw); + + public Visual[] ListVisuals () + { + IntPtr raw_ret = gdk_screen_list_visuals (Handle); + if (raw_ret == IntPtr.Zero) + return new Visual [0]; + GLib.List list = new GLib.List(raw_ret); + Visual[] result = new Visual [list.Count]; + for (int i = 0; i < list.Count; i++) + result [i] = list [i] as Visual; + return result; + } + diff --git a/gdk/Window.custom b/gdk/Window.custom index 07d6bd3be..ae0d805bf 100644 --- a/gdk/Window.custom +++ b/gdk/Window.custom @@ -1,11 +1,29 @@ // Gdk.Window.custom - Gdk Window class customizations // // Author: Moritz Balz +// Mike Kestner // // (c) 2003 Moritz Balz +// (c) 2004 Novell, Inc. // // This code is inserted after the automatically generated code. + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_window_get_children(IntPtr raw); + + public Window[] Children { + get { + IntPtr raw_ret = gdk_window_get_children(Handle); + 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 System.Drawing.Rectangle FrameExtents { get { Gdk.Rectangle rect = Gdk.Rectangle.Zero; @@ -14,6 +32,18 @@ } } + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_window_set_icon_list(IntPtr raw, IntPtr pixbufs); + + public Pixbuf[] IconList { + set { + GLib.List list = new GLib.List(IntPtr.Zero); + foreach (Pixbuf val in value) + list.Append (val.Handle); + gdk_window_set_icon_list(Handle, list.Handle); + } + } + public void Move (System.Drawing.Point p) { gdk_window_move (Handle, p.X, p.Y); } @@ -51,6 +81,22 @@ } } + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_window_get_toplevels(); + + public static Window[] Toplevels { + get { + IntPtr raw_ret = gdk_window_get_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 void MoveResize (System.Drawing.Rectangle rect) { gdk_window_move_resize (Handle, rect.X, rect.Y, rect.Width, rect.Height); } diff --git a/gdk/gdk-api.xml b/gdk/gdk-api.xml index 21b9e8c15..1bde7159a 100644 --- a/gdk/gdk-api.xml +++ b/gdk/gdk-api.xml @@ -702,7 +702,7 @@ - + @@ -1539,7 +1539,7 @@ - + @@ -1557,7 +1557,7 @@ - + @@ -1741,7 +1741,7 @@ - + @@ -1815,7 +1815,7 @@ - + @@ -1915,7 +1915,7 @@ - + @@ -2029,7 +2029,7 @@ - + - + @@ -2805,7 +2805,7 @@ - + @@ -2894,7 +2894,7 @@ - +