commit 1770a175bd01a5d8287da8314d0720f8728ac20e
parent b526e381cc065e44dc8ec7620c1725b203a3ee85
Author: falkTX <falktx@gmail.com>
Date: Sun, 30 Sep 2018 20:56:48 +0200
Expose get/setIgnoringKeyRepeat in Window class
Fixes #15
Diffstat:
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dgl/Window.hpp b/dgl/Window.hpp
@@ -98,8 +98,6 @@ public:
bool isResizable() const noexcept;
void setResizable(bool yesNo);
- void setGeometryConstraints(uint width, uint height, bool aspect);
-
uint getWidth() const noexcept;
uint getHeight() const noexcept;
Size<uint> getSize() const noexcept;
@@ -109,11 +107,15 @@ public:
const char* getTitle() const noexcept;
void setTitle(const char* title);
+ void setGeometryConstraints(uint width, uint height, bool aspect);
void setTransientWinId(uintptr_t winId);
double getScaling() const noexcept;
void setScaling(double scaling) noexcept;
+ bool getIgnoringKeyRepeat() const noexcept;
+ void setIgnoringKeyRepeat(bool ignore) noexcept;
+
Application& getApp() const noexcept;
intptr_t getWindowId() const noexcept;
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
@@ -710,6 +710,18 @@ struct Window::PrivateData {
// -------------------------------------------------------------------
+ bool getIgnoringKeyRepeat() const noexcept
+ {
+ return fView->ignoreKeyRepeat;
+ }
+
+ void setIgnoringKeyRepeat(bool ignore) noexcept
+ {
+ puglIgnoreKeyRepeat(fView, ignore);
+ }
+
+ // -------------------------------------------------------------------
+
void addWidget(Widget* const widget)
{
fWidgets.push_back(widget);
@@ -1333,6 +1345,16 @@ void Window::setScaling(double scaling) noexcept
pData->setScaling(scaling);
}
+bool Window::getIgnoringKeyRepeat() const noexcept
+{
+ return pData->getIgnoringKeyRepeat();
+}
+
+void Window::setIgnoringKeyRepeat(bool ignore) noexcept
+{
+ pData->setIgnoringKeyRepeat(ignore);
+}
+
Application& Window::getApp() const noexcept
{
return pData->fApp;