2005-05-11 Mike Kestner <mkestner@novell.com>
* 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] svn path=/trunk/gtk-sharp/; revision=44410
This commit is contained in:
parent
caec90e311
commit
07df433712
7 changed files with 154 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-05-11 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* 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 <eric@extremeboredom.net>
|
||||
|
||||
* gtk/Gtk.metadata : add IEnumerable iface to ListStore.
|
||||
|
|
54
doc/en/Pango/Units.xml
Normal file
54
doc/en/Pango/Units.xml
Normal file
|
@ -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>
|
|
@ -26,7 +26,8 @@ sources = \
|
|||
AttrUnderline.cs \
|
||||
AttrVariant.cs \
|
||||
AttrWeight.cs \
|
||||
Scale.cs
|
||||
Scale.cs \
|
||||
Units.cs
|
||||
|
||||
customs = \
|
||||
AttrIterator.custom \
|
||||
|
|
47
pango/Units.cs
Normal file
47
pango/Units.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Pango.Units.cs - Unit to pixel mapping class.
|
||||
//
|
||||
// Author: Mike Kestner <mkestner@novell.com>
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
39
pango/glue/units.c
Normal file
39
pango/glue/units.c
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* units.c : Glue to access unit macros.
|
||||
*
|
||||
* Author: Mike Kestner <mkestner@novell.com>
|
||||
*
|
||||
* 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);
|
||||
}
|
Loading…
Reference in a new issue