Merge pull request #3517 from Memphiz/mousemavericks
authorMemphiz <memphis@machzwo.de>
Tue, 29 Oct 2013 21:56:12 +0000 (14:56 -0700)
committerMemphiz <memphis@machzwo.de>
Tue, 29 Oct 2013 21:56:12 +0000 (14:56 -0700)
[osx/mavericks] - ugly hacked fix for the mouse bug (mouse wasn't able t...

38 files changed:
XBMC.xcodeproj/project.pbxproj
system/settings/settings.xml
xbmc/commons/typeindex.h
xbmc/interfaces/legacy/AddonClass.h
xbmc/interfaces/legacy/AddonUtils.cpp
xbmc/interfaces/legacy/AddonUtils.h
xbmc/interfaces/legacy/Alternative.h
xbmc/interfaces/legacy/CallbackFunction.h
xbmc/interfaces/legacy/CallbackHandler.cpp
xbmc/interfaces/legacy/Control.cpp
xbmc/interfaces/legacy/Dialog.cpp
xbmc/interfaces/legacy/LanguageHook.cpp
xbmc/interfaces/legacy/ModuleXbmc.cpp
xbmc/interfaces/legacy/Monitor.h
xbmc/interfaces/legacy/Player.cpp
xbmc/interfaces/legacy/Player.h
xbmc/interfaces/legacy/Window.cpp
xbmc/interfaces/legacy/Window.h
xbmc/interfaces/legacy/WindowDialog.cpp
xbmc/interfaces/legacy/WindowDialog.h
xbmc/interfaces/legacy/WindowDialogMixin.cpp
xbmc/interfaces/legacy/WindowInterceptor.h
xbmc/interfaces/legacy/WindowXML.cpp
xbmc/interfaces/legacy/WindowXML.h
xbmc/interfaces/python/CallbackHandler.cpp
xbmc/interfaces/python/LanguageHook.cpp
xbmc/interfaces/python/PythonInvoker.cpp
xbmc/interfaces/python/PythonSwig.cpp.template
xbmc/interfaces/python/XBPython.cpp
xbmc/interfaces/python/swig.cpp
xbmc/interfaces/python/swig.h
xbmc/interfaces/swig/AddonModuleXbmcgui.i
xbmc/network/linux/NetworkLinux.cpp
xbmc/utils/RssReader.cpp
xbmc/utils/ScraperUrl.cpp
xbmc/utils/URIUtils.cpp
xbmc/windowing/osx/WinSystemOSX.h
xbmc/windowing/osx/WinSystemOSX.mm

index bb5bddb..044538c 100644 (file)
                88ACB01D0DCF409E0083CFDF /* ASAPCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAPCodec.h; sourceTree = "<group>"; };
                88ACB01E0DCF409E0083CFDF /* DllASAP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllASAP.h; sourceTree = "<group>"; };
                88ECB6580DE013C4003396A7 /* DiskArbitration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiskArbitration.framework; path = /System/Library/Frameworks/DiskArbitration.framework; sourceTree = "<absolute>"; };
-               8DD76F7E0486A8DE00D96B5E /* XBMC */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = XBMC; sourceTree = BUILT_PRODUCTS_DIR; };
+               8DD76F7E0486A8DE00D96B5E /* XBMC */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = XBMC; sourceTree = BUILT_PRODUCTS_DIR; };
                AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagLibVFSStream.cpp; sourceTree = "<group>"; };
                AE84CB5C15A5B8BA00A3810E /* TagLibVFSStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagLibVFSStream.h; sourceTree = "<group>"; };
                AE89ACA41621DAB800E17DBC /* DVDDemuxBXA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDDemuxBXA.cpp; sourceTree = "<group>"; };
                E49910D9174E4A6400741B6D /* IOSExternalTouchController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSExternalTouchController.mm; sourceTree = "<group>"; };
                E49910DA174E4A6400741B6D /* IOSScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSScreenManager.h; sourceTree = "<group>"; };
                E49910DB174E4A6400741B6D /* IOSScreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSScreenManager.mm; sourceTree = "<group>"; };
-               E49910E2174E549400741B6D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
-               E49910E4174E54A100741B6D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
-               E49910E6174E54B300741B6D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreMedia.framework; sourceTree = DEVELOPER_DIR; };
-               E49910E8174E54C300741B6D /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreVideo.framework; sourceTree = DEVELOPER_DIR; };
-               E49910EA174E54C900741B6D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreAudio.framework; sourceTree = DEVELOPER_DIR; };
-               E49910EC174E54D200741B6D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; };
-               E49910EE174E54E400741B6D /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; };
-               E49910F0174E54EC00741B6D /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
-               E49910F2174E54FB00741B6D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
-               E49910F4174E550200741B6D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
+               E49910E2174E549400741B6D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+               E49910E4174E54A100741B6D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+               E49910E6174E54B300741B6D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
+               E49910E8174E54C300741B6D /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
+               E49910EA174E54C900741B6D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
+               E49910EC174E54D200741B6D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
+               E49910EE174E54E400741B6D /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
+               E49910F0174E54EC00741B6D /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+               E49910F2174E54FB00741B6D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+               E49910F4174E550200741B6D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
                E4991334174E5E5C00741B6D /* GenericTouchActionHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericTouchActionHandler.cpp; sourceTree = "<group>"; };
                E4991335174E5E5C00741B6D /* GenericTouchActionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericTouchActionHandler.h; sourceTree = "<group>"; };
                E4991340174E5E5C00741B6D /* ITouchActionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITouchActionHandler.h; sourceTree = "<group>"; };
                                FRAMEWORK_SEARCH_PATHS = (
                                        "$(inherited)",
                                        "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
-                                       "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
                                );
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_VERSION = 4.2;
                                FRAMEWORK_SEARCH_PATHS = (
                                        "$(inherited)",
                                        "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
-                                       "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
                                );
                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
                                GCC_ENABLE_OBJC_EXCEPTIONS = YES;
                                COPY_PHASE_STRIP = NO;
                                FRAMEWORK_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
                                        "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
                                );
                                GCC_C_LANGUAGE_STANDARD = gnu99;
                                COPY_PHASE_STRIP = YES;
                                FRAMEWORK_SEARCH_PATHS = (
                                        "$(inherited)",
-                                       "\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks\"",
                                        "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
                                );
                                GCC_C_LANGUAGE_STANDARD = gnu99;
index a381862..528c090 100644 (file)
         <setting id="pvrmenu.searchicons" type="action" label="19167" help="36217">
           <level>1</level>
           <dependencies>
-            <dependency type="enable" setting="pvrmanager.enabled">true</dependency>
+            <dependency type="enable">
+              <and>
+                <condition setting="pvrmanager.enabled" operator="is">true</condition>
+                <condition setting="pvrmenu.iconpath" operator="!is"></condition>
+              </and>
+            </dependency>
           </dependencies>
         </setting>
       </group>
index 66fc0bf..6160b1a 100644 (file)
@@ -22,7 +22,7 @@
 
 /**
  * This struct represents a pre-introduction of the std::type_index for RTTI
- *  which will only availalbe in C++11.
+ *  which is only availalbe in C++11.
  */
 
 namespace XbmcCommons
@@ -47,7 +47,7 @@ namespace XbmcCommons
 
     inline bool
     operator<(const type_index& __rhs) const
-    { return _M_target->before(*__rhs._M_target); }
+    { return _M_target->before(*__rhs._M_target) != 0; }
 
     inline bool
     operator<=(const type_index& __rhs) const
@@ -55,7 +55,7 @@ namespace XbmcCommons
 
     inline bool
     operator>(const type_index& __rhs) const
-    { return __rhs._M_target->before(*_M_target); }
+    { return __rhs._M_target->before(*_M_target) != 0; }
 
     inline bool
     operator>=(const type_index& __rhs) const
index d5ced32..fef3407 100644 (file)
@@ -111,7 +111,7 @@ namespace XBMCAddon
      *  on the object. It will prevent the deallocation during
      *  the time it's held.
      */
-    bool isDeallocating() { TRACE; return m_isDeallocating; }
+    bool isDeallocating() { XBMC_TRACE; return m_isDeallocating; }
 
     static short getNumAddonClasses();
 
index 5517971..fd41dd8 100644 (file)
@@ -71,7 +71,7 @@ namespace XBMCAddonUtils
     return cDefault;
   }
 
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
   static XbmcThreads::ThreadLocal<TraceGuard> tlParent;
 
   static char** getSpacesArray(int size)
index 7e2e8c4..7888d1a 100644 (file)
@@ -27,7 +27,7 @@
 
 #pragma once
 
-//#define ENABLE_TRACE_API
+//#define ENABLE_XBMC_TRACE_API
 
 #include "threads/SingleLock.h"
 
@@ -64,17 +64,6 @@ namespace XBMCAddonUtils
     ~InvertSingleLockGuard() { lock.Enter(); }
   };
 
-//  class WaitForNotify
-//  {
-//    std::vector<HANDLE> thoseWaiting;
-//    CCriticalSection csection; // Ha!
-//    CCriticalSection atomicWait;
-//  public:
-//    void wait();
-//    void notify();
-//    void notifyAll();
-//  };
-
 #define LOCKGUI XBMCAddonUtils::GuiLock __gl
 
   /*
@@ -83,7 +72,7 @@ namespace XBMCAddonUtils
    */
   const char *getDefaultImage(char* cControlType, char* cTextureType, char* cDefault);
 
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
   class TraceGuard
   {
     const char* function;
@@ -100,10 +89,10 @@ namespace XBMCAddonUtils
 #endif
 }
 
-#ifdef ENABLE_TRACE_API
-#define TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__)
+#ifdef ENABLE_XBMC_TRACE_API
+#define XBMC_TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__)
 #else
-#define TRACE
+#define XBMC_TRACE
 #endif
 
 
index 8677b0f..8b099a0 100644 (file)
@@ -89,9 +89,6 @@ namespace XBMCAddon
     inline operator const T1& () const throw (WrongTypeException) { return former(); }
     inline operator T2& () throw (WrongTypeException) { return later(); }
     inline operator const T2& () const throw (WrongTypeException) { return later(); }
-
-    static inline Alternative<T1,T2>& nullItem() { return *(Alternative<T1,T2>*)NULL; }
-    static inline bool isNullReference(const Alternative<T1,T2>& ref) { return (&ref) == NULL; }
   };
 }
 
index 65a8489..f928e73 100644 (file)
@@ -74,7 +74,7 @@ namespace XBMCAddon
 
     virtual ~CallbackFunction() { deallocating(); }
 
