56
[DllImport("libpangocairo-1.0-0.dll", CallingConvention=CallingConvention.Cdecl)]
57
static extern void pango_cairo_show_layout (IntPtr cr, IntPtr layout);
59
public static void ShowLayout (this Cairo.Context cr, Pango.Layout layout)
61
pango_cairo_show_layout (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle);
64
[DllImport("libpangocairo-1.0-0.dll", CallingConvention=CallingConvention.Cdecl)]
65
static extern IntPtr pango_cairo_create_layout (IntPtr cr);
67
public static Pango.Layout CreateLayout (this Cairo.Context cr)
69
IntPtr raw_ret = pango_cairo_create_layout (cr == null ? IntPtr.Zero : cr.Handle);
70
return GLib.Object.GetObject (raw_ret) as Pango.Layout;
73
[DllImport("libpangocairo-1.0-0.dll", CallingConvention=CallingConvention.Cdecl)]
74
static extern void pango_cairo_layout_path (IntPtr cr, IntPtr layout);
76
public static void LayoutPath (this Cairo.Context cr, Pango.Layout layout)
78
pango_cairo_layout_path (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle);
81
[DllImport("libpangocairo-1.0-0.dll", CallingConvention=CallingConvention.Cdecl)]
82
static extern void pango_cairo_context_set_resolution (IntPtr pango_context, double dpi);
84
public static void ContextSetResolution (this Pango.Context context, double dpi)
86
pango_cairo_context_set_resolution (context == null ? IntPtr.Zero : context.Handle, dpi);
89
[DllImport("libpangocairo-1.0-0.dll", CallingConvention=CallingConvention.Cdecl)]
90
static extern IntPtr pango_layout_get_context (IntPtr layout);
92
public static string GetColorString (Gdk.Color color)
94
return string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256);
97
public static Pango.Context LayoutGetContext (this Pango.Layout layout)
99
IntPtr handle = pango_layout_get_context (layout.Handle);
100
return handle.Equals (IntPtr.Zero) ? null : GLib.Object.GetObject (handle) as Pango.Context;
103
public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1, double y1, double x2, double y2)
111
public static void Line (this Cairo.Context cr, double x1, double y1, double x2, double y2)
117
public static void SharpLineX (this Cairo.Context cr, double x1, double y1, double x2, double y2)
119
cr.MoveTo (x1 + 0.5, y1);
120
cr.LineTo (x2 + 0.5, y2);
123
public static void SharpLineY (this Cairo.Context cr, double x1, double y1, double x2, double y2)
125
cr.MoveTo (x1, y1 + 0.5);
126
cr.LineTo (x2, y2 + 0.5);