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>
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "apptypes.h"
|
2001-05-08 11:48:54 +08:00
|
|
|
#include "widgets/widgets-types.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpbrushgenerated.h"
|
|
|
|
#include "core/gimpchannel.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpgradient.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimplayer.h"
|
2001-07-10 01:58:56 +08:00
|
|
|
#include "core/gimppalette.h"
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
#include "widgets/gimpbrushfactoryview.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "widgets/gimpbufferview.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "widgets/gimpcontainerlistview.h"
|
|
|
|
#include "widgets/gimpcontainergridview.h"
|
|
|
|
#include "widgets/gimpdatafactoryview.h"
|
2001-04-16 00:16:13 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2001-04-22 08:38:56 +08:00
|
|
|
#include "widgets/gimpimagedock.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "widgets/gimpdockable.h"
|
2001-04-16 00:16:13 +08:00
|
|
|
#include "widgets/gimpdockbook.h"
|
2001-04-20 10:30:43 +08:00
|
|
|
#include "widgets/gimpdrawablelistview.h"
|
2001-05-07 00:14:34 +08:00
|
|
|
#include "widgets/gimplistitem.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "widgets/gimppreview.h"
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "about-dialog.h"
|
2001-04-20 10:30:43 +08:00
|
|
|
#include "brush-editor.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "brush-select.h"
|
2001-07-09 05:44:52 +08:00
|
|
|
#include "brushes-commands.h"
|
2001-04-29 23:23:01 +08:00
|
|
|
#include "channels-commands.h"
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "color-area.h"
|
|
|
|
#include "colormap-dialog.h"
|
2001-04-18 00:00:27 +08:00
|
|
|
#include "devices.h"
|
|
|
|
#include "dialogs-constructors.h"
|
|
|
|
#include "docindex.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "errorconsole.h"
|
2001-04-18 00:00:27 +08:00
|
|
|
#include "gdisplay.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gradient-editor.h"
|
|
|
|
#include "gradient-select.h"
|
2001-07-09 05:44:52 +08:00
|
|
|
#include "gradients-commands.h"
|
2001-04-29 23:23:01 +08:00
|
|
|
#include "layers-commands.h"
|
2001-07-09 05:44:52 +08:00
|
|
|
#include "menus.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "palette-editor.h"
|
2001-07-10 01:58:56 +08:00
|
|
|
#include "palette-select.h"
|
2001-07-09 05:44:52 +08:00
|
|
|
#include "palettes-commands.h"
|
2001-05-12 01:02:30 +08:00
|
|
|
#include "paths-dialog.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "pattern-select.h"
|
2001-07-09 05:44:52 +08:00
|
|
|
#include "patterns-commands.h"
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "preferences-dialog.h"
|
|
|
|
#include "tips-dialog.h"
|
2001-05-25 09:24:12 +08:00
|
|
|
#include "tool-options-dialog.h"
|
2001-04-18 00:00:27 +08:00
|
|
|
#include "toolbox.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "app_procs.h"
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "gdisplay.h"
|
2001-04-14 23:21:45 +08:00
|
|
|
#include "gimprc.h"
|
2001-04-19 00:39:34 +08:00
|
|
|
#include "module_db.h"
|
|
|
|
#include "undo_history.h"
|
|
|
|
|
|
|
|
#ifdef DISPLAY_FILTERS
|
|
|
|
#include "gdisplay_color_ui.h"
|
|
|
|
#endif /* DISPLAY_FILTERS */
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
static void dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
|
|
|
|
GimpContext *context);
|
|
|
|
|
|
|
|
static GtkWidget * dialogs_brush_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size);
|
|
|
|
static GtkWidget * dialogs_pattern_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size);
|
|
|
|
static GtkWidget * dialogs_gradient_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size);
|
|
|
|
static GtkWidget * dialogs_palette_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size);
|
|
|
|
static GtkWidget * dialogs_tool_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size);
|
|
|
|
|
|
|
|
static void dialogs_set_view_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context);
|
2001-06-26 20:09:43 +08:00
|
|
|
static void dialogs_set_editor_context_func (GimpDockable *dockable,
|
2001-04-24 00:58:18 +08:00
|
|
|
GimpContext *context);
|
|
|
|
static void dialogs_set_drawable_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context);
|
2001-05-12 01:02:30 +08:00
|
|
|
static void dialogs_set_path_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context);
|
2001-04-24 00:58:18 +08:00
|
|
|
|
|
|
|
static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
|
|
|
|
const gchar *name,
|
|
|
|
const gchar *short_name,
|
|
|
|
GimpDockableGetTabFunc get_tab_func,
|
|
|
|
GimpDockableSetContextFunc set_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-20 10:30:43 +08:00
|
|
|
static void dialogs_drawable_view_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDrawableListView *view);
|
2001-05-12 01:02:30 +08:00
|
|
|
static void dialogs_path_view_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GtkWidget *view);
|
2001-04-20 10:30:43 +08:00
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_toolbox_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return toolbox_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_options_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return tool_options_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_device_status_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return device_status_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_brush_select_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return brush_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_pattern_select_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return pattern_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_gradient_select_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return gradient_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-07-10 01:58:56 +08:00
|
|
|
dialogs_palette_select_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return palette_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_error_console_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return error_console_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_document_index_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
return document_index_create ();
|
|
|
|
}
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_preferences_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
return preferences_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_input_devices_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
return input_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_module_browser_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
return module_db_browser_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_indexed_palette_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
GimpColormapDialog *cmap_dlg;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
cmap_dlg = gimp_colormap_dialog_create (context->gimp->images);
|
2001-04-19 00:39:34 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (cmap_dlg), "selected",
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_indexed_palette_selected),
|
|
|
|
factory->context);
|
|
|
|
|
|
|
|
return GTK_WIDGET (cmap_dlg);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_undo_history_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
GimpImage *gimage;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
gdisp = gimp_context_get_display (context);
|
2001-04-19 00:39:34 +08:00
|
|
|
|
|
|
|
if (! gdisp)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
|
|
|
|
|
|
|
if (! gimage->undo_history)
|
|
|
|
gimage->undo_history = undo_history_new (gimage);
|
|
|
|
|
|
|
|
return gimage->undo_history;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_display_filters_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
#ifdef DISPLAY_FILTERS
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
gdisp = gimp_context_get_display (context);
|
2001-04-19 00:39:34 +08:00
|
|
|
|
|
|
|
if (! gdisp)
|
|
|
|
gdisp = color_area_gdisp;
|
|
|
|
|
|
|
|
if (! gdisp->cd_ui)
|
|
|
|
gdisplay_color_ui_new (gdisp);
|
|
|
|
|
|
|
|
return gdisp->cd_ui;
|
|
|
|
#else
|
|
|
|
return NULL;
|
|
|
|
#endif /* DISPLAY_FILTERS */
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tips_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
return tips_dialog_create ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_about_get (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-19 00:39:34 +08:00
|
|
|
{
|
|
|
|
return about_dialog_create ();
|
|
|
|
}
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
|
2001-04-22 08:38:56 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_dock_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-22 08:38:56 +08:00
|
|
|
{
|
2001-07-05 03:31:35 +08:00
|
|
|
return gimp_image_dock_new (factory, context->gimp->images);
|
2001-04-22 08:38:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-29 23:23:01 +08:00
|
|
|
/* list views */
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_image_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
view = gimp_container_list_view_new (context->gimp->images,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
|
|
|
5, 3);
|
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Image List", "Images",
|
2001-04-24 00:58:18 +08:00
|
|
|
NULL,
|
|
|
|
dialogs_set_view_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_brush_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
view = gimp_brush_factory_view_new (GIMP_VIEW_TYPE_LIST,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->brush_factory,
|
2001-06-30 03:25:03 +08:00
|
|
|
dialogs_edit_brush_func,
|
|
|
|
context,
|
|
|
|
TRUE,
|
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
brushes_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Brush List", "Brushes",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_brush_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_pattern_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->pattern_factory,
|
2001-04-14 23:21:45 +08:00
|
|
|
NULL,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
patterns_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Pattern List", "Patterns",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_pattern_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_gradient_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->gradient_factory,
|
2001-04-20 10:30:43 +08:00
|
|
|
dialogs_edit_gradient_func,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-29 23:23:01 +08:00
|
|
|
32 / 2,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
gradients_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Gradient List", "Gradients",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_gradient_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_palette_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->palette_factory,
|
2001-04-20 10:30:43 +08:00
|
|
|
dialogs_edit_palette_func,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
palettes_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Palette List", "Palettes",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_palette_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
view = gimp_container_list_view_new (context->gimp->tool_info_list,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
22,
|
|
|
|
5, 3);
|
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Tool List", "Tools",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_tab_func,
|
|
|
|
dialogs_set_view_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
GtkWidget *
|
|
|
|
dialogs_buffer_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_LIST,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->named_buffers,
|
2001-06-26 20:09:43 +08:00
|
|
|
context,
|
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
NULL);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Buffer List", "Buffers",
|
|
|
|
NULL,
|
|
|
|
dialogs_set_editor_context_func);
|
|
|
|
}
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-16 00:16:13 +08:00
|
|
|
/* grid views */
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_image_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
view = gimp_container_grid_view_new (context->gimp->images,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
|
|
|
5, 3);
|
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Image Grid", "Images",
|
2001-04-24 00:58:18 +08:00
|
|
|
NULL,
|
|
|
|
dialogs_set_view_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_brush_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
view = gimp_brush_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->brush_factory,
|
2001-06-30 03:25:03 +08:00
|
|
|
dialogs_edit_brush_func,
|
|
|
|
context,
|
|
|
|
TRUE,
|
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
brushes_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Brush Grid", "Brushes",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_brush_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_pattern_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->pattern_factory,
|
2001-04-14 23:21:45 +08:00
|
|
|
NULL,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
patterns_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Pattern Grid", "Patterns",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_pattern_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_gradient_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->gradient_factory,
|
2001-04-20 10:30:43 +08:00
|
|
|
dialogs_edit_gradient_func,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
gradients_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Gradient Grid", "Gradients",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_gradient_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_palette_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->palette_factory,
|
2001-04-20 10:30:43 +08:00
|
|
|
dialogs_edit_palette_func,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
palettes_show_context_menu);
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Palette Grid", "Palettes",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_palette_tab_func,
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
view = gimp_container_grid_view_new (context->gimp->tool_info_list,
|
2001-04-24 00:58:18 +08:00
|
|
|
context,
|
2001-04-14 23:21:45 +08:00
|
|
|
22,
|
|
|
|
5, 3);
|
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Tool Grid", "Tools",
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_tab_func,
|
|
|
|
dialogs_set_view_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
GtkWidget *
|
|
|
|
dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-07-05 03:31:35 +08:00
|
|
|
context->gimp->named_buffers,
|
2001-06-26 20:09:43 +08:00
|
|
|
context,
|
|
|
|
32,
|
2001-07-09 05:44:52 +08:00
|
|
|
5, 3,
|
|
|
|
NULL);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
return dialogs_dockable_new (view,
|
|
|
|
"Buffer Grid", "Buffers",
|
|
|
|
NULL,
|
|
|
|
dialogs_set_editor_context_func);
|
|
|
|
}
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
|
2001-04-20 10:30:43 +08:00
|
|
|
/* image related dialogs */
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_layer_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-20 10:30:43 +08:00
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
GtkWidget *view;
|
2001-04-25 02:17:17 +08:00
|
|
|
GtkWidget *dockable;
|
2001-04-20 10:30:43 +08:00
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
gimage = gimp_context_get_image (context);
|
2001-04-20 10:30:43 +08:00
|
|
|
|
|
|
|
view = gimp_drawable_list_view_new
|
2001-07-07 20:17:23 +08:00
|
|
|
(gimprc.preview_size,
|
|
|
|
gimage,
|
2001-04-20 10:30:43 +08:00
|
|
|
GIMP_TYPE_LAYER,
|
|
|
|
"active_layer_changed",
|
|
|
|
(GimpGetContainerFunc) gimp_image_get_layers,
|
|
|
|
(GimpGetDrawableFunc) gimp_image_get_active_layer,
|
|
|
|
(GimpSetDrawableFunc) gimp_image_set_active_layer,
|
|
|
|
(GimpReorderDrawableFunc) gimp_image_position_layer,
|
|
|
|
(GimpAddDrawableFunc) gimp_image_add_layer,
|
|
|
|
(GimpRemoveDrawableFunc) gimp_image_remove_layer,
|
2001-04-29 23:23:01 +08:00
|
|
|
(GimpCopyDrawableFunc) gimp_layer_copy,
|
|
|
|
(GimpNewDrawableFunc) layers_new_layer_query,
|
|
|
|
(GimpEditDrawableFunc) layers_edit_layer_query,
|
|
|
|
(GimpDrawableContextFunc) layers_show_context_menu);
|
2001-04-20 10:30:43 +08:00
|
|
|
|
2001-04-25 02:17:17 +08:00
|
|
|
dockable = dialogs_dockable_new (view,
|
|
|
|
"Layer List", "Layers",
|
|
|
|
NULL,
|
|
|
|
dialogs_set_drawable_context_func);
|
|
|
|
|
|
|
|
dialogs_set_drawable_context_func (GIMP_DOCKABLE (dockable), context);
|
|
|
|
|
|
|
|
return dockable;
|
2001-04-20 10:30:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_channel_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
2001-04-20 10:30:43 +08:00
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
GtkWidget *view;
|
2001-04-25 02:17:17 +08:00
|
|
|
GtkWidget *dockable;
|
2001-04-20 10:30:43 +08:00
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
gimage = gimp_context_get_image (context);
|
2001-04-20 10:30:43 +08:00
|
|
|
|
|
|
|
view = gimp_drawable_list_view_new
|
2001-07-07 20:17:23 +08:00
|
|
|
(gimprc.preview_size,
|
|
|
|
gimage,
|
2001-04-20 10:30:43 +08:00
|
|
|
GIMP_TYPE_CHANNEL,
|
|
|
|
"active_channel_changed",
|
|
|
|
(GimpGetContainerFunc) gimp_image_get_channels,
|
|
|
|
(GimpGetDrawableFunc) gimp_image_get_active_channel,
|
|
|
|
(GimpSetDrawableFunc) gimp_image_set_active_channel,
|
|
|
|
(GimpReorderDrawableFunc) gimp_image_position_channel,
|
|
|
|
(GimpAddDrawableFunc) gimp_image_add_channel,
|
|
|
|
(GimpRemoveDrawableFunc) gimp_image_remove_channel,
|
2001-04-29 23:23:01 +08:00
|
|
|
(GimpCopyDrawableFunc) gimp_channel_copy,
|
|
|
|
(GimpNewDrawableFunc) channels_new_channel_query,
|
|
|
|
(GimpEditDrawableFunc) channels_edit_channel_query,
|
|
|
|
(GimpDrawableContextFunc) channels_show_context_menu);
|
2001-04-20 10:30:43 +08:00
|
|
|
|
2001-04-25 02:17:17 +08:00
|
|
|
dockable = dialogs_dockable_new (view,
|
|
|
|
"Channel List", "Channels",
|
|
|
|
NULL,
|
|
|
|
dialogs_set_drawable_context_func);
|
|
|
|
|
|
|
|
dialogs_set_drawable_context_func (GIMP_DOCKABLE (dockable), context);
|
|
|
|
|
|
|
|
return dockable;
|
2001-04-20 10:30:43 +08:00
|
|
|
}
|
|
|
|
|
2001-05-12 01:02:30 +08:00
|
|
|
GtkWidget *
|
|
|
|
dialogs_path_list_view_new (GimpDialogFactory *factory,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
static GtkWidget *view = NULL;
|
|
|
|
|
|
|
|
GtkWidget *dockable;
|
|
|
|
|
|
|
|
if (view)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
view = paths_dialog_create ();
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (view), "destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
|
|
|
|
&view);
|
|
|
|
|
|
|
|
dockable = dialogs_dockable_new (view,
|
|
|
|
"Path List", "Paths",
|
|
|
|
NULL,
|
|
|
|
dialogs_set_path_context_func);
|
|
|
|
|
|
|
|
dialogs_set_path_context_func (GIMP_DOCKABLE (dockable), context);
|
|
|
|
|
|
|
|
return dockable;
|
|
|
|
}
|
|
|
|
|
2001-04-20 10:30:43 +08:00
|
|
|
|
|
|
|
/* editor dialogs */
|
|
|
|
|
|
|
|
void
|
|
|
|
dialogs_edit_brush_func (GimpData *data)
|
|
|
|
{
|
2001-05-01 21:16:59 +08:00
|
|
|
static BrushEditor *brush_editor_dialog = NULL;
|
2001-04-20 10:30:43 +08:00
|
|
|
|
|
|
|
GimpBrush *brush;
|
|
|
|
|
|
|
|
brush = GIMP_BRUSH (data);
|
|
|
|
|
|
|
|
if (GIMP_IS_BRUSH_GENERATED (brush))
|
|
|
|
{
|
|
|
|
if (! brush_editor_dialog)
|
|
|
|
{
|
2001-05-01 21:16:59 +08:00
|
|
|
brush_editor_dialog = brush_editor_new ();
|
2001-04-20 10:30:43 +08:00
|
|
|
}
|
|
|
|
|
2001-05-01 21:16:59 +08:00
|
|
|
brush_editor_set_brush (brush_editor_dialog, brush);
|
2001-04-20 10:30:43 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_message (_("Sorry, this brush can't be edited."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
dialogs_edit_gradient_func (GimpData *data)
|
|
|
|
{
|
|
|
|
static GradientEditor *gradient_editor_dialog = NULL;
|
|
|
|
|
|
|
|
GimpGradient *gradient;
|
|
|
|
|
|
|
|
gradient = GIMP_GRADIENT (data);
|
|
|
|
|
|
|
|
if (! gradient_editor_dialog)
|
|
|
|
{
|
|
|
|
gradient_editor_dialog = gradient_editor_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
dialogs_edit_palette_func (GimpData *data)
|
|
|
|
{
|
2001-07-10 01:58:56 +08:00
|
|
|
static PaletteEditor *palette_editor_dialog = NULL;
|
|
|
|
|
|
|
|
GimpPalette *palette;
|
|
|
|
|
|
|
|
palette = GIMP_PALETTE (data);
|
|
|
|
|
|
|
|
if (! palette_editor_dialog)
|
|
|
|
{
|
|
|
|
palette_editor_dialog = palette_editor_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
palette_editor_set_palette (palette_editor_dialog, palette);
|
2001-04-20 10:30:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
/* private functions */
|
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
static void
|
|
|
|
dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
GimpRGB color;
|
|
|
|
gint index;
|
|
|
|
|
|
|
|
gimage = gimp_colormap_dialog_image (dialog);
|
|
|
|
index = gimp_colormap_dialog_col_index (dialog);
|
|
|
|
|
|
|
|
gimp_rgba_set_uchar (&color,
|
|
|
|
gimage->cmap[index * 3],
|
|
|
|
gimage->cmap[index * 3 + 1],
|
|
|
|
gimage->cmap[index * 3 + 2],
|
|
|
|
255);
|
|
|
|
|
|
|
|
if (active_color == FOREGROUND)
|
|
|
|
gimp_context_set_foreground (context, &color);
|
|
|
|
else if (active_color == BACKGROUND)
|
|
|
|
gimp_context_set_background (context, &color);
|
|
|
|
}
|
|
|
|
|
2001-04-14 23:21:45 +08:00
|
|
|
static GtkWidget *
|
|
|
|
dialogs_brush_tab_func (GimpDockable *dockable,
|
2001-04-16 00:16:13 +08:00
|
|
|
GimpDockbook *dockbook,
|
2001-04-14 23:21:45 +08:00
|
|
|
gint size)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
GtkWidget *preview;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
context = dockbook->dock->context;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
preview =
|
|
|
|
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (context)),
|
|
|
|
size, size, 1,
|
|
|
|
FALSE, FALSE, FALSE);
|
|
|
|
|
|
|
|
gtk_signal_connect_object_while_alive
|
|
|
|
(GTK_OBJECT (context),
|
|
|
|
"brush_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
|
|
|
GTK_OBJECT (preview));
|
|
|
|
|
|
|
|
return preview;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
dialogs_pattern_tab_func (GimpDockable *dockable,
|
2001-04-16 00:16:13 +08:00
|
|
|
GimpDockbook *dockbook,
|
2001-04-14 23:21:45 +08:00
|
|
|
gint size)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
GtkWidget *preview;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
context = dockbook->dock->context;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
preview =
|
|
|
|
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (context)),
|
|
|
|
size, size, 1,
|
|
|
|
FALSE, FALSE, FALSE);
|
|
|
|
|
|
|
|
gtk_signal_connect_object_while_alive
|
|
|
|
(GTK_OBJECT (context),
|
|
|
|
"pattern_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
|
|
|
GTK_OBJECT (preview));
|
|
|
|
|
|
|
|
return preview;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
dialogs_gradient_tab_func (GimpDockable *dockable,
|
2001-04-16 00:16:13 +08:00
|
|
|
GimpDockbook *dockbook,
|
2001-04-14 23:21:45 +08:00
|
|
|
gint size)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
GtkWidget *preview;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
context = dockbook->dock->context;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
preview =
|
|
|
|
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (context)),
|
|
|
|
size, size, 1,
|
|
|
|
FALSE, FALSE, FALSE);
|
|
|
|
|
|
|
|
gtk_signal_connect_object_while_alive
|
|
|
|
(GTK_OBJECT (context),
|
|
|
|
"gradient_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
|
|
|
GTK_OBJECT (preview));
|
|
|
|
|
|
|
|
return preview;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
dialogs_palette_tab_func (GimpDockable *dockable,
|
2001-04-16 00:16:13 +08:00
|
|
|
GimpDockbook *dockbook,
|
2001-04-14 23:21:45 +08:00
|
|
|
gint size)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
GtkWidget *preview;
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
context = dockbook->dock->context;
|
2001-04-14 23:21:45 +08:00
|
|
|
|
|
|
|
preview =
|
|
|
|
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_palette (context)),
|
|
|
|
size, size, 1,
|
|
|
|
FALSE, FALSE, FALSE);
|
|
|
|
|
|
|
|
gtk_signal_connect_object_while_alive
|
|
|
|
(GTK_OBJECT (context),
|
|
|
|
"palette_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
|
|
|
GTK_OBJECT (preview));
|
|
|
|
|
|
|
|
return preview;
|
|
|
|
}
|
|
|
|
|
2001-04-20 10:30:43 +08:00
|
|
|
static GtkWidget *
|
2001-04-24 00:58:18 +08:00
|
|
|
dialogs_tool_tab_func (GimpDockable *dockable,
|
|
|
|
GimpDockbook *dockbook,
|
|
|
|
gint size)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
GtkWidget *preview;
|
|
|
|
|
|
|
|
context = dockbook->dock->context;
|
|
|
|
|
|
|
|
preview =
|
|
|
|
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_tool (context)),
|
|
|
|
size, size, 1,
|
|
|
|
FALSE, FALSE, FALSE);
|
|
|
|
|
|
|
|
gtk_signal_connect_object_while_alive
|
|
|
|
(GTK_OBJECT (context),
|
|
|
|
"tool_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
|
|
|
GTK_OBJECT (preview));
|
|
|
|
|
|
|
|
return preview;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dialogs_set_view_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpContainerView *view;
|
|
|
|
|
|
|
|
view = (GimpContainerView *) gtk_object_get_data (GTK_OBJECT (dockable),
|
|
|
|
"gimp-dialogs-view");
|
|
|
|
|
|
|
|
if (view)
|
|
|
|
gimp_container_view_set_context (view, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-06-26 20:09:43 +08:00
|
|
|
dialogs_set_editor_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2001-06-26 20:09:43 +08:00
|
|
|
GimpContainerEditor *editor;
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
editor = (GimpContainerEditor *) gtk_object_get_data (GTK_OBJECT (dockable),
|
|
|
|
"gimp-dialogs-view");
|
2001-04-24 00:58:18 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
if (editor)
|
2001-06-30 03:25:03 +08:00
|
|
|
gimp_container_view_set_context (editor->view, context);
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dialogs_set_drawable_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *view;
|
|
|
|
|
|
|
|
view = (GimpDrawableListView *) gtk_object_get_data (GTK_OBJECT (dockable),
|
|
|
|
"gimp-dialogs-view");
|
|
|
|
|
|
|
|
if (view)
|
|
|
|
{
|
|
|
|
GimpContext *old_context;
|
|
|
|
|
|
|
|
old_context = (GimpContext *) gtk_object_get_data (GTK_OBJECT (view),
|
|
|
|
"gimp-dialogs-context");
|
|
|
|
|
|
|
|
if (old_context)
|
|
|
|
{
|
|
|
|
gtk_signal_disconnect_by_func (GTK_OBJECT (old_context),
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
|
|
|
|
view);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (context)
|
|
|
|
{
|
|
|
|
gtk_signal_connect (GTK_OBJECT (context), "image_changed",
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
|
|
|
|
view);
|
|
|
|
|
2001-05-07 00:14:34 +08:00
|
|
|
dialogs_drawable_view_image_changed (context,
|
|
|
|
gimp_context_get_image (context),
|
|
|
|
view);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dialogs_drawable_view_image_changed (NULL, NULL, view);
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
|
|
|
|
2001-05-07 00:14:34 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (view), "gimp-dialogs-context", context);
|
2001-04-24 00:58:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-12 01:02:30 +08:00
|
|
|
static void
|
|
|
|
dialogs_set_path_context_func (GimpDockable *dockable,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GtkWidget *view;
|
|
|
|
|
|
|
|
view = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (dockable),
|
|
|
|
"gimp-dialogs-view");
|
|
|
|
|
|
|
|
if (view)
|
|
|
|
{
|
|
|
|
GimpContext *old_context;
|
|
|
|
|
|
|
|
old_context = (GimpContext *) gtk_object_get_data (GTK_OBJECT (view),
|
|
|
|
"gimp-dialogs-context");
|
|
|
|
|
|
|
|
if (old_context)
|
|
|
|
{
|
|
|
|
gtk_signal_disconnect_by_func (GTK_OBJECT (old_context),
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_path_view_image_changed),
|
|
|
|
view);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (context)
|
|
|
|
{
|
|
|
|
gtk_signal_connect (GTK_OBJECT (context), "image_changed",
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_path_view_image_changed),
|
|
|
|
view);
|
|
|
|
|
|
|
|
dialogs_path_view_image_changed (context,
|
|
|
|
gimp_context_get_image (context),
|
|
|
|
view);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dialogs_path_view_image_changed (NULL, NULL, view);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_object_set_data (GTK_OBJECT (view), "gimp-dialogs-context", context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
static GtkWidget *
|
|
|
|
dialogs_dockable_new (GtkWidget *widget,
|
|
|
|
const gchar *name,
|
|
|
|
const gchar *short_name,
|
|
|
|
GimpDockableGetTabFunc get_tab_func,
|
|
|
|
GimpDockableSetContextFunc set_context_func)
|
2001-04-14 23:21:45 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dockable;
|
|
|
|
|
|
|
|
dockable = gimp_dockable_new (name,
|
|
|
|
short_name,
|
2001-04-24 00:58:18 +08:00
|
|
|
get_tab_func,
|
|
|
|
set_context_func);
|
2001-04-14 23:21:45 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (dockable), widget);
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
|
2001-04-24 00:58:18 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (dockable), "gimp-dialogs-view", widget);
|
|
|
|
|
2001-04-17 02:49:29 +08:00
|
|
|
return dockable;
|
2001-04-14 23:21:45 +08:00
|
|
|
}
|
2001-04-20 10:30:43 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
dialogs_drawable_view_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GimpDrawableListView *view)
|
|
|
|
{
|
|
|
|
gimp_drawable_list_view_set_image (view, gimage);
|
|
|
|
}
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2001-05-12 01:02:30 +08:00
|
|
|
static void
|
|
|
|
dialogs_path_view_image_changed (GimpContext *context,
|
|
|
|
GimpImage *gimage,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
|
|
|
paths_dialog_update (gimage);
|
|
|
|
}
|