Merge from trunk

This commit is contained in:
Charles Haley 2011-08-02 11:38:19 +01:00
commit 57ef16f70c
11 changed files with 895 additions and 89 deletions

758
imgsrc/random.svg Normal file
View File

@ -0,0 +1,758 @@
<?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://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"
width="128"
height="128"
id="svg10643"
sodipodi:version="0.32"
inkscape:version="0.46+devel"
sodipodi:docname="pointer.svgz"
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
inkscape:export-filename="/home/pinheiro/pics/oxygen-icons/scalable/actions/small/32x32/pointer.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
version="1.0">
<defs
id="defs10645">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 12 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="24 : 12 : 1"
inkscape:persp3d-origin="12 : 8 : 1"
id="perspective108" />
<linearGradient
id="linearGradient3233">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3235" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3237" />
</linearGradient>
<linearGradient
id="linearGradient3866">
<stop
id="stop3868"
offset="0"
style="stop-color:#fff299;stop-opacity:1;" />
<stop
id="stop3870"
offset="1"
style="stop-color:#dcd8bd;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient11059">
<stop
style="stop-color:#727272;stop-opacity:1;"
offset="0"
id="stop11061" />
<stop
id="stop11067"
offset="0.5"
style="stop-color:#a6a6a6;stop-opacity:1;" />
<stop
style="stop-color:#cdcdcd;stop-opacity:1;"
offset="0.75"
id="stop11069" />
<stop
style="stop-color:#acacac;stop-opacity:1;"
offset="1"
id="stop11063" />
</linearGradient>
<linearGradient
id="linearGradient10925">
<stop
style="stop-color:#bf0303;stop-opacity:0;"
offset="0"
id="stop10927" />
<stop
id="stop10978"
offset="0.39309064"
style="stop-color:#bf0303;stop-opacity:0;" />
<stop
id="stop10935"
offset="0.46538317"
style="stop-color:#bf0303;stop-opacity:0.49803922;" />
<stop
style="stop-color:#bf0303;stop-opacity:1;"
offset="0.5"
id="stop10976" />
<stop
id="stop10933"
offset="0.5"
style="stop-color:#bf0303;stop-opacity:1;" />
<stop
style="stop-color:#bf0303;stop-opacity:0.49803922;"
offset="0.55339807"
id="stop10937" />
<stop
id="stop10980"
offset="0.60542935"
style="stop-color:#bf0303;stop-opacity:0;" />
<stop
style="stop-color:#bf0303;stop-opacity:0;"
offset="1"
id="stop10929" />
</linearGradient>
<linearGradient
id="linearGradient10901">
<stop
id="stop10903"
offset="0"
style="stop-color:#fff299;stop-opacity:0;" />
<stop
style="stop-color:#fff299;stop-opacity:1;"
offset="0.5"
id="stop10909" />
<stop
id="stop10905"
offset="1"
style="stop-color:#fff299;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient10854">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop10856" />
<stop
id="stop10862"
offset="0.5"
style="stop-color:#000000;stop-opacity:0;" />
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="1"
id="stop10858" />
</linearGradient>
<linearGradient
id="linearGradient10711">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop10713" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop10715" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient10875"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8967678,0.05935673,-0.05873468,0.8873664,-5.4012494,0.1392525)"
spreadMethod="reflect"
cx="18.708233"
cy="24.759357"
fx="18.708233"
fy="24.759357"
r="13.169441" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10925"
id="radialGradient10931"
cx="9.996233"
cy="23.364098"
fx="7.6629176"
fy="18.295921"
r="8.7188435"
gradientTransform="matrix(3.0577456,1.8802807,-0.9054531,1.4724637,3.4545267,-24.480143)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient10968"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8967678,0.05935673,-0.05873468,0.8873664,-5.4012494,0.1392525)"
spreadMethod="reflect"
cx="18.708233"
cy="24.759357"
fx="18.708233"
fy="24.759357"
r="13.169441" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10925"
id="radialGradient10971"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.7002217,0.5715519,-0.4374946,2.0668853,-4.8632848,-26.818351)"
cx="9.1802711"
cy="24.942194"
fx="6.0336409"
fy="17.669048"
r="8.7188435" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath10999">
<path
sodipodi:nodetypes="ccccc"
id="path11001"
d="M 3.6413483,1.9681703 3.779696,17.490509 14.887308,19.785771 21.079035,17.498126 3.6413483,1.9681703 z"
style="fill:#ff80ff;fill-opacity:1;fill-rule:evenodd;stroke:none" />
</clipPath>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10925"
id="radialGradient11003"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.7002217,0.5715519,-0.4374946,2.0668853,-4.8632848,-26.818351)"
cx="8.2921495"
cy="23.935163"
fx="8.2488832"
fy="19.781427"
r="8.7188435" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10925"
id="radialGradient11030"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.7002217,0.5715519,-0.4374946,2.0668853,-4.8632848,-26.818351)"
cx="8.2921495"
cy="23.935163"
fx="8.2488832"
fy="19.781427"
r="8.7188435" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient11032"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8967678,0.05935673,-0.05873468,0.8873664,-5.4012494,0.1392525)"
spreadMethod="reflect"
cx="18.708233"
cy="24.759357"
fx="18.708233"
fy="24.759357"
r="13.169441" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10925"
id="radialGradient11034"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.7002217,0.5715519,-0.4374946,2.0668853,-4.8632848,-26.818351)"
cx="8.2921495"
cy="23.935163"
fx="8.2488832"
fy="19.781427"
r="8.7188435" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3294"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7030075,0.6357809,-0.8060735,0.8913044,14.84311,-8.1934483)"
spreadMethod="reflect"
cx="16.993044"
cy="20.648924"
fx="16.993044"
fy="20.648924"
r="13.169441" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient3297"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9823337,0,0,0.9823337,0.03300739,0.6182451)"
spreadMethod="pad"
x1="19.879225"
y1="12.061514"
x2="16.034332"
y2="15.552854" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient3353"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9823337,0,0,0.9823337,0.03300739,0.6182451)"
spreadMethod="pad"
x1="19.879225"
y1="12.061514"
x2="16.034332"
y2="15.552854" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3355"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7030075,0.6357809,-0.8060735,0.8913044,14.84311,-8.1934483)"
spreadMethod="reflect"
cx="16.993044"
cy="20.648924"
fx="16.993044"
fy="20.648924"
r="13.169441" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient3362"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9823337,0,0,0.9823337,0.03300739,0.6182451)"
spreadMethod="pad"
x1="19.879225"
y1="12.061514"
x2="16.034332"
y2="15.552854" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3364"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8341244,0.2489558,-0.2435026,0.8158514,0.7851109,-0.01382395)"
spreadMethod="reflect"
cx="17.54755"
cy="21.708042"
fx="17.54755"
fy="21.708042"
r="13.169441" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3367"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8151394,0.2358626,-0.2306962,0.7972824,0.7011221,-1.0582457)"
spreadMethod="reflect"
cx="17.54755"
cy="21.708042"
fx="17.54755"
fy="21.708042"
r="13.169441" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient3370"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9575785,-0.00803118,0.00803118,0.9575785,-0.0268605,-0.4359562)"
spreadMethod="pad"
x1="19.879225"
y1="12.061514"
x2="16.034332"
y2="15.552854" />
<linearGradient
y2="19.626715"
x2="10.711697"
y1="18.63658"
x1="9.7192469"
gradientTransform="matrix(3.547255,-0.03993894,0.03993894,3.547255,-27.397339,-48.790495)"
gradientUnits="userSpaceOnUse"
id="linearGradient3488"
xlink:href="#linearGradient10711"
inkscape:collect="always" />
<radialGradient
r="1.15625"
fy="20.478674"
fx="11.413477"
cy="20.478674"
cx="11.413477"
spreadMethod="pad"
gradientTransform="matrix(1.7083003,-0.01851949,0.01798426,1.6589328,-8.4797796,-13.189665)"
gradientUnits="userSpaceOnUse"
id="radialGradient3486"
xlink:href="#linearGradient3330"
inkscape:collect="always" />
<linearGradient
y2="19.626715"
x2="10.711697"
y1="18.63658"
x1="9.7192469"
gradientTransform="matrix(3.5474799,0,0,3.5474799,-26.927898,-62.356391)"
gradientUnits="userSpaceOnUse"
id="linearGradient3475"
xlink:href="#linearGradient10711"
inkscape:collect="always" />
<radialGradient
r="1.15625"
fy="20.478674"
fx="11.413477"
cy="20.478674"
cx="11.413477"
spreadMethod="pad"
gradientTransform="matrix(1.7083003,-0.01851949,0.01798426,1.6589328,-8.4797796,-13.189665)"
gradientUnits="userSpaceOnUse"
id="radialGradient3473"
xlink:href="#linearGradient3330"
inkscape:collect="always" />
<radialGradient
spreadMethod="reflect"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7809876,0.01449707,-0.0055455,0.2987498,-0.2924169,2.0957246)"
r="11.765625"
fy="10.911069"
fx="1.1416299"
cy="10.911069"
cx="1.1416299"
id="radialGradient3317"
xlink:href="#linearGradient3206"
inkscape:collect="always" />
<linearGradient
y2="26.641653"
x2="16.836901"
y1="6.8943019"
x1="5.6869311"
gradientTransform="translate(0,-7.2094174)"
gradientUnits="userSpaceOnUse"
id="linearGradient3265"
xlink:href="#linearGradient3267"
inkscape:collect="always" />
<linearGradient
y2="17.133453"
x2="16.836901"
y1="-2.6138983"
x1="5.6869311"
gradientTransform="translate(0,2.298783)"
gradientUnits="userSpaceOnUse"
id="linearGradient3261"
xlink:href="#linearGradient3267"
inkscape:collect="always" />
<linearGradient
gradientTransform="translate(0,-4.8361309)"
y2="24.268368"
x2="16.836901"
y1="4.5210156"
x1="5.6869311"
gradientUnits="userSpaceOnUse"
id="linearGradient3257"
xlink:href="#linearGradient3267"
inkscape:collect="always" />
<linearGradient
gradientTransform="translate(0,-2.4628444)"
y2="21.895081"
x2="16.836901"
y1="2.1477292"
x1="5.6869311"
gradientUnits="userSpaceOnUse"
id="linearGradient3249"
xlink:href="#linearGradient3267"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="19.432236"
x2="16.836901"
y1="-0.31511527"
x1="5.6869311"
id="linearGradient3239"
xlink:href="#linearGradient3267"
inkscape:collect="always" />
<linearGradient
y2="19.626715"
x2="10.711697"
y1="18.384007"
x1="9.8687286"
gradientTransform="matrix(3.6334443,0,0,3.6334443,-27.580699,-51.677773)"
gradientUnits="userSpaceOnUse"
id="linearGradient3220"
xlink:href="#linearGradient10711"
inkscape:collect="always" />
<radialGradient
r="1.15625"
fy="20.478674"
fx="11.413477"
cy="20.478674"
cx="11.413477"
spreadMethod="pad"
gradientTransform="matrix(1.7083003,-0.01851949,0.01798426,1.6589328,-8.4797796,-13.189665)"
gradientUnits="userSpaceOnUse"
id="radialGradient3218"
xlink:href="#linearGradient10711"
inkscape:collect="always" />
<linearGradient
id="linearGradient2657">
<stop
id="stop2659"
offset="0"
style="stop-color:#ff80ff;stop-opacity:1;" />
<stop
id="stop2661"
offset="1"
style="stop-color:#ff80ff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient3206">
<stop
style="stop-color:#b1d28f;stop-opacity:1;"
offset="0"
id="stop3208" />
<stop
style="stop-color:#b1d28f;stop-opacity:1;"
offset="1"
id="stop3210" />
</linearGradient>
<linearGradient
id="linearGradient3241">
<stop
id="stop3243"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop3245"
offset="1"
style="stop-color:#debc85;stop-opacity:0" />
</linearGradient>
<linearGradient
id="linearGradient3267">
<stop
style="stop-color:#debc85;stop-opacity:1;"
offset="0"
id="stop3269" />
<stop
style="stop-color:#debc85;stop-opacity:0;"
offset="1"
id="stop3271" />
</linearGradient>
<linearGradient
id="linearGradient3273">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3275" />
<stop
style="stop-color:#debc85;stop-opacity:0"
offset="1"
id="stop3277" />
</linearGradient>
<linearGradient
id="linearGradient3279">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3281" />
<stop
style="stop-color:#debc85;stop-opacity:0"
offset="1"
id="stop3283" />
</linearGradient>
<linearGradient
id="linearGradient3285">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3287" />
<stop
style="stop-color:#debc85;stop-opacity:0"
offset="1"
id="stop3289" />
</linearGradient>
<linearGradient
id="linearGradient3330">
<stop
style="stop-color:#ff80ff;stop-opacity:0;"
offset="0"
id="stop3332" />
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="1"
id="stop3334" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient4021"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9318803,-0.2210697,0.2308678,0.9731826,-3.9252239,2.7241703)"
spreadMethod="pad"
cx="11.074039"
cy="20.428291"
fx="11.074039"
fy="20.428291"
r="1.15625" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient4023"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8514941,0.5243642,-0.5243642,0.8514941,24.154135,2.8247022)"
x1="21.461079"
y1="23.349636"
x2="22.96941"
y2="28.038134" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="linearGradient4030"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8514941,0.5243642,-0.5243642,0.8514941,18.007546,-15.657615)"
x1="21.461079"
y1="23.349636"
x2="22.96941"
y2="28.038134" />
<filter
inkscape:collect="always"
x="-0.20028582"
width="1.4005716"
y="-0.11837127"
height="1.2367425"
id="filter3484">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.97202214"
id="feGaussianBlur3486" />
</filter>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3490"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1086176,-0.4093269,0.6608062,1.7897223,-9.2289678,-4.0397151)"
spreadMethod="reflect"
cx="8.8133469"
cy="14.235861"
fx="8.8133469"
fy="14.235861"
r="5.3238101" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3496">
<rect
style="opacity:0.62633481;fill:none;stroke:#000000;stroke-width:0.19602102;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3498"
width="13.277639"
height="22.63365"
x="5.309958"
y="1.2316679"
ry="1.171887" />
</clipPath>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3508"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1106976,-0.4036489,0.6516398,1.7930801,-9.2127514,-4.7972628)"
spreadMethod="reflect"
cx="8.8133469"
cy="14.235861"
fx="8.8133469"
fy="14.235861"
r="5.3238101" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3233"
id="linearGradient3240"
x1="9.4485903"
y1="2.761672"
x2="7.6776314"
y2="19.013866"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.1741381,0,0,4.1613891,14.977639,14.527008)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient10711"
id="radialGradient3253"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.7157796,-1.4428762,2.6160831,8.4980426,-22.699134,-22.277012)"
spreadMethod="reflect"
cx="8.2230186"
cy="14.316785"
fx="8.2230186"
fy="14.316785"
r="5.3238101" />
<filter
inkscape:collect="always"
id="filter3757"
x="-0.14567212"
width="1.2913442"
y="-0.098205952"
height="1.1964119">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.79012916"
id="feGaussianBlur3759" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2"
inkscape:cx="8.5584572"
inkscape:cy="52.628863"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1280"
inkscape:window-height="742"
inkscape:window-x="296"
inkscape:window-y="56"
showguides="true"
inkscape:guide-bbox="true"
width="24px"
height="24px"
inkscape:object-paths="false"
inkscape:object-nodes="true"
inkscape:snap-nodes="false"
inkscape:snap-global="false">
<inkscape:grid
type="xygrid"
id="grid3664"
empspacing="2"
visible="true"
enabled="true"
spacingx="2.6666px"
spacingy="2.6666px" />
<sodipodi:guide
orientation="1,0"
position="10.507812,7.328125"
id="guide3666" />
<sodipodi:guide
orientation="0,1"
position="10.292968,7.5546875"
id="guide3668" />
</sodipodi:namedview>
<metadata
id="metadata10648">
<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="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:0.18099551;color:#000000;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter3757);enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
d="m 5,19 c 5.24e-5,0.523584 0.4764155,0.999948 1,1 l 3.59375,0 2.5,2.5625 c 0.272702,0.267764 0.706204,0.357015 1.0625,0.21875 l 1.25,-0.46875 c 0.353635,-0.127466 0.619754,-0.46962 0.65625,-0.84375 l 0.34375,-3.3125 2.40625,-3 c 0.296435,-0.374818 0.26821,-0.967546 -0.0625,-1.3125 L 5.2034921,1.0488435 5,19 z"
id="path3670"
sodipodi:nodetypes="cccccccccccc"
transform="matrix(3.8351065,0,0,3.8305733,20.000787,24.35592)" />
<path
style="fill:#201020;fill-rule:evenodd;stroke:#595959;stroke-width:5.33333349;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 40.022468,18.688398 0,66.582224 16.696553,0 L 68.436432,97.122145 73.70512,95.153883 75.247683,80.05609 86.03678,66.636329 40.022468,18.688398 z"
id="path3502"
sodipodi:nodetypes="cccccccc" />
<path
sodipodi:nodetypes="cccccccc"
id="path3504"
d="m 40.022468,18.688397 0,66.58222 16.696554,0 11.717412,11.851511 5.268688,-1.968253 1.54256,-15.09779 L 85.892267,66.67168 40.022468,18.688397 z"
style="fill:#c4c4c4;fill-opacity:1;fill-rule:evenodd;stroke:none" />
<path
style="fill:url(#radialGradient3253);fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 40.022468,18.688397 0,66.58222 16.696554,0 11.717412,11.851511 5.268688,-1.968253 1.54256,-15.09779 10.56036,-13.22296 -45.785574,-48.144728 z"
id="path3506"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:none;stroke:url(#linearGradient3240);stroke-width:2.667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 41.38037,83.915714 58.396539,84.11082 69.204513,94.929961 72.193882,93.656427 73.839587,79.399575 84.08764,66.742537 41.448646,22.246495 41.38037,83.915714 z"
id="path2253"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 25 KiB

BIN
resources/images/random.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -843,6 +843,12 @@ class ActionNextMatch(InterfaceActionBase):
description = _('Find the next or previous match when searching in ' description = _('Find the next or previous match when searching in '
'your calibre library in highlight mode') 'your calibre library in highlight mode')
class ActionPickRandom(InterfaceActionBase):
name = 'Pick Random Book'
actual_plugin = 'calibre.gui2.actions.random:PickRandomAction'
description = _('Choose a random book from your calibre library')
class ActionStore(InterfaceActionBase): class ActionStore(InterfaceActionBase):
name = 'Store' name = 'Store'
author = 'John Schember' author = 'John Schember'
@ -873,7 +879,7 @@ plugins += [ActionAdd, ActionFetchAnnotations, ActionGenerateCatalog,
ActionSendToDevice, ActionHelp, ActionPreferences, ActionSimilarBooks, ActionSendToDevice, ActionHelp, ActionPreferences, ActionSimilarBooks,
ActionAddToLibrary, ActionEditCollections, ActionChooseLibrary, ActionAddToLibrary, ActionEditCollections, ActionChooseLibrary,
ActionCopyToLibrary, ActionTweakEpub, ActionNextMatch, ActionStore, ActionCopyToLibrary, ActionTweakEpub, ActionNextMatch, ActionStore,
ActionPluginUpdater] ActionPluginUpdater, ActionPickRandom]
# }}} # }}}

