1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
5
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
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 2 of the License, or
10
* (at your option) any later version.
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.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
#include "libgimpwidgets/gimpwidgets.h"
28
#include "widgets-types.h"
30
#include "core/gimp.h"
31
#include "core/gimpcontext.h"
33
#include "text/gimpfont.h"
35
#include "pdb/procedural_db.h"
37
#include "gimpcontainerbox.h"
38
#include "gimpfontselect.h"
39
#include "gimpfontview.h"
42
static void gimp_font_select_class_init (GimpFontSelectClass *klass);
44
static GObject * gimp_font_select_constructor (GType type,
46
GObjectConstructParam *params);
48
static Argument * gimp_font_select_run_callback (GimpPdbDialog *dialog,
54
static GimpPdbDialogClass *parent_class = NULL;
58
gimp_font_select_get_type (void)
60
static GType dialog_type = 0;
64
static const GTypeInfo dialog_info =
66
sizeof (GimpFontSelectClass),
68
(GBaseFinalizeFunc) NULL,
69
(GClassInitFunc) gimp_font_select_class_init,
70
NULL, /* class_finalize */
71
NULL, /* class_data */
72
sizeof (GimpFontSelect),
74
NULL /* instance_init */
77
dialog_type = g_type_register_static (GIMP_TYPE_PDB_DIALOG,
86
gimp_font_select_class_init (GimpFontSelectClass *klass)
88
GObjectClass *object_class = G_OBJECT_CLASS (klass);
89
GimpPdbDialogClass *pdb_class = GIMP_PDB_DIALOG_CLASS (klass);
91
parent_class = g_type_class_peek_parent (klass);
93
object_class->constructor = gimp_font_select_constructor;
95
pdb_class->run_callback = gimp_font_select_run_callback;
99
gimp_font_select_constructor (GType type,
101
GObjectConstructParam *params)
104
GimpPdbDialog *dialog;
106
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
108
dialog = GIMP_PDB_DIALOG (object);
110
dialog->view = gimp_font_view_new (GIMP_VIEW_TYPE_LIST,
111
dialog->context->gimp->fonts,
113
GIMP_VIEW_SIZE_MEDIUM, 1,
114
dialog->menu_factory);
116
gimp_container_box_set_size_request (GIMP_CONTAINER_BOX (GIMP_CONTAINER_EDITOR (dialog->view)->view),
117
6 * (GIMP_VIEW_SIZE_MEDIUM + 2),
118
6 * (GIMP_VIEW_SIZE_MEDIUM + 2));
120
gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
121
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->view);
122
gtk_widget_show (dialog->view);
128
gimp_font_select_run_callback (GimpPdbDialog *dialog,
133
return procedural_db_run_proc (dialog->caller_context->gimp,
134
dialog->caller_context,
136
dialog->callback_name,
138
GIMP_PDB_STRING, object->name,
139
GIMP_PDB_INT32, closing,