Fix include name for the ncursesw library
[centerim5.git] / cppconsui / HorizontalLine.cpp
blobcca8b9773ce170581048c003cac33df02a752a69
1 // Copyright (C) 2007 Mark Pustjens <pustjens@dds.nl>
2 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
3 //
4 // This file is part of CenterIM.
5 //
6 // CenterIM is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // CenterIM is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with CenterIM. If not, see <http://www.gnu.org/licenses/>.
19 /// @file
20 /// HorizontalLine class implementation
21 ///
22 /// @ingroup cppconsui
24 #include "HorizontalLine.h"
26 #include "ColorScheme.h"
28 namespace CppConsUI {
30 HorizontalLine::HorizontalLine(int w) : AbstractLine(w, 1)
34 int HorizontalLine::draw(Curses::ViewPort area, Error &error)
36 if (real_width_ == 0 || real_height_ != 1)
37 return 0;
39 int attrs;
40 DRAW(getAttributes(ColorScheme::PROPERTY_HORIZONTALLINE_LINE, &attrs, error));
41 DRAW(area.attrOn(attrs, error));
43 for (int i = 0; i < real_width_; ++i)
44 DRAW(area.addLineChar(i, 0, Curses::LINE_HLINE, error));
46 DRAW(area.attrOff(attrs, error));
48 return 0;
51 } // namespace CppConsUI
53 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: