GimpDisplayShell-scale

GimpDisplayShell-scale

Synopsis

void                gimp_display_shell_update_scrollbars_and_rulers
                                                        (GimpDisplayShell *shell);
void                gimp_display_shell_scale_update_scrollbars
                                                        (GimpDisplayShell *shell);
void                gimp_display_shell_scale_update_rulers
                                                        (GimpDisplayShell *shell);
gboolean            gimp_display_shell_scale_revert     (GimpDisplayShell *shell);
gboolean            gimp_display_shell_scale_can_revert (GimpDisplayShell *shell);
void                gimp_display_shell_scale_set_dot_for_dot
                                                        (GimpDisplayShell *shell,
                                                         gboolean dot_for_dot);
void                gimp_display_shell_get_screen_resolution
                                                        (GimpDisplayShell *shell,
                                                         gdouble *xres,
                                                         gdouble *yres);
void                gimp_display_shell_scale            (GimpDisplayShell *shell,
                                                         GimpZoomType zoom_type,
                                                         gdouble scale,
                                                         GimpZoomFocus zoom_focus);
void                gimp_display_shell_scale_fit_in     (GimpDisplayShell *shell);
gboolean            gimp_display_shell_scale_image_is_within_viewport
                                                        (GimpDisplayShell *shell,
                                                         gboolean *horizontally,
                                                         gboolean *vertically);
void                gimp_display_shell_scale_fill       (GimpDisplayShell *shell);
void                gimp_display_shell_scale_handle_zoom_revert
                                                        (GimpDisplayShell *shell);
void                gimp_display_shell_scale_by_values  (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gint offset_x,
                                                         gint offset_y,
                                                         gboolean resize_window);
void                gimp_display_shell_scale_shrink_wrap
                                                        (GimpDisplayShell *shell,
                                                         gboolean grow_only);
void                gimp_display_shell_scale_resize     (GimpDisplayShell *shell,
                                                         gboolean resize_window,
                                                         gboolean grow_only);
void                gimp_display_shell_calculate_scale_x_and_y
                                                        (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gdouble *scale_x,
                                                         gdouble *scale_y);
void                gimp_display_shell_set_initial_scale
                                                        (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gint *display_width,
                                                         gint *display_height);
void                gimp_display_shell_push_zoom_focus_pointer_pos
                                                        (GimpDisplayShell *shell,
                                                         gint x,
                                                         gint y);

Description

Details

gimp_display_shell_update_scrollbars_and_rulers ()

void                gimp_display_shell_update_scrollbars_and_rulers
                                                        (GimpDisplayShell *shell);

shell :

the GimpDisplayShell

gimp_display_shell_scale_update_scrollbars ()

void                gimp_display_shell_scale_update_scrollbars
                                                        (GimpDisplayShell *shell);

gimp_display_shell_scale_update_rulers ()

void                gimp_display_shell_scale_update_rulers
                                                        (GimpDisplayShell *shell);

gimp_display_shell_scale_revert ()

gboolean            gimp_display_shell_scale_revert     (GimpDisplayShell *shell);

Reverts the display to the previously used scale. If no previous scale exist, then the call does nothing.

shell :

the GimpDisplayShell

Returns :

TRUE if the scale was reverted, otherwise FALSE.

gimp_display_shell_scale_can_revert ()

gboolean            gimp_display_shell_scale_can_revert (GimpDisplayShell *shell);

shell :

the GimpDisplayShell

Returns :

TRUE if a previous display scale exists, otherwise FALSE.

gimp_display_shell_scale_set_dot_for_dot ()

void                gimp_display_shell_scale_set_dot_for_dot
                                                        (GimpDisplayShell *shell,
                                                         gboolean dot_for_dot);

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.

shell :

the GimpDisplayShell

dot_for_dot :

whether "Dot for Dot" should be enabled

gimp_display_shell_get_screen_resolution ()

void                gimp_display_shell_get_screen_resolution
                                                        (GimpDisplayShell *shell,
                                                         gdouble *xres,
                                                         gdouble *yres);


gimp_display_shell_scale ()

void                gimp_display_shell_scale            (GimpDisplayShell *shell,
                                                         GimpZoomType zoom_type,
                                                         gdouble scale,
                                                         GimpZoomFocus zoom_focus);

This function figures out the context of the zoom and behaves appropriatley thereafter.

shell :

the GimpDisplayShell

zoom_type :

whether to zoom in, our or to a specific scale

scale :

ignored unless zoom_type == GIMP_ZOOM_TO

gimp_display_shell_scale_fit_in ()

void                gimp_display_shell_scale_fit_in     (GimpDisplayShell *shell);

Sets the scale such that the entire image precisely fits in the display area.

shell :

the GimpDisplayShell

gimp_display_shell_scale_image_is_within_viewport ()

gboolean            gimp_display_shell_scale_image_is_within_viewport
                                                        (GimpDisplayShell *shell,
                                                         gboolean *horizontally,
                                                         gboolean *vertically);

Returns :

TRUE if the (scaled) image is smaller than and within the viewport.

gimp_display_shell_scale_fill ()

void                gimp_display_shell_scale_fill       (GimpDisplayShell *shell);

Sets the scale such that the entire display area is precisely filled by the image.

shell :

the GimpDisplayShell

gimp_display_shell_scale_handle_zoom_revert ()

void                gimp_display_shell_scale_handle_zoom_revert
                                                        (GimpDisplayShell *shell);

Handle the updating of the Revert Zoom variables.


gimp_display_shell_scale_by_values ()

void                gimp_display_shell_scale_by_values  (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gint offset_x,
                                                         gint offset_y,
                                                         gboolean resize_window);

Directly sets the image scale and image offsets used by the display. If resize_window is TRUE then the display window is resized to better accomodate the image, see gimp_display_shell_shrink_wrap().

shell :

the GimpDisplayShell

scale :

the new scale

offset_x :

the new X offset

offset_y :

the new Y offset

resize_window :

whether the display window should be resized

gimp_display_shell_scale_shrink_wrap ()

void                gimp_display_shell_scale_shrink_wrap
                                                        (GimpDisplayShell *shell,
                                                         gboolean grow_only);

Convenience function with the same functionality as gimp_display_shell_scale_resize(shell, TRUE, grow_only).

shell :

the GimpDisplayShell

gimp_display_shell_scale_resize ()

void                gimp_display_shell_scale_resize     (GimpDisplayShell *shell,
                                                         gboolean resize_window,
                                                         gboolean grow_only);

Function commonly called after a change in display scale to make the changes visible to the user. If resize_window is TRUE then the display window is resized to accomodate the display image as per gimp_display_shell_shrink_wrap().

shell :

the GimpDisplayShell

resize_window :

whether the display window should be resized

grow_only :

whether shrinking of the window is allowed or not

gimp_display_shell_calculate_scale_x_and_y ()

void                gimp_display_shell_calculate_scale_x_and_y
                                                        (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gdouble *scale_x,
                                                         gdouble *scale_y);

gimp_display_shell_set_initial_scale ()

void                gimp_display_shell_set_initial_scale
                                                        (GimpDisplayShell *shell,
                                                         gdouble scale,
                                                         gint *display_width,
                                                         gint *display_height);


gimp_display_shell_push_zoom_focus_pointer_pos ()

void                gimp_display_shell_push_zoom_focus_pointer_pos
                                                        (GimpDisplayShell *shell,
                                                         gint x,
                                                         gint y);

When the zoom focus mechanism asks for the pointer the next time, use x and y.