[Xfce4-commits] xfce4-settings:master Make the script work for gtk-2.0 and xfwm4 themes.

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to ed1083bd59d943e59e6d510c33c1f17879d7082d (commit)
   from 2eb6b06c424d3a97f03c872e1ac447462b20c697 (commit)

commit ed1083bd59d943e59e6d510c33c1f17879d7082d
Author: Nick Schermer n...@xfce.org
Date:   Sun Oct 23 12:23:43 2011 +0200

Make the script work for gtk-2.0 and xfwm4 themes.

 .../appearance-settings/appearance-install-theme   |  107 +++-
 dialogs/appearance-settings/main.c |   88 +++--
 2 files changed, 164 insertions(+), 31 deletions(-)

diff --git a/dialogs/appearance-settings/appearance-install-theme 
b/dialogs/appearance-settings/appearance-install-theme
old mode 100644
new mode 100755
index c52d3c2..59e10f4
--- a/dialogs/appearance-settings/appearance-install-theme
+++ b/dialogs/appearance-settings/appearance-install-theme
@@ -1,3 +1,108 @@
 #!/bin/sh
+#
+# Copyright (C) 2011 Nick Schermer n...@xfce.org
+#
+# 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-exit 0
+dndfilename=$1
+retval=0
+
+installtheme()
+{
+file=$1
+suffix=$2
+
+basedir=${file#$tmpdir/}
+themedir=${basedir%/$suffix}
+themename=`basename $themedir`
+themetype=`dirname $suffix`
+src=$tmpdir/$themedir/$themetype
+
+dest=$HOME/.themes/$themename
+if test ! -d $dest/$themetype; then
+# move theme to the users' theme directory
+mkdir -p $dest  mv $src $dest
+fi
+}
+
+# leave if no file is provided
+if test -z $dndfilename -o -z $HOME; then
+# 1: common error, should never happen
+exit 1
+fi
+
+# check file size, abort if bigger then 50Mb, only works for files
+if test x`which stat 2/dev/null` != x; then
+dndsize=`stat -c %s $dndfilename`
+if test $dndsize -gt 52428800; then
+# 2: File too big
+exit 2
+fi
+fi
+
+# provide tempdir to extract the tarball or folder
+# we try $XDG_CACHE_HOME because it is more likely this is on the
+# same partition, so moving the theme after extract is faster
+if test x`which mktemp 2/dev/null` != x; then
+tmpdir=`TMPDIR=$XDG_CACHE_HOME mktemp -d`
+else
+tmpdir=/tmp/tmp.$$.$RANDOM
+mkdir $tmpdir
+fi
+if test ! -d $tmpdir; then
+# 3: Failed to create temp directory
+exit 3
+fi
+
+# check if uri is directory or file
+if test -d $dndfilename; then
+cp -r $dndfilename $tmpdir || retval=1
+elif test -f $dndfilename; then
+case $dndfilename in
+*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tbz|*.tar)
+# extract the archive
+tar -C $tmpdir -xf $dndfilename || retval=4
+;;
+*.zip)
+# extract the archive
+unzip -d $tmpdir $dndfilename || retval=4
+;;
+*)
+# 5: unknow file format
+retval=5
+;;
+esac
+fi
+
+# detect theme type and move it to the correct location if
+# extracting or copying succeeded
+if test $retval -eq 0; then
+# install gtk-2.0 themes
+suffix=gtk-2.0/gtkrc
+find $tmpdir -path $tmpdir/*/$suffix -type f | while read file; do
+installtheme $file $suffix
+done
+
+# install xfwm4 themes
+suffix=xfwm4/themerc
+find $tmpdir -path $tmpdir/*/$suffix -type f | while read file; do
+installtheme $file $suffix
+done
+fi
+
+# cleanup
+rm -rf $tmpdir
+
+exit $retval
diff --git a/dialogs/appearance-settings/main.c 
b/dialogs/appearance-settings/main.c
index e324660..90972be 100644
--- a/dialogs/appearance-settings/main.c
+++ b/dialogs/appearance-settings/main.c
@@ -690,51 +690,79 @@ cb_theme_uri_dropped (GtkWidget*widget,
 guint   i;
 GError *error = NULL;
 gintstatus;
-GtkWidget  *toplevel;
+GtkWidget  *toplevel = gtk_widget_get_toplevel (widget);
 gchar  *filename;
+GdkCursor  *cursor;
+GdkWindow  *gdkwindow;
 
 uris = gtk_selection_data_get_uris (data);
-if (uris != NULL)
-{
-argv[0] = HELPERDIR G_DIR_SEPARATOR_S appearance-install-theme;
-argv[2] = NULL;
+if (uris == NULL)
+return;
 
-toplevel = gtk_widget_get_toplevel (widget);
+argv[0] = HELPERDIR G_DIR_SEPARATOR_S appearance-install-theme;
+argv[2] = NULL;
 
-for (i = 0; uris[i] != NULL; i++)
-{
-filename = g_filename_from_uri (uris[i], NULL, NULL);
-if 

[Xfce4-commits] xfce4-docs:xfce4-clipman-plugin-master l10n: Updated French (fr) translation to 100%

2011-10-23 Thread Transifex
Updating branch refs/heads/xfce4-clipman-plugin-master
 to 2868104c088aa75fa928843d4bb36a24d4420256 (commit)
   from f75411e91dffa760d59a056f44c04ba7a29631c3 (commit)

commit 2868104c088aa75fa928843d4bb36a24d4420256
Author: Mike Massonnet mmasson...@gmail.com
Date:   Sun Oct 23 14:34:32 2011 +0200

l10n: Updated French (fr) translation to 100%

New status: 94 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (translations.xfce.org).

 po/fr.po |  271 --
 1 files changed, 106 insertions(+), 165 deletions(-)

diff --git a/po/fr.po b/po/fr.po
index b0d20f1..a006ce5 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -3,8 +3,8 @@ msgid 
 msgstr 
 Project-Id-Version: Clipman 1.1.0svn-r07672\n
 POT-Creation-Date: 2011-10-22 22:21+0200\n
-PO-Revision-Date: 2009-11-15 18:24+0100\n
-Last-Translator: Douart Patrick patric...@laposte.net\n
+PO-Revision-Date: 2011-10-23 14:19+0200\n
+Last-Translator: Mike Massonnet mmasson...@xfce.org\n
 Language-Team: French\n
 Language: \n
 MIME-Version: 1.0\n
@@ -13,10 +13,9 @@ msgstr 
 Plural-Forms: nplurals=2; plural=(n  1);\n
 
 #. Put one translator per line, in the form NAME EMAIL, YEAR1, YEAR2
-#, fuzzy
 msgctxt _
 msgid translator-credits
-msgstr Mike Massonnet mmasson...@xfce.org, 2009
+msgstr Mike Massonnet mmasson...@xfce.org, 2009, 2011
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -26,7 +25,7 @@ msgstr Mike Massonnet mmasson...@xfce.org, 2009
 msgctxt _
 msgid 
 external ref='media/clipman-menu.png' md5='c28f907bdac5ed52c7e7895085312aeb'
-msgstr 
+msgstr ok
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -37,7 +36,7 @@ msgctxt _
 msgid 
 external ref='media/clipman-settings-general.png' 
 md5='e440eb1b5cefa5c22b53ea0a10886adc'
-msgstr 
+msgstr ok
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -48,7 +47,7 @@ msgctxt _
 msgid 
 external ref='media/clipman-settings-actions.png' 
 md5='56fd8454625ef49094f145d1badfe56f'
-msgstr 
+msgstr ok
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -59,20 +58,18 @@ msgctxt _
 msgid 
 external ref='media/clipman-action-dialog.png' 
 md5='d9c57e5f7ba0f4ee6a89d6b84682e0c1'
-msgstr 
+msgstr ok
 
 #: index.page:9(info/title)
-#, fuzzy
 msgctxt text
 msgid Clipman
-msgstr Menu Clipman
+msgstr Clipman
 
 #: index.page:10(info/desc)
 msgid User documentation
-msgstr 
+msgstr Documentation utilisateur
 
 #: index.page:17(license/p)
-#, fuzzy
 msgid 
 Permission is granted to copy, distribute and/or modify this document under 
 the terms of the GNU Free Documentation License, Version 1.3 or any later 
@@ -86,20 +83,17 @@ msgstr 
 Version 1.3 ou toute version ultérieure publiée par la Free Software 
 Foundation sans section invariante, sans texte de première de couverture, et 
 sans texte de couverture. Le texte de la licence complète est disponible sur 
-le ulink type=\http\ url=\http://www.fsf.org/\;Free Software 
-Foundation/ulink.
+le link href=\http://www.fsf.org/\;Free Software Foundation/link.
 
 #: index.page:26(page/title)
-#, fuzzy
 msgid Clipman
-msgstr Menu Clipman
+msgstr Clipman
 
 #: index.page:30(section/title)
 msgid Introduction
 msgstr Introduction
 
 #: index.page:31(section/p)
-#, fuzzy
 msgid 
 appClipman/app is a clipboard manager for appXfce/app. It keeps the 
 clipboard contents around while it is usually lost when you close an 
@@ -107,7 +101,7 @@ msgid 
 execute actions on specific text by matching them against regular 
 expressions.
 msgstr 
-@PACKAGE_NAME@ est un gestionnaire de presse-papier pour Xfce. Il conserve 
+appClipman/app est un gestionnaire de presse-papier pour appXfce/app. 
Il conserve 
 le contenu du presse-papier tandis qu'il est habituellement perdu lors de la 
 fermeture d'une application. Il est capable de gérer du texte et des images, 
 et possède une fonctionnalité pour exécuter des actions sur du texte 
@@ -132,14 +126,13 @@ msgstr 
 papier primaire qui est modifié lors des sélections de textes.
 
 #: index.page:48(section/p)
-#, fuzzy
 msgid 
 appClipman/app handles only the default clipboard, but optionnaly it can 
 also notice the selections. When it is handling the selections, the default 
 clipboard will always be synced with it and contain the same data. By this 
 meaning you can paste with the keyboard what you select on screen.
 msgstr 
-@PACKAGE_NAME@ gère uniquement le presse-papier par défaut, mais peut 
+appClipman/app gère uniquement le presse-papier par défaut, mais peut 
 également prendre en compte les sélections. Lorsqu'il gère les sélections, 
 

[Xfce4-commits] xfce4-docs:xfce4-clipman-plugin-master Update index.xsl to include translation copyright in the footer

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/xfce4-clipman-plugin-master
 to 636a47b50216c442fb57e6f15e7875ec9daefc21 (commit)
   from 2868104c088aa75fa928843d4bb36a24d4420256 (commit)

commit 636a47b50216c442fb57e6f15e7875ec9daefc21
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 14:37:44 2011 +0200

Update index.xsl to include translation copyright in the footer

 index.xsl |   17 ++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/index.xsl b/index.xsl
index 7d08e31..faf6159 100644
--- a/index.xsl
+++ b/index.xsl
@@ -102,9 +102,20 @@ includes the table of contents with links.
   xsl:param name=node/
   div class=copyrights
 xsl:for-each select=$node/mal:info/mal:credit[mal:years]
-  div class=copyright
-Copyright xsl:value-of select=concat('© ', mal:years, ' ', 
mal:name)/
-  /div
+  xsl:if test=contains(concat(' ', @type, ' '), ' author ')
+div class=copyright
+  Copyright xsl:value-of select=concat('© ', mal:years, ' ', 
mal:name)/
+/div
+  /xsl:if
+  xsl:if test=contains(concat(' ', @type, ' '), ' translator ')
+div class=copyright
+  xsl:call-template name=l10n.gettext
+xsl:with-param name=msgid select='Translation'/
+  /xsl:call-template
+  xsl:text /xsl:text
+  xsl:value-of select=concat('© ', mal:years, ' ', mal:name)/
+/div
+  /xsl:if
 /xsl:for-each
   /div
 /xsl:template
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-settings:master l10n: Updated Dutch (Flemish) (nl) translation to 100%

2011-10-23 Thread Transifex
Updating branch refs/heads/master
 to 0146afc9bb1b010e9bd739cf4b6c09b77254fc13 (commit)
   from ed1083bd59d943e59e6d510c33c1f17879d7082d (commit)

commit 0146afc9bb1b010e9bd739cf4b6c09b77254fc13
Author: Pjotr Anon pliniusmi...@gmail.com
Date:   Sun Oct 23 15:36:57 2011 +0200

l10n: Updated Dutch (Flemish) (nl) translation to 100%

New status: 296 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (translations.xfce.org).

 po/nl.po |   32 
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/po/nl.po b/po/nl.po
index 76990ba..d065cd2 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -9,7 +9,7 @@ msgid 
 msgstr 
 Project-Id-Version: xfce4-settings\n
 Report-Msgid-Bugs-To: \n
-POT-Creation-Date: 2011-09-24 10:14+\n
+POT-Creation-Date: 2011-10-23 10:07+\n
 PO-Revision-Date: 2011-09-08 22:32+0200\n
 Last-Translator: Pjotr\n
 Language-Team: Dutch (Flemish)\n
@@ -232,21 +232,21 @@ msgid pixels/sec
 msgstr pixels/sec
 
 #: ../dialogs/accessibility-settings/main.c:43
-#: ../dialogs/appearance-settings/main.c:86
+#: ../dialogs/appearance-settings/main.c:94
 #: ../dialogs/display-settings/main.c:102
 #: ../dialogs/keyboard-settings/main.c:38 ../dialogs/mouse-settings/main.c:97
 msgid Settings manager socket
 msgstr Contactpunt voor instellingenbeheer
 
 #: ../dialogs/accessibility-settings/main.c:43
-#: ../dialogs/appearance-settings/main.c:86
+#: ../dialogs/appearance-settings/main.c:94
 #: ../dialogs/display-settings/main.c:102
 #: ../dialogs/keyboard-settings/main.c:38 ../dialogs/mouse-settings/main.c:97
 msgid SOCKET ID
 msgstr CONTACTPUNT ID
 
 #: ../dialogs/accessibility-settings/main.c:44
-#: ../dialogs/appearance-settings/main.c:87
+#: ../dialogs/appearance-settings/main.c:95
 #: ../dialogs/display-settings/main.c:103
 #: ../dialogs/keyboard-settings/main.c:39 ../dialogs/mouse-settings/main.c:98
 #: ../xfce4-settings-editor/main.c:43 ../xfsettingsd/main.c:77
@@ -255,7 +255,7 @@ msgid Version information
 msgstr Versie-informatie
 
 #: ../dialogs/accessibility-settings/main.c:180
-#: ../dialogs/appearance-settings/main.c:826
+#: ../dialogs/appearance-settings/main.c:905
 #: ../dialogs/display-settings/main.c:1040
 #: ../dialogs/keyboard-settings/main.c:63
 #: ../dialogs/mouse-settings/main.c:1504 ../xfce4-settings-editor/main.c:63
@@ -265,7 +265,7 @@ msgid Type '%s --help' for usage.
 msgstr Tik '%s -- help' voor gebruiksinformatie.
 
 #: ../dialogs/accessibility-settings/main.c:199
-#: ../dialogs/appearance-settings/main.c:845
+#: ../dialogs/appearance-settings/main.c:924
 #: ../dialogs/display-settings/main.c:1059
 #: ../dialogs/keyboard-settings/main.c:79
 #: ../dialogs/mouse-settings/main.c:1523 ../xfce4-settings-editor/main.c:82
@@ -274,7 +274,7 @@ msgid The Xfce development team. All rights reserved.
 msgstr De Xfce-ontwikkelploeg. Alle rechten voorbehouden.
 
 #: ../dialogs/accessibility-settings/main.c:200
-#: ../dialogs/appearance-settings/main.c:846
+#: ../dialogs/appearance-settings/main.c:925
 #: ../dialogs/display-settings/main.c:1060
 #: ../dialogs/keyboard-settings/main.c:80
 #: ../dialogs/mouse-settings/main.c:1524 ../xfce4-settings-editor/main.c:83
@@ -394,7 +394,7 @@ msgid Menus and Buttons
 msgstr Menu's en knoppen
 
 #: ../dialogs/appearance-settings/appearance-dialog.glade.h:22
-#: ../dialogs/appearance-settings/main.c:722
+#: ../dialogs/appearance-settings/main.c:801
 #: ../dialogs/display-settings/main.c:79
 msgid None
 msgstr Geen
@@ -487,19 +487,27 @@ msgstr _Instellingen
 msgid _Toolbar Style
 msgstr _Werkbalkstijl
 
-#: ../dialogs/appearance-settings/main.c:726
+#: ../dialogs/appearance-settings/main.c:722
+msgid An unknown error occured
+msgstr Er trad een onbekende fout op
+
+#: ../dialogs/appearance-settings/main.c:729
+msgid Failed to install theme
+msgstr Kon thema niet installeren
+
+#: ../dialogs/appearance-settings/main.c:805
 msgid RGB
 msgstr RGB
 
-#: ../dialogs/appearance-settings/main.c:730
+#: ../dialogs/appearance-settings/main.c:809
 msgid BGR
 msgstr BGR
 
-#: ../dialogs/appearance-settings/main.c:734
+#: ../dialogs/appearance-settings/main.c:813
 msgid Vertical RGB
 msgstr Verticaal RGB
 
-#: ../dialogs/appearance-settings/main.c:738
+#: ../dialogs/appearance-settings/main.c:817
 msgid Vertical BGR
 msgstr Verticaal BGR
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfmpc:master Set minimum version of Valac to 0.14

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/master
 to 3687eb1c69ac4e0910e865910e5752935a426be0 (commit)
   from 2590f5347d68c6eada143c23c2eea484bb263fe7 (commit)

commit 3687eb1c69ac4e0910e865910e5752935a426be0
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 15:48:00 2011 +0200

Set minimum version of Valac to 0.14

 configure.in.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index fca3e8c..b7731db 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -62,7 +62,7 @@ dnl ***
 dnl *** Check for valac ***
 dnl ***
 if test x$USE_MAINTAINER_MODE = xyes ; then
-   AM_PROG_VALAC([0.8.0])
+   AM_PROG_VALAC([0.14.0])
if test x$VALAC = x ; then
AC_MSG_ERROR([Cannot find the valac compiler in your PATH])
fi
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfmpc:master status-icon: Restore window position between show/hide action

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/master
 to 36d22ac107e1fb4f23ecd5f1edcb5ff88c5f671e (commit)
   from 3687eb1c69ac4e0910e865910e5752935a426be0 (commit)

commit 36d22ac107e1fb4f23ecd5f1edcb5ff88c5f671e
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 16:36:01 2011 +0200

status-icon: Restore window position between show/hide action

 src/main-window.vala |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/main-window.vala b/src/main-window.vala
index a275a7b..d172484 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -144,7 +144,8 @@ namespace Xfmpc {
this.show ();
this.deiconify ();
} else {
-   this.hide ();
+   this.close_window ();
+   move (this.preferences.last_window_posx, 
this.preferences.last_window_posy);
}
}
 
@@ -216,11 +217,6 @@ namespace Xfmpc {
int posx, posy;
int width, height;
 
-   if (this.status_icon.visible) {
-   this.hide ();
-   return;
-   }
-
get_position (out posx, out posy);
get_size (out width, out height);
 
@@ -229,6 +225,11 @@ namespace Xfmpc {
this.preferences.last_window_width = width;
this.preferences.last_window_height = height;
 
+   if (this.status_icon.visible) {
+   this.hide ();
+   return;
+   }
+
main_quit ();
}
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] postler:master l10n: Initial commit.

2011-10-23 Thread Transifex
Updating branch refs/heads/master
 to b8b1cce1598cb59f5c6c8c172edb4b455e346d79 (commit)
   from 43a5dba507507dd5c5ce5ead091c3c02295b02db (commit)

commit b8b1cce1598cb59f5c6c8c172edb4b455e346d79
Author: Adolfo Jayme Barrientos fitosch...@gmail.com
Date:   Sun Oct 23 16:44:25 2011 +0200

l10n: Initial commit.

New status: 172 messages complete with 0 fuzzies and 95 untranslated.

Transmitted-via: Transifex (translations.xfce.org).

 po/{cs.po = es.po} |  511 +--
 1 files changed, 255 insertions(+), 256 deletions(-)

diff --git a/po/cs.po b/po/es.po
similarity index 72%
copy from po/cs.po
copy to po/es.po
index 3228c83..4d20fd8 100644
--- a/po/cs.po
+++ b/po/es.po
@@ -1,30 +1,30 @@
-# Czech translations for postler package
-# Copyright (C) 2011 THE PACKAGE'S COPYRIGHT HOLDER
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
-# David Štancl dsta...@dstancl.cz, 2011.
+# FIRST AUTHOR EMAIL@ADDRESS, YEAR.
 #
 msgid 
 msgstr 
-Project-Id-Version: PACKAGE VERSION\n
+Project-Id-Version: Postler\n
 Report-Msgid-Bugs-To: \n
-POT-Creation-Date: 2011-09-15 10:21+\n
-PO-Revision-Date: 2011-09-16 19:55+0100\n
-Last-Translator: David Štancl dsta...@dstancl.cz\n
-Language-Team: cs cz...@li.org\n
+POT-Creation-Date: 2011-10-23 10:11+\n
+PO-Revision-Date: 2011-10-23 09:38-0600\n
+Last-Translator: Fitoschido fitosch...@gmail.com\n
+Language-Team: Spanish Translation Team xfce-i...@xfce.org\n
+Language: Spanish\n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
 Content-Transfer-Encoding: 8bit\n
-Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n=2  n=4) ? 1 : 2;\n
-X-Poedit-Language: Czech\n
-X-Poedit-Country: CZECH REPUBLIC\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+X-Poedit-Language: Spanish\n
 
 #: ../data/postler.desktop.in.h:1
 msgid Lean mail interface
-msgstr Útlé poštovní rozhraní
+msgstr Interfaz de correo baja en grasas
 
 #: ../data/postler.desktop.in.h:2
 msgid Mail reader
-msgstr Poštovní klient
+msgstr Lector de correo
 
 #: ../data/postler.desktop.in.h:3
 #: ../postler/postler-reader.vala:44
@@ -38,50 +38,50 @@ msgstr Postler
 #: ../postler/postler-service.vala:372
 #: ../postler/postler-service.vala:379
 msgid Inbox
-msgstr Doručené
+msgstr Entrada
 
 #: ../postler/postler-accounts.vala:74
 msgid Sent
-msgstr Poslané
+msgstr Enviados
 
 #: ../postler/postler-accounts.vala:75
 msgid Drafts
-msgstr Koncepty
+msgstr Borradores
 
 #: ../postler/postler-accounts.vala:76
 msgid Outbox
-msgstr Odeslané
+msgstr Salida
 
 #: ../postler/postler-accounts.vala:77
 msgid Trash
-msgstr Koš
+msgstr Papelera
 
 #: ../postler/postler-accounts.vala:78
 msgid Archive
-msgstr Archív
+msgstr Archivo
 
 #. i18n: Junk, unsolicited bulk mail, spam
 #: ../postler/postler-accounts.vala:80
 msgid Junk
-msgstr Nevyžádané
+msgstr No deseados
 
 #: ../postler/postler-accounts.vala:176
 msgid Failed to find a root certificate file.
-msgstr Nepodařilo se najít soubor s kořenovým certifikátem.
+msgstr No se pudo encontrar un archivo de certificado raíz.
 
 #: ../postler/postler-accounts.vala:212
 msgid Config folder couldn't be created.
-msgstr Nelze vytvořit adresář s nastavením.
+msgstr No se pudo crear el directorio de configuración.
 
 #: ../postler/postler-accounts.vala:325
 #, c-format
 msgid Failed to remove \%s\
-msgstr Nepodařilo se odstranit \%s\
+msgstr No se pudo quitar «%s»
 
 #: ../postler/postler-accounts.vala:402
 #, c-format
 msgid Invalid type \%s\
-msgstr Nesprávný typ \%s\
+msgstr Tipo no válido «%s»
 
 #. i18n: File was found but can't contains invalid values
 #: ../postler/postler-accounts.vala:406
@@ -91,7 +91,7 @@ msgstr 
 
 #: ../postler/postler-accounts.vala:451
 msgid Cache folder couldn't be created.
-msgstr Nelze vytvořit složku keše.
+msgstr No se pudo crear la carpeta de caché.
 
 #: ../postler/postler-accounts.vala:462
 #: ../postler/postler-accounts.vala:605
@@ -99,56 +99,56 @@ msgstr Nelze vytvořit složku keše.
 #: ../postler/postler-accounts.vala:643
 #, c-format
 msgid Account \%s\ can't receive mail.
-msgstr Účet \%s\ nepříjímá poštu.
+msgstr 
 
 #: ../postler/postler-accounts.vala:626
 #: ../postler/postler-accounts.vala:646
 msgid Mail folder couldn't be created.
-msgstr Nelze vytvořit poštovní složku.
+msgstr No se pudo crear la carpeta de correo.
 
 #: ../postler/postler-accountsetup.vala:64
 msgid _Header:
-msgstr _Hlavička:
+msgstr _Cabecera:
 
 #: ../postler/postler-accountsetup.vala:67
 msgid _Keywords:
-msgstr _Klíčová slova:
+msgstr _Palabras clave:
 
 #: ../postler/postler-accountsetup.vala:77
 msgid Firstname Lastname
-msgstr Jméno příjmení
+msgstr Nombre Apellido
 
 #: ../postler/postler-accountsetup.vala:80
 msgid _Full Name:
-msgstr _Celé jméno:
+msgstr _Nombre completo:
 
 #: ../postler/postler-accountsetup.vala:81
 msgid em...@example.com
-msgstr jm...@priklad.cz
+msgstr 

[Xfce4-commits] postler:master l10n: Updated Spanish (Castilian) (es) translation to 67%

2011-10-23 Thread Transifex
Updating branch refs/heads/master
 to d8570df76ff2a8de2f9551d02c10beb10a0c28d9 (commit)
   from b8b1cce1598cb59f5c6c8c172edb4b455e346d79 (commit)

commit d8570df76ff2a8de2f9551d02c10beb10a0c28d9
Author: Adolfo Jayme Barrientos fitosch...@gmail.com
Date:   Sun Oct 23 16:47:51 2011 +0200

l10n: Updated Spanish (Castilian) (es) translation to 67%

New status: 181 messages complete with 0 fuzzies and 86 untranslated.

Transmitted-via: Transifex (translations.xfce.org).

 po/es.po |  107 ++---
 1 files changed, 39 insertions(+), 68 deletions(-)

diff --git a/po/es.po b/po/es.po
index 4d20fd8..a437d3f 100644
--- a/po/es.po
+++ b/po/es.po
@@ -2,7 +2,7 @@
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
 # FIRST AUTHOR EMAIL@ADDRESS, YEAR.
-#
+# 
 msgid 
 msgstr 
 Project-Id-Version: Postler\n
@@ -11,10 +11,10 @@ msgstr 
 PO-Revision-Date: 2011-10-23 09:38-0600\n
 Last-Translator: Fitoschido fitosch...@gmail.com\n
 Language-Team: Spanish Translation Team xfce-i...@xfce.org\n
-Language: Spanish\n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
 Content-Transfer-Encoding: 8bit\n
+Language: Spanish\n
 Plural-Forms: nplurals=2; plural=(n != 1);\n
 X-Poedit-Language: Spanish\n
 
@@ -26,16 +26,13 @@ msgstr Interfaz de correo baja en grasas
 msgid Mail reader
 msgstr Lector de correo
 
-#: ../data/postler.desktop.in.h:3
-#: ../postler/postler-reader.vala:44
+#: ../data/postler.desktop.in.h:3 ../postler/postler-reader.vala:44
 #: ../postler/postler-service.vala:305
 msgid Postler
 msgstr Postler
 
-#: ../postler/postler-accounts.vala:73
-#: ../postler/postler-accounts.vala:207
-#: ../postler/postler-bureau.vala:960
-#: ../postler/postler-service.vala:372
+#: ../postler/postler-accounts.vala:73 ../postler/postler-accounts.vala:207
+#: ../postler/postler-bureau.vala:960 ../postler/postler-service.vala:372
 #: ../postler/postler-service.vala:379
 msgid Inbox
 msgstr Entrada
@@ -93,16 +90,13 @@ msgstr 
 msgid Cache folder couldn't be created.
 msgstr No se pudo crear la carpeta de caché.
 
-#: ../postler/postler-accounts.vala:462
-#: ../postler/postler-accounts.vala:605
-#: ../postler/postler-accounts.vala:623
-#: ../postler/postler-accounts.vala:643
+#: ../postler/postler-accounts.vala:462 ../postler/postler-accounts.vala:605
+#: ../postler/postler-accounts.vala:623 ../postler/postler-accounts.vala:643
 #, c-format
 msgid Account \%s\ can't receive mail.
 msgstr 
 
-#: ../postler/postler-accounts.vala:626
-#: ../postler/postler-accounts.vala:646
+#: ../postler/postler-accounts.vala:626 ../postler/postler-accounts.vala:646
 msgid Mail folder couldn't be created.
 msgstr No se pudo crear la carpeta de correo.
 
@@ -240,8 +234,7 @@ msgstr Eliminar búsqueda guardada
 msgid Update Saved Search
 msgstr Actualizar búsqueda guardada
 
-#: ../postler/postler-app.vala:91
-#: ../postler/postler-bureau.vala:415
+#: ../postler/postler-app.vala:91 ../postler/postler-bureau.vala:415
 msgid New _Account
 msgstr _Cuenta nueva
 
@@ -301,8 +294,7 @@ msgstr _Recibir correo
 msgid Failed to launch external application.
 msgstr No se pudo abrir la aplicación externa.
 
-#: ../postler/postler-app.vala:195
-#: ../postler/postler-content.vala:274
+#: ../postler/postler-app.vala:195 ../postler/postler-content.vala:274
 msgid Failed to execute external command.
 msgstr No se pudo ejecutar el comando externo.
 
@@ -315,8 +307,7 @@ msgstr 
 msgid Failed to initialize.
 msgstr No se pudo inicializar.
 
-#: ../postler/postler-app.vala:238
-#: ../postler/postler-content.vala:840
+#: ../postler/postler-app.vala:238 ../postler/postler-content.vala:840
 msgid Open
 msgstr Abrir
 
@@ -349,8 +340,7 @@ msgstr _Reemplazar
 msgid translator-credits
 msgstr Fitoschido fitosch...@gmail.com, 2011
 
-#: ../postler/postler-bureau.vala:368
-#: ../postler/postler-composer.vala:491
+#: ../postler/postler-bureau.vala:368 ../postler/postler-composer.vala:491
 msgid _Mail
 msgstr _Correo
 
@@ -372,7 +362,7 @@ msgstr 
 
 #: ../postler/postler-bureau.vala:376
 msgid Reply to all recipients
-msgstr 
+msgstr Responder a todos los destinatarios
 
 #: ../postler/postler-bureau.vala:378
 msgid Forward message
@@ -384,15 +374,13 @@ msgstr Marcar mensaje como no leído
 
 #: ../postler/postler-bureau.vala:382
 msgid Flag message
-msgstr 
+msgstr Marcar mensaje
 
-#: ../postler/postler-bureau.vala:384
-#: ../postler/postler-bureau.vala:746
+#: ../postler/postler-bureau.vala:384 ../postler/postler-bureau.vala:746
 msgid Archive message
 msgstr Archivar mensaje
 
-#: ../postler/postler-bureau.vala:386
-#: ../postler/postler-bureau.vala:738
+#: ../postler/postler-bureau.vala:386 ../postler/postler-bureau.vala:738
 msgid Mark message as junk
 msgstr Marcar mensaje como no deseado
 
@@ -406,26 +394,25 @@ msgstr Cancelar la operación en los mensajes
 
 #: ../postler/postler-bureau.vala:391
 msgid _Previous 

[Xfce4-commits] xfmpc:master dbbrowser, playlist: Add Clear button in filter entry

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/master
 to bbb78934f055b7ae466a1ea0fc8638a63a5c3e8a (commit)
   from 36d22ac107e1fb4f23ecd5f1edcb5ff88c5f671e (commit)

commit bbb78934f055b7ae466a1ea0fc8638a63a5c3e8a
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 16:59:28 2011 +0200

dbbrowser, playlist: Add Clear button in filter entry

Added a clear button in order to have a visual component to show it can
be flushed away in a click (it currently works with the touch Escape).

 src/dbbrowser.vala |   15 +++
 src/playlist.vala  |   14 ++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/dbbrowser.vala b/src/dbbrowser.vala
index db32735..cc7bcf8 100644
--- a/src/dbbrowser.vala
+++ b/src/dbbrowser.vala
@@ -108,6 +108,7 @@ namespace Xfmpc {
this.search_entry = new Entry ();
this.search_entry.set_icon_from_stock 
(EntryIconPosition.PRIMARY, Gtk.Stock.FIND);
this.search_entry.set_icon_activatable 
(EntryIconPosition.PRIMARY, false);
+   this.search_entry.set_icon_activatable 
(EntryIconPosition.SECONDARY, true);
 
scrolled.add (this.treeview);
pack_start (scrolled, true, true, 0);
@@ -126,6 +127,7 @@ namespace Xfmpc {
this.search_entry.activate.connect 
(cb_search_entry_activated);
this.search_entry.key_release_event.connect 
(cb_search_entry_key_released);
this.search_entry.changed.connect 
(cb_search_entry_changed);
+   this.search_entry.icon_release.connect 
(cb_search_entry_icon_activated);
 
this.preferences.notify[song-format].connect (reload);
this.preferences.notify[song-format-custom].connect 
(reload);
@@ -457,6 +459,13 @@ namespace Xfmpc {
}
 
private void cb_search_entry_changed () {
+   if (search_entry.get_text () != ) {
+   search_entry.set_icon_from_stock 
(EntryIconPosition.SECONDARY, Gtk.Stock.CLEAR);
+   }
+   else {
+   search_entry.set_icon_from_stock 
(EntryIconPosition.SECONDARY, null);
+   }
+
if (this.search_timeout  0)
GLib.Source.remove (search_timeout);
 
@@ -467,5 +476,11 @@ namespace Xfmpc {
cb_search_entry_activated ();
return false;
}
+
+   private void cb_search_entry_icon_activated 
(Gtk.EntryIconPosition icon_pos, Gdk.Event event) {
+   if (icon_pos != Gtk.EntryIconPosition.SECONDARY)
+   return;
+   search_entry.set_text ();
+   }
}
 }
diff --git a/src/playlist.vala b/src/playlist.vala
index 1558be2..a66d652 100644
--- a/src/playlist.vala
+++ b/src/playlist.vala
@@ -117,6 +117,7 @@ namespace Xfmpc {
this.filter_entry = new Entry ();
this.filter_entry.set_icon_from_stock 
(EntryIconPosition.PRIMARY, Gtk.Stock.FIND);
this.filter_entry.set_icon_activatable 
(EntryIconPosition.PRIMARY, false);
+   this.filter_entry.set_icon_activatable 
(EntryIconPosition.SECONDARY, true);
 
scrolled.add (this.treeview);
pack_start (scrolled, true, true, 0);
@@ -135,6 +136,7 @@ namespace Xfmpc {
this.filter_entry.activate.connect 
(cb_filter_entry_activated);
this.filter_entry.key_release_event.connect 
(cb_filter_entry_key_released);
this.filter_entry.changed.connect 
(cb_filter_entry_changed);
+   this.filter_entry.icon_release.connect 
(cb_filter_entry_icon_activated);
 
this.preferences.notify[song-format].connect 
(cb_playlist_changed);
this.preferences.notify[song-format-custom].connect 
(cb_playlist_changed);
@@ -347,9 +349,21 @@ namespace Xfmpc {
}
 
private void cb_filter_entry_changed () {
+   if (filter_entry.get_text () != ) {
+   filter_entry.set_icon_from_stock 
(EntryIconPosition.SECONDARY, Gtk.Stock.CLEAR);
+   }
+   else {
+   filter_entry.set_icon_from_stock 
(EntryIconPosition.SECONDARY, null);
+   }
this.filter.refilter ();
}
 
+   private void cb_filter_entry_icon_activated 
(Gtk.EntryIconPosition icon_pos, Gdk.Event event) {
+   if (icon_pos != Gtk.EntryIconPosition.SECONDARY)
+   return;
+   

[Xfce4-commits] xfmpc:master playlist: Mimic behavior of Escape key in filter entry

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/master
 to b6638876121bfb98125bd73b4b5390f24797d7dc (commit)
   from bbb78934f055b7ae466a1ea0fc8638a63a5c3e8a (commit)

commit b6638876121bfb98125bd73b4b5390f24797d7dc
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 17:04:11 2011 +0200

playlist: Mimic behavior of Escape key in filter entry

When clicking the Clear button in the filter entry, automatically
reselect the current song.

 src/playlist.vala |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/playlist.vala b/src/playlist.vala
index a66d652..924431b 100644
--- a/src/playlist.vala
+++ b/src/playlist.vala
@@ -362,6 +362,7 @@ namespace Xfmpc {
if (icon_pos != Gtk.EntryIconPosition.SECONDARY)
return;
filter_entry.set_text ();
+   select_row (current);
}
 
/*
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfmpc:master status-icon: Fix commit 36d22a for remembering window position

2011-10-23 Thread Mike Massonnet
Updating branch refs/heads/master
 to a4813f0d5d79dd355a015261f82845fc05eec2cc (commit)
   from b6638876121bfb98125bd73b4b5390f24797d7dc (commit)

commit a4813f0d5d79dd355a015261f82845fc05eec2cc
Author: Mike Massonnet mmasson...@xfce.org
Date:   Sun Oct 23 17:10:54 2011 +0200

status-icon: Fix commit 36d22a for remembering window position

The window position was restored only when hiding the application
by clicking on the status icon, but not when closing the window.

 src/main-window.vala |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/main-window.vala b/src/main-window.vala
index d172484..a386707 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -145,7 +145,6 @@ namespace Xfmpc {
this.deiconify ();
} else {
this.close_window ();
-   move (this.preferences.last_window_posx, 
this.preferences.last_window_posy);
}
}
 
@@ -227,6 +226,7 @@ namespace Xfmpc {
 
if (this.status_icon.visible) {
this.hide ();
+   move (this.preferences.last_window_posx, 
this.preferences.last_window_posy);
return;
}
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-panel:master Directorymenu: Don't pass working dir as argument (bug #8018).

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to fad7e1e6ec57cc9a2b5719e4ef4f09514505b894 (commit)
   from d29f9ef5f49d7d0a589368a5cbeac036a6c8fe96 (commit)

commit fad7e1e6ec57cc9a2b5719e4ef4f09514505b894
Author: Nick Schermer n...@xfce.org
Date:   Sun Oct 23 18:20:37 2011 +0200

Directorymenu: Don't pass working dir as argument (bug #8018).

 plugins/directorymenu/directorymenu.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/directorymenu/directorymenu.c 
b/plugins/directorymenu/directorymenu.c
index ace2a19..b41043e 100644
--- a/plugins/directorymenu/directorymenu.c
+++ b/plugins/directorymenu/directorymenu.c
@@ -630,7 +630,7 @@ directory_menu_plugin_menu_open (GtkWidget   *mi,
   gchar   **binaries = NULL;
   guint i;
   gboolean  result = FALSE;
-  gchar*argv[3];
+  gchar*argv[2];
 
   /* try to work around the exo code and get the direct command */
   rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, xfce4/helpers.rc, TRUE);
@@ -673,8 +673,7 @@ directory_menu_plugin_menu_open (GtkWidget   *mi,
 continue;
 
   argv[0] = filename;
-  argv[1] = working_dir;
-  argv[2] = NULL;
+  argv[1] = NULL;
 
   /* try to spawn the program, if this fails we try exo for
* a decent error message */
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-panel:master Directorymenu: Properly fix previous commit.

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to ea0b61ae58fe484ebd1a5a5751998eadde92c12d (commit)
   from fad7e1e6ec57cc9a2b5719e4ef4f09514505b894 (commit)

commit ea0b61ae58fe484ebd1a5a5751998eadde92c12d
Author: Nick Schermer n...@xfce.org
Date:   Sun Oct 23 18:23:27 2011 +0200

Directorymenu: Properly fix previous commit.

The second argument was specifically for file managers,
so make this optional.

 plugins/directorymenu/directorymenu.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/plugins/directorymenu/directorymenu.c 
b/plugins/directorymenu/directorymenu.c
index b41043e..88341a5 100644
--- a/plugins/directorymenu/directorymenu.c
+++ b/plugins/directorymenu/directorymenu.c
@@ -620,7 +620,8 @@ err:
 static void
 directory_menu_plugin_menu_open (GtkWidget   *mi,
  GFile   *dir,
- const gchar *category)
+ const gchar *category,
+ gboolean path_as_arg)
 {
   GError   *error = NULL;
   gchar*working_dir;
@@ -630,7 +631,7 @@ directory_menu_plugin_menu_open (GtkWidget   *mi,
   gchar   **binaries = NULL;
   guint i;
   gboolean  result = FALSE;
-  gchar*argv[2];
+  gchar*argv[3];
 
   /* try to work around the exo code and get the direct command */
   rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, xfce4/helpers.rc, TRUE);
@@ -673,7 +674,8 @@ directory_menu_plugin_menu_open (GtkWidget   *mi,
 continue;
 
   argv[0] = filename;
-  argv[1] = NULL;
+  argv[1] = path_as_arg ? working_dir : NULL;
+  argv[2] = NULL;
 
   /* try to spawn the program, if this fails we try exo for
* a decent error message */
@@ -709,7 +711,7 @@ directory_menu_plugin_menu_open_terminal (GtkWidget *mi,
   panel_return_if_fail (GTK_IS_WIDGET (mi));
   panel_return_if_fail (G_IS_FILE (dir));
 
-  directory_menu_plugin_menu_open (mi, dir, TerminalEmulator);
+  directory_menu_plugin_menu_open (mi, dir, TerminalEmulator, FALSE);
 }
 
 
@@ -721,7 +723,7 @@ directory_menu_plugin_menu_open_folder (GtkWidget *mi,
   panel_return_if_fail (GTK_IS_WIDGET (mi));
   panel_return_if_fail (G_IS_FILE (dir));
 
-  directory_menu_plugin_menu_open (mi, dir, FileManager);
+  directory_menu_plugin_menu_open (mi, dir, FileManager, TRUE);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-panel:master Migrate: Add version based config migration.

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to 5385d9914b43ee74c0b1da093b44515777a81409 (commit)
   from 81a2d7523b779e2fbe93d632917074ff4d5613aa (commit)

commit 5385d9914b43ee74c0b1da093b44515777a81409
Author: Nick Schermer n...@xfce.org
Date:   Fri Sep 9 21:33:09 2011 +0200

Migrate: Add version based config migration.

This allows to update the configuration for new plugins.

 configure.ac.in|9 ++
 migrate/Makefile.am|2 +
 migrate/{default.xml = default.xml.in}|1 +
 migrate/main.c |  176 +++---
 migrate/migrate-46.c   |9 +-
 migrate/migrate-46.h   |4 +-
 migrate/migrate-config.c   |  184 
 migrate/{migrate-46.h = migrate-config.h} |   14 +-
 migrate/migrate-default.c  |7 +-
 panel/panel-application.c  |6 +-
 10 files changed, 319 insertions(+), 93 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 40e3245..8aa7e8c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -10,6 +10,7 @@ dnl *** Version information ***
 dnl ***
 m4_define([libxfce4panel_verinfo], [3:0:0]) dnl current:revision:age
 m4_define([libxfce4panel_version_api], [1.0])
+m4_define([xfce4_panel_config_version], [1])
 m4_define([xfce4_panel_version_major], [4])
 m4_define([xfce4_panel_version_minor], [9])
 m4_define([xfce4_panel_version_micro], [0])
@@ -96,6 +97,13 @@ AC_SUBST([LIBXFCE4PANEL_VERSION_MAJOR])
 AC_SUBST([LIBXFCE4PANEL_VERSION_MINOR])
 AC_SUBST([LIBXFCE4PANEL_VERSION_MICRO])
 
+dnl *
+dnl *** Substitute config version ***
+dnl *
+XFCE4_PANEL_CONFIG_VERSION=xfce4_panel_config_version()
+AC_DEFINE([XFCE4_PANEL_CONFIG_VERSION], xfce4_panel_config_version(), [config 
migration version])
+AC_SUBST([XFCE4_PANEL_CONFIG_VERSION])
+
 dnl **
 dnl *** Check for standard headers ***
 dnl **
@@ -254,6 +262,7 @@ libxfce4panel/Makefile
 libxfce4panel/libxfce4panel-1.0.pc
 libxfce4panel/libxfce4panel-config.h
 migrate/Makefile
+migrate/default.xml
 panel/Makefile
 wrapper/Makefile
 plugins/Makefile
diff --git a/migrate/Makefile.am b/migrate/Makefile.am
index 3fa3195..acaaa80 100644
--- a/migrate/Makefile.am
+++ b/migrate/Makefile.am
@@ -19,6 +19,8 @@ migrate_SOURCES = \
main.c \
migrate-46.c \
migrate-46.h \
+   migrate-config.c \
+   migrate-config.h \
migrate-default.c \
migrate-default.h
 
diff --git a/migrate/default.xml b/migrate/default.xml.in
similarity index 97%
rename from migrate/default.xml
rename to migrate/default.xml.in
index 3a91902..c9fdda7 100644
--- a/migrate/default.xml
+++ b/migrate/default.xml.in
@@ -1,6 +1,7 @@
 ?xml version=1.0 encoding=UTF-8?
 
 channel name=xfce4-panel version=1.0
+  property name=configver type=int value=@XFCE4_PANEL_CONFIG_VERSION@
   property name=panels type=uint value=2
 property name=panel-0 type=empty
   property name=position type=string value=p=6;x=0;y=0/
diff --git a/migrate/main.c b/migrate/main.c
index 6d2c646..3adf36e 100644
--- a/migrate/main.c
+++ b/migrate/main.c
@@ -34,8 +34,10 @@
 #include xfconf/xfconf.h
 #include libxfce4util/libxfce4util.h
 #include libxfce4ui/libxfce4ui.h
+#include libxfce4panel/xfce-panel-macros.h
 
 #include migrate/migrate-46.h
+#include migrate/migrate-config.h
 #include migrate/migrate-default.h
 
 
@@ -43,14 +45,16 @@
 gint
 main (gint argc, gchar **argv)
 {
-  gchar *file;
-  GError*error = NULL;
-  GtkWidget *dialog;
-  GtkWidget *button;
-  gint   result;
-  gint   retval = EXIT_SUCCESS;
-  gboolean   default_config_exists;
-  gint   default_response = GTK_RESPONSE_CANCEL;
+  gchar *file;
+  GError*error = NULL;
+  GtkWidget *dialog;
+  GtkWidget *button;
+  gint   result;
+  gint   retval = EXIT_SUCCESS;
+  gboolean   default_config_exists;
+  gint   default_response = GTK_RESPONSE_CANCEL;
+  XfconfChannel *channel;
+  gint   configver;
 
   /* set translation domain */
   xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, UTF-8);
@@ -60,15 +64,6 @@ main (gint argc, gchar **argv)
   g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
 #endif
 
-  /* lookup the possible configuration files */
-  file = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, XFCE_46_CONFIG);
-  default_config_exists = g_file_test (DEFAULT_CONFIG, G_FILE_TEST_IS_REGULAR);
-  if (file == NULL  !default_config_exists)
-{
-  g_warning (No default or old configuration found);
-  return EXIT_FAILURE;
-}
-
   gtk_init (argc, argv);
 
   if (!xfconf_init (error))
@@ -78,76 +73,109 @@ main (gint argc, gchar **argv)
   return EXIT_FAILURE;
 }
 
-  /* check if we auto-migrate the default 

[Xfce4-commits] xfce4-panel:nick/actions-plugin Deleting branch nick/actions-plugin

2011-10-23 Thread well, not really
Deleting branch refs/heads/nick/actions-plugin

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-session:nick/xfce-utils-merge Deleting branch nick/xfce-utils-merge

2011-10-23 Thread well, not really
Deleting branch refs/heads/nick/xfce-utils-merge

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-session:master Fix dist-check.

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to 48ceeac682c132464446240da7f1c6af300736bb (commit)
   from 539589ad6d106ff94e6b4ca6a2008a150ded6eb5 (commit)

commit 48ceeac682c132464446240da7f1c6af300736bb
Author: Nick Schermer n...@xfce.org
Date:   Sun Oct 23 18:40:54 2011 +0200

Fix dist-check.

 Makefile.am |3 ++-
 scripts/Makefile.am |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c505274..ce99958 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,6 +54,7 @@ ChangeLog: Makefile
 dist-hook: ChangeLog
 
 DISTCHECK_CONFIGURE_FLAGS =\
-   --enable-gen-doc
+   --enable-gen-doc\
+   --with-xsession-prefix=/tmp/$(PACKAGE)-distcheck
 
 # vi:set ts=8 sw=8 noet ai nocindent:
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b1b4b6e..4a1c328 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -27,7 +27,8 @@ conffiles_DATA = \
 EXTRA_DIST = \
startxfce4.in \
xinitrc.in \
-   Xft.xrdb
+   Xft.xrdb \
+   xflock4
 
 DISTCLEANFILES = \
startxfce4 \
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-session:master Remove the xfce4-panel logout menu plugin.

2011-10-23 Thread Nick Schermer
Updating branch refs/heads/master
 to 539589ad6d106ff94e6b4ca6a2008a150ded6eb5 (commit)
   from 1a965d018a46c7e58cc2016f669e28e6ab623976 (commit)

commit 539589ad6d106ff94e6b4ca6a2008a150ded6eb5
Author: Nick Schermer n...@xfce.org
Date:   Sun Oct 23 18:37:43 2011 +0200

Remove the xfce4-panel logout menu plugin.

Functionality of this plugin has been integrated in the
actions plugin of xfce4-panel.

 Makefile.am|9 +-
 configure.in.in|   11 -
 panel-plugin/Makefile.am   |   66 -
 panel-plugin/xfsm-logout-plugin-ui.xml |   15 -
 panel-plugin/xfsm-logout-plugin.c  |  420 
 panel-plugin/xfsm-logout-plugin.desktop.in |7 -
 po/POTFILES.in |2 -
 7 files changed, 1 insertions(+), 529 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a7334e4..c505274 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,3 @@
-# $Id$
-
 SUBDIRS =  \
libxfsm \
doc \
@@ -10,12 +8,7 @@ SUBDIRS = 
\
scripts \
xfce4-session   \
xfce4-session-logout\
-   xfsm-shutdown-helper\
-   $(panel_plugin_dir)
-
-if HAVE_LIBXFCE4PANEL
-panel_plugin_dir = panel-plugin
-endif
+   xfsm-shutdown-helper
 
 desktopdir = $(XSESSION_PREFIX)/share/xsessions
 desktop_in_files = xfce.desktop.in
diff --git a/configure.in.in b/configure.in.in
index 8eff947..1d10454 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -91,10 +91,6 @@ XDT_CHECK_PACKAGE([DBUS], [dbus-1], [1.0.0])
 XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.73])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.8.0])
 
-dnl we provide a panel plugin now
-XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0],
-   [panel-plugin], [Panel logout menu button], [yes])
-
 dnl Check for gnome support
 XDT_CHECK_OPTIONAL_PACKAGE([GNOME_KEYRING], [gnome-keyring-1], [2.22],
[libgnome-keyring],
@@ -284,7 +280,6 @@ icons/128x128/Makefile
 icons/scalable/Makefile
 libxfsm/Makefile
 libxfsm/xfce4-session-2.0.pc
-panel-plugin/Makefile
 po/Makefile.in
 settings/Makefile
 scripts/Makefile
@@ -328,12 +323,6 @@ echo  * Legacy session management:  yes
 else
 echo  * Legacy session management:  no
 fi
-if test x$LIBXFCE4PANEL_FOUND = xyes; then
-echo  * Panel plugin:   yes
-else
-echo  * Panel plugin:   no
-fi
-echo
 if test x$GNOME_KEYRING_FOUND = xyes; then
 echo  * Gnome Keyring support:  yes
 else
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
deleted file mode 100644
index 0675e2e..000
--- a/panel-plugin/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-
-INCLUDES = \
-   -I$(top_srcdir) \
-   -DLOCALEDIR=\$(localedir)\ \
-   -DG_LOG_DOMAIN=\libxfsm-logout-plugin\
-
-plugindir = $(libdir)/xfce4/panel/plugins
-
-plugin_LTLIBRARIES = libxfsm-logout-plugin.la
-
-libxfsm_logout_plugin_built_sources = \
-   xfsm-logout-plugin-ui.h
-
-libxfsm_logout_plugin_la_SOURCES = \
-   $(libxfsm_logout_plugin_built_sources) \
-   xfsm-logout-plugin.c
-
-libxfsm_logout_plugin_la_CFLAGS = \
-   $(LIBX11_CFLAGS) \
-   $(LIBXFCE4PANEL_CFLAGS) \
-   $(LIBXFCE4UTIL_CFLAGS) \
-   $(LIBXFCE4UI_CFLAGS) \
-   $(GTK_CFLAGS) \
-   $(DBUS_GLIB_CFLAGS)
-
-libxfsm_logout_plugin_la_LIBADD = \
-   $(LIBX11_LIBS) \
-   $(LIBXFCE4PANEL_LIBS) \
-   $(LIBXFCE4UTIL_LIBS) \
-   $(LIBXFCE4UI_LIBS) \
-   $(GTK_LIBS) \
-   $(DBUS_GLIB_LIBS)
-
-libxfsm_logout_plugin_la_LDFLAGS = \
-   -avoid-version \
-   -module \
-   -no-undefined \
-   -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)'
-
-#
-# .desktop file
-#
-desktopdir = $(datadir)/xfce4/panel-plugins
-desktop_in_files = xfsm-logout-plugin.desktop.in
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = \
-   xfsm-logout-plugin-ui.xml \
-   $(desktop_in_files)
-
-DISTCLEANFILES = \
-   $(desktop_DATA)
-
-if MAINTAINER_MODE
-BUILT_SOURCES = \
-   $(libxfsm_logout_plugin_built_sources)
-
-DISTCLEANFILES += \
-   $(libxfsm_logout_plugin_built_sources)
-
-xfsm-logout-plugin-ui.h: $(srcdir)/xfsm-logout-plugin-ui.xml Makefile
-   $(AM_V_GEN) exo-csource --static --strip-comments --strip-content 
--name=logout_plugin_ui $  $@
-endif
-
-# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/xfsm-logout-plugin-ui.xml 

[Xfce4-commits] ristretto|ristretto-0.1.2 Creating annotated tag ristretto-0.1.2

2011-10-23 Thread Stephan Arts
Updating annotated tag refs/tags/ristretto-0.1.2
 as new annotated tag
 to 35390a7b6be35089694a4ed0a4da5cb8b1b20239 (tag)
   succeeds ristretto-0.1.1
  tagged by Stephan Arts step...@xfce.org
 on 2011-10-23 18:32 +0200

Stephan Arts (4):
  Fix bug #8036
  Add some rounding fixes and a debug statement
  Bump version number
  Increase version number to 0.1.2, update NEWS

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Initial Commit

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 64cb5958270db4126e75a42cdf99838485501c14 (commit)
   from 64cb5958270db4126e75a42cdf99838485501c14^1 ()


___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add a preload state to the pictureviewer, where it will render the thumbnail instead of the original image.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to d4e2a5d7d9d203d5477a3dad227c1d7849b80df4 (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit d4e2a5d7d9d203d5477a3dad227c1d7849b80df4
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 01:08:31 2009 +0100

Add a preload state to the pictureviewer, where it will render the 
thumbnail instead of the original image.

 src/picture_viewer.c |  232 ++
 1 files changed, 44 insertions(+), 188 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index c88bbc6..6a75a07 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -56,6 +56,8 @@ struct _RsttoPictureViewerPriv
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
+gdouble  scale;
+
 struct
 {
 gdouble x;
@@ -674,207 +676,61 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
 GtkWidget *widget = GTK_WIDGET(viewer);
 GdkPixbuf *src_pixbuf = NULL;
+GdkPixbuf *thumb_pixbuf = NULL;
 gboolean *fit_to_screen = NULL;
 gdouble *scale = NULL;
-gboolean changed = TRUE;
+gint width = 0, height = 0;
 
-if (viewer-priv-image)
+if (viewer-priv-state == RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
 {
-fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
-scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+if (viewer-priv-image != NULL);
+{   
+src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
+thumb_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
 
-src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-
-if (viewer-priv-state == RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
-{
-src_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
-}
-if (src_pixbuf != NULL)
-{
-g_object_ref (src_pixbuf);
-}
-else
-{
-if(viewer-priv-dst_pixbuf)
+if (src_pixbuf)
 {
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
+width = gdk_pixbuf_get_width (src_pixbuf);
+height = gdk_pixbuf_get_height (src_pixbuf);
+
+/* Check if the image fits inside the viewer,
+ * if not, scale it down to fit
+ */
+if ((GTK_WIDGET (viewer)-allocation.width  width) ||
+(GTK_WIDGET (viewer)-allocation.height  height))
+{
+/* The image does not fit the picture-viewer, and 
+ * we decided to scale it down to fit. Now we need to check
+ * which side we need to use as a reference.
+ *
+ * We use the one that produces a larger scale difference
+ * to the viewer.
+ */
+if ((GTK_WIDGET (viewer)-allocation.width / width) 
+(GTK_WIDGET (viewer)-allocation.height / height))
+{
+viewer-priv-scale = GTK_WIDGET 
(viewer)-allocation.width / width;
+}
+else
+{
+viewer-priv-scale = GTK_WIDGET 
(viewer)-allocation.height / height;
+}
+}
+else
+{
+/* The image is smaller then the picture-viewer,
+ * As a result, view it at it's original size.
+ */
+viewer-priv-scale = 1.0;
+}
 }
-return changed;
 }
 }
 else
 {
-if(viewer-priv-dst_pixbuf)
-{
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
-}
-return changed;
-}
-
-
-if (scale == NULL)
-scale = g_new0 (gdouble, 1);
-if (fit_to_screen == NULL)
-fit_to_screen = g_new0 (gboolean , 1);
-
-
-gboolean vadjustment_changed = FALSE;
-gboolean hadjustment_changed = FALSE;
-
-gdouble width = (gdouble)gdk_pixbuf_get_width(src_pixbuf);
-gdouble height = (gdouble)gdk_pixbuf_get_height(src_pixbuf);
-
-if (*scale == 0)
-{
-if ((widget-allocation.width  width)  (widget-allocation.height  
height))
-{
-*scale = 1.0;
-*fit_to_screen = FALSE;
 
-g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
-}
-else
-{
-*fit_to_screen = TRUE;
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, 

[Xfce4-commits] ristretto:ristretto-0.0 Add missing main_window_ui.xml file from svn

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)
   from 64cb5958270db4126e75a42cdf99838485501c14 (commit)

commit 7d29665d25fe6356853220c6a2e3506fe02d9635
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 00:15:57 2009 +0100

Add missing main_window_ui.xml file from svn

 src/main_window_ui.xml |   74 
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
new file mode 100644
index 000..2004b83
--- /dev/null
+++ b/src/main_window_ui.xml
@@ -0,0 +1,74 @@
+ui
+!--
+
+
+--
+menubar name=main-menu
+menu action=file-menu
+menuitem action=open/
+menuitem action=open-folder/
+menu action=open-recent-menu
+placeholder name=placeholder-open-recent/
+/menu
+separator/
+menuitem action=file-properties/
+separator/
+menuitem action=close/
+menuitem action=close-all/
+menuitem action=quit/
+/menu
+menu action=edit-menu
+menu action=open-with-menu
+placeholder name=open-with-apps /
+/menu
+separator/
+menuitem action=preferences/
+/menu
+menu action=view-menu
+menuitem action=show-toolbar/
+menuitem action=show-thumbnailbar/
+separator/
+menu action=zoom-menu
+menuitem action=zoom-in/
+menuitem action=zoom-out/
+menuitem action=zoom-fit/
+menuitem action=zoom-100/
+/menu
+menu action=rotation-menu
+menuitem action=rotate-cw/
+menuitem action=rotate-ccw/
+/menu
+separator/
+menuitem action=fullscreen/
+menuitem action=set-as-wallpaper/
+/menu
+menu action=go-menu
+menuitem action=back/
+menuitem action=forward/
+menuitem action=first/
+menuitem action=last/
+separator/
+placeholder name=placeholder-slideshow /
+/menu
+menu action=help-menu
+menuitem action=contents/
+menuitem action=about/
+/menu
+/menubar
+
+!--
+
+
+--
+toolbar name=main-toolbar
+toolitem action=open/
+separator /
+toolitem action=back/
+toolitem action=forward/
+separator name=placeholder-1/
+toolitem action=zoom-in/
+toolitem action=zoom-out/
+toolitem action=zoom-100/
+toolitem action=zoom-fit/
+/toolbar
+/ui
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add some more comments Add a recent-filter to the recent-chooser (only filter the files opened by ristretto) Actually open files from the recent-chooser

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 73a8d7229f688d4b796117843b97b0101c1f5fdc (commit)
   from f4223148a6df935fa94da97a94ec04e89c0f29db (commit)

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

 src/main_window.c  |   98 +++-
 src/main_window_ui.xml |2 +-
 2 files changed, 81 insertions(+), 19 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index c859cdb..96d64f3 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -148,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,24 +284,32 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
 window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
 window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
 
+/**
+ * Add a filter to the recent-chooser
+ */
+recent_filter = gtk_recent_filter_new();
+gtk_recent_filter_add_application (recent_filter, ristretto);
+
gtk_recent_chooser_add_filter(GTK_RECENT_CHOOSER(window-priv-recent_action), 
recent_filter);
+
 /* Add the same accelerator path to play and pause, so the same 
kb-shortcut will be used for starting and stopping the slideshow */
 gtk_action_set_accel_path (window-priv-pause_action, 
Actions/RsttoWindow/play);
 gtk_action_set_accel_path (window-priv-play_action, 
Actions/RsttoWindow/play);
+
 /* Add the play and pause actions to the actiongroup */
+window-priv-action_group = gtk_action_group_new (RsttoWindow);
 gtk_action_group_add_action (window-priv-action_group,
  window-priv-play_action);
 gtk_action_group_add_action (window-priv-action_group,
@@ -308,6 +319,7 @@ rstto_main_window_init (RsttoMainWindow *window)
 /* Connect signal-handlers */
 g_signal_connect(G_OBJECT(window-priv-play_action), activate, 
G_CALLBACK(cb_rstto_main_window_play), window);
 g_signal_connect(G_OBJECT(window-priv-pause_action), activate, 
G_CALLBACK(cb_rstto_main_window_pause), window);
+g_signal_connect(G_OBJECT(window-priv-recent_action), item-activated, 
G_CALLBACK(cb_rstto_main_window_open_recent), window);
 
 gtk_ui_manager_insert_action_group (window-priv-ui_manager, 
window-priv-action_group, 0);
 
@@ -319,10 +331,17 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-menubar = gtk_ui_manager_get_widget 
(window-priv-ui_manager, /main-menu);
 window-priv-toolbar = gtk_ui_manager_get_widget 
(window-priv-ui_manager, /main-toolbar);
 
-separator = gtk_ui_manager_get_widget (window-priv-ui_manager, 

[Xfce4-commits] ristretto:ristretto-0.0 Implemented 'open folder'.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 1d06647dac89feb4e0eb82ac437b7710b7753b8c (commit)
   from 73a8d7229f688d4b796117843b97b0101c1f5fdc (commit)

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

 src/main_window.c |   70 ++---
 1 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 96d64f3..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -850,6 +850,7 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window)
 GFile *file;
 GSList *files = NULL, *_files_iter;
 GValue current_uri_val = {0, };
+gchar *uri = NULL;
 
 g_value_init (current_uri_val, G_TYPE_STRING);
 g_object_get_property (G_OBJECT(window-priv-settings_manager), 
current-uri, current_uri_val);
@@ -891,6 +892,13 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_dialog_run(GTK_DIALOG(dialog));
 gtk_widget_destroy(dialog);
 }
+else
+{
+uri = g_file_get_uri (_files_iter-data);
+gtk_recent_manager_add_item (window-priv-recent_manager, 
uri);
+g_free (uri);
+uri = NULL;
+}
 _files_iter = g_slist_next (_files_iter);
 }
 g_value_set_string (current_uri_val, 
gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (dialog)));
@@ -918,7 +926,11 @@ static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window)
 {
 gint response;
-GFile *file = NULL;
+GFile *file = NULL, *child_file = NULL;
+GFileEnumerator *file_enumarator = NULL;
+GFileInfo *file_info = NULL;
+const gchar *filename = NULL;
+gchar *uri = NULL;
 GValue current_uri_val = {0, };
 
 g_value_init (current_uri_val, G_TYPE_STRING);
@@ -937,6 +949,23 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_widget_hide(dialog);
 file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
 
+file_enumarator = g_file_enumerate_children (file, standard::name, 
0, NULL, NULL);
+while (file_info = g_file_enumerator_next_file (file_enumarator, NULL, 
NULL))
+{
+filename = g_file_info_get_name (file_info);
+child_file = g_file_get_child (file, filename);
+
+rstto_navigator_add_file (window-priv-props.navigator, 
child_file, NULL);
+
+g_object_unref (child_file);
+g_object_unref (file_info);
+}
+
+uri = g_file_get_uri (file);
+gtk_recent_manager_add_item (window-priv-recent_manager, uri);
+g_free (uri);
+uri = NULL;
+
 g_value_set_string (current_uri_val, 
gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (dialog)));
 g_object_set_property (G_OBJECT(window-priv-settings_manager), 
current-uri, current_uri_val);
 }
@@ -958,17 +987,40 @@ cb_rstto_main_window_open_recent(GtkRecentChooser 
*chooser, RsttoMainWindow *win
 {
 GtkWidget *dialog, *err_dialog;
 gchar *uri = gtk_recent_chooser_get_current_uri (chooser);
+const gchar *filename;
 GFile *file = g_file_new_for_uri (uri);
+GFile *child_file;
+GFileEnumerator *file_enumarator = NULL;
+GFileInfo *child_file_info = NULL;
+GFileInfo *file_info = g_file_query_info (file, standard::type, 0, NULL, 
NULL);
 
-if (rstto_navigator_add_file (window-priv-props.navigator, file, NULL) 
== FALSE)
+if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
 {
-err_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
-GTK_DIALOG_MODAL,
-GTK_MESSAGE_ERROR,
-GTK_BUTTONS_OK,
-_(Could not open file));
-gtk_dialog_run(GTK_DIALOG(dialog));
-gtk_widget_destroy(dialog);
+file_enumarator = g_file_enumerate_children (file, standard::name, 
0, NULL, NULL);
+while (child_file_info = g_file_enumerator_next_file (file_enumarator, 
NULL, NULL))
+{
+filename = g_file_info_get_name (child_file_info);
+child_file = g_file_get_child (file, filename);
+
+rstto_navigator_add_file (window-priv-props.navigator, 
child_file, NULL);
+
+g_object_unref (child_file);
+g_object_unref (child_file_info);
+}
+
+}
+else
+{
+if (rstto_navigator_add_file (window-priv-props.navigator, file, 
NULL) == FALSE)
+{
+err_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+GTK_DIALOG_MODAL,
+GTK_MESSAGE_ERROR,

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'recent_menu'

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to ce3185bf18ad773e073ab83e87354f7c4da9507c (commit)
   from 3f8ba01f6df517764a03802d145dfcf18bf14fbc (commit)

commit ce3185bf18ad773e073ab83e87354f7c4da9507c
Merge: 3f8ba01 1d06647
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:59:21 2009 +0100

Merge branch 'recent_menu'

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |  165 ++--
 src/main_window_ui.xml |6 +-
 2 files changed, 148 insertions(+), 23 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -147,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -185,7 +188,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,29 +284,42 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
+window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
+
+

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'master' into new_picture_viewer

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 9a99870c75f66aa963e22434ff4f1c5fc2a521f4 (commit)
   from c2e9b6b2e7c036f6e144318f9856ed44c28e69ae (commit)

commit 9a99870c75f66aa963e22434ff4f1c5fc2a521f4
Merge: c2e9b6b ce3185b
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 11:06:54 2009 +0100

Merge branch 'master' into new_picture_viewer

commit ce3185bf18ad773e073ab83e87354f7c4da9507c
Merge: 3f8ba01 1d06647
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:59:21 2009 +0100

Merge branch 'recent_menu'

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |  165 ++--
 src/main_window_ui.xml |6 +-
 2 files changed, 148 insertions(+), 23 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -147,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -185,7 +188,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,29 +284,42 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'master' into new_picture_viewer

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to c2e9b6b2e7c036f6e144318f9856ed44c28e69ae (commit)
   from d4e2a5d7d9d203d5477a3dad227c1d7849b80df4 (commit)

commit c2e9b6b2e7c036f6e144318f9856ed44c28e69ae
Merge: d4e2a5d 3f8ba01
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:26:25 2009 +0100

Merge branch 'master' into new_picture_viewer

commit 3f8ba01f6df517764a03802d145dfcf18bf14fbc
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:22:56 2009 +0100

Remove autogenerated header file from git

 src/main_window_ui.h |   37 -
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu action=\file-menu\menuitem ac
-  tion=\open\/menuitem action=\open-folder\/menu action=\open-re
-  cent-menu\placeholder name=\placeholder-open-recent\//menusepa
-  rator/menuitem action=\file-properties\/separator/menuitem acti
-  on=\close\/menuitem action=\close-all\/menuitem action=\quit\
-  //menumenu action=\edit-menu\menu action=\open-with-menu\pl
-  aceholder name=\open-with-apps\ //menuseparator/menuitem action
-  =\preferences\//menumenu action=\view-menu\menuitem action=\
-  show-toolbar\/menuitem action=\show-thumbnailbar\/separator/me
-  nu action=\zoom-menu\menuitem action=\zoom-in\/menuitem action=
-  \zoom-out\/menuitem action=\zoom-fit\/menuitem action=\zoom-10
-  0\//menumenu action=\rotation-menu\menuitem action=\rotate-cw
-  \/menuitem action=\rotate-ccw\//menuseparator/menuitem actio
-  n=\fullscreen\/menuitem action=\set-as-wallpaper\//menumenu a
-  ction=\go-menu\menuitem action=\back\/menuitem action=\forward
-  \/menuitem action=\first\/menuitem action=\last\/separator/
-  placeholder name=\placeholder-slideshow\ //menumenu action=\hel
-  p-menu\menuitem action=\contents\/menuitem action=\about\//m
-  enu/menubartoolbar name=\main-toolbar\toolitem action=\open\/
-  separator /toolitem action=\back\/toolitem action=\forward\/
-  separator name=\placeholder-1\/toolitem action=\zoom-in\/tooli
-  tem action=\zoom-out\/toolitem action=\zoom-100\/toolitem actio
-  n=\zoom-fit\//toolbar/ui
-};
-
-static const unsigned main_window_ui_length = 1503u;
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add some rudimentary preview support

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 58bee9be96336fe2448bae3f8f9906eaa2055169 (commit)
   from 9a99870c75f66aa963e22434ff4f1c5fc2a521f4 (commit)

commit 58bee9be96336fe2448bae3f8f9906eaa2055169
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 16:08:42 2009 +0100

Add some rudimentary preview support

 src/image.c  |   42 +--
 src/picture_viewer.c |  199 --
 2 files changed, 178 insertions(+), 63 deletions(-)

diff --git a/src/image.c b/src/image.c
index d5d3785..3ca403d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -401,14 +401,13 @@ rstto_image_load (RsttoImage *image, gboolean 
empty_cache, GError **error)
 /*g_signal_connect(image-priv-loader, area-updated, 
G_CALLBACK(cb_rstto_image_area_updated), image);*/
 g_signal_connect(image-priv-loader, closed, 
G_CALLBACK(cb_rstto_image_closed), image);
 
-rstto_image_cache_push_image (cache, image);
-
g_file_read_async (image-priv-file, 0, NULL, 
(GAsyncReadyCallback)cb_rstto_image_read_file_ready, image);
 }
 else
 {
-rstto_image_cache_push_image (cache, image);
+//g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
+rstto_image_cache_push_image (cache, image);
 return TRUE;
 }
 
@@ -616,8 +615,22 @@ cb_rstto_image_area_prepared (GdkPixbufLoader *loader, 
RsttoImage *image)
 {
 image-priv-iter = NULL;
 }
+
+if (image-priv-iter)
+{
+image-priv-pixbuf = gdk_pixbuf_animation_iter_get_pixbuf 
(image-priv-iter);
+g_object_ref (image-priv-pixbuf);
+}
+else
+{
+if (image-priv-loader)
+{
+image-priv-pixbuf = gdk_pixbuf_loader_get_pixbuf 
(image-priv-loader);
+g_object_ref (image-priv-pixbuf);
+}
+}
+
 g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_PREPARED], 0, image, NULL);
-g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
 
 /**
@@ -636,31 +649,12 @@ cb_rstto_image_closed (GdkPixbufLoader *loader, 
RsttoImage *image)
 GdkPixbuf *pixbuf = NULL;
 RsttoImageTransformation *transformation = NULL;
 
-if (image-priv-pixbuf)
-{
-g_object_unref(image-priv-pixbuf);
-image-priv-pixbuf = NULL;
-}
-
-if (image-priv-iter)
-{
-pixbuf = gdk_pixbuf_animation_iter_get_pixbuf (image-priv-iter);
-}
-else
-{
-if (image-priv-loader)
-{
-pixbuf = gdk_pixbuf_loader_get_pixbuf (image-priv-loader);
-}
-}
-
 g_object_unref (image-priv-loader);
 image-priv-loader = NULL;
 

-if (pixbuf != NULL)
+if (image-priv-pixbuf != NULL)
 {
-image-priv-pixbuf = pixbuf;
 /* Get to the bottom of the transformation list */
 GList *transform_iter = g_list_last (image-priv-transformations);
 while (transform_iter != NULL)
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6a75a07..b4828e4 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -675,60 +675,179 @@ static gboolean
 rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
 GtkWidget *widget = GTK_WIDGET(viewer);
-GdkPixbuf *src_pixbuf = NULL;
+GdkPixbuf *src_pixbuf = NULL, *tmp_pixbuf = NULL;
 GdkPixbuf *thumb_pixbuf = NULL;
 gboolean *fit_to_screen = NULL;
-gdouble *scale = NULL;
+gdouble *scale = NULL; 
 gint width = 0, height = 0;
 
-if (viewer-priv-state == RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
+/**
+ * Get all the required image peripherals
+ */
+if (viewer-priv-image != NULL)
+{   
+src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
+thumb_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
+
+width = gdk_pixbuf_get_width(src_pixbuf);
+height = gdk_pixbuf_get_height(src_pixbuf);
+
+fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
+scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+}
+
+if (scale == NULL)
+scale = g_new0 (gdouble, 1);
+
+if (fit_to_screen == NULL)
+fit_to_screen = g_new0 (gboolean, 1);
+
+/**
+ * Clean up the destination pixbuf, since we are going to re-create it
+ * anyway
+ */
+if(viewer-priv-dst_pixbuf)
 {
-if (viewer-priv-image != NULL);
-{   
-src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-thumb_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
+g_object_unref(viewer-priv-dst_pixbuf);
+viewer-priv-dst_pixbuf = NULL;
+}
 
-if (src_pixbuf)
+/**
+ * If Scale == 0, this means the image has not been rendered before.
+ * When this is the case, we render the image at 100% unless it is
+ * larger thenthe 

[Xfce4-commits] ristretto:ristretto-0.0 Fix the adjustment settings

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f28d501a4b94c752e2ad1e6ab4c8d06086a57907 (commit)
   from 58bee9be96336fe2448bae3f8f9906eaa2055169 (commit)

commit f28d501a4b94c752e2ad1e6ab4c8d06086a57907
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 16:38:56 2009 +0100

Fix the adjustment settings

 src/picture_viewer.c |   80 +
 1 files changed, 54 insertions(+), 26 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index b4828e4..5b203ba 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -680,6 +680,8 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 gboolean *fit_to_screen = NULL;
 gdouble *scale = NULL; 
 gint width = 0, height = 0;
+gboolean vadjustment_changed = FALSE;
+gboolean hadjustment_changed = FALSE;
 
 /**
  * Get all the required image peripherals
@@ -775,37 +777,60 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 
 if(*fit_to_screen)
 {
-gdouble h_scale = (gdouble)GTK_WIDGET(viewer)-allocation.width / 
(gdouble)width;
-gdouble v_scale = (gdouble)GTK_WIDGET(viewer)-allocation.height / 
(gdouble)height;
-if(h_scale  v_scale)
+/* The image does not fit the picture-viewer, and 
+ * we decided to scale it down to fit. Now we need to check
+ * which side we need to use as a reference.
+ *
+ * We use the one that produces a larger scale difference
+ * to the viewer. This way we know the image will always fit.
+ */
+if ((GTK_WIDGET (viewer)-allocation.width / width) 
+(GTK_WIDGET (viewer)-allocation.height / height))
 {
-if(*scale != h_scale)
-{
-*scale = h_scale;
-}
+*scale = (gdouble)GTK_WIDGET (viewer)-allocation.width / 
(gdouble)width;
 }
 else
 {
-if(*scale != v_scale)
-{
-*scale = v_scale;
-}
+*scale = (gdouble)GTK_WIDGET (viewer)-allocation.height / 
(gdouble)height;
 }
+
 g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 }
 }
 
 if (GTK_WIDGET_REALIZED (widget))
 {
-if (viewer-vadjustment  viewer-hadjustment)
+if (viewer-hadjustment  viewer-hadjustment)
 {
 viewer-hadjustment-page_size = widget-allocation.width;
 viewer-hadjustment-upper = width * (*scale);
-viewer-hadjustment-value = 0;
+viewer-hadjustment-lower = 0;
+
+if((viewer-hadjustment-value + viewer-hadjustment-page_size)  
viewer-hadjustment-upper)
+{
+viewer-hadjustment-value = viewer-hadjustment-upper - 
viewer-hadjustment-page_size;
+hadjustment_changed = TRUE;
+}
+if(viewer-hadjustment-value  viewer-hadjustment-lower)
+{
+viewer-hadjustment-value = viewer-hadjustment-lower;
+hadjustment_changed = TRUE;
+}
 
 viewer-vadjustment-page_size = widget-allocation.height;
 viewer-vadjustment-upper = height * (*scale);
-viewer-vadjustment-value = 0;
+viewer-vadjustment-lower = 0;
+
+if((viewer-vadjustment-value + viewer-vadjustment-page_size)  
viewer-vadjustment-upper)
+{
+viewer-vadjustment-value = viewer-vadjustment-upper - 
viewer-vadjustment-page_size;
+vadjustment_changed = TRUE;
+}
+if(viewer-vadjustment-value  viewer-vadjustment-lower)
+{
+viewer-vadjustment-value = viewer-vadjustment-lower;
+vadjustment_changed = TRUE;
+}
 
 }
 
@@ -821,22 +846,17 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
 if (src_pixbuf)
 {
-viewer-priv-dst_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf,
-
(gint)((gdouble)width * (*scale)),
-
(gint)((gdouble)height * (*scale)),
-
GDK_INTERP_BILINEAR);
-/*
 tmp_pixbuf = gdk_pixbuf_new_subpixbuf(src_pixbuf,

(gint)(viewer-hadjustment-value / (*scale)), 
   
viewer-vadjustment-value / (*scale),
-
((widget-allocation.width/(*scale)))  width?
-  
widget-allocation.width/(*scale):width,
- 

[Xfce4-commits] ristretto:ristretto-0.0 Add string.h header to prevent a compiler warning

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 79b6826f644c87e459531d01f1f50458a3925678 (commit)
   from f28d501a4b94c752e2ad1e6ab4c8d06086a57907 (commit)

commit 79b6826f644c87e459531d01f1f50458a3925678
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 17:31:54 2009 +0100

Add string.h header to prevent a compiler warning

 src/image.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/image.c b/src/image.c
index 3ca403d..a717cca 100644
--- a/src/image.c
+++ b/src/image.c
@@ -24,6 +24,8 @@
 
 #include libexif/exif-data.h
 
+#include string.h
+
 #include image.h
 #include image_cache.h
 #include image_transformation.h
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Enable mouse-move on picture viewer

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 67ce593c1d98dc141cfa28df268c5d5ff4338e02 (commit)
   from 79b6826f644c87e459531d01f1f50458a3925678 (commit)

commit 67ce593c1d98dc141cfa28df268c5d5ff4338e02
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 17:48:50 2009 +0100

Enable mouse-move on picture viewer

 src/picture_viewer.c |   21 +
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 5b203ba..150a51f 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1010,7 +1010,6 @@ cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer 
*viewer)
 static void
 cb_rstto_picture_viewer_button_press_event (RsttoPictureViewer *viewer, 
GdkEventButton *event)
 {
-/*
 if(event-button == 1)
 {
 viewer-priv-motion.x = event-x;
@@ -1020,7 +1019,7 @@ cb_rstto_picture_viewer_button_press_event 
(RsttoPictureViewer *viewer, GdkEvent
 viewer-priv-motion.h_val = viewer-hadjustment-value;
 viewer-priv-motion.v_val = viewer-vadjustment-value;
 
-if (rstto_navigator_get_file(viewer-priv-navigator) != NULL)
+if (viewer-priv-image != NULL  viewer-priv-state == 
RSTTO_PICTURE_VIEWER_STATE_NONE)
 {
 
 if (!(event-state  (GDK_CONTROL_MASK)))
@@ -1030,7 +1029,7 @@ cb_rstto_picture_viewer_button_press_event 
(RsttoPictureViewer *viewer, GdkEvent
 gdk_window_set_cursor(widget-window, cursor);
 gdk_cursor_unref(cursor);
 
-viewer-priv-motion.state = RSTTO_PICTURE_VIEWER_STATE_MOVE;
+viewer-priv-state = RSTTO_PICTURE_VIEWER_STATE_MOVE;
 }
 
 if (event-state  GDK_CONTROL_MASK)
@@ -1040,13 +1039,12 @@ cb_rstto_picture_viewer_button_press_event 
(RsttoPictureViewer *viewer, GdkEvent
 gdk_window_set_cursor(widget-window, cursor);
 gdk_cursor_unref(cursor);
 
-viewer-priv-motion.state = 
RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM;
+viewer-priv-state = RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM;
 }
 }
 
 
 }
-*/
 if(event-button == 3)
 {
 if (viewer-priv-menu)
@@ -1066,6 +1064,16 @@ cb_rstto_picture_viewer_button_press_event 
(RsttoPictureViewer *viewer, GdkEvent
 static void
 cb_rstto_picture_viewer_button_release_event (RsttoPictureViewer *viewer, 
GdkEventButton *event)
 {
+GtkWidget *widget = GTK_WIDGET(viewer);
+
+gdk_window_set_cursor(widget-window, NULL);
+if (viewer-priv-state != RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
+viewer-priv-state = RSTTO_PICTURE_VIEWER_STATE_NONE;
+if (viewer-priv-refresh.idle_id  0)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
+viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 /*
 if(event-button == 1)
 {
@@ -1192,10 +1200,7 @@ cb_rstto_picture_viewer_button_release_event 
(RsttoPictureViewer *viewer, GdkEve
 }
 
 }
-
-viewer-priv-motion.state = RSTTO_PICTURE_VIEWER_STATE_NONE;
 */
-
 }
 
 static void
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Remove autogenerated header file from git

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 3f8ba01f6df517764a03802d145dfcf18bf14fbc (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit 3f8ba01f6df517764a03802d145dfcf18bf14fbc
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:22:56 2009 +0100

Remove autogenerated header file from git

 src/main_window_ui.h |   37 -
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu action=\file-menu\menuitem ac
-  tion=\open\/menuitem action=\open-folder\/menu action=\open-re
-  cent-menu\placeholder name=\placeholder-open-recent\//menusepa
-  rator/menuitem action=\file-properties\/separator/menuitem acti
-  on=\close\/menuitem action=\close-all\/menuitem action=\quit\
-  //menumenu action=\edit-menu\menu action=\open-with-menu\pl
-  aceholder name=\open-with-apps\ //menuseparator/menuitem action
-  =\preferences\//menumenu action=\view-menu\menuitem action=\
-  show-toolbar\/menuitem action=\show-thumbnailbar\/separator/me
-  nu action=\zoom-menu\menuitem action=\zoom-in\/menuitem action=
-  \zoom-out\/menuitem action=\zoom-fit\/menuitem action=\zoom-10
-  0\//menumenu action=\rotation-menu\menuitem action=\rotate-cw
-  \/menuitem action=\rotate-ccw\//menuseparator/menuitem actio
-  n=\fullscreen\/menuitem action=\set-as-wallpaper\//menumenu a
-  ction=\go-menu\menuitem action=\back\/menuitem action=\forward
-  \/menuitem action=\first\/menuitem action=\last\/separator/
-  placeholder name=\placeholder-slideshow\ //menumenu action=\hel
-  p-menu\menuitem action=\contents\/menuitem action=\about\//m
-  enu/menubartoolbar name=\main-toolbar\toolitem action=\open\/
-  separator /toolitem action=\back\/toolitem action=\forward\/
-  separator name=\placeholder-1\/toolitem action=\zoom-in\/tooli
-  tem action=\zoom-out\/toolitem action=\zoom-100\/toolitem actio
-  n=\zoom-fit\//toolbar/ui
-};
-
-static const unsigned main_window_ui_length = 1503u;
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Improved performance when drawing the zoom-box, don't do a refresh when performing a queued_repaint, just paint the darn thing.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to fa5894a0df7f1bc7052c17fd2085e81b906497ba (commit)
   from 67ce593c1d98dc141cfa28df268c5d5ff4338e02 (commit)

commit fa5894a0df7f1bc7052c17fd2085e81b906497ba
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 18:00:43 2009 +0100

Improved performance when drawing the zoom-box, don't do a refresh when 
performing a queued_repaint, just paint the darn thing.

 src/picture_viewer.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 150a51f..6710a6a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -987,6 +987,10 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 }
 break;
 case RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM:
+if (viewer-priv-refresh.idle_id)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
 viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 break;
 default:
@@ -999,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-rstto_picture_viewer_refresh(viewer);
+//rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 That was a bug... reverting last change, I need to implement some better way of doing this.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534 (commit)
   from fa5894a0df7f1bc7052c17fd2085e81b906497ba (commit)

commit 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534
Author: Stephan Arts step...@xfce.org
Date:   Sun Feb 22 09:36:36 2009 +0100

That was a bug... reverting last change, I need to implement some better
way of doing this.

 src/picture_viewer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6710a6a..364e445 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1003,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-//rstto_picture_viewer_refresh(viewer);
+rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Removed autogenerated header from git Added the recently used menu to the file-menu

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f4223148a6df935fa94da97a94ec04e89c0f29db (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |   19 ---
 src/main_window_ui.h   |   37 -
 src/main_window_ui.xml |4 +---
 3 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..c859cdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -185,7 +186,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -282,7 +282,7 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-settings_manager = rstto_settings_new();
 
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
@@ -293,6 +293,8 @@ rstto_main_window_init (RsttoMainWindow *window)
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
+window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
+
 /* Add the same accelerator path to play and pause, so the same 
kb-shortcut will be used for starting and stopping the slideshow */
 gtk_action_set_accel_path (window-priv-pause_action, 
Actions/RsttoWindow/play);
 gtk_action_set_accel_path (window-priv-play_action, 
Actions/RsttoWindow/play);
@@ -301,6 +303,8 @@ rstto_main_window_init (RsttoMainWindow *window)
  window-priv-play_action);
 gtk_action_group_add_action (window-priv-action_group,
  window-priv-pause_action);
+gtk_action_group_add_action (window-priv-action_group,
+ window-priv-recent_action);
 /* Connect signal-handlers */
 g_signal_connect(G_OBJECT(window-priv-play_action), activate, 
G_CALLBACK(cb_rstto_main_window_play), window);
 g_signal_connect(G_OBJECT(window-priv-pause_action), activate, 
G_CALLBACK(cb_rstto_main_window_pause), window);
@@ -349,6 +353,15 @@ rstto_main_window_init (RsttoMainWindow *window)
GTK_UI_MANAGER_MENUITEM,
FALSE);
 
+
+gtk_ui_manager_add_ui (window-priv-ui_manager,
+   window-priv-recent_merge_id,
+   /main-menu/file-menu/placeholder-open-recent,
+   recent,
+   recent,
+   GTK_UI_MANAGER_MENUITEM,
+   FALSE);
+
 g_value_init (window_width, G_TYPE_UINT);
 g_value_init (window_height, G_TYPE_UINT);
 g_object_get_property (G_OBJECT(window-priv-settings_manager), 
window-width, window_width);
diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu 

[Xfce4-commits] ristretto:ristretto-0.0 add new entry in news

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 5932e7f473d373ae87c8532a29c9ee7fc5017a9f (commit)
   from 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534 (commit)

commit 5932e7f473d373ae87c8532a29c9ee7fc5017a9f
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:29:13 2009 +0100

add new entry in news

 NEWS |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 167cf46..f02678f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+x.x.x
+=
+
 0.0.21
 ==
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add refresh mask, needs some tweaking, but it solves the drag performance-loss. Eventually, this should reduce the times ristretto scales the image.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to ad1c2baadb12b28c47cbeb97b622af39d614ba5a (commit)
   from 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534 (commit)

commit ad1c2baadb12b28c47cbeb97b622af39d614ba5a
Author: Stephan Arts step...@xfce.org
Date:   Sun Feb 22 10:40:29 2009 +0100

Add refresh mask, needs some tweaking, but it solves the drag 
performance-loss.
Eventually, this should reduce the times ristretto scales the image.

 src/picture_viewer.c |  168 --
 1 files changed, 95 insertions(+), 73 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 364e445..a26c9ca 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -71,10 +71,14 @@ struct _RsttoPictureViewerPriv
 struct
 {
 gint idle_id;
+gint mask;
 } refresh;
 GtkMenu  *menu;
 };
 
+#define RSTTO_REFRESH_LOCATION 0x1
+#define RSTTO_REFRESH_SCALE0x2
+
 static void
 rstto_picture_viewer_init(RsttoPictureViewer *);
 static void
@@ -562,6 +566,7 @@ cb_rstto_picture_viewer_value_changed(GtkAdjustment 
*adjustment, RsttoPictureVie
 {
 g_source_remove(viewer-priv-refresh.idle_id);
 }
+viewer-priv-refresh.mask = RSTTO_REFRESH_LOCATION;
 viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 }
 
@@ -671,6 +676,52 @@ rstto_picture_viewer_get_scale(RsttoPictureViewer *viewer)
 return 0;
 }
 
+/**
+ * rstto_picture_viewer_calculate_scale:
+ * @viewer:
+ *
+ */
+static gdouble
+rstto_picture_viewer_calculate_scale (RsttoPictureViewer *viewer)
+{
+GdkPixbuf *p_src_pixbuf;
+gint width = 0, height = 0;
+gdouble newscale = 0.0;
+gdouble *p_scale = NULL;
+if (viewer-priv-image != NULL)
+{   
+p_src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
+
+width = gdk_pixbuf_get_width (p_src_pixbuf);
+height = gdk_pixbuf_get_height (p_src_pixbuf);
+
+p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+}
+
+if (p_scale)
+newscale = *p_scale;
+switch (viewer-priv-zoom_mode)
+{
+case RSTTO_ZOOM_MODE_FIT:
+if ((GTK_WIDGET (viewer)-allocation.width / width) 
+(GTK_WIDGET (viewer)-allocation.height / height))
+{
+newscale = (gdouble)GTK_WIDGET (viewer)-allocation.width / 
(gdouble)width;
+}
+else
+{
+newscale = (gdouble)GTK_WIDGET (viewer)-allocation.height / 
(gdouble)height;
+}
+break;
+case RSTTO_ZOOM_MODE_100:
+newscale = 1.0;
+break;
+case RSTTO_ZOOM_MODE_CUSTOM:
+break;
+}
+return newscale;
+}
+
 static gboolean
 rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
@@ -679,6 +730,7 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 GdkPixbuf *thumb_pixbuf = NULL;
 gboolean *fit_to_screen = NULL;
 gdouble *scale = NULL; 
+gdouble newscale = 0;
 gint width = 0, height = 0;
 gboolean vadjustment_changed = FALSE;
 gboolean hadjustment_changed = FALSE;
@@ -738,11 +790,11 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 if ((GTK_WIDGET (viewer)-allocation.width / width) 
 (GTK_WIDGET (viewer)-allocation.height / height))
 {
-*scale = (gdouble)GTK_WIDGET (viewer)-allocation.width / 
(gdouble)width;
+newscale = (gdouble)GTK_WIDGET (viewer)-allocation.width / 
(gdouble)width;
 }
 else
 {
-*scale = (gdouble)GTK_WIDGET (viewer)-allocation.height / 
(gdouble)height;
+newscale = (gdouble)GTK_WIDGET (viewer)-allocation.height / 
(gdouble)height;
 }
 
 }
@@ -751,87 +803,55 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 /* The image is smaller then the picture-viewer,
  * As a result, view it at it's original size.
  */
-*scale = 1.0;
+newscale = 1.0;
 *fit_to_screen = FALSE;
 }
-g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
 
 }
 else
 {
-switch (viewer-priv-zoom_mode)
-{
-case RSTTO_ZOOM_MODE_FIT:
-*fit_to_screen = TRUE;
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
-break;
-case RSTTO_ZOOM_MODE_100:
-*fit_to_screen = FALSE;
-*scale = 1.0;
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-scale, scale);
-break;
-case RSTTO_ZOOM_MODE_CUSTOM:
-break;
-}
-
-

[Xfce4-commits] ristretto:ristretto-0.0 Made all the scale related functions internal

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 1da739e89571c1775602a511ad86b5c0ed97a8e1 (commit)
   from 7da92c8d582e14d50adfee29144751e7b89b93cb (commit)

commit 1da739e89571c1775602a511ad86b5c0ed97a8e1
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:03:41 2009 +0100

Made all the scale related functions internal

 src/main_window.c|   10 +--
 src/picture_viewer.c |  233 ++
 src/picture_viewer.h |6 +-
 3 files changed, 148 insertions(+), 101 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 2254c7b..2f8fe74 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+rstto_picture_viewer_zoom_100 (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -699,8 +699,7 @@ cb_rstto_main_window_zoom_100 (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_in (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale * ZOOM_FACTOR);
+rstto_picture_viewer_zoom_in (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**
@@ -713,8 +712,7 @@ cb_rstto_main_window_zoom_in (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_out (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale / ZOOM_FACTOR);
+rstto_picture_viewer_zoom_out (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**/
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index e29e378..17cfb61 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -103,6 +103,9 @@ static void
 rstto_picture_viewer_set_motion_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerMotionState state);
 
 static void
+rstto_picture_viewer_set_zoom_mode (RsttoPictureViewer *viewer, RsttoZoomMode 
mode);
+
+static void
 rstto_picture_viewer_size_request(GtkWidget *, GtkRequisition *);
 static void
 rstto_picture_viewer_size_allocate(GtkWidget *, GtkAllocation *);
@@ -618,81 +621,60 @@ rstto_picture_viewer_new()
 void
 rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, gdouble scale)
 {
-gdouble *old_scale, *new_scale;
+gdouble *img_scale, *new_scale;
 GdkPixbuf *src_pixbuf = NULL;
-gboolean *fit_to_screen = NULL;
 
 if (viewer-priv-image)
 {
 src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-old_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
-fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
-//rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+img_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
 
-new_scale = g_new0 (gdouble, 1);
-*new_scale = scale;
-*fit_to_screen = FALSE;
-g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
new_scale);
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
-
-gdouble width = (gdouble)gdk_pixbuf_get_width (src_pixbuf);
-gdouble height = (gdouble)gdk_pixbuf_get_height (src_pixbuf);
+if (src_pixbuf)
+{
+gdouble width = (gdouble)gdk_pixbuf_get_width (src_pixbuf);
+gdouble height = (gdouble)gdk_pixbuf_get_height (src_pixbuf);
 
 
-viewer-hadjustment-upper = width * (*new_scale);
-gtk_adjustment_changed(viewer-hadjustment);
+viewer-hadjustment-upper = width * scale;
+gtk_adjustment_changed(viewer-hadjustment);
 
-viewer-vadjustment-upper = height * (*new_scale);
-gtk_adjustment_changed(viewer-vadjustment);
+viewer-vadjustment-upper = height * scale;
+gtk_adjustment_changed(viewer-vadjustment);
 
-viewer-hadjustment-value = (((viewer-hadjustment-value +
-  (viewer-hadjustment-page_size / 2)) *
-  

[Xfce4-commits] ristretto:ristretto-0.0 Split 'view' state from 'motion' state

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7da92c8d582e14d50adfee29144751e7b89b93cb (commit)
   from 691a6a7c89eb2902984ac6ccfe02e219168b82f4 (commit)

commit 7da92c8d582e14d50adfee29144751e7b89b93cb
Author: Stephan Arts step...@xfce.org
Date:   Sun Mar 8 14:22:37 2009 +0100

Split 'view' state from 'motion' state

 src/main_window.c|4 +-
 src/picture_viewer.c |  406 +++---
 src/picture_viewer.h |9 -
 3 files changed, 191 insertions(+), 228 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b7acbdb..2254c7b 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
 }
 
 /**
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6e8b261..e29e378 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -31,12 +31,23 @@
 typedef enum
 {
 RSTTO_PICTURE_VIEWER_STATE_NORMAL = 0,
-RSTTO_PICTURE_VIEWER_STATE_MOVE,
-RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM,
-RSTTO_PICTURE_VIEWER_STATE_TRANSITION
+RSTTO_PICTURE_VIEWER_STATE_PREVIEW
 } RsttoPictureViewerState;
 
+typedef enum
+{
+RSTTO_PICTURE_VIEWER_MOTION_STATE_NORMAL = 0,
+RSTTO_PICTURE_VIEWER_MOTION_STATE_BOX_ZOOM,
+RSTTO_PICTURE_VIEWER_MOTION_STATE_MOVE
+} RsttoPictureViewerMotionState;
+
+typedef enum
+{
+RSTTO_ZOOM_MODE_CUSTOM,
+RSTTO_ZOOM_MODE_100,
+RSTTO_ZOOM_MODE_FIT
+} RsttoZoomMode;
+
 enum
 {
 TARGET_TEXT_URI_LIST,
@@ -49,16 +60,16 @@ static const GtkTargetEntry drop_targets[] = {
 
 struct _RsttoPictureViewerPriv
 {
-RsttoImage *image;
+RsttoImage  *image;
+GtkMenu *menu;
+RsttoPictureViewerState  state;
+RsttoZoomModezoom_mode;
 
-RsttoZoomModezoom_mode;
 
 GdkPixbuf*dst_pixbuf; /* The pixbuf which ends up on screen */
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
-RsttoPictureViewerState state;
-
 struct
 {
 gdouble x;
@@ -67,12 +78,14 @@ struct _RsttoPictureViewerPriv
 gdouble current_y;
 gint h_val;
 gint v_val;
+RsttoPictureViewerMotionState state;
 } motion;
+
 struct
 {
 gint idle_id;
-} refresh;
-GtkMenu  *menu;
+gboolean refresh;
+} repaint;
 };
 
 static void
@@ -86,16 +99,8 @@ static void
 rstto_picture_viewer_set_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerState state);
 static RsttoPictureViewerState
 rstto_picture_viewer_get_state (RsttoPictureViewer *viewer);
-
-static gdouble
-rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
-
 static void
-cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static void
-cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static gboolean 
-cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer);
+rstto_picture_viewer_set_motion_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerMotionState state);
 
 static void
 rstto_picture_viewer_size_request(GtkWidget *, GtkRequisition *);
@@ -105,13 +110,10 @@ static void
 rstto_picture_viewer_realize(GtkWidget *);
 static gboolean 
 rstto_picture_viewer_expose(GtkWidget *, GdkEventExpose *);
-
 static void
 rstto_picture_viewer_paint (GtkWidget *widget);
-static void
-cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static void
-cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static gboolean 
+rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer, gboolean 
refresh);
 
 static gboolean
 rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *, 
GtkAdjustment *, GtkAdjustment *);
@@ -120,33 +122,24 @@ static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *, RsttoPictureViewer *);
 
 static void
-cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *, GdkEventScroll *);
+cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static void

[Xfce4-commits] ristretto:ristretto-0.0 Fix segfault

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b (commit)
   from 1da739e89571c1775602a511ad86b5c0ed97a8e1 (commit)

commit edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:23:48 2009 +0100

Fix segfault

 src/picture_viewer.c |   33 +++--
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 17cfb61..0575439 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -360,6 +360,7 @@ rstto_picture_viewer_size_allocate(GtkWidget *widget, 
GtkAllocation *allocation)
  * TODO: Check if we really nead a refresh
  */
 rstto_picture_viewer_queued_repaint (viewer, FALSE);
+//rstto_picture_viewer_paint (viewer);
 }
 
 /**
@@ -376,6 +377,7 @@ rstto_picture_viewer_expose(GtkWidget *widget, 
GdkEventExpose *event)
 /** 
  * TODO: Check if we really nead a refresh
  */
+//rstto_picture_viewer_paint (viewer);
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 return FALSE;
 }
@@ -673,6 +675,8 @@ rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, 
gdouble scale)
  * since the old and new values are required in the above code
  */
 *img_scale = scale;
+
+rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 }
 }
@@ -909,6 +913,8 @@ rstto_picture_viewer_calculate_adjustments 
(RsttoPictureViewer *viewer, gdouble
 static gboolean 
 rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer, gboolean 
refresh)
 {
+g_return_if_fail (RSTTO_IS_PICTURE_VIEWER (viewer));
+
 if (viewer-priv-repaint.idle_id  0)
 {
 g_source_remove(viewer-priv-repaint.idle_id);
@@ -926,13 +932,10 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 GdkPixbuf *p_src_pixbuf = NULL;
 GdkPixbuf *p_tmp_pixbuf = NULL;
 gdouble *p_scale = NULL;
+gdouble scale;
 gdouble width, height;
 GtkWidget *widget = GTK_WIDGET (viewer);
 
-gdouble  scale = rstto_picture_viewer_calculate_scale (viewer);
-
-rstto_picture_viewer_calculate_adjustments (viewer, scale);
-
 if (viewer-priv-image != NULL)
 {   
 p_src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
@@ -941,7 +944,18 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 width = (gdouble)gdk_pixbuf_get_width (p_src_pixbuf);
 height = (gdouble)gdk_pixbuf_get_height (p_src_pixbuf);
 }
+
+p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+scale = *p_scale;
+}
+
+if (scale = 0)
+{
+scale = rstto_picture_viewer_calculate_scale (viewer);
+*p_scale = scale;
 }
+rstto_picture_viewer_calculate_adjustments (viewer);
+
 
 switch (viewer-priv-state)
 {
@@ -950,7 +964,7 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 {
 if (p_src_pixbuf)
 {
-if (scale == 1.0 )
+if (*p_scale == 1.0 )
 {
 p_tmp_pixbuf = p_src_pixbuf;
 g_object_ref (p_tmp_pixbuf);
@@ -990,7 +1004,6 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 if (viewer-priv-image)
 {
 p_tmp_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
-p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
 if (G_LIKELY (p_scale == NULL))
 {
 p_scale = g_new0 (gdouble, 1);
@@ -1353,8 +1366,6 @@ void
 rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
 {
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1367,8 +1378,6 @@ void
 rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
 {
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1386,8 +1395,6 @@ rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, 
gboolean factor)
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
 scale = rstto_picture_viewer_get_scale (viewer);
 rstto_picture_viewer_set_scale (viewer, scale * factor);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1405,6 +1412,4 @@ rstto_picture_viewer_zoom_out (RsttoPictureViewer 
*viewer, gboolean factor)
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
 scale = rstto_picture_viewer_get_scale (viewer);
 rstto_picture_viewer_set_scale (viewer, scale / factor);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org

[Xfce4-commits] ristretto:ristretto-0.0 commit changes

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 691a6a7c89eb2902984ac6ccfe02e219168b82f4 (commit)
   from ad1c2baadb12b28c47cbeb97b622af39d614ba5a (commit)

commit 691a6a7c89eb2902984ac6ccfe02e219168b82f4
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:28:33 2009 +0100

commit changes

 src/picture_viewer.c |  664 --
 1 files changed, 314 insertions(+), 350 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index a26c9ca..6e8b261 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -30,10 +30,11 @@
 
 typedef enum
 {
-RSTTO_PICTURE_VIEWER_STATE_NONE,
+RSTTO_PICTURE_VIEWER_STATE_NORMAL = 0,
 RSTTO_PICTURE_VIEWER_STATE_MOVE,
 RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM
+RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM,
+RSTTO_PICTURE_VIEWER_STATE_TRANSITION
 } RsttoPictureViewerState;
 
 enum
@@ -56,7 +57,7 @@ struct _RsttoPictureViewerPriv
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
-gdouble  scale;
+RsttoPictureViewerState state;
 
 struct
 {
@@ -67,18 +68,13 @@ struct _RsttoPictureViewerPriv
 gint h_val;
 gint v_val;
 } motion;
-RsttoPictureViewerState state;
 struct
 {
 gint idle_id;
-gint mask;
 } refresh;
 GtkMenu  *menu;
 };
 
-#define RSTTO_REFRESH_LOCATION 0x1
-#define RSTTO_REFRESH_SCALE0x2
-
 static void
 rstto_picture_viewer_init(RsttoPictureViewer *);
 static void
@@ -86,6 +82,11 @@ rstto_picture_viewer_class_init(RsttoPictureViewerClass *);
 static void
 rstto_picture_viewer_destroy(GtkObject *object);
 
+static void
+rstto_picture_viewer_set_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerState state);
+static RsttoPictureViewerState
+rstto_picture_viewer_get_state (RsttoPictureViewer *viewer);
+
 static gdouble
 rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
 
@@ -93,7 +94,6 @@ static void
 cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
 static void
 cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
-
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer);
 
@@ -108,14 +108,17 @@ rstto_picture_viewer_expose(GtkWidget *, GdkEventExpose 
*);
 
 static void
 rstto_picture_viewer_paint (GtkWidget *widget);
-static gboolean
-rstto_picture_viewer_refresh(RsttoPictureViewer *viewer);
+static void
+cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static void
+cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
 
 static gboolean
 rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *, 
GtkAdjustment *, GtkAdjustment *);
 
 static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *, RsttoPictureViewer *);
+
 static void
 cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *, GdkEventScroll *);
 static gboolean 
@@ -303,8 +306,12 @@ rstto_picture_viewer_size_allocate(GtkWidget *widget, 
GtkAllocation *allocation)
 allocation-height - border_width * 2);
 }
 
-rstto_picture_viewer_refresh(viewer);
-rstto_picture_viewer_paint (GTK_WIDGET(viewer));
+if (viewer-priv-refresh.idle_id  0)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
+viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
+
 }
 
 static void
@@ -341,8 +348,13 @@ rstto_picture_viewer_realize(GtkWidget *widget)
 static gboolean
 rstto_picture_viewer_expose(GtkWidget *widget, GdkEventExpose *event)
 {
-rstto_picture_viewer_refresh (RSTTO_PICTURE_VIEWER(widget));
-rstto_picture_viewer_paint (widget);
+RsttoPictureViewer *viewer = RSTTO_PICTURE_VIEWER (widget);
+
+if (viewer-priv-refresh.idle_id  0)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
+viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 return FALSE;
 }
 
@@ -562,11 +574,12 @@ 
rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *viewer, GtkAdjus
 static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *adjustment, 
RsttoPictureViewer *viewer)
 {
+rstto_picture_viewer_set_state (viewer, RSTTO_PICTURE_VIEWER_STATE_MOVE);
+
 if (viewer-priv-refresh.idle_id  0)
 {
 g_source_remove(viewer-priv-refresh.idle_id);
 }
-viewer-priv-refresh.mask = RSTTO_REFRESH_LOCATION;
 viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 }
 
@@ -656,10 +669,6 @@ rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer)
 fit_to_screen = g_new0(gboolean, 1);
 g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
 
-

[Xfce4-commits] ristretto:ristretto-0.0 Move DnD code to the bottom of the file

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 2b5990b32b22c130f54395eb0f61f9c7ad107e27 (commit)
   from edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b (commit)

commit 2b5990b32b22c130f54395eb0f61f9c7ad107e27
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:28:49 2009 +0100

Move DnD code to the bottom of the file

 src/picture_viewer.c |  121 ++
 1 files changed, 63 insertions(+), 58 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 0575439..ad607cb 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1215,7 +1215,7 @@ rstto_picture_viewer_set_image (RsttoPictureViewer 
*viewer, RsttoImage *image)
 if (scale == NULL)
 {
 scale = g_new0 (gdouble, 1);
-*scale = -1.0;
+*scale = 0.0;
 g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 }
 if (fit_to_screen == NULL)
@@ -1255,6 +1255,68 @@ cb_rstto_picture_viewer_image_prepared (RsttoImage 
*image, RsttoPictureViewer *v
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
+/**
+ * rstto_picture_viewer_zoom_fit:
+ * @window:
+ *
+ * Adjust the scale to make the image fit the window
+ */
+void
+rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
+{
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
+}
+
+/**
+ * rstto_picture_viewer_zoom_100:
+ * @viewer:
+ *
+ * Set the scale to 1, meaning a zoom-factor of 100%
+ */
+void
+rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
+{
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
+}
+
+/**
+ * rstto_picture_viewer_zoom_in:
+ * @viewer:
+ * @factor:
+ *
+ * Zoom in the scale with a certain factor
+ */
+void
+rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
+{
+gdouble scale;
+
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+scale = rstto_picture_viewer_get_scale (viewer);
+rstto_picture_viewer_set_scale (viewer, scale * factor);
+}
+
+/**
+ * rstto_picture_viewer_zoom_out:
+ * @viewer:
+ * @factor:
+ *
+ * Zoom out the scale with a certain factor
+ */
+void
+rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
+{
+gdouble scale;
+
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+scale = rstto_picture_viewer_get_scale (viewer);
+rstto_picture_viewer_set_scale (viewer, scale / factor);
+}
+
+
+/**/
+
+
 /
  * FIXME: DnD
  */
@@ -1356,60 +1418,3 @@ rstto_picture_viewer_drag_motion (GtkWidget *widget,
 }
 
 
-/**
- * rstto_picture_viewer_zoom_fit:
- * @window:
- *
- * Adjust the scale to make the image fit the window
- */
-void
-rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
-{
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
-}
-
-/**
- * rstto_picture_viewer_zoom_100:
- * @viewer:
- *
- * Set the scale to 1, meaning a zoom-factor of 100%
- */
-void
-rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
-{
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
-}
-
-/**
- * rstto_picture_viewer_zoom_in:
- * @viewer:
- * @factor:
- *
- * Zoom in the scale with a certain factor
- */
-void
-rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
-{
-gdouble scale;
-
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
-scale = rstto_picture_viewer_get_scale (viewer);
-rstto_picture_viewer_set_scale (viewer, scale * factor);
-}
-
-/**
- * rstto_picture_viewer_zoom_out:
- * @viewer:
- * @factor:
- *
- * Zoom out the scale with a certain factor
- */
-void
-rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
-{
-gdouble scale;
-
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
-scale = rstto_picture_viewer_get_scale (viewer);
-rstto_picture_viewer_set_scale (viewer, scale / factor);
-}
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 68f99e86e52a3bbd80337b2e8516133eab1aaa23 (commit)
   from 2b5990b32b22c130f54395eb0f61f9c7ad107e27 (commit)

commit 68f99e86e52a3bbd80337b2e8516133eab1aaa23
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:44:47 2009 +0100

Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

 src/picture_viewer.c |9 +
 src/picture_viewer.h |4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index ad607cb..acc1c5a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -748,7 +748,7 @@ cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer 
*viewer, GdkEventScroll
 {
 case GDK_SCROLL_UP:
 case GDK_SCROLL_LEFT:
-if (scale = 0.05)
+if (scale= 0.05)
 return;
 if (viewer-priv-refresh.idle_id  0)
 {
@@ -954,7 +954,8 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 scale = rstto_picture_viewer_calculate_scale (viewer);
 *p_scale = scale;
 }
-rstto_picture_viewer_calculate_adjustments (viewer);
+
+rstto_picture_viewer_calculate_adjustments (viewer, scale);
 
 
 switch (viewer-priv-state)
@@ -1287,7 +1288,7 @@ rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
  * Zoom in the scale with a certain factor
  */
 void
-rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
+rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gdouble factor)
 {
 gdouble scale;
 
@@ -1304,7 +1305,7 @@ rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, 
gboolean factor)
  * Zoom out the scale with a certain factor
  */
 void
-rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
+rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gdouble factor)
 {
 gdouble scale;
 
diff --git a/src/picture_viewer.h b/src/picture_viewer.h
index 458118f..c241da8 100644
--- a/src/picture_viewer.h
+++ b/src/picture_viewer.h
@@ -73,8 +73,8 @@ gdoublerstto_picture_viewer_get_scale(RsttoPictureViewer 
*viewer);
 
 void   rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer);
 void   rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer);
-void   rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gboolean 
factor);
-void   rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean 
factor);
+void   rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gdouble 
factor);
+void   rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gdouble 
factor);
 
 /**
 gdoublerstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Emit 'updated' signal when 'rstto_image_load' is called and the image is already there.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 0c1e906c2931655b6f075bb7105895748b50946a (commit)
   from 68f99e86e52a3bbd80337b2e8516133eab1aaa23 (commit)

commit 0c1e906c2931655b6f075bb7105895748b50946a
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:51:09 2009 +0100

Emit 'updated' signal when 'rstto_image_load' is called and the image is 
already there.

 src/image.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/image.c b/src/image.c
index a717cca..82d23fe 100644
--- a/src/image.c
+++ b/src/image.c
@@ -407,7 +407,7 @@ rstto_image_load (RsttoImage *image, gboolean empty_cache, 
GError **error)
 }
 else
 {
-//g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
+g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
 rstto_image_cache_push_image (cache, image);
 return TRUE;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Revert That was a bug... reverting last change, I need to implement some better

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e (commit)
   from 5932e7f473d373ae87c8532a29c9ee7fc5017a9f (commit)

commit 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:59:38 2009 +0100

Revert That was a bug... reverting last change, I need to implement some 
better

This reverts commit 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534.

 src/picture_viewer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 364e445..6710a6a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1003,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-rstto_picture_viewer_refresh(viewer);
+//rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Revert add new entry in news

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c (commit)
   from 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e (commit)

commit 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 22:00:05 2009 +0100

Revert add new entry in news

This reverts commit 5932e7f473d373ae87c8532a29c9ee7fc5017a9f.

 NEWS |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index f02678f..167cf46 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,3 @@
-x.x.x
-=
-
 0.0.21
 ==
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Fix moving of zoomed-in image

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 656f9b4bb9f4b7d51cc012a384e08fa4f0175879 (commit)
   from f6b085b3e0b356796a592414249485c7a8e8ae20 (commit)

commit 656f9b4bb9f4b7d51cc012a384e08fa4f0175879
Author: Stephan Arts step...@xfce.org
Date:   Tue Mar 10 09:28:26 2009 +0100

Fix moving of zoomed-in image

 src/picture_viewer.c |   24 
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index acc1c5a..e3230d3 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -965,22 +965,14 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 {
 if (p_src_pixbuf)
 {
-if (*p_scale == 1.0 )
-{
-p_tmp_pixbuf = p_src_pixbuf;
-g_object_ref (p_tmp_pixbuf);
-}
-else
-{
-p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
-   
(gint)(viewer-hadjustment-value / scale), 
-  
viewer-vadjustment-value / scale,
-
((widget-allocation.width/scale))  width?
-  
widget-allocation.width/scale:width,
-
((widget-allocation.height/scale)) height?
-  
widget-allocation.height/scale:height);
+p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
+   
(gint)(viewer-hadjustment-value / scale), 
+  
viewer-vadjustment-value / scale,
+
((widget-allocation.width/scale))  width?
+  
widget-allocation.width/scale:width,
+
((widget-allocation.height/scale)) height?
+  
widget-allocation.height/scale:height);
 
-}
 if(viewer-priv-dst_pixbuf)
 {
 g_object_unref(viewer-priv-dst_pixbuf);
@@ -1039,7 +1031,7 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 break;
 }
 
-g_source_remove(viewer-priv-repaint.idle_id);
+g_source_remove (viewer-priv-repaint.idle_id);
 viewer-priv-repaint.idle_id = -1;
 viewer-priv-repaint.refresh = FALSE;
 return FALSE;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Fix 'zoom-fit' when resizing

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 3c9fbba878bb2518b4e9915f43be88dcb0b501a8 (commit)
   from 656f9b4bb9f4b7d51cc012a384e08fa4f0175879 (commit)

commit 3c9fbba878bb2518b4e9915f43be88dcb0b501a8
Author: Stephan Arts step...@xfce.org
Date:   Tue Mar 10 13:02:15 2009 +0100

Fix 'zoom-fit' when resizing

 src/picture_viewer.c |   28 ++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index e3230d3..427274a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -932,7 +932,9 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 GdkPixbuf *p_src_pixbuf = NULL;
 GdkPixbuf *p_tmp_pixbuf = NULL;
 gdouble *p_scale = NULL;
+gboolean *p_fit_to_screen= NULL;
 gdouble scale;
+gboolean fit_to_screen = FALSE;
 gdouble width, height;
 GtkWidget *widget = GTK_WIDGET (viewer);
 
@@ -946,12 +948,15 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 }
 
 p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+p_fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
 scale = *p_scale;
+fit_to_screen = *p_fit_to_screen;
 }
 
-if (scale = 0)
+if ((scale = 0) || (fit_to_screen == TRUE))
 {
 scale = rstto_picture_viewer_calculate_scale (viewer);
+*p_fit_to_screen = TRUE;
 *p_scale = scale;
 }
 
@@ -1157,18 +1162,37 @@ static void
 rstto_picture_viewer_set_zoom_mode(RsttoPictureViewer *viewer, RsttoZoomMode 
mode)
 {
 gdouble scale;
+gboolean *p_fit_to_screen;
 viewer-priv-zoom_mode = mode;
 
 switch (viewer-priv-zoom_mode)
 {
 case RSTTO_ZOOM_MODE_CUSTOM:
+if (viewer-priv-image)
+{
+p_fit_to_screen = g_object_get_data (G_OBJECT 
(viewer-priv-image), viewer-fit-to-screen);
+*p_fit_to_screen = FALSE;
+g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, p_fit_to_screen);
+}
 break;
 case RSTTO_ZOOM_MODE_FIT:
+if (viewer-priv-image)
+{
+p_fit_to_screen = g_object_get_data (G_OBJECT 
(viewer-priv-image), viewer-fit-to-screen);
+*p_fit_to_screen = TRUE;
+g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, p_fit_to_screen);
+}
 scale = rstto_picture_viewer_calculate_scale (viewer);
 if (scale != -1.0)
 rstto_picture_viewer_set_scale (viewer, scale);
 break;
 case RSTTO_ZOOM_MODE_100:
+if (viewer-priv-image)
+{
+p_fit_to_screen = g_object_get_data (G_OBJECT 
(viewer-priv-image), viewer-fit-to-screen);
+*p_fit_to_screen = FALSE;
+g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, p_fit_to_screen);
+}
 rstto_picture_viewer_set_scale (viewer, 1);
 break;
 }
@@ -1208,7 +1232,7 @@ rstto_picture_viewer_set_image (RsttoPictureViewer 
*viewer, RsttoImage *image)
 if (scale == NULL)
 {
 scale = g_new0 (gdouble, 1);
-*scale = 0.0;
+*scale = -1.0;
 g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 }
 if (fit_to_screen == NULL)
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Improved behaviour when zooming inside a previewed image

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7566a5a251dd6a37bc30889dab19aa8615361b5a (commit)
   from 3c9fbba878bb2518b4e9915f43be88dcb0b501a8 (commit)

commit 7566a5a251dd6a37bc30889dab19aa8615361b5a
Author: Stephan Arts step...@xfce.org
Date:   Wed Mar 11 16:36:13 2009 +0100

Improved behaviour when zooming inside a previewed image

 src/picture_viewer.c |  126 +
 1 files changed, 54 insertions(+), 72 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 427274a..910c6cb 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -934,6 +934,8 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 gdouble *p_scale = NULL;
 gboolean *p_fit_to_screen= NULL;
 gdouble scale;
+gdouble thumb_scale = 1;
+gdouble thumb_width = 0;
 gboolean fit_to_screen = FALSE;
 gdouble width, height;
 GtkWidget *widget = GTK_WIDGET (viewer);
@@ -945,96 +947,76 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 {
 width = (gdouble)gdk_pixbuf_get_width (p_src_pixbuf);
 height = (gdouble)gdk_pixbuf_get_height (p_src_pixbuf);
+if (viewer-priv-state != RSTTO_PICTURE_VIEWER_STATE_NORMAL)
+{
+switch (viewer-priv-state)
+{
+case RSTTO_PICTURE_VIEWER_STATE_PREVIEW:
+p_src_pixbuf = rstto_image_get_thumbnail 
(viewer-priv-image);
+thumb_width = (gdouble)gdk_pixbuf_get_width 
(p_src_pixbuf);
+thumb_scale = (thumb_width / width);
+break;
+default:
+break;
+}
+}
 }
 
 p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
 p_fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
 scale = *p_scale;
 fit_to_screen = *p_fit_to_screen;
-}
 
-if ((scale = 0) || (fit_to_screen == TRUE))
-{
-scale = rstto_picture_viewer_calculate_scale (viewer);
-*p_fit_to_screen = TRUE;
-*p_scale = scale;
+if ((scale = 0) || (fit_to_screen == TRUE))
+{
+scale = rstto_picture_viewer_calculate_scale (viewer);
+*p_fit_to_screen = TRUE;
+*p_scale = scale;
+}
 }
 
+
 rstto_picture_viewer_calculate_adjustments (viewer, scale);
 
 
-switch (viewer-priv-state)
+if (viewer-priv-repaint.refresh)
 {
-case RSTTO_PICTURE_VIEWER_STATE_NORMAL:
-if (viewer-priv-repaint.refresh)
+if (p_src_pixbuf)
+{
+/**
+ *  tmp_scale is the factor between the original image and the 
thumbnail,
+ *  when looking at the actual image, tmp_scale == 1.0
+ */
+gint x = (gint)viewer-hadjustment-value * scale;
+gint y = (gint)viewer-vadjustment-value * scale;
+
+p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
+   (gint)(x * thumb_scale), 
+  (y * thumb_scale),
+((widget-allocation.width 
/ scale)  width?
+  
(widget-allocation.width / scale)*thumb_scale:width*thumb_scale),
+
((widget-allocation.height / scale)  height?
+  
(widget-allocation.height / scale)*thumb_scale:height*thumb_scale));
+
+if(viewer-priv-dst_pixbuf)
 {
-if (p_src_pixbuf)
-{
-p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
-   
(gint)(viewer-hadjustment-value / scale), 
-  
viewer-vadjustment-value / scale,
-
((widget-allocation.width/scale))  width?
-  
widget-allocation.width/scale:width,
-
((widget-allocation.height/scale)) height?
-  
widget-allocation.height/scale:height);
-
-if(viewer-priv-dst_pixbuf)
-{
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
-}
-if(p_tmp_pixbuf)
-{
-gint dst_width = gdk_pixbuf_get_width 
(p_tmp_pixbuf)*scale;
-gint dst_height = gdk_pixbuf_get_height 
(p_tmp_pixbuf)*scale;
-   

[Xfce4-commits] ristretto:ristretto-0.0 Improve moving of the image

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 148698070231eb6527c8e08cec68e0de5b432eea (commit)
   from 7566a5a251dd6a37bc30889dab19aa8615361b5a (commit)

commit 148698070231eb6527c8e08cec68e0de5b432eea
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 13 20:06:01 2009 +0100

Improve moving of the image

 src/picture_viewer.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 910c6cb..ec42a81 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -987,15 +987,15 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
  *  tmp_scale is the factor between the original image and the 
thumbnail,
  *  when looking at the actual image, tmp_scale == 1.0
  */
-gint x = (gint)viewer-hadjustment-value * scale;
-gint y = (gint)viewer-vadjustment-value * scale;
+gdouble x = viewer-hadjustment-value;
+gdouble y = viewer-vadjustment-value;
 
 p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
-   (gint)(x * thumb_scale), 
-  (y * thumb_scale),
-((widget-allocation.width 
/ scale)  width?
+   (gint)(x/scale * thumb_scale), 
+   (gint)(y/scale * thumb_scale),
+   
(gint)((widget-allocation.width / scale)  width?
   
(widget-allocation.width / scale)*thumb_scale:width*thumb_scale),
-
((widget-allocation.height / scale)  height?
+   
(gint)((widget-allocation.height / scale)  height?
   
(widget-allocation.height / scale)*thumb_scale:height*thumb_scale));
 
 if(viewer-priv-dst_pixbuf)
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'breakup_refresh'

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f6b085b3e0b356796a592414249485c7a8e8ae20 (commit)
   from 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c (commit)

commit f6b085b3e0b356796a592414249485c7a8e8ae20
Merge: 7c3c0b8 0c1e906
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 22:01:38 2009 +0100

Merge branch 'breakup_refresh'

Conflicts:

src/picture_viewer.c

commit 0c1e906c2931655b6f075bb7105895748b50946a
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:51:09 2009 +0100

Emit 'updated' signal when 'rstto_image_load' is called and the image is 
already there.

commit 68f99e86e52a3bbd80337b2e8516133eab1aaa23
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:44:47 2009 +0100

Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

commit 2b5990b32b22c130f54395eb0f61f9c7ad107e27
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:28:49 2009 +0100

Move DnD code to the bottom of the file

commit edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:23:48 2009 +0100

Fix segfault

commit 1da739e89571c1775602a511ad86b5c0ed97a8e1
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:03:41 2009 +0100

Made all the scale related functions internal

commit 7da92c8d582e14d50adfee29144751e7b89b93cb
Author: Stephan Arts step...@xfce.org
Date:   Sun Mar 8 14:22:37 2009 +0100

Split 'view' state from 'motion' state

commit 691a6a7c89eb2902984ac6ccfe02e219168b82f4
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:28:33 2009 +0100

commit changes

commit ad1c2baadb12b28c47cbeb97b622af39d614ba5a
Author: Stephan Arts step...@xfce.org
Date:   Sun Feb 22 10:40:29 2009 +0100

Add refresh mask, needs some tweaking, but it solves the drag 
performance-loss.
Eventually, this should reduce the times ristretto scales the image.

 src/image.c  |2 +-
 src/main_window.c|   10 +-
 src/picture_viewer.c | 1010 +-
 src/picture_viewer.h |   15 +-
 4 files changed, 522 insertions(+), 515 deletions(-)

diff --git a/src/image.c b/src/image.c
index a717cca..82d23fe 100644
--- a/src/image.c
+++ b/src/image.c
@@ -407,7 +407,7 @@ rstto_image_load (RsttoImage *image, gboolean empty_cache, 
GError **error)
 }
 else
 {
-//g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
+g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
 rstto_image_cache_push_image (cache, image);
 return TRUE;
diff --git a/src/main_window.c b/src/main_window.c
index b7acbdb..2f8fe74 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+rstto_picture_viewer_zoom_100 (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -699,8 +699,7 @@ cb_rstto_main_window_zoom_100 (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_in (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale * ZOOM_FACTOR);
+rstto_picture_viewer_zoom_in (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**
@@ -713,8 +712,7 @@ cb_rstto_main_window_zoom_in (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_out (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale / ZOOM_FACTOR);
+rstto_picture_viewer_zoom_out (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**/
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6710a6a..acc1c5a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -30,12 +30,24 @@
 
 typedef enum
 {
-RSTTO_PICTURE_VIEWER_STATE_NONE,
-RSTTO_PICTURE_VIEWER_STATE_MOVE,
-RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM
+

[Xfce4-commits] ristretto:ristretto-0.0 cleanup some code

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 64c12a35e6f7465c3b5e4a31c18d8526019c81a7 (commit)
   from 148698070231eb6527c8e08cec68e0de5b432eea (commit)

commit 64c12a35e6f7465c3b5e4a31c18d8526019c81a7
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 13 21:19:31 2009 +0100

cleanup some code

 src/picture_viewer.c |   34 +++---
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index ec42a81..8f51294 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -101,6 +101,8 @@ static RsttoPictureViewerState
 rstto_picture_viewer_get_state (RsttoPictureViewer *viewer);
 static void
 rstto_picture_viewer_set_motion_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerMotionState state);
+static RsttoPictureViewerMotionState
+rstto_picture_viewer_get_motion_state (RsttoPictureViewer *viewer);
 
 static void
 rstto_picture_viewer_set_zoom_mode (RsttoPictureViewer *viewer, RsttoZoomMode 
mode);
@@ -190,10 +192,8 @@ rstto_picture_viewer_init(RsttoPictureViewer *viewer)
 g_signal_connect(G_OBJECT(viewer), motion_notify_event, 
G_CALLBACK(cb_rstto_picture_viewer_motion_notify_event), NULL);
 g_signal_connect(G_OBJECT(viewer), popup-menu, 
G_CALLBACK(cb_rstto_picture_viewer_popup_menu), NULL);
 
-/*
 gtk_drag_dest_set(GTK_WIDGET(viewer), 0, drop_targets, 
G_N_ELEMENTS(drop_targets),
   GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE | 
GDK_ACTION_PRIVATE);
-*/
 }
 
 /**
@@ -360,7 +360,6 @@ rstto_picture_viewer_size_allocate(GtkWidget *widget, 
GtkAllocation *allocation)
  * TODO: Check if we really nead a refresh
  */
 rstto_picture_viewer_queued_repaint (viewer, FALSE);
-//rstto_picture_viewer_paint (viewer);
 }
 
 /**
@@ -377,7 +376,6 @@ rstto_picture_viewer_expose(GtkWidget *widget, 
GdkEventExpose *event)
 /** 
  * TODO: Check if we really nead a refresh
  */
-//rstto_picture_viewer_paint (viewer);
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 return FALSE;
 }
@@ -1030,6 +1028,7 @@ rstto_picture_viewer_get_state (RsttoPictureViewer 
*viewer)
 return viewer-priv-state;
 }
 
+
 static void
 rstto_picture_viewer_set_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerState state)
 {
@@ -1042,6 +1041,12 @@ rstto_picture_viewer_set_motion_state 
(RsttoPictureViewer *viewer, RsttoPictureV
 viewer-priv-motion.state = state;
 }
 
+static RsttoPictureViewerMotionState
+rstto_picture_viewer_get_motion_state (RsttoPictureViewer *viewer)
+{
+return viewer-priv-motion.state;
+}
+
 static void
 cb_rstto_picture_viewer_button_press_event (RsttoPictureViewer *viewer, 
GdkEventButton *event)
 {
@@ -1100,11 +1105,26 @@ static void
 cb_rstto_picture_viewer_button_release_event (RsttoPictureViewer *viewer, 
GdkEventButton *event)
 {
 GtkWidget *widget = GTK_WIDGET(viewer);
+switch (event-button)
+{
+case 1:
+switch (rstto_picture_viewer_get_motion_state (viewer))
+{
+case RSTTO_PICTURE_VIEWER_MOTION_STATE_BOX_ZOOM:
+rstto_picture_viewer_set_zoom_mode (viewer, 
RSTTO_ZOOM_MODE_CUSTOM);
+if(GTK_WIDGET_REALIZED(widget))
+{
 
-gdk_window_set_cursor(widget-window, NULL);
+}
+break;
+default:
+break;
+}
+rstto_picture_viewer_set_motion_state (viewer, 
RSTTO_PICTURE_VIEWER_MOTION_STATE_NORMAL);
+rstto_picture_viewer_queued_repaint (viewer, FALSE);
+break;
+}
 
-rstto_picture_viewer_set_motion_state (viewer, 
RSTTO_PICTURE_VIEWER_MOTION_STATE_NORMAL);
-rstto_picture_viewer_queued_repaint (viewer, FALSE);
 }
 
 static void
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Initial Commit

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 64cb5958270db4126e75a42cdf99838485501c14 (commit)
   from 64cb5958270db4126e75a42cdf99838485501c14^1 ()


___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 - Fix picture viewer refresh when no image is present - Add notebook to preferences dialog - Rename icon in preferences dialog

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 94adc418fdc9869d468f34b004ae8038aa49bc35 (commit)
   from 64c12a35e6f7465c3b5e4a31c18d8526019c81a7 (commit)

commit 94adc418fdc9869d468f34b004ae8038aa49bc35
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 13 23:18:18 2009 +0100

- Fix picture viewer refresh when no image is present
- Add notebook to preferences dialog
- Rename icon in preferences dialog

 src/main_window.c|1 +
 src/picture_viewer.c |   14 +-
 src/preferences_dialog.c |7 ++-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 2f8fe74..4b78e7b 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1243,6 +1243,7 @@ cb_rstto_main_window_close (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_close_all (GtkWidget *widget, RsttoMainWindow *window)
 {
+rstto_picture_viewer_set_image (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), NULL);
 rstto_navigator_remove_all (window-priv-props.navigator);
 }
 
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 8f51294..3ebfb15 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -979,6 +979,11 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 
 if (viewer-priv-repaint.refresh)
 {
+if(viewer-priv-dst_pixbuf)
+{
+g_object_unref(viewer-priv-dst_pixbuf);
+viewer-priv-dst_pixbuf = NULL;
+}
 if (p_src_pixbuf)
 {
 /**
@@ -996,11 +1001,6 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)

(gint)((widget-allocation.height / scale)  height?
   
(widget-allocation.height / scale)*thumb_scale:height*thumb_scale));
 
-if(viewer-priv-dst_pixbuf)
-{
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
-}
 if(p_tmp_pixbuf)
 {
 gint dst_width = gdk_pixbuf_get_width 
(p_tmp_pixbuf)*(scale/thumb_scale);
@@ -1244,6 +1244,10 @@ rstto_picture_viewer_set_image (RsttoPictureViewer 
*viewer, RsttoImage *image)
 }
 rstto_image_load (viewer-priv-image, FALSE, NULL);
 }
+else
+{
+rstto_picture_viewer_queued_repaint (viewer, TRUE);
+}
 }
 
 /**
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 10920ed..134d63e 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -20,6 +20,7 @@
 #include gtk/gtk.h
 #include libxfcegui4/libxfcegui4.h
 
+#include settings.h
 #include preferences_dialog.h
 
 static void
@@ -58,6 +59,10 @@ rstto_preferences_dialog_get_type ()
 static void
 rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 {
+RsttoSettings *settings_manager = rstto_settings_new ();
+GtkWidget *notebook = gtk_notebook_new ();
+
+gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)-vbox), notebook);
 gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, 
GTK_RESPONSE_OK);
 }
 
@@ -73,7 +78,7 @@ rstto_preferences_dialog_new (GtkWindow *parent)
 {
 GtkWidget *dialog = g_object_new (RSTTO_TYPE_PREFERENCES_DIALOG,
   title, _(Preferences),
-  icon-name, go-left,
+  icon-name, GTK_STOCK_PREFERENCES,
   NULL);
 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add missing main_window_ui.xml file from svn

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)
   from 64cb5958270db4126e75a42cdf99838485501c14 (commit)

commit 7d29665d25fe6356853220c6a2e3506fe02d9635
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 00:15:57 2009 +0100

Add missing main_window_ui.xml file from svn

 src/main_window_ui.xml |   74 
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
new file mode 100644
index 000..2004b83
--- /dev/null
+++ b/src/main_window_ui.xml
@@ -0,0 +1,74 @@
+ui
+!--
+
+
+--
+menubar name=main-menu
+menu action=file-menu
+menuitem action=open/
+menuitem action=open-folder/
+menu action=open-recent-menu
+placeholder name=placeholder-open-recent/
+/menu
+separator/
+menuitem action=file-properties/
+separator/
+menuitem action=close/
+menuitem action=close-all/
+menuitem action=quit/
+/menu
+menu action=edit-menu
+menu action=open-with-menu
+placeholder name=open-with-apps /
+/menu
+separator/
+menuitem action=preferences/
+/menu
+menu action=view-menu
+menuitem action=show-toolbar/
+menuitem action=show-thumbnailbar/
+separator/
+menu action=zoom-menu
+menuitem action=zoom-in/
+menuitem action=zoom-out/
+menuitem action=zoom-fit/
+menuitem action=zoom-100/
+/menu
+menu action=rotation-menu
+menuitem action=rotate-cw/
+menuitem action=rotate-ccw/
+/menu
+separator/
+menuitem action=fullscreen/
+menuitem action=set-as-wallpaper/
+/menu
+menu action=go-menu
+menuitem action=back/
+menuitem action=forward/
+menuitem action=first/
+menuitem action=last/
+separator/
+placeholder name=placeholder-slideshow /
+/menu
+menu action=help-menu
+menuitem action=contents/
+menuitem action=about/
+/menu
+/menubar
+
+!--
+
+
+--
+toolbar name=main-toolbar
+toolitem action=open/
+separator /
+toolitem action=back/
+toolitem action=forward/
+separator name=placeholder-1/
+toolitem action=zoom-in/
+toolitem action=zoom-out/
+toolitem action=zoom-100/
+toolitem action=zoom-fit/
+/toolbar
+/ui
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add missing options to the preferences dialog

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 83656e1f3afa123a0cd5a645c089adaffbe13ac5 (commit)
   from 8f3bd6691ddf5e23883d31307bef55bbee5e9e28 (commit)

commit 83656e1f3afa123a0cd5a645c089adaffbe13ac5
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 23 21:59:36 2009 +0100

Add missing options to the preferences dialog

 src/preferences_dialog.c |   38 ++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 79d622d..a51408a 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -65,6 +65,10 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 GtkWidget *scroll_frame, *scroll_vbox;
 GtkWidget *timeout_frame, *timeout_vbox, *timeout_lbl, *timeout_hscale;
 GtkWidget *slideshow_bgcolor_frame, *slideshow_bgcolor_vbox, 
*slideshow_bgcolor_hbox, *slideshow_bgcolor_button;
+GtkWidget *bgcolor_frame, *bgcolor_vbox, *bgcolor_hbox, *bgcolor_button;
+GtkWidget *cache_frame, *cache_vbox;
+GtkWidget *scaling_frame, *scaling_vbox;
+GtkObject *cache_hbox, *cache_adjustment, *cache_spin_button, 
*cache_preload_check_button;
 
 GtkWidget *widget;
 
@@ -73,6 +77,31 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 GtkWidget *display_main_lbl = gtk_label_new(_(Display));
 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), display_main_vbox, 
display_main_lbl);
 
+bgcolor_vbox = gtk_vbox_new(FALSE, 0);
+bgcolor_frame = xfce_create_framebox_with_content (_(Background color), 
bgcolor_vbox);
+gtk_container_add (GTK_CONTAINER (display_main_vbox), bgcolor_frame);
+
+widget = gtk_check_button_new_with_label (_(Override background color:));
+bgcolor_hbox = gtk_hbox_new(FALSE, 4);
+bgcolor_button = gtk_color_button_new();
+gtk_container_add (GTK_CONTAINER (bgcolor_hbox), widget);
+gtk_container_add (GTK_CONTAINER (bgcolor_hbox), bgcolor_button);
+gtk_container_add (GTK_CONTAINER (bgcolor_vbox), bgcolor_hbox);
+
+cache_vbox = gtk_vbox_new(FALSE, 0);
+cache_frame = xfce_create_framebox_with_content (_(Image cache), 
cache_vbox);
+gtk_container_add (GTK_CONTAINER (display_main_vbox), cache_frame);
+
+cache_adjustment = gtk_adjustment_new(1000, 0, , 1, 0, 0);
+widget = gtk_label_new (_(Cache size));
+cache_hbox = gtk_hbox_new(FALSE, 4);
+cache_spin_button = gtk_spin_button_new(GTK_ADJUSTMENT(cache_adjustment), 
1.0, 0);
+cache_preload_check_button = gtk_check_button_new_with_label (_(Preload 
images));
+gtk_container_add (GTK_CONTAINER (cache_hbox), widget);
+gtk_container_add (GTK_CONTAINER (cache_hbox), cache_spin_button);
+gtk_container_add (GTK_CONTAINER (cache_vbox), cache_hbox);
+gtk_container_add (GTK_CONTAINER (cache_vbox), cache_preload_check_button);
+
 //
 GtkWidget *slideshow_main_vbox = gtk_vbox_new(FALSE, 0);
 GtkWidget *slideshow_main_lbl = gtk_label_new(_(Slideshow));
@@ -129,6 +158,15 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 GtkWidget *behaviour_main_lbl = gtk_label_new(_(Behaviour));
 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), behaviour_main_vbox, 
behaviour_main_lbl);
 
+scaling_vbox = gtk_vbox_new(FALSE, 0);
+scaling_frame = xfce_create_framebox_with_content (_(Scaling), 
scaling_vbox);
+gtk_container_add (GTK_CONTAINER (behaviour_main_vbox), scaling_frame);
+
+widget = gtk_check_button_new_with_label (_(Don't scale over 100% when 
maximizing the window.));
+gtk_container_add (GTK_CONTAINER (scaling_vbox), widget);
+
+
+//
 gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)-vbox), notebook);
 gtk_widget_show_all (notebook);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Clean up looks of preferences dialog Update TODO

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to c2a9945bcada416a23698705f6402560405c756c (commit)
   from 83656e1f3afa123a0cd5a645c089adaffbe13ac5 (commit)

commit c2a9945bcada416a23698705f6402560405c756c
Author: Stephan Arts step...@xfce.org
Date:   Fri Apr 3 12:02:38 2009 +0200

Clean up looks of preferences dialog
Update TODO

 TODO |   13 +
 src/preferences_dialog.c |   24 
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/TODO b/TODO
index 6f54d24..54cd5cd 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,14 @@
 - Merge transform actions of consecutive imagetransformations of the same type
 
 - Implement preferences dialog
+- Add a file-properties dialog
+
+- Support setting wallpapers
+- xfdesktop
+- nautilus
+- rox
+
+- Implement box-zoom
 
 - Add preloading
 - Improve cache calculation
@@ -8,3 +16,8 @@
 - Write comments
 
 - Remove libxfce4util dependency
+
+- Implement thumbnailbar
+
+- Support image collections
+- Export to tarball/zip
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index a51408a..62559b7 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -69,6 +69,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 GtkWidget *cache_frame, *cache_vbox;
 GtkWidget *scaling_frame, *scaling_vbox;
 GtkObject *cache_hbox, *cache_adjustment, *cache_spin_button, 
*cache_preload_check_button;
+GtkWidget *toolbar_vbox, *toolbar_frame;
 
 GtkWidget *widget;
 
@@ -79,7 +80,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 
 bgcolor_vbox = gtk_vbox_new(FALSE, 0);
 bgcolor_frame = xfce_create_framebox_with_content (_(Background color), 
bgcolor_vbox);
-gtk_container_add (GTK_CONTAINER (display_main_vbox), bgcolor_frame);
+gtk_box_pack_start (GTK_BOX (display_main_vbox), bgcolor_frame, FALSE, 
FALSE, 0);
 
 widget = gtk_check_button_new_with_label (_(Override background color:));
 bgcolor_hbox = gtk_hbox_new(FALSE, 4);
@@ -90,7 +91,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 
 cache_vbox = gtk_vbox_new(FALSE, 0);
 cache_frame = xfce_create_framebox_with_content (_(Image cache), 
cache_vbox);
-gtk_container_add (GTK_CONTAINER (display_main_vbox), cache_frame);
+gtk_box_pack_start (GTK_BOX (display_main_vbox), cache_frame, FALSE, 
FALSE, 0);
 
 cache_adjustment = gtk_adjustment_new(1000, 0, , 1, 0, 0);
 widget = gtk_label_new (_(Cache size));
@@ -99,8 +100,8 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 cache_preload_check_button = gtk_check_button_new_with_label (_(Preload 
images));
 gtk_container_add (GTK_CONTAINER (cache_hbox), widget);
 gtk_container_add (GTK_CONTAINER (cache_hbox), cache_spin_button);
-gtk_container_add (GTK_CONTAINER (cache_vbox), cache_hbox);
-gtk_container_add (GTK_CONTAINER (cache_vbox), cache_preload_check_button);
+gtk_box_pack_start (GTK_BOX (cache_vbox), cache_hbox, FALSE, FALSE, 0);
+gtk_box_pack_start (GTK_BOX (cache_vbox), cache_preload_check_button, 
FALSE, FALSE, 0);
 
 //
 GtkWidget *slideshow_main_vbox = gtk_vbox_new(FALSE, 0);
@@ -109,7 +110,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 
 slideshow_bgcolor_vbox = gtk_vbox_new(FALSE, 0);
 slideshow_bgcolor_frame = xfce_create_framebox_with_content (_(Background 
color), slideshow_bgcolor_vbox);
-gtk_container_add (GTK_CONTAINER (slideshow_main_vbox), 
slideshow_bgcolor_frame);
+gtk_box_pack_start (GTK_BOX (slideshow_main_vbox), 
slideshow_bgcolor_frame, FALSE, FALSE, 0);
 
 widget = gtk_radio_button_new_with_label (NULL, _(Black));
 gtk_container_add (GTK_CONTAINER (slideshow_bgcolor_vbox), widget);
@@ -125,7 +126,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 
 timeout_vbox = gtk_vbox_new(FALSE, 0);
 timeout_frame = xfce_create_framebox_with_content (_(Timeout), 
timeout_vbox);
-gtk_container_add (GTK_CONTAINER (slideshow_main_vbox), timeout_frame);
+gtk_box_pack_start (GTK_BOX (slideshow_main_vbox), timeout_frame, FALSE, 
FALSE, 0);
 
 
 timeout_lbl = gtk_label_new(_(The time period an individual image is 
displayed during a slideshow\n(in seconds)));
@@ -144,7 +145,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 
 scroll_vbox = gtk_vbox_new(FALSE, 0);
 scroll_frame = xfce_create_framebox_with_content (_(Scrollwheel), 
scroll_vbox);
-gtk_container_add (GTK_CONTAINER (control_main_vbox), scroll_frame);
+gtk_box_pack_start (GTK_BOX (control_main_vbox), scroll_frame, FALSE, 
FALSE, 0);
 
 widget = gtk_radio_button_new_with_label (NULL, _(No action));
 gtk_container_add (GTK_CONTAINER (scroll_vbox), widget);
@@ -153,6 +154,13 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 widget = 

[Xfce4-commits] ristretto:ristretto-0.0 Removed autogenerated header from git Added the recently used menu to the file-menu

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f4223148a6df935fa94da97a94ec04e89c0f29db (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |   19 ---
 src/main_window_ui.h   |   37 -
 src/main_window_ui.xml |4 +---
 3 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..c859cdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -185,7 +186,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -282,7 +282,7 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-settings_manager = rstto_settings_new();
 
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
@@ -293,6 +293,8 @@ rstto_main_window_init (RsttoMainWindow *window)
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
+window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
+
 /* Add the same accelerator path to play and pause, so the same 
kb-shortcut will be used for starting and stopping the slideshow */
 gtk_action_set_accel_path (window-priv-pause_action, 
Actions/RsttoWindow/play);
 gtk_action_set_accel_path (window-priv-play_action, 
Actions/RsttoWindow/play);
@@ -301,6 +303,8 @@ rstto_main_window_init (RsttoMainWindow *window)
  window-priv-play_action);
 gtk_action_group_add_action (window-priv-action_group,
  window-priv-pause_action);
+gtk_action_group_add_action (window-priv-action_group,
+ window-priv-recent_action);
 /* Connect signal-handlers */
 g_signal_connect(G_OBJECT(window-priv-play_action), activate, 
G_CALLBACK(cb_rstto_main_window_play), window);
 g_signal_connect(G_OBJECT(window-priv-pause_action), activate, 
G_CALLBACK(cb_rstto_main_window_pause), window);
@@ -349,6 +353,15 @@ rstto_main_window_init (RsttoMainWindow *window)
GTK_UI_MANAGER_MENUITEM,
FALSE);
 
+
+gtk_ui_manager_add_ui (window-priv-ui_manager,
+   window-priv-recent_merge_id,
+   /main-menu/file-menu/placeholder-open-recent,
+   recent,
+   recent,
+   GTK_UI_MANAGER_MENUITEM,
+   FALSE);
+
 g_value_init (window_width, G_TYPE_UINT);
 g_value_init (window_height, G_TYPE_UINT);
 g_object_get_property (G_OBJECT(window-priv-settings_manager), 
window-width, window_width);
diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu 

[Xfce4-commits] ristretto:ristretto-0.0 Add a preload state to the pictureviewer, where it will render the thumbnail instead of the original image.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to d4e2a5d7d9d203d5477a3dad227c1d7849b80df4 (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit d4e2a5d7d9d203d5477a3dad227c1d7849b80df4
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 01:08:31 2009 +0100

Add a preload state to the pictureviewer, where it will render the 
thumbnail instead of the original image.

 src/picture_viewer.c |  232 ++
 1 files changed, 44 insertions(+), 188 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index c88bbc6..6a75a07 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -56,6 +56,8 @@ struct _RsttoPictureViewerPriv
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
+gdouble  scale;
+
 struct
 {
 gdouble x;
@@ -674,207 +676,61 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
 GtkWidget *widget = GTK_WIDGET(viewer);
 GdkPixbuf *src_pixbuf = NULL;
+GdkPixbuf *thumb_pixbuf = NULL;
 gboolean *fit_to_screen = NULL;
 gdouble *scale = NULL;
-gboolean changed = TRUE;
+gint width = 0, height = 0;
 
-if (viewer-priv-image)
+if (viewer-priv-state == RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
 {
-fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
-scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+if (viewer-priv-image != NULL);
+{   
+src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
+thumb_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
 
-src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-
-if (viewer-priv-state == RSTTO_PICTURE_VIEWER_STATE_PREVIEW)
-{
-src_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
-}
-if (src_pixbuf != NULL)
-{
-g_object_ref (src_pixbuf);
-}
-else
-{
-if(viewer-priv-dst_pixbuf)
+if (src_pixbuf)
 {
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
+width = gdk_pixbuf_get_width (src_pixbuf);
+height = gdk_pixbuf_get_height (src_pixbuf);
+
+/* Check if the image fits inside the viewer,
+ * if not, scale it down to fit
+ */
+if ((GTK_WIDGET (viewer)-allocation.width  width) ||
+(GTK_WIDGET (viewer)-allocation.height  height))
+{
+/* The image does not fit the picture-viewer, and 
+ * we decided to scale it down to fit. Now we need to check
+ * which side we need to use as a reference.
+ *
+ * We use the one that produces a larger scale difference
+ * to the viewer.
+ */
+if ((GTK_WIDGET (viewer)-allocation.width / width) 
+(GTK_WIDGET (viewer)-allocation.height / height))
+{
+viewer-priv-scale = GTK_WIDGET 
(viewer)-allocation.width / width;
+}
+else
+{
+viewer-priv-scale = GTK_WIDGET 
(viewer)-allocation.height / height;
+}
+}
+else
+{
+/* The image is smaller then the picture-viewer,
+ * As a result, view it at it's original size.
+ */
+viewer-priv-scale = 1.0;
+}
 }
-return changed;
 }
 }
 else
 {
-if(viewer-priv-dst_pixbuf)
-{
-g_object_unref(viewer-priv-dst_pixbuf);
-viewer-priv-dst_pixbuf = NULL;
-}
-return changed;
-}
-
-
-if (scale == NULL)
-scale = g_new0 (gdouble, 1);
-if (fit_to_screen == NULL)
-fit_to_screen = g_new0 (gboolean , 1);
-
-
-gboolean vadjustment_changed = FALSE;
-gboolean hadjustment_changed = FALSE;
-
-gdouble width = (gdouble)gdk_pixbuf_get_width(src_pixbuf);
-gdouble height = (gdouble)gdk_pixbuf_get_height(src_pixbuf);
-
-if (*scale == 0)
-{
-if ((widget-allocation.width  width)  (widget-allocation.height  
height))
-{
-*scale = 1.0;
-*fit_to_screen = FALSE;
 
-g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
-}
-else
-{
-*fit_to_screen = TRUE;
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, 

[Xfce4-commits] ristretto:ristretto-0.0 Implement bgcolor settings

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to be4b10beab50a7a9e3ceb6e84fbfd65cd223395f (commit)
   from c2a9945bcada416a23698705f6402560405c756c (commit)

commit be4b10beab50a7a9e3ceb6e84fbfd65cd223395f
Author: Stephan Arts step...@xfce.org
Date:   Wed Apr 22 00:40:08 2009 +0200

Implement bgcolor settings

 src/picture_viewer.c |   14 -
 src/preferences_dialog.c |   71 ++
 src/settings.c   |  127 --
 3 files changed, 184 insertions(+), 28 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 1d5d0b1..9b803a1 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -27,6 +27,7 @@
 
 #include image.h
 #include picture_viewer.h
+#include settings.h
 
 typedef enum
 {
@@ -389,10 +390,18 @@ rstto_picture_viewer_expose(GtkWidget *widget, 
GdkEventExpose *event)
 static void
 rstto_picture_viewer_paint (GtkWidget *widget)
 {
+RsttoSettings *settings_manager = rstto_settings_new();
 RsttoPictureViewer *viewer = RSTTO_PICTURE_VIEWER(widget);
 GdkPixbuf *pixbuf = viewer-priv-dst_pixbuf;
 GdkColor color;
 GdkColor line_color;
+GValue bg_color = {0, }, bg_color_override = {0, };
+g_value_init (bg_color, GDK_TYPE_COLOR);
+g_value_init (bg_color_override, G_TYPE_BOOLEAN);
+
+g_object_get_property (G_OBJECT(settings_manager), bgcolor, bg_color);
+g_object_get_property (G_OBJECT(settings_manager), bgcolor-override, 
bg_color_override);
+
 
 color.pixel = 0x0;
 line_color.pixel = 0x0;
@@ -405,9 +414,9 @@ rstto_picture_viewer_paint (GtkWidget *widget)
 GdkPixmap *buffer = gdk_pixmap_new(NULL, widget-allocation.width, 
widget-allocation.height, gdk_drawable_get_depth(widget-window));
 GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(buffer));
 
-if (viewer-priv-bg_color)
+if (g_value_get_boxed (bg_color)  g_value_get_boolean 
(bg_color_override))
 {
-gdk_gc_set_foreground(gc, viewer-priv-bg_color);
+gdk_gc_set_foreground(gc, g_value_get_boxed (bg_color));
 }
 else
 {
@@ -561,6 +570,7 @@ rstto_picture_viewer_paint (GtkWidget *widget)
 widget-allocation.height);
 g_object_unref(buffer);
}
+   g_object_unref (settings_manager);
 }
 
 static void
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 62559b7..917c89f 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -29,6 +29,12 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *);
 static void
 rstto_preferences_dialog_class_init(RsttoPreferencesDialogClass *);
 
+
+static void
+cb_rstto_preferences_dialog_bgcolor_override_toggled (GtkToggleButton *, 
gpointer);
+static void
+cb_rstto_preferences_dialog_bgcolor_color_set (GtkColorButton *, gpointer);
+
 static GtkWidgetClass *parent_class = NULL;
 
 GType
@@ -68,7 +74,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 GtkWidget *bgcolor_frame, *bgcolor_vbox, *bgcolor_hbox, *bgcolor_button;
 GtkWidget *cache_frame, *cache_vbox;
 GtkWidget *scaling_frame, *scaling_vbox;
-GtkObject *cache_hbox, *cache_adjustment, *cache_spin_button, 
*cache_preload_check_button;
+GtkWidget *cache_hbox, *cache_adjustment, *cache_spin_button, 
*cache_preload_check_button;
 GtkWidget *toolbar_vbox, *toolbar_frame;
 
 GtkWidget *widget;
@@ -85,9 +91,13 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 widget = gtk_check_button_new_with_label (_(Override background color:));
 bgcolor_hbox = gtk_hbox_new(FALSE, 4);
 bgcolor_button = gtk_color_button_new();
-gtk_container_add (GTK_CONTAINER (bgcolor_hbox), widget);
-gtk_container_add (GTK_CONTAINER (bgcolor_hbox), bgcolor_button);
-gtk_container_add (GTK_CONTAINER (bgcolor_vbox), bgcolor_hbox);
+gtk_box_pack_start (GTK_BOX (bgcolor_hbox), widget, FALSE, FALSE, 0);
+gtk_box_pack_start (GTK_BOX (bgcolor_hbox), bgcolor_button, FALSE, FALSE, 
0);
+gtk_box_pack_start (GTK_BOX (bgcolor_vbox), bgcolor_hbox, FALSE, FALSE, 0);
+
+/* connect signals */
+g_signal_connect (G_OBJECT (widget), toggled, 
(GCallback)cb_rstto_preferences_dialog_bgcolor_override_toggled, 
bgcolor_button);
+g_signal_connect (G_OBJECT (bgcolor_button), color-set, G_CALLBACK 
(cb_rstto_preferences_dialog_bgcolor_color_set), NULL);
 
 cache_vbox = gtk_vbox_new(FALSE, 0);
 cache_frame = xfce_create_framebox_with_content (_(Image cache), 
cache_vbox);
@@ -98,8 +108,8 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog *dialog)
 cache_hbox = gtk_hbox_new(FALSE, 4);
 cache_spin_button = gtk_spin_button_new(GTK_ADJUSTMENT(cache_adjustment), 
1.0, 0);
 cache_preload_check_button = gtk_check_button_new_with_label (_(Preload 
images));
-gtk_container_add (GTK_CONTAINER (cache_hbox), widget);
-gtk_container_add (GTK_CONTAINER (cache_hbox), cache_spin_button);
+

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'master' into new_picture_viewer

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to c2e9b6b2e7c036f6e144318f9856ed44c28e69ae (commit)
   from d4e2a5d7d9d203d5477a3dad227c1d7849b80df4 (commit)

commit c2e9b6b2e7c036f6e144318f9856ed44c28e69ae
Merge: d4e2a5d 3f8ba01
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:26:25 2009 +0100

Merge branch 'master' into new_picture_viewer

commit 3f8ba01f6df517764a03802d145dfcf18bf14fbc
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:22:56 2009 +0100

Remove autogenerated header file from git

 src/main_window_ui.h |   37 -
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu action=\file-menu\menuitem ac
-  tion=\open\/menuitem action=\open-folder\/menu action=\open-re
-  cent-menu\placeholder name=\placeholder-open-recent\//menusepa
-  rator/menuitem action=\file-properties\/separator/menuitem acti
-  on=\close\/menuitem action=\close-all\/menuitem action=\quit\
-  //menumenu action=\edit-menu\menu action=\open-with-menu\pl
-  aceholder name=\open-with-apps\ //menuseparator/menuitem action
-  =\preferences\//menumenu action=\view-menu\menuitem action=\
-  show-toolbar\/menuitem action=\show-thumbnailbar\/separator/me
-  nu action=\zoom-menu\menuitem action=\zoom-in\/menuitem action=
-  \zoom-out\/menuitem action=\zoom-fit\/menuitem action=\zoom-10
-  0\//menumenu action=\rotation-menu\menuitem action=\rotate-cw
-  \/menuitem action=\rotate-ccw\//menuseparator/menuitem actio
-  n=\fullscreen\/menuitem action=\set-as-wallpaper\//menumenu a
-  ction=\go-menu\menuitem action=\back\/menuitem action=\forward
-  \/menuitem action=\first\/menuitem action=\last\/separator/
-  placeholder name=\placeholder-slideshow\ //menumenu action=\hel
-  p-menu\menuitem action=\contents\/menuitem action=\about\//m
-  enu/menubartoolbar name=\main-toolbar\toolitem action=\open\/
-  separator /toolitem action=\back\/toolitem action=\forward\/
-  separator name=\placeholder-1\/toolitem action=\zoom-in\/tooli
-  tem action=\zoom-out\/toolitem action=\zoom-100\/toolitem actio
-  n=\zoom-fit\//toolbar/ui
-};
-
-static const unsigned main_window_ui_length = 1503u;
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Remove autogenerated header file from git

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 3f8ba01f6df517764a03802d145dfcf18bf14fbc (commit)
   from 7d29665d25fe6356853220c6a2e3506fe02d9635 (commit)

commit 3f8ba01f6df517764a03802d145dfcf18bf14fbc
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:22:56 2009 +0100

Remove autogenerated header file from git

 src/main_window_ui.h |   37 -
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/main_window_ui.h b/src/main_window_ui.h
deleted file mode 100644
index e66253c..000
--- a/src/main_window_ui.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* automatically generated from main_window_ui.xml */
-#ifdef __SUNPRO_C
-#pragma align 4 (main_window_ui)
-#endif
-#ifdef __GNUC__
-static const char main_window_ui[] __attribute__ ((__aligned__ (4))) =
-#else
-static const char main_window_ui[] =
-#endif
-{
-  uimenubar name=\main-menu\menu action=\file-menu\menuitem ac
-  tion=\open\/menuitem action=\open-folder\/menu action=\open-re
-  cent-menu\placeholder name=\placeholder-open-recent\//menusepa
-  rator/menuitem action=\file-properties\/separator/menuitem acti
-  on=\close\/menuitem action=\close-all\/menuitem action=\quit\
-  //menumenu action=\edit-menu\menu action=\open-with-menu\pl
-  aceholder name=\open-with-apps\ //menuseparator/menuitem action
-  =\preferences\//menumenu action=\view-menu\menuitem action=\
-  show-toolbar\/menuitem action=\show-thumbnailbar\/separator/me
-  nu action=\zoom-menu\menuitem action=\zoom-in\/menuitem action=
-  \zoom-out\/menuitem action=\zoom-fit\/menuitem action=\zoom-10
-  0\//menumenu action=\rotation-menu\menuitem action=\rotate-cw
-  \/menuitem action=\rotate-ccw\//menuseparator/menuitem actio
-  n=\fullscreen\/menuitem action=\set-as-wallpaper\//menumenu a
-  ction=\go-menu\menuitem action=\back\/menuitem action=\forward
-  \/menuitem action=\first\/menuitem action=\last\/separator/
-  placeholder name=\placeholder-slideshow\ //menumenu action=\hel
-  p-menu\menuitem action=\contents\/menuitem action=\about\//m
-  enu/menubartoolbar name=\main-toolbar\toolitem action=\open\/
-  separator /toolitem action=\back\/toolitem action=\forward\/
-  separator name=\placeholder-1\/toolitem action=\zoom-in\/tooli
-  tem action=\zoom-out\/toolitem action=\zoom-100\/toolitem actio
-  n=\zoom-fit\//toolbar/ui
-};
-
-static const unsigned main_window_ui_length = 1503u;
-
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add some more comments Add a recent-filter to the recent-chooser (only filter the files opened by ristretto) Actually open files from the recent-chooser

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 73a8d7229f688d4b796117843b97b0101c1f5fdc (commit)
   from f4223148a6df935fa94da97a94ec04e89c0f29db (commit)

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

 src/main_window.c  |   98 +++-
 src/main_window_ui.xml |2 +-
 2 files changed, 81 insertions(+), 19 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index c859cdb..96d64f3 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -148,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,24 +284,32 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
 window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
 window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
 
+/**
+ * Add a filter to the recent-chooser
+ */
+recent_filter = gtk_recent_filter_new();
+gtk_recent_filter_add_application (recent_filter, ristretto);
+
gtk_recent_chooser_add_filter(GTK_RECENT_CHOOSER(window-priv-recent_action), 
recent_filter);
+
 /* Add the same accelerator path to play and pause, so the same 
kb-shortcut will be used for starting and stopping the slideshow */
 gtk_action_set_accel_path (window-priv-pause_action, 
Actions/RsttoWindow/play);
 gtk_action_set_accel_path (window-priv-play_action, 
Actions/RsttoWindow/play);
+
 /* Add the play and pause actions to the actiongroup */
+window-priv-action_group = gtk_action_group_new (RsttoWindow);
 gtk_action_group_add_action (window-priv-action_group,
  window-priv-play_action);
 gtk_action_group_add_action (window-priv-action_group,
@@ -308,6 +319,7 @@ rstto_main_window_init (RsttoMainWindow *window)
 /* Connect signal-handlers */
 g_signal_connect(G_OBJECT(window-priv-play_action), activate, 
G_CALLBACK(cb_rstto_main_window_play), window);
 g_signal_connect(G_OBJECT(window-priv-pause_action), activate, 
G_CALLBACK(cb_rstto_main_window_pause), window);
+g_signal_connect(G_OBJECT(window-priv-recent_action), item-activated, 
G_CALLBACK(cb_rstto_main_window_open_recent), window);
 
 gtk_ui_manager_insert_action_group (window-priv-ui_manager, 
window-priv-action_group, 0);
 
@@ -319,10 +331,17 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-menubar = gtk_ui_manager_get_widget 
(window-priv-ui_manager, /main-menu);
 window-priv-toolbar = gtk_ui_manager_get_widget 
(window-priv-ui_manager, /main-toolbar);
 
-separator = gtk_ui_manager_get_widget (window-priv-ui_manager, 

[Xfce4-commits] ristretto:ristretto-0.0 Implemented 'open folder'.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 1d06647dac89feb4e0eb82ac437b7710b7753b8c (commit)
   from 73a8d7229f688d4b796117843b97b0101c1f5fdc (commit)

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

 src/main_window.c |   70 ++---
 1 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 96d64f3..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -850,6 +850,7 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window)
 GFile *file;
 GSList *files = NULL, *_files_iter;
 GValue current_uri_val = {0, };
+gchar *uri = NULL;
 
 g_value_init (current_uri_val, G_TYPE_STRING);
 g_object_get_property (G_OBJECT(window-priv-settings_manager), 
current-uri, current_uri_val);
@@ -891,6 +892,13 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_dialog_run(GTK_DIALOG(dialog));
 gtk_widget_destroy(dialog);
 }
+else
+{
+uri = g_file_get_uri (_files_iter-data);
+gtk_recent_manager_add_item (window-priv-recent_manager, 
uri);
+g_free (uri);
+uri = NULL;
+}
 _files_iter = g_slist_next (_files_iter);
 }
 g_value_set_string (current_uri_val, 
gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (dialog)));
@@ -918,7 +926,11 @@ static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window)
 {
 gint response;
-GFile *file = NULL;
+GFile *file = NULL, *child_file = NULL;
+GFileEnumerator *file_enumarator = NULL;
+GFileInfo *file_info = NULL;
+const gchar *filename = NULL;
+gchar *uri = NULL;
 GValue current_uri_val = {0, };
 
 g_value_init (current_uri_val, G_TYPE_STRING);
@@ -937,6 +949,23 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_widget_hide(dialog);
 file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
 
+file_enumarator = g_file_enumerate_children (file, standard::name, 
0, NULL, NULL);
+while (file_info = g_file_enumerator_next_file (file_enumarator, NULL, 
NULL))
+{
+filename = g_file_info_get_name (file_info);
+child_file = g_file_get_child (file, filename);
+
+rstto_navigator_add_file (window-priv-props.navigator, 
child_file, NULL);
+
+g_object_unref (child_file);
+g_object_unref (file_info);
+}
+
+uri = g_file_get_uri (file);
+gtk_recent_manager_add_item (window-priv-recent_manager, uri);
+g_free (uri);
+uri = NULL;
+
 g_value_set_string (current_uri_val, 
gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (dialog)));
 g_object_set_property (G_OBJECT(window-priv-settings_manager), 
current-uri, current_uri_val);
 }
@@ -958,17 +987,40 @@ cb_rstto_main_window_open_recent(GtkRecentChooser 
*chooser, RsttoMainWindow *win
 {
 GtkWidget *dialog, *err_dialog;
 gchar *uri = gtk_recent_chooser_get_current_uri (chooser);
+const gchar *filename;
 GFile *file = g_file_new_for_uri (uri);
+GFile *child_file;
+GFileEnumerator *file_enumarator = NULL;
+GFileInfo *child_file_info = NULL;
+GFileInfo *file_info = g_file_query_info (file, standard::type, 0, NULL, 
NULL);
 
-if (rstto_navigator_add_file (window-priv-props.navigator, file, NULL) 
== FALSE)
+if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
 {
-err_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
-GTK_DIALOG_MODAL,
-GTK_MESSAGE_ERROR,
-GTK_BUTTONS_OK,
-_(Could not open file));
-gtk_dialog_run(GTK_DIALOG(dialog));
-gtk_widget_destroy(dialog);
+file_enumarator = g_file_enumerate_children (file, standard::name, 
0, NULL, NULL);
+while (child_file_info = g_file_enumerator_next_file (file_enumarator, 
NULL, NULL))
+{
+filename = g_file_info_get_name (child_file_info);
+child_file = g_file_get_child (file, filename);
+
+rstto_navigator_add_file (window-priv-props.navigator, 
child_file, NULL);
+
+g_object_unref (child_file);
+g_object_unref (child_file_info);
+}
+
+}
+else
+{
+if (rstto_navigator_add_file (window-priv-props.navigator, file, 
NULL) == FALSE)
+{
+err_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+GTK_DIALOG_MODAL,
+GTK_MESSAGE_ERROR,

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'recent_menu'

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to ce3185bf18ad773e073ab83e87354f7c4da9507c (commit)
   from 3f8ba01f6df517764a03802d145dfcf18bf14fbc (commit)

commit ce3185bf18ad773e073ab83e87354f7c4da9507c
Merge: 3f8ba01 1d06647
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:59:21 2009 +0100

Merge branch 'recent_menu'

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |  165 ++--
 src/main_window_ui.xml |6 +-
 2 files changed, 148 insertions(+), 23 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -147,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -185,7 +188,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,29 +284,42 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 
slideshow, GTK_STOCK_MEDIA_PAUSE);
+window-priv-recent_action = gtk_recent_action_new_for_manager (recent, 
_Recently used, Recently used, 0, 
GTK_RECENT_MANAGER(window-priv-recent_manager));
+
+

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'master' into new_picture_viewer

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 9a99870c75f66aa963e22434ff4f1c5fc2a521f4 (commit)
   from c2e9b6b2e7c036f6e144318f9856ed44c28e69ae (commit)

commit 9a99870c75f66aa963e22434ff4f1c5fc2a521f4
Merge: c2e9b6b ce3185b
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 11:06:54 2009 +0100

Merge branch 'master' into new_picture_viewer

commit ce3185bf18ad773e073ab83e87354f7c4da9507c
Merge: 3f8ba01 1d06647
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:59:21 2009 +0100

Merge branch 'recent_menu'

commit 1d06647dac89feb4e0eb82ac437b7710b7753b8c
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:56:52 2009 +0100

Implemented 'open folder'.

commit 73a8d7229f688d4b796117843b97b0101c1f5fdc
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 10:09:19 2009 +0100

Add some more comments
Add a recent-filter to the recent-chooser (only filter the files opened by 
ristretto)
Actually open files from the recent-chooser

commit f4223148a6df935fa94da97a94ec04e89c0f29db
Author: Stephan Arts stephan@thor.(none)
Date:   Sat Feb 21 09:18:33 2009 +0100

Removed autogenerated header from git
Added the recently used menu to the file-menu

 src/main_window.c  |  165 ++--
 src/main_window_ui.xml |6 +-
 2 files changed, 148 insertions(+), 23 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b119b80..b7acbdb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -72,12 +72,13 @@ struct _RsttoMainWindowPriv
 GtkWidget *p_viewer_s_window;
 GtkWidget *statusbar;
 
-guint  recent_menu_merge_id;
+guint  recent_merge_id;
 guint  play_merge_id;
 guint  pause_merge_id;
 
 GtkAction *play_action;
 GtkAction *pause_action;
+GtkAction *recent_action;
 
 gboolean playing;
 gint play_timeout_id;
@@ -147,6 +148,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow 
*window);
+static void
 cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow 
*window);
 static void
 cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
@@ -185,7 +188,6 @@ static GtkActionEntry action_entries[] =
   { file-menu, NULL, N_ (_File), NULL, },
   { open, GTK_STOCK_OPEN, N_ (_Open), controlO, N_ (Open an image), 
G_CALLBACK (cb_rstto_main_window_open_image), },
   { open-folder, NULL, N_ (Open _Folder), NULL, N_ (Open a folder), 
G_CALLBACK (cb_rstto_main_window_open_folder), },
-  { open-recent-menu, NULL, N_ (Open _Recent), NULL, },
   { file-properties, GTK_STOCK_PROPERTIES, N_ (_Properties), NULL, NULL, 
G_CALLBACK (cb_rstto_main_window_file_properties), },
   { close, GTK_STOCK_CLOSE, N_ (_Close), controlW, N_ (Close this 
image), G_CALLBACK (cb_rstto_main_window_close), },
   { close-all, NULL, N_ (_Close All), NULL, N_ (Close all images), 
G_CALLBACK (cb_rstto_main_window_close_all), },
@@ -266,10 +268,11 @@ rstto_main_window_get_type ()
 static void
 rstto_main_window_init (RsttoMainWindow *window)
 {
-GtkAccelGroup *accel_group;
-GValue show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget *separator, *back, *forward;
-GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkAccelGroup   *accel_group;
+GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
+GtkWidget   *separator, *back, *forward;
+GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
+GtkRecentFilter *recent_filter;
 
 gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
 
@@ -281,29 +284,42 @@ rstto_main_window_init (RsttoMainWindow *window)
 window-priv-recent_manager = gtk_recent_manager_get_default();
 window-priv-settings_manager = rstto_settings_new();
 
+accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
+gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
 /* Create mergeid's for adding ui-components */
-window-priv-recent_menu_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
+window-priv-recent_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-play_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 window-priv-pause_merge_id = gtk_ui_manager_new_merge_id 
(window-priv-ui_manager);
 
-accel_group = gtk_ui_manager_get_accel_group (window-priv-ui_manager);
-gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
-
-window-priv-action_group = gtk_action_group_new (RsttoWindow);
 
 window-priv-play_action = gtk_action_new (play, _Play, Play 
slideshow, GTK_STOCK_MEDIA_PLAY);
 window-priv-pause_action = gtk_action_new (pause, _Pause, Pause 

[Xfce4-commits] ristretto:ristretto-0.0 Add image_quality as a property that can be configured (default to 2MP)

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 8ad85cec725c16125ca2ca1ee38d3262a44b6421 (commit)
   from cc07db14e094aead5cd174d641f44ef5ac2a911e (commit)

commit 8ad85cec725c16125ca2ca1ee38d3262a44b6421
Author: Stephan Arts step...@xfce.org
Date:   Mon Apr 27 23:30:18 2009 +0200

Add image_quality as a property that can be configured (default to 2MP)

 src/image.c  |   24 +++-
 src/image.h  |2 +-
 src/main_window.c|   19 +--
 src/picture_viewer.c |9 -
 src/settings.c   |   21 +
 5 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/src/image.c b/src/image.c
index d84d421..0b831e0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -114,7 +114,7 @@ struct _RsttoImagePriv
 GdkPixbuf *pixbuf;
 gint   width;
 gint   height;
-gboolean full_size;
+guint  max_size;
 
 GdkPixbufAnimation  *animation;
 GdkPixbufAnimationIter *iter;
@@ -378,14 +378,14 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
  * Return value: TRUE on success.
  */
 gboolean
-rstto_image_load (RsttoImage *image, gboolean empty_cache, gboolean full_size, 
GError **error)
+rstto_image_load (RsttoImage *image, gboolean empty_cache, guint max_size, 
GError **error)
 {
 g_return_val_if_fail (image != NULL, FALSE);
 
 RsttoImageCache *cache = rstto_image_cache_new ();
 
 /* NEW */
-image-priv-full_size = full_size;
+image-priv-max_size = max_size;
 
 /* Check if a GIOChannel is present, if so... the load is already in 
progress */
 /* The image needs to be loaded if:
@@ -474,8 +474,8 @@ rstto_image_get_file (RsttoImage *image)
 gint
 rstto_image_get_width (RsttoImage *image)
 {
-g_return_val_if_fail (image != NULL, NULL);
-g_return_val_if_fail (image-priv != NULL, NULL);
+g_return_val_if_fail (image != NULL, 0);
+g_return_val_if_fail (image-priv != NULL, 0);
 
 return image-priv-width;
 }
@@ -489,8 +489,8 @@ rstto_image_get_width (RsttoImage *image)
 gint
 rstto_image_get_height (RsttoImage *image)
 {
-g_return_val_if_fail (image != NULL, NULL);
-g_return_val_if_fail (image-priv != NULL, NULL);
+g_return_val_if_fail (image != NULL, 0);
+g_return_val_if_fail (image-priv != NULL, 0);
 
 return image-priv-height;
 }
@@ -634,14 +634,12 @@ cb_rstto_image_size_prepared (GdkPixbufLoader *loader, 
gint width, gint height,
 image-priv-width = width;
 image-priv-height = height;
 
-if (image-priv-full_size == FALSE)
+if (image-priv-max_size  0)
 {
g_debug (FULLSIZE == FALSE);
-if (width  1024)
-   width = 1024;
-if (height  1024)
-   height = 1024;
-   gdk_pixbuf_loader_set_size (loader, width, height);
+gdouble ratio = (gdouble)(image-priv-max_size*1000)/(gdouble)(width 
* height);
+
+   gdk_pixbuf_loader_set_size (loader, width*ratio, height*ratio);
 }
 else
g_debug (FULLSIZE == TRUE);
diff --git a/src/image.h b/src/image.h
index c4d8c6d..af30567 100644
--- a/src/image.h
+++ b/src/image.h
@@ -79,7 +79,7 @@ gint rstto_image_get_height (RsttoImage *image);
 
 GFile *rstto_image_get_file (RsttoImage *image);
 void rstto_image_unload (RsttoImage *image);
-gboolean rstto_image_load (RsttoImage *image, gboolean empty_cache, gboolean 
full_size, GError **error);
+gboolean rstto_image_load (RsttoImage *image, gboolean empty_cache, guint 
max_size, GError **error);
 
 gboolean
 rstto_image_push_transformation (RsttoImage *image, GObject *transformation, 
GError **error);
diff --git a/src/main_window.c b/src/main_window.c
index 2f3ce05..1c159cb 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -732,6 +732,12 @@ cb_rstto_main_window_rotate_cw (GtkWidget *widget, 
RsttoMainWindow *window)
 RsttoImageTransformation *transform;
 RsttoImage *image = NULL;
 
+RsttoSettings *settings_manager = rstto_settings_new();
+GValue max_size = {0,};
+
+g_value_init (max_size, G_TYPE_UINT);
+g_object_get_property (G_OBJECT(settings_manager), image-quality, 
max_size);
+
 if (window-priv-iter)
 image = rstto_navigator_iter_get_image (window-priv-iter);
 
@@ -739,8 +745,10 @@ cb_rstto_main_window_rotate_cw (GtkWidget *widget, 
RsttoMainWindow *window)
 {
 transform = rstto_image_transform_orientation_new ( FALSE, FALSE, 
GDK_PIXBUF_ROTATE_CLOCKWISE);
 rstto_image_push_transformation (image, G_OBJECT (transform), NULL);
-rstto_image_load (image, TRUE, FALSE, NULL);
+rstto_image_load (image, TRUE, g_value_get_uint (max_size), NULL);
 }
+
+g_value_unset (max_size);
 }
 
 /**
@@ -756,6 +764,12 @@ cb_rstto_main_window_rotate_ccw (GtkWidget *widget, 
RsttoMainWindow *window)
 RsttoImageTransformation *transform;
 RsttoImage *image = NULL;
 
+RsttoSettings *settings_manager = rstto_settings_new();
+GValue max_size = {0,};
+
+

[Xfce4-commits] ristretto:ristretto-0.0 Add 'enable-cache' option Add maximum-render-quality of 1MP (can be configured with later commits) Destroy open_folder dialog after use Update TODO

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to cc07db14e094aead5cd174d641f44ef5ac2a911e (commit)
   from 42db1caddceb8fbb5516b1e7e6790a9e92da2107 (commit)

commit cc07db14e094aead5cd174d641f44ef5ac2a911e
Author: Stephan Arts step...@xfce.org
Date:   Mon Apr 27 21:30:09 2009 +0200

Add 'enable-cache' option
Add maximum-render-quality of 1MP (can be configured with later commits)
Destroy open_folder dialog after use
Update TODO

 TODO |1 +
 configure.in.in  |6 ++--
 src/image.c  |   69 -
 src/image.h  |5 ++-
 src/main_window.c|6 ++-
 src/picture_viewer.c |   85 +++---
 src/preferences_dialog.c |   56 +-
 src/settings.c   |   18 ++
 8 files changed, 202 insertions(+), 44 deletions(-)

diff --git a/TODO b/TODO
index 54cd5cd..63fd4c5 100644
--- a/TODO
+++ b/TODO
@@ -2,6 +2,7 @@
 
 - Implement preferences dialog
 - Add a file-properties dialog
+- Generate and save thumbnails
 
 - Support setting wallpapers
 - xfdesktop
diff --git a/configure.in.in b/configure.in.in
index 306f662..64493a2 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -58,10 +58,10 @@ XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.16.0])
 XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.16.0])
 XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.16.0])
 XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.34])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.6.0])
+XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.6.0])
 
-XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.5.93])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 
 dnl **
 dnl *** Check for xsltproc ***
diff --git a/src/image.c b/src/image.c
index 82d23fe..d84d421 100644
--- a/src/image.c
+++ b/src/image.c
@@ -54,6 +54,8 @@ rstto_image_dispose (GObject *object);
 static void
 cb_rstto_image_area_prepared (GdkPixbufLoader *loader, RsttoImage *image);
 static void
+cb_rstto_image_size_prepared (GdkPixbufLoader *loader, gint width, gint 
height, RsttoImage *image);
+static void
 cb_rstto_image_closed (GdkPixbufLoader *loader, RsttoImage *image);
 static gboolean
 cb_rstto_image_update(RsttoImage *image);
@@ -110,6 +112,9 @@ struct _RsttoImagePriv
 ExifData *exif_data;
 GdkPixbuf *thumbnail;
 GdkPixbuf *pixbuf;
+gint   width;
+gint   height;
+gboolean full_size;
 
 GdkPixbufAnimation  *animation;
 GdkPixbufAnimationIter *iter;
@@ -373,12 +378,15 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
  * Return value: TRUE on success.
  */
 gboolean
-rstto_image_load (RsttoImage *image, gboolean empty_cache, GError **error)
+rstto_image_load (RsttoImage *image, gboolean empty_cache, gboolean full_size, 
GError **error)
 {
 g_return_val_if_fail (image != NULL, FALSE);
 
 RsttoImageCache *cache = rstto_image_cache_new ();
 
+/* NEW */
+image-priv-full_size = full_size;
+
 /* Check if a GIOChannel is present, if so... the load is already in 
progress */
 /* The image needs to be loaded if:
  *   a) The image is already loaded but there is
@@ -400,6 +408,7 @@ rstto_image_load (RsttoImage *image, gboolean empty_cache, 
GError **error)
 
 /* connect the signal-handlers */
 g_signal_connect(image-priv-loader, area-prepared, 
G_CALLBACK(cb_rstto_image_area_prepared), image);
+g_signal_connect(image-priv-loader, size-prepared, 
G_CALLBACK(cb_rstto_image_size_prepared), image);
 /*g_signal_connect(image-priv-loader, area-updated, 
G_CALLBACK(cb_rstto_image_area_updated), image);*/
 g_signal_connect(image-priv-loader, closed, 
G_CALLBACK(cb_rstto_image_closed), image);
 
@@ -456,6 +465,36 @@ rstto_image_get_file (RsttoImage *image)
 return image-priv-file;
 }
 
+/**
+ * rstto_image_get_width:
+ * @image:
+ *
+ * Return value: width of the image
+ */
+gint
+rstto_image_get_width (RsttoImage *image)
+{
+g_return_val_if_fail (image != NULL, NULL);
+g_return_val_if_fail (image-priv != NULL, NULL);
+
+return image-priv-width;
+}
+
+/**
+ * rstto_image_get_height:
+ * @image:
+ *
+ * Return value: height of the image
+ */
+gint
+rstto_image_get_height (RsttoImage *image)
+{
+g_return_val_if_fail (image != NULL, NULL);
+g_return_val_if_fail (image-priv != NULL, NULL);
+
+return image-priv-height;
+}
+
 
 /**
  * rstto_image_get_thumbnail:
@@ -582,6 +621,33 @@ rstto_image_pop_transformation (RsttoImage *image, GError 
**error)
  */
 
 /**
+ * cb_rstto_image_size_prepared:
+ * @loader:
+ * @width;
+ * @height;
+ * @image:
+ *
+ */
+static void
+cb_rstto_image_size_prepared (GdkPixbufLoader *loader, gint width, gint 
height, RsttoImage *image)
+{
+image-priv-width 

[Xfce4-commits] ristretto:ristretto-0.0 Fix the adjustment settings

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f28d501a4b94c752e2ad1e6ab4c8d06086a57907 (commit)
   from 58bee9be96336fe2448bae3f8f9906eaa2055169 (commit)

commit f28d501a4b94c752e2ad1e6ab4c8d06086a57907
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 16:38:56 2009 +0100

Fix the adjustment settings

 src/picture_viewer.c |   80 +
 1 files changed, 54 insertions(+), 26 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index b4828e4..5b203ba 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -680,6 +680,8 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 gboolean *fit_to_screen = NULL;
 gdouble *scale = NULL; 
 gint width = 0, height = 0;
+gboolean vadjustment_changed = FALSE;
+gboolean hadjustment_changed = FALSE;
 
 /**
  * Get all the required image peripherals
@@ -775,37 +777,60 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 
 if(*fit_to_screen)
 {
-gdouble h_scale = (gdouble)GTK_WIDGET(viewer)-allocation.width / 
(gdouble)width;
-gdouble v_scale = (gdouble)GTK_WIDGET(viewer)-allocation.height / 
(gdouble)height;
-if(h_scale  v_scale)
+/* The image does not fit the picture-viewer, and 
+ * we decided to scale it down to fit. Now we need to check
+ * which side we need to use as a reference.
+ *
+ * We use the one that produces a larger scale difference
+ * to the viewer. This way we know the image will always fit.
+ */
+if ((GTK_WIDGET (viewer)-allocation.width / width) 
+(GTK_WIDGET (viewer)-allocation.height / height))
 {
-if(*scale != h_scale)
-{
-*scale = h_scale;
-}
+*scale = (gdouble)GTK_WIDGET (viewer)-allocation.width / 
(gdouble)width;
 }
 else
 {
-if(*scale != v_scale)
-{
-*scale = v_scale;
-}
+*scale = (gdouble)GTK_WIDGET (viewer)-allocation.height / 
(gdouble)height;
 }
+
 g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 }
 }
 
 if (GTK_WIDGET_REALIZED (widget))
 {
-if (viewer-vadjustment  viewer-hadjustment)
+if (viewer-hadjustment  viewer-hadjustment)
 {
 viewer-hadjustment-page_size = widget-allocation.width;
 viewer-hadjustment-upper = width * (*scale);
-viewer-hadjustment-value = 0;
+viewer-hadjustment-lower = 0;
+
+if((viewer-hadjustment-value + viewer-hadjustment-page_size)  
viewer-hadjustment-upper)
+{
+viewer-hadjustment-value = viewer-hadjustment-upper - 
viewer-hadjustment-page_size;
+hadjustment_changed = TRUE;
+}
+if(viewer-hadjustment-value  viewer-hadjustment-lower)
+{
+viewer-hadjustment-value = viewer-hadjustment-lower;
+hadjustment_changed = TRUE;
+}
 
 viewer-vadjustment-page_size = widget-allocation.height;
 viewer-vadjustment-upper = height * (*scale);
-viewer-vadjustment-value = 0;
+viewer-vadjustment-lower = 0;
+
+if((viewer-vadjustment-value + viewer-vadjustment-page_size)  
viewer-vadjustment-upper)
+{
+viewer-vadjustment-value = viewer-vadjustment-upper - 
viewer-vadjustment-page_size;
+vadjustment_changed = TRUE;
+}
+if(viewer-vadjustment-value  viewer-vadjustment-lower)
+{
+viewer-vadjustment-value = viewer-vadjustment-lower;
+vadjustment_changed = TRUE;
+}
 
 }
 
@@ -821,22 +846,17 @@ rstto_picture_viewer_refresh(RsttoPictureViewer *viewer)
 {
 if (src_pixbuf)
 {
-viewer-priv-dst_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf,
-
(gint)((gdouble)width * (*scale)),
-
(gint)((gdouble)height * (*scale)),
-
GDK_INTERP_BILINEAR);
-/*
 tmp_pixbuf = gdk_pixbuf_new_subpixbuf(src_pixbuf,

(gint)(viewer-hadjustment-value / (*scale)), 
   
viewer-vadjustment-value / (*scale),
-
((widget-allocation.width/(*scale)))  width?
-  
widget-allocation.width/(*scale):width,
- 

[Xfce4-commits] ristretto:ristretto-0.0 Do not scale the image UP, only DOWN Fix warning if thumbnail does not exist

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 415eea3428c67d8bc2ae097c451a3d2ea001d307 (commit)
   from 97ee4a1faf585e0386bcf05cc64c092fb3ebb5d3 (commit)

commit 415eea3428c67d8bc2ae097c451a3d2ea001d307
Author: Stephan Arts step...@xfce.org
Date:   Tue Apr 28 00:26:34 2009 +0200

Do not scale the image UP, only DOWN
Fix warning if thumbnail does not exist

 src/image.c  |4 ++--
 src/picture_viewer.c |7 +--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/image.c b/src/image.c
index f3ff26d..098aa6a 100644
--- a/src/image.c
+++ b/src/image.c
@@ -637,8 +637,8 @@ cb_rstto_image_size_prepared (GdkPixbufLoader *loader, gint 
width, gint height,
 if (image-priv-max_size  0)
 {
 gdouble ratio = 
(gdouble)(image-priv-max_size*100)/(gdouble)(width * height);
-
-   gdk_pixbuf_loader_set_size (loader, width*ratio, height*ratio);
+if (ratio  0)
+   gdk_pixbuf_loader_set_size (loader, width*ratio, height*ratio);
 }
 }
 
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 912122a..c92582a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -975,8 +975,11 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 {
 case RSTTO_PICTURE_VIEWER_STATE_PREVIEW:
 p_src_pixbuf = rstto_image_get_thumbnail 
(viewer-priv-image);
-thumb_width = (gdouble)gdk_pixbuf_get_width 
(p_src_pixbuf);
-thumb_scale = (thumb_width / image_width);
+if (p_src_pixbuf)
+{
+thumb_width = (gdouble)gdk_pixbuf_get_width 
(p_src_pixbuf);
+thumb_scale = (thumb_width / image_width);
+}
 break;
 default:
 break;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add string.h header to prevent a compiler warning

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 79b6826f644c87e459531d01f1f50458a3925678 (commit)
   from f28d501a4b94c752e2ad1e6ab4c8d06086a57907 (commit)

commit 79b6826f644c87e459531d01f1f50458a3925678
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 17:31:54 2009 +0100

Add string.h header to prevent a compiler warning

 src/image.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/image.c b/src/image.c
index 3ca403d..a717cca 100644
--- a/src/image.c
+++ b/src/image.c
@@ -24,6 +24,8 @@
 
 #include libexif/exif-data.h
 
+#include string.h
+
 #include image.h
 #include image_cache.h
 #include image_transformation.h
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Implement preferences option for the image-quality

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 97ee4a1faf585e0386bcf05cc64c092fb3ebb5d3 (commit)
   from 8ad85cec725c16125ca2ca1ee38d3262a44b6421 (commit)

commit 97ee4a1faf585e0386bcf05cc64c092fb3ebb5d3
Author: Stephan Arts step...@xfce.org
Date:   Tue Apr 28 00:01:29 2009 +0200

Implement preferences option for the image-quality

 src/image.c  |5 +--
 src/picture_viewer.c |2 -
 src/preferences_dialog.c |   90 ++
 src/settings.c   |6 ++--
 4 files changed, 87 insertions(+), 16 deletions(-)

diff --git a/src/image.c b/src/image.c
index 0b831e0..f3ff26d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -636,13 +636,10 @@ cb_rstto_image_size_prepared (GdkPixbufLoader *loader, 
gint width, gint height,
 
 if (image-priv-max_size  0)
 {
-   g_debug (FULLSIZE == FALSE);
-gdouble ratio = (gdouble)(image-priv-max_size*1000)/(gdouble)(width 
* height);
+gdouble ratio = 
(gdouble)(image-priv-max_size*100)/(gdouble)(width * height);
 
gdk_pixbuf_loader_set_size (loader, width*ratio, height*ratio);
 }
-else
-   g_debug (FULLSIZE == TRUE);
 }
 
 /**
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 4a3fa34..912122a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1017,8 +1017,6 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 gdouble x = viewer-hadjustment-value * image_scale;
 gdouble y = viewer-vadjustment-value * image_scale;
 
-g_debug (O %f:%d:%f, y, widget-allocation.height, image_height);
-
 p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
(gint)(x/scale * thumb_scale * 
image_scale), 
(gint)(y/scale * thumb_scale * 
image_scale),
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index a8f9e74..a9cda1b 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -48,6 +48,8 @@ static void
 cb_rstto_preferences_dialog_cache_preload_check_button_toggled 
(GtkToggleButton *, gpointer);
 static void
 cb_rstto_preferences_dialog_cache_spin_button_value_changed (GtkSpinButton *, 
gpointer);
+static void
+cb_rstto_preferences_dialog_image_quality_combo_box_changed (GtkComboBox *, 
gpointer);
 
 static GtkWidgetClass *parent_class = NULL;
 
@@ -68,10 +70,15 @@ struct _RsttoPreferencesDialogPriv
 GtkWidget *cache_size_label;
 GtkWidget *cache_size_unit;
 GtkWidget *cache_check_button;
-   GtkWidget *cache_alignment;
+GtkWidget *cache_alignment;
 GtkWidget *cache_spin_button;
 GtkWidget *cache_preload_check_button;
 
+GtkWidget *image_quality_frame;
+GtkWidget *image_quality_vbox;
+GtkWidget *image_quality_hbox;
+GtkWidget *image_quality_label;
+GtkWidget *image_quality_combo;
 } display_tab;
 };
 
@@ -108,7 +115,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 
 RsttoSettings *settings_manager = rstto_settings_new ();
 GValue value = {0, };
-GtkWidget *cache_adjustment;
+GtkObject *cache_adjustment;
 
 GtkWidget *notebook = gtk_notebook_new ();
 GtkWidget *scroll_frame, *scroll_vbox;
@@ -127,13 +134,13 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)
 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), display_main_vbox, 
display_main_lbl);
 
 /** Bg-color frame */
-dialog-priv-display_tab.bgcolor_vbox = gtk_vbox_new(FALSE, 0);
+dialog-priv-display_tab.bgcolor_vbox = gtk_vbox_new (FALSE, 0);
 dialog-priv-display_tab.bgcolor_frame = 
xfce_create_framebox_with_content (_(Background color),

  dialog-priv-display_tab.bgcolor_vbox);
 gtk_box_pack_start (GTK_BOX (display_main_vbox), 
dialog-priv-display_tab.bgcolor_frame, FALSE, FALSE, 0);
 
 dialog-priv-display_tab.bgcolor_override_check_button = 
gtk_check_button_new_with_label (_(Override background color:));
-dialog-priv-display_tab.bgcolor_hbox = gtk_hbox_new(FALSE, 4);
+dialog-priv-display_tab.bgcolor_hbox = gtk_hbox_new (FALSE, 4);
 dialog-priv-display_tab.bgcolor_color_button = gtk_color_button_new();
 
 gtk_box_pack_start (GTK_BOX (dialog-priv-display_tab.bgcolor_hbox), 
@@ -170,7 +177,7 @@ rstto_preferences_dialog_init(RsttoPreferencesDialog 
*dialog)

  dialog-priv-display_tab.cache_vbox);
 gtk_box_pack_start (GTK_BOX (display_main_vbox), 
dialog-priv-display_tab.cache_frame, FALSE, FALSE, 0);
 
-cache_adjustment = gtk_adjustment_new(RSTTO_DEFAULT_CACHE_SIZE, 
RSTTO_MIN_CACHE_SIZE, 4096, 1, 0, 0);
+cache_adjustment = gtk_adjustment_new (RSTTO_DEFAULT_CACHE_SIZE, 
RSTTO_MIN_CACHE_SIZE, 4096, 1, 0, 0);
 
 

[Xfce4-commits] ristretto:ristretto-0.0 Set ratio-trigger to 1, '0' will never do anything

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 980a4b09195f393b76bfa1985726f7eab2364651 (commit)
   from 415eea3428c67d8bc2ae097c451a3d2ea001d307 (commit)

commit 980a4b09195f393b76bfa1985726f7eab2364651
Author: Stephan Arts step...@xfce.org
Date:   Tue Apr 28 07:41:48 2009 +0200

Set ratio-trigger to 1, '0' will never do anything

 src/image.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/image.c b/src/image.c
index 098aa6a..4d53f04 100644
--- a/src/image.c
+++ b/src/image.c
@@ -637,7 +637,7 @@ cb_rstto_image_size_prepared (GdkPixbufLoader *loader, gint 
width, gint height,
 if (image-priv-max_size  0)
 {
 gdouble ratio = 
(gdouble)(image-priv-max_size*100)/(gdouble)(width * height);
-if (ratio  0)
+if (ratio  1)
gdk_pixbuf_loader_set_size (loader, width*ratio, height*ratio);
 }
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 That was a bug... reverting last change, I need to implement some better way of doing this.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534 (commit)
   from fa5894a0df7f1bc7052c17fd2085e81b906497ba (commit)

commit 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534
Author: Stephan Arts step...@xfce.org
Date:   Sun Feb 22 09:36:36 2009 +0100

That was a bug... reverting last change, I need to implement some better
way of doing this.

 src/picture_viewer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6710a6a..364e445 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1003,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-//rstto_picture_viewer_refresh(viewer);
+rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Improved performance when drawing the zoom-box, don't do a refresh when performing a queued_repaint, just paint the darn thing.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to fa5894a0df7f1bc7052c17fd2085e81b906497ba (commit)
   from 67ce593c1d98dc141cfa28df268c5d5ff4338e02 (commit)

commit fa5894a0df7f1bc7052c17fd2085e81b906497ba
Author: Stephan Arts step...@xfce.org
Date:   Sat Feb 21 18:00:43 2009 +0100

Improved performance when drawing the zoom-box, don't do a refresh when 
performing a queued_repaint, just paint the darn thing.

 src/picture_viewer.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 150a51f..6710a6a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -987,6 +987,10 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 }
 break;
 case RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM:
+if (viewer-priv-refresh.idle_id)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
 viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 break;
 default:
@@ -999,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-rstto_picture_viewer_refresh(viewer);
+//rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Let the pictureviewer figure out the fullscreen mode by itself

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 81c13825b177d82b6f72cb06b8e28cbae9fa8163 (commit)
   from 79b7af6a3c4556054e689bff631b0b53379bb350 (commit)

commit 81c13825b177d82b6f72cb06b8e28cbae9fa8163
Author: Stephan Arts step...@xfce.org
Date:   Thu Apr 30 08:29:53 2009 +0200

Let the pictureviewer figure out the fullscreen mode by itself

 ChangeLog|7 +++
 src/main_window.c|2 --
 src/picture_viewer.c |   11 +--
 src/picture_viewer.h |2 --
 4 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09f6825..8f2b249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-30  Stephan Arts step...@xfce.org
+
+   * src/main_window.c
+ src/pictureviewer.c
+ src/pictureviewer.h: Let the pictureviewer figure out the fullscreen-
+ state of it's parent-window by itself
+
 2009-04-28  Stephan Arts step...@xfce.org
 
* src/image.c
diff --git a/src/main_window.c b/src/main_window.c
index 05e6f25..bc688da 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1427,11 +1427,9 @@ cb_rstto_main_window_state_event(GtkWidget *widget, 
GdkEventWindowState *event,
 gtk_widget_hide (window-priv-menubar);
 gtk_widget_hide (window-priv-toolbar);
 gtk_widget_hide (window-priv-statusbar);
-rstto_picture_viewer_set_fs (window-priv-picture_viewer, TRUE);
 }
 else
{
-rstto_picture_viewer_set_fs (window-priv-picture_viewer, FALSE);
 g_value_init (show_toolbar_val, G_TYPE_BOOLEAN);
 g_object_get_property (G_OBJECT(window-priv-settings_manager), 
show-toolbar, show_toolbar_val);
 
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 0f933ab..e64e4cf 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -65,7 +65,6 @@ struct _RsttoPictureViewerPriv
 GtkMenu *menu;
 RsttoPictureViewerState  state;
 RsttoZoomModezoom_mode;
-gboolean fullscreen;
 
 
 GdkPixbuf*dst_pixbuf; /* The pixbuf which ends up on screen */
@@ -418,7 +417,7 @@ rstto_picture_viewer_paint (GtkWidget *widget)
 GdkPixmap *buffer = gdk_pixmap_new(NULL, widget-allocation.width, 
widget-allocation.height, gdk_drawable_get_depth(widget-window));
 GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(buffer));
 
-if (viewer-priv-fullscreen)
+
if(gdk_window_get_state(gdk_window_get_toplevel(GTK_WIDGET(viewer)-window))  
GDK_WINDOW_STATE_FULLSCREEN)
 {
gdk_gc_set_rgb_fg_color (gc, g_value_get_boxed (bg_color_fs));
 }
@@ -1325,14 +1324,6 @@ cb_rstto_picture_viewer_image_prepared (RsttoImage 
*image, RsttoPictureViewer *v
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
-void
-rstto_picture_viewer_set_fs (RsttoPictureViewer *viewer, gboolean fullscreen)
-{
-viewer-priv-fullscreen = fullscreen;
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
-}
-
 /**
  * rstto_picture_viewer_zoom_fit:
  * @window:
diff --git a/src/picture_viewer.h b/src/picture_viewer.h
index f129024..c241da8 100644
--- a/src/picture_viewer.h
+++ b/src/picture_viewer.h
@@ -71,8 +71,6 @@ GtkWidget *rstto_picture_viewer_new ();
 void   rstto_picture_viewer_set_image (RsttoPictureViewer *, RsttoImage *);
 gdoublerstto_picture_viewer_get_scale(RsttoPictureViewer *viewer);
 
-void   rstto_picture_viewer_set_fs (RsttoPictureViewer *viewer, gboolean 
fullscreen);
-
 void   rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer);
 void   rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer);
 void   rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gdouble 
factor);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Set important hint on leave-fullscreen toolbar item

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 1e586ea0c33bed9d55245b85a508bc277da099ee (commit)
   from c75595516827f2c6fc5552e81335088a3af7da48 (commit)

commit 1e586ea0c33bed9d55245b85a508bc277da099ee
Author: Stephan Arts step...@xfce.org
Date:   Thu Apr 30 09:35:17 2009 +0200

Set important hint on leave-fullscreen toolbar item

 ChangeLog  |3 +++
 src/main_window.c  |   11 +--
 src/main_window_ui.xml |2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1f87082..f235304 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
* src/main_window.c
  src/main_window_ui.xml: Add 'fullscreen-toolbar' with controls when in
  fullscreen-mode.
+   * src/main_window.c
+ src/main_window_ui.xml: Set is_important hint on 'leave-fullscreen'
+ toolitem.
 
 2009-04-28  Stephan Arts step...@xfce.org
 
diff --git a/src/main_window.c b/src/main_window.c
index a719125..1c8a409 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -239,7 +239,9 @@ static GtkActionEntry action_entries[] =
 N_ (_About),
 NULL,
 N_ (Display information about ristretto),
-G_CALLBACK (cb_rstto_main_window_about), }
+G_CALLBACK (cb_rstto_main_window_about), },
+/* Misc */
+  { leave-fullscreen, GTK_STOCK_LEAVE_FULLSCREEN, N_ (Leave _Fullscreen), 
NULL, NULL, G_CALLBACK (cb_rstto_main_window_fullscreen), }
 };
 
 static const GtkToggleActionEntry toggle_action_entries[] =
@@ -280,7 +282,7 @@ rstto_main_window_init (RsttoMainWindow *window)
 {
 GtkAccelGroup   *accel_group;
 GValue  show_toolbar_val = {0,}, window_width = {0, }, 
window_height = {0, };
-GtkWidget   *separator, *back, *forward;
+GtkWidget   *separator, *back, *forward, *leave_fullscreen;
 GtkWidget   *main_vbox = gtk_vbox_new (FALSE, 0);
 GtkRecentFilter *recent_filter;
 
@@ -364,6 +366,11 @@ rstto_main_window_init (RsttoMainWindow *window)
 forward = gtk_ui_manager_get_widget (window-priv-ui_manager, 
/main-toolbar/forward);
 gtk_tool_item_set_is_important (GTK_TOOL_ITEM (forward), TRUE);
 
+/* Make the leave-fullscreen toolitem important,
+ * when it is, the label is shown when the toolbar style is 
'both-horizontal'
+ */
+leave_fullscreen = gtk_ui_manager_get_widget (window-priv-ui_manager, 
/fullscreen-toolbar/leave-fullscreen);
+gtk_tool_item_set_is_important (GTK_TOOL_ITEM (leave_fullscreen), TRUE);
 
 window-priv-picture_viewer = rstto_picture_viewer_new ();
 window-priv-p_viewer_s_window = gtk_scrolled_window_new (NULL, NULL);
diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
index af1d990..2b0aa4a 100644
--- a/src/main_window_ui.xml
+++ b/src/main_window_ui.xml
@@ -76,6 +76,6 @@
 placeholder name=placeholder-slideshow /
 toolitem action=forward/
 separator name=separator-1/
-toolitem action=fullscreen/
+toolitem action=leave-fullscreen/
 /toolbar
 /ui
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Add sticky button to fullscreen-toolbar

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 41f49ce624d31417b35e1f8b171148fda8ca5269 (commit)
   from 1e586ea0c33bed9d55245b85a508bc277da099ee (commit)

commit 41f49ce624d31417b35e1f8b171148fda8ca5269
Author: Stephan Arts step...@xfce.org
Date:   Thu Apr 30 09:52:59 2009 +0200

Add sticky button to fullscreen-toolbar

 ChangeLog  |   27 +--
 src/main_window.c  |   24 +++-
 src/main_window_ui.xml |2 ++
 3 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f235304..e690db2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,15 +1,30 @@
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/main_window.c
- src/picture_viewer.c
- src/picture_viewer.h: Let the pictureviewer figure out the fullscreen-
- state of it's parent-window by itself
+ src/main_window_ui.xml: Add Sticky button to the fullscreen-toolbar.
+
+
+2009-04-30  Stephan Arts step...@xfce.org
+
+   * src/main_window.c
+ src/main_window_ui.xml: Set is_important hint on 'leave-fullscreen' 
+ toolitem.
+
+
+2009-04-30  Stephan Arts step...@xfce.org
+
* src/main_window.c
  src/main_window_ui.xml: Add 'fullscreen-toolbar' with controls when in
- fullscreen-mode.
+ fullscreen-mode.  
+
+
+2009-04-30  Stephan Arts step...@xfce.org
+
* src/main_window.c
- src/main_window_ui.xml: Set is_important hint on 'leave-fullscreen'
- toolitem.
+ src/picture_viewer.c
+ src/picture_viewer.h: Let the pictureviewer figure out the fullscreen-
+ state of it's parent-window by itself
+
 
 2009-04-28  Stephan Arts step...@xfce.org
 
diff --git a/src/main_window.c b/src/main_window.c
index 1c8a409..adb5711 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -59,6 +59,8 @@ struct _RsttoMainWindowPriv
 
 guint show_fs_toolbar_timeout_id;
 gint window_save_geometry_timer_id;
+
+gboolean fs_toolbar_sticky;
 
 RsttoNavigatorIter *iter;
 
@@ -183,6 +185,9 @@ cb_rstto_main_window_contents (GtkWidget *widget, 
RsttoMainWindow *window);
 static void
 cb_rstto_main_window_quit (GtkWidget *widget, RsttoMainWindow *window);
 
+static void
+cb_rstto_main_window_fullscreen_toolbar_sticky (GtkWidget *widget, 
RsttoMainWindow *window);
+
 static gboolean 
 cb_rstto_main_window_picture_viewer_motion_notify_event (RsttoPictureViewer 
*viewer,
  GdkEventMotion *event,
@@ -248,6 +253,7 @@ static const GtkToggleActionEntry toggle_action_entries[] =
 {
 { show-toolbar, NULL, N_ (Show _Toolbar), NULL, NULL, G_CALLBACK 
(cb_rstto_main_window_toggle_show_toolbar), TRUE, },
 { show-thumbnailbar, NULL, N_ (Show Thumb_nailbar), NULL, NULL, NULL, 
FALSE},
+{ sticky, GTK_STOCK_ADD, N_(Sticky), NULL, NULL, G_CALLBACK 
(cb_rstto_main_window_fullscreen_toolbar_sticky), FALSE }
 };
 
 
@@ -1520,7 +1526,7 @@ cb_rstto_main_window_picture_viewer_motion_notify_event 
(RsttoPictureViewer *vie
 RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data);
 if(gdk_window_get_state(GTK_WIDGET(window)-window)  
GDK_WINDOW_STATE_FULLSCREEN)
 {
-if (event-state == 0)
+if (event-state == 0  (window-priv-fs_toolbar_sticky == FALSE))
 {
 /* TODO: implement timer to hide it again */
 gtk_widget_show (window-priv-fs_toolbar);
@@ -1540,3 +1546,19 @@ cb_rstto_main_window_show_fs_toolbar_timeout 
(RsttoMainWindow *window)
 gtk_widget_hide (window-priv-fs_toolbar);
 return FALSE;
 }
+
+static void
+cb_rstto_main_window_fullscreen_toolbar_sticky (GtkWidget *widget, 
RsttoMainWindow *window)
+{
+if (window-priv-show_fs_toolbar_timeout_id  0)
+{
+g_source_remove (window-priv-show_fs_toolbar_timeout_id);
+window-priv-show_fs_toolbar_timeout_id = 0;
+}
+window-priv-fs_toolbar_sticky = gtk_toggle_action_get_active 
(GTK_TOGGLE_ACTION (widget));
+
+if (window-priv-fs_toolbar_sticky == FALSE)
+{
+window-priv-show_fs_toolbar_timeout_id = g_timeout_add (1500, 
(GSourceFunc)cb_rstto_main_window_show_fs_toolbar_timeout, window);
+}
+}
diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
index 2b0aa4a..c3ab245 100644
--- a/src/main_window_ui.xml
+++ b/src/main_window_ui.xml
@@ -72,6 +72,8 @@
 
 --
 toolbar name=fullscreen-toolbar
+toolitem action=sticky/
+separator/
 toolitem action=back/
 placeholder name=placeholder-slideshow /
 toolitem action=forward/
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 commit changes

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 691a6a7c89eb2902984ac6ccfe02e219168b82f4 (commit)
   from ad1c2baadb12b28c47cbeb97b622af39d614ba5a (commit)

commit 691a6a7c89eb2902984ac6ccfe02e219168b82f4
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:28:33 2009 +0100

commit changes

 src/picture_viewer.c |  664 --
 1 files changed, 314 insertions(+), 350 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index a26c9ca..6e8b261 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -30,10 +30,11 @@
 
 typedef enum
 {
-RSTTO_PICTURE_VIEWER_STATE_NONE,
+RSTTO_PICTURE_VIEWER_STATE_NORMAL = 0,
 RSTTO_PICTURE_VIEWER_STATE_MOVE,
 RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM
+RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM,
+RSTTO_PICTURE_VIEWER_STATE_TRANSITION
 } RsttoPictureViewerState;
 
 enum
@@ -56,7 +57,7 @@ struct _RsttoPictureViewerPriv
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
-gdouble  scale;
+RsttoPictureViewerState state;
 
 struct
 {
@@ -67,18 +68,13 @@ struct _RsttoPictureViewerPriv
 gint h_val;
 gint v_val;
 } motion;
-RsttoPictureViewerState state;
 struct
 {
 gint idle_id;
-gint mask;
 } refresh;
 GtkMenu  *menu;
 };
 
-#define RSTTO_REFRESH_LOCATION 0x1
-#define RSTTO_REFRESH_SCALE0x2
-
 static void
 rstto_picture_viewer_init(RsttoPictureViewer *);
 static void
@@ -86,6 +82,11 @@ rstto_picture_viewer_class_init(RsttoPictureViewerClass *);
 static void
 rstto_picture_viewer_destroy(GtkObject *object);
 
+static void
+rstto_picture_viewer_set_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerState state);
+static RsttoPictureViewerState
+rstto_picture_viewer_get_state (RsttoPictureViewer *viewer);
+
 static gdouble
 rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
 
@@ -93,7 +94,6 @@ static void
 cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
 static void
 cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
-
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer);
 
@@ -108,14 +108,17 @@ rstto_picture_viewer_expose(GtkWidget *, GdkEventExpose 
*);
 
 static void
 rstto_picture_viewer_paint (GtkWidget *widget);
-static gboolean
-rstto_picture_viewer_refresh(RsttoPictureViewer *viewer);
+static void
+cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static void
+cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
 
 static gboolean
 rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *, 
GtkAdjustment *, GtkAdjustment *);
 
 static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *, RsttoPictureViewer *);
+
 static void
 cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *, GdkEventScroll *);
 static gboolean 
@@ -303,8 +306,12 @@ rstto_picture_viewer_size_allocate(GtkWidget *widget, 
GtkAllocation *allocation)
 allocation-height - border_width * 2);
 }
 
-rstto_picture_viewer_refresh(viewer);
-rstto_picture_viewer_paint (GTK_WIDGET(viewer));
+if (viewer-priv-refresh.idle_id  0)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
+viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
+
 }
 
 static void
@@ -341,8 +348,13 @@ rstto_picture_viewer_realize(GtkWidget *widget)
 static gboolean
 rstto_picture_viewer_expose(GtkWidget *widget, GdkEventExpose *event)
 {
-rstto_picture_viewer_refresh (RSTTO_PICTURE_VIEWER(widget));
-rstto_picture_viewer_paint (widget);
+RsttoPictureViewer *viewer = RSTTO_PICTURE_VIEWER (widget);
+
+if (viewer-priv-refresh.idle_id  0)
+{
+g_source_remove(viewer-priv-refresh.idle_id);
+}
+viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 return FALSE;
 }
 
@@ -562,11 +574,12 @@ 
rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *viewer, GtkAdjus
 static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *adjustment, 
RsttoPictureViewer *viewer)
 {
+rstto_picture_viewer_set_state (viewer, RSTTO_PICTURE_VIEWER_STATE_MOVE);
+
 if (viewer-priv-refresh.idle_id  0)
 {
 g_source_remove(viewer-priv-refresh.idle_id);
 }
-viewer-priv-refresh.mask = RSTTO_REFRESH_LOCATION;
 viewer-priv-refresh.idle_id = 
g_idle_add((GSourceFunc)cb_rstto_picture_viewer_queued_repaint, viewer);
 }
 
