[hyena/canvas] [Hyena.Gui] Add Pango.Layout.Height extension methods
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena/canvas] [Hyena.Gui] Add Pango.Layout.Height extension methods
- Date: Fri, 22 Oct 2010 21:33:14 +0000 (UTC)
commit 96c0d574c9bf8f5896aa3829a2765e5f4b63fbc6
Author: Gabriel Burt <gabriel burt gmail com>
Date: Fri Oct 22 13:01:20 2010 -0500
[Hyena.Gui] Add Pango.Layout.Height extension methods
Hyena.Gui/Hyena.Gui.dll.config | 2 ++
Hyena.Gui/Hyena.Gui/PangoExtensions.cs | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui.dll.config b/Hyena.Gui/Hyena.Gui.dll.config
index abc0d01..d9e6021 100644
--- a/Hyena.Gui/Hyena.Gui.dll.config
+++ b/Hyena.Gui/Hyena.Gui.dll.config
@@ -6,6 +6,7 @@
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so.0" os="!windows,osx"/>
<dllmap dll="libpangocairo-1.0-0.dll" target="libpangocairo-1.0.so.0" os="!windows,osx"/>
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows,osx"/>
+ <dllmap dll="libpango-1.0-0.dll" target="libpango-1.0.so.0" os="!windows,osx"/>
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-quartz-2.0.dylib" os="osx"/>
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-quartz-2.0.dylib" os="osx"/>
@@ -13,5 +14,6 @@
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.dylib" os="osx"/>
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.dylib" os="osx"/>
<dllmap dll="libpangocairo-1.0-0.dll" target="libpangocairo-1.0.dylib" os="osx"/>
+ <dllmap dll="libpango-1.0-0.dll" target="libpango-1.0.dylib" os="osx"/>
<dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
</configuration>
diff --git a/Hyena.Gui/Hyena.Gui/PangoExtensions.cs b/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
index 2b2b7a7..f59757c 100644
--- a/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
+++ b/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
@@ -26,6 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
+using System.Runtime.InteropServices;
using System.Linq;
using Pango;
@@ -46,6 +47,22 @@ namespace Hyena.Gui
}
}
+ [DllImport("libpango-1.0-0.dll")]
+ static extern int pango_layout_get_height(IntPtr raw);
+ public static int GetHeight (this Pango.Layout layout)
+ {
+ int raw_ret = pango_layout_get_height(layout.Handle);
+ int ret = raw_ret;
+ return ret;
+ }
+
+ [DllImport("libpango-1.0-0.dll")]
+ static extern void pango_layout_set_height(IntPtr raw, int height);
+ public static void SetHeight (this Pango.Layout layout, int height)
+ {
+ pango_layout_set_height (layout.Handle, height);
+ }
+
public static string FormatEscaped (this string format, params object [] args)
{
return String.Format (format, args.Select (a => a == null ? "" : GLib.Markup.EscapeText (a.ToString ())).ToArray ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]