Commit 8e3259d0 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/apptypes.h app/Makefile.am new widget. The upcoming replacement for

2001-02-27  Michael Natterer  <mitch@gimp.org>

	* app/apptypes.h
	* app/Makefile.am
	* app/gimpdrawablelistview.[ch]: new widget. The upcoming replacement
	for the layers and channels dialogs.

	* app/test_commands.[ch]: put the test dialogs here...

	* app/commands.[ch]: ... and made this one clean again.

	* app/gimpcontainergridview.c
	* app/gimpcontainerlistview.c
	* app/gimpcontainerview.[ch]: some signal handling fine tuning.

	* app/gimpimage.[ch]: emits "active_layer_changed" and
	"active_channel_changed" signals now. The semantics of
	gimage->active_layer and gimage->active_channel have changed a bit.
	We now have either an active layer _or_ and active channel (there
	is no active layer any more if a channel is active).

	* app/channel_ops.c
	* app/floating_sel.c
	* app/gdisplay.c
	* app/layers_dialog.c
	* app/menus.c: changed accordingly.

	* app/tools/gimpcolorpickertool.c: actually assign the draw_class
	vraiable in the class_init function.

	* app/tools/gimpdrawtool.[ch]
	* app/tools/tool.c: removed the _new() functions because these
	objects are abstract superclasses. Did some cleanup.
	Nathan, please configure you editor to _not_ produce any tabs
	in the source code.

	* app/tools/gimppaintbrushtool.[ch]: "blurb" and "help" are tagged
	with _(), not N_(). Put the register function to the header.

	* po/POTFILES.in: made it compile again.
parent 80a8d5a7
2001-02-27 Michael Natterer <mitch@gimp.org>
* app/apptypes.h
* app/Makefile.am
* app/gimpdrawablelistview.[ch]: new widget. The upcoming replacement
for the layers and channels dialogs.
* app/test_commands.[ch]: put the test dialogs here...
* app/commands.[ch]: ... and made this one clean again.
* app/gimpcontainergridview.c
* app/gimpcontainerlistview.c
* app/gimpcontainerview.[ch]: some signal handling fine tuning.
* app/gimpimage.[ch]: emits "active_layer_changed" and
"active_channel_changed" signals now. The semantics of
gimage->active_layer and gimage->active_channel have changed a bit.
We now have either an active layer _or_ and active channel (there
is no active layer any more if a channel is active).
* app/channel_ops.c
* app/floating_sel.c
* app/gdisplay.c
* app/layers_dialog.c
* app/menus.c: changed accordingly.
* app/tools/gimpcolorpickertool.c: actually assign the draw_class
vraiable in the class_init function.
* app/tools/gimpdrawtool.[ch]
* app/tools/tool.c: removed the _new() functions because these
objects are abstract superclasses. Did some cleanup.
Nathan, please configure you editor to _not_ produce any tabs
in the source code.
* app/tools/gimppaintbrushtool.[ch]: "blurb" and "help" are tagged
with _(), not N_(). Put the register function to the header.
* po/POTFILES.in: made it compile again.
2001-02-26 Nathan Summers <rock@gimp.org>
app/tools/gimpdrawtool.c
* app/tools/gimpdrawtool.c
* app/tools/gimpdrawtool.h
* app/tools/gimppainttool.c
* app/tools/gimppainttool.h
......@@ -79,8 +121,8 @@ app/tools/gimpdrawtool.c
* plug-ins/libgck/gck/Makefile.am: made linking against stable
GIMP installed in the same prefix work again by renaming all our
libraries explicitly to libgimp<foo>-1.3.* (not as part of the
libtool revision but as part of the library name). Removed the
libtool revision to avoid double versioning. This has to be
libtool release but as part of the library name). Removed the
libtool release to avoid double versioning. This has to be
hardcoded in the libraries' Makefile.am ...
* app/Makefile.am
......@@ -115,7 +157,7 @@ app/tools/gimpdrawtool.c
* plug-ins/sgi/Makefile.am
* plug-ins/webbrowser/Makefile.am
* plug-ins/xjt/Makefile.am: ... while all other Makefiles can simply
link against "libgimp<foo>-$(LT_REVISION).la"
link against "libgimp<foo>-$(LT_RELEASE).la"
2001-02-24 Michael Natterer <mitch@gimp.org>
......
......@@ -245,6 +245,8 @@ gimp_SOURCES = \
selection.h \
session.h \
session.c \
test_commands.c \
test_commands.h \
tips_dialog.c \
tips_dialog.h \
toolbox.c \
......@@ -291,6 +293,8 @@ gimp_SOURCES = \
gimpcontainerview.c \
gimpdatafactoryview.h \
gimpdatafactoryview.c \
gimpdrawablelistview.c \
gimpdrawablelistview.h \
gimpdrawablepreview.c \
gimpdrawablepreview.h \
gimpgradientpreview.h \
......
......@@ -52,6 +52,7 @@
#include "floating_sel.h"
#include "gdisplay_ops.h"
#include "gimage_mask.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimphelp.h"
......@@ -82,17 +83,6 @@
#include "undo.h"
#include "undo_history.h"
/* for the example dialogs */
#include "gradient_editor.h"
#include "gimpcontainer.h"
#include "gimpcontainerlistview.h"
#include "gimpcontainergridview.h"
#include "gimpdatafactory.h"
#include "gimpdatafactoryview.h"
#include "gimppreview.h"
#ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h"
#endif /* DISPLAY_FILTERS */
......@@ -1381,575 +1371,6 @@ dialogs_module_browser_cmd_callback (GtkWidget *widget,
gtk_widget_show (module_browser);
}
/***** Container View Test Dialogs *****/
static void
container_view_scale_callback (GtkAdjustment *adj,
GimpContainerView *view)
{
gimp_container_view_set_preview_size (view, ROUND (adj->value));
}
static void
brushes_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, global_brush_factory->container);
}
static void
patterns_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, global_pattern_factory->container);
}
static void
gradients_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, global_gradient_factory->container);
}
static void
palettes_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, global_palette_factory->container);
}
static void
images_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, image_context);
}
/*
static void
null_callback (GtkWidget *widget,
GimpContainerView *view)
{
gimp_container_view_set_container (view, NULL);
}
*/
static void
container_view_new (gboolean list,
gchar *title,
GimpContainer *container,
GimpContext *context,
gint preview_size)
{
GtkWidget *dialog;
GtkWidget *view;
GtkObject *adjustment;
GtkWidget *scale;
if (list)
{
view = gimp_container_list_view_new (container,
context,
preview_size,
5, 5);
}
else
{
view = gimp_container_grid_view_new (container,
context,
preview_size,
5, 5);
}
dialog = gimp_dialog_new (title, "test",
gimp_standard_help_func,
NULL,
GTK_WIN_POS_MOUSE,
FALSE, TRUE, TRUE,
"_delete_event_", gtk_widget_destroy,
NULL, 1, NULL, TRUE, TRUE,
NULL);
gtk_widget_hide (GTK_DIALOG (dialog)->action_area);
/*
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_BIN (dialog)->child)), 1)));
*/
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), view);
gtk_widget_show (view);
adjustment = gtk_adjustment_new (preview_size, 16, 256, 16, 16, 0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scale,
FALSE, FALSE, 0);
gtk_widget_show (scale);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (container_view_scale_callback),
view);
gtk_widget_show (dialog);
}
static void
data_factory_view_new (GimpViewType view_type,
gchar *title,
GimpDataFactory *factory,
GimpDataEditFunc edit_func,
GimpContext *context,
gint preview_size)
{
GtkWidget *dialog;
GtkWidget *view;
GtkObject *adjustment;
GtkWidget *scale;
dialog = gimp_dialog_new (title, "test",
gimp_standard_help_func,
NULL,
GTK_WIN_POS_MOUSE,
FALSE, TRUE, TRUE,
"_delete_event_", gtk_widget_destroy,
NULL, 1, NULL, TRUE, TRUE,
NULL);
gtk_widget_hide (GTK_DIALOG (dialog)->action_area);
view = gimp_data_factory_view_new (view_type,
factory,
edit_func,
context,
preview_size,
5, 5);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), view);
gtk_widget_show (view);
adjustment = gtk_adjustment_new (preview_size, 16, 256, 16, 16, 0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scale,
FALSE, FALSE, 0);
gtk_widget_show (scale);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (container_view_scale_callback),
GIMP_DATA_FACTORY_VIEW (view)->view);
gtk_widget_show (dialog);
}
static void
container_multi_view_new (gboolean list,
gchar *title,
GimpContainer *container,
GimpContext *context,
gint preview_size)
{
GtkWidget *dialog;
GtkWidget *view;
GtkObject *adjustment;
GtkWidget *scale;
GtkWidget *preview;
if (list)
{
view = gimp_container_list_view_new (container,
context,
preview_size,
5, 5);
}
else
{
view = gimp_container_grid_view_new (container,
context,
preview_size,
5, 5);
}
dialog = gimp_dialog_new (title, "test",
gimp_standard_help_func,
NULL,
GTK_WIN_POS_MOUSE,
FALSE, TRUE, TRUE,
"Images", images_callback,
view, NULL, NULL, FALSE, FALSE,
/*
"NULL", null_callback,
view, NULL, NULL, FALSE, FALSE,
*/
"_delete_event_", gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE,
NULL);
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (brushes_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"brush_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (patterns_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"pattern_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (gradients_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"gradient_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_palette (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (palettes_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"palette_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
/*
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_image (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (images_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"pattern_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
*/
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), view);
gtk_widget_show (view);
adjustment = gtk_adjustment_new (preview_size, 16, 64, 4, 4, 0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scale,
FALSE, FALSE, 0);
gtk_widget_show (scale);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (container_view_scale_callback),
view);
gtk_widget_show (dialog);
}
void
dialogs_test_image_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (TRUE, "Image List",
image_context,
gimp_context_get_user (),
64);
}
void
dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (FALSE, "Image Grid",
image_context,
gimp_context_get_user (),
64);
}
void
dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_LIST,
"Brush List",
global_brush_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_LIST,
"Pattern List",
global_pattern_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_gradient_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_LIST,
"Gradient List",
global_gradient_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_palette_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_LIST,
"Palette List",
global_palette_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_GRID,
"Brush Grid",
global_brush_factory,
NULL,
gimp_context_get_user (),
32);
}
void
dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_GRID,
"Pattern Grid",
global_pattern_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_gradient_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_GRID,
"Gradient Grid",
global_gradient_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_palette_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
data_factory_view_new (GIMP_VIEW_TYPE_GRID,
"Palette Grid",
global_palette_factory,
NULL,
gimp_context_get_user (),
24);
}
void
dialogs_test_multi_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_multi_view_new (TRUE, "Multi List",
global_brush_factory->container,
gimp_context_get_user (),
24);
}
void
dialogs_test_multi_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_multi_view_new (FALSE, "Multi Grid",
global_brush_factory->container,
gimp_context_get_user (),
32);
}
static void
layers_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpContainerView *view)
{
gimp_container_view_set_container (view, gimage ? gimage->layers : NULL);
}
static void
channels_view_image_changed (GimpContext *context,
GimpImage *gimage,
GimpContainerView *view)
{
gimp_container_view_set_container (view, gimage ? gimage->channels : NULL);
}
static void
drawable_view_new (GimpViewType view_type,
gchar *title,
gboolean channels,
GimpContext *context)
{
GimpImage *gimage;
GtkWidget *dialog;
GtkWidget *view;
if (view_type == GIMP_VIEW_TYPE_LIST)
{
view = gimp_container_list_view_new (NULL,
NULL,
preview_size,
5, 5);
}
else
{
view = gimp_container_grid_view_new (NULL,
NULL,
preview_size,
5, 5);
}
gimage = gimp_context_get_image (context);
if (channels)
{
if (gimage)
gimp_container_view_set_container (GIMP_CONTAINER_VIEW (view),
gimage->channels);
gtk_signal_connect (GTK_OBJECT (context), "image_changed",
GTK_SIGNAL_FUNC (channels_view_image_changed),
view);
}
else
{