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:

committed by
Martin Nordholts

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>
|
2008-07-11 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimprotatetool.c (gimp_rotate_tool_key_press): simplified.
|
* app/tools/gimprotatetool.c (gimp_rotate_tool_key_press): simplified.
|
||||||
|
@ -147,12 +147,14 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||||
gint *x,
|
gint *x,
|
||||||
gint *y,
|
gint *y,
|
||||||
gint *w,
|
gint *w,
|
||||||
gint *h)
|
gint *h)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
if (x) *x = -shell->disp_xoffset + shell->offset_x;
|
if (x) *x = -shell->disp_xoffset + shell->offset_x;
|
||||||
if (y) *y = -shell->disp_yoffset + shell->offset_y;
|
if (y) *y = -shell->disp_yoffset + shell->offset_y;
|
||||||
if (w) *w = shell->disp_width;
|
if (w) *w = shell->disp_width;
|
||||||
@ -173,12 +175,14 @@ gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
|
||||||
gdouble *x,
|
gdouble *x,
|
||||||
gdouble *y,
|
gdouble *y,
|
||||||
gdouble *w,
|
gdouble *w,
|
||||||
gdouble *h)
|
gdouble *h)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
if (x) *x = shell->offset_x / shell->scale_x;
|
if (x) *x = shell->offset_x / shell->scale_x;
|
||||||
if (y) *y = shell->offset_y / shell->scale_y;
|
if (y) *y = shell->offset_y / shell->scale_y;
|
||||||
if (w) *w = shell->disp_width / shell->scale_x;
|
if (w) *w = shell->disp_width / shell->scale_x;
|
||||||
@ -195,10 +199,12 @@ gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_display_shell_get_scaled_image_viewport_offset (GimpDisplayShell *shell,
|
gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
|
||||||
gint *x,
|
gint *x,
|
||||||
gint *y)
|
gint *y)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
if (x) *x = shell->disp_xoffset - shell->offset_x;
|
if (x) *x = shell->disp_xoffset - shell->offset_x;
|
||||||
if (y) *y = shell->disp_yoffset - shell->offset_y;
|
if (y) *y = shell->disp_yoffset - shell->offset_y;
|
||||||
}
|
}
|
||||||
|
@ -26,19 +26,19 @@ void gimp_display_shell_scroll (GimpDisplayShell
|
|||||||
|
|
||||||
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,
|
void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||||
gint *x,
|
gint *x,
|
||||||
gint *y,
|
gint *y,
|
||||||
gint *w,
|
gint *w,
|
||||||
gint *h);
|
gint *h);
|
||||||
|
|
||||||
void gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
void gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
|
||||||
gdouble *x,
|
gdouble *x,
|
||||||
gdouble *y,
|
gdouble *y,
|
||||||
gdouble *w,
|
gdouble *w,
|
||||||
gdouble *h);
|
gdouble *h);
|
||||||
|
|
||||||
void gimp_display_shell_get_scaled_image_viewport_offset (GimpDisplayShell *shell,
|
void gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
|
||||||
gint *x,
|
gint *x,
|
||||||
gint *y);
|
gint *y);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user