⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gvolume.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>GVolume</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GIO Reference Manual"><link rel="up" href="volume_mon.html" title="Volumes and Drives"><link rel="prev" href="GVolumeMonitor.html" title="GVolumeMonitor"><link rel="next" href="GMount.html" title="GMount"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part&#160;I.&#160;GIO Overview"><link rel="chapter" href="ch01.html" title="Introduction"><link rel="chapter" href="ch02.html" title="Compiling GIO applications"><link rel="chapter" href="ch03.html" title="Running GIO applications"><link rel="chapter" href="gio-extension-points.html" title="Extending GIO"><link rel="part" href="pt02.html" title="Part&#160;II.&#160;API Reference"><link rel="chapter" href="file_ops.html" title="File Operations"><link rel="chapter" href="file_mon.html" title="File System Monitoring"><link rel="chapter" href="async.html" title="Asynchronous I/O"><link rel="chapter" href="streaming.html" title="Streaming I/O"><link rel="chapter" href="types.html" title="File types and applications"><link rel="chapter" href="volume_mon.html" title="Volumes and Drives"><link rel="chapter" href="icons.html" title="Icons"><link rel="chapter" href="utils.html" title="Utilities"><link rel="chapter" href="extending.html" title="Extending GIO"><link rel="part" href="migrating.html" title="Part&#160;III.&#160;Migrating to GIO"><link rel="chapter" href="ch14.html" title="Migrating from POSIX to GIO"><link rel="chapter" href="ch15.html" title="Migrating from GnomeVFS to GIO"><link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy"><link rel="index" href="ix01.html" title="Index"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="GVolumeMonitor.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="volume_mon.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIO Reference Manual</th><td><a accesskey="n" href="GMount.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id3115751" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#id3210125" class="shortcut">Description</a>                  &#160;|&#160;                  <a href="#id3210046" class="shortcut">Object Hierarchy</a>                  &#160;|&#160;                  <a href="#id3210071" class="shortcut">Prerequisites</a>                  &#160;|&#160;                  <a href="#id3210093" class="shortcut">Signals</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="GVolume"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3115751"></a><span class="refentrytitle">GVolume</span></h2><p>GVolume &#8212; Volume management</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include &lt;gio/gio.h&gt;                    <a class="link" href="GVolume.html#GVolume-struct">GVolume</a>;                    <a class="link" href="GVolume.html#GVolumeIface">GVolumeIface</a>;char*               <a class="link" href="GVolume.html#g-volume-get-name">g_volume_get_name</a>                   (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);char*               <a class="link" href="GVolume.html#g-volume-get-uuid">g_volume_get_uuid</a>                   (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);<a class="link" href="GIcon.html" title="GIcon">GIcon</a>*              <a class="link" href="GVolume.html#g-volume-get-icon">g_volume_get_icon</a>                   (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);<a class="link" href="GDrive.html" title="GDrive">GDrive</a>*             <a class="link" href="GVolume.html#g-volume-get-drive">g_volume_get_drive</a>                  (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);<a class="link" href="GMount.html" title="GMount">GMount</a>*             <a class="link" href="GVolume.html#g-volume-get-mount">g_volume_get_mount</a>                  (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GVolume.html#g-volume-can-mount">g_volume_can_mount</a>                  (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GVolume.html#g-volume-should-automount">g_volume_should_automount</a>           (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);void                <a class="link" href="GVolume.html#g-volume-mount">g_volume_mount</a>                      (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume,                                                         <a class="link" href="GMount.html#GMountMountFlags">GMountMountFlags</a> flags,                                                         <a class="link" href="GMountOperation.html" title="GMountOperation">GMountOperation</a> *mount_operation,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GVolume.html#g-volume-mount-finish">g_volume_mount_finish</a>               (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume,                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GVolume.html#g-volume-can-eject">g_volume_can_eject</a>                  (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);void                <a class="link" href="GVolume.html#g-volume-eject">g_volume_eject</a>                      (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume,                                                         <a class="link" href="GMount.html#GMountUnmountFlags">GMountUnmountFlags</a> flags,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GVolume.html#g-volume-eject-finish">g_volume_eject_finish</a>               (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume,                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);#define             <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-HAL-UDI:CAPS">G_VOLUME_IDENTIFIER_KIND_HAL_UDI</a>#define             <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-LABEL:CAPS">G_VOLUME_IDENTIFIER_KIND_LABEL</a>#define             <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-NFS-MOUNT:CAPS">G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT</a>#define             <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-UNIX-DEVICE:CAPS">G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE</a>#define             <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-UUID:CAPS">G_VOLUME_IDENTIFIER_KIND_UUID</a>char**              <a class="link" href="GVolume.html#g-volume-enumerate-identifiers">g_volume_enumerate_identifiers</a>      (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume);char*               <a class="link" href="GVolume.html#g-volume-get-identifier">g_volume_get_identifier</a>             (<a class="link" href="GVolume.html" title="GVolume">GVolume</a> *volume,                                                         const char *kind);</pre></div><div class="refsect1" lang="en"><a name="id3210046"></a><h2>Object Hierarchy</h2><pre class="synopsis">  GInterface   +----GVolume</pre></div><div class="refsect1" lang="en"><a name="id3210071"></a><h2>Prerequisites</h2><p>GVolume requires <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p></div><div class="refsect1" lang="en"><a name="id3210093"></a><h2>Signals</h2><pre class="synopsis">  "<a class="link" href="GVolume.html#GVolume-changed">changed</a>"                                        : Run Last  "<a class="link" href="GVolume.html#GVolume-removed">removed</a>"                                        : Run Last</pre></div><div class="refsect1" lang="en"><a name="id3210125"></a><h2>Description</h2><p>The <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a> interface represents user-visible objects that can bemounted. Note, when porting from GnomeVFS, <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a> is the moralequivalent of <span class="type">GnomeVFSDrive</span>.</p><p>Mounting a <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a> instance is an asynchronous operation. For moreinformation about asynchronous operations, see <span class="type">GAsyncReady</span> and<span class="type">GSimpleAsyncReady</span>. To mount a <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a>, first call<a class="link" href="GVolume.html#g-volume-mount"><code class="function">g_volume_mount()</code></a> with (at least) the <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a> instance, optionallya <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> object and a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a>. </p><p>Typically, one will only want to pass <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for the<a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> if automounting all volumes when a desktop sessionstarts since it's not desirable to put up a lot of dialogs askingfor credentials.</p><p>The callback will be fired when the operation has resolved (eitherwith success or failure), and a <span class="type">GAsyncReady</span> structure will bepassed to the callback.  That callback should then call<a class="link" href="GVolume.html#g-volume-mount-finish"><code class="function">g_volume_mount_finish()</code></a> with the <a class="link" href="GVolume.html" title="GVolume"><span class="type">GVolume</span></a> instance and the<span class="type">GAsyncReady</span> data to see if the operation was completedsuccessfully.  If an <em class="parameter"><code>error</code></em> is present when <a class="link" href="GVolume.html#g-volume-mount-finish"><code class="function">g_volume_mount_finish()</code></a>is called, then it will be filled with any error information.</p><p></p><p><a name="volume-identifier"></a>It is sometimes necessary to directly access the underlying operating system object behind a volume (e.g. for passing a volumeto an application via the commandline). For this purpose, GIOallows to obtain an 'identifier' for the volume. There can bedifferent kinds of identifiers, such as Hal UDIs, filesystem labels,traditional Unix devices (e.g. <code class="filename">/dev/sda2</code>),uuids. GIO uses predefind strings as names for the different kindsof identifiers: <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-HAL-UDI:CAPS"><span class="type">G_VOLUME_IDENTIFIER_KIND_HAL_UDI</span></a>, <a class="link" href="GVolume.html#G-VOLUME-IDENTIFIER-KIND-LABEL:CAPS"><span class="type">G_VOLUME_IDENTIFIER_KIND_LABEL</span></a>, etc. Use <a class="link" href="GVolume.html#g-volume-get-identifier"><code class="function">g_volume_get_identifier()</code></a> to obtain an identifier for a volume.</p><p></p></div><div class="refsect1" lang="en"><a name="id3220094"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3220105"></a><h3><a name="GVolume-struct"></a>GVolume</h3><a class="indexterm" name="id3220118"></a><pre class="programlisting">typedef struct _GVolume GVolume;</pre><p>Opaque mountable volume object.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3220137"></a><h3><a name="GVolumeIface"></a>GVolumeIface</h3><a class="indexterm" name="id3220150"></a><pre class="programlisting">typedef struct {  GTypeInterface g_iface;  /* signals */  void (*changed) (GVolume *volume);  void (*removed) (GVolume *volume);    /* Virtual Table */  char *    (*get_name)       (GVolume             *volume);  GIcon *   (*get_icon)       (GVolume             *volume);  char *    (*get_uuid)       (GVolume             *volume);  GDrive *  (*get_drive)      (GVolume             *volume);  GMount *  (*get_mount)      (GVolume             *volume);  gboolean  (*can_mount)      (GVolume             *volume);  gboolean  (*can_eject)      (GVolume             *volume);  void      (*mount_fn)       (GVolume             *volume,			       GMountMountFlags     flags,                               GMountOperation     *mount_operation,                               GCancellable        *cancellable,                               GAsyncReadyCallback  callback,                               gpointer             user_data);  gboolean  (*mount_finish)   (GVolume             *volume,                               GAsyncResult        *result,                               GError             **error);  void      (*eject)          (GVolume             *volume,			       GMountUnmountFlags   flags,                               GCancellable        *cancellable,                               GAsyncReadyCallback  callback,                               gpointer             user_data);  gboolean  (*eject_finish)   (GVolume             *volume,                               GAsyncResult        *result,                               GError             **error);  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -