[Xfce4-commits] <ristretto:master> Conflicts: src/image_viewer.c src/main_window.c
Stephan Arts
noreply at xfce.org
Sun Feb 5 11:04:01 CET 2012
Updating branch refs/heads/master
to 06c6a4c87aeeaeedfd44eb6d23bf48db3c63a9d8 (commit)
from 9a29ded80ce6633ff387228244328dba8a4555bd (commit)
commit 06c6a4c87aeeaeedfd44eb6d23bf48db3c63a9d8
Author: Stephan Arts <stephan at xfce.org>
Date: Sun Feb 5 11:02:21 2012 +0100
Conflicts:
src/image_viewer.c
src/main_window.c
AUTHORS | 3 +
configure.in.in | 5 +-
icons/128x128/ristretto.png | Bin 0 -> 13283 bytes
icons/16x16/ristretto.png | Bin 825 -> 797 bytes
icons/48x48/ristretto.png | Bin 3475 -> 3445 bytes
icons/Makefile.am | 2 +-
icons/scalable/ristretto.svg | 1706 ++++++++++++++++++++++++++++++---
po/POTFILES.in | 2 -
src/Makefile.am | 7 +-
src/file.c | 61 ++
src/file.h | 6 +
src/icon_bar.c | 2215 ++++++++++++++++++++++++++++++++++++++++++
src/icon_bar.h | 116 +++
src/image_list.c | 406 ++++++++-
src/image_viewer.c | 6 +-
src/main_window.c | 281 +++++--
src/main_window_ui.xml | 18 +
src/settings.c | 31 +
src/thumbnail.c | 388 --------
src/thumbnail.h | 74 --
src/thumbnail_bar.c | 991 -------------------
src/thumbnail_bar.h | 72 --
src/thumbnailer.c | 38 +-
src/thumbnailer.h | 9 +-
src/util.h | 28 +
src/xfce_wallpaper_manager.c | 5 +
26 files changed, 4709 insertions(+), 1761 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index db8c37d..34b61a0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,4 @@
Stephan Arts - <stephan at xfce.org>
+
+The ristretto-icon is drawn by Simon Steinbeiss and is released under the
+same license as the ristretto application.
diff --git a/configure.in.in b/configure.in.in
index ad152dd..980de18 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -81,11 +81,8 @@ po/Makefile.in
src/Makefile
icons/Makefile
icons/16x16/Makefile
-icons/22x22/Makefile
-icons/24x24/Makefile
-icons/32x32/Makefile
-icons/36x36/Makefile
icons/48x48/Makefile
+icons/128x128/Makefile
icons/scalable/Makefile
])
diff --git a/icons/128x128/ristretto.png b/icons/128x128/ristretto.png
new file mode 100755
index 0000000..0bffa29
Binary files /dev/null and b/icons/128x128/ristretto.png differ
diff --git a/icons/16x16/ristretto.png b/icons/16x16/ristretto.png
index 7970645..9144752 100644
Binary files a/icons/16x16/ristretto.png and b/icons/16x16/ristretto.png differ
diff --git a/icons/48x48/ristretto.png b/icons/48x48/ristretto.png
index 2683ddf..679971d 100644
Binary files a/icons/48x48/ristretto.png and b/icons/48x48/ristretto.png differ
diff --git a/icons/Makefile.am b/icons/Makefile.am
index df49907..a260111 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -1,6 +1,6 @@
# Inspired by Makefile.am from the Thunar file-manager
-SUBDIRS = 16x16 22x22 24x24 32x32 36x36 48x48 scalable
+SUBDIRS = 16x16 48x48 128x128 scalable
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
diff --git a/icons/scalable/ristretto.svg b/icons/scalable/ristretto.svg
index 193a73e..20b4d02 100644
--- a/icons/scalable/ristretto.svg
+++ b/icons/scalable/ristretto.svg
@@ -1,152 +1,1620 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
+ xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.45"
width="48"
height="48"
- version="1.0"
- sodipodi:docbase="/home/stephan/svn-repo/ristretto/trunk/icons/scalable"
- sodipodi:docname="ristretto.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape"
- inkscape:export-filename="/home/stephan/svn-repo/ristretto/trunk/icons/16x16/ristretto.png"
- inkscape:export-xdpi="30"
- inkscape:export-ydpi="30"
- sodipodi:modified="TRUE">
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
+ id="svg4335"
+ version="1.1"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="ristretto_48.svg"
+ inkscape:export-filename="/home/ochosi/Nerdstuff/icons/ristretto/ristretto_48a.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
<defs
- id="defs5">
+ id="defs4337">
<linearGradient
- id="linearGradient3140">
+ id="linearGradient5348">
+ <stop
+ id="stop5350"
+ style="stop-color:#eeeeec;stop-opacity:0.06722689;"
+ offset="0" />
+ <stop
+ id="stop5354"
+ style="stop-color:#3c3c3c;stop-opacity:0.84033614;"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5464">
+ <stop
+ id="stop5466"
+ style="stop-color:#989898;stop-opacity:1;"
+ offset="0" />
+ <stop
+ offset="0.57266599"
+ style="stop-color:#b0b0b0;stop-opacity:1;"
+ id="stop5468" />
+ <stop
+ id="stop5470"
+ style="stop-color:#e5e5e5;stop-opacity:1;"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5306">
<stop
- style="stop-color:#000000;stop-opacity:0;"
offset="0"
- id="stop3142" />
+ style="stop-color:#989898;stop-opacity:1;"
+ id="stop5308" />
<stop
- id="stop4117"
- offset="0.5"
- style="stop-color:#000000;stop-opacity:0.4224599;" />
+ id="stop5320"
+ style="stop-color:#b0b0b0;stop-opacity:1;"
+ offset="0.33073017" />
<stop
- style="stop-color:#000000;stop-opacity:0;"
offset="1"
- id="stop3144" />
+ style="stop-color:#e5e5e5;stop-opacity:1;"
+ id="stop5310" />
</linearGradient>
- <radialGradient
+ <linearGradient
+ id="linearGradient3967">
+ <stop
+ offset="0"
+ style="stop-color:#f9f9f6;stop-opacity:1;"
+ id="stop3969" />
+ <stop
+ offset="0.50909019"
+ style="stop-color:#dddddc;stop-opacity:1;"
+ id="stop3971" />
+ <stop
+ offset="1"
+ style="stop-color:#2f2f2f;stop-opacity:1;"
+ id="stop3973" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5272">
+ <stop
+ offset="0"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ id="stop5274" />
+ <stop
+ offset="0.57695335"
+ style="stop-color:#cacac9;stop-opacity:1"
+ id="stop5276" />
+ <stop
+ offset="1"
+ style="stop-color:#6b6b6b;stop-opacity:1"
+ id="stop5278" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3584">
+ <stop
+ id="stop3586"
+ style="stop-color:#929292;stop-opacity:1;"
+ offset="0" />
+ <stop
+ id="stop3588"
+ style="stop-color:#d4d4d4;stop-opacity:1;"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="-0.056300852"
+ y="-0.11260171"
+ width="1.1126018"
+ height="1.2252034"
+ color-interpolation-filters="sRGB"
+ id="filter3550">
+ <feGaussianBlur
+ stdDeviation="1.3737999"
+ id="feGaussianBlur3552" />
+ </filter>
+ <linearGradient
+ id="linearGradient3526">
+ <stop
+ id="stop3528"
+ style="stop-color:#d1d1d1;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3530"
+ style="stop-color:#959594;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3740">
+ <stop
+ id="stop3743"
+ style="stop-color:#8b7835;stop-opacity:1;"
+ offset="0" />
+ <stop
+ id="stop3771"
+ style="stop-color:#7c571f;stop-opacity:1;"
+ offset="0.37135857" />
+ <stop
+ id="stop3745"
+ style="stop-color:#5c3d0a;stop-opacity:1;"
+ offset="0.68556082" />
+ <stop
+ id="stop3747"
+ style="stop-color:#483816;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5370">
+ <stop
+ offset="0"
+ style="stop-color:#000000;stop-opacity:1"
+ id="stop5372" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop5374" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5236">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop5238" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1"
+ id="stop5240" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3595">
+ <stop
+ id="stop3597"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3599"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ id="filter3615">
+ <feGaussianBlur
+ stdDeviation="0.655"
+ id="feGaussianBlur3617" />
+ </filter>
+ <linearGradient
+ id="linearGradient3666">
+ <stop
+ id="stop3668"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3670"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3584-0">
+ <stop
+ id="stop3586-1"
+ style="stop-color:#5f5f5f;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3588-6"
+ style="stop-color:#c6c6c6;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
inkscape:collect="always"
- xlink:href="#linearGradient3140"
- id="radialGradient2178"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.8385456,3.8898335e-2,-1.774223e-2,1.2926432,-324.48363,-275.08499)"
- cx="401.91992"
- cy="707.04498"
- fx="401.91992"
- fy="707.04498"
- r="139.39044" />
+ id="filter3955-3"
+ x="-0.027580626"
+ width="1.0551614"
+ y="-0.1264112"
+ height="1.2528224">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.33519833"
+ id="feGaussianBlur3957-5" />
+ </filter>
+ <linearGradient
+ id="linearGradient5348-8">
+ <stop
+ id="stop5350-1"
+ style="stop-color:#eeeeec;stop-opacity:0.06722689;"
+ offset="0" />
+ <stop
+ id="stop5354-0"
+ style="stop-color:#3c3c3c;stop-opacity:0.84033614;"
+ offset="1" />
+ </linearGradient>
<filter
+ color-interpolation-filters="sRGB"
inkscape:collect="always"
- x="-0.19506111"
- width="1.3901222"
- y="-0.92654028"
- height="2.8530806"
- id="filter4432">
+ id="filter5342-7">
<feGaussianBlur
inkscape:collect="always"
- stdDeviation="3.7061611"
- id="feGaussianBlur4434" />
+ stdDeviation="0.077699185"
+ id="feGaussianBlur5344-2" />
</filter>
+ <linearGradient
+ id="linearGradient5464-4">
+ <stop
+ id="stop5466-9"
+ style="stop-color:#989898;stop-opacity:1;"
+ offset="0" />
+ <stop
+ offset="0.57266599"
+ style="stop-color:#b0b0b0;stop-opacity:1;"
+ id="stop5468-9" />
+ <stop
+ id="stop5470-2"
+ style="stop-color:#e5e5e5;stop-opacity:1;"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5306-3">
+ <stop
+ offset="0"
+ style="stop-color:#989898;stop-opacity:1;"
+ id="stop5308-6" />
+ <stop
+ id="stop5320-6"
+ style="stop-color:#b0b0b0;stop-opacity:1;"
+ offset="0.33073017" />
+ <stop
+ offset="1"
+ style="stop-color:#e5e5e5;stop-opacity:1;"
+ id="stop5310-7" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3967-4">
+ <stop
+ offset="0"
+ style="stop-color:#f9f9f6;stop-opacity:1;"
+ id="stop3969-6" />
+ <stop
+ offset="0.50909019"
+ style="stop-color:#dddddc;stop-opacity:1;"
+ id="stop3971-9" />
+ <stop
+ offset="1"
+ style="stop-color:#2f2f2f;stop-opacity:1;"
+ id="stop3973-6" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5272-0">
+ <stop
+ offset="0"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ id="stop5274-9" />
+ <stop
+ offset="0.57695335"
+ style="stop-color:#cacac9;stop-opacity:1"
+ id="stop5276-9" />
+ <stop
+ offset="1"
+ style="stop-color:#6b6b6b;stop-opacity:1"
+ id="stop5278-5" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3584-1">
+ <stop
+ id="stop3586-7"
+ style="stop-color:#929292;stop-opacity:1;"
+ offset="0" />
+ <stop
+ id="stop3588-3"
+ style="stop-color:#d4d4d4;stop-opacity:1;"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="-0.056300852"
+ y="-0.11260171"
+ width="1.1126018"
+ height="1.2252034"
+ color-interpolation-filters="sRGB"
+ id="filter3550-0">
+ <feGaussianBlur
+ stdDeviation="1.3737999"
+ id="feGaussianBlur3552-8" />
+ </filter>
+ <linearGradient
+ id="linearGradient3526-5">
+ <stop
+ id="stop3528-4"
+ style="stop-color:#d1d1d1;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3530-3"
+ style="stop-color:#959594;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3740-9">
+ <stop
+ id="stop3743-4"
+ style="stop-color:#8b7835;stop-opacity:1;"
+ offset="0" />
+ <stop
+ id="stop3771-6"
+ style="stop-color:#7c571f;stop-opacity:1;"
+ offset="0.37135857" />
+ <stop
+ id="stop3745-2"
+ style="stop-color:#5c3d0a;stop-opacity:1;"
+ offset="0.68556082" />
+ <stop
+ id="stop3747-3"
+ style="stop-color:#483816;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5370-6">
+ <stop
+ offset="0"
+ style="stop-color:#000000;stop-opacity:1"
+ id="stop5372-2" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop5374-7" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter5396-0"
+ x="-0.15666759"
+ width="1.3133352"
+ y="-0.52928245"
+ height="2.0585649">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.4424573"
+ id="feGaussianBlur5398-7" />
+ </filter>
+ <linearGradient
+ id="linearGradient5236-7">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop5238-4" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1"
+ id="stop5240-3" />
+ </linearGradient>
+ <filter
+ inkscape:collect="always"
+ id="filter5268-1"
+ x="-0.052338462"
+ width="1.1046768"
+ y="-0.17681913"
+ height="1.3536383"
+ color-interpolation-filters="sRGB">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.48188649"
+ id="feGaussianBlur5270-2" />
+ </filter>
+ <linearGradient
+ id="linearGradient3595-7">
+ <stop
+ id="stop3597-5"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3599-5"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ id="filter3615-8">
+ <feGaussianBlur
+ stdDeviation="0.655"
+ id="feGaussianBlur3617-0" />
+ </filter>
+ <linearGradient
+ id="linearGradient3666-7">
+ <stop
+ id="stop3668-7"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3670-3"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <filter
+ inkscape:collect="always"
+ id="filter5300-7"
+ x="-0.032951996"
+ width="1.065904"
+ y="-0.22856908"
+ height="1.4571382"
+ color-interpolation-filters="sRGB">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.21027346"
+ id="feGaussianBlur5302-7" />
+ </filter>
+ <linearGradient
+ id="linearGradient3584-0-9">
+ <stop
+ id="stop3586-1-3"
+ style="stop-color:#5f5f5f;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3588-6-2"
+ style="stop-color:#c6c6c6;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter5518-0"
+ x="-1.0420208"
+ width="3.0840416"
+ y="-0.14452717"
+ height="1.2890543">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.5542331"
+ id="feGaussianBlur5520-7" />
+ </filter>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter4172-8"
+ x="-0.12115395"
+ width="1.2423079"
+ y="-0.060576897"
+ height="1.1211538">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.46063742"
+ id="feGaussianBlur4174-2" />
+ </filter>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter4157-0"
+ x="-0.30881318"
+ width="1.6176264"
+ y="-0.1842142"
+ height="1.3684283">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.1741335"
+ id="feGaussianBlur4159-7" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5623"
+ x="-0.45"
+ width="1.9"
+ y="-0.225"
+ height="1.45">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.3671875"
+ id="feGaussianBlur5625" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5348-8"
+ id="linearGradient5653"
+ gradientUnits="userSpaceOnUse"
+ x1="-14.991652"
+ y1="16.764517"
+ x2="-14.991652"
+ y2="11.122693" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3967-4"
+ id="linearGradient5659"
+ gradientUnits="userSpaceOnUse"
+ x1="-13.724936"
+ y1="20.627558"
+ x2="-13.950117"
+ y2="6.1716137" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5370-6"
+ id="linearGradient5669"
+ gradientUnits="userSpaceOnUse"
+ x1="23.476465"
+ y1="43.138641"
+ x2="23.388077"
+ y2="39.335373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5236-7"
+ id="linearGradient5671"
+ gradientUnits="userSpaceOnUse"
+ x1="23.476465"
+ y1="43.138641"
+ x2="23.388077"
+ y2="39.335373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3595-7"
+ id="linearGradient5673"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-64.302516,-0.03124965)"
+ x1="87.050232"
+ y1="53.75"
+ x2="87.050232"
+ y2="41.729839" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3584-0-9"
+ id="linearGradient5703"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.93989449,0,0,1.01253,1.2738333,1002.0242)"
+ x1="21.766512"
+ y1="47.292023"
+ x2="19.958447"
+ y2="34.770805" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3666-7"
+ id="linearGradient5707"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43008487,0,0,0.32268549,21.449466,1018.0049)"
+ x1="-1.937054"
+ y1="0.98801559"
+ x2="-1.937054"
+ y2="31.826666" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3740-9"
+ id="radialGradient5713"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.50108728,-1.2355755e-8,0,0.18913207,19.757128,1020.1258)"
+ cx="8.4375"
+ cy="32.535023"
+ fx="8.4375"
+ fy="32.535023"
+ r="26.40625" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3526-5"
+ id="linearGradient5717"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.41723817,0,0,0.28467429,21.523353,1018.2247)"
+ spreadMethod="reflect"
+ x1="5.6835618"
+ y1="16.365782"
+ x2="35.032936"
+ y2="16.365782" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5272-0"
+ id="radialGradient5721"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.18053105,0.66518635,-0.62136481,0.16863792,36.861187,1029.3116)"
+ cx="-7.9468822"
+ cy="26.682461"
+ fx="-7.9468822"
+ fy="26.682461"
+ r="32.000408" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3584-1"
+ id="linearGradient5723"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.4344347,0,0,0.47777721,-13.135377,1017.0645)"
+ x1="117.30334"
+ y1="55.03125"
+ x2="53.302517"
+ y2="2.3599293" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5306-3"
+ id="radialGradient5727"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.24229937,0.27233706,-0.31629337,0.28140745,34.203672,981.32359)"
+ cx="106.30455"
+ cy="66.880486"
+ fx="106.30455"
+ fy="66.880486"
+ r="15.569839" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5464-4"
+ id="linearGradient5730"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.39034596,0,0,0.33710574,-1.696235,1006.9432)"
+ x1="94.203323"
+ y1="65.082436"
+ x2="106.09794"
+ y2="67.957436" />
+ <linearGradient
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507"
+ id="linearGradient2514"
+ xlink:href="#linearGradient5048"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)" />
+ <linearGradient
+ id="linearGradient5048">
+ <stop
+ id="stop5050"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="0" />
+ <stop
+ id="stop5056"
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0.5" />
+ <stop
+ id="stop5052"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <radialGradient
+ cx="605.71429"
+ cy="486.64789"
+ r="117.14286"
+ fx="605.71429"
+ fy="486.64789"
+ id="radialGradient2516"
+ xlink:href="#linearGradient5060"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)" />
+ <linearGradient
+ id="linearGradient5060">
+ <stop
+ id="stop5062"
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop5064"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <radialGradient
+ cx="605.71429"
+ cy="486.64789"
+ r="117.14286"
+ fx="605.71429"
+ fy="486.64789"
+ id="radialGradient2518"
+ xlink:href="#linearGradient5060"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)" />
+ <linearGradient
+ id="linearGradient3032">
+ <stop
+ id="stop3034"
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3036"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031"
+ id="linearGradient2526"
+ xlink:href="#linearGradient259-942"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2589474,0,0,0.1853811,-29.552425,-23.919907)" />
+ <linearGradient
+ id="linearGradient259-942">
+ <stop
+ id="stop3802"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3804"
+ style="stop-color:#e0e0e0;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723"
+ id="linearGradient2521"
+ xlink:href="#linearGradient4157-401-351"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2391271,0,0,0.1901676,-28.247959,-22.920364)" />
+ <linearGradient
+ id="linearGradient4157-401-351">
+ <stop
+ id="stop3790"
+ style="stop-color:#262626;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3792"
+ style="stop-color:#828282;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883"
+ id="linearGradient2523"
+ xlink:href="#linearGradient3610-302"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.5428573,0,0,0.5555556,1.0357211,3.004001)" />
+ <linearGradient
+ id="linearGradient3610-302">
+ <stop
+ id="stop3796"
+ style="stop-color:#333333;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop3798"
+ style="stop-color:#292929;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ y2="92.823723"
+ x2="105.36545"
+ y1="17.33289"
+ x1="28.938274"
+ gradientTransform="matrix(0.2391271,0,0,0.1901676,-28.247959,-22.920364)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3057"
+ xlink:href="#linearGradient4157-401-351"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="-40.163883"
+ x2="-24.097931"
+ y1="-13.090545"
+ x1="-24.032034"
+ gradientTransform="matrix(0.5428573,0,0,0.5555556,1.0357211,3.004001)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3059"
+ xlink:href="#linearGradient3610-302"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient6250"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient6252"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient6254"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient6256"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2589474,0,0,0.1853811,-29.552425,-23.919907)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient6258"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2391271,0,0,0.1901676,-28.247959,-22.920364)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient6260"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.5428573,0,0,0.5555556,1.0357211,3.004001)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient6276"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient6278"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient6280"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient6282"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2589474,0,0,0.1853811,-29.552425,-23.919907)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient6284"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.2391271,0,0,0.1901676,-28.247959,-22.920364)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient6286"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.5428573,0,0,0.5555556,1.0357211,3.004001)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient4060"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4062"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4064"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient4086"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4088"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4090"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4092"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-79.728428,-1030.6412)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4094"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-80.682391,-1025.4768)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4096"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-57.401299,-999.37018)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4099"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-26.93274,-1031.7856)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4101"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-3.6516454,-1005.679)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4104"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-26.048698,-1037.0715)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient4110"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4112"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4114"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4117"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-39.087093,-1028.7184)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4119"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-15.806001,-1002.6118)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient4152"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4154"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4156"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4158"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-26.048698,-1037.0715)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4160"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-26.93274,-1031.7856)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4162"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-3.6516454,-1005.679)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient4178"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03345303,0,0,0.01508077,-25.772132,20.02493)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4180"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.03142725,0,0,0.01508077,-24.517756,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient4182"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.03142725,0,0,0.01508077,-2.812712,20.02493)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4184"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-26.048698,-1037.0715)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4186"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-26.93274,-1031.7856)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4188"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-3.6516454,-1005.679)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4191"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-27.311555,-1031.7875)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4193"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-4.0304601,-1005.6809)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4196"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-26.427505,-1037.0725)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4206"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-26.427505,-1037.0725)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4208"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-27.311555,-1031.7875)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4210"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,-4.0304601,-1005.6809)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4213"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-12.012295,-1018.4951)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4215"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,11.268799,-992.38851)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4218"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-11.16175,-1023.8148)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4228"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-11.16175,-1023.8148)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4230"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-12.012295,-1018.4951)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4232"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,11.268799,-992.38851)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient259-942"
+ id="linearGradient4240"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.21391347,0,0,0.22440862,-11.16175,-1023.8148)"
+ x1="108.26451"
+ y1="110.28094"
+ x2="25.817675"
+ y2="14.029031" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4157-401-351"
+ id="linearGradient4242"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.19011067,0,0,0.19150238,-12.012295,-1018.4951)"
+ x1="28.938274"
+ y1="17.33289"
+ x2="105.36545"
+ y2="92.823723" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610-302"
+ id="linearGradient4244"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.43158206,0,0,0.55945501,11.268799,-992.38851)"
+ x1="-24.032034"
+ y1="-13.090545"
+ x2="-24.097931"
+ y2="-40.163883" />
</defs>
<sodipodi:namedview
- inkscape:window-height="703"
- inkscape:window-width="1280"
- inkscape:pageshadow="2"
- inkscape:pageopacity="0.0"
- guidetolerance="10.0"
- gridtolerance="10.0"
- objecttolerance="10.0"
- borderopacity="1.0"
- bordercolor="#666666"
- pagecolor="#ffffff"
id="base"
- width="48px"
- height="48px"
- inkscape:zoom="6.6756757"
- inkscape:cx="50.5"
- inkscape:cy="16"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="7.9195959"
+ inkscape:cx="35.158268"
+ inkscape:cy="37.429971"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="752"
inkscape:window-x="0"
- inkscape:window-y="32"
- inkscape:current-layer="svg2" />
- <path
- style="fill:#e6e6e6;fill-opacity:1;fill-rule:evenodd;stroke:#666666;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 37.748988,11.898786 C 40.445344,7.4048587 43.591094,9.3522271 43.591094,9.3522271 C 43.591094,9.3522271 46.88664,11.299596 45.238867,19.538462 C 43.591093,27.777329 35.052632,28.975709 35.052632,28.975709 C 35.052632,28.975709 35.651822,29.275305 36.251012,25.530366 C 40.595141,22.534414 40.972523,24.092854 42.242914,20.587046 C 43.544043,16.996416 43.591092,15.344129 43.1417,14.145749 C 42.323476,11.963818 37.898785,17.141701 37.898785,17.141701 L 37.748988,11.898786 z "
- id="path4440"
- sodipodi:nodetypes="ccsccsscc" />
- <path
- sodipodi:type="arc"
- style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4432)"
- id="path3161"
- sodipodi:cx="21"
- sodipodi:cy="39"
- sodipodi:rx="19"
- sodipodi:ry="4"
- d="M 40 39 A 19 4 0 1 1 2,39 A 19 4 0 1 1 40 39 z"
- transform="matrix(0.7894737,0,0,0.7894737,4.5396884,10.368421)" />
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4340">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
<g
- id="g3155">
- <path
- transform="matrix(8.9739838e-2,0,0,8.8907037e-2,-14.356084,-48.860724)"
- sodipodi:end="3.1341997"
- sodipodi:start="0"
- d="M 592.95534,691.78125 A 197.65178,325.85834 0 0 1 197.65718,694.19028 L 395.30356,691.78125 z"
- sodipodi:ry="325.85834"
- sodipodi:rx="197.65178"
- sodipodi:cy="691.78125"
- sodipodi:cx="395.30356"
- id="path2164"
- style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:11.19539165;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:type="arc" />
- <path
- transform="matrix(8.6840824e-2,0,0,6.4921981e-2,-11.238282,-22.796183)"
- d="M 576.92952 538.20044 A 204.32921 148.23883 0 1 1 168.2711,538.20044 A 204.32921 148.23883 0 1 1 576.92952 538.20044 z"
- sodipodi:ry="148.23883"
- sodipodi:rx="204.32921"
- sodipodi:cy="538.20044"
- sodipodi:cx="372.60031"
- id="path2159"
- style="fill:#ececec;fill-opacity:1;stroke:#666666;stroke-width:13.31809629;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:type="arc" />
- <path
- transform="matrix(0.1076744,0,0,8.6725961e-2,-21.445427,-33.934431)"
- d="M 534.194 540.8714 A 138.89044 94.819435 0 1 1 256.41312,540.8714 A 138.89044 94.819435 0 1 1 534.194 540.8714 z"
- sodipodi:ry="94.819435"
- sodipodi:rx="138.89044"
- sodipodi:cy="540.8714"
- sodipodi:cx="395.30356"
- id="path2161"
- style="fill:url(#radialGradient2178);fill-opacity:1;stroke:#666666;stroke-width:10.34830474;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:type="arc" />
- <path
- sodipodi:nodetypes="ccc"
- id="path3138"
- d="M 14.107298,19.778583 C 22.494977,22.149332 29.186728,19.42238 29.186728,19.42238 C 29.186728,19.42238 21.943858,16.92893 14.107298,19.778583 z "
- style="fill:#552200;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <g
+ transform="translate(38.706552,6.9422558)"
+ id="g4234">
+ <rect
+ width="18.985498"
+ height="22.950214"
+ x="-6.1454296"
+ y="-1020.8865"
+ transform="matrix(-0.99999656,0.00262257,-6.3478256e-4,-0.9999998,0,0)"
+ id="rect4236"
+ style="fill:url(#linearGradient4240);fill-opacity:1;stroke:#b3b3b3;stroke-width:1.0000006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.96862745;stroke-dasharray:none" />
+ <rect
+ width="15.077256"
+ height="15.031724"
+ rx="0"
+ ry="0"
+ x="-6.6563129"
+ y="-1015.0606"
+ transform="matrix(-0.99998808,0.00488177,0.00187765,-0.99999824,0,0)"
+ id="rect4238"
+ style="fill:url(#linearGradient4242);fill-opacity:1;stroke:url(#linearGradient4244);stroke-width:0.89470929;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="g4224"
+ transform="translate(26.706552,9.9422558)">
+ <rect
+ style="fill:url(#linearGradient4228);fill-opacity:1;stroke:#b3b3b3;stroke-width:1.0000006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.96862745;stroke-dasharray:none"
+ id="rect4148"
+ transform="matrix(-0.99999656,0.00262257,-6.3478256e-4,-0.9999998,0,0)"
+ y="-1020.8865"
+ x="-6.1454296"
+ height="22.950214"
+ width="18.985498" />
+ <rect
+ style="fill:url(#linearGradient4230);fill-opacity:1;stroke:url(#linearGradient4232);stroke-width:0.89470929;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect4150"
+ transform="matrix(-0.99998808,0.00488177,0.00187765,-0.99999824,0,0)"
+ y="-1015.0606"
+ x="-6.6563129"
+ ry="0"
+ rx="0"
+ height="15.031724"
+ width="15.077256" />
+ </g>
+ <g
+ id="g4202"
+ transform="translate(-0.56756602,-0.27539648)">
+ <rect
+ width="18.985498"
+ height="22.950214"
+ x="-21.411184"
+ y="-1034.1442"
+ transform="matrix(-0.99999656,0.00262257,-6.3478256e-4,-0.9999998,0,0)"
+ id="rect3580"
+ style="fill:url(#linearGradient4206);fill-opacity:1;stroke:#b3b3b3;stroke-width:1.0000006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.96862745;stroke-dasharray:none" />
+ <rect
+ width="15.077256"
+ height="15.031724"
+ rx="0"
+ ry="0"
+ x="-21.955572"
+ y="-1028.3529"
+ transform="matrix(-0.99998808,0.00488177,0.00187765,-0.99999824,0,0)"
+ id="rect3582"
+ style="fill:url(#linearGradient4208);fill-opacity:1;stroke:url(#linearGradient4210);stroke-width:0.89470929;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="g6347">
+ <path
+ transform="matrix(1.5920924,0,0,1.9370943,46.254103,1018.848)"
+ d="m 0.53033066,13.528544 c 0,1.75736 -6.52951406,3.181981 -14.58407766,3.181981 -8.054564,0 -14.584078,-1.424621 -14.584078,-3.181981 0,-1.757359 6.529514,-3.18198 14.584078,-3.18198 8.0545636,0 14.58407766,1.424621 14.58407766,3.18198 z"
+ sodipodi:ry="3.1819806"
+ sodipodi:rx="14.584078"
+ sodipodi:cy="13.528544"
+ sodipodi:cx="-14.053747"
+ id="path3953"
+ style="opacity:0.25000005;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter3955-3)"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.78431373;fill:url(#linearGradient5653);fill-opacity:1;stroke:none"
+ id="path5346"
+ sodipodi:cx="-14.053747"
+ sodipodi:cy="13.528544"
+ sodipodi:rx="14.584078"
+ sodipodi:ry="3.1819806"
+ d="m 0.53033066,13.528544 c 0,1.75736 -6.52951406,3.181981 -14.58407766,3.181981 -8.054564,0 -14.584078,-1.424621 -14.584078,-3.181981 0,-1.757359 6.529514,-3.18198 14.584078,-3.18198 8.0545636,0 14.58407766,1.424621 14.58407766,3.18198 z"
+ transform="matrix(1.6124378,0,0,2.541313,46.671,1007.1148)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#828282;stroke-width:0.37162852;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5342-7)"
+ id="path5304"
+ sodipodi:cx="-14.053747"
+ sodipodi:cy="13.528544"
+ sodipodi:rx="14.584078"
+ sodipodi:ry="3.1819806"
+ d="m 0.53033066,13.528544 c 0,1.75736 -6.52951406,3.181981 -14.58407766,3.181981 -8.054564,0 -14.584078,-1.424621 -14.584078,-3.181981 0,-1.757359 6.529514,-3.18198 14.584078,-3.18198 8.0545636,0 14.58407766,1.424621 14.58407766,3.18198 z"
+ transform="matrix(1.5919634,0,0,2.5572361,46.248651,1007.1625)" />
+ <path
+ style="fill:none;stroke:#b5b5b5;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 37.078748,1029.3448 c 0,-4.9087 7.438374,-5.3291 7.541168,-0.1257 0.102793,5.2035 -7.541168,5.0345 -7.541168,0.1257 z"
+ id="path5400"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="zzz" />
+ <path
+ sodipodi:nodetypes="cscsc"
+ inkscape:connector-curvature="0"
+ id="path5454"
+ d="m 37.728709,1023.4614 c 0,0 0.02815,1.0381 1.171036,0.8006 1.267172,-0.2632 -1.512591,9.2283 -1.512591,9.2283 0,0 -0.975865,-0.295 -1.610177,0.6742 -1.463568,2.2362 1.951732,-10.7031 1.951732,-10.7031 z"
+ style="fill:url(#linearGradient5730);fill-opacity:1;stroke:none" />
+ <path
+ sodipodi:nodetypes="zzz"
+ inkscape:connector-curvature="0"
+ id="path4584"
+ d="m 37.078748,1029.3448 c 0,-4.9087 7.541168,-5.1441 7.541168,-0.1257 0,5.0185 -7.541168,5.0345 -7.541168,0.1257 z"
+ style="fill:none;stroke:url(#radialGradient5727);stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(1.611369,0,0,2.5396286,46.645773,1007.1433)"
+ d="m 0.53033066,13.528544 c 0,1.75736 -6.52951406,3.181981 -14.58407766,3.181981 -8.054564,0 -14.584078,-1.424621 -14.584078,-3.181981 0,-1.757359 6.529514,-3.18198 14.584078,-3.18198 8.0545636,0 14.58407766,1.424621 14.58407766,3.18198 z"
+ sodipodi:ry="3.1819806"
+ sodipodi:rx="14.584078"
+ sodipodi:cy="13.528544"
+ sodipodi:cx="-14.053747"
+ id="path3150"
+ style="fill:url(#linearGradient5659);fill-opacity:1;stroke:#c8c8c8;stroke-width:0.49400282;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ d="m 23.922995,1017.6916 c -7.267798,0 -13.217154,2.2989 -13.65754,5.1958 l -0.02716,0 0,0.3434 0,2.9264 0,0.224 c 0.09795,9.2587 6.191448,16.7371 13.684694,16.7371 7.493237,0 13.586732,-7.4784 13.68469,-16.7371 7.43e-4,-0.076 0,-0.1484 0,-0.224 l 0,-2.9264 0,-0.3434 -0.02715,0 c -0.440389,-2.8969 -6.389746,-5.1958 -13.657543,-5.1958 z"
+ id="path2706"
+ style="fill:url(#radialGradient5721);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient5723);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 35.032936,16.365782 c 0.003,8.086853 -13.107553,14.643336 -29.2812595,14.643336 -16.1737065,0 -29.2842485,-6.556483 -29.2812595,-14.643336 -0.003,-8.0868532 13.107553,-14.6433356 29.2812595,-14.6433356 16.1737065,0 29.2842485,6.5564824 29.2812595,14.6433356 l 0,0 z"
+ transform="matrix(0.45020857,0,0,0.34483522,21.390507,1017.1949)"
+ id="path3534"
+ style="opacity:0.6;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.86063385;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter3550-0);enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 36.140431,1022.8836 c 0.0013,2.3021 -5.468973,4.1686 -12.21726,4.1686 -6.748287,0 -12.218505,-1.8665 -12.217257,-4.1686 -0.0013,-2.3021 5.46897,-4.1686 12.217257,-4.1686 6.748287,0 12.218506,1.8665 12.21726,4.1686 l 0,0 z"
+ id="path3499"
+ style="fill:url(#linearGradient5717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 23.859366,1020.9016 c -5.388164,0 -9.91792,1.3169 -11.237634,3.0995 1.326108,1.7793 5.856222,3.0867 11.237634,3.0867 5.380269,0 9.910446,-1.308 11.237629,-3.0867 -1.320461,-1.7822 -5.850263,-3.0995 -11.237629,-3.0995 z"
+ id="path3736"
+ style="fill:#36290f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 23.985052,1021.3794 c -5.508691,0 -10.139772,1.258 -11.489006,2.961 1.355772,1.6998 5.987219,2.9488 11.489006,2.9488 5.500618,0 10.132132,-1.2495 11.489001,-2.9488 -1.349998,-1.7026 -5.981125,-2.961 -11.489001,-2.961 z"
+ id="path3501"
+ style="fill:url(#radialGradient5713);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.49019608;fill:url(#linearGradient5669);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter5396-0)"
+ id="path5366"
+ sodipodi:cx="23.864855"
+ sodipodi:cy="39.691494"
+ sodipodi:rx="11.048544"
+ sodipodi:ry="3.2703688"
+ d="m 34.913399,39.691494 c 0,1.806175 -4.946602,3.270369 -11.048544,3.270369 -6.101943,0 -11.048544,-1.464194 -11.048544,-3.270369 0,-1.806175 4.946601,-3.270369 11.048544,-3.270369 6.101942,0 11.048544,1.464194 11.048544,3.270369 z"
+ transform="matrix(1.4276972,0,0,1.5746466,-10.125492,978.61188)" />
+ <path
+ transform="matrix(1.1842971,0,0,1.306194,-4.3169828,989.39872)"
+ d="m 34.913399,39.691494 c 0,1.806175 -4.946602,3.270369 -11.048544,3.270369 -6.101943,0 -11.048544,-1.464194 -11.048544,-3.270369 0,-1.806175 4.946601,-3.270369 11.048544,-3.270369 6.101942,0 11.048544,1.464194 11.048544,3.270369 z"
+ sodipodi:ry="3.2703688"
+ sodipodi:rx="11.048544"
+ sodipodi:cy="39.691494"
+ sodipodi:cx="23.864855"
+ id="path5234"
+ style="opacity:0.74509804;fill:url(#linearGradient5671);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter5268-1)"
+ sodipodi:type="arc" />
+ <path
+ d="m 46.072483,37.6875 c -5.21761,7.123568 -14.34843,11.84375 -24.75,11.84375 -10.38105,10e-7 -19.4959799,-4.712434 -24.7187498,-11.8125 4.01830989,9.384132 13.5721898,16 24.7187498,16 11.16122,0 20.74101,-6.627475 24.75,-16.03125 z"
+ transform="matrix(0.4344347,0,0,0.47777721,14.799866,1017.0794)"
+ id="path3590"
+ style="opacity:0.3;fill:url(#linearGradient5673);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.73178875;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter3615-8);enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 36.516599,1023.2859 c 0.0013,2.6095 -5.637359,4.7252 -12.593426,4.7252 -6.956067,0 -12.594712,-2.1157 -12.593426,-4.7252 -0.0013,-2.6095 5.637359,-4.7252 12.593426,-4.7252 6.956067,0 12.594711,2.1157 12.593426,4.7252 l 0,0 z"
+ id="path3664"
+ style="opacity:0.4;fill:none;stroke:url(#linearGradient5707);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(0.98770176,0,0,1.0054893,0.33746203,921.4947)"
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path5180"
+ d="m 16.242553,118.54955 c 0,0 2.273304,2.2079 7.657448,2.2079 5.38414,0 7.657446,-2.2079 7.657446,-2.2079"
+ style="fill:none;stroke:#3d3d3d;stroke-width:1.00345612;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5300-7)" />
+ <path
+ style="fill:none;stroke:url(#linearGradient5703);stroke-width:0.37136391;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 16.210178,1040.1923 c 0,0 2.285783,2.22 7.699482,2.22 5.413695,0 7.69948,-2.22 7.69948,-2.22"
+ id="path5166"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="czc" />
+ <path
+ transform="matrix(0.37136392,0,0,0.37136392,0.10831075,1004.6611)"
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path5480"
+ d="m 102.22328,52.339574 c 0,0 -1e-5,15.202796 -4.24265,25.809398"
+ style="opacity:0.60784314;fill:none;stroke:#1e1e1e;stroke-width:1.79999983;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5518-0)" />
+ <path
+ transform="matrix(0.37136392,0,0,0.37136392,0.10831075,1004.6611)"
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path4097"
+ d="m 109.75,56.999999 c 0,0 9.125,-0.07937 9.125,8.96875 0,9.048123 -8.875,9.28125 -8.875,9.28125"
+ style="fill:none;stroke:#dedede;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4172-8)" />
+ <path
+ transform="matrix(0.37136392,0,0,0.37136392,0.10831075,1004.6611)"
+ style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4157-0)"
+ d="m 108.75,59.249999 c 0,0 9.125,-1.07937 9.125,7.21875 0,8.29812 -8.875,8.03125 -8.875,8.03125"
+ id="path4099"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="czc" />
+ <path
+ transform="matrix(0.37136392,0,0,0.37136392,0.10831075,1004.6611)"
+ style="opacity:0.61764706;fill:none;stroke:#757575;stroke-width:3.69179654;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5623)"
+ d="m 110.25,53.499999 c 0,0 12.375,1.67063 12.375,12.96875 0,11.29812 -12.625,12.28125 -12.625,12.28125"
+ id="path4162"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="czc" />
+ </g>
</g>
</svg>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 45f5007..fdb6c04 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,9 +6,7 @@ src/privacy_dialog.c
src/preferences_dialog.c
src/properties_dialog.c
src/image_list.c
-src/thumbnail.c
src/thumbnailer.c
-src/thumbnail_bar.c
src/wallpaper_manager.c
src/xfce_wallpaper_manager.c
src/gnome_wallpaper_manager.c
diff --git a/src/Makefile.am b/src/Makefile.am
index c5e810e..513ec83 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,13 +13,12 @@ ristretto_SOURCES = \
xfce_wallpaper_manager.c xfce_wallpaper_manager.h \
gnome_wallpaper_manager.c gnome_wallpaper_manager.h \
app_menu_item.c app_menu_item.h \
- thumbnail_bar.c thumbnail_bar.h \
- thumbnail.c thumbnail.h \
thumbnailer.c thumbnailer.h \
marshal.c marshal.h \
file.c file.h \
privacy_dialog.h privacy_dialog.c \
util.c util.h \
+ icon_bar.c icon_bar.h \
main.c
ristretto_CFLAGS = \
@@ -80,7 +79,7 @@ stamp-marshal.h: marshal.list Makefile
&& echo "#ifndef __RSTTO_MARSHAL_H__" > xgen-tmh \
&& echo "#define __RSTTO_MARSHAL_H__" >> xgen-tmh \
&& ( glib-genmarshal \
- --prefix=rstto_marshal \
+ --prefix=_rstto_marshal \
--header marshal.list ) >> xgen-tmh \
&& echo "#endif /* !__RSTTO_MARSHAL_H__ */" >> xgen-tmh \
&& ( cmp -s xgen-tmh marshal.h || cp xgen-tmh marshal.h ) \
@@ -93,7 +92,7 @@ marshal.c: marshal.list Makefile
cd $(srcdir) \
&& echo "#include \"marshal.h\"" > xgen-tmc \
&& ( glib-genmarshal \
- --prefix=rstto_marshal \
+ --prefix=_rstto_marshal \
--body marshal.list ) >> xgen-tmc \
&& cp xgen-tmc marshal.c \
&& rm -f xgen-tmc \
diff --git a/src/file.c b/src/file.c
index f7ec265..13e5df3 100644
--- a/src/file.c
+++ b/src/file.c
@@ -20,6 +20,7 @@
#include <glib.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
#include <libexif/exif-data.h>
@@ -100,6 +101,9 @@ struct _RsttoFilePriv
gchar *uri;
gchar *path;
+ gchar *thumbnail_path;
+ GdkPixbuf *thumbnails[THUMBNAIL_SIZE_COUNT];
+
ExifData *exif_data;
RsttoImageOrientation orientation;
};
@@ -137,6 +141,7 @@ static void
rstto_file_dispose (GObject *object)
{
RsttoFile *file = RSTTO_FILE (object);
+ gint i = 0;
if (file->priv)
{
@@ -160,12 +165,26 @@ rstto_file_dispose (GObject *object)
g_free (file->priv->path);
file->priv->path = NULL;
}
+ if (file->priv->thumbnail_path)
+ {
+ g_free (file->priv->thumbnail_path);
+ file->priv->thumbnail_path = NULL;
+ }
if (file->priv->uri)
{
g_free (file->priv->uri);
file->priv->uri = NULL;
}
+ for (i = 0; i < THUMBNAIL_SIZE_COUNT; ++i)
+ {
+ if (file->priv->thumbnails[i])
+ {
+ g_object_unref (file->priv->thumbnails[i]);
+ file->priv->thumbnails[i] = NULL;
+ }
+ }
+
g_free (file->priv);
file->priv = NULL;
@@ -408,3 +427,45 @@ rstto_file_has_exif ( RsttoFile *file )
}
return TRUE;
}
+
+const gchar *
+rstto_file_get_thumbnail_path ( RsttoFile *file)
+{
+ const gchar *uri;
+ gchar *checksum;
+ gchar *filename;
+
+ if (NULL == file->priv->thumbnail_path)
+ {
+ uri = rstto_file_get_uri (file);
+ checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, strlen (uri));
+ filename = g_strconcat (checksum, ".png", NULL);
+
+ file->priv->thumbnail_path = g_build_path ("/", g_get_home_dir(), ".thumbnails", "normal", filename, NULL);
+
+ g_free (checksum);
+ g_free (filename);
+ }
+
+ return file->priv->thumbnail_path;
+}
+
+const GdkPixbuf *
+rstto_file_get_thumbnail ( RsttoFile *file , RsttoThumbnailSize size)
+{
+ const gchar *thumbnail_path;
+
+ if (file->priv->thumbnails[size])
+ return file->priv->thumbnails[size];
+
+ thumbnail_path = rstto_file_get_thumbnail_path (file);
+
+ file->priv->thumbnails[size] = gdk_pixbuf_new_from_file_at_scale (
+ thumbnail_path,
+ rstto_thumbnail_size[size],
+ rstto_thumbnail_size[size],
+ TRUE,
+ NULL);
+
+ return file->priv->thumbnails[size];
+}
diff --git a/src/file.h b/src/file.h
index 467813a..2a667b4 100644
--- a/src/file.h
+++ b/src/file.h
@@ -83,6 +83,12 @@ rstto_file_get_uri ( RsttoFile * );
const gchar *
rstto_file_get_content_type ( RsttoFile * );
+const gchar *
+rstto_file_get_thumbnail_path ( RsttoFile *);
+
+const GdkPixbuf *
+rstto_file_get_thumbnail ( RsttoFile *, RsttoThumbnailSize );
+
guint64
rstto_file_get_modified_time ( RsttoFile *);
diff --git a/src/icon_bar.c b/src/icon_bar.c
new file mode 100644
index 0000000..573524d
--- /dev/null
+++ b/src/icon_bar.c
@@ -0,0 +1,2215 @@
+/*-
+ * Copyright (c) 2004-2006 os-cillation e.K.
+ *
+ * Written by Benedikt Meurer <benny at xfce.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <gtk/gtkmarshal.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include <libexif/exif-data.h>
+
+#include "util.h"
+#include "file.h"
+#include "settings.h"
+#include "marshal.h"
+#include "icon_bar.h"
+
+/**
+ * SECTION: rstto-icon-bar
+ * @title: RsttoIconBar
+ * @short_description: A widget for displaying icon bars
+ * @include: rstto/rstto.h
+ * @see_also: <ulink url="http://library.gnome.org/devel/gtk/stable/GtkTreeModel.html">
+ * GtkTreeModel</ulink>,
+ * <ulink url="http://library.gnome.org/devel/gtk/stable/TreeWidget.html">
+ * Tree and List Widget Overview</ulink>
+ *
+ * A widget that displays any object that implements the #GtkTreeModel interface
+ * in an icon bar.
+ *
+ * <example>
+ * <title>
+ * Creating a new <structname>RsttoIconBar</structname> with a <structname>GtkListStore</structname>
+ * </title>
+ * <programlisting>
+ * enum
+ * {
+ * PIXBUF_COLUMN,
+ * STRING_COLUMN,
+ * N_COLUMNS,
+ * };
+ *
+ * {
+ * GtkListStore *store;
+ * GtkWidget *bar;
+ *
+ * // make a new list store
+ * store = gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
+ *
+ * // fill the store with data
+ * fill_store (store);
+ *
+ * // create the icon bar
+ * bar = rstto_icon_bar_new_with_model (GTK_TREE_MODEL (store));
+ * rstto_icon_bar_set_pixbuf_column (RSTTO_ICON_BAR (bar), PIXBUF_COLUMN);
+ * rstto_icon_bar_set_file_column (RSTTO_ICON_BAR (bar), FILE_COLUMN);
+ * gtk_widget_show (bar);
+ *
+ * // the icon bar keeps a reference on the store now
+ * g_object_unref (G_OBJECT (store));
+ *
+ * // add the bar to your GUI now...
+ * }
+ * </programlisting>
+ * </example>
+ **/
+
+
+
+#define MINIMUM_ICON_ITEM_WIDTH 32
+#define ICON_TEXT_PADDING 1
+
+#define RSTTO_ICON_BAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), RSTTO_TYPE_ICON_BAR, RsttoIconBarPrivate))
+
+#define RSTTO_ICON_BAR_VALID_MODEL_AND_COLUMNS(obj) ((obj)->priv->model != NULL && \
+ (obj)->priv->file_column != -1)
+
+
+
+typedef struct _RsttoIconBarItem RsttoIconBarItem;
+
+enum
+{
+ PROP_0,
+ PROP_ORIENTATION,
+ PROP_FILE_COLUMN,
+ PROP_MODEL,
+ PROP_ACTIVE,
+ PROP_SHOW_TEXT,
+};
+
+enum
+{
+ SELECTION_CHANGED,
+ LAST_SIGNAL,
+};
+
+static GdkPixbuf *thumbnail_missing = NULL;
+
+static void
+rstto_icon_bar_destroy (GtkObject *object);
+
+static void
+rstto_icon_bar_finalize (GObject *object);
+
+static void
+rstto_icon_bar_get_property (
+ GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void
+rstto_icon_bar_set_property (
+ GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+
+static void
+rstto_icon_bar_style_set (
+ GtkWidget *widget,
+ GtkStyle *previous_style);
+
+static void
+rstto_icon_bar_realize (GtkWidget *widget);
+static void
+rstto_icon_bar_unrealize (GtkWidget *widget);
+
+static void
+rstto_icon_bar_size_request (
+ GtkWidget *widget,
+ GtkRequisition *requisition);
+
+static void
+rstto_icon_bar_size_allocate (
+ GtkWidget *widget,
+ GtkAllocation *allocation);
+
+static gboolean
+rstto_icon_bar_expose (
+ GtkWidget *widget,
+ GdkEventExpose *expose);
+
+static gboolean
+rstto_icon_bar_leave (
+ GtkWidget *widget,
+ GdkEventCrossing *event);
+
+static gboolean
+rstto_icon_bar_motion (
+ GtkWidget *widget,
+ GdkEventMotion *event);
+
+static gboolean
+rstto_icon_bar_scroll (
+ GtkWidget *widget,
+ GdkEventScroll *event);
+
+static gboolean
+rstto_icon_bar_button_press (
+ GtkWidget *widget,
+ GdkEventButton *event);
+
+static gboolean
+rstto_icon_bar_button_release (
+ GtkWidget *widget,
+ GdkEventButton *event);
+
+static void
+rstto_icon_bar_set_adjustments (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj);
+
+static void
+cb_rstto_icon_bar_adjustment_value_changed (
+ GtkAdjustment *adjustment,
+ RsttoIconBar *icon_bar);
+
+static void
+rstto_icon_bar_invalidate (RsttoIconBar *icon_bar);
+
+static RsttoIconBarItem *
+rstto_icon_bar_get_item_at_pos (
+ RsttoIconBar *icon_bar,
+ gint x,
+ gint y);
+
+static void
+rstto_icon_bar_queue_draw_item (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item);
+
+static void
+rstto_icon_bar_paint_item (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item,
+ GdkRectangle *area);
+
+static void
+rstto_icon_bar_calculate_item_size (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item);
+
+static GdkPixbuf *
+rstto_icon_bar_get_item_icon (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item);
+
+static void
+rstto_icon_bar_adjustment_changed (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *adjustment);
+
+static void
+rstto_icon_bar_adjustment_value_changed (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *adjustment);
+
+static void
+cb_rstto_thumbnail_size_changed (
+ GObject *settings,
+ GParamSpec *pspec,
+ gpointer user_data);
+
+static void
+rstto_icon_bar_update_missing_icon (RsttoIconBar *icon_bar);
+
+
+static RsttoIconBarItem *
+rstto_icon_bar_item_new (void);
+
+static void
+rstto_icon_bar_item_free (RsttoIconBarItem *item);
+
+static void
+rstto_icon_bar_item_invalidate (RsttoIconBarItem *item);
+
+static void
+rstto_icon_bar_build_items (RsttoIconBar *icon_bar);
+
+static void
+rstto_icon_bar_row_changed (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ RsttoIconBar *icon_bar);
+
+static void
+rstto_icon_bar_row_inserted (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ RsttoIconBar *icon_bar);
+
+static void
+rstto_icon_bar_row_deleted (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ RsttoIconBar *icon_bar);
+
+static void
+rstto_icon_bar_rows_reordered (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gint *new_order,
+ RsttoIconBar *icon_bar);
+
+struct _RsttoIconBarItem
+{
+ GtkTreeIter iter;
+ gint index;
+
+ gint width;
+ gint height;
+
+ gint pixbuf_width;
+ gint pixbuf_height;
+
+ gint layout_width;
+ gint layout_height;
+};
+
+struct _RsttoIconBarPrivate
+{
+ GdkWindow *bin_window;
+
+ gint width;
+ gint height;
+
+ gint pixbuf_column;
+ gint file_column;
+
+ RsttoIconBarItem *active_item;
+ RsttoIconBarItem *single_click_item;
+ RsttoIconBarItem *cursor_item;
+
+ GList *items;
+ gint item_width;
+ gint item_height;
+
+ GtkAdjustment *hadjustment;
+ GtkAdjustment *vadjustment;
+
+ RsttoSettings *settings;
+
+ RsttoThumbnailSize thumbnail_size;
+
+ gboolean auto_center; /* automatically center the active item */
+
+ GtkOrientation orientation;
+
+ GtkTreeModel *model;
+
+ PangoLayout *layout;
+
+ gboolean show_text;
+};
+
+
+
+static guint icon_bar_signals[LAST_SIGNAL];
+
+G_DEFINE_TYPE (RsttoIconBar, rstto_icon_bar, GTK_TYPE_CONTAINER)
+
+
+static void
+rstto_icon_bar_class_init (RsttoIconBarClass *klass)
+{
+ GtkObjectClass *gtkobject_class;
+ GtkWidgetClass *gtkwidget_class;
+ GObjectClass *gobject_class;
+
+ g_type_class_add_private (klass, sizeof (RsttoIconBarPrivate));
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = rstto_icon_bar_finalize;
+ gobject_class->get_property = rstto_icon_bar_get_property;
+ gobject_class->set_property = rstto_icon_bar_set_property;
+
+ gtkobject_class = GTK_OBJECT_CLASS (klass);
+ gtkobject_class->destroy = rstto_icon_bar_destroy;
+
+ gtkwidget_class = GTK_WIDGET_CLASS (klass);
+ gtkwidget_class->style_set = rstto_icon_bar_style_set;
+ gtkwidget_class->realize = rstto_icon_bar_realize;
+ gtkwidget_class->unrealize = rstto_icon_bar_unrealize;
+ gtkwidget_class->size_request = rstto_icon_bar_size_request;
+ gtkwidget_class->size_allocate = rstto_icon_bar_size_allocate;
+ gtkwidget_class->expose_event = rstto_icon_bar_expose;
+ gtkwidget_class->leave_notify_event = rstto_icon_bar_leave;
+ gtkwidget_class->motion_notify_event = rstto_icon_bar_motion;
+ gtkwidget_class->scroll_event = rstto_icon_bar_scroll;
+ gtkwidget_class->button_press_event = rstto_icon_bar_button_press;
+ gtkwidget_class->button_release_event = rstto_icon_bar_button_release;
+
+ klass->set_scroll_adjustments = rstto_icon_bar_set_adjustments;
+
+ /**
+ * RsttoIconBar:orientation:
+ *
+ * The orientation of the icon bar.
+ *
+ * Default value: %GTK_ORIENTATION_VERTICAL
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_ORIENTATION,
+ g_param_spec_enum ("orientation",
+ _("Orientation"),
+ _("The orientation of the iconbar"),
+ GTK_TYPE_ORIENTATION,
+ GTK_ORIENTATION_VERTICAL,
+ G_PARAM_READWRITE));
+
+ /**
+ * RsttoIconBar:file-column:
+ *
+ * The ::file-column property contains the number of the model column
+ * containing the files which are displayed. The text column must be
+ * of type #RSTTO_TYPE_FILE. If this property is set to -1, no
+ * details are displayed.
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_FILE_COLUMN,
+ g_param_spec_int ("file-column",
+ _("File column"),
+ _("Model column used to retrieve the file from"),
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ /**
+ * RsttoIconBar:model:
+ *
+ * The model for the icon bar.
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_MODEL,
+ g_param_spec_object ("model",
+ _("Icon Bar Model"),
+ _("Model for the icon bar"),
+ GTK_TYPE_TREE_MODEL,
+ G_PARAM_READWRITE));
+
+ /**
+ * RsttoIconBar:active:
+ *
+ * The item which is currently active.
+ *
+ * Allowed values: >= -1
+ *
+ * Default value: -1
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_ACTIVE,
+ g_param_spec_int ("active",
+ _("Active"),
+ _("Active item index"),
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ /**
+ * RsttoIconBar:show-text:
+ *
+ * Show text under icon.
+ *
+ * Allowed values: TRUE, FALSE
+ *
+ * Default value: TRUE
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_SHOW_TEXT,
+ g_param_spec_boolean ("show-text",
+ _("Show Text"),
+ _("Show Text"),
+ TRUE,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("active-item-fill-color",
+ _("Active item fill color"),
+ _("Active item fill color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("active-item-border-color",
+ _("Active item border color"),
+ _("Active item border color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("active-item-text-color",
+ _("Active item text color"),
+ _("Active item text color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("cursor-item-fill-color",
+ _("Cursor item fill color"),
+ _("Cursor item fill color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("cursor-item-border-color",
+ _("Cursor item border color"),
+ _("Cursor item border color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_boxed ("cursor-item-text-color",
+ _("Cursor item text color"),
+ _("Cursor item text color"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+ /**
+ * RsttoIconBar::set-scroll-adjustments:
+ * @icon_bar : The #RsttoIconBar.
+ * @hadjustment : The horizontal adjustment.
+ * @vadjustment : The vertical adjustment.
+ *
+ * Used internally to make the #RsttoIconBar scrollable.
+ **/
+ gtkwidget_class->set_scroll_adjustments_signal =
+ g_signal_new ("set-scroll-adjustments",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (RsttoIconBarClass, set_scroll_adjustments),
+ NULL, NULL,
+ _rstto_marshal_VOID__OBJECT_OBJECT,
+ G_TYPE_NONE, 2,
+ GTK_TYPE_ADJUSTMENT,
+ GTK_TYPE_ADJUSTMENT);
+
+ /**
+ * RsttoIconBar::selection-changed:
+ * @icon_bar : The #RsttoIconBar.
+ *
+ * This signal is emitted whenever the currently selected icon
+ * changes.
+ **/
+ icon_bar_signals[SELECTION_CHANGED] =
+ g_signal_new ("selection-changed",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (RsttoIconBarClass, selection_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+}
+
+
+
+static void
+rstto_icon_bar_init (RsttoIconBar *icon_bar)
+{
+ icon_bar->priv = RSTTO_ICON_BAR_GET_PRIVATE (icon_bar);
+
+ icon_bar->priv->orientation = GTK_ORIENTATION_VERTICAL;
+ icon_bar->priv->pixbuf_column = -1;
+ icon_bar->priv->file_column = -1;
+ icon_bar->priv->show_text = TRUE;
+ icon_bar->priv->auto_center = TRUE;
+ icon_bar->priv->settings = rstto_settings_new ();
+
+ icon_bar->priv->thumbnail_size = rstto_settings_get_uint_property (
+ icon_bar->priv->settings,
+ "thumbnail-size");
+
+ rstto_icon_bar_update_missing_icon (icon_bar);
+
+ icon_bar->priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (icon_bar), NULL);
+ pango_layout_set_width (icon_bar->priv->layout, -1);
+ pango_layout_set_wrap (icon_bar->priv->layout,
+ PANGO_WRAP_WORD_CHAR);
+ pango_layout_set_ellipsize (icon_bar->priv->layout,
+ PANGO_ELLIPSIZE_END);
+
+ GTK_WIDGET_UNSET_FLAGS (icon_bar, GTK_CAN_FOCUS);
+
+ rstto_icon_bar_set_adjustments (icon_bar, NULL, NULL);
+
+ g_signal_connect (
+ G_OBJECT(icon_bar->priv->settings),
+ "notify::thumbnail-size",
+ G_CALLBACK (cb_rstto_thumbnail_size_changed),
+ icon_bar);
+
+}
+
+
+
+static void
+rstto_icon_bar_destroy (GtkObject *object)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (object);
+
+ rstto_icon_bar_set_model (icon_bar, NULL);
+
+ (*GTK_OBJECT_CLASS (rstto_icon_bar_parent_class)->destroy) (object);
+}
+
+
+
+static void
+rstto_icon_bar_finalize (GObject *object)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (object);
+
+ g_object_unref (G_OBJECT (icon_bar->priv->layout));
+ g_object_unref (G_OBJECT (icon_bar->priv->settings));
+
+ (*G_OBJECT_CLASS (rstto_icon_bar_parent_class)->finalize) (object);
+}
+
+
+
+static void
+rstto_icon_bar_get_property (
+ GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (object);
+
+ switch (prop_id)
+ {
+ case PROP_ORIENTATION:
+ g_value_set_enum (value, icon_bar->priv->orientation);
+ break;
+
+ case PROP_FILE_COLUMN:
+ g_value_set_int (value, icon_bar->priv->file_column);
+ break;
+
+ case PROP_MODEL:
+ g_value_set_object (value, icon_bar->priv->model);
+ break;
+
+ case PROP_ACTIVE:
+ g_value_set_int (value, rstto_icon_bar_get_active (icon_bar));
+ break;
+
+ case PROP_SHOW_TEXT:
+ g_value_set_boolean (value, rstto_icon_bar_get_show_text (icon_bar));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+
+
+static void
+rstto_icon_bar_set_property (
+ GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (object);
+
+ switch (prop_id)
+ {
+ case PROP_ORIENTATION:
+ rstto_icon_bar_set_orientation (icon_bar, g_value_get_enum (value));
+ break;
+
+ case PROP_FILE_COLUMN:
+ rstto_icon_bar_set_file_column (icon_bar, g_value_get_int (value));
+ break;
+
+ case PROP_MODEL:
+ rstto_icon_bar_set_model (icon_bar, g_value_get_object (value));
+ break;
+
+ case PROP_ACTIVE:
+ rstto_icon_bar_set_active (icon_bar, g_value_get_int (value));
+ break;
+
+ case PROP_SHOW_TEXT:
+ rstto_icon_bar_set_show_text (icon_bar, g_value_get_boolean (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+
+
+static void
+rstto_icon_bar_style_set (
+ GtkWidget *widget,
+ GtkStyle *previous_style)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+
+ (*GTK_WIDGET_CLASS (rstto_icon_bar_parent_class)->style_set) (widget, previous_style);
+
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ gdk_window_set_background (icon_bar->priv->bin_window,
+ &widget->style->base[widget->state]);
+ }
+}
+
+
+
+static void
+rstto_icon_bar_realize (GtkWidget *widget)
+{
+ GdkWindowAttr attributes;
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ gint attributes_mask;
+
+ GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.x = widget->allocation.x;
+ attributes.y = widget->allocation.y;
+ attributes.width = widget->allocation.width;
+ attributes.height = widget->allocation.height;
+ attributes.wclass = GDK_INPUT_OUTPUT;
+ attributes.visual = gtk_widget_get_visual (widget);
+ attributes.colormap = gtk_widget_get_colormap (widget);
+ attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+
+ widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (widget->window, widget);
+
+ attributes.x = 0;
+ attributes.y = 0;
+ attributes.width = MAX (icon_bar->priv->width, widget->allocation.width);
+ attributes.height = MAX (icon_bar->priv->height, widget->allocation.height);
+ attributes.event_mask = (GDK_SCROLL_MASK
+ | GDK_EXPOSURE_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_BUTTON_RELEASE_MASK
+ | GDK_KEY_PRESS_MASK
+ | GDK_KEY_RELEASE_MASK)
+ | gtk_widget_get_events (widget);
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+
+ icon_bar->priv->bin_window = gdk_window_new (widget->window,
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (icon_bar->priv->bin_window, widget);
+
+ widget->style = gtk_style_attach (widget->style, widget->window);
+ gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
+ gdk_window_set_background (icon_bar->priv->bin_window, &widget->style->base[widget->state]);
+ gdk_window_show (icon_bar->priv->bin_window);
+}
+
+
+
+static void
+rstto_icon_bar_unrealize (GtkWidget *widget)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+
+ gdk_window_set_user_data (icon_bar->priv->bin_window, NULL);
+ gdk_window_destroy (icon_bar->priv->bin_window);
+ icon_bar->priv->bin_window = NULL;
+
+ /* GtkWidget::unrealize destroys children and widget->window */
+ (*GTK_WIDGET_CLASS (rstto_icon_bar_parent_class)->unrealize) (widget);
+}
+
+
+
+static void
+rstto_icon_bar_size_request (
+ GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ RsttoIconBarItem *item;
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ GList *lp;
+ gint n = 0;
+ gint max_width = 0;
+ gint max_height = 0;
+
+ if (!RSTTO_ICON_BAR_VALID_MODEL_AND_COLUMNS (icon_bar)
+ || icon_bar->priv->items == NULL)
+ {
+ icon_bar->priv->width = requisition->width = 0;
+ icon_bar->priv->height = requisition->height = 0;
+ return;
+ }
+
+ /* calculate max item size */
+ for (lp = icon_bar->priv->items; lp != NULL; ++n, lp = lp->next)
+ {
+ item = lp->data;
+ rstto_icon_bar_calculate_item_size (icon_bar, item);
+ if (item->width > max_width)
+ max_width = item->width;
+ if (item->height > max_height)
+ max_height = item->height;
+ }
+
+ icon_bar->priv->item_width = max_width;
+ icon_bar->priv->item_height = max_height;
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ icon_bar->priv->width = requisition->width = icon_bar->priv->item_width;
+ icon_bar->priv->height = requisition->height = icon_bar->priv->item_height * n;
+ }
+ else
+ {
+ icon_bar->priv->width = requisition->width = icon_bar->priv->item_width * n;
+ icon_bar->priv->height = requisition->height = icon_bar->priv->item_height;
+ }
+}
+
+
+
+static void
+rstto_icon_bar_size_allocate (
+ GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ gdouble value = 0.0;
+ gdouble page_size = 0.0;
+
+ widget->allocation = *allocation;
+
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ gdk_window_move_resize (widget->window,
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height);
+ gdk_window_resize (icon_bar->priv->bin_window,
+ MAX (icon_bar->priv->width, allocation->width),
+ MAX (icon_bar->priv->height, allocation->height));
+ }
+
+ icon_bar->priv->hadjustment->page_size = allocation->width;
+ icon_bar->priv->hadjustment->page_increment = allocation->width * 0.9;
+ icon_bar->priv->hadjustment->step_increment = allocation->width * 0.1;
+ icon_bar->priv->hadjustment->lower = 0;
+ icon_bar->priv->hadjustment->upper = MAX (allocation->width, icon_bar->priv->width);
+
+ icon_bar->priv->vadjustment->page_size = allocation->height;
+ icon_bar->priv->vadjustment->page_increment = allocation->height * 0.9;
+ icon_bar->priv->vadjustment->step_increment = allocation->height * 0.1;
+ icon_bar->priv->vadjustment->lower = 0;
+ icon_bar->priv->vadjustment->upper = MAX (allocation->height, icon_bar->priv->height);
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ icon_bar->priv->width = allocation->width;
+ icon_bar->priv->item_width = icon_bar->priv->width;
+ icon_bar->priv->hadjustment->value = 0;
+
+ /* If auto-center is true, center the selected item */
+ if (icon_bar->priv->auto_center == TRUE)
+ {
+ page_size = gtk_adjustment_get_page_size (icon_bar->priv->vadjustment);
+ value = icon_bar->priv->active_item->index * icon_bar->priv->item_height - ((page_size-icon_bar->priv->item_height)/2);
+
+ if (value > (gtk_adjustment_get_upper (icon_bar->priv->vadjustment)-page_size))
+ value = (gtk_adjustment_get_upper (icon_bar->priv->vadjustment)-page_size);
+
+ gtk_adjustment_set_value (icon_bar->priv->vadjustment, value);
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->vadjustment);
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->hadjustment);
+ }
+ else
+ {
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->hadjustment);
+ }
+ }
+ else
+ {
+ icon_bar->priv->height = allocation->height;
+ icon_bar->priv->item_height = icon_bar->priv->height;
+ icon_bar->priv->vadjustment->value = 0;
+
+ /* If auto-center is true, center the selected item */
+ if (icon_bar->priv->auto_center == TRUE)
+ {
+ page_size = gtk_adjustment_get_page_size (icon_bar->priv->hadjustment);
+ value = icon_bar->priv->active_item->index * icon_bar->priv->item_width - ((page_size-icon_bar->priv->item_width)/2);
+
+ if (value > (gtk_adjustment_get_upper (icon_bar->priv->hadjustment)-page_size))
+ value = (gtk_adjustment_get_upper (icon_bar->priv->hadjustment)-page_size);
+
+ gtk_adjustment_set_value (icon_bar->priv->hadjustment, value);
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->vadjustment);
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->hadjustment);
+ }
+ else
+ {
+ rstto_icon_bar_adjustment_changed (icon_bar, icon_bar->priv->vadjustment);
+ }
+ }
+}
+
+
+
+static gboolean
+rstto_icon_bar_expose (
+ GtkWidget *widget,
+ GdkEventExpose *expose)
+{
+ RsttoIconBarItem *item;
+ GdkRectangle area;
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ GList *lp;
+
+ if (expose->window != icon_bar->priv->bin_window)
+ return FALSE;
+
+ for (lp = icon_bar->priv->items; lp != NULL; lp = lp->next)
+ {
+ item = lp->data;
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ area.x = 0;
+ area.y = item->index * icon_bar->priv->item_height;
+ }
+ else
+ {
+ area.x = item->index * icon_bar->priv->item_width;
+ area.y = 0;
+ }
+
+ area.width = icon_bar->priv->item_width;
+ area.height = icon_bar->priv->item_height;
+
+ if (gdk_region_rect_in (expose->region, &area) != GDK_OVERLAP_RECTANGLE_OUT)
+ rstto_icon_bar_paint_item (icon_bar, item, &expose->area);
+ }
+
+ return TRUE;
+}
+
+
+
+static gboolean
+rstto_icon_bar_leave (
+ GtkWidget *widget,
+ GdkEventCrossing *event)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+
+ if (icon_bar->priv->cursor_item != NULL)
+ {
+ rstto_icon_bar_queue_draw_item (icon_bar, icon_bar->priv->cursor_item);
+ icon_bar->priv->cursor_item = NULL;
+ }
+
+ return FALSE;
+}
+
+
+
+static gboolean
+rstto_icon_bar_motion (
+ GtkWidget *widget,
+ GdkEventMotion *event)
+{
+ RsttoIconBarItem *item;
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ RsttoFile *file;
+
+ item = rstto_icon_bar_get_item_at_pos (icon_bar, event->x, event->y);
+ if (item != NULL && icon_bar->priv->cursor_item != item)
+ {
+ if (icon_bar->priv->cursor_item != NULL)
+ rstto_icon_bar_queue_draw_item (icon_bar, icon_bar->priv->cursor_item);
+ icon_bar->priv->cursor_item = item;
+ rstto_icon_bar_queue_draw_item (icon_bar, item);
+
+ iter = item->iter;
+ gtk_tree_model_get (icon_bar->priv->model, &iter,
+ icon_bar->priv->file_column, &file,
+ -1);
+
+ gtk_widget_trigger_tooltip_query (widget);
+ }
+ else if (icon_bar->priv->cursor_item != NULL
+ && icon_bar->priv->cursor_item != item)
+ {
+ rstto_icon_bar_queue_draw_item (icon_bar, icon_bar->priv->cursor_item);
+ icon_bar->priv->cursor_item = NULL;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+rstto_icon_bar_scroll (
+ GtkWidget *widget,
+ GdkEventScroll *event)
+{
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
+ GtkAdjustment *adjustment = NULL;
+ gdouble val = 0;
+ gdouble step_size = 0;
+ gdouble max_value = 0;
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ adjustment = icon_bar->priv->vadjustment;
+ step_size = icon_bar->priv->item_height / 2;
+ }
+ else
+ {
+ adjustment = icon_bar->priv->hadjustment;
+ step_size = icon_bar->priv->item_width / 2;
+ }
+
+ val = gtk_adjustment_get_value (adjustment);
+ max_value = gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_page_size (adjustment);
+
+ switch (event->direction)
+ {
+ case GDK_SCROLL_UP:
+ case GDK_SCROLL_LEFT:
+ val-=step_size;
+ if (val<0) val = 0.0;
+ break;
+ case GDK_SCROLL_DOWN:
+ case GDK_SCROLL_RIGHT:
+ val+=step_size;
+ if (val > max_value) val = max_value;
+ break;
+ }
+ gtk_adjustment_set_value (adjustment, val);
+ return TRUE;
+}
+
+static gboolean
+rstto_icon_bar_button_press (
+ GtkWidget *widget,
+ GdkEventButton *event)
+{
+ RsttoIconBar *icon_bar;
+ RsttoIconBarItem *item;
+
+ icon_bar = RSTTO_ICON_BAR (widget);
+
+ if (G_UNLIKELY (!GTK_WIDGET_HAS_FOCUS (widget)))
+ gtk_widget_grab_focus (widget);
+
+ if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
+ {
+ item = rstto_icon_bar_get_item_at_pos (icon_bar, event->x, event->y);
+ icon_bar->priv->single_click_item = item;
+ }
+ return TRUE;
+}
+
+static gboolean
+rstto_icon_bar_button_release (
+ GtkWidget *widget,
+ GdkEventButton *event)
+{
+ RsttoIconBar *icon_bar;
+ RsttoIconBarItem *item;
+
+ icon_bar = RSTTO_ICON_BAR (widget);
+
+ if (event->button == 1 && event->type == GDK_BUTTON_RELEASE)
+ {
+ item = rstto_icon_bar_get_item_at_pos (icon_bar, event->x, event->y);
+ if (G_LIKELY (item != NULL && item != icon_bar->priv->active_item && item == icon_bar->priv->single_click_item))
+ rstto_icon_bar_set_active (icon_bar, item->index);
+ }
+ return TRUE;
+}
+
+
+static void
+rstto_icon_bar_set_adjustments (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj)
+{
+ gboolean need_adjust = FALSE;
+
+ if (hadj != NULL)
+ g_return_if_fail (GTK_IS_ADJUSTMENT (hadj));
+ else
+ hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
+
+ if (vadj != NULL)
+ g_return_if_fail (GTK_IS_ADJUSTMENT (vadj));
+ else
+ vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
+
+ if (icon_bar->priv->hadjustment && (icon_bar->priv->hadjustment != hadj))
+ {
+ g_signal_handlers_disconnect_matched (icon_bar->priv->hadjustment, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, icon_bar);
+ g_object_unref (icon_bar->priv->hadjustment);
+ }
+
+ if (icon_bar->priv->vadjustment && (icon_bar->priv->vadjustment != vadj))
+ {
+ g_signal_handlers_disconnect_matched (icon_bar->priv->vadjustment, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, icon_bar);
+ g_object_unref (icon_bar->priv->vadjustment);
+ }
+
+ if (icon_bar->priv->hadjustment != hadj)
+ {
+ icon_bar->priv->hadjustment = hadj;
+ g_object_ref (icon_bar->priv->hadjustment);
+ gtk_object_sink (GTK_OBJECT (icon_bar->priv->hadjustment));
+
+ g_signal_connect (icon_bar->priv->hadjustment, "value_changed",
+ G_CALLBACK (cb_rstto_icon_bar_adjustment_value_changed), icon_bar);
+ need_adjust = TRUE;
+ }
+
+ if (icon_bar->priv->vadjustment != vadj)
+ {
+ icon_bar->priv->vadjustment = vadj;
+ g_object_ref (icon_bar->priv->vadjustment);
+ gtk_object_sink (GTK_OBJECT (icon_bar->priv->vadjustment));
+
+ g_signal_connect (icon_bar->priv->vadjustment, "value_changed",
+ G_CALLBACK (cb_rstto_icon_bar_adjustment_value_changed), icon_bar);
+ need_adjust = TRUE;
+ }
+
+ if (need_adjust)
+ cb_rstto_icon_bar_adjustment_value_changed (NULL, icon_bar);
+}
+
+
+
+static void
+cb_rstto_icon_bar_adjustment_value_changed (
+ GtkAdjustment *adjustment,
+ RsttoIconBar *icon_bar)
+{
+ if (GTK_WIDGET_REALIZED (icon_bar))
+ {
+ /* Set auto_center to false, this should be the default behaviour
+ * in case a user changes the value of the adjustments.
+ *
+ * If the value is set internally, and auto-center was enabled
+ * the function calling gtk_adjustment_value_changed should set
+ * auto_center to TRUE afterwards.
+ */
+ icon_bar->priv->auto_center = FALSE;
+
+ gdk_window_move (icon_bar->priv->bin_window,
+ - icon_bar->priv->hadjustment->value,
+ - icon_bar->priv->vadjustment->value);
+
+ gdk_window_process_updates (icon_bar->priv->bin_window, TRUE);
+ }
+}
+
+static void
+rstto_icon_bar_invalidate (RsttoIconBar *icon_bar)
+{
+ g_list_foreach (icon_bar->priv->items, (GFunc) rstto_icon_bar_item_invalidate, NULL);
+
+ gtk_widget_queue_resize (GTK_WIDGET (icon_bar));
+}
+
+static RsttoIconBarItem*
+rstto_icon_bar_get_item_at_pos (
+ RsttoIconBar *icon_bar,
+ gint x,
+ gint y)
+{
+ GList *lp;
+
+ if (G_UNLIKELY (icon_bar->priv->item_height == 0))
+ return NULL;
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ lp = g_list_nth (icon_bar->priv->items, y / icon_bar->priv->item_height);
+ else
+ lp = g_list_nth (icon_bar->priv->items, x / icon_bar->priv->item_width);
+
+ return (lp != NULL) ? lp->data : NULL;
+}
+
+
+
+static void
+rstto_icon_bar_queue_draw_item (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item)
+{
+ GdkRectangle area;
+
+ if (GTK_WIDGET_REALIZED (icon_bar))
+ {
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ area.x = 0;
+ area.y = icon_bar->priv->item_height * item->index;
+ }
+ else
+ {
+ area.x = icon_bar->priv->item_width * item->index;
+ area.y = 0;
+ }
+
+ area.width = icon_bar->priv->item_width;
+ area.height = icon_bar->priv->item_height;
+
+ gdk_window_invalidate_rect (icon_bar->priv->bin_window, &area, TRUE);
+ }
+}
+
+
+
+static void
+rstto_icon_bar_paint_item (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item,
+ GdkRectangle *area)
+{
+ const GdkPixbuf *pixbuf = NULL;
+ GdkColor *border_color;
+ GdkColor *fill_color;
+ GdkColor *text_color;
+ GdkGC *gc;
+ gint focus_width;
+ gint focus_pad;
+ gint x, y;
+ gint px, py;
+ gint pixbuf_height, pixbuf_width;
+ const gchar *thumbnail_path;
+ RsttoFile *file;
+ GtkTreeIter iter;
+
+ if (!RSTTO_ICON_BAR_VALID_MODEL_AND_COLUMNS (icon_bar))
+ return;
+
+ gtk_widget_style_get (GTK_WIDGET (icon_bar),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_pad,
+ NULL);
+
+ iter = item->iter;
+ gtk_tree_model_get (icon_bar->priv->model, &iter,
+ icon_bar->priv->file_column, &file,
+ -1);
+
+ pixbuf = rstto_file_get_thumbnail (file, icon_bar->priv->thumbnail_size);
+
+ if (NULL == pixbuf)
+ {
+ pixbuf = thumbnail_missing;
+ }
+
+ if (pixbuf)
+ {
+ pixbuf_width = gdk_pixbuf_get_width (pixbuf);
+ pixbuf_height = gdk_pixbuf_get_height (pixbuf);
+ }
+
+ /* calculate pixbuf/layout location */
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ x = 0;
+ y = icon_bar->priv->item_height * item->index;
+
+ px = (icon_bar->priv->item_width - pixbuf_width) / 2;
+ py = (icon_bar->priv->item_height - pixbuf_height) / 2 + icon_bar->priv->item_height * item->index;
+ }
+ else
+ {
+ x = icon_bar->priv->item_width * item->index;
+ y = 0;
+
+ px = (icon_bar->priv->item_width - pixbuf_width) / 2 + icon_bar->priv->item_width * item->index;
+ py = (icon_bar->priv->item_height - pixbuf_height) / 2;
+ }
+
+ if (icon_bar->priv->active_item == item)
+ {
+ gtk_widget_style_get (GTK_WIDGET (icon_bar),
+ "active-item-fill-color", &fill_color,
+ "active-item-border-color", &border_color,
+ NULL);
+
+ if (fill_color == NULL)
+ {
+ fill_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ gdk_color_parse ("#c1d2ee", fill_color);
+ }
+
+ if (border_color == NULL)
+ {
+ border_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ gdk_color_parse ("#316ac5", border_color);
+ }
+
+ gc = gdk_gc_new (icon_bar->priv->bin_window);
+ gdk_gc_set_clip_rectangle (gc, area);
+ gdk_gc_set_rgb_fg_color (gc, fill_color);
+ gdk_draw_rectangle (icon_bar->priv->bin_window, gc, TRUE,
+ x + focus_pad + focus_width,
+ y + focus_pad + focus_width,
+ icon_bar->priv->item_width - 2 * (focus_width + focus_pad),
+ icon_bar->priv->item_height - 2 * (focus_width + focus_pad));
+ gdk_gc_set_rgb_fg_color (gc, border_color);
+ gdk_gc_set_line_attributes (gc, focus_width, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
+ gdk_draw_rectangle (icon_bar->priv->bin_window, gc, FALSE,
+ x + focus_pad + focus_width / 2,
+ y + focus_pad + focus_width / 2,
+ icon_bar->priv->item_width - (2 * focus_pad + focus_width),
+ icon_bar->priv->item_height - (2 * focus_pad + focus_width));
+ gdk_color_free (border_color);
+ gdk_color_free (fill_color);
+ g_object_unref (gc);
+ }
+ else if (icon_bar->priv->cursor_item == item)
+ {
+ gtk_widget_style_get (GTK_WIDGET (icon_bar),
+ "cursor-item-fill-color", &fill_color,
+ "cursor-item-border-color", &border_color,
+ NULL);
+
+ if (fill_color == NULL)
+ {
+ fill_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ gdk_color_parse ("#e0e8f6", fill_color);
+ }
+
+ if (border_color == NULL)
+ {
+ border_color = gdk_color_copy (>K_WIDGET (icon_bar)->style->base[GTK_STATE_SELECTED]);
+ gdk_color_parse ("#98b4e2", border_color);
+ }
+
+ gc = gdk_gc_new (icon_bar->priv->bin_window);
+ gdk_gc_set_clip_rectangle (gc, area);
+ gdk_gc_set_rgb_fg_color (gc, fill_color);
+ gdk_draw_rectangle (icon_bar->priv->bin_window, gc, TRUE,
+ x + focus_pad + focus_width,
+ y + focus_pad + focus_width,
+ icon_bar->priv->item_width - 2 * (focus_width + focus_pad),
+ icon_bar->priv->item_height - 2 * (focus_width + focus_pad));
+ gdk_gc_set_rgb_fg_color (gc, border_color);
+ gdk_gc_set_line_attributes (gc, focus_width, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
+ gdk_draw_rectangle (icon_bar->priv->bin_window, gc, FALSE,
+ x + focus_pad + focus_width / 2,
+ y + focus_pad + focus_width / 2,
+ icon_bar->priv->item_width - (2 * focus_pad + focus_width),
+ icon_bar->priv->item_height - (2 * focus_pad + focus_width));
+ gdk_color_free (border_color);
+ gdk_color_free (fill_color);
+ g_object_unref (gc);
+ }
+
+
+ if (NULL != pixbuf)
+ {
+ gdk_draw_pixbuf (icon_bar->priv->bin_window, NULL, pixbuf, 0, 0,
+ px, py,
+ pixbuf_width, pixbuf_height,
+ GDK_RGB_DITHER_NORMAL,
+ pixbuf_width, pixbuf_height);
+ }
+}
+
+
+
+static void
+rstto_icon_bar_calculate_item_size (
+ RsttoIconBar *icon_bar,
+ RsttoIconBarItem *item)
+{
+ GdkPixbuf *pixbuf;
+ gint focus_width;
+ gint focus_pad;
+ gint int_pad;
+
+ if (G_LIKELY (item->width != -1 && item->width != -1))
+ return;
+
+ gtk_widget_style_get (GTK_WIDGET (icon_bar),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_pad,
+ NULL);
+ int_pad = focus_pad;
+
+ switch (icon_bar->priv->thumbnail_size)
+ {
+ case THUMBNAIL_SIZE_VERY_SMALL:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_VERY_SMALL_SIZE;
+ break;
+ case THUMBNAIL_SIZE_SMALLER:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_SMALLER_SIZE;
+ break;
+ case THUMBNAIL_SIZE_SMALL:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_SMALL_SIZE;
+ break;
+ case THUMBNAIL_SIZE_NORMAL:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_NORMAL_SIZE;
+ break;
+ case THUMBNAIL_SIZE_LARGE:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_LARGE_SIZE;
+ break;
+ case THUMBNAIL_SIZE_LARGER:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_LARGER_SIZE;
+ break;
+ case THUMBNAIL_SIZE_VERY_LARGE:
+ item->width = (2 * (int_pad + focus_width + focus_pad)) + THUMBNAIL_SIZE_VERY_LARGE_SIZE;
+ break;
+ }
+
+ item->height = item->width;
+}
+
+static RsttoIconBarItem *
+rstto_icon_bar_item_new (void)
+{
+ RsttoIconBarItem *item;
+
+ item = g_slice_new0 (RsttoIconBarItem);
+ item->width = -1;
+ item->height = -1;
+
+ return item;
+}
+
+
+
+static void
+rstto_icon_bar_item_free (RsttoIconBarItem *item)
+{
+ g_slice_free (RsttoIconBarItem, item);
+}
+
+
+
+static void
+rstto_icon_bar_item_invalidate (RsttoIconBarItem *item)
+{
+ item->width = -1;
+ item->height = -1;
+}
+
+
+
+static void
+rstto_icon_bar_build_items (RsttoIconBar *icon_bar)
+{
+ RsttoIconBarItem *item;
+ GtkTreeIter iter;
+ GList *items = NULL;
+ gint i = 0;
+
+ if (!gtk_tree_model_get_iter_first (icon_bar->priv->model, &iter))
+ return;
+
+ do
+ {
+ item = rstto_icon_bar_item_new ();
+ item->iter = iter;
+ item->index = i++;
+
+ items = g_list_prepend (items, item);
+ }
+ while (gtk_tree_model_iter_next (icon_bar->priv->model, &iter));
+
+ icon_bar->priv->items = g_list_reverse (items);
+}
+
+
+
+static void
+rstto_icon_bar_row_changed (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ RsttoIconBar *icon_bar)
+{
+ RsttoIconBarItem *item;
+ gint idx;
+
+ idx = gtk_tree_path_get_indices (path)[0];
+ item = g_list_nth (icon_bar->priv->items, idx)->data;
+ rstto_icon_bar_item_invalidate (item);
+ gtk_widget_queue_resize (GTK_WIDGET (icon_bar));
+}
+
+
+
+static void
+rstto_icon_bar_row_inserted (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ RsttoIconBar *icon_bar)
+{
+ RsttoIconBarItem *item;
+ GList *lp;
+ gint idx;
+
+ idx = gtk_tree_path_get_indices (path)[0];
+ item = rstto_icon_bar_item_new ();
+
+ if ((gtk_tree_model_get_flags (icon_bar->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST) != 0)
+ item->iter = *iter;
+ item->index = idx;
+
+ icon_bar->priv->items = g_list_insert (icon_bar->priv->items, item, idx);
+
+ for (lp = g_list_nth (icon_bar->priv->items, idx + 1); lp != NULL; lp = lp->next)
+ {
+ item = lp->data;
+ item->index++;
+ }
+
+ gtk_widget_queue_resize (GTK_WIDGET (icon_bar));
+}
+
+
+
+static void
+rstto_icon_bar_row_deleted (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ RsttoIconBar *icon_bar)
+{
+ RsttoIconBarItem *item;
+ gboolean active = FALSE;
+ GList *lnext;
+ GList *lp;
+ gint idx;
+
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+
+ idx = gtk_tree_path_get_indices (path)[0];
+ lp = g_list_nth (icon_bar->priv->items, idx);
+ item = lp->data;
+
+ if (item == icon_bar->priv->active_item)
+ {
+ icon_bar->priv->active_item = NULL;
+ active = TRUE;
+ }
+
+ if (item == icon_bar->priv->cursor_item)
+ icon_bar->priv->cursor_item = NULL;
+
+ rstto_icon_bar_item_free (item);
+
+ for (lnext = lp->next; lnext != NULL; lnext = lnext->next)
+ {
+ item = lnext->data;
+ item->index--;
+ }
+
+ icon_bar->priv->items = g_list_delete_link (icon_bar->priv->items, lp);
+
+ if (active && icon_bar->priv->items != NULL)
+ icon_bar->priv->active_item = icon_bar->priv->items->data;
+
+ gtk_widget_queue_resize (GTK_WIDGET (icon_bar));
+
+ if (active)
+ rstto_icon_bar_set_active (icon_bar, -1);
+}
+
+
+static void
+rstto_icon_bar_rows_reordered (
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gint *new_order,
+ RsttoIconBar *icon_bar)
+{
+ RsttoIconBarItem **item_array;
+ GList *items = NULL;
+ GList *lp;
+ gint *inverted_order;
+ gint length;
+ gint i;
+
+ length = gtk_tree_model_iter_n_children (model, NULL);
+ inverted_order = g_newa (gint, length);
+
+ /* invert the array */
+ for (i = 0; i < length; ++i)
+ inverted_order[new_order[i]] = i;
+
+ item_array = g_newa (RsttoIconBarItem *, length);
+ for (i = 0, lp = icon_bar->priv->items; lp != NULL; ++i, lp = lp->next)
+ item_array[inverted_order[i]] = lp->data;
+
+ for (i = 0; i < length; ++i)
+ {
+ item_array[i]->index = i;
+ items = g_list_append (items, item_array[i]);
+ }
+
+ g_list_free (icon_bar->priv->items);
+ icon_bar->priv->items = g_list_reverse (items);
+ if (icon_bar->priv->auto_center)
+ {
+ rstto_icon_bar_show_active (icon_bar);
+ icon_bar->priv->auto_center = TRUE;
+ }
+
+ gtk_widget_queue_draw (GTK_WIDGET (icon_bar));
+}
+
+
+
+/**
+ * rstto_icon_bar_new:
+ *
+ * Creates a new #RsttoIconBar without model.
+ *
+ * Returns: a newly allocated #RsttoIconBar.
+ **/
+GtkWidget *
+rstto_icon_bar_new (void)
+{
+ return g_object_new (RSTTO_TYPE_ICON_BAR, NULL);
+}
+
+
+
+/**
+ * rstto_icon_bar_new_with_model:
+ * @model : A #GtkTreeModel.
+ *
+ * Creates a new #RsttoIconBar and associates it with
+ * @model.
+ *
+ * Returns: a newly allocated #RsttoIconBar, which is associated with @model.
+ **/
+GtkWidget *
+rstto_icon_bar_new_with_model (GtkTreeModel *model)
+{
+ g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
+
+ return g_object_new (RSTTO_TYPE_ICON_BAR,
+ "model", model,
+ NULL);
+}
+
+
+
+/**
+ * rstto_icon_bar_get_model:
+ * @icon_bar : A #RsttoIconBar.
+ *
+ * Returns the model the #RsttoIconBar is based on. Returns %NULL if
+ * the model is unset.
+ *
+ * Returns: A #GtkTreeModel, or %NULL if none is currently being used.
+ **/
+GtkTreeModel*
+rstto_icon_bar_get_model (RsttoIconBar *icon_bar)
+{
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), NULL);
+ return icon_bar->priv->model;
+}
+
+
+
+/**
+ * rstto_icon_bar_set_model:
+ * @icon_bar : A #RsttoIconBar.
+ * @model : A #GtkTreeModel or %NULL.
+ *
+ * Sets the model for a #RsttoIconBar. If the @icon_bar already has a model
+ * set, it will remove it before settings the new model. If @model is %NULL,
+ * then it will unset the old model.
+ **/
+void
+rstto_icon_bar_set_model (
+ RsttoIconBar *icon_bar,
+ GtkTreeModel *model)
+{
+ GType file_column_type;
+ gint active = -1;
+
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+ g_return_if_fail (GTK_IS_TREE_MODEL (model) || model == NULL);
+
+ if (G_UNLIKELY (model == icon_bar->priv->model))
+ return;
+
+ if (model != NULL)
+ {
+ g_return_if_fail (gtk_tree_model_get_flags (model) & GTK_TREE_MODEL_LIST_ONLY);
+
+ if (icon_bar->priv->file_column != -1)
+ {
+ file_column_type = gtk_tree_model_get_column_type (model, icon_bar->priv->file_column);
+ g_return_if_fail (file_column_type == RSTTO_TYPE_FILE);
+ }
+ }
+
+ if (icon_bar->priv->model)
+ {
+ g_signal_handlers_disconnect_by_func (icon_bar->priv->model,
+ rstto_icon_bar_row_changed,
+ icon_bar);
+ g_signal_handlers_disconnect_by_func (icon_bar->priv->model,
+ rstto_icon_bar_row_inserted,
+ icon_bar);
+ g_signal_handlers_disconnect_by_func (icon_bar->priv->model,
+ rstto_icon_bar_row_deleted,
+ icon_bar);
+ g_signal_handlers_disconnect_by_func (icon_bar->priv->model,
+ rstto_icon_bar_rows_reordered,
+ icon_bar);
+
+ g_object_unref (G_OBJECT (icon_bar->priv->model));
+
+ g_list_foreach (icon_bar->priv->items, (GFunc) rstto_icon_bar_item_free, NULL);
+ g_list_free (icon_bar->priv->items);
+ icon_bar->priv->active_item = NULL;
+ icon_bar->priv->cursor_item = NULL;
+ icon_bar->priv->items = NULL;
+ }
+
+ icon_bar->priv->model = model;
+
+ if (model != NULL)
+ {
+ g_object_ref (G_OBJECT (model));
+
+ g_signal_connect (G_OBJECT (model), "row-changed",
+ G_CALLBACK (rstto_icon_bar_row_changed), icon_bar);
+ g_signal_connect (G_OBJECT (model), "row-inserted",
+ G_CALLBACK (rstto_icon_bar_row_inserted), icon_bar);
+ g_signal_connect (G_OBJECT (model), "row-deleted",
+ G_CALLBACK (rstto_icon_bar_row_deleted), icon_bar);
+ g_signal_connect (G_OBJECT (model), "rows-reordered",
+ G_CALLBACK (rstto_icon_bar_rows_reordered), icon_bar);
+
+ rstto_icon_bar_build_items (icon_bar);
+
+ if (icon_bar->priv->items != NULL)
+ active = ((RsttoIconBarItem *) icon_bar->priv->items->data)->index;
+ }
+
+ rstto_icon_bar_invalidate (icon_bar);
+
+ g_object_notify (G_OBJECT (icon_bar), "model");
+
+ rstto_icon_bar_set_active (icon_bar, active);
+}
+
+
+/**
+ * rstto_icon_bar_get_file_column:
+ * @icon_bar : An #RsttoIconBar.
+ *
+ * Returns the column with file for @icon_bar.
+ *
+ * Returns: the file column, or -1 if it's unset.
+ **/
+gint
+rstto_icon_bar_get_file_column (RsttoIconBar *icon_bar)
+{
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), -1);
+ return icon_bar->priv->file_column;
+}
+
+
+
+/**
+ * rstto_icon_bar_set_file_column:
+ * @icon_bar : An #RsttoIconBar.
+ * @column : A column in the currently used model or -1 to
+ * use no text in @icon_bar.
+ *
+ * Sets the column with text for @icon_bar to be @column. The
+ * text column must be of type #G_TYPE_STRING.
+ **/
+void
+rstto_icon_bar_set_file_column (
+ RsttoIconBar *icon_bar,
+ gint column)
+{
+ GType file_column_type;
+
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+
+ if (column == icon_bar->priv->file_column)
+ return;
+
+ if (column == -1)
+ {
+ icon_bar->priv->file_column = -1;
+ }
+ else
+ {
+ if (icon_bar->priv->model != NULL)
+ {
+ file_column_type = gtk_tree_model_get_column_type (icon_bar->priv->model, column);
+ g_return_if_fail (file_column_type == RSTTO_TYPE_FILE);
+ }
+
+ icon_bar->priv->file_column = column;
+ }
+
+ rstto_icon_bar_invalidate (icon_bar);
+
+ g_object_notify (G_OBJECT (icon_bar), "file-column");
+}
+
+
+
+/**
+ * rstto_icon_bar_get_orientation:
+ * @icon_bar : An #RsttoIconBar.
+ *
+ * Retrieves the current orientation of the toolbar. See
+ * rstto_icon_bar_set_orientation().
+ *
+ * Returns: The orientation of @icon_bar.
+ **/
+GtkOrientation
+rstto_icon_bar_get_orientation (RsttoIconBar *icon_bar)
+{
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), GTK_ORIENTATION_VERTICAL);
+ return icon_bar->priv->orientation;
+}
+
+
+
+/**
+ * rstto_icon_bar_set_orientation:
+ * @icon_bar : An #RsttoIconBar.
+ * @orientation : A new #GtkOrientation.
+ *
+ * Sets whether the @icon_bar should appear horizontally
+ * or vertically.
+ **/
+void
+rstto_icon_bar_set_orientation (
+ RsttoIconBar *icon_bar,
+ GtkOrientation orientation)
+{
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+
+ if (icon_bar->priv->orientation != orientation)
+ {
+ /* Unset the cursor-item */
+ icon_bar->priv->cursor_item = NULL;
+
+ icon_bar->priv->orientation = orientation;
+ gtk_widget_queue_resize (GTK_WIDGET (icon_bar));
+
+ /* If the orientation changes, focus the active item */
+ rstto_icon_bar_show_active (icon_bar);
+
+ g_object_notify (G_OBJECT (icon_bar), "orientation");
+ }
+}
+
+
+
+/**
+ * rstto_icon_bar_get_active:
+ * @icon_bar : An #RsttoIconBar.
+ *
+ * Returns the index of the currently active item, or -1 if there's no
+ * active item.
+ *
+ * Returns: An integer which is the index of the currently active item,
+ * or -1 if there's no active item.
+ **/
+gint
+rstto_icon_bar_get_active (RsttoIconBar *icon_bar)
+{
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), -1);
+
+ return (icon_bar->priv->active_item != NULL)
+ ? icon_bar->priv->active_item->index
+ : -1;
+}
+
+
+
+/**
+ * rstto_icon_bar_set_active:
+ * @icon_bar : An #RsttoIconBar.
+ * @idx : An index in the model passed during construction,
+ * or -1 to have no active item.
+ *
+ * Sets the active item of @icon_bar to be the item at @idx.
+ **/
+void
+rstto_icon_bar_set_active (
+ RsttoIconBar *icon_bar,
+ gint idx)
+{
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+ g_return_if_fail (idx == -1 || g_list_nth (icon_bar->priv->items, idx) != NULL);
+
+ if ((icon_bar->priv->active_item == NULL && idx == -1)
+ || (icon_bar->priv->active_item != NULL && idx == icon_bar->priv->active_item->index))
+ return;
+
+ if (G_UNLIKELY (idx >= 0))
+ icon_bar->priv->active_item = g_list_nth (icon_bar->priv->items, idx)->data;
+ else
+ icon_bar->priv->active_item = NULL;
+
+ g_signal_emit (G_OBJECT (icon_bar), icon_bar_signals[SELECTION_CHANGED], 0);
+ g_object_notify (G_OBJECT (icon_bar), "active");
+ gtk_widget_queue_draw (GTK_WIDGET (icon_bar));
+}
+
+
+
+/**
+ * rstto_icon_bar_get_active_iter:
+ * @icon_bar : An #RsttoIconBar.
+ * @iter : An uninitialized #GtkTreeIter.
+ *
+ * Sets @iter to point to the current active item, if it exists.
+ *
+ * Returns: %TRUE if @iter was set.
+ **/
+gboolean
+rstto_icon_bar_get_active_iter (
+ RsttoIconBar *icon_bar,
+ GtkTreeIter *iter)
+{
+ RsttoIconBarItem *item;
+ GtkTreePath *path;
+
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), FALSE);
+ g_return_val_if_fail (iter != NULL, FALSE);
+
+ item = icon_bar->priv->active_item;
+ if (item == NULL)
+ return FALSE;
+
+ if ((gtk_tree_model_get_flags (icon_bar->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST) == 0)
+ {
+ path = gtk_tree_path_new_from_indices (item->index, -1);
+ gtk_tree_model_get_iter (icon_bar->priv->model, iter, path);
+ gtk_tree_path_free (path);
+ }
+ else
+ {
+ *iter = item->iter;
+ }
+
+ return TRUE;
+}
+
+
+
+/**
+ * rstto_icon_bar_set_active_iter:
+ * @icon_bar : An #RsttoIconBar.
+ * @iter : The #GtkTreeIter.
+ *
+ * Sets the current active item to be the one referenced by @iter. @iter
+ * must correspond to a path of depth one.
+ *
+ * This can only be called if @icon_bar is associated with #GtkTreeModel.
+ **/
+void
+rstto_icon_bar_set_active_iter (
+ RsttoIconBar *icon_bar,
+ GtkTreeIter *iter)
+{
+ GtkTreePath *path;
+
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+ g_return_if_fail (icon_bar->priv->model != NULL);
+ g_return_if_fail (iter != NULL);
+
+ path = gtk_tree_model_get_path (icon_bar->priv->model, iter);
+ if (G_LIKELY (path != NULL))
+ {
+ rstto_icon_bar_set_active (icon_bar, gtk_tree_path_get_indices (path)[0]);
+ gtk_tree_path_free (path);
+ }
+}
+
+gint
+rstto_icon_bar_get_item_width (RsttoIconBar *icon_bar)
+{
+ return -1;
+}
+
+void
+rstto_icon_bar_set_item_width (
+ RsttoIconBar *icon_bar,
+ gint item_width)
+{
+ pango_layout_set_width (icon_bar->priv->layout,
+ item_width*PANGO_SCALE);
+ return;
+}
+
+/**
+ * rstto_icon_bar_set_show_text:
+ * @icon_bar : An #RsttoIconBar.
+ * @show_text : TRUE if text should be visible
+ * or FALSE if text is hidden
+ *
+ * Toggles the visibility of the text-label
+ **/
+void
+rstto_icon_bar_set_show_text (
+ RsttoIconBar *icon_bar,
+ gboolean show_text)
+{
+ g_return_if_fail (RSTTO_IS_ICON_BAR (icon_bar));
+ icon_bar->priv->show_text = show_text;
+}
+
+/**
+ * rstto_icon_bar_get_show_text:
+ * @icon_bar : An #RsttoIconBar.
+ *
+ * Returns: TRUE if text is visible.
+ **/
+gboolean
+rstto_icon_bar_get_show_text (RsttoIconBar *icon_bar)
+{
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), FALSE);
+ return icon_bar->priv->show_text;
+}
+
+/**
+ * rstto_icon_bar_show_active:
+ * @icon_bar : An #RsttoIconBar.
+ *
+ * Returns: TRUE on success
+ **/
+gboolean
+rstto_icon_bar_show_active (RsttoIconBar *icon_bar)
+{
+ gint page_size = 0;
+ gint value = 0;
+
+ g_return_val_if_fail (RSTTO_IS_ICON_BAR (icon_bar), FALSE);
+ if (NULL == icon_bar->priv->active_item)
+ return FALSE;
+
+ icon_bar->priv->auto_center = TRUE;
+
+ if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ page_size = gtk_adjustment_get_page_size (icon_bar->priv->vadjustment);
+ value = icon_bar->priv->active_item->index * icon_bar->priv->item_height - ((page_size-icon_bar->priv->item_height)/2);
+
+ if (value > (gtk_adjustment_get_upper (icon_bar->priv->vadjustment)-page_size))
+ value = (gtk_adjustment_get_upper (icon_bar->priv->vadjustment)-page_size);
+
+ gtk_adjustment_set_value (icon_bar->priv->vadjustment, value);
+ rstto_icon_bar_adjustment_value_changed (
+ icon_bar,
+ icon_bar->priv->vadjustment);
+ return TRUE;
+ }
+ else
+ {
+ page_size = gtk_adjustment_get_page_size (icon_bar->priv->hadjustment);
+ value = icon_bar->priv->active_item->index * icon_bar->priv->item_width - ((page_size-icon_bar->priv->item_width)/2);
+
+ if (value > (gtk_adjustment_get_upper (icon_bar->priv->hadjustment)-page_size))
+ value = (gtk_adjustment_get_upper (icon_bar->priv->hadjustment)-page_size);
+
+ gtk_adjustment_set_value (icon_bar->priv->hadjustment, value);
+ rstto_icon_bar_adjustment_value_changed (
+ icon_bar,
+ icon_bar->priv->hadjustment);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+rstto_icon_bar_adjustment_changed (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *adjustment)
+{
+ if (TRUE == icon_bar->priv->auto_center)
+ {
+ gtk_adjustment_changed (adjustment);
+ icon_bar->priv->auto_center = TRUE;
+ }
+ else
+ {
+ gtk_adjustment_changed (adjustment);
+ }
+}
+
+static void
+rstto_icon_bar_adjustment_value_changed (
+ RsttoIconBar *icon_bar,
+ GtkAdjustment *adjustment)
+{
+ if (TRUE == icon_bar->priv->auto_center)
+ {
+ gtk_adjustment_value_changed (adjustment);
+ icon_bar->priv->auto_center = TRUE;
+ }
+ else
+ {
+ gtk_adjustment_value_changed (adjustment);
+ }
+}
+
+static void
+cb_rstto_thumbnail_size_changed (
+ GObject *settings,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ GValue val_thumbnail_size = { 0, };
+ RsttoIconBar *icon_bar = RSTTO_ICON_BAR (user_data);
+
+ g_value_init (&val_thumbnail_size, G_TYPE_UINT);
+
+ g_object_get_property (
+ settings,
+ "thumbnail-size",
+ &val_thumbnail_size);
+
+ icon_bar->priv->thumbnail_size = g_value_get_uint (&val_thumbnail_size);
+
+ rstto_icon_bar_invalidate (icon_bar);
+
+ rstto_icon_bar_update_missing_icon (icon_bar);
+}
+
+
+static void
+rstto_icon_bar_update_missing_icon (RsttoIconBar *icon_bar)
+{
+
+ if (NULL != thumbnail_missing)
+ {
+ g_object_unref (thumbnail_missing);
+ }
+
+ switch (icon_bar->priv->thumbnail_size)
+ {
+ case THUMBNAIL_SIZE_VERY_SMALL:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_VERY_SMALL_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_SMALLER:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_SMALLER_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_SMALL:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_SMALL_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_NORMAL:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_NORMAL_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_LARGE:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_LARGE_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_LARGER:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_LARGER_SIZE,
+ 0,
+ NULL);
+ break;
+ case THUMBNAIL_SIZE_VERY_LARGE:
+ thumbnail_missing = gtk_icon_theme_load_icon (
+ gtk_icon_theme_get_default(),
+ "image-missing",
+ THUMBNAIL_SIZE_VERY_LARGE_SIZE,
+ 0,
+ NULL);
+ break;
+ }
+
+}
diff --git a/src/icon_bar.h b/src/icon_bar.h
new file mode 100644
index 0000000..5f846a7
--- /dev/null
+++ b/src/icon_bar.h
@@ -0,0 +1,116 @@
+/*-
+ * Copyright (c) 2004 os-cillation e.K.
+ * Copyright (c) 2012 Stephan Arts <stephan at xfce.org>
+ *
+ * Written by Benedikt Meurer <benny at xfce.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __RSTTO_ICON_BAR_H__
+#define __RSTTO_ICON_BAR_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define RSTTO_TYPE_ICON_BAR (rstto_icon_bar_get_type ())
+#define RSTTO_ICON_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RSTTO_TYPE_ICON_BAR, RsttoIconBar))
+#define RSTTO_ICON_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RSTTO_TYPE_ICON_BAR, RsttoIconBarClass))
+#define RSTTO_IS_ICON_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RSTTO_TYPE_ICON_BAR))
+#define RSTTO_IS_ICON_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), RSTTO_TYPE_ICON_BAR))
+#define RSTTO_ICON_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RSTTO_TYPE_ICON_BAR, RsttoIconBarClass))
+
+typedef struct _RsttoIconBarPrivate RsttoIconBarPrivate;
+typedef struct _RsttoIconBarClass RsttoIconBarClass;
+typedef struct _RsttoIconBar RsttoIconBar;
+
+/**
+ * RsttoIconBarClass:
+ * @set_scroll_adjustments : Used internally to make the RsttoIconBar scrollable.
+ * @selection_changed : This signal is emitted whenever the currently selected icon changes.
+ **/
+struct _RsttoIconBarClass
+{
+ GtkContainerClass __parent__;
+
+ /* signals */
+ void (*set_scroll_adjustments) (RsttoIconBar *icon_bar,
+ GtkAdjustment *hadjustment,
+ GtkAdjustment *vadjustment);
+ void (*selection_changed) (RsttoIconBar *icon_bar);
+
+ /*< private >*/
+ void (*reserved1) (void);
+ void (*reserved2) (void);
+ void (*reserved3) (void);
+ void (*reserved4) (void);
+};
+
+/**
+ * RsttoIconBar:
+ *
+ * The #RsttoIconBar struct contains only private fields and should not
+ * be directly accessed.
+ **/
+struct _RsttoIconBar
+{
+ GtkContainer __parent__;
+
+ /*< private >*/
+ RsttoIconBarPrivate *priv;
+};
+
+GType rstto_icon_bar_get_type (void) G_GNUC_CONST;
+
+GtkWidget *rstto_icon_bar_new (void);
+GtkWidget *rstto_icon_bar_new_with_model (GtkTreeModel *model);
+
+GtkTreeModel *rstto_icon_bar_get_model (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_model (RsttoIconBar *icon_bar,
+ GtkTreeModel *model);
+
+gint rstto_icon_bar_get_file_column (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_file_column (RsttoIconBar *icon_bar,
+ gint column);
+
+GtkOrientation rstto_icon_bar_get_orientation (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_orientation (RsttoIconBar *icon_bar,
+ GtkOrientation orientation);
+
+gint rstto_icon_bar_get_active (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_active (RsttoIconBar *icon_bar,
+ gint idx);
+
+gboolean rstto_icon_bar_get_active_iter (RsttoIconBar *icon_bar,
+ GtkTreeIter *iter);
+void rstto_icon_bar_set_active_iter (RsttoIconBar *icon_bar,
+ GtkTreeIter *iter);
+
+gint rstto_icon_bar_get_item_width (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_item_width (RsttoIconBar *icon_bar,
+ gint item_width);
+
+gboolean rstto_icon_bar_get_show_text (RsttoIconBar *icon_bar);
+void rstto_icon_bar_set_show_text (RsttoIconBar *icon_bar,
+ gboolean show_text);
+
+gboolean rstto_icon_bar_show_active (RsttoIconBar *icon_bar);
+
+G_END_DECLS
+
+#endif /* !__RSTTO_ICON_BAR_H__ */
+
diff --git a/src/image_list.c b/src/image_list.c
index 5881651..e29db5e 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Sorting-algorithm taken from the thunar filemanager.
+ * Sorting-algorithm taken from the thunar filemanager.
+ * Copyright (c) Benedict Meurer <benny at xfce.org>
*/
#include <config.h>
@@ -33,6 +34,11 @@
#include "image_list.h"
#include "settings.h"
+static void
+rstto_image_list_tree_model_init (GtkTreeModelIface *iface);
+static void
+rstto_image_list_tree_sortable_init(GtkTreeSortableIface *iface);
+
static void
rstto_image_list_init(RsttoImageList *);
static void
@@ -86,6 +92,77 @@ iter_set_position (
gint pos,
gboolean sticky);
+/***************************************/
+/* Begin TreeModelIface Functions */
+/***************************************/
+
+static GtkTreeModelFlags
+image_list_model_get_flags ( GtkTreeModel *tree_model );
+
+static gint
+image_list_model_get_n_columns ( GtkTreeModel *tree_model );
+
+static GType
+image_list_model_get_column_type (
+ GtkTreeModel *tree_model,
+ gint index_ );
+
+static gboolean
+image_list_model_get_iter (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreePath *path );
+
+static GtkTreePath *
+image_list_model_get_path (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter );
+
+static void
+image_list_model_get_value (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ gint column,
+ GValue *value );
+
+static gboolean
+image_list_model_iter_children (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent );
+
+static gboolean
+image_list_model_iter_has_child (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter );
+
+static gboolean
+image_list_model_iter_parent (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *child );
+
+static gint
+image_list_model_iter_n_children (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter );
+
+static gboolean
+image_list_model_iter_nth_child (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent,
+ gint n );
+
+static gboolean
+image_list_model_iter_next (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter );
+
+/***************************************/
+/* End TreeModelIface Functions */
+/***************************************/
+
static RsttoImageListIter * rstto_image_list_iter_new ();
static gint
@@ -98,8 +175,7 @@ static GObjectClass *iter_parent_class = NULL;
enum
{
- RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE = 0,
- RSTTO_IMAGE_LIST_SIGNAL_REMOVE_IMAGE,
+ RSTTO_IMAGE_LIST_SIGNAL_REMOVE_IMAGE = 0,
RSTTO_IMAGE_LIST_SIGNAL_REMOVE_ALL,
RSTTO_IMAGE_LIST_SIGNAL_COUNT
};
@@ -111,6 +187,11 @@ enum
RSTTO_IMAGE_LIST_ITER_SIGNAL_COUNT
};
+/* Missing image thumbnail, should be re-generated every time
+ * the thumbnail-size changed.
+ */
+static GdkPixbuf *thumbnail_missing = NULL;
+
struct _RsttoImageListIterPriv
{
RsttoImageList *image_list;
@@ -122,7 +203,8 @@ struct _RsttoImageListIterPriv
struct _RsttoImageListPriv
{
- GFileMonitor *monitor;
+ gint stamp;
+ GFileMonitor *monitor;
RsttoSettings *settings;
GtkFileFilter *filter;
@@ -141,6 +223,18 @@ static gint rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_COUNT];
GType
rstto_image_list_get_type (void)
{
+ static const GInterfaceInfo tree_model_info =
+ {
+ (GInterfaceInitFunc) rstto_image_list_tree_model_init,
+ NULL,
+ NULL
+ };
+ static const GInterfaceInfo tree_sort_info =
+ {
+ (GInterfaceInitFunc) rstto_image_list_tree_sortable_init,
+ NULL,
+ NULL
+ };
static GType rstto_image_list_type = 0;
if (!rstto_image_list_type)
@@ -160,15 +254,51 @@ rstto_image_list_get_type (void)
};
rstto_image_list_type = g_type_register_static (G_TYPE_OBJECT, "RsttoImageList", &rstto_image_list_info, 0);
+
+ g_type_add_interface_static (rstto_image_list_type, GTK_TYPE_TREE_MODEL, &tree_model_info);
+
+ g_type_add_interface_static (rstto_image_list_type, GTK_TYPE_TREE_SORTABLE, &tree_sort_info);
}
+
+
return rstto_image_list_type;
}
static void
+rstto_image_list_tree_model_init (GtkTreeModelIface *iface)
+{
+ iface->get_flags = image_list_model_get_flags;
+ iface->get_n_columns = image_list_model_get_n_columns;
+ iface->get_column_type = image_list_model_get_column_type;
+ iface->get_iter = image_list_model_get_iter;
+ iface->get_path = image_list_model_get_path;
+ iface->get_value = image_list_model_get_value;
+ iface->iter_children = image_list_model_iter_children;
+ iface->iter_has_child = image_list_model_iter_has_child;
+ iface->iter_n_children = image_list_model_iter_n_children;
+ iface->iter_nth_child = image_list_model_iter_nth_child;
+ iface->iter_parent = image_list_model_iter_parent;
+ iface->iter_next = image_list_model_iter_next;
+}
+
+static void
+rstto_image_list_tree_sortable_init(GtkTreeSortableIface *iface)
+{
+#if 0
+ iface->get_sort_column_id = sq_archive_store_get_sort_column_id;
+ iface->set_sort_column_id = sq_archive_store_set_sort_column_id;
+ iface->set_sort_func = sq_archive_store_set_sort_func; /*NOT SUPPORTED*/
+ iface->set_default_sort_func = sq_archive_store_set_default_sort_func; /*NOT SUPPORTED*/
+ iface->has_default_sort_func = sq_archive_store_has_default_sort_func;
+#endif
+}
+
+static void
rstto_image_list_init(RsttoImageList *image_list)
{
image_list->priv = g_new0 (RsttoImageListPriv, 1);
+ image_list->priv->stamp = g_random_int();
image_list->priv->settings = rstto_settings_new ();
image_list->priv->filter = gtk_file_filter_new ();
g_object_ref_sink (image_list->priv->filter);
@@ -197,18 +327,6 @@ rstto_image_list_class_init(RsttoImageListClass *nav_class)
object_class->dispose = rstto_image_list_dispose;
- rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE] = g_signal_new("new-image",
- G_TYPE_FROM_CLASS(nav_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE,
- 1,
- G_TYPE_OBJECT,
- NULL);
-
rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_REMOVE_IMAGE] = g_signal_new("remove-image",
G_TYPE_FROM_CLASS(nav_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -275,6 +393,9 @@ rstto_image_list_add_file (
GtkFileFilterInfo filter_info;
GList *image_iter = g_list_find (image_list->priv->images, file);
GSList *iter = image_list->priv->iterators;
+ gint i = 0;
+ GtkTreePath *path = NULL;
+ GtkTreeIter t_iter;
g_return_val_if_fail ( NULL != file , FALSE);
g_return_val_if_fail ( RSTTO_IS_FILE (file) , FALSE);
@@ -294,8 +415,16 @@ rstto_image_list_add_file (
image_list->priv->images = g_list_insert_sorted (image_list->priv->images, file, rstto_image_list_get_compare_func (image_list));
image_list->priv->n_images++;
+ i = g_list_index (image_list->priv->images, file);
+
+ path = gtk_tree_path_new();
+ gtk_tree_path_append_index (path, i);
+ t_iter.stamp = image_list->priv->stamp;
+ t_iter.user_data = file;
+ t_iter.user_data3 = GINT_TO_POINTER(i);
+
+ gtk_tree_model_row_inserted(GTK_TREE_MODEL(image_list), path, &t_iter);
- g_signal_emit (G_OBJECT (image_list), rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE], 0, file, NULL);
/** TODO: update all iterators */
while (iter)
{
@@ -305,6 +434,7 @@ rstto_image_list_add_file (
}
iter = g_slist_next (iter);
}
+
return TRUE;
}
else
@@ -315,8 +445,6 @@ rstto_image_list_add_file (
return FALSE;
}
- g_signal_emit (G_OBJECT (image_list), rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE], 0, image_iter->data, NULL);
-
return TRUE;
}
@@ -355,6 +483,7 @@ rstto_image_list_remove_file (RsttoImageList *image_list, RsttoFile *file)
{
GSList *iter = NULL;
RsttoFile *afile = NULL;
+ GtkTreePath *path_ = NULL;
if (g_list_find(image_list->priv->images, file))
{
@@ -364,6 +493,12 @@ rstto_image_list_remove_file (RsttoImageList *image_list, RsttoFile *file)
{
if (rstto_file_equal(rstto_image_list_iter_get_file (iter->data), file))
{
+
+ path_ = gtk_tree_path_new();
+ gtk_tree_path_append_index(path_,rstto_image_list_iter_get_position (iter->data));
+
+ gtk_tree_model_row_deleted(GTK_TREE_MODEL(image_list), path_);
+
if (rstto_image_list_iter_get_position (iter->data) == rstto_image_list_get_n_images (image_list)-1)
{
iter_previous (iter->data, FALSE);
@@ -409,6 +544,22 @@ static void
rstto_image_list_remove_all (RsttoImageList *image_list)
{
GSList *iter = NULL;
+ GList *image_iter = image_list->priv->images;
+ GtkTreePath *path_ = NULL;
+ gint i = g_list_length (image_iter);
+
+ while (image_iter)
+ {
+ i--;
+ path_ = gtk_tree_path_new();
+ gtk_tree_path_append_index(path_, i);
+
+ gtk_tree_model_row_deleted(GTK_TREE_MODEL(image_list), path_);
+
+
+ image_iter = g_list_next (image_iter);
+ }
+
g_list_foreach (image_list->priv->images, (GFunc)g_object_unref, NULL);
g_list_free (image_list->priv->images);
image_list->priv->images = NULL;
@@ -1058,3 +1209,220 @@ cb_rstto_wrap_images_changed (
image_list->priv->wrap_images = g_value_get_boolean (&val_wrap_images);
}
+
+/***************************************/
+/* TreeModelIface Functions */
+/***************************************/
+
+static GtkTreeModelFlags
+image_list_model_get_flags ( GtkTreeModel *tree_model )
+{
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), (GtkTreeModelFlags)0);
+
+ return (GTK_TREE_MODEL_LIST_ONLY | GTK_TREE_MODEL_ITERS_PERSIST);
+}
+
+static gint
+image_list_model_get_n_columns ( GtkTreeModel *tree_model )
+{
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), 0);
+
+ return 2;
+}
+
+static GType
+image_list_model_get_column_type (
+ GtkTreeModel *tree_model,
+ gint index_ )
+{
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), G_TYPE_INVALID);
+
+ switch (index_)
+ {
+ case 0: /* file */
+ return RSTTO_TYPE_FILE;
+ case 1:
+ return GDK_TYPE_PIXBUF;
+ break;
+ default:
+ return G_TYPE_INVALID;
+ break;
+ }
+}
+
+static gboolean
+image_list_model_get_iter (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreePath *path )
+{
+ gint *indices;
+ gint depth;
+ gint index_;
+ RsttoImageList *image_list;
+ RsttoFile *file = NULL;
+
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), FALSE);
+
+ image_list = RSTTO_IMAGE_LIST (tree_model);
+
+ indices = gtk_tree_path_get_indices(path);
+ depth = gtk_tree_path_get_depth(path) - 1;
+
+ /* only support list: depth is always 0 */
+ g_return_val_if_fail(depth == 0, FALSE);
+
+ index_ = indices[depth];
+
+ if (index_ >= 0)
+ {
+ file = g_list_nth_data (image_list->priv->images, index_);
+ }
+
+ if (NULL == file)
+ {
+ return FALSE;
+ }
+
+ /* set the stamp, identify the iter as ours */
+ iter->stamp = image_list->priv->stamp;
+
+ iter->user_data = file;
+
+ /* the index_ in the child list */
+ iter->user_data3 = GINT_TO_POINTER(index_);
+ return TRUE;
+}
+
+static GtkTreePath *
+image_list_model_get_path (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter )
+{
+ GtkTreePath *path = NULL;
+ gint pos;
+
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), NULL);
+
+ pos = GPOINTER_TO_INT (iter->user_data3);
+
+ path = gtk_tree_path_new();
+ gtk_tree_path_append_index(path, pos);
+
+ return path;
+}
+
+static gboolean
+image_list_model_iter_children (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent )
+{
+ RsttoFile *file = NULL;
+ RsttoImageList *image_list;
+
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), FALSE);
+
+ /* only support lists: parent is always NULL */
+ g_return_val_if_fail(parent == NULL, FALSE);
+
+ image_list = RSTTO_IMAGE_LIST (tree_model);
+
+ file = g_list_nth_data (image_list->priv->images, 0);
+
+ if (NULL == file)
+ {
+ return FALSE;
+ }
+
+ iter->stamp = image_list->priv->stamp;
+ iter->user_data = file;
+ iter->user_data3 = GINT_TO_POINTER(0);
+
+ return TRUE;
+}
+
+static gboolean
+image_list_model_iter_has_child (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter )
+{
+ return FALSE;
+}
+
+static gboolean
+image_list_model_iter_parent (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *child )
+{
+ return FALSE;
+}
+
+static gint
+image_list_model_iter_n_children (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter )
+{
+ return FALSE;
+}
+
+static gboolean
+image_list_model_iter_nth_child (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent,
+ gint n )
+{
+ return FALSE;
+}
+
+static gboolean
+image_list_model_iter_next (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter )
+{
+ RsttoImageList *image_list;
+ RsttoFile *file = NULL;
+ gint pos = 0;
+
+ g_return_val_if_fail(RSTTO_IS_IMAGE_LIST(tree_model), FALSE);
+
+ image_list = RSTTO_IMAGE_LIST (tree_model);
+
+ file = iter->user_data;
+ pos = GPOINTER_TO_INT(iter->user_data3);
+ pos++;
+
+ file = g_list_nth_data (image_list->priv->images, pos);
+
+ if (NULL == file)
+ {
+ return FALSE;
+ }
+
+ iter->stamp = image_list->priv->stamp;
+ iter->user_data = file;
+ iter->user_data3 = GINT_TO_POINTER(pos);
+
+ return TRUE;
+}
+
+static void
+image_list_model_get_value (
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ gint column,
+ GValue *value )
+{
+ RsttoImageList *image_list = RSTTO_IMAGE_LIST (tree_model);
+ RsttoFile *file = RSTTO_FILE(iter->user_data);
+
+ switch (column)
+ {
+ case 0:
+ g_value_init (value, RSTTO_TYPE_FILE);
+ g_value_set_object (value, file);
+ break;
+ }
+}
diff --git a/src/image_viewer.c b/src/image_viewer.c
index 36a0f25..2627a6e 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -368,7 +368,7 @@ rstto_image_viewer_class_init(RsttoImageViewerClass *viewer_class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (RsttoImageViewerClass, set_scroll_adjustments),
NULL, NULL,
- rstto_marshal_VOID__OBJECT_OBJECT,
+ _rstto_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_ADJUSTMENT,
GTK_TYPE_ADJUSTMENT);
@@ -1063,8 +1063,8 @@ paint_image (
M_PI*0.5);
cairo_translate (
ctx,
- 0.0 - floor (gtk_adjustment_get_value (viewer->vadjustment)),
- floor (gtk_adjustment_get_value (viewer->hadjustment)));
+ floor(0.0 - gtk_adjustment_get_value (viewer->vadjustment)),
+ floor(gtk_adjustment_get_value (viewer->hadjustment)));
cairo_translate (
ctx,
0.0,
diff --git a/src/main_window.c b/src/main_window.c
index 3dbfa46..d1b3cf8 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -24,8 +24,6 @@
#include <gio/gio.h>
-#include <exo/exo.h>
-
#include <libxfce4ui/libxfce4ui.h>
#include <libexif/exif-data.h>
@@ -36,11 +34,11 @@
#include "settings.h"
#include "util.h"
#include "file.h"
+#include "icon_bar.h"
#include "image_list.h"
#include "image_viewer.h"
#include "main_window.h"
#include "main_window_ui.h"
-#include "thumbnail_bar.h"
#include "wallpaper_manager.h"
#include "xfce_wallpaper_manager.h"
@@ -91,10 +89,7 @@ struct _RsttoMainWindowPriv
GtkWidget *image_viewer;
GtkWidget *p_viewer_s_window;
GtkWidget *table;
- GtkWidget *hpaned_left;
- GtkWidget *hpaned_right;
- GtkWidget *vpaned_top;
- GtkWidget *vpaned_bottom;
+ GtkWidget *t_bar_s_window;
GtkWidget *thumbnailbar;
GtkWidget *statusbar;
guint statusbar_context_id;
@@ -142,6 +137,11 @@ key_press_event (
GtkWidget *widget,
GdkEventKey *event);
+static void
+cb_icon_bar_selection_changed (
+ RsttoIconBar *icon_bar,
+ gpointer user_data);
+
static gboolean
rstto_window_save_geometry_timer (gpointer user_data);
@@ -203,7 +203,14 @@ static void
cb_rstto_main_window_sorting_function_changed (GtkRadioAction *action, GtkRadioAction *current, RsttoMainWindow *window);
static void
cb_rstto_main_window_navigationtoolbar_position_changed (GtkRadioAction *, GtkRadioAction *, RsttoMainWindow *window);
+
static void
+cb_rstto_main_window_thumbnail_size_changed (
+ GtkRadioAction *action,
+ GtkRadioAction *current,
+ RsttoMainWindow *window);
+
+static gboolean
cb_rstto_main_window_navigationtoolbar_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
static void
cb_rstto_main_window_update_statusbar (GtkWidget *widget, RsttoMainWindow *window);
@@ -289,6 +296,11 @@ rstto_main_window_set_navigationbar_position (
RsttoMainWindow *window,
guint orientation);
+static void
+rstto_main_window_set_thumbnail_size (
+ RsttoMainWindow *window,
+ RsttoThumbnailSize size);
+
static void
cb_rstto_merge_toolbars_changed (
@@ -361,7 +373,9 @@ static GtkActionEntry action_entries[] =
G_CALLBACK (cb_rstto_main_window_about), },
/* Position Menu */
{ "position-menu", NULL, N_ ("_Position"), NULL, },
+ { "size-menu", NULL, N_ ("_Size"), NULL, },
{ "thumbnailbar-position-menu", NULL, N_ ("Thumbnail Bar _Position"), NULL, },
+ { "thumbnailbar-size-menu", NULL, N_ ("Thumbnail _Size"), NULL, },
/* Misc */
{ "leave-fullscreen", GTK_STOCK_LEAVE_FULLSCREEN, N_ ("Leave _Fullscreen"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_fullscreen), },
{ "tb-menu", NULL, NULL, NULL, }
@@ -396,6 +410,18 @@ static const GtkRadioActionEntry radio_action_pos_entries[] =
{ "pos-bottom", NULL, N_("Bottom"), NULL, NULL, 3},
};
+/** Thumbnail-size options*/
+static const GtkRadioActionEntry radio_action_size_entries[] =
+{
+ { "size-very-small", NULL, N_("Very Small"), NULL, NULL, 0},
+ { "size-smaller", NULL, N_("Smaller"), NULL, NULL, 1},
+ { "size-small", NULL, N_("Small"), NULL, NULL, 2},
+ { "size-normal", NULL, N_("Normal"), NULL, NULL, 3},
+ { "size-large", NULL, N_("Large"), NULL, NULL, 4},
+ { "size-larger", NULL, N_("Larger"), NULL, NULL, 5},
+ { "size-very-large", NULL, N_("Very Large"), NULL, NULL, 6},
+};
+
GType
rstto_main_window_get_type (void)
@@ -444,6 +470,7 @@ rstto_main_window_init (RsttoMainWindow *window)
GClosure *quit_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_quit, window, NULL);
guint navigationbar_position = 3;
+ guint thumbnail_size = 3;
gtk_window_set_title (GTK_WINDOW (window), RISTRETTO_APP_TITLE);
@@ -503,6 +530,7 @@ rstto_main_window_init (RsttoMainWindow *window)
navigationbar_position = rstto_settings_get_navbar_position (window->priv->settings_manager);
+ thumbnail_size = rstto_settings_get_uint_property (window->priv->settings_manager, "thumbnail-size");
accel_group = gtk_ui_manager_get_accel_group (window->priv->ui_manager);
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
@@ -574,6 +602,7 @@ rstto_main_window_init (RsttoMainWindow *window)
gtk_action_group_add_toggle_actions (window->priv->action_group, toggle_action_entries, G_N_ELEMENTS (toggle_action_entries), GTK_WIDGET (window));
gtk_action_group_add_radio_actions (window->priv->action_group, radio_action_sort_entries , G_N_ELEMENTS (radio_action_sort_entries), 0, G_CALLBACK (cb_rstto_main_window_sorting_function_changed), GTK_WIDGET (window));
gtk_action_group_add_radio_actions (window->priv->action_group, radio_action_pos_entries, G_N_ELEMENTS (radio_action_pos_entries), navigationbar_position, G_CALLBACK (cb_rstto_main_window_navigationtoolbar_position_changed), GTK_WIDGET (window));
+ gtk_action_group_add_radio_actions (window->priv->action_group, radio_action_size_entries, G_N_ELEMENTS (radio_action_size_entries), thumbnail_size, G_CALLBACK (cb_rstto_main_window_thumbnail_size_changed), GTK_WIDGET (window));
gtk_ui_manager_add_ui_from_string (window->priv->ui_manager,main_window_ui, main_window_ui_length, NULL);
@@ -616,21 +645,19 @@ rstto_main_window_init (RsttoMainWindow *window)
RSTTO_IMAGE_VIEWER(window->priv->image_viewer),
GTK_MENU(window->priv->image_viewer_menu));
- window->priv->thumbnailbar = rstto_thumbnail_bar_new (NULL);
+ window->priv->thumbnailbar = rstto_icon_bar_new();
+ rstto_icon_bar_set_show_text (RSTTO_ICON_BAR (window->priv->thumbnailbar), FALSE);
- window->priv->hpaned_left = gtk_hpaned_new();
- window->priv->hpaned_right = gtk_hpaned_new();
- window->priv->vpaned_top = gtk_vpaned_new();
- window->priv->vpaned_bottom = gtk_vpaned_new();
- window->priv->table = gtk_table_new (3, 3, FALSE);
+ g_signal_connect(G_OBJECT(window->priv->thumbnailbar), "selection-changed", G_CALLBACK(cb_icon_bar_selection_changed), window);
- gtk_paned_pack2 (GTK_PANED (window->priv->hpaned_left), window->priv->hpaned_right, TRUE, FALSE);
- gtk_paned_pack1 (GTK_PANED (window->priv->hpaned_right), window->priv->vpaned_top, TRUE, FALSE);
- gtk_paned_pack2 (GTK_PANED (window->priv->vpaned_top), window->priv->vpaned_bottom, TRUE, FALSE);
+ window->priv->t_bar_s_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_POLICY_ALWAYS, GTK_POLICY_NEVER);
+ gtk_container_add (GTK_CONTAINER (window->priv->t_bar_s_window), window->priv->thumbnailbar);
- gtk_paned_pack1 (GTK_PANED (window->priv->vpaned_bottom), window->priv->p_viewer_s_window, TRUE, FALSE);
- gtk_paned_pack2 (GTK_PANED (window->priv->hpaned_right), window->priv->thumbnailbar, FALSE, FALSE);
+ rstto_icon_bar_set_file_column (RSTTO_ICON_BAR (window->priv->thumbnailbar), 0);
+ rstto_icon_bar_set_item_width (RSTTO_ICON_BAR (window->priv->thumbnailbar), 96);
+ window->priv->table = gtk_table_new (5, 5, FALSE);
window->priv->statusbar = gtk_statusbar_new();
window->priv->statusbar_context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR(window->priv->statusbar), "image-data");
@@ -645,12 +672,15 @@ rstto_main_window_init (RsttoMainWindow *window)
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->table, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->statusbar, FALSE, FALSE, 0);
- gtk_table_attach_defaults (GTK_TABLE (window->priv->table), window->priv->hpaned_left, 1, 2, 1, 2);
- gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 0, 1, 0, 3, GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+ gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->t_bar_s_window, 1, 2, 0, 5, GTK_FILL|GTK_SHRINK, GTK_FILL|GTK_EXPAND, 0, 0);
+ gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 0, 1, 0, 5, GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+ gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->p_viewer_s_window, 2, 3, 2, 3, GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
gtk_widget_set_no_show_all (window->priv->toolbar, TRUE);
gtk_widget_set_no_show_all (window->priv->image_list_toolbar, TRUE);
- gtk_widget_set_no_show_all (window->priv->thumbnailbar, TRUE);
+ gtk_widget_set_no_show_all (window->priv->t_bar_s_window, TRUE);
+ gtk_widget_show_all (window->priv->thumbnailbar);
+
gtk_widget_set_no_show_all ( gtk_ui_manager_get_widget (window->priv->ui_manager, "/main-menu/view-menu/show-nav-toolbar"), TRUE);
rstto_main_window_set_navigationbar_position (window, navigationbar_position);
@@ -730,7 +760,7 @@ rstto_main_window_init (RsttoMainWindow *window)
GTK_CHECK_MENU_ITEM (
gtk_ui_manager_get_widget (window->priv->ui_manager, "/main-menu/view-menu/show-thumbnailbar")),
TRUE);
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
else
{
@@ -738,7 +768,7 @@ rstto_main_window_init (RsttoMainWindow *window)
GTK_CHECK_MENU_ITEM (
gtk_ui_manager_get_widget (window->priv->ui_manager, "/main-menu/view-menu/show-thumbnailbar")),
FALSE);
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
}
/**
@@ -847,12 +877,8 @@ static void
rstto_main_window_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
RsttoMainWindow *window = RSTTO_MAIN_WINDOW(widget);
- GtkRequisition panel_requisition;
GTK_WIDGET_CLASS (parent_class)->size_allocate(widget, allocation);
-
- gtk_widget_size_request (window->priv->vpaned_top, &panel_requisition);
-
}
static void
@@ -930,12 +956,18 @@ rstto_main_window_new (RsttoImageList *image_list, gboolean fullscreen)
"changed",
G_CALLBACK (cb_rstto_main_window_image_list_iter_changed),
window);
+
+ rstto_icon_bar_set_model (
+ RSTTO_ICON_BAR (window->priv->thumbnailbar),
+ GTK_TREE_MODEL (window->priv->image_list));
+ /*
rstto_thumbnail_bar_set_image_list (
RSTTO_THUMBNAIL_BAR (window->priv->thumbnailbar),
window->priv->image_list);
rstto_thumbnail_bar_set_iter (
RSTTO_THUMBNAIL_BAR (window->priv->thumbnailbar),
window->priv->iter);
+ */
rstto_main_window_update_buttons (window);
if (fullscreen == TRUE)
@@ -973,6 +1005,8 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
cur_file = rstto_image_list_iter_get_file (window->priv->iter);
if (NULL != cur_file)
{
+ rstto_icon_bar_set_active (RSTTO_ICON_BAR (window->priv->thumbnailbar), position);
+ rstto_icon_bar_show_active (RSTTO_ICON_BAR (window->priv->thumbnailbar));
content_type = rstto_file_get_content_type (cur_file);
rstto_image_viewer_set_file (
@@ -1146,7 +1180,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
gtk_widget_show (window->priv->toolbar);
}
}
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
gtk_widget_set_sensitive ( gtk_ui_manager_get_widget ( window->priv->ui_manager, "/main-menu/file-menu/save-copy"), FALSE);
/*
gtk_widget_set_sensitive ( gtk_ui_manager_get_widget ( window->priv->ui_manager, "/main-menu/file-menu/print"), FALSE);
@@ -1246,7 +1280,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
{
if ( 0 == (gdk_window_get_state (GTK_WIDGET (window)->window) & GDK_WINDOW_STATE_FULLSCREEN ))
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
else
{
@@ -1254,11 +1288,11 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
window->priv->settings_manager,
"hide-thumbnailbar-fullscreen"))
{
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
}
else
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
}
@@ -1377,7 +1411,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
{
if ( 0 == (gdk_window_get_state (GTK_WIDGET (window)->window) & GDK_WINDOW_STATE_FULLSCREEN ))
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
else
{
@@ -1385,11 +1419,11 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
window->priv->settings_manager,
"hide-thumbnailbar-fullscreen"))
{
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
}
else
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
}
@@ -1766,6 +1800,18 @@ rstto_window_save_geometry_timer (gpointer user_data)
return FALSE;
}
+
+static void
+rstto_main_window_set_thumbnail_size (
+ RsttoMainWindow *window,
+ RsttoThumbnailSize size)
+{
+ rstto_settings_set_uint_property (
+ window->priv->settings_manager,
+ "thumbnail-size",
+ size);
+}
+
static void
rstto_main_window_set_navigationbar_position (RsttoMainWindow *window, guint orientation)
{
@@ -1775,66 +1821,158 @@ rstto_main_window_set_navigationbar_position (RsttoMainWindow *window, guint ori
{
case 0: /* Left */
g_object_ref (window->priv->image_list_toolbar);
- g_object_ref (window->priv->thumbnailbar);
+ g_object_ref (window->priv->t_bar_s_window);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->back), GTK_STOCK_GO_UP);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->forward), GTK_STOCK_GO_DOWN);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->thumbnailbar)), window->priv->thumbnailbar);
- gtk_paned_pack1 (GTK_PANED (window->priv->hpaned_left), window->priv->thumbnailbar, FALSE, FALSE);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->t_bar_s_window)), window->priv->t_bar_s_window);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->t_bar_s_window,
+ 1,
+ 2,
+ 0,
+ 5,
+ GTK_SHRINK|GTK_FILL,
+ GTK_EXPAND|GTK_FILL,
+ 0,
+ 0);
+
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_CORNER_BOTTOM_RIGHT);
gtk_container_remove (GTK_CONTAINER (window->priv->table), window->priv->image_list_toolbar);
- gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 0, 1, 0, 3, GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->image_list_toolbar,
+ 0,
+ 1,
+ 0,
+ 5,
+ GTK_SHRINK|GTK_FILL,
+ GTK_EXPAND|GTK_FILL,
+ 0,
+ 0);
gtk_orientable_set_orientation (GTK_ORIENTABLE(window->priv->image_list_toolbar), GTK_ORIENTATION_VERTICAL);
- rstto_thumbnail_bar_set_orientation (RSTTO_THUMBNAIL_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_VERTICAL);
+ rstto_icon_bar_set_orientation (RSTTO_ICON_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_VERTICAL);
break;
case 1: /* Right */
g_object_ref (window->priv->image_list_toolbar);
- g_object_ref (window->priv->thumbnailbar);
+ g_object_ref (window->priv->t_bar_s_window);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->back), GTK_STOCK_GO_UP);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->forward), GTK_STOCK_GO_DOWN);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->thumbnailbar)), window->priv->thumbnailbar);
- gtk_paned_pack2 (GTK_PANED (window->priv->hpaned_right), window->priv->thumbnailbar, FALSE, FALSE);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->t_bar_s_window)), window->priv->t_bar_s_window);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->t_bar_s_window,
+ 3,
+ 4,
+ 0,
+ 5,
+ GTK_SHRINK|GTK_FILL,
+ GTK_EXPAND|GTK_FILL,
+ 0,
+ 0);
+
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_CORNER_BOTTOM_LEFT);
gtk_container_remove (GTK_CONTAINER (window->priv->table), window->priv->image_list_toolbar);
- gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 2, 3, 0, 3, GTK_FILL,GTK_EXPAND|GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->image_list_toolbar,
+ 4,
+ 5,
+ 0,
+ 5,
+ GTK_SHRINK|GTK_FILL,
+ GTK_EXPAND|GTK_FILL,
+ 0,
+ 0);
gtk_orientable_set_orientation (GTK_ORIENTABLE (window->priv->image_list_toolbar), GTK_ORIENTATION_VERTICAL);
- rstto_thumbnail_bar_set_orientation (RSTTO_THUMBNAIL_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_VERTICAL);
+ rstto_icon_bar_set_orientation (RSTTO_ICON_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_VERTICAL);
break;
case 2: /* Top */
g_object_ref (window->priv->image_list_toolbar);
- g_object_ref (window->priv->thumbnailbar);
+ g_object_ref (window->priv->t_bar_s_window);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->back), GTK_STOCK_GO_BACK);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->forward), GTK_STOCK_GO_FORWARD);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->thumbnailbar)), window->priv->thumbnailbar);
- gtk_paned_pack1 (GTK_PANED (window->priv->vpaned_top), window->priv->thumbnailbar, FALSE, FALSE);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->t_bar_s_window)), window->priv->t_bar_s_window);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->t_bar_s_window,
+ 0,
+ 5,
+ 1,
+ 2,
+ GTK_EXPAND|GTK_FILL,
+ GTK_SHRINK|GTK_FILL,
+ 0,
+ 0);
+
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_POLICY_ALWAYS, GTK_POLICY_NEVER);
+ gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_CORNER_BOTTOM_RIGHT);
gtk_container_remove (GTK_CONTAINER (window->priv->table), window->priv->image_list_toolbar);
- gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 0, 3, 0, 1, GTK_EXPAND|GTK_FILL,GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->image_list_toolbar,
+ 0,
+ 5,
+ 0,
+ 1,
+ GTK_EXPAND|GTK_FILL,
+ GTK_SHRINK|GTK_FILL,
+ 0,
+ 0);
gtk_orientable_set_orientation (GTK_ORIENTABLE (window->priv->image_list_toolbar), GTK_ORIENTATION_HORIZONTAL);
- rstto_thumbnail_bar_set_orientation (RSTTO_THUMBNAIL_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_HORIZONTAL);
+ rstto_icon_bar_set_orientation (RSTTO_ICON_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_HORIZONTAL);
break;
case 3: /* Bottom */
g_object_ref (window->priv->image_list_toolbar);
- g_object_ref (window->priv->thumbnailbar);
+ g_object_ref (window->priv->t_bar_s_window);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->back), GTK_STOCK_GO_BACK);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON(window->priv->forward), GTK_STOCK_GO_FORWARD);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->thumbnailbar)), window->priv->thumbnailbar);
- gtk_paned_pack2 (GTK_PANED (window->priv->vpaned_bottom), window->priv->thumbnailbar, FALSE, FALSE);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (window->priv->t_bar_s_window)), window->priv->t_bar_s_window);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->t_bar_s_window,
+ 0,
+ 5,
+ 3,
+ 4,
+ GTK_EXPAND|GTK_FILL,
+ GTK_SHRINK|GTK_FILL,
+ 0,
+ 0);
+
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_POLICY_ALWAYS, GTK_POLICY_NEVER);
+ gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (window->priv->t_bar_s_window), GTK_CORNER_TOP_RIGHT);
gtk_container_remove (GTK_CONTAINER (window->priv->table), window->priv->image_list_toolbar);
- gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->image_list_toolbar, 0, 3, 2, 3, GTK_EXPAND|GTK_FILL,GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (window->priv->table),
+ window->priv->image_list_toolbar,
+ 0,
+ 5,
+ 4,
+ 5,
+ GTK_EXPAND|GTK_FILL,
+ GTK_SHRINK|GTK_FILL,
+ 0,
+ 0);
gtk_orientable_set_orientation (GTK_ORIENTABLE(window->priv->image_list_toolbar), GTK_ORIENTATION_HORIZONTAL);
- rstto_thumbnail_bar_set_orientation (RSTTO_THUMBNAIL_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_HORIZONTAL);
+ rstto_icon_bar_set_orientation (RSTTO_ICON_BAR(window->priv->thumbnailbar), GTK_ORIENTATION_HORIZONTAL);
break;
default:
break;
@@ -1848,7 +1986,7 @@ rstto_main_window_set_navigationbar_position (RsttoMainWindow *window, guint ori
/** **/
/************************/
-static void
+static gboolean
cb_rstto_main_window_navigationtoolbar_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
int button, event_time;
@@ -1872,6 +2010,7 @@ cb_rstto_main_window_navigationtoolbar_button_press_event (GtkWidget *widget, Gd
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
button, event_time);
}
+ return FALSE;
}
static void
@@ -1910,6 +2049,15 @@ cb_rstto_main_window_navigationtoolbar_position_changed (GtkRadioAction *action,
}
static void
+cb_rstto_main_window_thumbnail_size_changed (
+ GtkRadioAction *action,
+ GtkRadioAction *current,
+ RsttoMainWindow *window)
+{
+ rstto_main_window_set_thumbnail_size (window, gtk_radio_action_get_current_value (current));
+}
+
+static void
cb_rstto_main_window_set_as_wallpaper (GtkWidget *widget, RsttoMainWindow *window)
{
gint response = GTK_RESPONSE_APPLY;
@@ -2103,7 +2251,7 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
if (rstto_settings_get_boolean_property (window->priv->settings_manager, "hide-thumbnailbar-fullscreen"))
{
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
}
if (rstto_settings_get_boolean_property (
@@ -2198,7 +2346,7 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
{
if (rstto_image_list_get_n_images (window->priv->image_list) > 0)
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
}
}
@@ -3291,12 +3439,12 @@ cb_rstto_main_window_toggle_show_thumbnailbar (GtkWidget *widget, RsttoMainWindo
{
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (widget)))
{
- gtk_widget_show (window->priv->thumbnailbar);
+ gtk_widget_show (window->priv->t_bar_s_window);
rstto_settings_set_boolean_property (RSTTO_SETTINGS (window->priv->settings_manager), "show-thumbnailbar", TRUE);
}
else
{
- gtk_widget_hide (window->priv->thumbnailbar);
+ gtk_widget_hide (window->priv->t_bar_s_window);
rstto_settings_set_boolean_property (RSTTO_SETTINGS (window->priv->settings_manager), "show-thumbnailbar", FALSE);
}
}
@@ -3519,3 +3667,18 @@ rstto_main_window_play_slideshow (RsttoMainWindow *window)
window->priv->play_timeout_id = g_timeout_add (g_value_get_uint (&timeout)*1000, (GSourceFunc)cb_rstto_main_window_play_slideshow, window);
return TRUE;
}
+
+static void
+cb_icon_bar_selection_changed (
+ RsttoIconBar *icon_bar,
+ gpointer user_data)
+{
+ RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data);
+ gint position = rstto_image_list_iter_get_position (window->priv->iter);
+ gint selection = rstto_icon_bar_get_active (RSTTO_ICON_BAR(window->priv->thumbnailbar));
+
+ if (position != selection )
+ {
+ rstto_image_list_iter_set_position (window->priv->iter, selection);
+ }
+}
diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
index c7888f7..2521d54 100644
--- a/src/main_window_ui.xml
+++ b/src/main_window_ui.xml
@@ -42,6 +42,15 @@
<menuitem action="pos-top"/>
<menuitem action="pos-bottom"/>
</menu>
+ <menu action="thumbnailbar-size-menu">
+ <menuitem action="size-very-small"/>
+ <menuitem action="size-smaller"/>
+ <menuitem action="size-small"/>
+ <menuitem action="size-normal"/>
+ <menuitem action="size-large"/>
+ <menuitem action="size-larger"/>
+ <menuitem action="size-very-large"/>
+ </menu>
<separator/>
<menu action="zoom-menu">
<menuitem action="zoom-in"/>
@@ -84,6 +93,15 @@
<menuitem action="pos-top"/>
<menuitem action="pos-bottom"/>
</menu>
+ <menu action="size-menu">
+ <menuitem action="size-very-small"/>
+ <menuitem action="size-smaller"/>
+ <menuitem action="size-small"/>
+ <menuitem action="size-normal"/>
+ <menuitem action="size-large"/>
+ <menuitem action="size-larger"/>
+ <menuitem action="size-very-large"/>
+ </menu>
</popup>
<popup name="image-viewer-menu">
diff --git a/src/settings.c b/src/settings.c
index 1d89aca..d34d1c5 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -74,6 +74,7 @@ enum
PROP_MERGE_TOOLBARS,
PROP_ERROR_MISSING_THUMBNAILER,
PROP_SORT_TYPE,
+ PROP_THUMBNAIL_SIZE,
};
GType
@@ -124,6 +125,7 @@ struct _RsttoSettingsPriv
gboolean use_thunar_properties;
gboolean maximize_on_startup;
gboolean merge_toolbars;
+ RsttoThumbnailSize thumbnail_size;
RsttoSortType sort_type;
@@ -165,6 +167,7 @@ rstto_settings_init (GObject *object)
settings->priv->maximize_on_startup = TRUE;
settings->priv->hide_thumbnailbar_fullscreen = TRUE;
settings->priv->errors.missing_thumbnailer = TRUE;
+ settings->priv->thumbnail_size = THUMBNAIL_SIZE_NORMAL;
xfconf_g_property_bind (
settings->priv->channel,
@@ -223,6 +226,13 @@ rstto_settings_init (GObject *object)
xfconf_g_property_bind (
settings->priv->channel,
+ "/window/thumbnails/size",
+ G_TYPE_UINT,
+ settings,
+ "thumbnail-size");
+
+ xfconf_g_property_bind (
+ settings->priv->channel,
"/window/thumbnails/hide-fullscreen",
G_TYPE_BOOLEAN,
settings,
@@ -547,6 +557,19 @@ rstto_settings_class_init (GObjectClass *object_class)
object_class,
PROP_SORT_TYPE,
pspec);
+
+ pspec = g_param_spec_uint (
+ "thumbnail-size",
+ "",
+ "",
+ 0,
+ THUMBNAIL_SIZE_COUNT,
+ 0,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (
+ object_class,
+ PROP_THUMBNAIL_SIZE,
+ pspec);
}
/**
@@ -709,6 +732,9 @@ rstto_settings_set_property (GObject *object,
case PROP_SORT_TYPE:
settings->priv->sort_type = g_value_get_uint ( value );
break;
+ case PROP_THUMBNAIL_SIZE:
+ settings->priv->thumbnail_size = g_value_get_uint (value);
+ break;
default:
break;
}
@@ -789,6 +815,11 @@ rstto_settings_get_property (GObject *object,
value,
settings->priv->sort_type);
break;
+ case PROP_THUMBNAIL_SIZE:
+ g_value_set_uint (
+ value,
+ settings->priv->thumbnail_size);
+ break;
default:
break;
diff --git a/src/thumbnail.c b/src/thumbnail.c
deleted file mode 100644
index 67876fc..0000000
--- a/src/thumbnail.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (C) Stephan Arts 2006-2010 <stephan at 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkmarshal.h>
-#include <string.h>
-
-#include <libexif/exif-data.h>
-
-#include "util.h"
-#include "file.h"
-#include "image_list.h"
-#include "thumbnail.h"
-
-struct _RsttoThumbnailPriv
-{
- RsttoFile *file;
- GdkPixbuf *pixbuf;
- GdkPixbuf *thumb_pixbuf;
- gchar *thumbnail_path;
-};
-
-static GtkWidgetClass *parent_class = NULL;
-static GdkPixbuf *thumbnail_missing_icon = NULL;
-
-static void
-rstto_thumbnail_init(RsttoThumbnail *);
-static void
-rstto_thumbnail_class_init(RsttoThumbnailClass *);
-static void
-rstto_thumbnail_finalize(GObject *object);
-
-static void
-rstto_thumbnail_size_request(GtkWidget *, GtkRequisition *);
-static void
-rstto_thumbnail_size_allocate(GtkWidget *, GtkAllocation *);
-static gboolean
-rstto_thumbnail_expose(GtkWidget *, GdkEventExpose *);
-
-static void
-rstto_thumbnail_paint(RsttoThumbnail *thumb);
-
-static void
-rstto_thumbnail_clicked (GtkButton *);
-static void
-rstto_thumbnail_enter (GtkButton *);
-static void
-rstto_thumbnail_leave (GtkButton *);
-
-GType
-rstto_thumbnail_get_type (void)
-{
- static GType rstto_thumbnail_type = 0;
-
- if (!rstto_thumbnail_type)
- {
- static const GTypeInfo rstto_thumbnail_info =
- {
- sizeof (RsttoThumbnailClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) rstto_thumbnail_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (RsttoThumbnail),
- 0,
- (GInstanceInitFunc) rstto_thumbnail_init,
- NULL
- };
-
- rstto_thumbnail_type = g_type_register_static (GTK_TYPE_BUTTON, "RsttoThumbnail", &rstto_thumbnail_info, 0);
- }
- return rstto_thumbnail_type;
-}
-
-static void
-rstto_thumbnail_init(RsttoThumbnail *thumb)
-{
- thumb->priv = g_new0(RsttoThumbnailPriv, 1);
-
- if (thumbnail_missing_icon == NULL)
- {
- thumbnail_missing_icon = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
- "image-missing",
- 128,
- 0,
- NULL);
- }
-
-
- gtk_widget_set_redraw_on_allocate(GTK_WIDGET(thumb), TRUE);
- gtk_widget_set_events (GTK_WIDGET(thumb),
- GDK_POINTER_MOTION_MASK);
-}
-
-static void
-rstto_thumbnail_class_init(RsttoThumbnailClass *thumb_class)
-{
- GtkWidgetClass *widget_class;
- GObjectClass *object_class;
- GtkButtonClass *button_class;
-
- widget_class = (GtkWidgetClass*)thumb_class;
- object_class = (GObjectClass*)thumb_class;
- button_class = (GtkButtonClass*)thumb_class;
-
- parent_class = g_type_class_peek_parent(thumb_class);
-
- widget_class->expose_event = rstto_thumbnail_expose;
-
- widget_class->size_request = rstto_thumbnail_size_request;
- widget_class->size_allocate = rstto_thumbnail_size_allocate;
-
- button_class->clicked = rstto_thumbnail_clicked;
- button_class->enter = rstto_thumbnail_enter;
- button_class->leave = rstto_thumbnail_leave;
-
- object_class->finalize = rstto_thumbnail_finalize;
-}
-
-static void
-rstto_thumbnail_finalize(GObject *object)
-{
- RsttoThumbnail *thumb = RSTTO_THUMBNAIL(object);
- if (thumb->priv->file)
- {
- g_object_unref (thumb->priv->file);
- thumb->priv->file = NULL;
- }
-
- if (thumb->priv->pixbuf)
- {
- g_object_unref (thumb->priv->pixbuf);
- thumb->priv->pixbuf = NULL;
- }
-
- if (thumb->priv->thumbnail_path)
- {
- g_free (thumb->priv->thumbnail_path);
- thumb->priv->thumbnail_path = NULL;
- }
-
- if (thumb->priv->thumb_pixbuf)
- {
- g_object_unref (thumb->priv->thumb_pixbuf);
- thumb->priv->thumb_pixbuf = NULL;
- }
-
-}
-
-
-static void
-rstto_thumbnail_size_request(GtkWidget *widget, GtkRequisition *requisition)
-{
- requisition->height = 70;
- requisition->width = 70;
-}
-
-static void
-rstto_thumbnail_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- RsttoThumbnail *thumb = RSTTO_THUMBNAIL(widget);
- widget->allocation = *allocation;
- parent_class->size_allocate(widget, allocation);
-
- if (thumb->priv->pixbuf)
- {
- g_object_unref (thumb->priv->pixbuf);
- thumb->priv->pixbuf = NULL;
- }
-
- thumb->priv->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- TRUE,
- 8,
- allocation->width,
- allocation->height);
-}
-
-static gboolean
-rstto_thumbnail_expose(GtkWidget *widget, GdkEventExpose *event)
-{
- RsttoThumbnail *thumb = RSTTO_THUMBNAIL(widget);
- GdkPixbuf *thumb_pixbuf = NULL;
- GdkPixbuf *tmp_pixbuf = NULL;
-
- if (GTK_WIDGET_REALIZED (widget))
- {
- if (NULL == thumb->priv->thumb_pixbuf)
- {
- thumb->priv->thumb_pixbuf = gdk_pixbuf_new_from_file_at_scale (thumb->priv->thumbnail_path, 128, 128, TRUE, NULL);
- }
- if (NULL != thumb->priv->thumb_pixbuf)
- {
- thumb_pixbuf = thumb->priv->thumb_pixbuf;
- g_object_ref (thumb_pixbuf);
- }
- /* TODO: perform a check if we can open the real thumbnail */
- if (thumb_pixbuf == NULL)
- {
- thumb_pixbuf = thumbnail_missing_icon;
- g_object_ref (thumb_pixbuf);
- }
-
- if (thumb_pixbuf)
- {
- gint height = gdk_pixbuf_get_height (thumb->priv->pixbuf) - 10;
- gint width = gdk_pixbuf_get_width (thumb->priv->pixbuf) - 10;
- GdkPixbuf *dst_thumb_pixbuf = NULL;
-
- switch (rstto_file_get_orientation (thumb->priv->file))
- {
- case RSTTO_IMAGE_ORIENT_90:
- tmp_pixbuf = gdk_pixbuf_rotate_simple (
- thumb_pixbuf,
- GDK_PIXBUF_ROTATE_CLOCKWISE);
- break;
- case RSTTO_IMAGE_ORIENT_180:
- tmp_pixbuf = gdk_pixbuf_rotate_simple (
- thumb_pixbuf,
- GDK_PIXBUF_ROTATE_UPSIDEDOWN);
- break;
- case RSTTO_IMAGE_ORIENT_270:
- tmp_pixbuf = gdk_pixbuf_rotate_simple (
- thumb_pixbuf,
- GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
- break;
- default:
- tmp_pixbuf = thumb_pixbuf;
- g_object_ref (tmp_pixbuf);
- break;
- }
-
- if (gdk_pixbuf_get_width (tmp_pixbuf) > gdk_pixbuf_get_height (tmp_pixbuf))
- {
- height = (gint)(((gdouble)gdk_pixbuf_get_height (tmp_pixbuf) / (gdouble)gdk_pixbuf_get_width (tmp_pixbuf)) * width);
- }
- else
- {
- width = (gint)(((gdouble)gdk_pixbuf_get_width (tmp_pixbuf) / (gdouble)gdk_pixbuf_get_height (tmp_pixbuf)) * height);
- }
-
- gdk_pixbuf_fill (thumb->priv->pixbuf, 0x00000000);
-
- dst_thumb_pixbuf = gdk_pixbuf_scale_simple (tmp_pixbuf, width, height, GDK_INTERP_BILINEAR);
-
- g_object_unref (tmp_pixbuf);
- tmp_pixbuf = NULL;
-
- gdk_pixbuf_copy_area (dst_thumb_pixbuf,
- 0, 0,
- width, height,
- thumb->priv->pixbuf,
- (gint)((gdouble)(gdk_pixbuf_get_width (thumb->priv->pixbuf) - width))/2,
- (gint)((gdouble)(gdk_pixbuf_get_height (thumb->priv->pixbuf) - height))/2
- );
-
- g_object_unref (dst_thumb_pixbuf);
- g_object_unref (thumb_pixbuf);
- }
-
-
- gdk_window_begin_paint_region(widget->window, event->region);
- rstto_thumbnail_paint(thumb);
- gdk_window_end_paint(widget->window);
- }
-
- return FALSE;
-}
-
-static void
-rstto_thumbnail_paint(RsttoThumbnail *thumb)
-{
- GtkWidget *widget = GTK_WIDGET(thumb);
-
- GtkStateType state = GTK_WIDGET_STATE(widget);
-
- if (GTK_WIDGET_STATE(widget) != GTK_STATE_PRELIGHT)
- {
- }
-
- gtk_paint_box(widget->style,
- widget->window,
- state,
- GTK_SHADOW_ETCHED_IN,
- NULL,
- widget,
- NULL,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width, widget->allocation.height);
-
- if (thumb->priv->pixbuf)
- {
- gdk_draw_pixbuf(GDK_DRAWABLE(widget->window),
- NULL,
- thumb->priv->pixbuf,
- 0, 0,
- (0.5 * (widget->allocation.width - gdk_pixbuf_get_width(thumb->priv->pixbuf))) + widget->allocation.x,
- (0.5 * (widget->allocation.height - gdk_pixbuf_get_height(thumb->priv->pixbuf))) + widget->allocation.y,
- -1, -1,
- GDK_RGB_DITHER_NORMAL,
- 0, 0);
- }
-}
-
-GtkWidget *
-rstto_thumbnail_new (RsttoFile *file)
-{
- const gchar *file_uri;
- gchar *file_uri_checksum;
- gchar *filename;
-
- RsttoThumbnail *thumb;
-
- g_return_val_if_fail (file != NULL, NULL);
-
- thumb = g_object_new(RSTTO_TYPE_THUMBNAIL, NULL);
-
- thumb->priv->file = file ;
- g_object_ref (file);
-
- file_uri = rstto_file_get_uri (file);
- file_uri_checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, file_uri, strlen (file_uri));
- filename = g_strconcat (file_uri_checksum, ".png", NULL);
-
- thumb->priv->thumbnail_path = g_build_path ("/", g_get_home_dir(), ".thumbnails", "normal", filename, NULL);
-
- gtk_widget_set_tooltip_text(GTK_WIDGET(thumb), rstto_file_get_display_name (file));
-
- g_free (file_uri_checksum);
- g_free (filename);
- return GTK_WIDGET(thumb);
-}
-
-RsttoFile *
-rstto_thumbnail_get_file (RsttoThumbnail *thumb)
-{
- return thumb->priv->file;
-}
-
-/* CALLBACKS */
-/*************/
-
-static void
-rstto_thumbnail_clicked (GtkButton *button)
-{
- gtk_widget_queue_draw (GTK_WIDGET (button));
-}
-
-static void
-rstto_thumbnail_enter (GtkButton *button)
-{
- gtk_widget_set_state (GTK_WIDGET (button), GTK_STATE_PRELIGHT);
- gtk_widget_queue_draw (GTK_WIDGET (button));
-}
-
-static void
-rstto_thumbnail_leave (GtkButton *button)
-{
- gtk_widget_set_state (GTK_WIDGET (button), GTK_STATE_NORMAL);
- gtk_widget_queue_draw (GTK_WIDGET (button));
-}
-
-void
-rstto_thumbnail_update (RsttoThumbnail *thumb)
-{
- if (thumb->priv->thumb_pixbuf)
- {
- g_object_unref (thumb->priv->thumb_pixbuf);
- }
- thumb->priv->thumb_pixbuf = gdk_pixbuf_new_from_file_at_scale (thumb->priv->thumbnail_path, 128, 128, TRUE, NULL);
- gtk_widget_queue_draw (GTK_WIDGET (thumb));
-}
diff --git a/src/thumbnail.h b/src/thumbnail.h
deleted file mode 100644
index cd07599..0000000
--- a/src/thumbnail.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) Stephan Arts 2006-2010 <stephan at 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __RISTRETTO_THUMBNAIL_H__
-#define __RISTRETTO_THUMBNAIL_H__
-
-G_BEGIN_DECLS
-
-#define RSTTO_TYPE_THUMBNAIL rstto_thumbnail_get_type()
-
-#define RSTTO_THUMBNAIL(obj)( \
- G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- RSTTO_TYPE_THUMBNAIL, \
- RsttoThumbnail))
-
-#define RSTTO_IS_THUMBNAIL(obj)( \
- G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
- RSTTO_TYPE_THUMBNAIL))
-
-#define RSTTO_THUMBNAIL_CLASS(klass)( \
- G_TYPE_CHECK_CLASS_CAST ((klass), \
- RSTTO_TYPE_THUMBNAIL, \
- RsttoThumbnailClass))
-
-#define RSTTO_IS_THUMBNAIL_CLASS(klass)( \
- G_TYPE_CHECK_CLASS_TYPE ((klass), \
- RSTTO_TYPE_THUMBNAIL()))
-
-typedef struct _RsttoThumbnailPriv RsttoThumbnailPriv;
-
-typedef struct _RsttoThumbnail RsttoThumbnail;
-
-struct _RsttoThumbnail
-{
- GtkButton parent;
- RsttoThumbnailPriv *priv;
- gboolean selected;
-};
-
-typedef struct _RsttoThumbnailClass RsttoThumbnailClass;
-
-struct _RsttoThumbnailClass
-{
- GtkButtonClass parent_class;
-};
-
-GType rstto_thumbnail_get_type();
-
-GtkWidget *rstto_thumbnail_new ( RsttoFile * );
-
-RsttoFile *
-rstto_thumbnail_get_file (RsttoThumbnail *thumb);
-
-
-void rstto_thumbnail_update (RsttoThumbnail *thumb);
-
-G_END_DECLS
-
-#endif /* __RISTRETTO_THUMBNAIL_H__ */
diff --git a/src/thumbnail_bar.c b/src/thumbnail_bar.c
deleted file mode 100644
index 1051bba..0000000
--- a/src/thumbnail_bar.c
+++ /dev/null
@@ -1,991 +0,0 @@
-/*
- * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkmarshal.h>
-#include <string.h>
-
-#include <gio/gio.h>
-
-#include <libxfce4ui/libxfce4ui.h>
-#include <libexif/exif-data.h>
-
-#include "util.h"
-#include "file.h"
-#include "image_list.h"
-#include "thumbnail.h"
-#include "thumbnail_bar.h"
-#include "thumbnailer.h"
-
-struct _RsttoThumbnailBarPriv
-{
- GtkOrientation orientation;
- gint dimension;
- gint offset;
- gboolean auto_center;
- gint begin;
- gint end;
-
- RsttoImageList *image_list;
- RsttoImageListIter *iter;
- RsttoImageListIter *internal_iter;
- GList *thumbs;
- gint scroll_speed;
- struct
- {
- gdouble current_x;
- gdouble current_y;
- gint offset;
- gboolean motion;
- } motion;
-
- RsttoThumbnailer *thumbnailer;
-};
-
-static void
-rstto_thumbnail_bar_init(RsttoThumbnailBar *);
-static void
-rstto_thumbnail_bar_class_init(RsttoThumbnailBarClass *);
-
-static void
-rstto_thumbnail_bar_dispose (GObject *object);
-
-static void
-rstto_thumbnail_bar_size_request(GtkWidget *, GtkRequisition *);
-static void
-rstto_thumbnail_bar_size_allocate(GtkWidget *, GtkAllocation *);
-static gboolean
-rstto_thumbnail_bar_expose(GtkWidget *, GdkEventExpose *);
-static void
-rstto_thumbnail_bar_realize(GtkWidget *widget);
-static void
-rstto_thumbnail_bar_unrealize(GtkWidget *widget);
-
-static void
-cb_rstto_thumbnail_bar_image_list_new_file (
- RsttoImageList *image_list,
- RsttoFile *file,
- gpointer user_data);
-static void
-cb_rstto_thumbnail_bar_image_list_remove_file (
- RsttoImageList *image_list,
- RsttoFile *file,
- gpointer user_data);
-static void
-cb_rstto_thumbnail_bar_image_list_remove_all (RsttoImageList *image_list, gpointer user_data);
-void
-cb_rstto_thumbnail_bar_image_list_iter_changed (RsttoImageListIter *iter, gpointer user_data);
-
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_button_press_event (GtkWidget *thumb, GdkEventButton *event);
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_button_release_event (GtkWidget *thumb, GdkEventButton *event);
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_motion_notify_event (GtkWidget *thumb,
- GdkEventMotion *event,
- gpointer user_data);
-
-static gboolean
-cb_rstto_thumbnail_bar_scroll_event (RsttoThumbnailBar *bar,
- GdkEventScroll *event,
- gpointer *user_data);
-
-static void
-rstto_thumbnail_bar_add(GtkContainer *container, GtkWidget *child);
-static void
-rstto_thumbnail_bar_remove(GtkContainer *container, GtkWidget *child);
-static void
-rstto_thumbnail_bar_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
-static GType
-rstto_thumbnail_bar_child_type(GtkContainer *container);
-
-static GtkWidgetClass *parent_class = NULL;
-
-static void
-cb_rstto_thumbnail_bar_thumbnail_clicked (GtkWidget *thumb, RsttoThumbnailBar *bar);
-
-static gint
-cb_rstto_thumbnail_bar_compare (GtkWidget *a, GtkWidget *b, gpointer);
-
-GType
-rstto_thumbnail_bar_get_type (void)
-{
- static GType rstto_thumbnail_bar_type = 0;
-
- if (!rstto_thumbnail_bar_type)
- {
- static const GTypeInfo rstto_thumbnail_bar_info =
- {
- sizeof (RsttoThumbnailBarClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) rstto_thumbnail_bar_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (RsttoThumbnailBar),
- 0,
- (GInstanceInitFunc) rstto_thumbnail_bar_init,
- NULL
- };
-
- rstto_thumbnail_bar_type = g_type_register_static (GTK_TYPE_CONTAINER, "RsttoThumbnailBar", &rstto_thumbnail_bar_info, 0);
- }
- return rstto_thumbnail_bar_type;
-}
-
-
-static void
-rstto_thumbnail_bar_init(RsttoThumbnailBar *bar)
-{
- RsttoThumbnailBarPriv *priv;
-
- priv = G_TYPE_INSTANCE_GET_PRIVATE (
- bar,
- RSTTO_TYPE_THUMBNAIL_BAR,
- RsttoThumbnailBarPriv);
-
- bar->priv = priv;
-
- bar->priv->auto_center = TRUE;
- bar->priv->thumbnailer = rstto_thumbnailer_new();
-
- GTK_WIDGET_UNSET_FLAGS(bar, GTK_NO_WINDOW);
- gtk_widget_set_redraw_on_allocate(GTK_WIDGET(bar), TRUE);
- gtk_widget_set_events (GTK_WIDGET(bar),
- GDK_SCROLL_MASK);
-
- bar->priv->orientation = GTK_ORIENTATION_VERTICAL;
- bar->priv->offset = 0;
- bar->priv->scroll_speed = 20;
-
-
- g_signal_connect(G_OBJECT(bar), "scroll_event", G_CALLBACK(cb_rstto_thumbnail_bar_scroll_event), NULL);
-
-}
-
-static void
-rstto_thumbnail_bar_class_init(RsttoThumbnailBarClass *bar_class)
-{
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- GObjectClass *object_class = (GObjectClass*)bar_class;
-
- widget_class = (GtkWidgetClass*)bar_class;
- container_class = (GtkContainerClass*)bar_class;
-
- parent_class = g_type_class_peek_parent(bar_class);
-
- object_class->dispose = rstto_thumbnail_bar_dispose;
-
- widget_class->size_request = rstto_thumbnail_bar_size_request;
- widget_class->size_allocate = rstto_thumbnail_bar_size_allocate;
- widget_class->expose_event = rstto_thumbnail_bar_expose;
- widget_class->realize = rstto_thumbnail_bar_realize;
- widget_class->unrealize = rstto_thumbnail_bar_unrealize;
-
- container_class->add = rstto_thumbnail_bar_add;
- container_class->remove = rstto_thumbnail_bar_remove;
- container_class->forall = rstto_thumbnail_bar_forall;
- container_class->child_type = rstto_thumbnail_bar_child_type;
-
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("spacing",
- _("Spacing"),
- _("The amount of space between the thumbnails"),
- 0, G_MAXINT, 3,
- G_PARAM_READABLE));
-
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("border-width",
- _("border width"),
- _("the border width of the thumbnail bar"),
- 0, G_MAXINT, 0,
- G_PARAM_READABLE));
-
- g_type_class_add_private (bar_class, sizeof (RsttoThumbnailBarPriv));
-}
-
-
-static void
-rstto_thumbnail_bar_dispose (GObject *object)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (object);
-
- if (bar->priv)
- {
- if (bar->priv->image_list)
- {
- g_object_unref (bar->priv->image_list);
- bar->priv->image_list = NULL;
- }
-
- if (bar->priv->thumbnailer)
- {
- g_object_unref (bar->priv->thumbnailer);
- bar->priv->thumbnailer = NULL;
- }
- }
-
- G_OBJECT_CLASS (parent_class)->dispose(object);
-}
-
-static void
-rstto_thumbnail_bar_size_request(GtkWidget *widget, GtkRequisition *requisition)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(widget);
- gint border_width;
- GList *iter;
- GtkRequisition child_requisition;
-
- gtk_widget_style_get (widget, "border-width", &border_width, NULL);
-
- requisition->height = 70;
- requisition->width = 70;
-
- for(iter = bar->priv->thumbs; iter; iter = g_list_next(iter))
- {
- gtk_widget_size_request(GTK_WIDGET(iter->data), &child_requisition);
- requisition->width = MAX(child_requisition.width, requisition->width);
- requisition->height = MAX(child_requisition.height, requisition->height);
- }
-
- switch (bar->priv->orientation)
- {
- case GTK_ORIENTATION_HORIZONTAL:
- requisition->height += (border_width * 2);
- requisition->width += (border_width * 2);
- break;
- case GTK_ORIENTATION_VERTICAL:
- requisition->height += (border_width * 2);
- requisition->width += (border_width * 2);
- break;
- }
-
- widget->requisition = *requisition;
- GTK_CONTAINER(bar)->border_width = border_width;
-}
-
-static void
-rstto_thumbnail_bar_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(widget);
- gint border_width = GTK_CONTAINER(bar)->border_width;
- gint spacing = 0;
- GtkAllocation child_allocation;
- GtkRequisition child_requisition;
- GList *iter = bar->priv->thumbs;
-
- gtk_widget_style_get(widget, "spacing", &spacing, NULL);
- widget->allocation = *allocation;
-
- child_allocation.x = border_width;
- child_allocation.y = border_width;
- child_allocation.height = border_width * 2;
- child_allocation.width = border_width * 2;
-
-
- if (GTK_WIDGET_REALIZED(widget))
- {
- gdk_window_move_resize (widget->window,
- allocation->x,
- allocation->y,
- allocation->width,
- allocation->height);
- }
-
-
- switch(bar->priv->orientation)
- {
- case GTK_ORIENTATION_HORIZONTAL:
- if (bar->priv->auto_center == TRUE)
- {
- bar->priv->offset = 0 - (allocation->width / 2);
- }
- while(iter)
- {
- gtk_widget_get_child_requisition(GTK_WIDGET(iter->data), &child_requisition);
- allocation->height = MAX(child_requisition.height + (border_width * 2), allocation->height);
-
- if (bar->priv->auto_center == TRUE)
- {
- if (g_list_position (bar->priv->thumbs, iter) < rstto_image_list_iter_get_position (bar->priv->iter))
- {
- bar->priv->offset += allocation->height + spacing;
- }
- if (g_list_position (bar->priv->thumbs, iter) == rstto_image_list_iter_get_position (bar->priv->iter))
- {
- bar->priv->offset += 0.5 * allocation->height;
- }
- }
-
- iter = g_list_next(iter);
- }
-
- child_allocation.x -= bar->priv->offset;
-
- iter = bar->priv->thumbs;
-
- while(iter)
- {
- gtk_widget_get_child_requisition(GTK_WIDGET(iter->data), &child_requisition);
- child_allocation.height = allocation->height - (border_width * 2);
- child_allocation.width = child_allocation.height;
-
- if ((child_allocation.x < (allocation->x + allocation->width)) &&
- ((child_allocation.x + child_allocation.width) > allocation->x + border_width))
- {
- gtk_widget_set_child_visible(GTK_WIDGET(iter->data), TRUE);
- gtk_widget_size_allocate(GTK_WIDGET(iter->data), &child_allocation);
-
- /* Do thumbnailing stuff */
- rstto_thumbnailer_queue_thumbnail (bar->priv->thumbnailer, iter->data);
- }
- else
- {
- gtk_widget_set_child_visible(GTK_WIDGET(iter->data), FALSE);
-
- rstto_thumbnailer_dequeue_thumbnail (bar->priv->thumbnailer, iter->data);
- }
-
- child_allocation.x += child_allocation.width + spacing;
- iter = g_list_next(iter);
- }
- break;
- case GTK_ORIENTATION_VERTICAL:
- if (bar->priv->auto_center == TRUE)
- {
- bar->priv->offset = 0 - (allocation->height / 2);
- }
- while(iter)
- {
- gtk_widget_get_child_requisition(GTK_WIDGET(iter->data), &child_requisition);
- allocation->width = MAX(child_requisition.width + (border_width * 2), allocation->width);
-
- if (bar->priv->auto_center == TRUE)
- {
- if (g_list_position (bar->priv->thumbs, iter) < rstto_image_list_iter_get_position (bar->priv->iter))
- {
- bar->priv->offset += allocation->width + spacing;
- }
- if (g_list_position (bar->priv->thumbs, iter) == rstto_image_list_iter_get_position (bar->priv->iter))
- {
- bar->priv->offset += 0.5 * allocation->width;
- }
- }
-
- iter = g_list_next(iter);
- }
-
- child_allocation.y -= bar->priv->offset;
-
- iter = bar->priv->thumbs;
-
- while(iter)
- {
-
- gtk_widget_get_child_requisition(GTK_WIDGET(iter->data), &child_requisition);
- child_allocation.width = allocation->width - (border_width * 2);
- child_allocation.height = child_allocation.width;
-
- if (child_allocation.y < (allocation->y + allocation->height))
- {
- gtk_widget_set_child_visible(GTK_WIDGET(iter->data), TRUE);
- gtk_widget_size_allocate(GTK_WIDGET(iter->data), &child_allocation);
-
- /* Do thumbnailing stuff */
- rstto_thumbnailer_queue_thumbnail (bar->priv->thumbnailer, iter->data);
- }
- else
- {
- gtk_widget_set_child_visible(GTK_WIDGET(iter->data), FALSE);
- rstto_thumbnailer_dequeue_thumbnail (bar->priv->thumbnailer, iter->data);
- }
-
- gtk_widget_size_allocate(GTK_WIDGET(iter->data), &child_allocation);
- child_allocation.y += child_allocation.height + spacing;
- iter = g_list_next(iter);
- }
- break;
- }
-}
-
-static gboolean
-rstto_thumbnail_bar_expose(GtkWidget *widget, GdkEventExpose *ex)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(widget);
-
- GList *iter = bar->priv->thumbs;
-
- GdkEventExpose *n_ex = g_new0(GdkEventExpose, 1);
-
- GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(widget->window));
- gint border_width = GTK_CONTAINER(bar)->border_width;
- GdkColor color, dot_color, bar_color;
- color.red= 0;
- color.green= 0;
- color.blue= 0;
- dot_color.red = 0xffff;
- dot_color.green = 0xffff;
- dot_color.blue = 0xffff;
- bar_color.red = 0x4444;
- bar_color.green = 0x4444;
- bar_color.blue = 0x4444;
-
- n_ex->type = ex->type;
- n_ex->window = ex->window;
- n_ex->send_event = ex->send_event;
- n_ex->area.x = border_width;
- n_ex->area.y = border_width;
- n_ex->area.width = ex->area.width;
- n_ex->area.height = ex->area.height;
- n_ex->count = ex->count;
-
- gdk_colormap_alloc_color (gdk_gc_get_colormap (gc), &color, FALSE, TRUE);
- gdk_colormap_alloc_color (gdk_gc_get_colormap (gc), &dot_color, FALSE, TRUE);
- gdk_colormap_alloc_color (gdk_gc_get_colormap (gc), &bar_color, FALSE, TRUE);
- gdk_gc_set_rgb_fg_color (gc, &color);
-
- while(iter)
- {
-
- if (GTK_WIDGET_VISIBLE(iter->data) == TRUE)
- {
- switch (bar->priv->orientation)
- {
- case GTK_ORIENTATION_HORIZONTAL:
- /* why are these widgets not filtered out with the GTK_WIDGET_VISIBLE macro?*/
- if (GTK_WIDGET(iter->data)->allocation.x > GTK_WIDGET(bar)->allocation.width)
- break;
- if ((GTK_WIDGET(iter->data)->allocation.x + GTK_WIDGET(iter->data)->allocation.width) < 0)
- break;
-
- /* first (partially) visible thumbnail */
- if (GTK_WIDGET(iter->data)->allocation.x < 0)
- {
- n_ex->area.x = 0;
- n_ex->area.width = GTK_WIDGET(iter->data)->allocation.width;
- }
- else
- {
- /* last (partially) visible thumbnail */
- if ((GTK_WIDGET(bar)->allocation.x + (GTK_WIDGET(bar)->allocation.width)) <
- (GTK_WIDGET(iter->data)->allocation.x + GTK_WIDGET(iter->data)->allocation.width))
- {
- n_ex->area.x = GTK_WIDGET(iter->data)->allocation.x;
- n_ex->area.width = GTK_WIDGET(bar)->allocation.x + GTK_WIDGET(bar)->allocation.width - n_ex->area.x;
- }
- else
- {
- /* everything in between */
- n_ex->area.x = GTK_WIDGET(iter->data)->allocation.x;
- n_ex->area.width = GTK_WIDGET(bar)->allocation.width - n_ex->area.x;
- }
-
- }
- if (n_ex->region)
- gdk_region_destroy(n_ex->region);
- n_ex->region = gdk_region_rectangle(&(n_ex->area));
- gtk_container_propagate_expose(GTK_CONTAINER(widget), GTK_WIDGET(iter->data), n_ex);
- break;
- case GTK_ORIENTATION_VERTICAL:
- /* why are these widgets not filtered out with the GTK_WIDGET_VISIBLE macro?*/
- if (GTK_WIDGET(iter->data)->allocation.y > GTK_WIDGET(bar)->allocation.height)
- break;
- if ((GTK_WIDGET(iter->data)->allocation.y + GTK_WIDGET(iter->data)->allocation.height) < 0 )
- break;
-
- /* first (partially) visible thumbnail */
- if (GTK_WIDGET(iter->data)->allocation.y < 0)
- {
- n_ex->area.y = 0;
- n_ex->area.height = GTK_WIDGET(iter->data)->allocation.height;
- }
- else
- {
- /* last (partially) visible thumbnail */
- if ((GTK_WIDGET(bar)->allocation.y + (GTK_WIDGET(bar)->allocation.height)) <
- (GTK_WIDGET(iter->data)->allocation.y + GTK_WIDGET(iter->data)->allocation.height))
- {
- n_ex->area.y = GTK_WIDGET(iter->data)->allocation.y;
- n_ex->area.height = GTK_WIDGET(bar)->allocation.y + GTK_WIDGET(bar)->allocation.height - n_ex->area.y;
- }
- else
- {
- /* everything in between */
- n_ex->area.y = GTK_WIDGET(iter->data)->allocation.y;
- n_ex->area.height = GTK_WIDGET(bar)->allocation.height - n_ex->area.y;
- }
-
- }
- if (n_ex->region)
- gdk_region_destroy(n_ex->region);
- n_ex->region = gdk_region_rectangle(&(n_ex->area));
- gtk_container_propagate_expose(GTK_CONTAINER(widget), GTK_WIDGET(iter->data), n_ex);
- break;
- }
- }
- iter = g_list_next(iter);
- }
-
- return FALSE;
-}
-
-static void
-rstto_thumbnail_bar_realize(GtkWidget *widget)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(widget);
-
- GdkWindowAttr attributes;
- gint attributes_mask;
- gint border_width = 0;
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
- attributes.x = widget->allocation.x + border_width;
- attributes.y = widget->allocation.y + border_width;
- attributes.width = widget->allocation.width - border_width * 2;
- attributes.height = widget->allocation.height - border_width * 2;
- attributes.window_type = GDK_WINDOW_CHILD;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
- attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
-
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, bar);
-
- attributes.x = 0;
- attributes.y = 0;
- widget->style = gtk_style_attach (widget->style, widget->window);
- gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-}
-
-static void
-rstto_thumbnail_bar_unrealize(GtkWidget *widget)
-{
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
-
-}
-
-GtkWidget *
-rstto_thumbnail_bar_new (RsttoImageList *nav)
-{
- RsttoThumbnailBar *bar;
-
- bar = g_object_new(RSTTO_TYPE_THUMBNAIL_BAR, NULL);
-
- rstto_thumbnail_bar_set_image_list (bar, nav);
-
- return (GtkWidget *)bar;
-}
-
-void
-rstto_thumbnail_bar_set_image_list (RsttoThumbnailBar *bar, RsttoImageList *nav)
-{
- if (bar->priv->image_list)
- {
- g_object_unref (bar->priv->image_list);
- bar->priv->image_list = NULL;
- }
-
- bar->priv->image_list = nav;
-
- if (bar->priv->image_list)
- {
- g_signal_connect (G_OBJECT (bar->priv->image_list), "new-image", G_CALLBACK (cb_rstto_thumbnail_bar_image_list_new_file), bar);
- g_signal_connect (G_OBJECT (bar->priv->image_list), "remove-image", G_CALLBACK (cb_rstto_thumbnail_bar_image_list_remove_file), bar);
- g_signal_connect (G_OBJECT (bar->priv->image_list), "remove-all", G_CALLBACK (cb_rstto_thumbnail_bar_image_list_remove_all), bar);
- g_object_ref (nav);
- }
-}
-/*
- * rstto_thumbnail_bar_set_orientation:
- *
- * @bar : ThumbnailBar
- * @orientation :
- *
- */
-void
-rstto_thumbnail_bar_set_orientation (RsttoThumbnailBar *bar, GtkOrientation orientation)
-{
- bar->priv->orientation = orientation;
-}
-
-/*
- * rstto_thumbnail_bar_get_orientation:
- *
- * @bar : ThumbnailBar
- *
- * Return value : GtkOrientation
- *
- */
-GtkOrientation
-rstto_thumbnail_bar_get_orientation (RsttoThumbnailBar *bar)
-{
- return bar->priv->orientation;
-}
-
-static void
-rstto_thumbnail_bar_add(GtkContainer *container, GtkWidget *child)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(container);
- g_return_if_fail(GTK_IS_WIDGET(child));
-
- gtk_widget_set_parent(child, GTK_WIDGET(container));
-
- bar->priv->thumbs = g_list_insert_sorted_with_data (bar->priv->thumbs, child, (GCompareDataFunc)cb_rstto_thumbnail_bar_compare, bar);
-}
-
-static void
-rstto_thumbnail_bar_remove(GtkContainer *container, GtkWidget *child)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(container);
- gboolean widget_was_visible;
-
- g_return_if_fail(GTK_IS_WIDGET(child));
-
-
- widget_was_visible = GTK_WIDGET_VISIBLE(child);
-
- /* Check if there still is a thumbnailer present */
- if (NULL != bar->priv->thumbnailer)
- {
- rstto_thumbnailer_dequeue_thumbnail (bar->priv->thumbnailer, RSTTO_THUMBNAIL(child));
- }
-
- bar->priv->thumbs = g_list_remove(bar->priv->thumbs, child);
-
- gtk_widget_unparent(child);
-
- /* remove from list is somewhere else */
- if(widget_was_visible)
- gtk_widget_queue_resize(GTK_WIDGET(container));
-}
-
-static void
-rstto_thumbnail_bar_forall (
- GtkContainer *container,
- gboolean include_internals,
- GtkCallback callback,
- gpointer callback_data )
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(container);
-
- g_return_if_fail(callback != NULL);
-
- g_list_foreach(bar->priv->thumbs, (GFunc)callback, callback_data);
-}
-
-static GType
-rstto_thumbnail_bar_child_type(GtkContainer *container)
-{
- return GTK_TYPE_WIDGET;
-}
-
-
-static gint
-cb_rstto_thumbnail_bar_compare (GtkWidget *a, GtkWidget *b, gpointer user_data)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (user_data);
- RsttoFile *a_i = rstto_thumbnail_get_file (RSTTO_THUMBNAIL (a));
- RsttoFile *b_i = rstto_thumbnail_get_file (RSTTO_THUMBNAIL (b));
-
- return rstto_image_list_get_compare_func (bar->priv->image_list) (a_i, b_i);
-}
-
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_button_press_event (GtkWidget *thumb, GdkEventButton *event)
-{
- if(event->button == 1)
- {
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(gtk_widget_get_parent(GTK_WIDGET(thumb)));
-
- bar->priv->motion.offset = bar->priv->offset;
- if (bar->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- gdouble x = event->x + GTK_WIDGET(thumb)->allocation.x;
- bar->priv->motion.current_x = x;
- }
- else
- {
- gdouble y = event->y + GTK_WIDGET(thumb)->allocation.y;
- bar->priv->motion.current_y = y;
- }
- }
-
- return FALSE;
-}
-
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_button_release_event (GtkWidget *thumb, GdkEventButton *event)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(gtk_widget_get_parent(GTK_WIDGET(thumb)));
- if(event->button == 1)
- {
- GtkWidget *widget = GTK_WIDGET(thumb);
- gdk_window_set_cursor(widget->window, NULL);
- if (bar->priv->motion.motion == TRUE)
- {
- bar->priv->motion.motion = FALSE;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static gboolean
-cb_rstto_thumbnail_bar_thumbnail_motion_notify_event (GtkWidget *thumb,
- GdkEventMotion *event,
- gpointer user_data)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR(gtk_widget_get_parent(GTK_WIDGET(thumb)));
- gdouble x = event->x + GTK_WIDGET(thumb)->allocation.x;
- gdouble y = event->y + GTK_WIDGET(thumb)->allocation.y;
- gint thumb_size = GTK_WIDGET(bar->priv->thumbs->data)->allocation.width;
- gint border_width = 0;
- gint spacing;
- gint size = 0;
-
- gtk_widget_style_get(GTK_WIDGET (bar), "spacing", &spacing, NULL);
- size = thumb_size * g_list_length (bar->priv->thumbs) + spacing * (g_list_length (bar->priv->thumbs) - 1);
-
- if (event->state & GDK_BUTTON1_MASK)
- {
- GtkWidget *widget = GTK_WIDGET(thumb);
- GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
- gdk_window_set_cursor(widget->window, cursor);
- gdk_cursor_unref(cursor);
-
- bar->priv->motion.motion = TRUE;
- bar->priv->auto_center = FALSE;
- if (bar->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- bar->priv->offset = bar->priv->motion.offset + (bar->priv->motion.current_x - x);
- if ((thumb_size - GTK_WIDGET(bar)->allocation.width) >= bar->priv->offset)
- bar->priv->offset = thumb_size - GTK_WIDGET(bar)->allocation.width + border_width;
- if ((size - thumb_size) <= bar->priv->offset)
- bar->priv->offset = size - thumb_size;
- }
- else
- {
- bar->priv->offset = bar->priv->motion.offset + (bar->priv->motion.current_y - y);
- if ((thumb_size - GTK_WIDGET(bar)->allocation.height) >= bar->priv->offset)
- bar->priv->offset = thumb_size - GTK_WIDGET(bar)->allocation.height + border_width;
- if ((size - thumb_size) <= bar->priv->offset)
- bar->priv->offset = size - thumb_size;
- }
-
-
- bar->priv->motion.offset = bar->priv->offset;
- bar->priv->motion.current_x = x;
- bar->priv->motion.current_y = y;
- gtk_widget_queue_resize(GTK_WIDGET(bar));
- }
- return FALSE;
-}
-
-static gboolean
-cb_rstto_thumbnail_bar_scroll_event (RsttoThumbnailBar *bar,
- GdkEventScroll *event,
- gpointer *user_data)
-{
- gint thumb_size;
- GList *thumb;
- gint border_width = GTK_CONTAINER(bar)->border_width;
- gint spacing = 0;
- GtkWidget *widget = GTK_WIDGET (bar);
-
- gtk_widget_style_get(widget, "spacing", &spacing, NULL);
-
- switch(event->direction)
- {
- case GDK_SCROLL_UP:
- case GDK_SCROLL_LEFT:
- if (bar->priv->thumbs)
- {
- bar->priv->auto_center = FALSE;
- bar->priv->offset -= bar->priv->scroll_speed;
- switch(bar->priv->orientation)
- {
- case GTK_ORIENTATION_HORIZONTAL:
- thumb_size = GTK_WIDGET(bar->priv->thumbs->data)->allocation.width;
- if ((thumb_size - GTK_WIDGET(bar)->allocation.width) >= bar->priv->offset)
- bar->priv->offset = thumb_size - GTK_WIDGET(bar)->allocation.width + border_width;
- break;
- case GTK_ORIENTATION_VERTICAL:
- thumb_size = GTK_WIDGET(bar->priv->thumbs->data)->allocation.height;
- if ((thumb_size - GTK_WIDGET(bar)->allocation.height) >= bar->priv->offset)
- bar->priv->offset = thumb_size - GTK_WIDGET(bar)->allocation.height + border_width;
- break;
- }
- }
- break;
- case GDK_SCROLL_DOWN:
- case GDK_SCROLL_RIGHT:
- if (bar->priv->thumbs)
- {
- gint size = 0;
- bar->priv->auto_center = FALSE;
- bar->priv->offset += bar->priv->scroll_speed;
- switch(bar->priv->orientation)
- {
- case GTK_ORIENTATION_HORIZONTAL:
- thumb_size = GTK_WIDGET(bar->priv->thumbs->data)->allocation.width;
- for (thumb = bar->priv->thumbs; thumb != NULL; thumb = g_list_next(thumb))
- {
- size += GTK_WIDGET(thumb->data)->allocation.width;
- if (g_list_next (thumb))
- size += spacing;
- }
- if ((size - thumb_size) <= bar->priv->offset)
- bar->priv->offset = size - thumb_size;
- break;
- case GTK_ORIENTATION_VERTICAL:
- thumb_size = GTK_WIDGET(bar->priv->thumbs->data)->allocation.height;
- for (thumb = bar->priv->thumbs; thumb != NULL; thumb = g_list_next(thumb))
- {
- size += GTK_WIDGET(thumb->data)->allocation.height;
- if (g_list_next (thumb))
- size += spacing;
- }
- if ((size - thumb_size) <= bar->priv->offset)
- bar->priv->offset = size - thumb_size;
- break;
- }
- }
- break;
- }
- gtk_widget_queue_resize(GTK_WIDGET(bar));
- return FALSE;
-
-}
-
-void
-rstto_thumbnail_bar_set_iter (RsttoThumbnailBar *bar, RsttoImageListIter *iter)
-{
- if (bar->priv->iter)
- {
- g_signal_handlers_disconnect_by_func (bar->priv->iter, cb_rstto_thumbnail_bar_image_list_iter_changed, bar);
-
- g_object_unref (bar->priv->iter);
- g_object_unref (bar->priv->internal_iter);
- bar->priv->internal_iter = NULL;
- }
-
- bar->priv->iter = iter;
-
- if (bar->priv->iter)
- {
- g_object_ref (bar->priv->iter);
- bar->priv->internal_iter = rstto_image_list_iter_clone (bar->priv->iter);
- g_signal_connect (bar->priv->iter, "changed", G_CALLBACK (cb_rstto_thumbnail_bar_image_list_iter_changed), bar);
- }
-}
-
-void
-cb_rstto_thumbnail_bar_image_list_iter_changed (RsttoImageListIter *iter, gpointer user_data)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (user_data);
-
- bar->priv->thumbs = g_list_sort_with_data (bar->priv->thumbs, (GCompareDataFunc)cb_rstto_thumbnail_bar_compare, bar);
- bar->priv->auto_center = TRUE;
-
- gtk_widget_queue_resize(GTK_WIDGET(bar));
- /* useless, but keepsthe compiler silent */
- bar->priv->begin=0;
-}
-
-static void
-cb_rstto_thumbnail_bar_image_list_new_file (
- RsttoImageList *image_list,
- RsttoFile *file,
- gpointer user_data)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (user_data);
- GtkWidget *thumb;
- GList *iter;
-
- g_return_if_fail (rstto_image_list_iter_find_file (bar->priv->internal_iter, file));
-
- for (iter = bar->priv->thumbs; iter != NULL; iter = g_list_next (iter))
- {
- if (rstto_file_equal(file,rstto_thumbnail_get_file (iter->data)))
- return;
- }
-
- thumb = rstto_thumbnail_new (file);
-
- gtk_container_add (GTK_CONTAINER (bar), thumb);
- gtk_widget_show_all (thumb);
-
- g_signal_connect (thumb, "clicked", G_CALLBACK (cb_rstto_thumbnail_bar_thumbnail_clicked), bar);
- g_signal_connect (thumb, "button_press_event", G_CALLBACK (cb_rstto_thumbnail_bar_thumbnail_button_press_event), bar);
- g_signal_connect (thumb, "button_release_event", G_CALLBACK (cb_rstto_thumbnail_bar_thumbnail_button_release_event), bar);
- g_signal_connect (thumb, "motion_notify_event", G_CALLBACK (cb_rstto_thumbnail_bar_thumbnail_motion_notify_event), bar);
-}
-
-static void
-cb_rstto_thumbnail_bar_image_list_remove_file (
- RsttoImageList *image_list,
- RsttoFile *file,
- gpointer user_data )
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (user_data);
- GList *iter = bar->priv->thumbs;
-
- while (iter)
- {
- if (rstto_file_equal(rstto_thumbnail_get_file(iter->data), file))
- {
- GtkWidget *widget = iter->data;
- gtk_container_remove (GTK_CONTAINER (bar), widget);
- break;
- }
- iter = g_list_next (iter);
- }
-}
-
-static void
-cb_rstto_thumbnail_bar_image_list_remove_all (RsttoImageList *image_list, gpointer user_data)
-{
- RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (user_data);
- if (bar->priv->thumbs)
- {
- g_list_foreach (bar->priv->thumbs, (GFunc)(gtk_widget_destroy), NULL);
- g_list_free (bar->priv->thumbs);
- bar->priv->thumbs = NULL;
- }
-}
-
-
-
-static void
-cb_rstto_thumbnail_bar_thumbnail_clicked (GtkWidget *thumb, RsttoThumbnailBar *bar)
-{
- RsttoFile *file;
-
- g_return_if_fail (bar->priv->iter);
-
- file = rstto_thumbnail_get_file (RSTTO_THUMBNAIL(thumb));
- rstto_image_list_iter_find_file (bar->priv->iter, file);
-}
diff --git a/src/thumbnail_bar.h b/src/thumbnail_bar.h
deleted file mode 100644
index 11e847b..0000000
--- a/src/thumbnail_bar.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __RISTRETTO_THUMBNAIL_BAR_H__
-#define __RISTRETTO_THUMBNAIL_BAR_H__
-
-G_BEGIN_DECLS
-
-#define RSTTO_TYPE_THUMBNAIL_BAR rstto_thumbnail_bar_get_type()
-
-#define RSTTO_THUMBNAIL_BAR(obj)( \
- G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- RSTTO_TYPE_THUMBNAIL_BAR, \
- RsttoThumbnailBar))
-
-#define RSTTO_IS_THUMBNAIL_BAR(obj)( \
- G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
- RSTTO_TYPE_THUMBNAIL_BAR))
-
-#define RSTTO_THUMBNAIL_BAR_CLASS(klass)( \
- G_TYPE_CHECK_CLASS_CAST ((klass), \
- RSTTO_TYPE_THUMBNAIL_BAR, \
- RsttoThumbnailBarClass))
-
-#define RSTTO_IS_THUMBNAIL_BAR_CLASS(klass)( \
- G_TYPE_CHECK_CLASS_TYPE ((klass), \
- RSTTO_TYPE_THUMBNAIL_BAR()))
-
-typedef struct _RsttoThumbnailBarPriv RsttoThumbnailBarPriv;
-
-typedef struct _RsttoThumbnailBar RsttoThumbnailBar;
-
-struct _RsttoThumbnailBar
-{
- GtkContainer parent;
- RsttoThumbnailBarPriv *priv;
- gint film_border_width;
-};
-
-typedef struct _RsttoThumbnailBarClass RsttoThumbnailBarClass;
-
-struct _RsttoThumbnailBarClass
-{
- GtkContainerClass parent_class;
-};
-
-GType rstto_thumbnail_bar_get_type();
-
-GtkWidget *rstto_thumbnail_bar_new();
-
-void rstto_thumbnail_bar_set_orientation (RsttoThumbnailBar *, GtkOrientation);
-GtkOrientation rstto_thumbnail_bar_get_orientation (RsttoThumbnailBar *);
-
-void rstto_thumbnail_bar_set_image_list (RsttoThumbnailBar *bar, RsttoImageList *nav);
-void rstto_thumbnail_bar_set_iter (RsttoThumbnailBar *bar, RsttoImageListIter *iter);
-
-G_END_DECLS
-
-#endif /* __RISTRETTO_THUMBNAIL_BAR_H__ */
diff --git a/src/thumbnailer.c b/src/thumbnailer.c
index bbb37ce..a3d2c85 100644
--- a/src/thumbnailer.c
+++ b/src/thumbnailer.c
@@ -32,7 +32,6 @@
#include "util.h"
#include "file.h"
#include "settings.h"
-#include "thumbnail.h"
#include "thumbnailer.h"
#include "marshal.h"
@@ -151,7 +150,7 @@ rstto_thumbnailer_init (GObject *object)
"org.freedesktop.thumbnails.Thumbnailer1");
dbus_g_object_register_marshaller (
- (GClosureMarshal) rstto_marshal_VOID__UINT_BOXED,
+ (GClosureMarshal) _rstto_marshal_VOID__UINT_BOXED,
G_TYPE_NONE,
G_TYPE_UINT,
G_TYPE_STRV,
@@ -286,13 +285,13 @@ rstto_thumbnailer_get_property (
}
void
-rstto_thumbnailer_queue_thumbnail (
+rstto_thumbnailer_queue_file (
RsttoThumbnailer *thumbnailer,
- RsttoThumbnail *thumb)
+ RsttoFile *file )
{
g_return_if_fail ( RSTTO_IS_THUMBNAILER (thumbnailer) );
- g_return_if_fail ( RSTTO_IS_THUMBNAIL (thumb) );
+ g_return_if_fail ( RSTTO_IS_FILE (file) );
if (thumbnailer->priv->request_timer_id)
{
@@ -310,12 +309,12 @@ rstto_thumbnailer_queue_thumbnail (
}
}
- if (g_slist_find (thumbnailer->priv->queue, thumb) == NULL)
+ if (g_slist_find (thumbnailer->priv->queue, file) == NULL)
{
- g_object_ref (thumb);
+ g_object_ref (file);
thumbnailer->priv->queue = g_slist_prepend (
thumbnailer->priv->queue,
- thumb);
+ file);
}
thumbnailer->priv->request_timer_id = g_timeout_add_full (
@@ -327,13 +326,13 @@ rstto_thumbnailer_queue_thumbnail (
}
void
-rstto_thumbnailer_dequeue_thumbnail (
+rstto_thumbnailer_dequeue_file (
RsttoThumbnailer *thumbnailer,
- RsttoThumbnail *thumb)
+ RsttoFile *file)
{
g_return_if_fail ( RSTTO_IS_THUMBNAILER (thumbnailer) );
- g_return_if_fail ( RSTTO_IS_THUMBNAIL (thumb) );
+ g_return_if_fail ( RSTTO_IS_FILE (file) );
if (thumbnailer->priv->request_timer_id)
{
@@ -351,12 +350,12 @@ rstto_thumbnailer_dequeue_thumbnail (
}
}
- if (g_slist_find (thumbnailer->priv->queue, thumb) != NULL)
+ if (g_slist_find (thumbnailer->priv->queue, file) != NULL)
{
thumbnailer->priv->queue = g_slist_remove_all (
thumbnailer->priv->queue,
- thumb);
- g_object_unref (thumb);
+ file);
+ g_object_unref (file);
}
thumbnailer->priv->request_timer_id = g_timeout_add_full (
@@ -394,7 +393,7 @@ rstto_thumbnailer_queue_request_timer (
{
if (iter->data)
{
- file = rstto_thumbnail_get_file (RSTTO_THUMBNAIL(iter->data));
+ file = RSTTO_FILE(iter->data);
uris[i] = rstto_file_get_uri (file);
mimetypes[i] = rstto_file_get_content_type (file);
}
@@ -491,7 +490,6 @@ cb_rstto_thumbnailer_thumbnail_ready (
gpointer data)
{
RsttoThumbnailer *thumbnailer = RSTTO_THUMBNAILER (data);
- RsttoThumbnail *thumbnail;
RsttoFile *file;
GSList *iter = thumbnailer->priv->queue;
gint x = 0;
@@ -506,16 +504,14 @@ cb_rstto_thumbnailer_thumbnail_ready (
break;
}
- thumbnail = iter->data;
- file = rstto_thumbnail_get_file (thumbnail);
+ file = RSTTO_FILE (iter->data);
f_uri = rstto_file_get_uri (file);
if (strcmp (uri[x], f_uri) == 0)
{
- rstto_thumbnail_update (thumbnail);
thumbnailer->priv->queue = g_slist_remove (
thumbnailer->priv->queue,
- iter->data);
- g_object_unref (thumbnail);
+ file);
+ g_object_unref (file);
iter = thumbnailer->priv->queue;
x++;
diff --git a/src/thumbnailer.h b/src/thumbnailer.h
index 35d8d58..3cc91c4 100644
--- a/src/thumbnailer.h
+++ b/src/thumbnailer.h
@@ -66,13 +66,14 @@ GType
rstto_thumbnailer_get_type (void);
void
-rstto_thumbnailer_queue_thumbnail (
+rstto_thumbnailer_queue_file (
RsttoThumbnailer *thumbnailer,
- RsttoThumbnail *thumb);
+ RsttoFile *file);
void
-rstto_thumbnailer_dequeue_thumbnail (
+rstto_thumbnailer_dequeue_file (
RsttoThumbnailer *thumbnailer,
- RsttoThumbnail *thumb);
+ RsttoFile *file );
+
G_END_DECLS
#endif /* __RISTRETTO_THUMBNAILER_H__ */
diff --git a/src/util.h b/src/util.h
index cbea6bc..e815e26 100644
--- a/src/util.h
+++ b/src/util.h
@@ -47,4 +47,32 @@ typedef enum {
SORT_TYPE_COUNT,
} RsttoSortType;
+typedef enum {
+ THUMBNAIL_SIZE_VERY_SMALL = 0,
+ THUMBNAIL_SIZE_SMALLER,
+ THUMBNAIL_SIZE_SMALL,
+ THUMBNAIL_SIZE_NORMAL,
+ THUMBNAIL_SIZE_LARGE,
+ THUMBNAIL_SIZE_LARGER,
+ THUMBNAIL_SIZE_VERY_LARGE,
+ THUMBNAIL_SIZE_COUNT,
+} RsttoThumbnailSize;
+
+static guint rstto_thumbnail_size[] = {
+ 24,
+ 32,
+ 48,
+ 64,
+ 96,
+ 128,
+ 256};
+
+#define THUMBNAIL_SIZE_VERY_SMALL_SIZE 24
+#define THUMBNAIL_SIZE_SMALLER_SIZE 32
+#define THUMBNAIL_SIZE_SMALL_SIZE 48
+#define THUMBNAIL_SIZE_NORMAL_SIZE 64
+#define THUMBNAIL_SIZE_LARGE_SIZE 96
+#define THUMBNAIL_SIZE_LARGER_SIZE 128
+#define THUMBNAIL_SIZE_VERY_LARGE_SIZE 256
+
#endif /* __RSTTO_UTIL_H__ */
diff --git a/src/xfce_wallpaper_manager.c b/src/xfce_wallpaper_manager.c
index f7e3470..07d1011 100644
--- a/src/xfce_wallpaper_manager.c
+++ b/src/xfce_wallpaper_manager.c
@@ -409,6 +409,11 @@ rstto_xfce_wallpaper_manager_init (GObject *object)
monitor_geometry.height);
}
+ rstto_monitor_chooser_add (
+ RSTTO_MONITOR_CHOOSER (manager->priv->monitor_chooser),
+ 800,
+ 600);
+
gtk_box_pack_start (
GTK_BOX (vbox),
manager->priv->monitor_chooser,
More information about the Xfce4-commits
mailing list