1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * GimpTextStyleEditor
5  * Copyright (C) 2010  Michael Natterer <mitch@gimp.org>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GIMP_TEXT_STYLE_EDITOR_H__
22 #define __GIMP_TEXT_STYLE_EDITOR_H__
23 
24 
25 #define GIMP_TYPE_TEXT_STYLE_EDITOR            (gimp_text_style_editor_get_type ())
26 #define GIMP_TEXT_STYLE_EDITOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TEXT_STYLE_EDITOR, GimpTextStyleEditor))
27 #define GIMP_TEXT_STYLE_EDITOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TEXT_STYLE_EDITOR, GimpTextStyleEditorClass))
28 #define GIMP_IS_TEXT_STYLE_EDITOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TEXT_STYLE_EDITOR))
29 #define GIMP_IS_TEXT_STYLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TEXT_STYLE_EDITOR))
30 #define GIMP_TEXT_STYLE_EDITOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TEXT_STYLE_EDITOR, GimpTextStyleEditorClass))
31 
32 
33 typedef struct _GimpTextStyleEditorClass GimpTextStyleEditorClass;
34 
35 struct _GimpTextStyleEditor
36 {
37   GtkBox          parent_instance;
38 
39   Gimp           *gimp;
40   GimpContext    *context;
41 
42   GimpText       *text; /* read-only for default values */
43   GimpTextBuffer *buffer;
44 
45   GimpContainer  *fonts;
46   gdouble         resolution_x;
47   gdouble         resolution_y;
48 
49   GtkWidget      *upper_hbox;
50   GtkWidget      *lower_hbox;
51 
52   GtkWidget      *font_entry;
53   GtkWidget      *size_entry;
54 
55   GtkWidget      *color_button;
56 
57   GtkWidget      *clear_button;
58 
59   GtkWidget      *baseline_spinbutton;
60   GtkAdjustment  *baseline_adjustment;
61 
62   GtkWidget      *kerning_spinbutton;
63   GtkAdjustment  *kerning_adjustment;
64 
65   GList          *toggles;
66 
67   guint           update_idle_id;
68 };
69 
70 struct _GimpTextStyleEditorClass
71 {
72   GtkBoxClass  parent_class;
73 };
74 
75 
76 GType       gimp_text_style_editor_get_type  (void) G_GNUC_CONST;
77 
78 GtkWidget * gimp_text_style_editor_new       (Gimp                 *gimp,
79                                               GimpText             *text,
80                                               GimpTextBuffer       *buffer,
81                                               GimpContainer        *fonts,
82                                               gdouble               resolution_x,
83                                               gdouble               resolution_y);
84 
85 GList     * gimp_text_style_editor_list_tags (GimpTextStyleEditor  *editor,
86                                               GList               **remove_tags);
87 
88 
89 #endif /*  __GIMP_TEXT_STYLE_EDITOR_H__  */
90