[Goodies-commits] r3090 - in ristretto/trunk: . icons icons/22x22 icons/24x24 icons/32x32 icons/36x36 po src

Stephan Arts stephan at xfce.org
Wed Aug 29 19:23:54 CEST 2007


Author: stephan
Date: 2007-08-29 17:23:54 +0000 (Wed, 29 Aug 2007)
New Revision: 3090

Added:
   ristretto/trunk/icons/22x22/
   ristretto/trunk/icons/22x22/ristretto.png
   ristretto/trunk/icons/24x24/
   ristretto/trunk/icons/24x24/ristretto.png
   ristretto/trunk/icons/32x32/
   ristretto/trunk/icons/32x32/ristretto.png
   ristretto/trunk/icons/36x36/
   ristretto/trunk/icons/36x36/ristretto.png
Modified:
   ristretto/trunk/ChangeLog
   ristretto/trunk/README
   ristretto/trunk/configure.in.in
   ristretto/trunk/icons/Makefile.am
   ristretto/trunk/po/ChangeLog
   ristretto/trunk/po/POTFILES.in
   ristretto/trunk/po/de.po
   ristretto/trunk/po/fr.po
   ristretto/trunk/po/nl.po
   ristretto/trunk/po/ristretto.pot
   ristretto/trunk/src/navigator.c
   ristretto/trunk/src/picture_viewer.c
Log:
Updated .po files
Updated Dutch and German translations
Added Mike to the translator-credits field of the french translation
Fixed scaling bugs of the picture-viewer.
Added missing icons for 22x22, 24x24, 32x32 and 36x36pixels
Updated ChangeLog
Started on README



Modified: ristretto/trunk/ChangeLog
===================================================================
--- ristretto/trunk/ChangeLog	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/ChangeLog	2007-08-29 17:23:54 UTC (rev 3090)
@@ -1,9 +1,16 @@
 2007-08-27:
+	* icons/22x22,
+	  icons/24x24,
+	  icons/32x32,
+	  icons/36x36: Added aditional icons
+	* README: Written the README file
 	* configure.in.in: Fixed version-numbering
 	* src/thumbnailer.c: Added scrollwheel navigation
 	  Fixed backwards scrolling of thumbnailer
 	* src/pictureviewer.c: Added scrollwheel zooming
 	  Fix Bug #3500 (Do not upscale images by default)
+	  Add a minimum zoom-level of 5% and a maximum of 1600%.
+	  Prevent images being down-scaled beyond 1 pixel.
 	* src/main.c: Added space/backspace navigation
 
 2007-08-26: Release 0.0.1

Modified: ristretto/trunk/README
===================================================================
--- ristretto/trunk/README	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/README	2007-08-29 17:23:54 UTC (rev 3090)
@@ -0,0 +1,9 @@
+# README README README README README README README README README README README #
+#                                                                              #
+#                             Ristretto Image Viewer                           #
+#                                                                              #
+################################################################################
+
+# Introduction:
+
+Ristretto is an image-viewer for the Xfce Desktop Environment.

Modified: ristretto/trunk/configure.in.in
===================================================================
--- ristretto/trunk/configure.in.in	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/configure.in.in	2007-08-29 17:23:54 UTC (rev 3090)
@@ -123,6 +123,10 @@
 src/Makefile
 icons/Makefile
 icons/16x16/Makefile
+icons/22x22/Makefile
+icons/24x24/Makefile
+icons/32x32/Makefile
+icons/36x36/Makefile
 icons/48x48/Makefile
 icons/scalable/Makefile
 ])

Added: ristretto/trunk/icons/22x22/ristretto.png
===================================================================
(Binary files differ)


Property changes on: ristretto/trunk/icons/22x22/ristretto.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: ristretto/trunk/icons/24x24/ristretto.png
===================================================================
(Binary files differ)


Property changes on: ristretto/trunk/icons/24x24/ristretto.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: ristretto/trunk/icons/32x32/ristretto.png
===================================================================
(Binary files differ)


Property changes on: ristretto/trunk/icons/32x32/ristretto.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: ristretto/trunk/icons/36x36/ristretto.png
===================================================================
(Binary files differ)


