2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2002-08-31 05:00:42 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpviewabledialog.c
|
|
|
|
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2002-08-31 05:00:42 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2002-08-31 05:00:42 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-08-31 05:00:42 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2002-08-31 05:00:42 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "widgets-types.h"
|
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2002-08-31 05:00:42 +08:00
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimpitem.h"
|
|
|
|
|
2004-08-25 01:16:46 +08:00
|
|
|
#include "gimpview.h"
|
2002-08-31 05:00:42 +08:00
|
|
|
#include "gimpviewabledialog.h"
|
2006-09-01 19:26:54 +08:00
|
|
|
#include "gimpviewrenderer.h"
|
2002-08-31 05:00:42 +08:00
|
|
|
|
|
|
|
|
2004-05-05 08:01:19 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2006-04-23 10:28:15 +08:00
|
|
|
PROP_VIEWABLE,
|
2006-09-01 19:26:54 +08:00
|
|
|
PROP_CONTEXT,
|
2014-05-07 21:30:38 +08:00
|
|
|
PROP_ICON_NAME,
|
2011-03-20 19:44:03 +08:00
|
|
|
PROP_DESC
|
2004-05-05 08:01:19 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
static void gimp_viewable_dialog_dispose (GObject *object);
|
2004-05-05 08:01:19 +08:00
|
|
|
static void gimp_viewable_dialog_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2006-04-23 10:28:15 +08:00
|
|
|
static void gimp_viewable_dialog_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2004-05-05 08:01:19 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
static void gimp_viewable_dialog_name_changed (GimpObject *object,
|
|
|
|
GimpViewableDialog *dialog);
|
2002-09-08 20:18:23 +08:00
|
|
|
static void gimp_viewable_dialog_close (GimpViewableDialog *dialog);
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2006-05-15 17:46:31 +08:00
|
|
|
G_DEFINE_TYPE (GimpViewableDialog, gimp_viewable_dialog, GIMP_TYPE_DIALOG)
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
#define parent_class gimp_viewable_dialog_parent_class
|
2002-08-31 05:00:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_class_init (GimpViewableDialogClass *klass)
|
|
|
|
{
|
2010-09-27 04:38:01 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2004-05-05 08:01:19 +08:00
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
object_class->dispose = gimp_viewable_dialog_dispose;
|
2006-04-23 10:28:15 +08:00
|
|
|
object_class->get_property = gimp_viewable_dialog_get_property;
|
2004-05-05 08:01:19 +08:00
|
|
|
object_class->set_property = gimp_viewable_dialog_set_property;
|
|
|
|
|
2006-04-23 10:28:15 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_VIEWABLE,
|
|
|
|
g_param_spec_object ("viewable", NULL, NULL,
|
|
|
|
GIMP_TYPE_VIEWABLE,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_CONTEXT,
|
|
|
|
g_param_spec_object ("context", NULL, NULL,
|
|
|
|
GIMP_TYPE_CONTEXT,
|
2014-11-27 06:48:19 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT));
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2014-05-07 21:30:38 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_ICON_NAME,
|
|
|
|
g_param_spec_string ("icon-name", NULL, NULL,
|
2004-05-05 08:01:19 +08:00
|
|
|
NULL,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_WRITABLE |
|
2014-05-23 05:28:19 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2004-05-05 08:01:19 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_DESC,
|
|
|
|
g_param_spec_string ("description", NULL, NULL,
|
|
|
|
NULL,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_WRITABLE |
|
2004-10-22 23:41:03 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
2002-08-31 05:00:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_init (GimpViewableDialog *dialog)
|
|
|
|
{
|
2009-03-23 00:35:53 +08:00
|
|
|
GtkWidget *content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
2002-08-31 05:00:42 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
2009-03-23 00:35:53 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (content_area), frame, FALSE, FALSE, 0);
|
2002-08-31 05:00:42 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
2002-08-31 05:00:42 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
dialog->icon = gtk_image_new ();
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (dialog->icon), 0.5, 0.0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), dialog->icon, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (dialog->icon);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
2010-10-30 21:42:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
2002-08-31 05:00:42 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
dialog->desc_label = gtk_label_new (NULL);
|
2016-09-09 01:11:20 +08:00
|
|
|
gtk_label_set_xalign (GTK_LABEL (dialog->desc_label), 0.0);
|
2004-06-21 21:18:50 +08:00
|
|
|
gimp_label_set_attributes (GTK_LABEL (dialog->desc_label),
|
|
|
|
PANGO_ATTR_SCALE, PANGO_SCALE_LARGE,
|
|
|
|
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
|
|
|
-1);
|
2002-08-31 05:00:42 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), dialog->desc_label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (dialog->desc_label);
|
|
|
|
|
2005-07-09 07:57:47 +08:00
|
|
|
dialog->viewable_label = g_object_new (GTK_TYPE_LABEL,
|
|
|
|
"xalign", 0.0,
|
|
|
|
"yalign", 0.5,
|
|
|
|
"ellipsize", PANGO_ELLIPSIZE_END,
|
|
|
|
NULL);
|
2004-09-22 06:31:20 +08:00
|
|
|
gimp_label_set_attributes (GTK_LABEL (dialog->viewable_label),
|
|
|
|
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
|
|
|
|
-1);
|
2002-08-31 05:00:42 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), dialog->viewable_label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (dialog->viewable_label);
|
|
|
|
}
|
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
|
|
|
|
|
|
|
|
if (dialog->view)
|
|
|
|
gimp_viewable_dialog_set_viewable (dialog, NULL, NULL);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
2002-09-08 20:18:23 +08:00
|
|
|
static void
|
2004-05-05 08:01:19 +08:00
|
|
|
gimp_viewable_dialog_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2002-09-08 20:18:23 +08:00
|
|
|
{
|
2004-05-05 08:01:19 +08:00
|
|
|
GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
|
2002-09-08 20:18:23 +08:00
|
|
|
|
2004-05-05 08:01:19 +08:00
|
|
|
switch (property_id)
|
|
|
|
{
|
2006-04-23 10:28:15 +08:00
|
|
|
case PROP_VIEWABLE:
|
2006-09-01 19:26:54 +08:00
|
|
|
gimp_viewable_dialog_set_viewable (dialog,
|
|
|
|
g_value_get_object (value),
|
|
|
|
dialog->context);
|
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
case PROP_CONTEXT:
|
|
|
|
gimp_viewable_dialog_set_viewable (dialog,
|
|
|
|
dialog->view ?
|
|
|
|
GIMP_VIEW (dialog->view)->viewable :
|
|
|
|
NULL,
|
|
|
|
g_value_get_object (value));
|
2006-04-23 10:28:15 +08:00
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2014-05-07 21:30:38 +08:00
|
|
|
case PROP_ICON_NAME:
|
|
|
|
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->icon),
|
|
|
|
g_value_get_string (value),
|
|
|
|
GTK_ICON_SIZE_LARGE_TOOLBAR);
|
2004-05-05 08:01:19 +08:00
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2004-05-05 08:01:19 +08:00
|
|
|
case PROP_DESC:
|
|
|
|
gtk_label_set_text (GTK_LABEL (dialog->desc_label),
|
|
|
|
g_value_get_string (value));
|
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2004-05-05 08:01:19 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-23 10:28:15 +08:00
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_VIEWABLE:
|
|
|
|
g_value_set_object (value,
|
|
|
|
dialog->view ?
|
|
|
|
GIMP_VIEW (dialog->view)->viewable : NULL);
|
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
case PROP_CONTEXT:
|
|
|
|
g_value_set_object (value, dialog->context);
|
|
|
|
break;
|
2011-03-20 19:44:03 +08:00
|
|
|
|
2006-04-23 10:28:15 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-31 05:00:42 +08:00
|
|
|
GtkWidget *
|
2003-11-08 23:32:38 +08:00
|
|
|
gimp_viewable_dialog_new (GimpViewable *viewable,
|
2006-09-01 19:26:54 +08:00
|
|
|
GimpContext *context,
|
2003-11-08 23:32:38 +08:00
|
|
|
const gchar *title,
|
|
|
|
const gchar *role,
|
2014-05-07 21:30:38 +08:00
|
|
|
const gchar *icon_name,
|
2003-11-08 23:32:38 +08:00
|
|
|
const gchar *desc,
|
|
|
|
GtkWidget *parent,
|
|
|
|
GimpHelpFunc help_func,
|
|
|
|
const gchar *help_id,
|
2002-08-31 05:00:42 +08:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
GimpViewableDialog *dialog;
|
|
|
|
va_list args;
|
|
|
|
|
2006-08-30 05:44:51 +08:00
|
|
|
g_return_val_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable), NULL);
|
2006-09-01 19:26:54 +08:00
|
|
|
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
2002-08-31 05:00:42 +08:00
|
|
|
g_return_val_if_fail (title != NULL, NULL);
|
2003-11-08 01:29:02 +08:00
|
|
|
g_return_val_if_fail (role != NULL, NULL);
|
2003-11-08 23:32:38 +08:00
|
|
|
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2006-04-23 10:28:15 +08:00
|
|
|
if (! viewable)
|
2016-12-22 05:50:01 +08:00
|
|
|
g_warning ("Use of GimpViewableDialog with a NULL viewable is deprecated!");
|
2006-04-23 10:28:15 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG,
|
2006-04-23 10:28:15 +08:00
|
|
|
"viewable", viewable,
|
2006-09-01 19:26:54 +08:00
|
|
|
"context", context,
|
2004-05-05 08:01:19 +08:00
|
|
|
"title", title,
|
|
|
|
"role", role,
|
2004-07-09 05:57:05 +08:00
|
|
|
"help-func", help_func,
|
|
|
|
"help-id", help_id,
|
2014-05-07 21:30:38 +08:00
|
|
|
"icon-name", icon_name,
|
2004-05-05 08:01:19 +08:00
|
|
|
"description", desc,
|
|
|
|
"parent", parent,
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
NULL);
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2003-08-24 03:35:05 +08:00
|
|
|
va_start (args, help_id);
|
2003-11-06 23:27:05 +08:00
|
|
|
gimp_dialog_add_buttons_valist (GIMP_DIALOG (dialog), args);
|
2002-08-31 05:00:42 +08:00
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
return GTK_WIDGET (dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
2006-09-01 19:26:54 +08:00
|
|
|
GimpViewable *viewable,
|
|
|
|
GimpContext *context)
|
2002-08-31 05:00:42 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_VIEWABLE_DIALOG (dialog));
|
2006-08-30 05:44:51 +08:00
|
|
|
g_return_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable));
|
2006-09-01 19:26:54 +08:00
|
|
|
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
dialog->context = context;
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2006-01-17 18:08:50 +08:00
|
|
|
if (dialog->view)
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
{
|
2006-04-23 10:15:16 +08:00
|
|
|
GimpViewable *old_viewable = GIMP_VIEW (dialog->view)->viewable;
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
|
|
|
|
if (viewable == old_viewable)
|
2006-09-01 19:26:54 +08:00
|
|
|
{
|
|
|
|
gimp_view_renderer_set_context (GIMP_VIEW (dialog->view)->renderer,
|
|
|
|
context);
|
|
|
|
return;
|
|
|
|
}
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
|
2006-01-17 18:08:50 +08:00
|
|
|
gtk_widget_destroy (dialog->view);
|
2002-09-08 20:18:23 +08:00
|
|
|
|
|
|
|
if (old_viewable)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (old_viewable,
|
2002-09-08 20:18:23 +08:00
|
|
|
gimp_viewable_dialog_name_changed,
|
|
|
|
dialog);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (old_viewable,
|
2002-09-08 20:18:23 +08:00
|
|
|
gimp_viewable_dialog_close,
|
|
|
|
dialog);
|
|
|
|
}
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (viewable)
|
|
|
|
{
|
2008-06-28 23:50:27 +08:00
|
|
|
GtkWidget *box;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (viewable,
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
GIMP_VIEWABLE_GET_CLASS (viewable)->name_changed_signal,
|
|
|
|
G_CALLBACK (gimp_viewable_dialog_name_changed),
|
2003-01-06 06:07:10 +08:00
|
|
|
dialog,
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
0);
|
|
|
|
|
2008-06-28 23:50:27 +08:00
|
|
|
box = gtk_widget_get_parent (dialog->icon);
|
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
dialog->view = gimp_view_new (context, viewable, 32, 1, TRUE);
|
2008-06-28 23:50:27 +08:00
|
|
|
gtk_box_pack_end (GTK_BOX (box), dialog->view, FALSE, FALSE, 2);
|
2006-01-17 18:08:50 +08:00
|
|
|
gtk_widget_show (dialog->view);
|
2002-09-02 21:56:08 +08:00
|
|
|
|
2006-01-17 18:08:50 +08:00
|
|
|
g_object_add_weak_pointer (G_OBJECT (dialog->view),
|
2006-06-20 01:50:40 +08:00
|
|
|
(gpointer) &dialog->view);
|
2002-09-08 20:18:23 +08:00
|
|
|
|
2002-09-02 21:56:08 +08:00
|
|
|
gimp_viewable_dialog_name_changed (GIMP_OBJECT (viewable), dialog);
|
2002-09-08 20:18:23 +08:00
|
|
|
|
|
|
|
if (GIMP_IS_ITEM (viewable))
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (viewable, "removed",
|
2002-09-08 20:18:23 +08:00
|
|
|
G_CALLBACK (gimp_viewable_dialog_close),
|
2003-01-06 06:07:10 +08:00
|
|
|
dialog,
|
2002-09-08 20:18:23 +08:00
|
|
|
G_CONNECT_SWAPPED);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (viewable, "disconnect",
|
2002-09-08 20:18:23 +08:00
|
|
|
G_CALLBACK (gimp_viewable_dialog_close),
|
2003-01-06 06:07:10 +08:00
|
|
|
dialog,
|
2002-09-08 20:18:23 +08:00
|
|
|
G_CONNECT_SWAPPED);
|
|
|
|
}
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
2002-08-31 05:00:42 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_name_changed (GimpObject *object,
|
|
|
|
GimpViewableDialog *dialog)
|
|
|
|
{
|
2003-04-09 00:01:01 +08:00
|
|
|
gchar *name;
|
2002-09-02 21:56:08 +08:00
|
|
|
|
2003-04-09 00:01:01 +08:00
|
|
|
name = gimp_viewable_get_description (GIMP_VIEWABLE (object), NULL);
|
2002-08-31 05:00:42 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
if (GIMP_IS_ITEM (object))
|
2002-08-31 05:00:42 +08:00
|
|
|
{
|
2008-11-13 20:09:05 +08:00
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (object));
|
|
|
|
gchar *tmp;
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2002-09-02 21:56:08 +08:00
|
|
|
tmp = name;
|
|
|
|
name = g_strdup_printf ("%s-%d (%s)",
|
|
|
|
tmp,
|
|
|
|
gimp_item_get_ID (GIMP_ITEM (object)),
|
2008-11-13 20:09:05 +08:00
|
|
|
gimp_image_get_display_name (image));
|
2002-09-02 21:56:08 +08:00
|
|
|
g_free (tmp);
|
2002-08-31 05:00:42 +08:00
|
|
|
}
|
|
|
|
|
2002-09-02 21:56:08 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (dialog->viewable_label), name);
|
|
|
|
g_free (name);
|
2002-08-31 05:00:42 +08:00
|
|
|
}
|
2002-09-08 20:18:23 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_viewable_dialog_close (GimpViewableDialog *dialog)
|
|
|
|
{
|
2003-03-20 23:49:48 +08:00
|
|
|
g_signal_emit_by_name (dialog, "close");
|
2002-09-08 20:18:23 +08:00
|
|
|
}
|