X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fcanvas%2Fflag.h;h=ac77cc759f7f22a96da157eeb53e4af8556321ec;hb=9a0a2a29b53a7d8b74d64039a3a594e54262ef29;hp=3127fb09ad884cb7d26bd136480fce30f8e0746e;hpb=aaea166135ace01709f7e0be64f40be80f4107ec;p=ardour.git diff --git a/libs/canvas/canvas/flag.h b/libs/canvas/canvas/flag.h index 3127fb09ad..ac77cc759f 100644 --- a/libs/canvas/canvas/flag.h +++ b/libs/canvas/canvas/flag.h @@ -1,5 +1,30 @@ -#include "canvas/group.h" +/* + Copyright (C) 2011-2013 Paul Davis + Author: Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __CANVAS_FLAG_H__ +#define __CANVAS_FLAG_H__ + +#include + +#include "canvas/visibility.h" #include "canvas/types.h" +#include "canvas/container.h" namespace ArdourCanvas { @@ -7,21 +32,32 @@ class Text; class Line; class Rectangle; -class Flag : public Group +class LIBCANVAS_API Flag : public Container { public: - Flag (Group *, Distance, Color, Color, Duple); + Flag (Canvas *, Distance, Gtkmm2ext::Color, Gtkmm2ext::Color, Duple, bool invert=false); + Flag (Item*, Distance, Gtkmm2ext::Color, Gtkmm2ext::Color, Duple, bool invert=false); void set_text (std::string const &); void set_height (Distance); - + + void set_font_description (Pango::FontDescription); + + bool covers (Duple const &) const; + + double width() const; + private: - Distance _height; - Color _outline_color; - Color _fill_color; + void setup (Distance height, Duple position); + + Gtkmm2ext::Color _outline_color; + Gtkmm2ext::Color _fill_color; Text* _text; Line* _line; Rectangle* _rectangle; + bool _invert; }; - + } + +#endif // __CANVAS_FLAG_H__