1 /* 2 * gretl -- Gnu Regression, Econometrics and Time-series Library 3 * Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 /* 21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS 22 * file for a list of people on the GTK+ Team. See the ChangeLog 23 * files for a list of changes. These files are distributed with 24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 25 */ 26 27 /* 28 * Modified to allow filtering of fonts by Allin Cottrell, 2002 29 */ 30 31 #ifndef __GTK_FONTSELHACK_H__ 32 #define __GTK_FONTSELHACK_H__ 33 34 #include <gdk/gdk.h> 35 #include <glib-object.h> 36 37 #define GTK_TYPE_FONTSEL_HACK_DIALOG (gtk_fontsel_hack_dialog_get_type ()) 38 #define GTK_FONTSEL_HACK_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FONTSEL_HACK_DIALOG, \ 39 GtkFontselHackDialog)) 40 41 typedef struct _GtkFontselHack GtkFontselHack; 42 typedef struct _GtkFontselHackClass GtkFontselHackClass; 43 44 typedef struct _GtkFontselHackDialog GtkFontselHackDialog; 45 typedef struct _GtkFontselHackDialogClass GtkFontselHackDialogClass; 46 47 typedef enum { 48 FONT_HACK_NONE, 49 FONT_HACK_LATIN, 50 FONT_HACK_LATIN_MONO 51 } FontFilterType; 52 53 GType gtk_fontsel_hack_get_type (void) G_GNUC_CONST; 54 GtkWidget* gtk_fontsel_hack_new (void); 55 gchar* gtk_fontsel_hack_get_font_name (GtkFontselHack *fontsel); 56 57 gboolean gtk_fontsel_hack_set_font_name (GtkFontselHack *fontsel, 58 const gchar *fontname); 59 G_CONST_RETURN gchar* gtk_fontsel_hack_get_preview_text (GtkFontselHack *fontsel); 60 void gtk_fontsel_hack_set_preview_text (GtkFontselHack *fontsel, 61 const gchar *text); 62 63 gint gtk_fontsel_hack_get_filter (GtkFontselHack *fontsel); 64 void gtk_fontsel_hack_set_filter (GtkFontselHack *fontsel, 65 FontFilterType filter); 66 67 GType gtk_fontsel_hack_dialog_get_type (void) G_GNUC_CONST; 68 69 GtkWidget* gtk_fontsel_hack_dialog_new (const gchar *title); 70 71 gchar* gtk_fontsel_hack_dialog_get_font_name(GtkFontselHackDialog *fsd); 72 73 gboolean gtk_fontsel_hack_dialog_set_font_name(GtkFontselHackDialog *fsd, 74 const gchar *fontname); 75 76 G_CONST_RETURN gchar* gtk_fontsel_hack_dialog_get_preview_text (GtkFontselHackDialog *fsd); 77 78 /* This sets the text in the preview entry. It will be copied by the entry. */ 79 void gtk_fontsel_hack_dialog_set_preview_text(GtkFontselHackDialog *fsd, 80 const gchar *text); 81 82 /* This returns the font filter currently in force. */ 83 gint gtk_fontsel_hack_dialog_get_filter(GtkFontselHackDialog *fsd); 84 85 /* This sets the font filter for the dialog. */ 86 void gtk_fontsel_hack_dialog_set_filter (GtkFontselHackDialog *fsd, 87 FontFilterType filter); 88 89 GtkWidget *gtk_fontsel_hack_dialog_ok_button(GtkWidget *fsd); 90 91 GtkWidget *gtk_fontsel_hack_dialog_cancel_button(GtkWidget *fsd); 92 93 94 #endif /* __GTK_FONTSELHACK_H__ */ 95