From 094a49f69a7423393a88cbcf1c8b3aeea9c8c3ff Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 5 Aug 2012 17:51:13 +0200 Subject: [PATCH] pango: Move all .custom files to partial classes No real code change, just renaming and adding boilerplate. Files will be re-indented in another commit, to avoid confusing git. --- pango/{Analysis.custom => Analysis.cs} | 13 ++++-- .../{AttrIterator.custom => AttrIterator.cs} | 12 +++-- pango/{AttrList.custom => AttrList.cs} | 14 ++++-- pango/{Context.custom => Context.cs} | 14 ++++-- pango/{Coverage.custom => Coverage.cs} | 14 ++++-- pango/{FontFamily.custom => FontFamily.cs} | 14 ++++-- pango/{FontMap.custom => FontMap.cs} | 14 ++++-- pango/{Global.custom => Global.cs} | 13 ++++-- pango/{GlyphItem.custom => GlyphItem.cs} | 12 +++-- pango/{GlyphString.custom => GlyphString.cs} | 12 +++-- pango/{Item.custom => Item.cs} | 12 +++-- pango/{Layout.custom => Layout.cs} | 13 ++++-- pango/{LayoutLine.custom => LayoutLine.cs} | 13 ++++-- pango/{LayoutRun.custom => LayoutRun.cs} | 12 +++-- pango/Makefile.am | 44 +++++++++---------- pango/{Matrix.custom => Matrix.cs} | 12 +++-- pango/{TabArray.custom => TabArray.cs} | 14 ++++-- pango/{Units.custom => Units.cs} | 11 ++++- 18 files changed, 182 insertions(+), 81 deletions(-) rename pango/{Analysis.custom => Analysis.cs} (93%) rename pango/{AttrIterator.custom => AttrIterator.cs} (92%) rename pango/{AttrList.custom => AttrList.cs} (90%) rename pango/{Context.custom => Context.cs} (92%) rename pango/{Coverage.custom => Coverage.cs} (88%) rename pango/{FontFamily.custom => FontFamily.cs} (91%) rename pango/{FontMap.custom => FontMap.cs} (92%) rename pango/{Global.custom => Global.cs} (92%) rename pango/{GlyphItem.custom => GlyphItem.cs} (90%) rename pango/{GlyphString.custom => GlyphString.cs} (88%) rename pango/{Item.custom => Item.cs} (89%) rename pango/{Layout.custom => Layout.cs} (95%) rename pango/{LayoutLine.custom => LayoutLine.cs} (92%) rename pango/{LayoutRun.custom => LayoutRun.cs} (87%) rename pango/{Matrix.custom => Matrix.cs} (88%) rename pango/{TabArray.custom => TabArray.cs} (90%) rename pango/{Units.custom => Units.cs} (89%) diff --git a/pango/Analysis.custom b/pango/Analysis.cs similarity index 93% rename from pango/Analysis.custom rename to pango/Analysis.cs index 3a44c58f7..c5c852ddb 100644 --- a/pango/Analysis.custom +++ b/pango/Analysis.cs @@ -1,11 +1,9 @@ -// Pango.Analysis.custom - Pango Analysis class customizations +// Pango.Analysis.cs - Pango Analysis class customizations // // Authors: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial struct Analysis { + public Attribute[] ExtraAttrs { get { GLib.SList list = new GLib.SList (_extra_attrs, typeof (IntPtr)); @@ -62,4 +66,5 @@ } set { _language = value == null ? IntPtr.Zero : value.Handle; } } - + } +} diff --git a/pango/AttrIterator.custom b/pango/AttrIterator.cs similarity index 92% rename from pango/AttrIterator.custom rename to pango/AttrIterator.cs index 30d92c728..416bfb347 100644 --- a/pango/AttrIterator.custom +++ b/pango/AttrIterator.cs @@ -1,11 +1,9 @@ -// Pango.AttrIterator.custom - Pango AttrIterator class customizations +// Pango.AttrIterator.cs - Pango AttrIterator class customizations // // Author: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class AttrIterator { [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void pango_attr_iterator_get_font(IntPtr raw, IntPtr desc, out IntPtr language, out IntPtr extra_attrs); @@ -58,3 +62,5 @@ return attrs; } } + } +} diff --git a/pango/AttrList.custom b/pango/AttrList.cs similarity index 90% rename from pango/AttrList.custom rename to pango/AttrList.cs index 8c415c798..f9870ba54 100644 --- a/pango/AttrList.custom +++ b/pango/AttrList.cs @@ -1,11 +1,9 @@ -// Pango.AttrList.custom - Pango AttrList customizations +// Pango.AttrList.cs - Pango AttrList customizations // // Authors: Mike Kestner // // Copyright (c) 2008 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class AttrList { + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_attribute_copy (IntPtr raw); @@ -38,4 +43,5 @@ { pango_attr_list_insert_before (Handle, pango_attribute_copy (attr.Handle)); } - + } +} diff --git a/pango/Context.custom b/pango/Context.cs similarity index 92% rename from pango/Context.custom rename to pango/Context.cs index 3fc230e4a..a67778e09 100644 --- a/pango/Context.custom +++ b/pango/Context.cs @@ -1,11 +1,9 @@ -// Pango.Context.custom - Pango Context class customizations +// Pango.Context.cs - Pango Context class customizations // // Authors: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class Context { + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); @@ -53,4 +58,5 @@ pango_context_list_families(Handle, families.Handle, out n_families); return n_families; } - + } +} diff --git a/pango/Coverage.custom b/pango/Coverage.cs similarity index 88% rename from pango/Coverage.custom rename to pango/Coverage.cs index 8dc04fd04..3ed728485 100644 --- a/pango/Coverage.custom +++ b/pango/Coverage.cs @@ -1,11 +1,9 @@ -// Pango.Coverage.custom - Pango Coverage class customizations +// Pango.Coverage.cs - Pango Coverage class customizations // // Author: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class Coverage { + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); @@ -35,4 +40,5 @@ Marshal.Copy (array_ptr, bytes, 0, count); g_free (array_ptr); } - + } +} diff --git a/pango/FontFamily.custom b/pango/FontFamily.cs similarity index 91% rename from pango/FontFamily.custom rename to pango/FontFamily.cs index 271a377bc..ebd71f3bb 100644 --- a/pango/FontFamily.custom +++ b/pango/FontFamily.cs @@ -1,11 +1,9 @@ -// Pango.FontFamily.custom - Pango FontFamily class customizations +// Pango.FontFamily.cs - Pango FontFamily class customizations // // Authors: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class FontFamily { + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); @@ -53,4 +58,5 @@ pango_font_family_list_faces(Handle, faces.Handle, out n_faces); return n_faces; } - + } +} diff --git a/pango/FontMap.custom b/pango/FontMap.cs similarity index 92% rename from pango/FontMap.custom rename to pango/FontMap.cs index bfbc5acf3..cee7053f4 100644 --- a/pango/FontMap.custom +++ b/pango/FontMap.cs @@ -1,11 +1,9 @@ -// Pango.FontMap.custom - Pango FontMap class customizations +// Pango.FontMap.cs - Pango FontMap class customizations // // Authors: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class FontMap { + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); @@ -53,4 +58,5 @@ pango_font_map_list_families(Handle, families.Handle, out n_families); return n_families; } - + } +} diff --git a/pango/Global.custom b/pango/Global.cs similarity index 92% rename from pango/Global.custom rename to pango/Global.cs index 9faa86097..bc5bfc49f 100644 --- a/pango/Global.custom +++ b/pango/Global.cs @@ -1,11 +1,9 @@ -// Pango.Global.custom - Pango Global class customizations +// Pango.Global.cs - Pango Global class customizations // // Authors: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class Global { + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern bool pango_scan_int(IntPtr pos, out int out_param); @@ -48,5 +53,7 @@ attrs = new Pango.AttrList (attrs_handle); return result; } + } +} diff --git a/pango/GlyphItem.custom b/pango/GlyphItem.cs similarity index 90% rename from pango/GlyphItem.custom rename to pango/GlyphItem.cs index ee81300c0..1b7e1468d 100644 --- a/pango/GlyphItem.custom +++ b/pango/GlyphItem.cs @@ -1,11 +1,9 @@ -// Pango.GlyphItem.custom - Pango GlyphItem class customizations +// Pango.GlyphItem.cs - Pango GlyphItem class customizations // // Author: Mike Kestner // // Copyright (c) 2004-2005 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial struct GlyphItem { [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_glyph_item_apply_attrs(ref Pango.GlyphItem raw, IntPtr text, IntPtr list); @@ -48,3 +52,5 @@ public Pango.Item item { get { return Item; } } + } +} diff --git a/pango/GlyphString.custom b/pango/GlyphString.cs similarity index 88% rename from pango/GlyphString.custom rename to pango/GlyphString.cs index c2545165e..8440db476 100644 --- a/pango/GlyphString.custom +++ b/pango/GlyphString.cs @@ -1,9 +1,7 @@ -// Pango.GlyphString.custom - Pango GlyphString class customizations +// Pango.GlyphString.cs - Pango GlyphString class customizations // // Copyright (c) 2005 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -18,6 +16,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial class GlyphString { + [Obsolete("Pango.GlyphString is a reference type now, use null")] public static GlyphString Zero = null; @@ -32,3 +36,5 @@ { return new GlyphString (); } + } +} diff --git a/pango/Item.custom b/pango/Item.cs similarity index 89% rename from pango/Item.custom rename to pango/Item.cs index 983f488ce..a159361e6 100644 --- a/pango/Item.custom +++ b/pango/Item.cs @@ -1,9 +1,7 @@ -// Pango.Item.custom - Pango Item class customizations +// Pango.Item.cs - Pango Item class customizations // // Copyright (c) 2005 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -18,6 +16,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial class Item { + [Obsolete("Pango.Item is a reference type now, use null")] public static Item Zero = null; @@ -32,3 +36,5 @@ { return new Item (); } + } +} diff --git a/pango/Layout.custom b/pango/Layout.cs similarity index 95% rename from pango/Layout.custom rename to pango/Layout.cs index ff4401afd..359696bfb 100644 --- a/pango/Layout.custom +++ b/pango/Layout.cs @@ -1,12 +1,10 @@ -// Pango.Layout.custom - Pango Layout class customizations +// Pango.Layout.cs - Pango Layout class customizations // // Authors: Pedro Abelleira Seco // Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -21,6 +19,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class Layout { + [DllImport ("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr pango_layout_get_lines(IntPtr raw); @@ -92,3 +97,5 @@ public void SetMarkupWithAccel (string markup, char accel_marker, out char accel pango_layout_set_markup (Handle, native_markup, -1); GLib.Marshaller.Free (native_markup); } + } +} diff --git a/pango/LayoutLine.custom b/pango/LayoutLine.cs similarity index 92% rename from pango/LayoutLine.custom rename to pango/LayoutLine.cs index 8f59dbe03..7b92e0890 100644 --- a/pango/LayoutLine.custom +++ b/pango/LayoutLine.cs @@ -1,12 +1,10 @@ -// Pango.LayoutLine.custom - Pango LayoutLine class customizations +// Pango.LayoutLine.cs - Pango LayoutLine class customizations // // Authors: Jeroen Zwartepoorte // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -21,6 +19,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + 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); @@ -45,4 +49,5 @@ public void GetXRanges(int start_index, int end_index, out int[][] ranges) g_free (array_ptr); #endif } - + } +} diff --git a/pango/LayoutRun.custom b/pango/LayoutRun.cs similarity index 87% rename from pango/LayoutRun.custom rename to pango/LayoutRun.cs index 787d118bf..5356da92b 100644 --- a/pango/LayoutRun.custom +++ b/pango/LayoutRun.cs @@ -1,9 +1,7 @@ -// Pango.LayoutRun.custom - Pango.LayoutRun class customizations +// Pango.LayoutRun.cs - Pango.LayoutRun class customizations // // Copyright (c) 2005 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -18,6 +16,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial struct LayoutRun { + [Obsolete ("Replaced by Glyphs property")] public Pango.GlyphString glyphs { get { return Glyphs; } @@ -27,3 +31,5 @@ public Pango.Item item { get { return Item; } } + } +} diff --git a/pango/Makefile.am b/pango/Makefile.am index ed85ae85e..b0f726fb3 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -8,7 +8,7 @@ references = $(top_builddir)/glib/glib-sharp.dll $(top_builddir)/cairo/cairo-sha glue_includes = pango/pango.h sources = \ - Attribute.cs \ + Analysis.cs \ AttrBackground.cs \ AttrColor.cs \ AttrFallback.cs \ @@ -18,42 +18,40 @@ sources = \ AttrForeground.cs \ AttrGravity.cs \ AttrGravityHint.cs \ + Attribute.cs \ AttrInt.cs \ + AttrIterator.cs \ AttrLanguage.cs \ AttrLetterSpacing.cs \ + AttrList.cs \ AttrRise.cs \ AttrScale.cs \ AttrShape.cs \ AttrSize.cs \ AttrStretch.cs \ - AttrStrikethroughColor.cs \ AttrStrikethrough.cs \ + AttrStrikethroughColor.cs \ AttrStyle.cs \ - AttrUnderlineColor.cs \ AttrUnderline.cs \ + AttrUnderlineColor.cs \ AttrVariant.cs \ AttrWeight.cs \ + Context.cs \ + Coverage.cs \ + FontFamily.cs \ + FontMap.cs \ + Global.cs \ + GlyphItem.cs \ + GlyphString.cs \ + Item.cs \ + Layout.cs \ + LayoutLine.cs \ + LayoutRun.cs \ + Matrix.cs \ Scale.cs \ - ScriptIter.cs - -customs = \ - Analysis.custom \ - AttrIterator.custom \ - AttrList.custom \ - Context.custom \ - Coverage.custom \ - FontFamily.custom \ - FontMap.custom \ - Global.custom \ - GlyphItem.custom \ - GlyphString.custom \ - Item.custom \ - Layout.custom \ - LayoutLine.custom \ - LayoutRun.custom \ - Matrix.custom \ - TabArray.custom \ - Units.custom + ScriptIter.cs \ + TabArray.cs \ + Units.cs add_dist = diff --git a/pango/Matrix.custom b/pango/Matrix.cs similarity index 88% rename from pango/Matrix.custom rename to pango/Matrix.cs index 8c84561fc..7c9dbddb1 100644 --- a/pango/Matrix.custom +++ b/pango/Matrix.cs @@ -1,11 +1,9 @@ -// Pango.Matrix.custom - Pango Matrix class customizations +// Pango.Matrix.cs - Pango Matrix class customizations // // Authors: John Luke // // Copyright (c) 2005 John Luke. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial struct Matrix { + static Matrix () { Identity.Xx = 1.0; @@ -32,3 +36,5 @@ public static Matrix Identity; + } +} diff --git a/pango/TabArray.custom b/pango/TabArray.cs similarity index 90% rename from pango/TabArray.custom rename to pango/TabArray.cs index 755809263..9892edc4f 100644 --- a/pango/TabArray.custom +++ b/pango/TabArray.cs @@ -1,11 +1,9 @@ -// Pango.TabArray.custom - Pango TabArray class customizations +// Pango.TabArray.cs - Pango TabArray class customizations // // Author: Mike Kestner // // Copyright (c) 2004 Novell, Inc. // -// This code is inserted after the automatically generated code. -// // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. @@ -20,6 +18,13 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + using System.Runtime.InteropServices; + + public partial class TabArray { + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr raw); @@ -43,4 +48,5 @@ g_free (align_ptr); g_free (loc_ptr); } - + } +} diff --git a/pango/Units.custom b/pango/Units.cs similarity index 89% rename from pango/Units.custom rename to pango/Units.cs index 663ee8981..47c450412 100644 --- a/pango/Units.custom +++ b/pango/Units.cs @@ -1,4 +1,4 @@ -// Pango.Units.custom - Unit customizations. +// Pango.Units.cs - Unit customizations. // // Author: Mike Kestner // @@ -18,6 +18,12 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +namespace Pango { + + using System; + + public partial class Units { + private Units () {} public static int FromPixels (int pixels) @@ -29,4 +35,5 @@ { return (units + 512) >> 10; } - + } +}