@@ -656,10 +669,6 @@ rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer)
 fit_to_screen = g_new0(gboolean, 1);
 g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
 
-

[Xfce4-commits] ristretto:ristretto-0.0 add new entry in news

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 5932e7f473d373ae87c8532a29c9ee7fc5017a9f (commit)
   from 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534 (commit)

commit 5932e7f473d373ae87c8532a29c9ee7fc5017a9f
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:29:13 2009 +0100

add new entry in news

 NEWS |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 167cf46..f02678f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+x.x.x
+=
+
 0.0.21
 ==
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Implement hack to check if the image has been rotated

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 20f7ffbc978263b6dff3a6ac5040909a38f9b402 (commit)
   from 41f49ce624d31417b35e1f8b171148fda8ca5269 (commit)

commit 20f7ffbc978263b6dff3a6ac5040909a38f9b402
Author: Stephan Arts step...@xfce.org
Date:   Thu Apr 30 23:30:32 2009 +0200

Implement hack to check if the image has been rotated

 ChangeLog|6 
 src/picture_viewer.c |   65 +-
 2 files changed, 49 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e690db2..b8c1401 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-04-30  Stephan Arts step...@xfce.org
 
+   * src/picture_viewer.c: Implement a hack to check if the pixbuf has
+   been rotated.
+
+
+2009-04-30  Stephan Arts step...@xfce.org
+
* src/main_window.c
  src/main_window_ui.xml: Add Sticky button to the fullscreen-toolbar.
 
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 85c5eb8..59b6f30 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -972,31 +972,52 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 image_width = (gdouble)rstto_image_get_width (viewer-priv-image);
 image_height = (gdouble)rstto_image_get_height (viewer-priv-image);
 
