Add filtering to the font chooser

This commit is contained in:
Matthias Clasen
2011-08-14 22:20:00 -04:00
parent ba564088c3
commit a09ee203ec
2 changed files with 129 additions and 81 deletions

View File

@ -81,6 +81,26 @@ gboolean gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchoo
void gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
gboolean show_preview_entry);
/**
* GtkFontFilterFunc:
* @family: a #PangoFontFamily
* @face: a #PangoFontFace belonging to @family
* @data (closure): user data passed to gtk_font_chooser_set_filter_func()
*
* The type of function that is used for deciding what fonts get
* shown in a #GtkFontChooser. See gtk_font_chooser_set_filter_func().
*
* Returns: %TRUE if the font should be displayed
*/
typedef gboolean (*GtkFontFilterFunc) (const PangoFontFamily *family,
const PangoFontFace *face,
gpointer data);
void gtk_font_chooser_set_filter_func (GtkFontChooser *fontchooser,
GtkFontFilterFunc filter,
gpointer data,
GDestroyNotify destroy);
G_END_DECLS
#endif /* __GTK_FONT_CHOOSER_H__ */