View File

@ -557,7 +557,7 @@ OptionRecommendation(name='delete_blank_paragraphs',
OptionRecommendation(name='format_scene_breaks', OptionRecommendation(name='format_scene_breaks',
recommended_value=True, level=OptionRecommendation.LOW, recommended_value=True, level=OptionRecommendation.LOW,
help=_('Left aligned scene break markers are center aligned. ' help=_('Left aligned scene break markers are center aligned. '
'Replace soft scene breaks that use multiple blank lines with' 'Replace soft scene breaks that use multiple blank lines with '
'horizontal rules.')), 'horizontal rules.')),
OptionRecommendation(name='replace_scene_breaks', OptionRecommendation(name='replace_scene_breaks',

View File

@ -1361,7 +1361,7 @@ class MOBIFile(object): # {{{
huffrecs = [self.records[r].raw for r in self.huffman_record_nums] huffrecs = [self.records[r].raw for r in self.huffman_record_nums]
from calibre.ebooks.mobi.huffcdic import HuffReader from calibre.ebooks.mobi.huffcdic import HuffReader
huffs = HuffReader(huffrecs) huffs = HuffReader(huffrecs)
decompress = lambda x: huffs.decompress([x]) decompress = huffs.unpack
elif 'palmdoc' in self.mobi_header.compression.lower(): elif 'palmdoc' in self.mobi_header.compression.lower():
from calibre.ebooks.compression.palmdoc import decompress_doc from calibre.ebooks.compression.palmdoc import decompress_doc
decompress = decompress_doc decompress = decompress_doc

View File

@ -1,8 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
''' '''
Decompress MOBI files compressed with the Huff/cdic algorithm. Code thanks to darkninja Decompress MOBI files compressed with the Huff/cdic algorithm. Code thanks to darkninja
and igorsk. and igorsk.
@ -12,82 +16,92 @@ import struct
from calibre.ebooks.mobi import MobiError from calibre.ebooks.mobi import MobiError
class BitReader(object): class Reader(object):
def __init__(self, data): def __init__(self):
self.data, self.pos, self.nbits = data + "\x00\x00\x00\x00", 0, len(data) * 8 self.q = struct.Struct(b'>Q').unpack_from
def peek(self, n): def load_huff(self, huff):
r, g = 0, 0 if huff[0:8] != b'HUFF\x00\x00\x00\x18':
while g < n: raise MobiError('Invalid HUFF header')
r, g = (r << 8) | ord(self.data[(self.pos+g)>>3]), g + 8 - ((self.pos+g) & 7) off1, off2 = struct.unpack_from(b'>LL', huff, 8)
return (r >> (g - n)) & ((1 << n) - 1)
def eat(self, n): def dict1_unpack(v):
self.pos += n codelen, term, maxcode = v&0x1f, v&0x80, v>>8
return self.pos <= self.nbits assert codelen != 0
if codelen <= 8:
assert term
maxcode = ((maxcode + 1) << (32 - codelen)) - 1
return (codelen, term, maxcode)
self.dict1 = map(dict1_unpack, struct.unpack_from(b'>256L', huff, off1))
def left(self): dict2 = struct.unpack_from(b'>64L', huff, off2)
return self.nbits - self.pos self.mincode, self.maxcode = (), ()
for codelen, mincode in enumerate((0,) + dict2[0::2]):
self.mincode += (mincode << (32 - codelen), )
for codelen, maxcode in enumerate((0,) + dict2[1::2]):
self.maxcode += (((maxcode + 1) << (32 - codelen)) - 1, )
self.dictionary = []
def load_cdic(self, cdic):
if cdic[0:8] != b'CDIC\x00\x00\x00\x10':
raise MobiError('Invalid CDIC header')
phrases, bits = struct.unpack_from(b'>LL', cdic, 8)
n = min(1<<bits, phrases-len(self.dictionary))
h = struct.Struct(b'>H').unpack_from
def getslice(off):
blen, = h(cdic, 16+off)
slice = cdic[18+off:18+off+(blen&0x7fff)]
return (slice, blen&0x8000)
self.dictionary += map(getslice, struct.unpack_from(b'>%dH' % n, cdic, 16))
def unpack(self, data):
q = self.q
bitsleft = len(data) * 8
data += b'\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 0
x, = q(data, pos)
n = 32
s = []
while True:
if n <= 0:
pos += 4
x, = q(data, pos)
n += 32
code = (x >> n) & ((1 << 32) - 1)
codelen, term, maxcode = self.dict1[code >> 24]
if not term:
while code < self.mincode[codelen]:
codelen += 1
maxcode = self.maxcode[codelen]
n -= codelen
bitsleft -= codelen
if bitsleft < 0:
break
r = (maxcode - code) >> (32 - codelen)
slice_, flag = self.dictionary[r]
if not flag:
self.dictionary[r] = None
slice_ = self.unpack(slice_)
self.dictionary[r] = (slice_, 1)
s.append(slice_)
return b''.join(s)
class HuffReader(object): class HuffReader(object):
def __init__(self, huffs): def __init__(self, huffs):
self.huffs = huffs self.reader = Reader()
self.reader.load_huff(huffs[0])
for cdic in huffs[1:]:
self.reader.load_cdic(cdic)
if huffs[0][0:4] != 'HUFF' or huffs[0][4:8] != '\x00\x00\x00\x18': def unpack(self, section):
raise MobiError('Invalid HUFF header') return self.reader.unpack(section)
if huffs[1][0:4] != 'CDIC' or huffs[1][4:8] != '\x00\x00\x00\x10':
raise ValueError('Invalid CDIC header')
self.entry_bits, = struct.unpack('>L', huffs[1][12:16])
off1,off2 = struct.unpack('>LL', huffs[0][16:24])
self.dict1 = struct.unpack('<256L', huffs[0][off1:off1+256*4])
self.dict2 = struct.unpack('<64L', huffs[0][off2:off2+64*4])
self.dicts = huffs[1:]
self.r = ''
def _unpack(self, bits, depth = 0):
if depth > 32:
raise MobiError('Corrupt file')
while bits.left():
dw = bits.peek(32)
v = self.dict1[dw >> 24]
codelen = v & 0x1F
assert codelen != 0
code = dw >> (32 - codelen)
r = (v >> 8)
if not (v & 0x80):
while code < self.dict2[(codelen-1)*2]:
codelen += 1
code = dw >> (32 - codelen)
r = self.dict2[(codelen-1)*2+1]
r -= code
assert codelen != 0
if not bits.eat(codelen):
return
dicno = r >> self.entry_bits
off1 = 16 + (r - (dicno << self.entry_bits)) * 2
dic = self.dicts[dicno]
off2 = 16 + ord(dic[off1]) * 256 + ord(dic[off1+1])
blen = ord(dic[off2]) * 256 + ord(dic[off2+1])
slice = dic[off2+2:off2+2+(blen&0x7fff)]
if blen & 0x8000:
self.r += slice
else:
self._unpack(BitReader(slice), depth + 1)
def unpack(self, data):
self.r = ''
self._unpack(BitReader(data))
return self.r
def decompress(self, sections):
r = ''
for data in sections:
r += self.unpack(data)
if r.endswith('#'):
r = r[:-1]
return r

View File

@ -859,16 +859,19 @@ class MobiReader(object):
processed_records += list(range(self.book_header.huff_offset, processed_records += list(range(self.book_header.huff_offset,
self.book_header.huff_offset + self.book_header.huff_number)) self.book_header.huff_offset + self.book_header.huff_number))
huff = HuffReader(huffs) huff = HuffReader(huffs)
self.mobi_html = huff.decompress(text_sections) unpack = huff.unpack
elif self.book_header.compression_type == '\x00\x02': elif self.book_header.compression_type == '\x00\x02':
for section in text_sections: unpack = decompress_doc
self.mobi_html += decompress_doc(section)
elif self.book_header.compression_type == '\x00\x01': elif self.book_header.compression_type == '\x00\x01':
self.mobi_html = ''.join(text_sections) unpack = lambda x: x
else: else:
raise MobiError('Unknown compression algorithm: %s' % repr(self.book_header.compression_type)) raise MobiError('Unknown compression algorithm: %s' % repr(self.book_header.compression_type))
self.mobi_html = b''.join(map(unpack, text_sections))
if self.mobi_html.endswith(b'#'):
self.mobi_html = self.mobi_html[:-1]
if self.book_header.ancient and '<html' not in self.mobi_html[:300].lower(): if self.book_header.ancient and '<html' not in self.mobi_html[:300].lower():
self.mobi_html = self.mobi_html.replace('\r ', '\n\n ') self.mobi_html = self.mobi_html.replace('\r ', '\n\n ')
self.mobi_html = self.mobi_html.replace('\0', '') self.mobi_html = self.mobi_html.replace('\0', '')

View File

@ -152,10 +152,7 @@ class ChooseLibraryAction(InterfaceAction):
self.choose_menu.addMenu(self.maintenance_menu) self.choose_menu.addMenu(self.maintenance_menu)
def pick_random(self, *args): def pick_random(self, *args):
import random self.gui.iactions['Pick Random Book'].pick_random()
pick = random.randint(0, self.gui.library_view.model().rowCount(None))
self.gui.library_view.set_current_row(pick)
self.gui.library_view.scroll_to_row(pick)
def library_name(self): def library_name(self):
db = self.gui.library_view.model().db db = self.gui.library_view.model().db

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import random
from calibre.gui2.actions import InterfaceAction
class PickRandomAction(InterfaceAction):
name = 'Pick Random Book'
action_spec = (_('Pick a random book'), 'random.png', 'Catalog builder', None)
dont_add_to = frozenset(['menubar-device', 'toolbar-device', 'context-menu-device'])
def genesis(self):
self.qaction.triggered.connect(self.pick_random)
def pick_random(self):
pick = random.randint(0, self.gui.library_view.model().rowCount(None))
self.gui.library_view.set_current_row(pick)
self.gui.library_view.scroll_to_row(pick)

View File

@ -207,7 +207,7 @@ class ViewAction(InterfaceAction):
self._view_books([index]) self._view_books([index])
def view_random(self, *args): def view_random(self, *args):
self.gui.iactions['Choose Library'].pick_random() self.gui.iactions['Pick Random Book'].pick_random()
self._view_books([self.gui.library_view.currentIndex()]) self._view_books([self.gui.library_view.currentIndex()])
def _view_calibre_books(self, ids): def _view_calibre_books(self, ids):

View File

@ -167,7 +167,7 @@ def render_data(mi, use_roman_numbers=True, all_fields=False):
elif metadata['datatype'] == 'datetime': elif metadata['datatype'] == 'datetime':
aval = getattr(mi, field) aval = getattr(mi, field)
if is_date_undefined(aval): if is_date_undefined(aval):
val = '' continue
ans.append((field, u'<td class="title">%s</td><td>%s</td>'%(name, val))) ans.append((field, u'<td class="title">%s</td><td>%s</td>'%(name, val)))