package Gtk_Recent_Info_List is new Glib.Glist.Generic_List (Gtk_Recent_Info);
type Gtk_Recent_Manager_Record is new Glib.Object.GObject_Record with private;
type Gtk_Recent_Info_Record is new Glib.Object.GObject_Record with private;
type Gtk_Recent_Manager is access all Gtk_Recent_Manager_Record'Class;
subtype time_t is Long_Integer;
type Gtk_Recent_Info is access all Gtk_Recent_Info_Record'Class;
type Application_Info_Record is record Result : Boolean; -- True if an application with App_Name has registered this resource -- inside the recently used list, or False otherwise. App_Exec : String_Ptr; -- Pointer to the string containing the command line. Free using -- Glib.Free when no longer needed. Count : Guint; -- The number of times this item was registered. Time : time_t; -- The timestamp this item was last registered for this application. end record;
Filename_Property : constant Glib.Properties.Property_String;
Limit_Property : constant Glib.Properties.Property_Int;
Size_Property : constant Glib.Properties.Property_Int;
function Convert
( | Widget | : Gtk_Recent_Info) return System.Address; |
function Convert
( | Widget | : System.Address) return Gtk_Recent_Info; |
function Get_Type_Recent_Info return GType;
function Exists
( | Info | : access Gtk_Recent_Info_Record) return Boolean; |
function Get_Added
( | Info | : access Gtk_Recent_Info_Record) return time_t; |
function Get_Age
( | Info | : access Gtk_Recent_Info_Record) return Gint; |
function Get_Application_Info
( | Info | : access Gtk_Recent_Info_Record; |
App_Name | : String) return Application_Info_Record; |
function Get_Description
( | Info | : access Gtk_Recent_Info_Record) return UTF8_String; |
function Get_Display_Name
( | Info | : access Gtk_Recent_Info_Record) return String; |
function Get_Icon
( | Info | : access Gtk_Recent_Info_Record; |
Size | : Gint) return Gdk.Pixbuf.Gdk_Pixbuf; |
function Get_Mime_Type
( | Info | : access Gtk_Recent_Info_Record) return UTF8_String; |
function Get_Modified
( | Info | : access Gtk_Recent_Info_Record) return time_t; |
function Get_Private_Hint
( | Info | : access Gtk_Recent_Info_Record) return Boolean; |
function Get_Uri
( | Info | : access Gtk_Recent_Info_Record) return UTF8_String; |
function Get_Visited
( | Info | : access Gtk_Recent_Info_Record) return time_t; |
function Has_Application
( | Info | : access Gtk_Recent_Info_Record; |
App_Name | : UTF8_String) return Boolean; |
function Has_Group
( | Info | : access Gtk_Recent_Info_Record; |
Group_Name | : UTF8_String) return Boolean; |
function Is_Local
( | Info | : access Gtk_Recent_Info_Record) return Boolean; |
function Match
( | Info_A | : access Gtk_Recent_Info_Record'Class; |
Info_B | : access Gtk_Recent_Info_Record'Class) return Boolean; |
function Ref
( | Info | : access Gtk_Recent_Info_Record) return Gtk_Recent_Info; |
procedure Unref
( | Info | : access Gtk_Recent_Info_Record); |
procedure Gtk_New
( | Widget | : out Gtk_Recent_Manager); |
procedure Initialize
( | Widget | : access Gtk_Recent_Manager_Record'Class); |
function Get_Type return GType;
function Error_Quark return GQuark;
function Add_Full
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String; | |
Display_Name | : UTF8_String := ""; | |
Description | : UTF8_String := ""; | |
Mime_Type | : UTF8_String; | |
App_Name | : UTF8_String; | |
App_Exec | : UTF8_String; | |
Groups | : GNAT.Strings.String_List; | |
Is_Private | : Boolean) return Boolean; |
function Add_Item
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String) return Boolean; |
function Get_Default return Gtk_Recent_Manager;
function Get_Items
( | Manager | : access Gtk_Recent_Manager_Record) return Gtk_Recent_Info_List.Glist; |
function Get_Limit
( | Manager | : access Gtk_Recent_Manager_Record) return Gint; |
procedure Set_Limit
( | Manager | : access Gtk_Recent_Manager_Record; |
Limit | : Gint); |
function Has_Item
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String) return Boolean; |
function Lookup_Item
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String; | |
Error | : Glib.Error.GError) return Gtk_Recent_Info; |
function Move_Item
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String; | |
New_Uri | : UTF8_String; | |
Error | : Glib.Error.GError) return Boolean; |
function Purge_Items
( | Manager | : access Gtk_Recent_Manager_Record; |
Error | : Glib.Error.GError) return Gint; |
function Remove_Item
( | Manager | : access Gtk_Recent_Manager_Record; |
Uri | : UTF8_String; | |
Error | : Glib.Error.GError) return Boolean; |
function Get_For_Screen
( | Screen | : access Gdk.Screen.Gdk_Screen_Record) return Gtk_Recent_Manager; |
procedure Set_Screen
( | Manager | : access Gtk_Recent_Manager_Record; |
Screen | : access Gdk.Screen.Gdk_Screen_Record'Class); |
Gtk_Recent_Manager 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 Gtk_Recent_Manager acts like a database of all the recently used files.
You can create new Gtk_Recent_Manager objects, but it is more efficient to use the standard recent manager for the Gdk_Screen so that information about 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: declare Manager : constant Gtk_Recent_Manager := Get_Default; begin Add_Item (Manager, File_URI); end; While looking up a recently used file is as simple as using: declare Manager : constant Gtk_Recent_Manager := Get_Default; Info : Gtk_Recent_Info; Error : Glib.Error.GError; begin Lookup_Item (Info, Manager, File_URI, Error); if Error /= null then -- Use the info object Unref (Info); else Put_Line ("Could not find the file: " & Glib.Error.Get_Message (Error)); Glib.Error.Error_Free (Error); end if; end; Recently used files are supported since GTK+ 2.10.
Binding from C File version 2.16.6