mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
2009-11-30 Mike Kestner <mkestner@novell.com>
* generator/Method.cs: support win32_utf8_variant attribute on methods. * glib/*.cs: support win32 utf8 variant methods. * gtk/*.custom: support win32 utf8 variant methods. * gtk/Gtk.metadata: mark some win32_utf8_variant methods. [Fixes #550961] Adapted from a patch by Tor Lillqvist. svn path=/trunk/gtk-sharp/; revision=147113
This commit is contained in:
parent
f1bf740bf5
commit
536c3aca54
@ -1,3 +1,11 @@
|
||||
2009-11-30 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* generator/Method.cs: support win32_utf8_variant attribute on methods.
|
||||
* glib/*.cs: support win32 utf8 variant methods.
|
||||
* gtk/*.custom: support win32 utf8 variant methods.
|
||||
* gtk/Gtk.metadata: mark some win32_utf8_variant methods.
|
||||
[Fixes #550961] Adapted from a patch by Tor Lillqvist.
|
||||
|
||||
2009-11-28 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* glib/GException.cs: add Code and Domain props to expose the GError
|
||||
|
@ -34,6 +34,7 @@ namespace GtkSharp.Generation {
|
||||
private string call;
|
||||
private bool is_get, is_set;
|
||||
private bool deprecated = false;
|
||||
private bool win32_utf8_variant = false;
|
||||
|
||||
public Method (XmlElement elem, ClassBase container_type) : base (elem, container_type)
|
||||
{
|
||||
@ -44,10 +45,19 @@ namespace GtkSharp.Generation {
|
||||
deprecated = attr == "1" || attr == "true";
|
||||
}
|
||||
|
||||
if (elem.HasAttribute ("win32_utf8_variant")) {
|
||||
string attr = elem.GetAttribute ("win32_utf8_variant");
|
||||
win32_utf8_variant = attr == "1" || attr.ToLower () == "true";
|
||||
}
|
||||
|
||||
if (Name == "GetType")
|
||||
Name = "GetGType";
|
||||
}
|
||||
|
||||
public bool HasWin32Utf8Variant {
|
||||
get { return win32_utf8_variant; }
|
||||
}
|
||||
|
||||
public bool IsDeprecated {
|
||||
get {
|
||||
return deprecated;
|
||||
@ -191,6 +201,15 @@ namespace GtkSharp.Generation {
|
||||
else
|
||||
sw.WriteLine("\t\tstatic extern " + Safety + retval.MarshalType + " " + CName + "(" + import_sig + ");");
|
||||
sw.WriteLine();
|
||||
|
||||
if (HasWin32Utf8Variant) {
|
||||
sw.WriteLine("\t\t[DllImport(\"" + LibraryName + "\")]");
|
||||
if (retval.MarshalType.StartsWith ("[return:"))
|
||||
sw.WriteLine("\t\t" + retval.MarshalType + " static extern " + Safety + retval.CSType + " " + CName + "_utf8(" + import_sig + ");");
|
||||
else
|
||||
sw.WriteLine("\t\tstatic extern " + Safety + retval.MarshalType + " " + CName + "_utf8(" + import_sig + ");");
|
||||
sw.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
public void Generate (GenerationInfo gen_info, ClassBase implementor)
|
||||
@ -271,6 +290,24 @@ namespace GtkSharp.Generation {
|
||||
Body.InitAccessor (sw, Signature, indent);
|
||||
Body.Initialize(gen_info, is_get, is_set, indent);
|
||||
|
||||
if (HasWin32Utf8Variant) {
|
||||
if (!retval.IsVoid)
|
||||
sw.WriteLine(indent + "\t\t\t" + retval.MarshalType + " raw_ret;");
|
||||
sw.WriteLine(indent + "\t\t\t" + "if (Environment.OSVersion.Platform == PlatformID.Win32NT ||");
|
||||
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.Win32S ||");
|
||||
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.Win32Windows ||");
|
||||
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.WinCE)");
|
||||
if (retval.IsVoid) {
|
||||
sw.WriteLine(indent + "\t\t\t\t" + CName + "_utf8" + call + ";");
|
||||
sw.WriteLine(indent + "\t\t\t" + "else");
|
||||
sw.WriteLine(indent + "\t\t\t\t" + CName + call + ";");
|
||||
} else {
|
||||
sw.WriteLine(indent + "\t\t\t\traw_ret = " + CName + "_utf8" + call + ";");
|
||||
sw.WriteLine(indent + "\t\t\t" + "else");
|
||||
sw.WriteLine(indent + "\t\t\t\traw_ret = " + CName + call + ";");
|
||||
sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
|
||||
}
|
||||
} else {
|
||||
sw.Write(indent + "\t\t\t");
|
||||
if (retval.IsVoid)
|
||||
sw.WriteLine(CName + call + ";");
|
||||
@ -278,6 +315,7 @@ namespace GtkSharp.Generation {
|
||||
sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
|
||||
sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsStatic && implementor != null)
|
||||
implementor.Finish (sw, indent + "\t\t\t");
|
||||
|
@ -30,14 +30,22 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
extern static bool g_file_get_contents (IntPtr filename, out IntPtr contents, out int length, out IntPtr error);
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
extern static bool g_file_get_contents_utf8 (IntPtr filename, out IntPtr contents, out int length, out IntPtr error);
|
||||
|
||||
public static string GetFileContents (string filename)
|
||||
{
|
||||
int length;
|
||||
IntPtr contents, error;
|
||||
IntPtr native_filename = Marshaller.StringToPtrGStrdup (filename);
|
||||
|
||||
if (Global.IsWindowsPlatform) {
|
||||
if (!g_file_get_contents_utf8 (native_filename, out contents, out length, out error))
|
||||
throw new GException (error);
|
||||
} else {
|
||||
if (!g_file_get_contents (native_filename, out contents, out length, out error))
|
||||
throw new GException (error);
|
||||
}
|
||||
|
||||
Marshaller.Free (native_filename);
|
||||
return Marshaller.Utf8PtrToString (contents);
|
||||
|
@ -31,6 +31,20 @@ namespace GLib {
|
||||
//this is a static class
|
||||
private Global () {}
|
||||
|
||||
internal static bool IsWindowsPlatform {
|
||||
get {
|
||||
switch (Environment.OSVersion.Platform) {
|
||||
case PlatformID.Win32NT:
|
||||
case PlatformID.Win32S:
|
||||
case PlatformID.Win32Windows:
|
||||
case PlatformID.WinCE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ProgramName {
|
||||
get {
|
||||
return GLib.Marshaller.PtrToStringGFree(g_get_prgname());
|
||||
|
@ -73,6 +73,10 @@ namespace GLib {
|
||||
IntPtr native_filename = Marshaller.StringToPtrGStrdup (filename);
|
||||
IntPtr native_mode = Marshaller.StringToPtrGStrdup (mode);
|
||||
IntPtr error;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
handle = g_io_channel_new_file_utf8(native_filename, native_mode, out error);
|
||||
else
|
||||
handle = g_io_channel_new_file(native_filename, native_mode, out error);
|
||||
Marshaller.Free (native_filename);
|
||||
Marshaller.Free (native_mode);
|
||||
@ -325,6 +329,9 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_io_channel_new_file (IntPtr filename, IntPtr mode, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_io_channel_new_file_utf8 (IntPtr filename, IntPtr mode, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern int g_io_channel_error_quark ();
|
||||
|
||||
|
@ -49,12 +49,21 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_filename_to_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
static extern IntPtr g_filename_to_utf8_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
|
||||
|
||||
public static string FilenamePtrToString (IntPtr ptr)
|
||||
{
|
||||
if (ptr == IntPtr.Zero) return null;
|
||||
|
||||
IntPtr dummy, error;
|
||||
IntPtr utf8 = g_filename_to_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
|
||||
IntPtr utf8;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
utf8 = g_filename_to_utf8_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
|
||||
else
|
||||
utf8 = g_filename_to_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
|
||||
|
||||
if (error != IntPtr.Zero)
|
||||
throw new GLib.GException (error);
|
||||
return Utf8PtrToString (utf8);
|
||||
@ -117,6 +126,9 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_filename_from_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
static extern IntPtr g_filename_from_utf8_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
|
||||
|
||||
public static IntPtr StringToFilenamePtr (string str)
|
||||
{
|
||||
if (str == null)
|
||||
@ -124,7 +136,14 @@ namespace GLib {
|
||||
|
||||
IntPtr dummy, error;
|
||||
IntPtr utf8 = StringToPtrGStrdup (str);
|
||||
IntPtr result = g_filename_from_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
|
||||
|
||||
IntPtr result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_filename_from_utf8_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
|
||||
else
|
||||
result = g_filename_from_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
|
||||
|
||||
g_free (utf8);
|
||||
if (error != IntPtr.Zero)
|
||||
throw new GException (error);
|
||||
|
@ -113,6 +113,9 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern bool g_spawn_async (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out int pid, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll")]
|
||||
static extern bool g_spawn_async_utf8 (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out int pid, out IntPtr error);
|
||||
|
||||
public static bool SpawnAsync (string working_directory, string[] argv, string[] envp, SpawnFlags flags, SpawnChildSetupFunc child_setup, out Process child_process)
|
||||
{
|
||||
int pid;
|
||||
@ -121,7 +124,13 @@ namespace GLib {
|
||||
IntPtr[] native_argv = Marshaller.StringArrayToNullTermPointer (argv);
|
||||
IntPtr[] native_envp = Marshaller.StringArrayToNullTermPointer (envp);
|
||||
SpawnChildSetupWrapper wrapper = new SpawnChildSetupWrapper (child_setup);
|
||||
bool result = g_spawn_async (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, out error);
|
||||
bool result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_spawn_async_utf8 (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, out error);
|
||||
else
|
||||
result = g_spawn_async (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, out error);
|
||||
|
||||
child_process = new Process (pid);
|
||||
Marshaller.Free (native_dir);
|
||||
Marshaller.Free (native_argv);
|
||||
@ -133,6 +142,9 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern bool g_spawn_async_with_pipes (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out int pid, IntPtr stdin, IntPtr stdout, IntPtr stderr, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll")]
|
||||
static extern bool g_spawn_async_with_pipes_utf8 (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out int pid, IntPtr stdin, IntPtr stdout, IntPtr stderr, out IntPtr error);
|
||||
|
||||
public static bool SpawnAsyncWithPipes (string working_directory, string[] argv, string[] envp, SpawnFlags flags, SpawnChildSetupFunc child_setup, out Process child_process, ref int stdin, ref int stdout, ref int stderr)
|
||||
{
|
||||
int pid;
|
||||
@ -144,7 +156,13 @@ namespace GLib {
|
||||
IntPtr in_ptr = stdin == IgnorePipe ? IntPtr.Zero : Marshal.AllocHGlobal (4);
|
||||
IntPtr out_ptr = stdout == IgnorePipe ? IntPtr.Zero : Marshal.AllocHGlobal (4);
|
||||
IntPtr err_ptr = stderr == IgnorePipe ? IntPtr.Zero : Marshal.AllocHGlobal (4);
|
||||
bool result = g_spawn_async_with_pipes (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, in_ptr, out_ptr, err_ptr, out error);
|
||||
bool result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_spawn_async_with_pipes_utf8 (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, in_ptr, out_ptr, err_ptr, out error);
|
||||
else
|
||||
result = g_spawn_async_with_pipes (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out pid, in_ptr, out_ptr, err_ptr, out error);
|
||||
|
||||
child_process = new Process (pid);
|
||||
if (in_ptr != IntPtr.Zero) {
|
||||
stdin = Marshal.ReadInt32 (in_ptr);
|
||||
@ -168,6 +186,9 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern bool g_spawn_sync (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out IntPtr stdout, out IntPtr stderr, out int exit_status, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll")]
|
||||
static extern bool g_spawn_sync_utf8 (IntPtr dir, IntPtr[] argv, IntPtr[] envp, int flags, SpawnChildSetupFuncNative func, IntPtr data, out IntPtr stdout, out IntPtr stderr, out int exit_status, out IntPtr error);
|
||||
|
||||
public static bool SpawnSync (string working_directory, string[] argv, string[] envp, SpawnFlags flags, SpawnChildSetupFunc child_setup, out string stdout, out string stderr, out int exit_status)
|
||||
{
|
||||
IntPtr native_stdout, native_stderr, error;
|
||||
@ -175,7 +196,13 @@ namespace GLib {
|
||||
IntPtr[] native_argv = Marshaller.StringArrayToNullTermPointer (argv);
|
||||
IntPtr[] native_envp = Marshaller.StringArrayToNullTermPointer (envp);
|
||||
SpawnChildSetupWrapper wrapper = new SpawnChildSetupWrapper (child_setup);
|
||||
bool result = g_spawn_sync (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
bool result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_spawn_sync (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
else
|
||||
result = g_spawn_sync (native_dir, native_argv, native_envp, (int) flags, wrapper.NativeCallback, wrapper.Data, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
|
||||
Marshaller.Free (native_dir);
|
||||
Marshaller.Free (native_argv);
|
||||
Marshaller.Free (native_envp);
|
||||
@ -188,11 +215,20 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern bool g_spawn_command_line_async (IntPtr cmdline, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll")]
|
||||
static extern bool g_spawn_command_line_async_utf8 (IntPtr cmdline, out IntPtr error);
|
||||
|
||||
public static bool SpawnCommandLineAsync (string command_line)
|
||||
{
|
||||
IntPtr error;
|
||||
IntPtr native_cmd = Marshaller.StringToPtrGStrdup (command_line);
|
||||
bool result = g_spawn_command_line_async (native_cmd, out error);
|
||||
bool result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_spawn_command_line_async_utf8 (native_cmd, out error);
|
||||
else
|
||||
result = g_spawn_command_line_async (native_cmd, out error);
|
||||
|
||||
Marshaller.Free (native_cmd);
|
||||
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||||
return result;
|
||||
@ -201,11 +237,20 @@ namespace GLib {
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern bool g_spawn_command_line_sync (IntPtr cmdline, out IntPtr stdout, out IntPtr stderr, out int exit_status, out IntPtr error);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll")]
|
||||
static extern bool g_spawn_command_line_sync_utf8 (IntPtr cmdline, out IntPtr stdout, out IntPtr stderr, out int exit_status, out IntPtr error);
|
||||
|
||||
public static bool SpawnCommandLineSync (string command_line, out string stdout, out string stderr, out int exit_status)
|
||||
{
|
||||
IntPtr error, native_stdout, native_stderr;
|
||||
IntPtr native_cmd = Marshaller.StringToPtrGStrdup (command_line);
|
||||
bool result = g_spawn_command_line_sync (native_cmd, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
bool result;
|
||||
|
||||
if (Global.IsWindowsPlatform)
|
||||
result = g_spawn_command_line_sync_utf8 (native_cmd, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
else
|
||||
result = g_spawn_command_line_sync (native_cmd, out native_stdout, out native_stderr, out exit_status, out error);
|
||||
|
||||
Marshaller.Free (native_cmd);
|
||||
stdout = Marshaller.PtrToStringGFree (native_stdout);
|
||||
stderr = Marshaller.PtrToStringGFree (native_stderr);
|
||||
|
@ -36,15 +36,30 @@ public class FSButton : Gtk.Button {
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern IntPtr gtk_file_selection_get_selections (IntPtr handle);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern IntPtr gtk_file_selection_get_selections_utf8 (IntPtr handle);
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
static extern void g_strfreev (IntPtr handle);
|
||||
|
||||
public string[] Selections {
|
||||
get {
|
||||
IntPtr strv = gtk_file_selection_get_selections (Handle);
|
||||
IntPtr strv;
|
||||
|
||||
switch (Environment.OSVersion.Platform) {
|
||||
case PlatformID.Win32NT:
|
||||
case PlatformID.Win32S:
|
||||
case PlatformID.Win32Windows:
|
||||
case PlatformID.WinCE:
|
||||
strv = gtk_file_selection_get_selections_utf8 (Handle);
|
||||
break;
|
||||
default:
|
||||
strv = gtk_file_selection_get_selections (Handle);
|
||||
break;
|
||||
}
|
||||
|
||||
System.Collections.ArrayList result = new System.Collections.ArrayList ();
|
||||
|
||||
|
@ -13,10 +13,13 @@
|
||||
<attr path="/api/namespace/struct[@cname='GtkTypeInfo']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkBorder']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconInfo']/method[@name='Free']" name="deprecated">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconInfo']/method[@name='GetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSet']/method[@name='GetSizes']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSet']/method[@name='Ref']" name="deprecated">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSet']/method[@name='Unref']" name="deprecated">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSource']/method[@name='Free']" name="deprecated">1</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSource']/method[@name='GetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkIconSource']/method[@name='SetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkPaperSize']/method[@name='GetPaperSizes']/return-type" name="element_type">GtkPaperSize*</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkPaperSize']/method[@name='GetPaperSizes']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/boxed[@cname='GtkPaperSize']/method[@name='GetPaperSizes']/return-type" name="elements_owned">true</attr>
|
||||
@ -105,7 +108,10 @@
|
||||
<attr path="/api/namespace/class[@cname='GtkPrint_']/method[@name='RunPageSetupDialogAsync']/*/*[@name='done_cb']" name="scope">async</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkQuit_']/method[@name='Add']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkQuit_']/method[@name='AddFull']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkRc_']/method[@name='AddDefaultFile']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkRc_']/method[@name='GetDefaultFiles']/return-type" name="null_term_array">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkRc_']/method[@name='Parse']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkRc_']/method[@name='SetDefaultFiles']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkRc_']/method[@name='SetDefaultFiles']/*/*[@name='filenames']" name="null_term_array">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkSignal_']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/class[@cname='GtkStock_']" name="hidden">1</attr>
|
||||
@ -152,11 +158,15 @@
|
||||
<attr path="/api/namespace/interface[@cname='GtkEditable']/virtual_method[@name='SetSelectionBounds']" name="name">SelectRegion</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']" name="consume_only">1</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/property[@name='Action']" name="new_flag">1</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetCurrentFolder']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetCurrentFolder']/return-type" name="type">gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilename']/return-type" name="type">gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="element_type">gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="elements_owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']/return-type" name="type">gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method/parameters/*[@name='filename']" name="type">const-gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method/parameters/*[@name='folder']" name="type">const-gfilename*</attr>
|
||||
@ -166,6 +176,7 @@
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']" name="name">GetFilters</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']/return-type" name="element_type">GtkFileFilter*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folders']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folders']" name="name">GetShortcutFolders</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folders']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folders']/return-type" name="element_type">gfilename*</attr>
|
||||
@ -174,6 +185,12 @@
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="element_type">gchar*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="elements_owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='RemoveShortcutFolder']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='SelectFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='SetCurrentFolder']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='SetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='UnselectFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='AddShortcutFolder']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='GetPaths']" name="name">GetFilenames</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='get_paths']/return-type" name="element_type">gfilename*</attr>
|
||||
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='get_paths']/return-type" name="elements_owned">true</attr>
|
||||
@ -227,6 +244,8 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelGroup']/signal[@name='AccelActivate']/*/*[@name='p2']" name="name">modifier</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/method[@name='Foreach']/*/*[@name='foreach_func']" name="scope">call</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/method[@name='ForeachUnfiltered']/*/*[@name='foreach_func']" name="scope">call</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/method[@name='Load']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/method[@name='Save']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/signal[@name='Changed']" name="name">MapChanged</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/signal[@name='MapChanged']/*/*[@name='p0']" name="name">accel_path</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkAccelMap']/signal[@name='MapChanged']/*/*[@name='p1']" name="name">accel_key</attr>
|
||||
@ -391,8 +410,11 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/field[@name='OkButton']" name="type">GtkButton*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/field[@name='SelectionEntry']" name="type">GtkEntry*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/field[@name='SelectionText']" name="type">GtkLabel*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='GetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='GetFilename']/return-type" name="type">const-gfilename*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='GetSelections']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='GetSelections']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='SetFilename']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/method[@name='SetFilename']/*/*[@name='filename']" name="type">const-gfilename*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFileSelection']/property[@name='Filename']" name="type">gfilename*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkFontSelectionDialog']/field[@name='ApplyButton']" name="type">GtkButton*</attr>
|
||||
@ -410,8 +432,10 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkHandleBox']/property[@name='ShadowType']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkHandleBox']/method[@name='GetChildDetached']" name="name">IsChildDetached</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkHScale']/constructor[@cname='gtk_hscale_new_with_range']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='AppendSearchPath']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='ChooseIcon']/*/*[@name='icon_names']" name="null_term_array">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='GetIconSizes']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='GetSearchPath']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='GetSearchPath']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='ListContexts']/return-type" name="element_type">gchar*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='ListContexts']/return-type" name="owned">true</attr>
|
||||
@ -421,6 +445,8 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='LookupIcon']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@cname='gtk_icon_theme_lookup_by_gicon']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@cname='gtk_icon_theme_lookup_by_gicon']" name="name">LookupIcon</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='PrependSearchPath']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='SetSearchPath']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconTheme']/method[@name='SetSearchPath']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconView']/method[@name='ItemActivated']" name="name">ActivateItem</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkIconView']/method[@name='EnableModelDragDest']/*/*[@name='targets']" name="array">1</attr>
|
||||
@ -451,6 +477,7 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkImageMenuItem']/constructor[@cname='gtk_image_menu_item_new_with_mnemonic']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImageMenuItem']/constructor[@cname='gtk_image_menu_item_new_with_label']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/constructor[@cname='gtk_image_new_from_animation']/*/*[@name='animation']" name="property_name">pixbuf_animation</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/constructor[@cname='gtk_image_new_from_file']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/constructor[@cname='gtk_image_new_from_file']/*/*[@name='filename']" name="property_name">file</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/constructor[@cname='gtk_image_new_from_icon_name']" name="shared">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/constructor[@cname='gtk_image_new_from_icon_set']" name="hidden">1</attr>
|
||||
@ -462,6 +489,7 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@name='GetPixmap']/*/*[@name='mask']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@name='GetStock']/*/*[@name='stock_id']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@name='SetFromAnimation']" name="name">SetAnimation</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@cname='gtk_image_set_from_file']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@name='SetFromFile']" name="name">SetFile</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@name='SetFromPixbuf']" name="name">SetPixbuf</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkImage']/method[@cname='gtk_image_get_gicon']/*/parameter[@name='gicon']" name="pass_as">out</attr>
|
||||
@ -774,6 +802,7 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkTreeView']/method[@name='SetGridLines']" name="name">SetEnableGridLines</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkTreeView']/signal[@name='SetScrollAdjustments']" name="name">ScrollAdjustmentsSet</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkUIManager']/constructor[@cname='gtk_ui_manager_new_merge_id']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkUIManager']/method[@name='AddUiFromFile']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkUIManager']/method[@cname='gtk_ui_manager_get_action_groups']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkUIManager']/method[@name='GetToplevels']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkViewport']/signal[@name='SetScrollAdjustments']" name="name">ScrollAdjustmentsSet</attr>
|
||||
@ -847,7 +876,9 @@
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='IsActive']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="element_type">GtkWindow*</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="owned">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetDefaultIconFromFile']" name="win32_utf8_variant">true</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetDefaultIconList']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetIconFromFile']" name="win32_utf8_variant">true</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']/signal[@name='ActivateDefault']" name="name">DefaultActivated</attr>
|
||||
|
@ -46,9 +46,29 @@
|
||||
[DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern void gtk_icon_theme_set_search_path(IntPtr raw, IntPtr[] path, int n_elements);
|
||||
|
||||
[DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern void gtk_icon_theme_get_search_path_utf8(IntPtr raw, out IntPtr path, out int n_elements);
|
||||
|
||||
[DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern void gtk_icon_theme_set_search_path_utf8(IntPtr raw, IntPtr[] path, int n_elements);
|
||||
|
||||
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern void g_strfreev (IntPtr mem);
|
||||
|
||||
bool IsWindowsPlatform {
|
||||
get {
|
||||
switch (Environment.OSVersion.Platform) {
|
||||
case PlatformID.Win32NT:
|
||||
case PlatformID.Win32S:
|
||||
case PlatformID.Win32Windows:
|
||||
case PlatformID.WinCE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string[] SearchPath {
|
||||
get {
|
||||
string[] retval;
|
||||
@ -56,7 +76,11 @@
|
||||
unsafe {
|
||||
int length;
|
||||
IntPtr raw_ret;
|
||||
if (IsWindowsPlatform)
|
||||
gtk_icon_theme_get_search_path_utf8 (Handle, out raw_ret, out length);
|
||||
else
|
||||
gtk_icon_theme_get_search_path (Handle, out raw_ret, out length);
|
||||
|
||||
int size = Marshal.SizeOf (typeof (IntPtr));
|
||||
retval = new string[length];
|
||||
for (int i = 0, j = 0; i < length; i++, j += size) {
|
||||
@ -74,7 +98,12 @@
|
||||
IntPtr[] native_path = new IntPtr [cnt_path];
|
||||
for (int i = 0; i < cnt_path; i++)
|
||||
native_path [i] = GLib.Marshaller.StringToPtrGStrdup (value[i]);
|
||||
|
||||
if (IsWindowsPlatform)
|
||||
gtk_icon_theme_set_search_path_utf8 (Handle, native_path, native_path.Length);
|
||||
else
|
||||
gtk_icon_theme_set_search_path (Handle, native_path, native_path.Length);
|
||||
|
||||
for (int i = 0; i < native_path.Length; i++)
|
||||
GLib.Marshaller.Free (native_path[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user