gimp r25119 - in trunk: . app/display



Author: neo
Date: Wed Mar 19 09:57:22 2008
New Revision: 25119
URL: http://svn.gnome.org/viewvc/gimp?rev=25119&view=rev

Log:
2008-03-19  Sven Neumann  <sven gimp org>

	* app/display/gimpdisplayshell.[ch]
	* app/display/gimpdisplayshell-scale.[ch]: moved
	gimp_display_shell_set_initial_scale() to gimpdisplayshell-scale.c.

	* app/display/gimpdisplayoptions.c: reverted last change, we want
	to keep the status-bar around.


Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayoptions.c
   trunk/app/display/gimpdisplayshell-scale.c
   trunk/app/display/gimpdisplayshell-scale.h
   trunk/app/display/gimpdisplayshell.c
   trunk/app/display/gimpdisplayshell.h

Modified: trunk/app/display/gimpdisplayoptions.c
==============================================================================
--- trunk/app/display/gimpdisplayoptions.c	(original)
+++ trunk/app/display/gimpdisplayoptions.c	Wed Mar 19 09:57:22 2008
@@ -223,10 +223,6 @@
                                     "show-scrollbars", SHOW_SCROLLBARS_BLURB,
                                     FALSE,
                                     GIMP_PARAM_STATIC_STRINGS);
-  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
-                                    "show-statusbar", SHOW_STATUSBAR_BLURB,
-                                    FALSE,
-                                    GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SELECTION,
                                     "show-selection", SHOW_SELECTION_BLURB,
                                     FALSE,

Modified: trunk/app/display/gimpdisplayshell-scale.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-scale.c	(original)
+++ trunk/app/display/gimpdisplayshell-scale.c	Wed Mar 19 09:57:22 2008
@@ -600,6 +600,82 @@
   gimp_display_shell_resume (shell);
 }
 
+void
+gimp_display_shell_set_initial_scale (GimpDisplayShell *shell,
+                                      gdouble           scale,
+                                      gint             *display_width,
+                                      gint             *display_height)
+{
+  GdkScreen *screen;
+  gint       image_width;
+  gint       image_height;
+  gint       shell_width;
+  gint       shell_height;
+  gint       screen_width;
+  gint       screen_height;
+  gdouble    new_scale;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  screen = gtk_widget_get_screen (GTK_WIDGET (shell));
+
+  image_width  = gimp_image_get_width  (shell->display->image);
+  image_height = gimp_image_get_height (shell->display->image);
+
+  screen_width  = gdk_screen_get_width (screen)  * 0.75;
+  screen_height = gdk_screen_get_height (screen) * 0.75;
+
+  shell_width  = SCALEX (shell, image_width);
+  shell_height = SCALEY (shell, image_height);
+
+  gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, scale);
+
+  if (shell->display->config->initial_zoom_to_fit)
+    {
+      /*  Limit to the size of the screen...  */
+      if (shell_width > screen_width || shell_height > screen_height)
+        {
+          gdouble current = gimp_zoom_model_get_factor (shell->zoom);
+
+          new_scale = current * MIN (((gdouble) screen_height) / shell_height,
+                                     ((gdouble) screen_width)  / shell_width);
+
+          new_scale = gimp_zoom_model_zoom_step (GIMP_ZOOM_OUT, new_scale);
+
+          /*  Since zooming out might skip a zoom step we zoom in
+           *  again and test if we are small enough.
+           */
+          gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO,
+                                gimp_zoom_model_zoom_step (GIMP_ZOOM_IN,
+                                                           new_scale));
+
+          if (SCALEX (shell, image_width) > screen_width ||
+              SCALEY (shell, image_height) > screen_height)
+            gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, new_scale);
+
+          shell_width  = SCALEX (shell, image_width);
+          shell_height = SCALEY (shell, image_height);
+        }
+    }
+  else
+    {
+      /*  Set up size like above, but do not zoom to fit. Useful when
+       *  working on large images.
+       */
+      if (shell_width > screen_width)
+        shell_width = screen_width;
+
+      if (shell_height > screen_height)
+        shell_height = screen_height;
+    }
+
+  if (display_width)
+    *display_width = shell_width;
+
+  if (display_height)
+    *display_height = shell_height;
+}
+
 /**
  * gimp_display_shell_scale_dialog:
  * @shell: the #GimpDisplayShell

Modified: trunk/app/display/gimpdisplayshell-scale.h
==============================================================================
--- trunk/app/display/gimpdisplayshell-scale.h	(original)
+++ trunk/app/display/gimpdisplayshell-scale.h	Wed Mar 19 09:57:22 2008
@@ -48,6 +48,11 @@
 void   gimp_display_shell_scale_resize          (GimpDisplayShell *shell,
                                                  gboolean          resize_window,
                                                  gboolean          redisplay);
+void   gimp_display_shell_set_initial_scale     (GimpDisplayShell *shell,
+                                                 gdouble           scale,
+                                                 gint             *display_width,
+                                                 gint             *display_height);
+
 void   gimp_display_shell_scale_dialog          (GimpDisplayShell *shell);
 
 

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Wed Mar 19 09:57:22 2008
@@ -690,10 +690,7 @@
       shell->monitor_yres = shell->display->config->monitor_yres;
     }
 
-  /* adjust the initial scale -- so that window fits on screen the 75%
-   * value is the same as in gimp_display_shell_shrink_wrap. It
-   * probably should be a user-configurable option.
-   */
+  /* adjust the initial scale -- so that window fits on screen. */
   gimp_display_shell_set_initial_scale (shell, scale,
                                         &shell_width, &shell_height);
 
@@ -1108,82 +1105,6 @@
   gimp_display_shell_scaled (shell);
 }
 
-void
-gimp_display_shell_set_initial_scale (GimpDisplayShell *shell,
-                                      gdouble           scale,
-                                      gint             *display_width,
-                                      gint             *display_height)
-{
-  GdkScreen *screen;
-  gint       image_width;
-  gint       image_height;
-  gint       shell_width;
-  gint       shell_height;
-  gint       screen_width;
-  gint       screen_height;
-  gdouble    new_scale;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-
-  screen = gtk_widget_get_screen (GTK_WIDGET (shell));
-
-  image_width  = gimp_image_get_width  (shell->display->image);
-  image_height = gimp_image_get_height (shell->display->image);
-
-  screen_width  = gdk_screen_get_width (screen)  * 0.75;
-  screen_height = gdk_screen_get_height (screen) * 0.75;
-
-  shell_width  = SCALEX (shell, image_width);
-  shell_height = SCALEY (shell, image_height);
-
-  gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, scale);
-
-  if (shell->display->config->initial_zoom_to_fit)
-    {
-      /*  Limit to the size of the screen...  */
-      if (shell_width > screen_width || shell_height > screen_height)
-        {
-          gdouble current = gimp_zoom_model_get_factor (shell->zoom);
-
-          new_scale = current * MIN (((gdouble) screen_height) / shell_height,
-                                     ((gdouble) screen_width)  / shell_width);
-
-          new_scale = gimp_zoom_model_zoom_step (GIMP_ZOOM_OUT, new_scale);
-
-          /*  Since zooming out might skip a zoom step we zoom in
-           *  again and test if we are small enough.
-           */
-          gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO,
-                                gimp_zoom_model_zoom_step (GIMP_ZOOM_IN,
-                                                           new_scale));
-
-          if (SCALEX (shell, image_width) > screen_width ||
-              SCALEY (shell, image_height) > screen_height)
-            gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, new_scale);
-
-          shell_width  = SCALEX (shell, image_width);
-          shell_height = SCALEY (shell, image_height);
-        }
-    }
-  else
-    {
-      /*  Set up size like above, but do not zoom to fit. Useful when
-       *  working on large images.
-       */
-      if (shell_width > screen_width)
-        shell_width = screen_width;
-
-      if (shell_height > screen_height)
-        shell_height = screen_height;
-    }
-
-  if (display_width)
-    *display_width = shell_width;
-
-  if (display_height)
-    *display_height = shell_height;
-}
-
 /*
  * We used to calculate the scale factor in the SCALEFACTOR_X() and
  * SCALEFACTOR_Y() macros. But since these are rather frequently

Modified: trunk/app/display/gimpdisplayshell.h
==============================================================================
--- trunk/app/display/gimpdisplayshell.h	(original)
+++ trunk/app/display/gimpdisplayshell.h	Wed Mar 19 09:57:22 2008
@@ -211,11 +211,6 @@
 
 void        gimp_display_shell_reconnect           (GimpDisplayShell   *shell);
 
-void        gimp_display_shell_set_initial_scale   (GimpDisplayShell   *shell,
-                                                    gdouble             scale,
-                                                    gint               *display_width,
-                                                    gint               *display_height);
-
 void        gimp_display_shell_scale_changed       (GimpDisplayShell   *shell);
 
 void        gimp_display_shell_scaled              (GimpDisplayShell   *shell);



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