The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

Tab.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
Circle boundaries heads/master
1 /* 2 Copyright (C) 2012 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 namespace BirdFont { 16 17 public class Tab : GLib.Object { 18 19 bool always_open; 20 double width; 21 string label; 22 FontDisplay display; 23 GlyphCollection glyph_collection; 24 25 public Tab (FontDisplay glyph, double tab_width, bool always_open) { 26 width = tab_width; 27 display = glyph; 28 this.always_open = always_open; 29 label = display.get_label (); 30 glyph_collection = new GlyphCollection.with_glyph ('\0', ""); 31 } 32 33 public bool has_close_button () { 34 return !always_open; 35 } 36 37 public GlyphCollection get_glyph_collection () { 38 return glyph_collection; 39 } 40 41 public void set_glyph_collection (GlyphCollection gc) { 42 glyph_collection = gc; 43 } 44 45 public void set_display (FontDisplay fd) { 46 display = fd; 47 } 48 49 public FontDisplay get_display () { 50 return display; 51 } 52 53 public double get_width () { 54 return width; 55 } 56 57 public string get_label () { 58 return label; 59 } 60 } 61 62 } 63