static void gimp_display_shell_resolution_changed_handler (GimpImage *image, GimpDisplayShell *shell) { gimp_display_shell_scale_changed (shell); if (shell->dot_for_dot) { if (shell->unit != GIMP_UNIT_PIXEL) { gimp_display_shell_scale_update_rulers (shell); } gimp_display_shell_scaled (shell); } else { /* A resolution change has the same effect as a size change from * a display shell point of view. Force a redraw of the display * so that we don't get any display garbage. */ gimp_display_shell_scale_resize (shell, shell->display->config->resize_windows_on_resize, FALSE); } }
/** * gimp_display_shell_scroll_clamp_and_update: * @shell: * * Helper function for calling two functions that are commonly called * in pairs. **/ void gimp_display_shell_scroll_clamp_and_update (GimpDisplayShell *shell) { gimp_display_shell_scroll_clamp_offsets (shell); gimp_display_shell_scale_update_scrollbars (shell); gimp_display_shell_scale_update_rulers (shell); }
/** * gimp_display_shell_update_scrollbars_and_rulers: * @shell: the #GimpDisplayShell * **/ void gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); gimp_display_shell_scale_update_scrollbars (shell); gimp_display_shell_scale_update_rulers (shell); }
void gimp_display_shell_scroll (GimpDisplayShell *shell, gint x_offset, gint y_offset) { gint old_x; gint old_y; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); if (x_offset == 0 && y_offset == 0) return; old_x = shell->offset_x; old_y = shell->offset_y; shell->offset_x += x_offset; shell->offset_y += y_offset; gimp_display_shell_scroll_clamp_offsets (shell); /* the actual changes in offset */ x_offset = (shell->offset_x - old_x); y_offset = (shell->offset_y - old_y); if (x_offset || y_offset) { /* reset the old values so that the tool can accurately redraw */ shell->offset_x = old_x; shell->offset_y = old_y; gimp_display_shell_pause (shell); /* set the offsets back to the new values */ shell->offset_x += x_offset; shell->offset_y += y_offset; gimp_display_shell_rotate_update_transform (shell); gimp_overlay_box_scroll (GIMP_OVERLAY_BOX (shell->canvas), -x_offset, -y_offset); /* Update scrollbars and rulers */ gimp_display_shell_scale_update_scrollbars (shell); gimp_display_shell_scale_update_rulers (shell); gimp_display_shell_resume (shell); gimp_display_shell_scrolled (shell); } }