~ubuntu-branches/ubuntu/natty/gtk-sharp2/natty

« back to all changes in this revision

Viewing changes to glib/Marshaller.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-05-18 00:00:41 UTC
  • mfrom: (1.1.16 upstream) (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100518000041-tlgvki554jx6ndhi
Tags: 2.12.10-1
* New upstream release
* debian/rules:
  + Bump API version to 2.12.10
* debian/control:
  + Bump Standards to 3.8.4 (no changes needed)
* debian/source/format:
  + Force Debian source format 1.0
* debian/rules:
  + Write a get-orig-source rule
* debian/watch:
  + Get rid of evil "debian uupdate" line which breaks packaging work on
    Ubuntu
* debian/patches/01_dllmaps.dpatch:
  + Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                [DllImport("libglib-2.0-0.dll")]
50
50
                static extern IntPtr g_filename_to_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
51
51
 
 
52
                [DllImport("libglib-2.0-0.dll")]
 
53
                static extern IntPtr g_filename_to_utf8_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
 
54
 
52
55
                public static string FilenamePtrToString (IntPtr ptr) 
53
56
                {
54
57
                        if (ptr == IntPtr.Zero) return null;
55
58
                        
56
59
                        IntPtr dummy, error;
57
 
                        IntPtr utf8 = g_filename_to_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
 
60
                        IntPtr utf8;
 
61
 
 
62
                        if (Global.IsWindowsPlatform)
 
63
                                utf8 = g_filename_to_utf8_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
 
64
                        else
 
65
                                utf8 = g_filename_to_utf8 (ptr, -1, IntPtr.Zero, out dummy, out error);
 
66
 
58
67
                        if (error != IntPtr.Zero)
59
68
                                throw new GLib.GException (error);
60
69
                        return Utf8PtrToString (utf8);
109
118
                [DllImport("libglib-2.0-0.dll")]
110
119
                static extern IntPtr g_filename_from_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
111
120
 
 
121
                [DllImport("libglib-2.0-0.dll")]
 
122
                static extern IntPtr g_filename_from_utf8_utf8 (IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error);
 
123
 
112
124
                public static IntPtr StringToFilenamePtr (string str) 
113
125
                {
114
126
                        if (str == null)
116
128
 
117
129
                        IntPtr dummy, error;
118
130
                        IntPtr utf8 = StringToPtrGStrdup (str);
119
 
                        IntPtr result = g_filename_from_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
 
131
 
 
132
                        IntPtr result;
 
133
 
 
134
                        if (Global.IsWindowsPlatform)
 
135
                                result = g_filename_from_utf8_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
 
136
                        else
 
137
                                result = g_filename_from_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error);
 
138
 
120
139
                        g_free (utf8);
121
140
                        if (error != IntPtr.Zero)
122
141
                                throw new GException (error);