.
1 /*
2 Copyright (C) 2015 Johan Mattsson
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the
7 License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13 */
14
15 using Cairo;
16 using Math;
17
18 namespace BirdFont {
19
20 public class HiddenTools : ToolCollection {
21
22 public Gee.ArrayList<Expander> expanders;
23 public Expander hidden_expander;
24
25 public HiddenTools () {
26 hidden_expander = new Expander ();
27 expanders = new Gee.ArrayList<Expander> ();
28
29 Tool zoom_in = new Tool ("zoom_in", t_("Zoom in"));
30 zoom_in.select_action.connect ((self) => {
31 DrawingTools.zoom_tool.store_current_view ();
32 GlyphCanvas.current_display.zoom_in ();
33 });
34 hidden_expander.add_tool (zoom_in);
35
36 Tool zoom_out = new Tool ("zoom_out", t_("Zoom out"));
37 zoom_out.select_action.connect ((self) => {
38 DrawingTools.zoom_tool.store_current_view ();
39 GlyphCanvas.current_display.zoom_out ();
40 });
41 hidden_expander.add_tool (zoom_out);
42
43 Tool bezier_line = new Tool ("bezier_line", t_("Convert the last segment to a straight line"));
44 bezier_line.select_action.connect ((self) => {
45 DrawingTools.bezier_tool.switch_to_line_mode ();
46 });
47 bezier_line.is_tool_modifier = true;
48 hidden_expander.add_tool (bezier_line);
49 bezier_line.set_tool_visibility (false);
50
51 expanders.add (hidden_expander);
52 }
53
54 public override Gee.ArrayList<Expander> get_expanders () {
55 return expanders;
56 }
57 }
58
59 }
60