mirror of https://github.com/GNOME/gimp.git
const- and g_return_if_fail-ify.
2008-07-11 Martin Nordholts <martinn@svn.gnome.org> * app/display/gimpdisplayshell-scroll.[ch] (gimp_display_shell_get_viewport) (gimp_display_shell_get_scaled_viewport) (gimp_display_shell_get_scaled_image_viewport_offset): const- and g_return_if_fail-ify. svn path=/trunk/; revision=26140
This commit is contained in:
parent
00ef6ab9ec
commit
dc6f184a17
|
@ -1,3 +1,11 @@
|
|||
2008-07-11 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/display/gimpdisplayshell-scroll.[ch]
|
||||
(gimp_display_shell_get_viewport)
|
||||
(gimp_display_shell_get_scaled_viewport)
|
||||
(gimp_display_shell_get_scaled_image_viewport_offset): const- and
|
||||
g_return_if_fail-ify.
|
||||
|
||||
2008-07-11 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimprotatetool.c (gimp_rotate_tool_key_press): simplified.
|
||||
|
|
|
@ -147,12 +147,14 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
|
|||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *w,
|
||||
gint *h)
|
||||
gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *w,
|
||||
gint *h)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (x) *x = -shell->disp_xoffset + shell->offset_x;
|
||||
if (y) *y = -shell->disp_yoffset + shell->offset_y;
|
||||
if (w) *w = shell->disp_width;
|
||||
|
@ -173,12 +175,14 @@ gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
|||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h)
|
||||
gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (x) *x = shell->offset_x / shell->scale_x;
|
||||
if (y) *y = shell->offset_y / shell->scale_y;
|
||||
if (w) *w = shell->disp_width / shell->scale_x;
|
||||
|
@ -195,10 +199,12 @@ gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
|||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_get_scaled_image_viewport_offset (GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y)
|
||||
gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (x) *x = shell->disp_xoffset - shell->offset_x;
|
||||
if (y) *y = shell->disp_yoffset - shell->offset_y;
|
||||
}
|
||||
|
|
|
@ -20,27 +20,27 @@
|
|||
#define __GIMP_DISPLAY_SHELL_SCROLL_H__
|
||||
|
||||
|
||||
void gimp_display_shell_scroll (GimpDisplayShell *shell,
|
||||
gdouble x_offset_into_image,
|
||||
gdouble y_offset_into_image);
|
||||
void gimp_display_shell_scroll (GimpDisplayShell *shell,
|
||||
gdouble x_offset_into_image,
|
||||
gdouble y_offset_into_image);
|
||||
|
||||
void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *w,
|
||||
gint *h);
|
||||
void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *w,
|
||||
gint *h);
|
||||
|
||||
void gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h);
|
||||
void gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h);
|
||||
|
||||
void gimp_display_shell_get_scaled_image_viewport_offset (GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_H__ */
|
||||
|
|
Loading…
Reference in New Issue