Commit 4aab2ac3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

set the message handler for all app log domains, not only for "Gimp".

2001-04-20  Michael Natterer  <mitch@gimp.org>

	* app/main.c: set the message handler for all app log domains, not
	only for "Gimp".

	* app/gui/brush-select.c
	* app/gui/gradient-select.c
	* app/gui/palette-select.c: removed the "edit" callbacks.

	* app/gui/dialogs-constructors.[ch]: Added the callbacks
	here. Added layer and channel lists.

	* app/gui/dialogs.c: register the new lists.
	* app/gui/menus.c: their menu entries.

	* app/widgets/gimpdock.c: set a minimal width of 280 pixels.
parent 2301e7e1
2001-04-20 Michael Natterer <mitch@gimp.org>
* app/main.c: set the message handler for all app log domains, not
only for "Gimp".
* app/gui/brush-select.c
* app/gui/gradient-select.c
* app/gui/palette-select.c: removed the "edit" callbacks.
* app/gui/dialogs-constructors.[ch]: Added the callbacks
here. Added layer and channel lists.
* app/gui/dialogs.c: register the new lists.
* app/gui/menus.c: their menu entries.
* app/widgets/gimpdock.c: set a minimal width of 280 pixels.
2001-04-19 Michael Natterer <mitch@gimp.org>
* app/tools/Makefile.am
......
......@@ -35,9 +35,11 @@
#include "widgets/gimpdock.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdrawablelistview.h"
#include "widgets/gimppreview.h"
#include "about-dialog.h"
#include "brush-editor.h"
#include "brush-select.h"
#include "color-area.h"
#include "colormap-dialog.h"
......@@ -57,10 +59,15 @@
#include "context_manager.h"
#include "gdisplay.h"
#include "gimpbrush.h"
#include "gimpbrushgenerated.h"
#include "gimpchannel.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpdatafactory.h"
#include "gimpgradient.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "module_db.h"
#include "undo_history.h"
......@@ -93,6 +100,10 @@ static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
const gchar *short_name,
GimpDockableGetTabFunc get_tab_func);
static void dialogs_drawable_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpDrawableListView *view);
/* public functions */
......@@ -266,7 +277,7 @@ dialogs_brush_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_brush_factory,
NULL,
dialogs_edit_brush_func,
factory->context,
32,
5, 3);
......@@ -300,7 +311,7 @@ dialogs_gradient_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_gradient_factory,
NULL,
dialogs_edit_gradient_func,
factory->context,
32,
5, 3);
......@@ -317,7 +328,7 @@ dialogs_palette_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_palette_factory,
NULL,
dialogs_edit_palette_func,
factory->context,
32,
5, 3);
......@@ -367,7 +378,7 @@ dialogs_brush_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_brush_factory,
NULL,
dialogs_edit_brush_func,
factory->context,
32,
5, 3);
......@@ -401,7 +412,7 @@ dialogs_gradient_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_gradient_factory,
NULL,
dialogs_edit_gradient_func,
factory->context,
32,
5, 3);
......@@ -418,7 +429,7 @@ dialogs_palette_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_palette_factory,
NULL,
dialogs_edit_palette_func,
factory->context,
32,
5, 3);
......@@ -444,6 +455,121 @@ dialogs_tool_grid_view_new (GimpDialogFactory *factory)
}
/* image related dialogs */
GtkWidget *
dialogs_layer_list_view_new (GimpDialogFactory *factory)
{
GimpImage *gimage;
GtkWidget *view;
gimage = gimp_context_get_image (factory->context);
view = gimp_drawable_list_view_new
(gimage,
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,
(GimpCopyDrawableFunc) gimp_layer_copy);
gtk_signal_connect_while_alive
(GTK_OBJECT (factory->context), "image_changed",
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
view,
GTK_OBJECT (view));
return dialogs_dockable_new (view,
"Layer List", "Layers",
NULL);
}
GtkWidget *
dialogs_channel_list_view_new (GimpDialogFactory *factory)
{
GimpImage *gimage;
GtkWidget *view;
gimage = gimp_context_get_image (factory->context);
view = gimp_drawable_list_view_new
(gimage,
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,
(GimpCopyDrawableFunc) gimp_channel_copy);
gtk_signal_connect_while_alive
(GTK_OBJECT (factory->context), "image_changed",
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
view,
GTK_OBJECT (view));
return dialogs_dockable_new (view,
"Channel List", "Channels",
NULL);
}
/* editor dialogs */
void
dialogs_edit_brush_func (GimpData *data)
{
static BrushEditGeneratedWindow *brush_editor_dialog = NULL;
GimpBrush *brush;
brush = GIMP_BRUSH (data);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_edit_generated_new ();
}
brush_edit_generated_set_brush (brush_editor_dialog, brush);
}
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)
{
palette_dialog_edit_palette (data);
}
/* private functions */
static void
......@@ -565,7 +691,7 @@ dialogs_palette_tab_func (GimpDockable *dockable,
return preview;
}
GtkWidget *
static GtkWidget *
dialogs_dockable_new (GtkWidget *widget,
const gchar *name,
const gchar *short_name,
......@@ -582,3 +708,12 @@ dialogs_dockable_new (GtkWidget *widget,
return dockable;
}
static void
dialogs_drawable_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpDrawableListView *view)
{
gimp_drawable_list_view_set_image (view, gimage);
}
......@@ -53,5 +53,12 @@ GtkWidget * dialogs_gradient_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_palette_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_tool_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory);
void dialogs_edit_brush_func (GimpData *data);
void dialogs_edit_gradient_func (GimpData *data);
void dialogs_edit_palette_func (GimpData *data);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */
......@@ -73,7 +73,11 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE }
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE },
/* these will go to image_dock_entries */
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE }
};
static const gint n_dock_entries = (sizeof (dock_entries) /
sizeof (dock_entries[0]));
......
......@@ -32,8 +32,8 @@
#include "widgets/gimpdatafactoryview.h"
#include "brush-editor.h"
#include "brush-select.h"
#include "dialogs-constructors.h"
#include "appenv.h"
#include "context_manager.h"
......@@ -81,7 +81,6 @@ static void spacing_scale_update (GtkAdjustment *adj,
static void brush_select_close_callback (GtkWidget *widget,
gpointer data);
static void brush_select_edit_brush (GimpData *data);
/* list of active dialogs */
......@@ -91,10 +90,6 @@ GSList *brush_active_dialogs = NULL;
BrushSelect *brush_select_dialog = NULL;
/* the main brush editor dialog */
static BrushEditGeneratedWindow *brush_edit_generated_dialog = NULL;
/* public functions */
GtkWidget *
......@@ -219,7 +214,7 @@ brush_select_new (gchar *title,
/* The Brush Grid */
bsp->view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_brush_factory,
brush_select_edit_brush,
dialogs_edit_brush_func,
bsp->context,
MIN_CELL_SIZE,
STD_BRUSH_COLUMNS,
......@@ -602,25 +597,3 @@ brush_select_close_callback (GtkWidget *widget,
brush_select_free (bsp);
}
}
static void
brush_select_edit_brush (GimpData *data)
{
GimpBrush *brush;
brush = GIMP_BRUSH (data);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
if (! brush_edit_generated_dialog)
{
brush_edit_generated_dialog = brush_edit_generated_new ();
}
brush_edit_generated_set_brush (brush_edit_generated_dialog, brush);
}
else
{
g_message (_("Sorry, this brush can't be edited."));
}
}
......@@ -35,9 +35,11 @@
#include "widgets/gimpdock.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdrawablelistview.h"
#include "widgets/gimppreview.h"
#include "about-dialog.h"
#include "brush-editor.h"
#include "brush-select.h"
#include "color-area.h"
#include "colormap-dialog.h"
......@@ -57,10 +59,15 @@
#include "context_manager.h"
#include "gdisplay.h"
#include "gimpbrush.h"
#include "gimpbrushgenerated.h"
#include "gimpchannel.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpdatafactory.h"
#include "gimpgradient.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "module_db.h"
#include "undo_history.h"
......@@ -93,6 +100,10 @@ static GtkWidget * dialogs_dockable_new (GtkWidget *widget,
const gchar *short_name,
GimpDockableGetTabFunc get_tab_func);
static void dialogs_drawable_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpDrawableListView *view);
/* public functions */
......@@ -266,7 +277,7 @@ dialogs_brush_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_brush_factory,
NULL,
dialogs_edit_brush_func,
factory->context,
32,
5, 3);
......@@ -300,7 +311,7 @@ dialogs_gradient_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_gradient_factory,
NULL,
dialogs_edit_gradient_func,
factory->context,
32,
5, 3);
......@@ -317,7 +328,7 @@ dialogs_palette_list_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_palette_factory,
NULL,
dialogs_edit_palette_func,
factory->context,
32,
5, 3);
......@@ -367,7 +378,7 @@ dialogs_brush_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_brush_factory,
NULL,
dialogs_edit_brush_func,
factory->context,
32,
5, 3);
......@@ -401,7 +412,7 @@ dialogs_gradient_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_gradient_factory,
NULL,
dialogs_edit_gradient_func,
factory->context,
32,
5, 3);
......@@ -418,7 +429,7 @@ dialogs_palette_grid_view_new (GimpDialogFactory *factory)
view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
global_palette_factory,
NULL,
dialogs_edit_palette_func,
factory->context,
32,
5, 3);
......@@ -444,6 +455,121 @@ dialogs_tool_grid_view_new (GimpDialogFactory *factory)
}
/* image related dialogs */
GtkWidget *
dialogs_layer_list_view_new (GimpDialogFactory *factory)
{
GimpImage *gimage;
GtkWidget *view;
gimage = gimp_context_get_image (factory->context);
view = gimp_drawable_list_view_new
(gimage,
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,
(GimpCopyDrawableFunc) gimp_layer_copy);
gtk_signal_connect_while_alive
(GTK_OBJECT (factory->context), "image_changed",
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
view,
GTK_OBJECT (view));
return dialogs_dockable_new (view,
"Layer List", "Layers",
NULL);
}
GtkWidget *
dialogs_channel_list_view_new (GimpDialogFactory *factory)
{
GimpImage *gimage;
GtkWidget *view;
gimage = gimp_context_get_image (factory->context);
view = gimp_drawable_list_view_new
(gimage,
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,
(GimpCopyDrawableFunc) gimp_channel_copy);
gtk_signal_connect_while_alive
(GTK_OBJECT (factory->context), "image_changed",
GTK_SIGNAL_FUNC (dialogs_drawable_view_image_changed),
view,
GTK_OBJECT (view));
return dialogs_dockable_new (view,
"Channel List", "Channels",
NULL);
}
/* editor dialogs */
void
dialogs_edit_brush_func (GimpData *data)
{
static BrushEditGeneratedWindow *brush_editor_dialog = NULL;
GimpBrush *brush;
brush = GIMP_BRUSH (data);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_edit_generated_new ();
}
brush_edit_generated_set_brush (brush_editor_dialog, brush);
}
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)
{
palette_dialog_edit_palette (data);
}
/* private functions */
static void
......@@ -565,7 +691,7 @@ dialogs_palette_tab_func (GimpDockable *dockable,
return preview;
}
GtkWidget *
static GtkWidget *
dialogs_dockable_new (GtkWidget *widget,
const gchar *name,
const gchar *short_name,
......@@ -582,3 +708,12 @@ dialogs_dockable_new (GtkWidget *widget,
return dockable;
}
static void
dialogs_drawable_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpDrawableListView *view)
{
gimp_drawable_list_view_set_image (view, gimage);
}
......@@ -53,5 +53,12 @@ GtkWidget * dialogs_gradient_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_palette_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_tool_grid_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory);
GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory);
void dialogs_edit_brush_func (GimpData *data);
void dialogs_edit_gradient_func (GimpData *data);
void dialogs_edit_palette_func (GimpData *data);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */
......@@ -73,7 +73,11 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE }
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE },
/* these will go to image_dock_entries */
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE }
};
static const gint n_dock_entries = (sizeof (dock_entries) /
sizeof (dock_entries[0]));
......
......@@ -32,7 +32,7 @@
#include "widgets/gimpdatafactoryview.h"
#include "dialog_handler.h"
#include "gradient-editor.h"
#include "dialogs-constructors.h"
#include "gradient-select.h"
#include "appenv.h"
......@@ -52,7 +52,6 @@ static void gradient_select_gradient_changed (GimpContext *context,
GradientSelect *gsp);
static void gradient_select_close_callback (GtkWidget *widget,
gpointer data);
static void gradient_select_edit_gradient (GimpData *data);
/* list of active dialogs */
......@@ -62,10 +61,6 @@ GSList *gradient_active_dialogs = NULL;
GradientSelect *gradient_select_dialog = NULL;
/* the main gradient editor dialog */
static GradientEditor *gradient_editor_dialog = NULL;
/* public functions */
GtkWidget *
......@@ -160,7 +155,7 @@ gradient_select_new (gchar *title,
/* The Gradient List */
gsp->view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
global_gradient_factory,