Пример #1
0
        public void GetRangeBlock(out Cdn.IndexRange rows, out Cdn.IndexRange columns)
        {
            IntPtr native_rows    = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Cdn.IndexRange)));
            IntPtr native_columns = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Cdn.IndexRange)));

            cdn_instruction_index_get_range_block(Handle, native_rows, native_columns);
            rows = Cdn.IndexRange.New(native_rows);
            Marshal.FreeHGlobal(native_rows);
            columns = Cdn.IndexRange.New(native_columns);
            Marshal.FreeHGlobal(native_columns);
        }
Пример #2
0
        public InstructionIndex(Cdn.IndexRange range, Cdn.StackArg arg) : base(IntPtr.Zero)
        {
            if (GetType() != typeof(InstructionIndex))
            {
                throw new InvalidOperationException("Can't override this constructor.");
            }
            IntPtr native_range = GLib.Marshaller.StructureToPtrAlloc(range);

            Raw   = cdn_instruction_index_new_range(native_range, arg == null ? IntPtr.Zero : arg.Handle);
            range = Cdn.IndexRange.New(native_range);
            Marshal.FreeHGlobal(native_range);
        }
Пример #3
0
        public bool Equal(Cdn.IndexRange b)
        {
            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_b = GLib.Marshaller.StructureToPtrAlloc(b);
            bool   raw_ret  = cdn_index_range_equal(this_as_native, native_b);
            bool   ret      = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            b = Cdn.IndexRange.New(native_b);
            Marshal.FreeHGlobal(native_b);
            return(ret);
        }
Пример #4
0
 static void ReadNative(IntPtr native, ref Cdn.IndexRange target)
 {
     target = New(native);
 }