From b32a56ae9ea7603f567381e9b2f660f49972f2a6 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Tue, 24 Mar 2009 21:34:13 +0000 Subject: Add gio.AppInfo and gio.FileAttributeInfo in docs. 2009-03-24 Gian Mario Tagliaretti * docs/Makefile.am: * docs/reference/pygio-classes.xml: * docs/reference/pygio-appinfo.xml: * docs/reference/pygio-constants.xml: * docs/reference/pygio-fileattributeinfo.xml: Add gio.AppInfo and gio.FileAttributeInfo in docs. svn path=/trunk/; revision=1031 --- docs/reference/ChangeLog | 9 + docs/reference/pygio-appinfo.xml | 737 +++++++++++++++++++++++++++++ docs/reference/pygio-classes.xml | 4 +- docs/reference/pygio-constants.xml | 128 ++++- docs/reference/pygio-fileattributeinfo.xml | 73 +++ 5 files changed, 948 insertions(+), 3 deletions(-) create mode 100644 docs/reference/pygio-appinfo.xml create mode 100644 docs/reference/pygio-fileattributeinfo.xml (limited to 'docs/reference') diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 1afd7f7..e65dea5 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,12 @@ +2009-03-24 Gian Mario Tagliaretti + + * docs/Makefile.am: + * docs/reference/pygio-classes.xml: + * docs/reference/pygio-appinfo.xml: + * docs/reference/pygio-constants.xml: + * docs/reference/pygio-fileattributeinfo.xml: Add gio.AppInfo and + gio.FileAttributeInfo in docs. + 2009-03-22 Gian Mario Tagliaretti * docs/Makefile.am: diff --git a/docs/reference/pygio-appinfo.xml b/docs/reference/pygio-appinfo.xml new file mode 100644 index 0000000..66a1f20 --- /dev/null +++ b/docs/reference/pygio-appinfo.xml @@ -0,0 +1,737 @@ + + + + + + gio.AppInfo + Information about an installed application and methods to launch it (with file arguments). + + + + Synopsis + + + gio.AppInfo + gobject.GInterface + + + gio.AppInfo + commandline + application_nameNone + content_typegio.APP_INFO_CREATE_NONE + + + + add_supports_type + content_type + + + can_remove_supports_type + + + + dup + + + + equal + appinfo2 + + + get_description + + + + get_executable + + + + get_icon + + + + get_id + + + + get_name + + + + launch + files + launch_context + + + launch_uris + uris + launch_context + + + remove_supports_type + content_type + + + set_as_default_for_extension + extension + + + set_as_default_for_type + content_type + + + should_show + + + + supports_files + + + + supports_uris + + + + + + +Functions + + + gio.app_info_get_all + + + gio.app_info_get_all_for_type + content_type + + gio.app_info_get_default_for_type + content_type + must_support_uris + + gio.app_info_get_default_for_uri_scheme + uri_scheme + + + + + + Ancestry + ++-- gobject.GInterface + +-- gio.AppInfo + + + + + + Known Implementation + + gio.AppInfo is implemented by + gio.DesktopAppInfo + + + + + Description + + + gio.AppInfo + and gio.AppLaunchContext + are used for describing and launching applications installed on the system. + + + As of GLib 2.20, URIs will always be converted to POSIX paths (using + gio.File.get_path()) when using + gio.AppInfo.launch() + even if the application requested an URI and not a POSIX path. For example for an desktop-file + based application with Exec key totem %U and a single URI, sftp://foo/file.avi, then /home/user/.gvfs/sftp + on foo/file.avi will be passed. This will only work if a set of suitable GIO extensions (such as gvfs 2.26 + compiled with FUSE support), is available and operational; if this is not the case, the URI will be passed + unmodified to the application. Some URIs, such as mailto:, of course cannot be mapped to a POSIX path + (in gvfs there's no FUSE mount for it); such URIs will be passed unmodified to the application. + + + Specifically for gvfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the + gio.File constructors + (since gvfs implements the GVfs extension point). As such, if the application needs to examine the URI, + it needs to use + gio.File.get_uri() + or similar on + gio.File. + In other words, an application cannot assume that the URI passed to e.g. + gio.File() constructor + is equal to the result of + gio.File.get_uri(). + + + + + Methods + + + gio.AppInfo.add_supports_type + + + add_supports_type + content_type + + + + + content_type : + A string. + + + + + The add_supports_type() method adds a content type + to the application information to indicate the application is capable of + opening files with the given content type. + + + + + gio.AppInfo.can_remove_supports_type + + + can_remove_supports_type + + + + + + Returns : + True if it is possible to remove + supported content types from a given appinfo, False + if not. + + + + + The can_remove_supports_type() method checks if a + supported content type can be removed from an application. + + + + + gio.AppInfo.dup + + + dup + + + + + + Returns : + A duplicate of appinfo. + + + + + The dup() method creates a duplicate of a + gio.AppInfo. + + + + + gio.AppInfo.equal + + + equal + icon2 + + + + + appinfo2 : + the second + gio.AppInfo + + + + Returns : + True if appinfo1 is equal to appinfo2. + False otherwise. + + + + + The equal() method checks if two + gio.AppInfos are equal. + + + + + gio.AppInfo.get_description + + + get_description + + + + + + Returns : + A string containing a description of the application + appinfo, or None if none. + + + + + The get_description() method gets a human-readable + description of an installed application. + + + + + gio.AppInfo.get_executable + + + get_executable + + + + + + Returns : + a string containing the appinfo's application + binary's name. + + + + + + The get_description() method gets the executable's + name for the installed application. + + + + + gio.AppInfo.get_icon + + + get_icon + + + + + + Returns : + the default + gio.Icon for appinfo. + + + + + + The get_icon() method gets the icon for the application. + + + + + gio.AppInfo.get_id + + + get_id + + + + + + Returns : + a string containing the application's ID. + + + + + + The get_id() method gets the ID of an application. + An id is a string that identifies the application. The exact format of the + id is platform dependent. For instance, on Unix this is the desktop file id + from the xdg menu specification. + + + Note that the returned ID may be None, depending on + how the appinfo has been constructed. + + + + + gio.AppInfo.get_name + + + get_name + + + + + + Returns : + the name of the application for appinfo. + + + + + + The get_name() method gets the installed + name of the application. + + + + + gio.AppInfo.launch + + + launch + files + launch_context + + + + + files : + a list of gio.File objects. + + + + launch_context : + a gio.AppLaunchContext + or None. + + + Returns : + True on successful launch, + False otherwise. + + + + + + The launch() method launches the application. + Passes files to the launched application as arguments, using the optional + launch_context to get information about the details of the launcher + (like what screen it is on). On error, error will be set accordingly. + + + To lauch the application without arguments pass a None for files list. + + + Note that even if the launch is successful the application launched can fail + to start if it runs into problems during startup. There is no way to detect this. + + + Some URIs can be changed when passed through a + gio.File + (for instance unsupported uris with strange formats like mailto:), so + if you have a textual uri you want to pass in as argument, consider using + gio.File.launch_uris() + instead. + + + + + gio.AppInfo.launch_uris + + + launch_uris + uris + launch_context + + + + + uris : + a list containing URIs to launch. + + + + launch_context : + a gio.AppLaunchContext + or None. + + + Returns : + True on successful launch, + False otherwise. + + + + + + The launch_uris() method launches the application. + Passes uris to the launched application as arguments, using the optional + launch_context to get information about the details of the launcher + (like what screen it is on). On error, error will be set accordingly. + + + To lauch the application without arguments pass a None for files list. + + + Note that even if the launch is successful the application launched can fail + to start if it runs into problems during startup. There is no way to detect this. + + + + + gio.AppInfo.remove_supports_type + + + remove_supports_type + content_type + + + + + content_type : + A string. + + + + + The remove_supports_type() method removes a + supported type from an application, if possible. + + + + + gio.AppInfo.set_as_default_for_extension + + + set_as_default_for_extension + extension + + + + + extension : + A string containing the file extension (without the dot). + + + + + + The set_as_default_for_extension() method sets the + application as the default handler for the given file extention. + + + + + gio.AppInfo.set_as_default_for_type + + + set_as_default_for_type + content_type + + + + + content_type : + The content type. + + + + + + The set_as_default_for_type() method sets the + application as the default handler for a given type. + + + + + gio.AppInfo.should_show + + + should_show + + + + + + Returns : + True if the appinfo should be shown, + False otherwise. + + + + + + The should_show() method checks if the application + info should be shown in menus that list available applications. + + + + + gio.AppInfo.supports_files + + + supports_files + + + + + + Returns : + True if the appinfo supports files. + + + + + + The supports_files() method checks if the application + accepts files as arguments. + + + + + gio.AppInfo.supports_uris + + + supports_uris + + + + + + Returns : + True if the appinfo supports uris. + + + + + + The supports_uris() method checks if the application + accepts uris as arguments. + + + + + + Functions + + + gio.app_info_get_all + + + app_info_get_all + + + + + + Returns : + A list of gio.AppInfos. + + + + + + The app_info_get_all() function gets a list of all of + the applications currently registered on this system. + + + For desktop files, this includes applications that have NoDisplay=true set or are + excluded from display by means of OnlyShowIn or NotShowIn. See + gio.AppInfo.should_show(). + The returned list does not include applications which have the Hidden key set. + + + + + gio.app_info_get_all_for_type + + + app_info_get_all_for_type + content_type + + + + + content_type : + the content type to find a + gio.AppInfo + for. + + + Returns : + A list of gio.AppInfos + for a given content type or None on error. + + + + + + The app_info_get_all_for_type() function gets a list of all + gio.AppInfos + for a given content type. + + + + + gio.app_info_get_default_for_type + + + app_info_get_default_for_type + content_type + must_support_uris + + + + + content_type : + the content type to find a + gio.AppInfo + for. + + + must_support_uris : + if True, the + gio.AppInfo + is expected to support URIs + + + Returns : + gio.AppInfo + for given content_type or None on error. + + + + + + The app_info_get_default_for_type() function gets the + gio.AppInfo + that correspond to a given content type. + + + + + gio.app_info_get_default_for_uri_scheme + + + app_info_get_default_for_uri_scheme + uri_scheme + + + + + uri_scheme : + a string containing a URI scheme. + + + Returns : + gio.AppInfo + for given uri_scheme or None on error. + + + + + + The app_info_get_default_for_uri_scheme() function gets + the default application for launching applications using this URI scheme. A URI + scheme is the initial part of the URI, up to but not including the + ':', e.g. "http", "ftp" or "sip". + + + + diff --git a/docs/reference/pygio-classes.xml b/docs/reference/pygio-classes.xml index 5a9ec86..b3ecda5 100644 --- a/docs/reference/pygio-classes.xml +++ b/docs/reference/pygio-classes.xml @@ -6,12 +6,14 @@ PyGioClass Reference - + + + diff --git a/docs/reference/pygio-constants.xml b/docs/reference/pygio-constants.xml index dd85126..d167de8 100644 --- a/docs/reference/pygio-constants.xml +++ b/docs/reference/pygio-constants.xml @@ -12,8 +12,11 @@ Synopsis + + + @@ -21,6 +24,35 @@ Description + + Gio AppInfo Create Flags Constants + + + Flags used when creating a gio.AppInfo + + + + + gio.APP_INFO_CREATE_NONE + + No flags. + + + + gio.APP_INFO_CREATE_NEEDS_TERMINAL + + Application opens in a terminal window. + + + + gio.APP_INFO_CREATE_SUPPORTS_URIS + + Application supports URI arguments. + + + + + Gio Emblem Origin Constants @@ -229,7 +261,6 @@ File contains too many symbolic links. - gio.ERROR_WOULD_BLOCK @@ -264,6 +294,100 @@ + + + Gio File Attribute Type Constants + + + The data types for file attributes. + + + + + gio.FILE_ATTRIBUTE_TYPE_BOOLEAN + + a boolean value. + + + + gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING + + a zero terminated string of non-zero bytes. + + + + gio.FILE_ATTRIBUTE_TYPE_INT32 + + a signed 4-byte/32-bit integer. + + + + gio.FILE_ATTRIBUTE_TYPE_INT64 + + a signed 8-byte/64-bit integer. + + + + gio.FILE_ATTRIBUTE_TYPE_INVALID + + indicates an invalid or uninitalized type. + + + + gio.FILE_ATTRIBUTE_TYPE_OBJECT + + a gobject.GObject. + + + + gio.FILE_ATTRIBUTE_TYPE_STRING + + a null terminated UTF8 string. + + + + gio.FILE_ATTRIBUTE_TYPE_UINT32 + + an unsigned 4-byte/32-bit integer. + + + + gio.FILE_ATTRIBUTE_TYPE_UINT64 + + an unsigned 8-byte/64-bit integer. + + + + + + + Gio File Attribute Flags Constants + + + Flags specifying the behaviour of an attribute. + + + + + gio.FILE_ATTRIBUTE_INFO_NONE + + no flags set. + + + + gio.FILE_ATTRIBUTE_INFO_COPY_WITH_FILE + + copy the attribute values when the file is copied. + + + + gio.FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED + + copy the attribute values when the file is moved. + + + + diff --git a/docs/reference/pygio-fileattributeinfo.xml b/docs/reference/pygio-fileattributeinfo.xml new file mode 100644 index 0000000..4b72c27 --- /dev/null +++ b/docs/reference/pygio-fileattributeinfo.xml @@ -0,0 +1,73 @@ + + + + + + gio.FileAttributeInfo + Information about a specific attribute. + + + + Synopsis + + + gio.FileAttributeInfo + __builtin__.object + + + + + + Ancestry + ++-- __builtin__.object + +-- gio.FileAttributeInfo + + + + + + Description + + + The gio.FileAttributeInfo + contains information about a specific attribute. + + + + + gio.FileAttributeInfo Attributes + +
+ + + + + + + + "name" + Read + The name of the attribute. + + + "type" + Read + the + + type of the attribute. + + + "flags" + Read + a set of + . + + + + + +
+
+
-- cgit