-p_src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-if (p_src_pixbuf)
+switch (viewer-priv-state)
 {
-pixbuf_width = (gdouble)gdk_pixbuf_get_width (p_src_pixbuf);
-pixbuf_height = (gdouble)gdk_pixbuf_get_height (p_src_pixbuf);
-
-image_scale = pixbuf_width / image_width;
-}
-if (viewer-priv-state != RSTTO_PICTURE_VIEWER_STATE_NORMAL)
-{
-switch (viewer-priv-state)
-{
-case RSTTO_PICTURE_VIEWER_STATE_PREVIEW:
-p_src_pixbuf = rstto_image_get_thumbnail 
(viewer-priv-image);
-if (p_src_pixbuf)
+case RSTTO_PICTURE_VIEWER_STATE_NORMAL:
+p_src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
+if (p_src_pixbuf)
+{
+pixbuf_width = (gdouble)gdk_pixbuf_get_width 
(p_src_pixbuf);
+pixbuf_height = (gdouble)gdk_pixbuf_get_height 
(p_src_pixbuf);
+
+/** HACK HACK HACK
+  * Because the image-dimensions do not get modified when 
the image is rotated,
+  * we have to check here... and fix it ourselves
+  */
+if pixbuf_width / pixbuf_height)  1)  ((image_width 
/ image_height  1))) ||
+(((pixbuf_width / pixbuf_height)  1)  ((image_width 
/ image_height  1
 {
-thumb_width = (gdouble)gdk_pixbuf_get_width 
(p_src_pixbuf);
-thumb_scale = (thumb_width / image_width);
+gdouble tmp_width = image_width;
+image_width = image_height;
+image_height = tmp_width;
 }
-else
-return;
-break;
-default:
-break;
-}
+image_scale = pixbuf_width / image_width;
+}
+break;
+case RSTTO_PICTURE_VIEWER_STATE_PREVIEW:
+p_src_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
+if (p_src_pixbuf)
+{
+thumb_width = (gdouble)gdk_pixbuf_get_width (p_src_pixbuf);
+/** HACK HACK HACK
+  * Because the image-dimensions do not get modified when 
the image is rotated,
+  * we have to check here... and fix it ourselves
+  */
+if pixbuf_width / pixbuf_height)  1)  ((image_width 
/ image_height  1))) ||
+(((pixbuf_width / pixbuf_height)  1)  ((image_width 
/ image_height  1
+{
+gdouble tmp_width = image_width;
+image_width = image_height;
+image_height = tmp_width;
+}
+thumb_scale = (thumb_width / image_width);
+}
+else
+return;
+break;
+default:
+break;
 }
 
 p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Make sure sticky does not break the visibility of the fs-toolbar

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 90a0d52283c57eafc4c49e2065883a4828580e65 (commit)
   from 20f7ffbc978263b6dff3a6ac5040909a38f9b402 (commit)

commit 90a0d52283c57eafc4c49e2065883a4828580e65
Author: Stephan Arts step...@xfce.org
Date:   Fri May 1 10:37:26 2009 +0200

Make sure sticky does not break the visibility of the fs-toolbar

 ChangeLog |   10 +-
 src/main_window.c |   21 ++---
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b8c1401..da3a23e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,29 +1,30 @@
+2009-05-01  Stephan Arts step...@xfce.org
+
+   * src/main_window.c: Make sure the fullscreen-toolbar gets shown in
+   fullscreen mode when ristretto left fullscreen with sticky set.
+
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/picture_viewer.c: Implement a hack to check if the pixbuf has
been rotated.
 
-
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/main_window.c
  src/main_window_ui.xml: Add Sticky button to the fullscreen-toolbar.
 
-
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/main_window.c
  src/main_window_ui.xml: Set is_important hint on 'leave-fullscreen' 
  toolitem.
 
-
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/main_window.c
  src/main_window_ui.xml: Add 'fullscreen-toolbar' with controls when in
  fullscreen-mode.  
 
-
 2009-04-30  Stephan Arts step...@xfce.org
 
* src/main_window.c
@@ -31,7 +32,6 @@
  src/picture_viewer.h: Let the pictureviewer figure out the fullscreen-
  state of it's parent-window by itself
 
-
 2009-04-28  Stephan Arts step...@xfce.org
 
* src/image.c
diff --git a/src/main_window.c b/src/main_window.c
index adb5711..c308fd0 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -984,6 +984,7 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, 
RsttoMainWindow *window)
 GFileEnumerator *file_enumarator = NULL;
 GFileInfo *file_info = NULL;
 const gchar *filename = NULL;
+const gchar *content_type = NULL;
 gchar *uri = NULL;
 GValue current_uri_val = {0, };
 
@@ -1003,12 +1004,15 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_widget_hide(dialog);
 file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
 
-file_enumarator = g_file_enumerate_children (file, standard::name, 
0, NULL, NULL);
+file_enumarator = g_file_enumerate_children (file, standard::*, 0, 
NULL, NULL);
 while (file_info = g_file_enumerator_next_file (file_enumarator, NULL, 
NULL))
 {
 filename = g_file_info_get_name (file_info);
+content_type  = g_file_info_get_content_type (file_info);
 child_file = g_file_get_child (file, filename);
 
+g_debug (%s, content_type);
+
 rstto_navigator_add_file (window-priv-props.navigator, 
child_file, NULL);
 
 g_object_unref (child_file);
@@ -1526,16 +1530,19 @@ cb_rstto_main_window_picture_viewer_motion_notify_event 
(RsttoPictureViewer *vie
 RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data);
 if(gdk_window_get_state(GTK_WIDGET(window)-window)  
GDK_WINDOW_STATE_FULLSCREEN)
 {
-if (event-state == 0  (window-priv-fs_toolbar_sticky == FALSE))
+if (event-state == 0)
 {
-/* TODO: implement timer to hide it again */
 gtk_widget_show (window-priv-fs_toolbar);
-if (window-priv-show_fs_toolbar_timeout_id  0)
+
+if (window-priv-fs_toolbar_sticky == FALSE)
 {
-g_source_remove (window-priv-show_fs_toolbar_timeout_id);
-window-priv-show_fs_toolbar_timeout_id = 0;
+if (window-priv-show_fs_toolbar_timeout_id  0)
+{
+g_source_remove (window-priv-show_fs_toolbar_timeout_id);
+window-priv-show_fs_toolbar_timeout_id = 0;
+}
+window-priv-show_fs_toolbar_timeout_id = g_timeout_add 
(3000, (GSourceFunc)cb_rstto_main_window_show_fs_toolbar_timeout, window);
 }
-window-priv-show_fs_toolbar_timeout_id = g_timeout_add (3000, 
(GSourceFunc)cb_rstto_main_window_show_fs_toolbar_timeout, window);
 }
 }
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Split 'view' state from 'motion' state

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7da92c8d582e14d50adfee29144751e7b89b93cb (commit)
   from 691a6a7c89eb2902984ac6ccfe02e219168b82f4 (commit)

commit 7da92c8d582e14d50adfee29144751e7b89b93cb
Author: Stephan Arts step...@xfce.org
Date:   Sun Mar 8 14:22:37 2009 +0100

Split 'view' state from 'motion' state

 src/main_window.c|4 +-
 src/picture_viewer.c |  406 +++---
 src/picture_viewer.h |9 -
 3 files changed, 191 insertions(+), 228 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index b7acbdb..2254c7b 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
 }
 
 /**
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6e8b261..e29e378 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -31,12 +31,23 @@
 typedef enum
 {
 RSTTO_PICTURE_VIEWER_STATE_NORMAL = 0,
-RSTTO_PICTURE_VIEWER_STATE_MOVE,
-RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM,
-RSTTO_PICTURE_VIEWER_STATE_TRANSITION
+RSTTO_PICTURE_VIEWER_STATE_PREVIEW
 } RsttoPictureViewerState;
 
+typedef enum
+{
+RSTTO_PICTURE_VIEWER_MOTION_STATE_NORMAL = 0,
+RSTTO_PICTURE_VIEWER_MOTION_STATE_BOX_ZOOM,
+RSTTO_PICTURE_VIEWER_MOTION_STATE_MOVE
+} RsttoPictureViewerMotionState;
+
+typedef enum
+{
+RSTTO_ZOOM_MODE_CUSTOM,
+RSTTO_ZOOM_MODE_100,
+RSTTO_ZOOM_MODE_FIT
+} RsttoZoomMode;
+
 enum
 {
 TARGET_TEXT_URI_LIST,
@@ -49,16 +60,16 @@ static const GtkTargetEntry drop_targets[] = {
 
 struct _RsttoPictureViewerPriv
 {
-RsttoImage *image;
+RsttoImage  *image;
+GtkMenu *menu;
+RsttoPictureViewerState  state;
+RsttoZoomModezoom_mode;
 
-RsttoZoomModezoom_mode;
 
 GdkPixbuf*dst_pixbuf; /* The pixbuf which ends up on screen */
 void (*cb_value_changed)(GtkAdjustment *, RsttoPictureViewer 
*);
 GdkColor *bg_color;
 
-RsttoPictureViewerState state;
-
 struct
 {
 gdouble x;
@@ -67,12 +78,14 @@ struct _RsttoPictureViewerPriv
 gdouble current_y;
 gint h_val;
 gint v_val;
+RsttoPictureViewerMotionState state;
 } motion;
+
 struct
 {
 gint idle_id;
-} refresh;
-GtkMenu  *menu;
+gboolean refresh;
+} repaint;
 };
 
 static void
@@ -86,16 +99,8 @@ static void
 rstto_picture_viewer_set_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerState state);
 static RsttoPictureViewerState
 rstto_picture_viewer_get_state (RsttoPictureViewer *viewer);
-
-static gdouble
-rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
-
 static void
-cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static void
-cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static gboolean 
-cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer);
+rstto_picture_viewer_set_motion_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerMotionState state);
 
 static void
 rstto_picture_viewer_size_request(GtkWidget *, GtkRequisition *);
@@ -105,13 +110,10 @@ static void
 rstto_picture_viewer_realize(GtkWidget *);
 static gboolean 
 rstto_picture_viewer_expose(GtkWidget *, GdkEventExpose *);
-
 static void
 rstto_picture_viewer_paint (GtkWidget *widget);
-static void
-cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
-static void
-cb_rstto_picture_viewer_image_prepared (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static gboolean 
+rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer, gboolean 
refresh);
 
 static gboolean
 rstto_picture_viewer_set_scroll_adjustments(RsttoPictureViewer *, 
GtkAdjustment *, GtkAdjustment *);
@@ -120,33 +122,24 @@ static void
 cb_rstto_picture_viewer_value_changed(GtkAdjustment *, RsttoPictureViewer *);
 
 static void
-cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer *, GdkEventScroll *);
+cb_rstto_picture_viewer_image_updated (RsttoImage *image, RsttoPictureViewer 
*viewer);
+static void

[Xfce4-commits] ristretto:ristretto-0.0 Made all the scale related functions internal

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 1da739e89571c1775602a511ad86b5c0ed97a8e1 (commit)
   from 7da92c8d582e14d50adfee29144751e7b89b93cb (commit)

commit 1da739e89571c1775602a511ad86b5c0ed97a8e1
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:03:41 2009 +0100

Made all the scale related functions internal

 src/main_window.c|   10 +--
 src/picture_viewer.c |  233 ++
 src/picture_viewer.h |6 +-
 3 files changed, 148 insertions(+), 101 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 2254c7b..2f8fe74 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-//rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+rstto_picture_viewer_zoom_100 (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -699,8 +699,7 @@ cb_rstto_main_window_zoom_100 (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_in (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale * ZOOM_FACTOR);
+rstto_picture_viewer_zoom_in (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**
@@ -713,8 +712,7 @@ cb_rstto_main_window_zoom_in (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_out (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale / ZOOM_FACTOR);
+rstto_picture_viewer_zoom_out (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**/
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index e29e378..17cfb61 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -103,6 +103,9 @@ static void
 rstto_picture_viewer_set_motion_state (RsttoPictureViewer *viewer, 
RsttoPictureViewerMotionState state);
 
 static void
+rstto_picture_viewer_set_zoom_mode (RsttoPictureViewer *viewer, RsttoZoomMode 
mode);
+
+static void
 rstto_picture_viewer_size_request(GtkWidget *, GtkRequisition *);
 static void
 rstto_picture_viewer_size_allocate(GtkWidget *, GtkAllocation *);
@@ -618,81 +621,60 @@ rstto_picture_viewer_new()
 void
 rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, gdouble scale)
 {
-gdouble *old_scale, *new_scale;
+gdouble *img_scale, *new_scale;
 GdkPixbuf *src_pixbuf = NULL;
-gboolean *fit_to_screen = NULL;
 
 if (viewer-priv-image)
 {
 src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
-old_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
-fit_to_screen = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen);
-//rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+img_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
 
-new_scale = g_new0 (gdouble, 1);
-*new_scale = scale;
-*fit_to_screen = FALSE;
-g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
new_scale);
-g_object_set_data (G_OBJECT (viewer-priv-image), 
viewer-fit-to-screen, fit_to_screen);
-
-gdouble width = (gdouble)gdk_pixbuf_get_width (src_pixbuf);
-gdouble height = (gdouble)gdk_pixbuf_get_height (src_pixbuf);
+if (src_pixbuf)
+{
+gdouble width = (gdouble)gdk_pixbuf_get_width (src_pixbuf);
+gdouble height = (gdouble)gdk_pixbuf_get_height (src_pixbuf);
 
 
-viewer-hadjustment-upper = width * (*new_scale);
-gtk_adjustment_changed(viewer-hadjustment);
+viewer-hadjustment-upper = width * scale;
+gtk_adjustment_changed(viewer-hadjustment);
 
-viewer-vadjustment-upper = height * (*new_scale);
-gtk_adjustment_changed(viewer-vadjustment);
+viewer-vadjustment-upper = height * scale;
+gtk_adjustment_changed(viewer-vadjustment);
 
-viewer-hadjustment-value = (((viewer-hadjustment-value +
-  (viewer-hadjustment-page_size / 2)) *
-  

[Xfce4-commits] ristretto:ristretto-0.0 Implement image-cache size calculation

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 4b1c367e21a57eaf0f1785838268f379f22bde89 (commit)
   from e81a905eac295ffb23214cac5f239e8c0370379d (commit)

commit 4b1c367e21a57eaf0f1785838268f379f22bde89
Author: Stephan Arts step...@xfce.org
Date:   Sat May 2 00:32:50 2009 +0200

Implement image-cache size calculation

 ChangeLog |6 ++
 src/image.c   |   14 ++
 src/image.h   |1 +
 src/image_cache.c |   31 +++
 4 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3742c2a..dcfc193 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-05-02  Stephan Arts step...@xfce.org
 
+   * src/image,c
+ src/image.h
+ src/image_cache.c: Implement image-cache size calculation
+
+2009-05-02  Stephan Arts step...@xfce.org
+
* src/main_window.c: Add jpeg filter to the open-files dialog
 
 2009-05-01  Stephan Arts step...@xfce.org
diff --git a/src/image.c b/src/image.c
index 1442f64..9c53043 100644
--- a/src/image.c
+++ b/src/image.c
@@ -791,3 +791,17 @@ cb_rstto_image_update(RsttoImage *image)
 }
 return TRUE;
 }
+
+guint64
+rstto_image_get_size (RsttoImage *image)
+{
+GdkPixbuf *pixbuf = rstto_image_get_pixbuf (image);
+if (pixbuf)
+{
+gint n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+gint rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+gint height = gdk_pixbuf_get_height (pixbuf);
+return rowstride * height *n_channels;
+}
+return 0;
+}
diff --git a/src/image.h b/src/image.h
index f8f4544..a7866ea 100644
--- a/src/image.h
+++ b/src/image.h
@@ -88,6 +88,7 @@ rstto_image_pop_transformation (RsttoImage *image, GError 
**error);
 
 /* Should only be used by image-transformation implementations */
 void rstto_image_set_pixbuf (RsttoImage *image, GdkPixbuf *pixbuf);
+guint64 rstto_image_get_size (RsttoImage *image);
 
 G_END_DECLS
 
diff --git a/src/image_cache.c b/src/image_cache.c
index 0c2aed6..55f2de3 100644
--- a/src/image_cache.c
+++ b/src/image_cache.c
@@ -90,10 +90,18 @@ void
 rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, 
gboolean last)
 {
 RsttoSettings *settings = rstto_settings_new();
-GValue val = {0, };
+GValue val = {0, }, val_cache_size = {0, };
+guint64 size = 0;
+guint64 cache_size = 0;
+RsttoImage *c_image;
+GList *iter = NULL;
 
 g_value_init (val, G_TYPE_BOOLEAN);
+g_value_init (val_cache_size, G_TYPE_UINT);
 g_object_get_property (G_OBJECT (settings), enable-cache, val);
+g_object_get_property (G_OBJECT (settings), cache-size, val_cache_size);
+
+cache_size = g_value_get_uint(val_cache_size)*100;
 
 if (cache-cache_list)
 {
@@ -115,24 +123,23 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 {
 if (g_list_length (cache-cache_list)  1)
 {
-RsttoImage *c_image = g_list_last (cache-cache_list)-data;
+c_image = g_list_last (cache-cache_list)-data;
 rstto_image_unload (c_image);
 cache-cache_list = g_list_remove (cache-cache_list, c_image);
-g_object_unref (image);
 }
 }
 else
 {
-/**
- * TODO:
- * Fix the cache-size calculation
- */
-if (g_list_length (cache-cache_list)  3)
+for (iter = cache-cache_list-next; iter != NULL; iter = g_list_next 
(iter))
 {
-RsttoImage *c_image = g_list_last (cache-cache_list)-data;
-rstto_image_unload (c_image);
-cache-cache_list = g_list_remove (cache-cache_list, c_image);
-g_object_unref (image);
+c_image = iter-data;
+size += rstto_image_get_size (c_image);
+if (size  cache_size)
+{
+rstto_image_unload (c_image);
+cache-cache_list = g_list_remove (cache-cache_list, c_image);
+iter = g_list_previous(iter);
+} 
 }
 }
 g_value_unset (val);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Fix segfault

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b (commit)
   from 1da739e89571c1775602a511ad86b5c0ed97a8e1 (commit)

commit edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:23:48 2009 +0100

Fix segfault

 src/picture_viewer.c |   33 +++--
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 17cfb61..0575439 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -360,6 +360,7 @@ rstto_picture_viewer_size_allocate(GtkWidget *widget, 
GtkAllocation *allocation)
  * TODO: Check if we really nead a refresh
  */
 rstto_picture_viewer_queued_repaint (viewer, FALSE);
+//rstto_picture_viewer_paint (viewer);
 }
 
 /**
@@ -376,6 +377,7 @@ rstto_picture_viewer_expose(GtkWidget *widget, 
GdkEventExpose *event)
 /** 
  * TODO: Check if we really nead a refresh
  */
+//rstto_picture_viewer_paint (viewer);
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 return FALSE;
 }
@@ -673,6 +675,8 @@ rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, 
gdouble scale)
  * since the old and new values are required in the above code
  */
 *img_scale = scale;
+
+rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 }
 }
