diff --git a/ChangeLog b/ChangeLog index ad309c8bc..750348a78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-05-11 Mike Kestner + + * 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 * gtk/Gtk.metadata : add IEnumerable iface to ListStore. diff --git a/doc/en/Pango/Units.xml b/doc/en/Pango/Units.xml new file mode 100644 index 000000000..c4841a407 --- /dev/null +++ b/doc/en/Pango/Units.xml @@ -0,0 +1,54 @@ + + + + pango-sharp + [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] + 2.0.0.0 + neutral + + + Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. + + Converts between Device units and Pango Units. + + + + System.Object + + + + + + + Method + + System.Int32 + + + + + + Converts from Device units to Pango Units. + a + a + + + + + + Method + + System.Int32 + + + + + + Converts from Pango Units to Device Units. + a + a + + + + + diff --git a/pango/Makefile.am b/pango/Makefile.am index bebbb56a1..179667908 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -26,7 +26,8 @@ sources = \ AttrUnderline.cs \ AttrVariant.cs \ AttrWeight.cs \ - Scale.cs + Scale.cs \ + Units.cs customs = \ AttrIterator.custom \ diff --git a/pango/Units.cs b/pango/Units.cs new file mode 100644 index 000000000..d43fa4a52 --- /dev/null +++ b/pango/Units.cs @@ -0,0 +1,47 @@ +// Pango.Units.cs - Unit to pixel mapping class. +// +// Author: Mike Kestner +// +// 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); + } + + } +} diff --git a/pango/glue/Makefile.am b/pango/glue/Makefile.am index 257258290..5d3406f66 100644 --- a/pango/glue/Makefile.am +++ b/pango/glue/Makefile.am @@ -2,7 +2,8 @@ lib_LTLIBRARIES = libpangosharpglue-2.la libpangosharpglue_2_la_SOURCES = \ attribute.c \ - layoutline.c + layoutline.c \ + units.c # Adding a new glue file? # Please remember to update makefile.win32 diff --git a/pango/glue/makefile.win32 b/pango/glue/makefile.win32 index 6acc93d6c..5330a2ce3 100644 --- a/pango/glue/makefile.win32 +++ b/pango/glue/makefile.win32 @@ -6,6 +6,7 @@ DLLWRAP=dllwrap -mno-cygwin -mms-bitfields --target i386-mingw32 --export-all-sy GLUE_OBJS = \ attribute.c \ layoutline.o \ + units.o \ win32dll.o all: pangosharpglue-2.dll diff --git a/pango/glue/units.c b/pango/glue/units.c new file mode 100644 index 000000000..1f400ab44 --- /dev/null +++ b/pango/glue/units.c @@ -0,0 +1,39 @@ +/* units.c : Glue to access unit macros. + * + * Author: Mike Kestner + * + * 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 + +/* 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); +}