kNCurses/VerticalTilingWindowManager.cpp

41 lines
1.2 KiB
C++
Raw Normal View History

/**
* @author Christian Burger (christian@krikkel.de)
*/
#include "Debug.hpp"
2022-05-06 22:42:09 +02:00
#include <kNCurses/VerticalTilingWindowManager.hpp>
#include <kNCurses/Window.hpp>
#include <ncursesw/ncurses.h>
#include <algorithm>
namespace krikkel::NCurses
{
using std::recursive_mutex;
VerticalTilingWindowManager::VerticalTilingWindowManager(NCursesWindow *rootWindow, std::recursive_mutex *ncursesMutex)
: TilingWindowManager(rootWindow, ncursesMutex)
{}
void VerticalTilingWindowManager::resizeAndMoveWindow(Window *window, windowDimension dimension, windowPosition position)
{
__debug_log("(" + std::to_string(0 + begx()) + ", " + std::to_string(position + begy()) + ", " + std::to_string(width()) + ", " + std::to_string(dimension) + ")");
window->resize(dimension, width());
window->mvwin(position + begy(), 0 + begx());
}
TilingWindowManager::windowDimension VerticalTilingWindowManager::getAvailableSpace()
{
return height();
}
void VerticalTilingWindowManager::windowBorder()
{
hline(width());
}
void VerticalTilingWindowManager::moveCursor(TilingWindowManager::windowPosition position)
{
move(position, 0);
}
}