public void GetCropBox(Poppler.Rectangle rect) { IntPtr native_rect = GLib.Marshaller.StructureToPtrAlloc(rect); poppler_page_get_crop_box(Handle, native_rect); rect = Poppler.Rectangle.New(native_rect); Marshal.FreeHGlobal(native_rect); }
public string GetText(Poppler.SelectionStyle style, Poppler.Rectangle rect) { IntPtr native_rect = GLib.Marshaller.StructureToPtrAlloc(rect); IntPtr raw_ret = poppler_page_get_text(Handle, (int)style, native_rect); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); rect = Poppler.Rectangle.New(native_rect); Marshal.FreeHGlobal(native_rect); return(ret); }
public Poppler.Rectangle Copy() { 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 raw_ret = poppler_rectangle_copy(this_as_native); Poppler.Rectangle ret = Poppler.Rectangle.New(raw_ret); ReadNative(this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native); return(ret); }
public void RenderSelection(Cairo.Context cairo, Poppler.Rectangle selection, Poppler.Rectangle old_selection, Poppler.SelectionStyle style, Poppler.Color glyph_color, Poppler.Color background_color) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc(selection); IntPtr native_old_selection = GLib.Marshaller.StructureToPtrAlloc(old_selection); IntPtr native_glyph_color = GLib.Marshaller.StructureToPtrAlloc(glyph_color); IntPtr native_background_color = GLib.Marshaller.StructureToPtrAlloc(background_color); poppler_page_render_selection(Handle, cairo == null ? IntPtr.Zero : cairo.Handle, native_selection, native_old_selection, (int)style, native_glyph_color, native_background_color); selection = Poppler.Rectangle.New(native_selection); Marshal.FreeHGlobal(native_selection); old_selection = Poppler.Rectangle.New(native_old_selection); Marshal.FreeHGlobal(native_old_selection); glyph_color = Poppler.Color.New(native_glyph_color); Marshal.FreeHGlobal(native_glyph_color); background_color = Poppler.Color.New(native_background_color); Marshal.FreeHGlobal(native_background_color); }
static void ReadNative(IntPtr native, ref Poppler.Rectangle target) { target = New(native); }
public GLib.List GetSelectionRegion(double scale, Poppler.SelectionStyle style, Poppler.Rectangle selection) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc(selection); IntPtr raw_ret = poppler_page_get_selection_region(Handle, scale, (int)style, native_selection); GLib.List ret = new GLib.List(raw_ret); selection = Poppler.Rectangle.New(native_selection); Marshal.FreeHGlobal(native_selection); return(ret); }
public void RenderSelectionToPixbuf(double scale, int rotation, Gdk.Pixbuf pixbuf, Poppler.Rectangle selection, Poppler.Rectangle old_selection, Poppler.SelectionStyle style, Gdk.Color glyph_color, Gdk.Color background_color) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc(selection); IntPtr native_old_selection = GLib.Marshaller.StructureToPtrAlloc(old_selection); IntPtr native_glyph_color = GLib.Marshaller.StructureToPtrAlloc(glyph_color); IntPtr native_background_color = GLib.Marshaller.StructureToPtrAlloc(background_color); poppler_page_render_selection_to_pixbuf(Handle, scale, rotation, pixbuf == null ? IntPtr.Zero : pixbuf.Handle, native_selection, native_old_selection, (int)style, native_glyph_color, native_background_color); selection = Poppler.Rectangle.New(native_selection); Marshal.FreeHGlobal(native_selection); old_selection = Poppler.Rectangle.New(native_old_selection); Marshal.FreeHGlobal(native_old_selection); glyph_color = Gdk.Color.New(native_glyph_color); Marshal.FreeHGlobal(native_glyph_color); background_color = Gdk.Color.New(native_background_color); Marshal.FreeHGlobal(native_background_color); }