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