]> Pileus Git - ~andy/gtk/blob - gtk/gtkfontchooser.h
GtkFontChooserDialog: Split the dialog out of gtkfontchooser.[ch] to gtkfontchooserdi...
[~andy/gtk] / gtk / gtkfontchooser.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011      Alberto Ruiz <aruiz@gnome.org>
3  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4  *
5  * GtkFontChooser widget for Gtk+, by Damon Chaplin, May 1998.
6  * Based on the GnomeFontSelector widget, by Elliot Lee, but major changes.
7  * The GnomeFontSelector was derived from app/text_tool.c in the GIMP.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
26 #error "Only <gtk/gtk.h> can be included directly."
27 #endif
28
29 #ifndef __GTK_FONT_CHOOSER_H__
30 #define __GTK_FONT_CHOOSER_H__
31
32 #include <gtk/gtkvbox.h>
33
34 G_BEGIN_DECLS
35
36 #define GTK_TYPE_FONT_CHOOSER              (gtk_font_chooser_get_type ())
37 #define GTK_FONT_CHOOSER(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FONT_CHOOSER, GtkFontChooser))
38 #define GTK_FONT_CHOOSER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FONT_CHOOSER, GtkFontChooserClass))
39 #define GTK_IS_FONT_CHOOSER(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FONT_CHOOSER))
40 #define GTK_IS_FONT_CHOOSER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FONT_CHOOSER))
41 #define GTK_FONT_CHOOSER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FONT_CHOOSER, GtkFontChooserClass))
42
43 typedef struct _GtkFontChooser              GtkFontChooser;
44 typedef struct _GtkFontChooserPrivate       GtkFontChooserPrivate;
45 typedef struct _GtkFontChooserClass         GtkFontChooserClass;
46
47 struct _GtkFontChooser
48 {
49   GtkVBox parent_instance;
50
51   /*< private >*/
52   GtkFontChooserPrivate *priv;
53 };
54
55 struct _GtkFontChooserClass
56 {
57   GtkVBoxClass parent_class;
58
59   /* Padding for future expansion */
60   void (*_gtk_reserved1) (void);
61   void (*_gtk_reserved2) (void);
62   void (*_gtk_reserved3) (void);
63   void (*_gtk_reserved4) (void);
64 };
65
66 /*****************************************************************************
67  * GtkFontChooser functions.
68  *   see the comments in the GtkFontChooserDialog functions.
69  *****************************************************************************/
70
71 GType        gtk_font_chooser_get_type                 (void) G_GNUC_CONST;
72 GtkWidget*   gtk_font_chooser_new                      (void);
73 PangoFontFamily*
74              gtk_font_chooser_get_family               (GtkFontChooser *fontchooser);
75 PangoFontFace*
76              gtk_font_chooser_get_face                 (GtkFontChooser *fontchooser);
77 gint         gtk_font_chooser_get_size                 (GtkFontChooser *fontchooser);
78 gchar*       gtk_font_chooser_get_font_name            (GtkFontChooser *fontchooser);
79
80 gboolean     gtk_font_chooser_set_font_name            (GtkFontChooser *fontchooser,
81                                                         const gchar    *fontname);
82 const gchar* gtk_font_chooser_get_preview_text         (GtkFontChooser *fontchooser);
83 void         gtk_font_chooser_set_preview_text         (GtkFontChooser *fontchooser,
84                                                         const gchar    *text);
85 gboolean     gtk_font_chooser_get_show_preview_entry   (GtkFontChooser *fontchooser);
86 void         gtk_font_chooser_set_show_preview_entry   (GtkFontChooser *fontchooser,
87                                                         gboolean        show_preview_entry);
88
89 #endif /* __GTK_FONT_CHOOSER_H__ */