コード例 #1
0
        public static string GuessForTree(GLib.IFile root)
        {
            IntPtr raw_ret = g_content_type_guess_for_tree(root == null ? IntPtr.Zero : ((root is GLib.Object) ? (root as GLib.Object).Handle : (root as GLib.FileAdapter).Handle));
            string ret     = GLib.Marshaller.PtrToStringGFree(raw_ret);

            return(ret);
        }
コード例 #2
0
        public GLib.IFile GetChild(GLib.FileInfo info)
        {
            IntPtr raw_ret = g_file_enumerator_get_child(Handle, info == null ? IntPtr.Zero : info.Handle);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            return(ret);
        }
コード例 #3
0
        public GLib.IFile GetNthBookmark(int n)
        {
            IntPtr raw_ret = gtk_places_sidebar_get_nth_bookmark(Handle, n);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            return(ret);
        }
コード例 #4
0
        GLib.IFile InvokeNative(GLib.Vfs vfs, string identifier)
        {
            IntPtr native_identifier = GLib.Marshaller.StringToPtrGStrdup(identifier);

            GLib.IFile __result = GLib.FileAdapter.GetObject(native_cb(vfs == null ? IntPtr.Zero : vfs.Handle, native_identifier, __data), false);
            GLib.Marshaller.Free(native_identifier);
            return(__result);
        }
コード例 #5
0
        public GLib.IFile GetFileForPath(string path)
        {
            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr raw_ret     = g_vfs_get_file_for_path(Handle, native_path);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            GLib.Marshaller.Free(native_path);
            return(ret);
        }
コード例 #6
0
        public GLib.IFile GetFileForUri(string uri)
        {
            IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup(uri);
            IntPtr raw_ret    = g_vfs_get_file_for_uri(Handle, native_uri);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            GLib.Marshaller.Free(native_uri);
            return(ret);
        }
コード例 #7
0
        public GLib.IFile ParseName(string parse_name)
        {
            IntPtr native_parse_name = GLib.Marshaller.StringToPtrGStrdup(parse_name);
            IntPtr raw_ret           = g_vfs_parse_name(Handle, native_parse_name);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            GLib.Marshaller.Free(native_parse_name);
            return(ret);
        }
コード例 #8
0
        public GLib.IFile CreateFileForArg(string arg)
        {
            IntPtr native_arg = GLib.Marshaller.StringToPtrGStrdup(arg);
            IntPtr raw_ret    = g_application_command_line_create_file_for_arg(Handle, native_arg);

            GLib.IFile ret = GLib.FileAdapter.GetObject(raw_ret, false);
            GLib.Marshaller.Free(native_arg);
            return(ret);
        }
コード例 #9
0
        private void InternalChanged(GLib.IFile file, GLib.IFile other_file, GLib.FileMonitorEvent event_type)
        {
            ChangedNativeDelegate unmanaged = class_abi.BaseOverride <ChangedNativeDelegate>(this.LookupGType(), "changed");

            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle), other_file == null ? IntPtr.Zero : ((other_file is GLib.Object) ? (other_file as GLib.Object).Handle : (other_file as GLib.FileAdapter).Handle), (int)event_type);
        }
コード例 #10
0
        public bool SetFile(GLib.IFile file)
        {
            IntPtr error   = IntPtr.Zero;
            bool   raw_ret = gtk_file_chooser_set_file(Handle, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle), out error);
            bool   ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
コード例 #11
0
        public unsafe bool LoadFromFile(GLib.IFile file)
        {
            IntPtr error   = IntPtr.Zero;
            bool   raw_ret = gtk_css_provider_load_from_file(Handle, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle), out error);
            bool   ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