Property changes on: ristretto/trunk/icons/36x36/ristretto.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: ristretto/trunk/icons/Makefile.am
===================================================================
--- ristretto/trunk/icons/Makefile.am	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/icons/Makefile.am	2007-08-29 17:23:54 UTC (rev 3090)
@@ -1,6 +1,6 @@
 # Inspired by Makefile.am from the Thunar file-manager
 
-SUBDIRS = 16x16 48x48 scalable
+SUBDIRS = 16x16 22x22 24x24 32x32 36x36 48x48 scalable
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
 

Modified: ristretto/trunk/po/ChangeLog
===================================================================
--- ristretto/trunk/po/ChangeLog	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/ChangeLog	2007-08-29 17:23:54 UTC (rev 3090)
@@ -1,3 +1,8 @@
+27-08-2007  Stephan Arts <stephan at xfce.org>
+	* nl.po: Update Dutch translation
+	* de.po: Update German translation
+	* fr.po: Add Mike to the translator-credits of the french translation
+
 26-08-2007  Mike Massonnet <mmassonnet at xfce.org>
 	* fr.po: Update french translations
 

Modified: ristretto/trunk/po/POTFILES.in
===================================================================
--- ristretto/trunk/po/POTFILES.in	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/POTFILES.in	2007-08-29 17:23:54 UTC (rev 3090)
@@ -1,2 +1,5 @@
 src/main.c
+src/navigator.c
+src/picture_viewer.c
+src/thumbnail_viewer.c
 ristretto.desktop.in

Modified: ristretto/trunk/po/de.po
===================================================================
--- ristretto/trunk/po/de.po	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/de.po	2007-08-29 17:23:54 UTC (rev 3090)
@@ -7,79 +7,79 @@
 msgstr ""
 "Project-Id-Version: ristretto\n"
 "Report-Msgid-Bugs-To: stephan at xfce.org\n"
-"POT-Creation-Date: 2007-08-26 02:20+0200\n"
+"POT-Creation-Date: 2007-08-29 17:53+0200\n"
 "PO-Revision-Date: 2007-07-03 00:59:21+0200\n"
-"Last-Translator: Christian Dywan <christian at twotoasts.de>\n"
+"Last-Translator: stephan arts <stephan at xfce.org>\n"
 "Language-Team: German\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../src/main.c:199
+#: ../src/main.c:198
 msgid "_File"
 msgstr "_Datei"
 
-#: ../src/main.c:201
+#: ../src/main.c:200
 msgid "O_pen Folder"
 msgstr "_Ordner öffnen"
 
-#: ../src/main.c:202
+#: ../src/main.c:201
 msgid "_Recently used"
 msgstr "_Zuletzt geöffnet"
 
-#: ../src/main.c:221
+#: ../src/main.c:220
 msgid "_Edit"
 msgstr "_Bearbeiten"
 
-#: ../src/main.c:222
+#: ../src/main.c:221
 msgid "Rotate _Left"
 msgstr "_Links drehen"
 
-#: ../src/main.c:223
+#: ../src/main.c:222
 msgid "Rotate _Right"
 msgstr "_Rechts drehen"
 
-#: ../src/main.c:224
+#: ../src/main.c:223
 msgid "Flip _Vertically"
 msgstr "_Vertikal spiegeln"
 
-#: ../src/main.c:225
+#: ../src/main.c:224
 msgid "Flip _Horizontally"
 msgstr "_Horizontal spiegeln"
 
-#: ../src/main.c:234
+#: ../src/main.c:233
 msgid "_View"
 msgstr "_Ansicht"
 
-#: ../src/main.c:235
+#: ../src/main.c:234
 msgid "Thumbnail Viewer"
 msgstr "Vor_schaubilder"
 
-#: ../src/main.c:246
+#: ../src/main.c:245
 msgid "Show Horizontally"
 msgstr "_Horizontal anzeigen"
 
-#: ../src/main.c:247
+#: ../src/main.c:246
 msgid "Show Vertically"
 msgstr "_Vertikal anzeigen"
 
