[aseprite] 136/250: Move window size fields to OSXWindow
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:21 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 9e44818cd8ec395f135990d55596c8151334307c
Author: David Capello <davidcapello at gmail.com>
Date: Tue Oct 6 11:18:21 2015 -0300
Move window size fields to OSXWindow
---
src/she/osx/window.h | 6 ++++++
src/she/osx/window.mm | 12 ++++++++++++
src/she/skia/skia_window_osx.mm | 6 ++----
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/she/osx/window.h b/src/she/osx/window.h
index d585e95..03372f4 100644
--- a/src/she/osx/window.h
+++ b/src/she/osx/window.h
@@ -14,6 +14,8 @@
#include <stdio.h>
+#include "gfx/size.h"
+
class CloseDelegate {
public:
virtual ~CloseDelegate() { }
@@ -23,11 +25,15 @@ public:
@interface OSXWindow : NSWindow
{
CloseDelegate* closeDelegate;
+ gfx::Size clientSize;
+ gfx::Size restoredSize;
}
- (OSXWindow*)init;
- (void)dealloc;
- (CloseDelegate*)closeDelegate;
- (void)setCloseDelegate:(CloseDelegate*)aDelegate;
+- (gfx::Size)clientSize;
+- (gfx::Size)restoredSize;
@end
#endif
diff --git a/src/she/osx/window.mm b/src/she/osx/window.mm
index 0befdce..5b1e1d8 100644
--- a/src/she/osx/window.mm
+++ b/src/she/osx/window.mm
@@ -78,6 +78,8 @@
closeDelegate = nullptr;
NSRect rect = NSMakeRect(0, 0, 640, 480);
+ clientSize.w = restoredSize.w = rect.size.width;
+ clientSize.h = restoredSize.h = rect.size.height;
OSXWindowDelegate* windowDelegate = [[OSXWindowDelegate new] autorelease];
[windowDelegate setEventQueue:she::instance()->eventQueue()];
@@ -113,4 +115,14 @@
closeDelegate = aDelegate;
}
+- (gfx::Size)clientSize
+{
+ return clientSize;
+}
+
+- (gfx::Size)restoredSize
+{
+ return restoredSize;
+}
+
@end
diff --git a/src/she/skia/skia_window_osx.mm b/src/she/skia/skia_window_osx.mm
index d273288..988ec0a 100644
--- a/src/she/skia/skia_window_osx.mm
+++ b/src/she/skia/skia_window_osx.mm
@@ -21,8 +21,6 @@ public:
bool closing;
int scale;
OSXWindow* window;
- gfx::Size clientSize;
- gfx::Size restoredSize;
Impl() {
closing = false;
@@ -87,12 +85,12 @@ bool SkiaWindow::isMaximized() const
gfx::Size SkiaWindow::clientSize() const
{
- return m_impl->clientSize;
+ return m_impl->window.clientSize;
}
gfx::Size SkiaWindow::restoredSize() const
{
- return m_impl->restoredSize;
+ return m_impl->window.restoredSize;
}
void SkiaWindow::setTitle(const std::string& title)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list