[grilo-plugins] youtube: Add source icon



commit 02b910fae991f4bf33833cbac6d1f9a2fa91650b
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 29 14:02:58 2014 +0100

    youtube: Add source icon
    
    Icon by Jakub Steiner.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723233

 src/youtube/Makefile.am           |   11 +++-
 src/youtube/channel-youtube.svg   |  108 +++++++++++++++++++++++++++++++++++++
 src/youtube/grl-youtube.c         |    7 +++
 src/youtube/youtube.gresource.xml |    6 ++
 4 files changed, 130 insertions(+), 2 deletions(-)
---
diff --git a/src/youtube/Makefile.am b/src/youtube/Makefile.am
index 56f0eb3..fb618ed 100644
--- a/src/youtube/Makefile.am
+++ b/src/youtube/Makefile.am
@@ -22,13 +22,20 @@ libgrlyoutube_la_LDFLAGS = \
        -module            \
        -avoid-version
 
-libgrlyoutube_la_SOURCES = grl-youtube.c grl-youtube.h
+libgrlyoutube_la_SOURCES = grl-youtube.c grl-youtube.h youtuberesources.h youtuberesources.c
 
 extdir                         = $(GRL_PLUGINS_DIR)
 youtubexmldir          = $(GRL_PLUGINS_DIR)
 youtubexml_DATA        = $(YOUTUBE_PLUGIN_ID).xml
 
-EXTRA_DIST = $(youtubexml_DATA)
+youtuberesources.h: youtube.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/youtube.gresource.xml \
+               --target=$@ --sourcedir=$(srcdir) --c-name _grl_youtube --generate-header
+youtuberesources.c: youtube.gresource.xml youtuberesources.h channel-youtube.svg
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/youtube.gresource.xml \
+               --target=$@ --sourcedir=$(srcdir) --c-name _grl_youtube --generate-source
+
+EXTRA_DIST = $(youtubexml_DATA) channel-youtube.svg youtube.gresource.xml
 
 MAINTAINERCLEANFILES    = \
        *.in \
diff --git a/src/youtube/channel-youtube.svg b/src/youtube/channel-youtube.svg
new file mode 100644
index 0000000..a5c7a89
--- /dev/null
+++ b/src/youtube/channel-youtube.svg
@@ -0,0 +1,108 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="256"
+   height="256"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="channel-youtube.svg">
+  <defs
+     id="defs4">
+    <clipPath
+       id="clipPath6193"
+       clipPathUnits="userSpaceOnUse">
+      <path
+         id="path6195"
+         d="m 1600,2252.8 5020,0 0,3650 -5020,0 0,-3650 z" />
+    </clipPath>
+    <linearGradient
+       id="linearGradient6181"
+       spreadMethod="pad"
+       gradientTransform="matrix(-3.593e-5,822,822,3.593e-5,411,0)"
+       gradientUnits="userSpaceOnUse"
+       y2="0"
+       x2="1"
+       y1="0"
+       x1="0">
+      <stop
+         id="stop6183"
+         offset="0"
+         style="stop-opacity:1;stop-color:#c01e25" />
+      <stop
+         id="stop6185"
+         offset="1"
+         style="stop-opacity:1;stop-color:#e62426" />
+    </linearGradient>
+    <clipPath
+       id="clipPath6177"
+       clipPathUnits="userSpaceOnUse">
+      <path
+         id="path6179"
+         d="M 8220,0 0,0 l 0,8220 8220,0 0,-8220 m -6620,5902.8 0,-3650 5020,0 0,3650 -5020,0" />
+    </clipPath>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#505050"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-190.70924"
+     inkscape:cy="151.81032"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     borderlayer="true"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="2560"
+     inkscape:window-height="1374"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1" />
+  <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>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-796.36218)">
+    <g
+       transform="matrix(630.025,0,0,-458.9,-77.5125,1218.8747)"
+       id="g6197" />
+    <path
+       id="path6201"
+       
style="fill:#d42025;fill-opacity:1;fill-rule:nonzero;stroke:none;color:#000000;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       d="m 227.03908,879.2746 c -3.84615,-15.3957 -11.0669,-21.3283 -24.3561,-23.4717 -7.66273,-1.1253 
-44.43996,-2.5721 -73.62648,-2.5721 l 0.13075,3e-4 c -29.18609,0 -65.963749,1.4468 -73.626475,2.5721 
-13.289204,2.1435 -20.509528,8.076 -24.355681,23.4718 -1.293768,5.1785 -3.080094,33.5432 -3.080094,44.3671 l 
0,2.371 c 0,10.8243 1.786326,39.189 3.080094,44.3675 3.846153,15.3958 11.066477,21.3283 24.355681,23.4717 
7.662726,1.1254 44.440385,2.5722 73.626475,2.5722 l -0.13075,0 c 29.18652,0 65.96375,-1.4468 73.62648,-2.5722 
13.2892,-2.1434 20.50995,-8.0764 24.3561,-23.4721 1.29377,-5.1785 3.07967,-33.5428 3.07967,-44.3675 l 
0,-2.3711 c 0,-10.8242 -1.7859,-39.1885 -3.07967,-44.3675"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path6203"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       d="m 108.14615,895.8137 53.65709,28.0072 -53.65709,29.3653 0,-57.3725"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path6205"
+       style="fill:#f2b3b6;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       d="m 108.14615,895.8137 53.65709,28.0072 -6.14775,3.3643 -47.50934,-31.3715"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/src/youtube/grl-youtube.c b/src/youtube/grl-youtube.c
index 254d6a0..bd913ac 100644
--- a/src/youtube/grl-youtube.c
+++ b/src/youtube/grl-youtube.c
@@ -318,6 +318,8 @@ grl_youtube_source_new (const gchar *api_key, const gchar *client_id, const gcha
 {
   GrlYoutubeSource *source;
   GDataYouTubeService *service;
+  GIcon *icon;
+  GFile *file;
 
   GRL_DEBUG ("grl_youtube_source_new");
 
@@ -331,6 +333,10 @@ grl_youtube_source_new (const gchar *api_key, const gchar *client_id, const gcha
     return NULL;
   }
 
+  file = g_file_new_for_uri ("resource:///org/gnome/grilo/plugins/youtube/channel-youtube.svg");
+  icon = g_file_icon_new (file);
+  g_object_unref (file);
+
   /* Use auto-split mode because YouTube fails for queries
      that request more than YOUTUBE_MAX_CHUNK results */
   source = GRL_YOUTUBE_SOURCE (g_object_new (GRL_YOUTUBE_SOURCE_TYPE,
@@ -341,6 +347,7 @@ grl_youtube_source_new (const gchar *api_key, const gchar *client_id, const gcha
                                             YOUTUBE_MAX_CHUNK,
                                              "yt-service", service,
                                              "supported-media", GRL_MEDIA_TYPE_VIDEO,
+                                             "source-icon", icon,
                                             NULL));
 
   ytsrc = source;
diff --git a/src/youtube/youtube.gresource.xml b/src/youtube/youtube.gresource.xml
new file mode 100644
index 0000000..aaf1d21
--- /dev/null
+++ b/src/youtube/youtube.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/grilo/plugins/youtube">
+    <file compressed="false">channel-youtube.svg</file>
+  </gresource>
+</gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]