-#: ../src/main.c:248
+#: ../src/main.c:247
 msgid "Hide"
 msgstr "Ver_bergen"
 
-#: ../src/main.c:254
+#: ../src/main.c:253
 msgid "_Go"
 msgstr "_Gehe zu"
 
-#: ../src/main.c:282
+#: ../src/main.c:281
 msgid "_Help"
 msgstr "_Hilfe"
 
-#: ../src/main.c:438
+#: ../src/main.c:435
 msgid "Developer:"
 msgstr "Entwickler:"
 
-#: ../src/main.c:448
+#: ../src/main.c:445
 msgid ""
 "Ristretto is a fast and lightweight picture-viewer for the Xfce desktop "
 "environment."
@@ -87,30 +87,33 @@
 "Ristretto ist ein schneller und leichter Bildbetrachter für die "
 "Arbeitsumgebung Xfce."
 
-#: ../src/main.c:456
+#: ../src/main.c:453
 msgid "translator-credits"
 msgstr "Christian Dywan <christian at twotoasts.de>"
 
-#: ../src/main.c:690
+#: ../src/main.c:687
 msgid "Open image"
 msgstr "_Bild öffnen"
 
-#: ../src/main.c:731
+#: ../src/main.c:723
+msgid "Could not open file"
+msgstr ""
+
+#: ../src/main.c:735
 msgid "Open folder"
 msgstr "_Ordner öffnen"
 
 #: ../ristretto.desktop.in.h:1
-#, fuzzy
 msgid "Image Viewer"
-msgstr "Vor_schaubilder"
+msgstr "Bildbetrachter"
 
 #: ../ristretto.desktop.in.h:2
 msgid "Ristretto Image Viewer"
-msgstr ""
+msgstr "Ristretto Bildbetrachter"
 
 #: ../ristretto.desktop.in.h:3
 msgid "Xfce Image viewer"
-msgstr ""
+msgstr "Xfce Bildbetrachter"
 
 #~ msgid "View Zoom toolbar"
 #~ msgstr "Barre de zoom"

Modified: ristretto/trunk/po/fr.po
===================================================================
--- ristretto/trunk/po/fr.po	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/fr.po	2007-08-29 17:23:54 UTC (rev 3090)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: ristretto\n"
 "Report-Msgid-Bugs-To: stephan at xfce.org\n"
-"POT-Creation-Date: 2007-08-26 02:20+0200\n"
+"POT-Creation-Date: 2007-08-29 17:53+0200\n"
 "PO-Revision-Date: 2007-08-26 03:33+0100\n"
 "Last-Translator: Mike Massonnet <mmassonnet at gmail.com>\n"
 "Language-Team: French\n"
@@ -15,83 +15,91 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../src/main.c:199
+#: ../src/main.c:198
 msgid "_File"
 msgstr "_Fichier"
 
-#: ../src/main.c:201
+#: ../src/main.c:200
 msgid "O_pen Folder"
 msgstr "O_uvrir un répertoire"
 
-#: ../src/main.c:202
+#: ../src/main.c:201
 msgid "_Recently used"
 msgstr "_Récemment ouvert"
 
-#: ../src/main.c:221
+#: ../src/main.c:220
 msgid "_Edit"
 msgstr "_Editer"
 
-#: ../src/main.c:222
+#: ../src/main.c:221
 msgid "Rotate _Left"
 msgstr "Tourner vers la _gauche"
 
-#: ../src/main.c:223
+#: ../src/main.c:222
 msgid "Rotate _Right"
 msgstr "Tourner vers la _droite"
 
-#: ../src/main.c:224
+#: ../src/main.c:223
 msgid "Flip _Vertically"
 msgstr "Retourner _verticalement"
 
-#: ../src/main.c:225
+#: ../src/main.c:224
 msgid "Flip _Horizontally"
 msgstr "Retourner _horizontalement"
 
-#: ../src/main.c:234
+#: ../src/main.c:233
 msgid "_View"
 msgstr "_Afficher"
 
-#: ../src/main.c:235
+#: ../src/main.c:234
 msgid "Thumbnail Viewer"
 msgstr "Vue des miniatures"
 
