[gimp] app: make gimp_display_shell_calculate_scale_x_and_y() private



commit c80f0136ba117c857964df4bb84f68ebd12e882e
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jan 5 18:52:03 2016 +0100

    app: make gimp_display_shell_calculate_scale_x_and_y() private

 app/display/gimpdisplayshell-scale.c |   67 +++++++++++++++++-----------------
 app/display/gimpdisplayshell-scale.h |    4 --
 2 files changed, 33 insertions(+), 38 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c
index ef0459d..85a4fcc 100644
--- a/app/display/gimpdisplayshell-scale.c
+++ b/app/display/gimpdisplayshell-scale.c
@@ -58,6 +58,11 @@ static void      gimp_display_shell_scale_get_image_size_for_scale
                                                           gdouble           scale,
                                                           gint             *w,
                                                           gint             *h);
+static void      gimp_display_shell_calculate_scale_x_and_y
+                                                         (GimpDisplayShell *shell,
+                                                          gdouble           scale,
+                                                          gdouble          *scale_x,
+                                                          gdouble          *scale_y);
 
   static void    gimp_display_shell_scale_to             (GimpDisplayShell *shell,
                                                           gdouble           scale,
@@ -693,40 +698,6 @@ gimp_display_shell_scale_resize (GimpDisplayShell *shell,
   gimp_display_shell_resume (shell);
 }
 
-/**
- * gimp_display_shell_calculate_scale_x_and_y:
- * @shell:
- * @scale:
- * @scale_x:
- * @scale_y:
- *
- **/
-void
-gimp_display_shell_calculate_scale_x_and_y (GimpDisplayShell *shell,
-                                            gdouble           scale,
-                                            gdouble          *scale_x,
-                                            gdouble          *scale_y)
-{
-  GimpImage *image;
-  gdouble    xres;
-  gdouble    yres;
-  gdouble    screen_xres;
-  gdouble    screen_yres;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-
-  image = gimp_display_get_image (shell->display);
-
-  g_return_if_fail (GIMP_IS_IMAGE (image));
-
-  gimp_image_get_resolution (image, &xres, &yres);
-  gimp_display_shell_scale_get_screen_resolution (shell,
-                                                  &screen_xres, &screen_yres);
-
-  if (scale_x) *scale_x = scale * screen_xres / xres;
-  if (scale_y) *scale_y = scale * screen_yres / yres;
-}
-
 void
 gimp_display_shell_set_initial_scale (GimpDisplayShell *shell,
                                       gdouble           scale,
@@ -879,6 +850,34 @@ gimp_display_shell_scale_get_image_size_for_scale (GimpDisplayShell *shell,
 }
 
 /**
+ * gimp_display_shell_calculate_scale_x_and_y:
+ * @shell:
+ * @scale:
+ * @scale_x:
+ * @scale_y:
+ *
+ **/
+static void
+gimp_display_shell_calculate_scale_x_and_y (GimpDisplayShell *shell,
+                                            gdouble           scale,
+                                            gdouble          *scale_x,
+                                            gdouble          *scale_y)
+{
+  GimpImage *image = gimp_display_get_image (shell->display);
+  gdouble    xres;
+  gdouble    yres;
+  gdouble    screen_xres;
+  gdouble    screen_yres;
+
+  gimp_image_get_resolution (image, &xres, &yres);
+  gimp_display_shell_scale_get_screen_resolution (shell,
+                                                  &screen_xres, &screen_yres);
+
+  if (scale_x) *scale_x = scale * screen_xres / xres;
+  if (scale_y) *scale_y = scale * screen_yres / yres;
+}
+
+/**
  * gimp_display_shell_scale_to:
  * @shell:
  * @scale:
diff --git a/app/display/gimpdisplayshell-scale.h b/app/display/gimpdisplayshell-scale.h
index 1940f53..ab5fac7 100644
--- a/app/display/gimpdisplayshell-scale.h
+++ b/app/display/gimpdisplayshell-scale.h
@@ -59,10 +59,6 @@ void     gimp_display_shell_scale_shrink_wrap              (GimpDisplayShell *sh
 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]