Commit ec6c9865 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

bumped the version number to 1.3.12.

2003-01-03  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped the version number to 1.3.12.

	* app/display/Makefile.am
	* app/display/gimpdisplayshell-cursor.[ch]
	* app/display/gimpdisplayshell-title.[ch]
	* app/display/gimpdisplayshell-transform.[ch]: new files with code
	that used to live in gimpdisplayshell.c.

	* app/display/gimpdisplay-foreach.c
	* app/display/gimpdisplay.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-selection.c
	* app/display/gimpdisplayshell.[ch]
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimptool.c: changed accordingly.
parent 28bd9bf7
2003-01-03 Sven Neumann <sven@gimp.org>
* configure.in: bumped the version number to 1.3.12.
* app/display/Makefile.am
* app/display/gimpdisplayshell-cursor.[ch]
* app/display/gimpdisplayshell-title.[ch]
* app/display/gimpdisplayshell-transform.[ch]: new files with code
that used to live in gimpdisplayshell.c.
* app/display/gimpdisplay-foreach.c
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-handlers.c
* app/display/gimpdisplayshell-selection.c
* app/display/gimpdisplayshell.[ch]
* app/tools/gimpbezierselecttool.c
* app/tools/gimpcroptool.c
* app/tools/gimpdrawtool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimpmovetool.c
* app/tools/gimptool.c: changed accordingly.
2003-01-03 Michael Natterer <mitch@gimp.org>
* app/tools/tool_manager.c (tool_manager_image_undo_start): don't
......
......@@ -41,6 +41,7 @@
#include "gimpdisplay-handlers.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-handlers.h"
#include "gimpdisplayshell-transform.h"
#include "libgimp/gimpintl.h"
......
......@@ -28,6 +28,8 @@ libappdisplay_a_sources = \
gimpdisplayshell.h \
gimpdisplayshell-callbacks.c \
gimpdisplayshell-callbacks.h \
gimpdisplayshell-cursor.c \
gimpdisplayshell-cursor.h \
gimpdisplayshell-dnd.c \
gimpdisplayshell-dnd.h \
gimpdisplayshell-handlers.c \
......@@ -47,6 +49,10 @@ libappdisplay_a_sources = \
gimpdisplayshell-scroll.h \
gimpdisplayshell-selection.c \
gimpdisplayshell-selection.h \
gimpdisplayshell-title.c \
gimpdisplayshell-title.h \
gimpdisplayshell-transform.c \
gimpdisplayshell-transform.h \
gimpnavigationview.c \
gimpnavigationview.h \
gimpprogress.c \
......
......@@ -29,6 +29,7 @@
#include "gimpdisplay.h"
#include "gimpdisplay-foreach.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-cursor.h"
gboolean
......
......@@ -41,6 +41,7 @@
#include "gimpdisplay-handlers.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-handlers.h"
#include "gimpdisplayshell-transform.h"
#include "libgimp/gimpintl.h"
......
......@@ -54,11 +54,14 @@
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-callbacks.h"
#include "gimpdisplayshell-cursor.h"
#include "gimpdisplayshell-layer-select.h"
#include "gimpdisplayshell-render.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-scroll.h"
#include "gimpdisplayshell-selection.h"
#include "gimpdisplayshell-title.h"
#include "gimpdisplayshell-transform.h"
#include "gimpnavigationview.h"
#include "gimpstatusbar.h"
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "display-types.h"
#ifdef __GNUC__
#warning FIXME #include "gui/gui-types.h"
#endif
#include "gui/gui-types.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "gui/info-window.h"
#include "widgets/gimpcursor.h"
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-cursor.h"
#include "gimpdisplayshell-transform.h"
#include "gimpstatusbar.h"
static void gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void
gimp_display_shell_set_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (! shell->using_override_cursor)
{
gimp_display_shell_real_set_cursor (shell,
cursor_type,
tool_cursor,
modifier,
FALSE);
}
}
void
gimp_display_shell_set_override_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type)
{
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (! shell->using_override_cursor ||
(shell->using_override_cursor &&
shell->override_cursor != cursor_type))
{
GdkCursor *cursor;
shell->override_cursor = cursor_type;
shell->using_override_cursor = TRUE;
cursor = gimp_cursor_new (cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (shell->canvas->window, cursor);
gdk_cursor_unref (cursor);
}
}
void
gimp_display_shell_unset_override_cursor (GimpDisplayShell *shell)
{
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (shell->using_override_cursor)
{
shell->using_override_cursor = FALSE;
gimp_display_shell_real_set_cursor (shell,
shell->current_cursor,
shell->tool_cursor,
shell->cursor_modifier,
TRUE);
}
}
void
gimp_display_shell_update_cursor (GimpDisplayShell *shell,
gint x,
gint y)
{
GimpImage *gimage;
gboolean new_cursor;
gboolean flush = FALSE;
gint t_x = -1;
gint t_y = -1;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
gimage = shell->gdisp->gimage;
new_cursor = (shell->draw_cursor &&
shell->proximity &&
x > 0 &&
y > 0);
/* Erase old cursor, if necessary */
if (shell->have_cursor && (! new_cursor ||
x != shell->cursor_x ||
y != shell->cursor_y))
{
gimp_display_shell_add_expose_area (shell,
shell->cursor_x - 7,
shell->cursor_y - 7,
15, 15);
if (! new_cursor)
{
shell->have_cursor = FALSE;
flush = TRUE;
}
}
shell->have_cursor = new_cursor;
shell->cursor_x = x;
shell->cursor_y = y;
if (new_cursor || flush)
{
gimp_display_shell_flush (shell);
}
if (x > 0 && y > 0)
{
gimp_display_shell_untransform_xy (shell, x, y, &t_x, &t_y, FALSE, FALSE);
}
gimp_statusbar_update_cursor (GIMP_STATUSBAR (shell->statusbar), t_x, t_y);
if (t_x < 0 ||
t_y < 0 ||
t_x >= gimage->width ||
t_y >= gimage->height)
{
info_window_update_extended (shell->gdisp, -1, -1);
}
else
{
info_window_update_extended (shell->gdisp, t_x, t_y);
}
}
static void
gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install)
{
GimpDisplayConfig *config;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
if (cursor_type != GIMP_BAD_CURSOR)
{
switch (config->cursor_mode)
{
case GIMP_CURSOR_MODE_TOOL_ICON:
break;
case GIMP_CURSOR_MODE_TOOL_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_SMALL_CURSOR;
break;
case GIMP_CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
}
}
if (shell->current_cursor != cursor_type ||
shell->tool_cursor != tool_cursor ||
shell->cursor_modifier != modifier ||
always_install)
{
GdkCursor *cursor;
shell->current_cursor = cursor_type;
shell->tool_cursor = tool_cursor;
shell->cursor_modifier = modifier;
cursor = gimp_cursor_new (cursor_type,
tool_cursor,
modifier);
gdk_window_set_cursor (shell->canvas->window, cursor);
gdk_cursor_unref (cursor);
}
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_DISPLAY_SHELL_CURSOR_H__
#define __GIMP_DISPLAY_SHELL_CURSOR_H__
void gimp_display_shell_set_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gimp_display_shell_set_override_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type);
void gimp_display_shell_unset_override_cursor (GimpDisplayShell *shell);
void gimp_display_shell_update_cursor (GimpDisplayShell *shell,
gint x,
gint y);
#endif /* __GIMP_DISPLAY_SHELL_CURSOR_H__ */
This diff is collapsed.
......@@ -29,16 +29,16 @@
/* some useful macros */
/* unpacking the user scale level (char) */
#define SCALESRC(s) (s->scale & 0x00ff)
#define SCALEDEST(s) (s->scale >> 8)
/* finding the effective screen resolution (double) */
#define SCREEN_XRES(s) (s->dot_for_dot ? \
s->gdisp->gimage->xresolution : s->monitor_xres)
#define SCREEN_YRES(s) (s->dot_for_dot ? \
s->gdisp->gimage->yresolution : s->monitor_yres)
/* unpacking the user scale level (char) */
#define SCALESRC(s) (s->scale & 0x00ff)
#define SCALEDEST(s) (s->scale >> 8)
/* calculate scale factors (double) */
#define SCALEFACTOR_X(s) ((SCALEDEST(s) * SCREEN_XRES(s)) / \
(SCALESRC(s) * s->gdisp->gimage->xresolution))
......@@ -173,40 +173,6 @@ void gimp_display_shell_reconnect (GimpDisplayShell *shell);
void gimp_display_shell_scaled (GimpDisplayShell *shell);
void gimp_display_shell_scrolled (GimpDisplayShell *shell);
void gimp_display_shell_transform_coords (GimpDisplayShell *shell,
GimpCoords *image_coords,
GimpCoords *display_coords);
void gimp_display_shell_untransform_coords (GimpDisplayShell *shell,
GimpCoords *display_coords,
GimpCoords *image_coords);
void gimp_display_shell_transform_xy (GimpDisplayShell *shell,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gimp_display_shell_untransform_xy (GimpDisplayShell *shell,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gimp_display_shell_transform_xy_f (GimpDisplayShell *shell,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell,
Gimp *gimp,
gboolean popup_only);
......@@ -246,19 +212,6 @@ void gimp_display_shell_expose_guide (GimpDisplayShell *shell,
void gimp_display_shell_expose_full (GimpDisplayShell *shell);
void gimp_display_shell_flush (GimpDisplayShell *shell);
void gimp_display_shell_set_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gimp_display_shell_set_override_cursor (GimpDisplayShell *shell,
GdkCursorType cursor_type);
void gimp_display_shell_unset_override_cursor (GimpDisplayShell *shell);
void gimp_display_shell_update_cursor (GimpDisplayShell *shell,
gint x,
gint y);
void gimp_display_shell_update_title (GimpDisplayShell *shell);
void gimp_display_shell_update_icon (GimpDisplayShell *shell);
void gimp_display_shell_set_padding (GimpDisplayShell *shell,
......
......@@ -35,6 +35,7 @@
#include "gimpdisplayshell-handlers.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-selection.h"
#include "gimpdisplayshell-title.h"
#include "gimpstatusbar.h"
......
......@@ -34,6 +34,7 @@
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-marching-ants.h"
#include "gimpdisplayshell-selection.h"
#include "gimpdisplayshell-transform.h"
#undef VERBOSE
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "display-types.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "file/file-utils.h"
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-title.h"
#include "gimpstatusbar.h"
#include "libgimp/gimpintl.h"
#define MAX_TITLE_BUF 256
static void gimp_display_shell_format_title (GimpDisplayShell *gdisp,
gchar *title,
gint title_len,
const gchar *format);
void
gimp_display_shell_update_title (GimpDisplayShell *shell)
{
GimpDisplayConfig *config;
gchar title[MAX_TITLE_BUF];
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
/* format the title */
gimp_display_shell_format_title (shell, title, sizeof (title),
config->image_title_format);
gdk_window_set_title (GTK_WIDGET (shell)->window, title);
/* format the statusbar */
if (strcmp (config->image_title_format, config->image_status_format))
{
gimp_display_shell_format_title (shell, title, sizeof (title),
config->image_status_format);
}
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "title");
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "title", title);
}
static gint print (gchar *buf,
gint len,
gint start,
const gchar *fmt,
...) G_GNUC_PRINTF (4, 5);
static gint
print (gchar *buf,
gint len,
gint start,
const gchar *fmt,
...)
{
va_list args;
gint printed;
va_start (args, fmt);
printed = g_vsnprintf (buf + start, len - start, fmt, args);
if (printed < 0)
printed = len - start;
va_end (args);
return printed;
}
static void
gimp_display_shell_format_title (GimpDisplayShell *shell,
gchar *title,
gint title_len,
const gchar *format)
{
GimpImage *gimage;
gchar *image_type_str = NULL;
gboolean empty;
gint i;
gchar unit_format[8];
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
gimage = shell->gdisp->gimage;
empty = gimp_image_is_empty (gimage);
switch (gimp_image_base_type (gimage))
{
case GIMP_RGB:
image_type_str = empty ? _("RGB-empty") : _("RGB");
break;
case GIMP_GRAY:
image_type_str = empty ? _("grayscale-empty") : _("grayscale");
break;
case GIMP_INDEXED:
image_type_str = empty ? _("indexed-empty") : _("indexed");
break;
default:
g_assert_not_reached ();
break;
}
i = 0;
while (i < title_len && *format)
{
switch (*format)
{
case '%':
format++;
switch (*format)
{
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
{
gchar *basename;
basename = file_utils_uri_to_utf8_basename (gimp_image_get_uri (gimage));
i += print (title, title_len, i, "%s", basename);
g_free (basename);
}
break;
case 'F': /* full filename */
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (gimp_image_get_uri (gimage));
i += print (title, title_len, i, "%s", filename);
g_free (filename);
}
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", gimp_image_get_ID (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", shell->gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (shell));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (shell));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i, "%d",
100 * SCALEDEST (shell) / SCALESRC (shell));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning ("image-title-format string ended within "
"%%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
format++;
break;
case 'C': /* clean flag */
if (format[1] == 0)
{
g_warning ("image-title-format string ended within "
"%%C-sequence");
break;
}
if (! gimage->dirty)
title[i++] = format[1];
format++;
break;
case 'm': /* memory used by image */
{
gsize memsize;
gchar *size_str;
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage));
size_str = gimp_image_new_get_memsize_string (memsize);
i += print (title, title_len, i, "%s", size_str);
g_free (size_str);
}
break;
case 'l': /* number of layers */
i += print (title, title_len, i, "%d",
gimp_container_num_children (gimage->layers));
break;
case 'L': /* active drawable name */
{
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (gimage);
if (drawable)
i += print (title, title_len, i, "%s",
gimp_object_get_name (GIMP_OBJECT (drawable)));
else
i += print (title, title_len, i, "%s", "(none)");
}
break;
case 'w': /* width in pixels */
i += print (title, title_len, i, "%d", gimage->width);
break;
case 'W': /* width in real-world units */
g_snprintf (unit_format, sizeof (unit_format), "%%.%df",
gimp_unit_get_digits (gimage->unit) + 1);
i += print (title, title_len, i, unit_format,
(gimage->width *
gimp_unit_get_factor (gimage->unit) /
gimage->xresolution));
break;