Commit b280b493 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

don't use the global "the_gimp" variable.

2001-07-15  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp.c: don't use the global "the_gimp" variable.

	* app/core/gimpimage-convert.c: don't update the display here.

	* app/gui/gui.c: connect to the images' "mode_changed" signal
	and update here.

	* app/gui/brush-editor.[ch]
	* app/gui/gradient-editor.[ch]
	* app/gui/palette-editor.[ch]: pass a "Gimp" pointer to all
	editors. Added an palette_name entry to the palette editor.

	* app/gui/colormap-dialog.[ch]: removed all the dialog stuff and
	made the constructor return a vbox so it can be integrated in a
	dockable. Lots of cleanup and removal of anqiuqe aretfacts.

	* app/gui/dialogs-constructors.[ch]: wrap the colormap dialog in
	a dockable.

	* app/gui/dialogs-commands.[ch]
	* app/gui/dialogs.c
	* app/gui/menus.c: integrate the new dockable, made the "Brushes.."
	etc. menu entries create dockbles. Moved the old dialogs and the
	test menu entries to "Old + Testing" and removed N_() so the .po
	files stay cruft-free.

	* app/gui/test-commands.[ch]: removed lots of stuff which is not
	"testing" any more.
parent de1202c7
2001-07-15 Michael Natterer <mitch@gimp.org>
* app/core/gimp.c: don't use the global "the_gimp" variable.
* app/core/gimpimage-convert.c: don't update the display here.
* app/gui/gui.c: connect to the images' "mode_changed" signal
and update here.
* app/gui/brush-editor.[ch]
* app/gui/gradient-editor.[ch]
* app/gui/palette-editor.[ch]: pass a "Gimp" pointer to all
editors. Added an palette_name entry to the palette editor.
* app/gui/colormap-dialog.[ch]: removed all the dialog stuff and
made the constructor return a vbox so it can be integrated in a
dockable. Lots of cleanup and removal of anqiuqe aretfacts.
* app/gui/dialogs-constructors.[ch]: wrap the colormap dialog in
a dockable.
* app/gui/dialogs-commands.[ch]
* app/gui/dialogs.c
* app/gui/menus.c: integrate the new dockable, made the "Brushes.."
etc. menu entries create dockbles. Moved the old dialogs and the
test menu entries to "Old + Testing" and removed N_() so the .po
files stay cruft-free.
* app/gui/test-commands.[ch]: removed lots of stuff which is not
"testing" any more.
2001-07-14 Sven Neumann <sven@gimp.org>
* app/pdb/display_cmds.c
......
......@@ -48,6 +48,22 @@ dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
}
}
void
dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
gchar *identifier;
identifier = g_quark_to_string ((GQuark) action);
if (identifier)
gimp_dialog_factory_dialog_raise (global_dock_factory, identifier);
}
}
void
dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -23,6 +23,9 @@
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -412,7 +412,7 @@ gimp_set_busy (Gimp *gimp)
gimp->busy = TRUE;
if (gimp->gui_set_busy_func)
gimp->gui_set_busy_func (the_gimp);
gimp->gui_set_busy_func (gimp);
}
static gboolean
......@@ -452,7 +452,7 @@ gimp_unset_busy (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (gimp->gui_unset_busy_func)
gimp->gui_unset_busy_func (the_gimp);
gimp->gui_unset_busy_func (gimp);
/* FIXME: gimp_busy HACK */
gimp->busy = FALSE;
......
......@@ -117,7 +117,6 @@
#include "gimppalette.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "undo.h"
......@@ -757,10 +756,10 @@ gimp_image_convert (GimpImage *gimage,
}
if (
(old_type == RGB) &&
(!needs_quantize) &&
(palette_type == MAKE_PALETTE)
)
(old_type == RGB) &&
(!needs_quantize) &&
(palette_type == MAKE_PALETTE)
)
{
/* If this is an RGB image, and the user wanted a custom-built
......@@ -936,14 +935,6 @@ gimp_image_convert (GimpImage *gimage,
undo_push_group_end (gimage);
/* shrink wrap and update all views */
gimp_image_invalidate_layer_previews (gimage);
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage));
gdisplays_update_title (gimage);
gdisplays_update_full (gimage);
gimp_image_colormap_changed (gimage, -1);
gimp_image_mode_changed (gimage);
gimp_unset_busy (gimage->gimp);
......
......@@ -91,7 +91,7 @@
static void dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
GimpContext *context);
GimpDockable *dockable);
static GtkWidget * dialogs_brush_tab_func (GimpDockable *dockable,
GimpDockbook *dockbook,
......@@ -117,6 +117,8 @@ static void dialogs_set_drawable_context_func (GimpDockable *dockable,
GimpContext *context);
static void dialogs_set_path_context_func (GimpDockable *dockable,
GimpContext *context);
static void dialogs_set_indexed_palette_context_func (GimpDockable *dockable,
GimpContext *context);
static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
const gchar *name,
......@@ -130,6 +132,9 @@ static void dialogs_drawable_view_image_changed (GimpContext *context,
static void dialogs_path_view_image_changed (GimpContext *context,
GimpImage *gimage,
GtkWidget *view);
static void dialogs_indexed_palette_image_changed (GimpContext *context,
GimpImage *gimage,
GimpColormapDialog *ipal);
/* public functions */
......@@ -218,21 +223,6 @@ dialogs_module_browser_get (GimpDialogFactory *factory,
return module_db_browser_new ();
}
GtkWidget *
dialogs_indexed_palette_get (GimpDialogFactory *factory,
GimpContext *context)
{
GimpColormapDialog *cmap_dlg;
cmap_dlg = gimp_colormap_dialog_create (context->gimp->images);
gtk_signal_connect (GTK_OBJECT (cmap_dlg), "selected",
GTK_SIGNAL_FUNC (dialogs_indexed_palette_selected),
factory->context);
return GTK_WIDGET (cmap_dlg);
}
GtkWidget *
dialogs_undo_history_get (GimpDialogFactory *factory,
GimpContext *context)
......@@ -288,6 +278,29 @@ dialogs_about_get (GimpDialogFactory *factory,
return about_dialog_create ();
}
GtkWidget *
dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
GtkWidget *
dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
GtkWidget *
dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
/* docks */
GtkWidget *
dialogs_dock_new (GimpDialogFactory *factory,
......@@ -672,6 +685,32 @@ dialogs_path_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_indexed_palette_new (GimpDialogFactory *factory,
GimpContext *context)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
view = gimp_colormap_dialog_new (gimage);
dockable = dialogs_dockable_new (view,
"Indexed Palette", "Colormap",
NULL,
dialogs_set_indexed_palette_context_func);
dialogs_set_indexed_palette_context_func (GIMP_DOCKABLE (dockable), context);
gtk_signal_connect (GTK_OBJECT (view), "selected",
GTK_SIGNAL_FUNC (dialogs_indexed_palette_selected),
dockable);
return dockable;
}
/* editor dialogs */
......@@ -688,7 +727,7 @@ dialogs_edit_brush_func (GimpData *data)
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new ();
brush_editor_dialog = brush_editor_new (the_gimp);
}
brush_editor_set_brush (brush_editor_dialog, brush);
......@@ -710,7 +749,7 @@ dialogs_edit_gradient_func (GimpData *data)
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new ();
gradient_editor_dialog = gradient_editor_new (the_gimp);
}
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
......@@ -727,7 +766,7 @@ dialogs_edit_palette_func (GimpData *data)
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new ();
palette_editor_dialog = palette_editor_new (the_gimp);
}
palette_editor_set_palette (palette_editor_dialog, palette);
......@@ -738,25 +777,33 @@ dialogs_edit_palette_func (GimpData *data)
static void
dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
GimpContext *context)
GimpDockable *dockable)
{
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);
GimpContext *context;
context = (GimpContext *) gtk_object_get_data (GTK_OBJECT (dialog),
"gimp-dialogs-context");
if (context)
{
GimpImage *gimage;
GimpRGB color;
gint index;
gimage = gimp_colormap_dialog_get_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);
}
}
static GtkWidget *
......@@ -989,6 +1036,48 @@ dialogs_set_path_context_func (GimpDockable *dockable,
}
}
static void
dialogs_set_indexed_palette_context_func (GimpDockable *dockable,
GimpContext *context)
{
GimpColormapDialog *view;
view = (GimpColormapDialog *) 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_indexed_palette_image_changed),
view);
}
if (context)
{
gtk_signal_connect (GTK_OBJECT (context), "image_changed",
GTK_SIGNAL_FUNC (dialogs_indexed_palette_image_changed),
view);
dialogs_indexed_palette_image_changed (context,
gimp_context_get_image (context),
view);
}
else
{
dialogs_indexed_palette_image_changed (NULL, NULL, view);
}
gtk_object_set_data (GTK_OBJECT (view), "gimp-dialogs-context", context);
}
}
static GtkWidget *
dialogs_dockable_new (GtkWidget *widget,
const gchar *name,
......@@ -1025,3 +1114,11 @@ dialogs_path_view_image_changed (GimpContext *context,
{
paths_dialog_update (gimage);
}
static void
dialogs_indexed_palette_image_changed (GimpContext *context,
GimpImage *gimage,
GimpColormapDialog *ipal)
{
gimp_colormap_dialog_set_image (ipal, gimage);
}
......@@ -46,8 +46,6 @@ GtkWidget * dialogs_input_devices_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_module_browser_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_indexed_palette_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_undo_history_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_display_filters_get (GimpDialogFactory *factory,
......@@ -57,6 +55,13 @@ GtkWidget * dialogs_tips_get (GimpDialogFactory *factory,
GtkWidget * dialogs_about_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_dock_new (GimpDialogFactory *factory,
GimpContext *context);
......@@ -96,6 +101,8 @@ GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_path_list_view_new (GimpDialogFactory *factory,
GimpContext *context);
GtkWidget * dialogs_indexed_palette_new (GimpDialogFactory *factory,
GimpContext *context);
void dialogs_edit_brush_func (GimpData *data);
void dialogs_edit_gradient_func (GimpData *data);
......
......@@ -50,36 +50,40 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
{ "gimp:preferences-dialog", dialogs_preferences_get, TRUE, FALSE, FALSE },
{ "gimp:input-devices-dialog", dialogs_input_devices_get, TRUE, FALSE, FALSE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, TRUE, FALSE, FALSE },
{ "gimp:indexed-palette-dialog", dialogs_indexed_palette_get, TRUE, FALSE, FALSE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, FALSE, FALSE, FALSE },
{ "gimp:display-filters-dialog", dialogs_display_filters_get, FALSE, FALSE, FALSE },
{ "gimp:tips-dialog", dialogs_tips_get, TRUE, FALSE, FALSE },
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE }
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE },
{ "gimp:brush-editor", dialogs_brush_editor_get, TRUE, TRUE, TRUE },
{ "gimp:gradient-editor", dialogs_gradient_editor_get, TRUE, TRUE, TRUE },
{ "gimp:palette-editor", dialogs_palette_editor_get, TRUE, TRUE, TRUE }
};
static const gint n_toplevel_entries = (sizeof (toplevel_entries) /
sizeof (toplevel_entries[0]));
static const GimpDialogFactoryEntry dock_entries[] =
{
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE }
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE },
{ "gimp:indexed-palette", dialogs_indexed_palette_new, FALSE, FALSE, FALSE }
};
static const gint n_dock_entries = (sizeof (dock_entries) /
sizeof (dock_entries[0]));
......
......@@ -82,7 +82,7 @@ static void brush_editor_brush_name_changed (GtkWidget *widget,
/* public functions */
BrushEditor *
brush_editor_new (void)
brush_editor_new (Gimp *gimp)
{
BrushEditor *brush_editor;
GtkWidget *vbox;
......
......@@ -26,7 +26,7 @@
typedef struct _BrushEditor BrushEditor;
BrushEditor * brush_editor_new (void);
BrushEditor * brush_editor_new (Gimp *gimp);
void brush_editor_set_brush (BrushEditor *brush_editor,
GimpBrush *brush);
......
This diff is collapsed.
......@@ -35,45 +35,43 @@ typedef struct _GimpColormapDialogClass GimpColormapDialogClass;
struct _GimpColormapDialog
{
GtkDialog parent;
GimpImage *image;
gint col_index;
gint dnd_col_index;
GtkWidget *vbox;
GtkPreview *palette;
GtkWidget *image_menu;
GtkWidget *popup_menu;
GtkOptionMenu *option_menu;
GimpContainer *context;
guint event_handler;
gint xn;
gint yn;
gint cellsize;
GtkWidget *index_spinbutton;
GtkAdjustment *index_adjustment;
GtkEntry *color_entry;
GQuark rename_handler_id;
GQuark cmap_changed_handler_id;
GtkWidget *add_item;
ColorNotebook *color_notebook;
GtkVBox parent;
GimpImage *image;
gint col_index;
gint dnd_col_index;
GtkWidget *palette;
GtkWidget *image_menu;
GtkWidget *popup_menu;
GtkOptionMenu *option_menu;
gint xn;
gint yn;
gint cellsize;
GtkAdjustment *index_adjustment;
GtkWidget *index_spinbutton;
GtkWidget *color_entry;
GtkWidget *add_item;
ColorNotebook *color_notebook;
};
struct _GimpColormapDialogClass
{
GtkDialogClass parent_class;
GtkVBoxClass parent_class;
void (* selected) (GimpColormapDialog *gcd);
};
GtkType gimp_colormap_dialog_get_type (void);
GimpColormapDialog * gimp_colormap_dialog_create (GimpContainer *context);
GtkType gimp_colormap_dialog_get_type (void);
void gimp_colormap_dialog_selected (GimpColormapDialog *colormap_dialog);
GtkWidget * gimp_colormap_dialog_new (GimpImage *gimage);
GimpImage * gimp_colormap_dialog_image (const GimpColormapDialog *colormap_dialog);
gint gimp_colormap_dialog_col_index (const GimpColormapDialog *colormap_dialog);
void gimp_colormap_dialog_selected (GimpColormapDialog *gcd);
void gimp_colormap_dialog_set_image (GimpColormapDialog *gcd,
GimpImage *gimage);
GimpImage * gimp_colormap_dialog_get_image (GimpColormapDialog *gcd);
gint gimp_colormap_dialog_col_index (GimpColormapDialog *gcd);
#endif /* __COLORMAP_DIALOG_H__ */
......@@ -48,6 +48,22 @@ dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
}
}
void
dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
gchar *identifier;
identifier = g_quark_to_string ((GQuark) action);
if (identifier)
gimp_dialog_factory_dialog_raise (global_dock_factory, identifier);
}
}
void
dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -23,6 +23,9 @@
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
......
......@@ -91,7 +91,7 @@
static void dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
GimpContext *context);
GimpDockable *dockable);
static GtkWidget * dialogs_brush_tab_func (GimpDockable *dockable,
GimpDockbook *dockbook,
......@@ -117,6 +117,8 @@ static void dialogs_set_drawable_context_func (GimpDockable *dockable,
GimpContext *context);
static void dialogs_set_path_context_func (GimpDockable *dockable,
GimpContext *context);
static void dialogs_set_indexed_palette_context_func (GimpDockable *dockable,
GimpContext *context);
static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
const gchar *name,
......@@ -130,6 +132,9 @@ static void dialogs_drawable_view_image_changed (GimpContext *context,
static void dialogs_path_view_image_changed (GimpContext *context,
GimpImage *gimage,
GtkWidget *view);
static void dialogs_indexed_palette_image_changed (GimpContext *context,
GimpImage *gimage,
GimpColormapDialog *ipal);
/* public functions */
......@@ -218,21 +223,6 @@ dialogs_module_browser_get (GimpDialogFactory *factory,
return module_db_browser_new ();
}
GtkWidget *
dialogs_indexed_palette_get (GimpDialogFactory *factory,
GimpContext *context)
{
GimpColormapDialog *cmap_dlg;
cmap_dlg = gimp_colormap_dialog_create (context->gimp->images);
gtk_signal_connect (GTK_OBJECT (cmap_dlg), "selected",
GTK_SIGNAL_FUNC (dialogs_indexed_palette_selected),
factory->context);
return GTK_WIDGET (cmap_dlg);
}
GtkWidget *
dialogs_undo_history_get (GimpDialogFactory *factory,
GimpContext *context)
......@@ -288,6 +278,29 @@ dialogs_about_get (GimpDialogFactory *factory,
return about_dialog_create ();
}
GtkWidget *
dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
GtkWidget *
dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
GtkWidget *
dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
}
/* docks */
GtkWidget *
dialogs_dock_new (GimpDialogFactory *factory,
......@@ -672,6 +685,32 @@ dialogs_path_list_view_new (GimpDialogFactory *factory,
return dockable;
}
GtkWidget *
dialogs_indexed_palette_new (GimpDialogFactory *factory,
GimpContext *context)
{
GimpImage *gimage;
GtkWidget *view;
GtkWidget *dockable;
gimage = gimp_context_get_image (context);
view = gimp_colormap_dialog_new (gimage);
dockable = dialogs_dockable_new (view,
"Indexed Palette", "Colormap",
NULL,
dialogs_set_indexed_palette_context_func);
dialogs_set_indexed_palette_context_func (GIMP_DOCKABLE (dockable), context);
gtk_signal_connect (GTK_OBJECT (view), "selected",
GTK_SIGNAL_FUNC (dialogs_indexed_palette_selected),
dockable);
return dockable;
}
/* editor dialogs */
......@@ -688,7 +727,7 @@ dialogs_edit_brush_func (GimpData *data)
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new ();
brush_editor_dialog = brush_editor_new (the_gimp);
}
brush_editor_set_brush (brush_editor_dialog, brush);
......@@ -710,7 +749,7 @@ dialogs_edit_gradient_func (GimpData *data)
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new ();
gradient_editor_dialog = gradient_editor_new (the_gimp);
}
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
......@@ -727,7 +766,7 @@ dialogs_edit_palette_func (GimpData *data)
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new ();
palette_editor_dialog = palette_editor_new (the_gimp);
}
palette_editor_set_palette (palette_editor_dialog, palette);
......@@ -738,25 +777,33 @@ dialogs_edit_palette_func (GimpData *data)