-    virtual void executeCallback() { TRACE; ((*obj).*(meth))(); }
+    virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(); }
   };
 
   /**
@@ -98,7 +98,7 @@ namespace XBMCAddon
 
     virtual ~CallbackFunction() { deallocating(); }
 
-    virtual void executeCallback() { TRACE; ((*obj).*(meth))(param); }
+    virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param); }
   };
 
   /**
@@ -123,7 +123,7 @@ namespace XBMCAddon
 
     virtual ~CallbackFunction() { deallocating(); }
 
-    virtual void executeCallback() { TRACE; ((*obj).*(meth))(param); }
+    virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param); }
   };
 
 
@@ -149,7 +149,7 @@ namespace XBMCAddon
 
     virtual ~CallbackFunction() { deallocating(); }
 
-    virtual void executeCallback() { TRACE; ((*obj).*(meth))(param1,param2); }
+    virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param1,param2); }
   };
 
 
@@ -176,7 +176,7 @@ namespace XBMCAddon
 
     virtual ~CallbackFunction() { deallocating(); }
 
-    virtual void executeCallback() { TRACE; ((*obj).*(meth))(param1,param2,param3); }
+    virtual void executeCallback() { XBMC_TRACE; ((*obj).*(meth))(param1,param2,param3); }
   };
 }
 
index 19a4a88..1214645 100644 (file)
@@ -32,7 +32,7 @@ namespace XBMCAddon
     AddonClass::Ref<Callback> cb;
     RetardedAsynchCallbackHandler* handler;
     AsynchCallbackMessage(Callback* _cb, RetardedAsynchCallbackHandler* _handler) :
-      cb(_cb), handler(_handler) { TRACE; }
+      cb(_cb), handler(_handler) { XBMC_TRACE; }
   };
 
   //********************************************************************
@@ -46,14 +46,14 @@ namespace XBMCAddon
 
   void RetardedAsynchCallbackHandler::invokeCallback(Callback* cb)
   {
-    TRACE;
+    XBMC_TRACE;
     CSingleLock lock(critSection);
     g_callQueue.push_back(new AsynchCallbackMessage(cb,this));
   }
 
   RetardedAsynchCallbackHandler::~RetardedAsynchCallbackHandler()
   {
-    TRACE;
+    XBMC_TRACE;
     CSingleLock lock(critSection);
 
     // find any messages that might be there because of me ... and remove them
@@ -75,7 +75,7 @@ namespace XBMCAddon
 
   void RetardedAsynchCallbackHandler::makePendingCalls()
   {
-    TRACE;
+    XBMC_TRACE;
     CSingleLock lock(critSection);
     CallbackQueue::iterator iter = g_callQueue.begin();
     while (iter != g_callQueue.end())
@@ -100,7 +100,7 @@ namespace XBMCAddon
           // we need to grab the object lock to see if the object of the call 
           //  is deallocating. holding this lock should prevent it from 
           //  deallocating durring the execution of this call.
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
           CLog::Log(LOGDEBUG,"%sNEWADDON executing callback 0x%lx",_tg.getSpaces(),(long)(p->cb.get()));
 #endif
           CSingleLock lock2(*(p->cb->getObject()));
@@ -132,7 +132,7 @@ namespace XBMCAddon
 
   void RetardedAsynchCallbackHandler::clearPendingCalls(void* userData)
   {
-    TRACE;
+    XBMC_TRACE;
     CSingleLock lock(critSection);
     CallbackQueue::iterator iter = g_callQueue.begin();
     while (iter != g_callQueue.end())
@@ -141,7 +141,7 @@ namespace XBMCAddon
 
       if(p->handler->shouldRemoveCallback(p->cb->getObject(),userData))
       {
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
         CLog::Log(LOGDEBUG,"%sNEWADDON removing callback 0x%lx for PyThreadState 0x%lx from queue", _tg.getSpaces(),(long)(p->cb.get()) ,(long)userData);
 #endif
         iter = g_callQueue.erase(iter);
index e921434..020b80e 100644 (file)
@@ -1198,7 +1198,7 @@ namespace XBMCAddon
 
     void ControlList::addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage)
     {
-      TRACE;
+      XBMC_TRACE;
 
       if (item.which() == first)
         internAddListItem(ListItem::fromString(item.former()),sendMessage);
@@ -1208,7 +1208,7 @@ namespace XBMCAddon
 
     void ControlList::addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items)
     {
-      TRACE;
+      XBMC_TRACE;
 
       for (std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > >::const_iterator iter = items.begin(); iter != items.end(); ++iter)
         addItem(*iter,false);
index cbb10eb..91ec366 100644 (file)
@@ -352,11 +352,11 @@ namespace XBMCAddon
       return value;
     }
 
-    DialogProgress::~DialogProgress() { TRACE; deallocating(); }
+    DialogProgress::~DialogProgress() { XBMC_TRACE; deallocating(); }
 
     void DialogProgress::deallocating()
     {
-      TRACE;
+      XBMC_TRACE;
 
       if (dlg)
       {
@@ -428,11 +428,11 @@ namespace XBMCAddon
       return dlg->IsCanceled();
     }
 
-    DialogProgressBG::~DialogProgressBG() { TRACE; deallocating(); }
+    DialogProgressBG::~DialogProgressBG() { XBMC_TRACE; deallocating(); }
 
     void DialogProgressBG::deallocating()
     {
-      TRACE;
+      XBMC_TRACE;
 
       if (dlg)
       {
index e057b1d..9a30a95 100644 (file)
@@ -34,7 +34,7 @@ namespace XBMCAddon
 
   void LanguageHook::SetLanguageHook(LanguageHook* languageHook)
   {
-    TRACE;
+    XBMC_TRACE;
     languageHook->Acquire();
     addonLanguageHookTls.set(languageHook);
   }
index 649a462..7b86e2f 100644 (file)
@@ -82,21 +82,21 @@ namespace XBMCAddon
 
     void shutdown()
     {
-      TRACE;
+      XBMC_TRACE;
       ThreadMessage tMsg = {TMSG_SHUTDOWN};
       CApplicationMessenger::Get().SendMessage(tMsg);
     }
 
     void restart()
     {
-      TRACE;
+      XBMC_TRACE;
       ThreadMessage tMsg = {TMSG_RESTART};
       CApplicationMessenger::Get().SendMessage(tMsg);
     }
 
     void executescript(const char* script)
     {
-      TRACE;
+      XBMC_TRACE;
       if (! script)
         return;
 
@@ -107,7 +107,7 @@ namespace XBMCAddon
 
     void executebuiltin(const char* function, bool wait /* = false*/)
     {
-      TRACE;
+      XBMC_TRACE;
       if (! function)
         return;
       CApplicationMessenger::Get().ExecBuiltIn(function,wait);
@@ -115,13 +115,13 @@ namespace XBMCAddon
 
     String executehttpapi(const char* httpcommand) 
     {
-      TRACE;
+      XBMC_TRACE;
       THROW_UNIMP("executehttpapi");
     }
 
     String executeJSONRPC(const char* jsonrpccommand)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg;
 #ifdef HAS_JSONRPC
       String ret;
@@ -142,7 +142,7 @@ namespace XBMCAddon
 
     void sleep(long timemillis)
     {
-      TRACE;
+      XBMC_TRACE;
 
       XbmcThreads::EndTime endTime(timemillis);
       while (!endTime.IsTimePast())
@@ -163,7 +163,7 @@ namespace XBMCAddon
 
     String getLocalizedString(int id)
     {
-      TRACE;
+      XBMC_TRACE;
       String label;
       if (id >= 30000 && id <= 30999)
         label = g_localizeStringsTemp.Get(id);
@@ -177,13 +177,13 @@ namespace XBMCAddon
 
     String getSkinDir()
     {
-      TRACE;
+      XBMC_TRACE;
       return CSettings::Get().GetString("lookandfeel.skin");
     }
 
     String getLanguage(int format /* = CLangCodeExpander::ENGLISH_NAME */, bool region /*= false*/)
     {
-      TRACE;
+      XBMC_TRACE;
       CStdString lang = CSettings::Get().GetString("locale.language");
 
       switch (format)
@@ -233,7 +233,7 @@ namespace XBMCAddon
 
     String getIPAddress()
     {
-      TRACE;
+      XBMC_TRACE;
       char cTitleIP[32];
       sprintf(cTitleIP, "127.0.0.1");
       CNetworkInterface* iface = g_application.getNetwork().GetFirstConnectedInterface();
@@ -245,13 +245,13 @@ namespace XBMCAddon
 
     long getDVDState()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_mediaManager.GetDriveStatus();
     }
 
     long getFreeMem()
     {
-      TRACE;
+      XBMC_TRACE;
       MEMORYSTATUSEX stat;
       stat.dwLength = sizeof(MEMORYSTATUSEX);
       GlobalMemoryStatusEx(&stat);
@@ -293,7 +293,7 @@ namespace XBMCAddon
 
     String getInfoLabel(const char* cLine)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!cLine)
       {
         String ret;
@@ -314,7 +314,7 @@ namespace XBMCAddon
 
     String getInfoImage(const char * infotag)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!infotag)
         {
           String ret;
@@ -327,7 +327,7 @@ namespace XBMCAddon
 
     void playSFX(const char* filename)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!filename)
         return;
 
@@ -339,13 +339,13 @@ namespace XBMCAddon
 
     void enableNavSounds(bool yesNo)
     {
-      TRACE;
+      XBMC_TRACE;
       g_audioManager.Enable(yesNo);
     }
 
     bool getCondVisibility(const char *condition)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!condition)
         return false;
 
@@ -363,13 +363,13 @@ namespace XBMCAddon
 
     int getGlobalIdleTime()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_application.GlobalIdleTime();
     }
 
     String getCacheThumbName(const String& path)
     {
-      TRACE;
+      XBMC_TRACE;
       Crc32 crc;
       crc.ComputeFromLowerCase(path);
       CStdString strPath;
@@ -379,19 +379,19 @@ namespace XBMCAddon
 
     String makeLegalFilename(const String& filename, bool fatX)
     {
-      TRACE;
+      XBMC_TRACE;
       return CUtil::MakeLegalPath(filename);
     }
 
     String translatePath(const String& path)
     {
-      TRACE;
+      XBMC_TRACE;
       return CSpecialProtocol::TranslatePath(path);
     }
 
     Tuple<String,String> getCleanMovieTitle(const String& path, bool usefoldername)
     {
-      TRACE;
+      XBMC_TRACE;
       CFileItem item(path, false);
       CStdString strName = item.GetMovieName(usefoldername);
 
@@ -404,13 +404,13 @@ namespace XBMCAddon
 
     String validatePath(const String& path)
     {
-      TRACE;
+      XBMC_TRACE;
       return CUtil::ValidatePath(path, true);
     }
 
     String getRegion(const char* id)
     {
-      TRACE;
+      XBMC_TRACE;
       CStdString result;
 
       if (strcmpi(id, "datelong") == 0)
@@ -450,7 +450,7 @@ namespace XBMCAddon
     // TODO: Add a mediaType enum
     String getSupportedMedia(const char* mediaType)
     {
-      TRACE;
+      XBMC_TRACE;
       String result;
       if (strcmpi(mediaType, "video") == 0)
         result = g_advancedSettings.m_videoExtensions;
@@ -468,14 +468,14 @@ namespace XBMCAddon
 
     bool skinHasImage(const char* image)
     {
-      TRACE;
+      XBMC_TRACE;
       return g_TextureManager.HasTexture(image);
     }
 
 
     bool startServer(int iTyp, bool bStart, bool bWait)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg;
       return g_application.StartServer((CApplication::ESERVERS)iTyp, bStart != 0, bWait != 0);
     }
index 0e03cb1..55953cb 100644 (file)
@@ -39,13 +39,13 @@ namespace XBMCAddon
       Monitor();
 
 #ifndef SWIG
-      inline void    OnSettingsChanged() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onSettingsChanged)); }
-      inline void    OnScreensaverActivated() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverActivated)); }
-      inline void    OnScreensaverDeactivated() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverDeactivated)); }
-      inline void    OnDatabaseUpdated(const String &database) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseUpdated,database)); }
-      inline void    OnDatabaseScanStarted(const String &database) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseScanStarted,database)); }
-      inline void    OnAbortRequested() { TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onAbortRequested)); }
-      inline void    OnNotification(const String &sender, const String &method, const String &data) { TRACE; invokeCallback(new CallbackFunction<Monitor,const String,const String,const String>(this,&Monitor::onNotification,sender,method,data)); }
+      inline void    OnSettingsChanged() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onSettingsChanged)); }
+      inline void    OnScreensaverActivated() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverActivated)); }
+      inline void    OnScreensaverDeactivated() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onScreensaverDeactivated)); }
+      inline void    OnDatabaseUpdated(const String &database) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseUpdated,database)); }
+      inline void    OnDatabaseScanStarted(const String &database) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onDatabaseScanStarted,database)); }
+      inline void    OnAbortRequested() { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor>(this,&Monitor::onAbortRequested)); }
+      inline void    OnNotification(const String &sender, const String &method, const String &data) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String,const String,const String>(this,&Monitor::onNotification,sender,method,data)); }
 
       inline const String& GetId() { return Id; }
 #endif
