app/gui/Makefile.am app/gui/channels-dialog.[ch] at the end of their

2001-05-11  Michael Natterer  <mitch@gimp.org>

	* app/gui/Makefile.am
	* app/gui/channels-dialog.[ch]
	* app/gui/layers-dialog.[ch]: at the end of their epoch, the
	dinosaurs were wiped out by a "cvs remove" impact from space.

	* app/lc_dialog.c: changed accordingly.

	* app/gui/layer-select.c: use the new preview system (mostly code
	removal).

	* app/gui/menus.c: reorder the dialog factory menu.
This commit is contained in:
Michael Natterer 2001-05-11 15:17:39 +00:00 committed by Michael Natterer
parent 42c3912161
commit 02b52b70f0
12 changed files with 195 additions and 6364 deletions

View File

@ -1,3 +1,17 @@
2001-05-11 Michael Natterer <mitch@gimp.org>
* app/gui/Makefile.am
* app/gui/channels-dialog.[ch]
* app/gui/layers-dialog.[ch]: at the end of their epoch, the
dinosaurs were wiped out by a "cvs remove" impact from space.
* app/lc_dialog.c: changed accordingly.
* app/gui/layer-select.c: use the new preview system (mostly code
removal).
* app/gui/menus.c: reorder the dialog factory menu.
2001-05-10 David Neary <dneary@eircom.net>
* app/tools/gimpbycolorselecttool.[ch]

View File

