2001-04-14 23:21:45 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* 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 2 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2004-09-27 02:41:29 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs-types.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
|
2001-04-15 00:37:28 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2004-09-27 02:41:29 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2004-09-20 22:41:54 +08:00
|
|
|
#include "widgets/gimpmenufactory.h"
|
2004-05-06 15:41:53 +08:00
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "dialogs.h"
|
|
|
|
#include "dialogs-constructors.h"
|
|
|
|
|
2004-09-27 02:41:29 +08:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
GimpDialogFactory *global_dialog_factory = NULL;
|
|
|
|
GimpDialogFactory *global_dock_factory = NULL;
|
|
|
|
GimpDialogFactory *global_toolbox_factory = NULL;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
static const GimpDialogFactoryEntry toplevel_entries[] =
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
2003-05-03 02:43:15 +08:00
|
|
|
/* foreign toplevels without constructor */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-brightness-contrast-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-color-picker-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-12-12 19:34:53 +08:00
|
|
|
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-colorize-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-19 22:21:03 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-crop-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-curves-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-color-balance-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-hue-saturation-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-levels-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-11-25 23:30:16 +08:00
|
|
|
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-measure-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 17:56:25 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-posterize-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-rotate-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-scale-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-shear-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-text-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-06-27 22:26:04 +08:00
|
|
|
NULL, 0, TRUE, TRUE, TRUE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-threshold-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-perspective-tool-dialog", NULL, NULL, NULL, NULL,
|
2003-05-03 02:43:15 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
|
|
|
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-toolbox-color-dialog", NULL, NULL, NULL, NULL,
|
2003-05-16 19:53:50 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-gradient-editor-color-dialog", NULL, NULL, NULL, NULL,
|
2003-05-16 19:53:50 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-palette-editor-color-dialog", NULL, NULL, NULL, NULL,
|
2003-05-16 19:53:50 +08:00
|
|
|
NULL, 0, TRUE, TRUE, FALSE, FALSE },
|
|
|
|
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-colormap-editor-color-dialog", NULL, NULL, NULL, NULL,
|
2003-05-16 19:53:50 +08:00
|
|
|
NULL, 0, FALSE, TRUE, FALSE, FALSE },
|
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* ordinary toplevels */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-image-new-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_image_new_new, 0,
|
|
|
|
FALSE, TRUE, FALSE, FALSE },
|
|
|
|
{ "gimp-file-open-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_file_open_new, 0,
|
|
|
|
TRUE, TRUE, TRUE, FALSE },
|
|
|
|
{ "gimp-file-open-location-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_file_open_location_new, 0,
|
|
|
|
FALSE, TRUE, FALSE, FALSE },
|
|
|
|
{ "gimp-file-save-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_file_save_new, 0,
|
|
|
|
FALSE, TRUE, TRUE, FALSE },
|
2003-05-03 02:43:15 +08:00
|
|
|
|
|
|
|
/* singleton toplevels */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-preferences-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_preferences_get, 0,
|
|
|
|
TRUE, TRUE, FALSE, FALSE },
|
|
|
|
{ "gimp-module-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_module_get, 0,
|
|
|
|
TRUE, TRUE, TRUE, FALSE },
|
|
|
|
{ "gimp-tips-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_tips_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, FALSE },
|
|
|
|
{ "gimp-about-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_about_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, FALSE },
|
|
|
|
{ "gimp-error-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_error_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, FALSE },
|
|
|
|
{ "gimp-quit-dialog", NULL, NULL, NULL, NULL,
|
|
|
|
dialogs_quit_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, FALSE }
|
2001-04-18 00:00:27 +08:00
|
|
|
};
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
static const GimpDialogFactoryEntry dock_entries[] =
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
2003-05-03 02:43:15 +08:00
|
|
|
/* singleton dockables */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-tool-options",
|
|
|
|
N_("Tool Options"), NULL, GIMP_STOCK_TOOL_OPTIONS,
|
|
|
|
GIMP_HELP_TOOL_OPTIONS_DIALOG,
|
|
|
|
dialogs_tool_options_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-device-status",
|
|
|
|
N_("Devices"), N_("Device Status"), GIMP_STOCK_DEVICE_STATUS,
|
|
|
|
GIMP_HELP_DEVICE_STATUS_DIALOG,
|
|
|
|
dialogs_device_status_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-error-console",
|
|
|
|
N_("Errors"), N_("Error Console"), GIMP_STOCK_WARNING,
|
|
|
|
GIMP_HELP_ERRORS_DIALOG,
|
|
|
|
dialogs_error_console_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE },
|
2003-03-13 19:37:51 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* list views */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-image-list",
|
|
|
|
N_("Images"), NULL, GIMP_STOCK_IMAGES,
|
|
|
|
GIMP_HELP_IMAGE_DIALOG,
|
|
|
|
dialogs_image_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-brush-list",
|
|
|
|
N_("Brushes"), NULL, GIMP_STOCK_BRUSH,
|
|
|
|
GIMP_HELP_BRUSH_DIALOG,
|
|
|
|
dialogs_brush_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-pattern-list",
|
|
|
|
N_("Patterns"), NULL, GIMP_STOCK_PATTERN,
|
|
|
|
GIMP_HELP_PATTERN_DIALOG,
|
|
|
|
dialogs_pattern_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-gradient-list",
|
|
|
|
N_("Gradients"), NULL, GIMP_STOCK_GRADIENT,
|
|
|
|
GIMP_HELP_GRADIENT_DIALOG,
|
|
|
|
dialogs_gradient_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-palette-list",
|
|
|
|
N_("Palettes"), NULL, GIMP_STOCK_PALETTE,
|
|
|
|
GIMP_HELP_PALETTE_DIALOG,
|
|
|
|
dialogs_palette_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-font-list",
|
|
|
|
N_("Fonts"), NULL, GIMP_STOCK_FONT,
|
|
|
|
GIMP_HELP_FONT_DIALOG,
|
|
|
|
dialogs_font_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-tool-list",
|
|
|
|
N_("Tools"), NULL, GIMP_STOCK_TOOLS,
|
|
|
|
GIMP_HELP_TOOLS_DIALOG,
|
|
|
|
dialogs_tool_list_view_new, GIMP_VIEW_SIZE_SMALL,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-buffer-list",
|
|
|
|
N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
|
|
|
|
GIMP_HELP_BUFFER_DIALOG,
|
|
|
|
dialogs_buffer_list_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-document-list",
|
|
|
|
N_("History"), N_("Document History"), GTK_STOCK_OPEN,
|
|
|
|
GIMP_HELP_DOCUMENT_DIALOG,
|
|
|
|
dialogs_document_list_new, GIMP_VIEW_SIZE_LARGE,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-template-list",
|
|
|
|
N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE,
|
|
|
|
GIMP_HELP_TEMPLATE_DIALOG,
|
|
|
|
dialogs_template_list_new, GIMP_VIEW_SIZE_SMALL,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
2003-03-13 19:37:51 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* grid views */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-image-grid",
|
|
|
|
N_("Images"), NULL, GIMP_STOCK_IMAGES,
|
|
|
|
GIMP_HELP_IMAGE_DIALOG,
|
|
|
|
dialogs_image_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-brush-grid",
|
|
|
|
N_("Brushes"), NULL, GIMP_STOCK_BRUSH,
|
|
|
|
GIMP_HELP_BRUSH_DIALOG,
|
|
|
|
dialogs_brush_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-pattern-grid",
|
|
|
|
N_("Patterns"), NULL, GIMP_STOCK_PATTERN,
|
|
|
|
GIMP_HELP_PATTERN_DIALOG,
|
|
|
|
dialogs_pattern_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-gradient-grid",
|
|
|
|
N_("Gradients"), NULL, GIMP_STOCK_GRADIENT,
|
|
|
|
GIMP_HELP_GRADIENT_DIALOG,
|
|
|
|
dialogs_gradient_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-palette-grid",
|
|
|
|
N_("Palettes"), NULL, GIMP_STOCK_PALETTE,
|
|
|
|
GIMP_HELP_PALETTE_DIALOG,
|
|
|
|
dialogs_palette_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-font-grid",
|
|
|
|
N_("Fonts"), NULL, GIMP_STOCK_FONT,
|
|
|
|
GIMP_HELP_FONT_DIALOG,
|
|
|
|
dialogs_font_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-tool-grid",
|
|
|
|
N_("Tools"), NULL, GIMP_STOCK_TOOLS,
|
|
|
|
GIMP_HELP_TOOLS_DIALOG,
|
|
|
|
dialogs_tool_grid_view_new, GIMP_VIEW_SIZE_SMALL,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-buffer-grid",
|
|
|
|
N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
|
|
|
|
GIMP_HELP_BUFFER_DIALOG,
|
|
|
|
dialogs_buffer_grid_view_new, GIMP_VIEW_SIZE_MEDIUM,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-document-grid",
|
|
|
|
N_("History"), N_("Document History"), GTK_STOCK_OPEN,
|
|
|
|
GIMP_HELP_DOCUMENT_DIALOG,
|
|
|
|
dialogs_document_grid_new, GIMP_VIEW_SIZE_LARGE,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
2003-03-13 19:37:51 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* image related */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-layer-list",
|
|
|
|
N_("Layers"), NULL, GIMP_STOCK_LAYERS,
|
|
|
|
GIMP_HELP_LAYER_DIALOG,
|
|
|
|
dialogs_layer_list_view_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-channel-list",
|
|
|
|
N_("Channels"), NULL, GIMP_STOCK_CHANNELS,
|
|
|
|
GIMP_HELP_CHANNEL_DIALOG,
|
|
|
|
dialogs_channel_list_view_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-vectors-list",
|
|
|
|
N_("Paths"), NULL, GIMP_STOCK_PATHS,
|
|
|
|
GIMP_HELP_PATH_DIALOG,
|
|
|
|
dialogs_vectors_list_view_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-indexed-palette",
|
|
|
|
N_("Colormap"), N_("Indexed Palette"), GIMP_STOCK_INDEXED_PALETTE,
|
|
|
|
GIMP_HELP_INDEXED_PALETTE_DIALOG,
|
|
|
|
dialogs_colormap_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-histogram-editor",
|
|
|
|
N_("Histogram"), NULL, GIMP_STOCK_HISTOGRAM,
|
|
|
|
GIMP_HELP_HISTOGRAM_DIALOG,
|
|
|
|
dialogs_histogram_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-selection-editor",
|
|
|
|
N_("Selection"), N_("Selection Editor"), GIMP_STOCK_TOOL_RECT_SELECT,
|
|
|
|
GIMP_HELP_SELECTION_DIALOG,
|
|
|
|
dialogs_selection_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-undo-history",
|
|
|
|
N_("Undo"), N_("Undo History"), GIMP_STOCK_UNDO_HISTORY,
|
|
|
|
GIMP_HELP_UNDO_DIALOG,
|
|
|
|
dialogs_undo_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
2003-03-13 19:37:51 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* display related */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-navigation-view",
|
|
|
|
N_("Navigation"), N_("Display Navigation"), GIMP_STOCK_NAVIGATION,
|
|
|
|
GIMP_HELP_NAVIGATION_DIALOG,
|
|
|
|
dialogs_navigation_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
2003-03-13 19:37:51 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* editors */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-color-editor",
|
|
|
|
N_("FG/BG"), N_("FG/BG Color"), GIMP_STOCK_DEFAULT_COLORS,
|
|
|
|
GIMP_HELP_COLOR_DIALOG,
|
|
|
|
dialogs_color_editor_new, 0,
|
|
|
|
FALSE, FALSE, FALSE, TRUE },
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
/* singleton editors */
|
2004-09-27 02:41:29 +08:00
|
|
|
{ "gimp-brush-editor",
|
|
|
|
N_("Brush Editor"), NULL, GIMP_STOCK_BRUSH,
|
|
|
|
GIMP_HELP_BRUSH_EDITOR_DIALOG,
|
|
|
|
dialogs_brush_editor_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-gradient-editor",
|
|
|
|
N_("Gradient Editor"), NULL, GIMP_STOCK_GRADIENT,
|
|
|
|
GIMP_HELP_GRADIENT_EDITOR_DIALOG,
|
|
|
|
dialogs_gradient_editor_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE },
|
|
|
|
{ "gimp-palette-editor",
|
|
|
|
N_("Palette Editor"), NULL, GIMP_STOCK_PALETTE,
|
|
|
|
GIMP_HELP_PALETTE_EDITOR_DIALOG,
|
|
|
|
dialogs_palette_editor_get, 0,
|
|
|
|
TRUE, FALSE, FALSE, TRUE }
|
2001-04-18 00:00:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
void
|
2004-09-20 22:41:54 +08:00
|
|
|
dialogs_init (Gimp *gimp,
|
|
|
|
GimpMenuFactory *menu_factory)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
2001-04-18 00:00:27 +08:00
|
|
|
gint i;
|
|
|
|
|
2004-02-01 03:00:26 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2004-09-20 22:41:54 +08:00
|
|
|
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
|
2004-02-01 03:00:26 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
global_dialog_factory = gimp_dialog_factory_new ("toplevel",
|
|
|
|
gimp_get_user_context (gimp),
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2001-07-02 22:58:02 +08:00
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
global_toolbox_factory = gimp_dialog_factory_new ("toolbox",
|
|
|
|
gimp_get_user_context (gimp),
|
2004-09-20 22:41:54 +08:00
|
|
|
menu_factory,
|
2002-03-15 01:07:02 +08:00
|
|
|
dialogs_toolbox_get);
|
2004-09-27 02:41:29 +08:00
|
|
|
gimp_dialog_factory_set_constructor (global_toolbox_factory,
|
|
|
|
dialogs_dockable_constructor);
|
2002-03-15 01:07:02 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
global_dock_factory = gimp_dialog_factory_new ("dock",
|
|
|
|
gimp_get_user_context (gimp),
|
2004-09-20 22:41:54 +08:00
|
|
|
menu_factory,
|
2001-07-07 20:17:23 +08:00
|
|
|
dialogs_dock_new);
|
2004-09-27 02:41:29 +08:00
|
|
|
gimp_dialog_factory_set_constructor (global_dock_factory,
|
|
|
|
dialogs_dockable_constructor);
|
2001-07-02 22:58:02 +08:00
|
|
|
|
2001-10-23 01:27:46 +08:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++)
|
2001-07-02 22:58:02 +08:00
|
|
|
gimp_dialog_factory_register_entry (global_dialog_factory,
|
|
|
|
toplevel_entries[i].identifier,
|
2004-09-27 02:41:29 +08:00
|
|
|
gettext (toplevel_entries[i].name),
|
|
|
|
gettext (toplevel_entries[i].blurb),
|
|
|
|
toplevel_entries[i].stock_id,
|
|
|
|
toplevel_entries[i].help_id,
|
2001-07-02 22:58:02 +08:00
|
|
|
toplevel_entries[i].new_func,
|
2001-11-24 00:25:01 +08:00
|
|
|
toplevel_entries[i].preview_size,
|
2001-07-02 22:58:02 +08:00
|
|
|
toplevel_entries[i].singleton,
|
|
|
|
toplevel_entries[i].session_managed,
|
2001-07-18 04:50:01 +08:00
|
|
|
toplevel_entries[i].remember_size,
|
|
|
|
toplevel_entries[i].remember_if_open);
|
2001-04-18 00:00:27 +08:00
|
|
|
|
2001-10-23 01:27:46 +08:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (dock_entries); i++)
|
2001-07-02 22:58:02 +08:00
|
|
|
gimp_dialog_factory_register_entry (global_dock_factory,
|
|
|
|
dock_entries[i].identifier,
|
2004-09-27 02:41:29 +08:00
|
|
|
gettext (dock_entries[i].name),
|
|
|
|
gettext (dock_entries[i].blurb),
|
|
|
|
dock_entries[i].stock_id,
|
|
|
|
dock_entries[i].help_id,
|
2001-07-02 22:58:02 +08:00
|
|
|
dock_entries[i].new_func,
|
2001-11-24 00:25:01 +08:00
|
|
|
dock_entries[i].preview_size,
|
2001-07-02 22:58:02 +08:00
|
|
|
dock_entries[i].singleton,
|
|
|
|
dock_entries[i].session_managed,
|
2001-07-18 04:50:01 +08:00
|
|
|
dock_entries[i].remember_size,
|
|
|
|
dock_entries[i].remember_if_open);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
2001-04-17 02:49:29 +08:00
|
|
|
|
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
dialogs_exit (Gimp *gimp)
|
2001-04-17 02:49:29 +08:00
|
|
|
{
|
2004-02-01 03:00:26 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2002-03-08 08:27:45 +08:00
|
|
|
if (global_dialog_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (global_dialog_factory);
|
2002-03-08 08:27:45 +08:00
|
|
|
global_dialog_factory = NULL;
|
|
|
|
}
|
|
|
|
|
2002-03-15 01:07:02 +08:00
|
|
|
/* destroy the "global_toolbox_factory" _before_ destroying the
|
|
|
|
* "global_dock_factory" because the "global_toolbox_factory" owns
|
|
|
|
* dockables which were created by the "global_dock_factory". This
|
|
|
|
* way they are properly removed from the "global_dock_factory", which
|
|
|
|
* would complain about stale entries otherwise.
|
|
|
|
*/
|
|
|
|
if (global_toolbox_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (global_toolbox_factory);
|
2002-03-15 01:07:02 +08:00
|
|
|
global_toolbox_factory = NULL;
|
|
|
|
}
|
|
|
|
|
2002-03-08 08:27:45 +08:00
|
|
|
if (global_dock_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (global_dock_factory);
|
2002-03-08 08:27:45 +08:00
|
|
|
global_dock_factory = NULL;
|
|
|
|
}
|
2001-04-17 02:49:29 +08:00
|
|
|
}
|
2004-04-29 20:52:29 +08:00
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
dialogs_get_toolbox (void)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_toolbox_factory), NULL);
|
|
|
|
|
|
|
|
for (list = global_toolbox_factory->open_dialogs;
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_TOPLEVEL (list->data))
|
|
|
|
return list->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|