-#: ../src/main.c:246
+#: ../src/main.c:245
 msgid "Show Horizontally"
 msgstr "Afficher horizontalement"
 
-#: ../src/main.c:247
+#: ../src/main.c:246
 msgid "Show Vertically"
 msgstr "Afficher verticalement"
 
-#: ../src/main.c:248
+#: ../src/main.c:247
 msgid "Hide"
 msgstr "Cacher"
 
-#: ../src/main.c:254
+#: ../src/main.c:253
 msgid "_Go"
 msgstr "A_ller"
 
-#: ../src/main.c:282
+#: ../src/main.c:281
 msgid "_Help"
 msgstr "A_ide"
 
-#: ../src/main.c:438
+#: ../src/main.c:435
 msgid "Developer:"
 msgstr "Développeur :"
 
-#: ../src/main.c:448
-msgid "Ristretto is a fast and lightweight picture-viewer for the Xfce desktop environment."
-msgstr "Ristretto est un visualiseur d'images léger et rapide pour l'environnement de bureau Xfce."
+#: ../src/main.c:445
+msgid ""
+"Ristretto is a fast and lightweight picture-viewer for the Xfce desktop "
+"environment."
+msgstr ""
+"Ristretto est un visualiseur d'images léger et rapide pour l'environnement "
+"de bureau Xfce."
 
-#: ../src/main.c:456
+#: ../src/main.c:453
 msgid "translator-credits"
-msgstr ""
+msgstr "Mike Massonnet <mmassonnet at gmail.com>"
 
-#: ../src/main.c:690
+#: ../src/main.c:687
 msgid "Open image"
 msgstr "Ouvrir une image"
 
-#: ../src/main.c:731
+#: ../src/main.c:723
+msgid "Could not open file"
+msgstr ""
+
+#: ../src/main.c:735
 msgid "Open folder"
 msgstr "Ouvrir un répertoire"
 
@@ -109,4 +117,3 @@
 
 #~ msgid "View Zoom toolbar"
 #~ msgstr "Barre de zoom"
-

Modified: ristretto/trunk/po/nl.po
===================================================================
--- ristretto/trunk/po/nl.po	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/nl.po	2007-08-29 17:23:54 UTC (rev 3090)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: ristretto 0.0.1-svn-r02537\n"
 "Report-Msgid-Bugs-To: stephan at xfce.org\n"
-"POT-Creation-Date: 2007-08-26 02:20+0200\n"
+"POT-Creation-Date: 2007-08-29 17:53+0200\n"
 "PO-Revision-Date: 2007-07-13 00:48+0200\n"
 "Last-Translator: Stephan Arts <stephan at xfce.org>\n"
 "Language-Team: Dutch\n"
@@ -16,87 +16,91 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: ../src/main.c:199
+#: ../src/main.c:198
 msgid "_File"
 msgstr "_Bestand"
 
-#: ../src/main.c:201
+#: ../src/main.c:200
 msgid "O_pen Folder"
 msgstr "Map o_penen"
 
-#: ../src/main.c:202
+#: ../src/main.c:201
 msgid "_Recently used"
 msgstr "_Recent geopend"
 
-#: ../src/main.c:221
+#: ../src/main.c:220
 msgid "_Edit"
 msgstr "B_ewerken"
 
-#: ../src/main.c:222
+#: ../src/main.c:221
 msgid "Rotate _Left"
 msgstr "_Linksom draaien"
 
-#: ../src/main.c:223
+#: ../src/main.c:222
 msgid "Rotate _Right"
 msgstr "_Rechtsom draaien"
 
-#: ../src/main.c:224
+#: ../src/main.c:223
 msgid "Flip _Vertically"
 msgstr "_Verticaal spiegelen"
 
-#: ../src/main.c:225
+#: ../src/main.c:224
 msgid "Flip _Horizontally"
 msgstr "_Horizontaal spiegelen"
 
-#: ../src/main.c:234
+#: ../src/main.c:233
 msgid "_View"
 msgstr "_Beeld"
 
-#: ../src/main.c:235
+#: ../src/main.c:234
 msgid "Thumbnail Viewer"
 msgstr "Miniatuur Weergave"
 
-#: ../src/main.c:246
+#: ../src/main.c:245
 msgid "Show Horizontally"
 msgstr "Horizontaal tonen"
 
-#: ../src/main.c:247
+#: ../src/main.c:246
 msgid "Show Vertically"
 msgstr "Verticaal tonen"
 
-#: ../src/main.c:248
+#: ../src/main.c:247
 msgid "Hide"
 msgstr "Verbergen"
 
-#: ../src/main.c:254
+#: ../src/main.c:253
 msgid "_Go"
 msgstr "_Ga"
 
-#: ../src/main.c:282
+#: ../src/main.c:281
 msgid "_Help"
 msgstr "_Help"
 
-#: ../src/main.c:438
+#: ../src/main.c:435
 msgid "Developer:"
 msgstr "Ontwikkelaar:"
 
-#: ../src/main.c:448
+#: ../src/main.c:445
 msgid ""
 "Ristretto is a fast and lightweight picture-viewer for the Xfce desktop "
 "environment."
 msgstr ""
-"Ristretto is een snelle en lichtgewicht afbeeldingsweergave-programma voor "
-"de Xfce-desktop omgeving"
+"Ristretto is een snel en lichtgewicht afbeeldingsweergave-programma voor de "
+"Xfce-desktop omgeving"
 
-#: ../src/main.c:456
+#: ../src/main.c:453
 msgid "translator-credits"
 msgstr "Stephan Arts <stephan at xfce.org>"
 
-#: ../src/main.c:690
+#: ../src/main.c:687
 msgid "Open image"
 msgstr "Afbeelding openen"
 
-#: ../src/main.c:731
+#: ../src/main.c:723
+msgid "Could not open file"
+msgstr "Kan bestand niet openen"
+
+#: ../src/main.c:735
 msgid "Open folder"
 msgstr "Map openen"
 

Modified: ristretto/trunk/po/ristretto.pot
===================================================================
--- ristretto/trunk/po/ristretto.pot	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/po/ristretto.pot	2007-08-29 17:23:54 UTC (rev 3090)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: stephan at xfce.org\n"
-"POT-Creation-Date: 2007-08-25 17:06+0200\n"
+"POT-Creation-Date: 2007-08-29 17:53+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -16,85 +16,89 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../src/main.c:199
+#: ../src/main.c:198
 msgid "_File"
 msgstr ""
 
-#: ../src/main.c:201
+#: ../src/main.c:200
 msgid "O_pen Folder"
 msgstr ""
 
-#: ../src/main.c:202
+#: ../src/main.c:201
 msgid "_Recently used"
 msgstr ""
 
-#: ../src/main.c:221
+#: ../src/main.c:220
 msgid "_Edit"
 msgstr ""
 
-#: ../src/main.c:222
+#: ../src/main.c:221
 msgid "Rotate _Left"
 msgstr ""
 
-#: ../src/main.c:223
+#: ../src/main.c:222
 msgid "Rotate _Right"
 msgstr ""
 
-#: ../src/main.c:224
+#: ../src/main.c:223
 msgid "Flip _Vertically"
 msgstr ""
 
-#: ../src/main.c:225
+#: ../src/main.c:224
 msgid "Flip _Horizontally"
 msgstr ""
 
-#: ../src/main.c:234
+#: ../src/main.c:233
 msgid "_View"
 msgstr ""
 
-#: ../src/main.c:235
+#: ../src/main.c:234
 msgid "Thumbnail Viewer"
 msgstr ""
 
-#: ../src/main.c:246
+#: ../src/main.c:245
 msgid "Show Horizontally"
 msgstr ""
 
-#: ../src/main.c:247
+#: ../src/main.c:246
 msgid "Show Vertically"
 msgstr ""
 
-#: ../src/main.c:248
+#: ../src/main.c:247
 msgid "Hide"
 msgstr ""
 
-#: ../src/main.c:254
+#: ../src/main.c:253
 msgid "_Go"
 msgstr ""
 