@ -22,13 +22,15 @@
#include <gdk/gdkkeysyms.h>
#include "core/core-types.h"
#include "widgets/widgets-types.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "widgets/gimppreview.h"
#include "layer-select.h"
#include "gdisplay.h"
#include "layers-dialog.h"
#include "gimprc.h"
#include "temp_buf.h"
@ -44,17 +46,11 @@ typedef struct _LayerSelect LayerSelect;
struct _LayerSelect
{
GtkWidget *shell;
GtkWidget *layer_preview;
GtkWidget *label;
GdkPixmap *layer_pixmap;
GtkWidget *preview;
GtkWidget *label;
GimpImage *gimage;
GimpLayer *current_layer;
gboolean dirty;
gint image_width;
gint image_height;
gdouble ratio;
};
@ -67,12 +63,8 @@ static void layer_select_end (LayerSelect *layer_select,
guint32 time);
static void layer_select_set_gimage (LayerSelect *layer_select,
GimpImage *gimage);
static void layer_select_set_layer (LayerSelect *layer_select);
static gint layer_select_events (GtkWidget *widget,
GdkEvent *event);
static gint preview_events (GtkWidget *widget,
GdkEvent *event);
static void preview_redraw (LayerSelect *layer_select);
/*
@ -91,28 +83,28 @@ layer_select_init (GimpImage *gimage,
gint move,
guint32 time)
{
GimpLayer *layer;
GtkWidget *frame1;
GtkWidget *frame2;
GtkWidget *hbox;
GtkWidget *alignment;
layer = gimp_image_get_active_layer (gimage);
if (! layer)
return;
if (!layer_select)
{
layer_select = g_malloc (sizeof (LayerSelect));
layer_select->layer_pixmap = NULL;
layer_select->layer_preview = NULL;
layer_select->preview = NULL;
layer_select->image_width = layer_select->image_height = 0;
layer_select = g_new0 (LayerSelect, 1);
layer_select->preview = gimp_preview_new (GIMP_VIEWABLE (layer),
preview_size, 1, FALSE);
layer_select->label = gtk_label_new (NULL);
layer_select_set_gimage (layer_select, gimage);
layer_select_advance (layer_select, move);
if (preview_size)
{
layer_select->preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (layer_select->preview),
preview_size, preview_size);
}
/* The shell and main vbox */
layer_select->shell = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_wmclass (GTK_WINDOW (layer_select->shell),
@ -143,22 +135,11 @@ layer_select_init (GimpImage *gimage,
gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 0);
gtk_widget_show (alignment);
layer_select->layer_preview = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (layer_select->layer_preview),
layer_select->image_width,
layer_select->image_height);
gtk_widget_set_events (layer_select->layer_preview, PREVIEW_EVENT_MASK);
gtk_signal_connect (GTK_OBJECT (layer_select->layer_preview), "event",
(GtkSignalFunc) preview_events, layer_select);
gtk_object_set_user_data (GTK_OBJECT (layer_select->layer_preview),
layer_select);
gtk_container_add (GTK_CONTAINER (alignment),
layer_select->layer_preview);
gtk_widget_show (layer_select->layer_preview);
gtk_container_add (GTK_CONTAINER (alignment), layer_select->preview);
gtk_widget_show (layer_select->preview);
gtk_widget_show (alignment);
/* the layer name label */
layer_select->label = gtk_label_new (_("Layer"));
gtk_box_pack_start (GTK_BOX (hbox),
layer_select->label, FALSE, FALSE, 2);
gtk_widget_show (layer_select->label);
@ -175,8 +156,6 @@ layer_select_init (GimpImage *gimage,
if (! GTK_WIDGET_VISIBLE (layer_select->shell))
gtk_widget_show (layer_select->shell);
else
gtk_widget_draw (layer_select->layer_preview, NULL);
}
gdk_key_repeat_disable ();
@ -187,10 +166,9 @@ void
layer_select_update_preview_size (void)
{
if (layer_select != NULL)
{ gtk_preview_size (GTK_PREVIEW (layer_select->preview),
preview_size, preview_size);
if (GTK_WIDGET_VISIBLE (layer_select->shell))
gtk_widget_draw (layer_select->layer_preview, NULL);
{
gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview),
preview_size, 1);
}
}
@ -238,6 +216,12 @@ layer_select_advance (LayerSelect *layer_select,
{
layer = (GimpLayer *) nth->data;
layer_select->current_layer = layer;
gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview),
GIMP_VIEWABLE (layer_select->current_layer));
gtk_label_set_text (GTK_LABEL (layer_select->label),
GIMP_OBJECT (layer_select->current_layer)->name);
}
}
@ -245,16 +229,12 @@ static void
layer_select_forward (LayerSelect *layer_select)
{
layer_select_advance (layer_select, 1);
layer_select->dirty = TRUE;
gtk_widget_draw (layer_select->layer_preview, NULL);
}
static void
layer_select_backward (LayerSelect *layer_select)
{
layer_select_advance (layer_select, -1);
layer_select->dirty = TRUE;
gtk_widget_draw (layer_select->layer_preview, NULL);
}
static void
@ -280,54 +260,15 @@ static void
layer_select_set_gimage (LayerSelect *layer_select,
GimpImage *gimage)
{
gint image_width;
gint image_height;
layer_select->gimage = gimage;
layer_select->current_layer = gimp_image_get_active_layer (gimage);
layer_select->dirty = TRUE;
/* Get the image width and height variables, based on the gimage */
if (gimage->width > gimage->height)
layer_select->ratio =
MIN (1.0, (gdouble) preview_size / (gdouble) gimage->width);
else
layer_select->ratio =
MIN (1.0, (gdouble) preview_size / (gdouble) gimage->height);
image_width = (gint) (layer_select->ratio * gimage->width);
image_height = (gint) (layer_select->ratio * gimage->height);
if (layer_select->image_width != image_width ||
layer_select->image_height != image_height)
{
layer_select->image_width = image_width;
layer_select->image_height = image_height;
if (layer_select->layer_preview)
gtk_widget_set_usize (layer_select->layer_preview,
layer_select->image_width,
layer_select->image_height);
if (layer_select->layer_pixmap)
{
gdk_pixmap_unref (layer_select->layer_pixmap);
layer_select->layer_pixmap = NULL;
}
}
}
static void
layer_select_set_layer (LayerSelect *layer_select)
{
GimpLayer *layer;
if (! (layer = (layer_select->current_layer)))
return;
/* Set the layer label */
gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview),
GIMP_VIEWABLE (layer_select->current_layer));
gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview),
preview_size, 1);
gtk_label_set_text (GTK_LABEL (layer_select->label),
gimp_object_get_name (GIMP_OBJECT (layer)));
GIMP_OBJECT (layer_select->current_layer)->name);
}
static gint
@ -384,100 +325,3 @@ layer_select_events (GtkWidget *widget,
return FALSE;
}
static gint
preview_events (GtkWidget *widget,
GdkEvent *event)
{
switch (event->type)
{
case GDK_EXPOSE:
if (layer_select->dirty)
{
/* If a preview exists, draw it */
if (preview_size)
preview_redraw (layer_select);
/* Change the layer name label */
layer_select_set_layer (layer_select);
layer_select->dirty = FALSE;
}
if (preview_size)
gdk_draw_pixmap (layer_select->layer_preview->window,
layer_select->layer_preview->style->black_gc,
layer_select->layer_pixmap,
0, 0, 0, 0,
layer_select->image_width,
layer_select->image_height);
break;
default:
break;
}
return FALSE;
}
static void
preview_redraw (LayerSelect *layer_select)
{
GimpLayer *layer;
TempBuf *preview_buf;
gint w, h;
gint offx, offy;
if (! (layer = (layer_select->current_layer)))
return;
if (! layer_select->layer_pixmap)
layer_select->layer_pixmap =
gdk_pixmap_new (layer_select->layer_preview->window,
layer_select->image_width,
layer_select->image_height,
-1);
if (gimp_layer_is_floating_sel (layer))
{
render_fs_preview (layer_select->layer_preview,
layer_select->layer_pixmap);
}
else
{
gint off_x;
gint off_y;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
/* determine width and height */
w = (gint) (layer_select->ratio *
gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) (layer_select->ratio *
gimp_drawable_height (GIMP_DRAWABLE (layer)));
offx = (gint) (layer_select->ratio * off_x);
offy = (gint) (layer_select->ratio * off_y);
preview_buf = gimp_viewable_get_preview (GIMP_VIEWABLE (layer), w, h);
preview_buf->x = offx;
preview_buf->y = offy;
render_preview (preview_buf,
layer_select->preview,
layer_select->image_width,
layer_select->image_height,
-1);
/* Set the layer pixmap */
gtk_preview_put (GTK_PREVIEW (layer_select->preview),
layer_select->layer_pixmap,
layer_select->layer_preview->style->black_gc,
0, 0, 0, 0,
layer_select->image_width, layer_select->image_height);
/* make sure the image has been transfered completely
* to the pixmap before we use it again...
*/
gdk_flush ();
}
}