@@ -909,6 +913,8 @@ rstto_picture_viewer_calculate_adjustments 
(RsttoPictureViewer *viewer, gdouble
 static gboolean 
 rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer, gboolean 
refresh)
 {
+g_return_if_fail (RSTTO_IS_PICTURE_VIEWER (viewer));
+
 if (viewer-priv-repaint.idle_id  0)
 {
 g_source_remove(viewer-priv-repaint.idle_id);
@@ -926,13 +932,10 @@ cb_rstto_picture_viewer_queued_repaint 
(RsttoPictureViewer *viewer)
 GdkPixbuf *p_src_pixbuf = NULL;
 GdkPixbuf *p_tmp_pixbuf = NULL;
 gdouble *p_scale = NULL;
+gdouble scale;
 gdouble width, height;
 GtkWidget *widget = GTK_WIDGET (viewer);
 
-gdouble  scale = rstto_picture_viewer_calculate_scale (viewer);
-
-rstto_picture_viewer_calculate_adjustments (viewer, scale);
-
 if (viewer-priv-image != NULL)
 {   
 p_src_pixbuf = rstto_image_get_pixbuf (viewer-priv-image);
@@ -941,7 +944,18 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 width = (gdouble)gdk_pixbuf_get_width (p_src_pixbuf);
 height = (gdouble)gdk_pixbuf_get_height (p_src_pixbuf);
 }
+
+p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
+scale = *p_scale;
+}
+
+if (scale = 0)
+{
+scale = rstto_picture_viewer_calculate_scale (viewer);
+*p_scale = scale;
 }
+rstto_picture_viewer_calculate_adjustments (viewer);
+
 
 switch (viewer-priv-state)
 {
@@ -950,7 +964,7 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 {
 if (p_src_pixbuf)
 {
-if (scale == 1.0 )
+if (*p_scale == 1.0 )
 {
 p_tmp_pixbuf = p_src_pixbuf;
 g_object_ref (p_tmp_pixbuf);
@@ -990,7 +1004,6 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 if (viewer-priv-image)
 {
 p_tmp_pixbuf = rstto_image_get_thumbnail (viewer-priv-image);
-p_scale = g_object_get_data (G_OBJECT (viewer-priv-image), 
viewer-scale);
 if (G_LIKELY (p_scale == NULL))
 {
 p_scale = g_new0 (gdouble, 1);
@@ -1353,8 +1366,6 @@ void
 rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
 {
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1367,8 +1378,6 @@ void
 rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
 {
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1386,8 +1395,6 @@ rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, 
gboolean factor)
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
 scale = rstto_picture_viewer_get_scale (viewer);
 rstto_picture_viewer_set_scale (viewer, scale * factor);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
 /**
@@ -1405,6 +1412,4 @@ rstto_picture_viewer_zoom_out (RsttoPictureViewer 
*viewer, gboolean factor)
 rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
 scale = rstto_picture_viewer_get_scale (viewer);
 rstto_picture_viewer_set_scale (viewer, scale / factor);
-
-rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org

[Xfce4-commits] ristretto:ristretto-0.0 Add jpeg filter to open files dialog

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to e81a905eac295ffb23214cac5f239e8c0370379d (commit)
   from 90a0d52283c57eafc4c49e2065883a4828580e65 (commit)

commit e81a905eac295ffb23214cac5f239e8c0370379d
Author: Stephan Arts step...@xfce.org
Date:   Sat May 2 00:31:31 2009 +0200

Add jpeg filter to open files dialog

 ChangeLog |4 
 src/main_window.c |5 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index da3a23e..3742c2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-02  Stephan Arts step...@xfce.org
+
+   * src/main_window.c: Add jpeg filter to the open-files dialog
+
 2009-05-01  Stephan Arts step...@xfce.org
 
* src/main_window.c: Make sure the fullscreen-toolbar gets shown in
diff --git a/src/main_window.c b/src/main_window.c
index c308fd0..6ae02d3 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -926,6 +926,11 @@ cb_rstto_main_window_open_image (GtkWidget *widget, 
RsttoMainWindow *window)
 gtk_file_filter_set_name (filter, _(Images));
 gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
 
+filter = gtk_file_filter_new();
+gtk_file_filter_add_mime_type (filter, image/jpeg);
+gtk_file_filter_set_name (filter, _(.jp(e)g));
+gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+
 
 response = gtk_dialog_run(GTK_DIALOG(dialog));
 gtk_widget_hide (dialog);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Move DnD code to the bottom of the file

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 2b5990b32b22c130f54395eb0f61f9c7ad107e27 (commit)
   from edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b (commit)

commit 2b5990b32b22c130f54395eb0f61f9c7ad107e27
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:28:49 2009 +0100

Move DnD code to the bottom of the file

 src/picture_viewer.c |  121 ++
 1 files changed, 63 insertions(+), 58 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 0575439..ad607cb 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1215,7 +1215,7 @@ rstto_picture_viewer_set_image (RsttoPictureViewer 
*viewer, RsttoImage *image)
 if (scale == NULL)
 {
 scale = g_new0 (gdouble, 1);
-*scale = -1.0;
+*scale = 0.0;
 g_object_set_data (G_OBJECT (viewer-priv-image), viewer-scale, 
scale);
 }
 if (fit_to_screen == NULL)
@@ -1255,6 +1255,68 @@ cb_rstto_picture_viewer_image_prepared (RsttoImage 
*image, RsttoPictureViewer *v
 rstto_picture_viewer_queued_repaint (viewer, TRUE);
 }
 
+/**
+ * rstto_picture_viewer_zoom_fit:
+ * @window:
+ *
+ * Adjust the scale to make the image fit the window
+ */
+void
+rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
+{
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
+}
+
+/**
+ * rstto_picture_viewer_zoom_100:
+ * @viewer:
+ *
+ * Set the scale to 1, meaning a zoom-factor of 100%
+ */
+void
+rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
+{
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
+}
+
+/**
+ * rstto_picture_viewer_zoom_in:
+ * @viewer:
+ * @factor:
+ *
+ * Zoom in the scale with a certain factor
+ */
+void
+rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
+{
+gdouble scale;
+
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+scale = rstto_picture_viewer_get_scale (viewer);
+rstto_picture_viewer_set_scale (viewer, scale * factor);
+}
+
+/**
+ * rstto_picture_viewer_zoom_out:
+ * @viewer:
+ * @factor:
+ *
+ * Zoom out the scale with a certain factor
+ */
+void
+rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
+{
+gdouble scale;
+
+rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
+scale = rstto_picture_viewer_get_scale (viewer);
+rstto_picture_viewer_set_scale (viewer, scale / factor);
+}
+
+
+/**/
+
+
 /
  * FIXME: DnD
  */
@@ -1356,60 +1418,3 @@ rstto_picture_viewer_drag_motion (GtkWidget *widget,
 }
 
 
-/**
- * rstto_picture_viewer_zoom_fit:
- * @window:
- *
- * Adjust the scale to make the image fit the window
- */
-void
-rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer)
-{
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_FIT);
-}
-
-/**
- * rstto_picture_viewer_zoom_100:
- * @viewer:
- *
- * Set the scale to 1, meaning a zoom-factor of 100%
- */
-void
-rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
-{
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_100);
-}
-
-/**
- * rstto_picture_viewer_zoom_in:
- * @viewer:
- * @factor:
- *
- * Zoom in the scale with a certain factor
- */
-void
-rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
-{
-gdouble scale;
-
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
-scale = rstto_picture_viewer_get_scale (viewer);
-rstto_picture_viewer_set_scale (viewer, scale * factor);
-}
-
-/**
- * rstto_picture_viewer_zoom_out:
- * @viewer:
- * @factor:
- *
- * Zoom out the scale with a certain factor
- */
-void
-rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
-{
-gdouble scale;
-
-rstto_picture_viewer_set_zoom_mode (viewer, RSTTO_ZOOM_MODE_CUSTOM);
-scale = rstto_picture_viewer_get_scale (viewer);
-rstto_picture_viewer_set_scale (viewer, scale / factor);
-}
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Improve cache behaviour

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to e47e53b62d95d969276956fb50a659b99cb6738a (commit)
   from b53ef99302afe9424dc1f8424e0c896034f3069c (commit)

commit e47e53b62d95d969276956fb50a659b99cb6738a
Author: Stephan Arts step...@xfce.org
Date:   Sat May 2 16:19:18 2009 +0200

Improve cache behaviour

 ChangeLog |9 +
 src/image.c   |2 +-
 src/image.h   |2 +-
 src/image_cache.c |   15 ---
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b913bf5..40e656d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-05-02  Stephan Arts step...@xfce.org
 
+   * src/image_cache.c: Remove images which return size=0 from the cache,
+ it might still be loading, in which case it should stop immediately 
and
+ be dropped from the cache
+   * src/image.c
+ src/image.h
+ src/image_cache.c: calculate cache-size in uint instead of uint64
+
+2009-05-02  Stephan Arts step...@xfce.org
+
* src/main_window.c
  src/main_window_ui.xml: Implement save-as function (Bug #4647)
* src/navigator.c: Fix iter_find_image function
diff --git a/src/image.c b/src/image.c
index 9c53043..5a44844 100644
--- a/src/image.c
+++ b/src/image.c
@@ -792,7 +792,7 @@ cb_rstto_image_update(RsttoImage *image)
 return TRUE;
 }
 
-guint64
+guint
 rstto_image_get_size (RsttoImage *image)
 {
 GdkPixbuf *pixbuf = rstto_image_get_pixbuf (image);
diff --git a/src/image.h b/src/image.h
index a7866ea..05b0846 100644
--- a/src/image.h
+++ b/src/image.h
@@ -88,7 +88,7 @@ rstto_image_pop_transformation (RsttoImage *image, GError 
**error);
 
 /* Should only be used by image-transformation implementations */
 void rstto_image_set_pixbuf (RsttoImage *image, GdkPixbuf *pixbuf);
-guint64 rstto_image_get_size (RsttoImage *image);
+guint rstto_image_get_size (RsttoImage *image);
 
 G_END_DECLS
 
diff --git a/src/image_cache.c b/src/image_cache.c
index 46d7220..c548be6 100644
--- a/src/image_cache.c
+++ b/src/image_cache.c
@@ -92,8 +92,8 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 gboolean retval = FALSE;
 RsttoSettings *settings = rstto_settings_new();
 GValue val = {0, }, val_cache_size = {0, };
-guint64 size = 0;
-guint64 cache_size = 0;
+guint size = 0;
+guint cache_size = 0;
 RsttoImage *c_image;
 GList *iter = NULL;
 
@@ -141,7 +141,6 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 for (iter = cache-cache_list-next; iter != NULL; iter = g_list_next 
(iter))
 {
 c_image = iter-data;
-size += rstto_image_get_size (c_image);
 if (size  cache_size)
 {
 rstto_image_unload (c_image);
@@ -149,6 +148,16 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 iter = g_list_previous(iter);
 retval = TRUE;
 } 
+else
+{
+size += rstto_image_get_size (c_image);
+if (rstto_image_get_size (c_image) == 0)
+{
+rstto_image_unload (c_image);
+cache-cache_list = g_list_remove (cache-cache_list, 
c_image);
+iter = g_list_previous(iter);
+}
+}
 }
 }
 g_value_unset (val);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Added save-as function

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to b53ef99302afe9424dc1f8424e0c896034f3069c (commit)
   from 4b1c367e21a57eaf0f1785838268f379f22bde89 (commit)

commit b53ef99302afe9424dc1f8424e0c896034f3069c
Author: Stephan Arts step...@xfce.org
Date:   Sat May 2 01:27:36 2009 +0200

Added save-as function

* src/main_window.c
  src/main_window_ui.xml: Implement save-as function (Bug #4647)
* src/navigator.c: Fix iter_find_image function
* src/image_cache.h
  src/image_cache.c: Return TRUE when the cache had to drop images to
  fit the new one.
* src/main.c: Fix error when trying to open nonexistent file from the
  CLI

 ChangeLog  |   13 -
 src/image_cache.c  |   14 --
 src/image_cache.h  |2 +-
 src/main.c |   16 +++-
 src/main_window.c  |   39 +++
 src/main_window_ui.xml |2 ++
 src/navigator.c|1 +
 7 files changed, 78 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dcfc193..b913bf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,19 @@
 2009-05-02  Stephan Arts step...@xfce.org
 
+   * src/main_window.c
+ src/main_window_ui.xml: Implement save-as function (Bug #4647)
+   * src/navigator.c: Fix iter_find_image function
+   * src/image_cache.h
+ src/image_cache.c: Return TRUE when the cache had to drop images to
+ fit the new one.
+   * src/main.c: Fix error when trying to open nonexistent file from the
+ CLI
+
+2009-05-02  Stephan Arts step...@xfce.org
+
* src/image,c
  src/image.h
- src/image_cache.c: Implement image-cache size calculation
+ src/image_cache.c: Implement image-cache size calculation (Bug #4064)
 
 2009-05-02  Stephan Arts step...@xfce.org
 
diff --git a/src/image_cache.c b/src/image_cache.c
index 55f2de3..46d7220 100644
--- a/src/image_cache.c
+++ b/src/image_cache.c
@@ -86,9 +86,10 @@ rstto_image_cache_class_init (GObjectClass *object_class)
 
 }
 
-void
+gboolean
 rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, 
gboolean last)
 {
+gboolean retval = FALSE;
 RsttoSettings *settings = rstto_settings_new();
 GValue val = {0, }, val_cache_size = {0, };
 guint64 size = 0;
@@ -119,17 +120,24 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 cache-cache_list = g_list_prepend (cache-cache_list, image);
 }
 
+/**
+ * Check if we are keeping a cache
+ */
 if (g_value_get_boolean (val) == FALSE)
 {
-if (g_list_length (cache-cache_list)  1)
+while (g_list_length (cache-cache_list)  1)
 {
 c_image = g_list_last (cache-cache_list)-data;
 rstto_image_unload (c_image);
 cache-cache_list = g_list_remove (cache-cache_list, c_image);
+retval = TRUE;
 }
 }
 else
 {
+/* Calculate the cache-size, if it exceeds the defined maximum,
+ * unload the the images that exceed that.
+ */
 for (iter = cache-cache_list-next; iter != NULL; iter = g_list_next 
(iter))
 {
 c_image = iter-data;
@@ -139,10 +147,12 @@ rstto_image_cache_push_image (RsttoImageCache *cache, 
RsttoImage *image, gboolea
 rstto_image_unload (c_image);
 cache-cache_list = g_list_remove (cache-cache_list, c_image);
 iter = g_list_previous(iter);
+retval = TRUE;
 } 
 }
 }
 g_value_unset (val);
+return retval;
 }
 
 /**
diff --git a/src/image_cache.h b/src/image_cache.h
index ac1a4fe..16501a3 100644
--- a/src/image_cache.h
+++ b/src/image_cache.h
@@ -47,7 +47,7 @@ typedef struct _RsttoImageCacheClass RsttoImageCacheClass;
 
 RsttoImageCache *rstto_image_cache_new ();
 
-void rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, 
gboolean last);
+gboolean rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage 
*image, gboolean last);
 
 G_END_DECLS
 
diff --git a/src/main.c b/src/main.c
index f914872..ef25bca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -138,12 +138,18 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
 if (rof-iter  rof-argc)
 {
 file = g_file_new_for_commandline_arg (rof-argv[rof-iter]);
-file_info = g_file_query_info (file, standard::content-type, 0, 
NULL, NULL);
-content_type = g_file_info_get_attribute_string (file_info, 
standard::content-type);
-
-if (strncmp (content_type, image/, 6) == 0)
+if (file)
 {
-rstto_navigator_add_file (rof-navigator, file, NULL);
+file_info = g_file_query_info (file, standard::content-type, 0, 
NULL, NULL);
+if (file_info)
+{
+content_type = g_file_info_get_attribute_string (file_info, 
standard::content-type);
+

[Xfce4-commits] ristretto:ristretto-0.0 Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 68f99e86e52a3bbd80337b2e8516133eab1aaa23 (commit)
   from 2b5990b32b22c130f54395eb0f61f9c7ad107e27 (commit)

commit 68f99e86e52a3bbd80337b2e8516133eab1aaa23
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:44:47 2009 +0100

Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

 src/picture_viewer.c |9 +
 src/picture_viewer.h |4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index ad607cb..acc1c5a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -748,7 +748,7 @@ cb_rstto_picture_viewer_scroll_event (RsttoPictureViewer 
*viewer, GdkEventScroll
 {
 case GDK_SCROLL_UP:
 case GDK_SCROLL_LEFT:
-if (scale = 0.05)
+if (scale= 0.05)
 return;
 if (viewer-priv-refresh.idle_id  0)
 {
@@ -954,7 +954,8 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer 
*viewer)
 scale = rstto_picture_viewer_calculate_scale (viewer);
 *p_scale = scale;
 }
-rstto_picture_viewer_calculate_adjustments (viewer);
+
+rstto_picture_viewer_calculate_adjustments (viewer, scale);
 
 
 switch (viewer-priv-state)
@@ -1287,7 +1288,7 @@ rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer)
  * Zoom in the scale with a certain factor
  */
 void
-rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gboolean factor)
+rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, gdouble factor)
 {
 gdouble scale;
 
@@ -1304,7 +1305,7 @@ rstto_picture_viewer_zoom_in (RsttoPictureViewer *viewer, 
gboolean factor)
  * Zoom out the scale with a certain factor
  */
 void
-rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean factor)
+rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gdouble factor)
 {
 gdouble scale;
 
diff --git a/src/picture_viewer.h b/src/picture_viewer.h
index 458118f..c241da8 100644
--- a/src/picture_viewer.h
+++ b/src/picture_viewer.h
@@ -73,8 +73,8 @@ gdoublerstto_picture_viewer_get_scale(RsttoPictureViewer 
*viewer);
 
 void   rstto_picture_viewer_zoom_fit (RsttoPictureViewer *viewer);
 void   rstto_picture_viewer_zoom_100 (RsttoPictureViewer *viewer);
-void   rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gboolean 
factor);
-void   rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gboolean 
factor);
+void   rstto_picture_viewer_zoom_in  (RsttoPictureViewer *viewer, gdouble 
factor);
+void   rstto_picture_viewer_zoom_out (RsttoPictureViewer *viewer, gdouble 
factor);
 
 /**
 gdoublerstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Emit 'updated' signal when 'rstto_image_load' is called and the image is already there.

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 0c1e906c2931655b6f075bb7105895748b50946a (commit)
   from 68f99e86e52a3bbd80337b2e8516133eab1aaa23 (commit)

commit 0c1e906c2931655b6f075bb7105895748b50946a
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:51:09 2009 +0100

Emit 'updated' signal when 'rstto_image_load' is called and the image is 
already there.

 src/image.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/image.c b/src/image.c
index a717cca..82d23fe 100644
--- a/src/image.c
+++ b/src/image.c
@@ -407,7 +407,7 @@ rstto_image_load (RsttoImage *image, gboolean empty_cache, 
GError **error)
 }
 else
 {
-//g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
+g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
 rstto_image_cache_push_image (cache, image);
 return TRUE;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Revert add new entry in news

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c (commit)
   from 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e (commit)

commit 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 22:00:05 2009 +0100

Revert add new entry in news

This reverts commit 5932e7f473d373ae87c8532a29c9ee7fc5017a9f.

 NEWS |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index f02678f..167cf46 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,3 @@
-x.x.x
-=
-
 0.0.21
 ==
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Revert That was a bug... reverting last change, I need to implement some better

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e (commit)
   from 5932e7f473d373ae87c8532a29c9ee7fc5017a9f (commit)

commit 8ecfb6a2e3e91f6857266a9d17d8475a8d97420e
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:59:38 2009 +0100

Revert That was a bug... reverting last change, I need to implement some 
better

This reverts commit 580177dc2ef4a2b3eaeade76bd83a94a1b6b9534.

 src/picture_viewer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 364e445..6710a6a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1003,7 +1003,7 @@ cb_rstto_picture_viewer_motion_notify_event 
(RsttoPictureViewer *viewer,
 static gboolean 
 cb_rstto_picture_viewer_queued_repaint(RsttoPictureViewer *viewer)
 {
-rstto_picture_viewer_refresh(viewer);
+//rstto_picture_viewer_refresh(viewer);
 rstto_picture_viewer_paint(GTK_WIDGET(viewer));
 
 g_source_remove(viewer-priv-refresh.idle_id);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.1 Creating branch ristretto-0.1

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.1
 as new branch
 to ec44ddfdb009bb71bac60e8d4ea23c266e55881b (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/ristretto-0.1

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Fix memory leak in image class (unref animation-iter)

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 99f0917fc1d220dd6a2ef61a5f5f53fe2e839065 (commit)
   from 96ee95c3848f91e9693d4519e1c7d52f35ab4340 (commit)

commit 99f0917fc1d220dd6a2ef61a5f5f53fe2e839065
Author: Stephan Arts stephan@thor.(none)
Date:   Fri May 15 18:00:45 2009 +0200

Fix memory leak in image class (unref animation-iter)

 ChangeLog   |8 
 src/image.c |   47 +++
 2 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 40e656d..10efd6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-15  Stephan Arts step...@xfce.org
+
+   * src/image.c
+ src/image.h
+ src/picture_viewer.c: Implement state-machine, do not expose weird
+ signals
+   * src/image.c: Unref animation_iter, fix memleak
+
 2009-05-02  Stephan Arts step...@xfce.org
 
* src/image_cache.c: Remove images which return size=0 from the cache,
diff --git a/src/image.c b/src/image.c
index bf7c1d1..38333eb 100644
--- a/src/image.c
+++ b/src/image.c
@@ -344,7 +344,6 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 if(gdk_pixbuf_loader_write (image-priv-loader, (const guchar 
*)image-priv-buffer, read_bytes, error) == FALSE)
 {
 g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
-image-priv-loader = NULL;
 g_object_unref (image);
 }
 else
@@ -365,7 +364,6 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 /* OK */
 g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
 gdk_pixbuf_loader_close (image-priv-loader, NULL);
-image-priv-loader = NULL;
 g_object_unref (image);
 }
 else
@@ -373,7 +371,6 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 /* I/O ERROR */
 g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
 gdk_pixbuf_loader_close (image-priv-loader, NULL);
-image-priv-loader = NULL;
 g_object_unref (image);
 }
 }
@@ -462,6 +459,37 @@ rstto_image_unload (RsttoImage *image)
 image-priv-pixbuf = NULL;
 }
 
+if (image-priv-thumbnail)
+{
+g_object_unref (image-priv-thumbnail);
+image-priv-thumbnail = NULL;
+}
+
+if (image-priv-animation_timeout_id)
+{
+g_source_remove (image-priv-animation_timeout_id);
+image-priv-animation_timeout_id = 0;
+}
+
+if (image-priv-animation)
+{
+g_object_unref (image-priv-animation);
+image-priv-animation = NULL;
+}
+
+if (image-priv-iter)
+{
+g_object_unref (image-priv-iter);
+image-priv-iter = NULL;
+}
+
+if (image-priv-transformations)
+{
+g_list_foreach (image-priv-transformations, (GFunc)g_object_unref, 
NULL);
+g_list_free (image-priv-transformations);
+image-priv-transformations = NULL;
+}
+
 rstto_image_set_state (image, RSTTO_IMAGE_STATE_DEFAULT);
 }
 
@@ -711,22 +739,9 @@ cb_rstto_image_area_prepared (GdkPixbufLoader *loader, 
RsttoImage *image)
 }   
 else
 {
-image-priv-iter = NULL;
-}
-
-if (image-priv-iter)
-{
 image-priv-pixbuf = gdk_pixbuf_animation_iter_get_pixbuf 
(image-priv-iter);
 g_object_ref (image-priv-pixbuf);
 }
-else
-{
-if (image-priv-loader)
-{
-image-priv-pixbuf = gdk_pixbuf_loader_get_pixbuf 
(image-priv-loader);
-g_object_ref (image-priv-pixbuf);
-}
-}
 }
 
 /**
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] ristretto:ristretto-0.0 Implement state-machine in image class

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 96ee95c3848f91e9693d4519e1c7d52f35ab4340 (commit)
   from e47e53b62d95d969276956fb50a659b99cb6738a (commit)

commit 96ee95c3848f91e9693d4519e1c7d52f35ab4340
Author: Stephan Arts stephan@thor.(none)
Date:   Fri May 15 01:03:53 2009 +0200

Implement state-machine in image class

 src/image.c  |  138 ++---
 src/image.h  |   12 
 src/picture_viewer.c |   36 +
 3 files changed, 145 insertions(+), 41 deletions(-)

diff --git a/src/image.c b/src/image.c
index 5a44844..bf7c1d1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -38,11 +38,12 @@
 
 enum
 {
-RSTTO_IMAGE_SIGNAL_UPDATED= 0,
-RSTTO_IMAGE_SIGNAL_PREPARED,
+RSTTO_IMAGE_SIGNAL_STATE_CHANGED = 0,
+RSTTO_IMAGE_SIGNAL_UPDATED,
 RSTTO_IMAGE_SIGNAL_COUNT
 };
 
+
 static void
 rstto_image_init (GObject *);
 static void
@@ -61,6 +62,9 @@ static gboolean
 cb_rstto_image_update(RsttoImage *image);
 
 static void
+rstto_image_set_state (RsttoImage *image, RsttoImageState state);
+
+static void
 cb_rstto_image_read_file_ready (GObject *source_object, GAsyncResult *result, 
gpointer user_data);
 static void
 cb_rstto_image_read_input_stream_ready (GObject *source_object, GAsyncResult 
*result, gpointer user_data);
@@ -97,6 +101,8 @@ rstto_image_get_type ()
 
 struct _RsttoImagePriv
 {
+/* Generic data */
+RsttoImageState state;
 /* File data */
 /*/
 GFile *file;
@@ -105,15 +111,18 @@ struct _RsttoImagePriv
 /* File I/O data */
 /*/
 guchar *buffer;
+GdkPixbufLoader *loader;
+gboolean load_cancelled;
 
 /* Image data */
 /**/
-GdkPixbufLoader *loader;
 ExifData *exif_data;
 GdkPixbuf *thumbnail;
 GdkPixbuf *pixbuf;
 gint   width;
 gint   height;
+gint   pixbuf_width;
+gint   pixbuf_height;
 guint  max_size;
 
 GdkPixbufAnimation  *animation;
@@ -156,7 +165,7 @@ rstto_image_class_init (GObjectClass *object_class)
 0,
 NULL);
 
-rstto_image_signals[RSTTO_IMAGE_SIGNAL_PREPARED] = g_signal_new(prepared,
+rstto_image_signals[RSTTO_IMAGE_SIGNAL_STATE_CHANGED] = 
g_signal_new(state-changed,
 G_TYPE_FROM_CLASS (image_class),
 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 0,
@@ -177,6 +186,7 @@ rstto_image_class_init (GObjectClass *object_class)
 static void
 rstto_image_dispose (GObject *object)
 {
+g_debug (%s, __FUNCTION__);
 RsttoImage *image = RSTTO_IMAGE (object);
 
 if(image-priv-thumbnail)
@@ -191,12 +201,16 @@ rstto_image_dispose (GObject *object)
 image-priv-animation_timeout_id = 0;
 }
 
+/*
 if (image-priv-loader)
 {
+g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_size_prepared, image);
 g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_area_prepared, image);
+g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_closed, image);
 gdk_pixbuf_loader_close (image-priv-loader, NULL);
 image-priv-loader = NULL;
 }
+*/
 
 if (image-priv-animation)
 {
@@ -235,6 +249,7 @@ rstto_image_dispose (GObject *object)
 RsttoImage *
 rstto_image_new (GFile *file)
 {
+g_debug (%s, __FUNCTION__);
 g_object_ref (file);
 
 RsttoImage *image = g_object_new (RSTTO_TYPE_IMAGE, NULL);
@@ -296,6 +311,7 @@ rstto_image_new (GFile *file)
 static void
 cb_rstto_image_read_file_ready (GObject *source_object, GAsyncResult *result, 
gpointer user_data)
 {
+g_debug (%s, __FUNCTION__);
 GFile *file = G_FILE (source_object);
 RsttoImage *image = RSTTO_IMAGE (user_data);
 
@@ -314,6 +330,7 @@ cb_rstto_image_read_file_ready (GObject *source_object, 
GAsyncResult *result, gp
 static void
 cb_rstto_image_read_input_stream_ready (GObject *source_object, GAsyncResult 
*result, gpointer user_data)
 {
+g_debug (%s, __FUNCTION__);
 RsttoImage *image = RSTTO_IMAGE (user_data);
 gssize read_bytes = g_input_stream_read_finish (G_INPUT_STREAM 
(source_object), result, NULL);
 GError *error = NULL;
@@ -322,7 +339,7 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 return;
 
 
-if (read_bytes  0)
+if (read_bytes  0  (image-priv-load_cancelled == FALSE))
 {
 if(gdk_pixbuf_loader_write (image-priv-loader, (const guchar 
*)image-priv-buffer, read_bytes, error) == FALSE)
 {
@@ -342,21 +359,23 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 }
 }
 else
-if (read_bytes == 0)
-{
-/* OK */
-g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
-gdk_pixbuf_loader_close (image-priv-loader, NULL);
-image-priv-loader = NULL;
-g_object_unref (image);
-}
-else
 {
-/* I/O ERROR 

[Xfce4-commits] ristretto:ristretto-0.0 Revert Implement state-machine in image class

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to 66cae1e72422b4912d5cc852c4989a9225322ea3 (commit)
   from 99f0917fc1d220dd6a2ef61a5f5f53fe2e839065 (commit)

commit 66cae1e72422b4912d5cc852c4989a9225322ea3
Author: Stephan Arts stephan@thor.(none)
Date:   Fri May 15 18:33:06 2009 +0200

Revert Implement state-machine in image class

This reverts commit 96ee95c3848f91e9693d4519e1c7d52f35ab4340.

 src/image.c  |  109 -
 src/image.h  |   12 -
 src/picture_viewer.c |   36 +
 3 files changed, 28 insertions(+), 129 deletions(-)

diff --git a/src/image.c b/src/image.c
index 38333eb..c454cf8 100644
--- a/src/image.c
+++ b/src/image.c
@@ -38,12 +38,11 @@
 
 enum
 {
-RSTTO_IMAGE_SIGNAL_STATE_CHANGED = 0,
-RSTTO_IMAGE_SIGNAL_UPDATED,
+RSTTO_IMAGE_SIGNAL_UPDATED= 0,
+RSTTO_IMAGE_SIGNAL_PREPARED,
 RSTTO_IMAGE_SIGNAL_COUNT
 };
 
-
 static void
 rstto_image_init (GObject *);
 static void
@@ -62,9 +61,6 @@ static gboolean
 cb_rstto_image_update(RsttoImage *image);
 
 static void
-rstto_image_set_state (RsttoImage *image, RsttoImageState state);
-
-static void
 cb_rstto_image_read_file_ready (GObject *source_object, GAsyncResult *result, 
gpointer user_data);
 static void
 cb_rstto_image_read_input_stream_ready (GObject *source_object, GAsyncResult 
*result, gpointer user_data);
@@ -101,8 +97,6 @@ rstto_image_get_type ()
 
 struct _RsttoImagePriv
 {
-/* Generic data */
-RsttoImageState state;
 /* File data */
 /*/
 GFile *file;
@@ -111,18 +105,15 @@ struct _RsttoImagePriv
 /* File I/O data */
 /*/
 guchar *buffer;
-GdkPixbufLoader *loader;
-gboolean load_cancelled;
 
 /* Image data */
 /**/
+GdkPixbufLoader *loader;
 ExifData *exif_data;
 GdkPixbuf *thumbnail;
 GdkPixbuf *pixbuf;
 gint   width;
 gint   height;
-gint   pixbuf_width;
-gint   pixbuf_height;
 guint  max_size;
 
 GdkPixbufAnimation  *animation;
@@ -165,7 +156,7 @@ rstto_image_class_init (GObjectClass *object_class)
 0,
 NULL);
 
-rstto_image_signals[RSTTO_IMAGE_SIGNAL_STATE_CHANGED] = 
g_signal_new(state-changed,
+rstto_image_signals[RSTTO_IMAGE_SIGNAL_PREPARED] = g_signal_new(prepared,
 G_TYPE_FROM_CLASS (image_class),
 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 0,
@@ -186,7 +177,6 @@ rstto_image_class_init (GObjectClass *object_class)
 static void
 rstto_image_dispose (GObject *object)
 {
-g_debug (%s, __FUNCTION__);
 RsttoImage *image = RSTTO_IMAGE (object);
 
 if(image-priv-thumbnail)
@@ -201,16 +191,12 @@ rstto_image_dispose (GObject *object)
 image-priv-animation_timeout_id = 0;
 }
 
-/*
 if (image-priv-loader)
 {
-g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_size_prepared, image);
 g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_area_prepared, image);
-g_signal_handlers_disconnect_by_func (image-priv-loader , 
cb_rstto_image_closed, image);
 gdk_pixbuf_loader_close (image-priv-loader, NULL);
 image-priv-loader = NULL;
 }
-*/
 
 if (image-priv-animation)
 {
@@ -249,7 +235,6 @@ rstto_image_dispose (GObject *object)
 RsttoImage *
 rstto_image_new (GFile *file)
 {
-g_debug (%s, __FUNCTION__);
 g_object_ref (file);
 
 RsttoImage *image = g_object_new (RSTTO_TYPE_IMAGE, NULL);
@@ -311,7 +296,6 @@ rstto_image_new (GFile *file)
 static void
 cb_rstto_image_read_file_ready (GObject *source_object, GAsyncResult *result, 
gpointer user_data)
 {
-g_debug (%s, __FUNCTION__);
 GFile *file = G_FILE (source_object);
 RsttoImage *image = RSTTO_IMAGE (user_data);
 
@@ -330,7 +314,6 @@ cb_rstto_image_read_file_ready (GObject *source_object, 
GAsyncResult *result, gp
 static void
 cb_rstto_image_read_input_stream_ready (GObject *source_object, GAsyncResult 
*result, gpointer user_data)
 {
-g_debug (%s, __FUNCTION__);
 RsttoImage *image = RSTTO_IMAGE (user_data);
 gssize read_bytes = g_input_stream_read_finish (G_INPUT_STREAM 
(source_object), result, NULL);
 GError *error = NULL;
@@ -339,7 +322,7 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 return;
 
 
-if (read_bytes  0  (image-priv-load_cancelled == FALSE))
+if (read_bytes  0)
 {
 if(gdk_pixbuf_loader_write (image-priv-loader, (const guchar 
*)image-priv-buffer, read_bytes, error) == FALSE)
 {
@@ -358,6 +341,7 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 }
 }
 else
+if (read_bytes == 0)
 {
 if (read_bytes == 0)
 {
@@ -396,7 +380,6 @@ cb_rstto_image_read_input_stream_ready (GObject 
*source_object, GAsyncResult *re
 gboolean
 rstto_image_load (RsttoImage 

[Xfce4-commits] ristretto:ristretto-0.0 Merge branch 'breakup_refresh'

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.0
 to f6b085b3e0b356796a592414249485c7a8e8ae20 (commit)
   from 7c3c0b8d56ed639352d7e11d1bdf3058052a2d5c (commit)

commit f6b085b3e0b356796a592414249485c7a8e8ae20
Merge: 7c3c0b8 0c1e906
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 22:01:38 2009 +0100

Merge branch 'breakup_refresh'

Conflicts:

src/picture_viewer.c

commit 0c1e906c2931655b6f075bb7105895748b50946a
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:51:09 2009 +0100

Emit 'updated' signal when 'rstto_image_load' is called and the image is 
already there.

commit 68f99e86e52a3bbd80337b2e8516133eab1aaa23
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 21:44:47 2009 +0100

Fix zoom-in and zoom-out (accidently passed a boolean instead of a double)

commit 2b5990b32b22c130f54395eb0f61f9c7ad107e27
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:28:49 2009 +0100

Move DnD code to the bottom of the file

commit edf1b2a317f77e5b162a50c0ac5e8d11e0703a9b
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:23:48 2009 +0100

Fix segfault

commit 1da739e89571c1775602a511ad86b5c0ed97a8e1
Author: Stephan Arts step...@xfce.org
Date:   Mon Mar 9 00:03:41 2009 +0100

Made all the scale related functions internal

commit 7da92c8d582e14d50adfee29144751e7b89b93cb
Author: Stephan Arts step...@xfce.org
Date:   Sun Mar 8 14:22:37 2009 +0100

Split 'view' state from 'motion' state

commit 691a6a7c89eb2902984ac6ccfe02e219168b82f4
Author: Stephan Arts step...@xfce.org
Date:   Fri Mar 6 15:28:33 2009 +0100

commit changes

commit ad1c2baadb12b28c47cbeb97b622af39d614ba5a
Author: Stephan Arts step...@xfce.org
Date:   Sun Feb 22 10:40:29 2009 +0100

Add refresh mask, needs some tweaking, but it solves the drag 
performance-loss.
Eventually, this should reduce the times ristretto scales the image.

 src/image.c  |2 +-
 src/main_window.c|   10 +-
 src/picture_viewer.c | 1010 +-
 src/picture_viewer.h |   15 +-
 4 files changed, 522 insertions(+), 515 deletions(-)

diff --git a/src/image.c b/src/image.c
index a717cca..82d23fe 100644
--- a/src/image.c
+++ b/src/image.c
@@ -407,7 +407,7 @@ rstto_image_load (RsttoImage *image, gboolean empty_cache, 
GError **error)
 }
 else
 {
-//g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
+g_signal_emit(G_OBJECT(image), 
rstto_image_signals[RSTTO_IMAGE_SIGNAL_UPDATED], 0, image, NULL);
 }
 rstto_image_cache_push_image (cache, image);
 return TRUE;
diff --git a/src/main_window.c b/src/main_window.c
index b7acbdb..2f8fe74 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -673,7 +673,7 @@ rstto_main_window_get_property (GObject*object,
 static void
 cb_rstto_main_window_zoom_fit (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_FIT);
+rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -686,7 +686,7 @@ cb_rstto_main_window_zoom_fit (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_100 (GtkWidget *widget, RsttoMainWindow *window)
 {
-rstto_picture_viewer_set_zoom_mode (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), RSTTO_ZOOM_MODE_100);
+rstto_picture_viewer_zoom_100 (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
 }
 
 /**
@@ -699,8 +699,7 @@ cb_rstto_main_window_zoom_100 (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_in (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale * ZOOM_FACTOR);
+rstto_picture_viewer_zoom_in (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**
@@ -713,8 +712,7 @@ cb_rstto_main_window_zoom_in (GtkWidget *widget, 
RsttoMainWindow *window)
 static void
 cb_rstto_main_window_zoom_out (GtkWidget *widget, RsttoMainWindow *window)
 {
-gdouble scale = rstto_picture_viewer_get_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer));
-rstto_picture_viewer_set_scale (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), scale / ZOOM_FACTOR);
+rstto_picture_viewer_zoom_out (RSTTO_PICTURE_VIEWER 
(window-priv-picture_viewer), ZOOM_FACTOR);
 }
 
 /**/
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 6710a6a..acc1c5a 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -30,12 +30,24 @@
 
 typedef enum
 {
-RSTTO_PICTURE_VIEWER_STATE_NONE,
-RSTTO_PICTURE_VIEWER_STATE_MOVE,
-RSTTO_PICTURE_VIEWER_STATE_PREVIEW,
-RSTTO_PICTURE_VIEWER_STATE_BOX_ZOOM
+

[Xfce4-commits] ristretto:ristretto-0.2 Creating branch ristretto-0.2

2011-10-23 Thread Stephan Arts
Updating branch refs/heads/ristretto-0.2
 as new branch
 to 1f5b673ad353942fdfbd2fc77efd54de933b1e96 (commit)

Branches are created implicitly by pushing. This mail only exists to 
let you know that there was code pushed to 

  refs/heads/ristretto-0.2

for the first time. Mails for the commits that lead to the creation 
of the branch will follow after this mail.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


  1   2   3   4   5   6   7   >