gimp r26140 - in trunk: . app/display
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26140 - in trunk: . app/display
- Date: Fri, 11 Jul 2008 20:03:36 +0000 (UTC)
Author: martinn
Date: Fri Jul 11 20:03:36 2008
New Revision: 26140
URL: http://svn.gnome.org/viewvc/gimp?rev=26140&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell-scroll.c
trunk/app/display/gimpdisplayshell-scroll.h
Modified: trunk/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-scroll.c (original)
+++ trunk/app/display/gimpdisplayshell-scroll.c Fri Jul 11 20:03:36 2008
@@ -147,12 +147,14 @@
*
**/
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 @@
*
**/
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 @@
*
**/
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;
}
Modified: trunk/app/display/gimpdisplayshell-scroll.h
==============================================================================
--- trunk/app/display/gimpdisplayshell-scroll.h (original)
+++ trunk/app/display/gimpdisplayshell-scroll.h Fri Jul 11 20:03:36 2008
@@ -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_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_viewport (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_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_get_scaled_viewport (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y,
+ gint *w,
+ gint *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 (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y);
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]