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