gimp r25227 - in trunk: . app/display
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25227 - in trunk: . app/display
- Date: Tue, 25 Mar 2008 16:13:17 +0000 (GMT)
Author: neo
Date: Tue Mar 25 16:13:17 2008
New Revision: 25227
URL: http://svn.gnome.org/viewvc/gimp?rev=25227&view=rev
Log:
2008-03-25 Sven Neumann <sven gimp org>
* app/display/Makefile.am
* app/display/gimpdisplayshell-icon.[ch]: split icon code to its
own file.
* app/display/gimpdisplayshell.c
* app/display/gimpdisplayshell-handlers.c: changed accordingly.
Added:
trunk/app/display/gimpdisplayshell-icon.c (contents, props changed)
trunk/app/display/gimpdisplayshell-icon.h (contents, props changed)
Modified:
trunk/ChangeLog
trunk/app/display/Makefile.am
trunk/app/display/gimpdisplayshell-handlers.c
trunk/app/display/gimpdisplayshell.c
Modified: trunk/app/display/Makefile.am
==============================================================================
--- trunk/app/display/Makefile.am (original)
+++ trunk/app/display/Makefile.am Tue Mar 25 16:13:17 2008
@@ -41,6 +41,8 @@
gimpdisplayshell-filter-dialog.h \
gimpdisplayshell-layer-select.c \
gimpdisplayshell-layer-select.h \
+ gimpdisplayshell-icon.c \
+ gimpdisplayshell-icon.h \
gimpdisplayshell-preview.c \
gimpdisplayshell-preview.h \
gimpdisplayshell-progress.c \
Modified: trunk/app/display/gimpdisplayshell-handlers.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-handlers.c (original)
+++ trunk/app/display/gimpdisplayshell-handlers.c Tue Mar 25 16:13:17 2008
@@ -41,6 +41,7 @@
#include "gimpdisplayshell-callbacks.h"
#include "gimpdisplayshell-draw.h"
#include "gimpdisplayshell-handlers.h"
+#include "gimpdisplayshell-icon.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-selection.h"
#include "gimpdisplayshell-title.h"
@@ -694,7 +695,7 @@
shell->icon_idle_id = 0;
- gimp_display_shell_update_icon (shell);
+ gimp_display_shell_icon_update (shell);
return FALSE;
}
Added: trunk/app/display/gimpdisplayshell-icon.c
==============================================================================
--- (empty file)
+++ trunk/app/display/gimpdisplayshell-icon.c Tue Mar 25 16:13:17 2008
@@ -0,0 +1,74 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include "display-types.h"
+
+#include "core/gimp.h"
+#include "core/gimpimage.h"
+#include "core/gimpviewable.h"
+
+#include "gimpdisplay.h"
+#include "gimpdisplayshell.h"
+#include "gimpdisplayshell-icon.h"
+
+
+void
+gimp_display_shell_icon_update (GimpDisplayShell *shell)
+{
+ GimpImage *image;
+
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ image = shell->display->image;
+
+ if (image)
+ {
+ Gimp *gimp = shell->display->gimp;
+ GdkPixbuf *pixbuf;
+ gint width;
+ gint height;
+ gdouble factor = ((gdouble) gimp_image_get_height (image) /
+ (gdouble) gimp_image_get_width (image));
+
+ if (factor >= 1)
+ {
+ height = MAX (shell->icon_size, 1);
+ width = MAX (((gdouble) shell->icon_size) / factor, 1);
+ }
+ else
+ {
+ height = MAX (((gdouble) shell->icon_size) * factor, 1);
+ width = MAX (shell->icon_size, 1);
+ }
+
+ pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (image),
+ gimp_get_user_context (gimp),
+ width, height);
+
+ gtk_window_set_icon (GTK_WINDOW (shell), pixbuf);
+ }
+ else
+ {
+ gtk_window_set_icon (GTK_WINDOW (shell), NULL);
+ }
+}
+
Added: trunk/app/display/gimpdisplayshell-icon.h
==============================================================================
--- (empty file)
+++ trunk/app/display/gimpdisplayshell-icon.h Tue Mar 25 16:13:17 2008
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GIMP_DISPLAY_SHELL_ICON_H__
+#define __GIMP_DISPLAY_SHELL_ICON_H__
+
+
+void gimp_display_shell_icon_update (GimpDisplayShell *shell);
+
+
+#endif /* __GIMP_DISPLAY_SHELL_ICON_H__ */
Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c (original)
+++ trunk/app/display/gimpdisplayshell.c Tue Mar 25 16:13:17 2008
@@ -1737,47 +1737,6 @@
}
void
-gimp_display_shell_update_icon (GimpDisplayShell *shell)
-{
- GimpImage *image;
-
- g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-
- image = shell->display->image;
-
- if (image)
- {
- Gimp *gimp = shell->display->gimp;
- GdkPixbuf *pixbuf;
- gint width;
- gint height;
- gdouble factor = ((gdouble) gimp_image_get_height (image) /
- (gdouble) gimp_image_get_width (image));
-
- if (factor >= 1)
- {
- height = MAX (shell->icon_size, 1);
- width = MAX (((gdouble) shell->icon_size) / factor, 1);
- }
- else
- {
- height = MAX (((gdouble) shell->icon_size) * factor, 1);
- width = MAX (shell->icon_size, 1);
- }
-
- pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (image),
- gimp_get_user_context (gimp),
- width, height);
-
- gtk_window_set_icon (GTK_WINDOW (shell), pixbuf);
- }
- else
- {
- gtk_window_set_icon (GTK_WINDOW (shell), NULL);
- }
-}
-
-void
gimp_display_shell_shrink_wrap (GimpDisplayShell *shell,
gboolean grow_only)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]