@@ -55,21 +55,21 @@ namespace XBMCAddon
        * \n
        * Will be called when addon settings are changed\n
        */
-      virtual void    onSettingsChanged() { TRACE; }
+      virtual void    onSettingsChanged() { XBMC_TRACE; }
 
       /**
        * onScreensaverActivated() -- onScreensaverActivated method.\n
        * \n
        * Will be called when screensaver kicks in\n
        */
-      virtual void    onScreensaverActivated() { TRACE; }
+      virtual void    onScreensaverActivated() { XBMC_TRACE; }
 
       /**
        * onScreensaverDeactivated() -- onScreensaverDeactivated method.\n
        * \n
        * Will be called when screensaver goes off\n
        */
-      virtual void    onScreensaverDeactivated() { TRACE; }
+      virtual void    onScreensaverDeactivated() { XBMC_TRACE; }
 
       /**
        * onDatabaseUpdated(database) -- onDatabaseUpdated method.\n
@@ -78,7 +78,7 @@ namespace XBMCAddon
        * \n
        * Will be called when database gets updated and return video or music to indicate which DB has been changed\n
        */
-      virtual void    onDatabaseUpdated(const String database) { TRACE; }
+      virtual void    onDatabaseUpdated(const String database) { XBMC_TRACE; }
 
       /**
        * onDatabaseScanStarted(database) -- onDatabaseScanStarted method.\n
@@ -87,14 +87,14 @@ namespace XBMCAddon
        *\n
        * Will be called when database update starts and return video or music to indicate which DB is being updated\n
        */
-      virtual void    onDatabaseScanStarted(const String database) { TRACE; }
+      virtual void    onDatabaseScanStarted(const String database) { XBMC_TRACE; }
       
       /**
        * onAbortRequested() -- onAbortRequested method.\n
        * \n
        * Will be called when XBMC requests Abort\n
        */
-      virtual void    onAbortRequested() { TRACE; }
+      virtual void    onAbortRequested() { XBMC_TRACE; }
 
       /**
        * onNotification(sender, method, data) -- onNotification method.\n
@@ -105,7 +105,7 @@ namespace XBMCAddon
        *\n
        * Will be called when XBMC receives or sends a notification\n
        */
-      virtual void    onNotification(const String sender, const String method, const String data) { TRACE; }
+      virtual void    onNotification(const String sender, const String method, const String data) { XBMC_TRACE; }
 
       virtual ~Monitor();
     };
index ad51349..3e1b2b5 100644 (file)
@@ -35,6 +35,8 @@ namespace XBMCAddon
 {
   namespace xbmc
   {
+       PlayParameter Player::defaultPlayParameter;
+
     Player::Player(int _playerCore)
     {
       iPlayList = PLAYLIST_MUSIC;
@@ -69,9 +71,9 @@ namespace XBMCAddon
     void Player::play(const Alternative<String, const PlayList* > & item,
                       const XBMCAddon::xbmcgui::ListItem* listitem, bool windowed, int startpos)
     {
-      TRACE;
+      XBMC_TRACE;
 
-      if (Alternative<String, const PlayList*>::isNullReference(item))
+      if (&item == &defaultPlayParameter)
         playCurrent(windowed);
       else if (item.which() == XBMCAddon::first)
         playStream(item.former(), listitem, windowed);
@@ -81,7 +83,7 @@ namespace XBMCAddon
 
     void Player::playStream(const String& item, const xbmcgui::ListItem* plistitem, bool windowed)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       if (!item.empty())
       {
@@ -111,7 +113,7 @@ namespace XBMCAddon
 
     void Player::playCurrent(bool windowed)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       // set fullscreen or windowed
       CMediaSettings::Get().SetVideoStartWindowed(windowed);
@@ -127,7 +129,7 @@ namespace XBMCAddon
 
     void Player::playPlaylist(const PlayList* playlist, bool windowed, int startpos)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       if (playlist != NULL)
       {
@@ -150,19 +152,19 @@ namespace XBMCAddon
 
     void Player::stop()
     {
-      TRACE;
+      XBMC_TRACE;
       CApplicationMessenger::Get().MediaStop();
     }
 
     void Player::pause()
     {
-      TRACE;
+      XBMC_TRACE;
       CApplicationMessenger::Get().MediaPause();
     }
 
     void Player::playnext()
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       // force a playercore before playing
       g_application.m_eForcedNextPlayer = playerCore;
@@ -172,7 +174,7 @@ namespace XBMCAddon
 
     void Player::playprevious()
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       // force a playercore before playing
       g_application.m_eForcedNextPlayer = playerCore;
@@ -182,7 +184,7 @@ namespace XBMCAddon
 
     void Player::playselected(int selected)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dc(languageHook);
       // force a playercore before playing
       g_application.m_eForcedNextPlayer = playerCore;
@@ -200,124 +202,124 @@ namespace XBMCAddon
 
     void Player::OnPlayBackStarted()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackStarted));
     }
 
     void Player::OnPlayBackEnded()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackEnded));
     }
 
     void Player::OnPlayBackStopped()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackStopped));
     }
 
     void Player::OnPlayBackPaused()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackPaused));
     }
 
     void Player::OnPlayBackResumed()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onPlayBackResumed));
     }
 
     void Player::OnQueueNextItem()
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player>(this,&Player::onQueueNextItem));
     }
 
     void Player::OnPlayBackSpeedChanged(int speed)
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player,int>(this,&Player::onPlayBackSpeedChanged,speed));
     }
 
     void Player::OnPlayBackSeek(int time, int seekOffset)
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player,int,int>(this,&Player::onPlayBackSeek,time,seekOffset));
     }
 
     void Player::OnPlayBackSeekChapter(int chapter)
     { 
-      TRACE;
+      XBMC_TRACE;
       invokeCallback(new CallbackFunction<Player,int>(this,&Player::onPlayBackSeekChapter,chapter));
     }
 
     void Player::onPlayBackStarted()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackEnded()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackStopped()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackPaused()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackResumed()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onQueueNextItem()
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackSpeedChanged(int speed)
     { 
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackSeek(int time, int seekOffset)
     { 
-      TRACE;
+      XBMC_TRACE;
     }
 
     void Player::onPlayBackSeekChapter(int chapter)
     { 
-      TRACE;
+      XBMC_TRACE;
     }
 
     bool Player::isPlaying()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_application.m_pPlayer->IsPlaying();
     }
 
     bool Player::isPlayingAudio()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_application.m_pPlayer->IsPlayingAudio();
     }
 
     bool Player::isPlayingVideo()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_application.m_pPlayer->IsPlayingVideo();
     }
 
     String Player::getPlayingFile() throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!g_application.m_pPlayer->IsPlaying())
         throw PlayerException("XBMC is not playing any file");
 
@@ -326,7 +328,7 @@ namespace XBMCAddon
 
     InfoTagVideo* Player::getVideoInfoTag() throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!g_application.m_pPlayer->IsPlayingVideo())
         throw PlayerException("XBMC is not playing any videofile");
 
@@ -339,7 +341,7 @@ namespace XBMCAddon
 
     InfoTagMusic* Player::getMusicInfoTag() throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (g_application.m_pPlayer->IsPlayingVideo() || !g_application.m_pPlayer->IsPlayingAudio())
         throw PlayerException("XBMC is not playing any music file");
 
@@ -352,7 +354,7 @@ namespace XBMCAddon
 
     double Player::getTotalTime() throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!g_application.m_pPlayer->IsPlaying())
         throw PlayerException("XBMC is not playing any media file");
 
@@ -361,7 +363,7 @@ namespace XBMCAddon
 
     double Player::getTime() throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!g_application.m_pPlayer->IsPlaying())
         throw PlayerException("XBMC is not playing any media file");
 
@@ -370,7 +372,7 @@ namespace XBMCAddon
 
     void Player::seekTime(double pTime) throw (PlayerException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!g_application.m_pPlayer->IsPlaying())
         throw PlayerException("XBMC is not playing any media file");
 