-#: ../src/main.c:282
+#: ../src/main.c:281
 msgid "_Help"
 msgstr ""
 
-#: ../src/main.c:438
+#: ../src/main.c:435
 msgid "Developer:"
 msgstr ""
 
-#: ../src/main.c:448
+#: ../src/main.c:445
 msgid ""
 "Ristretto is a fast and lightweight picture-viewer for the Xfce desktop "
 "environment."
 msgstr ""
 
-#: ../src/main.c:456
+#: ../src/main.c:453
 msgid "translator-credits"
 msgstr ""
 
-#: ../src/main.c:690
+#: ../src/main.c:687
 msgid "Open image"
 msgstr ""
 
-#: ../src/main.c:731
+#: ../src/main.c:723
+msgid "Could not open file"
+msgstr ""
+
+#: ../src/main.c:735
 msgid "Open folder"
 msgstr ""
 

Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/src/navigator.c	2007-08-29 17:23:54 UTC (rev 3090)
@@ -507,6 +507,12 @@
 void
 rstto_navigator_entry_set_scale (RsttoNavigatorEntry *entry, gdouble scale)
 {
+    /* Max scale 1600% */
+    if (scale > 16)
+        scale = 16;
+    /* Min scale 5% */
+    if (scale < 0.05)
+        scale = 0.05;
     entry->scale = scale;
 }
 

Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c	2007-08-29 06:39:37 UTC (rev 3089)
+++ ristretto/trunk/src/picture_viewer.c	2007-08-29 17:23:54 UTC (rev 3090)
@@ -45,15 +45,10 @@
 rstto_picture_viewer_size_allocate(GtkWidget *, GtkAllocation *);
 static void
 rstto_picture_viewer_realize(GtkWidget *);
-static void
-rstto_picture_viewer_unrealize(GtkWidget *);
 static gboolean 
 rstto_picture_viewer_expose(GtkWidget *, GdkEventExpose *);
 
 static void
-cb_rstto_picture_viewer_nav_file_changed(RsttoNavigator *nav, gint nr, RsttoNavigatorEntry *entry, RsttoPictureViewer *viewer);
-
-static void
 rstto_picture_viewer_paint(GtkWidget *widget);
 static gboolean
 rstto_picture_viewer_refresh(RsttoPictureViewer *viewer);
@@ -62,9 +57,11 @@
 rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *, GtkAdjustment *, GtkAdjustment *);
 
 static void
-cb_rstto_picture_viewer_value_changed(GtkAdjustment *adjustment, RsttoPictureViewer *viewer);
+cb_rstto_picture_viewer_nav_file_changed(RsttoNavigator *, gint , RsttoNavigatorEntry *, RsttoPictureViewer *);
 static void
-cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *viewer, GdkEventScroll *event);
+cb_rstto_picture_viewer_value_changed(GtkAdjustment *, RsttoPictureViewer *);
+static void
+cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *, GdkEventScroll *);
 
 
 static GtkWidgetClass *parent_class = NULL;
@@ -124,7 +121,6 @@
     viewer_class->set_scroll_adjustments = rstto_picture_viewer_set_scroll_adjustments;
 
     widget_class->realize = rstto_picture_viewer_realize;
-    widget_class->unrealize = rstto_picture_viewer_unrealize;
     widget_class->expose_event = rstto_picture_viewer_expose;
 
     widget_class->size_request = rstto_picture_viewer_size_request;
@@ -203,11 +199,6 @@
     gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE);
 }
 
