Example #1
0
 public BufferedOutputStream(GLib.OutputStream base_stream, ulong size) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(BufferedOutputStream))
     {
         throw new InvalidOperationException("Can't override this constructor.");
     }
     Raw = g_buffered_output_stream_new_sized(base_stream == null ? IntPtr.Zero : base_stream.Handle, new UIntPtr(size));
 }
Example #2
0
        public void SaveToStreamvAsync(GLib.OutputStream stream, string type, string option_keys, string option_values, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
        {
            IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup(type);

            GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
            gdk_pixbuf_save_to_streamv_async(Handle, stream == null ? IntPtr.Zero : stream.Handle, native_type, GLib.Marshaller.StringToPtrGStrdup(option_keys), GLib.Marshaller.StringToPtrGStrdup(option_values), cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
            GLib.Marshaller.Free(native_type);
        }
Example #3
0
        public static unsafe long StreamWrite(GLib.OutputStream stream, IntPtr buffer, ulong count, bool blocking, GLib.Cancellable cancellable)
        {
            IntPtr error   = IntPtr.Zero;
            IntPtr raw_ret = g_pollable_stream_write(stream == null ? IntPtr.Zero : stream.Handle, buffer, new UIntPtr(count), blocking, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            long   ret     = (long)raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Example #4
0
        public static unsafe bool StreamWriteAll(GLib.OutputStream stream, IntPtr buffer, ulong count, bool blocking, out ulong bytes_written, GLib.Cancellable cancellable)
        {
            UIntPtr native_bytes_written;
            IntPtr  error   = IntPtr.Zero;
            bool    raw_ret = g_pollable_stream_write_all(stream == null ? IntPtr.Zero : stream.Handle, buffer, new UIntPtr(count), blocking, out native_bytes_written, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool    ret     = raw_ret;

            bytes_written = (ulong)native_bytes_written;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Example #5
0
        public unsafe bool SaveToStreamv(GLib.OutputStream stream, string type, string option_keys, string option_values, GLib.Cancellable cancellable)
        {
            IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup(type);
            IntPtr error       = IntPtr.Zero;
            bool   raw_ret     = gdk_pixbuf_save_to_streamv(Handle, stream == null ? IntPtr.Zero : stream.Handle, native_type, GLib.Marshaller.StringToPtrGStrdup(option_keys), GLib.Marshaller.StringToPtrGStrdup(option_values), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool   ret         = raw_ret;

            GLib.Marshaller.Free(native_type);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
Example #6
0
 public DataOutputStream(GLib.OutputStream base_stream) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(DataOutputStream))
     {
         ArrayList vals  = new ArrayList();
         ArrayList names = new ArrayList();
         if (base_stream != null)
         {
             names.Add("base_stream");
             vals.Add(new GLib.Value(base_stream));
         }
         CreateNativeObject((string[])names.ToArray(typeof(string)), (GLib.Value[])vals.ToArray(typeof(GLib.Value)));
         return;
     }
     Raw = g_data_output_stream_new(base_stream == null ? IntPtr.Zero : base_stream.Handle);
 }
 public BufferedOutputStream(GLib.OutputStream base_stream, ulong size) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(BufferedOutputStream))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (base_stream != null)
         {
             names.Add("base_stream");
             vals.Add(new GLib.Value(base_stream));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     Raw = g_buffered_output_stream_new_sized(base_stream == null ? IntPtr.Zero : base_stream.Handle, new UIntPtr(size));
 }
Example #8
0
 public DataOutputStream(GLib.OutputStream base_stream) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(DataOutputStream))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (base_stream != null)
         {
             names.Add("base_stream");
             vals.Add(new GLib.Value(base_stream));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     Raw = g_data_output_stream_new(base_stream == null ? IntPtr.Zero : base_stream.Handle);
 }
Example #9
0
 public SimpleIOStream(GLib.InputStream input_stream, GLib.OutputStream output_stream) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(SimpleIOStream))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (input_stream != null)
         {
             names.Add("input_stream");
             vals.Add(new GLib.Value(input_stream));
         }
         if (output_stream != null)
         {
             names.Add("output_stream");
             vals.Add(new GLib.Value(output_stream));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     Raw = g_simple_io_stream_new(input_stream == null ? IntPtr.Zero : input_stream.Handle, output_stream == null ? IntPtr.Zero : output_stream.Handle);
 }