示例#1
0
        public static void ShowGlyphItem(Cairo.Context cr, string text, Pango.GlyphItem glyph_item)
        {
            IntPtr native_text       = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc(glyph_item);

            pango_cairo_show_glyph_item(cr == null ? IntPtr.Zero : cr.Handle, native_text, native_glyph_item);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_glyph_item);
        }
示例#2
0
        public void DrawGlyphItem(string text, Pango.GlyphItem glyph_item, int x, int y)
        {
            IntPtr native_text       = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc(glyph_item);

            pango_renderer_draw_glyph_item(Handle, native_text, native_glyph_item, x, y);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_glyph_item);
        }
示例#3
0
        public Pango.GlyphItem Split(string text, int split_index)
        {
            IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(this));

            System.Runtime.InteropServices.Marshal.StructureToPtr(this, this_as_native, false);
            IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr raw_ret     = pango_glyph_item_split(this_as_native, native_text, split_index);

            Pango.GlyphItem ret = Pango.GlyphItem.New(raw_ret);
            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            GLib.Marshaller.Free(native_text);
            return(ret);
        }
示例#4
0
        private void InternalDrawGlyphItem(string text, Pango.GlyphItem glyph_item, int x, int y)
        {
            DrawGlyphItemNativeDelegate unmanaged = class_abi.BaseOverride <DrawGlyphItemNativeDelegate>(this.LookupGType(), "draw_glyph_item");

            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_text       = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc(glyph_item);

            unmanaged(this.Handle, native_text, native_glyph_item, x, y);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_glyph_item);
        }
示例#5
0
        public bool InitStart(Pango.GlyphItem glyph_item, string text)
        {
            IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(this));

            System.Runtime.InteropServices.Marshal.StructureToPtr(this, this_as_native, false);
            IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc(glyph_item);
            IntPtr native_text       = GLib.Marshaller.StringToPtrGStrdup(text);
            bool   raw_ret           = pango_glyph_item_iter_init_start(this_as_native, native_glyph_item, native_text);
            bool   ret = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            Marshal.FreeHGlobal(native_glyph_item);
            GLib.Marshaller.Free(native_text);
            return(ret);
        }
示例#6
0
        private void InternalDrawGlyphItem(string text, Pango.GlyphItem glyph_item, int x, int y)
        {
            DrawGlyphItemNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("draw_glyph_item"));
                unmanaged = (DrawGlyphItemNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DrawGlyphItemNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_text       = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc(glyph_item);

            unmanaged(this.Handle, native_text, native_glyph_item, x, y);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_glyph_item);
        }
示例#7
0
 protected virtual void OnDrawGlyphItem(string text, Pango.GlyphItem glyph_item, int x, int y)
 {
     InternalDrawGlyphItem(text, glyph_item, x, y);
 }
示例#8
0
 static extern IntPtr pango_glyph_item_apply_attrs(ref Pango.GlyphItem raw, IntPtr text, IntPtr list);
示例#9
0
 static void ReadNative(IntPtr native, ref Pango.GlyphItem target)
 {
     target = New(native);
 }