@@ -379,7 +381,7 @@ namespace XBMCAddon
 
     void Player::setSubtitles(const char* cLine)
     {
-      TRACE;
+      XBMC_TRACE;
       if (g_application.m_pPlayer->HasPlayer())
       {
         int nStream = g_application.m_pPlayer->AddSubtitle(cLine);
@@ -395,7 +397,7 @@ namespace XBMCAddon
 
     void Player::showSubtitles(bool bVisible)
     {
-      TRACE;
+      XBMC_TRACE;
       if (g_application.m_pPlayer->HasPlayer())
       {
         CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn = bVisible != 0;
@@ -405,7 +407,7 @@ namespace XBMCAddon
 
     String Player::getSubtitles()
     {
-      TRACE;
+      XBMC_TRACE;
       if (g_application.m_pPlayer->HasPlayer())
       {
         SPlayerSubtitleStreamInfo info;
@@ -422,7 +424,7 @@ namespace XBMCAddon
 
     void Player::disableSubtitles()
     {
-      TRACE;
+      XBMC_TRACE;
       CLog::Log(LOGWARNING,"'xbmc.Player().disableSubtitles()' is deprecated and will be removed in future releases, please use 'xbmc.Player().showSubtitles(false)' instead");
       if (g_application.m_pPlayer->HasPlayer())
       {
index 94936d1..28e38ed 100644 (file)
@@ -64,6 +64,10 @@ namespace XBMCAddon
       void playCurrent(bool windowed = false);
 
     public:
+#ifndef SWIG
+         static PlayParameter defaultPlayParameter;
+#endif
+
       // Construct a Player proxying the given generated binding. The 
       //  construction of a Player needs to identify whether or not any 
       //  callbacks will be executed asynchronously or not.
@@ -88,7 +92,7 @@ namespace XBMCAddon
        *   - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})\n
        *   - xbmc.Player().play(url, listitem, windowed)\n
        */
-      void play(const PlayParameter& item = PlayParameter::nullItem()
+      void play(const PlayParameter& item = Player::defaultPlayParameter
                 const XBMCAddon::xbmcgui::ListItem* listitem = NULL, bool windowed = false, int startpos = -1);
 
       /**
index 76478ba..e07f514 100644 (file)
@@ -76,19 +76,19 @@ namespace XBMCAddon
 
     public:
       inline ProxyExistingWindowInterceptor(CGUIWindow* window) :
-        cguiwindow(window) { TRACE; }
+        cguiwindow(window) { XBMC_TRACE; }
 
       virtual CGUIWindow* get();
     };
 
-    CGUIWindow* ProxyExistingWindowInterceptor::get() { TRACE; return cguiwindow; }
+    CGUIWindow* ProxyExistingWindowInterceptor::get() { XBMC_TRACE; return cguiwindow; }
 
     Window::Window() throw (WindowException): 
       isDisposed(false), window(NULL), iWindowId(-1),
       iOldWindowId(0), iCurrentControlId(3000), bModal(false), m_actionEvent(true),
       canPulse(true), existingWindow(false), destroyAfterDeInit(false)
     {
-      TRACE;
+      XBMC_TRACE;
     }
 
     /**
@@ -99,7 +99,7 @@ namespace XBMCAddon
       iOldWindowId(0), iCurrentControlId(3000), bModal(false), m_actionEvent(true),
       canPulse(false), existingWindow(true), destroyAfterDeInit(false)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
 
       if (existingWindowId == -1)
@@ -124,7 +124,7 @@ namespace XBMCAddon
 
     Window::~Window()
     {
-      TRACE;
+      XBMC_TRACE;
 
       deallocating();
     }
@@ -138,7 +138,7 @@ namespace XBMCAddon
 
     void Window::dispose()
     {
-      TRACE;
+      XBMC_TRACE;
 
       // this is called from non-scripting-language callstacks. Don't use the delayed call guard.
       CSingleLock lock(g_graphicsContext);
@@ -206,7 +206,7 @@ namespace XBMCAddon
 
     void Window::setWindow(InterceptorBase* _window) 
     { 
-      TRACE;
+      XBMC_TRACE;
       window = _window; 
       iWindowId = _window->get()->GetID(); 
 
@@ -216,7 +216,7 @@ namespace XBMCAddon
 
     int Window::getNextAvailalbeWindowId() throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       // window id's 13000 - 13100 are reserved for python
       // get first window id that is not in use
       int id = WINDOW_PYTHON_START;
@@ -230,7 +230,7 @@ namespace XBMCAddon
 
     void Window::popActiveWindowId()
     {
-      TRACE;
+      XBMC_TRACE;
       if (iOldWindowId != iWindowId &&
           iWindowId != ACTIVE_WINDOW)
         iOldWindowId = ACTIVE_WINDOW;
@@ -243,7 +243,7 @@ namespace XBMCAddon
      */
     Control* Window::GetControlById(int iControlId, CCriticalSection* gc) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
 
       // find in window vector first!!!
       // this saves us from creating a complete new control
@@ -388,14 +388,14 @@ namespace XBMCAddon
 
     void Window::PulseActionEvent()
     {
-      TRACE;
+      XBMC_TRACE;
       if (canPulse)
         m_actionEvent.Set();
     }
 
     bool Window::WaitForActionEvent(unsigned int milliseconds)
     {
-      TRACE;
+      XBMC_TRACE;
       // DO NOT MAKE THIS A DELAYED CALL!!!!
       bool ret = languageHook == NULL ? m_actionEvent.WaitMSec(milliseconds) : languageHook->WaitForEvent(m_actionEvent,milliseconds);
       if (ret)
@@ -405,7 +405,7 @@ namespace XBMCAddon
 
     bool Window::OnAction(const CAction &action)
     {
-      TRACE;
+      XBMC_TRACE;
       // do the base class window first, and the call to python after this
       bool ret = ref(window)->OnAction(action);
 
@@ -440,7 +440,7 @@ namespace XBMCAddon
 
     void Window::onAction(Action* action)
     {
-      TRACE;
+      XBMC_TRACE;
       // default onAction behavior
       if(action->id == ACTION_PREVIOUS_MENU || action->id == ACTION_NAV_BACK)
         close();
@@ -448,7 +448,7 @@ namespace XBMCAddon
 
     bool Window::OnMessage(CGUIMessage& message)
     {
-      TRACE;
+      XBMC_TRACE;
       switch (message.GetMessage())
       {
       case GUI_MSG_WINDOW_DEINIT:
@@ -503,15 +503,15 @@ namespace XBMCAddon
       return ref(window)->OnMessage(message);
     }
 
-    void Window::onControl(Control* action) { TRACE; /* do nothing by default */ }
-    void Window::onClick(int controlId) { TRACE; /* do nothing by default */ }
-    void Window::onDoubleClick(int controlId) { TRACE; /* do nothing by default */ }
-    void Window::onFocus(int controlId) { TRACE; /* do nothing by default */ }
-    void Window::onInit() { TRACE; /* do nothing by default */ }
+    void Window::onControl(Control* action) { XBMC_TRACE; /* do nothing by default */ }
+    void Window::onClick(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+    void Window::onDoubleClick(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+    void Window::onFocus(int controlId) { XBMC_TRACE; /* do nothing by default */ }
+    void Window::onInit() { XBMC_TRACE; /* do nothing by default */ }
 
     void Window::show()
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dcguard(languageHook);
       popActiveWindowId();
 
@@ -521,7 +521,7 @@ namespace XBMCAddon
 
     void Window::setFocus(Control* pControl) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       if(pControl == NULL)
         throw WindowException("Object should be of type Control");
 
@@ -531,14 +531,14 @@ namespace XBMCAddon
 
     void Window::setFocusId(int iControlId)
     {
-      TRACE;
+      XBMC_TRACE;
       CGUIMessage msg = CGUIMessage(GUI_MSG_SETFOCUS,iWindowId,iControlId);
       g_windowManager.SendThreadMessage(msg, iWindowId);
     }
 
     Control* Window::getFocus() throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
 
       int iControlId = ref(window)->GetFocusedControlID();
@@ -550,7 +550,7 @@ namespace XBMCAddon
 
     long Window::getFocusId() throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
       int iControlId = ref(window)->GetFocusedControlID();
       if(iControlId == -1)
@@ -560,14 +560,14 @@ namespace XBMCAddon
 
     void Window::removeControl(Control* pControl) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg(languageHook);
       doRemoveControl(pControl,&g_graphicsContext,true);
     }
 
     void Window::doRemoveControl(Control* pControl, CCriticalSection* gcontext, bool wait) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       // type checking, object should be of type Control
       if(pControl == NULL)
         throw WindowException("Object should be of type Control");
@@ -601,7 +601,7 @@ namespace XBMCAddon
 
     void Window::removeControls(std::vector<Control*> pControls) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg(languageHook);
       int count = 1; int size = pControls.size();
       for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); count++, iter++)
@@ -610,25 +610,25 @@ namespace XBMCAddon
 
     long Window::getHeight()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_graphicsContext.GetHeight();
     }
 
     long Window::getWidth()
     {
-      TRACE;
+      XBMC_TRACE;
       return g_graphicsContext.GetWidth();
     }
 
     long Window::getResolution()
     {
-      TRACE;
+      XBMC_TRACE;
       return (long)g_graphicsContext.GetVideoResolution();
     }
 
     void Window::setCoordinateResolution(long res) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       if (res < RES_HDTV_1080i || res > RES_AUTORES)
         throw WindowException("Invalid resolution.");
 
@@ -638,7 +638,7 @@ namespace XBMCAddon
 
     void Window::setProperty(const char* key, const String& value)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
       CStdString lowerKey = key;
 
@@ -647,7 +647,7 @@ namespace XBMCAddon
 
     String Window::getProperty(const char* key)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
       CStdString lowerKey = key;
       std::string value = ref(window)->GetProperty(lowerKey.ToLower()).asString();
@@ -656,7 +656,7 @@ namespace XBMCAddon
 
     void Window::clearProperty(const char* key)
     {
-      TRACE;
+      XBMC_TRACE;
       if (!key) return;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
 
@@ -666,14 +666,14 @@ namespace XBMCAddon
 
     void Window::clearProperties()
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
       ref(window)->ClearProperties();
     }
 
     void Window::close()
     {
-      TRACE;
+      XBMC_TRACE;
       bModal = false;
 
       if (!existingWindow)
@@ -687,7 +687,7 @@ namespace XBMCAddon
 
     void Window::doModal()
     {
-      TRACE;
+      XBMC_TRACE;
       if (!existingWindow)
       {
         bModal = true;
@@ -724,14 +724,14 @@ namespace XBMCAddon
 
     void Window::addControl(Control* pControl) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg(languageHook);
       doAddControl(pControl,&g_graphicsContext,true);
     }
 
     void Window::doAddControl(Control* pControl, CCriticalSection* gcontext, bool wait) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       if(pControl == NULL)
         throw WindowException("NULL Control passed to WindowBase::addControl");
 
@@ -771,7 +771,7 @@ namespace XBMCAddon
 
     void Window::addControls(std::vector<Control*> pControls) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       SingleLockWithDelayGuard gslock(g_graphicsContext,languageHook);
       int count = 1; int size = pControls.size();
       for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); count++, iter++)
@@ -780,14 +780,14 @@ namespace XBMCAddon
 
     Control* Window::getControl(int iControlId) throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       DelayedCallGuard dg(languageHook);
       return GetControlById(iControlId,&g_graphicsContext);
     }
 
     void Action::setFromCAction(const CAction& action)
     {
-      TRACE;
+      XBMC_TRACE;
       id = action.GetID();
       buttonCode = action.GetButtonCode();
       fAmount1 = action.GetAmount(0);
index dfe097f..c508e4a 100644 (file)
@@ -73,22 +73,22 @@ namespace XBMCAddon
       /**
        * getId() -- Returns the action's current id as a long or 0 if no action is mapped in the xml's.
        */
-      long getId() { TRACE; return id; }
+      long getId() { XBMC_TRACE; return id; }
 
       /**
        * getButtonCode() -- Returns the button code for this action.
        */
-      long getButtonCode() { TRACE; return buttonCode; }
+      long getButtonCode() { XBMC_TRACE; return buttonCode; }
 
       /**
        * getAmount1() -- Returns the first amount of force applied to the thumbstick n.
        */
-      float getAmount1() { TRACE; return fAmount1; }
+      float getAmount1() { XBMC_TRACE; return fAmount1; }
       
       /**
        * getAmount2() -- Returns the second amount of force applied to the thumbstick n.
        */
-      float getAmount2() { TRACE; return fAmount2; }
+      float getAmount2() { XBMC_TRACE; return fAmount2; }
     };
 
     //============================================================================
@@ -179,10 +179,10 @@ namespace XBMCAddon
       SWIGHIDDENVIRTUAL bool    OnBack(int actionId);
       SWIGHIDDENVIRTUAL void    OnDeinitWindow(int nextWindowID);
 
-      SWIGHIDDENVIRTUAL bool    IsDialogRunning() const { TRACE; return false; };
-      SWIGHIDDENVIRTUAL bool    IsDialog() const { TRACE; return false; };
-      SWIGHIDDENVIRTUAL bool    IsModalDialog() const { TRACE; return false; };
-      SWIGHIDDENVIRTUAL bool    IsMediaWindow() const { TRACE; return false; };
+      SWIGHIDDENVIRTUAL bool    IsDialogRunning() const { XBMC_TRACE; return false; };
+      SWIGHIDDENVIRTUAL bool    IsDialog() const { XBMC_TRACE; return false; };
+      SWIGHIDDENVIRTUAL bool    IsModalDialog() const { XBMC_TRACE; return false; };
+      SWIGHIDDENVIRTUAL bool    IsMediaWindow() const { XBMC_TRACE; return false; };
       SWIGHIDDENVIRTUAL void    dispose();
 
       // This is called from the InterceptorBase destructor to prevent further
index 87f0d84..c312cb3 100644 (file)
@@ -38,8 +38,8 @@ namespace XBMCAddon
 
     bool WindowDialog::OnMessage(CGUIMessage& message)
     {
-#ifdef ENABLE_TRACE_API
-      TRACE;
+#ifdef ENABLE_XBMC_TRACE_API
+      XBMC_TRACE;
       CLog::Log(LOGDEBUG,"%sNEWADDON WindowDialog::OnMessage Message %d", _tg.getSpaces(),message.GetMessage());
 #endif
 
@@ -65,7 +65,7 @@ namespace XBMCAddon
 
     bool WindowDialog::OnAction(const CAction &action)
     {
-      TRACE;
+      XBMC_TRACE;
       return WindowDialogMixin::OnAction(action) ? true : Window::OnAction(action);
     }
 
index 6b48ec2..db9d826 100644 (file)
@@ -44,11 +44,11 @@ namespace XBMCAddon
       SWIGHIDDENVIRTUAL void OnDeinitWindow(int nextWindowID);
 
       SWIGHIDDENVIRTUAL bool IsDialogRunning() const { return WindowDialogMixin::IsDialogRunning(); }
-      SWIGHIDDENVIRTUAL bool IsModalDialog() const { TRACE; return true; };
-      SWIGHIDDENVIRTUAL bool IsDialog() const { TRACE; return true; };
+      SWIGHIDDENVIRTUAL bool IsModalDialog() const { XBMC_TRACE; return true; };
+      SWIGHIDDENVIRTUAL bool IsDialog() const { XBMC_TRACE; return true; };
 
-      SWIGHIDDENVIRTUAL inline void show() { TRACE; WindowDialogMixin::show(); }
-      SWIGHIDDENVIRTUAL inline void close() { TRACE; WindowDialogMixin::close(); }
+      SWIGHIDDENVIRTUAL inline void show() { XBMC_TRACE; WindowDialogMixin::show(); }
+      SWIGHIDDENVIRTUAL inline void close() { XBMC_TRACE; WindowDialogMixin::close(); }
 #endif
     };
   }
index be136c9..21cfa48 100644 (file)
@@ -30,7 +30,7 @@ namespace XBMCAddon
   {
     void WindowDialogMixin::show()
     {
-      TRACE;
+      XBMC_TRACE;
       ThreadMessage tMsg = {TMSG_GUI_PYTHON_DIALOG, HACK_CUSTOM_ACTION_OPENING, 0u};
       tMsg.lpVoid = w->window->get();
       CApplicationMessenger::Get().SendMessage(tMsg, true);
@@ -38,7 +38,7 @@ namespace XBMCAddon
 
     void WindowDialogMixin::close()
     {
-      TRACE;
+      XBMC_TRACE;
       w->bModal = false;
       w->PulseActionEvent();
 
@@ -49,11 +49,11 @@ namespace XBMCAddon
       w->iOldWindowId = 0;
     }
 
-    bool WindowDialogMixin::IsDialogRunning() const { TRACE; return w->window->isActive(); }
+    bool WindowDialogMixin::IsDialogRunning() const { XBMC_TRACE; return w->window->isActive(); }
 
     bool WindowDialogMixin::OnAction(const CAction &action)
     {
-      TRACE;
+      XBMC_TRACE;
       switch (action.GetID())
       {
       case HACK_CUSTOM_ACTION_OPENING:
index b3c568b..5cdf686 100644 (file)
@@ -127,7 +127,7 @@ namespace XBMCAddon
                   Window* _window, int windowid) : P(windowid, "")
       { 
         ((classname = "Interceptor<") += specializedName) += ">";
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
         XBMCAddonUtils::TraceGuard tg;
         CLog::Log(LOGDEBUG, "%sNEWADDON constructing %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
 #endif
@@ -140,7 +140,7 @@ namespace XBMCAddon
                   const char* xmlfile) : P(windowid, xmlfile)
       { 
         ((classname = "Interceptor<") += specializedName) += ">";
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
         XBMCAddonUtils::TraceGuard tg;
         CLog::Log(LOGDEBUG, "%sNEWADDON constructing %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
 #endif
@@ -150,32 +150,32 @@ namespace XBMCAddon
 
       virtual ~Interceptor()
       { 
-#ifdef ENABLE_TRACE_API
+#ifdef ENABLE_XBMC_TRACE_API
         XBMCAddonUtils::TraceGuard tg;
         CLog::Log(LOGDEBUG, "%sNEWADDON LIFECYCLE destroying %s 0x%lx", tg.getSpaces(),classname.c_str(), (long)(((void*)this)));
 #endif
       }
 
       virtual bool    OnMessage(CGUIMessage& message) 
-      { TRACE; return up() ? P::OnMessage(message) : checkedb(OnMessage(message)); }
+      { XBMC_TRACE; return up() ? P::OnMessage(message) : checkedb(OnMessage(message)); }
       virtual bool    OnAction(const CAction &action) 
-      { TRACE; return up() ? P::OnAction(action) : checkedb(OnAction(action)); }
+      { XBMC_TRACE; return up() ? P::OnAction(action) : checkedb(OnAction(action)); }
 
       // NOTE!!: This ALWAYS skips up to the CGUIWindow instance.
       virtual bool    OnBack(int actionId) 
-      { TRACE; return up() ? CGUIWindow::OnBack(actionId) : checkedb(OnBack(actionId)); }
+      { XBMC_TRACE; return up() ? CGUIWindow::OnBack(actionId) : checkedb(OnBack(actionId)); }
 
       virtual void OnDeinitWindow(int nextWindowID)
-      { TRACE; if(up()) P::OnDeinitWindow(nextWindowID); else checkedv(OnDeinitWindow(nextWindowID)); }
+      { XBMC_TRACE; if(up()) P::OnDeinitWindow(nextWindowID); else checkedv(OnDeinitWindow(nextWindowID)); }
 
-      virtual bool    IsModalDialog() const { TRACE; return checkedb(IsModalDialog()); };
+      virtual bool    IsModalDialog() const { XBMC_TRACE; return checkedb(IsModalDialog()); };
 
-      virtual bool    IsDialogRunning() const { TRACE; return checkedb(IsDialogRunning()); };
-      virtual bool    IsDialog() const { TRACE; return checkedb(IsDialog()); };
-      virtual bool    IsMediaWindow() const { TRACE; return checkedb(IsMediaWindow());; };
+      virtual bool    IsDialogRunning() const { XBMC_TRACE; return checkedb(IsDialogRunning()); };
+      virtual bool    IsDialog() const { XBMC_TRACE; return checkedb(IsDialog()); };
+      virtual bool    IsMediaWindow() const { XBMC_TRACE; return checkedb(IsMediaWindow());; };
 
-      virtual void    setActive(bool active) { TRACE; P::m_active = active; }
-      virtual bool    isActive() { TRACE; return P::m_active; }
+      virtual void    setActive(bool active) { XBMC_TRACE; P::m_active = active; }
+      virtual bool    isActive() { XBMC_TRACE; return P::m_active; }
     };
 
     template <class P /* extends CGUIWindow*/> class InterceptorDialog : 
index b184ad6..fd8ae14 100644 (file)
@@ -62,43 +62,43 @@ namespace XBMCAddon
       { }
 
       virtual void AllocResources(bool forceLoad = false)
-      { TRACE; if(up()) CGUIMediaWindow::AllocResources(forceLoad); else checkedv(AllocResources(forceLoad)); }
+      { XBMC_TRACE; if(up()) CGUIMediaWindow::AllocResources(forceLoad); else checkedv(AllocResources(forceLoad)); }
       virtual  void FreeResources(bool forceUnLoad = false)
-      { TRACE; if(up()) CGUIMediaWindow::FreeResources(forceUnLoad); else checkedv(FreeResources(forceUnLoad)); }
-      virtual bool OnClick(int iItem) { TRACE; return up() ? CGUIMediaWindow::OnClick(iItem) : checkedb(OnClick(iItem)); }
+      { XBMC_TRACE; if(up()) CGUIMediaWindow::FreeResources(forceUnLoad); else checkedv(FreeResources(forceUnLoad)); }
+      virtual bool OnClick(int iItem) { XBMC_TRACE; return up() ? CGUIMediaWindow::OnClick(iItem) : checkedb(OnClick(iItem)); }
 
       virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
-      { TRACE; if(up()) CGUIMediaWindow::Process(currentTime,dirtyregions); else checkedv(Process(currentTime,dirtyregions)); }
+      { XBMC_TRACE; if(up()) CGUIMediaWindow::Process(currentTime,dirtyregions); else checkedv(Process(currentTime,dirtyregions)); }
 
       // this is a hack to SKIP the CGUIMediaWindow
       virtual bool OnAction(const CAction &action) 
-      { TRACE; return up() ? CGUIWindow::OnAction(action) : checkedb(OnAction(action)); }
+      { XBMC_TRACE; return up() ? CGUIWindow::OnAction(action) : checkedb(OnAction(action)); }
 
     protected:
       // CGUIWindow
       virtual bool LoadXML(const CStdString &strPath, const CStdString &strPathLower)
-      { TRACE; return up() ? CGUIMediaWindow::LoadXML(strPath,strPathLower) : xwin->LoadXML(strPath,strPathLower); }
+      { XBMC_TRACE; return up() ? CGUIMediaWindow::LoadXML(strPath,strPathLower) : xwin->LoadXML(strPath,strPathLower); }
 
       // CGUIMediaWindow
       virtual void GetContextButtons(int itemNumber, CContextButtons &buttons)
-      { TRACE; if (up()) CGUIMediaWindow::GetContextButtons(itemNumber,buttons); else xwin->GetContextButtons(itemNumber,buttons); }
+      { XBMC_TRACE; if (up()) CGUIMediaWindow::GetContextButtons(itemNumber,buttons); else xwin->GetContextButtons(itemNumber,buttons); }
       virtual bool Update(const CStdString &strPath)
-      { TRACE; return up() ? CGUIMediaWindow::Update(strPath) : xwin->Update(strPath); }
-      virtual void SetupShares() { TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); }
+      { XBMC_TRACE; return up() ? CGUIMediaWindow::Update(strPath) : xwin->Update(strPath); }
+      virtual void SetupShares() { XBMC_TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); }
 
       friend class WindowXML;
       friend class WindowXMLDialog;
 
     };
 
-    WindowXML::~WindowXML() { TRACE; deallocating();  }
+    WindowXML::~WindowXML() { XBMC_TRACE; deallocating();  }
 
     WindowXML::WindowXML(const String& xmlFilename,
                          const String& scriptPath,
                          const String& defaultSkin,
                          const String& defaultRes) throw(WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       RESOLUTION_INFO res;
       CStdString strSkinPath = g_SkinInfo->GetSkinPath(xmlFilename, &res);
 
@@ -147,14 +147,14 @@ namespace XBMCAddon
 
     int WindowXML::lockingGetNextAvailalbeWindowId() throw (WindowException)
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock lock(g_graphicsContext);
       return getNextAvailalbeWindowId();
     }
 
     void WindowXML::addItem(const Alternative<String, const ListItem*>& item, int position)
     {
-      TRACE;
+      XBMC_TRACE;
       // item could be deleted if the reference count is 0.
       //   so I MAY need to check prior to using a Ref just in
       //   case this object is managed by Python. I'm not sure
@@ -191,7 +191,7 @@ namespace XBMCAddon
 
     void WindowXML::removeItem(int position)
     {
-      TRACE;
+      XBMC_TRACE;
       // Tells the window to remove the item at the specified position from the FileItem vector
       LOCKGUI;
       A(m_vecItems)->Remove(position);
@@ -201,7 +201,7 @@ namespace XBMCAddon
 
     int WindowXML::getCurrentListPosition()
     {
-      TRACE;
+      XBMC_TRACE;
       LOCKGUI;
       int listPos = A(m_viewControl).GetSelectedItem();
       return listPos;
@@ -209,7 +209,7 @@ namespace XBMCAddon
 
     void WindowXML::setCurrentListPosition(int position)
     {
-      TRACE;
+      XBMC_TRACE;
       LOCKGUI;
       A(m_viewControl).SetSelectedItem(position);
     }
@@ -240,13 +240,13 @@ namespace XBMCAddon
 
     int WindowXML::getListSize()
     {
-      TRACE;
+      XBMC_TRACE;
       return A(m_vecItems)->Size();
     }
 
     void WindowXML::clearList()
     {
-      TRACE;
+      XBMC_TRACE;
       A(ClearFileItems());
 
       A(m_viewControl).SetItems(*(A(m_vecItems)));
@@ -255,13 +255,13 @@ namespace XBMCAddon
 
     void WindowXML::setProperty(const String& key, const String& value)
     {
-      TRACE;
+      XBMC_TRACE;
       A(m_vecItems)->SetProperty(key, value);
     }
 
     bool WindowXML::OnAction(const CAction &action)
     {
-      TRACE;
+      XBMC_TRACE;
       // do the base class window first, and the call to python after this
       bool ret = ref(window)->OnAction(action);  // we don't currently want the mediawindow actions here
                                                  //  look at the WindowXMLInterceptor onAction, it skips
@@ -275,8 +275,8 @@ namespace XBMCAddon
 
     bool WindowXML::OnMessage(CGUIMessage& message)
     {
-#ifdef ENABLE_TRACE_API
-      TRACE;
+#ifdef ENABLE_XBMC_TRACE_API
+      XBMC_TRACE;
       CLog::Log(LOGDEBUG,"%sMessage id:%d",_tg.getSpaces(),(int)message.GetMessage());
 #endif
 
@@ -378,7 +378,7 @@ namespace XBMCAddon
 
     void WindowXML::AllocResources(bool forceLoad /*= FALSE */)
     {
-      TRACE;
+      XBMC_TRACE;
       CStdString tmpDir = URIUtils::GetDirectory(ref(window)->GetProperty("xmlfile").asString());
       CStdString fallbackMediaPath;
       URIUtils::GetParentPath(tmpDir, fallbackMediaPath);
@@ -393,14 +393,14 @@ namespace XBMCAddon
 
     void WindowXML::FreeResources(bool forceUnLoad /*= FALSE */)
     {
-      TRACE;
+      XBMC_TRACE;
 
       ref(window)->FreeResources(forceUnLoad);
     }
 
     void WindowXML::Process(unsigned int currentTime, CDirtyRegionList &regions)
     {
-      TRACE;
+      XBMC_TRACE;
       g_TextureManager.AddTexturePath(m_mediaDir);
       ref(window)->Process(currentTime, regions);
       g_TextureManager.RemoveTexturePath(m_mediaDir);
@@ -408,7 +408,7 @@ namespace XBMCAddon
 
     bool WindowXML::OnClick(int iItem) 
     {
-      TRACE;
+      XBMC_TRACE;
       // Hook Over calling  CGUIMediaWindow::OnClick(iItem) results in it trying to PLAY the file item
       // which if its not media is BAD and 99 out of 100 times undesireable.
       return false;
@@ -416,20 +416,20 @@ namespace XBMCAddon
 
     bool WindowXML::OnDoubleClick(int iItem)
     {
-      TRACE;
+      XBMC_TRACE;
       return false;
     }
 
     void WindowXML::GetContextButtons(int itemNumber, CContextButtons &buttons)
     {
-      TRACE;
+      XBMC_TRACE;
       // maybe on day we can make an easy way to do this context menu
       // with out this method overriding the MediaWindow version, it will display 'Add to Favorites'
     }
 
     bool WindowXML::LoadXML(const String &strPath, const String &strLowerPath)
     {
-      TRACE;
+      XBMC_TRACE;
       // load our window
       XFILE::CFile file;
       if (!file.Open(strPath) && !file.Open(CStdString(strPath).ToLower()) && !file.Open(strLowerPath))
@@ -462,13 +462,13 @@ namespace XBMCAddon
 
     void WindowXML::SetupShares()
     {
-      TRACE;
+      XBMC_TRACE;
       A(UpdateButtons());
     }
 
     bool WindowXML::Update(const String &strPath)
     {
-      TRACE;
+      XBMC_TRACE;
       return true;
     }
 
@@ -477,13 +477,13 @@ namespace XBMCAddon
                                      const String& defaultRes) throw(WindowException) :
       WindowXML(xmlFilename, scriptPath, defaultSkin, defaultRes),
       WindowDialogMixin(this)
-    { TRACE; }
+    { XBMC_TRACE; }
 
-    WindowXMLDialog::~WindowXMLDialog() { TRACE; deallocating(); }
+    WindowXMLDialog::~WindowXMLDialog() { XBMC_TRACE; deallocating(); }
 
     bool WindowXMLDialog::OnMessage(CGUIMessage &message)
     {
-      TRACE;
+      XBMC_TRACE;
       if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT)
       {
         CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
@@ -496,13 +496,13 @@ namespace XBMCAddon
 
     bool WindowXMLDialog::OnAction(const CAction &action)
     {
-      TRACE;
+      XBMC_TRACE;
       return WindowDialogMixin::OnAction(action) ? true : WindowXML::OnAction(action);
     }
     
     void WindowXMLDialog::OnDeinitWindow(int nextWindowID)
     {
-      TRACE;
+      XBMC_TRACE;
       g_windowManager.RemoveDialog(interceptor->GetID());
       WindowXML::OnDeinitWindow(nextWindowID);
     }
index f3db088..54413f4 100644 (file)
@@ -169,7 +169,7 @@ namespace XBMCAddon
       SWIGHIDDENVIRTUAL bool      OnDoubleClick(int iItem);
       SWIGHIDDENVIRTUAL void      Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
 
-      SWIGHIDDENVIRTUAL bool IsMediaWindow() const { TRACE; return true; };
+      SWIGHIDDENVIRTUAL bool IsMediaWindow() const { XBMC_TRACE; return true; };
 
       // This method is identical to the Window::OnDeinitWindow method
       //  except it passes the message on to their respective parents.
@@ -236,15 +236,15 @@ namespace XBMCAddon
 
 #ifndef SWIG
       SWIGHIDDENVIRTUAL bool    OnMessage(CGUIMessage &message);
-      SWIGHIDDENVIRTUAL bool    IsDialogRunning() const { TRACE; return WindowDialogMixin::IsDialogRunning(); }
-      SWIGHIDDENVIRTUAL bool    IsDialog() const { TRACE; return true;};
-      SWIGHIDDENVIRTUAL bool    IsModalDialog() const { TRACE; return true; };
-      SWIGHIDDENVIRTUAL bool    IsMediaWindow() const { TRACE; return false; };
+      SWIGHIDDENVIRTUAL bool    IsDialogRunning() const { XBMC_TRACE; return WindowDialogMixin::IsDialogRunning(); }
+      SWIGHIDDENVIRTUAL bool    IsDialog() const { XBMC_TRACE; return true;};
+      SWIGHIDDENVIRTUAL bool    IsModalDialog() const { XBMC_TRACE; return true; };
+      SWIGHIDDENVIRTUAL bool    IsMediaWindow() const { XBMC_TRACE; return false; };
       SWIGHIDDENVIRTUAL bool    OnAction(const CAction &action);
       SWIGHIDDENVIRTUAL void    OnDeinitWindow(int nextWindowID);
 
-      SWIGHIDDENVIRTUAL inline void show() { TRACE; WindowDialogMixin::show(); }
-      SWIGHIDDENVIRTUAL inline void close() { TRACE; WindowDialogMixin::close(); }
+      SWIGHIDDENVIRTUAL inline void show() { XBMC_TRACE; WindowDialogMixin::show(); }
+      SWIGHIDDENVIRTUAL inline void close() { XBMC_TRACE; WindowDialogMixin::close(); }
 
       friend class DialogJumper;
 #endif
index 42599c5..6bcaff6 100644 (file)
@@ -33,7 +33,7 @@ namespace XBMCAddon
      */
     PythonCallbackHandler::PythonCallbackHandler()
     {
-      TRACE;
+      XBMC_TRACE;
       objectThreadState = PyThreadState_Get();
     }
 
@@ -43,7 +43,7 @@ namespace XBMCAddon
      */
     bool PythonCallbackHandler::isStateOk(AddonClass* obj)
     {
-      TRACE;
+      XBMC_TRACE;
       PyThreadState* state = PyThreadState_Get();
       if (objectThreadState == state)
       {
@@ -64,7 +64,7 @@ namespace XBMCAddon
      */
     bool PythonCallbackHandler::shouldRemoveCallback(AddonClass* obj, void* threadState)
     {
-      TRACE;
+      XBMC_TRACE;
       if (threadState == objectThreadState)
         return true;
 
index 563beb6..832611c 100644 (file)
@@ -39,38 +39,38 @@ namespace XBMCAddon
     // vtab instantiation
     PythonLanguageHook::~PythonLanguageHook()
     {
-      TRACE;
+      XBMC_TRACE;
       XBMCAddon::LanguageHook::deallocating();
     }
 
     void PythonLanguageHook::MakePendingCalls()
     {
-      TRACE;
+      XBMC_TRACE;
       PythonCallbackHandler::makePendingCalls();
     }
 
     void PythonLanguageHook::DelayedCallOpen()
     {
-      TRACE;
+      XBMC_TRACE;
       PyGILLock::releaseGil();
     }
 
     void PythonLanguageHook::DelayedCallClose()
     {
-      TRACE;
+      XBMC_TRACE;
       PyGILLock::acquireGil();
     }
 
     void PythonLanguageHook::RegisterMe()
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock lock(hooksMutex);
       hooks[m_interp] = AddonClass::Ref<PythonLanguageHook>(this);
     }
 
     void PythonLanguageHook::UnregisterMe()
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock lock(hooksMutex);
       hooks.erase(m_interp);
     }
@@ -84,7 +84,7 @@ namespace XBMCAddon
     // cases like this we're going to use a global interpreter 
     AddonClass::Ref<PythonLanguageHook> PythonLanguageHook::GetIfExists(PyInterpreterState* interp)
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock lock(hooksMutex);
       std::map<PyInterpreterState*,AddonClass::Ref<PythonLanguageHook> >::iterator iter = hooks.find(interp);
       if (iter != hooks.end())
@@ -122,13 +122,13 @@ namespace XBMCAddon
      */
     XBMCAddon::CallbackHandler* PythonLanguageHook::GetCallbackHandler()
     { 
-      TRACE;
+      XBMC_TRACE;
       return new PythonCallbackHandler();
     }
 
     String PythonLanguageHook::GetAddonId()
     {
-      TRACE;
+      XBMC_TRACE;
       const char* id = NULL;
 
       // Get a reference to the main module
@@ -144,7 +144,7 @@ namespace XBMCAddon
 
     String PythonLanguageHook::GetAddonVersion()
     {
-      TRACE;
+      XBMC_TRACE;
       // Get a reference to the main module
       // and global dictionary
       PyObject* main_module = PyImport_AddModule((char*)"__main__");
@@ -156,20 +156,20 @@ namespace XBMCAddon
       return version;
     }
 
-    void PythonLanguageHook::RegisterPlayerCallback(IPlayerCallback* player) { TRACE; g_pythonParser.RegisterPythonPlayerCallBack(player); }
-    void PythonLanguageHook::UnregisterPlayerCallback(IPlayerCallback* player) { TRACE; g_pythonParser.UnregisterPythonPlayerCallBack(player); }
-    void PythonLanguageHook::RegisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { TRACE; g_pythonParser.RegisterPythonMonitorCallBack(monitor); }
-    void PythonLanguageHook::UnregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { TRACE; g_pythonParser.UnregisterPythonMonitorCallBack(monitor); }
+    void PythonLanguageHook::RegisterPlayerCallback(IPlayerCallback* player) { XBMC_TRACE; g_pythonParser.RegisterPythonPlayerCallBack(player); }
+    void PythonLanguageHook::UnregisterPlayerCallback(IPlayerCallback* player) { XBMC_TRACE; g_pythonParser.UnregisterPythonPlayerCallBack(player); }
+    void PythonLanguageHook::RegisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { XBMC_TRACE; g_pythonParser.RegisterPythonMonitorCallBack(monitor); }
+    void PythonLanguageHook::UnregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { XBMC_TRACE; g_pythonParser.UnregisterPythonMonitorCallBack(monitor); }
 
     bool PythonLanguageHook::WaitForEvent(CEvent& hEvent, unsigned int milliseconds)
     { 
-      TRACE;
+      XBMC_TRACE;
       return g_pythonParser.WaitForEvent(hEvent,milliseconds);
     }
 
     void PythonLanguageHook::RegisterAddonClassInstance(AddonClass* obj)
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock l(*this);
       obj->Acquire();
       currentObjects.insert(obj);
@@ -177,7 +177,7 @@ namespace XBMCAddon
 
     void PythonLanguageHook::UnregisterAddonClassInstance(AddonClass* obj)
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock l(*this);
       if (currentObjects.erase(obj) > 0)
         obj->Release();
@@ -185,7 +185,7 @@ namespace XBMCAddon
 
     bool PythonLanguageHook::HasRegisteredAddonClassInstance(AddonClass* obj)
     {
-      TRACE;
+      XBMC_TRACE;
       CSingleLock l(*this);
       return currentObjects.find(obj) != currentObjects.end();
     }
index 7b5b04b..82b39dd 100644 (file)
@@ -65,8 +65,6 @@ extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode);
 // Time before ill-behaved scripts are terminated
 #define PYTHON_SCRIPT_TIMEOUT 5000 // ms
 
-#define THREAD_STOP_TIMEOUT_MILLIS 5000
-
 using namespace std;
 using namespace XFILE;
 
@@ -288,22 +286,23 @@ bool CPythonInvoker::execute(const std::string &script, const std::vector<std::s
   }
 
   bool systemExitThrown = false;
+  InvokerState stateToSet;
   if (!failed && !PyErr_Occurred())
   {
     CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): script successfully run", GetId(), m_source);
-    setState(InvokerStateDone);
+    stateToSet = InvokerStateDone;
     onSuccess();
   }
   else if (PyErr_ExceptionMatches(PyExc_SystemExit))
   {
     systemExitThrown = true;
     CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): script aborted", GetId(), m_source);
-    setState(InvokerStateFailed);
+    stateToSet = InvokerStateFailed;
     onAbort();
   }
   else
   {
-    setState(InvokerStateFailed);
+    stateToSet = InvokerStateFailed;
 
     // if it failed with an exception we already logged the details
     if (!failed)
@@ -317,14 +316,16 @@ bool CPythonInvoker::execute(const std::string &script, const std::vector<std::s
 
   // no need to do anything else because the script has already stopped
   if (failed)
+  {
+    setState(stateToSet);
     return true;
+  }
 
   PyObject *m = PyImport_AddModule((char*)"xbmc");
   if (m == NULL || PyObject_SetAttrString(m, (char*)"abortRequested", PyBool_FromLong(1)))
     CLog::Log(LOGERROR, "CPythonInvoker(%d, %s): failed to set abortRequested", GetId(), m_source);
 
   // make sure all sub threads have finished
-  XbmcThreads::EndTime waitTime(THREAD_STOP_TIMEOUT_MILLIS); // we will wait THREAD_STOP_TIMEOUT_MILLIS for any given thread to end
   for (PyThreadState* s = state->interp->tstate_head, *old = NULL; s;)
   {
     if (s == state)
@@ -335,7 +336,6 @@ bool CPythonInvoker::execute(const std::string &script, const std::vector<std::s
     if (old != s)
     {
       CLog::Log(LOGINFO, "CPythonInvoker(%d, %s): waiting on thread %"PRIu64, GetId(), m_source, (uint64_t)s->thread_id);
-      waitTime.Set(THREAD_STOP_TIMEOUT_MILLIS); // reset the wait time
       old = s;
     }
 
@@ -343,15 +343,6 @@ bool CPythonInvoker::execute(const std::string &script, const std::vector<std::s
     Sleep(100);
     pyState.Restore();
 
-    if (waitTime.IsTimePast())
-    {
-      // let's kick this and see if it helps
-      // Raise a SystemExit exception in python threads
-      Py_XDECREF(s->async_exc);
-      s->async_exc = PyExc_SystemExit;
-      Py_XINCREF(s->async_exc);
-    }
-
     s = state->interp->tstate_head;
   }
 
@@ -400,6 +391,8 @@ bool CPythonInvoker::execute(const std::string &script, const std::vector<std::s
 
   PyEval_ReleaseLock();
 
+  setState(stateToSet);
+
   return true;
 }
 
@@ -510,7 +503,7 @@ std::map<std::string, CPythonInvoker::PythonModuleInitialization> CPythonInvoker
 
 void CPythonInvoker::onInitialization()
 {
-  TRACE;
+  XBMC_TRACE;
   {
     GilSafeSingleLock lock(s_critical);
     initializeModules(getModules());
@@ -546,7 +539,7 @@ void CPythonInvoker::onPythonModuleInitialization(void* moduleDict)
 
 void CPythonInvoker::onDeinitialization()
 {
-  TRACE;
+  XBMC_TRACE;
 }
 
 void CPythonInvoker::onError()
index 86cc208..8e80ff8 100644 (file)
@@ -152,7 +152,7 @@ void doMethod(Node method, MethodType methodType)
                    if (doAsMappingIndex) { %>, PyObject* py${params[0].@name}<% }
                    else if (methodType != MethodType.destructor) { %> , PyObject *args, PyObject *kwds <%} %> )
   {
-    TRACE;
+    XBMC_TRACE;
 <%  if (numParams > 0)
     { 
       if (useKeywordParsing && !doAsMappingIndex)
index aaeb22b..e2fd194 100644 (file)
@@ -72,7 +72,7 @@ XBPython::XBPython()
 
 XBPython::~XBPython()
 {
-  TRACE;
+  XBMC_TRACE;
   CAnnouncementManager::RemoveAnnouncer(this);
 }
 
@@ -116,7 +116,7 @@ void XBPython::Announce(AnnouncementFlag flag, const char *sender, const char *m
 // message all registered callbacks that we started playing
 void XBPython::OnPlayBackStarted()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -128,7 +128,7 @@ void XBPython::OnPlayBackStarted()
 // message all registered callbacks that we paused playing
 void XBPython::OnPlayBackPaused()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -140,7 +140,7 @@ void XBPython::OnPlayBackPaused()
 // message all registered callbacks that we resumed playing
 void XBPython::OnPlayBackResumed()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -152,7 +152,7 @@ void XBPython::OnPlayBackResumed()
 // message all registered callbacks that xbmc stopped playing
 void XBPython::OnPlayBackEnded()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -164,7 +164,7 @@ void XBPython::OnPlayBackEnded()
 // message all registered callbacks that user stopped playing
 void XBPython::OnPlayBackStopped()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -176,7 +176,7 @@ void XBPython::OnPlayBackStopped()
 // message all registered callbacks that playback speed changed (FF/RW)
 void XBPython::OnPlayBackSpeedChanged(int iSpeed)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -188,7 +188,7 @@ void XBPython::OnPlayBackSpeedChanged(int iSpeed)
 // message all registered callbacks that player is seeking
 void XBPython::OnPlayBackSeek(int iTime, int seekOffset)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -200,7 +200,7 @@ void XBPython::OnPlayBackSeek(int iTime, int seekOffset)
 // message all registered callbacks that player chapter seeked
 void XBPython::OnPlayBackSeekChapter(int iChapter)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -212,7 +212,7 @@ void XBPython::OnPlayBackSeekChapter(int iChapter)
 // message all registered callbacks that next item has been queued
 void XBPython::OnQueueNextItem()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<PVOID>,tmp,m_vecPlayerCallbackList);
   for (PlayerCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -223,14 +223,14 @@ void XBPython::OnQueueNextItem()
 
 void XBPython::RegisterPythonPlayerCallBack(IPlayerCallback* pCallback)
 {
-  TRACE;
+  XBMC_TRACE;
   CSingleLock lock(m_vecPlayerCallbackList);
   m_vecPlayerCallbackList.push_back(pCallback);
 }
 
 void XBPython::UnregisterPythonPlayerCallBack(IPlayerCallback* pCallback)
 {
-  TRACE;
+  XBMC_TRACE;
   CSingleLock lock(m_vecPlayerCallbackList);
   PlayerCallbackList::iterator it = m_vecPlayerCallbackList.begin();
   while (it != m_vecPlayerCallbackList.end())
@@ -247,14 +247,14 @@ void XBPython::UnregisterPythonPlayerCallBack(IPlayerCallback* pCallback)
 
 void XBPython::RegisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback)
 {
-  TRACE;
+  XBMC_TRACE;
   CSingleLock lock(m_vecMonitorCallbackList);
   m_vecMonitorCallbackList.push_back(pCallback);
 }
 
 void XBPython::UnregisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback)
 {
-  TRACE;
+  XBMC_TRACE;
   CSingleLock lock(m_vecMonitorCallbackList);
   MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin();
   while (it != m_vecMonitorCallbackList.end())
@@ -271,7 +271,7 @@ void XBPython::UnregisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallba
 
 void XBPython::OnSettingsChanged(const CStdString &ID)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -282,7 +282,7 @@ void XBPython::OnSettingsChanged(const CStdString &ID)
 
 void XBPython::OnScreensaverActivated()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -293,7 +293,7 @@ void XBPython::OnScreensaverActivated()
 
 void XBPython::OnScreensaverDeactivated()
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -304,7 +304,7 @@ void XBPython::OnScreensaverDeactivated()
 
 void XBPython::OnDatabaseUpdated(const std::string &database)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -315,7 +315,7 @@ void XBPython::OnDatabaseUpdated(const std::string &database)
 
 void XBPython::OnDatabaseScanStarted(const std::string &database)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -326,7 +326,7 @@ void XBPython::OnDatabaseScanStarted(const std::string &database)
 
 void XBPython::OnAbortRequested(const CStdString &ID)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -342,7 +342,7 @@ void XBPython::OnAbortRequested(const CStdString &ID)
 
 void XBPython::OnNotification(const std::string &sender, const std::string &method, const std::string &data)
 {
-  TRACE;
+  XBMC_TRACE;
   LOCK_AND_COPY(std::vector<XBMCAddon::xbmc::Monitor*>,tmp,m_vecMonitorCallbackList);
   for (MonitorCallbackList::iterator it = tmp.begin(); (it != tmp.end()); ++it)
   {
@@ -415,7 +415,7 @@ void XBPython::UnloadExtensionLibs()
 */
 bool XBPython::InitializeEngine()
 {
-  TRACE;
+  XBMC_TRACE;
   CLog::Log(LOGINFO, "initializing python engine.");
   CSingleLock lock(m_critSection);
   m_iDllScriptCounter++;
@@ -512,7 +512,7 @@ bool XBPython::InitializeEngine()
 */
 void XBPython::FinalizeScript()
 {
-  TRACE;
+  XBMC_TRACE;
   CSingleLock lock(m_critSection);
   // for linux - we never release the library. its loaded and stays in memory.
   if (m_iDllScriptCounter)
@@ -525,7 +525,7 @@ void XBPython::FinalizeScript()
 // Always called with the lock held on m_critSection
 void XBPython::Finalize()
 {
-  TRACE;
+  XBMC_TRACE;
   if (m_bInitialized)
   {
     CLog::Log(LOGINFO, "Python, unloading python shared library because no scripts are running anymore");
index 7b1a302..6a3e9c4 100644 (file)
@@ -222,7 +222,7 @@ namespace PythonBindings
    */
   void prepareForReturn(XBMCAddon::AddonClass* c)
   {
-    TRACE;
+    XBMC_TRACE;
     if(c) { 
       c->Acquire(); 
       PyThreadState* state = PyThreadState_Get();
@@ -232,7 +232,7 @@ namespace PythonBindings
 
   static bool handleInterpRegistrationForClean(XBMCAddon::AddonClass* c)
   {
-    TRACE;
+    XBMC_TRACE;
     if(c){
       XBMCAddon::AddonClass::Ref<XBMCAddon::Python::PythonLanguageHook> lh = 
         XBMCAddon::AddonClass::Ref<XBMCAddon::AddonClass>(c->GetLanguageHook());
@@ -259,7 +259,7 @@ namespace PythonBindings
    */
   void cleanForDealloc(XBMCAddon::AddonClass* c) 
   { 
-    TRACE;
+    XBMC_TRACE;
     if (handleInterpRegistrationForClean(c))
       c->Release();
   }
@@ -274,7 +274,7 @@ namespace PythonBindings
    */
   void cleanForDealloc(XBMCAddon::xbmcgui::Window* c) 
   {
-    TRACE;
+    XBMC_TRACE;
     if (handleInterpRegistrationForClean(c))
     { 
       c->dispose();
index 8c0fbfa..f772942 100644 (file)
@@ -175,7 +175,7 @@ namespace PythonBindings
     static inline int compare(PyObject* obj1, PyObject* obj2, const char* swigType, const char* methodNamespacePrefix, const char* methodNameForErrorString)
       throw(XBMCAddon::WrongTypeException)
     {
-      TRACE;
+      XBMC_TRACE;
       try
       {
         T* o1 = (T*)retrieveApiInstance(obj1, swigType, methodNamespacePrefix, methodNameForErrorString);
index 52eeddf..b8e8fbc 100644 (file)
@@ -70,7 +70,7 @@ using namespace xbmcgui;
 
 // This is such a damn hack it makes me nauseous
 %feature("python:rcmp") XBMCAddon::xbmcgui::Action
-  { TRACE;
+  { XBMC_TRACE;
     if (method == Py_EQ)
     {
       XBMCAddon::xbmcgui::Action* a1 = (Action*)retrieveApiInstance(obj1,&TyXBMCAddon_xbmcgui_Action_Type,"rcmp","XBMCAddon::xbmcgui::Action");
index ab3738a..eaebe41 100644 (file)
@@ -584,7 +584,8 @@ bool CNetworkInterfaceLinux::GetHostMacAddress(unsigned long host_ip, CStdString
   
   if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &needed, NULL, 0) == 0)
   {   
-    if (buf = (char*)malloc(needed))
+    buf = (char*)malloc(needed);
+    if (buf)
     {      
       if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &needed, NULL, 0) == 0)
       {        
index 2bae9be..b12f1ef 100644 (file)
@@ -36,6 +36,7 @@
 #include "utils/TimeUtils.h"
 #include "threads/SingleLock.h"
 #include "log.h"
+#include "utils/FileUtils.h"
 
 #define RSS_COLOR_BODY      0
 #define RSS_COLOR_HEADLINE  1
@@ -161,14 +162,12 @@ void CRssReader::Process()
 
         if (url.GetProtocol() != "http" && url.GetProtocol() != "https")
         {
-          CFile file;
-          if (file.Open(strUrl))
+          void* bufferPtr;
+          const unsigned int fsize = CFileUtils::LoadFile(strUrl, bufferPtr);
+          if (fsize != 0)
           {
-            char *yo = new char[(int)file.GetLength() + 1];
-            file.Read(yo, file.GetLength());
-            yo[file.GetLength()] = '\0';
-            strXML = yo;
-            delete[] yo;
+            strXML.assign((const char*)bufferPtr, fsize);
+            free(bufferPtr);
             break;
           }
         }
index 470d18a..d9c38cc 100644 (file)
@@ -214,10 +214,9 @@ bool CScraperUrl::Get(const SUrlEntry& scrURL, std::string& strHTML, XFILE::CCur
       XFILE::CFile file;
       if (file.Open(strCachePath))
       {
-        char* temp = new char[(int)file.GetLength()];
-        file.Read(temp,file.GetLength());
-        strHTML.clear();
-        strHTML.append(temp,temp+file.GetLength());
+        size_t flen = file.GetLength();
+        char* temp = new char[flen];
+        strHTML.assign(temp, file.Read(temp, flen));
         file.Close();
         delete[] temp;
         return true;
index 418282e..21c8dad 100644 (file)
@@ -87,7 +87,7 @@ bool URIUtils::HasExtension(const CStdString& strFileName, const CStdString& str
   {
     // Iterate backwards over strFileName untill we hit a '.' or a mismatch
     for (CStdString::const_reverse_iterator itFileName = strFileName.rbegin();
-         itFileName != strFileName.rend(), itExtensions != strExtensions.rend(),
+         itFileName != strFileName.rend() && itExtensions != strExtensions.rend() &&
          tolower(*itFileName) == *itExtensions;
          ++itFileName, ++itExtensions)
     {
index 0997288..6b9e0fb 100644 (file)
@@ -65,6 +65,9 @@ public:
   virtual void Unregister(IDispResource *resource);
   
   virtual int GetNumScreens();
+  virtual int GetCurrentScreen();
+  
+  void        WindowChangedScreen();
 
   void CheckDisplayChanging(u_int32_t flags);
   
@@ -93,8 +96,11 @@ protected:
 
   bool                         m_use_system_screensaver;
   bool                         m_can_display_switch;
+  bool                         m_movedToOtherScreen;
+  int                          m_lastDisplayNr;
   void                        *m_windowDidMove;
   void                        *m_windowDidReSize;
+  void                        *m_windowChangedScreen;
 
   CCriticalSection             m_resourceSection;
   std::vector<IDispResource*>  m_resources;
index 787c427..880a0c9 100644 (file)
   */
 }
 @end
+
+//------------------------------------------------------------------------------------------
+// special object-c class for handling the NSWindowDidChangeScreenNotification callback.
+@interface windowDidChangeScreenNoteClass : NSObject
+{
+  void *m_userdata;
+}
++ initWith: (void*) userdata;
+- (void) windowDidChangeScreenNotification:(NSNotification*) note;
+@end
+@implementation windowDidChangeScreenNoteClass
++ initWith: (void*) userdata;
+{
+    windowDidChangeScreenNoteClass *windowDidChangeScreen = [windowDidChangeScreenNoteClass new];
+    windowDidChangeScreen->m_userdata = userdata;
+    return [windowDidChangeScreen autorelease];
+}
+- (void) windowDidChangeScreenNotification:(NSNotification*) note;
+{
+  CWinSystemOSX *winsys = (CWinSystemOSX*)m_userdata;
+       if (!winsys)
+    return;
+  winsys->WindowChangedScreen();
+}
+@end
 //------------------------------------------------------------------------------------------
 
 
@@ -532,6 +557,8 @@ CWinSystemOSX::CWinSystemOSX() : CWinSystemBase()
   m_use_system_screensaver = true;
   // check runtime, we only allow this on 10.5+
   m_can_display_switch = (floor(NSAppKitVersionNumber) >= 949);
+  m_lastDisplayNr = -1;
+  m_movedToOtherScreen = false;
 }
 
 CWinSystemOSX::~CWinSystemOSX()
@@ -570,6 +597,13 @@ bool CWinSystemOSX::InitWindowSystem()
     name:NSWindowDidResizeNotification object:nil];
   m_windowDidReSize = windowDidReSize;
 
+  windowDidChangeScreenNoteClass *windowDidChangeScreen;
+  windowDidChangeScreen = [windowDidChangeScreenNoteClass initWith: this];
+  [center addObserver:windowDidChangeScreen
+    selector:@selector(windowDidChangeScreenNotification:)
+    name:NSWindowDidChangeScreenNotification object:nil];
+  m_windowChangedScreen = windowDidChangeScreen;
+
   return true;
 }
 
@@ -578,6 +612,7 @@ bool CWinSystemOSX::DestroyWindowSystem()
   NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
   [center removeObserver:(windowDidMoveNoteClass*)m_windowDidMove name:NSWindowDidMoveNotification object:nil];
   [center removeObserver:(windowDidReSizeNoteClass*)m_windowDidReSize name:NSWindowDidResizeNotification object:nil];
+  [center removeObserver:(windowDidChangeScreenNoteClass*)m_windowChangedScreen name:NSWindowDidChangeScreenNotification object:nil];  
 
   if (m_can_display_switch)
     CGDisplayRemoveReconfigurationCallback(DisplayReconfigured, (void*)this);
@@ -735,8 +770,10 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
   static NSPoint last_view_origin;
   static NSInteger last_window_level = NSNormalWindowLevel;
   bool was_fullscreen = m_bFullScreen;
-  static int lastDisplayNr = res.iScreen;
   NSOpenGLContext* cur_context;
+  
+  if (m_lastDisplayNr == -1)
+    m_lastDisplayNr = res.iScreen;
 
   // Fade to black to hide resolution-switching flicker and garbage.
   CGDisplayFadeReservationToken fade_token = DisplayFadeToBlack(needtoshowme);
@@ -773,7 +810,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
 
       // switch videomode
       SwitchToVideoMode(res.iWidth, res.iHeight, res.fRefreshRate, res.iScreen);
-      lastDisplayNr = res.iScreen;
+      m_lastDisplayNr = res.iScreen;
     }
   }
 
@@ -1623,6 +1660,44 @@ int CWinSystemOSX::GetNumScreens()
   return(numDisplays);
 }
 
+int CWinSystemOSX::GetCurrentScreen()
+{
+  NSOpenGLContext* context = [NSOpenGLContext currentContext];
+  
+  // if user hasn't moved us in windowed mode - return the
+  // last display we were fullscreened at
+  if (!m_movedToOtherScreen)
+    return m_lastDisplayNr;
+  
+  // if we are here the user dragged the window to a different
+  // screen and we return the screen of the window
+  if (context)
+  {
+    NSView* view;
+
+    view = [context view];
+    if (view)
+    {
+      NSWindow* window;
+      window = [view window];
+      if (window)
+      {
+        m_movedToOtherScreen = false;
+        return GetDisplayIndex(GetDisplayIDFromScreen( [window screen] ));
+      }
+        
+    }
+  }
+  return 0;
+}
+
+void CWinSystemOSX::WindowChangedScreen()
+{
+  // user has moved the window to a
+  // different screen
+  m_movedToOtherScreen = true;
+}
+
 void CWinSystemOSX::CheckDisplayChanging(u_int32_t flags)
 {
   if (flags)