gimp/app/widgets/gimpfontselect.c

113 lines
3.8 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpfontselect.c
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
#include "core/gimpparamspecs.h"
#include "text/gimpfont.h"
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
#include "pdb/gimppdb.h"
#include "gimpcontainerbox.h"
#include "gimpfontselect.h"
#include "gimpfontview.h"
static void gimp_font_select_constructed (GObject *object);
static GimpValueArray * gimp_font_select_run_callback (GimpPdbDialog *dialog,
GimpObject *object,
gboolean closing,
GError **error);
G_DEFINE_TYPE (GimpFontSelect, gimp_font_select, GIMP_TYPE_PDB_DIALOG)
#define parent_class gimp_font_select_parent_class
static void
gimp_font_select_class_init (GimpFontSelectClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpPdbDialogClass *pdb_class = GIMP_PDB_DIALOG_CLASS (klass);
object_class->constructed = gimp_font_select_constructed;
pdb_class->run_callback = gimp_font_select_run_callback;
}
static void
gimp_font_select_init (GimpFontSelect *select)
{
}
static void
gimp_font_select_constructed (GObject *object)
{
GimpPdbDialog *dialog = GIMP_PDB_DIALOG (object);
app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c 2009-03-22 Michael Natterer <mitch@gimp.org> * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcolordialog.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcursor.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpdockable.c * app/widgets/gimperrordialog.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpgradientselect.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpmessagedialog.c * app/widgets/gimpnavigationview.c * app/widgets/gimppaletteselect.c * app/widgets/gimppaletteview.c * app/widgets/gimppatternselect.c * app/widgets/gimpprogressbox.c * app/widgets/gimpprogressdialog.c * app/widgets/gimpscalebutton.c * app/widgets/gimpselectiondata.c * app/widgets/gimpsessioninfo.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpuimanager.c * app/widgets/gimpview-popup.c * app/widgets/gimpview.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpwidgets-utils.c: use accessors for various members of GTK+ structures that don't exist any longer when GSEAL_ENABLE is defined. svn path=/trunk/; revision=28193
2009-03-23 00:35:53 +08:00
GtkWidget *content_area;
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
dialog->view = gimp_font_view_new (GIMP_VIEW_TYPE_LIST,
dialog->context->gimp->fonts,
dialog->context,
GIMP_VIEW_SIZE_MEDIUM, 1,
dialog->menu_factory);
gimp_container_box_set_size_request (GIMP_CONTAINER_BOX (GIMP_CONTAINER_EDITOR (dialog->view)->view),
6 * (GIMP_VIEW_SIZE_MEDIUM + 2),
6 * (GIMP_VIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c 2009-03-22 Michael Natterer <mitch@gimp.org> * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcolordialog.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcursor.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpdockable.c * app/widgets/gimperrordialog.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpgradientselect.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpmessagedialog.c * app/widgets/gimpnavigationview.c * app/widgets/gimppaletteselect.c * app/widgets/gimppaletteview.c * app/widgets/gimppatternselect.c * app/widgets/gimpprogressbox.c * app/widgets/gimpprogressdialog.c * app/widgets/gimpscalebutton.c * app/widgets/gimpselectiondata.c * app/widgets/gimpsessioninfo.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpuimanager.c * app/widgets/gimpview-popup.c * app/widgets/gimpview.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpwidgets-utils.c: use accessors for various members of GTK+ structures that don't exist any longer when GSEAL_ENABLE is defined. svn path=/trunk/; revision=28193
2009-03-23 00:35:53 +08:00
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_pack_start (GTK_BOX (content_area), dialog->view, TRUE, TRUE, 0);
gtk_widget_show (dialog->view);
}
static GimpValueArray *
gimp_font_select_run_callback (GimpPdbDialog *dialog,
GimpObject *object,
gboolean closing,
GError **error)
{
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
return gimp_pdb_execute_procedure_by_name (dialog->pdb,
dialog->caller_context,
NULL, error,
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
dialog->callback_name,
G_TYPE_STRING, gimp_object_get_name (object),
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
GIMP_TYPE_INT32, closing,
G_TYPE_NONE);
}