diff --git a/gmusicbrowser.pl b/gmusicbrowser.pl index dbaf30d3..1fab4883 100755 --- a/gmusicbrowser.pl +++ b/gmusicbrowser.pl @@ -137,6 +137,7 @@ sub Load_Wnck } use List::Util qw/min max sum first/; use File::Copy; +use Digest::MD5 (); use Fcntl qw/O_NONBLOCK O_WRONLY O_RDWR SEEK_SET/; use Scalar::Util qw/blessed weaken refaddr/; use Unicode::Normalize 'NFKD'; #for accent-insensitive sort and search, only used via superlc() @@ -9640,6 +9641,7 @@ package GMB::Picture; our @ArraysOfFiles; #array of filenames that needs updating in case a folder is renamed our $loaded_poppler; +my $DiskCacheDir; sub pdf_ok { return $loaded_poppler if defined $loaded_poppler; $loaded_poppler= eval {Glib::Object::Introspection->setup( basename => 'Poppler', version => '0.18', package => 'Poppler'); 1; } || 0; @@ -9655,13 +9657,60 @@ sub pixbuf { my ($file,$size,$cacheonly,$anim_ok)=@_; my $key= defined $size ? $size.':'.$file : $file; my $pb= GMB::Cache::get($key); + if (!$pb && defined $size && !$anim_ok) + { $pb= diskcache_get($file,$size); + GMB::Cache::add_pb($key,$pb) if $pb; + } unless ($pb || $cacheonly) { $pb=load($file,size=>$size,anim_ok=>$anim_ok); - GMB::Cache::add_pb($key,$pb) if $pb && $pb->isa('Gtk3::Gdk::Pixbuf'); #don't bother caching animation + if ($pb && $pb->isa('Gtk3::Gdk::Pixbuf')) + { GMB::Cache::add_pb($key,$pb); #don't bother caching animation + diskcache_add($file,$size,$pb) if defined $size; + } } return $pb; } +sub diskcache_dir +{ return $DiskCacheDir if defined $DiskCacheDir; + $DiskCacheDir= $::HomeDir.'thumbnails'; + unless (-d $DiskCacheDir) + { my $ok= eval { ::CreateDir($DiskCacheDir); }; + return $DiskCacheDir=undef unless $ok; + } + return $DiskCacheDir; +} + +sub diskcache_file +{ my ($file,$size)=@_; + return unless defined $size && $size>0; + my $nb= $file=~s/:(\w+)$// ? $1 : ''; + my @stat= stat $file; + return unless @stat; + my $key= join "\0",'v1',$size,$file,$nb,$stat[7],$stat[9]; + my $dir= diskcache_dir(); + return unless $dir; + return $dir.::SLASH.Digest::MD5::md5_hex($key).'.png'; +} + +sub diskcache_get +{ my ($file,$size)=@_; + my $cachefile= diskcache_file($file,$size); + return unless $cachefile && -e $cachefile; + my $pb= eval { Gtk3::Gdk::Pixbuf->new_from_file($cachefile); }; + return $pb if $pb; + unlink $cachefile; + return; +} + +sub diskcache_add +{ my ($file,$size,$pb)=@_; + my $cachefile= diskcache_file($file,$size); + return unless $cachefile; + eval { $pb->save($cachefile,'png'); }; + unlink $cachefile if $@; +} + sub pdf_pages { my $file= shift; my $ref= GMB::Cache::get("$file:pagecount"); diff --git a/pix/elementary-dark/gmb-album.png b/pix/elementary-dark/gmb-album.png new file mode 100644 index 00000000..b3b6dac2 Binary files /dev/null and b/pix/elementary-dark/gmb-album.png differ diff --git a/pix/elementary-dark/gmb-case_insensitive.png b/pix/elementary-dark/gmb-case_insensitive.png new file mode 100644 index 00000000..f579b557 Binary files /dev/null and b/pix/elementary-dark/gmb-case_insensitive.png differ diff --git a/pix/elementary-dark/gmb-case_sensitive.png b/pix/elementary-dark/gmb-case_sensitive.png new file mode 100644 index 00000000..2f551e8d Binary files /dev/null and b/pix/elementary-dark/gmb-case_sensitive.png differ diff --git a/pix/elementary-dark/gmb-equalizer.png b/pix/elementary-dark/gmb-equalizer.png new file mode 100644 index 00000000..0c85cf4e Binary files /dev/null and b/pix/elementary-dark/gmb-equalizer.png differ diff --git a/pix/elementary-dark/gmb-filter.png b/pix/elementary-dark/gmb-filter.png new file mode 100644 index 00000000..f7c4b3ef Binary files /dev/null and b/pix/elementary-dark/gmb-filter.png differ diff --git a/pix/elementary-dark/gmb-invert.png b/pix/elementary-dark/gmb-invert.png new file mode 100644 index 00000000..cb19639e Binary files /dev/null and b/pix/elementary-dark/gmb-invert.png differ diff --git a/pix/elementary-dark/gmb-library.png b/pix/elementary-dark/gmb-library.png new file mode 100644 index 00000000..67e4a25e Binary files /dev/null and b/pix/elementary-dark/gmb-library.png differ diff --git a/pix/elementary-dark/gmb-list.png b/pix/elementary-dark/gmb-list.png new file mode 100644 index 00000000..7b755475 Binary files /dev/null and b/pix/elementary-dark/gmb-list.png differ diff --git a/pix/elementary-dark/gmb-lock.png b/pix/elementary-dark/gmb-lock.png new file mode 100644 index 00000000..e0eeb5d9 Binary files /dev/null and b/pix/elementary-dark/gmb-lock.png differ diff --git a/pix/elementary-dark/gmb-locklight.png b/pix/elementary-dark/gmb-locklight.png new file mode 100644 index 00000000..95649a44 Binary files /dev/null and b/pix/elementary-dark/gmb-locklight.png differ diff --git a/pix/elementary-dark/gmb-lockopen.png b/pix/elementary-dark/gmb-lockopen.png new file mode 100644 index 00000000..92b42296 Binary files /dev/null and b/pix/elementary-dark/gmb-lockopen.png differ diff --git a/pix/elementary-dark/gmb-picture.png b/pix/elementary-dark/gmb-picture.png new file mode 100644 index 00000000..46e46e00 Binary files /dev/null and b/pix/elementary-dark/gmb-picture.png differ diff --git a/pix/elementary-dark/gmb-playlist.png b/pix/elementary-dark/gmb-playlist.png new file mode 100644 index 00000000..dc11cfc1 Binary files /dev/null and b/pix/elementary-dark/gmb-playlist.png differ diff --git a/pix/elementary-dark/gmb-queue.png b/pix/elementary-dark/gmb-queue.png new file mode 100644 index 00000000..6609597d Binary files /dev/null and b/pix/elementary-dark/gmb-queue.png differ diff --git a/pix/elementary-dark/gmb-queue0.png b/pix/elementary-dark/gmb-queue0.png new file mode 100644 index 00000000..f45e9222 Binary files /dev/null and b/pix/elementary-dark/gmb-queue0.png differ diff --git a/pix/elementary-dark/gmb-queue1.png b/pix/elementary-dark/gmb-queue1.png new file mode 100644 index 00000000..2196ae5d Binary files /dev/null and b/pix/elementary-dark/gmb-queue1.png differ diff --git a/pix/elementary-dark/gmb-queue2.png b/pix/elementary-dark/gmb-queue2.png new file mode 100644 index 00000000..46c86845 Binary files /dev/null and b/pix/elementary-dark/gmb-queue2.png differ diff --git a/pix/elementary-dark/gmb-queue3.png b/pix/elementary-dark/gmb-queue3.png new file mode 100644 index 00000000..d3d4d517 Binary files /dev/null and b/pix/elementary-dark/gmb-queue3.png differ diff --git a/pix/elementary-dark/gmb-queue4.png b/pix/elementary-dark/gmb-queue4.png new file mode 100644 index 00000000..665a7beb Binary files /dev/null and b/pix/elementary-dark/gmb-queue4.png differ diff --git a/pix/elementary-dark/gmb-queue5.png b/pix/elementary-dark/gmb-queue5.png new file mode 100644 index 00000000..896b91ce Binary files /dev/null and b/pix/elementary-dark/gmb-queue5.png differ diff --git a/pix/elementary-dark/gmb-queue6.png b/pix/elementary-dark/gmb-queue6.png new file mode 100644 index 00000000..ba7d2c32 Binary files /dev/null and b/pix/elementary-dark/gmb-queue6.png differ diff --git a/pix/elementary-dark/gmb-queue7.png b/pix/elementary-dark/gmb-queue7.png new file mode 100644 index 00000000..65cd6d38 Binary files /dev/null and b/pix/elementary-dark/gmb-queue7.png differ diff --git a/pix/elementary-dark/gmb-queue8.png b/pix/elementary-dark/gmb-queue8.png new file mode 100644 index 00000000..d552226b Binary files /dev/null and b/pix/elementary-dark/gmb-queue8.png differ diff --git a/pix/elementary-dark/gmb-queue9.png b/pix/elementary-dark/gmb-queue9.png new file mode 100644 index 00000000..ae3ca919 Binary files /dev/null and b/pix/elementary-dark/gmb-queue9.png differ diff --git a/pix/elementary-dark/gmb-random.png b/pix/elementary-dark/gmb-random.png new file mode 100644 index 00000000..bcb331bb Binary files /dev/null and b/pix/elementary-dark/gmb-random.png differ diff --git a/pix/elementary-dark/gmb-shuffle.png b/pix/elementary-dark/gmb-shuffle.png new file mode 100644 index 00000000..b2668eac Binary files /dev/null and b/pix/elementary-dark/gmb-shuffle.png differ diff --git a/pix/elementary-dark/gmb-song.png b/pix/elementary-dark/gmb-song.png new file mode 100644 index 00000000..eb3f45c0 Binary files /dev/null and b/pix/elementary-dark/gmb-song.png differ diff --git a/pix/elementary-dark/gmb-turnoff.png b/pix/elementary-dark/gmb-turnoff.png new file mode 100644 index 00000000..3f98a1a1 Binary files /dev/null and b/pix/elementary-dark/gmb-turnoff.png differ diff --git a/pix/elementary-dark/gmb-view-fullscreen.png b/pix/elementary-dark/gmb-view-fullscreen.png new file mode 100644 index 00000000..f6de997d Binary files /dev/null and b/pix/elementary-dark/gmb-view-fullscreen.png differ diff --git a/pix/elementary-dark/gmb-vol0.png b/pix/elementary-dark/gmb-vol0.png new file mode 100644 index 00000000..4c452898 Binary files /dev/null and b/pix/elementary-dark/gmb-vol0.png differ diff --git a/pix/elementary-dark/gmb-vol1.png b/pix/elementary-dark/gmb-vol1.png new file mode 100644 index 00000000..8448e6ae Binary files /dev/null and b/pix/elementary-dark/gmb-vol1.png differ diff --git a/pix/elementary-dark/gmb-vol2.png b/pix/elementary-dark/gmb-vol2.png new file mode 100644 index 00000000..7297af76 Binary files /dev/null and b/pix/elementary-dark/gmb-vol2.png differ diff --git a/pix/elementary-dark/gmb-vol3.png b/pix/elementary-dark/gmb-vol3.png new file mode 100644 index 00000000..5439e019 Binary files /dev/null and b/pix/elementary-dark/gmb-vol3.png differ diff --git a/pix/elementary-dark/gmb-volm.png b/pix/elementary-dark/gmb-volm.png new file mode 100644 index 00000000..019abc5e Binary files /dev/null and b/pix/elementary-dark/gmb-volm.png differ diff --git a/pix/elementary-dark/gmb-wait.png b/pix/elementary-dark/gmb-wait.png new file mode 100644 index 00000000..505c6ec6 Binary files /dev/null and b/pix/elementary-dark/gmb-wait.png differ diff --git a/pix/elementary-dark/gtk-clear.png b/pix/elementary-dark/gtk-clear.png new file mode 100644 index 00000000..6261fe00 Binary files /dev/null and b/pix/elementary-dark/gtk-clear.png differ diff --git a/pix/elementary-dark/gtk-find.png b/pix/elementary-dark/gtk-find.png new file mode 100644 index 00000000..3aaf78ad Binary files /dev/null and b/pix/elementary-dark/gtk-find.png differ diff --git a/pix/elementary-dark/gtk-fullscreen.png b/pix/elementary-dark/gtk-fullscreen.png new file mode 100644 index 00000000..80d30a3b Binary files /dev/null and b/pix/elementary-dark/gtk-fullscreen.png differ diff --git a/pix/elementary-dark/gtk-media-next.png b/pix/elementary-dark/gtk-media-next.png new file mode 100644 index 00000000..67398bd3 Binary files /dev/null and b/pix/elementary-dark/gtk-media-next.png differ diff --git a/pix/elementary-dark/gtk-media-pause.png b/pix/elementary-dark/gtk-media-pause.png new file mode 100644 index 00000000..20636cff Binary files /dev/null and b/pix/elementary-dark/gtk-media-pause.png differ diff --git a/pix/elementary-dark/gtk-media-play.png b/pix/elementary-dark/gtk-media-play.png new file mode 100644 index 00000000..76205c95 Binary files /dev/null and b/pix/elementary-dark/gtk-media-play.png differ diff --git a/pix/elementary-dark/gtk-media-previous.png b/pix/elementary-dark/gtk-media-previous.png new file mode 100644 index 00000000..87b46c35 Binary files /dev/null and b/pix/elementary-dark/gtk-media-previous.png differ diff --git a/pix/elementary-dark/gtk-media-stop.png b/pix/elementary-dark/gtk-media-stop.png new file mode 100644 index 00000000..514802d8 Binary files /dev/null and b/pix/elementary-dark/gtk-media-stop.png differ diff --git a/pix/elementary-dark/gtk-preferences.png b/pix/elementary-dark/gtk-preferences.png new file mode 100644 index 00000000..bc4986e2 Binary files /dev/null and b/pix/elementary-dark/gtk-preferences.png differ diff --git a/pix/elementary-dark/gtk-quit.png b/pix/elementary-dark/gtk-quit.png new file mode 100644 index 00000000..f218b5a9 Binary files /dev/null and b/pix/elementary-dark/gtk-quit.png differ diff --git a/pix/elementary-dark/gtk-sort-ascending.png b/pix/elementary-dark/gtk-sort-ascending.png new file mode 100644 index 00000000..9879c9fc Binary files /dev/null and b/pix/elementary-dark/gtk-sort-ascending.png differ diff --git a/pix/elementary-dark/gtk-sort-descending.png b/pix/elementary-dark/gtk-sort-descending.png new file mode 100644 index 00000000..764ed9ef Binary files /dev/null and b/pix/elementary-dark/gtk-sort-descending.png differ diff --git a/pix/elementary-dark/icon_source b/pix/elementary-dark/icon_source new file mode 100644 index 00000000..eb8747aa --- /dev/null +++ b/pix/elementary-dark/icon_source @@ -0,0 +1,4 @@ +#Source for the weblinks-icons +http://www.iconspedia.com/icon/last-fm-13861.html +author: http://umar123.deviantart.com/ +License: Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 diff --git a/pix/elementary-dark/no-cover.svg b/pix/elementary-dark/no-cover.svg new file mode 100644 index 00000000..81b6e81b --- /dev/null +++ b/pix/elementary-dark/no-cover.svg @@ -0,0 +1,142 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pix/elementary-dark/overlay.png b/pix/elementary-dark/overlay.png new file mode 100644 index 00000000..411181c4 Binary files /dev/null and b/pix/elementary-dark/overlay.png differ diff --git a/pix/elementary-dark/plugin-rip.png b/pix/elementary-dark/plugin-rip.png new file mode 100644 index 00000000..5d7fdce8 Binary files /dev/null and b/pix/elementary-dark/plugin-rip.png differ diff --git a/pix/elementary-dark/plugin-wikipedia.png b/pix/elementary-dark/plugin-wikipedia.png new file mode 100644 index 00000000..4b162c25 Binary files /dev/null and b/pix/elementary-dark/plugin-wikipedia.png differ diff --git a/pix/elementary-dark/stars0.png b/pix/elementary-dark/stars0.png new file mode 100644 index 00000000..ab11b563 Binary files /dev/null and b/pix/elementary-dark/stars0.png differ diff --git a/pix/elementary-dark/stars1.png b/pix/elementary-dark/stars1.png new file mode 100644 index 00000000..c3763b6c Binary files /dev/null and b/pix/elementary-dark/stars1.png differ diff --git a/pix/elementary-dark/stars10.png b/pix/elementary-dark/stars10.png new file mode 100644 index 00000000..9aa84958 Binary files /dev/null and b/pix/elementary-dark/stars10.png differ diff --git a/pix/elementary-dark/stars2.png b/pix/elementary-dark/stars2.png new file mode 100644 index 00000000..a54c67d6 Binary files /dev/null and b/pix/elementary-dark/stars2.png differ diff --git a/pix/elementary-dark/stars3.png b/pix/elementary-dark/stars3.png new file mode 100644 index 00000000..4f202f21 Binary files /dev/null and b/pix/elementary-dark/stars3.png differ diff --git a/pix/elementary-dark/stars4.png b/pix/elementary-dark/stars4.png new file mode 100644 index 00000000..236f26ba Binary files /dev/null and b/pix/elementary-dark/stars4.png differ diff --git a/pix/elementary-dark/stars5.png b/pix/elementary-dark/stars5.png new file mode 100644 index 00000000..809ade3b Binary files /dev/null and b/pix/elementary-dark/stars5.png differ diff --git a/pix/elementary-dark/stars6.png b/pix/elementary-dark/stars6.png new file mode 100644 index 00000000..d35b9f07 Binary files /dev/null and b/pix/elementary-dark/stars6.png differ diff --git a/pix/elementary-dark/stars7.png b/pix/elementary-dark/stars7.png new file mode 100644 index 00000000..1b9ceac0 Binary files /dev/null and b/pix/elementary-dark/stars7.png differ diff --git a/pix/elementary-dark/stars8.png b/pix/elementary-dark/stars8.png new file mode 100644 index 00000000..714edf5b Binary files /dev/null and b/pix/elementary-dark/stars8.png differ diff --git a/pix/elementary-dark/stars9.png b/pix/elementary-dark/stars9.png new file mode 100644 index 00000000..2adfb188 Binary files /dev/null and b/pix/elementary-dark/stars9.png differ diff --git a/pix/elementary-dark/trayicon.png b/pix/elementary-dark/trayicon.png new file mode 100644 index 00000000..001f4fd0 Binary files /dev/null and b/pix/elementary-dark/trayicon.png differ diff --git a/pix/elementary-dark/trayicon_dark.png b/pix/elementary-dark/trayicon_dark.png new file mode 100644 index 00000000..0c9c5e4d Binary files /dev/null and b/pix/elementary-dark/trayicon_dark.png differ