View File

@ -11,8 +11,6 @@ libappgui_la_SOURCES = \
brush-select.h \
channels-commands.c \
channels-commands.h \
channels-dialog.c \
channels-dialog.h \
color-area.c \
color-area.h \
color-notebook.c \
@ -55,8 +53,6 @@ libappgui_la_SOURCES = \
layer-select.h \
layers-commands.c \
layers-commands.h \
layers-dialog.c \
layers-dialog.h \
menus.c \
menus.h \
offset-dialog.c \

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
/* 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.
*/
#ifndef __CHANNELS_DIALOG_H__
#define __CHANNELS_DIALOG_H__
GtkWidget * channels_dialog_create (void);
void channels_dialog_free (void);
void channels_dialog_update (GimpImage *gimage);
void channels_dialog_flush (void);
void channels_dialog_clear (void);
#endif /* __CHANNELS_DIALOG_H__ */

View File

@ -22,13 +22,15 @@
#include <gdk/gdkkeysyms.h>
#include "core/core-types.h"
#include "widgets/widgets-types.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "widgets/gimppreview.h"
#include "layer-select.h"
#include "gdisplay.h"
#include "layers-dialog.h"
#include "gimprc.h"
#include "temp_buf.h"
@ -44,17 +46,11 @@ typedef struct _LayerSelect LayerSelect;
struct _LayerSelect
{
GtkWidget *shell;
GtkWidget *layer_preview;
GtkWidget *label;
GdkPixmap *layer_pixmap;
GtkWidget *preview;
GtkWidget *label;
GimpImage *gimage;
GimpLayer *current_layer;
gboolean dirty;
gint image_width;
gint image_height;
gdouble ratio;
};
@ -67,12 +63,8 @@ static void layer_select_end (LayerSelect *layer_select,
guint32 time);
static void layer_select_set_gimage (LayerSelect *layer_select,
GimpImage *gimage);
static void layer_select_set_layer (LayerSelect *layer_select);
static gint layer_select_events (GtkWidget *widget,
GdkEvent *event);
static gint preview_events (GtkWidget *widget,
GdkEvent *event);
static void preview_redraw (LayerSelect *layer_select);
/*
@ -91,28 +83,28 @@ layer_select_init (GimpImage *gimage,
gint move,
guint32 time)
{
GimpLayer *layer;
GtkWidget *frame1;
GtkWidget *frame2;
GtkWidget *hbox;
GtkWidget *alignment;
layer = gimp_image_get_active_layer (gimage);
if (! layer)
return;
if (!layer_select)
{
layer_select = g_malloc (sizeof (LayerSelect));
layer_select->layer_pixmap = NULL;
layer_select->layer_preview = NULL;
layer_select->preview = NULL;
layer_select->image_width = layer_select->image_height = 0;
layer_select = g_new0 (LayerSelect, 1);
layer_select->preview = gimp_preview_new (GIMP_VIEWABLE (layer),
preview_size, 1, FALSE);
layer_select->label = gtk_label_new (NULL);
layer_select_set_gimage (layer_select, gimage);
layer_select_advance (layer_select, move);
if (preview_size)
{
layer_select->preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (layer_select->preview),
preview_size, preview_size);
}
/* The shell and main vbox */
layer_select->shell = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_wmclass (GTK_WINDOW (layer_select->shell),
@ -143,22 +135,11 @@ layer_select_init (GimpImage *gimage,
gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 0);
gtk_widget_show (alignment);
layer_select->layer_preview = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (layer_select->layer_preview),
layer_select->image_width,
layer_select->image_height);
gtk_widget_set_events (layer_select->layer_preview, PREVIEW_EVENT_MASK);
gtk_signal_connect (GTK_OBJECT (layer_select->layer_preview), "event",
(GtkSignalFunc) preview_events, layer_select);
gtk_object_set_user_data (GTK_OBJECT (layer_select->layer_preview),
layer_select);
gtk_container_add (GTK_CONTAINER (alignment),
layer_select->layer_preview);
gtk_widget_show (layer_select->layer_preview);
gtk_container_add (GTK_CONTAINER (alignment), layer_select->preview);
gtk_widget_show (layer_select->preview);
gtk_widget_show (alignment);
/* the layer name label */
layer_select->label = gtk_label_new (_("Layer"));
gtk_box_pack_start (GTK_BOX (hbox),
layer_select->label, FALSE, FALSE, 2);
gtk_widget_show (layer_select->label);
@ -175,8 +156,6 @@ layer_select_init (GimpImage *gimage,
if (! GTK_WIDGET_VISIBLE (layer_select->shell))
gtk_widget_show (layer_select->shell);
else
gtk_widget_draw (layer_select->layer_preview, NULL);
}
gdk_key_repeat_disable ();
@ -187,10 +166,9 @@ void
layer_select_update_preview_size (void)
{
if (layer_select != NULL)
{ gtk_preview_size (GTK_PREVIEW (layer_select->preview),
preview_size, preview_size);
if (GTK_WIDGET_VISIBLE (layer_select->shell))
gtk_widget_draw (layer_select->layer_preview, NULL);
{
gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview),
preview_size, 1);
}
}
@ -238,6 +216,12 @@ layer_select_advance (LayerSelect *layer_select,
{
layer = (GimpLayer *) nth->data;
layer_select->current_layer = layer;
gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview),
GIMP_VIEWABLE (layer_select->current_layer));
gtk_label_set_text (GTK_LABEL (layer_select->label),
GIMP_OBJECT (layer_select->current_layer)->name);
}
}
@ -245,16 +229,12 @@ static void
layer_select_forward (LayerSelect *layer_select)
{
layer_select_advance (layer_select, 1);
layer_select->dirty = TRUE;
gtk_widget_draw (layer_select->layer_preview, NULL);
}
static void
layer_select_backward (LayerSelect *layer_select)
{
layer_select_advance (layer_select, -1);
layer_select->dirty = TRUE;
gtk_widget_draw (layer_select->layer_preview, NULL);
}
static void
@ -280,54 +260,15 @@ static void
layer_select_set_gimage (LayerSelect *layer_select,
GimpImage *gimage)
{
gint image_width;
gint image_height;
layer_select->gimage = gimage;
layer_select->current_layer = gimp_image_get_active_layer (gimage);
layer_select->dirty = TRUE;
/* Get the image width and height variables, based on the gimage */
if (gimage->width > gimage->height)
layer_select->ratio =
MIN (1.0, (gdouble) preview_size / (gdouble) gimage->width);
else
layer_select->ratio =
MIN (1.0, (gdouble) preview_size / (gdouble) gimage->height);
image_width = (gint) (layer_select->ratio * gimage->width);
image_height = (gint) (layer_select->ratio * gimage->height);
if (layer_select->image_width != image_width ||
layer_select->image_height != image_height)
{
layer_select->image_width = image_width;
layer_select->image_height = image_height;
if (layer_select->layer_preview)
gtk_widget_set_usize (layer_select->layer_preview,
layer_select->image_width,
layer_select->image_height);
if (layer_select->layer_pixmap)
{
gdk_pixmap_unref (layer_select->layer_pixmap);
layer_select->layer_pixmap = NULL;
}
}
}
static void
layer_select_set_layer (LayerSelect *layer_select)
{
GimpLayer *layer;
if (! (layer = (layer_select->current_layer)))
return;
/* Set the layer label */
gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview),
GIMP_VIEWABLE (layer_select->current_layer));
gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview),
preview_size, 1);
gtk_label_set_text (GTK_LABEL (layer_select->label),
gimp_object_get_name (GIMP_OBJECT (layer)));
GIMP_OBJECT (layer_select->current_layer)->name);
}
static gint
@ -384,100 +325,3 @@ layer_select_events (GtkWidget *widget,
return FALSE;
}
static gint
preview_events (GtkWidget *widget,
GdkEvent *event)
{
switch (event->type)
{
case GDK_EXPOSE:
if (layer_select->dirty)
{
/* If a preview exists, draw it */
if (preview_size)
preview_redraw (layer_select);
/* Change the layer name label */
layer_select_set_layer (layer_select);
layer_select->dirty = FALSE;
}
if (preview_size)
gdk_draw_pixmap (layer_select->layer_preview->window,
layer_select->layer_preview->style->black_gc,
layer_select->layer_pixmap,
0, 0, 0, 0,
layer_select->image_width,
layer_select->image_height);
break;
default:
break;
}
return FALSE;
}
static void
preview_redraw (LayerSelect *layer_select)
{
GimpLayer *layer;
TempBuf *preview_buf;
gint w, h;
gint offx, offy;
if (! (layer = (layer_select->current_layer)))
return;
if (! layer_select->layer_pixmap)
layer_select->layer_pixmap =
gdk_pixmap_new (layer_select->layer_preview->window,
layer_select->image_width,
layer_select->image_height,
-1);
if (gimp_layer_is_floating_sel (layer))
{
render_fs_preview (layer_select->layer_preview,
layer_select->layer_pixmap);
}
else
{
gint off_x;
gint off_y;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
/* determine width and height */
w = (gint) (layer_select->ratio *
gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) (layer_select->ratio *
gimp_drawable_height (GIMP_DRAWABLE (layer)));
offx = (gint) (layer_select->ratio * off_x);
offy = (gint) (layer_select->ratio * off_y);
preview_buf = gimp_viewable_get_preview (GIMP_VIEWABLE (layer), w, h);
preview_buf->x = offx;
preview_buf->y = offy;
render_preview (preview_buf,
layer_select->preview,
layer_select->image_width,
layer_select->image_height,
-1);
/* Set the layer pixmap */
gtk_preview_put (GTK_PREVIEW (layer_select->preview),
layer_select->layer_pixmap,
layer_select->layer_preview->style->black_gc,
0, 0, 0, 0,
layer_select->image_width, layer_select->image_height);
/* make sure the image has been transfered completely
* to the pixmap before we use it again...
*/
gdk_flush ();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
/* 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.
*/
#ifndef __LAYERS_DIALOG_H__
#define __LAYERS_DIALOG_H__
GtkWidget * layers_dialog_create (void);
void layers_dialog_free (void);
void layers_dialog_update (GimpImage *gimage);
void layers_dialog_flush (void);
void layers_dialog_clear (void);
void render_fs_preview (GtkWidget *widget,
GdkPixmap *pixmap);
void render_preview (TempBuf *preview_buf,
GtkWidget *preview_widget,
gint width,
gint height,
gint channel);
void layers_dialog_invalidate_previews (GimpImage *gimage);
#endif /* __LAYERS_DIALOG_H__ */

View File

@ -856,43 +856,59 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { N_("/Remove Tab"), NULL, dialogs_remove_tab_cmd_callback, 0 },
NULL, NULL },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-grid") },
NULL, NULL },
@ -900,11 +916,11 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
NULL, NULL },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
NULL, NULL }
};
static guint n_dialogs_entries = (sizeof (dialogs_entries) /

View File

@ -34,8 +34,6 @@
#include "widgets/gimpdialogfactory.h"
#include "gui/dialogs.h"
#include "gui/channels-dialog.h"
#include "gui/layers-dialog.h"
#include "gui/paths-dialog.h"
#include "context_manager.h"
@ -121,7 +119,7 @@ lc_dialog_create (GimpImage *gimage)
lc_dialog->gimage = NULL;
lc_dialog->auto_follow_active = TRUE;
lc_dialog->shell = gimp_dialog_new (_("Layers, Channels & Paths"),
lc_dialog->shell = gimp_dialog_new ("Old Paths Dialog",
"layers_channels_paths",
lc_dialog_help_func,
"dialogs/layers_and_channels.html",
@ -193,16 +191,6 @@ lc_dialog_create (GimpImage *gimage)
gtk_box_pack_start (GTK_BOX (lc_dialog->subshell), lc_dialog->notebook,
TRUE, TRUE, 0);
label = gtk_label_new (_("Layers"));
gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook),
layers_dialog_create (), label);
gtk_widget_show (label);
label = gtk_label_new (_("Channels"));
gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook),
channels_dialog_create (), label);
gtk_widget_show (label);
label = gtk_label_new (_("Paths"));
gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook),
paths_dialog_create (), label);
@ -218,10 +206,6 @@ lc_dialog_create (GimpImage *gimage)
gtk_container_set_border_width
(GTK_CONTAINER (GTK_DIALOG (lc_dialog->shell)->action_area), 1);
/* Make sure the channels page is realized */
gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 1);
gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 0);
gtk_signal_connect (GTK_OBJECT (image_context), "add",
GTK_SIGNAL_FUNC (lc_dialog_add_callback), NULL);
gtk_signal_connect (GTK_OBJECT (image_context), "remove",
@ -245,9 +229,6 @@ lc_dialog_free (void)
if (lc_dialog == NULL)
return;
layers_dialog_free ();
channels_dialog_free ();
gtk_widget_destroy (lc_dialog->shell);
g_free (lc_dialog);
@ -285,8 +266,6 @@ lc_dialog_flush (void)
if (! lc_dialog || lc_dialog->gimage == NULL)
return;
layers_dialog_flush ();
channels_dialog_flush ();
paths_dialog_flush ();
}
@ -319,7 +298,6 @@ lc_dialog_preview_update (GimpImage *gimage)
if (!preview_size)
return;
layers_dialog_invalidate_previews (gimage);
gtk_idle_add ((GtkFunction) image_menu_preview_update_do, gimage);
}
@ -385,9 +363,6 @@ lc_dialog_update_image_list (void)
}
else
{
layers_dialog_clear ();
channels_dialog_clear ();
lc_dialog->gimage = NULL;
if (GTK_WIDGET_IS_SENSITIVE (lc_dialog->subshell))
@ -407,8 +382,6 @@ lc_dialog_update (GimpImage *gimage)
lc_dialog->gimage = gimage;
layers_dialog_update (gimage);
channels_dialog_update (gimage);
paths_dialog_update (gimage);
}
@ -750,12 +723,12 @@ lc_dialog_help_func (const gchar *help_data)
gchar *help_page;
gint page_num;
static gchar* dialog_names[] = { "layers", "channels", "paths" };
static gchar* dialog_names[] = { "paths" };
page_num =
gtk_notebook_get_current_page (GTK_NOTEBOOK (lc_dialog->notebook));
if (page_num > 2)
if (page_num > 0)
return;
help_page = g_strconcat (dialog_names[page_num], "/",

View File

@ -856,43 +856,59 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { N_("/Remove Tab"), NULL, dialogs_remove_tab_cmd_callback, 0 },
NULL, NULL },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-grid") },
NULL, NULL },
@ -900,11 +916,11 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
NULL, NULL },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
NULL, NULL }
};
static guint n_dialogs_entries = (sizeof (dialogs_entries) /

View File

@ -856,43 +856,59 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { N_("/Remove Tab"), NULL, dialogs_remove_tab_cmd_callback, 0 },
NULL, NULL },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
{ { N_("/Add Tab/Brush List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-list") },
NULL, NULL },
{ { N_("/Add Tab/Brush Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:brush-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Pattern List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-list") },
NULL, NULL },
{ { N_("/Add Tab/Pattern Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:pattern-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Gradient List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-list") },
NULL, NULL },
{ { N_("/Add Tab/Gradient Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:gradient-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Palette List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-list") },
NULL, NULL },
{ { N_("/Add Tab/Palette Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:palette-grid") },
NULL, NULL },
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Tool List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-list") },
NULL, NULL },
{ { N_("/Add Tab/Tool Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:tool-grid") },
NULL, NULL },
@ -900,11 +916,11 @@ static GimpItemFactoryEntry dialogs_entries[] =
{ { "/Add Tab/---", NULL, NULL, 0, "<Separator>" },
NULL, NULL },
{ { N_("/Add Tab/Layer List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:layer-list") },
{ { N_("/Add Tab/Image List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-list") },
NULL, NULL },
{ { N_("/Add Tab/Channel List..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:channel-list") },
{ { N_("/Add Tab/Image Grid..."), NULL, dialogs_add_tab_cmd_callback,
GPOINTER_TO_UINT ("gimp:image-grid") },
NULL, NULL }
};
static guint n_dialogs_entries = (sizeof (dialogs_entries) /