Ejemplo n.º 1
0
 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);
     });
 }
Ejemplo n.º 2
0
        static long Size(this GLib.File file)
        {
            IntPtr info = NativeInterop.GFileQueryInfo(file, "standard::size", FileQueryInfoFlags.None, null);
            long   size = NativeInterop.GFileInfoSize(info);

            NativeInterop.GObjectUnref(info);
            return(size);
        }
Ejemplo n.º 3
0
        public static string Icon(this GLib.File file)
        {
            IntPtr info = NativeInterop.GFileQueryInfo(file, "standard::icon", FileQueryInfoFlags.None, null);

            GLib.Icon icon     = NativeInterop.GFileInfoIcon(info);
            string    iconName = DockServices.Drawing.IconFromGIcon(icon);

            NativeInterop.GObjectUnref(info);
            return(iconName);
        }
Ejemplo n.º 4
0
        public static T QueryInfo <T> (this GLib.File file, string attribute)
        {
            IntPtr info = NativeInterop.GFileQueryInfo(file, attribute, FileQueryInfoFlags.None, null);

            Type   returnType = typeof(T);
            object ret;

            if (returnType == typeof(bool))
            {
                ret = QueryBoolAttr(info, attribute);
            }
            else if (returnType == typeof(string))
            {
                ret = QueryStringAttr(info, attribute);
            }
            else if (returnType == typeof(string[]))
            {
                ret = QueryStringVAttr(info, attribute);
            }
            else if (returnType == typeof(uint))
            {
                ret = QueryUIntAttr(info, attribute);
            }
            else if (returnType == typeof(ulong))
            {
                ret = QueryULongAttr(info, attribute);
            }
            else
            {
                ret = default(T);
            }

            NativeInterop.GObjectUnref(info);

            return((T)ret);
        }
Ejemplo n.º 5
0
 public static Pixbuf FromFileAtSize(string filename, int width, int height)
 {
     return(NativeInterop.GdkPixbufNewFromFileAtSize(filename, width, height));
 }
Ejemplo n.º 6
0
 public void SetProcessName(string name)
 {
     NativeInterop.prctl(15 /* PR_SET_NAME */, name);
 }
Ejemplo n.º 7
0
 public static IconInfo LookupByGIcon(this IconTheme theme, GLib.Icon icon, int size, Gtk.IconLookupFlags flags)
 {
     return(NativeInterop.IconThemeLookUpByGIcon(theme, icon, size, (int)flags));
 }
Ejemplo n.º 8
0
 public static bool UnmountWithOperationFinish(this GLib.Mount m, AsyncResult result)
 {
     return(NativeInterop.UnmountWithOperation(m, result));
 }
Ejemplo n.º 9
0
 public static string StringUri(this GLib.File file)
 {
     return(NativeInterop.StrUri(file));
 }
Ejemplo n.º 10
0
 static ulong QueryULongAttr(IntPtr info, string attribute)
 {
     return(NativeInterop.GFileInfoQueryULong(info, attribute));
 }
Ejemplo n.º 11
0
 static bool QueryBoolAttr(IntPtr info, string attribute)
 {
     return(NativeInterop.GFileInfoQueryBool(info, attribute));
 }
Ejemplo n.º 12
0
 static uint QueryUIntAttr(IntPtr info, string attribute)
 {
     return(NativeInterop.GFileInfoQueryUInt(info, attribute));
 }
Ejemplo n.º 13
0
 static string[] QueryStringVAttr(IntPtr info, string Attribute)
 {
     return(NativeInterop.GFileInfoQueryStringV(info, Attribute));
 }