* stderr.printf -> debug etc
[jackpanel.git] / jackpanel / PanelDisplayBase.vala
blob56d8bab19138989757012bc69249f5d23f3c0d0b
1 using Gtk;
2 using Gdk;
3 using Prolooks;
5 namespace Jackpanel {
7 public abstract class PanelDisplayBase : DisplayBase {
8 public PanelDisplayBase () {
9 base ();
12 private string _time;
13 public string time {
14 get { return _time; }
15 set {
16 if (_time != value) {
17 _time = value;
18 redraw_time ();
23 private string _time_alt;
24 public string time_alt {
25 get { return _time_alt; }
26 set {
27 if (_time_alt != value) {
28 _time_alt = value;
29 redraw_time_alt ();
34 protected double xruns_x;
35 protected double xruns_y;
36 protected double xruns_w;
37 protected double xruns_h;
38 protected uint32 _xruns;
40 public signal void reset_xruns_requested ();
41 public uint32 xruns {
42 get {
43 return _xruns;
45 set {
46 if (_xruns != value) {
47 _xruns = value;
48 queue_draw ();
53 protected abstract void redraw_time ();
54 protected abstract void redraw_time_alt ();
56 protected static void debug_rect (Cairo.Context cr, double x, double y, double w, double h) {
57 cr.save ();
58 set_source_from_color_string (cr, "#ff0000");
59 cr.rectangle (x, y, w, h);
60 cr.stroke ();
61 cr.restore ();
64 protected bool is_in_rect (double x, double y, double r_x, double r_y, double r_w, double r_h) {
65 x -= inner_x;
66 y -= inner_y;
67 return (r_x <= x) && (x <= r_x + r_w)
68 && (r_y <= y) && (y <= r_y + r_h);
72 } //namespace Jackpanel