1 /*
2  * Copyright © 2004 Noah Levitt
3  * Copyright © 2008 Christian Persch
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
18  */
19 
20 #ifndef GUCHARMAP_MINI_FONTSEL_H
21 #define GUCHARMAP_MINI_FONTSEL_H
22 
23 #include <gtk/gtk.h>
24 
25 G_BEGIN_DECLS
26 
27 #define GUCHARMAP_TYPE_MINI_FONT_SELECTION             (gucharmap_mini_font_selection_get_type ())
28 #define GUCHARMAP_MINI_FONT_SELECTION(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), GUCHARMAP_TYPE_MINI_FONT_SELECTION, GucharmapMiniFontSelection))
29 #define GUCHARMAP_MINI_FONT_SELECTION_CLASS(k)         (G_TYPE_CHECK_CLASS_CAST((k), GUCHARMAP_TYPE_MINI_FONT_SELECTION, GucharmapMiniFontSelectionClass))
30 #define GUCHARMAP_IS_MINI_FONT_SELECTION(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), GUCHARMAP_TYPE_MINI_FONT_SELECTION))
31 #define GUCHARMAP_IS_MINI_FONT_SELECTION_CLASS(k)      (G_TYPE_CHECK_CLASS_TYPE ((k), GUCHARMAP_TYPE_MINI_FONT_SELECTION))
32 #define GUCHARMAP_MINI_FONT_SELECTION_GET_CLASS(o)     (G_TYPE_INSTANCE_GET_CLASS ((o), GUCHARMAP_TYPE_MINI_FONT_SELECTION, GucharmapMiniFontSelectionClass))
33 
34 typedef struct _GucharmapMiniFontSelection GucharmapMiniFontSelection;
35 typedef struct _GucharmapMiniFontSelectionClass GucharmapMiniFontSelectionClass;
36 
37 struct _GucharmapMiniFontSelection
38 {
39   GtkHBox parent;
40 
41   GtkListStore         *family_store;
42   GtkEntryCompletion   *completion; /* font name completion */
43   GtkWidget            *family; /* combo box */
44   GtkWidget            *bold;   /* toggle button*/
45   GtkWidget            *italic; /* toggle button*/
46 
47   GtkAdjustment        *size_adj;
48   GtkWidget            *size;   /* spin button */
49 
50   PangoFontDescription *font_desc;
51 
52   gint                  default_size;
53 };
54 
55 struct _GucharmapMiniFontSelectionClass
56 {
57   GtkHBoxClass parent_class;
58 };
59 
60 
61 GType                  gucharmap_mini_font_selection_get_type         (void);
62 
63 GtkWidget *            gucharmap_mini_font_selection_new              (void);
64 
65 void                   gucharmap_mini_font_selection_set_font_desc    (GucharmapMiniFontSelection *fontsel,
66                                                                        PangoFontDescription       *font_desc);
67 
68 PangoFontDescription * gucharmap_mini_font_selection_get_font_desc    (GucharmapMiniFontSelection *fontsel);
69 
70 void                   gucharmap_mini_font_selection_change_font_size (GucharmapMiniFontSelection *fontsel,
71                                                                        float factor);
72 
73 void                   gucharmap_mini_font_selection_reset_font_size  (GucharmapMiniFontSelection *fontsel);
74 
75 G_END_DECLS
76 
77 #endif /* #ifndef GUCHARMAP_MINI_FONTSEL_H */
78