コード例 #12
0
        public unsafe bool Iterate(GLib.FileInfo out_info, GLib.IFile out_child, GLib.Cancellable cancellable)
        {
            IntPtr error   = IntPtr.Zero;
            bool   raw_ret = g_file_enumerator_iterate(Handle, out_info == null ? IntPtr.Zero : out_info.Handle, out_child == null ? IntPtr.Zero : ((out_child is GLib.Object) ? (out_child as GLib.Object).Handle : (out_child as GLib.FileAdapter).Handle), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
            bool   ret     = raw_ret;

            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
コード例 #13
0
        public static unsafe GLib.FileMonitor File(GLib.IFile file, GLib.FileMonitorFlags flags, GLib.Cancellable cancellable)
        {
            IntPtr error   = IntPtr.Zero;
            IntPtr raw_ret = g_file_monitor_file(file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle), (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            GLib.FileMonitor ret = GLib.Object.GetObject(raw_ret) as GLib.FileMonitor;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
コード例 #14
0
 public IntPtr NativeCallback(IntPtr vfs, IntPtr identifier, IntPtr user_data)
 {
     try {
         GLib.IFile __ret = managed(GLib.Object.GetObject(vfs) as GLib.Vfs, GLib.Marshaller.Utf8PtrToString(identifier));
         if (release_on_call)
         {
             gch.Free();
         }
         return(__ret == null ? IntPtr.Zero : ((__ret is GLib.Object) ? (__ret as GLib.Object).Handle : (__ret as GLib.FileAdapter).Handle));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: Above call does not return.
         throw e;
     }
 }
コード例 #15
0
        private void InternalChanged(GLib.IFile file, GLib.IFile other_file, GLib.FileMonitorEvent event_type)
        {
            ChangedNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("changed"));
                unmanaged = (ChangedNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ChangedNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle), other_file == null ? IntPtr.Zero : ((other_file is GLib.Object) ? (other_file as GLib.Object).Handle : (other_file as GLib.FileAdapter).Handle), (int)event_type);
        }
コード例 #16
0
 public AppChooserDialog(Gtk.Window parent, Gtk.DialogFlags flags, GLib.IFile file) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(AppChooserDialog))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (parent != null)
         {
             names.Add("parent");
             vals.Add(new GLib.Value(parent));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     Raw = gtk_app_chooser_dialog_new(parent == null ? IntPtr.Zero : parent.Handle, (int)flags, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle));
 }
コード例 #17
0
 public FileIcon(GLib.IFile file) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(FileIcon))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (file != null)
         {
             names.Add("file");
             vals.Add(new GLib.Value(file));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     Raw = g_file_icon_new(file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle));
 }
コード例 #18
0
 public FileSaver(GtkSource.Buffer buffer, GtkSource.File file, GLib.IFile target_location) : base(IntPtr.Zero)
 {
     if (GetType() != typeof(FileSaver))
     {
         var vals  = new List <GLib.Value> ();
         var names = new List <string> ();
         if (buffer != null)
         {
             names.Add("buffer");
             vals.Add(new GLib.Value(buffer));
         }
         if (file != null)
         {
             names.Add("file");
             vals.Add(new GLib.Value(file));
         }
         CreateNativeObject(names.ToArray(), vals.ToArray());
         return;
     }
     owned = true;
     Raw   = gtk_source_file_saver_new_with_target(buffer == null ? IntPtr.Zero : buffer.Handle, file == null ? IntPtr.Zero : file.Handle, target_location == null ? IntPtr.Zero : ((target_location is GLib.Object) ? (target_location as GLib.Object).Handle : (target_location as GLib.FileAdapter).Handle));
 }
コード例 #19
0
 public void UnselectFile(GLib.IFile file)
 {
     gtk_file_chooser_unselect_file(Handle, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle));
 }
コード例 #20
0
 public void EmitEvent(GLib.IFile child, GLib.IFile other_file, GLib.FileMonitorEvent event_type)
 {
     g_file_monitor_emit_event(Handle, child == null ? IntPtr.Zero : ((child is GLib.Object) ? (child as GLib.Object).Handle : (child as GLib.FileAdapter).Handle), other_file == null ? IntPtr.Zero : ((other_file is GLib.Object) ? (other_file as GLib.Object).Handle : (other_file as GLib.FileAdapter).Handle), (int)event_type);
 }
コード例 #21
0
 public void RemoveShortcut(GLib.IFile location)
 {
     gtk_places_sidebar_remove_shortcut(Handle, location == null ? IntPtr.Zero : ((location is GLib.Object) ? (location as GLib.Object).Handle : (location as GLib.FileAdapter).Handle));
 }
コード例 #22
0
 protected virtual void OnChanged(GLib.IFile file, GLib.IFile other_file, GLib.FileMonitorEvent event_type)
 {
     InternalChanged(file, other_file, event_type);
 }