1997-11-25 06:05:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-14 02:53:35 +08:00
|
|
|
|
1999-08-26 06:51:44 +08:00
|
|
|
#include "config.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2003-11-14 04:02:48 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
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
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2003-09-27 18:27:38 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpimage.h"
|
2001-11-28 11:08:03 +08:00
|
|
|
#include "core/gimpimage-projection.h"
|
2003-10-02 01:32:14 +08:00
|
|
|
#include "core/gimpimage-unit.h"
|
2003-10-14 23:20:59 +08:00
|
|
|
#include "core/gimptemplate.h"
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimpunit.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-11-01 05:20:09 +08:00
|
|
|
#include "display/gimpdisplayshell.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
#include "widgets/gimpcolorframe.h"
|
2003-08-26 17:57:28 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
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
|
|
|
#include "widgets/gimpviewabledialog.h"
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "info-dialog.h"
|
|
|
|
#include "info-window.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#define MAX_BUF 256
|
|
|
|
|
|
|
|
typedef struct _InfoWinData InfoWinData;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
struct _InfoWinData
|
|
|
|
{
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp;
|
|
|
|
|
|
|
|
gchar dimensions_str[MAX_BUF];
|
|
|
|
gchar real_dimensions_str[MAX_BUF];
|
|
|
|
gchar scale_str[MAX_BUF];
|
2003-11-14 04:02:48 +08:00
|
|
|
gchar num_layers_str[MAX_BUF];
|
|
|
|
gchar memsize_str[MAX_BUF];
|
2001-10-29 19:47:11 +08:00
|
|
|
gchar color_type_str[MAX_BUF];
|
|
|
|
gchar visual_class_str[MAX_BUF];
|
|
|
|
gchar visual_depth_str[MAX_BUF];
|
|
|
|
gchar resolution_str[MAX_BUF];
|
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
GtkWidget *pixel_labels[2];
|
2001-10-29 19:47:11 +08:00
|
|
|
GtkWidget *unit_labels[2];
|
2003-10-16 01:59:40 +08:00
|
|
|
|
|
|
|
GtkWidget *frame1;
|
|
|
|
GtkWidget *frame2;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
|
|
|
gboolean showing_extended;
|
1997-11-25 06:05:25 +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
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* The different classes of visuals */
|
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 const gchar *visual_classes[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-11-23 22:47:09 +08:00
|
|
|
N_("Static Gray"),
|
|
|
|
N_("Grayscale"),
|
|
|
|
N_("Static Color"),
|
|
|
|
N_("Pseudo Color"),
|
|
|
|
N_("True Color"),
|
|
|
|
N_("Direct Color"),
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
1999-10-31 01:49:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2003-11-06 23:27:05 +08:00
|
|
|
info_window_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
|
|
|
InfoDialog *info_win)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-11-06 23:27:05 +08:00
|
|
|
info_dialog_popdown (info_win);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-08-13 06:21:04 +08:00
|
|
|
static void
|
2003-08-26 17:57:28 +08:00
|
|
|
info_window_page_switch (GtkWidget *widget,
|
|
|
|
GtkNotebookPage *page,
|
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
|
|
|
gint page_num,
|
|
|
|
InfoDialog *info_win)
|
1999-08-13 06:21:04 +08:00
|
|
|
{
|
|
|
|
InfoWinData *iwd;
|
2001-06-18 21:10:03 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
iwd = (InfoWinData *) info_win->user_data;
|
1999-08-13 06:21:04 +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
|
|
|
iwd->showing_extended = (page_num == 1);
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
|
|
|
|
/* displays information:
|
|
|
|
* cursor pos
|
|
|
|
* cursor pos in real units
|
|
|
|
* color under cursor
|
|
|
|
* Can't we find a better place for this than in the image window? (Ralf)
|
|
|
|
*/
|
|
|
|
|
1999-08-13 06:21:04 +08:00
|
|
|
static void
|
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
|
|
|
info_window_create_extended (InfoDialog *info_win,
|
|
|
|
Gimp *gimp)
|
1999-08-13 06:21:04 +08:00
|
|
|
{
|
2001-01-23 04:46:50 +08:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *table;
|
2002-09-02 21:53:04 +08:00
|
|
|
GtkWidget *vbox;
|
1999-08-13 06:21:04 +08:00
|
|
|
InfoWinData *iwd;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
iwd = (InfoWinData *) info_win->user_data;
|
1999-08-13 06:21:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (info_win->info_notebook),
|
|
|
|
vbox, gtk_label_new (_("Extended")));
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
|
|
|
|
/* cursor information */
|
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
hbox = gtk_hbox_new (TRUE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Pixels"));
|
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
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
2001-06-15 00:23:40 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
2001-06-15 00:23:40 +08:00
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
2001-06-15 00:23:40 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2003-10-17 00:55:16 +08:00
|
|
|
iwd->pixel_labels[0] = gtk_label_new (_("n/a"));
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (iwd->pixel_labels[0]), 0.0, 0.5);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("X:"), 1.0, 0.5,
|
|
|
|
iwd->pixel_labels[0], 1, FALSE);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
2003-10-17 00:55:16 +08:00
|
|
|
iwd->pixel_labels[1] = gtk_label_new (_("n/a"));
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (iwd->pixel_labels[1]), 0.0, 0.5);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Y:"), 1.0, 0.5,
|
|
|
|
iwd->pixel_labels[1], 1, FALSE);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
frame = gtk_frame_new (_("Units"));
|
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
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
2000-02-12 22:38:15 +08:00
|
|
|
gtk_widget_show (frame);
|
1999-08-13 06:21:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
2003-07-19 06:00:36 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2003-10-17 00:55:16 +08:00
|
|
|
iwd->unit_labels[0] = gtk_label_new (_("n/a"));
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (iwd->unit_labels[0]), 0.0, 0.5);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("X:"), 1.0, 0.5,
|
|
|
|
iwd->unit_labels[0], 1, FALSE);
|
2003-07-19 06:00:36 +08:00
|
|
|
|
2003-10-17 00:55:16 +08:00
|
|
|
iwd->unit_labels[1] = gtk_label_new (_("n/a"));
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (iwd->unit_labels[1]), 0.0, 0.5);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Y:"), 1.0, 0.5,
|
|
|
|
iwd->unit_labels[1], 1, FALSE);
|
2003-07-19 06:00:36 +08:00
|
|
|
|
2002-09-02 21:53:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
/* color information */
|
2002-09-02 21:53:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
hbox = gtk_hbox_new (TRUE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2002-09-02 21:53:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
iwd->frame1 = gimp_color_frame_new ();
|
|
|
|
gimp_color_frame_set_mode (GIMP_COLOR_FRAME (iwd->frame1),
|
|
|
|
GIMP_COLOR_FRAME_MODE_PIXEL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), iwd->frame1, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (iwd->frame1);
|
2002-09-02 21:53:04 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
iwd->frame2 = gimp_color_frame_new ();
|
|
|
|
gimp_color_frame_set_mode (GIMP_COLOR_FRAME (iwd->frame2),
|
|
|
|
GIMP_COLOR_FRAME_MODE_RGB);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), iwd->frame2, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (iwd->frame2);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
1999-08-13 06:21:04 +08:00
|
|
|
|
|
|
|
/* Set back to first page */
|
2001-08-01 08:35:59 +08:00
|
|
|
gtk_notebook_set_current_page (GTK_NOTEBOOK (info_win->info_notebook), 0);
|
1999-08-13 06:21:04 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (info_win->info_notebook, "switch_page",
|
2001-08-15 00:33:28 +08:00
|
|
|
G_CALLBACK (info_window_page_switch),
|
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
|
|
|
info_win);
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
InfoDialog *
|
2001-10-29 19:47:11 +08:00
|
|
|
info_window_create (GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-23 04:46:50 +08:00
|
|
|
InfoDialog *info_win;
|
1997-11-25 06:05:25 +08:00
|
|
|
InfoWinData *iwd;
|
2001-01-23 04:46:50 +08:00
|
|
|
gint type;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
type = gimp_image_base_type (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-08-31 05:00:42 +08:00
|
|
|
info_win = info_dialog_notebook_new (GIMP_VIEWABLE (gdisp->gimage),
|
2003-11-08 01:29:02 +08:00
|
|
|
_("Info Window"), "gimp-info-window",
|
2002-08-31 05:00:42 +08:00
|
|
|
GIMP_STOCK_INFO,
|
|
|
|
_("Image Information"),
|
2003-11-08 23:29:47 +08:00
|
|
|
gdisp->shell,
|
1999-09-28 01:58:10 +08:00
|
|
|
gimp_standard_help_func,
|
2003-08-26 17:57:28 +08:00
|
|
|
GIMP_HELP_INFO_DIALOG);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
gtk_dialog_add_button (GTK_DIALOG (info_win->shell),
|
|
|
|
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_signal_connect (info_win->shell, "response",
|
|
|
|
G_CALLBACK (info_window_response),
|
|
|
|
info_win);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
iwd = g_new0 (InfoWinData, 1);
|
|
|
|
iwd->gdisp = gdisp;
|
1997-11-25 06:05:25 +08:00
|
|
|
info_win->user_data = iwd;
|
2000-02-08 04:03:03 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* add the information fields */
|
2003-11-14 04:02:48 +08:00
|
|
|
info_dialog_add_label (info_win, _("Pixel Dimensions:"),
|
1999-04-03 03:46:59 +08:00
|
|
|
iwd->dimensions_str);
|
2003-11-14 04:02:48 +08:00
|
|
|
info_dialog_add_label (info_win, _("Print Size:"),
|
2000-02-08 04:03:03 +08:00
|
|
|
iwd->real_dimensions_str);
|
1999-04-03 03:46:59 +08:00
|
|
|
info_dialog_add_label (info_win, _("Resolution:"),
|
|
|
|
iwd->resolution_str);
|
|
|
|
info_dialog_add_label (info_win, _("Scale Ratio:"),
|
|
|
|
iwd->scale_str);
|
2003-11-14 04:02:48 +08:00
|
|
|
info_dialog_add_label (info_win, _("Number of Layers:"),
|
|
|
|
iwd->num_layers_str);
|
|
|
|
info_dialog_add_label (info_win, _("Size in Memory:"),
|
|
|
|
iwd->memsize_str);
|
1999-04-03 03:46:59 +08:00
|
|
|
info_dialog_add_label (info_win, _("Display Type:"),
|
|
|
|
iwd->color_type_str);
|
|
|
|
info_dialog_add_label (info_win, _("Visual Class:"),
|
|
|
|
iwd->visual_class_str);
|
|
|
|
info_dialog_add_label (info_win, _("Visual Depth:"),
|
|
|
|
iwd->visual_depth_str);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-31 01:49:50 +08:00
|
|
|
/* Add extra tabs */
|
2001-10-29 19:47:11 +08:00
|
|
|
info_window_create_extended (info_win, gdisp->gimage->gimp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
/* update the fields */
|
|
|
|
info_window_update (gdisp);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return info_win;
|
|
|
|
}
|
|
|
|
|
1999-11-30 08:11:08 +08:00
|
|
|
static InfoDialog *info_window_auto = NULL;
|
|
|
|
|
|
|
|
static void
|
2001-06-18 21:10:03 +08:00
|
|
|
info_window_change_display (GimpContext *context,
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *newdisp,
|
2001-06-18 21:10:03 +08:00
|
|
|
gpointer data)
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp = newdisp;
|
|
|
|
GimpDisplay *old_gdisp;
|
2001-01-23 04:46:50 +08:00
|
|
|
GimpImage *gimage;
|
1999-11-30 08:11:08 +08:00
|
|
|
InfoWinData *iwd;
|
|
|
|
|
|
|
|
iwd = (InfoWinData *) info_window_auto->user_data;
|
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
old_gdisp = (GimpDisplay *) iwd->gdisp;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
|
|
|
if (!info_window_auto || gdisp == old_gdisp || !gdisp)
|
2001-01-23 04:46:50 +08:00
|
|
|
return;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if (gimage && gimp_container_have (context->gimp->images,
|
|
|
|
GIMP_OBJECT (gimage)))
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
|
|
|
iwd->gdisp = gdisp;
|
2001-01-23 04:46:50 +08:00
|
|
|
info_window_update (gdisp);
|
1999-11-30 08:11:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-29 19:47:11 +08:00
|
|
|
info_window_follow_auto (Gimp *gimp)
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
2001-06-18 21:10:03 +08:00
|
|
|
GimpContext *context;
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
context = gimp_get_user_context (gimp);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
|
|
|
gdisp = gimp_context_get_display (context);
|
|
|
|
|
|
|
|
if (! gdisp)
|
1999-11-30 08:11:08 +08:00
|
|
|
return;
|
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_window_auto)
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
2001-06-18 21:10:03 +08:00
|
|
|
info_window_auto = info_window_create (gdisp);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (context, "display_changed",
|
2003-08-26 17:57:28 +08:00
|
|
|
G_CALLBACK (info_window_change_display),
|
2001-07-25 08:42:47 +08:00
|
|
|
NULL);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
|
|
|
info_window_update (gdisp);
|
1999-11-30 08:11:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
info_dialog_popup (info_window_auto);
|
|
|
|
}
|
|
|
|
|
2003-08-26 17:57:28 +08:00
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
/* Updates all extended information. */
|
|
|
|
|
2003-08-26 17:57:28 +08:00
|
|
|
void
|
2001-10-29 19:47:11 +08:00
|
|
|
info_window_update_extended (GimpDisplay *gdisp,
|
|
|
|
gdouble tx,
|
|
|
|
gdouble ty)
|
1999-08-13 06:21:04 +08:00
|
|
|
{
|
2003-10-16 01:59:40 +08:00
|
|
|
InfoDialog *info_win;
|
|
|
|
InfoWinData *iwd;
|
|
|
|
guchar *color;
|
2003-08-26 17:57:28 +08:00
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
info_win = GIMP_DISPLAY_SHELL (gdisp->shell)->info_dialog;
|
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win && info_window_auto != NULL)
|
2001-01-23 04:46:50 +08:00
|
|
|
info_win = info_window_auto;
|
1999-08-13 06:21:04 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win)
|
1999-08-13 06:21:04 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
iwd = (InfoWinData *) info_win->user_data;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2001-01-23 04:46:50 +08:00
|
|
|
if (iwd->gdisp != gdisp)
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
2003-10-16 01:59:40 +08:00
|
|
|
iwd->gdisp = gdisp;
|
|
|
|
|
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_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (info_window_auto->shell),
|
|
|
|
GIMP_VIEWABLE (gdisp->gimage));
|
2001-01-23 04:46:50 +08:00
|
|
|
|
|
|
|
info_window_update (gdisp);
|
1999-11-30 08:11:08 +08:00
|
|
|
}
|
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! iwd || ! iwd->showing_extended)
|
1999-08-13 06:21:04 +08:00
|
|
|
return;
|
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
/* fill in position information */
|
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (tx < 0.0 && ty < 0.0)
|
2001-06-15 00:23:40 +08:00
|
|
|
{
|
2003-10-17 00:55:16 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->pixel_labels[0]), _("n/a"));
|
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->pixel_labels[1]), _("n/a"));
|
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->unit_labels[0]), _("n/a"));
|
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->unit_labels[1]), _("n/a"));
|
2001-06-15 00:23:40 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-10-16 01:59:40 +08:00
|
|
|
gdouble unit_factor;
|
|
|
|
gint unit_digits;
|
|
|
|
const gchar *unit_str;
|
|
|
|
gchar format_buf[32];
|
|
|
|
gchar buf[32];
|
|
|
|
|
2003-10-02 01:32:14 +08:00
|
|
|
unit_factor = gimp_image_unit_get_factor (gdisp->gimage);
|
|
|
|
unit_digits = gimp_image_unit_get_digits (gdisp->gimage);
|
2003-10-16 01:59:40 +08:00
|
|
|
unit_str = gimp_image_unit_get_abbreviation (gdisp->gimage);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
g_snprintf (buf, sizeof (buf), "%d", (gint) tx);
|
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->pixel_labels[0]), buf);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
g_snprintf (buf, sizeof (buf), "%d", (gint) ty);
|
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->pixel_labels[1]), buf);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
|
|
|
g_snprintf (format_buf, sizeof (format_buf),
|
2003-10-16 01:59:40 +08:00
|
|
|
"%%.%df %s", unit_digits, unit_str);
|
2003-08-26 17:57:28 +08:00
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
g_snprintf (buf, sizeof (buf), format_buf,
|
|
|
|
tx * unit_factor / gdisp->gimage->xresolution);
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->unit_labels[0]), buf);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), format_buf,
|
|
|
|
ty * unit_factor / gdisp->gimage->yresolution);
|
2003-10-16 01:59:40 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (iwd->unit_labels[1]), buf);
|
2003-08-26 17:57:28 +08:00
|
|
|
|
2001-06-15 00:23:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* fill in color information */
|
2003-10-16 01:59:40 +08:00
|
|
|
color = gimp_image_projection_get_color_at (gdisp->gimage, tx, ty);
|
|
|
|
|
|
|
|
if (! color || (tx < 0.0 && ty < 0.0))
|
1999-08-13 06:21:04 +08:00
|
|
|
{
|
2003-10-16 01:59:40 +08:00
|
|
|
gimp_color_frame_set_invalid (GIMP_COLOR_FRAME (iwd->frame1));
|
|
|
|
gimp_color_frame_set_invalid (GIMP_COLOR_FRAME (iwd->frame2));
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
2001-06-15 00:23:40 +08:00
|
|
|
else
|
2000-02-12 22:38:15 +08:00
|
|
|
{
|
2003-10-16 01:59:40 +08:00
|
|
|
GimpImageType sample_type;
|
|
|
|
GimpRGB rgb;
|
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
|
|
|
|
2001-11-28 11:08:03 +08:00
|
|
|
sample_type = gimp_image_projection_type (gdisp->gimage);
|
2001-06-15 00:23:40 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
gimp_rgba_set_uchar (&rgb,
|
|
|
|
color[RED_PIX],
|
|
|
|
color[GREEN_PIX],
|
|
|
|
color[BLUE_PIX],
|
|
|
|
color[ALPHA_PIX]);
|
2003-07-19 06:00:36 +08:00
|
|
|
|
2003-10-16 01:59:40 +08:00
|
|
|
gimp_color_frame_set_color (GIMP_COLOR_FRAME (iwd->frame1),
|
|
|
|
sample_type, &rgb, -1);
|
|
|
|
gimp_color_frame_set_color (GIMP_COLOR_FRAME (iwd->frame2),
|
|
|
|
sample_type, &rgb, -1);
|
2003-07-19 06:00:36 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
g_free (color);
|
2000-02-12 22:38:15 +08:00
|
|
|
}
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
info_window_free (InfoDialog *info_win)
|
|
|
|
{
|
1999-10-31 01:49:50 +08:00
|
|
|
InfoWinData *iwd;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win && info_window_auto)
|
1999-11-30 08:11:08 +08:00
|
|
|
{
|
2000-02-12 22:38:15 +08:00
|
|
|
gtk_widget_set_sensitive (info_window_auto->vbox, FALSE);
|
1999-11-30 08:11:08 +08:00
|
|
|
return;
|
|
|
|
}
|
1999-10-31 01:49:50 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win)
|
1999-12-01 05:33:12 +08:00
|
|
|
return;
|
|
|
|
|
1999-10-31 01:49:50 +08:00
|
|
|
iwd = (InfoWinData *) info_win->user_data;
|
|
|
|
|
|
|
|
g_free (iwd);
|
1997-11-25 06:05:25 +08:00
|
|
|
info_dialog_free (info_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-29 19:47:11 +08:00
|
|
|
info_window_update (GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-06-27 06:16:59 +08:00
|
|
|
GimpDisplayShell *shell;
|
2003-09-27 20:59:22 +08:00
|
|
|
GimpImage *gimage;
|
2002-06-27 06:16:59 +08:00
|
|
|
InfoWinData *iwd;
|
|
|
|
gint type;
|
|
|
|
gdouble unit_factor;
|
|
|
|
gint unit_digits;
|
2003-09-27 18:27:38 +08:00
|
|
|
GimpUnit res_unit;
|
|
|
|
gdouble res_unit_factor;
|
2002-06-27 06:16:59 +08:00
|
|
|
gchar format_buf[32];
|
|
|
|
InfoDialog *info_win;
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2002-06-27 06:16:59 +08:00
|
|
|
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
|
|
|
|
|
|
|
info_win = shell->info_dialog;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win && info_window_auto != NULL)
|
2000-02-12 22:38:15 +08:00
|
|
|
info_win = info_window_auto;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
if (! info_win)
|
1999-11-30 08:11:08 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
iwd = (InfoWinData *) info_win->user_data;
|
1999-11-30 08:11:08 +08:00
|
|
|
|
2000-02-12 22:38:15 +08:00
|
|
|
if (info_window_auto)
|
|
|
|
gtk_widget_set_sensitive (info_window_auto->vbox, TRUE);
|
1999-11-30 08:11:08 +08:00
|
|
|
|
|
|
|
/* If doing info_window_auto then return if this display
|
|
|
|
* is not the one we are showing.
|
|
|
|
*/
|
2000-02-08 04:03:03 +08:00
|
|
|
if (info_window_auto && iwd->gdisp != gdisp)
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-09-27 20:59:22 +08:00
|
|
|
gimage = gdisp->gimage;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* width and height */
|
2003-10-02 01:32:14 +08:00
|
|
|
unit_factor = gimp_image_unit_get_factor (gimage);
|
|
|
|
unit_digits = gimp_image_unit_get_digits (gimage);
|
2003-09-27 20:59:22 +08:00
|
|
|
|
|
|
|
g_snprintf (iwd->dimensions_str, MAX_BUF, _("%d x %d pixels"),
|
2003-10-02 01:32:14 +08:00
|
|
|
gimage->width, gimage->height);
|
2003-09-27 20:59:22 +08:00
|
|
|
g_snprintf (format_buf, sizeof (format_buf), "%%.%df x %%.%df %s",
|
1999-04-03 03:46:59 +08:00
|
|
|
unit_digits + 1, unit_digits + 1,
|
2003-10-02 01:32:14 +08:00
|
|
|
gimp_image_unit_get_plural (gimage));
|
2000-02-08 04:03:03 +08:00
|
|
|
g_snprintf (iwd->real_dimensions_str, MAX_BUF, format_buf,
|
2003-09-27 20:59:22 +08:00
|
|
|
gimage->width * unit_factor / gimage->xresolution,
|
|
|
|
gimage->height * unit_factor / gimage->yresolution);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-10-05 18:05:29 +08:00
|
|
|
/* image resolution */
|
2003-10-14 23:20:59 +08:00
|
|
|
res_unit = gimage->gimp->config->default_image->resolution_unit;
|
2003-09-27 20:59:22 +08:00
|
|
|
res_unit_factor = _gimp_unit_get_factor (gimage->gimp, res_unit);
|
2003-09-27 18:27:38 +08:00
|
|
|
|
|
|
|
g_snprintf (format_buf, sizeof (format_buf), _("pixels/%s"),
|
2003-09-27 20:59:22 +08:00
|
|
|
_gimp_unit_get_abbreviation (gimage->gimp, res_unit));
|
2003-09-27 18:27:38 +08:00
|
|
|
g_snprintf (iwd->resolution_str, MAX_BUF, _("%g x %g %s"),
|
2003-09-27 20:59:22 +08:00
|
|
|
gimage->xresolution / res_unit_factor,
|
|
|
|
gimage->yresolution / res_unit_factor,
|
2003-09-27 18:27:38 +08:00
|
|
|
res_unit == GIMP_UNIT_INCH ? _("dpi") : format_buf);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
1998-12-06 05:48:37 +08:00
|
|
|
/* user zoom ratio */
|
1998-12-26 02:22:01 +08:00
|
|
|
g_snprintf (iwd->scale_str, MAX_BUF, "%d:%d",
|
2003-09-27 20:59:22 +08:00
|
|
|
SCALEDEST (shell), SCALESRC (shell));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-14 04:02:48 +08:00
|
|
|
/* number of layers */
|
|
|
|
g_snprintf (iwd->num_layers_str, MAX_BUF, "%d",
|
|
|
|
gimp_container_num_children (gimage->layers));
|
|
|
|
|
|
|
|
/* size in memory */
|
|
|
|
{
|
2003-11-17 01:51:36 +08:00
|
|
|
GimpObject *object = GIMP_OBJECT (gimage);
|
|
|
|
gchar *str;
|
2003-11-14 04:02:48 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
str = gimp_memsize_to_string (gimp_object_get_memsize (object, NULL));
|
2003-11-14 04:02:48 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
g_snprintf (iwd->memsize_str, MAX_BUF, "%s", str);
|
2003-11-14 04:02:48 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
g_free (str);
|
2003-11-14 04:02:48 +08:00
|
|
|
}
|
|
|
|
|
2003-09-27 20:59:22 +08:00
|
|
|
type = gimp_image_base_type (gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* color type */
|
2001-12-11 23:58:07 +08:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
|
|
|
g_snprintf (iwd->color_type_str, MAX_BUF, "%s", _("RGB Color"));
|
|
|
|
break;
|
|
|
|
case GIMP_GRAY:
|
|
|
|
g_snprintf (iwd->color_type_str, MAX_BUF, "%s", _("Grayscale"));
|
|
|
|
break;
|
|
|
|
case GIMP_INDEXED:
|
2003-08-26 17:57:28 +08:00
|
|
|
g_snprintf (iwd->color_type_str, MAX_BUF, "%s (%d %s)",
|
2003-09-27 20:59:22 +08:00
|
|
|
_("Indexed Color"), gimage->num_cols, _("colors"));
|
2001-12-11 23:58:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-12-01 00:39:40 +08:00
|
|
|
{
|
2003-11-02 04:06:01 +08:00
|
|
|
GdkScreen *screen;
|
|
|
|
GdkVisual *visual;
|
2003-11-14 04:02:48 +08:00
|
|
|
|
2003-11-02 04:06:01 +08:00
|
|
|
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
|
|
|
|
visual = gdk_screen_get_rgb_visual (screen);
|
2001-12-01 00:39:40 +08:00
|
|
|
|
2001-12-11 23:58:07 +08:00
|
|
|
/* visual class */
|
|
|
|
g_snprintf (iwd->visual_class_str, MAX_BUF, "%s",
|
|
|
|
gettext (visual_classes[visual->type]));
|
2003-08-26 17:57:28 +08:00
|
|
|
|
2001-12-01 00:39:40 +08:00
|
|
|
/* visual depth */
|
|
|
|
g_snprintf (iwd->visual_depth_str, MAX_BUF, "%d", visual->depth);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
info_dialog_update (info_win);
|
|
|
|
}
|