2022-05-03 11:23:32 +02:00
|
|
|
/**
|
|
|
|
* @author Christian Burger (christian@krikkel.de)
|
|
|
|
*/
|
|
|
|
|
2022-05-18 21:15:13 +02:00
|
|
|
#include "Debug.hpp"
|
2022-05-06 22:42:09 +02:00
|
|
|
#include <kNCurses/VerticalTilingWindowManager.hpp>
|
|
|
|
#include <kNCurses/Window.hpp>
|
2022-05-03 11:23:32 +02:00
|
|
|
#include <ncursesw/ncurses.h>
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
namespace krikkel::NCurses
|
|
|
|
{
|
2022-05-06 14:02:18 +02:00
|
|
|
using std::recursive_mutex;
|
2022-05-03 11:23:32 +02:00
|
|
|
|
2022-05-08 20:57:48 +02:00
|
|
|
VerticalTilingWindowManager::VerticalTilingWindowManager(NCursesWindow *rootWindow, std::recursive_mutex *ncursesMutex)
|
|
|
|
: TilingWindowManager(rootWindow, ncursesMutex)
|
2022-05-03 11:23:32 +02:00
|
|
|
{}
|
|
|
|
|
2022-05-18 21:15:13 +02:00
|
|
|
void VerticalTilingWindowManager::resizeAndMoveWindow(Window *window, windowDimension dimension, windowPosition position)
|
2022-05-03 11:23:32 +02:00
|
|
|
{
|
2022-05-18 21:15:13 +02:00
|
|
|
__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());
|
2022-05-03 11:23:32 +02:00
|
|
|
}
|
2022-05-18 21:15:13 +02:00
|
|
|
|
|
|
|
TilingWindowManager::windowDimension VerticalTilingWindowManager::getAvailableSpace()
|
|
|
|
{
|
|
|
|
return height();
|
|
|
|
}
|
|
|
|
|
|
|
|
void VerticalTilingWindowManager::windowBorder()
|
|
|
|
{
|
|
|
|
hline(width());
|
|
|
|
}
|
|
|
|
|
|
|
|
void VerticalTilingWindowManager::moveCursor(TilingWindowManager::windowPosition position)
|
|
|
|
{
|
|
|
|
move(position, 0);
|
|
|
|
}
|
|
|
|
|
2022-05-03 11:23:32 +02:00
|
|
|
}
|