The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

GlyphTab.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) 2016 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 GlyphTab : FontDisplay { 21 22 public GlyphCollection glyphs; 23 24 public GlyphTab (GlyphCollection glyphs) { 25 this.glyphs = glyphs; 26 } 27 28 public override string get_name () { 29 return glyphs.get_current ().get_name (); 30 } 31 32 public override string get_label () { 33 return glyphs.get_current ().get_label (); 34 } 35 36 public override void close () { 37 glyphs.get_current ().close (); 38 } 39 40 public override bool has_scrollbar () { 41 return glyphs.get_current ().has_scrollbar (); 42 } 43 44 public override void update_scrollbar () { 45 glyphs.get_current ().update_scrollbar (); 46 } 47 48 public override void scroll_to (double percent) { 49 glyphs.get_current ().scroll_to (percent); 50 } 51 52 public override void draw (WidgetAllocation allocation, Context cr) { 53 glyphs.get_current ().draw (allocation, cr); 54 } 55 56 public override void selected_canvas () { 57 glyphs.get_current ().selected_canvas (); 58 } 59 60 public override void key_press (uint keyval) { 61 glyphs.get_current ().key_press (keyval); 62 } 63 64 public override void key_release (uint keyval) { 65 glyphs.get_current ().key_release (keyval); 66 } 67 68 public override void motion_notify (double x, double y) { 69 glyphs.get_current ().motion_notify (x, y); 70 } 71 72 public override void button_release (int button, double x, double y) { 73 glyphs.get_current ().button_release (button, x, y); 74 } 75 76 public override void button_press (uint button, double x, double y) { 77 glyphs.get_current ().button_press (button, x, y); 78 } 79 80 public override void double_click (uint button, double ex, double ey) { 81 glyphs.get_current ().double_click (button, ex, ey); 82 } 83 84 public override void magnify (double magnification) { 85 glyphs.get_current ().magnify (magnification); 86 } 87 88 public override void tap_down (int finger, int x, int y) { 89 glyphs.get_current ().tap_down (finger, x, y); 90 } 91 92 public override void tap_up (int finger, int x, int y) { 93 glyphs.get_current ().tap_up (finger, x, y); 94 } 95 96 public override void tap_move (int finger, int x, int y) { 97 glyphs.get_current ().tap_move (finger, x, y); 98 } 99 100 public override void zoom_in () { 101 glyphs.get_current ().zoom_in (); 102 } 103 104 public override void zoom_out () { 105 glyphs.get_current ().zoom_out (); 106 } 107 108 public override void zoom_max () { 109 glyphs.get_current ().zoom_max (); 110 } 111 112 public override void zoom_min () { 113 glyphs.get_current ().zoom_min (); 114 } 115 116 public override void move_view (double x, double y) { 117 glyphs.get_current ().move_view (x, y); 118 } 119 120 public override void reset_zoom () { 121 glyphs.get_current ().reset_zoom (); 122 } 123 124 public override void store_current_view () { 125 glyphs.get_current ().store_current_view (); 126 } 127 128 public override void restore_last_view () { 129 glyphs.get_current ().restore_last_view (); 130 } 131 132 public override void next_view () { 133 glyphs.get_current ().next_view (); 134 } 135 136 public override void scroll_wheel (double x, double y, 137 double pixeldelta_x, double pixeldelta_y) { 138 glyphs.get_current ().scroll_wheel (x, y, pixeldelta_x, pixeldelta_y); 139 } 140 141 public override void undo () { 142 glyphs.get_current ().undo (); 143 } 144 145 public override void redo () { 146 glyphs.get_current ().redo (); 147 } 148 149 /** returns false if bindings to a single key works in the display. */ 150 public override bool needs_modifier () { 151 return glyphs.get_current ().needs_modifier (); 152 } 153 } 154 155 } 156