Top |
gboolean | (*GtkFileFilterFunc) () |
GtkFileFilter * | gtk_file_filter_new () |
void | gtk_file_filter_set_name () |
const gchar * | gtk_file_filter_get_name () |
void | gtk_file_filter_add_mime_type () |
void | gtk_file_filter_add_pattern () |
void | gtk_file_filter_add_pixbuf_formats () |
void | gtk_file_filter_add_custom () |
GtkFileFilterFlags | gtk_file_filter_get_needed () |
gboolean | gtk_file_filter_filter () |
gboolean (*GtkFileFilterFunc) (const GtkFileFilterInfo *filter_info
,gpointer data
);
GtkFileFilter *
gtk_file_filter_new (void
);
Creates a new GtkFileFilter with no rules added to it.
Such a filter doesn't accept any files, so is not
particularly useful until you add rules with
gtk_file_filter_add_mime_type()
, gtk_file_filter_add_pattern()
,
or gtk_file_filter_add_custom()
. To create a filter
that accepts any file, use:
1 2 |
GtkFileFilter *filter = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter, "*"); |
Since: 2.4
void gtk_file_filter_set_name (GtkFileFilter *filter
,const gchar *name
);
Sets the human-readable name of the filter; this is the string that will be displayed in the file selector user interface if there is a selectable list of filters.
filter |
||
name |
the human-readable-name for the filter, or |
[allow-none] |
Since: 2.4
const gchar *
gtk_file_filter_get_name (GtkFileFilter *filter
);
Gets the human-readable name for the filter. See gtk_file_filter_set_name()
.
The human-readable name of the filter,
or NULL
. This value is owned by GTK+ and must not
be modified or freed.
Since: 2.4
void gtk_file_filter_add_mime_type (GtkFileFilter *filter
,const gchar *mime_type
);
Adds a rule allowing a given mime type to filter
.
Since: 2.4
void gtk_file_filter_add_pattern (GtkFileFilter *filter
,const gchar *pattern
);
Adds a rule allowing a shell style glob to a filter.
Since: 2.4
void
gtk_file_filter_add_pixbuf_formats (GtkFileFilter *filter
);
Adds a rule allowing image files in the formats supported by GdkPixbuf.
Since: 2.6
void gtk_file_filter_add_custom (GtkFileFilter *filter
,GtkFileFilterFlags needed
,GtkFileFilterFunc func
,gpointer data
,GDestroyNotify notify
);
Adds rule to a filter that allows files based on a custom callback
function. The bitfield needed
which is passed in provides information
about what sorts of information that the filter function needs;
this allows GTK+ to avoid retrieving expensive information when
it isn't needed by the filter.
filter |
||
needed |
bitfield of flags indicating the information that the custom filter function needs. |
|
func |
callback function; if the function returns |
|
data |
data to pass to |
|
notify |
function to call to free |
Since: 2.4
GtkFileFilterFlags
gtk_file_filter_get_needed (GtkFileFilter *filter
);
Gets the fields that need to be filled in for the structure
passed to gtk_file_filter_filter()
This function will not typically be used by applications; it is intended principally for use in the implementation of GtkFileChooser.
Since: 2.4
gboolean gtk_file_filter_filter (GtkFileFilter *filter
,const GtkFileFilterInfo *filter_info
);
Tests whether a file should be displayed according to filter
.
The GtkFileFilterInfo structure filter_info
should include
the fields returned from gtk_file_filter_get_needed()
.
This function will not typically be used by applications; it is intended principally for use in the implementation of GtkFileChooser.
Since: 2.4