Пример #1
0
        public void Start(DriveStartFlags flags, MountOperation mount_operation, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_drive_start(Handle, (int)flags, mount_operation == null ? IntPtr.Zero : mount_operation.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #2
0
        public void Eject(MountUnmountFlags flags, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_drive_eject(Handle, (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #3
0
        public void PollForMedia(Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_drive_poll_for_media(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #4
0
        public void LoadAsync(int size, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_loadable_icon_load_async(Handle, size, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #5
0
        public void GuessContentType(bool force_rescan, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_mount_guess_content_type(Handle, force_rescan, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #6
0
        public void ReadLineAsync(int io_priority, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_data_input_stream_read_line_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
		public static void EjectWithOperation (this GLib.Mount m, MountUnmountFlags flags, GLib.MountOperation operation, 
			Cancellable cancellable, AsyncReadyCallback callback)
		{
			m.MaybeEmptyTrashWithAction (() => {
				NativeInterop.EjectWithOperation (m, flags, operation, cancellable, callback);
			});
		}
Пример #8
0
        public void ReadAsync(byte[] buffer, ulong count, int io_priority, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_input_stream_read_async(Handle, buffer, new UIntPtr(count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #9
0
        public void InitAsync(int io_priority, Cancellable cancellable, AsyncReadyCallback cb)
        {
            var cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_async_initable_init_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Пример #10
0
        public void ReadUntilAsync(string stop_chars, int io_priority, Cancellable cancellable, AsyncReadyCallback cb)
        {
            IntPtr native_stop_chars = GLib.Marshaller.StringToPtrGStrdup(stop_chars);
            var    cb_wrapper        = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_data_input_stream_read_until_async(Handle, native_stop_chars, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
            GLib.Marshaller.Free(native_stop_chars);
        }
Пример #11
0
        public void QueryInfoAsync(string attributes, int io_priority, Cancellable cancellable, AsyncReadyCallback cb)
        {
            IntPtr native_attributes = GLib.Marshaller.StringToPtrGStrdup(attributes);
            var    cb_wrapper        = new GLibSharp.AsyncReadyCallbackWrapper(cb);

            cb_wrapper.PersistUntilCalled();
            g_file_io_stream_query_info_async(Handle, native_attributes, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
            GLib.Marshaller.Free(native_attributes);
        }
Пример #12
0
 static void cancelled_cb(IntPtr cancellable)
 {
     try {
         Cancellable cancellable_managed = GLib.Object.GetObject(cancellable, false) as Cancellable;
         cancellable_managed.OnCancelled();
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Пример #13
0
 static void Cancelled_cb(IntPtr inst)
 {
     try {
         Cancellable __obj = GLib.Object.GetObject(inst, false) as Cancellable;
         __obj.OnCancelled();
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Пример #14
0
        public string[] GuessContentTypeSync(bool force_rescan, Cancellable cancellable)
        {
            var error   = IntPtr.Zero;
            var raw_ret = g_mount_guess_content_type_sync(Handle, force_rescan, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            string[] ret = GLib.Marshaller.NullTermPtrToStringArray(raw_ret, false);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #15
0
        public InputStream Load(int size, string type, Cancellable cancellable)
        {
            var error   = IntPtr.Zero;
            var raw_ret = g_loadable_icon_load(Handle, size, GLib.Marshaller.StringToPtrGStrdup(type), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            var ret     = GLib.Object.GetObject(raw_ret) as InputStream;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #16
0
        public unsafe short ReadInt16(Cancellable cancellable)
        {
            var   error   = IntPtr.Zero;
            short raw_ret = g_data_input_stream_read_int16(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            short ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #17
0
        public unsafe long Fill(long count, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            var  raw_ret = g_buffered_input_stream_fill(Handle, new IntPtr(count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            long ret     = (long)raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #18
0
        public bool Seek(long offset, GLib.SeekType type, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            bool raw_ret = g_seekable_seek(Handle, offset, type, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #19
0
        public unsafe long Splice(InputStream source, OutputStreamSpliceFlags flags, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            var  raw_ret = g_output_stream_splice(Handle, source == null ? IntPtr.Zero : source.Handle, (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            long ret     = (long)raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #20
0
        public bool Truncate(long offset, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            bool raw_ret = g_seekable_truncate(Handle, offset, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #21
0
        public unsafe bool Close(Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            bool raw_ret = g_input_stream_close(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #22
0
        public unsafe bool PutUint32(uint data, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            bool raw_ret = g_data_output_stream_put_uint32(Handle, data, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #23
0
        public unsafe new byte ReadByte(Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            byte raw_ret = g_data_input_stream_read_byte(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            byte ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #24
0
        public unsafe ulong ReadUint64(Cancellable cancellable)
        {
            var   error   = IntPtr.Zero;
            ulong raw_ret = g_data_input_stream_read_uint64(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            ulong ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #25
0
        public unsafe long Read(byte[] buffer, ulong count, Cancellable cancellable)
        {
            var  error   = IntPtr.Zero;
            var  raw_ret = g_input_stream_read(Handle, buffer, new UIntPtr(count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            long ret     = (long)raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #26
0
        public static unsafe FileMonitor File(File file, FileMonitorFlags flags, Cancellable cancellable)
        {
            var error   = IntPtr.Zero;
            var raw_ret = g_file_monitor_file(file == null ? IntPtr.Zero : file.Handle, (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            var ret     = GLib.Object.GetObject(raw_ret) as FileMonitor;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #27
0
        public unsafe bool ReadAll(byte[] buffer, ulong count, out ulong bytes_read, Cancellable cancellable)
        {
            UIntPtr native_bytes_read;
            var     error   = IntPtr.Zero;
            bool    raw_ret = g_input_stream_read_all(Handle, buffer, new UIntPtr(count), out native_bytes_read, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool    ret     = raw_ret;

            bytes_read = (ulong)native_bytes_read;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #28
0
        public unsafe FileInfo QueryInfo(string attributes, Cancellable cancellable)
        {
            IntPtr native_attributes = GLib.Marshaller.StringToPtrGStrdup(attributes);
            var    error             = IntPtr.Zero;
            var    raw_ret           = g_file_io_stream_query_info(Handle, native_attributes, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            var    ret = GLib.Object.GetObject(raw_ret) as FileInfo;

            GLib.Marshaller.Free(native_attributes);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #29
0
        public unsafe bool PutString(string str, Cancellable cancellable)
        {
            IntPtr native_str = GLib.Marshaller.StringToPtrGStrdup(str);
            var    error      = IntPtr.Zero;
            bool   raw_ret    = g_data_output_stream_put_string(Handle, native_str, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool   ret        = raw_ret;

            GLib.Marshaller.Free(native_str);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #30
0
        public unsafe string ReadLine(out ulong length, Cancellable cancellable)
        {
            UIntPtr native_length;
            var     error   = IntPtr.Zero;
            var     raw_ret = g_data_input_stream_read_line(Handle, out native_length, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            string  ret     = GLib.Marshaller.PtrToStringGFree(raw_ret);

            length = (ulong)native_length;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Пример #31
0
        public unsafe string ReadUntil(string stop_chars, out ulong length, Cancellable cancellable)
        {
            IntPtr  native_stop_chars = GLib.Marshaller.StringToPtrGStrdup(stop_chars);
            UIntPtr native_length;
            var     error   = IntPtr.Zero;
            var     raw_ret = g_data_input_stream_read_until(Handle, native_stop_chars, out native_length, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            string  ret     = GLib.Marshaller.PtrToStringGFree(raw_ret);

            GLib.Marshaller.Free(native_stop_chars);
            length = (ulong)native_length;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }