don't emit the "scaled" signal from gimp_display_shell_scale_setup(). Emit

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

	* app/display/gimpdisplayshell-scale.c: don't emit the "scaled"
	signal from gimp_display_shell_scale_setup(). Emit it explicitely
	from gimp_display_shell_scale_resize() instead.

	* app/display/gimpdisplayshell-scroll.c: call
	gimp_display_shell_scale_setup() after scrolling in order to
	update scrollbars and rulers.

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-handlers.c: emit the "scaled" signal
	explicitely.

	* app/display/gimpdisplayshell-render.c: minor optimizations.

	* app/display/gimpdisplayshell.c: minor cleanup.
This commit is contained in:
Sven Neumann 2003-03-21 16:28:06 +00:00 committed by Sven Neumann
parent 87cfd54e29
commit 6fb7877ebd
8 changed files with 52 additions and 32 deletions

View File

@ -1,3 +1,21 @@
2003-03-21 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-scale.c: don't emit the "scaled"
signal from gimp_display_shell_scale_setup(). Emit it explicitely
from gimp_display_shell_scale_resize() instead.
* app/display/gimpdisplayshell-scroll.c: call
gimp_display_shell_scale_setup() after scrolling in order to
update scrollbars and rulers.
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-handlers.c: emit the "scaled" signal
explicitely.
* app/display/gimpdisplayshell-render.c: minor optimizations.
* app/display/gimpdisplayshell.c: minor cleanup.
2003-03-21 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcellrendererviewable.c

View File

@ -308,6 +308,7 @@ gimp_display_shell_canvas_configure (GtkWidget *widget,
gimp_display_shell_scroll_clamp_offsets (shell);
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
}
return TRUE;

View File

@ -1363,11 +1363,11 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell,
gint w,
gint h)
{
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@ -1449,7 +1449,7 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell,
i - shell->disp_yoffset,
dx, dy);
#if 0
#ifdef STRESS_TEST
/* Invalidate the projection just after we render it! */
gimp_image_invalidate_without_render (shell->gdisp->gimage,
j - shell->disp_xoffset,

View File

@ -307,7 +307,10 @@ gimp_display_shell_resolution_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
if (! shell->dot_for_dot)
gimp_display_shell_scale_setup (shell);
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
}
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
}
@ -317,7 +320,10 @@ gimp_display_shell_unit_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
if (! shell->dot_for_dot)
gimp_display_shell_scale_setup (shell);
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
}
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
}
@ -420,6 +426,7 @@ gimp_display_shell_monitor_res_notify_handler (GObject *config,
if (! shell->dot_for_dot)
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));

View File

@ -857,8 +857,8 @@ render_image_init_info (RenderInfo *info,
info->h = h;
info->scalex = SCALEFACTOR_X (shell);
info->scaley = SCALEFACTOR_Y (shell);
info->src_x = UNSCALEX (shell, info->x);
info->src_y = UNSCALEY (shell, info->y);
info->src_x = (gfloat) info->x / info->scalex;
info->src_y = (gfloat) info->y / info->scaley;
info->src_bpp = gimp_image_projection_bytes (shell->gdisp->gimage);
info->dest = shell->render_buf;
info->dest_bpp = 3;
@ -876,7 +876,7 @@ render_image_init_info (RenderInfo *info,
}
}
static guint*
static guint *
render_image_init_alpha (gint mult)
{
static guint *alpha_mult = NULL;
@ -934,14 +934,10 @@ render_image_tile_fault (RenderInfo *info)
guchar *scale;
gint width;
gint tilex;
gint tiley;
gint step;
gint bpp = info->src_bpp;
gint x, b;
tilex = info->src_x / TILE_WIDTH;
tiley = info->src_y / TILE_HEIGHT;
tile = tile_manager_get_tile (info->src_tiles,
info->src_x, info->src_y,
TRUE, FALSE);
@ -957,6 +953,8 @@ render_image_tile_fault (RenderInfo *info)
x = info->src_x;
width = info->w;
tilex = info->src_x / TILE_WIDTH;
while (width--)
{
for (b = 0; b < bpp; b++)

View File

@ -150,8 +150,6 @@ gimp_display_shell_scale_setup (GimpDisplayShell *shell)
gtk_widget_queue_draw (GTK_WIDGET (hruler));
gtk_widget_queue_draw (GTK_WIDGET (vruler));
gimp_display_shell_scaled (shell);
#if 0
g_print ("offset_x: %d\n"
"offset_y: %d\n"
@ -419,6 +417,7 @@ gimp_display_shell_scale_resize (GimpDisplayShell *shell,
gimp_display_shell_scroll_clamp_offsets (shell);
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
if (resize_window || redisplay)
gimp_display_shell_expose_full (shell);

View File

@ -33,6 +33,7 @@
#include "gimpdisplay.h"
#include "gimpdisplay-foreach.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-scroll.h"
@ -67,25 +68,21 @@ gimp_display_shell_scroll (GimpDisplayShell *shell,
tool_manager_control_active (shell->gdisp->gimage->gimp, PAUSE,
shell->gdisp);
gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset);
/* set the offsets back to the new values */
shell->offset_x += x_offset;
shell->offset_y += y_offset;
gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset);
/* Make sure expose events are processed before scrolling again */
gdk_window_process_updates (shell->canvas->window, FALSE);
/* Update scrollbars and rulers */
gimp_display_shell_scale_setup (shell);
tool_manager_control_active (shell->gdisp->gimage->gimp, RESUME,
shell->gdisp);
/* Update the scrollbars */
shell->hsbdata->value = shell->offset_x;
shell->vsbdata->value = shell->offset_y;
gtk_adjustment_changed (shell->hsbdata);
gtk_adjustment_changed (shell->vsbdata);
gimp_display_shell_scrolled (shell);
return TRUE;

View File

@ -1363,11 +1363,11 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell,
gint w,
gint h)
{
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@ -1449,7 +1449,7 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell,
i - shell->disp_yoffset,
dx, dy);
#if 0
#ifdef STRESS_TEST
/* Invalidate the projection just after we render it! */
gimp_image_invalidate_without_render (shell->gdisp->gimage,
j - shell->disp_xoffset,