示例#1
0
static void
gimp_display_shell_monitor_res_notify_handler (GObject          *config,
        GParamSpec       *param_spec,
        GimpDisplayShell *shell)
{
    if (GIMP_DISPLAY_CONFIG (config)->monitor_res_from_gdk)
    {
        gimp_get_monitor_resolution (gtk_widget_get_screen (GTK_WIDGET (shell)),
                                     gimp_widget_get_monitor (GTK_WIDGET (shell)),
                                     &shell->monitor_xres,
                                     &shell->monitor_yres);
    }
    else
    {
        shell->monitor_xres = GIMP_DISPLAY_CONFIG (config)->monitor_xres;
        shell->monitor_yres = GIMP_DISPLAY_CONFIG (config)->monitor_yres;
    }

    gimp_display_shell_scale_changed (shell);

    if (! shell->dot_for_dot)
    {
        gimp_display_shell_scroll_clamp_and_update (shell);

        gimp_display_shell_scaled (shell);

        gimp_display_shell_expose_full (shell);
    }
}
示例#2
0
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);
    }
}
static void
gimp_display_shell_resolution_changed_handler (GimpImage        *image,
                                               GimpDisplayShell *shell)
{
  gimp_display_shell_scale_changed (shell);

  if (shell->dot_for_dot)
    {
      gimp_display_shell_scale_setup (shell);
      gimp_display_shell_scaled (shell);
    }
  else
    {
      gimp_display_shell_size_changed_handler (image, shell);
    }
}
/**
 * gimp_display_shell_scale_set_dot_for_dot:
 * @shell:        the #GimpDisplayShell
 * @dot_for_dot:  whether "Dot for Dot" should be enabled
 *
 * If @dot_for_dot is set to %TRUE then the "Dot for Dot" mode (where image and
 * screen pixels are of the same size) is activated. Dually, the mode is
 * disabled if @dot_for_dot is %FALSE.
 **/
void
gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
                                          gboolean          dot_for_dot)
{
  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));

  if (dot_for_dot != shell->dot_for_dot)
    {
      /* freeze the active tool */
      gimp_display_shell_pause (shell);

      shell->dot_for_dot = dot_for_dot;

      gimp_display_shell_scale_changed (shell);

      gimp_display_shell_scale_resize (shell,
                                       shell->display->config->resize_windows_on_zoom,
                                       FALSE);

      /* re-enable the active tool */
      gimp_display_shell_resume (shell);
    }
}