]> Pileus Git - ~andy/gtk/blob - gtk/gtkfontchooserdialog.h
GtkFontChooser: Use const instead of G_CONST_RETURN
[~andy/gtk] / gtk / gtkfontchooserdialog.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_DIALOG_H__
30 #define __GTK_FONT_CHOOSER_DIALOG_H__
31
32 #include <gtk/gtkdialog.h>
33
34 G_BEGIN_DECLS
35
36 #define GTK_TYPE_FONT_CHOOSER_DIALOG              (gtk_font_chooser_dialog_get_type ())
37 #define GTK_FONT_CHOOSER_DIALOG(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FONT_CHOOSER_DIALOG, GtkFontChooserDialog))
38 #define GTK_FONT_CHOOSER_DIALOG_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FONT_CHOOSER_DIALOG, GtkFontChooserDialogClass))
39 #define GTK_IS_FONT_CHOOSER_DIALOG(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FONT_CHOOSER_DIALOG))
40 #define GTK_IS_FONT_CHOOSER_DIALOG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FONT_CHOOSER_DIALOG))
41 #define GTK_FONT_CHOOSER_DIALOG_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FONT_CHOOSER_DIALOG, GtkFontChooserDialogClass))
42
43 typedef struct _GtkFontChooserDialog              GtkFontChooserDialog;
44 typedef struct _GtkFontChooserDialogPrivate       GtkFontChooserDialogPrivate;
45 typedef struct _GtkFontChooserDialogClass         GtkFontChooserDialogClass;
46
47 struct _GtkFontChooserDialog
48 {
49   GtkDialog parent_instance;
50
51   /*< private >*/
52   GtkFontChooserDialogPrivate *priv;
53 };
54
55 struct _GtkFontChooserDialogClass
56 {
57   GtkDialogClass 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  * GtkFontChooserDialog functions.
68  *   most of these functions simply call the corresponding function in the
69  *   GtkFontChooser.
70  *****************************************************************************/
71
72 GType        gtk_font_chooser_dialog_get_type           (void) G_GNUC_CONST;
73 GtkWidget* gtk_font_chooser_dialog_new                (const gchar            *title);
74
75 GtkWidget* gtk_font_chooser_dialog_get_font_selection (GtkFontChooserDialog *fcd);
76
77 gchar*     gtk_font_chooser_dialog_get_font_name      (GtkFontChooserDialog *fcd);
78
79 gboolean   gtk_font_chooser_dialog_set_font_name      (GtkFontChooserDialog *fcd,
80                                                        const gchar          *fontname);
81 const gchar* 
82           gtk_font_chooser_dialog_get_preview_text    (GtkFontChooserDialog *fcd);
83
84 void      gtk_font_chooser_dialog_set_preview_text    (GtkFontChooserDialog *fcd,
85                                                        const gchar          *text);
86
87 G_END_DECLS
88
89 #endif /* __GTK_FONT_CHOOSER_DIALOG_H__ */