package Gtk_Recent_Filter_List is new Generic_SList (Gtk.Recent_Filter.Gtk_Recent_Filter);
package Gtk_Recent_Filter_Flags_Properties is new Generic_Internal_Discrete_Property (Gtk_Recent_Filter_Flags);
package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Recent_Filter_Record, Gtk_Recent_Filter);
type Gtk_Recent_Filter_Record is new GObject_Record with null record;
type Gtk_Recent_Filter is access all Gtk_Recent_Filter_Record'Class;
type Gtk_Recent_Filter_Info is record Contains : Gtk_Recent_Filter_Flags; URI : Interfaces.C.Strings.chars_ptr; Display_Name : Interfaces.C.Strings.chars_ptr; Mime_Type : Interfaces.C.Strings.chars_ptr; Applications : Interfaces.C.Strings.char_array_access; Groups : Interfaces.C.Strings.char_array_access; Age : Gint; end record;
type Gtk_Recent_Filter_Func is access function (Filter_Info : Gtk_Recent_Filter_Info) return Boolean;
type Property_Gtk_Recent_Filter_Flags is new Gtk_Recent_Filter_Flags_Properties.Property;
Recent_Filter_Uri : constant Gtk_Recent_Filter_Flags := 1;
Recent_Filter_Display_Name : constant Gtk_Recent_Filter_Flags := 2;
Recent_Filter_Mime_Type : constant Gtk_Recent_Filter_Flags := 4;
Recent_Filter_Application : constant Gtk_Recent_Filter_Flags := 8;
Recent_Filter_Group : constant Gtk_Recent_Filter_Flags := 16;
Recent_Filter_Age : constant Gtk_Recent_Filter_Flags := 32;
function From_Object_Free
| ( | B | : access Gtk_Recent_Filter_Info) return Gtk_Recent_Filter_Info; |
function Convert
| ( | R | : Gtk.Recent_Filter.Gtk_Recent_Filter) return System.Address; |
function Convert
| ( | R | : System.Address) return Gtk.Recent_Filter.Gtk_Recent_Filter; |
procedure Gtk_New
| ( | Filter | : out Gtk_Recent_Filter); |
procedure Initialize
| ( | Filter | : not null access Gtk_Recent_Filter_Record'Class); |
function Gtk_Recent_Filter_New return Gtk_Recent_Filter;
function Get_Type return Glib.GType;
procedure Add_Age
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Days | : Gint); |
procedure Add_Application
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Application | : UTF8_String); |
procedure Add_Custom
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Needed | : Gtk_Recent_Filter_Flags; | |
| Func | : Gtk_Recent_Filter_Func; | |
| Data_Destroy | : Glib.G_Destroy_Notify_Address); |
procedure Add_Group
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Group | : UTF8_String); |
procedure Add_Mime_Type
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Mime_Type | : UTF8_String); |
procedure Add_Pattern
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Pattern | : UTF8_String); |
procedure Add_Pixbuf_Formats
| ( | Filter | : not null access Gtk_Recent_Filter_Record); |
function Filter
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Filter_Info | : Gtk_Recent_Filter_Info) return Boolean; |
function Get_Name
| ( | Filter | : not null access Gtk_Recent_Filter_Record) return UTF8_String; |
procedure Set_Name
| ( | Filter | : not null access Gtk_Recent_Filter_Record; |
| Name | : UTF8_String); |
function Get_Needed
| ( | Filter | : not null access Gtk_Recent_Filter_Record) return Gtk_Recent_Filter_Flags; |
function "+"
| ( | Widget | : access Gtk_Recent_Filter_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
| ( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Recent_Filter renames Implements_Gtk_Buildable.To_Object; |
A Gtk.Recent_Filter.Gtk_Recent_Filter can be used to restrict the files being shown in a Gtk.Recent_Chooser.Gtk_Recent_Chooser. Files can be filtered based on their name (with Gtk.Recent_Filter.Add_Pattern), on their mime type (with Gtk.File_Filter.Add_Mime_Type), on the application that has registered them (with Gtk.Recent_Filter.Add_Application), or by a custom filter function (with Gtk.Recent_Filter.Add_Custom).
Filtering by mime type handles aliasing and subclassing of mime types; e.g. a filter for text/plain also matches a file with mime type application/rtf, since application/rtf is a subclass of text/plain. Note that Gtk.Recent_Filter.Gtk_Recent_Filter allows wildcards for the subtype of a mime type, so you can e.g. filter for image/<!-- -->*.
Normally, filters are used by adding them to a Gtk.Recent_Chooser.Gtk_Recent_Chooser, see Gtk.Recent_Chooser.Add_Filter, but it is also possible to manually use a filter on a file with Gtk.Recent_Filter.Filter.
Recently used files are supported since GTK+ 2.10. == GtkRecentFilter as GtkBuildable == The GtkRecentFilter implementation of the GtkBuildable interface supports adding rules using the <mime-types>, <patterns> and <applications> elements and listing the rules within. Specifying a <mime-type>, <pattern> or <application> is the same as calling Gtk.Recent_Filter.Add_Mime_Type, Gtk.Recent_Filter.Add_Pattern or Gtk.Recent_Filter.Add_Application. == A UI definition fragment specifying GtkRecentFilter rules == <object class="GtkRecentFilter"> <mime-types> <mime-type>text/plain</mime-type> <mime-type>image/png</mime-type> </mime-types> <patterns> <pattern>*.txt</pattern> <pattern>*.png</pattern> </patterns> <applications> <application>gimp</application> <application>gedit</application> <application>glade</application> </applications> </object>