Synopsis#include <gtk/gtk.h> GtkRecentManager; GtkRecentInfo; GtkRecentData; #define GTK_RECENT_MANAGER_ERROR enum GtkRecentManagerError; GtkRecentManager* gtk_recent_manager_new (void); GtkRecentManager* gtk_recent_manager_get_default (void); GtkRecentManager* gtk_recent_manager_get_for_screen (GdkScreen *screen); void gtk_recent_manager_set_screen (GtkRecentManager *manager, GdkScreen *screen); gboolean gtk_recent_manager_add_item (GtkRecentManager *manager, const gchar *uri); gboolean gtk_recent_manager_add_full (GtkRecentManager *manager, const gchar *uri, const GtkRecentData *recent_data); gboolean gtk_recent_manager_remove_item (GtkRecentManager *manager, const gchar *uri, GError **error); GtkRecentInfo* gtk_recent_manager_lookup_item (GtkRecentManager *manager, const gchar *uri, GError **error); gboolean gtk_recent_manager_has_item (GtkRecentManager *manager, const gchar *uri); gboolean gtk_recent_manager_move_item (GtkRecentManager *manager, const gchar *uri, const gchar *new_uri, GError **error); gint gtk_recent_manager_get_limit (GtkRecentManager *manager); void gtk_recent_manager_set_limit (GtkRecentManager *manager, gint limit); GList* gtk_recent_manager_get_items (GtkRecentManager *manager); gint gtk_recent_manager_purge_items (GtkRecentManager *manager, GError **error); GtkRecentInfo* gtk_recent_info_ref (GtkRecentInfo *info); void gtk_recent_info_unref (GtkRecentInfo *info); const gchar* gtk_recent_info_get_uri (GtkRecentInfo *info); const gchar* gtk_recent_info_get_display_name (GtkRecentInfo *info); const gchar* gtk_recent_info_get_description (GtkRecentInfo *info); const gchar* gtk_recent_info_get_mime_type (GtkRecentInfo *info); time_t gtk_recent_info_get_added (GtkRecentInfo *info); time_t gtk_recent_info_get_modified (GtkRecentInfo *info); time_t gtk_recent_info_get_visited (GtkRecentInfo *info); gboolean gtk_recent_info_get_private_hint (GtkRecentInfo *info); gboolean gtk_recent_info_get_application_info (GtkRecentInfo *info, const gchar *app_name, gchar **app_exec, guint *count, time_t *time_); gchar** gtk_recent_info_get_applications (GtkRecentInfo *info, gsize *length); gchar* gtk_recent_info_last_application (GtkRecentInfo *info); gchar** gtk_recent_info_get_groups (GtkRecentInfo *info, gsize *length); gboolean gtk_recent_info_has_group (GtkRecentInfo *info, const gchar *group_name); gboolean gtk_recent_info_has_application (GtkRecentInfo *info, const gchar *app_name); GdkPixbuf* gtk_recent_info_get_icon (GtkRecentInfo *info, gint size); gchar* gtk_recent_info_get_short_name (GtkRecentInfo *info); gchar* gtk_recent_info_get_uri_display (GtkRecentInfo *info); gint gtk_recent_info_get_age (GtkRecentInfo *info); gboolean gtk_recent_info_is_local (GtkRecentInfo *info); gboolean gtk_recent_info_exists (GtkRecentInfo *info); gboolean gtk_recent_info_match (GtkRecentInfo *info_a, GtkRecentInfo *info_b); Properties"filename" gchar* : Read / Write / Construct Only "limit" gint : Read / Write "size" gint : Read DescriptionGtkRecentManager provides a facility for adding, removing and looking up recently used files. Each recently used file is identified by its URI, and has meta-data associated to it, like the names and command lines of the applications that have registered it, the number of time each application has registered the same file, the mime type of the file and whether the file should be displayed only by the applications that have registered it. The GtkRecentManager acts like a database of all the recently used files. You can create new GtkRecentManager objects, but it is more efficient to use the standard recent manager for the GdkScreen so that informations about the recently used files is shared with other people using them. In case the default screen is being used, adding a new recently used file is as simple as: GtkRecentManager *manager; manager = gtk_recent_manager_get_default (); gtk_recent_manager_add_item (manager, file_uri); GtkRecentManager *manager; GtkRecentInfo *info; GError *error = NULL; manager = gtk_recent_manager_get_default (); info = gtk_recent_manager_lookup_item (manager, file_uri, &error); if (error) { g_warning ("Could not find the file: %s", error->message); g_error_free (error); } else { /* Use the info object */ gtk_recent_info_unref (info); } Recently used files are supported since GTK+ 2.10. DetailsGtkRecentManagertypedef struct _GtkRecentManager GtkRecentManager;
Acts as a database of information about the list of recently
used files. Normally, you retrieve the recent manager for a
particular screen using GtkRecentInfotypedef struct _GtkRecentInfo GtkRecentInfo; Contains informations found when looking up an entry of the recently used files list. GtkRecentDatatypedef struct { gchar *display_name; gchar *description; gchar *mime_type; gchar *app_name; gchar *app_exec; gchar **groups; gboolean is_private; } GtkRecentData;
Meta-data to be passed to
GTK_RECENT_MANAGER_ERROR#define GTK_RECENT_MANAGER_ERROR (gtk_recent_manager_error_quark ()) The GQuark used for GtkRecentManagerError errors. enum GtkRecentManagerErrortypedef enum { GTK_RECENT_MANAGER_ERROR_NOT_FOUND, GTK_RECENT_MANAGER_ERROR_INVALID_URI, GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING, GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED, GTK_RECENT_MANAGER_ERROR_READ, GTK_RECENT_MANAGER_ERROR_WRITE, GTK_RECENT_MANAGER_ERROR_UNKNOWN } GtkRecentManagerError; Error codes for GtkRecentManager operations
gtk_recent_manager_new ()GtkRecentManager* gtk_recent_manager_new (void); Creates a new recent manager object. Recent manager objects are used to handle the list of recently used resources. A GtkRecentManager object monitors the recently used resources list, and emits the "changed" signal each time something inside the list changes.
GtkRecentManager objects are expensive: be sure to create them only when
needed. You should use
Since 2.10 gtk_recent_manager_get_default ()GtkRecentManager* gtk_recent_manager_get_default (void); Gets a unique instance of GtkRecentManager, that you can share in your application without caring about memory management. The returned instance will be freed when you application terminates.
Since 2.10 gtk_recent_manager_get_for_screen ()GtkRecentManager* gtk_recent_manager_get_for_screen (GdkScreen *screen); Warning
Gets the recent manager object associated with
Since 2.10 gtk_recent_manager_set_screen ()void gtk_recent_manager_set_screen (GtkRecentManager *manager, GdkScreen *screen); Warning
Sets the screen for a recent manager; the screen is used to track the user's currently configured recently used documents storage.
Since 2.10 gtk_recent_manager_add_item ()gboolean gtk_recent_manager_add_item (GtkRecentManager *manager, const gchar *uri);
Adds a new resource, pointed by
This function automatically retrieves some of the needed
metadata and setting other metadata to common default values; it
then feeds the data to
See
Since 2.10 gtk_recent_manager_add_full ()gboolean gtk_recent_manager_add_full (GtkRecentManager *manager, const gchar *uri, const GtkRecentData *recent_data);
Adds a new resource, pointed by The passed URI will be used to identify this resource inside the list. In order to register the new recently used resource, metadata about the resource must be passed as well as the URI; the metadata is stored in a GtkRecentData structure, which must contain the MIME type of the resource pointed by the URI; the name of the application that is registering the item, and a command line to be used when launching the item. Optionally, a GtkRecentData structure might contain a UTF-8 string to be used when viewing the item instead of the last component of the URI; a short description of the item; whether the item should be considered private - that is, should be displayed only by the applications that have registered it.
Since 2.10 gtk_recent_manager_remove_item ()gboolean gtk_recent_manager_remove_item (GtkRecentManager *manager, const gchar *uri, GError **error);
Removes a resource pointed by
Since 2.10 gtk_recent_manager_lookup_item ()GtkRecentInfo* gtk_recent_manager_lookup_item (GtkRecentManager *manager, const gchar *uri, GError **error); Searches for a URI inside the recently used resources list, and returns a structure containing informations about the resource like its MIME type, or its display name.
Since 2.10 gtk_recent_manager_has_item ()gboolean gtk_recent_manager_has_item (GtkRecentManager *manager, const gchar *uri);
Checks whether there is a recently used resource registered
with
Since 2.10 gtk_recent_manager_move_item ()gboolean gtk_recent_manager_move_item (GtkRecentManager *manager, const gchar *uri, const gchar *new_uri, GError **error);
Changes the location of a recently used resource from Please note that this function will not affect the resource pointed by the URIs, but only the URI used in the recently used resources list.
Since 2.10 gtk_recent_manager_get_limit ()gint gtk_recent_manager_get_limit (GtkRecentManager *manager);
Gets the maximum number of items that the
Since 2.10 gtk_recent_manager_set_limit ()void gtk_recent_manager_set_limit (GtkRecentManager *manager, gint limit);
Sets the maximum number of item that the
Since 2.10 gtk_recent_manager_get_items ()GList* gtk_recent_manager_get_items (GtkRecentManager *manager); Gets the list of recently used resources.
Since 2.10 gtk_recent_manager_purge_items ()gint gtk_recent_manager_purge_items (GtkRecentManager *manager, GError **error); Purges every item from the recently used resources list.
Since 2.10 gtk_recent_info_ref ()GtkRecentInfo* gtk_recent_info_ref (GtkRecentInfo *info);
Increases the reference count of
Since 2.10 gtk_recent_info_unref ()void gtk_recent_info_unref (GtkRecentInfo *info);
Decreases the reference count of
Since 2.10 gtk_recent_info_get_uri ()const gchar* gtk_recent_info_get_uri (GtkRecentInfo *info); Gets the URI of the resource.
Since 2.10 gtk_recent_info_get_display_name ()const gchar* gtk_recent_info_get_display_name (GtkRecentInfo *info); Gets the name of the resource. If none has been defined, the basename of the resource is obtained.
Since 2.10 gtk_recent_info_get_description ()const gchar* gtk_recent_info_get_description (GtkRecentInfo *info); Gets the (short) description of the resource.
Since 2.10 gtk_recent_info_get_mime_type ()const gchar* gtk_recent_info_get_mime_type (GtkRecentInfo *info); Gets the MIME type of the resource.
Since 2.10 gtk_recent_info_get_added ()time_t gtk_recent_info_get_added (GtkRecentInfo *info); Gets the timestamp (seconds from system's Epoch) when the resource was added to the recently used resources list.
Since 2.10 gtk_recent_info_get_modified ()time_t gtk_recent_info_get_modified (GtkRecentInfo *info); Gets the timestamp (seconds from system's Epoch) when the resource was last modified.
Since 2.10 gtk_recent_info_get_visited ()time_t gtk_recent_info_get_visited (GtkRecentInfo *info); Gets the timestamp (seconds from system's Epoch) when the resource was last visited.
Since 2.10 gtk_recent_info_get_private_hint ()gboolean gtk_recent_info_get_private_hint (GtkRecentInfo *info);
Gets the value of the "private" flag. Resources in the recently used
list that have this flag set to
Since 2.10 gtk_recent_info_get_application_info ()gboolean gtk_recent_info_get_application_info (GtkRecentInfo *info, const gchar *app_name, gchar **app_exec, guint *count, time_t *time_);
Gets the data regarding the application that has registered the resource
pointed by If the command line contains any escape characters defined inside the storage specification, they will be expanded.
Since 2.10 gtk_recent_info_get_applications ()gchar** gtk_recent_info_get_applications (GtkRecentInfo *info, gsize *length); Retrieves the list of applications that have registered this resource.
Since 2.10 gtk_recent_info_last_application ()gchar* gtk_recent_info_last_application (GtkRecentInfo *info);
Gets the name of the last application that have registered the
recently used resource represented by
Since 2.10 gtk_recent_info_get_groups ()gchar** gtk_recent_info_get_groups (GtkRecentInfo *info, gsize *length);
Returns all groups registered for the recently used item
Since 2.10 gtk_recent_info_has_group ()gboolean gtk_recent_info_has_group (GtkRecentInfo *info, const gchar *group_name);
Checks whether
Since 2.10 gtk_recent_info_has_application ()gboolean gtk_recent_info_has_application (GtkRecentInfo *info, const gchar *app_name);
Checks whether an application registered this resource using
Since 2.10 gtk_recent_info_get_icon ()GdkPixbuf* gtk_recent_info_get_icon (GtkRecentInfo *info, gint size);
Retrieves the icon of size
Since 2.10 gtk_recent_info_get_short_name ()gchar* gtk_recent_info_get_short_name (GtkRecentInfo *info); Computes a valid UTF-8 string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to "file:///foo/bar.txt" will yield "bar.txt".
Since 2.10 gtk_recent_info_get_uri_display ()gchar* gtk_recent_info_get_uri_display (GtkRecentInfo *info);
Gets a displayable version of the resource's URI. If the resource
is local, it returns a local path; if the resource is not local,
it returns the UTF-8 encoded content of
Since 2.10 gtk_recent_info_get_age ()gint gtk_recent_info_get_age (GtkRecentInfo *info);
Gets the number of days elapsed since the last update of the resource
pointed by
Since 2.10 gtk_recent_info_is_local ()gboolean gtk_recent_info_is_local (GtkRecentInfo *info); Checks whether the resource is local or not by looking at the scheme of its URI.
Since 2.10 gtk_recent_info_exists ()gboolean gtk_recent_info_exists (GtkRecentInfo *info);
Checks whether the resource pointed by
Since 2.10 gtk_recent_info_match ()gboolean gtk_recent_info_match (GtkRecentInfo *info_a, GtkRecentInfo *info_b); Checks whether two GtkRecentInfo structures point to the same resource.
Since 2.10 Property DetailsThe
|
|
the recent manager |
|
user data set when the signal handler was connected. |
Since 2.10