Example #1
0
        public void BboxDrect(Art.DRect drect)
        {
            IntPtr native_drect = GLib.Marshaller.StructureToPtrAlloc(drect);

            art_vpath_bbox_drect(Handle, native_drect);
            drect = Art.DRect.New(native_drect);
            Marshal.FreeHGlobal(native_drect);
        }
Example #2
0
        public static void ToIrect(Art.IRect dst, Art.DRect src)
        {
            IntPtr native_dst = GLib.Marshaller.StructureToPtrAlloc(dst);
            IntPtr native_src = GLib.Marshaller.StructureToPtrAlloc(src);

            art_drect_to_irect(native_dst, native_src);
            dst = Art.IRect.New(native_dst);
            Marshal.FreeHGlobal(native_dst);
            src = Art.DRect.New(native_src);
            Marshal.FreeHGlobal(native_src);
        }
Example #3
0
        public void Copy(Art.DRect src)
        {
            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_src = GLib.Marshaller.StructureToPtrAlloc(src);

            art_drect_copy(this_as_native, native_src);
            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            src = Art.DRect.New(native_src);
            Marshal.FreeHGlobal(native_src);
        }
Example #4
0
        public void AffineTransform(Art.DRect src, double[] matrix)
        {
            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_src = GLib.Marshaller.StructureToPtrAlloc(src);

            art_drect_affine_transform(this_as_native, native_src, matrix);
            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            src = Art.DRect.New(native_src);
            Marshal.FreeHGlobal(native_src);
        }
Example #5
0
        public int AddSegment(out int pn_segs_max, out int pn_points_max, int n_points, int dir, Art.Point points, Art.DRect bbox)
        {
            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_points = GLib.Marshaller.StructureToPtrAlloc(points);
            IntPtr native_bbox   = GLib.Marshaller.StructureToPtrAlloc(bbox);
            int    raw_ret       = art_svp_add_segment(this_as_native, out pn_segs_max, out pn_points_max, n_points, dir, native_points, native_bbox);
            int    ret           = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            points = Art.Point.New(native_points);
            Marshal.FreeHGlobal(native_points);
            bbox = Art.DRect.New(native_bbox);
            Marshal.FreeHGlobal(native_bbox);
            return(ret);
        }
Example #6
0
 static void ReadNative(IntPtr native, ref Art.DRect target)
 {
     target = New(native);
 }