From 2aea49b8e0aa4db649818353d0f1756854b0a487 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Fri, 1 Jul 2011 23:47:37 +0200 Subject: [add] - HasCursor method to WinSystemBase - defaulting to true - overwrite this for ios to false if not appletv2 - use HasCursor in GUIWindowPointer::UpdateVisibility --- xbmc/windowing/WinSystem.h | 1 + xbmc/windowing/osx/WinSystemIOS.h | 1 + xbmc/windowing/osx/WinSystemIOS.mm | 13 +++++++++++++ xbmc/windows/GUIWindowPointer.cpp | 15 ++++++++------- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h index 5029560054..c7be3bab13 100644 --- a/xbmc/windowing/WinSystem.h +++ b/xbmc/windowing/WinSystem.h @@ -70,6 +70,7 @@ public: virtual void NotifyAppFocusChange(bool bGaining) {} virtual void NotifyAppActiveChange(bool bActivated) {} virtual void ShowOSMouse(bool show) {}; + virtual bool HasCursor(){ return true; } virtual bool Minimize() { return false; } virtual bool Restore() { return false; } diff --git a/xbmc/windowing/osx/WinSystemIOS.h b/xbmc/windowing/osx/WinSystemIOS.h index 5c0ce54af8..c7dd6f25b3 100644 --- a/xbmc/windowing/osx/WinSystemIOS.h +++ b/xbmc/windowing/osx/WinSystemIOS.h @@ -44,6 +44,7 @@ public: virtual void UpdateResolutions(); virtual void ShowOSMouse(bool show); + virtual bool HasCursor(); virtual void NotifyAppActiveChange(bool bActivated); diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm index ca0889ee25..6e0418f75e 100644 --- a/xbmc/windowing/osx/WinSystemIOS.mm +++ b/xbmc/windowing/osx/WinSystemIOS.mm @@ -40,6 +40,7 @@ #import #import #import "XBMCController.h" +#include "utils/SystemInfo.h" #import CWinSystemIOS::CWinSystemIOS() : CWinSystemBase() @@ -200,6 +201,18 @@ void CWinSystemIOS::ShowOSMouse(bool show) { } +bool CWinSystemIOS::HasCursor() +{ + if( g_sysinfo.IsAppleTV2() ) + { + return true; + } + else//apple touch devices + { + return false; + } +} + void CWinSystemIOS::NotifyAppActiveChange(bool bActivated) { if (bActivated && m_bWasFullScreenBeforeMinimize && !g_graphicsContext.IsFullScreenRoot()) diff --git a/xbmc/windows/GUIWindowPointer.cpp b/xbmc/windows/GUIWindowPointer.cpp index dcbe003fbe..6a8030e773 100644 --- a/xbmc/windows/GUIWindowPointer.cpp +++ b/xbmc/windows/GUIWindowPointer.cpp @@ -21,6 +21,7 @@ #include "GUIWindowPointer.h" #include "input/MouseStat.h" +#include "windowing/WindowingFactory.h" #include #define ID_POINTER 10 @@ -56,13 +57,13 @@ void CGUIWindowPointer::SetPointer(int pointer) void CGUIWindowPointer::UpdateVisibility() { -//no mouse pointer for ios devices (they are all touchy) -#ifndef TARGET_DARWIN_IOS - if (g_Mouse.IsActive()) - Show(); - else - Close(); -#endif//TARGET_DARWIN_IOS + if(g_Windowing.HasCursor()) + { + if (g_Mouse.IsActive()) + Show(); + else + Close(); + } } void CGUIWindowPointer::OnWindowLoaded() -- cgit v1.2.3