add Application::windowSize()

This commit is contained in:
Günter Obiltschnig
2021-04-11 16:00:53 +02:00
parent 8625b29f9f
commit 4066c4d794
2 changed files with 42 additions and 1 deletions

View File

@@ -118,6 +118,12 @@ public:
PRIO_SYSTEM = 100
};
struct WindowSize
{
int width;
int height;
};
Application();
/// Creates the Application.
@@ -294,6 +300,15 @@ public:
/// help information has been encountered and no other things
/// besides displaying help shall be done.
static WindowSize windowSize();
/// Returns the current window size of the console window,
/// if available.
///
/// Currently implemented for POSIX platforms (via TIOCGWINSZ ioctl())
/// and Windows (GetConsoleScreenBufferInfo()).
///
/// Returns zero width and height if the window size cannot be determined.
const char* name() const;
protected: