diff --git a/ChangeLog b/ChangeLog index 78922ab22e03b2341e96fa1ecb90479f65c120e1..949ebfe83eed96df180f247a086a1aa4754d2cc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-11-21 Benedikt Meurer <benny@xfce.org> + + * docs/reference/thunar-vfs/, thunar-vfs/thunar-vfs-info.h: Small + documentation tweaks. + * thunar-vfs/thunar-vfs-info.h: Allow previous declarations of the + ThunarVfsInfo typedef. + * thunarx/thunarx-file-info.{c,h}, thunarx/thunarx.symbols, + thunar/thunar-file.c, docs/reference/thunarx/: Add new virtual method + thunarx_file_info_get_vfs_info(), which can be used to query the + ThunarVfsInfo for a given ThunarxFileInfo. + 2005-11-21 Benedikt Meurer <benny@xfce.org> * thunarx/thunarx-provider-plugin.{c,h}, thunarx/Makefile.am, diff --git a/docs/reference/thunar-vfs/thunar-vfs-sections.txt b/docs/reference/thunar-vfs/thunar-vfs-sections.txt index 0114fd2561afbe24f21ef305b02fe016b8a0f782..9ff5809e683a16bc61401bd62c5601a59a40469f 100644 --- a/docs/reference/thunar-vfs/thunar-vfs-sections.txt +++ b/docs/reference/thunar-vfs/thunar-vfs-sections.txt @@ -99,8 +99,6 @@ thunar_vfs_job_get_type <SECTION> <FILE>thunar-vfs-mime-application</FILE> <TITLE>ThunarVfsMimeApplication</TITLE> -THUNAR_VFS_MIME_APPLICATION_ERROR -ThunarVfsMimeApplicationError ThunarVfsMimeApplicationFlags ThunarVfsMimeApplication thunar_vfs_mime_application_new_from_desktop_id diff --git a/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml b/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml index 3d9c7b82eb7876f5410744645d77fc9f66e06017..5b8bf1ca7402edc26311ea580089808bf81da6a5 100644 --- a/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml +++ b/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml @@ -22,21 +22,21 @@ ThunarVfsInfo </para> -@type: -@mode: -@flags: -@uid: -@gid: -@size: -@atime: -@mtime: -@ctime: -@inode: -@device: -@mime_info: -@path: -@custom_icon: -@display_name: +@type: the file type. +@mode: the file permissions and special mode flags. +@flags: the file flags. +@uid: the owner's user id. +@gid: the owner's group id. +@size: the file size in bytes. +@atime: the time of last access. +@mtime: the time of last modification. +@ctime: the time of last status change. +@inode: the file's inode. +@device: the file's device. +@mime_info: the file's mime type. +@path: the file's path. +@custom_icon: a custom icon name or %NULL. +@display_name: the file's display name (UTF-8). <!-- ##### FUNCTION thunar_vfs_info_new_for_path ##### --> <para> diff --git a/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml b/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml index f16f3c2f63a972bde2fbe4f88350a835502cde1c..57daed116376ada2289a932c569eea2e99920b4a 100644 --- a/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml +++ b/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml @@ -17,20 +17,6 @@ ThunarVfsMimeApplication <!-- ##### SECTION Stability_Level ##### --> -<!-- ##### MACRO THUNAR_VFS_MIME_APPLICATION_ERROR ##### --> -<para> - -</para> - - - -<!-- ##### ENUM ThunarVfsMimeApplicationError ##### --> -<para> - -</para> - -@THUNAR_VFS_MIME_APPLICATION_ERROR_LOCAL_FILES_ONLY: - <!-- ##### ENUM ThunarVfsMimeApplicationFlags ##### --> <para> diff --git a/docs/reference/thunarx/thunarx-sections.txt b/docs/reference/thunarx/thunarx-sections.txt index 019b32718952f2d72bb28a3fcc23e8c4c9d89352..7dd8a9e277d87161074c364101615db4a9ec83f3 100644 --- a/docs/reference/thunarx/thunarx-sections.txt +++ b/docs/reference/thunarx/thunarx-sections.txt @@ -12,6 +12,7 @@ thunarx_file_info_get_uri_scheme thunarx_file_info_get_mime_type thunarx_file_info_has_mime_type thunarx_file_info_is_directory +thunarx_file_info_get_vfs_info thunarx_file_info_list_copy thunarx_file_info_list_free <SUBSECTION Standard> diff --git a/docs/reference/thunarx/tmpl/thunarx-file-info.sgml b/docs/reference/thunarx/tmpl/thunarx-file-info.sgml index 362ef9a08c0ff62f09672782a098155e0ec00e39..da7ea9aaed370c1a0207cbb1bf34322930ed21a4 100644 --- a/docs/reference/thunarx/tmpl/thunarx-file-info.sgml +++ b/docs/reference/thunarx/tmpl/thunarx-file-info.sgml @@ -31,6 +31,7 @@ Stable @get_mime_type: See thunarx_file_info_get_mime_type(). @has_mime_type: See thunarx_file_info_has_mime_type(). @is_directory: See thunarx_file_info_is_directory(). +@get_vfs_info: See thunarx_file_info_get_vfs_info(). <!-- ##### STRUCT ThunarxFileInfo ##### --> <para> @@ -103,6 +104,15 @@ Stable @Returns: +<!-- ##### FUNCTION thunarx_file_info_get_vfs_info ##### --> +<para> + +</para> + +@file_info: +@Returns: + + <!-- ##### FUNCTION thunarx_file_info_list_copy ##### --> <para> diff --git a/thunar-vfs/thunar-vfs-info.h b/thunar-vfs/thunar-vfs-info.h index 4ee4aba88610e08cacf15b054c1afb59638330f5..c1ce4fbdc18f3d643ca4ef5988367bc55e1e139e 100644 --- a/thunar-vfs/thunar-vfs-info.h +++ b/thunar-vfs/thunar-vfs-info.h @@ -31,15 +31,14 @@ G_BEGIN_DECLS; +/* Used to avoid a dependency of thunarx on thunar-vfs */ +#ifndef __THUNAR_VFS_INFO_DEFINED__ +#define __THUNAR_VFS_INFO_DEFINED__ +typedef struct _ThunarVfsInfo ThunarVfsInfo; +#endif + #define THUNAR_VFS_TYPE_INFO (thunar_vfs_info_get_type ()) -/** - * ThunarVfsInfo: - * - * The #ThunarVfsInfo structure provides information about a file system - * entity. - **/ -typedef struct _ThunarVfsInfo ThunarVfsInfo; struct _ThunarVfsInfo { /* File type */ @@ -157,18 +156,10 @@ thunar_vfs_info_get_custom_icon (const ThunarVfsInfo *info) /** * thunar_vfs_info_list_free: - * @info_list : a list #ThunarVfsInfo<!---->s. + * @info_list : a list of #ThunarVfsInfo<!---->s. * * Unrefs all #ThunarVfsInfo<!---->s in @info_list and * frees the list itself. - * - * This method always returns %NULL for the convenience of - * being able to do: - * <informalexample><programlisting> - * info_list = thunar_vfs_info_list_free (info_list); - * </programlisting></informalexample> - * - * Return value: the empty list (%NULL). **/ G_INLINE_FUNC void thunar_vfs_info_list_free (GList *info_list) diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 292ac547c7c2d75a517682cfb790e70bfff2c366..d7dd46a0e0fab01102a8db2f822db282448129ec 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -75,6 +75,7 @@ static gchar *thunar_file_info_get_mime_type (ThunarxFileInfo static gboolean thunar_file_info_has_mime_type (ThunarxFileInfo *file_info, const gchar *mime_type); static gboolean thunar_file_info_is_directory (ThunarxFileInfo *file_info); +static ThunarVfsInfo *thunar_file_info_get_vfs_info (ThunarxFileInfo *file_info); static void thunar_file_real_changed (ThunarFile *file); static gboolean thunar_file_denies_access_permission (const ThunarFile *file, ThunarVfsFileMode usr_permissions, @@ -266,6 +267,7 @@ thunar_file_info_init (ThunarxFileInfoIface *iface) iface->get_mime_type = thunar_file_info_get_mime_type; iface->has_mime_type = thunar_file_info_has_mime_type; iface->is_directory = thunar_file_info_is_directory; + iface->get_vfs_info = thunar_file_info_get_vfs_info; } @@ -408,6 +410,14 @@ thunar_file_info_is_directory (ThunarxFileInfo *file_info) +static ThunarVfsInfo* +thunar_file_info_get_vfs_info (ThunarxFileInfo *file_info) +{ + return thunar_vfs_info_ref (THUNAR_FILE (file_info)->info); +} + + + static void thunar_file_real_changed (ThunarFile *file) { diff --git a/thunarx/thunarx-file-info.c b/thunarx/thunarx-file-info.c index 01b6b6ea87407ce2625878169d86e7ef22ce7084..c1d279cc19c7fc9af6976700a39c7eb4b26d5d18 100644 --- a/thunarx/thunarx-file-info.c +++ b/thunarx/thunarx-file-info.c @@ -234,6 +234,35 @@ thunarx_file_info_is_directory (ThunarxFileInfo *file_info) +/** + * thunarx_file_info_get_vfs_info: + * @file_info : a #ThunarxFileInfo. + * + * Returns the #ThunarVfsInfo associated with @file_info, + * which includes additional information about the @file_info + * as queried from the VFS library earlier. The caller is + * responsible to free the returned #ThunarVfsInfo object + * using thunar_vfs_info_unref() when no longer needed. + * + * Note that the <application>thunarx</application> library itself + * is not linked to the <application>thunar-vfs</application> library, + * and so, if you need to use this method, you'll need to include + * <code><thunar-vfs/thunar-vfs.h></code> in your code and + * add <code>`pkg-config --cflags thunar-vfs-1`</code> to your + * <envar>CFLAGS</envar>. + * + * Return value: the #ThunarVfsInfo object associated with @file_info, + * which MUST be freed using thunar_vfs_info_unref(). + **/ +ThunarVfsInfo* +thunarx_file_info_get_vfs_info (ThunarxFileInfo *file_info) +{ + g_return_val_if_fail (THUNARX_IS_FILE_INFO (file_info), NULL); + return (*THUNARX_FILE_INFO_GET_IFACE (file_info)->get_vfs_info) (file_info); +} + + + /** * thunarx_file_info_list_copy: * @file_infos : a #GList of #ThunarxFileInfo<!---->s. diff --git a/thunarx/thunarx-file-info.h b/thunarx/thunarx-file-info.h index a1fa753984f40f9f98be6d3e565ce78516efd265..50a284891fb07e160d27a1e6b1d0d96c7370a86b 100644 --- a/thunarx/thunarx-file-info.h +++ b/thunarx/thunarx-file-info.h @@ -29,6 +29,12 @@ G_BEGIN_DECLS; +/* Used to avoid a dependency of thunarx on thunar-vfs */ +#ifndef __THUNAR_VFS_INFO_DEFINED__ +#define __THUNAR_VFS_INFO_DEFINED__ +typedef struct _ThunarVfsInfo ThunarVfsInfo; +#endif + typedef struct _ThunarxFileInfoIface ThunarxFileInfoIface; typedef struct _ThunarxFileInfo ThunarxFileInfo; @@ -43,17 +49,19 @@ struct _ThunarxFileInfoIface GTypeInterface __parent__; /*< public >*/ - gchar *(*get_name) (ThunarxFileInfo *file_info); + gchar *(*get_name) (ThunarxFileInfo *file_info); - gchar *(*get_uri) (ThunarxFileInfo *file_info); - gchar *(*get_parent_uri) (ThunarxFileInfo *file_info); - gchar *(*get_uri_scheme) (ThunarxFileInfo *file_info); + gchar *(*get_uri) (ThunarxFileInfo *file_info); + gchar *(*get_parent_uri) (ThunarxFileInfo *file_info); + gchar *(*get_uri_scheme) (ThunarxFileInfo *file_info); - gchar *(*get_mime_type) (ThunarxFileInfo *file_info); - gboolean (*has_mime_type) (ThunarxFileInfo *file_info, - const gchar *mime_type); + gchar *(*get_mime_type) (ThunarxFileInfo *file_info); + gboolean (*has_mime_type) (ThunarxFileInfo *file_info, + const gchar *mime_type); - gboolean (*is_directory) (ThunarxFileInfo *file_info); + gboolean (*is_directory) (ThunarxFileInfo *file_info); + + ThunarVfsInfo *(*get_vfs_info) (ThunarxFileInfo *file_info); /*< private >*/ void (*reserved1) (void); @@ -62,24 +70,25 @@ struct _ThunarxFileInfoIface void (*reserved4) (void); void (*reserved5) (void); void (*reserved6) (void); - void (*reserved7) (void); }; -GType thunarx_file_info_get_type (void) G_GNUC_CONST; +GType thunarx_file_info_get_type (void) G_GNUC_CONST; + +gchar *thunarx_file_info_get_name (ThunarxFileInfo *file_info); +gchar *thunarx_file_info_get_uri (ThunarxFileInfo *file_info); +gchar *thunarx_file_info_get_parent_uri (ThunarxFileInfo *file_info); +gchar *thunarx_file_info_get_uri_scheme (ThunarxFileInfo *file_info); -gchar *thunarx_file_info_get_name (ThunarxFileInfo *file_info); -gchar *thunarx_file_info_get_uri (ThunarxFileInfo *file_info); -gchar *thunarx_file_info_get_parent_uri (ThunarxFileInfo *file_info); -gchar *thunarx_file_info_get_uri_scheme (ThunarxFileInfo *file_info); +gchar *thunarx_file_info_get_mime_type (ThunarxFileInfo *file_info); +gboolean thunarx_file_info_has_mime_type (ThunarxFileInfo *file_info, + const gchar *mime_type); -gchar *thunarx_file_info_get_mime_type (ThunarxFileInfo *file_info); -gboolean thunarx_file_info_has_mime_type (ThunarxFileInfo *file_info, - const gchar *mime_type); +gboolean thunarx_file_info_is_directory (ThunarxFileInfo *file_info); -gboolean thunarx_file_info_is_directory (ThunarxFileInfo *file_info); +ThunarVfsInfo *thunarx_file_info_get_vfs_info (ThunarxFileInfo *file_info); -GList *thunarx_file_info_list_copy (GList *file_infos); -void thunarx_file_info_list_free (GList *file_infos); +GList *thunarx_file_info_list_copy (GList *file_infos); +void thunarx_file_info_list_free (GList *file_infos); G_END_DECLS; diff --git a/thunarx/thunarx.symbols b/thunarx/thunarx.symbols index 90d165649064c9836828e640ce7d5227f240dd26..86d040e052caf15e6b7b3b7418e15ca12e53f671 100644 --- a/thunarx/thunarx.symbols +++ b/thunarx/thunarx.symbols @@ -55,6 +55,7 @@ thunarx_file_info_get_uri_scheme thunarx_file_info_get_mime_type thunarx_file_info_has_mime_type thunarx_file_info_is_directory +thunarx_file_info_get_vfs_info thunarx_file_info_list_copy thunarx_file_info_list_free #endif