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