The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

HiddenTools.vala in libbirdfont

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of libbirdfont/HiddenTools.vala.
Merge branch '2.10'
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 Tool bezier_corner = new Tool ("bezier_corner", t_("Convert the last control point to a corner node")); 52 bezier_corner.select_action.connect ((self) => { 53 DrawingTools.bezier_tool.create_corner (); 54 }); 55 bezier_corner.is_tool_modifier = true; 56 hidden_expander.add_tool (bezier_corner); 57 bezier_corner.set_tool_visibility (false); 58 59 expanders.add (hidden_expander); 60 } 61 62 public override Gee.ArrayList<Expander> get_expanders () { 63 return expanders; 64 } 65 } 66 67 } 68