1 /**
2 * \brief Stock icons for Inkscape-specific menu items and buttons.
3 *
4 * Author:
5 * Derek P. Moore <derekm@hackunix.org>
6 *
7 * Copyright (C) 2004 Derek P. Moore
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifdef HAVE_CONFIG_H
13 # include "config.h"
14 #endif
16 #include <gtkmm/iconfactory.h>
17 #include <gtkmm/stock.h>
19 #include "stock.h"
20 #include "path-prefix.h"
22 namespace Inkscape {
23 namespace UI {
24 namespace Icons {
26 static Glib::ustring const get_icon_path(char const *utf8_basename);
28 void
29 init()
30 {
31 Glib::RefPtr<Gtk::IconFactory> icons = Gtk::IconFactory::create();
32 Gtk::IconSource src;
34 // repeat, for every Inkscape stock.h entry that needs an icon.
35 //Gtk::IconSet ;
36 //src.set_icon_name("");
37 //src.set_filename(get_icon_path(".svg"));
38 //.add_source(src);
39 //icons->add(Stock::, );
41 // File menu
42 // Open Recent
43 Gtk::IconSet _open_recent;
44 src.set_icon_name("OpenRecent");
45 src.set_filename(get_icon_path("open-recent.svg"));
46 _open_recent.add_source(src);
47 icons->add(Stock::OPEN_RECENT, _open_recent);
48 // Import
49 Gtk::IconSet _import;
50 src.set_icon_name("Import");
51 src.set_filename(get_icon_path("import.svg"));
52 _import.add_source(src);
53 icons->add(Stock::IMPORT, _import);
54 // Export
55 Gtk::IconSet _export;
56 src.set_icon_name("Export");
57 src.set_filename(get_icon_path("export.svg"));
58 _export.add_source(src);
59 icons->add(Stock::EXPORT, _export);
60 // Vacuum Defs
61 Gtk::IconSet _vacuum_defs;
62 src.set_icon_name("VacuumDefs");
63 src.set_filename(get_icon_path("vacuum-defs.svg"));
64 _vacuum_defs.add_source(src);
65 icons->add(Stock::VACUUM_DEFS, _vacuum_defs);
67 // Edit menu
68 // Paste In Place
69 Gtk::IconSet _paste_in_place;
70 src.set_icon_name("PasteInPlace");
71 src.set_filename(get_icon_path("paste-in-place.svg"));
72 _paste_in_place.add_source(src);
73 icons->add(Stock::PASTE_IN_PLACE, _paste_in_place);
74 // Paste Style
75 Gtk::IconSet _paste_style;
76 src.set_icon_name("PasteStyle");
77 src.set_filename(get_icon_path("paste-style.svg"));
78 _paste_style.add_source(src);
79 icons->add(Stock::PASTE_STYLE, _paste_style);
80 // Duplicate
81 Gtk::IconSet _duplicate;
82 src.set_icon_name("Duplicate");
83 src.set_filename(get_icon_path("duplicate.svg"));
84 _duplicate.add_source(src);
85 icons->add(Stock::DUPLICATE, _duplicate);
86 // Clone
87 Gtk::IconSet _clone;
88 src.set_icon_name("Clone");
89 src.set_filename(get_icon_path("clone.svg"));
90 _clone.add_source(src);
91 icons->add(Stock::CLONE, _clone);
92 // Unlink Clone
93 Gtk::IconSet _clone_unlink;
94 src.set_icon_name("CloneUnlink");
95 src.set_filename(get_icon_path("clone-unlink.svg"));
96 _clone_unlink.add_source(src);
97 icons->add(Stock::CLONE_UNLINK, _clone_unlink);
98 // Make Bitmap
99 Gtk::IconSet _make_bitmap;
100 src.set_icon_name("MakeBitmap");
101 src.set_filename(get_icon_path("make-bitmap.svg"));
102 _make_bitmap.add_source(src);
103 icons->add(Stock::MAKE_BITMAP, _make_bitmap);
104 // Select All
105 Gtk::IconSet _select_all;
106 src.set_icon_name("SelectAll");
107 src.set_filename(get_icon_path("select-all.svg"));
108 _select_all.add_source(src);
109 icons->add(Stock::SELECT_ALL, _select_all);
110 // XML Editor
111 Gtk::IconSet _xml_editor;
112 src.set_icon_name("XmlEditor");
113 src.set_filename(get_icon_path("xml-editor.svg"));
114 _xml_editor.add_source(src);
115 icons->add(Stock::XML_EDITOR, _xml_editor);
117 // View menu
118 // Zoom
119 Gtk::IconSet _zoom;
120 src.set_icon_name("Zoom");
121 src.set_filename(get_icon_path("zoom.svg"));
122 _zoom.add_source(src);
123 icons->add(Stock::ZOOM, _zoom);
124 // Zoom In (use Inkscape icon for consistency over Gtk::Stock::ZOOM_IN)
125 Gtk::IconSet _zoom_in;
126 src.set_icon_name("ZoomIn");
127 src.set_filename(get_icon_path("zoom-in.svg"));
128 _zoom_in.add_source(src);
129 icons->add(Stock::ZOOM_IN, _zoom_in);
130 // Zoom Out (use Inkscape icon for consistency over Gtk::Stock::ZOOM_OUT)
131 Gtk::IconSet _zoom_out;
132 src.set_icon_name("ZoomOut");
133 src.set_filename(get_icon_path("zoom-out.svg"));
134 _zoom_out.add_source(src);
135 icons->add(Stock::ZOOM_OUT, _zoom_out);
136 // Zoom 100% (use Inkscape icon for consistency over Gtk::Stock::ZOOM_100)
137 Gtk::IconSet _zoom_100;
138 src.set_icon_name("Zoom100");
139 src.set_filename(get_icon_path("zoom-100.svg"));
140 _zoom_100.add_source(src);
141 icons->add(Stock::ZOOM_100, _zoom_100);
142 // Zoom 50%
143 Gtk::IconSet _zoom_50;
144 src.set_icon_name("Zoom50");
145 src.set_filename(get_icon_path("zoom-50.svg"));
146 _zoom_50.add_source(src);
147 icons->add(Stock::ZOOM_50, _zoom_50);
148 // Zoom 200%
149 Gtk::IconSet _zoom_200;
150 src.set_icon_name("Zoom200");
151 src.set_filename(get_icon_path("zoom-200.svg"));
152 _zoom_200.add_source(src);
153 icons->add(Stock::ZOOM_200, _zoom_200);
154 // Zoom Selection
155 Gtk::IconSet _zoom_selection;
156 src.set_icon_name("ZoomSelection");
157 src.set_filename(get_icon_path("zoom-selection.svg"));
158 _zoom_selection.add_source(src);
159 icons->add(Stock::ZOOM_SELECTION, _zoom_selection);
160 // Zoom Drawing
161 Gtk::IconSet _zoom_drawing;
162 src.set_icon_name("ZoomDrawing");
163 src.set_filename(get_icon_path("zoom-drawing.svg"));
164 _zoom_drawing.add_source(src);
165 icons->add(Stock::ZOOM_DRAWING, _zoom_drawing);
166 // Zoom Page (use Inkscape icon for consistency over Gtk::Stock::ZOOM_FIT)
167 Gtk::IconSet _zoom_page;
168 src.set_icon_name("ZoomPage");
169 src.set_filename(get_icon_path("zoom-page.svg"));
170 _zoom_page.add_source(src);
171 icons->add(Stock::ZOOM_PAGE, _zoom_page);
172 // Zoom Width
173 Gtk::IconSet _zoom_width;
174 src.set_icon_name("ZoomWidth");
175 src.set_filename(get_icon_path("zoom-width.svg"));
176 _zoom_width.add_source(src);
177 icons->add(Stock::ZOOM_WIDTH, _zoom_width);
178 // Zoom Previous
179 Gtk::IconSet _zoom_prev;
180 src.set_icon_name("ZoomPrev");
181 src.set_filename(get_icon_path("zoom-prev.svg"));
182 _zoom_prev.add_source(src);
183 icons->add(Stock::ZOOM_PREV, _zoom_prev);
184 // Zoom Next
185 Gtk::IconSet _zoom_next;
186 src.set_icon_name("ZoomNext");
187 src.set_filename(get_icon_path("zoom-next.svg"));
188 _zoom_next.add_source(src);
189 icons->add(Stock::ZOOM_NEXT, _zoom_next);
190 // Show/Hide Dialogs
191 Gtk::IconSet _show_hide_dialogs;
192 src.set_icon_name("ShowHideDialogs");
193 src.set_filename(get_icon_path("show-hide-dialogs.svg"));
194 _show_hide_dialogs.add_source(src);
195 icons->add(Stock::SHOW_HIDE_DIALOGS, _show_hide_dialogs);
196 // Grid
197 Gtk::IconSet _grid;
198 src.set_icon_name("Grid");
199 src.set_filename(get_icon_path("grid.svg"));
200 _grid.add_source(src);
201 icons->add(Stock::GRID, _grid);
202 // Guides
203 Gtk::IconSet _guides;
204 src.set_icon_name("Guides");
205 src.set_filename(get_icon_path("guides.svg"));
206 _guides.add_source(src);
207 icons->add(Stock::GUIDES, _guides);
208 // Fullscreen
209 Gtk::IconSet _fullscreen;
210 src.set_icon_name("Fullscreen");
211 src.set_filename(get_icon_path("fullscreen.svg"));
212 _fullscreen.add_source(src);
213 icons->add(Stock::FULLSCREEN, _fullscreen);
214 // Previous Window
215 Gtk::IconSet _window_prev;
216 src.set_icon_name("WindowPrev");
217 src.set_filename(get_icon_path("window-prev.svg"));
218 _window_prev.add_source(src);
219 icons->add(Stock::WINDOW_PREV, _window_prev);
220 // Next Window
221 Gtk::IconSet _window_next;
222 src.set_icon_name("WindowNext");
223 src.set_filename(get_icon_path("window-next.svg"));
224 _window_next.add_source(src);
225 icons->add(Stock::WINDOW_NEXT, _window_next);
226 // Duplicate Window
227 Gtk::IconSet _window_duplicate;
228 src.set_icon_name("WindowDuplicate");
229 src.set_filename(get_icon_path("window-duplicate.svg"));
230 _window_duplicate.add_source(src);
231 icons->add(Stock::WINDOW_DUPLICATE, _window_duplicate);
233 // Layer menu
234 // New Layer
235 icons->add(Stock::LAYER_NEW,
236 Gtk::IconSet::lookup_default(Gtk::Stock::NEW));
237 // Delete Layer
238 icons->add(Stock::LAYER_DELETE,
239 Gtk::IconSet::lookup_default(Gtk::Stock::DELETE));
240 // Raise Layer
241 icons->add(Stock::LAYER_RAISE,
242 Gtk::IconSet::lookup_default(Gtk::Stock::GO_UP));
243 // Lower Layer
244 icons->add(Stock::LAYER_LOWER,
245 Gtk::IconSet::lookup_default(Gtk::Stock::GO_DOWN));
246 // Layer to Top
247 icons->add(Stock::LAYER_TO_TOP,
248 Gtk::IconSet::lookup_default(Gtk::Stock::GOTO_TOP));
249 // Layer to Bottom
250 icons->add(Stock::LAYER_TO_BOTTOM,
251 Gtk::IconSet::lookup_default(Gtk::Stock::GOTO_BOTTOM));
253 // Object menu
254 // Fill and Stoke
255 Gtk::IconSet _fill_stroke;
256 src.set_icon_name("FillAndStroke");
257 src.set_filename(get_icon_path("fill-stroke.svg"));
258 _fill_stroke.add_source(src);
259 icons->add(Stock::FILL_STROKE, _fill_stroke);
260 // Object Properties
261 Gtk::IconSet _object_properties;
262 src.set_icon_name("ObjectProperties");
263 src.set_filename(get_icon_path("object-properties.svg"));
264 _object_properties.add_source(src);
265 icons->add(Stock::OBJECT_PROPERTIES, _object_properties);
266 // Group
267 Gtk::IconSet _group;
268 src.set_icon_name("Group");
269 src.set_filename(get_icon_path("group.svg"));
270 _group.add_source(src);
271 icons->add(Stock::GROUP, _group);
272 // Ungroup
273 Gtk::IconSet _ungroup;
274 src.set_icon_name("Ungroup");
275 src.set_filename(get_icon_path("ungroup.svg"));
276 _ungroup.add_source(src);
277 icons->add(Stock::UNGROUP, _ungroup);
278 // Raise
279 Gtk::IconSet _raise;
280 src.set_icon_name("Raise");
281 src.set_filename(get_icon_path("raise.svg"));
282 _raise.add_source(src);
283 icons->add(Stock::RAISE, _raise);
284 // Lower
285 Gtk::IconSet _lower;
286 src.set_icon_name("Lower");
287 src.set_filename(get_icon_path("lower.svg"));
288 _lower.add_source(src);
289 icons->add(Stock::LOWER, _lower);
290 // Raise to Top
291 Gtk::IconSet _raise_to_top;
292 src.set_icon_name("RaiseToTop");
293 src.set_filename(get_icon_path("raise-to-top.svg"));
294 _raise_to_top.add_source(src);
295 icons->add(Stock::RAISE_TO_TOP, _raise_to_top);
296 // Lower to Bottom
297 Gtk::IconSet _lower_to_bottom;
298 src.set_icon_name("LowerToBottom");
299 src.set_filename(get_icon_path("lower-to-bottom.svg"));
300 _lower_to_bottom.add_source(src);
301 icons->add(Stock::LOWER_TO_BOTTOM, _lower_to_bottom);
302 // Move to Next Layer
303 Gtk::IconSet _move_to_next_layer;
304 src.set_icon_name("MoveToNextLayer");
305 src.set_filename(get_icon_path("move-to-next-layer.svg"));
306 _move_to_next_layer.add_source(src);
307 icons->add(Stock::MOVE_TO_NEXT_LAYER, _move_to_next_layer);
308 // Move to Previous Layer
309 Gtk::IconSet _move_to_prev_layer;
310 src.set_icon_name("MoveToPrevLayer");
311 src.set_filename(get_icon_path("move-to-prev-layer.svg"));
312 _move_to_prev_layer.add_source(src);
313 icons->add(Stock::MOVE_TO_PREV_LAYER, _move_to_prev_layer);
314 // Move to Top Layer
315 Gtk::IconSet _move_to_top_layer;
316 src.set_icon_name("MoveToTopLayer");
317 src.set_filename(get_icon_path("move-to-top-layer.svg"));
318 _move_to_top_layer.add_source(src);
319 icons->add(Stock::MOVE_TO_TOP_LAYER, _move_to_top_layer);
320 // Move to Bottom Layer
321 Gtk::IconSet _move_to_bottom_layer;
322 src.set_icon_name("MoveToBottomLayer");
323 src.set_filename(get_icon_path("move-to-bottom-layer.svg"));
324 _move_to_bottom_layer.add_source(src);
325 icons->add(Stock::MOVE_TO_BOTTOM_LAYER, _move_to_bottom_layer);
326 // Rotate 90 CW
327 Gtk::IconSet _rotate_90_cw;
328 src.set_icon_name("Rotate90CW");
329 src.set_filename(get_icon_path("rotate-90-cw.svg"));
330 _rotate_90_cw.add_source(src);
331 icons->add(Stock::ROTATE_90_CW, _rotate_90_cw);
332 // Rotate 90 CCW
333 Gtk::IconSet _rotate_90_ccw;
334 src.set_icon_name("Rotate90CCW");
335 src.set_filename(get_icon_path("rotate-90-ccw.svg"));
336 _rotate_90_ccw.add_source(src);
337 icons->add(Stock::ROTATE_90_CCW, _rotate_90_ccw);
338 // Flip Horizontal
339 Gtk::IconSet _flip_horiz;
340 src.set_icon_name("FlipHoriz");
341 src.set_filename(get_icon_path("flip-horiz.svg"));
342 _flip_horiz.add_source(src);
343 icons->add(Stock::FLIP_HORIZ, _flip_horiz);
344 // Flip Vertical
345 Gtk::IconSet _flip_vert;
346 src.set_icon_name("FlipVert");
347 src.set_filename(get_icon_path("flip-vert.svg"));
348 _flip_vert.add_source(src);
349 icons->add(Stock::FLIP_VERT, _flip_vert);
350 // Transform
351 Gtk::IconSet _transform;
352 src.set_icon_name("Transform");
353 src.set_filename(get_icon_path("transform.svg"));
354 _transform.add_source(src);
355 icons->add(Stock::TRANSFORM, _transform);
356 // Transformation
357 Gtk::IconSet _transformation;
358 src.set_icon_name("Transformation");
359 src.set_filename(get_icon_path("transform.svg"));
360 _transformation.add_source(src);
361 icons->add(Stock::TRANSFORMATION, _transformation);
362 // Align and Distribute
363 Gtk::IconSet _align_distribute;
364 src.set_icon_name("AlignAndDistribute");
365 src.set_filename(get_icon_path("align-distribute.svg"));
366 _align_distribute.add_source(src);
367 icons->add(Stock::ALIGN_DISTRIBUTE, _align_distribute);
369 // Path menu
370 // Object to Path
371 Gtk::IconSet _object_to_path;
372 src.set_icon_name("ObjectToPath");
373 src.set_filename(get_icon_path("object-to-path.svg"));
374 _object_to_path.add_source(src);
375 icons->add(Stock::OBJECT_TO_PATH, _object_to_path);
376 // Stroke to Path
377 Gtk::IconSet _stroke_to_path;
378 src.set_icon_name("StrokeToPath");
379 src.set_filename(get_icon_path("stroke-to-path.svg"));
380 _stroke_to_path.add_source(src);
381 icons->add(Stock::STROKE_TO_PATH, _stroke_to_path);
382 // Trace
383 Gtk::IconSet _trace;
384 src.set_icon_name("Trace");
385 src.set_filename(get_icon_path("trace.svg"));
386 _trace.add_source(src);
387 icons->add(Stock::TRACE, _trace);
388 // Union
389 Gtk::IconSet _union;
390 src.set_icon_name("Union");
391 src.set_filename(get_icon_path("union.svg"));
392 _union.add_source(src);
393 icons->add(Stock::UNION, _union);
394 // Difference
395 Gtk::IconSet _difference;
396 src.set_icon_name("Difference");
397 src.set_filename(get_icon_path("difference.svg"));
398 _difference.add_source(src);
399 icons->add(Stock::DIFFERENCE, _difference);
400 // Intersection
401 Gtk::IconSet _intersection;
402 src.set_icon_name("Intersection");
403 src.set_filename(get_icon_path("intersection.svg"));
404 _intersection.add_source(src);
405 icons->add(Stock::INTERSECTION, _intersection);
406 // Exclusion
407 Gtk::IconSet _exclusion;
408 src.set_icon_name("Exclusion");
409 src.set_filename(get_icon_path("exclusion.svg"));
410 _exclusion.add_source(src);
411 icons->add(Stock::EXCLUSION, _exclusion);
412 // Division
413 Gtk::IconSet _division;
414 src.set_icon_name("Division");
415 src.set_filename(get_icon_path("division.svg"));
416 _division.add_source(src);
417 icons->add(Stock::DIVISION, _division);
418 // Cut Path
419 Gtk::IconSet _cut_path;
420 src.set_icon_name("CutPath");
421 src.set_filename(get_icon_path("cut-path.svg"));
422 _cut_path.add_source(src);
423 icons->add(Stock::CUT_PATH, _cut_path);
424 // Combine
425 Gtk::IconSet _combine;
426 src.set_icon_name("Combine");
427 src.set_filename(get_icon_path("combine.svg"));
428 _combine.add_source(src);
429 icons->add(Stock::COMBINE, _combine);
430 // Break Apart
431 Gtk::IconSet _break_apart;
432 src.set_icon_name("BreakApart");
433 src.set_filename(get_icon_path("break-apart.svg"));
434 _break_apart.add_source(src);
435 icons->add(Stock::BREAK_APART, _break_apart);
436 // Inset
437 Gtk::IconSet _inset;
438 src.set_icon_name("Inset");
439 src.set_filename(get_icon_path("inset.svg"));
440 _inset.add_source(src);
441 icons->add(Stock::INSET, _inset);
442 // Outset
443 Gtk::IconSet _outset;
444 src.set_icon_name("Outset");
445 src.set_filename(get_icon_path("outset.svg"));
446 _outset.add_source(src);
447 icons->add(Stock::OUTSET, _outset);
448 // Dynamic Offset
449 Gtk::IconSet _offset_dynamic;
450 src.set_icon_name("OffsetDynamic");
451 src.set_filename(get_icon_path("offset-dynamic.svg"));
452 _offset_dynamic.add_source(src);
453 icons->add(Stock::OFFSET_DYNAMIC, _offset_dynamic);
454 // Linked Offset
455 Gtk::IconSet _offset_linked;
456 src.set_icon_name("OffsetLinked");
457 src.set_filename(get_icon_path("offset-linked.svg"));
458 _offset_linked.add_source(src);
459 icons->add(Stock::OFFSET_LINKED, _offset_linked);
460 // Simplify
461 Gtk::IconSet _simplify;
462 src.set_icon_name("Simplify");
463 src.set_filename(get_icon_path("simplify.svg"));
464 _simplify.add_source(src);
465 icons->add(Stock::SIMPLIFY, _simplify);
466 // Reverse
467 Gtk::IconSet _reverse;
468 src.set_icon_name("Reverse");
469 src.set_filename(get_icon_path("reverse.svg"));
470 _reverse.add_source(src);
471 icons->add(Stock::REVERSE, _reverse);
473 // Help menu
474 // Keys and Mouse
475 Gtk::IconSet _keys_mouse;
476 src.set_icon_name("KeysAndMouse");
477 src.set_filename(get_icon_path("keys-mouse.svg"));
478 _keys_mouse.add_source(src);
479 icons->add(Stock::KEYS_MOUSE, _keys_mouse);
480 // Tutorials
481 Gtk::IconSet _tutorials;
482 src.set_icon_name("Tutorials");
483 src.set_filename(get_icon_path("tutorials.svg"));
484 _tutorials.add_source(src);
485 icons->add(Stock::TUTORIALS, _tutorials);
486 // About Inkscape
487 Gtk::IconSet _about;
488 src.set_icon_name("About");
489 src.set_filename(get_icon_path("inkscape.svg"));
490 _about.add_source(src);
491 icons->add(Stock::ABOUT, _about);
492 // About Splash
493 Gtk::IconSet _about_splash;
494 src.set_filename(get_icon_path("about41.svg"));
495 src.set_size(Gtk::IconSize::register_new("about", 750, 625));
496 _about_splash.add_source(src);
497 icons->add(Stock::ABOUT_SPLASH, _about_splash);
498 // 42 Don't Panic!
499 Gtk::IconSet _about_42;
500 src.set_filename(get_icon_path("dontpanic.svg"));
501 src.set_size(Gtk::IconSize::register_new("dontpanic", 250, 172));
502 _about_42.add_source(src);
503 icons->add(Stock::ABOUT_42, _about_42);
504 // Quick Help
505 Gtk::IconSet _about_quick_help;
506 src.set_filename(get_icon_path("quick-help.svg"));
507 src.set_size(Gtk::IconSize::from_name("about"));
508 _about_quick_help.add_source(src);
509 icons->add(Stock::ABOUT_QUICK_HELP, _about_quick_help);
511 // Tools toolbar
512 // Select tool
513 Gtk::IconSet _tool_select;
514 src.set_icon_name("ToolSelect");
515 src.set_filename(get_icon_path("tool-select.svg"));
516 _tool_select.add_source(src);
517 icons->add(Stock::TOOL_SELECT, _tool_select);
518 // Node tool
519 Gtk::IconSet _tool_node;
520 src.set_icon_name("ToolNode");
521 src.set_filename(get_icon_path("tool-node.svg"));
522 _tool_node.add_source(src);
523 icons->add(Stock::TOOL_NODE, _tool_node);
524 // Zoom tool
525 Gtk::IconSet _tool_zoom;
526 src.set_icon_name("ToolZoom");
527 src.set_filename(get_icon_path("tool-zoom.svg"));
528 _tool_zoom.add_source(src);
529 icons->add(Stock::TOOL_ZOOM, _tool_zoom);
530 // Rect tool
531 Gtk::IconSet _tool_rect;
532 src.set_icon_name("ToolRect");
533 src.set_filename(get_icon_path("tool-rect.svg"));
534 _tool_rect.add_source(src);
535 icons->add(Stock::TOOL_RECT, _tool_rect);
536 // Arc tool
537 Gtk::IconSet _tool_arc;
538 src.set_icon_name("ToolArc");
539 src.set_filename(get_icon_path("tool-arc.svg"));
540 _tool_arc.add_source(src);
541 icons->add(Stock::TOOL_ARC, _tool_arc);
542 // Star tool
543 Gtk::IconSet _tool_star;
544 src.set_icon_name("ToolStar");
545 src.set_filename(get_icon_path("tool-star.svg"));
546 _tool_star.add_source(src);
547 icons->add(Stock::TOOL_STAR, _tool_star);
548 // Spiral tool
549 Gtk::IconSet _tool_spiral;
550 src.set_icon_name("ToolSpiral");
551 src.set_filename(get_icon_path("tool-spiral.svg"));
552 _tool_spiral.add_source(src);
553 icons->add(Stock::TOOL_SPIRAL, _tool_spiral);
554 // Freehand tool
555 Gtk::IconSet _tool_freehand;
556 src.set_icon_name("ToolFreehand");
557 src.set_filename(get_icon_path("tool-freehand.svg"));
558 _tool_freehand.add_source(src);
559 icons->add(Stock::TOOL_FREEHAND, _tool_freehand);
560 // Pen tool
561 Gtk::IconSet _tool_pen;
562 src.set_icon_name("ToolPen");
563 src.set_filename(get_icon_path("tool-pen.svg"));
564 _tool_pen.add_source(src);
565 icons->add(Stock::TOOL_PEN, _tool_pen);
566 // DynaDraw tool
567 Gtk::IconSet _tool_dynadraw;
568 src.set_icon_name("ToolDynaDraw");
569 src.set_filename(get_icon_path("tool-dynadraw.svg"));
570 _tool_dynadraw.add_source(src);
571 icons->add(Stock::TOOL_DYNADRAW, _tool_dynadraw);
572 // Text tool
573 Gtk::IconSet _tool_text;
574 src.set_icon_name("ToolText");
575 src.set_filename(get_icon_path("tool-text.svg"));
576 _tool_text.add_source(src);
577 icons->add(Stock::TOOL_TEXT, _tool_text);
578 // Dropper tool
579 Gtk::IconSet _tool_dropper;
580 src.set_icon_name("ToolDropper");
581 src.set_filename(get_icon_path("tool-dropper.svg"));
582 _tool_dropper.add_source(src);
583 icons->add(Stock::TOOL_DROPPER, _tool_dropper);
585 // Select Tool controls
586 Gtk::IconSource small;
587 small.set_size(Gtk::ICON_SIZE_SMALL_TOOLBAR);
588 // Transform Stroke
589 Gtk::IconSet _transform_stroke;
590 small.set_icon_name("TransformStroke");
591 small.set_filename(get_icon_path("transform-stroke.svg"));
592 _transform_stroke.add_source(small);
593 icons->add(Stock::TRANSFORM_STROKE, _transform_stroke);
594 // Transform Corners
595 Gtk::IconSet _transform_corners;
596 small.set_icon_name("TransformCorners");
597 small.set_filename(get_icon_path("transform-corners.svg"));
598 _transform_corners.add_source(small);
599 icons->add(Stock::TRANSFORM_CORNERS, _transform_corners);
600 // Transform Grandient
601 Gtk::IconSet _transform_gradient;
602 small.set_icon_name("TransformGrandient");
603 small.set_filename(get_icon_path("transform-gradient.svg"));
604 _transform_gradient.add_source(small);
605 icons->add(Stock::TRANSFORM_GRADIENT, _transform_gradient);
606 // Transform Pattern
607 Gtk::IconSet _transform_pattern;
608 small.set_icon_name("TransformPattern");
609 small.set_filename(get_icon_path("transform-pattern.svg"));
610 _transform_pattern.add_source(small);
611 icons->add(Stock::TRANSFORM_PATTERN, _transform_pattern);
613 // Calligraphy Tool controls
614 // Use Pressure
615 Gtk::IconSet _use_pressure;
616 small.set_icon_name("UsePressure");
617 small.set_filename(get_icon_path("use-pressure.svg"));
618 _use_pressure.add_source(small);
619 icons->add(Stock::USE_PRESSURE, _use_pressure);
620 // Use Tilt
621 Gtk::IconSet _use_tilt;
622 small.set_icon_name("UseTilt");
623 small.set_filename(get_icon_path("use-tilt.svg"));
624 _use_tilt.add_source(small);
625 icons->add(Stock::USE_TILT, _use_tilt);
627 // Session playback dialog
628 // Rewind
629 Gtk::IconSet _session_rewind;
630 src.set_icon_name("Rewind");
631 src.set_filename(get_icon_path("session-rew.svg"));
632 _session_rewind.add_source(src);
633 icons->add(Stock::SESSION_PLAYBACK_REW, _session_rewind);
634 // Step backwards
635 Gtk::IconSet _session_stepback;
636 src.set_icon_name("StepBackward");
637 src.set_filename(get_icon_path("session-back1.svg"));
638 _session_stepback.add_source(src);
639 icons->add(Stock::SESSION_PLAYBACK_STEPBACK, _session_stepback);
640 // Pause
641 Gtk::IconSet _session_pause;
642 src.set_icon_name("Pause");
643 src.set_filename(get_icon_path("session-pause.svg"));
644 _session_pause.add_source(src);
645 icons->add(Stock::SESSION_PLAYBACK_PAUSE, _session_pause);
646 // Step forwards
647 Gtk::IconSet _session_stepforward;
648 src.set_icon_name("StepForward");
649 src.set_filename(get_icon_path("session-adv1.svg"));
650 _session_stepforward.add_source(src);
651 icons->add(Stock::SESSION_PLAYBACK_STEPFORWARD, _session_stepforward);
652 // Play
653 Gtk::IconSet _session_play;
654 src.set_icon_name("Play");
655 src.set_filename(get_icon_path("session-play.svg"));
656 _session_play.add_source(src);
657 icons->add(Stock::SESSION_PLAYBACK_PLAY, _session_play);
659 icons->add_default();
660 }
662 /** Returns the icon filename (in the operating system encoding used for filenames) whose basename
663 in utf8 encoding is \a utf8_basename.
664 **/
665 static Glib::ustring const
666 get_icon_path(char const *const utf8_basename)
667 {
668 /* Given that INKSCAPE_PIXMAPDIR is often a compiled constant, I suppose we should
669 interpret it as utf8: under windows, the encoding for filenames can change from
670 day to day even for a given file. */
671 static char *const opsys_iconsdir = g_filename_from_utf8(INKSCAPE_PIXMAPDIR, -1,
672 NULL, NULL, NULL);
674 g_assert(g_utf8_validate(utf8_basename, -1, NULL));
675 char *const opsys_basename = g_filename_from_utf8(utf8_basename, -1, NULL, NULL, NULL);
676 char *const ret_cstr = g_build_filename(opsys_iconsdir, opsys_basename, NULL);
677 Glib::ustring const ret(ret_cstr);
678 g_free(ret_cstr);
679 g_free(opsys_basename);
680 return ret;
681 }
683 } // namespace Icon
684 } // namespace UI
685 } // namespace Inkscape
687 /*
688 Local Variables:
689 mode:c++
690 c-file-style:"stroustrup"
691 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
692 indent-tabs-mode:nil
693 fill-column:99
694 End:
695 */
696 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :