1 | #ifndef __GNOME_FONT_DIALOG_H__ |
---|
2 | #define __GNOME_FONT_DIALOG_H__ |
---|
3 | |
---|
4 | /* |
---|
5 | * Copyright (C) 1999-2001 Ximian Inc. and authors |
---|
6 | * |
---|
7 | * Authors: |
---|
8 | * Chris Lahey <clahey@ximian.com> |
---|
9 | * Lauris Kaplinski <lauris@ximian.com> |
---|
10 | * |
---|
11 | * Font selector, preview and dialog implementation |
---|
12 | * |
---|
13 | * This program is free software; you can redistribute it and/or |
---|
14 | * modify it under the terms of the GNU Library General Public License |
---|
15 | * as published by the Free Software Foundation; either version 2 of |
---|
16 | * the License, or (at your option) any later version. |
---|
17 | * |
---|
18 | * This program is distributed in the hope that it will be useful, |
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | * GNU Library General Public License for more details. |
---|
22 | * |
---|
23 | * You should have received a copy of the GNU Library General Public |
---|
24 | * License along with this program; if not, write to the Free Software |
---|
25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
26 | */ |
---|
27 | |
---|
28 | #include <glib.h> |
---|
29 | |
---|
30 | G_BEGIN_DECLS |
---|
31 | |
---|
32 | #define GNOME_TYPE_FONT_PREVIEW (gnome_font_preview_get_type ()) |
---|
33 | #define GNOME_FONT_PREVIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_TYPE_FONT_PREVIEW, GnomeFontPreview)) |
---|
34 | #define GNOME_FONT_PREVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNOME_TYPE_FONT_PREVIEW, GnomeFontPreviewClass)) |
---|
35 | #define GNOME_IS_FONT_PREVIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_TYPE_FONT_PREVIEW)) |
---|
36 | #define GNOME_IS_FONT_PREVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_TYPE_FONT_PREVIEW)) |
---|
37 | #define GNOME_FONT_PREVIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNOME_TYPE_FONT_PREVIEW, GnomeFontPreviewClass)) |
---|
38 | |
---|
39 | #define GNOME_TYPE_FONT_SELECTION (gnome_font_selection_get_type ()) |
---|
40 | #define GNOME_FONT_SELECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_TYPE_FONT_SELECTION, GnomeFontSelection)) |
---|
41 | #define GNOME_FONT_SELECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNOME_TYPE_FONT_SELECTION, GnomeFontSelectionClass)) |
---|
42 | #define GNOME_IS_FONT_SELECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_TYPE_FONT_SELECTION)) |
---|
43 | #define GNOME_IS_FONT_SELECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_TYPE_FONT_SELECTION)) |
---|
44 | #define GNOME_FONT_SELECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNOME_TYPE_FONT_SELECTION, GnomeFontSelectionClass)) |
---|
45 | |
---|
46 | #define GNOME_TYPE_FONT_DIALOG (gnome_font_dialog_get_type ()) |
---|
47 | #define GNOME_FONT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_TYPE_FONT_DIALOG, GnomeFontDialog)) |
---|
48 | #define GNOME_FONT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNOME_TYPE_FONT_DIALOG, GnomeFontDialogClass)) |
---|
49 | #define GNOME_IS_FONT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_TYPE_FONT_DIALOG)) |
---|
50 | #define GNOME_IS_FONT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_TYPE_FONT_DIALOG)) |
---|
51 | #define GNOME_FONT_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNOME_TYPE_FONT_DIALOG, GnomeFontDialogClass)) |
---|
52 | |
---|
53 | typedef struct _GnomeFontSelection GnomeFontSelection; |
---|
54 | typedef struct _GnomeFontSelectionClass GnomeFontSelectionClass; |
---|
55 | |
---|
56 | typedef struct _GnomeFontPreview GnomeFontPreview; |
---|
57 | typedef struct _GnomeFontPreviewClass GnomeFontPreviewClass; |
---|
58 | |
---|
59 | typedef struct _GnomeFontDialog GnomeFontDialog; |
---|
60 | typedef struct _GnomeFontDialogClass GnomeFontDialogClass; |
---|
61 | |
---|
62 | #include <gtk/gtkwidget.h> |
---|
63 | #include <libgnomeprint/gnome-font.h> |
---|
64 | |
---|
65 | /* |
---|
66 | * INTERNALS ARE PRIVATE UNTIL THEY ARE STABILIZED |
---|
67 | * |
---|
68 | * We implement single signal at moment: |
---|
69 | * |
---|
70 | * void (*font_set) (GnomeFontSelection *selection, GnomeFont *font); |
---|
71 | * |
---|
72 | * You have to ref font in handler, if you want to guarantee it's persistence |
---|
73 | * |
---|
74 | */ |
---|
75 | |
---|
76 | /***************************************************************************** |
---|
77 | * GtkFontSelection functions. |
---|
78 | * see the comments in the GtkFontSelectionDialog functions. |
---|
79 | *****************************************************************************/ |
---|
80 | |
---|
81 | GtkType gnome_font_selection_get_type (void); |
---|
82 | |
---|
83 | GtkWidget *gnome_font_selection_new (void); |
---|
84 | |
---|
85 | /* |
---|
86 | * Reading of selection |
---|
87 | * |
---|
88 | * Font and Face are given with reference, so do not forget to unref these |
---|
89 | */ |
---|
90 | |
---|
91 | GnomeFontFace *gnome_font_selection_get_face (GnomeFontSelection *fontsel); |
---|
92 | gdouble gnome_font_selection_get_size (GnomeFontSelection *fontsel); |
---|
93 | GnomeFont *gnome_font_selection_get_font (GnomeFontSelection *fontsel); |
---|
94 | |
---|
95 | /* |
---|
96 | * You can unref font instantly |
---|
97 | */ |
---|
98 | |
---|
99 | void gnome_font_selection_set_font (GnomeFontSelection *fontsel, GnomeFont *font); |
---|
100 | |
---|
101 | /* |
---|
102 | * GnomeFontPreview |
---|
103 | */ |
---|
104 | |
---|
105 | GtkType gnome_font_preview_get_type (void); |
---|
106 | |
---|
107 | GtkWidget * gnome_font_preview_new (void); |
---|
108 | |
---|
109 | /* |
---|
110 | * Sets UTF-8 demonstration phrase (NULL means font's default one) |
---|
111 | */ |
---|
112 | |
---|
113 | void gnome_font_preview_set_phrase (GnomeFontPreview *preview, const guchar *phrase); |
---|
114 | |
---|
115 | void gnome_font_preview_set_font (GnomeFontPreview *preview, GnomeFont *font); |
---|
116 | void gnome_font_preview_set_color (GnomeFontPreview *preview, guint32 color); |
---|
117 | |
---|
118 | /***************************************************************************** |
---|
119 | * GnomeFontSelectionDialog functions. |
---|
120 | * most of these functions simply call the corresponding function in the |
---|
121 | * GnomeFontSelection. |
---|
122 | *****************************************************************************/ |
---|
123 | |
---|
124 | GtkType gnome_font_dialog_get_type (void); |
---|
125 | |
---|
126 | GtkWidget *gnome_font_dialog_new (const gchar *title); |
---|
127 | |
---|
128 | GtkWidget *gnome_font_dialog_get_fontsel (GnomeFontDialog *gfsd); |
---|
129 | |
---|
130 | GtkWidget *gnome_font_dialog_get_preview (GnomeFontDialog *gfsd); |
---|
131 | |
---|
132 | G_END_DECLS |
---|
133 | |
---|
134 | #endif /* __GNOME_FONT_DIALOG_H__ */ |
---|
135 | |
---|
136 | |
---|
137 | |
---|