[aseprite] 181/250: Return false if the native cursor cannot be change on SkiaWindow::setNativeMouseCursor

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:28 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 8cba37e36b24179736fa026443d8eaaf02ed5bc4
Author: David Capello <davidcapello at gmail.com>
Date:   Wed Oct 14 19:31:38 2015 -0300

    Return false if the native cursor cannot be change on SkiaWindow::setNativeMouseCursor
---
 src/she/osx/window.h            |  2 +-
 src/she/osx/window.mm           |  3 ++-
 src/she/skia/skia_display.cpp   |  3 +--
 src/she/skia/skia_window_osx.h  |  2 +-
 src/she/skia/skia_window_osx.mm | 10 ++++++----
 src/she/win/window.h            |  3 ++-
 6 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/she/osx/window.h b/src/she/osx/window.h
index 1636f78..b1e8cc0 100644
--- a/src/she/osx/window.h
+++ b/src/she/osx/window.h
@@ -47,7 +47,7 @@ public:
 - (gfx::Size)clientSize;
 - (gfx::Size)restoredSize;
 - (void)setMousePosition:(const gfx::Point&)position;
-- (void)setNativeMouseCursor:(she::NativeCursor)cursor;
+- (BOOL)setNativeMouseCursor:(she::NativeCursor)cursor;
 @end
 
 #endif
diff --git a/src/she/osx/window.mm b/src/she/osx/window.mm
index 59e1b09..f856abe 100644
--- a/src/she/osx/window.mm
+++ b/src/she/osx/window.mm
@@ -104,7 +104,7 @@ using namespace she;
    CFRelease(event);
 }
 
-- (void)setNativeMouseCursor:(NativeCursor)cursor
+- (BOOL)setNativeMouseCursor:(NativeCursor)cursor
 {
   NSCursor* nsCursor = nil;
 
@@ -154,6 +154,7 @@ using namespace she;
   }
 
   [self.contentView setCursor:nsCursor];
+  return (nsCursor != nil ? YES: NO);
 }
 
 @end
diff --git a/src/she/skia/skia_display.cpp b/src/she/skia/skia_display.cpp
index 8b501f5..8982077 100644
--- a/src/she/skia/skia_display.cpp
+++ b/src/she/skia/skia_display.cpp
@@ -122,8 +122,7 @@ NativeCursor SkiaDisplay::nativeMouseCursor()
 bool SkiaDisplay::setNativeMouseCursor(NativeCursor cursor)
 {
   m_nativeCursor = cursor;
-  m_window.setNativeMouseCursor(cursor);
-  return true;
+  return m_window.setNativeMouseCursor(cursor);
 }
 
 void SkiaDisplay::setMousePosition(const gfx::Point& position)
diff --git a/src/she/skia/skia_window_osx.h b/src/she/skia/skia_window_osx.h
index 28f1a73..8012f4f 100644
--- a/src/she/skia/skia_window_osx.h
+++ b/src/she/skia/skia_window_osx.h
@@ -37,7 +37,7 @@ public:
   void captureMouse();
   void releaseMouse();
   void setMousePosition(const gfx::Point& position);
-  void setNativeMouseCursor(NativeCursor cursor);
+  bool setNativeMouseCursor(NativeCursor cursor);
   void updateWindow(const gfx::Rect& bounds);
   void* handle();
 
diff --git a/src/she/skia/skia_window_osx.mm b/src/she/skia/skia_window_osx.mm
index f3e5688..89d2f65 100644
--- a/src/she/skia/skia_window_osx.mm
+++ b/src/she/skia/skia_window_osx.mm
@@ -94,8 +94,8 @@ public:
     [m_window setMousePosition:position];
   }
 
-  void setNativeMouseCursor(NativeCursor cursor) {
-    [m_window setNativeMouseCursor:cursor];
+  bool setNativeMouseCursor(NativeCursor cursor) {
+    return ([m_window setNativeMouseCursor:cursor] ? true: false);
   }
 
   void updateWindow(const gfx::Rect& bounds) {
@@ -378,10 +378,12 @@ void SkiaWindow::setMousePosition(const gfx::Point& position)
     m_impl->setMousePosition(position);
 }
 
-void SkiaWindow::setNativeMouseCursor(NativeCursor cursor)
+bool SkiaWindow::setNativeMouseCursor(NativeCursor cursor)
 {
   if (m_impl)
-    m_impl->setNativeMouseCursor(cursor);
+    return m_impl->setNativeMouseCursor(cursor);
+  else
+    return false;
 }
 
 void SkiaWindow::updateWindow(const gfx::Rect& bounds)
diff --git a/src/she/win/window.h b/src/she/win/window.h
index ceaa312..bad64f5 100644
--- a/src/she/win/window.h
+++ b/src/she/win/window.h
@@ -100,7 +100,7 @@ namespace she {
       SetCursorPos(pos.x, pos.y);
     }
 
-    void setNativeMouseCursor(NativeCursor cursor) {
+    bool setNativeMouseCursor(NativeCursor cursor) {
       HCURSOR hcursor = NULL;
 
       switch (cursor) {
@@ -150,6 +150,7 @@ namespace she {
 
       SetCursor(hcursor);
       m_hcursor = hcursor;
+      return (m_hcursor ? true: false);
     }
 
     void updateWindow(const gfx::Rect& bounds) {

-- 
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