From f692bf6d374fd2049b294ac8da3255a20422fc54 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 12 Feb 2004 22:38:43 +0000 Subject: [PATCH] 2004-02-12 Mike Kestner * gnome/Gnome.metadata : hide the GList API * gnome/*.custom : manually wrap GList api using typed arrays * gnome/gnome-api.xml : regen. svn path=/trunk/gtk-sharp/; revision=23045 --- ChangeLog | 6 ++++++ gnome/Font.custom | 41 +++++++++++++++++++++++++++++++++++++++++ gnome/FontFamily.custom | 41 +++++++++++++++++++++++++++++++++++++++++ gnome/Gnome.metadata | 13 +++++++++++-- gnome/IconList.custom | 24 ++++++++++++++++++++++++ gnome/IconTheme.custom | 23 +++++++++++++++++++++++ gnome/gnome-api.xml | 20 ++++++++++---------- 7 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 gnome/Font.custom create mode 100644 gnome/FontFamily.custom create mode 100644 gnome/IconList.custom create mode 100644 gnome/IconTheme.custom diff --git a/ChangeLog b/ChangeLog index dfcb34730..1840084f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-02-12 Mike Kestner + + * gnome/Gnome.metadata : hide the GList API + * gnome/*.custom : manually wrap GList api using typed arrays + * gnome/gnome-api.xml : regen. + 2004-02-12 Mike Kestner * glade/Glade.metadata : hide a GList method. diff --git a/gnome/Font.custom b/gnome/Font.custom new file mode 100644 index 000000000..ee0b07cfb --- /dev/null +++ b/gnome/Font.custom @@ -0,0 +1,41 @@ +// Font.custom - customizations to Gnome.Font +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("gnomeprint-2-2")] + static extern IntPtr gnome_font_list (); + + public static string[] List () + { + IntPtr list_ptr = gnome_font_list (); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + + [DllImport("gnomeprint-2-2")] + static extern IntPtr gnome_font_style_list (string family); + + public static string[] StyleList (string family) + { + IntPtr list_ptr = gnome_font_style_list (family); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + + diff --git a/gnome/FontFamily.custom b/gnome/FontFamily.custom new file mode 100644 index 000000000..e68939dff --- /dev/null +++ b/gnome/FontFamily.custom @@ -0,0 +1,41 @@ +// FontFamily.custom - customizations to Gnome.FontFamily +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("gnomeprint-2-2")] + static extern IntPtr gnome_font_family_list (); + + public static string[] List () + { + IntPtr list_ptr = gnome_font_family_list (); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + + [DllImport("gnomeprint-2-2")] + static extern IntPtr gnome_font_family_style_list (IntPtr raw); + + public string[] StyleList () + { + IntPtr list_ptr = gnome_font_family_style_list (Handle); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + + diff --git a/gnome/Gnome.metadata b/gnome/Gnome.metadata index a03c4642a..339a28cd0 100644 --- a/gnome/Gnome.metadata +++ b/gnome/Gnome.metadata @@ -54,21 +54,30 @@ 1 1 Activated - const-gchar* + 1 + 1 + 1 + 1 + const-gchar* const-gchar* const-gchar* const-gchar* const-gchar* + 1 + 1 + 1 + 1 1 1 1 - int + i 1 1 IconFocused IconSelected IconUnselected 1 + 1 const-gchar* gchar* const-gchar* diff --git a/gnome/IconList.custom b/gnome/IconList.custom new file mode 100644 index 000000000..3b9c36891 --- /dev/null +++ b/gnome/IconList.custom @@ -0,0 +1,24 @@ +// IconList.custom - customizations to Gnome.IconList +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_list_get_selection (IntPtr raw); + + public int[] Selection { + get { + IntPtr list_ptr = gnome_icon_list_get_selection (Handle); + if (list_ptr == IntPtr.Zero) + return new int [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (int)); + int[] result = new int [list.Count]; + int i = 0; + foreach (int val in list) + result [i++] = val; + return result; + } + } + diff --git a/gnome/IconTheme.custom b/gnome/IconTheme.custom new file mode 100644 index 000000000..52a8211c1 --- /dev/null +++ b/gnome/IconTheme.custom @@ -0,0 +1,23 @@ +// IconTheme.custom - customizations to Gnome.IconTheme +// +// Authors: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_theme_list_icons (IntPtr raw, string context); + + public string[] ListIcons (string context) + { + IntPtr list_ptr = gnome_icon_theme_list_icons (Handle, context); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + diff --git a/gnome/gnome-api.xml b/gnome/gnome-api.xml index d48457be5..9f83e1733 100644 --- a/gnome/gnome-api.xml +++ b/gnome/gnome-api.xml @@ -3556,7 +3556,7 @@ - + @@ -3882,7 +3882,7 @@ - + - + - + - + - +