-static void
-rstto_picture_viewer_unrealize(GtkWidget *widget)
-{
-}
-
 static gboolean
 rstto_picture_viewer_expose(GtkWidget *widget, GdkEventExpose *event)
 {
@@ -394,9 +385,11 @@
 
         if(tmp_pixbuf)
         {
+            gint dst_width = gdk_pixbuf_get_width(tmp_pixbuf)*scale;
+            gint dst_height = gdk_pixbuf_get_height(tmp_pixbuf)*scale;
             viewer->priv->dst_pixbuf = gdk_pixbuf_scale_simple(tmp_pixbuf,
-                                    gdk_pixbuf_get_width(tmp_pixbuf)*scale,
-                                    gdk_pixbuf_get_height(tmp_pixbuf)*scale,
+                                    dst_width>0?dst_width:1,
+                                    dst_height>0?dst_height:1,
                                     GDK_INTERP_BILINEAR);
             g_object_unref(tmp_pixbuf);
             tmp_pixbuf = NULL;
@@ -420,14 +413,16 @@
 void
 rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, gdouble scale)
 {
-    g_return_if_fail(scale > 0);
     RsttoNavigatorEntry *entry = rstto_navigator_get_file(viewer->priv->navigator);
-    rstto_navigator_entry_set_scale(entry, scale);
-    rstto_navigator_entry_set_fit_to_screen (entry, FALSE);
+    if (entry)
+    {
+        rstto_navigator_entry_set_scale(entry, scale);
+        rstto_navigator_entry_set_fit_to_screen (entry, FALSE);
 
-    if(rstto_picture_viewer_refresh(viewer))
-    {
-        rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+        if(rstto_picture_viewer_refresh(viewer))
+        {
+            rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+        }
     }
 }
 
@@ -435,20 +430,28 @@
 rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer)
 {
     RsttoNavigatorEntry *entry = rstto_navigator_get_file(viewer->priv->navigator);
-    rstto_navigator_entry_set_fit_to_screen (entry, TRUE);
+    if (entry)
+    {
+        rstto_navigator_entry_set_fit_to_screen (entry, TRUE);
 
-    if(rstto_picture_viewer_refresh(viewer))
-    {
-        rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+        if(rstto_picture_viewer_refresh(viewer))
+        {
+            rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+        }
+        return rstto_navigator_entry_get_scale(entry);
     }
-    return rstto_navigator_entry_get_scale(entry);
+    return 0;
 }
 
 gdouble
 rstto_picture_viewer_get_scale(RsttoPictureViewer *viewer)
 {
     RsttoNavigatorEntry *entry = rstto_navigator_get_file(viewer->priv->navigator);
-    return rstto_navigator_entry_get_scale(entry);
+    if (entry)
+    {
+        return rstto_navigator_entry_get_scale(entry);
+    }
+    return 0;
 }
 
 static gboolean
@@ -577,10 +580,12 @@
 
             if(tmp_pixbuf)
             {
-                viewer->priv->dst_pixbuf = gdk_pixbuf_scale_simple(tmp_pixbuf, 
-                                                     gdk_pixbuf_get_width(tmp_pixbuf) * scale, 
-                                                     gdk_pixbuf_get_height(tmp_pixbuf) * scale,
-                                                     GDK_INTERP_BILINEAR);
+                gint dst_width = gdk_pixbuf_get_width(tmp_pixbuf)*scale;
+                gint dst_height = gdk_pixbuf_get_height(tmp_pixbuf)*scale;
+                viewer->priv->dst_pixbuf = gdk_pixbuf_scale_simple(tmp_pixbuf,
+                                        dst_width>0?dst_width:1,
+                                        dst_height>0?dst_height:1,
+                                        GDK_INTERP_BILINEAR);
                 g_object_unref(tmp_pixbuf);
                 tmp_pixbuf = NULL;
             }
@@ -645,12 +650,18 @@
     {
         case GDK_SCROLL_UP:
         case GDK_SCROLL_LEFT:
-            rstto_picture_viewer_set_scale(viewer, scale / 1.2);
+            rstto_navigator_entry_set_scale(entry, scale / 1.2);
+            rstto_navigator_entry_set_fit_to_screen (entry, FALSE);
             break;
         case GDK_SCROLL_DOWN:
         case GDK_SCROLL_RIGHT:
-            rstto_picture_viewer_set_scale(viewer, scale * 1.2);
+            rstto_navigator_entry_set_scale(entry, scale * 1.2);
+            rstto_navigator_entry_set_fit_to_screen (entry, FALSE);
             break;
     }
+    if(rstto_picture_viewer_refresh(viewer))
+    {
+        rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+    }
 
 }




More information about the Goodies-commits mailing list