Author: mkestner
Date: 2005-05-11 16:27:00 -0400 (Wed, 11 May 2005)
New Revision: 44410

Added:
   trunk/gtk-sharp/doc/en/Pango/Units.xml
   trunk/gtk-sharp/pango/Units.cs
   trunk/gtk-sharp/pango/glue/units.c
Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/pango/Makefile.am
   trunk/gtk-sharp/pango/glue/Makefile.am
   trunk/gtk-sharp/pango/glue/makefile.win32
Log:

2005-05-11  Mike Kestner  <[EMAIL PROTECTED]>

        * pango/Makefile.am : add file.
        * pango/Units.cs : new class to wrap PANGO_SCALE and PANGO_PIXELS.
        * pango/glue/units.c : accessors for the macros.
        * pango/glue/Makefile.am : build it.
        * pango/glue/makefile.win32 : build it on win.
        [Fixes #74837]


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2005-05-11 19:41:45 UTC (rev 44409)
+++ trunk/gtk-sharp/ChangeLog   2005-05-11 20:27:00 UTC (rev 44410)
@@ -1,3 +1,12 @@
+2005-05-11  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * pango/Makefile.am : add file.
+       * pango/Units.cs : new class to wrap PANGO_SCALE and PANGO_PIXELS.
+       * pango/glue/units.c : accessors for the macros.
+       * pango/glue/Makefile.am : build it.
+       * pango/glue/makefile.win32 : build it on win.
+       [Fixes #74837]
+
 2005-05-11  Eric Butler  <[EMAIL PROTECTED]>
 
        * gtk/Gtk.metadata : add IEnumerable iface to ListStore.

Added: trunk/gtk-sharp/doc/en/Pango/Units.xml
===================================================================
--- trunk/gtk-sharp/doc/en/Pango/Units.xml      2005-05-11 19:41:45 UTC (rev 
44409)
+++ trunk/gtk-sharp/doc/en/Pango/Units.xml      2005-05-11 20:27:00 UTC (rev 
44410)
@@ -0,0 +1,54 @@
+<Type Name="Units" FullName="Pango.Units">
+  <TypeSignature Language="C#" Value="public class Units" Maintainer="auto" />
+  <AssemblyInfo>
+    <AssemblyName>pango-sharp</AssemblyName>
+    <AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 
00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 
EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 
03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 
A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 
70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 
21 26 CB 36 89 C2 EA 64 96 A4 7C B4]</AssemblyPublicKey>
+    <AssemblyVersion>2.0.0.0</AssemblyVersion>
+    <AssemblyCulture>neutral</AssemblyCulture>
+    <Attributes />
+  </AssemblyInfo>
+  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the 
<link location="node:gtk-sharp/programming/threads">Gtk# Thread 
Programming</link> for details.</ThreadSafetyStatement>
+  <Docs>
+    <summary>Converts between Device units and Pango Units.</summary>
+    <remarks />
+  </Docs>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Attributes />
+  <Members>
+    <Member MemberName="FromPixels">
+      <MemberSignature Language="C#" Value="public static int FromPixels (int 
pixels);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="pixels" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <summary>Converts from Device units to Pango Units.</summary>
+        <param name="pixels">a <see cref="T:System.Int32" /></param>
+        <returns>a <see cref="T:System.Int32" /></returns>
+        <remarks />
+      </Docs>
+    </Member>
+    <Member MemberName="ToPixels">
+      <MemberSignature Language="C#" Value="public static int ToPixels (int 
units);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="units" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <summary>Converts from Pango Units to Device Units.</summary>
+        <param name="units">a <see cref="T:System.Int32" /></param>
+        <returns>a <see cref="T:System.Int32" /></returns>
+        <remarks />
+      </Docs>
+    </Member>
+  </Members>
+</Type>

Modified: trunk/gtk-sharp/pango/Makefile.am
===================================================================
--- trunk/gtk-sharp/pango/Makefile.am   2005-05-11 19:41:45 UTC (rev 44409)
+++ trunk/gtk-sharp/pango/Makefile.am   2005-05-11 20:27:00 UTC (rev 44410)
@@ -26,7 +26,8 @@
        AttrUnderline.cs        \
        AttrVariant.cs          \
        AttrWeight.cs           \
-       Scale.cs
+       Scale.cs                \
+       Units.cs
 
 customs =                      \
        AttrIterator.custom     \

Added: trunk/gtk-sharp/pango/Units.cs
===================================================================
--- trunk/gtk-sharp/pango/Units.cs      2005-05-11 19:41:45 UTC (rev 44409)
+++ trunk/gtk-sharp/pango/Units.cs      2005-05-11 20:27:00 UTC (rev 44410)
@@ -0,0 +1,47 @@
+// Pango.Units.cs - Unit to pixel mapping class.
+//
+// Author: Mike Kestner <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2005 Novell, Inc.
+//
+// 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.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+namespace Pango {
+
+       using System;
+       using System.Runtime.InteropServices;
+
+       public class Units {
+
+               private Units () {}
+               
+               [DllImport("pangosharpglue-2")]
+               static extern int pangosharp_pixels (int units);
+
+               [DllImport("pangosharpglue-2")]
+               static extern int pangosharp_scale ();
+
+               public static int FromPixels (int pixels)
+               {
+                       return pixels * pangosharp_scale ();
+               }
+
+               public static int ToPixels (int units)
+               {
+                       return pangosharp_pixels (units);
+               }
+
+       }
+}

Modified: trunk/gtk-sharp/pango/glue/Makefile.am
===================================================================
--- trunk/gtk-sharp/pango/glue/Makefile.am      2005-05-11 19:41:45 UTC (rev 
44409)
+++ trunk/gtk-sharp/pango/glue/Makefile.am      2005-05-11 20:27:00 UTC (rev 
44410)
@@ -2,7 +2,8 @@
 
 libpangosharpglue_2_la_SOURCES =       \
        attribute.c                     \
-       layoutline.c
+       layoutline.c                    \
+       units.c
 
 # Adding a new glue file?
 # Please remember to update makefile.win32

Modified: trunk/gtk-sharp/pango/glue/makefile.win32
===================================================================
--- trunk/gtk-sharp/pango/glue/makefile.win32   2005-05-11 19:41:45 UTC (rev 
44409)
+++ trunk/gtk-sharp/pango/glue/makefile.win32   2005-05-11 20:27:00 UTC (rev 
44410)
@@ -6,6 +6,7 @@
 GLUE_OBJS = \
        attribute.c     \
         layoutline.o   \
+       units.o         \
        win32dll.o
 
 all: pangosharpglue-2.dll

Added: trunk/gtk-sharp/pango/glue/units.c
===================================================================
--- trunk/gtk-sharp/pango/glue/units.c  2005-05-11 19:41:45 UTC (rev 44409)
+++ trunk/gtk-sharp/pango/glue/units.c  2005-05-11 20:27:00 UTC (rev 44410)
@@ -0,0 +1,39 @@
+/* units.c : Glue to access unit macros.
+ *
+ * Author: Mike Kestner  <[EMAIL PROTECTED]>
+ *
+ * Copyright (c) 2005 Novell, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <pango/pango.h>
+
+/* Forward declarations */
+int pangosharp_scale (void);
+int pangosharp_pixels (int units);
+/* */
+
+gint 
+pangosharp_scale ()
+{
+       return PANGO_SCALE;
+}
+
+gint 
+pangosharp_pixels (gint units)
+{
+       return PANGO_PIXELS (units);
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to