#include <libsoup/soup.h>
#include <math.h>
#include <string.h>
+#include <clutter-cairo.h>
enum
{
create_error_tile (ChamplainTile* tile)
{
ClutterActor *actor;
- ClutterColor red = { 0xff, 0x00, 0x00, 0xff };
-
- actor = clutter_texture_new_from_file (DATADIR "/champlain/error.svg", NULL);
- if (!actor)
- {
- /* Just in case the image is not found, put some red. This should not
- * happen if libchamplain is installed correctly. */
- actor = clutter_rectangle_new_with_color (&red);
- clutter_actor_set_size (actor , 256, 256);
- }
+ cairo_t *cr;
+ cairo_pattern_t *pat;
+
+ actor = clutter_cairo_new (256, 256);
+ cr = clutter_cairo_create (CLUTTER_CAIRO(actor));
+
+ /* draw a linear gray to white pattern */
+ pat = cairo_pattern_create_linear(128.0, 0.0, 256.0, 128.0);
+ cairo_pattern_add_color_stop_rgb(pat, 0, 0.686, 0.686, 0.686);
+ cairo_pattern_add_color_stop_rgb(pat, 1, 0.925, 0.925, 0.925);
+ cairo_set_source(cr, pat);
+ cairo_rectangle(cr, 0, 0, 256, 256);
+ cairo_fill(cr);
+
+ cairo_pattern_destroy(pat);
+
+ /* draw the red cross */
+ cairo_set_source_rgb(cr, 0.424, 0.078, 0.078);
+ cairo_set_line_width (cr, 14.0);
+ cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
+ cairo_move_to(cr, 24, 24);
+ cairo_line_to(cr, 50, 50);
+ cairo_move_to(cr, 50, 24);
+ cairo_line_to(cr, 24, 50);
+ cairo_stroke(cr);
+
+ cairo_destroy(cr);
champlain_tile_set_actor (tile, actor);
clutter_actor_show (actor);
+++ /dev/null
-<?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="256"
- height="256"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- version="1.0"
- sodipodi:docname="error.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- <defs
- id="defs4">
- <linearGradient
- id="linearGradient3200">
- <stop
- style="stop-color:#b3b3b3;stop-opacity:1;"
- offset="0"
- id="stop3202" />
- <stop
- style="stop-color:#ececec;stop-opacity:1;"
- offset="1"
- id="stop3204" />
- </linearGradient>
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 526.18109 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="744.09448 : 526.18109 : 1"
- inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
- id="perspective10" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3200"
- id="linearGradient3206"
- x1="122.23481"
- y1="0.032388873"
- x2="257.81464"
- y2="135.61221"
- gradientUnits="userSpaceOnUse"
- spreadMethod="reflect" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.235"
- inkscape:cx="150.26644"
- inkscape:cy="92.575521"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1023"
- inkscape:window-height="719"
- inkscape:window-x="1"
- inkscape:window-y="49" />
- <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="Calque 1"
- inkscape:groupmode="layer"
- id="layer1">
- <rect
- style="opacity:1;fill:url(#linearGradient3206);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.25000000000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect3198"
- width="256"
- height="256"
- x="0"
- y="0"
- rx="0"
- ry="0" />
- <path
- style="opacity:1;fill:#6c1414;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.25;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 17.691061,21.608585 C 15.787881,23.511765 15.809981,26.577605 17.713151,28.480785 L 25.734401,36.502025 L 17.713151,44.523265 C 15.809981,46.426445 15.787881,49.492285 17.691061,51.395465 L 19.989151,53.693555 C 21.892331,55.596735 24.958171,55.574635 26.861351,53.671465 L 34.882591,45.650215 L 42.903831,53.671465 C 44.807011,55.574635 47.872851,55.596735 49.776031,53.693555 L 52.074121,51.395465 C 53.977301,49.492285 53.955201,46.426445 52.052031,44.523265 L 44.030781,36.502025 L 52.052031,28.480785 C 53.955201,26.577605 53.977301,23.511765 52.074121,21.608585 L 49.776031,19.310495 C 47.872851,17.407315 44.807021,17.429405 42.903831,19.332585 L 34.882591,27.353835 L 26.861351,19.332585 C 24.958171,17.429415 21.892331,17.407315 19.989151,19.310495 L 17.691061,21.608585 z"
- id="rect2383" />
- </g>
-</svg>