#include <glib/gprintf.h>
#include <string.h>
-#include "gtkfontchooserdialog.h"
+#include "gtkfontchooserdialogprivate.h"
#include "gtkfontchooser.h"
#include "gtkfontchooserwidget.h"
#include "gtkfontchooserwidgetprivate.h"
return parent_buildable_iface->get_internal_child (buildable, builder, childname);
}
+
+void
+gtk_font_chooser_dialog_set_filter (GtkFontChooserDialog *dialog,
+ GtkFilter *filter)
+{
+ gtk_font_chooser_widget_set_filter (GTK_FONT_CHOOSER_WIDGET (dialog->fontchooser), filter);
+}
--- /dev/null
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2017 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_FONT_CHOOSER_DIALOG_PRIVATE_H__
+#define __GTK_FONT_CHOOSER_DIALOG_PRIVATE_H__
+
+#include "gtkfontchooserdialog.h"
+#include "gtkfilter.h"
+
+G_BEGIN_DECLS
+
+void gtk_font_chooser_dialog_set_filter (GtkFontChooserDialog *dialog,
+ GtkFilter *filter);
+
+G_END_DECLS
+
+#endif /* __GTK_FONT_CHOOSER_WIDGET_PRIVATE_H__ */
#include "gtksortlistmodel.h"
#include "gtkstringsorter.h"
#include "gtkdropdown.h"
+#include "gtkmultifilter.h"
#include <hb-ot.h>
GtkSingleSelection *selection;
GtkCustomFilter *custom_filter;
GtkCustomFilter *user_filter;
+ GtkCustomFilter *multi_filter;
GtkFilterListModel *filter_model;
GtkWidget *preview;
gpointer filter_data;
GDestroyNotify filter_data_destroy;
+ GtkFilter *filter;
+
guint last_fontconfig_timestamp;
GtkFontChooserLevel level;
g_free (fontchooser->font_features);
+ g_clear_object (&fontchooser->filter);
+
G_OBJECT_CLASS (gtk_font_chooser_widget_parent_class)->finalize (object);
}
return fontchooser->tweak_action;
}
+
+void
+gtk_font_chooser_widget_set_filter (GtkFontChooserWidget *widget,
+ GtkFilter *filter)
+{
+ if (widget->filter)
+ gtk_multi_filter_remove (GTK_MULTI_FILTER (widget->multi_filter), 3);
+ g_set_object (&widget->filter, filter);
+ if (widget->filter)
+ gtk_multi_filter_append (GTK_MULTI_FILTER (widget->multi_filter), g_object_ref (filter));
+}
#define __GTK_FONT_CHOOSER_WIDGET_PRIVATE_H__
#include "gtkfontchooserwidget.h"
+#include "gtkfilter.h"
G_BEGIN_DECLS
GAction *gtk_font_chooser_widget_get_tweak_action (GtkWidget *fontchooser);
+void gtk_font_chooser_widget_set_filter (GtkFontChooserWidget *widget,
+ GtkFilter *filter);
+
G_END_DECLS
#endif /* __GTK_FONT_CHOOSER_WIDGET_PRIVATE_H__ */
<signal name="notify::pending" handler="rows_changed_cb" object="GtkFontChooserWidget" swapped="1"/>
<property name="incremental">1</property>
<property name="filter">
- <object class="GtkEveryFilter">
+ <object class="GtkEveryFilter" id="multi_filter">
<child>
<object class="GtkStringFilter">
<binding name="search">