From 5b22918f4f2ae14ce3c06b0acbd610e1f3b2a6de Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 5 Aug 2012 18:00:11 +0200 Subject: [PATCH] pango: Re-indent code that was moved inside partial classes No real code change, just whitespace. --- pango/Layout.cs | 49 +++++++++++++++++++++++---------------------- pango/LayoutLine.cs | 38 +++++++++++++++++------------------ pango/Matrix.cs | 20 +++++++++--------- 3 files changed, 54 insertions(+), 53 deletions(-) diff --git a/pango/Layout.cs b/pango/Layout.cs index 359696bfb..34c2a682e 100644 --- a/pango/Layout.cs +++ b/pango/Layout.cs @@ -26,33 +26,34 @@ namespace Pango { public partial class Layout { -[DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] -static extern IntPtr pango_layout_get_lines(IntPtr raw); + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr pango_layout_get_lines(IntPtr raw); -public LayoutLine[] Lines { - get { - IntPtr list_ptr = pango_layout_get_lines(Handle); - if (list_ptr == IntPtr.Zero) - return new LayoutLine [0]; - GLib.SList list = new GLib.SList(list_ptr, typeof (IntPtr)); - LayoutLine[] result = new LayoutLine [list.Count]; - for (int i = 0; i < list.Count; i++) - result[i] = new LayoutLine ((IntPtr)list[i]); - return result; - } -} + public LayoutLine[] Lines { + get { + IntPtr list_ptr = pango_layout_get_lines(Handle); + if (list_ptr == IntPtr.Zero) + return new LayoutLine [0]; + GLib.SList list = new GLib.SList(list_ptr, typeof (IntPtr)); + LayoutLine[] result = new LayoutLine [list.Count]; + for (int i = 0; i < list.Count; i++) + result[i] = new LayoutLine ((IntPtr)list[i]); -[DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] -static extern void pango_layout_set_markup_with_accel (IntPtr raw, IntPtr markup, int length, uint accel_marker, out uint accel_char); + return result; + } + } -public void SetMarkupWithAccel (string markup, char accel_marker, out char accel_char) -{ - uint ucs4_accel_char; - IntPtr native_markup = GLib.Marshaller.StringToPtrGStrdup (markup); - pango_layout_set_markup_with_accel (Handle, native_markup, -1, GLib.Marshaller.CharToGUnichar (accel_marker), out ucs4_accel_char); - GLib.Marshaller.Free (native_markup); - accel_char = GLib.Marshaller.GUnicharToChar (ucs4_accel_char); -} + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern void pango_layout_set_markup_with_accel (IntPtr raw, IntPtr markup, int length, uint accel_marker, out uint accel_char); + + public void SetMarkupWithAccel (string markup, char accel_marker, out char accel_char) + { + uint ucs4_accel_char; + IntPtr native_markup = GLib.Marshaller.StringToPtrGStrdup (markup); + pango_layout_set_markup_with_accel (Handle, native_markup, -1, GLib.Marshaller.CharToGUnichar (accel_marker), out ucs4_accel_char); + GLib.Marshaller.Free (native_markup); + accel_char = GLib.Marshaller.GUnicharToChar (ucs4_accel_char); + } [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); diff --git a/pango/LayoutLine.cs b/pango/LayoutLine.cs index 7b92e0890..39e826dc1 100644 --- a/pango/LayoutLine.cs +++ b/pango/LayoutLine.cs @@ -26,28 +26,28 @@ namespace Pango { public partial class LayoutLine { #if NOT_BROKEN -[DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] -static extern void pango_layout_line_get_x_ranges(IntPtr raw, int start_index, int end_index, out IntPtr ranges_handle, out int n_ranges); + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern void pango_layout_line_get_x_ranges(IntPtr raw, int start_index, int end_index, out IntPtr ranges_handle, out int n_ranges); #endif -public void GetXRanges(int start_index, int end_index, out int[][] ranges) -{ - // FIXME: this is broken - throw new NotImplementedException (); + public void GetXRanges(int start_index, int end_index, out int[][] ranges) + { + // FIXME: this is broken + throw new NotImplementedException (); #if NOT_BROKEN - int count; - IntPtr array_ptr; - pango_layout_line_get_x_ranges(Handle, start_index, end_index, out array_ptr, out count); - ranges = new int[count] []; - for (int i = 0; i < count; i++) { - IntPtr tmp = new IntPtr (array_ptr + 2 * i * IntPtr.Size); - IntPtr rng_ptr = Marshal.ReadIntPtr (tmp); - IntPtr end_ptr = Marshal.ReadIntPtr (tmp, IntPtr.Size); - - } - Marshal.Copy (array_ptr, ranges, 0, count); - g_free (array_ptr); + int count; + IntPtr array_ptr; + pango_layout_line_get_x_ranges(Handle, start_index, end_index, out array_ptr, out count); + ranges = new int[count] []; + for (int i = 0; i < count; i++) { + IntPtr tmp = new IntPtr (array_ptr + 2 * i * IntPtr.Size); + IntPtr rng_ptr = Marshal.ReadIntPtr (tmp); + IntPtr end_ptr = Marshal.ReadIntPtr (tmp, IntPtr.Size); + + } + Marshal.Copy (array_ptr, ranges, 0, count); + g_free (array_ptr); #endif -} + } } } diff --git a/pango/Matrix.cs b/pango/Matrix.cs index 7c9dbddb1..57a00f965 100644 --- a/pango/Matrix.cs +++ b/pango/Matrix.cs @@ -24,17 +24,17 @@ namespace Pango { public partial struct Matrix { - static Matrix () - { - Identity.Xx = 1.0; - Identity.Xy = 0.0; - Identity.Yx = 0.0; - Identity.Yy = 1.0; - Identity.X0 = 0.0; - Identity.Y0 = 0.0; - } + static Matrix () + { + Identity.Xx = 1.0; + Identity.Xy = 0.0; + Identity.Yx = 0.0; + Identity.Yy = 1.0; + Identity.X0 = 0.0; + Identity.Y0 = 0.0; + } - public static Matrix Identity; + public static Matrix Identity; } }