diff options
94 files changed, 4622 insertions, 17779 deletions
diff --git a/.gitignore b/.gitignore index e65c83c475..a33dc04f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ testMain # Eclipse *.project *.cproject +.classpath # generated files etc config.cache @@ -28,6 +29,7 @@ config.log *.orig *.bak *.apk +*.class # Windows specific generated files *.exp @@ -378,6 +380,8 @@ lib/cmyth/Makefile /project/BuildDependencies/lib /project/BuildDependencies/msys /project/BuildDependencies/scripts/tmp +/project/BuildDependencies/bin/swig +/project/BuildDependencies/bin/doxygen # /project/VS2008Express /project/VS2008Express/Debug @@ -1150,33 +1154,12 @@ lib/cmyth/Makefile # /xbmc/interfaces/ /xbmc/interfaces/Makefile /xbmc/interfaces/python/Makefile -/xbmc/interfaces/python/xbmcmodule/Makefile -/xbmc/interfaces/python/linux/Makefile -/xbmc/interfaces/python/linux/wrapper_python.def +/xbmc/interfaces/python/generated/ # /xbmc/network/ /xbmc/network/Makefile /xbmc/network/upnp/Makefile -/lib/python/Makefile -/lib/python/Include/pyconfig.h -/lib/python/Makefile.pre -/lib/python/Modules/Setup -/lib/python/Modules/Setup.config -/lib/python/Modules/Setup.local -/lib/python/Modules/config.c -/lib/python/Parser/pgen -/lib/python/Parser/pgen.exe -/lib/python/PC/pythonnt_rc.h -/lib/python/build/ -/lib/python/buildno -/lib/python/pyconfig.h -/lib/python/pyconfig.hbak -/lib/python/python -/lib/python/python.exe -/lib/python/Mac/Python/ -/lib/python/PC/pythonnt_rc_d.h - # /lib/libRTV/ /lib/libRTV/Makefile /lib/libRTV/Debug diff --git a/Makefile.in b/Makefile.in index fb80df6313..2395da63b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -50,8 +50,6 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \ xbmc/interfaces/info/info.a \ xbmc/interfaces/interfaces.a \ xbmc/interfaces/json-rpc/json-rpc.a \ - xbmc/interfaces/python/python.a \ - xbmc/interfaces/python/xbmcmodule/xbmcmodule.a \ xbmc/linux/linux.a \ xbmc/music/dialogs/musicdialogs.a \ xbmc/music/infoscanner/musicscanner.a \ @@ -97,6 +95,9 @@ ifeq (@USE_WEB_SERVER@,1) DIRECTORY_ARCHIVES += xbmc/network/httprequesthandler/httprequesthandlers.a endif +DIRECTORY_ARCHIVES += xbmc/interfaces/legacy/legacy.a +DIRECTORY_ARCHIVES += xbmc/interfaces/python/python_binding.a + ifeq (@USE_OPENGL@,1) DIRECTORY_ARCHIVES += xbmc/rendering/gl/rendering_gl.a endif @@ -347,9 +348,6 @@ libaddon: exports $(MAKE) -C lib/addons/library.xbmc.addon $(MAKE) -C lib/addons/library.xbmc.gui $(MAKE) -C lib/addons/library.xbmc.pvr -libpython: dllloader - $(MAKE) -C xbmc/interfaces/python - $(MAKE) -C xbmc/interfaces/python/xbmcmodule dvdpcodecs: dllloader $(MAKE) -C lib $(MAKE) -C lib/libdvd @@ -396,13 +394,18 @@ libs: libhdhomerun libid3tag imagelib libexif system/libcpluff-@ARCH@.so $(CMYTH externals: codecs libs visualizations screensavers libaddon +ADDON_BINDINGS = xbmc/interfaces/legacy/legacy.a +ADDON_BINDINGS += xbmc/interfaces/python/python_binding.a + xcode_depends: \ codecs libs visualizations screensavers eventclients skins libaddon \ lib/libsquish/libsquish.a \ lib/libapetag/.libs/libapetag.a \ lib/libRTV/librtv.a \ lib/libXDAAP/libxdaap.a \ - lib/SlingboxLib/SlingboxLib.a + lib/SlingboxLib/SlingboxLib.a \ + $(ADDON_BINDINGS) + libtool -static -o xbmc/interfaces/addonbindings.a $(ADDON_BINDINGS) OBJSXBMC =$(DIRECTORY_ARCHIVES) OBJSXBMC+=lib/libapetag/.libs/libapetag.a diff --git a/XBMC-ATV2.xcodeproj/project.pbxproj b/XBMC-ATV2.xcodeproj/project.pbxproj index 458e9d4ec8..c539cc09dd 100644 --- a/XBMC-ATV2.xcodeproj/project.pbxproj +++ b/XBMC-ATV2.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 1830216013B8E35300770920 /* controledit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1830215F13B8E35300770920 /* controledit.cpp */; }; 18404DFD1396C44F00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DFC1396C44F00863BBA /* SlingboxLib.a */; }; 1840B796139968DB007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B792139968DB007C848B /* JSONVariantParser.cpp */; }; 1840B797139968DB007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B794139968DB007C848B /* JSONVariantWriter.cpp */; }; @@ -43,8 +42,6 @@ 7CCFD9AA1514952700211D82 /* PCMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCFD9A81514952700211D82 /* PCMCodec.cpp */; }; 7CEE2E6D13D6B7A8000ABF2A /* TimeSmoother.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CEE2E6B13D6B7A8000ABF2A /* TimeSmoother.cpp */; }; C807119F135DB842002F601B /* InputOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C807119D135DB842002F601B /* InputOperations.cpp */; }; - C8936060152C86EC00812418 /* PythonMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C893605E152C86EC00812418 /* PythonMonitor.cpp */; }; - C8936063152C86F500812418 /* monitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8936061152C86F500812418 /* monitor.cpp */; }; C8B92A8215735D0300284190 /* Epg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B92A7515735D0300284190 /* Epg.cpp */; }; C8B92A8315735D0300284190 /* EpgContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B92A7715735D0300284190 /* EpgContainer.cpp */; }; C8B92A8415735D0300284190 /* EpgDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B92A7915735D0300284190 /* EpgDatabase.cpp */; }; @@ -101,6 +98,7 @@ DF23461115FA671900A934F6 /* UPnPInternal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23460915FA671900A934F6 /* UPnPInternal.cpp */; }; DF23461215FA671900A934F6 /* UPnPRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23460B15FA671900A934F6 /* UPnPRenderer.cpp */; }; DF23461315FA671900A934F6 /* UPnPServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23460D15FA671900A934F6 /* UPnPServer.cpp */; }; + DF294E7915DAD78E004FDDEC /* addonbindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DF294E7815DAD78E004FDDEC /* addonbindings.a */; }; DF33C2A415509C1B0046CDCB /* XbmcContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C2A215509C1B0046CDCB /* XbmcContext.cpp */; }; DF33C2AE15509C5A0046CDCB /* ilog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C2AB15509C5A0046CDCB /* ilog.cpp */; }; DF34890913FD96390026A711 /* GUIAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34890713FD96390026A711 /* GUIAction.cpp */; }; @@ -612,44 +610,6 @@ F56C7A47131EC155000AD0F6 /* KeyboardStat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7558131EC152000AD0F6 /* KeyboardStat.cpp */; }; F56C7A48131EC155000AD0F6 /* MouseStat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C755A131EC152000AD0F6 /* MouseStat.cpp */; }; F56C7A49131EC155000AD0F6 /* SDLJoystick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C755C131EC152000AD0F6 /* SDLJoystick.cpp */; }; - F56C7A4B131EC155000AD0F6 /* xbmcvfsmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7567131EC152000AD0F6 /* xbmcvfsmodule.cpp */; }; - F56C7A4C131EC155000AD0F6 /* PythonAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7568131EC152000AD0F6 /* PythonAddon.cpp */; }; - F56C7A4D131EC155000AD0F6 /* xbmcaddonmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C756A131EC152000AD0F6 /* xbmcaddonmodule.cpp */; }; - F56C7A4E131EC155000AD0F6 /* controlslider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C756B131EC152000AD0F6 /* controlslider.cpp */; }; - F56C7A4F131EC155000AD0F6 /* controlradiobutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C756C131EC152000AD0F6 /* controlradiobutton.cpp */; }; - F56C7A50131EC155000AD0F6 /* action.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C756D131EC152000AD0F6 /* action.cpp */; }; - F56C7A51131EC155000AD0F6 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C756F131EC152000AD0F6 /* control.cpp */; }; - F56C7A52131EC155000AD0F6 /* controlbutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7571131EC152000AD0F6 /* controlbutton.cpp */; }; - F56C7A53131EC155000AD0F6 /* controlcheckmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7572131EC152000AD0F6 /* controlcheckmark.cpp */; }; - F56C7A54131EC155000AD0F6 /* controlfadelabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7573131EC152000AD0F6 /* controlfadelabel.cpp */; }; - F56C7A55131EC155000AD0F6 /* controlgroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7574131EC152000AD0F6 /* controlgroup.cpp */; }; - F56C7A56131EC155000AD0F6 /* controlimage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7575131EC152000AD0F6 /* controlimage.cpp */; }; - F56C7A57131EC155000AD0F6 /* controllabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7576131EC152000AD0F6 /* controllabel.cpp */; }; - F56C7A58131EC155000AD0F6 /* controllist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7577131EC152000AD0F6 /* controllist.cpp */; }; - F56C7A59131EC155000AD0F6 /* controlprogress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7578131EC152000AD0F6 /* controlprogress.cpp */; }; - F56C7A5A131EC155000AD0F6 /* controlspin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7579131EC152000AD0F6 /* controlspin.cpp */; }; - F56C7A5B131EC155000AD0F6 /* controltextbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C757A131EC152000AD0F6 /* controltextbox.cpp */; }; - F56C7A5C131EC155000AD0F6 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C757B131EC152000AD0F6 /* dialog.cpp */; }; - F56C7A5D131EC155000AD0F6 /* GUIPythonWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C757D131EC152000AD0F6 /* GUIPythonWindow.cpp */; }; - F56C7A5E131EC155000AD0F6 /* GUIPythonWindowDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C757F131EC152000AD0F6 /* GUIPythonWindowDialog.cpp */; }; - F56C7A5F131EC155000AD0F6 /* GUIPythonWindowXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7581131EC152000AD0F6 /* GUIPythonWindowXML.cpp */; }; - F56C7A60131EC155000AD0F6 /* GUIPythonWindowXMLDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7583131EC152000AD0F6 /* GUIPythonWindowXMLDialog.cpp */; }; - F56C7A61131EC155000AD0F6 /* infotagmusic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7585131EC152000AD0F6 /* infotagmusic.cpp */; }; - F56C7A62131EC155000AD0F6 /* infotagvideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7587131EC152000AD0F6 /* infotagvideo.cpp */; }; - F56C7A63131EC155000AD0F6 /* keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7589131EC152000AD0F6 /* keyboard.cpp */; }; - F56C7A64131EC155000AD0F6 /* listitem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C758B131EC152000AD0F6 /* listitem.cpp */; }; - F56C7A65131EC155000AD0F6 /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C758D131EC152000AD0F6 /* player.cpp */; }; - F56C7A66131EC155000AD0F6 /* pyplaylist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C758F131EC152000AD0F6 /* pyplaylist.cpp */; }; - F56C7A67131EC155000AD0F6 /* PythonPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7591131EC152000AD0F6 /* PythonPlayer.cpp */; }; - F56C7A68131EC155000AD0F6 /* pyutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7593131EC152000AD0F6 /* pyutil.cpp */; }; - F56C7A69131EC155000AD0F6 /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7595131EC152000AD0F6 /* window.cpp */; }; - F56C7A6A131EC155000AD0F6 /* winxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7597131EC152000AD0F6 /* winxml.cpp */; }; - F56C7A6B131EC155000AD0F6 /* winxmldialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7599131EC152000AD0F6 /* winxmldialog.cpp */; }; - F56C7A6C131EC155000AD0F6 /* xbmcguimodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C759A131EC152000AD0F6 /* xbmcguimodule.cpp */; }; - F56C7A6D131EC155000AD0F6 /* xbmcmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C759B131EC152000AD0F6 /* xbmcmodule.cpp */; }; - F56C7A6E131EC155000AD0F6 /* xbmcplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C759C131EC152000AD0F6 /* xbmcplugin.cpp */; }; - F56C7A6F131EC155000AD0F6 /* XBPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C759D131EC152000AD0F6 /* XBPython.cpp */; }; - F56C7A71131EC155000AD0F6 /* XBPyThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75A1131EC152000AD0F6 /* XBPyThread.cpp */; }; F56C7A72131EC155000AD0F6 /* AnnouncementManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75A3131EC152000AD0F6 /* AnnouncementManager.cpp */; }; F56C7A73131EC155000AD0F6 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75A5131EC153000AD0F6 /* Builtins.cpp */; }; F56C7A75131EC155000AD0F6 /* ConvUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75AD131EC153000AD0F6 /* ConvUtils.cpp */; }; @@ -1034,7 +994,6 @@ F5E1132714357B6500175026 /* GUIDialogPeripheralManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1131614357B6500175026 /* GUIDialogPeripheralManager.cpp */; }; F5E1132814357B6500175026 /* GUIDialogPeripheralSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1131814357B6500175026 /* GUIDialogPeripheralSettings.cpp */; }; F5E1132914357B6500175026 /* Peripherals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1131A14357B6500175026 /* Peripherals.cpp */; }; - F5E113AD1435882400175026 /* pyrendercapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E113AC1435882400175026 /* pyrendercapture.cpp */; }; F5E6209F13E9081400D5F2CD /* InfoBool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E6209D13E9081400D5F2CD /* InfoBool.cpp */; }; F5ED8D931551FAEA00842059 /* BlurayDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5ED8D911551FAEA00842059 /* BlurayDirectory.cpp */; }; F5ED90C91553994800842059 /* XBMCTinyXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5ED90C71553994800842059 /* XBMCTinyXML.cpp */; }; @@ -1042,7 +1001,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1830215F13B8E35300770920 /* controledit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controledit.cpp; sourceTree = "<group>"; }; 18404DFC1396C44F00863BBA /* SlingboxLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = SlingboxLib.a; path = lib/SlingboxLib/SlingboxLib.a; sourceTree = "<group>"; }; 1840B792139968DB007C848B /* JSONVariantParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantParser.cpp; sourceTree = "<group>"; }; 1840B793139968DB007C848B /* JSONVariantParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantParser.h; sourceTree = "<group>"; }; @@ -1118,10 +1076,6 @@ 8D576316048677EA00EA77CD /* XBMC.frappliance */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XBMC.frappliance; sourceTree = BUILT_PRODUCTS_DIR; }; C807119D135DB842002F601B /* InputOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputOperations.cpp; sourceTree = "<group>"; }; C807119E135DB842002F601B /* InputOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputOperations.h; sourceTree = "<group>"; }; - C893605E152C86EC00812418 /* PythonMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonMonitor.cpp; sourceTree = "<group>"; }; - C893605F152C86EC00812418 /* PythonMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonMonitor.h; sourceTree = "<group>"; }; - C8936061152C86F500812418 /* monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = monitor.cpp; sourceTree = "<group>"; }; - C8936062152C86F500812418 /* monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = monitor.h; sourceTree = "<group>"; }; C8B92A7515735D0300284190 /* Epg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Epg.cpp; sourceTree = "<group>"; }; C8B92A7615735D0300284190 /* Epg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Epg.h; sourceTree = "<group>"; }; C8B92A7715735D0300284190 /* EpgContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EpgContainer.cpp; sourceTree = "<group>"; }; @@ -1226,6 +1180,73 @@ DF08E84415829BA600058C77 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; DF0DF16A13A3AF82008ED511 /* NFSDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NFSDirectory.cpp; sourceTree = "<group>"; }; DF0DF16B13A3AF82008ED511 /* NFSDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFSDirectory.h; sourceTree = "<group>"; }; + DF1AD01615FCE5C600E10810 /* AddonModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1AD01A15FCE5C600E10810 /* AddonModuleXbmcaddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcaddon.cpp; sourceTree = "<group>"; }; + DF1AD01E15FCE5C600E10810 /* AddonModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1AD02215FCE5C600E10810 /* AddonModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1AD02615FCE5C600E10810 /* AddonModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD02E15FCE62E00E10810 /* Addon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Addon.cpp; sourceTree = "<group>"; }; + DF1AD02F15FCE62E00E10810 /* Addon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Addon.h; sourceTree = "<group>"; }; + DF1AD03215FCE62E00E10810 /* AddonCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallback.cpp; sourceTree = "<group>"; }; + DF1AD03315FCE62E00E10810 /* AddonCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallback.h; sourceTree = "<group>"; }; + DF1AD03615FCE62E00E10810 /* AddonClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonClass.cpp; sourceTree = "<group>"; }; + DF1AD03715FCE62E00E10810 /* AddonClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonClass.h; sourceTree = "<group>"; }; + DF1AD03A15FCE62E00E10810 /* AddonString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonString.h; sourceTree = "<group>"; }; + DF1AD03B15FCE62E00E10810 /* AddonUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonUtils.cpp; sourceTree = "<group>"; }; + DF1AD03C15FCE62E00E10810 /* AddonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonUtils.h; sourceTree = "<group>"; }; + DF1AD03F15FCE62E00E10810 /* Alternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alternative.h; sourceTree = "<group>"; }; + DF1AD04015FCE62E00E10810 /* aojsonrpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aojsonrpc.h; sourceTree = "<group>"; }; + DF1AD04115FCE62E00E10810 /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; }; + DF1AD04215FCE62E00E10810 /* CallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackFunction.h; sourceTree = "<group>"; }; + DF1AD04515FCE62E00E10810 /* CallbackHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackHandler.cpp; sourceTree = "<group>"; }; + DF1AD04615FCE62E00E10810 /* CallbackHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackHandler.h; sourceTree = "<group>"; }; + DF1AD04915FCE62E00E10810 /* Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Control.cpp; sourceTree = "<group>"; }; + DF1AD04A15FCE62E00E10810 /* Control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Control.h; sourceTree = "<group>"; }; + DF1AD04D15FCE62E00E10810 /* Dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dialog.cpp; sourceTree = "<group>"; }; + DF1AD04E15FCE62E00E10810 /* Dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dialog.h; sourceTree = "<group>"; }; + DF1AD05115FCE62E00E10810 /* Dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dictionary.h; sourceTree = "<group>"; }; + DF1AD05215FCE62E00E10810 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; + DF1AD05315FCE62E00E10810 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; + DF1AD05415FCE62E00E10810 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; + DF1AD05715FCE62E00E10810 /* InfoTagMusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagMusic.cpp; sourceTree = "<group>"; }; + DF1AD05815FCE62E00E10810 /* InfoTagMusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagMusic.h; sourceTree = "<group>"; }; + DF1AD05B15FCE62E00E10810 /* InfoTagVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagVideo.cpp; sourceTree = "<group>"; }; + DF1AD05C15FCE62E00E10810 /* InfoTagVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagVideo.h; sourceTree = "<group>"; }; + DF1AD05F15FCE62E00E10810 /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = "<group>"; }; + DF1AD06015FCE62E00E10810 /* Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Keyboard.h; sourceTree = "<group>"; }; + DF1AD06315FCE62E00E10810 /* LanguageHook.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageHook.cpp; sourceTree = "<group>"; }; + DF1AD06415FCE62E00E10810 /* LanguageHook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageHook.h; sourceTree = "<group>"; }; + DF1AD06815FCE62E00E10810 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = "<group>"; }; + DF1AD06915FCE62E00E10810 /* ListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListItem.cpp; sourceTree = "<group>"; }; + DF1AD06A15FCE62E00E10810 /* ListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListItem.h; sourceTree = "<group>"; }; + DF1AD06E15FCE62E00E10810 /* ModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1AD06F15FCE62E00E10810 /* ModuleXbmc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmc.h; sourceTree = "<group>"; }; + DF1AD07215FCE62E00E10810 /* ModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1AD07315FCE62E00E10810 /* ModuleXbmcgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcgui.h; sourceTree = "<group>"; }; + DF1AD07615FCE62E00E10810 /* ModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1AD07715FCE62E00E10810 /* ModuleXbmcplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcplugin.h; sourceTree = "<group>"; }; + DF1AD07A15FCE62E00E10810 /* ModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD07B15FCE62E00E10810 /* ModuleXbmcvfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcvfs.h; sourceTree = "<group>"; }; + DF1AD07E15FCE62E00E10810 /* Monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Monitor.cpp; sourceTree = "<group>"; }; + DF1AD07F15FCE62E00E10810 /* Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Monitor.h; sourceTree = "<group>"; }; + DF1AD08215FCE62E00E10810 /* Player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Player.cpp; sourceTree = "<group>"; }; + DF1AD08315FCE62E00E10810 /* Player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Player.h; sourceTree = "<group>"; }; + DF1AD08615FCE62E00E10810 /* PlayList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayList.cpp; sourceTree = "<group>"; }; + DF1AD08715FCE62E00E10810 /* PlayList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayList.h; sourceTree = "<group>"; }; + DF1AD08A15FCE62E00E10810 /* RenderCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCapture.h; sourceTree = "<group>"; }; + DF1AD08B15FCE62E00E10810 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; }; + DF1AD08E15FCE62E00E10810 /* swighelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swighelper.h; sourceTree = "<group>"; }; + DF1AD08F15FCE62E00E10810 /* Tuple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tuple.h; sourceTree = "<group>"; }; + DF1AD09015FCE62E00E10810 /* Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window.cpp; sourceTree = "<group>"; }; + DF1AD09115FCE62E00E10810 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = "<group>"; }; + DF1AD09415FCE62E00E10810 /* WindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialog.cpp; sourceTree = "<group>"; }; + DF1AD09515FCE62E00E10810 /* WindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialog.h; sourceTree = "<group>"; }; + DF1AD09815FCE62E00E10810 /* WindowDialogMixin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialogMixin.cpp; sourceTree = "<group>"; }; + DF1AD09915FCE62E00E10810 /* WindowDialogMixin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialogMixin.h; sourceTree = "<group>"; }; + DF1AD09C15FCE62E00E10810 /* WindowException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowException.h; sourceTree = "<group>"; }; + DF1AD09D15FCE62E00E10810 /* WindowInterceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowInterceptor.h; sourceTree = "<group>"; }; + DF1AD09E15FCE62E00E10810 /* WindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowXML.cpp; sourceTree = "<group>"; }; + DF1AD09F15FCE62E00E10810 /* WindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowXML.h; sourceTree = "<group>"; }; DF23460715FA671900A934F6 /* UPnP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnP.cpp; sourceTree = "<group>"; }; DF23460815FA671900A934F6 /* UPnP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnP.h; sourceTree = "<group>"; }; DF23460915FA671900A934F6 /* UPnPInternal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPInternal.cpp; sourceTree = "<group>"; }; @@ -1234,6 +1255,7 @@ DF23460C15FA671900A934F6 /* UPnPRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnPRenderer.h; sourceTree = "<group>"; }; DF23460D15FA671900A934F6 /* UPnPServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPServer.cpp; sourceTree = "<group>"; }; DF23460E15FA671900A934F6 /* UPnPServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnPServer.h; sourceTree = "<group>"; }; + DF294E7815DAD78E004FDDEC /* addonbindings.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = addonbindings.a; path = xbmc/interfaces/addonbindings.a; sourceTree = "<group>"; }; DF33C2A215509C1B0046CDCB /* XbmcContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XbmcContext.cpp; sourceTree = "<group>"; }; DF33C2A315509C1B0046CDCB /* XbmcContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XbmcContext.h; sourceTree = "<group>"; }; DF33C2AB15509C5A0046CDCB /* ilog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ilog.cpp; sourceTree = "<group>"; }; @@ -2379,64 +2401,6 @@ F56C7560131EC152000AD0F6 /* XBMC_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_keysym.h; sourceTree = "<group>"; }; F56C7561131EC152000AD0F6 /* XBMC_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_mouse.h; sourceTree = "<group>"; }; F56C7562131EC152000AD0F6 /* XBMC_vkeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_vkeys.h; sourceTree = "<group>"; }; - F56C7567131EC152000AD0F6 /* xbmcvfsmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcvfsmodule.cpp; sourceTree = "<group>"; }; - F56C7568131EC152000AD0F6 /* PythonAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonAddon.cpp; sourceTree = "<group>"; }; - F56C7569131EC152000AD0F6 /* PythonAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonAddon.h; sourceTree = "<group>"; }; - F56C756A131EC152000AD0F6 /* xbmcaddonmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcaddonmodule.cpp; sourceTree = "<group>"; }; - F56C756B131EC152000AD0F6 /* controlslider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlslider.cpp; sourceTree = "<group>"; }; - F56C756C131EC152000AD0F6 /* controlradiobutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlradiobutton.cpp; sourceTree = "<group>"; }; - F56C756D131EC152000AD0F6 /* action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = action.cpp; sourceTree = "<group>"; }; - F56C756E131EC152000AD0F6 /* action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = action.h; sourceTree = "<group>"; }; - F56C756F131EC152000AD0F6 /* control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = control.cpp; sourceTree = "<group>"; }; - F56C7570131EC152000AD0F6 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = control.h; sourceTree = "<group>"; }; - F56C7571131EC152000AD0F6 /* controlbutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlbutton.cpp; sourceTree = "<group>"; }; - F56C7572131EC152000AD0F6 /* controlcheckmark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlcheckmark.cpp; sourceTree = "<group>"; }; - F56C7573131EC152000AD0F6 /* controlfadelabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlfadelabel.cpp; sourceTree = "<group>"; }; - F56C7574131EC152000AD0F6 /* controlgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlgroup.cpp; sourceTree = "<group>"; }; - F56C7575131EC152000AD0F6 /* controlimage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlimage.cpp; sourceTree = "<group>"; }; - F56C7576131EC152000AD0F6 /* controllabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllabel.cpp; sourceTree = "<group>"; }; - F56C7577131EC152000AD0F6 /* controllist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllist.cpp; sourceTree = "<group>"; }; - F56C7578131EC152000AD0F6 /* controlprogress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlprogress.cpp; sourceTree = "<group>"; }; - F56C7579131EC152000AD0F6 /* controlspin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlspin.cpp; sourceTree = "<group>"; }; - F56C757A131EC152000AD0F6 /* controltextbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controltextbox.cpp; sourceTree = "<group>"; }; - F56C757B131EC152000AD0F6 /* dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialog.cpp; sourceTree = "<group>"; }; - F56C757C131EC152000AD0F6 /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialog.h; sourceTree = "<group>"; }; - F56C757D131EC152000AD0F6 /* GUIPythonWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindow.cpp; sourceTree = "<group>"; }; - F56C757E131EC152000AD0F6 /* GUIPythonWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindow.h; sourceTree = "<group>"; }; - F56C757F131EC152000AD0F6 /* GUIPythonWindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowDialog.cpp; sourceTree = "<group>"; }; - F56C7580131EC152000AD0F6 /* GUIPythonWindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowDialog.h; sourceTree = "<group>"; }; - F56C7581131EC152000AD0F6 /* GUIPythonWindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXML.cpp; sourceTree = "<group>"; }; - F56C7582131EC152000AD0F6 /* GUIPythonWindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXML.h; sourceTree = "<group>"; }; - F56C7583131EC152000AD0F6 /* GUIPythonWindowXMLDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXMLDialog.cpp; sourceTree = "<group>"; }; - F56C7584131EC152000AD0F6 /* GUIPythonWindowXMLDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXMLDialog.h; sourceTree = "<group>"; }; - F56C7585131EC152000AD0F6 /* infotagmusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagmusic.cpp; sourceTree = "<group>"; }; - F56C7586131EC152000AD0F6 /* infotagmusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagmusic.h; sourceTree = "<group>"; }; - F56C7587131EC152000AD0F6 /* infotagvideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagvideo.cpp; sourceTree = "<group>"; }; - F56C7588131EC152000AD0F6 /* infotagvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagvideo.h; sourceTree = "<group>"; }; - F56C7589131EC152000AD0F6 /* keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = keyboard.cpp; sourceTree = "<group>"; }; - F56C758A131EC152000AD0F6 /* keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboard.h; sourceTree = "<group>"; }; - F56C758B131EC152000AD0F6 /* listitem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listitem.cpp; sourceTree = "<group>"; }; - F56C758C131EC152000AD0F6 /* listitem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = listitem.h; sourceTree = "<group>"; }; - F56C758D131EC152000AD0F6 /* player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player.cpp; sourceTree = "<group>"; }; - F56C758E131EC152000AD0F6 /* player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player.h; sourceTree = "<group>"; }; - F56C758F131EC152000AD0F6 /* pyplaylist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyplaylist.cpp; sourceTree = "<group>"; }; - F56C7590131EC152000AD0F6 /* pyplaylist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyplaylist.h; sourceTree = "<group>"; }; - F56C7591131EC152000AD0F6 /* PythonPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonPlayer.cpp; sourceTree = "<group>"; }; - F56C7592131EC152000AD0F6 /* PythonPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonPlayer.h; sourceTree = "<group>"; }; - F56C7593131EC152000AD0F6 /* pyutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyutil.cpp; sourceTree = "<group>"; }; - F56C7594131EC152000AD0F6 /* pyutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyutil.h; sourceTree = "<group>"; }; - F56C7595131EC152000AD0F6 /* window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = window.cpp; sourceTree = "<group>"; }; - F56C7596131EC152000AD0F6 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = window.h; sourceTree = "<group>"; }; - F56C7597131EC152000AD0F6 /* winxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxml.cpp; sourceTree = "<group>"; }; - F56C7598131EC152000AD0F6 /* winxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winxml.h; sourceTree = "<group>"; }; - F56C7599131EC152000AD0F6 /* winxmldialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxmldialog.cpp; sourceTree = "<group>"; }; - F56C759A131EC152000AD0F6 /* xbmcguimodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcguimodule.cpp; sourceTree = "<group>"; }; - F56C759B131EC152000AD0F6 /* xbmcmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcmodule.cpp; sourceTree = "<group>"; }; - F56C759C131EC152000AD0F6 /* xbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcplugin.cpp; sourceTree = "<group>"; }; - F56C759D131EC152000AD0F6 /* XBPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPython.cpp; sourceTree = "<group>"; }; - F56C759E131EC152000AD0F6 /* XBPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPython.h; sourceTree = "<group>"; }; - F56C75A1131EC152000AD0F6 /* XBPyThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPyThread.cpp; sourceTree = "<group>"; }; - F56C75A2131EC152000AD0F6 /* XBPyThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPyThread.h; sourceTree = "<group>"; }; F56C75A3131EC152000AD0F6 /* AnnouncementManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnnouncementManager.cpp; sourceTree = "<group>"; }; F56C75A4131EC152000AD0F6 /* AnnouncementManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnouncementManager.h; sourceTree = "<group>"; }; F56C75A5131EC153000AD0F6 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Builtins.cpp; sourceTree = "<group>"; }; @@ -3237,8 +3201,6 @@ F5E1131A14357B6500175026 /* Peripherals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Peripherals.cpp; sourceTree = "<group>"; }; F5E1131B14357B6500175026 /* Peripherals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Peripherals.h; sourceTree = "<group>"; }; F5E1131C14357B6500175026 /* PeripheralTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralTypes.h; sourceTree = "<group>"; }; - F5E113AC1435882400175026 /* pyrendercapture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyrendercapture.cpp; sourceTree = "<group>"; }; - F5E113AE1435882900175026 /* pyrendercapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyrendercapture.h; sourceTree = "<group>"; }; F5E6209D13E9081400D5F2CD /* InfoBool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoBool.cpp; sourceTree = "<group>"; }; F5E6209E13E9081400D5F2CD /* InfoBool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoBool.h; sourceTree = "<group>"; }; F5ED8D911551FAEA00842059 /* BlurayDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlurayDirectory.cpp; sourceTree = "<group>"; }; @@ -3276,6 +3238,7 @@ F56B161B12CD69DB009B4C96 /* ImageIO.framework in Frameworks */, 4D5D2E131301753F006ABC13 /* CFNetwork.framework in Frameworks */, 18404DFD1396C44F00863BBA /* SlingboxLib.a in Frameworks */, + DF294E7915DAD78E004FDDEC /* addonbindings.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3449,6 +3412,96 @@ path = windows; sourceTree = "<group>"; }; + DF1AD01415FCE5AF00E10810 /* python */ = { + isa = PBXGroup; + children = ( + DF1AD01515FCE5C600E10810 /* generated */, + ); + name = python; + sourceTree = "<group>"; + }; + DF1AD01515FCE5C600E10810 /* generated */ = { + isa = PBXGroup; + children = ( + DF1AD01615FCE5C600E10810 /* AddonModuleXbmc.cpp */, + DF1AD01A15FCE5C600E10810 /* AddonModuleXbmcaddon.cpp */, + DF1AD01E15FCE5C600E10810 /* AddonModuleXbmcgui.cpp */, + DF1AD02215FCE5C600E10810 /* AddonModuleXbmcplugin.cpp */, + DF1AD02615FCE5C600E10810 /* AddonModuleXbmcvfs.cpp */, + ); + name = generated; + path = python/generated; + sourceTree = "<group>"; + }; + DF1AD02D15FCE62E00E10810 /* legacy */ = { + isa = PBXGroup; + children = ( + DF1AD02E15FCE62E00E10810 /* Addon.cpp */, + DF1AD02F15FCE62E00E10810 /* Addon.h */, + DF1AD03215FCE62E00E10810 /* AddonCallback.cpp */, + DF1AD03315FCE62E00E10810 /* AddonCallback.h */, + DF1AD03615FCE62E00E10810 /* AddonClass.cpp */, + DF1AD03715FCE62E00E10810 /* AddonClass.h */, + DF1AD03A15FCE62E00E10810 /* AddonString.h */, + DF1AD03B15FCE62E00E10810 /* AddonUtils.cpp */, + DF1AD03C15FCE62E00E10810 /* AddonUtils.h */, + DF1AD03F15FCE62E00E10810 /* Alternative.h */, + DF1AD04015FCE62E00E10810 /* aojsonrpc.h */, + DF1AD04115FCE62E00E10810 /* CallbackFunction.cpp */, + DF1AD04215FCE62E00E10810 /* CallbackFunction.h */, + DF1AD04515FCE62E00E10810 /* CallbackHandler.cpp */, + DF1AD04615FCE62E00E10810 /* CallbackHandler.h */, + DF1AD04915FCE62E00E10810 /* Control.cpp */, + DF1AD04A15FCE62E00E10810 /* Control.h */, + DF1AD04D15FCE62E00E10810 /* Dialog.cpp */, + DF1AD04E15FCE62E00E10810 /* Dialog.h */, + DF1AD05115FCE62E00E10810 /* Dictionary.h */, + DF1AD05215FCE62E00E10810 /* Exception.h */, + DF1AD05315FCE62E00E10810 /* File.cpp */, + DF1AD05415FCE62E00E10810 /* File.h */, + DF1AD05715FCE62E00E10810 /* InfoTagMusic.cpp */, + DF1AD05815FCE62E00E10810 /* InfoTagMusic.h */, + DF1AD05B15FCE62E00E10810 /* InfoTagVideo.cpp */, + DF1AD05C15FCE62E00E10810 /* InfoTagVideo.h */, + DF1AD05F15FCE62E00E10810 /* Keyboard.cpp */, + DF1AD06015FCE62E00E10810 /* Keyboard.h */, + DF1AD06315FCE62E00E10810 /* LanguageHook.cpp */, + DF1AD06415FCE62E00E10810 /* LanguageHook.h */, + DF1AD06815FCE62E00E10810 /* List.h */, + DF1AD06915FCE62E00E10810 /* ListItem.cpp */, + DF1AD06A15FCE62E00E10810 /* ListItem.h */, + DF1AD06E15FCE62E00E10810 /* ModuleXbmc.cpp */, + DF1AD06F15FCE62E00E10810 /* ModuleXbmc.h */, + DF1AD07215FCE62E00E10810 /* ModuleXbmcgui.cpp */, + DF1AD07315FCE62E00E10810 /* ModuleXbmcgui.h */, + DF1AD07615FCE62E00E10810 /* ModuleXbmcplugin.cpp */, + DF1AD07715FCE62E00E10810 /* ModuleXbmcplugin.h */, + DF1AD07A15FCE62E00E10810 /* ModuleXbmcvfs.cpp */, + DF1AD07B15FCE62E00E10810 /* ModuleXbmcvfs.h */, + DF1AD07E15FCE62E00E10810 /* Monitor.cpp */, + DF1AD07F15FCE62E00E10810 /* Monitor.h */, + DF1AD08215FCE62E00E10810 /* Player.cpp */, + DF1AD08315FCE62E00E10810 /* Player.h */, + DF1AD08615FCE62E00E10810 /* PlayList.cpp */, + DF1AD08715FCE62E00E10810 /* PlayList.h */, + DF1AD08A15FCE62E00E10810 /* RenderCapture.h */, + DF1AD08B15FCE62E00E10810 /* String.cpp */, + DF1AD08E15FCE62E00E10810 /* swighelper.h */, + DF1AD08F15FCE62E00E10810 /* Tuple.h */, + DF1AD09015FCE62E00E10810 /* Window.cpp */, + DF1AD09115FCE62E00E10810 /* Window.h */, + DF1AD09415FCE62E00E10810 /* WindowDialog.cpp */, + DF1AD09515FCE62E00E10810 /* WindowDialog.h */, + DF1AD09815FCE62E00E10810 /* WindowDialogMixin.cpp */, + DF1AD09915FCE62E00E10810 /* WindowDialogMixin.h */, + DF1AD09C15FCE62E00E10810 /* WindowException.h */, + DF1AD09D15FCE62E00E10810 /* WindowInterceptor.h */, + DF1AD09E15FCE62E00E10810 /* WindowXML.cpp */, + DF1AD09F15FCE62E00E10810 /* WindowXML.h */, + ); + path = legacy; + sourceTree = "<group>"; + }; DF23460515FA671900A934F6 /* upnp */ = { isa = PBXGroup; children = ( @@ -5146,7 +5199,8 @@ F5AE40E5134175160004BD79 /* http-api */, F5E6209C13E9081400D5F2CD /* info */, F5AE40EC1341751E0004BD79 /* json-rpc */, - F56C7564131EC152000AD0F6 /* python */, + DF1AD02D15FCE62E00E10810 /* legacy */, + DF1AD01415FCE5AF00E10810 /* python */, F56C75A3131EC152000AD0F6 /* AnnouncementManager.cpp */, F56C75A4131EC152000AD0F6 /* AnnouncementManager.h */, F56C75A5131EC153000AD0F6 /* Builtins.cpp */, @@ -5156,86 +5210,6 @@ path = interfaces; sourceTree = "<group>"; }; - F56C7564131EC152000AD0F6 /* python */ = { - isa = PBXGroup; - children = ( - F56C7566131EC152000AD0F6 /* xbmcmodule */, - F56C759D131EC152000AD0F6 /* XBPython.cpp */, - F56C759E131EC152000AD0F6 /* XBPython.h */, - F56C75A1131EC152000AD0F6 /* XBPyThread.cpp */, - F56C75A2131EC152000AD0F6 /* XBPyThread.h */, - ); - path = python; - sourceTree = "<group>"; - }; - F56C7566131EC152000AD0F6 /* xbmcmodule */ = { - isa = PBXGroup; - children = ( - F56C756D131EC152000AD0F6 /* action.cpp */, - F56C756E131EC152000AD0F6 /* action.h */, - F56C756F131EC152000AD0F6 /* control.cpp */, - F56C7570131EC152000AD0F6 /* control.h */, - F56C7571131EC152000AD0F6 /* controlbutton.cpp */, - F56C7572131EC152000AD0F6 /* controlcheckmark.cpp */, - 1830215F13B8E35300770920 /* controledit.cpp */, - F56C7573131EC152000AD0F6 /* controlfadelabel.cpp */, - F56C7574131EC152000AD0F6 /* controlgroup.cpp */, - F56C7575131EC152000AD0F6 /* controlimage.cpp */, - F56C7576131EC152000AD0F6 /* controllabel.cpp */, - F56C7577131EC152000AD0F6 /* controllist.cpp */, - F56C7578131EC152000AD0F6 /* controlprogress.cpp */, - F56C756C131EC152000AD0F6 /* controlradiobutton.cpp */, - F56C756B131EC152000AD0F6 /* controlslider.cpp */, - F56C7579131EC152000AD0F6 /* controlspin.cpp */, - F56C757A131EC152000AD0F6 /* controltextbox.cpp */, - F56C757B131EC152000AD0F6 /* dialog.cpp */, - F56C757C131EC152000AD0F6 /* dialog.h */, - F56C757D131EC152000AD0F6 /* GUIPythonWindow.cpp */, - F56C757E131EC152000AD0F6 /* GUIPythonWindow.h */, - F56C757F131EC152000AD0F6 /* GUIPythonWindowDialog.cpp */, - F56C7580131EC152000AD0F6 /* GUIPythonWindowDialog.h */, - F56C7581131EC152000AD0F6 /* GUIPythonWindowXML.cpp */, - F56C7582131EC152000AD0F6 /* GUIPythonWindowXML.h */, - F56C7583131EC152000AD0F6 /* GUIPythonWindowXMLDialog.cpp */, - F56C7584131EC152000AD0F6 /* GUIPythonWindowXMLDialog.h */, - F56C7585131EC152000AD0F6 /* infotagmusic.cpp */, - F56C7586131EC152000AD0F6 /* infotagmusic.h */, - F56C7587131EC152000AD0F6 /* infotagvideo.cpp */, - F56C7588131EC152000AD0F6 /* infotagvideo.h */, - F56C7589131EC152000AD0F6 /* keyboard.cpp */, - F56C758A131EC152000AD0F6 /* keyboard.h */, - F56C758B131EC152000AD0F6 /* listitem.cpp */, - F56C758C131EC152000AD0F6 /* listitem.h */, - C8936061152C86F500812418 /* monitor.cpp */, - C8936062152C86F500812418 /* monitor.h */, - F56C758D131EC152000AD0F6 /* player.cpp */, - F56C758E131EC152000AD0F6 /* player.h */, - F56C758F131EC152000AD0F6 /* pyplaylist.cpp */, - F56C7590131EC152000AD0F6 /* pyplaylist.h */, - F5E113AC1435882400175026 /* pyrendercapture.cpp */, - F5E113AE1435882900175026 /* pyrendercapture.h */, - F56C7568131EC152000AD0F6 /* PythonAddon.cpp */, - F56C7569131EC152000AD0F6 /* PythonAddon.h */, - C893605E152C86EC00812418 /* PythonMonitor.cpp */, - C893605F152C86EC00812418 /* PythonMonitor.h */, - F56C7591131EC152000AD0F6 /* PythonPlayer.cpp */, - F56C7592131EC152000AD0F6 /* PythonPlayer.h */, - F56C7593131EC152000AD0F6 /* pyutil.cpp */, - F56C7594131EC152000AD0F6 /* pyutil.h */, - F56C7595131EC152000AD0F6 /* window.cpp */, - F56C7596131EC152000AD0F6 /* window.h */, - F56C7597131EC152000AD0F6 /* winxml.cpp */, - F56C7598131EC152000AD0F6 /* winxml.h */, - F56C7599131EC152000AD0F6 /* winxmldialog.cpp */, - F56C756A131EC152000AD0F6 /* xbmcaddonmodule.cpp */, - F56C759A131EC152000AD0F6 /* xbmcguimodule.cpp */, - F56C759B131EC152000AD0F6 /* xbmcmodule.cpp */, - F56C759C131EC152000AD0F6 /* xbmcplugin.cpp */, - F56C7567131EC152000AD0F6 /* xbmcvfsmodule.cpp */, - ); - path = xbmcmodule; - sourceTree = "<group>"; - }; F56C75A8131EC153000AD0F6 /* linux */ = { isa = PBXGroup; children = ( @@ -6399,6 +6373,7 @@ F589AE6D12890B6700D8079E /* Internal Libs */ = { isa = PBXGroup; children = ( + DF294E7815DAD78E004FDDEC /* addonbindings.a */, F589AE7012890B9E00D8079E /* libapetag.a */, F589AE7E12890BEF00D8079E /* librtv.a */, F589AE7D12890BEF00D8079E /* libsquish.a */, @@ -7066,44 +7041,6 @@ F56C7A47131EC155000AD0F6 /* KeyboardStat.cpp in Sources */, F56C7A48131EC155000AD0F6 /* MouseStat.cpp in Sources */, F56C7A49131EC155000AD0F6 /* SDLJoystick.cpp in Sources */, - F56C7A4B131EC155000AD0F6 /* xbmcvfsmodule.cpp in Sources */, - F56C7A4C131EC155000AD0F6 /* PythonAddon.cpp in Sources */, - F56C7A4D131EC155000AD0F6 /* xbmcaddonmodule.cpp in Sources */, - F56C7A4E131EC155000AD0F6 /* controlslider.cpp in Sources */, - F56C7A4F131EC155000AD0F6 /* controlradiobutton.cpp in Sources */, - F56C7A50131EC155000AD0F6 /* action.cpp in Sources */, - F56C7A51131EC155000AD0F6 /* control.cpp in Sources */, - F56C7A52131EC155000AD0F6 /* controlbutton.cpp in Sources */, - F56C7A53131EC155000AD0F6 /* controlcheckmark.cpp in Sources */, - F56C7A54131EC155000AD0F6 /* controlfadelabel.cpp in Sources */, - F56C7A55131EC155000AD0F6 /* controlgroup.cpp in Sources */, - F56C7A56131EC155000AD0F6 /* controlimage.cpp in Sources */, - F56C7A57131EC155000AD0F6 /* controllabel.cpp in Sources */, - F56C7A58131EC155000AD0F6 /* controllist.cpp in Sources */, - F56C7A59131EC155000AD0F6 /* controlprogress.cpp in Sources */, - F56C7A5A131EC155000AD0F6 /* controlspin.cpp in Sources */, - F56C7A5B131EC155000AD0F6 /* controltextbox.cpp in Sources */, - F56C7A5C131EC155000AD0F6 /* dialog.cpp in Sources */, - F56C7A5D131EC155000AD0F6 /* GUIPythonWindow.cpp in Sources */, - F56C7A5E131EC155000AD0F6 /* GUIPythonWindowDialog.cpp in Sources */, - F56C7A5F131EC155000AD0F6 /* GUIPythonWindowXML.cpp in Sources */, - F56C7A60131EC155000AD0F6 /* GUIPythonWindowXMLDialog.cpp in Sources */, - F56C7A61131EC155000AD0F6 /* infotagmusic.cpp in Sources */, - F56C7A62131EC155000AD0F6 /* infotagvideo.cpp in Sources */, - F56C7A63131EC155000AD0F6 /* keyboard.cpp in Sources */, - F56C7A64131EC155000AD0F6 /* listitem.cpp in Sources */, - F56C7A65131EC155000AD0F6 /* player.cpp in Sources */, - F56C7A66131EC155000AD0F6 /* pyplaylist.cpp in Sources */, - F56C7A67131EC155000AD0F6 /* PythonPlayer.cpp in Sources */, - F56C7A68131EC155000AD0F6 /* pyutil.cpp in Sources */, - F56C7A69131EC155000AD0F6 /* window.cpp in Sources */, - F56C7A6A131EC155000AD0F6 /* winxml.cpp in Sources */, - F56C7A6B131EC155000AD0F6 /* winxmldialog.cpp in Sources */, - F56C7A6C131EC155000AD0F6 /* xbmcguimodule.cpp in Sources */, - F56C7A6D131EC155000AD0F6 /* xbmcmodule.cpp in Sources */, - F56C7A6E131EC155000AD0F6 /* xbmcplugin.cpp in Sources */, - F56C7A6F131EC155000AD0F6 /* XBPython.cpp in Sources */, - F56C7A71131EC155000AD0F6 /* XBPyThread.cpp in Sources */, F56C7A72131EC155000AD0F6 /* AnnouncementManager.cpp in Sources */, F56C7A73131EC155000AD0F6 /* Builtins.cpp in Sources */, F56C7A75131EC155000AD0F6 /* ConvUtils.cpp in Sources */, @@ -7469,7 +7406,6 @@ 7C0A7FCC13A9E76E00AFC2BD /* GUIWindowDebugInfo.cpp in Sources */, DF0DF16D13A3AF82008ED511 /* NFSDirectory.cpp in Sources */, 7C89627013B702F3003631FE /* GUIWindowScreensaverDim.cpp in Sources */, - 1830216013B8E35300770920 /* controledit.cpp in Sources */, 18ECC9AA13CF17EB00A9ED6C /* StreamUtils.cpp in Sources */, F5CEE72C13D3F9AC00225F72 /* DVDOverlayCodecTX3G.cpp in Sources */, DFD4D22013D7286E00A47C47 /* Implementation.cpp in Sources */, @@ -7500,7 +7436,6 @@ F5E1132714357B6500175026 /* GUIDialogPeripheralManager.cpp in Sources */, F5E1132814357B6500175026 /* GUIDialogPeripheralSettings.cpp in Sources */, F5E1132914357B6500175026 /* Peripherals.cpp in Sources */, - F5E113AD1435882400175026 /* pyrendercapture.cpp in Sources */, F5BD033A148D4923001B5583 /* CryptThreading.cpp in Sources */, 7CCFD9AA1514952700211D82 /* PCMCodec.cpp in Sources */, DF527780151BAFD600B5B63B /* WebSocket.cpp in Sources */, @@ -7550,8 +7485,6 @@ DFDB004B1516408F005079A4 /* FileCache.cpp in Sources */, DFDB004C1516408F005079A4 /* MemBufferCache.cpp in Sources */, 7C1A89BB152671FB00C63311 /* TextureCacheJob.cpp in Sources */, - C8936060152C86EC00812418 /* PythonMonitor.cpp in Sources */, - C8936063152C86F500812418 /* monitor.cpp in Sources */, DFFD594F1506B6300088DE4B /* IOSEAGLView.mm in Sources */, DFFEFBDB151606CB001294DC /* IOSScreenManager.mm in Sources */, DFFEFC2215160927001294DC /* IOSExternalTouchController.mm in Sources */, @@ -7749,6 +7682,8 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces\"", + "\"$(SRCROOT)/xbmc/interfaces/legacy\"", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -7870,6 +7805,8 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces\"", + "\"$(SRCROOT)/xbmc/interfaces/legacy\"", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/XBMC-IOS.xcodeproj/project.pbxproj b/XBMC-IOS.xcodeproj/project.pbxproj index feb7adef09..a2938ce476 100644 --- a/XBMC-IOS.xcodeproj/project.pbxproj +++ b/XBMC-IOS.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 1830219E13B8E37300770920 /* controledit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1830219D13B8E37300770920 /* controledit.cpp */; }; 18404DD31396C3D200863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DD21396C3D200863BBA /* SlingboxLib.a */; }; 1840B77A1399616D007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B7761399616D007C848B /* JSONVariantParser.cpp */; }; 1840B77B1399616D007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B7781399616D007C848B /* JSONVariantWriter.cpp */; }; @@ -44,8 +43,6 @@ 7CCFD9991514950700211D82 /* PCMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCFD9971514950700211D82 /* PCMCodec.cpp */; }; 7CEE2E7F13D6B7D4000ABF2A /* TimeSmoother.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CEE2E7D13D6B7D4000ABF2A /* TimeSmoother.cpp */; }; C80711AD135DB85F002F601B /* InputOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C80711AB135DB85F002F601B /* InputOperations.cpp */; }; - C893606F152C870600812418 /* monitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C893606D152C870600812418 /* monitor.cpp */; }; - C8936072152C871400812418 /* PythonMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8936070152C871400812418 /* PythonMonitor.cpp */; }; C8B929D01573557B00284190 /* Epg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B929C31573557B00284190 /* Epg.cpp */; }; C8B929D11573557B00284190 /* EpgContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B929C51573557B00284190 /* EpgContainer.cpp */; }; C8B929D21573557B00284190 /* EpgDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8B929C71573557B00284190 /* EpgDatabase.cpp */; }; @@ -102,6 +99,7 @@ DF23462315FA675200A934F6 /* UPnPInternal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23461B15FA675200A934F6 /* UPnPInternal.cpp */; }; DF23462415FA675200A934F6 /* UPnPRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23461D15FA675200A934F6 /* UPnPRenderer.cpp */; }; DF23462515FA675200A934F6 /* UPnPServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF23461F15FA675200A934F6 /* UPnPServer.cpp */; }; + DF294E4015DACE94004FDDEC /* addonbindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DF294E3F15DACE94004FDDEC /* addonbindings.a */; }; DF2E329415509B2C000F5772 /* XbmcContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2E329215509B2C000F5772 /* XbmcContext.cpp */; }; DF33C29415509BF50046CDCB /* ilog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C29115509BF50046CDCB /* ilog.cpp */; }; DF3488F813FD961A0026A711 /* GUIAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF3488F613FD961A0026A711 /* GUIAction.cpp */; }; @@ -697,44 +695,6 @@ F56C8A31131F42ED000AD0F6 /* KeyboardStat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C853B131F42E9000AD0F6 /* KeyboardStat.cpp */; }; F56C8A32131F42ED000AD0F6 /* MouseStat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C853D131F42E9000AD0F6 /* MouseStat.cpp */; }; F56C8A33131F42ED000AD0F6 /* SDLJoystick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C853F131F42E9000AD0F6 /* SDLJoystick.cpp */; }; - F56C8A35131F42ED000AD0F6 /* xbmcvfsmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C854A131F42E9000AD0F6 /* xbmcvfsmodule.cpp */; }; - F56C8A36131F42ED000AD0F6 /* PythonAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C854B131F42E9000AD0F6 /* PythonAddon.cpp */; }; - F56C8A37131F42ED000AD0F6 /* xbmcaddonmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C854D131F42E9000AD0F6 /* xbmcaddonmodule.cpp */; }; - F56C8A38131F42ED000AD0F6 /* controlslider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C854E131F42E9000AD0F6 /* controlslider.cpp */; }; - F56C8A39131F42ED000AD0F6 /* controlradiobutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C854F131F42E9000AD0F6 /* controlradiobutton.cpp */; }; - F56C8A3A131F42ED000AD0F6 /* action.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8550131F42E9000AD0F6 /* action.cpp */; }; - F56C8A3B131F42ED000AD0F6 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8552131F42E9000AD0F6 /* control.cpp */; }; - F56C8A3C131F42ED000AD0F6 /* controlbutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8554131F42E9000AD0F6 /* controlbutton.cpp */; }; - F56C8A3D131F42ED000AD0F6 /* controlcheckmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8555131F42E9000AD0F6 /* controlcheckmark.cpp */; }; - F56C8A3E131F42ED000AD0F6 /* controlfadelabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8556131F42E9000AD0F6 /* controlfadelabel.cpp */; }; - F56C8A3F131F42ED000AD0F6 /* controlgroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8557131F42E9000AD0F6 /* controlgroup.cpp */; }; - F56C8A40131F42ED000AD0F6 /* controlimage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8558131F42E9000AD0F6 /* controlimage.cpp */; }; - F56C8A41131F42ED000AD0F6 /* controllabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8559131F42E9000AD0F6 /* controllabel.cpp */; }; - F56C8A42131F42ED000AD0F6 /* controllist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C855A131F42E9000AD0F6 /* controllist.cpp */; }; - F56C8A43131F42ED000AD0F6 /* controlprogress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C855B131F42E9000AD0F6 /* controlprogress.cpp */; }; - F56C8A44131F42ED000AD0F6 /* controlspin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C855C131F42E9000AD0F6 /* controlspin.cpp */; }; - F56C8A45131F42ED000AD0F6 /* controltextbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C855D131F42E9000AD0F6 /* controltextbox.cpp */; }; - F56C8A46131F42ED000AD0F6 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C855E131F42E9000AD0F6 /* dialog.cpp */; }; - F56C8A47131F42ED000AD0F6 /* GUIPythonWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8560131F42E9000AD0F6 /* GUIPythonWindow.cpp */; }; - F56C8A48131F42ED000AD0F6 /* GUIPythonWindowDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8562131F42E9000AD0F6 /* GUIPythonWindowDialog.cpp */; }; - F56C8A49131F42ED000AD0F6 /* GUIPythonWindowXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8564131F42EA000AD0F6 /* GUIPythonWindowXML.cpp */; }; - F56C8A4A131F42ED000AD0F6 /* GUIPythonWindowXMLDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8566131F42EA000AD0F6 /* GUIPythonWindowXMLDialog.cpp */; }; - F56C8A4B131F42ED000AD0F6 /* infotagmusic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8568131F42EA000AD0F6 /* infotagmusic.cpp */; }; - F56C8A4C131F42ED000AD0F6 /* infotagvideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C856A131F42EA000AD0F6 /* infotagvideo.cpp */; }; - F56C8A4D131F42ED000AD0F6 /* keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C856C131F42EA000AD0F6 /* keyboard.cpp */; }; - F56C8A4E131F42ED000AD0F6 /* listitem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C856E131F42EA000AD0F6 /* listitem.cpp */; }; - F56C8A4F131F42ED000AD0F6 /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8570131F42EA000AD0F6 /* player.cpp */; }; - F56C8A50131F42ED000AD0F6 /* pyplaylist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8572131F42EA000AD0F6 /* pyplaylist.cpp */; }; - F56C8A51131F42ED000AD0F6 /* PythonPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8574131F42EA000AD0F6 /* PythonPlayer.cpp */; }; - F56C8A52131F42ED000AD0F6 /* pyutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8576131F42EA000AD0F6 /* pyutil.cpp */; }; - F56C8A53131F42ED000AD0F6 /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8578131F42EA000AD0F6 /* window.cpp */; }; - F56C8A54131F42ED000AD0F6 /* winxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C857A131F42EA000AD0F6 /* winxml.cpp */; }; - F56C8A55131F42ED000AD0F6 /* winxmldialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C857C131F42EA000AD0F6 /* winxmldialog.cpp */; }; - F56C8A56131F42ED000AD0F6 /* xbmcguimodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C857D131F42EA000AD0F6 /* xbmcguimodule.cpp */; }; - F56C8A57131F42ED000AD0F6 /* xbmcmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C857E131F42EA000AD0F6 /* xbmcmodule.cpp */; }; - F56C8A58131F42ED000AD0F6 /* xbmcplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C857F131F42EA000AD0F6 /* xbmcplugin.cpp */; }; - F56C8A59131F42ED000AD0F6 /* XBPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8580131F42EA000AD0F6 /* XBPython.cpp */; }; - F56C8A5B131F42ED000AD0F6 /* XBPyThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8584131F42EA000AD0F6 /* XBPyThread.cpp */; }; F56C8A5C131F42ED000AD0F6 /* AnnouncementManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8586131F42EA000AD0F6 /* AnnouncementManager.cpp */; }; F56C8A5D131F42ED000AD0F6 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8588131F42EA000AD0F6 /* Builtins.cpp */; }; F56C8A5F131F42ED000AD0F6 /* ConvUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8590131F42EA000AD0F6 /* ConvUtils.cpp */; }; @@ -1024,7 +984,6 @@ F5B13DCF1334490D0045076D /* DarwinUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B13DCE1334490D0045076D /* DarwinUtils.mm */; }; F5BD034F148D496A001B5583 /* CryptThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5BD034D148D496A001B5583 /* CryptThreading.cpp */; }; F5CEE73013D3F9D100225F72 /* DVDOverlayCodecTX3G.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CEE72F13D3F9D100225F72 /* DVDOverlayCodecTX3G.cpp */; }; - F5E1127B14356C4600175026 /* pyrendercapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1127A14356C4600175026 /* pyrendercapture.cpp */; }; F5E112DB143577A000175026 /* PeripheralBusUSB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E112B2143577A000175026 /* PeripheralBusUSB.cpp */; }; F5E112DC143577A000175026 /* PeripheralBus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E112B4143577A000175026 /* PeripheralBus.cpp */; }; F5E112E0143577A000175026 /* Peripheral.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E112BD143577A000175026 /* Peripheral.cpp */; }; @@ -1045,7 +1004,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1830219D13B8E37300770920 /* controledit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controledit.cpp; sourceTree = "<group>"; }; 18404DD21396C3D200863BBA /* SlingboxLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = SlingboxLib.a; path = lib/SlingboxLib/SlingboxLib.a; sourceTree = "<group>"; }; 1840B7761399616D007C848B /* JSONVariantParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantParser.cpp; sourceTree = "<group>"; }; 1840B7771399616D007C848B /* JSONVariantParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantParser.h; sourceTree = "<group>"; }; @@ -1122,10 +1080,6 @@ 8D576316048677EA00EA77CD /* XBMC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XBMC.app; sourceTree = BUILT_PRODUCTS_DIR; }; C80711AB135DB85F002F601B /* InputOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputOperations.cpp; sourceTree = "<group>"; }; C80711AC135DB85F002F601B /* InputOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputOperations.h; sourceTree = "<group>"; }; - C893606D152C870600812418 /* monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = monitor.cpp; sourceTree = "<group>"; }; - C893606E152C870600812418 /* monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = monitor.h; sourceTree = "<group>"; }; - C8936070152C871400812418 /* PythonMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonMonitor.cpp; sourceTree = "<group>"; }; - C8936071152C871400812418 /* PythonMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonMonitor.h; sourceTree = "<group>"; }; C8B929C31573557B00284190 /* Epg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Epg.cpp; sourceTree = "<group>"; }; C8B929C41573557B00284190 /* Epg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Epg.h; sourceTree = "<group>"; }; C8B929C51573557B00284190 /* EpgContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EpgContainer.cpp; sourceTree = "<group>"; }; @@ -1232,6 +1186,73 @@ DF02A887153382A60084754E /* IOSKeyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSKeyboard.mm; sourceTree = "<group>"; }; DF0DF17D13A3AF9F008ED511 /* NFSDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NFSDirectory.cpp; sourceTree = "<group>"; }; DF0DF17E13A3AF9F008ED511 /* NFSDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFSDirectory.h; sourceTree = "<group>"; }; + DF1ACFF615FCE57C00E10810 /* AddonModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1ACFFA15FCE57C00E10810 /* AddonModuleXbmcaddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcaddon.cpp; sourceTree = "<group>"; }; + DF1ACFFE15FCE57C00E10810 /* AddonModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1AD00215FCE57C00E10810 /* AddonModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1AD00615FCE57C00E10810 /* AddonModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD10415FCE71000E10810 /* Addon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Addon.cpp; sourceTree = "<group>"; }; + DF1AD10515FCE71000E10810 /* Addon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Addon.h; sourceTree = "<group>"; }; + DF1AD10815FCE71000E10810 /* AddonCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallback.cpp; sourceTree = "<group>"; }; + DF1AD10915FCE71000E10810 /* AddonCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallback.h; sourceTree = "<group>"; }; + DF1AD10C15FCE71000E10810 /* AddonClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonClass.cpp; sourceTree = "<group>"; }; + DF1AD10D15FCE71000E10810 /* AddonClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonClass.h; sourceTree = "<group>"; }; + DF1AD11015FCE71000E10810 /* AddonString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonString.h; sourceTree = "<group>"; }; + DF1AD11115FCE71000E10810 /* AddonUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonUtils.cpp; sourceTree = "<group>"; }; + DF1AD11215FCE71000E10810 /* AddonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonUtils.h; sourceTree = "<group>"; }; + DF1AD11515FCE71000E10810 /* Alternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alternative.h; sourceTree = "<group>"; }; + DF1AD11615FCE71000E10810 /* aojsonrpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aojsonrpc.h; sourceTree = "<group>"; }; + DF1AD11715FCE71000E10810 /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; }; + DF1AD11815FCE71000E10810 /* CallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackFunction.h; sourceTree = "<group>"; }; + DF1AD11B15FCE71000E10810 /* CallbackHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackHandler.cpp; sourceTree = "<group>"; }; + DF1AD11C15FCE71000E10810 /* CallbackHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackHandler.h; sourceTree = "<group>"; }; + DF1AD11F15FCE71000E10810 /* Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Control.cpp; sourceTree = "<group>"; }; + DF1AD12015FCE71000E10810 /* Control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Control.h; sourceTree = "<group>"; }; + DF1AD12315FCE71000E10810 /* Dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dialog.cpp; sourceTree = "<group>"; }; + DF1AD12415FCE71000E10810 /* Dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dialog.h; sourceTree = "<group>"; }; + DF1AD12715FCE71000E10810 /* Dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dictionary.h; sourceTree = "<group>"; }; + DF1AD12815FCE71000E10810 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; + DF1AD12915FCE71000E10810 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; + DF1AD12A15FCE71000E10810 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; + DF1AD12D15FCE71000E10810 /* InfoTagMusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagMusic.cpp; sourceTree = "<group>"; }; + DF1AD12E15FCE71000E10810 /* InfoTagMusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagMusic.h; sourceTree = "<group>"; }; + DF1AD13115FCE71000E10810 /* InfoTagVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagVideo.cpp; sourceTree = "<group>"; }; + DF1AD13215FCE71000E10810 /* InfoTagVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagVideo.h; sourceTree = "<group>"; }; + DF1AD13515FCE71000E10810 /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = "<group>"; }; + DF1AD13615FCE71000E10810 /* Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Keyboard.h; sourceTree = "<group>"; }; + DF1AD13915FCE71000E10810 /* LanguageHook.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageHook.cpp; sourceTree = "<group>"; }; + DF1AD13A15FCE71000E10810 /* LanguageHook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageHook.h; sourceTree = "<group>"; }; + DF1AD13E15FCE71000E10810 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = "<group>"; }; + DF1AD13F15FCE71000E10810 /* ListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListItem.cpp; sourceTree = "<group>"; }; + DF1AD14015FCE71000E10810 /* ListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListItem.h; sourceTree = "<group>"; }; + DF1AD14415FCE71000E10810 /* ModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1AD14515FCE71000E10810 /* ModuleXbmc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmc.h; sourceTree = "<group>"; }; + DF1AD14815FCE71000E10810 /* ModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1AD14915FCE71000E10810 /* ModuleXbmcgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcgui.h; sourceTree = "<group>"; }; + DF1AD14C15FCE71000E10810 /* ModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1AD14D15FCE71000E10810 /* ModuleXbmcplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcplugin.h; sourceTree = "<group>"; }; + DF1AD15015FCE71000E10810 /* ModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD15115FCE71000E10810 /* ModuleXbmcvfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcvfs.h; sourceTree = "<group>"; }; + DF1AD15415FCE71000E10810 /* Monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Monitor.cpp; sourceTree = "<group>"; }; + DF1AD15515FCE71000E10810 /* Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Monitor.h; sourceTree = "<group>"; }; + DF1AD15815FCE71000E10810 /* Player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Player.cpp; sourceTree = "<group>"; }; + DF1AD15915FCE71000E10810 /* Player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Player.h; sourceTree = "<group>"; }; + DF1AD15C15FCE71000E10810 /* PlayList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayList.cpp; sourceTree = "<group>"; }; + DF1AD15D15FCE71000E10810 /* PlayList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayList.h; sourceTree = "<group>"; }; + DF1AD16015FCE71000E10810 /* RenderCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCapture.h; sourceTree = "<group>"; }; + DF1AD16115FCE71000E10810 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; }; + DF1AD16415FCE71000E10810 /* swighelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swighelper.h; sourceTree = "<group>"; }; + DF1AD16515FCE71000E10810 /* Tuple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tuple.h; sourceTree = "<group>"; }; + DF1AD16615FCE71000E10810 /* Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window.cpp; sourceTree = "<group>"; }; + DF1AD16715FCE71000E10810 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = "<group>"; }; + DF1AD16A15FCE71000E10810 /* WindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialog.cpp; sourceTree = "<group>"; }; + DF1AD16B15FCE71000E10810 /* WindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialog.h; sourceTree = "<group>"; }; + DF1AD16E15FCE71000E10810 /* WindowDialogMixin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialogMixin.cpp; sourceTree = "<group>"; }; + DF1AD16F15FCE71000E10810 /* WindowDialogMixin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialogMixin.h; sourceTree = "<group>"; }; + DF1AD17215FCE71000E10810 /* WindowException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowException.h; sourceTree = "<group>"; }; + DF1AD17315FCE71000E10810 /* WindowInterceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowInterceptor.h; sourceTree = "<group>"; }; + DF1AD17415FCE71000E10810 /* WindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowXML.cpp; sourceTree = "<group>"; }; + DF1AD17515FCE71000E10810 /* WindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowXML.h; sourceTree = "<group>"; }; DF23461915FA675200A934F6 /* UPnP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnP.cpp; sourceTree = "<group>"; }; DF23461A15FA675200A934F6 /* UPnP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnP.h; sourceTree = "<group>"; }; DF23461B15FA675200A934F6 /* UPnPInternal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPInternal.cpp; sourceTree = "<group>"; }; @@ -1240,6 +1261,7 @@ DF23461E15FA675200A934F6 /* UPnPRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnPRenderer.h; sourceTree = "<group>"; }; DF23461F15FA675200A934F6 /* UPnPServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPServer.cpp; sourceTree = "<group>"; }; DF23462015FA675200A934F6 /* UPnPServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnPServer.h; sourceTree = "<group>"; }; + DF294E3F15DACE94004FDDEC /* addonbindings.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = addonbindings.a; path = xbmc/interfaces/addonbindings.a; sourceTree = "<group>"; }; DF2E329215509B2C000F5772 /* XbmcContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XbmcContext.cpp; sourceTree = "<group>"; }; DF2E329315509B2C000F5772 /* XbmcContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XbmcContext.h; sourceTree = "<group>"; }; DF33C29115509BF50046CDCB /* ilog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ilog.cpp; sourceTree = "<group>"; }; @@ -2566,64 +2588,6 @@ F56C8543131F42E9000AD0F6 /* XBMC_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_keysym.h; sourceTree = "<group>"; }; F56C8544131F42E9000AD0F6 /* XBMC_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_mouse.h; sourceTree = "<group>"; }; F56C8545131F42E9000AD0F6 /* XBMC_vkeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_vkeys.h; sourceTree = "<group>"; }; - F56C854A131F42E9000AD0F6 /* xbmcvfsmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcvfsmodule.cpp; sourceTree = "<group>"; }; - F56C854B131F42E9000AD0F6 /* PythonAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonAddon.cpp; sourceTree = "<group>"; }; - F56C854C131F42E9000AD0F6 /* PythonAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonAddon.h; sourceTree = "<group>"; }; - F56C854D131F42E9000AD0F6 /* xbmcaddonmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcaddonmodule.cpp; sourceTree = "<group>"; }; - F56C854E131F42E9000AD0F6 /* controlslider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlslider.cpp; sourceTree = "<group>"; }; - F56C854F131F42E9000AD0F6 /* controlradiobutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlradiobutton.cpp; sourceTree = "<group>"; }; - F56C8550131F42E9000AD0F6 /* action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = action.cpp; sourceTree = "<group>"; }; - F56C8551131F42E9000AD0F6 /* action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = action.h; sourceTree = "<group>"; }; - F56C8552131F42E9000AD0F6 /* control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = control.cpp; sourceTree = "<group>"; }; - F56C8553131F42E9000AD0F6 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = control.h; sourceTree = "<group>"; }; - F56C8554131F42E9000AD0F6 /* controlbutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlbutton.cpp; sourceTree = "<group>"; }; - F56C8555131F42E9000AD0F6 /* controlcheckmark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlcheckmark.cpp; sourceTree = "<group>"; }; - F56C8556131F42E9000AD0F6 /* controlfadelabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlfadelabel.cpp; sourceTree = "<group>"; }; - F56C8557131F42E9000AD0F6 /* controlgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlgroup.cpp; sourceTree = "<group>"; }; - F56C8558131F42E9000AD0F6 /* controlimage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlimage.cpp; sourceTree = "<group>"; }; - F56C8559131F42E9000AD0F6 /* controllabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllabel.cpp; sourceTree = "<group>"; }; - F56C855A131F42E9000AD0F6 /* controllist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllist.cpp; sourceTree = "<group>"; }; - F56C855B131F42E9000AD0F6 /* controlprogress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlprogress.cpp; sourceTree = "<group>"; }; - F56C855C131F42E9000AD0F6 /* controlspin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlspin.cpp; sourceTree = "<group>"; }; - F56C855D131F42E9000AD0F6 /* controltextbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controltextbox.cpp; sourceTree = "<group>"; }; - F56C855E131F42E9000AD0F6 /* dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialog.cpp; sourceTree = "<group>"; }; - F56C855F131F42E9000AD0F6 /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialog.h; sourceTree = "<group>"; }; - F56C8560131F42E9000AD0F6 /* GUIPythonWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindow.cpp; sourceTree = "<group>"; }; - F56C8561131F42E9000AD0F6 /* GUIPythonWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindow.h; sourceTree = "<group>"; }; - F56C8562131F42E9000AD0F6 /* GUIPythonWindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowDialog.cpp; sourceTree = "<group>"; }; - F56C8563131F42E9000AD0F6 /* GUIPythonWindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowDialog.h; sourceTree = "<group>"; }; - F56C8564131F42EA000AD0F6 /* GUIPythonWindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXML.cpp; sourceTree = "<group>"; }; - F56C8565131F42EA000AD0F6 /* GUIPythonWindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXML.h; sourceTree = "<group>"; }; - F56C8566131F42EA000AD0F6 /* GUIPythonWindowXMLDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXMLDialog.cpp; sourceTree = "<group>"; }; - F56C8567131F42EA000AD0F6 /* GUIPythonWindowXMLDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXMLDialog.h; sourceTree = "<group>"; }; - F56C8568131F42EA000AD0F6 /* infotagmusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagmusic.cpp; sourceTree = "<group>"; }; - F56C8569131F42EA000AD0F6 /* infotagmusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagmusic.h; sourceTree = "<group>"; }; - F56C856A131F42EA000AD0F6 /* infotagvideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagvideo.cpp; sourceTree = "<group>"; }; - F56C856B131F42EA000AD0F6 /* infotagvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagvideo.h; sourceTree = "<group>"; }; - F56C856C131F42EA000AD0F6 /* keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = keyboard.cpp; sourceTree = "<group>"; }; - F56C856D131F42EA000AD0F6 /* keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboard.h; sourceTree = "<group>"; }; - F56C856E131F42EA000AD0F6 /* listitem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listitem.cpp; sourceTree = "<group>"; }; - F56C856F131F42EA000AD0F6 /* listitem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = listitem.h; sourceTree = "<group>"; }; - F56C8570131F42EA000AD0F6 /* player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player.cpp; sourceTree = "<group>"; }; - F56C8571131F42EA000AD0F6 /* player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player.h; sourceTree = "<group>"; }; - F56C8572131F42EA000AD0F6 /* pyplaylist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyplaylist.cpp; sourceTree = "<group>"; }; - F56C8573131F42EA000AD0F6 /* pyplaylist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyplaylist.h; sourceTree = "<group>"; }; - F56C8574131F42EA000AD0F6 /* PythonPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonPlayer.cpp; sourceTree = "<group>"; }; - F56C8575131F42EA000AD0F6 /* PythonPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonPlayer.h; sourceTree = "<group>"; }; - F56C8576131F42EA000AD0F6 /* pyutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyutil.cpp; sourceTree = "<group>"; }; - F56C8577131F42EA000AD0F6 /* pyutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyutil.h; sourceTree = "<group>"; }; - F56C8578131F42EA000AD0F6 /* window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = window.cpp; sourceTree = "<group>"; }; - F56C8579131F42EA000AD0F6 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = window.h; sourceTree = "<group>"; }; - F56C857A131F42EA000AD0F6 /* winxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxml.cpp; sourceTree = "<group>"; }; - F56C857B131F42EA000AD0F6 /* winxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winxml.h; sourceTree = "<group>"; }; - F56C857C131F42EA000AD0F6 /* winxmldialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxmldialog.cpp; sourceTree = "<group>"; }; - F56C857D131F42EA000AD0F6 /* xbmcguimodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcguimodule.cpp; sourceTree = "<group>"; }; - F56C857E131F42EA000AD0F6 /* xbmcmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcmodule.cpp; sourceTree = "<group>"; }; - F56C857F131F42EA000AD0F6 /* xbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcplugin.cpp; sourceTree = "<group>"; }; - F56C8580131F42EA000AD0F6 /* XBPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPython.cpp; sourceTree = "<group>"; }; - F56C8581131F42EA000AD0F6 /* XBPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPython.h; sourceTree = "<group>"; }; - F56C8584131F42EA000AD0F6 /* XBPyThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPyThread.cpp; sourceTree = "<group>"; }; - F56C8585131F42EA000AD0F6 /* XBPyThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPyThread.h; sourceTree = "<group>"; }; F56C8586131F42EA000AD0F6 /* AnnouncementManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnnouncementManager.cpp; sourceTree = "<group>"; }; F56C8587131F42EA000AD0F6 /* AnnouncementManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnouncementManager.h; sourceTree = "<group>"; }; F56C8588131F42EA000AD0F6 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Builtins.cpp; sourceTree = "<group>"; }; @@ -3219,8 +3183,6 @@ F5BD034E148D496A001B5583 /* CryptThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptThreading.h; sourceTree = "<group>"; }; F5CEE72F13D3F9D100225F72 /* DVDOverlayCodecTX3G.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDOverlayCodecTX3G.cpp; sourceTree = "<group>"; }; F5CEE73113D3F9D800225F72 /* DVDOverlayCodecTX3G.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDOverlayCodecTX3G.h; sourceTree = "<group>"; }; - F5E1127A14356C4600175026 /* pyrendercapture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyrendercapture.cpp; sourceTree = "<group>"; }; - F5E1127C14356C4D00175026 /* pyrendercapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyrendercapture.h; sourceTree = "<group>"; }; F5E112B2143577A000175026 /* PeripheralBusUSB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeripheralBusUSB.cpp; sourceTree = "<group>"; }; F5E112B3143577A000175026 /* PeripheralBusUSB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusUSB.h; sourceTree = "<group>"; }; F5E112B4143577A000175026 /* PeripheralBus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeripheralBus.cpp; sourceTree = "<group>"; }; @@ -3286,6 +3248,7 @@ F56C8C12131F4811000AD0F6 /* librtv.a in Frameworks */, F56C8C14131F4811000AD0F6 /* libxdaap.a in Frameworks */, 18404DD31396C3D200863BBA /* SlingboxLib.a in Frameworks */, + DF294E4015DACE94004FDDEC /* addonbindings.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3458,6 +3421,96 @@ path = windows; sourceTree = "<group>"; }; + DF1ACFF415FCE56C00E10810 /* python */ = { + isa = PBXGroup; + children = ( + DF1ACFF515FCE57C00E10810 /* generated */, + ); + name = python; + sourceTree = "<group>"; + }; + DF1ACFF515FCE57C00E10810 /* generated */ = { + isa = PBXGroup; + children = ( + DF1ACFF615FCE57C00E10810 /* AddonModuleXbmc.cpp */, + DF1ACFFA15FCE57C00E10810 /* AddonModuleXbmcaddon.cpp */, + DF1ACFFE15FCE57C00E10810 /* AddonModuleXbmcgui.cpp */, + DF1AD00215FCE57C00E10810 /* AddonModuleXbmcplugin.cpp */, + DF1AD00615FCE57C00E10810 /* AddonModuleXbmcvfs.cpp */, + ); + name = generated; + path = python/generated; + sourceTree = "<group>"; + }; + DF1AD10315FCE71000E10810 /* legacy */ = { + isa = PBXGroup; + children = ( + DF1AD10415FCE71000E10810 /* Addon.cpp */, + DF1AD10515FCE71000E10810 /* Addon.h */, + DF1AD10815FCE71000E10810 /* AddonCallback.cpp */, + DF1AD10915FCE71000E10810 /* AddonCallback.h */, + DF1AD10C15FCE71000E10810 /* AddonClass.cpp */, + DF1AD10D15FCE71000E10810 /* AddonClass.h */, + DF1AD11015FCE71000E10810 /* AddonString.h */, + DF1AD11115FCE71000E10810 /* AddonUtils.cpp */, + DF1AD11215FCE71000E10810 /* AddonUtils.h */, + DF1AD11515FCE71000E10810 /* Alternative.h */, + DF1AD11615FCE71000E10810 /* aojsonrpc.h */, + DF1AD11715FCE71000E10810 /* CallbackFunction.cpp */, + DF1AD11815FCE71000E10810 /* CallbackFunction.h */, + DF1AD11B15FCE71000E10810 /* CallbackHandler.cpp */, + DF1AD11C15FCE71000E10810 /* CallbackHandler.h */, + DF1AD11F15FCE71000E10810 /* Control.cpp */, + DF1AD12015FCE71000E10810 /* Control.h */, + DF1AD12315FCE71000E10810 /* Dialog.cpp */, + DF1AD12415FCE71000E10810 /* Dialog.h */, + DF1AD12715FCE71000E10810 /* Dictionary.h */, + DF1AD12815FCE71000E10810 /* Exception.h */, + DF1AD12915FCE71000E10810 /* File.cpp */, + DF1AD12A15FCE71000E10810 /* File.h */, + DF1AD12D15FCE71000E10810 /* InfoTagMusic.cpp */, + DF1AD12E15FCE71000E10810 /* InfoTagMusic.h */, + DF1AD13115FCE71000E10810 /* InfoTagVideo.cpp */, + DF1AD13215FCE71000E10810 /* InfoTagVideo.h */, + DF1AD13515FCE71000E10810 /* Keyboard.cpp */, + DF1AD13615FCE71000E10810 /* Keyboard.h */, + DF1AD13915FCE71000E10810 /* LanguageHook.cpp */, + DF1AD13A15FCE71000E10810 /* LanguageHook.h */, + DF1AD13E15FCE71000E10810 /* List.h */, + DF1AD13F15FCE71000E10810 /* ListItem.cpp */, + DF1AD14015FCE71000E10810 /* ListItem.h */, + DF1AD14415FCE71000E10810 /* ModuleXbmc.cpp */, + DF1AD14515FCE71000E10810 /* ModuleXbmc.h */, + DF1AD14815FCE71000E10810 /* ModuleXbmcgui.cpp */, + DF1AD14915FCE71000E10810 /* ModuleXbmcgui.h */, + DF1AD14C15FCE71000E10810 /* ModuleXbmcplugin.cpp */, + DF1AD14D15FCE71000E10810 /* ModuleXbmcplugin.h */, + DF1AD15015FCE71000E10810 /* ModuleXbmcvfs.cpp */, + DF1AD15115FCE71000E10810 /* ModuleXbmcvfs.h */, + DF1AD15415FCE71000E10810 /* Monitor.cpp */, + DF1AD15515FCE71000E10810 /* Monitor.h */, + DF1AD15815FCE71000E10810 /* Player.cpp */, + DF1AD15915FCE71000E10810 /* Player.h */, + DF1AD15C15FCE71000E10810 /* PlayList.cpp */, + DF1AD15D15FCE71000E10810 /* PlayList.h */, + DF1AD16015FCE71000E10810 /* RenderCapture.h */, + DF1AD16115FCE71000E10810 /* String.cpp */, + DF1AD16415FCE71000E10810 /* swighelper.h */, + DF1AD16515FCE71000E10810 /* Tuple.h */, + DF1AD16615FCE71000E10810 /* Window.cpp */, + DF1AD16715FCE71000E10810 /* Window.h */, + DF1AD16A15FCE71000E10810 /* WindowDialog.cpp */, + DF1AD16B15FCE71000E10810 /* WindowDialog.h */, + DF1AD16E15FCE71000E10810 /* WindowDialogMixin.cpp */, + DF1AD16F15FCE71000E10810 /* WindowDialogMixin.h */, + DF1AD17215FCE71000E10810 /* WindowException.h */, + DF1AD17315FCE71000E10810 /* WindowInterceptor.h */, + DF1AD17415FCE71000E10810 /* WindowXML.cpp */, + DF1AD17515FCE71000E10810 /* WindowXML.h */, + ); + path = legacy; + sourceTree = "<group>"; + }; DF23461715FA675200A934F6 /* upnp */ = { isa = PBXGroup; children = ( @@ -5508,7 +5561,8 @@ F5AE41381341754C0004BD79 /* http-api */, F5E6209313E907E200D5F2CD /* info */, F5AE413F134175520004BD79 /* json-rpc */, - F56C8547131F42E9000AD0F6 /* python */, + DF1AD10315FCE71000E10810 /* legacy */, + DF1ACFF415FCE56C00E10810 /* python */, F56C8586131F42EA000AD0F6 /* AnnouncementManager.cpp */, F56C8587131F42EA000AD0F6 /* AnnouncementManager.h */, F56C8588131F42EA000AD0F6 /* Builtins.cpp */, @@ -5518,86 +5572,6 @@ path = interfaces; sourceTree = "<group>"; }; - F56C8547131F42E9000AD0F6 /* python */ = { - isa = PBXGroup; - children = ( - F56C8549131F42E9000AD0F6 /* xbmcmodule */, - F56C8580131F42EA000AD0F6 /* XBPython.cpp */, - F56C8581131F42EA000AD0F6 /* XBPython.h */, - F56C8584131F42EA000AD0F6 /* XBPyThread.cpp */, - F56C8585131F42EA000AD0F6 /* XBPyThread.h */, - ); - path = python; - sourceTree = "<group>"; - }; - F56C8549131F42E9000AD0F6 /* xbmcmodule */ = { - isa = PBXGroup; - children = ( - F56C8550131F42E9000AD0F6 /* action.cpp */, - F56C8551131F42E9000AD0F6 /* action.h */, - F56C8552131F42E9000AD0F6 /* control.cpp */, - F56C8553131F42E9000AD0F6 /* control.h */, - F56C8554131F42E9000AD0F6 /* controlbutton.cpp */, - F56C8555131F42E9000AD0F6 /* controlcheckmark.cpp */, - 1830219D13B8E37300770920 /* controledit.cpp */, - F56C8556131F42E9000AD0F6 /* controlfadelabel.cpp */, - F56C8557131F42E9000AD0F6 /* controlgroup.cpp */, - F56C8558131F42E9000AD0F6 /* controlimage.cpp */, - F56C8559131F42E9000AD0F6 /* controllabel.cpp */, - F56C855A131F42E9000AD0F6 /* controllist.cpp */, - F56C855B131F42E9000AD0F6 /* controlprogress.cpp */, - F56C854F131F42E9000AD0F6 /* controlradiobutton.cpp */, - F56C854E131F42E9000AD0F6 /* controlslider.cpp */, - F56C855C131F42E9000AD0F6 /* controlspin.cpp */, - F56C855D131F42E9000AD0F6 /* controltextbox.cpp */, - F56C855E131F42E9000AD0F6 /* dialog.cpp */, - F56C855F131F42E9000AD0F6 /* dialog.h */, - F56C8560131F42E9000AD0F6 /* GUIPythonWindow.cpp */, - F56C8561131F42E9000AD0F6 /* GUIPythonWindow.h */, - F56C8562131F42E9000AD0F6 /* GUIPythonWindowDialog.cpp */, - F56C8563131F42E9000AD0F6 /* GUIPythonWindowDialog.h */, - F56C8564131F42EA000AD0F6 /* GUIPythonWindowXML.cpp */, - F56C8565131F42EA000AD0F6 /* GUIPythonWindowXML.h */, - F56C8566131F42EA000AD0F6 /* GUIPythonWindowXMLDialog.cpp */, - F56C8567131F42EA000AD0F6 /* GUIPythonWindowXMLDialog.h */, - F56C8568131F42EA000AD0F6 /* infotagmusic.cpp */, - F56C8569131F42EA000AD0F6 /* infotagmusic.h */, - F56C856A131F42EA000AD0F6 /* infotagvideo.cpp */, - F56C856B131F42EA000AD0F6 /* infotagvideo.h */, - F56C856C131F42EA000AD0F6 /* keyboard.cpp */, - F56C856D131F42EA000AD0F6 /* keyboard.h */, - F56C856E131F42EA000AD0F6 /* listitem.cpp */, - F56C856F131F42EA000AD0F6 /* listitem.h */, - C893606D152C870600812418 /* monitor.cpp */, - C893606E152C870600812418 /* monitor.h */, - F56C8570131F42EA000AD0F6 /* player.cpp */, - F56C8571131F42EA000AD0F6 /* player.h */, - F56C8572131F42EA000AD0F6 /* pyplaylist.cpp */, - F56C8573131F42EA000AD0F6 /* pyplaylist.h */, - F5E1127A14356C4600175026 /* pyrendercapture.cpp */, - F5E1127C14356C4D00175026 /* pyrendercapture.h */, - F56C854B131F42E9000AD0F6 /* PythonAddon.cpp */, - F56C854C131F42E9000AD0F6 /* PythonAddon.h */, - C8936070152C871400812418 /* PythonMonitor.cpp */, - C8936071152C871400812418 /* PythonMonitor.h */, - F56C8574131F42EA000AD0F6 /* PythonPlayer.cpp */, - F56C8575131F42EA000AD0F6 /* PythonPlayer.h */, - F56C8576131F42EA000AD0F6 /* pyutil.cpp */, - F56C8577131F42EA000AD0F6 /* pyutil.h */, - F56C8578131F42EA000AD0F6 /* window.cpp */, - F56C8579131F42EA000AD0F6 /* window.h */, - F56C857A131F42EA000AD0F6 /* winxml.cpp */, - F56C857B131F42EA000AD0F6 /* winxml.h */, - F56C857C131F42EA000AD0F6 /* winxmldialog.cpp */, - F56C854D131F42E9000AD0F6 /* xbmcaddonmodule.cpp */, - F56C857D131F42EA000AD0F6 /* xbmcguimodule.cpp */, - F56C857E131F42EA000AD0F6 /* xbmcmodule.cpp */, - F56C857F131F42EA000AD0F6 /* xbmcplugin.cpp */, - F56C854A131F42E9000AD0F6 /* xbmcvfsmodule.cpp */, - ); - path = xbmcmodule; - sourceTree = "<group>"; - }; F56C858B131F42EA000AD0F6 /* linux */ = { isa = PBXGroup; children = ( @@ -6416,6 +6390,7 @@ F589AE6D12890B6700D8079E /* Internal Libs */ = { isa = PBXGroup; children = ( + DF294E3F15DACE94004FDDEC /* addonbindings.a */, F56C8C03131F47EA000AD0F6 /* libapetag.a */, F56C8C0E131F4811000AD0F6 /* librtv.a */, F56C8C0D131F4811000AD0F6 /* libsquish.a */, @@ -7178,44 +7153,6 @@ F56C8A31131F42ED000AD0F6 /* KeyboardStat.cpp in Sources */, F56C8A32131F42ED000AD0F6 /* MouseStat.cpp in Sources */, F56C8A33131F42ED000AD0F6 /* SDLJoystick.cpp in Sources */, - F56C8A35131F42ED000AD0F6 /* xbmcvfsmodule.cpp in Sources */, - F56C8A36131F42ED000AD0F6 /* PythonAddon.cpp in Sources */, - F56C8A37131F42ED000AD0F6 /* xbmcaddonmodule.cpp in Sources */, - F56C8A38131F42ED000AD0F6 /* controlslider.cpp in Sources */, - F56C8A39131F42ED000AD0F6 /* controlradiobutton.cpp in Sources */, - F56C8A3A131F42ED000AD0F6 /* action.cpp in Sources */, - F56C8A3B131F42ED000AD0F6 /* control.cpp in Sources */, - F56C8A3C131F42ED000AD0F6 /* controlbutton.cpp in Sources */, - F56C8A3D131F42ED000AD0F6 /* controlcheckmark.cpp in Sources */, - F56C8A3E131F42ED000AD0F6 /* controlfadelabel.cpp in Sources */, - F56C8A3F131F42ED000AD0F6 /* controlgroup.cpp in Sources */, - F56C8A40131F42ED000AD0F6 /* controlimage.cpp in Sources */, - F56C8A41131F42ED000AD0F6 /* controllabel.cpp in Sources */, - F56C8A42131F42ED000AD0F6 /* controllist.cpp in Sources */, - F56C8A43131F42ED000AD0F6 /* controlprogress.cpp in Sources */, - F56C8A44131F42ED000AD0F6 /* controlspin.cpp in Sources */, - F56C8A45131F42ED000AD0F6 /* controltextbox.cpp in Sources */, - F56C8A46131F42ED000AD0F6 /* dialog.cpp in Sources */, - F56C8A47131F42ED000AD0F6 /* GUIPythonWindow.cpp in Sources */, - F56C8A48131F42ED000AD0F6 /* GUIPythonWindowDialog.cpp in Sources */, - F56C8A49131F42ED000AD0F6 /* GUIPythonWindowXML.cpp in Sources */, - F56C8A4A131F42ED000AD0F6 /* GUIPythonWindowXMLDialog.cpp in Sources */, - F56C8A4B131F42ED000AD0F6 /* infotagmusic.cpp in Sources */, - F56C8A4C131F42ED000AD0F6 /* infotagvideo.cpp in Sources */, - F56C8A4D131F42ED000AD0F6 /* keyboard.cpp in Sources */, - F56C8A4E131F42ED000AD0F6 /* listitem.cpp in Sources */, - F56C8A4F131F42ED000AD0F6 /* player.cpp in Sources */, - F56C8A50131F42ED000AD0F6 /* pyplaylist.cpp in Sources */, - F56C8A51131F42ED000AD0F6 /* PythonPlayer.cpp in Sources */, - F56C8A52131F42ED000AD0F6 /* pyutil.cpp in Sources */, - F56C8A53131F42ED000AD0F6 /* window.cpp in Sources */, - F56C8A54131F42ED000AD0F6 /* winxml.cpp in Sources */, - F56C8A55131F42ED000AD0F6 /* winxmldialog.cpp in Sources */, - F56C8A56131F42ED000AD0F6 /* xbmcguimodule.cpp in Sources */, - F56C8A57131F42ED000AD0F6 /* xbmcmodule.cpp in Sources */, - F56C8A58131F42ED000AD0F6 /* xbmcplugin.cpp in Sources */, - F56C8A59131F42ED000AD0F6 /* XBPython.cpp in Sources */, - F56C8A5B131F42ED000AD0F6 /* XBPyThread.cpp in Sources */, F56C8A5C131F42ED000AD0F6 /* AnnouncementManager.cpp in Sources */, F56C8A5D131F42ED000AD0F6 /* Builtins.cpp in Sources */, F56C8A5F131F42ED000AD0F6 /* ConvUtils.cpp in Sources */, @@ -7499,7 +7436,6 @@ 7C0A7FB313A9E72E00AFC2BD /* DirtyRegionTracker.cpp in Sources */, DF0DF18013A3AF9F008ED511 /* NFSDirectory.cpp in Sources */, 7C89628013B7031E003631FE /* GUIWindowScreensaverDim.cpp in Sources */, - 1830219E13B8E37300770920 /* controledit.cpp in Sources */, 18ECC99D13CF17D200A9ED6C /* StreamUtils.cpp in Sources */, F5CEE73013D3F9D100225F72 /* DVDOverlayCodecTX3G.cpp in Sources */, DFD4D1E213D725ED00A47C47 /* Implementation.cpp in Sources */, @@ -7517,7 +7453,6 @@ DF448572140065E10069344B /* PipesManager.cpp in Sources */, DF4485751400662D0069344B /* AirTunesServer.cpp in Sources */, DF98D9991434F49500A6EBE1 /* SkinVariable.cpp in Sources */, - F5E1127B14356C4600175026 /* pyrendercapture.cpp in Sources */, F5E112DB143577A000175026 /* PeripheralBusUSB.cpp in Sources */, F5E112DC143577A000175026 /* PeripheralBus.cpp in Sources */, F5E112E0143577A000175026 /* Peripheral.cpp in Sources */, @@ -7580,8 +7515,6 @@ DFDB00261516403A005079A4 /* FileCache.cpp in Sources */, DFDB00271516403A005079A4 /* MemBufferCache.cpp in Sources */, 7C1A89CE1526722200C63311 /* TextureCacheJob.cpp in Sources */, - C893606F152C870600812418 /* monitor.cpp in Sources */, - C8936072152C871400812418 /* PythonMonitor.cpp in Sources */, DFFD59401506B5B10088DE4B /* IOSEAGLView.mm in Sources */, DFFEFBEE15160739001294DC /* IOSScreenManager.mm in Sources */, DFFEFC0415160808001294DC /* IOSExternalTouchController.mm in Sources */, @@ -7781,6 +7714,7 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces\"", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -7901,6 +7835,7 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces\"", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj index 54d9871c46..6e0792aadb 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -25,8 +25,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 1830212813B8E2DC00770920 /* controledit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1830212713B8E2DC00770920 /* controledit.cpp */; }; - 183C454D130C4D55006AA317 /* xbmcvfsmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 189047D11301DEAB00C11012 /* xbmcvfsmodule.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; 183FDF8A11AF0B0500B81E9C /* PluginSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 183FDF8811AF0B0500B81E9C /* PluginSource.cpp */; }; 18404DA61396C31B00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DA51396C31B00863BBA /* SlingboxLib.a */; }; 1840B74D13993D8A007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */; }; @@ -304,8 +302,6 @@ 7CCF7FC9106A0DF500992676 /* TimeUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCF7FC7106A0DF500992676 /* TimeUtils.cpp */; }; 7CCFD98D151494E100211D82 /* PCMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCFD98A151494E100211D82 /* PCMCodec.cpp */; }; 7CD2C3AB11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */; }; - 7CD2CD0311B38B000009EFC1 /* PythonAddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD2CCFE11B38B000009EFC1 /* PythonAddon.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - 7CD2CD0411B38B000009EFC1 /* xbmcaddonmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD2CD0011B38B000009EFC1 /* xbmcaddonmodule.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; 7CDAE9050FFCA3520040B25F /* DVDTSCorrection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */; }; 7CDAEA7D1001CD6E0040B25F /* karaokelyricstextustar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAEA7B1001CD6E0040B25F /* karaokelyricstextustar.cpp */; }; 7CDAEA8C1001EBA70040B25F /* PltConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAEA891001EBA70040B25F /* PltConstants.cpp */; }; @@ -330,7 +326,6 @@ 889B4D8E0E0EF86C00FAD25E /* RSSDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 889B4D8C0E0EF86C00FAD25E /* RSSDirectory.cpp */; }; 88ACB01B0DCF40800083CFDF /* ASAPFileDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 88ACB0190DCF40800083CFDF /* ASAPFileDirectory.cpp */; }; 88ACB01F0DCF409E0083CFDF /* ASAPCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 88ACB01C0DCF409E0083CFDF /* ASAPCodec.cpp */; }; - C80425711158A0DE00D158A6 /* controlslider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C80425701158A0DE00D158A6 /* controlslider.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; C807114D135DB5CC002F601B /* InputOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C807114B135DB5CC002F601B /* InputOperations.cpp */; }; C84828C0156CFCD8005A996F /* PVRClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482874156CFCD8005A996F /* PVRClient.cpp */; }; C84828C1156CFCD8005A996F /* PVRClients.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8482876156CFCD8005A996F /* PVRClients.cpp */; }; @@ -383,8 +378,6 @@ C848291F156D003E005A996F /* TextSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C848291D156D003E005A996F /* TextSearch.cpp */; }; C84BF7341349BB74006D6FC9 /* JSONServiceDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C84BF7321349BB74006D6FC9 /* JSONServiceDescription.cpp */; }; C85EB75C1174614E0008E5A5 /* Repository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C85EB75A1174614E0008E5A5 /* Repository.cpp */; }; - C8936052152C86CF00812418 /* monitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8936050152C86CF00812418 /* monitor.cpp */; }; - C8936056152C86D800812418 /* PythonMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8936054152C86D800812418 /* PythonMonitor.cpp */; }; C8D0B2AF1265A9A800F0C0AC /* SystemGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */; }; C8EC5D0E1369519D00CCC10D /* XBMC_keytable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8EC5D0C1369519D00CCC10D /* XBMC_keytable.cpp */; }; DF0DF15C13A3ADA7008ED511 /* NFSDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0DF15913A3ADA7008ED511 /* NFSDirectory.cpp */; }; @@ -396,6 +389,7 @@ DF3488E713FD958F0026A711 /* GUIAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF3488E513FD958F0026A711 /* GUIAction.cpp */; }; DF34892A13FD9C780026A711 /* AirPlayServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34892813FD9C780026A711 /* AirPlayServer.cpp */; }; DF34898213FDAAF60026A711 /* HttpParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34898113FDAAF60026A711 /* HttpParser.cpp */; }; + DF357C6015D9ADB600C1EEC7 /* addonbindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DF357C5F15D9ADB600C1EEC7 /* addonbindings.a */; }; DF448457140048A60069344B /* AirTunesServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF448455140048A60069344B /* AirTunesServer.cpp */; }; DF44845E140048C80069344B /* PipesManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF44845B140048C80069344B /* PipesManager.cpp */; }; DF4484EE140054530069344B /* BXAcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF4484EC140054530069344B /* BXAcodec.cpp */; }; @@ -470,7 +464,6 @@ E33206380D5070AA00435CE3 /* DVDDemuxVobsub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E33206370D5070AA00435CE3 /* DVDDemuxVobsub.cpp */; }; E33466A60D2E5103005A65EC /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E33466A50D2E5103005A65EC /* IOKit.framework */; }; E33979960D62FD48004ECDDA /* DVDInputStreamTV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E33979940D62FD47004ECDDA /* DVDInputStreamTV.cpp */; }; - E354EF040D99EDC900B55311 /* controlradiobutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E354EF030D99EDC900B55311 /* controlradiobutton.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; E36578880D3AA7B40033CC1C /* DVDPlayerCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E36578860D3AA7B40033CC1C /* DVDPlayerCodec.cpp */; }; E36C29DF0DA72429001F0C9D /* Artist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E36C29DB0DA72429001F0C9D /* Artist.cpp */; }; E36C29E00DA72429001F0C9D /* Album.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E36C29DC0DA72429001F0C9D /* Album.cpp */; }; @@ -717,8 +710,6 @@ E38E20D60D25F9FD00618676 /* LangCodeExpander.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18560D25F9FA00618676 /* LangCodeExpander.cpp */; }; E38E20D70D25F9FD00618676 /* LangInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18580D25F9FA00618676 /* LangInfo.cpp */; }; E38E20D80D25F9FD00618676 /* LastFmManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E185A0D25F9FA00618676 /* LastFmManager.cpp */; }; - E38E21600D25F9FD00618676 /* XBPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1A0D0D25F9FB00618676 /* XBPython.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E21620D25F9FD00618676 /* XBPyThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1A110D25F9FB00618676 /* XBPyThread.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; E38E21670D25F9FD00618676 /* scrobbler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1A250D25F9FB00618676 /* scrobbler.cpp */; }; E38E21740D25F9FD00618676 /* MediaCrawler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1ABD0D25F9FB00618676 /* MediaCrawler.cpp */; }; E38E21760D25F9FD00618676 /* PltMicroMediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E1AC20D25F9FB00618676 /* PltMicroMediaController.cpp */; }; @@ -868,37 +859,6 @@ E38E256D0D263A1C00618676 /* librtv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E38E256C0D263A1C00618676 /* librtv.a */; }; E38E25780D263BF600618676 /* unpack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25770D263BF600618676 /* unpack.cpp */; }; E38E257C0D263C4400618676 /* rar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E257B0D263C4400618676 /* rar.cpp */; }; - E38E259D0D263CE000618676 /* action.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E257E0D263CE000618676 /* action.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E259E0D263CE000618676 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E257F0D263CE000618676 /* control.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E259F0D263CE000618676 /* controlbutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25800D263CE000618676 /* controlbutton.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A00D263CE000618676 /* controlcheckmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25810D263CE000618676 /* controlcheckmark.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A10D263CE000618676 /* controlfadelabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25820D263CE000618676 /* controlfadelabel.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A20D263CE000618676 /* controlgroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25830D263CE000618676 /* controlgroup.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A30D263CE000618676 /* controlimage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25840D263CE000618676 /* controlimage.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A40D263CE000618676 /* controllabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25850D263CE000618676 /* controllabel.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A50D263CE000618676 /* controllist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25860D263CE000618676 /* controllist.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A60D263CE000618676 /* controlprogress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25870D263CE000618676 /* controlprogress.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A70D263CE000618676 /* controlspin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25880D263CE000618676 /* controlspin.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A80D263CE000618676 /* controltextbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25890D263CE000618676 /* controltextbox.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25A90D263CE000618676 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258A0D263CE000618676 /* dialog.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AA0D263CE000618676 /* GUIPythonWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258B0D263CE000618676 /* GUIPythonWindow.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AB0D263CE000618676 /* GUIPythonWindowDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258C0D263CE000618676 /* GUIPythonWindowDialog.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AC0D263CE000618676 /* GUIPythonWindowXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258D0D263CE000618676 /* GUIPythonWindowXML.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AD0D263CE000618676 /* GUIPythonWindowXMLDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258E0D263CE000618676 /* GUIPythonWindowXMLDialog.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AE0D263CE000618676 /* infotagmusic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E258F0D263CE000618676 /* infotagmusic.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25AF0D263CE000618676 /* infotagvideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25900D263CE000618676 /* infotagvideo.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B00D263CE000618676 /* keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25910D263CE000618676 /* keyboard.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B10D263CE000618676 /* listitem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25920D263CE000618676 /* listitem.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B20D263CE000618676 /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25930D263CE000618676 /* player.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B30D263CE000618676 /* pyplaylist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25940D263CE000618676 /* pyplaylist.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B40D263CE000618676 /* PythonPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25950D263CE000618676 /* PythonPlayer.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B50D263CE000618676 /* pyutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25960D263CE000618676 /* pyutil.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B60D263CE000618676 /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25970D263CE000618676 /* window.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B70D263CE000618676 /* winxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25980D263CE000618676 /* winxml.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B80D263CE000618676 /* winxmldialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25990D263CE000618676 /* winxmldialog.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25B90D263CE000618676 /* xbmcguimodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E259A0D263CE000618676 /* xbmcguimodule.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25BA0D263CE000618676 /* xbmcmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E259B0D263CE000618676 /* xbmcmodule.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; - E38E25BB0D263CE000618676 /* xbmcplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E259C0D263CE000618676 /* xbmcplugin.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; }; E38E25C00D263DC100618676 /* DVDFactoryDemuxer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25BF0D263DC100618676 /* DVDFactoryDemuxer.cpp */; }; E38E25C30D263DE200618676 /* DVDDemuxFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E25C20D263DE200618676 /* DVDDemuxFFmpeg.cpp */; }; E3A4780A0D29029A00F3C3A6 /* GUIDialogCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3A478090D29029A00F3C3A6 /* GUIDialogCache.cpp */; }; @@ -1025,7 +985,6 @@ F5E10543140AA38100175026 /* GUIDialogPeripheralManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1052D140AA38000175026 /* GUIDialogPeripheralManager.cpp */; }; F5E10544140AA38100175026 /* GUIDialogPeripheralSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1052F140AA38000175026 /* GUIDialogPeripheralSettings.cpp */; }; F5E10547140AA38100175026 /* Peripherals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E10533140AA38000175026 /* Peripherals.cpp */; }; - F5E1125E14356B2400175026 /* pyrendercapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E1125C14356B2400175026 /* pyrendercapture.cpp */; }; F5E1138014357F3800175026 /* PeripheralCecAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E10520140AA38000175026 /* PeripheralCecAdapter.cpp */; }; F5E55B5D10741272006E788A /* DVDPlayerTeletext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E55B5B10741272006E788A /* DVDPlayerTeletext.cpp */; }; F5E55B66107412DE006E788A /* GUIDialogTeletext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5E55B65107412DE006E788A /* GUIDialogTeletext.cpp */; }; @@ -1074,7 +1033,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1830212713B8E2DC00770920 /* controledit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controledit.cpp; sourceTree = "<group>"; }; 18308CB41303370800AA309E /* stat_utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stat_utf8.h; sourceTree = "<group>"; }; 18308CB51303370800AA309E /* stdio_utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio_utf8.h; sourceTree = "<group>"; }; 183FDF8811AF0B0500B81E9C /* PluginSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginSource.cpp; sourceTree = "<group>"; }; @@ -1093,7 +1051,6 @@ 188F75FD152217BC009870CE /* Mime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mime.h; sourceTree = "<group>"; }; 188F7600152217DF009870CE /* GUIOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIOperations.cpp; sourceTree = "<group>"; }; 188F7601152217DF009870CE /* GUIOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIOperations.h; sourceTree = "<group>"; }; - 189047D11301DEAB00C11012 /* xbmcvfsmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcvfsmodule.cpp; sourceTree = "<group>"; }; 18968DC614155D7C005BA742 /* ApplicationOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationOperations.cpp; sourceTree = "<group>"; }; 18968DC714155D7C005BA742 /* ApplicationOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationOperations.h; sourceTree = "<group>"; }; 18ACF84113596C9B00B67371 /* RecentlyAddedJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecentlyAddedJob.cpp; sourceTree = "<group>"; }; @@ -1690,9 +1647,6 @@ 7CCFD98B151494E100211D82 /* PCMCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PCMCodec.h; sourceTree = "<group>"; }; 7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryNodeCountry.cpp; sourceTree = "<group>"; }; 7CD2C3A911940B270009EFC1 /* DirectoryNodeCountry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryNodeCountry.h; sourceTree = "<group>"; }; - 7CD2CCFE11B38B000009EFC1 /* PythonAddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonAddon.cpp; sourceTree = "<group>"; }; - 7CD2CCFF11B38B000009EFC1 /* PythonAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonAddon.h; sourceTree = "<group>"; }; - 7CD2CD0011B38B000009EFC1 /* xbmcaddonmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcaddonmodule.cpp; sourceTree = "<group>"; }; 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDTSCorrection.cpp; sourceTree = "<group>"; }; 7CDAE9040FFCA3520040B25F /* DVDTSCorrection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDTSCorrection.h; sourceTree = "<group>"; }; 7CDAEA7B1001CD6E0040B25F /* karaokelyricstextustar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = karaokelyricstextustar.cpp; sourceTree = "<group>"; }; @@ -1747,7 +1701,6 @@ 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; }; - C80425701158A0DE00D158A6 /* controlslider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlslider.cpp; sourceTree = "<group>"; }; C807114B135DB5CC002F601B /* InputOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputOperations.cpp; sourceTree = "<group>"; }; C807114C135DB5CC002F601B /* InputOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputOperations.h; sourceTree = "<group>"; }; C8482874156CFCD8005A996F /* PVRClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PVRClient.cpp; sourceTree = "<group>"; }; @@ -1852,15 +1805,78 @@ C84BF7331349BB74006D6FC9 /* JSONServiceDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONServiceDescription.h; sourceTree = "<group>"; }; C85EB75A1174614E0008E5A5 /* Repository.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Repository.cpp; sourceTree = "<group>"; }; C85EB75B1174614E0008E5A5 /* Repository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Repository.h; sourceTree = "<group>"; }; - C8936050152C86CF00812418 /* monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = monitor.cpp; sourceTree = "<group>"; }; - C8936051152C86CF00812418 /* monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = monitor.h; sourceTree = "<group>"; }; - C8936054152C86D800812418 /* PythonMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonMonitor.cpp; sourceTree = "<group>"; }; - C8936055152C86D800812418 /* PythonMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonMonitor.h; sourceTree = "<group>"; }; C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemGlobals.cpp; sourceTree = "<group>"; }; C8EC5D0C1369519D00CCC10D /* XBMC_keytable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBMC_keytable.cpp; sourceTree = "<group>"; }; C8EC5D0D1369519D00CCC10D /* XBMC_keytable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMC_keytable.h; sourceTree = "<group>"; }; DF0DF15913A3ADA7008ED511 /* NFSDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NFSDirectory.cpp; sourceTree = "<group>"; }; DF0DF15A13A3ADA7008ED511 /* NFSDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFSDirectory.h; sourceTree = "<group>"; }; + DF1ACFD115FCE50700E10810 /* AddonModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1ACFD515FCE50700E10810 /* AddonModuleXbmcaddon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcaddon.cpp; sourceTree = "<group>"; }; + DF1ACFD915FCE50700E10810 /* AddonModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1ACFDD15FCE50700E10810 /* AddonModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1ACFE115FCE50700E10810 /* AddonModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD17C15FCE77900E10810 /* Addon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Addon.cpp; sourceTree = "<group>"; }; + DF1AD17D15FCE77900E10810 /* Addon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Addon.h; sourceTree = "<group>"; }; + DF1AD18015FCE77900E10810 /* AddonCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonCallback.cpp; sourceTree = "<group>"; }; + DF1AD18115FCE77900E10810 /* AddonCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonCallback.h; sourceTree = "<group>"; }; + DF1AD18415FCE77900E10810 /* AddonClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonClass.cpp; sourceTree = "<group>"; }; + DF1AD18515FCE77900E10810 /* AddonClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonClass.h; sourceTree = "<group>"; }; + DF1AD18815FCE77900E10810 /* AddonString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonString.h; sourceTree = "<group>"; }; + DF1AD18915FCE77900E10810 /* AddonUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonUtils.cpp; sourceTree = "<group>"; }; + DF1AD18A15FCE77900E10810 /* AddonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonUtils.h; sourceTree = "<group>"; }; + DF1AD18D15FCE77900E10810 /* Alternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alternative.h; sourceTree = "<group>"; }; + DF1AD18E15FCE77900E10810 /* aojsonrpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aojsonrpc.h; sourceTree = "<group>"; }; + DF1AD18F15FCE77900E10810 /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; }; + DF1AD19015FCE77900E10810 /* CallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackFunction.h; sourceTree = "<group>"; }; + DF1AD19315FCE77900E10810 /* CallbackHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackHandler.cpp; sourceTree = "<group>"; }; + DF1AD19415FCE77900E10810 /* CallbackHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackHandler.h; sourceTree = "<group>"; }; + DF1AD19715FCE77900E10810 /* Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Control.cpp; sourceTree = "<group>"; }; + DF1AD19815FCE77900E10810 /* Control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Control.h; sourceTree = "<group>"; }; + DF1AD19B15FCE77900E10810 /* Dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dialog.cpp; sourceTree = "<group>"; }; + DF1AD19C15FCE77900E10810 /* Dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dialog.h; sourceTree = "<group>"; }; + DF1AD19F15FCE77900E10810 /* Dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dictionary.h; sourceTree = "<group>"; }; + DF1AD1A015FCE77900E10810 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; + DF1AD1A115FCE77900E10810 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; + DF1AD1A215FCE77900E10810 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; + DF1AD1A515FCE77900E10810 /* InfoTagMusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagMusic.cpp; sourceTree = "<group>"; }; + DF1AD1A615FCE77900E10810 /* InfoTagMusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagMusic.h; sourceTree = "<group>"; }; + DF1AD1A915FCE77900E10810 /* InfoTagVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoTagVideo.cpp; sourceTree = "<group>"; }; + DF1AD1AA15FCE77900E10810 /* InfoTagVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTagVideo.h; sourceTree = "<group>"; }; + DF1AD1AD15FCE77900E10810 /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = "<group>"; }; + DF1AD1AE15FCE77900E10810 /* Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Keyboard.h; sourceTree = "<group>"; }; + DF1AD1B115FCE77900E10810 /* LanguageHook.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageHook.cpp; sourceTree = "<group>"; }; + DF1AD1B215FCE77900E10810 /* LanguageHook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageHook.h; sourceTree = "<group>"; }; + DF1AD1B615FCE77900E10810 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = "<group>"; }; + DF1AD1B715FCE77900E10810 /* ListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListItem.cpp; sourceTree = "<group>"; }; + DF1AD1B815FCE77900E10810 /* ListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListItem.h; sourceTree = "<group>"; }; + DF1AD1BC15FCE77900E10810 /* ModuleXbmc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmc.cpp; sourceTree = "<group>"; }; + DF1AD1BD15FCE77900E10810 /* ModuleXbmc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmc.h; sourceTree = "<group>"; }; + DF1AD1C015FCE77900E10810 /* ModuleXbmcgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcgui.cpp; sourceTree = "<group>"; }; + DF1AD1C115FCE77900E10810 /* ModuleXbmcgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcgui.h; sourceTree = "<group>"; }; + DF1AD1C415FCE77900E10810 /* ModuleXbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcplugin.cpp; sourceTree = "<group>"; }; + DF1AD1C515FCE77900E10810 /* ModuleXbmcplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcplugin.h; sourceTree = "<group>"; }; + DF1AD1C815FCE77900E10810 /* ModuleXbmcvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleXbmcvfs.cpp; sourceTree = "<group>"; }; + DF1AD1C915FCE77900E10810 /* ModuleXbmcvfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleXbmcvfs.h; sourceTree = "<group>"; }; + DF1AD1CC15FCE77900E10810 /* Monitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Monitor.cpp; sourceTree = "<group>"; }; + DF1AD1CD15FCE77900E10810 /* Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Monitor.h; sourceTree = "<group>"; }; + DF1AD1D015FCE77900E10810 /* Player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Player.cpp; sourceTree = "<group>"; }; + DF1AD1D115FCE77900E10810 /* Player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Player.h; sourceTree = "<group>"; }; + DF1AD1D415FCE77900E10810 /* PlayList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayList.cpp; sourceTree = "<group>"; }; + DF1AD1D515FCE77900E10810 /* PlayList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayList.h; sourceTree = "<group>"; }; + DF1AD1D815FCE77900E10810 /* RenderCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCapture.h; sourceTree = "<group>"; }; + DF1AD1D915FCE77900E10810 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; }; + DF1AD1DC15FCE77900E10810 /* swighelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swighelper.h; sourceTree = "<group>"; }; + DF1AD1DD15FCE77900E10810 /* Tuple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tuple.h; sourceTree = "<group>"; }; + DF1AD1DE15FCE77900E10810 /* Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window.cpp; sourceTree = "<group>"; }; + DF1AD1DF15FCE77900E10810 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = "<group>"; }; + DF1AD1E215FCE77900E10810 /* WindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialog.cpp; sourceTree = "<group>"; }; + DF1AD1E315FCE77900E10810 /* WindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialog.h; sourceTree = "<group>"; }; + DF1AD1E615FCE77900E10810 /* WindowDialogMixin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowDialogMixin.cpp; sourceTree = "<group>"; }; + DF1AD1E715FCE77900E10810 /* WindowDialogMixin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDialogMixin.h; sourceTree = "<group>"; }; + DF1AD1EA15FCE77900E10810 /* WindowException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowException.h; sourceTree = "<group>"; }; + DF1AD1EB15FCE77900E10810 /* WindowInterceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowInterceptor.h; sourceTree = "<group>"; }; + DF1AD1EC15FCE77900E10810 /* WindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowXML.cpp; sourceTree = "<group>"; }; + DF1AD1ED15FCE77900E10810 /* WindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowXML.h; sourceTree = "<group>"; }; DF2345D915FA639500A934F6 /* UPnP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnP.cpp; sourceTree = "<group>"; }; DF2345DA15FA639500A934F6 /* UPnP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnP.h; sourceTree = "<group>"; }; DF2345DB15FA639500A934F6 /* UPnPInternal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPInternal.cpp; sourceTree = "<group>"; }; @@ -1877,6 +1893,7 @@ DF34892913FD9C780026A711 /* AirPlayServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirPlayServer.h; sourceTree = "<group>"; }; DF34897A13FDAA270026A711 /* HttpParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpParser.h; sourceTree = "<group>"; }; DF34898113FDAAF60026A711 /* HttpParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpParser.cpp; sourceTree = "<group>"; }; + DF357C5F15D9ADB600C1EEC7 /* addonbindings.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = addonbindings.a; path = xbmc/interfaces/addonbindings.a; sourceTree = "<group>"; }; DF448455140048A60069344B /* AirTunesServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AirTunesServer.cpp; sourceTree = "<group>"; }; DF448456140048A60069344B /* AirTunesServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirTunesServer.h; sourceTree = "<group>"; }; DF44845B140048C80069344B /* PipesManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipesManager.cpp; sourceTree = "<group>"; }; @@ -2031,7 +2048,6 @@ E33466A50D2E5103005A65EC /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; E33979940D62FD47004ECDDA /* DVDInputStreamTV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDInputStreamTV.cpp; sourceTree = "<group>"; }; E33979950D62FD47004ECDDA /* DVDInputStreamTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDInputStreamTV.h; sourceTree = "<group>"; }; - E354EF030D99EDC900B55311 /* controlradiobutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlradiobutton.cpp; sourceTree = "<group>"; }; E36578860D3AA7B40033CC1C /* DVDPlayerCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDPlayerCodec.cpp; sourceTree = "<group>"; }; E36578870D3AA7B40033CC1C /* DVDPlayerCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDPlayerCodec.h; sourceTree = "<group>"; }; E36C29DB0DA72429001F0C9D /* Artist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Artist.cpp; sourceTree = "<group>"; }; @@ -2579,27 +2595,6 @@ E38E19730D25F9FB00618676 /* hdhomerun_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hdhomerun_os.h; sourceTree = "<group>"; }; E38E19740D25F9FB00618676 /* hdhomerun_pkt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hdhomerun_pkt.h; sourceTree = "<group>"; }; E38E19750D25F9FB00618676 /* hdhomerun_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hdhomerun_video.h; sourceTree = "<group>"; }; - E38E19DC0D25F9FB00618676 /* action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = action.h; sourceTree = "<group>"; }; - E38E19DE0D25F9FB00618676 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = control.h; sourceTree = "<group>"; }; - E38E19EA0D25F9FB00618676 /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialog.h; sourceTree = "<group>"; }; - E38E19EC0D25F9FB00618676 /* GUIPythonWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindow.h; sourceTree = "<group>"; }; - E38E19EE0D25F9FB00618676 /* GUIPythonWindowDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowDialog.h; sourceTree = "<group>"; }; - E38E19F00D25F9FB00618676 /* GUIPythonWindowXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXML.h; sourceTree = "<group>"; }; - E38E19F20D25F9FB00618676 /* GUIPythonWindowXMLDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIPythonWindowXMLDialog.h; sourceTree = "<group>"; }; - E38E19F40D25F9FB00618676 /* infotagmusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagmusic.h; sourceTree = "<group>"; }; - E38E19F60D25F9FB00618676 /* infotagvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infotagvideo.h; sourceTree = "<group>"; }; - E38E19F80D25F9FB00618676 /* keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboard.h; sourceTree = "<group>"; }; - E38E19FA0D25F9FB00618676 /* listitem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = listitem.h; sourceTree = "<group>"; }; - E38E19FE0D25F9FB00618676 /* player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player.h; sourceTree = "<group>"; }; - E38E1A000D25F9FB00618676 /* pyplaylist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyplaylist.h; sourceTree = "<group>"; }; - E38E1A020D25F9FB00618676 /* PythonPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonPlayer.h; sourceTree = "<group>"; }; - E38E1A040D25F9FB00618676 /* pyutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyutil.h; sourceTree = "<group>"; }; - E38E1A060D25F9FB00618676 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = window.h; sourceTree = "<group>"; }; - E38E1A080D25F9FB00618676 /* winxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winxml.h; sourceTree = "<group>"; }; - E38E1A0D0D25F9FB00618676 /* XBPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPython.cpp; sourceTree = "<group>"; }; - E38E1A0E0D25F9FB00618676 /* XBPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPython.h; sourceTree = "<group>"; }; - E38E1A110D25F9FB00618676 /* XBPyThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBPyThread.cpp; sourceTree = "<group>"; }; - E38E1A120D25F9FB00618676 /* XBPyThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBPyThread.h; sourceTree = "<group>"; }; E38E1A140D25F9FB00618676 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; }; E38E1A150D25F9FB00618676 /* guideclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guideclient.h; sourceTree = "<group>"; }; E38E1A160D25F9FB00618676 /* GuideParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuideParser.h; sourceTree = "<group>"; }; @@ -2948,37 +2943,6 @@ E38E256C0D263A1C00618676 /* librtv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librtv.a; path = lib/libRTV/librtv.a; sourceTree = "<group>"; }; E38E25770D263BF600618676 /* unpack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unpack.cpp; sourceTree = "<group>"; }; E38E257B0D263C4400618676 /* rar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rar.cpp; sourceTree = "<group>"; }; - E38E257E0D263CE000618676 /* action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = action.cpp; sourceTree = "<group>"; }; - E38E257F0D263CE000618676 /* control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = control.cpp; sourceTree = "<group>"; }; - E38E25800D263CE000618676 /* controlbutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlbutton.cpp; sourceTree = "<group>"; }; - E38E25810D263CE000618676 /* controlcheckmark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlcheckmark.cpp; sourceTree = "<group>"; }; - E38E25820D263CE000618676 /* controlfadelabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlfadelabel.cpp; sourceTree = "<group>"; }; - E38E25830D263CE000618676 /* controlgroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlgroup.cpp; sourceTree = "<group>"; }; - E38E25840D263CE000618676 /* controlimage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlimage.cpp; sourceTree = "<group>"; }; - E38E25850D263CE000618676 /* controllabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllabel.cpp; sourceTree = "<group>"; }; - E38E25860D263CE000618676 /* controllist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controllist.cpp; sourceTree = "<group>"; }; - E38E25870D263CE000618676 /* controlprogress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlprogress.cpp; sourceTree = "<group>"; }; - E38E25880D263CE000618676 /* controlspin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlspin.cpp; sourceTree = "<group>"; }; - E38E25890D263CE000618676 /* controltextbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controltextbox.cpp; sourceTree = "<group>"; }; - E38E258A0D263CE000618676 /* dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialog.cpp; sourceTree = "<group>"; }; - E38E258B0D263CE000618676 /* GUIPythonWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindow.cpp; sourceTree = "<group>"; }; - E38E258C0D263CE000618676 /* GUIPythonWindowDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowDialog.cpp; sourceTree = "<group>"; }; - E38E258D0D263CE000618676 /* GUIPythonWindowXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXML.cpp; sourceTree = "<group>"; }; - E38E258E0D263CE000618676 /* GUIPythonWindowXMLDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIPythonWindowXMLDialog.cpp; sourceTree = "<group>"; }; - E38E258F0D263CE000618676 /* infotagmusic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagmusic.cpp; sourceTree = "<group>"; }; - E38E25900D263CE000618676 /* infotagvideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infotagvideo.cpp; sourceTree = "<group>"; }; - E38E25910D263CE000618676 /* keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = keyboard.cpp; sourceTree = "<group>"; }; - E38E25920D263CE000618676 /* listitem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listitem.cpp; sourceTree = "<group>"; }; - E38E25930D263CE000618676 /* player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player.cpp; sourceTree = "<group>"; }; - E38E25940D263CE000618676 /* pyplaylist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyplaylist.cpp; sourceTree = "<group>"; }; - E38E25950D263CE000618676 /* PythonPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonPlayer.cpp; sourceTree = "<group>"; }; - E38E25960D263CE000618676 /* pyutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyutil.cpp; sourceTree = "<group>"; }; - E38E25970D263CE000618676 /* window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = window.cpp; sourceTree = "<group>"; }; - E38E25980D263CE000618676 /* winxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxml.cpp; sourceTree = "<group>"; }; - E38E25990D263CE000618676 /* winxmldialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winxmldialog.cpp; sourceTree = "<group>"; }; - E38E259A0D263CE000618676 /* xbmcguimodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcguimodule.cpp; sourceTree = "<group>"; }; - E38E259B0D263CE000618676 /* xbmcmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcmodule.cpp; sourceTree = "<group>"; }; - E38E259C0D263CE000618676 /* xbmcplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcplugin.cpp; sourceTree = "<group>"; }; E38E25BF0D263DC100618676 /* DVDFactoryDemuxer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDFactoryDemuxer.cpp; sourceTree = "<group>"; }; E38E25C20D263DE200618676 /* DVDDemuxFFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDDemuxFFmpeg.cpp; sourceTree = "<group>"; }; E3A478090D29029A00F3C3A6 /* GUIDialogCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogCache.cpp; sourceTree = "<group>"; }; @@ -3224,8 +3188,6 @@ F5E10533140AA38000175026 /* Peripherals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Peripherals.cpp; sourceTree = "<group>"; }; F5E10534140AA38000175026 /* Peripherals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Peripherals.h; sourceTree = "<group>"; }; F5E10535140AA38000175026 /* PeripheralTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralTypes.h; sourceTree = "<group>"; }; - F5E1125C14356B2400175026 /* pyrendercapture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pyrendercapture.cpp; sourceTree = "<group>"; }; - F5E1125D14356B2400175026 /* pyrendercapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pyrendercapture.h; sourceTree = "<group>"; }; F5E55B5B10741272006E788A /* DVDPlayerTeletext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDPlayerTeletext.cpp; sourceTree = "<group>"; }; F5E55B5C10741272006E788A /* DVDPlayerTeletext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDPlayerTeletext.h; sourceTree = "<group>"; }; F5E55B64107412DE006E788A /* GUIDialogTeletext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogTeletext.h; sourceTree = "<group>"; }; @@ -3320,6 +3282,7 @@ F59879080FBAA0C3008EF4FB /* QuartzCore.framework in Frameworks */, F52A733D1560BC34005B1A0B /* CoreFoundation.framework in Frameworks */, DFBE805115F7D75700D7D102 /* SystemConfiguration.framework in Frameworks */, + DF357C6015D9ADB600C1EEC7 /* addonbindings.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4094,7 +4057,8 @@ F5AE406E13415D8C0004BD79 /* http-api */, 7C89674213C03B21003631FE /* info */, F5AE407F13415D9E0004BD79 /* json-rpc */, - E38E19820D25F9FB00618676 /* python */, + DF1AD17B15FCE77900E10810 /* legacy */, + DF1ACFE815FCE53900E10810 /* python */, F5A7A700112893E50059D6AA /* AnnouncementManager.cpp */, F5A7A701112893E50059D6AA /* AnnouncementManager.h */, 7CCF7F1B1069F3AE00992676 /* Builtins.cpp */, @@ -4491,6 +4455,96 @@ path = epg; sourceTree = "<group>"; }; + DF1ACFD015FCE50700E10810 /* generated */ = { + isa = PBXGroup; + children = ( + DF1ACFD115FCE50700E10810 /* AddonModuleXbmc.cpp */, + DF1ACFD515FCE50700E10810 /* AddonModuleXbmcaddon.cpp */, + DF1ACFD915FCE50700E10810 /* AddonModuleXbmcgui.cpp */, + DF1ACFDD15FCE50700E10810 /* AddonModuleXbmcplugin.cpp */, + DF1ACFE115FCE50700E10810 /* AddonModuleXbmcvfs.cpp */, + ); + name = generated; + path = python/generated; + sourceTree = "<group>"; + }; + DF1ACFE815FCE53900E10810 /* python */ = { + isa = PBXGroup; + children = ( + DF1ACFD015FCE50700E10810 /* generated */, + ); + name = python; + sourceTree = "<group>"; + }; + DF1AD17B15FCE77900E10810 /* legacy */ = { + isa = PBXGroup; + children = ( + DF1AD17C15FCE77900E10810 /* Addon.cpp */, + DF1AD17D15FCE77900E10810 /* Addon.h */, + DF1AD18015FCE77900E10810 /* AddonCallback.cpp */, + DF1AD18115FCE77900E10810 /* AddonCallback.h */, + DF1AD18415FCE77900E10810 /* AddonClass.cpp */, + DF1AD18515FCE77900E10810 /* AddonClass.h */, + DF1AD18815FCE77900E10810 /* AddonString.h */, + DF1AD18915FCE77900E10810 /* AddonUtils.cpp */, + DF1AD18A15FCE77900E10810 /* AddonUtils.h */, + DF1AD18D15FCE77900E10810 /* Alternative.h */, + DF1AD18E15FCE77900E10810 /* aojsonrpc.h */, + DF1AD18F15FCE77900E10810 /* CallbackFunction.cpp */, + DF1AD19015FCE77900E10810 /* CallbackFunction.h */, + DF1AD19315FCE77900E10810 /* CallbackHandler.cpp */, + DF1AD19415FCE77900E10810 /* CallbackHandler.h */, + DF1AD19715FCE77900E10810 /* Control.cpp */, + DF1AD19815FCE77900E10810 /* Control.h */, + DF1AD19B15FCE77900E10810 /* Dialog.cpp */, + DF1AD19C15FCE77900E10810 /* Dialog.h */, + DF1AD19F15FCE77900E10810 /* Dictionary.h */, + DF1AD1A015FCE77900E10810 /* Exception.h */, + DF1AD1A115FCE77900E10810 /* File.cpp */, + DF1AD1A215FCE77900E10810 /* File.h */, + DF1AD1A515FCE77900E10810 /* InfoTagMusic.cpp */, + DF1AD1A615FCE77900E10810 /* InfoTagMusic.h */, + DF1AD1A915FCE77900E10810 /* InfoTagVideo.cpp */, + DF1AD1AA15FCE77900E10810 /* InfoTagVideo.h */, + DF1AD1AD15FCE77900E10810 /* Keyboard.cpp */, + DF1AD1AE15FCE77900E10810 /* Keyboard.h */, + DF1AD1B115FCE77900E10810 /* LanguageHook.cpp */, + DF1AD1B215FCE77900E10810 /* LanguageHook.h */, + DF1AD1B615FCE77900E10810 /* List.h */, + DF1AD1B715FCE77900E10810 /* ListItem.cpp */, + DF1AD1B815FCE77900E10810 /* ListItem.h */, + DF1AD1BC15FCE77900E10810 /* ModuleXbmc.cpp */, + DF1AD1BD15FCE77900E10810 /* ModuleXbmc.h */, + DF1AD1C015FCE77900E10810 /* ModuleXbmcgui.cpp */, + DF1AD1C115FCE77900E10810 /* ModuleXbmcgui.h */, + DF1AD1C415FCE77900E10810 /* ModuleXbmcplugin.cpp */, + DF1AD1C515FCE77900E10810 /* ModuleXbmcplugin.h */, + DF1AD1C815FCE77900E10810 /* ModuleXbmcvfs.cpp */, + DF1AD1C915FCE77900E10810 /* ModuleXbmcvfs.h */, + DF1AD1CC15FCE77900E10810 /* Monitor.cpp */, + DF1AD1CD15FCE77900E10810 /* Monitor.h */, + DF1AD1D015FCE77900E10810 /* Player.cpp */, + DF1AD1D115FCE77900E10810 /* Player.h */, + DF1AD1D415FCE77900E10810 /* PlayList.cpp */, + DF1AD1D515FCE77900E10810 /* PlayList.h */, + DF1AD1D815FCE77900E10810 /* RenderCapture.h */, + DF1AD1D915FCE77900E10810 /* String.cpp */, + DF1AD1DC15FCE77900E10810 /* swighelper.h */, + DF1AD1DD15FCE77900E10810 /* Tuple.h */, + DF1AD1DE15FCE77900E10810 /* Window.cpp */, + DF1AD1DF15FCE77900E10810 /* Window.h */, + DF1AD1E215FCE77900E10810 /* WindowDialog.cpp */, + DF1AD1E315FCE77900E10810 /* WindowDialog.h */, + DF1AD1E615FCE77900E10810 /* WindowDialogMixin.cpp */, + DF1AD1E715FCE77900E10810 /* WindowDialogMixin.h */, + DF1AD1EA15FCE77900E10810 /* WindowException.h */, + DF1AD1EB15FCE77900E10810 /* WindowInterceptor.h */, + DF1AD1EC15FCE77900E10810 /* WindowXML.cpp */, + DF1AD1ED15FCE77900E10810 /* WindowXML.h */, + ); + path = legacy; + sourceTree = "<group>"; + }; DF2345D715FA639500A934F6 /* upnp */ = { isa = PBXGroup; children = ( @@ -5586,86 +5640,6 @@ path = libid3tag; sourceTree = "<group>"; }; - E38E19820D25F9FB00618676 /* python */ = { - isa = PBXGroup; - children = ( - E38E19DA0D25F9FB00618676 /* xbmcmodule */, - E38E1A0D0D25F9FB00618676 /* XBPython.cpp */, - E38E1A0E0D25F9FB00618676 /* XBPython.h */, - E38E1A110D25F9FB00618676 /* XBPyThread.cpp */, - E38E1A120D25F9FB00618676 /* XBPyThread.h */, - ); - path = python; - sourceTree = "<group>"; - }; - E38E19DA0D25F9FB00618676 /* xbmcmodule */ = { - isa = PBXGroup; - children = ( - E38E257E0D263CE000618676 /* action.cpp */, - E38E19DC0D25F9FB00618676 /* action.h */, - E38E257F0D263CE000618676 /* control.cpp */, - E38E19DE0D25F9FB00618676 /* control.h */, - E38E25800D263CE000618676 /* controlbutton.cpp */, - E38E25810D263CE000618676 /* controlcheckmark.cpp */, - 1830212713B8E2DC00770920 /* controledit.cpp */, - E38E25820D263CE000618676 /* controlfadelabel.cpp */, - E38E25830D263CE000618676 /* controlgroup.cpp */, - E38E25840D263CE000618676 /* controlimage.cpp */, - E38E25850D263CE000618676 /* controllabel.cpp */, - E38E25860D263CE000618676 /* controllist.cpp */, - E38E25870D263CE000618676 /* controlprogress.cpp */, - E354EF030D99EDC900B55311 /* controlradiobutton.cpp */, - C80425701158A0DE00D158A6 /* controlslider.cpp */, - E38E25880D263CE000618676 /* controlspin.cpp */, - E38E25890D263CE000618676 /* controltextbox.cpp */, - E38E258A0D263CE000618676 /* dialog.cpp */, - E38E19EA0D25F9FB00618676 /* dialog.h */, - E38E258B0D263CE000618676 /* GUIPythonWindow.cpp */, - E38E19EC0D25F9FB00618676 /* GUIPythonWindow.h */, - E38E258C0D263CE000618676 /* GUIPythonWindowDialog.cpp */, - E38E19EE0D25F9FB00618676 /* GUIPythonWindowDialog.h */, - E38E258D0D263CE000618676 /* GUIPythonWindowXML.cpp */, - E38E19F00D25F9FB00618676 /* GUIPythonWindowXML.h */, - E38E258E0D263CE000618676 /* GUIPythonWindowXMLDialog.cpp */, - E38E19F20D25F9FB00618676 /* GUIPythonWindowXMLDialog.h */, - E38E258F0D263CE000618676 /* infotagmusic.cpp */, - E38E19F40D25F9FB00618676 /* infotagmusic.h */, - E38E25900D263CE000618676 /* infotagvideo.cpp */, - E38E19F60D25F9FB00618676 /* infotagvideo.h */, - E38E25910D263CE000618676 /* keyboard.cpp */, - E38E19F80D25F9FB00618676 /* keyboard.h */, - E38E25920D263CE000618676 /* listitem.cpp */, - E38E19FA0D25F9FB00618676 /* listitem.h */, - C8936050152C86CF00812418 /* monitor.cpp */, - C8936051152C86CF00812418 /* monitor.h */, - E38E25930D263CE000618676 /* player.cpp */, - E38E19FE0D25F9FB00618676 /* player.h */, - E38E25940D263CE000618676 /* pyplaylist.cpp */, - E38E1A000D25F9FB00618676 /* pyplaylist.h */, - F5E1125C14356B2400175026 /* pyrendercapture.cpp */, - F5E1125D14356B2400175026 /* pyrendercapture.h */, - 7CD2CCFE11B38B000009EFC1 /* PythonAddon.cpp */, - 7CD2CCFF11B38B000009EFC1 /* PythonAddon.h */, - C8936054152C86D800812418 /* PythonMonitor.cpp */, - C8936055152C86D800812418 /* PythonMonitor.h */, - E38E25950D263CE000618676 /* PythonPlayer.cpp */, - E38E1A020D25F9FB00618676 /* PythonPlayer.h */, - E38E25960D263CE000618676 /* pyutil.cpp */, - E38E1A040D25F9FB00618676 /* pyutil.h */, - E38E25970D263CE000618676 /* window.cpp */, - E38E1A060D25F9FB00618676 /* window.h */, - E38E25980D263CE000618676 /* winxml.cpp */, - E38E1A080D25F9FB00618676 /* winxml.h */, - E38E25990D263CE000618676 /* winxmldialog.cpp */, - 7CD2CD0011B38B000009EFC1 /* xbmcaddonmodule.cpp */, - E38E259A0D263CE000618676 /* xbmcguimodule.cpp */, - E38E259B0D263CE000618676 /* xbmcmodule.cpp */, - E38E259C0D263CE000618676 /* xbmcplugin.cpp */, - 189047D11301DEAB00C11012 /* xbmcvfsmodule.cpp */, - ); - path = xbmcmodule; - sourceTree = "<group>"; - }; E38E1A130D25F9FB00618676 /* libRTV */ = { isa = PBXGroup; children = ( @@ -6310,6 +6284,7 @@ F57E1ED20E36E8FD00700C9D /* internal libs */ = { isa = PBXGroup; children = ( + DF357C5F15D9ADB600C1EEC7 /* addonbindings.a */, F5DC888A110A654000EE1B15 /* libapetag.a */, E38E256C0D263A1C00618676 /* librtv.a */, 43352CED1071634600706B8A /* libsquish.a */, @@ -6955,8 +6930,6 @@ E38E20D60D25F9FD00618676 /* LangCodeExpander.cpp in Sources */, E38E20D70D25F9FD00618676 /* LangInfo.cpp in Sources */, E38E20D80D25F9FD00618676 /* LastFmManager.cpp in Sources */, - E38E21600D25F9FD00618676 /* XBPython.cpp in Sources */, - E38E21620D25F9FD00618676 /* XBPyThread.cpp in Sources */, E38E21670D25F9FD00618676 /* scrobbler.cpp in Sources */, E38E21740D25F9FD00618676 /* MediaCrawler.cpp in Sources */, E38E21760D25F9FD00618676 /* PltMicroMediaController.cpp in Sources */, @@ -7099,37 +7072,6 @@ E38E23150D25F9FE00618676 /* xbmc.cpp in Sources */, E38E25780D263BF600618676 /* unpack.cpp in Sources */, E38E257C0D263C4400618676 /* rar.cpp in Sources */, - E38E259D0D263CE000618676 /* action.cpp in Sources */, - E38E259E0D263CE000618676 /* control.cpp in Sources */, - E38E259F0D263CE000618676 /* controlbutton.cpp in Sources */, - E38E25A00D263CE000618676 /* controlcheckmark.cpp in Sources */, - E38E25A10D263CE000618676 /* controlfadelabel.cpp in Sources */, - E38E25A20D263CE000618676 /* controlgroup.cpp in Sources */, - E38E25A30D263CE000618676 /* controlimage.cpp in Sources */, - E38E25A40D263CE000618676 /* controllabel.cpp in Sources */, - E38E25A50D263CE000618676 /* controllist.cpp in Sources */, - E38E25A60D263CE000618676 /* controlprogress.cpp in Sources */, - E38E25A70D263CE000618676 /* controlspin.cpp in Sources */, - E38E25A80D263CE000618676 /* controltextbox.cpp in Sources */, - E38E25A90D263CE000618676 /* dialog.cpp in Sources */, - E38E25AA0D263CE000618676 /* GUIPythonWindow.cpp in Sources */, - E38E25AB0D263CE000618676 /* GUIPythonWindowDialog.cpp in Sources */, - E38E25AC0D263CE000618676 /* GUIPythonWindowXML.cpp in Sources */, - E38E25AD0D263CE000618676 /* GUIPythonWindowXMLDialog.cpp in Sources */, - E38E25AE0D263CE000618676 /* infotagmusic.cpp in Sources */, - E38E25AF0D263CE000618676 /* infotagvideo.cpp in Sources */, - E38E25B00D263CE000618676 /* keyboard.cpp in Sources */, - E38E25B10D263CE000618676 /* listitem.cpp in Sources */, - E38E25B20D263CE000618676 /* player.cpp in Sources */, - E38E25B30D263CE000618676 /* pyplaylist.cpp in Sources */, - E38E25B40D263CE000618676 /* PythonPlayer.cpp in Sources */, - E38E25B50D263CE000618676 /* pyutil.cpp in Sources */, - E38E25B60D263CE000618676 /* window.cpp in Sources */, - E38E25B70D263CE000618676 /* winxml.cpp in Sources */, - E38E25B80D263CE000618676 /* winxmldialog.cpp in Sources */, - E38E25B90D263CE000618676 /* xbmcguimodule.cpp in Sources */, - E38E25BA0D263CE000618676 /* xbmcmodule.cpp in Sources */, - E38E25BB0D263CE000618676 /* xbmcplugin.cpp in Sources */, E38E25C00D263DC100618676 /* DVDFactoryDemuxer.cpp in Sources */, E38E25C30D263DE200618676 /* DVDDemuxFFmpeg.cpp in Sources */, E3A4780A0D29029A00F3C3A6 /* GUIDialogCache.cpp in Sources */, @@ -7148,7 +7090,6 @@ E3E920020D8C622A002BF43D /* EventClient.cpp in Sources */, E38A06CE0D95AA5500FF8227 /* GUIDialogKaiToast.cpp in Sources */, E3B53E7C0D97B08100021A96 /* DVDSubtitleParserMicroDVD.cpp in Sources */, - E354EF040D99EDC900B55311 /* controlradiobutton.cpp in Sources */, E36C29DF0DA72429001F0C9D /* Artist.cpp in Sources */, E36C29E00DA72429001F0C9D /* Album.cpp in Sources */, E36C29E60DA72442001F0C9D /* DVDSubtitleParserSami.cpp in Sources */, @@ -7329,7 +7270,6 @@ 18B4A0061152BFA5001AF8A6 /* ScreenSaver.cpp in Sources */, 18B4A0071152BFA5001AF8A6 /* Visualisation.cpp in Sources */, 7C8A14571154CB2600E5FCFA /* TextureCache.cpp in Sources */, - C80425711158A0DE00D158A6 /* controlslider.cpp in Sources */, 7C8A187D115B2A8200E5FCFA /* TextureDatabase.cpp in Sources */, F52BFFDB115D5574004B1D66 /* AddonStatusHandler.cpp in Sources */, C85EB75C1174614E0008E5A5 /* Repository.cpp in Sources */, @@ -7340,8 +7280,6 @@ F50FE04A11A3410300C8B8CD /* EncoderFlac.cpp in Sources */, F50FE04E11A3411A00C8B8CD /* EncoderFFmpeg.cpp in Sources */, 183FDF8A11AF0B0500B81E9C /* PluginSource.cpp in Sources */, - 7CD2CD0311B38B000009EFC1 /* PythonAddon.cpp in Sources */, - 7CD2CD0411B38B000009EFC1 /* xbmcaddonmodule.cpp in Sources */, F58E293911FFC103006F4D46 /* DVDInputStreamBluray.cpp in Sources */, F5BDB80C120202F400F0B710 /* DVDSubtitleTagSami.cpp in Sources */, F5BDB81A1202032400F0B710 /* DVDSubtitleTagMicroDVD.cpp in Sources */, @@ -7501,7 +7439,6 @@ 433219D912E4C6A500CD7486 /* UDFDirectory.cpp in Sources */, 7C4705AE12EF584C00369E51 /* AddonInstaller.cpp in Sources */, 18C1D22D13033F6A00CFFE59 /* GLUtils.cpp in Sources */, - 183C454D130C4D55006AA317 /* xbmcvfsmodule.cpp in Sources */, F56579AF13060D1E0085ED7F /* RenderCapture.cpp in Sources */, 7C84A59E12FA3C1600CD1714 /* SourcesDirectory.cpp in Sources */, F57A1D1E1329B15300498CC7 /* AutoPool.mm in Sources */, @@ -7534,7 +7471,6 @@ F558F29613ABD7DF00631E12 /* GUIWindowDebugInfo.cpp in Sources */, DF0DF15C13A3ADA7008ED511 /* NFSDirectory.cpp in Sources */, 7C89619213B6A16F003631FE /* GUIWindowScreensaverDim.cpp in Sources */, - 1830212813B8E2DC00770920 /* controledit.cpp in Sources */, 18ECC96213CF178D00A9ED6C /* StreamUtils.cpp in Sources */, F5CEE60913D3C89700225F72 /* DVDOverlayCodecTX3G.cpp in Sources */, 38F4E57013CCCB3B00664821 /* Implementation.cpp in Sources */, @@ -7564,7 +7500,6 @@ F5E10543140AA38100175026 /* GUIDialogPeripheralManager.cpp in Sources */, F5E10544140AA38100175026 /* GUIDialogPeripheralSettings.cpp in Sources */, F5E10547140AA38100175026 /* Peripherals.cpp in Sources */, - F5E1125E14356B2400175026 /* pyrendercapture.cpp in Sources */, F5E1138014357F3800175026 /* PeripheralCecAdapter.cpp in Sources */, F54BCC5F1439345300F86B0F /* HotKeyController.m in Sources */, DF673AA51443819600A5A509 /* AddonManager.cpp in Sources */, @@ -7615,8 +7550,6 @@ DF93D7F21444B54A007C6459 /* HDHomeRunFile.cpp in Sources */, DF93D7F61444B568007C6459 /* HDHomeRunDirectory.cpp in Sources */, 7C1A85661520522500C63311 /* TextureCacheJob.cpp in Sources */, - C8936052152C86CF00812418 /* monitor.cpp in Sources */, - C8936056152C86D800812418 /* PythonMonitor.cpp in Sources */, 7C1F6EBB13ECCFA7001726AB /* LibraryDirectory.cpp in Sources */, EC720A8F155091BB00FFD782 /* ilog.cpp in Sources */, EC720A9D1550927000FFD782 /* XbmcContext.cpp in Sources */, @@ -7810,6 +7743,7 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces/bindings\"", ); LINK_WITH_STANDARD_LIBRARIES = YES; OTHER_CPLUSPLUSFLAGS = ( @@ -7931,6 +7865,7 @@ "\"$(SRCROOT)/lib/ffmpeg/libswresample\"", "\"$(SRCROOT)/lib/ffmpeg/libpostproc\"", "\"$(SRCROOT)/lib/ffmpeg/libswscale\"", + "\"$(SRCROOT)/xbmc/interfaces/bindings\"", ); LINK_WITH_STANDARD_LIBRARIES = YES; OTHER_CPLUSPLUSFLAGS = ( diff --git a/configure.in b/configure.in index a06d69f31b..c7bab6b2e5 100644 --- a/configure.in +++ b/configure.in @@ -1574,6 +1574,31 @@ else AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1], [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.]) fi +echo "Checking for SWIG installation" +AC_PATH_PROG(SWIG_EXE, swig, "none") +if test "$SWIG_EXE" = "none"; then + AC_MSG_ERROR($missing_program) +fi +final_message="$final_message\n SWIG Available:\tYes" + +echo "Checking for a jre installation" +AC_PATH_PROG(JAVA_EXE, java, "none") +if test "$JAVE_EXE" = "none"; then + AC_MSG_ERROR($missing_program) +fi +final_message="$final_message\n JRE Available:\tYes" + +echo "Checking for doxygen installation" +AC_PATH_PROG(DOXYGEN_EXE, doxygen, "none") +if test "$DOXYGEN_EXE" = "none"; then + AC_MSG_WARN([Unable to find doxygen installation. Will not be able to make docstrings for the python api]) + final_message="$final_message\n Doxygen Available:\tNo" + USE_DOXYGEN=0 +else + final_message="$final_message\n Doxygen Available:\tYes" + USE_DOXYGEN=1 +fi + # VDPAU if test "x$use_vdpau" != "xno"; then if test "$host_vendor" = "apple" ; then @@ -2269,8 +2294,6 @@ OUTPUT_FILES="Makefile \ lib/libid3tag/Makefile \ lib/cximage-6.0/Makefile \ lib/addons/script.module.pil/Makefile \ - xbmc/interfaces/python/Makefile \ - xbmc/interfaces/python/xbmcmodule/Makefile \ lib/libUPnP/Makefile \ xbmc/DllPaths_generated.h \ xbmc/DllPaths_generated_android.h \ @@ -2301,6 +2324,9 @@ if test "$use_skin_touched" = "yes"; then OUTPUT_FILES="$OUTPUT_FILES addons/skin.touched/media/Makefile" fi +OUTPUT_FILES="$OUTPUT_FILES \ + xbmc/interfaces/python/Makefile" + # Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding # .dummy.am does nothing. AC_CONFIG_FILES([.dummy]) @@ -2362,6 +2388,7 @@ AC_SUBST(USE_UPNP) AC_SUBST(USE_OMXLIB) AC_SUBST(USE_ANDROID) AC_SUBST(GTEST_CONFIGURED) +AC_SUBST(USE_DOXYGEN) # pushd and popd are not available in other shells besides bash, so implement diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index da3e217f24..6eaacb5835 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -113,6 +113,8 @@ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">$(DXSDK_DIR)Lib\x86;$(LibraryPath)</LibraryPath> <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">$(DXSDK_DIR)Lib\x86;$(LibraryPath)</LibraryPath> <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">xbmc-test</TargetName> + <CustomBuildBeforeTargets Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'"> + </CustomBuildBeforeTargets> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'"> <ClCompile> @@ -139,6 +141,7 @@ <ForcedIncludeFiles>pch.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ShowIncludes>false</ShowIncludes> <MultiProcessorCompilation>true</MultiProcessorCompilation> + <ObjectFileName>$(IntDir)\a\a\%(RelativeDir)</ObjectFileName> </ClCompile> <Link> <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> @@ -181,6 +184,7 @@ <ShowIncludes>false</ShowIncludes> <MultiProcessorCompilation>true</MultiProcessorCompilation> <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet> + <ObjectFileName>$(IntDir)\a\a\%(RelativeDir)</ObjectFileName> </ClCompile> <Link> <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> @@ -272,6 +276,7 @@ <ForcedIncludeFiles>pch.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ShowIncludes>false</ShowIncludes> <MultiProcessorCompilation>true</MultiProcessorCompilation> + <ObjectFileName>$(IntDir)\a\a\%(RelativeDir)</ObjectFileName> </ClCompile> <Link> <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> @@ -312,6 +317,7 @@ <ForcedIncludeFiles>pch.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ShowIncludes>false</ShowIncludes> <MultiProcessorCompilation>true</MultiProcessorCompilation> + <ObjectFileName>$(IntDir)\a\a\%(RelativeDir)</ObjectFileName> </ClCompile> <Link> <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> @@ -712,130 +718,42 @@ <ClCompile Include="..\..\xbmc\interfaces\json-rpc\SystemOperations.cpp" /> <ClCompile Include="..\..\xbmc\interfaces\json-rpc\VideoLibrary.cpp" /> <ClCompile Include="..\..\xbmc\interfaces\json-rpc\XBMCOperations.cpp" /> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\action.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\control.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlbutton.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlcheckmark.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controledit.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlfadelabel.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlgroup.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlimage.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controllabel.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controllist.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlprogress.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlradiobutton.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlslider.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlspin.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controltextbox.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\dialog.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindow.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowDialog.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXML.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXMLDialog.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagmusic.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagvideo.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\keyboard.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\listitem.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\monitor.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\player.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyplaylist.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyrendercapture.cpp" /> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonAddon.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonPlayer.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonMonitor.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyutil.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\window.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\winxml.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\winxmldialog.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcaddonmodule.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcguimodule.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcmodule.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcplugin.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcvfsmodule.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\XBPython.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\XBPyThread.cpp"> - <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">..\..\project\BuildDependencies\include\python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Addon.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonCallback.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonClass.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonUtils.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\CallbackFunction.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\CallbackHandler.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Control.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Dialog.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\File.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\InfoTagMusic.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\InfoTagVideo.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Keyboard.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\LanguageHook.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ListItem.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmc.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcgui.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcplugin.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcvfs.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Monitor.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Player.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\PlayList.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\String.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Window.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowDialog.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowDialogMixin.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowXML.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\CallbackHandler.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmc.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcaddon.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcgui.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcplugin.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcvfs.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\LanguageHook.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\swig.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\XBPython.cpp" /> + <ClCompile Include="..\..\xbmc\interfaces\python\XBPyThread.cpp" /> <ClCompile Include="..\..\xbmc\LangInfo.cpp" /> <ClCompile Include="..\..\xbmc\MediaSource.cpp" /> <ClCompile Include="..\..\xbmc\music\Album.cpp" /> @@ -1105,7 +1023,49 @@ <ClInclude Include="..\..\xbmc\guilib\GUIKeyboard.h" /> <ClInclude Include="..\..\xbmc\guilib\GUIKeyboardFactory.h" /> <ClInclude Include="..\..\xbmc\input\windows\WINJoystick.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pythreadstate.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Addon.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonCallback.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonClass.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonString.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonUtils.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Alternative.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\aojsonrpc.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\CallbackFunction.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\CallbackHandler.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Control.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Dialog.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Dictionary.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Exception.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\File.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\InfoTagMusic.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\InfoTagVideo.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Keyboard.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\LanguageHook.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\List.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ListItem.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmc.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcgui.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcplugin.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcvfs.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Monitor.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Player.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\PlayList.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\RenderCapture.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\swighelper.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Tuple.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Window.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowDialog.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowDialogMixin.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowException.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowInterceptor.h" /> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowXML.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\CallbackHandler.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\LanguageHook.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\preamble.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\pythreadstate.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\swig.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" /> + <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h" /> <ClInclude Include="..\..\xbmc\music\MusicDbUrl.h" /> <ClInclude Include="..\..\xbmc\network\httprequesthandler\HTTPImageHandler.h" /> <ClInclude Include="..\..\xbmc\network\AirTunesServer.h" /> @@ -2185,30 +2145,6 @@ <ClInclude Include="..\..\xbmc\interfaces\json-rpc\SystemOperations.h" /> <ClInclude Include="..\..\xbmc\interfaces\json-rpc\VideoLibrary.h" /> <ClInclude Include="..\..\xbmc\interfaces\json-rpc\XBMCOperations.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\action.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\control.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\dialog.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindow.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowDialog.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXML.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXMLDialog.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagmusic.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagvideo.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\keyboard.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\listitem.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\monitor.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\player.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyjsonrpc.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyplaylist.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyrendercapture.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonAddon.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonMonitor.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonPlayer.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyutil.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\window.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\winxml.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h" /> <ClInclude Include="..\..\xbmc\IProgressCallback.h" /> <ClInclude Include="..\..\xbmc\LangInfo.h" /> <ClInclude Include="..\..\xbmc\MediaSource.h" /> @@ -2879,6 +2815,115 @@ <Project>{034b1d02-ca92-455d-8866-db95bee49c10}</Project> </ProjectReference> </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmc.i"> + <FileType>Document</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CALL $(SolutionDir)..\..\tools\codegenerator\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">%(RelativeDir)..\python\generated\%(Filename).cpp</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcaddon.i"> + <FileType>Document</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CALL $(SolutionDir)..\..\tools\codegenerator\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">%(RelativeDir)..\python\generated\%(Filename).cpp</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcgui.i"> + <FileType>Document</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CALL $(SolutionDir)..\..\tools\codegenerator\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">%(RelativeDir)..\python\generated\%(Filename).cpp</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcplugin.i"> + <FileType>Document</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CALL $(SolutionDir)..\..\tools\codegenerator\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">%(RelativeDir)..\python\generated\%(Filename).cpp</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcvfs.i"> + <FileType>Document</FileType> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CALL $(SolutionDir)..\..\tools\codegenerator\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">%(RelativeDir)..\python\generated\%(Filename).cpp</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">Generating SWIG bindings</Message> + <Message Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Command Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">CALL $(SolutionDir)..\BuildDependencies\GenerateSWIGBindings.bat %(RelativeDir) %(Filename)</Command> + <Message Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">Generating SWIG bindings</Message> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">%(RelativeDir)python\generated\%(Filename).cpp</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmc.xml"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcaddon.xml"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcgui.xml"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcplugin.xml"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcvfs.xml"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild> + </None> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index 1919e1c40d..aca6fe6322 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -130,9 +130,6 @@ <Filter Include="interfaces\http-api"> <UniqueIdentifier>{3616033f-20f3-48c8-96bd-b07f2eed008e}</UniqueIdentifier> </Filter> - <Filter Include="interfaces\python"> - <UniqueIdentifier>{d00b9c4f-dee7-4b68-a0d3-e8e6c815b888}</UniqueIdentifier> - </Filter> <Filter Include="interfaces\json-rpc"> <UniqueIdentifier>{15fc3844-6b50-4424-ba2c-ac9bd85d3ab0}</UniqueIdentifier> </Filter> @@ -181,9 +178,6 @@ <Filter Include="windowing\windows"> <UniqueIdentifier>{7db3d8e6-a261-4732-84e8-21bf2d3b0eb9}</UniqueIdentifier> </Filter> - <Filter Include="interfaces\python\xbmcmodule"> - <UniqueIdentifier>{257a54d6-994c-4c7d-a3bb-c46bb6423fda}</UniqueIdentifier> - </Filter> <Filter Include="libs"> <UniqueIdentifier>{4a09e4cc-709d-43b8-86cf-d83ca38d41ce}</UniqueIdentifier> </Filter> @@ -274,6 +268,18 @@ <Filter Include="network\upnp"> <UniqueIdentifier>{89c1ccdb-5d9b-447c-91e9-7c61e5cee042}</UniqueIdentifier> </Filter> + <Filter Include="interfaces\swig"> + <UniqueIdentifier>{3447ad7c-23a6-4586-856a-62fc75c2f3aa}</UniqueIdentifier> + </Filter> + <Filter Include="interfaces\legacy"> + <UniqueIdentifier>{9e178535-1590-42cd-a325-302f6bd8c28a}</UniqueIdentifier> + </Filter> + <Filter Include="interfaces\python"> + <UniqueIdentifier>{4d489407-c145-44ce-ab0a-a8da78067533}</UniqueIdentifier> + </Filter> + <Filter Include="interfaces\python\generated"> + <UniqueIdentifier>{4cc89394-6b5b-44db-86a2-8b71b65e85a8}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\xbmc\win32\pch.cpp"> @@ -1240,12 +1246,6 @@ <ClCompile Include="..\..\xbmc\interfaces\json-rpc\XBMCOperations.cpp"> <Filter>interfaces\json-rpc</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\XBPython.cpp"> - <Filter>interfaces\python</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\XBPyThread.cpp"> - <Filter>interfaces\python</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicInfo.cpp"> <Filter>music\dialogs</Filter> </ClCompile> @@ -1777,120 +1777,6 @@ <ClCompile Include="..\..\xbmc\addons\GUIWindowAddonBrowser.cpp"> <Filter>addons</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\action.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\control.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlbutton.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlcheckmark.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controledit.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlfadelabel.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlgroup.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlimage.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controllabel.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controllist.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlprogress.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlradiobutton.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlslider.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controlspin.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\controltextbox.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\dialog.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindow.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowDialog.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXML.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXMLDialog.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagmusic.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagvideo.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\keyboard.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\listitem.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\monitor.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\player.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyplaylist.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonAddon.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonMonitor.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonPlayer.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyutil.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\window.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\winxml.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\winxmldialog.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcaddonmodule.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcguimodule.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcmodule.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcplugin.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\dialogs\GUIDialogCache.cpp"> <Filter>dialogs</Filter> </ClCompile> @@ -2059,9 +1945,6 @@ <ClCompile Include="..\..\xbmc\pvr\PVRManager.cpp"> <Filter>pvr</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\xbmcvfsmodule.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\cores\VideoRenderers\RenderCapture.cpp"> <Filter>cores\VideoRenderers</Filter> </ClCompile> @@ -2215,9 +2098,6 @@ <ClCompile Include="..\..\xbmc\peripherals\dialogs\GUIDialogPeripheralSettings.cpp"> <Filter>peripherals\dialogs</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\interfaces\python\xbmcmodule\pyrendercapture.cpp"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\filesystem\AddonsDirectory.cpp"> <Filter>filesystem</Filter> </ClCompile> @@ -2975,6 +2855,114 @@ <ClCompile Include="..\..\xbmc\network\upnp\UPnPServer.cpp"> <Filter>network\upnp</Filter> </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Addon.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonCallback.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonClass.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\AddonUtils.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\CallbackFunction.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\CallbackHandler.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Control.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Dialog.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\File.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\InfoTagMusic.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\InfoTagVideo.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Keyboard.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\LanguageHook.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ListItem.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmc.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcgui.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcplugin.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\ModuleXbmcvfs.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Monitor.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Player.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\PlayList.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\String.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\Window.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowDialog.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowDialogMixin.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\legacy\WindowXML.cpp"> + <Filter>interfaces\legacy</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\CallbackHandler.cpp"> + <Filter>interfaces\python</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\LanguageHook.cpp"> + <Filter>interfaces\python</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\swig.cpp"> + <Filter>interfaces\python</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\XBPython.cpp"> + <Filter>interfaces\python</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\XBPyThread.cpp"> + <Filter>interfaces\python</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmc.cpp"> + <Filter>interfaces\python\generated</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcaddon.cpp"> + <Filter>interfaces\python\generated</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcgui.cpp"> + <Filter>interfaces\python\generated</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcplugin.cpp"> + <Filter>interfaces\python\generated</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcvfs.cpp"> + <Filter>interfaces\python\generated</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\xbmc\win32\pch.h"> @@ -4143,12 +4131,6 @@ <ClInclude Include="..\..\xbmc\interfaces\json-rpc\XBMCOperations.h"> <Filter>interfaces\json-rpc</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h"> - <Filter>interfaces\python</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h"> - <Filter>interfaces\python</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicInfo.h"> <Filter>music\dialogs</Filter> </ClInclude> @@ -4743,69 +4725,6 @@ <ClInclude Include="..\..\xbmc\addons\GUIWindowAddonBrowser.h"> <Filter>addons</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\action.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\control.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\dialog.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindow.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowDialog.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXML.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\GUIPythonWindowXMLDialog.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagmusic.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\infotagvideo.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\keyboard.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\listitem.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\monitor.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\player.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyjsonrpc.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyplaylist.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonAddon.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonMonitor.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\PythonPlayer.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyutil.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\window.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\winxml.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\dialogs\GUIDialogCache.h"> <Filter>dialogs</Filter> </ClInclude> @@ -5143,9 +5062,6 @@ <ClInclude Include="..\..\xbmc\peripherals\dialogs\GUIDialogPeripheralSettings.h"> <Filter>peripherals\dialogs</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pyrendercapture.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\filesystem\ZipManager.h"> <Filter>filesystem</Filter> </ClInclude> @@ -5510,9 +5426,6 @@ <ClInclude Include="..\..\xbmc\utils\POUtils.h"> <Filter>utils</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\pythreadstate.h"> - <Filter>interfaces\python\xbmcmodule</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\network\ZeroconfBrowser.h"> <Filter>network</Filter> </ClInclude> @@ -5773,6 +5686,135 @@ <ClInclude Include="..\..\xbmc\network\upnp\UPnPServer.h"> <Filter>network\upnp</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Addon.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonCallback.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonClass.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonString.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\AddonUtils.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Alternative.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\aojsonrpc.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\CallbackFunction.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\CallbackHandler.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Control.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Dialog.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Dictionary.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Exception.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\File.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\InfoTagMusic.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\InfoTagVideo.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Keyboard.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\LanguageHook.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\List.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ListItem.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmc.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcgui.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcplugin.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\ModuleXbmcvfs.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Monitor.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Player.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\PlayList.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\RenderCapture.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\swighelper.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Tuple.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\Window.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowDialog.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowDialogMixin.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowException.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowInterceptor.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\legacy\WindowXML.h"> + <Filter>interfaces\legacy</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\CallbackHandler.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\LanguageHook.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\preamble.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\pythreadstate.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\swig.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h"> + <Filter>interfaces\python</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h"> + <Filter>interfaces\python</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc"> @@ -5783,5 +5825,37 @@ <CustomBuild Include="..\..\xbmc\win32\PlatformInclude.h"> <Filter>win32</Filter> </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcplugin.i"> + <Filter>interfaces\swig</Filter> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcgui.i"> + <Filter>interfaces\swig</Filter> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcaddon.i"> + <Filter>interfaces\swig</Filter> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmcvfs.i"> + <Filter>interfaces\swig</Filter> + </CustomBuild> + <CustomBuild Include="..\..\xbmc\interfaces\swig\AddonModuleXbmc.i"> + <Filter>interfaces\swig</Filter> + </CustomBuild> + </ItemGroup> + <ItemGroup> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmc.xml"> + <Filter>interfaces\python\generated</Filter> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcaddon.xml"> + <Filter>interfaces\python\generated</Filter> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcgui.xml"> + <Filter>interfaces\python\generated</Filter> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcplugin.xml"> + <Filter>interfaces\python\generated</Filter> + </None> + <None Include="..\..\xbmc\interfaces\python\generated\AddonModuleXbmcvfs.xml"> + <Filter>interfaces\python\generated</Filter> + </None> </ItemGroup> </Project>
\ No newline at end of file diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp index 81a89f5ab9..36ed07ce33 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp @@ -33,6 +33,7 @@ #include "network/Network.h" #include "utils/log.h" #include "utils/URIUtils.h" +#include "utils/Variant.h" #include "guilib/GUIWindowManager.h" #include "settings/Settings.h" #include "settings/GUISettings.h" @@ -57,10 +58,6 @@ #include "storage/MediaManager.h" #include "guilib/LocalizeStrings.h" #include "threads/SingleLock.h" -#ifdef HAS_PYTHON -#include "interfaces/python/xbmcmodule/GUIPythonWindowDialog.h" -#include "interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.h" -#endif #ifdef HAS_HTTPAPI #include "interfaces/http-api/XBMChttp.h" @@ -724,13 +721,10 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg) case TMSG_GUI_PYTHON_DIALOG: { - if (pMsg->lpVoid) - { // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs - if (pMsg->dwParam1) - ((CGUIPythonWindowXMLDialog *)pMsg->lpVoid)->Show_Internal(pMsg->dwParam2 > 0); - else - ((CGUIPythonWindowDialog *)pMsg->lpVoid)->Show_Internal(pMsg->dwParam2 > 0); - } + // This hack is not much better but at least I don't need to make ApplicationMessenger + // know about Addon (Python) specific classes. + CAction caction(pMsg->dwParam1); + ((CGUIWindow*)pMsg->lpVoid)->OnAction(caction); } break; diff --git a/xbmc/guilib/GUIWindow.h b/xbmc/guilib/GUIWindow.h index 8cf3de2202..6b0b9b3d2d 100644 --- a/xbmc/guilib/GUIWindow.h +++ b/xbmc/guilib/GUIWindow.h @@ -191,6 +191,7 @@ public: bool HasSaveLastControl() const { return !m_defaultAlways; }; + virtual void OnDeinitWindow(int nextWindowID); protected: virtual EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event); virtual bool LoadXML(const CStdString& strPath, const CStdString &strLowerPath); ///< Loads from the given file @@ -201,7 +202,6 @@ protected: virtual void OnWindowUnload() {} virtual void OnWindowLoaded(); virtual void OnInitWindow(); - virtual void OnDeinitWindow(int nextWindowID); void Close_Internal(bool forceClose = false, int nextWindowID = 0, bool enableSound = true); EVENT_RESULT OnMouseAction(const CAction &action); virtual bool Animate(unsigned int currentTime); diff --git a/xbmc/interfaces/python/CallbackHandler.cpp b/xbmc/interfaces/python/CallbackHandler.cpp new file mode 100644 index 0000000000..21d401ea0a --- /dev/null +++ b/xbmc/interfaces/python/CallbackHandler.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "CallbackHandler.h" + +namespace XBMCAddon +{ + namespace Python + { + + /** + * We are ASS-U-MEing that this construction is happening + * within the context of a Python call. This way we can + * store off the PyThreadState to later verify that we're + * handling callbacks in the appropriate thread. + */ + PythonCallbackHandler::PythonCallbackHandler() : RetardedAsynchCallbackHandler("PythonCallbackHandler") + { + objectThreadState = PyThreadState_Get(); + CLog::Log(LOGDEBUG,"NEWADDON PythonCallbackHandler construction with PyThreadState 0x%lx",(long)objectThreadState); + } + + /** + * Now we are answering the question as to whether or not we are in the + * PyThreadState that we were in when we started. + */ + bool PythonCallbackHandler::isThreadStateOk() + { + TRACE; + return objectThreadState == PyThreadState_Get(); + } + + /** + * For this method we expect the PyThreadState to be passed as the user + * data for the check. + * + * TODO: This is a stupid way to get this information back to the handler. + * there should be a more language neutral means. + */ + bool PythonCallbackHandler::shouldRemoveCallback(void* threadState) + { + TRACE; + return threadState == objectThreadState; + } + } +} diff --git a/xbmc/interfaces/python/xbmcmodule/PythonMonitor.h b/xbmc/interfaces/python/CallbackHandler.h index ed46b70194..3c219c8fd8 100644 --- a/xbmc/interfaces/python/xbmcmodule/PythonMonitor.h +++ b/xbmc/interfaces/python/CallbackHandler.h @@ -19,34 +19,33 @@ * */ -#pragma once - #include <Python.h> -#include <string> -int Py_XBMC_Event_OnSettingsChanged(void* arg); -int Py_XBMC_Event_OnScreensaverActivated(void* arg); -int Py_XBMC_Event_OnScreensaverDeactivated(void* arg); -int Py_XBMC_Event_OnDatabaseUpdated(void* arg); +#include "interfaces/legacy/CallbackHandler.h" -class CPythonMonitor +namespace XBMCAddon { -public: - CPythonMonitor(); - void SetCallback(PyThreadState *state, PyObject *object); - void OnSettingsChanged(); - void OnScreensaverActivated(); - void OnScreensaverDeactivated(); - void OnDatabaseUpdated(const std::string &database); - void OnAbortRequested(); - - void Acquire(); - void Release(); + namespace Python + { + /** + * This class represents a specialization of the callback handler + * that specifically checks to see if we're in an OK thread state + * based on Python specifics. + */ + class PythonCallbackHandler : public RetardedAsynchCallbackHandler + { + PyThreadState* objectThreadState; + public: - PyObject* m_callback; - PyThreadState *m_state; - std::string Id; -protected: - ~CPythonMonitor(void); - long m_refs; -}; + /** + * We are ASS-U-MEing that this construction is happening + * within the context of a Python call. This way we can + * store off the PyThreadState to later verify that we're + * handling callbacks in the appropriate thread. + */ + PythonCallbackHandler(); + virtual bool isThreadStateOk(); + virtual bool shouldRemoveCallback(void* threadState); + }; + } +} diff --git a/xbmc/interfaces/python/Doxyfile b/xbmc/interfaces/python/Doxyfile new file mode 100644 index 0000000000..c3bddcd793 --- /dev/null +++ b/xbmc/interfaces/python/Doxyfile @@ -0,0 +1,1781 @@ +# Doxyfile 1.7.6.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "Xbmc Legacy Api" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./generated + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../legacy + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = NO + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# style sheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> +# Qt Help Project / Custom Filters</a>. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> +# Qt Help Project / Filter Attributes</a>. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = YES + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = doxygenxml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = NO + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/xbmc/interfaces/python/LanguageHook.cpp b/xbmc/interfaces/python/LanguageHook.cpp new file mode 100644 index 0000000000..37716a0f37 --- /dev/null +++ b/xbmc/interfaces/python/LanguageHook.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + + +#include "LanguageHook.h" +#include "XBPython.h" + +#include "interfaces/legacy/AddonUtils.h" +#include "utils/GlobalsHandling.h" + +namespace XBMCAddon +{ + namespace Python + { + static AddonClass::Ref<LanguageHook> instance; + + static CCriticalSection ccrit; + static bool isInited = false; + static xbmcutil::InitFlag flag(isInited); + + // vtab instantiation + LanguageHook::~LanguageHook() { } + + struct MutableInteger + { + MutableInteger() : value(0) {} + int value; + }; + + void LanguageHook::delayedCallOpen() + { + TRACE; + PythonCallbackHandler::makePendingCalls(); + // TODO: add a check for null of _save. If it's not null there's + // a problem. + + MutableInteger* count = tlsCount.get(); + if (count == NULL) + { + count = new MutableInteger(); + tlsCount.set(count); + } + + // increment the count + count->value++; + int curlevel = count->value; + if (curlevel == 1) + { + PyThreadState* _save; + // this macro sets _save + Py_UNBLOCK_THREADS + pyThreadStateTls.set(_save); + } + } + + void LanguageHook::delayedCallClose() + { + TRACE; + + // here we ASSUME that the open was called. + MutableInteger* count = tlsCount.get(); + count->value--; + int curlevel = count->value; + + // this is a hack but ... + if (curlevel < 0) + { + CLog::Log(LOGERROR, "PythonCallbackHandler delay has closed more than opened"); + count->value = 0; + } + + if (curlevel == 0) + { + PyThreadState* _save = pyThreadStateTls.get(); + if (_save != NULL) + { + Py_BLOCK_THREADS + } + _save = NULL; + pyThreadStateTls.set(_save); + + // clear the tlsCount + tlsCount.set(NULL); + delete count; + } + PythonCallbackHandler::makePendingCalls(); + } + + LanguageHook* LanguageHook::getInstance() + { + if (!isInited) // in this case we're being called from a static initializer + { + if (instance.isNull()) + instance = new LanguageHook(); + } + else + { + CSingleLock lock (ccrit); + if (instance.isNull()) + instance = new LanguageHook(); + } + + return instance.get(); + } + + /** + * PythonCallbackHandler expects to be instantiated PER AddonClass instance + * that is to be used as a callback. This is why this cannot be instantited + * once. + * + * There is an expectation that this method is called from the Python thread + * that instantiated an AddonClass that has the potential for a callback. + * + * See RetardedAsynchCallbackHandler for more details. + * See PythonCallbackHandler for more details + * See PythonCallbackHandler::PythonCallbackHandler for more details + */ + XBMCAddon::CallbackHandler* LanguageHook::getCallbackHandler() + { + return new PythonCallbackHandler(); + } + + String LanguageHook::getAddonId() + { + const char* id = NULL; + + // Get a reference to the main module + // and global dictionary + PyObject* main_module = PyImport_AddModule((char*)"__main__"); + PyObject* global_dict = PyModule_GetDict(main_module); + // Extract a reference to the function "func_name" + // from the global dictionary + PyObject* pyid = PyDict_GetItemString(global_dict, "__xbmcaddonid__"); + id = PyString_AsString(pyid); + return id; + } + + String LanguageHook::getAddonVersion() + { + // Get a reference to the main module + // and global dictionary + PyObject* main_module = PyImport_AddModule((char*)"__main__"); + PyObject* global_dict = PyModule_GetDict(main_module); + // Extract a reference to the function "func_name" + // from the global dictionary + PyObject* pyversion = PyDict_GetItemString(global_dict, "__xbmcapiversion__"); + String version(PyString_AsString(pyversion)); + return version; + } + + void LanguageHook::registerPlayerCallback(IPlayerCallback* player) { g_pythonParser.RegisterPythonPlayerCallBack(player); } + void LanguageHook::unregisterPlayerCallback(IPlayerCallback* player) { g_pythonParser.UnregisterPythonPlayerCallBack(player); } + void LanguageHook::registerMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { g_pythonParser.RegisterPythonMonitorCallBack(monitor); } + void LanguageHook::unregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor) { g_pythonParser.UnregisterPythonMonitorCallBack(monitor); } + void LanguageHook::waitForEvent(CEvent& hEvent) { g_pythonParser.WaitForEvent(hEvent); } + +// void LanguageHook::constructing(AddonClass* beingConstructed) +// { +// } +// +// void LanguageHook::destructing(AddonClass* beingDestructed) +// { +// } + + } +} diff --git a/xbmc/interfaces/python/LanguageHook.h b/xbmc/interfaces/python/LanguageHook.h new file mode 100644 index 0000000000..8881d11b78 --- /dev/null +++ b/xbmc/interfaces/python/LanguageHook.h @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#pragma once + +#if (defined HAVE_CONFIG_H) && (!defined WIN32) + #include "config.h" +#endif + +#include <Python.h> + +#include "interfaces/legacy/LanguageHook.h" +#include "interfaces/python/CallbackHandler.h" +#include "threads/ThreadLocal.h" +#include "threads/Event.h" + +namespace XBMCAddon +{ + namespace Python + { + struct MutableInteger; + + /** + * This class supplies the python specific functionality for + * plugging into the API. It's got a static only implementation + * and uses the singleton pattern for access. + */ + class LanguageHook : public XBMCAddon::LanguageHook + { + LanguageHook() : XBMCAddon::LanguageHook("Python::LanguageHook") { } + + XbmcThreads::ThreadLocal<PyThreadState> pyThreadStateTls; + XbmcThreads::ThreadLocal<MutableInteger> tlsCount; + public: + + virtual ~LanguageHook(); + + virtual void delayedCallOpen(); + virtual void delayedCallClose(); + + /** + * PythonCallbackHandler expects to be instantiated PER AddonClass instance + * that is to be used as a callback. This is why this cannot be instantited + * once. + * + * There is an expectation that this method is called from the Python thread + * that instantiated an AddonClass that has the potential for a callback. + * + * See RetardedAsynchCallbackHandler for more details. + * See PythonCallbackHandler for more details + * See PythonCallbackHandler::PythonCallbackHandler for more details + */ + virtual XBMCAddon::CallbackHandler* getCallbackHandler(); + + virtual String getAddonId(); + virtual String getAddonVersion(); + + virtual void registerPlayerCallback(IPlayerCallback* player); + virtual void unregisterPlayerCallback(IPlayerCallback* player); + virtual void registerMonitorCallback(XBMCAddon::xbmc::Monitor* monitor); + virtual void unregisterMonitorCallback(XBMCAddon::xbmc::Monitor* monitor); + virtual void waitForEvent(CEvent& hEvent); + + static LanguageHook* getInstance(); + }; + } +} + diff --git a/xbmc/interfaces/python/Makefile.in b/xbmc/interfaces/python/Makefile.in index 04fe11e59d..a5d4ca911a 100644 --- a/xbmc/interfaces/python/Makefile.in +++ b/xbmc/interfaces/python/Makefile.in @@ -1,9 +1,61 @@ -INCLUDES += @PYTHON_CPPFLAGS@ +INCLUDES=-I../../.. -I. -I../../ -I../../linux -I../../../guilib -I. -SRCS = XBPython.cpp -SRCS += XBPyThread.cpp +INTERFACES = AddonModuleXbmc.i +INTERFACES += AddonModuleXbmcgui.i +INTERFACES += AddonModuleXbmcplugin.i +INTERFACES += AddonModuleXbmcaddon.i +INTERFACES += AddonModuleXbmcvfs.i -LIB = python.a +GENDIR = generated -include @abs_top_srcdir@/Makefile.include --include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(pathsubst %.S,,$(SRCS)))) +GENERATED = $(patsubst %.i,$(GENDIR)/%.cpp,$(INTERFACES)) + +GENERATOR=@abs_top_srcdir@/tools/codegenerator + +SRCS= CallbackHandler.cpp LanguageHook.cpp \ + XBPyThread.cpp XBPython.cpp swig.cpp \ + $(GENERATED) + +SWIG_INTERFACE_DIR=../swig + +ifeq (@USE_DOXYGEN@,1) +DOXY_XML_PATH=$(GENDIR)/doxygenxml +else +DOXY_XML_PATH= +endif + +SWIG_INC += -I@abs_top_srcdir@/xbmc +INCLUDES += @PYTHON_CPPFLAGS@ $(SWIG_INC) + +CLEAN_FILES=$(GENDIR) + +LIB=python_binding.a + +CXXFLAGS+= -DSWIGRUNTIME_DEBUG -DSTATIC_LINKED + +# This prevents the removal of the intermediate files. Without +# this target the make will re-reun the generator a second time +# without any changes. +.SECONDARY: + +include ../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) + +$(GENDIR)/dummy: ../legacy/*.h + mkdir -p $(GENDIR) + touch $(GENDIR)/dummy + +$(GENDIR)/doxygenxml/dummy: $(GENDIR)/dummy ./Doxyfile +ifeq (@USE_DOXYGEN@,1) + (@DOXYGEN_EXE@ > /dev/null) 2>&1 | grep -v " warning: " +else + echo "Warning: No doxygen installed. The Api will not have any docstrings." + mkdir -p $(GENDIR)/doxygenxml +endif + touch $(GENDIR)/doxygenxml/dummy + +$(GENDIR)/%.xml: $(SWIG_INTERFACE_DIR)/%.i $(GENDIR)/dummy $(GENDIR)/doxygenxml/dummy + /usr/bin/swig -w401 -c++ -outdir $(GENDIR) -o $@ -xml $(SWIG_INC) -xmllang python $< + +$(GENDIR)/%.cpp: $(GENDIR)/%.xml + /usr/bin/java -cp "../../../lib/groovy/groovy-all-1.8.4.jar:../../../lib/groovy/commons-lang-2.6.jar:$(GENERATOR):./" groovy.ui.GroovyMain $(GENERATOR)/Generator.groovy $< PythonSwig.cpp.template $@ $(DOXY_XML_PATH) diff --git a/xbmc/interfaces/python/xbmcmodule/PythonAddon.h b/xbmc/interfaces/python/MethodType.groovy index 83237dc585..5a2f9ea608 100644 --- a/xbmc/interfaces/python/xbmcmodule/PythonAddon.h +++ b/xbmc/interfaces/python/MethodType.groovy @@ -1,7 +1,5 @@ -#pragma once - /* - * Copyright (C) 2005-2010 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -21,25 +19,9 @@ * */ -#include <Python.h> - -#include "addons/IAddon.h" - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC +public enum MethodType { - typedef struct { - PyObject_HEAD - ADDON::AddonPtr pAddon; - } Addon; - - extern PyTypeObject Addon_Type; - void initAddon_Type(); + constructor, destructor, method } -#ifdef __cplusplus -} -#endif + diff --git a/xbmc/interfaces/python/PythonSwig.cpp.template b/xbmc/interfaces/python/PythonSwig.cpp.template new file mode 100644 index 0000000000..905d3e5a6e --- /dev/null +++ b/xbmc/interfaces/python/PythonSwig.cpp.template @@ -0,0 +1,530 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% +import Helper +import SwigTypeParser +import PythonTools +import MethodType + +import groovy.xml.XmlUtil +import groovy.text.SimpleTemplateEngine +import java.util.regex.Pattern + +/** + * All of the method nodes and all of the class nodes are used several + * times over, so they are pulled out once here. + */ + +// initialize the SwigTypeParser with the module's typetables +module.findAll( { it.name() == 'typetab' } ).each { SwigTypeParser.appendTypeTable(it) } + +methods = module.depthFirst().findAll { it.name() == 'function' || it.name() == 'constructor' || it.name() == 'destructor' } +classes = module.depthFirst().findAll { it.name() == 'class' } + +Helper.setup(classes, + /** + * This is meant to contain mini-templates for converting the return type + * of the native call to be returned to the python caller. + */ +// 'p.void' : '${result} = Py_BuildValue((char*)"s#",${api},readBytes);', + [ 'void' : 'Py_INCREF(Py_None);\n ${result} = Py_None;', + 'long': '${result} = PyInt_FromLong(${api});', + 'unsigned long': '${result} = PyInt_FromLong(${api});', + 'bool': '${result} = Py_BuildValue((char*)"b", ${api});', + 'long long': '${result} = Py_BuildValue((char*)"L", ${api});', + 'int': '${result} = Py_BuildValue((char*)"i", ${api});', + 'double': '${result} = PyFloat_FromDouble(${api});', + 'float': '${result} = Py_BuildValue((char*)"f", ${api});', + 'String' : new File('typemaps/python.string.outtm'), + 'p.q(const).char' : '${result} = PyString_FromString(${api});', + (Pattern.compile('''(p.){0,1}std::vector<\\(.*\\)>''')) : new File('typemaps/python.vector.outtm'), + (Pattern.compile('''(p.){0,1}Tuple<\\(.*\\)>''')) : new File('typemaps/python.Tuple.outtm'), + (Pattern.compile('''(p.){0,1}Alternative<\\(.*\\)>''')) : new File('typemaps/python.Alternative.outtm') + ], '${result} = makePythonInstance(${api},&Py${Helper.findFullClassName(classnode).replaceAll(\'::\',\'_\')}_Type,"${type}");', + /** + * This is meant to contain mini-templates for converting the parameter types + * of the native call to be converted from the python types provided by the caller. + * + * Note: if the type can be handled by PythonTools.ltypeToFormatChar then it wont + * appear here as it gets converted directly within the PyArg_ParseTupleAndKeywords + * call. + */ + [ + 'String' : 'if (${slarg}) PyXBMCGetUnicodeString(${api},${slarg},false,"${api}","${method.@name}");', + (Pattern.compile('''(p.){0,1}std::vector<\\(.*\\)>''')) : new File('typemaps/python.vector.intm'), + (Pattern.compile('''(p.){0,1}Tuple(3){0,1}<\\(.*\\)>''')) : new File('typemaps/python.Tuple.intm'), + // I shouldn't need both of these but my parser doesn't resolve namespaces within + // parameter declarations. TODO: Maybe I should fix this. + 'r.q(const).Dictionary' : new File('typemaps/python.dict.intm'), + 'r.q(const).XBMCAddon::Dictionary' : new File('typemaps/python.dict.intm'), + (Pattern.compile('''(p.){0,1}std::map<\\(.*\\)>''')) : new File('typemaps/python.map.intm'), + 'bool' : '${api} = (PyInt_AsLong(${slarg}) == 0L ? false : true);' + ], '${api} = (${swigTypeParser.SwigType_str(ltype)})retrieveApiInstance(${slarg},"${ltype}","${helper.findNamespace(method)}","${helper.callingName(method)}");') + +//println 'this: ' + this.binding.getVariables() + +void doMethod(method, MethodType methodType) +{ + boolean constructor = methodType == MethodType.constructor + + // if we're a constructor, but we're private, then we're outta here + if (constructor && method.@access != null && method.@access != "public") + return + + boolean destructor = methodType == MethodType.destructor + List params = method?.parm + int numParams = params?.size() + String clazz = Helper.findFullClassName(method) + String returns = constructor ? 'p.' + clazz : (destructor ? 'void' : Helper.getReturnSwigType(method)) + Node classnode = Helper.findClassNode(method) + String classNameAsVariable = clazz == null ? null : PythonTools.getClassNameAsVariable(classnode) + + // do the docs + if (!constructor && !destructor) + { + if (Helper.hasDoc(method)) + { +%> + PyDoc_STRVAR(${PythonTools.getPyMethodName(method,methodType)}__doc__, + ${PythonTools.makeDocString(method.doc[0])}); +<% } + } +%> + static <% if(methodType == MethodType.destructor) { %>void<% } else { %>PyObject*<% } %> ${module.@name}_${PythonTools.getPyMethodName(method,methodType)} (<%= ((clazz == null) ? "PyObject" : + (constructor ? "PyTypeObject" : 'PyHolder')) %>* ${constructor ? 'pytype' : 'self'} <% + if (methodType != MethodType.destructor) { %> , PyObject *args, PyObject *kwds <%} %> ) + { + CLog::Log(LOGDEBUG, "NEWADDON Entering the Python method \\"${PythonTools.getPyMethodName(method,methodType)}\\""); +<% if (numParams > 0) + { %> + static const char *keywords[] = {<% + params.each { %> + "${it.@name}",<% } %> + NULL}; + +<% params.each { +%> + ${SwigTypeParser.SwigType_str(SwigTypeParser.convertTypeToLTypeForParam(it.@type))} ${it.@name} ${it.@value != null ? ' = ' + it.@value : ''};<% + if (!PythonTools.parameterCanBeUsedDirectly(it)) + { %> + PyObject* py${it.@name} = NULL;<% + } + } %> + if (!PyArg_ParseTupleAndKeywords( + args, + kwds, + (char*)"<%= PythonTools.makeFormatStringFromParameters(method) %>", + (char**)keywords,<% params.eachWithIndex { param,i -> %> + &${PythonTools.parameterCanBeUsedDirectly(param) ? '' : 'py'}${param.@name}${i < params.size() - 1 ? "," : ""}<% } %> + )) + { + CLog::Log(LOGDEBUG, "NEWADDON Leaving Python method \\"${PythonTools.getPyMethodName(method,methodType)}\\" ... returning NULL"); + return NULL; + } + +<% } + // now actually invoke the method + if (returns != "void") { %> ${SwigTypeParser.SwigType_lstr(returns)} apiResult;<% } +%> + try + { +<% + // now do the input converstion if any are necessary + params.findAll({ !PythonTools.parameterCanBeUsedDirectly(it) }).each { %> ${Helper.getInConversion(it.@type, it.@name, 'py' + it.@name, method)} <% println() } +%> +<% + // check to see if this method is a call to a virtual function on a director class. + boolean isDirectorCall = Helper.isDirector(method) + if (isDirectorCall) + { + %> // This is a director call comming from python so it explcitly calls the base class method. +<% + } + // now do the method call itself + if (!destructor) { + if (constructor || !clazz) { %> XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::LanguageHook::getInstance());<% println() } +%> <% + if (returns != "void") { %>apiResult = (${SwigTypeParser.SwigType_lstr(returns)})<% } + if (clazz && !constructor) { + %>((${clazz}*)retrieveApiInstance((PyObject*)self,&Py${classNameAsVariable}_Type,"${Helper.callingName(method)}","${clazz}"))-> <% + } + if (constructor && classnode.@feature_director) { + %>(&Py${classNameAsVariable}_Type != pytype) ? new ${classNameAsVariable}_Director(<% params.eachWithIndex { param, i -> %> ${param.@name}${i < params.size() - 1 ? "," : ""} <% } %>) : <% } + + // Here is the actual call ... if this is a Director we need to do an upCall (from Python) + if (isDirectorCall){ %>${clazz}::<% } + %>${Helper.callingName(method)}( <% params.eachWithIndex { param, i -> %> ${param.@name}${i < params.size() - 1 ? "," : ""} <% } %> ); +<% + if (constructor && classnode.@feature_ref != null) { %> ${new SimpleTemplateEngine().createTemplate(classnode.@feature_ref).make(['ths' : 'apiResult']).toString()} <% } + } // close the 'if method is not a destructor' + else { // it is a destructor +%> + ${clazz}* theObj = (${clazz}*)retrieveApiInstance((PyObject*)self,&Py${classNameAsVariable}_Type,"~${Helper.callingName(method)}","${clazz}"); + if (theObj != NULL) + { <% + if (classnode != null && classnode && classnode.@feature_unref != null) + { %> + ${new SimpleTemplateEngine().createTemplate(classnode.@feature_unref).make(['ths' : 'theObj']).toString()}<% + } +%> + } +<% + } +%> + } + catch (const XbmcCommons::Exception& e) + { + CLog::Log(LOGERROR,"Leaving Python method \\"${PythonTools.getPyMethodName(method,methodType)}\\". Exception from call to \"${Helper.callingName(method)}\" \"%s\" ... returning NULL", e.GetMessage()); + PyErr_SetString(PyExc_RuntimeError, e.GetMessage()); <% + if (!destructor) { %> + return NULL; <% + } %> + } + catch (...) + { + CLog::Log(LOGERROR,"Unknown exception thrown from the call \"${Helper.callingName(method)}\""); + PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"${Helper.callingName(method)}\""); <% + if (!destructor) { %> + return NULL; <% + } %> + } +<% + if (!destructor) { %> + PyObject* result; + + // transform the result +<% + if (constructor) { +%> result = makePythonInstance(apiResult,pytype,"${returns}");<% + } + else { +%> ${Helper.getOutConversion(returns,'result',method)}<% + } + if (constructor && method.@feature_director) { %> + if (&Py${classNameAsVariable}_Type != pytype) + ((${classNameAsVariable}_Director*)apiResult)->setPyObjectForDirector(result);<% + } + %> + + return result; <% } + else { %> + self->ob_type->tp_free((PyObject*)self); + <% + } + %> + } <% +} + +void doClassTypeInfo(Node clazz, List classNameAsVariables = null) +{ + String classNameAsVariable = PythonTools.getClassNameAsVariable(clazz) + String fullClassName = Helper.findFullClassName(clazz) + classNameAsVariables?.add(classNameAsVariable) +%> + //========================================================================= + // This variable will hold the Python Type information for ${fullClassName} + PyTypeObject Py${classNameAsVariable}_Type; + //========================================================================= +<% +} + +void doClassMethodInfo(Node clazz, List initTypeCalls = null) +{ + String classNameAsVariable = PythonTools.getClassNameAsVariable(clazz) + String fullClassName = Helper.findFullClassName(clazz) + String initTypeCall = "initPy${classNameAsVariable}_Type" + initTypeCalls?.add(initTypeCall) +%> + //========================================================================= + // This section contains the initialization for the + // Python extention for the Api class ${fullClassName} + //========================================================================= + // All of the methods on this class + static PyMethodDef ${classNameAsVariable}_methods[] = { <% + clazz.function.each { %> + {(char*)"${it.@sym_name}", (PyCFunction)${module.@name}_${PythonTools.getPyMethodName(it,MethodType.method)}, METH_VARARGS|METH_KEYWORDS, ${Helper.hasDoc(it) ? PythonTools.getPyMethodName(it,MethodType.method) + '__doc__' : 'NULL'} }, <% } + + // now do all of the explcit feature:python:method's that may be in this class + List tmpl = [] + tmpl.addAll(clazz.attributes().keySet()) + List newMethodKeys = tmpl.findAll { it.startsWith('feature_python_method_') } + newMethodKeys.each { key -> + String featureEntry = clazz.attribute(key) + String methodName = key.substring('feature_python_method_'.length()) %> + {(char*)"${methodName}", (PyCFunction)${module.@name}_${PythonTools.getClassNameAsVariable(clazz)}_${methodName}, METH_VARARGS|METH_KEYWORDS, NULL}, +<% + } +%> + {NULL, NULL, 0, NULL} + }; + + // This method initializes the above mentioned Python Type structure + static void ${initTypeCall}() + { +<% + if (Helper.hasDoc(clazz)) + { +%> + PyDoc_STRVAR(${classNameAsVariable}__doc__, + ${PythonTools.makeDocString(clazz.doc[0])} + ); +<% } %> + PyXBMCInitializeTypeObject(&Py${classNameAsVariable}_Type); + + Py${classNameAsVariable}_Type.tp_name = (char*)"${module.@name}.${clazz.@sym_name}"; + Py${classNameAsVariable}_Type.tp_basicsize = sizeof(PyHolder); + Py${classNameAsVariable}_Type.tp_dealloc = (destructor)${module.@name}_${classNameAsVariable}_Dealloc; + Py${classNameAsVariable}_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; + Py${classNameAsVariable}_Type.tp_doc = ${Helper.hasDoc(clazz) ? (classNameAsVariable + '__doc__') : 'NULL' }; + Py${classNameAsVariable}_Type.tp_methods = ${classNameAsVariable}_methods; <% + // I need to find the base type if there is a known class with it + assert clazz.baselist.size() < 2, "${clazz} has multiple baselists - need to write code to separate out the public one." + String baseclass = 'NULL' + List knownbases = [] + if (clazz.baselist) + { + if (clazz.baselist[0].base) clazz.baselist[0].base.each { + Node baseclassnode = Helper.findClassNodeByName(module,it.@name,clazz) + if (baseclassnode) knownbases.add(baseclassnode) + else if (!Helper.isKnownBaseType(it.@name,clazz)) + System.out.println("WARNING: the base class ${it.@name} for ${fullClassName} is unrecognized within ${module.@name}.") + } + } + assert knownbases.size() < 2, + "The class ${fullClassName} has too many known base classes. Multiple inheritance isn't supported in the code generator. Please \"#ifdef SWIG\" out all but one." + if (knownbases.size() > 0) + baseclass = "&Py${PythonTools.getClassNameAsVariable(knownbases[0])}_Type" +%> + Py${classNameAsVariable}_Type.tp_base = ${baseclass}; + Py${classNameAsVariable}_Type.tp_new = <% Helper.hasHiddenConstructor(clazz) ? print('NULL') : print("${module.@name}_${classNameAsVariable}_New") %>; + } + //========================================================================= +<% +} + +List getAllVirtualMethods(Node clazz) +{ + List ret = [] + ret.addAll(clazz.findAll({ it.name() == 'function' && it.@storage && it.@storage == 'virtual' })) + if (clazz.baselist) { + if (clazz.baselist[0].base) clazz.baselist[0].base.each { + Node baseclassnode = Helper.findClassNodeByName(module,it.@name,clazz) + if (baseclassnode && baseclassnode.@feature_director) ret.addAll(getAllVirtualMethods(baseclassnode)) + } + } + return ret; +} + +%> +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +// ************************************************************************ +// This file was generated by xbmc compile process. DO NOT EDIT!! +// It was created by running the code generator on the spec file for +// the module "${module.@name}" on the template file PythonSwig.template.cpp +// ************************************************************************ + +<% +Helper.getInsertNodes(module, 'begin').each { %>${Helper.unescape(it)}<% } +%> + +#include <Python.h> +#include <string> +#include "interfaces/python/LanguageHook.h" +#include "interfaces/python/swig.h" + +<% +Helper.getInsertNodes(module, 'header').each { %>${Helper.unescape(it)}<% } +%> + +namespace PythonBindings +{ +<% + List initTypeCalls = [] + List classNameAsVariables = [] + + classes.each { clazz -> doClassTypeInfo(clazz, classNameAsVariables) } +%> + +<% +//========================================================================= +// Do the directors + classes.findAll({ it.@feature_director != null }).each { clazz -> + // find the constructor for this class + constructor = clazz.constructor[0] +%> + //========================================================================= + // This class is the Director for ${Helper.findFullClassName(clazz)}. + // It provides the "reverse bridge" from C++ to Python to support + // cross-language polymorphism. + //========================================================================= + class ${PythonTools.getClassNameAsVariable(clazz)}_Director : public Director, public ${clazz.@name} + { + public: +<% + if (constructor) + {%> + inline ${PythonTools.getClassNameAsVariable(clazz)}_Director(<% + List params = constructor?.parm + params.eachWithIndex { param, i -> %>${SwigTypeParser.SwigType_str(param.@type)} ${param.@name}${i < params.size() - 1 ? "," : ""} <% } + %>) : ${Helper.findFullClassName(constructor)}(<% + params.eachWithIndex { param, i -> %> ${param.@name}${i < params.size() - 1 ? "," : ""} <% } %>) { } <% + } +%> +<% + getAllVirtualMethods(clazz).each + { %> + virtual ${SwigTypeParser.SwigType_str(Helper.getReturnSwigType(it))} ${Helper.callingName(it)}( <% + List params = it?.parm + String paramFormatStr = '' + params.each { paramFormatStr += 'O' } + params.eachWithIndex { param, i -> %> ${SwigTypeParser.SwigType_str(param.@type)} ${param.@name}${i < params.size() - 1 ? "," : ""} <% } + %> ) + { <% + params.each + { param -> + %> + PyObject* py${param.@name} = NULL; + ${Helper.getOutConversion(param.@type,'result',it,['result' : 'py' + param.@name, 'api' : param.@name])}<% + } +%> + PyObject_CallMethod(self,(char*)"${Helper.callingName(it)}",(char*)"(${paramFormatStr})"<% + params.each { + %>, py${it.@name} <% + } + %>); + if (PyErr_Occurred()) + throw PythonBindings::PythonToCppException(); + } +<% } + +%> + }; +<% + } +//========================================================================= + + // types used as method parameter or return values need to be declared + // as extern if they are unknown types. + methods.each { if (it.name() != 'destructor') { doMethod(it, (it.name() == 'constructor' ? MethodType.constructor : MethodType.method)); println(); } } + classes.each { clazz -> doMethod(clazz, MethodType.destructor) } + + // now find any methods that have been added explicitly + classes.each { node -> + List tmpl = [] + tmpl.addAll(node.attributes().keySet()) + List newMethodKeys = tmpl.findAll { it.startsWith('feature_python_method_') } + newMethodKeys.each { key -> + String featureEntry = node.attribute(key) + String methodName = key.substring('feature_python_method_'.length()) %> + static PyObject* ${module.@name}_${PythonTools.getClassNameAsVariable(node)}_${methodName}(PyObject* self, PyObject *args, PyObject *kwds) + ${Helper.unescape(featureEntry)} +<% + } + } + + classes.each { clazz -> doClassMethodInfo(clazz, initTypeCalls) } +%> + + static PyMethodDef ${module.@name}_methods[] = { <% + module.depthFirst().findAll({ it.name() == 'function' && Helper.parents(it, { Node lnode -> lnode.name() == 'class'}).size() == 0 }).each { %> + {(char*)"${it.@sym_name}", (PyCFunction)${module.@name}_${PythonTools.getPyMethodName(it,MethodType.method)}, METH_VARARGS|METH_KEYWORDS, ${Helper.hasDoc(it) ? PythonTools.getPyMethodName(it,MethodType.method) + '__doc__' : 'NULL'} }, <% } +%> + {NULL, NULL, 0, NULL} + }; + + // This is the call that will call all of the other initializes + // for all of the classes in this module + static void initTypes() + { + static bool typesAlreadyInitialized = false; + if (!typesAlreadyInitialized) + { + typesAlreadyInitialized = true; +<% + initTypeCalls.each { %> + ${it}();<% + } + + classNameAsVariables.each { %> + if (PyType_Ready(&Py${it}_Type) < 0) + return;<% + }%> + } + } + + void initModule_${module.@name}() + { + initTypes(); + + // init general ${module.@name} modules + PyObject* module; + +<% classNameAsVariables.each { %> + Py_INCREF(&Py${it}_Type);<% + }%> + + module = Py_InitModule((char*)"${module.@name}", ${module.@name}_methods); + if (module == NULL) return; + +<% classes.each { clazz -> %> + PyModule_AddObject(module, (char*)"${clazz.@sym_name}", (PyObject*)&Py${PythonTools.getClassNameAsVariable(clazz)}_Type);<% + }%> + + // constants + PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team XBMC <www.xbmc.org>"); + PyModule_AddStringConstant(module, (char*)"__date__", (char*)"${new Date().toString()}"); + PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.0"); + PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team XBMC"); + PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL"); + + // need to handle constants +<% module.depthFirst().findAll( { it.name() == 'constant'} ).each { + String pyCall = + (it.@type == 'int' || it.@type == 'long' || it.@type == 'unsigned int' || it.@type == 'unsigned long' || it.@type == 'bool') ? + 'PyModule_AddIntConstant' : 'PyModule_AddStringConstant' %> + ${pyCall}(module,"${it.@sym_name}",(int)${it.@value}); <% + } %> + } + +} // end PythonBindings namespace for python type definitions + diff --git a/xbmc/interfaces/python/PythonTools.groovy b/xbmc/interfaces/python/PythonTools.groovy new file mode 100644 index 0000000000..3f1c0d4a1d --- /dev/null +++ b/xbmc/interfaces/python/PythonTools.groovy @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +import Helper +import SwigTypeParser + +public class PythonTools +{ + /** + * This array defines a mapping of the api spec type to the python parse format character. + * By default, if a lookup here results in 'null' then the format char is 'O' + */ + private static Map ltypeToFormatChar = [ + 'p.char':"s", bool:"b", + int:"i", 'unsigned int' : 'I', + long:"l", 'unsigned long' : 'k', + 'double':"d", 'float':"f", + 'long long' : "L" + ] + + /** + * if the parameter can be directly read from python then its type should be in the ltypeToFormatChar + * otherwise we need an intermediate pyobject + */ + public static boolean parameterCanBeUsedDirectly(Node param) { return ltypeToFormatChar[SwigTypeParser.convertTypeToLTypeForParam(param.@type)] != null } + + /** + * This method will take the parameter list from the method node passed + * and will convert it to a Pythonn argument string for PyArg_ParseTupleAndKeywords + */ + public static String makeFormatStringFromParameters(Node method) + { + if (!method) + return '' + List params = method.parm + String format = "" + boolean previousDefaulted = false + params.eachWithIndex { param, i -> + String defaultValue = param.@value + String paramtype = SwigTypeParser.convertTypeToLTypeForParam(param.@type) + String curFormat = ltypeToFormatChar[paramtype]; + if (curFormat == null) // then we will assume it's an object + curFormat = "O"; + + if (defaultValue != null && !previousDefaulted) + { + format +="|" + previousDefaulted = true + } + format += curFormat + } + return format; + } + + /** + * This method gets the FULL class name as a variable including the + * namespace. If converts all of the '::' references to '_' so + * that the result can be used in part, or in whold, as a variable name + */ + public static String getClassNameAsVariable(Node clazz) { return Helper.findFullClassName(clazz).replaceAll('::','_') } + + public static String getPyMethodName(Node method, MethodType methodType) + { + String clazz = Helper.findFullClassName(method)?.replaceAll('::','_') + + // if we're not in a class then this must be a method node + assert (clazz != null || methodType == MethodType.method), 'Cannot use a non-class function as a constructor or destructor ' + method + + // it's ok to pass a 'class' node if the methodType is either constructor or destructor + assert (method.name() != 'class' || (methodType == MethodType.constructor || methodType == MethodType.destructor)) + + // if this is a constructor node then the methodtype best reflect that + assert (method.name() != 'constructor' || methodType == MethodType.constructor), 'Cannot use a constructor node and not identify the type as a constructor' + method + + // if this is a destructor node then the methodtype best reflect that + assert (method.name() != 'destructor' || methodType == MethodType.destructor), 'Cannot use a destructor node and not identify the type as a destructor' + method + + return (clazz == null) ? method.@sym_name : + ( + (methodType == MethodType.constructor) ? (clazz + "_New") : + (methodType == MethodType.destructor ? (clazz + "_Dealloc") : clazz + "_" + method.@sym_name) + ) + } + + public static String makeDocString(Node docnode) + { + if (docnode?.name() != 'doc') + throw new RuntimeException("Invalid doc Node passed to PythonTools.makeDocString (" + docnode + ")") + + String[] lines = (docnode.@value).split(Helper.newline) + def ret = '' + lines.eachWithIndex { val, index -> + val = ((val =~ /\\n/).replaceAll('')) // remove extraneous \n's + val = val.replaceAll("\\\\","\\\\\\\\") // escape backslash + val = ((val =~ /\"/).replaceAll("\\\\\"")) // escape quotes + ret += ('"' + val + '\\n"' + (index != lines.length - 1 ? Helper.newline : '')) + } + + return ret + } +} diff --git a/xbmc/interfaces/python/XBPyThread.cpp b/xbmc/interfaces/python/XBPyThread.cpp index b3769146c2..ce11697112 100644 --- a/xbmc/interfaces/python/XBPyThread.cpp +++ b/xbmc/interfaces/python/XBPyThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2009 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -43,8 +43,13 @@ #include "XBPyThread.h" #include "XBPython.h" -#include "xbmcmodule/pyutil.h" -#include "xbmcmodule/pythreadstate.h" +#include "interfaces/legacy/Exception.h" +#include "interfaces/legacy/CallbackHandler.h" +#include "interfaces/legacy/AddonUtils.h" +#include "interfaces/legacy/ModuleXbmc.h" + +#include "interfaces/python/pythreadstate.h" +#include "interfaces/python/swig.h" #include "utils/CharsetConverter.h" @@ -194,8 +199,8 @@ void XBPyThread::Process() PyObject *e = PyList_GetItem(pathObj, i); // borrowed ref, no need to delete if( e && PyString_Check(e) ) { - path += PyString_AsString(e); // returns internal data, don't delete or modify - path += PY_PATH_SEP; + path += PyString_AsString(e); // returns internal data, don't delete or modify + path += PY_PATH_SEP; } } } @@ -234,6 +239,8 @@ void XBPyThread::Process() if (!stopping) { + try + { if (m_type == 'F') { // run script from file @@ -269,6 +276,15 @@ void XBPyThread::Process() //run script PyRun_String(m_source, m_Py_file_input, moduleDict, moduleDict); } + } + catch (const XbmcCommons::Exception& e) + { + e.LogThrowMessage(); + } + catch (...) + { + CLog::Log(LOGERROR, "failure in %s", m_source); + } } if (!PyErr_Occurred()) @@ -277,53 +293,13 @@ void XBPyThread::Process() CLog::Log(LOGINFO, "Scriptresult: Aborted"); else { - PyObject* exc_type; - PyObject* exc_value; - PyObject* exc_traceback; - PyObject* pystring; - pystring = NULL; - - PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - if (exc_type == 0 && exc_value == 0 && exc_traceback == 0) - { - CLog::Log(LOGINFO, "Strange: No Python exception occured"); - } - else + PythonBindings::PythonToCppException e; + e.LogThrowMessage(); + { - if (exc_type != NULL && (pystring = PyObject_Str(exc_type)) != NULL && (PyString_Check(pystring))) - { - PyObject *tracebackModule; - - CLog::Log(LOGINFO, "-->Python script returned the following error<--"); - CLog::Log(LOGERROR, "Error Type: %s", PyString_AsString(PyObject_Str(exc_type))); - if (PyObject_Str(exc_value)) - CLog::Log(LOGERROR, "Error Contents: %s", PyString_AsString(PyObject_Str(exc_value))); - - tracebackModule = PyImport_ImportModule((char*)"traceback"); - if (tracebackModule != NULL) - { - PyObject *tbList, *emptyString, *strRetval; - - tbList = PyObject_CallMethod(tracebackModule, (char*)"format_exception", (char*)"OOO", exc_type, exc_value == NULL ? Py_None : exc_value, exc_traceback == NULL ? Py_None : exc_traceback); - emptyString = PyString_FromString(""); - strRetval = PyObject_CallMethod(emptyString, (char*)"join", (char*)"O", tbList); - - CLog::Log(LOGERROR, "%s", PyString_AsString(strRetval)); - - Py_DECREF(tbList); - Py_DECREF(emptyString); - Py_DECREF(strRetval); - Py_DECREF(tracebackModule); - } - CLog::Log(LOGINFO, "-->End of Python script error report<--"); - } - else - { - pystring = NULL; - CLog::Log(LOGINFO, "<unknown exception type>"); - } + CPyThreadState releaseGil; + CSingleLock gc(g_graphicsContext); - PYXBMC::PyXBMCGUILock(); CGUIDialogKaiToast *pDlgToast = (CGUIDialogKaiToast*)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST); if (pDlgToast) { @@ -341,15 +317,9 @@ void XBPyThread::Process() desc.Format(g_localizeStrings.Get(2100), script); pDlgToast->QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(257), desc); } - PYXBMC::PyXBMCGUIUnlock(); } - - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); // caller owns all 3 - Py_XDECREF(exc_traceback); // already NULL'd out - Py_XDECREF(pystring); } - + PyObject *m = PyImport_AddModule((char*)"xbmc"); if(!m || PyObject_SetAttrString(m, (char*)"abortRequested", PyBool_FromLong(1))) CLog::Log(LOGERROR, "Scriptresult: failed to set abortRequested"); @@ -376,7 +346,7 @@ void XBPyThread::Process() } // pending calls must be cleared out - PyXBMC_ClearPendingCalls(state); + XBMCAddon::RetardedAsynchCallbackHandler::clearPendingCalls(state); PyThreadState_Swap(NULL); PyEval_ReleaseLock(); @@ -385,7 +355,7 @@ void XBPyThread::Process() //this event has to be fired without holding m_pExecuter->m_critSection //before //Also the GIL (PyEval_AcquireLock) must not be held - //if not obeyed there is still no deadlock because ::stop waits with timeout + //if not obeyed there is still no deadlock because ::stop waits with timeout (smart one!) stoppedEvent.Set(); { CSingleLock lock(m_pExecuter->m_critSection); diff --git a/xbmc/interfaces/python/XBPyThread.h b/xbmc/interfaces/python/XBPyThread.h index 55a6fbd216..c49fd959c9 100644 --- a/xbmc/interfaces/python/XBPyThread.h +++ b/xbmc/interfaces/python/XBPyThread.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp index d23eb71082..c48fbdb746 100644 --- a/xbmc/interfaces/python/XBPython.cpp +++ b/xbmc/interfaces/python/XBPython.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -29,44 +29,33 @@ #include "system.h" #include "cores/DllLoader/DllLoaderContainer.h" #include "GUIPassword.h" - #include "XBPython.h" #include "settings/Settings.h" #include "filesystem/File.h" #include "filesystem/SpecialProtocol.h" #include "utils/log.h" -#include "threads/SingleLock.h" +#include "pythreadstate.h" #include "utils/TimeUtils.h" #include "Util.h" #include "threads/SystemClock.h" #include "addons/Addon.h" #include "interfaces/AnnouncementManager.h" -#include "interfaces/python/xbmcmodule/PythonMonitor.h" + +#include "interfaces/legacy/Monitor.h" using namespace ANNOUNCEMENT; -extern "C" HMODULE __stdcall dllLoadLibraryA(LPCSTR file); -extern "C" BOOL __stdcall dllFreeLibrary(HINSTANCE hLibModule); - -extern "C" { - void InitXBMCModule(void); - void InitXBMCTypes(void); - void DeinitXBMCModule(void); - void InitPluginModule(void); - void InitPluginTypes(void); - void DeinitPluginModule(void); - void InitGUIModule(void); - void InitGUITypes(void); - void DeinitGUIModule(void); - void InitAddonModule(void); - void InitAddonTypes(void); - void DeinitAddonModule(void); - void InitVFSModule(void); - void InitVFSTypes(void); - void DeinitVFSModule(void); +namespace PythonBindings { + void initModule_xbmcgui(void); + void initModule_xbmc(void); + void initModule_xbmcplugin(void); + void initModule_xbmcaddon(void); + void initModule_xbmcvfs(void); } +using namespace PythonBindings; + XBPython::XBPython() { m_bInitialized = false; @@ -79,6 +68,7 @@ XBPython::XBPython() m_pDll = NULL; m_vecPlayerCallbackList.clear(); m_vecMonitorCallbackList.clear(); + CAnnouncementManager::AddAnnouncer(this); } @@ -262,13 +252,13 @@ void XBPython::UnregisterPythonPlayerCallBack(IPlayerCallback* pCallback) } } -void XBPython::RegisterPythonMonitorCallBack(CPythonMonitor* pCallback) +void XBPython::RegisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback) { CSingleLock lock(m_critSection); m_vecMonitorCallbackList.push_back(pCallback); } -void XBPython::UnregisterPythonMonitorCallBack(CPythonMonitor* pCallback) +void XBPython::UnregisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback) { CSingleLock lock(m_critSection); MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin(); @@ -289,8 +279,8 @@ void XBPython::OnSettingsChanged(const CStdString &ID) MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin(); while (it != m_vecMonitorCallbackList.end()) { - if (((CPythonMonitor*)(*it))->Id == ID) - ((CPythonMonitor*)(*it))->OnSettingsChanged(); + if (((XBMCAddon::xbmc::Monitor*)(*it))->GetId() == ID) + ((XBMCAddon::xbmc::Monitor*)(*it))->OnSettingsChanged(); it++; } } @@ -304,7 +294,7 @@ void XBPython::OnScreensaverActivated() MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin(); while (it != m_vecMonitorCallbackList.end()) { - ((CPythonMonitor*)(*it))->OnScreensaverActivated(); + ((XBMCAddon::xbmc::Monitor*)(*it))->OnScreensaverActivated(); it++; } } @@ -318,7 +308,7 @@ void XBPython::OnScreensaverDeactivated() MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin(); while (it != m_vecMonitorCallbackList.end()) { - ((CPythonMonitor*)(*it))->OnScreensaverDeactivated(); + ((XBMCAddon::xbmc::Monitor*)(*it))->OnScreensaverDeactivated(); it++; } } @@ -332,7 +322,7 @@ void XBPython::OnDatabaseUpdated(const std::string &database) MonitorCallbackList::iterator it = m_vecMonitorCallbackList.begin(); while (it != m_vecMonitorCallbackList.end()) { - ((CPythonMonitor*)(*it))->OnDatabaseUpdated(database); + ((XBMCAddon::xbmc::Monitor*)(*it))->OnDatabaseUpdated(database); it++; } } @@ -348,12 +338,12 @@ void XBPython::OnAbortRequested(const CStdString &ID) { if (ID.IsEmpty()) { - ((CPythonMonitor*)(*it))->OnAbortRequested(); + ((XBMCAddon::xbmc::Monitor*)(*it))->OnAbortRequested(); } else { - if (((CPythonMonitor*)(*it))->Id == ID) - ((CPythonMonitor*)(*it))->OnAbortRequested(); + if (((XBMCAddon::xbmc::Monitor*)(*it))->GetId() == ID) + ((XBMCAddon::xbmc::Monitor*)(*it))->OnAbortRequested(); } it++; } @@ -419,21 +409,24 @@ void XBPython::UnloadExtensionLibs() m_extensions.clear(); } +#define MODULE "xbmc" + #define RUNSCRIPT_PRAMBLE \ "" \ - "import xbmc\n" \ + "import " MODULE "\n" \ + "xbmc.abortRequested = False\n" \ "class xbmcout:\n" \ - "\tdef __init__(self, loglevel=xbmc.LOGNOTICE):\n" \ + "\tdef __init__(self, loglevel=" MODULE ".LOGNOTICE):\n" \ "\t\tself.ll=loglevel\n" \ "\tdef write(self, data):\n" \ - "\t\txbmc.log(data,self.ll)\n" \ + "\t\t" MODULE ".log(data,self.ll)\n" \ "\tdef close(self):\n" \ - "\t\txbmc.log('.')\n" \ + "\t\t" MODULE ".log('.')\n" \ "\tdef flush(self):\n" \ - "\t\txbmc.log('.')\n" \ + "\t\t" MODULE ".log('.')\n" \ "import sys\n" \ "sys.stdout = xbmcout()\n" \ - "sys.stderr = xbmcout(xbmc.LOGERROR)\n" + "sys.stderr = xbmcout(" MODULE ".LOGERROR)\n" #define RUNSCRIPT_OVERRIDE_HACK \ "" \ @@ -468,12 +461,14 @@ void XBPython::UnloadExtensionLibs() void XBPython::InitializeInterpreter(ADDON::AddonPtr addon) { - InitXBMCModule(); // init xbmc modules - InitPluginModule(); // init xbmcplugin modules - InitGUIModule(); // init xbmcgui modules - InitAddonModule(); // init xbmcaddon modules - InitVFSModule(); // init xbmcvfs modules - InitVFSTypes(); + { + GilSafeSingleLock lock(m_critSection); + initModule_xbmcgui(); + initModule_xbmc(); + initModule_xbmcplugin(); + initModule_xbmcaddon(); + initModule_xbmcvfs(); + } CStdString addonVer = ADDON::GetXbmcApiVersionDependency(addon); bool bwcompatMode = (addon.get() == NULL || (ADDON::AddonVersion(addonVer) <= ADDON::AddonVersion("1.0"))); @@ -488,11 +483,6 @@ void XBPython::InitializeInterpreter(ADDON::AddonPtr addon) void XBPython::DeInitializeInterpreter() { - DeinitXBMCModule(); - DeinitPluginModule(); - DeinitGUIModule(); - DeinitAddonModule(); - DeinitVFSModule(); } /** @@ -579,12 +569,6 @@ void XBPython::Initialize() char* python_argv[1] = { (char*)"" } ; PySys_SetArgv(1, python_argv); - InitXBMCTypes(); - InitGUITypes(); - InitPluginTypes(); - InitAddonTypes(); - InitVFSTypes(); - if (!(m_mainThreadState = PyThreadState_Get())) CLog::Log(LOGERROR, "Python threadstate is NULL."); PyEval_ReleaseLock(); @@ -683,7 +667,10 @@ void XBPython::Process() //delete scripts which are done if (it->bDone) { - delete it->pyThread; + { + CSingleExit exit(m_critSection); + delete it->pyThread; + } it = m_vecPyList.erase(it); FinalizeScript(); } diff --git a/xbmc/interfaces/python/XBPython.h b/xbmc/interfaces/python/XBPython.h index 932586a55a..3e1364d424 100644 --- a/xbmc/interfaces/python/XBPython.h +++ b/xbmc/interfaces/python/XBPython.h @@ -1,7 +1,7 @@ #pragma once /* - * Copyright (C) 2005-2008 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -37,11 +37,18 @@ typedef struct { }PyElem; class LibraryLoader; -class CPythonMonitor; + +namespace XBMCAddon +{ + namespace xbmc + { + class Monitor; + } +} typedef std::vector<PyElem> PyList; typedef std::vector<PVOID> PlayerCallbackList; -typedef std::vector<PVOID> MonitorCallbackList; +typedef std::vector<XBMCAddon::xbmc::Monitor*> MonitorCallbackList; typedef std::vector<LibraryLoader*> PythonExtensionLibraries; class XBPython : @@ -64,8 +71,8 @@ public: virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data); void RegisterPythonPlayerCallBack(IPlayerCallback* pCallback); void UnregisterPythonPlayerCallBack(IPlayerCallback* pCallback); - void RegisterPythonMonitorCallBack(CPythonMonitor* pCallback); - void UnregisterPythonMonitorCallBack(CPythonMonitor* pCallback); + void RegisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback); + void UnregisterPythonMonitorCallBack(XBMCAddon::xbmc::Monitor* pCallback); void OnSettingsChanged(const CStdString &strings); void OnScreensaverActivated(); void OnScreensaverDeactivated(); diff --git a/xbmc/interfaces/python/xbmcmodule/monitor.h b/xbmc/interfaces/python/preamble.h index 0a28dc8383..7a570baa57 100644 --- a/xbmc/interfaces/python/xbmcmodule/monitor.h +++ b/xbmc/interfaces/python/preamble.h @@ -18,26 +18,15 @@ * http://www.gnu.org/copyleft/gpl.html * */ -#pragma once -#include <Python.h> -#include "PythonMonitor.h" +#pragma once -#ifdef __cplusplus -extern "C" { +#if (defined HAVE_CONFIG_H) && (!defined WIN32) + #include "config.h" #endif -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - CPythonMonitor* pMonitor; - } Monitor; +#ifdef SWIGPYTHON + +#include <Python.h> - extern PyTypeObject Monitor_Type; - void initMonitor_Type(); -} - -#ifdef __cplusplus -} #endif diff --git a/xbmc/interfaces/python/xbmcmodule/pythreadstate.h b/xbmc/interfaces/python/pythreadstate.h index c2e1a7b77e..9fabd60c44 100644 --- a/xbmc/interfaces/python/xbmcmodule/pythreadstate.h +++ b/xbmc/interfaces/python/pythreadstate.h @@ -1,7 +1,7 @@ #pragma once /* - * Copyright (C) 2005-2011 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -21,6 +21,8 @@ * */ +#include "threads/SingleLock.h" + //WARNING: since this will unlock/lock the python global interpreter lock, // it will not work recursively @@ -60,3 +62,13 @@ class CPyThreadState PyThreadState* m_threadState; }; +/** + * A CSingleLock that will relinquish the GIL during the time + * it takes to obtain the CriticalSection + */ +class GilSafeSingleLock : public CPyThreadState, public CSingleLock +{ +public: + GilSafeSingleLock(const CCriticalSection& critSec) : CPyThreadState(true), CSingleLock(critSec) { CPyThreadState::Restore(); } +}; + diff --git a/xbmc/interfaces/python/swig.cpp b/xbmc/interfaces/python/swig.cpp new file mode 100644 index 0000000000..a927d1f53c --- /dev/null +++ b/xbmc/interfaces/python/swig.cpp @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "interfaces/python/swig.h" +#include <string> + +namespace PythonBindings +{ + void PyXBMCInitializeTypeObject(PyTypeObject* type_object) + { + static PyTypeObject py_type_object_header = { PyObject_HEAD_INIT(NULL) 0}; + int size = (long*)&(py_type_object_header.tp_name) - (long*)&py_type_object_header; + memset(type_object, 0, sizeof(PyTypeObject)); + memcpy(type_object, &py_type_object_header, size); + } + + int PyXBMCGetUnicodeString(std::string& buf, PyObject* pObject, bool coerceToString, + const char* argumentName, const char* methodname) + { + // TODO: UTF-8: Does python use UTF-16? + // Do we need to convert from the string charset to UTF-8 + // for non-unicode data? + if (PyUnicode_Check(pObject)) + { + // Python unicode objects are UCS2 or UCS4 depending on compilation + // options, wchar_t is 16-bit or 32-bit depending on platform. + // Avoid the complexity by just letting python convert the string. + PyObject *utf8_pyString = PyUnicode_AsUTF8String(pObject); + + if (utf8_pyString) + { + buf = PyString_AsString(utf8_pyString); + Py_DECREF(utf8_pyString); + return 1; + } + } + if (PyString_Check(pObject)) + { + buf = PyString_AsString(pObject); + return 1; + } + + // if we got here then we need to coerce the value to a string + if (coerceToString) + { + PyObject* pyStrCast = PyObject_Str(pObject); + if (pyStrCast) + { + int ret = PyXBMCGetUnicodeString(buf,pyStrCast,false,argumentName,methodname); + Py_DECREF(pyStrCast); + return ret; + } + } + + // Object is not a unicode or a normal string. + buf = ""; + PyErr_Format(PyExc_TypeError, "argument \"%s\" for method \"%s\" must be unicode or str", argumentName, methodname); + return 0; + } + + // need to compare the typestring + bool isParameterRightType(const char* passedType, const char* expectedType, const char* methodNamespacePrefix) + { + if (strcmp(expectedType,passedType) == 0) + return true; + + // well now things are a bit more complicated. We need to see if the passed type + // is a subset of the overall type + std::string pt(passedType); + bool isPointer = (pt[0] == 'p' && pt[1] == '.'); + std::string baseType(pt,(isPointer ? 2 : 0)); + std::string ns(methodNamespacePrefix); + + // cut off trailing '::' + if (ns.size() > 2 && ns[ns.size() - 1] == ':' && ns[ns.size() - 2] == ':') + ns = ns.substr(0,ns.size()-2); + + bool done = false; + while(! done) + { + done = true; + std::string check(isPointer ? "p." : ""); + check += ns; + check += "::"; + check += baseType; + + if (strcmp(expectedType,check.c_str()) == 0) + return true; + + // see if the namespace is nested. + int posOfScopeOp = ns.find("::"); + if (posOfScopeOp >= 0) + { + done = false; + // cur off the outermost namespace + ns = ns.substr(posOfScopeOp + 2); + } + } + + return false; + } + + PythonToCppException::PythonToCppException() : XbmcCommons::UncheckedException("") + { + setClassname("PythonToCppException"); + + PyObject* exc_type; + PyObject* exc_value; + PyObject* exc_traceback; + PyObject* pystring = NULL; + + CStdString msg; + + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + if (exc_type == 0 && exc_value == 0 && exc_traceback == 0) + { + msg = "Strange: No Python exception occured"; + } + else + { + msg = "-->Python callback/script returned the following error<--\n"; + msg += " - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!\n"; + if (exc_type != NULL && (pystring = PyObject_Str(exc_type)) != NULL && (PyString_Check(pystring))) + { + PyObject *tracebackModule; + + msg.AppendFormat("Error Type: %s\n", PyString_AsString(pystring)); + if (PyObject_Str(exc_value)) + msg.AppendFormat("Error Contents: %s\n", PyString_AsString(PyObject_Str(exc_value))); + + tracebackModule = PyImport_ImportModule((char*)"traceback"); + if (tracebackModule != NULL) + { + PyObject *tbList, *emptyString, *strRetval; + + tbList = PyObject_CallMethod(tracebackModule, (char*)"format_exception", (char*)"OOO", exc_type, exc_value == NULL ? Py_None : exc_value, exc_traceback == NULL ? Py_None : exc_traceback); + emptyString = PyString_FromString(""); + strRetval = PyObject_CallMethod(emptyString, (char*)"join", (char*)"O", tbList); + + msg.Format("%s%s", msg.c_str(),PyString_AsString(strRetval)); + + Py_DECREF(tbList); + Py_DECREF(emptyString); + Py_DECREF(strRetval); + Py_DECREF(tracebackModule); + } + msg += "-->End of Python script error report<--\n"; + } + else + { + pystring = NULL; + msg += "<unknown exception type>"; + } + } + + SetMessage("%s",msg.c_str()); + } +} + diff --git a/xbmc/interfaces/python/swig.h b/xbmc/interfaces/python/swig.h new file mode 100644 index 0000000000..6d6bdc0152 --- /dev/null +++ b/xbmc/interfaces/python/swig.h @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include <Python.h> +#include <string> +#include <stdint.h> + +#include "utils/StdString.h" +#include "interfaces/legacy/Exception.h" +#include "threads/ThreadLocal.h" + +namespace PythonBindings +{ + void PyXBMCInitializeTypeObject(PyTypeObject* type_object); + int PyXBMCGetUnicodeString(std::string& buf, PyObject* pObject, bool coerceToString = false, + const char* pos = "unknown", + const char* methodname = "unknown"); + + // This will hold the pointer to the api type, whether known or unknown + struct PyHolder + { + PyObject_HEAD + int32_t magicNumber; + const char* swigType; + void* pSelf; + }; + + XBMCCOMMONS_STANDARD_EXCEPTION(WrongTypeException); + +#define XBMC_PYTHON_TYPE_MAGIC_NUMBER 0x58626D63 + + /** + * This method retrieves the pointer from the PyHolder. The return value should + * be case to the appropriate type. + * + * Since the calls to this are generated there's no NULL pointer checks + */ + inline void* retrieveApiInstance(PyObject* pythonType, PyTypeObject* typeToCheck, + const char* methodNameForErrorString, + const char* typenameForErrorString) throw (WrongTypeException) + { + if (pythonType == NULL || ((PyHolder*)pythonType)->magicNumber != XBMC_PYTHON_TYPE_MAGIC_NUMBER) + return NULL; + if (!PyObject_TypeCheck(pythonType, typeToCheck)) + throw WrongTypeException("Incorrect type passed to \"%s\", was expecting a \"%s\".",methodNameForErrorString,typenameForErrorString); + return ((PyHolder*)pythonType)->pSelf; + } + + bool isParameterRightType(const char* passedType, const char* expectedType, const char* methodNamespacePrefix); + + /** + * This method retrieves the pointer from the PyHolder. The return value should + * be case to the appropriate type. + * + * Since the calls to this are generated there's no NULL pointer checks + */ + inline void* retrieveApiInstance(PyObject* pythonType, const char* swigType, const char* methodNamespacePrefix, + const char* methodNameForErrorString) throw (WrongTypeException) + { + if (pythonType == NULL || ((PyHolder*)pythonType)->magicNumber != XBMC_PYTHON_TYPE_MAGIC_NUMBER) + throw WrongTypeException("Non api type passed in place of the expected type \"%s.\"",swigType); + if (!isParameterRightType(((PyHolder*)pythonType)->swigType,swigType,methodNamespacePrefix)) + throw WrongTypeException("Incorrect type passed to \"%s\", was expecting a \"%s\" but received a \"%s\"", + methodNameForErrorString,swigType,((PyHolder*)pythonType)->swigType); + return ((PyHolder*)pythonType)->pSelf; + } + + /** + * This method allows for conversion of the native api Type to the Python type + * + * NOTE: swigTypeString must be in the data segment. That is, it should be an explicit string since + * the const char* is stored in a PyHolder struct and never deleted. + */ + inline PyObject* makePythonInstance(void* api, PyTypeObject* typeObj, const char* swigTypeString) + { + PyHolder* self = (PyHolder*)typeObj->tp_alloc(typeObj,0); + if (!self) return NULL; + self->magicNumber = XBMC_PYTHON_TYPE_MAGIC_NUMBER; + self->swigType = swigTypeString; + self->pSelf = api; + return (PyObject*)self; + } + + class Director + { + protected: + PyObject* self; + public: + inline Director() : self(NULL) {} + inline void setPyObjectForDirector(PyObject* pyargself) { self = pyargself; } + }; + + /** + * This exception is thrown from Director calls that call into python when the + * Python error is + */ + class PythonToCppException : public XbmcCommons::UncheckedException + { + public: + /** + * Assuming a PyErr_Occurred, this will fill the exception message with all + * of the appropriate information including the traceback if it can be + * obtained. It will also clear the python message. + */ + PythonToCppException(); + }; +} diff --git a/xbmc/interfaces/python/typemaps/python.Alternative.outtm b/xbmc/interfaces/python/typemaps/python.Alternative.outtm new file mode 100644 index 0000000000..e8b069f783 --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.Alternative.outtm @@ -0,0 +1,52 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% + matcher = type =~ /Alternative<\((.*)\)>/ + vectype = '(' + matcher[0][1] + ')' + boolean ispointer = swigTypeParser.SwigType_ispointer(type) + int seq = sequence.increment() + String accessor = ispointer ? '->' : '.' + altAccess = [ 'former', 'later' ] + altSwitch = [ 'first', 'second' ] +%> + WhichAlternative pos = ${api}${accessor}which(); + + if (<%if (ispointer) { %>${api} != NULL && <%}%>pos != XBMCAddon::none) + { <% + swigTypeParser.SwigType_parmlist(vectype).eachWithIndex { curType, entryIndex -> +%> + if (pos == XBMCAddon::${altSwitch[entryIndex]}) + { + const ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(curType))}& entry${seq} = ${api}${accessor}${altAccess[entryIndex]}(); + { + ${helper.getOutConversion(curType,result,method,[ 'api' : 'entry' + seq, 'sequence' : sequence ])} + } + } +<% + } +%> + } + else + { + ${result} = Py_None; + } diff --git a/xbmc/interfaces/python/typemaps/python.Tuple.intm b/xbmc/interfaces/python/typemaps/python.Tuple.intm new file mode 100644 index 0000000000..394651fc1d --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.Tuple.intm @@ -0,0 +1,57 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% +matcher = ltype =~ /Tuple<\((.*)\)>/ + vectype = '(' + matcher[0][1] + ')' + boolean ispointer = swigTypeParser.SwigType_ispointer(type) + String accessor = ispointer ? '->' : '.' + int seq = sequence.increment() + tupleAccess = [ 'first', 'second', 'third', 'fourth' ] +%> + { + bool isTuple = PyObject_TypeCheck(${slarg},&PyTuple_Type); + if (!isTuple && !PyObject_TypeCheck(${slarg},&PyList_Type)) + { + PyErr_SetString(PyExc_TypeError, "the parameter \"${api}\" must be either a Tuple or a List."); + return NULL; // short circuit the rest of this python method + } + int vecSize = (isTuple ? PyTuple_Size(${slarg}) : PyList_Size(${slarg})); +<% + swigTypeParser.SwigType_parmlist(vectype).eachWithIndex { curType, entryIndex -> +%> + if (vecSize > ${entryIndex}) + { + PyObject *pyentry${entryIndex}_${seq} = NULL; + pyentry${entryIndex}_${seq} = (isTuple ? PyTuple_GetItem(${slarg}, ${entryIndex}) : PyList_GetItem(${slarg}, ${entryIndex})); + ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(curType))} entry${entryIndex}_${seq}; + ${helper.getInConversion(curType, 'entry' + entryIndex + '_' + seq, 'pyentry' + entryIndex + '_' + seq, method, + [ 'type' : vectype, + 'ltype' : swigTypeParser.SwigType_ltype(curType), + 'sequence' : sequence + ])} + ${api}${accessor}${tupleAccess[entryIndex]}() = entry${entryIndex}_${seq}; + } +<% + } +%> + } diff --git a/xbmc/interfaces/python/typemaps/python.Tuple.outtm b/xbmc/interfaces/python/typemaps/python.Tuple.outtm new file mode 100644 index 0000000000..f32dcfb7d9 --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.Tuple.outtm @@ -0,0 +1,56 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% + matcher = type =~ /Tuple<\((.*)\)>/ + vectype = '(' + matcher[0][1] + ')' + boolean ispointer = swigTypeParser.SwigType_ispointer(type) + int seq = sequence.increment() + String accessor = ispointer ? '->' : '.' + tupleAccess = [ 'first', 'second', 'third', 'fourth' ] +%> + + int vecSize = ${api}${accessor}GetNumValuesSet(); + ${result} = PyTuple_New(vecSize); +<% + if (ispointer) + { +%> + if (${api} != NULL) +<% } // this ends the if (ispointer) +%> { + PyObject* pyentry${seq}; <% + swigTypeParser.SwigType_parmlist(vectype).eachWithIndex { curType, entryIndex -> +%> + + if (vecSize > ${entryIndex}) + { + const ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(curType))}& entry${seq} = ${api}${accessor}${tupleAccess[entryIndex]}(); + { + ${helper.getOutConversion(curType,'result',method,[ 'result' : 'pyentry' + seq, 'api' : 'entry' + seq, 'sequence' : sequence ])} + } + PyTuple_SetItem(${result}, ${entryIndex}, pyentry${seq}); + } +<% + } +%> + } diff --git a/xbmc/interfaces/python/xbmcmodule/player.h b/xbmc/interfaces/python/typemaps/python.dict.intm index 44f39d667f..549988aeec 100644 --- a/xbmc/interfaces/python/xbmcmodule/player.h +++ b/xbmc/interfaces/python/typemaps/python.dict.intm @@ -1,5 +1,6 @@ +<% /* - * Copyright (C) 2005-2008 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -18,30 +19,16 @@ * http://www.gnu.org/copyleft/gpl.html * */ - -#include <Python.h> - -#include "PythonPlayer.h" -#include "cores/playercorefactory/PlayerCoreFactory.h" -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - int iPlayList; - CPythonPlayer* pPlayer; - EPLAYERCORES playerCore; - } Player; - - extern PyTypeObject Player_Type; - void initPlayer_Type(); -} - -#ifdef __cplusplus -} -#endif +%> + { + PyObject *pykey, *pyvalue; + Py_ssize_t pos = 0; + while(PyDict_Next(${slarg}, &pos, &pykey, &pyvalue)) + { + CStdString key; + CStdString value; + PyXBMCGetUnicodeString(key,pykey,false,"${api}","${method.@name}"); + PyXBMCGetUnicodeString(value,pyvalue,true,"${api}","${method.@name}"); + ${api}[key] = value; + } + } diff --git a/xbmc/interfaces/python/typemaps/python.map.intm b/xbmc/interfaces/python/typemaps/python.map.intm new file mode 100644 index 0000000000..f93df993bf --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.map.intm @@ -0,0 +1,46 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% + matcher = ltype =~ /std::map<\((.*),(.*)\)>/ + keytype = matcher[0][1] + valtype = matcher[0][2] +%> + + { + PyObject *pykey, *pyvalue; + Py_ssize_t pos = 0; + while(PyDict_Next(${slarg}, &pos, &pykey, &pyvalue)) + { + ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(keytype))} key; + ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(valtype))} value; + ${helper.getInConversion(keytype, 'key', 'pykey', method, + [ 'type' : swigTypeParser.SwigType_str(keytype), + 'ltype' : swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(keytype)) + ])} + ${helper.getInConversion(valtype, 'value', 'pyvalue' ,method, + [ 'type' : swigTypeParser.SwigType_str(valtype), + 'ltype' : swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(valtype)) + ])} + ${api}[key] = value; + } + } diff --git a/xbmc/interfaces/python/xbmcmodule/infotagvideo.h b/xbmc/interfaces/python/typemaps/python.string.outtm index 4fed3bd8bf..1751f7078f 100644 --- a/xbmc/interfaces/python/xbmcmodule/infotagvideo.h +++ b/xbmc/interfaces/python/typemaps/python.string.outtm @@ -1,5 +1,6 @@ +<% /* - * Copyright (C) 2005-2008 Team XBMC + * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -18,29 +19,7 @@ * http://www.gnu.org/copyleft/gpl.html * */ - -#include <Python.h> - -#include "video/VideoInfoTag.h" - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - CVideoInfoTag infoTag; - } InfoTagVideo; - - extern PyTypeObject InfoTagVideo_Type; - extern InfoTagVideo* InfoTagVideo_FromCVideoInfoTag(const CVideoInfoTag& infoTag); - void initInfoTagVideo_Type(); -} - -#ifdef __cplusplus -} -#endif +%> +${result} = <% + if(method.@feature_python_coerceToUnicode) { %>PyUnicode_DecodeUTF8(${api}.c_str(),${api}.size(),"replace");<% } + else { %>PyString_FromString(${api}.c_str());<% } %> diff --git a/xbmc/interfaces/python/typemaps/python.vector.intm b/xbmc/interfaces/python/typemaps/python.vector.intm new file mode 100644 index 0000000000..38036086dd --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.vector.intm @@ -0,0 +1,52 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% + matcher = ltype =~ /std::vector<\((.*)\)>/ + vectype = matcher[0][1] + boolean ispointer = swigTypeParser.SwigType_ispointer(type) + String accessor = ispointer ? '->' : '.' + int seq = sequence.increment() +%> + { + bool isTuple = PyObject_TypeCheck(${slarg},&PyTuple_Type); + if (!isTuple && !PyObject_TypeCheck(${slarg},&PyList_Type)) + { + PyErr_SetString(PyExc_TypeError, "the parameter \"${api}\" must be either a Tuple or a List."); + return NULL; // short circuit the rest of this python method + } + + <% if (ispointer) print("${api} = new std::vector<${swigTypeParser.SwigType_str(vectype)}>();") %> + PyObject *pyentry${seq} = NULL; + int vecSize = (isTuple ? PyTuple_Size(${slarg}) : PyList_Size(${slarg})); + for(int i = 0; i < vecSize; i++) + { + pyentry${seq} = (isTuple ? PyTuple_GetItem(${slarg}, i) : PyList_GetItem(${slarg}, i)); + ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(vectype))} entry${seq}; + ${helper.getInConversion(vectype, 'entry' + seq, 'pyentry' + seq, method, + [ 'type' : vectype, + 'ltype' : swigTypeParser.SwigType_ltype(vectype), + 'sequence' : sequence + ])} + ${api}${accessor}push_back(entry${seq}); + } + } diff --git a/xbmc/interfaces/python/typemaps/python.vector.outtm b/xbmc/interfaces/python/typemaps/python.vector.outtm new file mode 100644 index 0000000000..424643f172 --- /dev/null +++ b/xbmc/interfaces/python/typemaps/python.vector.outtm @@ -0,0 +1,51 @@ +<% +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +%> +<% + matcher = type =~ /std::vector<\((.*)\)>/ + vectype = matcher[0][1] + boolean ispointer = swigTypeParser.SwigType_ispointer(type) + String accessor = ispointer ? '->' : '.' + seq = sequence.increment() +%> + + ${result} = PyList_New(0); +<% + if (ispointer) + { +%> + if (${api} != NULL) + { +<% } %> + for (std::vector<${vectype}>::const_iterator iter = ${api}${accessor}begin(); iter != ${api}${accessor}end(); ++iter) + { + const ${swigTypeParser.SwigType_str(swigTypeParser.SwigType_ltype(vectype))}& entry${seq} = *iter; + PyObject* pyentry${seq}; + ${helper.getOutConversion(vectype,'result',method,[ 'result' : 'pyentry' + seq, 'api' : 'entry' + seq, 'sequence' : sequence ])} + PyList_Append(${result}, pyentry${seq}); + } +<% + if (ispointer) + { +%> + } +<% } %> diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.cpp b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.cpp deleted file mode 100644 index 58aae0e008..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyutil.h" -#include "GUIPythonWindow.h" -#include "window.h" -#include "control.h" -#include "action.h" -#include "guilib/GUIWindowManager.h" -#include "../XBPython.h" -#include "utils/log.h" -#include "threads/SingleLock.h" - -using namespace PYXBMC; - -PyXBMCAction::PyXBMCAction(void*& callback) - : param(0), pCallbackWindow(NULL), pObject(NULL), controlId(0), type(0) -{ - // this is ugly, but we can't grab python lock - // while holding gfx, that will potentially deadlock - CSingleExit ex(g_graphicsContext); - PyEval_AcquireLock(); - // callback is a reference to a pointer in the - // window, that is controlled by the python lock. - // callback can become null while we are trying - // to grab python lock above, so anything using - // this should allow that situation - void* tmp = callback; // copy the referenced value - pCallbackWindow = (PyObject*)tmp; // assign internally - Py_XINCREF((PyObject*)callback); - - PyEval_ReleaseLock(); -} - -PyXBMCAction::~PyXBMCAction() { - Py_XDECREF((PyObject*)pObject); - Py_XDECREF((PyObject*)pCallbackWindow); -} - -CGUIPythonWindow::CGUIPythonWindow(int id) - : CGUIWindow(id, ""), m_actionEvent(true) -{ - pCallbackWindow = NULL; - m_threadState = NULL; - m_loadType = LOAD_ON_GUI_INIT; - m_destroyAfterDeinit = false; -} - -CGUIPythonWindow::~CGUIPythonWindow(void) -{ -} - -bool CGUIPythonWindow::OnAction(const CAction &action) -{ - // call the base class first, then call python - bool ret = CGUIWindow::OnAction(action); - - // workaround - for scripts which try to access the active control (focused) when there is none. - // for example - the case when the mouse enters the screen. - CGUIControl *pControl = GetFocusedControl(); - if (action.IsMouse() && !pControl) - return ret; - - if(pCallbackWindow) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - inf->pObject = Action_FromAction(action); - - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnAction, inf); - PulseActionEvent(); - } - return ret; -} - -bool CGUIPythonWindow::OnBack(int actionID) -{ - // if we have a callback window then python handles the closing - if (!pCallbackWindow) - return CGUIWindow::OnBack(actionID); - return true; -} - -bool CGUIPythonWindow::OnMessage(CGUIMessage& message) -{ - switch (message.GetMessage()) - { - case GUI_MSG_WINDOW_DEINIT: - { - g_windowManager.ShowOverlay(OVERLAY_STATE_SHOWN); - } - break; - - case GUI_MSG_WINDOW_INIT: - { - CGUIWindow::OnMessage(message); - g_windowManager.ShowOverlay(OVERLAY_STATE_HIDDEN); - return true; - } - break; - - case GUI_MSG_CLICKED: - { - int iControl=message.GetSenderId(); - if(pCallbackWindow) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - // find python control object with same iControl - std::vector<Control*>::iterator it = ((PYXBMC::Window*)pCallbackWindow)->vecControls.begin(); - while (it != ((PYXBMC::Window*)pCallbackWindow)->vecControls.end()) - { - Control* pControl = *it; - if (pControl->iControlId == iControl) - { - inf->pObject = pControl; - Py_INCREF((PyObject*)inf->pObject); - break; - } - ++it; - } - // did we find our control? - if (inf->pObject) - { - // currently we only accept messages from a button or controllist with a select action - if ((ControlList_CheckExact((PyObject*)inf->pObject) && (message.GetParam1() == ACTION_SELECT_ITEM || message.GetParam1() == ACTION_MOUSE_LEFT_CLICK)) || - ControlButton_CheckExact((PyObject*)inf->pObject) || ControlRadioButton_CheckExact((PyObject*)inf->pObject) || - ControlCheckMark_CheckExact((PyObject*)inf->pObject)) - { - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnControl, inf); - PulseActionEvent(); - - // return true here as we are handling the event - return true; - } - } - - // if we get here, we didn't add the action - delete inf; - } - } - break; - } - - return CGUIWindow::OnMessage(message); -} - -void CGUIPythonWindow::OnDeinitWindow(int nextWindowID /*= 0*/) -{ - CGUIWindow::OnDeinitWindow(nextWindowID); - if (m_destroyAfterDeinit) - g_windowManager.Delete(GetID()); -} - -void CGUIPythonWindow::SetDestroyAfterDeinit(bool destroy /*= true*/) -{ - m_destroyAfterDeinit = destroy; -} - -void CGUIPythonWindow::SetCallbackWindow(void *state, void *object) -{ - pCallbackWindow = object; - m_threadState = state; -} - -void CGUIPythonWindow::WaitForActionEvent() -{ - g_pythonParser.WaitForEvent(m_actionEvent); - m_actionEvent.Reset(); -} - -void CGUIPythonWindow::PulseActionEvent() -{ - m_actionEvent.Set(); -} - - -#ifdef _LINUX - -/* -vector<PyXBMCAction*> g_actionQueue; -CRITICAL_SECTION g_critSection; - -void Py_InitCriticalSection() -{ - static bool first_call = true; - if (first_call) - { - InitializeCriticalSection(&g_critSection); - first_call = false; - } -} - -void Py_AddPendingActionCall(PyXBMCAction* inf) -{ - EnterCriticalSection(&g_critSection); - g_actionQueue.push_back(inf); - LeaveCriticalSection(&g_critSection); -} - -void Py_MakePendingActionCalls() -{ - vector<PyXBMCAction*>::iterator iter; - iter = g_actionQueue.begin(); - while (iter!=g_actionQueue.end()) - { - PyXBMCAction* arg = (*iter); - EnterCriticalSection(&g_critSection); - g_actionQueue.erase(iter); - LeaveCriticalSection(&g_critSection); - - if (arg->type==0) - { - Py_XBMC_Event_OnAction(arg); - } else if (arg->type==1) { - Py_XBMC_Event_OnControl(arg); - } - - EnterCriticalSection(&g_critSection); - iter=g_actionQueue.begin(); - LeaveCriticalSection(&g_critSection); - } -} - -*/ - -#endif - -/* - * called from python library! - */ -int Py_XBMC_Event_OnControl(void* arg) -{ - if(!arg) - return 0; - - PyXBMCAction* action = (PyXBMCAction*)arg; - if (action->pCallbackWindow) - { - PyXBMCAction* action = (PyXBMCAction*)arg; - PyObject *ret = PyObject_CallMethod((PyObject*)action->pCallbackWindow, (char*)"onControl", (char*)"(O)", (PyObject*)action->pObject); - if (ret) { - Py_DECREF(ret); - } - } - delete action; - return 0; -} - -/* - * called from python library! - */ -int Py_XBMC_Event_OnAction(void* arg) -{ - if(!arg) - return 0; - - PyXBMCAction* action = (PyXBMCAction*)arg; - if (action->pCallbackWindow) - { - Action *pAction= (Action *)action->pObject; - - PyObject *ret = PyObject_CallMethod((PyObject*)action->pCallbackWindow, (char*)"onAction", (char*)"(O)", (PyObject*)pAction); - if (ret) { - Py_DECREF(ret); - } - else { - CLog::Log(LOGERROR,"Exception in python script's onAction"); - PyErr_Print(); - } - } - delete action; - return 0; -} diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.h b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.h deleted file mode 100644 index 09c0d429b8..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "guilib/GUIWindow.h" -#include "threads/Event.h" - -class PyXBMCAction -{ -public: - int param; - void* pCallbackWindow; - void* pObject; - int controlId; // for XML window -#if defined(_LINUX) || defined(_WIN32) - int type; // 0=Action, 1=Control; -#endif - - PyXBMCAction(void*& callback); - virtual ~PyXBMCAction() ; -}; - -int Py_XBMC_Event_OnAction(void* arg); -int Py_XBMC_Event_OnControl(void* arg); - -class CGUIPythonWindow : public CGUIWindow -{ -public: - CGUIPythonWindow(int id); - virtual ~CGUIPythonWindow(void); - virtual bool OnMessage(CGUIMessage& message); - virtual bool OnAction(const CAction &action); - virtual bool OnBack(int actionID); - void SetCallbackWindow(void* state, void *object); - void WaitForActionEvent(); - void PulseActionEvent(); - void SetDestroyAfterDeinit(bool destroy = true); -protected: - virtual void OnDeinitWindow(int nextWindowID = 0); - void* pCallbackWindow; - void* m_threadState; - CEvent m_actionEvent; - bool m_destroyAfterDeinit; -}; diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.cpp b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.cpp deleted file mode 100644 index 576a2d593f..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "GUIPythonWindowDialog.h" -#include "guilib/GUIWindowManager.h" -#include "threads/SingleLock.h" - -CGUIPythonWindowDialog::CGUIPythonWindowDialog(int id) -:CGUIPythonWindow(id) -{ - m_loadType = LOAD_ON_GUI_INIT; -} - -CGUIPythonWindowDialog::~CGUIPythonWindowDialog(void) -{ -} - -bool CGUIPythonWindowDialog::OnMessage(CGUIMessage& message) -{ - switch(message.GetMessage()) - { - case GUI_MSG_WINDOW_INIT: - { - CGUIWindow::OnMessage(message); - return true; - } - break; - - case GUI_MSG_CLICKED: - { - return CGUIPythonWindow::OnMessage(message); - } - break; - } - - // we do not message CGUIPythonWindow here.. - return CGUIWindow::OnMessage(message); -} - -void CGUIPythonWindowDialog::Show_Internal(bool show /* = true */) -{ - if (show) - { - g_windowManager.RouteToWindow(this); - - // active this dialog... - CGUIMessage msg(GUI_MSG_WINDOW_INIT,0,0); - OnMessage(msg); - m_active = true; - } - else // hide - Close(); -} - -void CGUIPythonWindowDialog::OnDeinitWindow(int nextWindowID) -{ - g_windowManager.RemoveDialog(GetID()); - CGUIPythonWindow::OnDeinitWindow(nextWindowID); -} diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.h b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.h deleted file mode 100644 index 0732696006..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowDialog.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "GUIPythonWindow.h" - -class CApplicationMessenger; - -class CGUIPythonWindowDialog : public CGUIPythonWindow -{ -public: - CGUIPythonWindowDialog(int id); - virtual ~CGUIPythonWindowDialog(void); - virtual bool OnMessage(CGUIMessage& message); - virtual bool IsDialogRunning() const { return m_active; } - virtual bool IsDialog() const { return true;}; - virtual bool IsModalDialog() const { return true; }; - -protected: - friend class CApplicationMessenger; - void Show_Internal(bool show = true); - virtual void OnDeinitWindow(int nextWindowID = 0); -}; diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.cpp b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.cpp deleted file mode 100644 index 29e63ca6e0..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyutil.h" -#include "GUIPythonWindowXML.h" -#include "window.h" -#include "control.h" -#include "action.h" -#include "utils/URIUtils.h" -#include "guilib/GUIWindowManager.h" -#include "FileItem.h" -#include "filesystem/File.h" -#include "guilib/TextureManager.h" -#include "../XBPython.h" -#include "settings/GUISettings.h" -#include "guilib/LocalizeStrings.h" -#include "utils/log.h" -#include "utils/XBMCTinyXML.h" - -using namespace std; - -#define CONTROL_BTNVIEWASICONS 2 -#define CONTROL_BTNSORTBY 3 -#define CONTROL_BTNSORTASC 4 -#define CONTROL_LABELFILES 12 - -using namespace PYXBMC; - -CGUIPythonWindowXML::CGUIPythonWindowXML(int id, CStdString strXML, CStdString strFallBackPath) - : CGUIMediaWindow(id, strXML), m_actionEvent(true) -{ - pCallbackWindow = NULL; - m_threadState = NULL; - m_loadType = LOAD_ON_GUI_INIT; - m_scriptPath = strFallBackPath; - m_destroyAfterDeinit = false; -} - -CGUIPythonWindowXML::~CGUIPythonWindowXML(void) -{ -} - -bool CGUIPythonWindowXML::Update(const CStdString &strPath) -{ - return true; -} - -bool CGUIPythonWindowXML::OnAction(const CAction &action) -{ - // call the base class first, then call python - bool ret = CGUIWindow::OnAction(action); - if(pCallbackWindow) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - inf->pObject = Action_FromAction(action); - - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnAction, inf); - PulseActionEvent(); - } - return ret; -} - -bool CGUIPythonWindowXML::OnBack(int actionID) -{ - // if we have a callback window then python handles the closing - if (!pCallbackWindow) - return CGUIWindow::OnBack(actionID); - return true; -} - -bool CGUIPythonWindowXML::OnClick(int iItem) { - // 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; -} - -// SetupShares(); -/* - CGUIMediaWindow::OnWindowLoaded() calls SetupShares() so override it -and just call UpdateButtons(); -*/ -void CGUIPythonWindowXML::SetupShares() -{ - UpdateButtons(); -} - -bool CGUIPythonWindowXML::OnMessage(CGUIMessage& message) -{ - // TODO: We shouldn't be dropping down to CGUIWindow in any of this ideally. - // We have to make up our minds about what python should be doing and - // what this side of things should be doing - switch (message.GetMessage()) - { - case GUI_MSG_WINDOW_DEINIT: - { - return CGUIMediaWindow::OnMessage(message); - } - break; - - case GUI_MSG_WINDOW_INIT: - { - CGUIMediaWindow::OnMessage(message); - if(pCallbackWindow) - { - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnInit, new PyXBMCAction(pCallbackWindow)); - PulseActionEvent(); - } - return true; - } - break; - - case GUI_MSG_FOCUSED: - { - if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != (int)message.GetControlId()) - { - m_viewControl.SetFocused(); - return true; - } - // check if our focused control is one of our category buttons - int iControl=message.GetControlId(); - if(pCallbackWindow) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - inf->controlId = iControl; - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnFocus, inf); - PulseActionEvent(); - } - } - break; - - case GUI_MSG_CLICKED: - { - int iControl=message.GetSenderId(); - // Handle Sort/View internally. Scripters shouldn't use ID 2, 3 or 4. - if (iControl == CONTROL_BTNSORTASC) // sort asc - { - CLog::Log(LOGINFO, "WindowXML: Internal asc/dsc button not implemented"); - /*if (m_guiState.get()) - m_guiState->SetNextSortOrder(); - UpdateFileList();*/ - return true; - } - else if (iControl == CONTROL_BTNSORTBY) // sort by - { - CLog::Log(LOGINFO, "WindowXML: Internal sort button not implemented"); - /*if (m_guiState.get()) - m_guiState->SetNextSortMethod(); - UpdateFileList();*/ - return true; - } - else if (iControl == CONTROL_BTNVIEWASICONS) - { // base class handles this one - break; - } - if(pCallbackWindow && iControl && iControl != (int)this->GetID()) // pCallbackWindow && != this->GetID()) - { - CGUIControl* controlClicked = (CGUIControl*)this->GetControl(iControl); - - // The old python way used to check list AND SELECITEM method or if its a button, checkmark. - // Its done this way for now to allow other controls without a python version like togglebutton to still raise a onAction event - if (controlClicked) // Will get problems if we the id is not on the window and we try to do GetControlType on it. So check to make sure it exists - { - if ((controlClicked->IsContainer() && (message.GetParam1() == ACTION_SELECT_ITEM || message.GetParam1() == ACTION_MOUSE_LEFT_CLICK)) || !controlClicked->IsContainer()) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - inf->controlId = iControl; - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnClick, inf); - PulseActionEvent(); - return true; - } - else if (controlClicked->IsContainer() && message.GetParam1() == ACTION_MOUSE_RIGHT_CLICK) - { - PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow); - inf->pObject = Action_FromAction(CAction(ACTION_CONTEXT_MENU)); - - // aquire lock? - PyXBMC_AddPendingCall((PyThreadState*)m_threadState, Py_XBMC_Event_OnAction, inf); - PulseActionEvent(); - return true; - } - } - } - } - break; - } - - return CGUIMediaWindow::OnMessage(message); -} - -void CGUIPythonWindowXML::OnDeinitWindow(int nextWindowID /*= 0*/) -{ - CGUIMediaWindow::OnDeinitWindow(nextWindowID); - if (m_destroyAfterDeinit) - g_windowManager.Delete(GetID()); -} - -void CGUIPythonWindowXML::SetDestroyAfterDeinit(bool destroy /*= true*/) -{ - m_destroyAfterDeinit = destroy; -} - -void CGUIPythonWindowXML::AddItem(CFileItemPtr fileItem, int itemPosition) -{ - if (itemPosition == INT_MAX || itemPosition > m_vecItems->Size()) - { - m_vecItems->Add(fileItem); - } - else if (itemPosition < -1 && !(itemPosition*-1 < m_vecItems->Size())) - { - m_vecItems->AddFront(fileItem,0); - } - else - { - m_vecItems->AddFront(fileItem,itemPosition); - } - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -void CGUIPythonWindowXML::RemoveItem(int itemPosition) -{ - m_vecItems->Remove(itemPosition); - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -int CGUIPythonWindowXML::GetListSize() -{ - return m_vecItems->Size(); -} - -int CGUIPythonWindowXML::GetCurrentListPosition() -{ - return m_viewControl.GetSelectedItem(); -} - -void CGUIPythonWindowXML::SetCurrentListPosition(int item) -{ - m_viewControl.SetSelectedItem(item); -} - -void CGUIPythonWindowXML::SetProperty(const CStdString& key, const CStdString& value) -{ - m_vecItems->SetProperty(key, value); -} - -CFileItemPtr CGUIPythonWindowXML::GetListItem(int position) -{ - if (position < 0 || position >= m_vecItems->Size()) return CFileItemPtr(); - return m_vecItems->Get(position); -} - -void CGUIPythonWindowXML::ClearList() -{ - ClearFileItems(); - - m_viewControl.SetItems(*m_vecItems); - UpdateButtons(); -} - -void CGUIPythonWindowXML::WaitForActionEvent() -{ - g_pythonParser.WaitForEvent(m_actionEvent); - m_actionEvent.Reset(); -} - -void CGUIPythonWindowXML::PulseActionEvent() -{ - m_actionEvent.Set(); -} - -void CGUIPythonWindowXML::AllocResources(bool forceLoad /*= FALSE */) -{ - CStdString tmpDir; - URIUtils::GetDirectory(GetProperty("xmlfile").asString(), tmpDir); - CStdString fallbackMediaPath; - URIUtils::GetParentPath(tmpDir, fallbackMediaPath); - URIUtils::RemoveSlashAtEnd(fallbackMediaPath); - m_mediaDir = fallbackMediaPath; - - //CLog::Log(LOGDEBUG, "CGUIPythonWindowXML::AllocResources called: %s", fallbackMediaPath.c_str()); - g_TextureManager.AddTexturePath(m_mediaDir); - CGUIMediaWindow::AllocResources(forceLoad); - g_TextureManager.RemoveTexturePath(m_mediaDir); -} - -bool CGUIPythonWindowXML::LoadXML(const CStdString &strPath, const CStdString &strLowerPath) -{ - // load our window - XFILE::CFile file; - if (!file.Open(strPath) && !file.Open(CStdString(strPath).ToLower()) && !file.Open(strLowerPath)) - { - // fail - can't load the file - CLog::Log(LOGERROR, "%s: Unable to load skin file %s", __FUNCTION__, strPath.c_str()); - return false; - } - // load the strings in - unsigned int offset = LoadScriptStrings(); - - CStdString xml; - char *buffer = new char[(unsigned int)file.GetLength()+1]; - if(buffer == NULL) - return false; - int size = file.Read(buffer, file.GetLength()); - if (size > 0) - { - buffer[size] = 0; - xml = buffer; - if (offset) - { - // replace the occurences of SCRIPT### with offset+### - // not particularly efficient, but it works - int pos = xml.Find("SCRIPT"); - while (pos != (int)CStdString::npos) - { - CStdString num = xml.Mid(pos + 6, 4); - int number = atol(num.c_str()); - CStdString oldNumber, newNumber; - oldNumber.Format("SCRIPT%d", number); - newNumber.Format("%lu", offset + number); - xml.Replace(oldNumber, newNumber); - pos = xml.Find("SCRIPT", pos + 6); - } - } - } - delete[] buffer; - - CXBMCTinyXML xmlDoc; - xmlDoc.Parse(xml.c_str()); - - if (xmlDoc.Error()) - return false; - - return Load(xmlDoc.RootElement()); -} - -void CGUIPythonWindowXML::FreeResources(bool forceUnLoad /*= FALSE */) -{ - // Unload temporary language strings - ClearScriptStrings(); - - CGUIMediaWindow::FreeResources(forceUnLoad); -} - -void CGUIPythonWindowXML::Process(unsigned int currentTime, CDirtyRegionList ®ions) -{ - g_TextureManager.AddTexturePath(m_mediaDir); - CGUIMediaWindow::Process(currentTime, regions); - g_TextureManager.RemoveTexturePath(m_mediaDir); -} - -int Py_XBMC_Event_OnClick(void* arg) -{ - if(!arg) - return 0; - - PyXBMCAction* action = (PyXBMCAction*)arg; - if (action->pCallbackWindow) - { - PyObject *ret = PyObject_CallMethod((PyObject*)action->pCallbackWindow, (char*)"onClick", (char*)"(i)", action->controlId); - if (ret) - { - Py_DECREF(ret); - } - } - delete action; - return 0; -} - -int Py_XBMC_Event_OnFocus(void* arg) -{ - if(!arg) - return 0; - - PyXBMCAction* action = (PyXBMCAction*)arg; - if (action->pCallbackWindow) - { - PyObject *ret = PyObject_CallMethod((PyObject*)action->pCallbackWindow, (char*)"onFocus", (char*)"(i)", action->controlId); - if (ret) - { - Py_DECREF(ret); - } - delete action; - } - return 0; -} - -int Py_XBMC_Event_OnInit(void* arg) -{ - if(!arg) - return 0; - - PyXBMCAction* action = (PyXBMCAction*)arg; - if (action->pCallbackWindow) - { - PyObject *ret = PyObject_CallMethod((PyObject*)action->pCallbackWindow, (char*)"onInit", (char*)"()"); //, (char*)"O", &self); - if (ret) - { - Py_XDECREF(ret); - } - } - delete action; - return 0; -} - -void CGUIPythonWindowXML::SetCallbackWindow(void *state, void *object) -{ - pCallbackWindow = object; - m_threadState = state; -} - -void CGUIPythonWindowXML::GetContextButtons(int itemNumber, CContextButtons &buttons) -{ - // 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' -} - -unsigned int CGUIPythonWindowXML::LoadScriptStrings() -{ - // Path where the language strings reside - CStdString pathToLanguageFile = m_scriptPath; - URIUtils::AddFileToFolder(pathToLanguageFile, "resources", pathToLanguageFile); - URIUtils::AddFileToFolder(pathToLanguageFile, "language", pathToLanguageFile); - URIUtils::AddSlashAtEnd(pathToLanguageFile); - - // allocate a bunch of strings - return g_localizeStrings.LoadBlock(m_scriptPath, pathToLanguageFile, g_guiSettings.GetString("locale.language")); -} - -void CGUIPythonWindowXML::ClearScriptStrings() -{ - // Unload temporary language strings - g_localizeStrings.ClearBlock(m_scriptPath); -} - - diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.h b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.h deleted file mode 100644 index 340be8b9eb..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXML.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "GUIPythonWindow.h" -#include "windows/GUIMediaWindow.h" -#include "threads/Event.h" - -int Py_XBMC_Event_OnClick(void* arg); -int Py_XBMC_Event_OnFocus(void* arg); -int Py_XBMC_Event_OnInit(void* arg); - -class CGUIPythonWindowXML : public CGUIMediaWindow -{ -public: - CGUIPythonWindowXML(int id, CStdString strXML, CStdString strFallBackPath); - virtual ~CGUIPythonWindowXML(void); - virtual bool OnMessage(CGUIMessage& message); - virtual bool OnAction(const CAction &action); - virtual bool OnBack(int actionID); - virtual void AllocResources(bool forceLoad = false); - virtual void FreeResources(bool forceUnLoad = false); - void Process(unsigned int currentTime, CDirtyRegionList ®ions); - void WaitForActionEvent(); - void PulseActionEvent(); - void AddItem(CFileItemPtr fileItem,int itemPosition); - void RemoveItem(int itemPosition); - void ClearList(); - CFileItemPtr GetListItem(int position); - int GetListSize(); - int GetCurrentListPosition(); - void SetCurrentListPosition(int item); - void SetCallbackWindow(void* state, void* object); - virtual bool OnClick(int iItem); - void SetProperty(const CStdString &strProperty, const CStdString &strValue); - void SetDestroyAfterDeinit(bool destroy = true); - -protected: - virtual void OnDeinitWindow(int nextWindowID = 0); - virtual void GetContextButtons(int itemNumber, CContextButtons &buttons); - virtual bool LoadXML(const CStdString &strPath, const CStdString &strPathLower); - unsigned int LoadScriptStrings(); - void ClearScriptStrings(); - virtual bool Update(const CStdString &strPath); - void SetupShares(); - void* pCallbackWindow; - void* m_threadState; - CEvent m_actionEvent; - bool m_bRunning; - CStdString m_scriptPath; - CStdString m_mediaDir; - bool m_destroyAfterDeinit; -}; - diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.cpp b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.cpp deleted file mode 100644 index bab729229b..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "GUIPythonWindowXMLDialog.h" -#include "guilib/GUIWindowManager.h" -#include "threads/SingleLock.h" - -CGUIPythonWindowXMLDialog::CGUIPythonWindowXMLDialog(int id, CStdString strXML, CStdString strFallBackPath) -: CGUIPythonWindowXML(id,strXML,strFallBackPath) -{ - m_loadType = LOAD_ON_GUI_INIT; -} - -CGUIPythonWindowXMLDialog::~CGUIPythonWindowXMLDialog(void) -{ -} - -bool CGUIPythonWindowXMLDialog::OnMessage(CGUIMessage &message) -{ - if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT) - { - CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); - if (pWindow) - g_windowManager.ShowOverlay(pWindow->GetOverlayState()); - return CGUIWindow::OnMessage(message); - } - return CGUIPythonWindowXML::OnMessage(message); -} - -void CGUIPythonWindowXMLDialog::Show_Internal(bool show /* = true */) -{ - if (show) - { - g_windowManager.RouteToWindow(this); - - // active this dialog... - CGUIMessage msg(GUI_MSG_WINDOW_INIT,0,0); - OnMessage(msg); - m_active = true; - } - else // hide - Close(); -} - -void CGUIPythonWindowXMLDialog::OnDeinitWindow(int nextWindowID) -{ - g_windowManager.RemoveDialog(GetID()); - CGUIPythonWindowXML::OnDeinitWindow(nextWindowID); -} diff --git a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.h b/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.h deleted file mode 100644 index b21821ad8d..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/GUIPythonWindowXMLDialog.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "GUIPythonWindowXML.h" - -class CApplicationMessenger; - -class CGUIPythonWindowXMLDialog : public CGUIPythonWindowXML -{ - public: - CGUIPythonWindowXMLDialog(int id, CStdString strXML, CStdString strFallBackPath); - virtual ~CGUIPythonWindowXMLDialog(void); - virtual bool OnMessage(CGUIMessage &message); - virtual bool IsDialogRunning() const { return m_active; } - virtual bool IsDialog() const { return true;}; - virtual bool IsModalDialog() const { return true; }; - virtual bool IsMediaWindow() const { return false; }; - protected: - friend class CApplicationMessenger; - void Show_Internal(bool show = true); - virtual void OnDeinitWindow(int nextWindowID = 0); -}; - diff --git a/xbmc/interfaces/python/xbmcmodule/Makefile.in b/xbmc/interfaces/python/xbmcmodule/Makefile.in deleted file mode 100644 index bfb600b04c..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/Makefile.in +++ /dev/null @@ -1,47 +0,0 @@ -INCLUDES += @PYTHON_CPPFLAGS@ - -SRCS = action.cpp -SRCS += control.cpp -SRCS += controlbutton.cpp -SRCS += controlcheckmark.cpp -SRCS += controledit.cpp -SRCS += controlfadelabel.cpp -SRCS += controlgroup.cpp -SRCS += controlimage.cpp -SRCS += controllabel.cpp -SRCS += controllist.cpp -SRCS += controlprogress.cpp -SRCS += controlradiobutton.cpp -SRCS += controlslider.cpp -SRCS += controlspin.cpp -SRCS += controltextbox.cpp -SRCS += dialog.cpp -SRCS += GUIPythonWindow.cpp -SRCS += GUIPythonWindowDialog.cpp -SRCS += GUIPythonWindowXML.cpp -SRCS += GUIPythonWindowXMLDialog.cpp -SRCS += infotagmusic.cpp -SRCS += infotagvideo.cpp -SRCS += keyboard.cpp -SRCS += listitem.cpp -SRCS += monitor.cpp -SRCS += player.cpp -SRCS += pyplaylist.cpp -SRCS += pyrendercapture.cpp -SRCS += PythonAddon.cpp -SRCS += PythonMonitor.cpp -SRCS += PythonPlayer.cpp -SRCS += pyutil.cpp -SRCS += window.cpp -SRCS += winxml.cpp -SRCS += winxmldialog.cpp -SRCS += xbmcaddonmodule.cpp -SRCS += xbmcguimodule.cpp -SRCS += xbmcmodule.cpp -SRCS += xbmcplugin.cpp -SRCS += xbmcvfsmodule.cpp - -LIB = xbmcmodule.a - -include @abs_top_srcdir@/Makefile.include --include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp b/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp deleted file mode 100644 index 8db03ff025..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (C) 2005-2010 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "PythonAddon.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "addons/AddonManager.h" -#include "addons/GUIDialogAddonSettings.h" -#include "guilib/GUIWindowManager.h" -#include "GUIUserMessages.h" -#include "utils/log.h" - -namespace PYXBMC -{ - - static const char* getDefaultId() - { - const char* id = NULL; - - // Get a reference to the main module - // and global dictionary - PyObject* main_module = PyImport_AddModule((char*)"__main__"); - PyObject* global_dict = PyModule_GetDict(main_module); - // Extract a reference to the function "func_name" - // from the global dictionary - PyObject* pyid = PyDict_GetItemString(global_dict, "__xbmcaddonid__"); - if(pyid) - id = PyString_AsString(pyid); - return id; - } - - static CStdString getAddonVersion() - { - // Get a reference to the main module - // and global dictionary - PyObject* main_module = PyImport_AddModule((char*)"__main__"); - PyObject* global_dict = PyModule_GetDict(main_module); - // Extract a reference to the function "func_name" - // from the global dictionary - PyObject* pyversion = PyDict_GetItemString(global_dict, "__xbmcapiversion__"); - CStdString version(PyString_AsString(pyversion)); - return version; - } - -} - - -#ifdef __cplusplus -extern "C" { -#endif - -using ADDON::AddonPtr; -using ADDON::CAddonMgr; - -namespace PYXBMC -{ - - PyObject* Addon_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Addon *self; - - self = (Addon*)type->tp_alloc(type, 0); - if (!self) return NULL; - - static const char *keywords[] = { "id", NULL }; - const char *id = NULL; - - // parse arguments - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"|s", - (char**)keywords, - (char**)&id - )) - { - Py_DECREF(self); - return NULL; - }; - - // if the id wasn't passed then get the id from - // the global dictionary - if (!id) - id = getDefaultId(); - - // if we still don't have an id then bail - if (!id) - { - PyErr_SetString(PyExc_Exception, "No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner."); - Py_DECREF(self); - return NULL; - } - - // if we still fail we MAY be able to recover. - if (!CAddonMgr::Get().GetAddon(id, self->pAddon)) - { - // we need to check the version prior to trying a bw compatibility trick - ADDON::AddonVersion version(getAddonVersion()); - ADDON::AddonVersion allowable("1.0"); - - if (version <= allowable) - { - // try the default ... - id = getDefaultId(); - - if (!CAddonMgr::Get().GetAddon(id, self->pAddon)) - { - PyErr_SetString(PyExc_Exception, "Could not get AddonPtr!"); - Py_DECREF(self); - return NULL; - } - else - CLog::Log(LOGERROR,"Use of deprecated functionality. Please to not assume that \"os.getcwd\" will return the script directory."); - } - else - { - CStdString errorMessage ("Could not get AddonPtr given a script id of "); - errorMessage += id; - errorMessage += ". If you are trying to use 'os.getcwd' to set the path, you cannot do that in a "; - errorMessage += version.Print(); - errorMessage += " plugin."; - PyErr_SetString(PyExc_Exception, errorMessage.c_str()); - Py_DECREF(self); - return NULL; - } - } - - CAddonMgr::Get().AddToUpdateableAddons(self->pAddon); - return (PyObject*)self; - } - - void Addon_Dealloc(Addon* self) - { - CAddonMgr::Get().RemoveFromUpdateableAddons(self->pAddon); - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(getLocalizedString__doc__, - "getLocalizedString(id) -- Returns an addon's localized 'unicode string'.\n" - "\n" - "id : integer - id# for string you want to localize.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - locstr = self.Addon.getLocalizedString(id=6)\n"); - - PyObject* Addon_GetLocalizedString(Addon *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "id", NULL }; - int id = -1; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"i", - (char**)keywords, - &id - )) - { - return NULL; - }; - - CStdString label = self->pAddon->GetString(id); - - return PyUnicode_DecodeUTF8(label.c_str(), label.size(), "replace"); - } - - PyDoc_STRVAR(getSetting__doc__, - "getSetting(id) -- Returns the value of a setting as a unicode string.\n" - "\n" - "id : string - id of the setting that the module needs to access.\n" - "\n" - "*Note, You can use the above as a keyword.\n" - "\n" - "example:\n" - " - apikey = self.Addon.getSetting('apikey')\n"); - - PyObject* Addon_GetSetting(Addon *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "id", NULL }; - char *id; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &id - )) - { - return NULL; - }; - - return Py_BuildValue((char*)"s", self->pAddon->GetSetting(id).c_str()); - } - - PyDoc_STRVAR(setSetting__doc__, - "setSetting(id, value) -- Sets a script setting.\n" - "\n" - "id : string - id of the setting that the module needs to access.\n" - "value : string or unicode - value of the setting.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - self.Settings.setSetting(id='username', value='teamxbmc')\n"); - - PyObject* Addon_SetSetting(Addon *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "id", "value", NULL }; - char *id = NULL; - PyObject *pValue = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &id, - &pValue - )) - { - return NULL; - }; - - CStdString value; - if (!id || !PyXBMCGetUnicodeString(value, pValue, 1)) - { - PyErr_SetString(PyExc_ValueError, "Invalid id or value!"); - return NULL; - } - - AddonPtr addon(self->pAddon); - CPyThreadState pyState; - bool save=true; - if (g_windowManager.IsWindowActive(WINDOW_DIALOG_ADDON_SETTINGS)) - { - CGUIDialogAddonSettings* dialog = (CGUIDialogAddonSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_ADDON_SETTINGS); - if (dialog->GetCurrentID() == addon->ID()) - { - CGUIMessage message(GUI_MSG_SETTING_UPDATED,0,0); - std::vector<CStdString> params; - params.push_back(id); - params.push_back(value); - message.SetStringParams(params); - g_windowManager.SendThreadMessage(message,WINDOW_DIALOG_ADDON_SETTINGS); - save=false; - } - } - if (save) - { - addon->UpdateSetting(id, value); - addon->SaveSettings(); - } - - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(openSettings__doc__, - "openSettings() -- Opens this scripts settings dialog.\n" - "\n" - "example:\n" - " - self.Settings.openSettings()\n"); - - PyObject* Addon_OpenSettings(Addon *self, PyObject *args, PyObject *kwds) - { - // show settings dialog - AddonPtr addon(self->pAddon); - CPyThreadState pyState; - CGUIDialogAddonSettings::ShowAndGetInput(addon); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getAddonInfo__doc__, - "getAddonInfo(id) -- Returns the value of an addon property as a string.\n" - "\n" - "id : string - id of the property that the module needs to access.\n" - "\n" - // Handle all props available - "*Note, choices are (author, changelog, description, disclaimer, fanart. icon, id, name, path\n" - " profile, stars, summary, type, version)\n" - "\n" - " You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - version = self.Addon.getAddonInfo('version')\n"); - - PyObject* Addon_GetAddonInfo(Addon *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "id", NULL }; - char *id; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &id - )) - { - return NULL; - }; - - if (strcmpi(id, "author") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Author().c_str()); - else if (strcmpi(id, "changelog") == 0) - return Py_BuildValue((char*)"s", self->pAddon->ChangeLog().c_str()); - else if (strcmpi(id, "description") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Description().c_str()); - else if (strcmpi(id, "disclaimer") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Disclaimer().c_str()); - else if (strcmpi(id, "fanart") == 0) - return Py_BuildValue((char*)"s", self->pAddon->FanArt().c_str()); - else if (strcmpi(id, "icon") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Icon().c_str()); - else if (strcmpi(id, "id") == 0) - return Py_BuildValue((char*)"s", self->pAddon->ID().c_str()); - else if (strcmpi(id, "name") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Name().c_str()); - else if (strcmpi(id, "path") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Path().c_str()); - else if (strcmpi(id, "profile") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Profile().c_str()); - else if (strcmpi(id, "stars") == 0) - return Py_BuildValue((char*)"i", self->pAddon->Stars()); - else if (strcmpi(id, "summary") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Summary().c_str()); - else if (strcmpi(id, "type") == 0) - return Py_BuildValue((char*)"s", ADDON::TranslateType(self->pAddon->Type()).c_str()); - else if (strcmpi(id, "version") == 0) - return Py_BuildValue((char*)"s", self->pAddon->Version().c_str()); - else - { - CStdString error; - error.Format("'%s' is an invalid Id", id); - PyErr_SetString(PyExc_ValueError, error.c_str()); - return NULL; - } - } - - PyMethodDef Addon_methods[] = { - {(char*)"getLocalizedString", (PyCFunction)Addon_GetLocalizedString, METH_VARARGS|METH_KEYWORDS, getLocalizedString__doc__}, - {(char*)"getSetting", (PyCFunction)Addon_GetSetting, METH_VARARGS|METH_KEYWORDS, getSetting__doc__}, - {(char*)"setSetting", (PyCFunction)Addon_SetSetting, METH_VARARGS|METH_KEYWORDS, setSetting__doc__}, - {(char*)"openSettings", (PyCFunction)Addon_OpenSettings, METH_VARARGS|METH_KEYWORDS, openSettings__doc__}, - {(char*)"getAddonInfo", (PyCFunction)Addon_GetAddonInfo, METH_VARARGS|METH_KEYWORDS, getAddonInfo__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(addon__doc__, - "Addon class.\n" - "\n" - "Addon(id) -- Creates a new Addon class.\n" - "\n" - "id : string - id of the addon.\n" - "\n" - "*Note, You can use the above as a keyword.\n" - "\n" - "example:\n" - " - self.Addon = xbmcaddon.Addon(id='script.recentlyadded')\n"); - -// Restore code and data sections to normal. - - PyTypeObject Addon_Type; - - void initAddon_Type() - { - PyXBMCInitializeTypeObject(&Addon_Type); - - Addon_Type.tp_name = (char*)"xbmcaddon.Addon"; - Addon_Type.tp_basicsize = sizeof(Addon); - Addon_Type.tp_dealloc = (destructor)Addon_Dealloc; - Addon_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Addon_Type.tp_doc = addon__doc__; - Addon_Type.tp_methods = Addon_methods; - Addon_Type.tp_base = 0; - Addon_Type.tp_new = Addon_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/PythonMonitor.cpp b/xbmc/interfaces/python/xbmcmodule/PythonMonitor.cpp deleted file mode 100644 index 9fc9a20b65..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/PythonMonitor.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2005-2012 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "PythonMonitor.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "../XBPython.h" -#include "threads/Atomics.h" - -using namespace PYXBMC; - -struct SPyMonitor -{ - SPyMonitor(CPythonMonitor* monitor - , const std::string &function, const std::string &arg = "") - { - m_monitor = monitor; - m_monitor->Acquire(); - m_function = function; - m_arg = arg; - } - - ~SPyMonitor() - { - m_monitor->Release(); - } - - std::string m_function; - std::string m_arg; - CPythonMonitor* m_monitor; -}; - -/* - * called from python library! - */ -static int SPyMonitor_Function(void* e) -{ - SPyMonitor* object = (SPyMonitor*)e; - PyObject* ret = NULL; - - if(object->m_monitor->m_callback) - { - if (!object->m_arg.empty()) - ret = PyObject_CallMethod(object->m_monitor->m_callback, (char*)object->m_function.c_str(), (char*)"(s)", object->m_arg.c_str()); - else - ret = PyObject_CallMethod(object->m_monitor->m_callback, (char*)object->m_function.c_str(), NULL); - } - - if(ret) - { - Py_DECREF(ret); - } - - CPyThreadState pyState; - delete object; - - return 0; - -} - -CPythonMonitor::CPythonMonitor() -{ - m_callback = NULL; - m_refs = 1; - g_pythonParser.RegisterPythonMonitorCallBack(this); -} - -void CPythonMonitor::Release() -{ - if(AtomicDecrement(&m_refs) == 0) - delete this; -} - -void CPythonMonitor::Acquire() -{ - AtomicIncrement(&m_refs); -} - -CPythonMonitor::~CPythonMonitor(void) -{ - g_pythonParser.UnregisterPythonMonitorCallBack(this); -} - -void CPythonMonitor::OnSettingsChanged() -{ - PyXBMC_AddPendingCall(m_state, SPyMonitor_Function, new SPyMonitor(this, "onSettingsChanged")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonMonitor::OnScreensaverActivated() -{ - PyXBMC_AddPendingCall(m_state, SPyMonitor_Function, new SPyMonitor(this, "onScreensaverActivated")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonMonitor::OnScreensaverDeactivated() -{ - PyXBMC_AddPendingCall(m_state, SPyMonitor_Function, new SPyMonitor(this, "onScreensaverDeactivated")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonMonitor::OnDatabaseUpdated(const std::string &database) -{ - PyXBMC_AddPendingCall(m_state, SPyMonitor_Function, new SPyMonitor(this, "onDatabaseUpdated", database)); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonMonitor::OnAbortRequested() -{ - PyXBMC_AddPendingCall(m_state, SPyMonitor_Function, new SPyMonitor(this, "onAbortRequested")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonMonitor::SetCallback(PyThreadState *state, PyObject *object) -{ - /* python lock should be held */ - m_callback = object; - m_state = state; -} diff --git a/xbmc/interfaces/python/xbmcmodule/PythonPlayer.cpp b/xbmc/interfaces/python/xbmcmodule/PythonPlayer.cpp deleted file mode 100644 index b55c818e1c..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/PythonPlayer.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyutil.h" -#include "PythonPlayer.h" -#include "pythreadstate.h" -#include "../XBPython.h" -#include "threads/Atomics.h" - -using namespace PYXBMC; - -struct SPyEvent -{ - SPyEvent(CPythonPlayer *player, const char *function, const std::vector<int> ¶ms=std::vector<int>()) - { - m_player = player; - m_player->Acquire(); - m_function = function; - m_params = params; - } - - ~SPyEvent() - { - m_player->Release(); - } - - const char* m_function; - CPythonPlayer* m_player; - std::vector<int> m_params; -}; - -/* - * called from python library! - */ -static int SPyEvent_Function(void* e) -{ - SPyEvent* object = (SPyEvent*)e; - PyObject* ret = NULL; - - if(object->m_player->m_callback) - { - if (object->m_params.size() == 2) - ret = PyObject_CallMethod(object->m_player->m_callback, (char*)object->m_function, (char*)"ii", object->m_params[0], object->m_params[1]); - else if (object->m_params.size() == 1) - ret = PyObject_CallMethod(object->m_player->m_callback, (char*)object->m_function, (char*)"i", object->m_params[0]); - else - ret = PyObject_CallMethod(object->m_player->m_callback, (char*)object->m_function, NULL); - } - - if(ret) - { - Py_DECREF(ret); - } - - CPyThreadState pyState; - delete object; - - return 0; - -} - -CPythonPlayer::CPythonPlayer() -{ - m_callback = NULL; - m_refs = 1; - g_pythonParser.RegisterPythonPlayerCallBack(this); -} - -void CPythonPlayer::Release() -{ - if(AtomicDecrement(&m_refs) == 0) - delete this; -} - -void CPythonPlayer::Acquire() -{ - AtomicIncrement(&m_refs); -} - -CPythonPlayer::~CPythonPlayer(void) -{ - g_pythonParser.UnregisterPythonPlayerCallBack(this); -} - -void CPythonPlayer::OnPlayBackStarted() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackStarted")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackEnded() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackEnded")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackStopped() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackStopped")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackPaused() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackPaused")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackResumed() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackResumed")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackSpeedChanged(int iSpeed) -{ - std::vector<int> params; - params.push_back(iSpeed); - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackSpeedChanged", params)); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackSeek(int iTime, int seekOffset) -{ - std::vector<int> params; - params.push_back(iTime); - params.push_back(seekOffset); - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackSeek", params)); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnPlayBackSeekChapter(int iChapter) -{ - std::vector<int> params; - params.push_back(iChapter); - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onPlayBackSeekChapter", params)); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::OnQueueNextItem() -{ - PyXBMC_AddPendingCall(m_state, SPyEvent_Function, new SPyEvent(this, "onQueueNextItem")); - g_pythonParser.PulseGlobalEvent(); -} - -void CPythonPlayer::SetCallback(PyThreadState *state, PyObject *object) -{ - /* python lock should be held */ - m_callback = object; - m_state = state; -} diff --git a/xbmc/interfaces/python/xbmcmodule/PythonPlayer.h b/xbmc/interfaces/python/xbmcmodule/PythonPlayer.h deleted file mode 100644 index a9be0e6c69..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/PythonPlayer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include <Python.h> -#include "cores/IPlayer.h" - - -int Py_XBMC_Event_OnPlayBackStarted(void* arg); -int Py_XBMC_Event_OnPlayBackEnded(void* arg); -int Py_XBMC_Event_OnPlayBackStopped(void* arg); -int Py_XBMC_Event_OnPlayBackPaused(void* arg); -int Py_XBMC_Event_OnPlayBackResumed(void* arg); -int Py_XBMC_Event_OnPlayBackSpeedChanged(int iSpeed); -int Py_XBMC_Event_OnPlayBackSeek(int iTime, int seekOffset); -int Py_XBMC_Event_OnPlayBackSeekChapter(int iChapter); -int Py_XBMC_Event_OnQueueNextItem(void* arg); - -class CPythonPlayer : public IPlayerCallback -{ -public: - CPythonPlayer(); - void SetCallback(PyThreadState *state, PyObject *object); - void OnPlayBackEnded(); - void OnPlayBackStarted(); - void OnPlayBackPaused(); - void OnPlayBackResumed(); - void OnPlayBackStopped(); - void OnPlayBackSpeedChanged(int iSpeed); - void OnPlayBackSeek(int iTime, int seekOffset); - void OnPlayBackSeekChapter(int iChapter); - void OnQueueNextItem(); - - void Acquire(); - void Release(); - - PyObject* m_callback; - PyThreadState *m_state; -protected: - virtual ~CPythonPlayer(void); - long m_refs; -}; diff --git a/xbmc/interfaces/python/xbmcmodule/action.cpp b/xbmc/interfaces/python/xbmcmodule/action.cpp deleted file mode 100644 index ff03f3ff83..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/action.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// Get rid of 'dereferencing type-punned pointer will break strict-aliasing rules' -// warnings caused by Py_RETURN_TRUE/FALSE. -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#include "action.h" -#include "guilib/Key.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* Action_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Action *self; - - self = (Action*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strAction) string(); - - //if (!PyArg_ParseTuple(args, "l", &self->action)) return NULL; - //self->action = -1; - - self->id = -1; - self->fAmount1 = 0.0f; - self->fAmount2 = 0.0f; - self->fRepeat = 0.0f; - self->buttonCode = 0; - self->strAction = ""; - - return (PyObject*)self; - } - - PyObject* Action_FromAction(const CAction& action) - { - Action* pyAction = (Action*)Action_Type.tp_alloc(&Action_Type, 0); - new(&pyAction->strAction) string(); - - if (pyAction) - { - pyAction->id = action.GetID(); - pyAction->buttonCode = action.GetButtonCode(); - pyAction->fAmount1 = action.GetAmount(0); - pyAction->fAmount2 = action.GetAmount(1); - pyAction->fRepeat = action.GetRepeat(); - pyAction->strAction = action.GetName(); - } - - return (PyObject*)pyAction; - } - - void Action_Dealloc(Action* self) - { - self->strAction.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - /* For backwards compatability we have to check the action code - * against an integer - * The first argument is always an Action object - */ - PyObject* Action_RichCompare(Action* obj1, PyObject* obj2, int method) - { - if (method == Py_EQ) - { - if (Action_Check(obj2)) - { - // both are Action objects - Action* a2 = (Action*)obj2; - - if (obj1->id == a2->id && - obj1->buttonCode == a2->buttonCode && - obj1->fAmount1 == a2->fAmount1 && - obj1->fAmount2 == a2->fAmount2 && - obj1->fRepeat == a2->fRepeat && - obj1->strAction == a2->strAction) - { - Py_RETURN_TRUE; - } - else - { - Py_RETURN_FALSE; - } - } - else - { - // for backwards compatability in python scripts - PyObject* o1 = PyLong_FromLong(obj1->id); - return PyObject_RichCompare(o1, obj2, method); - } - } - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - - // getId() Method - PyDoc_STRVAR(getId__doc__, - "getId() -- Returns the action's current id as a long or 0 if no action is mapped in the xml's.\n" - "\n"); - - PyObject* Action_GetId(Action* self, PyObject* args) - { - return Py_BuildValue((char*)"l", self->id); - } - - // getButtonCode() Method - PyDoc_STRVAR(getButtonCode__doc__, - "getButtonCode() -- Returns the button code for this action.\n" - "\n"); - - PyObject* Action_GetButtonCode(Action* self, PyObject* args) - { - return Py_BuildValue((char*)"l", self->buttonCode); - } - - PyDoc_STRVAR(getAmount1__doc__, - "getAmount1() -- Returns the first amount of force applied to the thumbstick n.\n" - "\n"); - - PyDoc_STRVAR(getAmount2__doc__, - "getAmount2() -- Returns the second amount of force applied to the thumbstick n.\n" - "\n"); - - PyObject* Action_GetAmount1(Action* self, PyObject* args) - { - return Py_BuildValue((char*)"f", self->fAmount1); - } - - PyObject* Action_GetAmount2(Action* self, PyObject* args) - { - return Py_BuildValue((char*)"f", self->fAmount2); - } - - PyMethodDef Action_methods[] = { - {(char*)"getId", (PyCFunction)Action_GetId, METH_VARARGS, getId__doc__}, - {(char*)"getButtonCode", (PyCFunction)Action_GetButtonCode, METH_VARARGS, getButtonCode__doc__}, - {(char*)"getAmount1", (PyCFunction)Action_GetAmount1, METH_VARARGS, getAmount1__doc__}, - {(char*)"getAmount2", (PyCFunction)Action_GetAmount2, METH_VARARGS, getAmount2__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(action__doc__, - "Action class.\n" - "\n" - "For backwards compatibility reasons the == operator is extended so that it" - "can compare an action with other actions and action.GetID() with numbers" - " example: (action == ACTION_MOVE_LEFT)" - ""); - -// Restore code and data sections to normal. - - PyTypeObject Action_Type; - - void initAction_Type() - { - PyXBMCInitializeTypeObject(&Action_Type); - - Action_Type.tp_name = (char*)"xbmcgui.Action"; - Action_Type.tp_basicsize = sizeof(Action); - Action_Type.tp_dealloc = (destructor)Action_Dealloc; - //Action_Type.tp_compare = Action_Compare; - Action_Type.tp_richcompare = (richcmpfunc)Action_RichCompare; - Action_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Action_Type.tp_doc = action__doc__; - Action_Type.tp_methods = Action_methods; - Action_Type.tp_base = 0; - Action_Type.tp_new = Action_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/action.h b/xbmc/interfaces/python/xbmcmodule/action.h deleted file mode 100644 index a73d35557b..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/action.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "listitem.h" - -#pragma once - -class CAction; - -// python type checking -#define Action_Check(op) PyObject_TypeCheck(op, &Action_Type) -#define Action_CheckExact(op) ((op)->ob_type == &Action_Type) - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - long id; - float fAmount1; - float fAmount2; - float fRepeat; - unsigned long buttonCode; - std::string strAction; - } Action; - - extern PyTypeObject Action_Type; - - PyObject* Action_FromAction(const CAction& action); - - void initAction_Type(); - -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/control.cpp b/xbmc/interfaces/python/xbmcmodule/control.cpp deleted file mode 100644 index 06b5226b61..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/control.cpp +++ /dev/null @@ -1,634 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "control.h" -#include "pyutil.h" -#include "guilib/GUIControlFactory.h" -#include "guilib/GUITexture.h" -#include "utils/StringUtils.h" -#include "utils/XBMCTinyXML.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - /* - // not used for now - - PyObject* Control_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Control *self; - - self = (Control*)type->tp_alloc(type, 0); - if (!self) return NULL; - - self->iControlId = 0; - self->iParentId = 0; - self->pGUIControl = NULL; - - return (PyObject*)self; - } - - void Control_Dealloc(Control* self) - { - self->ob_type->tp_free((PyObject*)self); - } -*/ - - /* This function should return -1 if obj1 is less than obj2, - * 0 if they are equal, and 1 if obj1 is greater than obj2 - */ - int Control_Compare(PyObject* obj1, PyObject* obj2) - { - if(((Control*)obj1)->iControlId < ((Control*)obj2)->iControlId) return -1; - if(((Control*)obj1)->iControlId > ((Control*)obj2)->iControlId) return 1; - return 0; - } - - // getId() Method - PyDoc_STRVAR(getId__doc__, - "getId() -- Returns the control's current id as an integer.\n" - "\n" - "example:\n" - " - id = self.button.getId()\n"); - - PyObject* Control_GetId(Control* self, PyObject* args) - { - return Py_BuildValue((char*)"i", self->iControlId); - } - - // getPosition() Method - PyDoc_STRVAR(getPosition__doc__, - "getPosition() -- Returns the control's current position as a x,y integer tuple.\n" - "\n" - "example:\n" - " - pos = self.button.getPosition()\n"); - - PyObject* Control_GetPosition(Control* self, PyObject* args) - { - return Py_BuildValue((char*)"(ll)", self->dwPosX, self->dwPosY); - } - - // getHeight() Method - PyDoc_STRVAR(getHeight__doc__, - "getHeight() -- Returns the control's current height as an integer.\n" - "\n" - "example:\n" - " - height = self.button.getHeight()\n"); - - PyObject* Control_GetHeight(Control* self, PyObject* args) - { - return Py_BuildValue((char*)"l", self->dwHeight); - } - - // getWidth() Method - PyDoc_STRVAR(getWidth__doc__, - "getWidth() -- Returns the control's current width as an integer.\n" - "\n" - "example:\n" - " - width = self.button.getWidth()\n"); - - PyObject* Control_GetWidth(Control* self, PyObject* args) - { - return Py_BuildValue((char*)"l", self->dwWidth); - } - - // setEnabled() Method - PyDoc_STRVAR(setEnabled__doc__, - "setEnabled(enabled) -- Set's the control's enabled/disabled state.\n" - "\n" - "enabled : bool - True=enabled / False=disabled.\n" - "\n" - "example:\n" - " - self.button.setEnabled(False)\n"); - - PyObject* Control_SetEnabled(Control* self, PyObject* args) - { - char enabled; - if (!PyArg_ParseTuple(args, (char*)"b", &enabled)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetEnabled(0 != enabled); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setVisible() Method - PyDoc_STRVAR(setVisible__doc__, - "setVisible(visible) -- Set's the control's visible/hidden state.\n" - "\n" - "visible : bool - True=visible / False=hidden.\n" - "\n" - "example:\n" - " - self.button.setVisible(False)\n"); - - PyObject* Control_SetVisible(Control* self, PyObject* args) - { - char visible; - if (!PyArg_ParseTuple(args, (char*)"b", &visible)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) - { - self->pGUIControl->SetVisible(0 != visible); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setVisibleCondition() Method - PyDoc_STRVAR(setVisibleCondition__doc__, - "setVisibleCondition(visible[,allowHiddenFocus]) -- Set's the control's visible condition.\n" - " Allows XBMC to control the visible status of the control.\n" - "\n" - "visible : string - Visible condition.\n" - "allowHiddenFocus : bool - True=gains focus even if hidden.\n" - "\n" - "List of Conditions - http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions \n" - "\n" - "example:\n" - " - self.button.setVisibleCondition('[Control.IsVisible(41) + !Control.IsVisible(12)]', True)\n"); - - PyObject* Control_SetVisibleCondition(Control* self, PyObject* args) - { - char *cVisible = NULL; - char bHidden = false; - - if (!PyArg_ParseTuple(args, (char*)"s|b", &cVisible, &bHidden)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) - self->pGUIControl->SetVisibleCondition(cVisible, bHidden ? "true" : "false"); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setEnableCondition() Method - PyDoc_STRVAR(setEnableCondition__doc__, - "setEnableCondition(enable) -- Set's the control's enabled condition.\n" - " Allows XBMC to control the enabled status of the control.\n" - "\n" - "enable : string - Enable condition.\n" - "\n" - "List of Conditions - http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions \n" - "\n" - "example:\n" - " - self.button.setEnableCondition('System.InternetState')\n"); - - PyObject* Control_SetEnableCondition(Control* self, PyObject* args) - { - char *cEnable = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cEnable)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) - self->pGUIControl->SetEnableCondition(cEnable); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setAnimations() Method - PyDoc_STRVAR(setAnimations__doc__, - "setAnimations([(event, attr,)*]) -- Set's the control's animations.\n" - "\n" - "[(event,attr,)*] : list - A list of tuples consisting of event and attributes pairs.\n" - " - event : string - The event to animate.\n" - " - attr : string - The whole attribute string separated by spaces.\n" - "\n" - "Animating your skin - http://wiki.xbmc.org/?title=Animating_Your_Skin \n" - "\n" - "example:\n" - " - self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0',)])\n"); - - PyObject* Control_SetAnimations(Control* self, PyObject* args) - { - PyObject *pList = NULL; - if (!PyArg_ParseTuple(args, (char*)"O", &pList) || pList == NULL || !PyObject_TypeCheck(pList, &PyList_Type)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type List"); - return NULL; - } - - CXBMCTinyXML xmlDoc; - TiXmlElement xmlRootElement("control"); - TiXmlNode *pRoot = xmlDoc.InsertEndChild(xmlRootElement); - if (!pRoot) - { - PyErr_SetString(PyExc_TypeError, "TiXmlNode creation error"); - return NULL; - } - vector<CAnimation> animations; - for (int anim = 0; anim < PyList_Size(pList); anim++) - { - PyObject *pTuple = NULL; - char *cEvent = NULL; - char *cAttr = NULL; - pTuple = PyList_GetItem(pList, anim); - if (pTuple == NULL || !PyObject_TypeCheck(pTuple, &PyTuple_Type)) - { - PyErr_SetString(PyExc_TypeError, "List must only contain tuples"); - return NULL; - } - if (!PyArg_ParseTuple(pTuple, (char*)"ss", &cEvent, &cAttr)) - { - PyErr_SetString(PyExc_TypeError, "Error unpacking tuple found in list"); - return NULL; - } - - if (NULL != cAttr && NULL != cEvent) - { - TiXmlElement pNode("animation"); - CStdStringArray attrs; - StringUtils::SplitString(cAttr, " ", attrs); - for (unsigned int i = 0; i < attrs.size(); i++) - { - CStdStringArray attrs2; - StringUtils::SplitString(attrs[i], "=", attrs2); - if (attrs2.size() == 2) - pNode.SetAttribute(attrs2[0], attrs2[1]); - } - TiXmlText value(cEvent); - pNode.InsertEndChild(value); - pRoot->InsertEndChild(pNode); - } - } - - //bool ret = xmlDoc.SaveFile("special://profile/test.txt"); - - const CRect animRect((float)self->dwPosX, (float)self->dwPosY, (float)self->dwPosX + self->dwWidth, (float)self->dwPosY + self->dwHeight); - PyXBMCGUILock(); - if (self->pGUIControl) - { - CGUIControlFactory::GetAnimations(pRoot, animRect, self->iParentId, animations); - self->pGUIControl->SetAnimations(animations); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setPosition() Method - PyDoc_STRVAR(setPosition__doc__, - "setPosition(x, y) -- Set's the controls position.\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "\n" - "*Note, You may use negative integers. (e.g sliding a control into view)\n" - "\n" - "example:\n" - " - self.button.setPosition(100, 250)\n"); - - PyObject* Control_SetPosition(Control* self, PyObject* args) - { - if (!PyArg_ParseTuple(args, (char*)"ll", &self->dwPosX, &self->dwPosY)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetPosition((float)self->dwPosX, (float)self->dwPosY); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setWidth() Method - PyDoc_STRVAR(setWidth__doc__, - "setWidth(width) -- Set's the controls width.\n" - "\n" - "width : integer - width of control.\n" - "\n" - "example:\n" - " - self.image.setWidth(100)\n"); - - PyObject* Control_SetWidth(Control* self, PyObject* args) - { - if (!PyArg_ParseTuple(args, (char*)"l", &self->dwWidth)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetWidth((float)self->dwWidth); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setHeight() Method - PyDoc_STRVAR(setHeight__doc__, - "setHeight(height) -- Set's the controls height.\n" - "\n" - "height : integer - height of control.\n" - "\n" - "example:\n" - " - self.image.setHeight(100)\n"); - - PyObject* Control_SetHeight(Control* self, PyObject* args) - { - if (!PyArg_ParseTuple(args, (char*)"l", &self->dwHeight)) return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetHeight((float)self->dwHeight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setNavigation() Method - PyDoc_STRVAR(setNavigation__doc__, - "setNavigation(up, down, left, right) -- Set's the controls navigation.\n" - "\n" - "up : control object - control to navigate to on up.\n" - "down : control object - control to navigate to on down.\n" - "left : control object - control to navigate to on left.\n" - "right : control object - control to navigate to on right.\n" - "\n" - "*Note, Same as controlUp(), controlDown(), controlLeft(), controlRight().\n" - " Set to self to disable navigation for that direction.\n" - "\n" - "Throws: TypeError, if one of the supplied arguments is not a control type.\n" - " ReferenceError, if one of the controls is not added to a window.\n" - "\n" - "example:\n" - " - self.button.setNavigation(self.button1, self.button2, self.button3, self.button4)\n"); - - PyObject* Control_SetNavigation(Control* self, PyObject* args) - { - Control* pUpControl = NULL; - Control* pDownControl = NULL; - Control* pLeftControl = NULL; - Control* pRightControl = NULL; - - if (!PyArg_ParseTuple(args, (char*)"OOOO", &pUpControl, &pDownControl, &pLeftControl, &pRightControl)) return NULL; - - // type checking, objects should be of type Control - if(!(Control_Check(pUpControl) && Control_Check(pDownControl) && - Control_Check(pLeftControl) && Control_Check(pRightControl))) - { - PyErr_SetString(PyExc_TypeError, "Objects should be of type Control"); - return NULL; - } - if(self->iControlId == 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control has to be added to a window first"); - return NULL; - } - - self->iControlUp = pUpControl->iControlId; - self->iControlDown = pDownControl->iControlId; - self->iControlLeft = pLeftControl->iControlId; - self->iControlRight = pRightControl->iControlId; - - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetNavigation( - self->iControlUp,self->iControlDown,self->iControlLeft,self->iControlRight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // controlUp() Method - PyDoc_STRVAR(controlUp__doc__, - "controlUp(control) -- Set's the controls up navigation.\n" - "\n" - "control : control object - control to navigate to on up.\n" - "\n" - "*Note, You can also use setNavigation(). Set to self to disable navigation.\n" - "\n" - "Throws: TypeError, if one of the supplied arguments is not a control type.\n" - " ReferenceError, if one of the controls is not added to a window.\n" - "\n" - "example:\n" - " - self.button.controlUp(self.button1)\n"); - - PyObject* Control_ControlUp(Control* self, PyObject* args) - { - Control* pControl; - if (!PyArg_ParseTuple(args, (char*)"O", &pControl)) return NULL; - // type checking, object should be of type Control - if(!Control_Check(pControl)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - if(self->iControlId == 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control has to be added to a window first"); - return NULL; - } - - self->iControlUp = pControl->iControlId; - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetNavigation( - self->iControlUp,self->iControlDown,self->iControlLeft,self->iControlRight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // controlDown() Method - PyDoc_STRVAR(controlDown__doc__, - "controlDown(control) -- Set's the controls down navigation.\n" - "\n" - "control : control object - control to navigate to on down.\n" - "\n" - "*Note, You can also use setNavigation(). Set to self to disable navigation.\n" - "\n" - "Throws: TypeError, if one of the supplied arguments is not a control type.\n" - " ReferenceError, if one of the controls is not added to a window.\n" - "\n" - "example:\n" - " - self.button.controlDown(self.button1)\n"); - - PyObject* Control_ControlDown(Control* self, PyObject* args) - { - Control* pControl; - if (!PyArg_ParseTuple(args, (char*)"O", &pControl)) return NULL; - // type checking, object should be of type Control - if (!Control_Check(pControl)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - if(self->iControlId == 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control has to be added to a window first"); - return NULL; - } - - self->iControlDown = pControl->iControlId; - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetNavigation( - self->iControlUp,self->iControlDown,self->iControlLeft,self->iControlRight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // controlLeft() Method - PyDoc_STRVAR(controlLeft__doc__, - "controlLeft(control) -- Set's the controls left navigation.\n" - "\n" - "control : control object - control to navigate to on left.\n" - "\n" - "*Note, You can also use setNavigation(). Set to self to disable navigation.\n" - "\n" - "Throws: TypeError, if one of the supplied arguments is not a control type.\n" - " ReferenceError, if one of the controls is not added to a window.\n" - "\n" - "example:\n" - " - self.button.controlLeft(self.button1)\n"); - - PyObject* Control_ControlLeft(Control* self, PyObject* args) - { - Control* pControl; - if (!PyArg_ParseTuple(args, (char*)"O", &pControl)) return NULL; - // type checking, object should be of type Control - if (!Control_Check(pControl)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - if(self->iControlId == 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control has to be added to a window first"); - return NULL; - } - - self->iControlLeft = pControl->iControlId; - PyXBMCGUILock(); - if (self->pGUIControl) - { - self->pGUIControl->SetNavigation(self->iControlUp, self->iControlDown, - self->iControlLeft,self->iControlRight); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // controlRight() Method - PyDoc_STRVAR(controlRight__doc__, - "controlRight(control) -- Set's the controls right navigation.\n" - "\n" - "control : control object - control to navigate to on right.\n" - "\n" - "*Note, You can also use setNavigation(). Set to self to disable navigation.\n" - "\n" - "Throws: TypeError, if one of the supplied arguments is not a control type.\n" - " ReferenceError, if one of the controls is not added to a window.\n" - "\n" - "example:\n" - " - self.button.controlRight(self.button1)\n"); - - PyObject* Control_ControlRight(Control* self, PyObject* args) - { - Control* pControl; - if (!PyArg_ParseTuple(args, (char*)"O", &pControl)) return NULL; - // type checking, object should be of type Control - if (!Control_Check(pControl)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - if(self->iControlId == 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control has to be added to a window first"); - return NULL; - } - - self->iControlRight = pControl->iControlId; - PyXBMCGUILock(); - if (self->pGUIControl) self->pGUIControl->SetNavigation(self->iControlUp, - self->iControlDown,self->iControlLeft,self->iControlRight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef Control_methods[] = { - {(char*)"getId", (PyCFunction)Control_GetId, METH_VARARGS, getId__doc__}, - {(char*)"getPosition", (PyCFunction)Control_GetPosition, METH_VARARGS, getPosition__doc__}, - {(char*)"getHeight", (PyCFunction)Control_GetHeight, METH_VARARGS, getHeight__doc__}, - {(char*)"getWidth", (PyCFunction)Control_GetWidth, METH_VARARGS, getWidth__doc__}, - {(char*)"setEnabled", (PyCFunction)Control_SetEnabled, METH_VARARGS, setEnabled__doc__}, - {(char*)"setEnableCondition", (PyCFunction)Control_SetEnableCondition, METH_VARARGS, setEnableCondition__doc__}, - {(char*)"setVisible", (PyCFunction)Control_SetVisible, METH_VARARGS, setVisible__doc__}, - {(char*)"setVisibleCondition", (PyCFunction)Control_SetVisibleCondition, METH_VARARGS, setVisibleCondition__doc__}, - {(char*)"setAnimations", (PyCFunction)Control_SetAnimations, METH_VARARGS, setAnimations__doc__}, - {(char*)"setPosition", (PyCFunction)Control_SetPosition, METH_VARARGS, setPosition__doc__}, - {(char*)"setWidth", (PyCFunction)Control_SetWidth, METH_VARARGS, setWidth__doc__}, - {(char*)"setHeight", (PyCFunction)Control_SetHeight, METH_VARARGS, setHeight__doc__}, - {(char*)"setNavigation", (PyCFunction)Control_SetNavigation, METH_VARARGS, setNavigation__doc__}, - {(char*)"controlUp", (PyCFunction)Control_ControlUp, METH_VARARGS, controlUp__doc__}, - {(char*)"controlDown", (PyCFunction)Control_ControlDown, METH_VARARGS, controlDown__doc__}, - {(char*)"controlLeft", (PyCFunction)Control_ControlLeft, METH_VARARGS, controlLeft__doc__}, - {(char*)"controlRight", (PyCFunction)Control_ControlRight, METH_VARARGS, controlRight__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(control__doc__, - "Control class.\n" - "\n" - "Base class for all controls."); - -// Restore code and data sections to normal. - - PyTypeObject Control_Type; - - void initControl_Type() - { - PyXBMCInitializeTypeObject(&Control_Type); - - Control_Type.tp_name = (char*)"xbmcgui.Control"; - Control_Type.tp_basicsize = sizeof(Control); - Control_Type.tp_dealloc = 0; - Control_Type.tp_compare = Control_Compare; - Control_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Control_Type.tp_doc = control__doc__; - Control_Type.tp_methods = Control_methods; - Control_Type.tp_base = 0; - Control_Type.tp_new = 0; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/control.h b/xbmc/interfaces/python/xbmcmodule/control.h deleted file mode 100644 index 610e7715b2..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/control.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "listitem.h" -#include "guilib/GUIColorManager.h" - -#pragma once - -class CGUIControl; - -// python type checking -#define Control_Check(op) PyObject_TypeCheck(op, &Control_Type) -#define Control_CheckExact(op) ((op)->ob_type == &Control_Type) - -#define ControlButton_Check(op) PyObject_TypeCheck(op, &ControlButton_Type) -#define ControlButton_CheckExact(op) ((op)->ob_type == &ControlButton_Type) - -#define ControlCheckMark_Check(op) PyObject_TypeCheck(op, &ControlCheckMark_Type) -#define ControlCheckMark_CheckExact(op) ((op)->ob_type == &ControlCheckMark_Type) - -#define ControlProgress_Check(op) PyObject_TypeCheck(op, &ControlProgress_Type) -#define ControlProgress__CheckExact(op) ((op)->ob_type == &ControlProgress_Type) - -#define ControlList_Check(op) PyObject_TypeCheck(op, &ControlList_Type) -#define ControlList_CheckExact(op) ((op)->ob_type == &ControlList_Type) - -#define ControlSpin_Check(op) PyObject_TypeCheck(op, &ControlSpin_Type) -#define ControlSpin_CheckExact(op) ((op)->ob_type == &ControlSpin_Type) - -#define ControlLabel_Check(op) PyObject_TypeCheck(op, &ControlLabel_Type) -#define ControlLabel_CheckExact(op) ((op)->ob_type == &ControlLabel_Type) - -#define ControlFadeLabel_Check(op) PyObject_TypeCheck(op, &ControlFadeLabel_Type) -#define ControlFadeLabel_CheckExact(op) ((op)->ob_type == &ControlFadeLabel_Type) - -#define ControlTextBox_Check(op) PyObject_TypeCheck(op, &ControlTextBox_Type) -#define ControlTextBox_CheckExact(op) ((op)->ob_type == &ControlTextBox_Type) - -#define ControlImage_Check(op) PyObject_TypeCheck(op, &ControlImage_Type) -#define ControlImage_CheckExact(op) ((op)->ob_type == &ControlImage_Type) - -#define ControlGroup_Check(op) PyObject_TypeCheck(op, &ControlGroup_Type) -#define ControlGroup_CheckExact(op) ((op)->ob_type == &ControlGroup_Type) - -#define ControlRadioButton_Check(op) PyObject_TypeCheck(op, &ControlRadioButton_Type) -#define ControlRadioButton_CheckExact(op) ((op)->ob_type == &ControlRadioButton_Type) - -#define ControlSlider_Check(op) PyObject_TypeCheck(op, &ControlSlider_Type) -#define ControlSlider_CheckExact(op) ((op)->ob_type == &ControlSlider_Type) - -#define ControlEdit_Check(op) PyObject_TypeCheck(op, &ControlEdit_Type) -#define ControlEdit_CheckExact(op) ((op)->ob_type == &ControlEdit_Type) -// ----------------- - -// hardcoded offsets for button controls (and controls that use button controls) -// ideally they should be dynamically read in as with all the other properties. -#define CONTROL_TEXT_OFFSET_X 10 -#define CONTROL_TEXT_OFFSET_Y 2 - -#define PyObject_HEAD_XBMC_CONTROL \ - PyObject_HEAD \ - int iControlId; \ - int iParentId; \ - int dwPosX; \ - int dwPosY; \ - int dwWidth; \ - int dwHeight; \ - int iControlUp; \ - int iControlDown; \ - int iControlLeft; \ - int iControlRight; \ - CGUIControl* pGUIControl; - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD_XBMC_CONTROL - } Control; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - color_t color; - std::string strTextureUp; - std::string strTextureDown; - std::string strTextureUpFocus; - std::string strTextureDownFocus; - } ControlSpin; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - std::string strText; - color_t textColor; - color_t disabledColor; - uint32_t align; - bool bHasPath; - int iAngle; - } ControlLabel; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - std::string strText; - std::string strTextureFocus; - std::string strTextureNoFocus; - color_t textColor; - color_t disabledColor; - uint32_t align; - bool bIsPassword; - } ControlEdit; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - color_t textColor; - std::vector<std::string> vecLabels; - uint32_t align; - } ControlFadeLabel; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - color_t textColor; - } ControlTextBox; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFileName; - int aspectRatio; - color_t colorDiffuse; - } ControlImage; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strTextureLeft; - std::string strTextureMid; - std::string strTextureRight; - std::string strTextureBg; - std::string strTextureOverlay; - int aspectRatio; - color_t colorDiffuse; - } ControlProgress; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - std::string strText; - std::string strText2; - std::string strTextureFocus; - std::string strTextureNoFocus; - color_t textColor; - color_t disabledColor; - int textOffsetX; - int textOffsetY; - color_t align; - int iAngle; - int shadowColor; - int focusedColor; - } ControlButton; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - std::string strText; - std::string strTextureFocus; - std::string strTextureNoFocus; - color_t textColor; - color_t disabledColor; - int checkWidth; - int checkHeight; - uint32_t align; - } ControlCheckMark; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::vector<PYXBMC::ListItem*> vecItems; - std::string strFont; - ControlSpin* pControlSpin; - - color_t textColor; - color_t selectedColor; - std::string strTextureButton; - std::string strTextureButtonFocus; - - int imageHeight; - int imageWidth; - int itemHeight; - int space; - - int itemTextOffsetX; - int itemTextOffsetY; - uint32_t alignmentY; - } ControlList; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - } ControlGroup; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strFont; - std::string strText; - std::string strTextureFocus; - std::string strTextureNoFocus; - std::string strTextureRadioFocus; - std::string strTextureRadioNoFocus; - color_t textColor; - color_t disabledColor; - int textOffsetX; - int textOffsetY; - uint32_t align; - int iAngle; - color_t shadowColor; - color_t focusedColor; - } ControlRadioButton; - - typedef struct { - PyObject_HEAD_XBMC_CONTROL - std::string strTextureBack; - std::string strTexture; - std::string strTextureFoc; - } ControlSlider; - - extern void Control_Dealloc(Control* self); - - extern PyMethodDef Control_methods[]; - - extern PyTypeObject Control_Type; - extern PyTypeObject ControlSpin_Type; - extern PyTypeObject ControlLabel_Type; - extern PyTypeObject ControlFadeLabel_Type; - extern PyTypeObject ControlTextBox_Type; - extern PyTypeObject ControlImage_Type; - extern PyTypeObject ControlGroup_Type; - extern PyTypeObject ControlButton_Type; - extern PyTypeObject ControlCheckMark_Type; - extern PyTypeObject ControlList_Type; - extern PyTypeObject ControlProgress_Type; - extern PyTypeObject ControlRadioButton_Type; - extern PyTypeObject ControlSlider_Type; - extern PyTypeObject ControlEdit_Type; - - CGUIControl* ControlLabel_Create(ControlLabel* pControl); - CGUIControl* ControlFadeLabel_Create(ControlFadeLabel* pControl); - CGUIControl* ControlTextBox_Create(ControlTextBox* pControl); - CGUIControl* ControlButton_Create(ControlButton* pControl); - CGUIControl* ControlCheckMark_Create(ControlCheckMark* pControl); - CGUIControl* ControlImage_Create(ControlImage* pControl); - CGUIControl* ControlGroup_Create(ControlGroup* pControl); - CGUIControl* ControlList_Create(ControlList* pControl); - CGUIControl* ControlProgress_Create(ControlProgress* pControl); - CGUIControl* ControlRadioButton_Create(ControlRadioButton* pControl); - CGUIControl* ControlSlider_Create(ControlSlider* pControl); - CGUIControl* ControlEdit_Create(ControlEdit* pControl); - - void initControl_Type(); - void initControlSpin_Type(); - void initControlLabel_Type(); - void initControlFadeLabel_Type(); - void initControlTextBox_Type(); - void initControlButton_Type(); - void initControlCheckMark_Type(); - void initControlList_Type(); - void initControlImage_Type(); - void initControlGroup_Type(); - void initControlProgress_Type(); - void initControlRadioButton_Type(); - void initControlSlider_Type(); - void initControlEdit_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlbutton.cpp b/xbmc/interfaces/python/xbmcmodule/controlbutton.cpp deleted file mode 100644 index c6ecf3e03e..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlbutton.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIButtonControl.h" -#include "guilib/GUIFontManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlButton_New( - PyTypeObject *type, - PyObject *args, - PyObject *kwds ) - { - static const char *keywords[] = { - "x", "y", "width", "height", "label", - "focusTexture", "noFocusTexture", - "textOffsetX", "textOffsetY", "alignment", - "font", "textColor", "disabledColor", "angle", "shadowColor", "focusedColor", NULL }; - ControlButton *self; - char* cFont = NULL; - char* cTextureFocus = NULL; - char* cTextureNoFocus = NULL; - char* cTextColor = NULL; - char* cDisabledColor = NULL; - char* cShadowColor = NULL; - char* cFocusedColor = NULL; - - PyObject* pObjectText; - - self = (ControlButton*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFont) string(); - new(&self->strText) string(); - new(&self->strText2) string(); - new(&self->strTextureFocus) string(); - new(&self->strTextureNoFocus) string(); - - // set up default values in case they are not supplied - self->textOffsetX = CONTROL_TEXT_OFFSET_X; - self->textOffsetY = CONTROL_TEXT_OFFSET_Y; - self->align = (XBFONT_LEFT | XBFONT_CENTER_Y); - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - self->iAngle = 0; - self->shadowColor = 0; - self->focusedColor = 0xffffffff; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llllO|sslllssslss", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &pObjectText, - &cTextureFocus, - &cTextureNoFocus, - &self->textOffsetX, - &self->textOffsetY, - &self->align, - &cFont, - &cTextColor, - &cDisabledColor, - &self->iAngle, - &cShadowColor, - &cFocusedColor)) - { - Py_DECREF( self ); - return NULL; - } - - - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) - { - Py_DECREF( self ); - return NULL; - } - - // if texture is supplied use it, else get default ones - self->strTextureFocus = cTextureFocus ? - cTextureFocus : - PyXBMCGetDefaultImage((char*)"button", (char*)"texturefocus", (char*)"button-focus.png"); - self->strTextureNoFocus = cTextureNoFocus ? - cTextureNoFocus : - PyXBMCGetDefaultImage((char*)"button", (char*)"texturenofocus", (char*)"button-nofocus.jpg"); - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf( cTextColor, "%x", &self->textColor ); - if (cDisabledColor) sscanf( cDisabledColor, "%x", &self->disabledColor ); - if (cShadowColor) sscanf( cShadowColor, "%x", &self->shadowColor ); - if (cFocusedColor) sscanf( cFocusedColor, "%x", &self->focusedColor ); - return (PyObject*)self; - } - - void ControlButton_Dealloc(ControlButton* self) - { - self->strFont.~string(); - self->strText.~string(); - self->strText2.~string(); - self->strTextureFocus.~string(); - self->strTextureNoFocus.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlButton_Create(ControlButton* pControl) - { - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = pControl->textColor; - label.disabledColor = pControl->disabledColor; - label.shadowColor = pControl->shadowColor; - label.focusedColor = pControl->focusedColor; - label.align = pControl->align; - label.offsetX = (float)pControl->textOffsetX; - label.offsetY = (float)pControl->textOffsetY; - label.angle = (float)-pControl->iAngle; - pControl->pGUIControl = new CGUIButtonControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - (CStdString)pControl->strTextureFocus, - (CStdString)pControl->strTextureNoFocus, - label); - - CGUIButtonControl* pGuiButtonControl = - (CGUIButtonControl*)pControl->pGUIControl; - - pGuiButtonControl->SetLabel(pControl->strText); - pGuiButtonControl->SetLabel2(pControl->strText2); - - return pControl->pGUIControl; - } - - // setDisabledColor() Method - PyDoc_STRVAR(setDisabledColor__doc__, - "setDisabledColor(disabledColor) -- Set's this buttons disabled color.\n" - "\n" - "disabledColor : hexstring - color of disabled button's label. (e.g. '0xFFFF3300')\n" - "\n" - "example:\n" - " - self.button.setDisabledColor('0xFFFF3300')\n"); - - PyObject* ControlButton_SetDisabledColor(ControlButton *self, PyObject *args) - { - char *cDisabledColor = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cDisabledColor)) return NULL; - - // ControlButton *pControl = (ControlButton*)self; - - if (cDisabledColor) sscanf(cDisabledColor, "%x", &self->disabledColor); - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUIButtonControl*)self->pGUIControl)->PythonSetDisabledColor(self->disabledColor); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setLabel() Method - PyDoc_STRVAR(setLabel__doc__, - "setLabel([label, font, textColor, disabledColor, shadowColor, focusedColor]) -- Set's this buttons text attributes.\n" - "\n" - "label : [opt] string or unicode - text string.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled button's label. (e.g. '0xFFFF3300')\n" - "shadowColor : [opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')\n" - "focusedColor : [opt] hexstring - color of focused button's label. (e.g. '0xFFFFFF00')\n" - "label2 : [opt] string or unicode - text string.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - self.button.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')\n"); - - PyObject* ControlButton_SetLabel(ControlButton *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "label", - "font", - "textColor", - "disabledColor", - "shadowColor", - "focusedColor", - "label2", - NULL}; - char *cFont = NULL; - char *cTextColor = NULL; - char *cDisabledColor = NULL; - char *cShadowColor = NULL; - char *cFocusedColor = NULL; - PyObject *pObjectText = NULL; - PyObject *pObjectText2 = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"|OsssssO", - (char**)keywords, - &pObjectText, - &cFont, - &cTextColor, - &cDisabledColor, - &cShadowColor, - &cFocusedColor, - &pObjectText2)) - { - return NULL; - } - if (pObjectText) PyXBMCGetUnicodeString(self->strText, pObjectText, 1); - if (pObjectText2) PyXBMCGetUnicodeString(self->strText2, pObjectText2, 1); - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - if (cDisabledColor) sscanf( cDisabledColor, "%x", &self->disabledColor ); - if (cShadowColor) sscanf(cShadowColor, "%x", &self->shadowColor); - if (cFocusedColor) sscanf(cFocusedColor, "%x", &self->focusedColor); - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUIButtonControl*)self->pGUIControl)->PythonSetLabel( - self->strFont, self->strText, self->textColor, self->shadowColor, self->focusedColor); - ((CGUIButtonControl*)self->pGUIControl)->SetLabel2(self->strText2); - ((CGUIButtonControl*)self->pGUIControl)->PythonSetDisabledColor(self->disabledColor); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // getLabel() Method - PyDoc_STRVAR(getLabel__doc__, - "getLabel() -- Returns the buttons label as a unicode string.\n" - "\n" - "example:\n" - " - label = self.button.getLabel()\n"); - - PyObject* ControlButton_GetLabel(ControlButton *self, PyObject *args) - { - if (!self->pGUIControl) return NULL; - - PyXBMCGUILock(); - CStdString label = ((CGUIButtonControl*) self->pGUIControl)->GetLabel(); - PyXBMCGUIUnlock(); - - return PyUnicode_DecodeUTF8(label.c_str(), label.size(), "replace"); - } - - // getLabel2() Method - PyDoc_STRVAR(getLabel2__doc__, - "getLabel2() -- Returns the buttons label2 as a unicode string.\n" - "\n" - "example:\n" - " - label = self.button.getLabel2()\n"); - - PyObject* ControlButton_GetLabel2(ControlButton *self, PyObject *args) - { - if (!self->pGUIControl) return NULL; - - PyXBMCGUILock(); - CStdString label = ((CGUIButtonControl*) self->pGUIControl)->GetLabel2(); - PyXBMCGUIUnlock(); - - return PyUnicode_DecodeUTF8(label.c_str(), label.size(), "replace"); - } - - PyMethodDef ControlButton_methods[] = { - {(char*)"setLabel", (PyCFunction)ControlButton_SetLabel, METH_VARARGS|METH_KEYWORDS, setLabel__doc__}, - {(char*)"setDisabledColor", (PyCFunction)ControlButton_SetDisabledColor, METH_VARARGS, setDisabledColor__doc__}, - {(char*)"getLabel", (PyCFunction)ControlButton_GetLabel, METH_VARARGS, getLabel__doc__}, - {(char*)"getLabel2", (PyCFunction)ControlButton_GetLabel2, METH_VARARGS, getLabel2__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlButton class - PyDoc_STRVAR(controlButton__doc__, - "ControlButton class.\n" - "\n" - "ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,\n" - " alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "label : string or unicode - text string.\n" - "focusTexture : [opt] string - filename for focus texture.\n" - "noFocusTexture : [opt] string - filename for no focus texture.\n" - "textOffsetX : [opt] integer - x offset of label.\n" - "textOffsetY : [opt] integer - y offset of label.\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled button's label. (e.g. '0xFFFF3300')\n" - "angle : [opt] integer - angle of control. (+ rotates CCW, - rotates CW)\n" - "shadowColor : [opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')\n" - "focusedColor : [opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')\n"); - - // Restore code and data sections to normal. - - PyTypeObject ControlButton_Type; - - void initControlButton_Type() - { - PyXBMCInitializeTypeObject(&ControlButton_Type); - - ControlButton_Type.tp_name = (char*)"xbmcgui.ControlButton"; - ControlButton_Type.tp_basicsize = sizeof(ControlButton); - ControlButton_Type.tp_dealloc = (destructor)ControlButton_Dealloc; - ControlButton_Type.tp_compare = 0; - ControlButton_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlButton_Type.tp_doc = controlButton__doc__; - ControlButton_Type.tp_methods = ControlButton_methods; - ControlButton_Type.tp_base = &Control_Type; - ControlButton_Type.tp_new = ControlButton_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlcheckmark.cpp b/xbmc/interfaces/python/xbmcmodule/controlcheckmark.cpp deleted file mode 100644 index 1f3d3f2170..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlcheckmark.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUICheckMarkControl.h" -#include "guilib/GUIFontManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlCheckMark_New(PyTypeObject *type, PyObject *args, PyObject *kwds ) - { - static const char *keywords[] = { - "x", "y", "width", "height", "label", "focusTexture", "noFocusTexture", - "checkWidth", "checkHeight", "alignment", "font", "textColor", "disabledColor", NULL }; - ControlCheckMark *self; - char* cFont = NULL; - char* cTextureFocus = NULL; - char* cTextureNoFocus = NULL; - char* cTextColor = NULL; - char* cDisabledColor = NULL; - - PyObject* pObjectText; - - self = (ControlCheckMark*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFont) string(); - new(&self->strText) string(); - new(&self->strTextureFocus) string(); - new(&self->strTextureNoFocus) string(); - - // set up default values in case they are not supplied - self->checkWidth = 30; - self->checkHeight = 30; - self->align = XBFONT_RIGHT; - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llllO|sslllsss:ControlCheckMark", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &pObjectText, - &cTextureFocus, - &cTextureNoFocus, - &self->checkWidth, - &self->checkHeight, - &self->align, - &cFont, - &cTextColor, - &cDisabledColor )) - { - Py_DECREF( self ); - return NULL; - } - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) - { - Py_DECREF( self ); - return NULL; - } - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - if (cDisabledColor) - { - sscanf( cDisabledColor, "%x", &self->disabledColor ); - } - self->strTextureFocus = cTextureFocus ? - cTextureFocus : - PyXBMCGetDefaultImage((char*)"checkmark", (char*)"texturefocus", (char*)"check-box.png"); - self->strTextureNoFocus = cTextureNoFocus ? - cTextureNoFocus : - PyXBMCGetDefaultImage((char*)"checkmark", (char*)"texturenofocus", (char*)"check-boxNF.png"); - - return (PyObject*)self; - } - - void ControlCheckMark_Dealloc(ControlCheckMark* self) - { - self->strFont.~string(); - self->strText.~string(); - self->strTextureFocus.~string(); - self->strTextureNoFocus.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlCheckMark_Create(ControlCheckMark* pControl) - { - CLabelInfo label; - label.disabledColor = pControl->disabledColor; - label.textColor = label.focusedColor = pControl->textColor; - label.font = g_fontManager.GetFont(pControl->strFont); - label.align = pControl->align; - CTextureInfo imageFocus(pControl->strTextureFocus); - CTextureInfo imageNoFocus(pControl->strTextureNoFocus); - pControl->pGUIControl = new CGUICheckMarkControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - imageFocus, imageNoFocus, - (float)pControl->checkWidth, - (float)pControl->checkHeight, - label ); - - CGUICheckMarkControl* pGuiCheckMarkControl = (CGUICheckMarkControl*)pControl->pGUIControl; - pGuiCheckMarkControl->SetLabel(pControl->strText); - - return pControl->pGUIControl; - } - - // setDisabledColor() Method - PyDoc_STRVAR(setDisabledColor__doc__, - "setDisabledColor(disabledColor) -- Set's this controls disabled color.\n" - "\n" - "disabledColor : hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')\n" - "\n" - "example:\n" - " - self.checkmark.setDisabledColor('0xFFFF3300')\n"); - - PyObject* ControlCheckMark_SetDisabledColor(ControlCheckMark *self, PyObject *args) - { - char *cDisabledColor = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cDisabledColor)) return NULL; - - if (cDisabledColor) - { - sscanf(cDisabledColor, "%x", &self->disabledColor); - } - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUICheckMarkControl*)self->pGUIControl)->PythonSetDisabledColor( self->disabledColor ); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setLabel() Method - PyDoc_STRVAR(setLabel__doc__, - "setLabel(label[, font, textColor, disabledColor]) -- Set's this controls text attributes.\n" - "\n" - "label : string or unicode - text string.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')\n" - "\n" - "example:\n" - " - self.checkmark.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300')\n"); - - PyObject* ControlCheckMark_SetLabel(ControlCheckMark *self, PyObject *args) - { - PyObject *pObjectText; - char *cFont = NULL; - char *cTextColor = NULL; - char* cDisabledColor = NULL; - - if (!PyArg_ParseTuple( - args, (char*)"O|sss", - &pObjectText, &cFont, - &cTextColor, &cDisabledColor)) - return NULL; - - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 1)) - return NULL; - - if (cFont) self->strFont = cFont; - if (cTextColor) - { - sscanf(cTextColor, "%x", &self->textColor); - } - if (cDisabledColor) - { - sscanf(cDisabledColor, "%x", &self->disabledColor); - } - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUICheckMarkControl*)self->pGUIControl)->PythonSetLabel( - self->strFont, - self->strText, - self->textColor ); - ((CGUICheckMarkControl*)self->pGUIControl)->PythonSetDisabledColor( - self->disabledColor ); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // getSelected() Method - PyDoc_STRVAR(getSelected__doc__, - "getSelected() -- Returns the selected status for this checkmark as a bool.\n" - "\n" - "example:\n" - " - selected = self.checkmark.getSelected()\n"); - - PyObject* ControlCheckMark_GetSelected( ControlCheckMark *self ) - { - bool isSelected = 0; - - PyXBMCGUILock(); - if (self->pGUIControl) - { - isSelected = ((CGUICheckMarkControl*)self->pGUIControl)->GetSelected(); - } - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", isSelected); - } - - // setSelected() Method - PyDoc_STRVAR(setSelected__doc__, - "setSelected(isOn) -- Sets this checkmark status to on or off.\n" - "\n" - "isOn : bool - True=selected (on) / False=not selected (off)\n" - "\n" - "example:\n" - " - self.checkmark.setSelected(True)\n"); - - PyObject* ControlCheckMark_SetSelected(ControlCheckMark *self, PyObject *args) - { - char isSelected = 0; - - if (!PyArg_ParseTuple(args, (char*)"b", &isSelected)) - return NULL; - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUICheckMarkControl*)self->pGUIControl)->SetSelected(0 != isSelected); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlCheckMark_methods[] = { - {(char*)"getSelected", (PyCFunction)ControlCheckMark_GetSelected, METH_NOARGS, getSelected__doc__}, - {(char*)"setSelected", (PyCFunction)ControlCheckMark_SetSelected, METH_VARARGS, setSelected__doc__}, - {(char*)"setLabel", (PyCFunction)ControlCheckMark_SetLabel, METH_VARARGS, setLabel__doc__}, - {(char*)"setDisabledColor", (PyCFunction)ControlCheckMark_SetDisabledColor, METH_VARARGS, setDisabledColor__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlCheckMark class - PyDoc_STRVAR(controlCheckMark__doc__, - "ControlCheckMark class.\n" - "\n" - "ControlCheckMark(x, y, width, height, label[, focusTexture, noFocusTexture,\n" - " checkWidth, checkHeight, alignment, font, textColor, disabledColor])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "label : string or unicode - text string.\n" - "focusTexture : [opt] string - filename for focus texture.\n" - "noFocusTexture : [opt] string - filename for no focus texture.\n" - "checkWidth : [opt] integer - width of checkmark.\n" - "checkHeight : [opt] integer - height of checkmark.\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.checkmark = xbmcgui.ControlCheckMark(100, 250, 200, 50, 'Status', font='font14')\n"); - - -// Restore code and data sections to normal. - - PyTypeObject ControlCheckMark_Type; - - void initControlCheckMark_Type() - { - PyXBMCInitializeTypeObject(&ControlCheckMark_Type); - - ControlCheckMark_Type.tp_name = (char*)"xbmcgui.ControlCheckMark"; - ControlCheckMark_Type.tp_basicsize = sizeof(ControlCheckMark); - ControlCheckMark_Type.tp_dealloc = (destructor)ControlCheckMark_Dealloc; - ControlCheckMark_Type.tp_compare = 0; - ControlCheckMark_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlCheckMark_Type.tp_doc = controlCheckMark__doc__; - ControlCheckMark_Type.tp_methods = ControlCheckMark_methods; - ControlCheckMark_Type.tp_base = &Control_Type; - ControlCheckMark_Type.tp_new = ControlCheckMark_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controledit.cpp b/xbmc/interfaces/python/xbmcmodule/controledit.cpp deleted file mode 100644 index 1a87ab4254..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controledit.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (C) 2005-2011 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIEditControl.h" -#include "guilib/GUIFontManager.h" -#include "guilib/GUIWindowManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - -#ifndef __GNUC__ -#pragma code_seg("PY_TEXT") -#pragma data_seg("PY_DATA") -#pragma bss_seg("PY_BSS") -#pragma const_seg("PY_RDATA") -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlEdit_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", "y", "width", "height", "label", "font", "textColor", - "disabledColor", "alignment", "focusTexture", "noFocusTexture", "isPassword", NULL }; - - ControlEdit *self; - char *cFont = NULL; - char *cTextColor = NULL; - char *cDisabledColor = NULL; - PyObject* pObjectText; - char* cTextureFocus = NULL; - char* cTextureNoFocus = NULL; - - self = (ControlEdit*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strText) string(); - new(&self->strFont) string(); - new(&self->strTextureFocus) string(); - new(&self->strTextureNoFocus) string(); - - // set up default values in case they are not supplied - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - self->align = XBFONT_LEFT; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llllO|ssslssb", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &pObjectText, - &cFont, - &cTextColor, - &cDisabledColor, - &self->align, - &cTextureFocus, - &cTextureNoFocus, - &self->bIsPassword)) - { - Py_DECREF( self ); - return NULL; - } - - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) - { - Py_DECREF( self ); - return NULL; - } - - self->strTextureFocus = cTextureFocus ? - cTextureFocus : - PyXBMCGetDefaultImage((char*)"edit", (char*)"texturefocus", (char*)"button-focus.png"); - self->strTextureNoFocus = cTextureNoFocus ? - cTextureNoFocus : - PyXBMCGetDefaultImage((char*)"edit", (char*)"texturenofocus", (char*)"button-nofocus.jpg"); - - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - if (cDisabledColor) - { - sscanf( cDisabledColor, "%x", &self->disabledColor ); - } - - return (PyObject*)self; - } - - void ControlEdit_Dealloc(ControlLabel* self) - { - self->strText.~string(); - self->strFont.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlEdit_Create(ControlEdit* pControl) - { - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = label.focusedColor = pControl->textColor; - label.disabledColor = pControl->disabledColor; - label.align = pControl->align; - - pControl->pGUIControl = new CGUIEditControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - (CStdString)pControl->strTextureFocus, - (CStdString)pControl->strTextureNoFocus, - label, - pControl->strText); - if (pControl->bIsPassword) - ((CGUIEditControl *) pControl->pGUIControl)->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD, 0); - return pControl->pGUIControl; - } - - // setLabel() Method - PyDoc_STRVAR(setLabel__doc__, - "setLabel(label) -- Set's text heading for this edit control.\n" - "\n" - "label : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.edit.setLabel('Status')\n"); - - PyObject* ControlEdit_SetLabel(ControlLabel *self, PyObject *args) - { - PyObject *pObjectText; - - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 1)) return NULL; - - ControlLabel *pControl = (ControlLabel*)self; - CGUIMessage msg(GUI_MSG_LABEL_SET, pControl->iParentId, pControl->iControlId); - msg.SetLabel(self->strText); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - // getLabel() Method - PyDoc_STRVAR(getLabel__doc__, - "getLabel() -- Returns the text heading for this edit control.\n" - "\n" - "example:\n" - " - label = self.edit.getLabel()\n"); - - PyObject* ControlEdit_GetLabel(ControlLabel *self, PyObject *args) - { - if (!self->pGUIControl) return NULL; - return Py_BuildValue((char*)"s", self->strText.c_str()); - } - - // setLabel() Method - PyDoc_STRVAR(setText__doc__, - "setText(value) -- Set's text value for this edit control.\n" - "\n" - "value : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.edit.setText('online')\n"); - - PyObject* ControlEdit_SetText(ControlLabel *self, PyObject *args) - { - PyObject *pObjectText; - std::string strValue; - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - if (!PyXBMCGetUnicodeString(strValue, pObjectText, 1)) return NULL; - - ControlLabel *pControl = (ControlLabel*)self; - CGUIMessage msg(GUI_MSG_LABEL2_SET, pControl->iParentId, pControl->iControlId); - msg.SetLabel(strValue); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - // getText() Method - PyDoc_STRVAR(getText__doc__, - "getText() -- Returns the text value for this edit control.\n" - "\n" - "example:\n" - " - value = self.edit.getText()\n"); - - PyObject* ControlEdit_GetText(ControlLabel *self, PyObject *args) - { - if (!self->pGUIControl) return NULL; - - ControlLabel *pControl = (ControlLabel*)self; - CGUIMessage msg(GUI_MSG_ITEM_SELECTED, pControl->iParentId, pControl->iControlId); - g_windowManager.SendMessage(msg, pControl->iParentId); - - return Py_BuildValue((char*)"s", msg.GetLabel().c_str()); - } - - PyMethodDef ControlEdit_methods[] = { - {(char*)"setLabel", (PyCFunction)ControlEdit_SetLabel, METH_VARARGS, setLabel__doc__}, - {(char*)"getLabel", (PyCFunction)ControlEdit_GetLabel, METH_VARARGS, getLabel__doc__}, - {(char*)"setText", (PyCFunction)ControlEdit_SetText, METH_VARARGS, setText__doc__}, - {(char*)"getText", (PyCFunction)ControlEdit_GetText, METH_VARARGS, getText__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlEdit class - PyDoc_STRVAR(controlEdit__doc__, - "ControlEdit class.\n" - "\n" - "ControlEdit(x, y, width, height, label[, font, textColor, \n" - " disabledColor, alignment, focusTexture, noFocusTexture])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "label : string or unicode - text string.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "focusTexture : [opt] string - filename for focus texture.\n" - "noFocusTexture : [opt] string - filename for no focus texture.\n" - "isPassword : [opt] bool - if true, mask text value.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.edit = xbmcgui.ControlEdit(100, 250, 125, 75, 'Status')\n"); - - // Restore code and data sections to normal. -#ifndef __GNUC__ -#pragma code_seg() -#pragma data_seg() -#pragma bss_seg() -#pragma const_seg() -#endif - - PyTypeObject ControlEdit_Type; - - void initControlEdit_Type() - { - PyXBMCInitializeTypeObject(&ControlEdit_Type); - - ControlEdit_Type.tp_name = (char*)"xbmcgui.ControlEdit"; - ControlEdit_Type.tp_basicsize = sizeof(ControlEdit); - ControlEdit_Type.tp_dealloc = (destructor)ControlEdit_Dealloc; - ControlEdit_Type.tp_compare = 0; - ControlEdit_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlEdit_Type.tp_doc = controlEdit__doc__; - ControlEdit_Type.tp_methods = ControlEdit_methods; - ControlEdit_Type.tp_base = &Control_Type; - ControlEdit_Type.tp_new = ControlEdit_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlfadelabel.cpp b/xbmc/interfaces/python/xbmcmodule/controlfadelabel.cpp deleted file mode 100644 index d0c69d996a..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlfadelabel.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIFadeLabelControl.h" -#include "guilib/GUIFontManager.h" -#include "guilib/GUIWindowManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlFadeLabel_New(PyTypeObject *type, - PyObject *args, - PyObject *kwds ) - { - static const char *keywords[] = { - "x", "y", "width", "height", "font", "textColor", "alignment", NULL }; - - ControlFadeLabel *self; - char *cFont = NULL; - char *cTextColor = NULL; - - self = (ControlFadeLabel*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFont) string(); - new(&self->vecLabels) std::vector<string>(); - - // set up default values in case they are not supplied - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->align = XBFONT_LEFT; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llll|ssl", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cFont, - &cTextColor, - &self->align )) - { - Py_DECREF( self ); - return NULL; - } - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - - self->pGUIControl = NULL; - - return (PyObject*)self; - } - - void ControlFadeLabel_Dealloc(Control* self) - { - ControlFadeLabel *pControl = (ControlFadeLabel*)self; - pControl->vecLabels.clear(); - pControl->vecLabels.~vector(); - pControl->strFont.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlFadeLabel_Create(ControlFadeLabel* pControl) - { - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = label.focusedColor = pControl->textColor; - label.align = pControl->align; - pControl->pGUIControl = new CGUIFadeLabelControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - label, - true, - 0, - true); - - CGUIMessage msg(GUI_MSG_LABEL_RESET, pControl->iParentId, pControl->iControlId); - pControl->pGUIControl->OnMessage(msg); - - return pControl->pGUIControl; - } - - // addLabel() Method - PyDoc_STRVAR(addLabel__doc__, - "addLabel(label) -- Add a label to this control for scrolling.\n" - "\n" - "label : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.fadelabel.addLabel('This is a line of text that can scroll.')"); - - PyObject* ControlFadeLabel_AddLabel(ControlFadeLabel *self, PyObject *args) - { - PyObject *pObjectText; - string strText; - - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - ControlFadeLabel *pControl = (ControlFadeLabel*)self; - CGUIMessage msg(GUI_MSG_LABEL_ADD, pControl->iParentId, pControl->iControlId); - msg.SetLabel(strText); - - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - // reset() Method - PyDoc_STRVAR(reset__doc__, - "reset() -- Clears this fadelabel.\n" - "\n" - "example:\n" - " - self.fadelabel.reset()\n"); - - PyObject* ControlFadeLabel_Reset(ControlFadeLabel *self, PyObject *args) - { - ControlFadeLabel *pControl = (ControlFadeLabel*)self; - CGUIMessage msg(GUI_MSG_LABEL_RESET, pControl->iParentId, pControl->iControlId); - - pControl->vecLabels.clear(); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlFadeLabel_methods[] = { - {(char*)"addLabel", (PyCFunction)ControlFadeLabel_AddLabel, METH_VARARGS, addLabel__doc__}, - {(char*)"reset", (PyCFunction)ControlFadeLabel_Reset, METH_VARARGS, reset__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlFadeLabel class - PyDoc_STRVAR(controlFadeLabel__doc__, - "ControlFadeLabel class.\n" - "Control that scroll's lables" - "\n" - "ControlFadeLabel(x, y, width, height[, font, textColor, alignment])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlFadeLabel_Type; - - void initControlFadeLabel_Type() - { - PyXBMCInitializeTypeObject(&ControlFadeLabel_Type); - - ControlFadeLabel_Type.tp_name = (char*)"xbmcgui.ControlFadeLabel"; - ControlFadeLabel_Type.tp_basicsize = sizeof(ControlFadeLabel); - ControlFadeLabel_Type.tp_dealloc = (destructor)ControlFadeLabel_Dealloc; - ControlFadeLabel_Type.tp_compare = 0; - ControlFadeLabel_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlFadeLabel_Type.tp_doc = controlFadeLabel__doc__; - ControlFadeLabel_Type.tp_methods = ControlFadeLabel_methods; - ControlFadeLabel_Type.tp_base = &Control_Type; - ControlFadeLabel_Type.tp_new = ControlFadeLabel_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlgroup.cpp b/xbmc/interfaces/python/xbmcmodule/controlgroup.cpp deleted file mode 100644 index dd08281a2b..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlgroup.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIControlGroup.h" -#include "guilib/GUIFontManager.h" -#include "control.h" -#include "pyutil.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - namespace PYXBMC - { - PyObject * ControlGroup_New (PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", "y", "width", "height", NULL - }; - - ControlGroup *self; - int ret; - - self = (ControlGroup *) type->tp_alloc (type, 0); - if (!self) { - return NULL; - } - - ret = PyArg_ParseTupleAndKeywords (args, - kwds, - (char*)"llll", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight); - if (!ret) { - Py_DECREF (self); - return NULL; - } - - return (PyObject *) self; - } - - - void ControlGroup_Dealloc (ControlGroup *self) - { - self->ob_type->tp_free ((PyObject *) self); - } - - - CGUIControl * - ControlGroup_Create (ControlGroup *pCtrl) - { - pCtrl->pGUIControl = new CGUIControlGroup(pCtrl->iParentId, - pCtrl->iControlId, - (float) pCtrl->dwPosX, - (float) pCtrl->dwPosY, - (float) pCtrl->dwWidth, - (float) pCtrl->dwHeight); - return pCtrl->pGUIControl; - } - - - PyMethodDef ControlGroup_methods[] = { - {NULL, NULL, 0, NULL} - }; - - - // ControlGroup class - PyDoc_STRVAR (controlGroup__doc__, - "ControlGroup class.\n" - "\n" - "ControlGroup(x, y, width, height\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "example:\n" - " - self.group = xbmcgui.ControlGroup(100, 250, 125, 75)\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlGroup_Type; - - void initControlGroup_Type () - { - PyXBMCInitializeTypeObject (&ControlGroup_Type); - - ControlGroup_Type.tp_name = (char*)"xbmcgui.ControlGroup"; - ControlGroup_Type.tp_basicsize = sizeof (ControlGroup); - ControlGroup_Type.tp_dealloc = (destructor) ControlGroup_Dealloc; - ControlGroup_Type.tp_compare = 0; - ControlGroup_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlGroup_Type.tp_doc = controlGroup__doc__; - ControlGroup_Type.tp_methods = ControlGroup_methods; - ControlGroup_Type.tp_base = &Control_Type; - ControlGroup_Type.tp_new = ControlGroup_New; - } - } -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlimage.cpp b/xbmc/interfaces/python/xbmcmodule/controlimage.cpp deleted file mode 100644 index ecbadc9d00..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlimage.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIImage.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlImage_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", "y", "width", "height", "filename", "aspectRatio", "colorDiffuse", NULL }; - ControlImage *self; - char *cImage = NULL; - char *cColorDiffuse = NULL;//"0xFFFFFFFF"; - - self = (ControlImage*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFileName) string(); - - //if (!PyArg_ParseTuple(args, "lllls|l", &self->dwPosX, &self->dwPosY, &self->dwWidth, &self->dwHeight, - // &cImage, &self->aspectRatio)) return NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, kwds, - (char*)"lllls|ls", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cImage, - &self->aspectRatio, - &cColorDiffuse )) - { - Py_DECREF( self ); - return NULL; - } - - // check if filename exists - self->strFileName = cImage; - if (cColorDiffuse) sscanf(cColorDiffuse, "%x", &self->colorDiffuse); - else self->colorDiffuse = 0; - - return (PyObject*)self; - } - - void ControlImage_Dealloc(ControlImage* self) - { - self->strFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlImage_Create(ControlImage* pControl) - { - pControl->pGUIControl = new CGUIImage(pControl->iParentId, pControl->iControlId, - (float)pControl->dwPosX, (float)pControl->dwPosY, (float)pControl->dwWidth, (float)pControl->dwHeight, - (CStdString)pControl->strFileName); - - if (pControl->pGUIControl && pControl->aspectRatio <= CAspectRatio::AR_KEEP) - ((CGUIImage *)pControl->pGUIControl)->SetAspectRatio((CAspectRatio::ASPECT_RATIO)pControl->aspectRatio); - - if (pControl->pGUIControl && pControl->colorDiffuse) - ((CGUIImage *)pControl->pGUIControl)->SetColorDiffuse(pControl->colorDiffuse); - - return pControl->pGUIControl; - } - - - PyDoc_STRVAR(setImage__doc__, - "setImage(filename, colorKey) -- Changes the image.\n" - "\n" - "filename : string - image filename.\n" - "\n" - "example:\n" - " - self.image.setImage('special://home/scripts/test.png')\n"); - - PyObject* ControlImage_SetImage(ControlImage *self, PyObject *args) - { - char *cImage = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cImage)) return NULL; - - self->strFileName = cImage; - - PyXBMCGUILock(); - if (self->pGUIControl) - ((CGUIImage*)self->pGUIControl)->SetFileName(self->strFileName); - - PyXBMCGUIUnlock(); - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setColorDiffuse__doc__, - "setColorDiffuse(colorDiffuse) -- Changes the images color.\n" - "\n" - "colorDiffuse : hexString - (example, '0xC0FF0000' (red tint))\n" - "\n" - "example:\n" - " - self.image.setColorDiffuse('0xC0FF0000')\n"); - - PyObject* ControlImage_SetColorDiffuse(ControlImage *self, PyObject *args) - { - char *cColorDiffuse = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cColorDiffuse)) return NULL; - - if (cColorDiffuse) sscanf(cColorDiffuse, "%x", &self->colorDiffuse); - else self->colorDiffuse = 0; - - PyXBMCGUILock(); - if (self->pGUIControl) - ((CGUIImage *)self->pGUIControl)->SetColorDiffuse(self->colorDiffuse); - - PyXBMCGUIUnlock(); - Py_INCREF(Py_None); - return Py_None; - } - - - PyMethodDef ControlImage_methods[] = { - {(char*)"setImage", (PyCFunction)ControlImage_SetImage, METH_VARARGS, setImage__doc__}, - {(char*)"setColorDiffuse", (PyCFunction)ControlImage_SetColorDiffuse, METH_VARARGS, setColorDiffuse__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlImage class - PyDoc_STRVAR(controlImage__doc__, - "ControlImage class.\n" - "\n" - "ControlImage(x, y, width, height, filename[, colorKey, aspectRatio, colorDiffuse])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "filename : string - image filename.\n" - "aspectRatio : [opt] integer - (values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bars)" - "colorDiffuse : hexString - (example, '0xC0FF0000' (red tint))\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.image = xbmcgui.ControlImage(100, 250, 125, 75, aspectRatio=2)\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlImage_Type; - - void initControlImage_Type() - { - PyXBMCInitializeTypeObject(&ControlImage_Type); - - ControlImage_Type.tp_name = (char*)"xbmcgui.ControlImage"; - ControlImage_Type.tp_basicsize = sizeof(ControlImage); - ControlImage_Type.tp_dealloc = (destructor)ControlImage_Dealloc; - ControlImage_Type.tp_compare = 0; - ControlImage_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlImage_Type.tp_doc = controlImage__doc__; - ControlImage_Type.tp_methods = ControlImage_methods; - ControlImage_Type.tp_base = &Control_Type; - ControlImage_Type.tp_new = ControlImage_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controllabel.cpp b/xbmc/interfaces/python/xbmcmodule/controllabel.cpp deleted file mode 100644 index 8655b11763..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controllabel.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUILabelControl.h" -#include "guilib/GUIFontManager.h" -#include "guilib/GUIWindowManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlLabel_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", "y", "width", "height", "label", "font", "textColor", - "disabledColor", "alignment", "hasPath", "angle", NULL }; - - ControlLabel *self; - char *cFont = NULL; - char *cTextColor = NULL; - char *cDisabledColor = NULL; - PyObject* pObjectText; - char bHasPath = false; - - self = (ControlLabel*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strText) string(); - new(&self->strFont) string(); - - // set up default values in case they are not supplied - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - self->align = XBFONT_LEFT; - self->iAngle = 0; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llllO|ssslbl", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &pObjectText, - &cFont, - &cTextColor, - &cDisabledColor, - &self->align, - &bHasPath, - &self->iAngle)) - { - Py_DECREF( self ); - return NULL; - } - self->bHasPath = (0 != bHasPath); - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) - { - Py_DECREF( self ); - return NULL; - } - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - if (cDisabledColor) - { - sscanf( cDisabledColor, "%x", &self->disabledColor ); - } - - return (PyObject*)self; - } - - void ControlLabel_Dealloc(ControlLabel* self) - { - self->strText.~string(); - self->strFont.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlLabel_Create(ControlLabel* pControl) - { - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = label.focusedColor = pControl->textColor; - label.disabledColor = pControl->disabledColor; - label.align = pControl->align; - label.angle = (float)-pControl->iAngle; - pControl->pGUIControl = new CGUILabelControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - label, - false, - pControl->bHasPath); - ((CGUILabelControl *)pControl->pGUIControl)->SetLabel(pControl->strText); - return pControl->pGUIControl; - } - - // setLabel() Method - PyDoc_STRVAR(setLabel__doc__, - "setLabel(label) -- Set's text for this label.\n" - "\n" - "label : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.label.setLabel('Status')\n"); - - PyObject* ControlLabel_SetLabel(ControlLabel *self, PyObject *args) - { - PyObject *pObjectText; - - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 1)) return NULL; - - ControlLabel *pControl = (ControlLabel*)self; - CGUIMessage msg(GUI_MSG_LABEL_SET, pControl->iParentId, pControl->iControlId); - msg.SetLabel(self->strText); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - // getLabel() Method - PyDoc_STRVAR(getLabel__doc__, - "getLabel() -- Returns the text value for this label.\n" - "\n" - "example:\n" - " - label = self.label.getLabel()\n"); - - PyObject* ControlLabel_GetLabel(ControlLabel *self, PyObject *args) - { - if (!self->pGUIControl) return NULL; - return Py_BuildValue((char*)"s", self->strText.c_str()); - } - - PyMethodDef ControlLabel_methods[] = { - {(char*)"setLabel", (PyCFunction)ControlLabel_SetLabel, METH_VARARGS, setLabel__doc__}, - {(char*)"getLabel", (PyCFunction)ControlLabel_GetLabel, METH_VARARGS, getLabel__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlLabel class - PyDoc_STRVAR(controlLabel__doc__, - "ControlLabel class.\n" - "\n" - "ControlLabel(x, y, width, height, label[, font, textColor, \n" - " disabledColor, alignment, hasPath, angle])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "label : string or unicode - text string.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "hasPath : [opt] bool - True=stores a path / False=no path.\n" - "angle : [opt] integer - angle of control. (+ rotates CCW, - rotates CW)" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)\n"); - - // Restore code and data sections to normal. - - PyTypeObject ControlLabel_Type; - - void initControlLabel_Type() - { - PyXBMCInitializeTypeObject(&ControlLabel_Type); - - ControlLabel_Type.tp_name = (char*)"xbmcgui.ControlLabel"; - ControlLabel_Type.tp_basicsize = sizeof(ControlLabel); - ControlLabel_Type.tp_dealloc = (destructor)ControlLabel_Dealloc; - ControlLabel_Type.tp_compare = 0; - ControlLabel_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlLabel_Type.tp_doc = controlLabel__doc__; - ControlLabel_Type.tp_methods = ControlLabel_methods; - ControlLabel_Type.tp_base = &Control_Type; - ControlLabel_Type.tp_new = ControlLabel_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controllist.cpp b/xbmc/interfaces/python/xbmcmodule/controllist.cpp deleted file mode 100644 index d4181366ac..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controllist.cpp +++ /dev/null @@ -1,743 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIListContainer.h" -#include "guilib/GUIFontManager.h" -#include "guilib/GUIWindowManager.h" -#include "guilib/GUILabel.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - extern PyObject* ControlSpin_New(void); - - PyObject* ControlList_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", "y", "width", "height", "font", - "textColor", "buttonTexture", "buttonFocusTexture", - // maintain order of above items for backward compatibility - "selectedColor", - "imageWidth", "imageHeight", - "itemTextXOffset", "itemTextYOffset", - "itemHeight", "space", "alignmentY", NULL };//"shadowColor", NULL }; - ControlList *self; - char *cFont = NULL; - char *cTextColor = NULL; - char *cSelectedColor = NULL; - char *cTextureButton = NULL; - char *cTextureButtonFocus = NULL; - //char* cShadowColor = NULL; - self = (ControlList*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFont) string(); - new(&self->strTextureButton) string(); - new(&self->strTextureButtonFocus) string(); - new(&self->vecItems) std::vector<PYXBMC::ListItem*>(); - - // create a python spin control - self->pControlSpin = (ControlSpin*)ControlSpin_New(); - if (!self->pControlSpin) - { - Py_DECREF( self ); - return NULL; - } - - // initialize default values - self->strFont = "font13"; - self->textColor = 0xe0f0f0f0; - self->selectedColor = 0xffffffff; - self->imageHeight = 10; - self->imageWidth = 10; - self->itemHeight = 27; - self->space = 2; - self->itemTextOffsetX = CONTROL_TEXT_OFFSET_X; - self->itemTextOffsetY = CONTROL_TEXT_OFFSET_Y; - self->alignmentY = XBFONT_CENTER_Y; - //self->shadowColor = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llll|ssssslllllll",//s", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cFont, - &cTextColor, - &cTextureButton, - &cTextureButtonFocus, - &cSelectedColor, - &self->imageWidth, - &self->imageHeight, - &self->itemTextOffsetX, - &self->itemTextOffsetY, - &self->itemHeight, - &self->space, - &self->alignmentY//, - ))//&cShadowColor)) - { - Py_DECREF( self ); - return NULL; - } - - // set specified values - if (cFont) self->strFont = cFont; - if (cTextColor) - { - sscanf( cTextColor, "%x", &self->textColor ); - } - if (cSelectedColor) - { - sscanf( cSelectedColor, "%x", &self->selectedColor ); - } - //if (cShadowColor) sscanf( cShadowColor, "%x", &self->shadowColor ); - - self->strTextureButton = cTextureButton ? cTextureButton : - PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"texturenofocus", (char*)"list-nofocus.png"); - self->strTextureButtonFocus = cTextureButtonFocus ? cTextureButtonFocus : - PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"texturefocus", (char*)"list-focus.png"); - - // default values for spin control - self->pControlSpin->dwPosX = self->dwWidth - 35; - self->pControlSpin->dwPosY = self->dwHeight - 15; - - return (PyObject*)self; - } - - void ControlList_Dealloc(ControlList* self) - { - // conditionally delete spincontrol - Py_XDECREF(self->pControlSpin); - - // delete all ListItem from vector - vector<ListItem*>::iterator it = self->vecItems.begin(); - while (it != self->vecItems.end()) - { - ListItem* pListItem = *it; - Py_DECREF(pListItem); - ++it; - } - self->vecItems.clear(); - self->vecItems.~vector(); - - self->strFont.~string(); - self->strTextureButton.~string(); - self->strTextureButtonFocus.~string(); - - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlList_Create(ControlList* pControl) - { - CLabelInfo label; - label.align = pControl->alignmentY; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = label.focusedColor = pControl->textColor; - //label.shadowColor = pControl->shadowColor; - label.selectedColor = pControl->selectedColor; - label.offsetX = (float)pControl->itemTextOffsetX; - label.offsetY = (float)pControl->itemTextOffsetY; - // Second label should have the same font, alignment, and colours as the first, but - // the offsets should be 0. - CLabelInfo label2 = label; - label2.offsetX = label2.offsetY = 0; - label2.align |= XBFONT_RIGHT; - - pControl->pGUIControl = new CGUIListContainer( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight - pControl->pControlSpin->dwHeight - 5, - label, label2, - (CStdString)pControl->strTextureButton, - (CStdString)pControl->strTextureButtonFocus, - (float)pControl->itemHeight, - (float)pControl->imageWidth, (float)pControl->imageHeight, - (float)pControl->space); - - return pControl->pGUIControl; - } - - /* - * ControlList_AddItem - * (string label) / (ListItem) - * ListItem is added to vector - * For a string we create a new ListItem and add it to the vector - */ -PyDoc_STRVAR(addItem__doc__, - "addItem(item) -- Add a new item to this list control.\n" - "\n" - "item : string, unicode or ListItem - item to add.\n" - "\n" - "example:\n" - " - cList.addItem('Reboot XBMC')\n"); - - PyObject* ControlList_AddItem(ControlList *self, PyObject *args) - { - PyObject *pObject; - if (!PyArg_ParseTuple(args, (char*)"O", &pObject)) return NULL; - - ListItem* pListItem = NULL; - if (ListItem_CheckExact(pObject)) - { - // object is a listitem - pListItem = (ListItem*)pObject; - Py_INCREF(pListItem); - } - else - { - string strText; - // object is probably a text item - if (!PyXBMCGetUnicodeString(strText, pObject, 1)) return NULL; - // object is a unicode string now, create a new ListItem - pListItem = ListItem_FromString(strText); - } - - // add item to objects vector - self->vecItems.push_back(pListItem); - - // construct a CFileItemList to pass 'em on to the list - CGUIListItemPtr items(new CFileItemList()); - for (unsigned int i = 0; i < self->vecItems.size(); i++) - ((CFileItemList*)items.get())->Add(self->vecItems[i]->item); - - CGUIMessage msg(GUI_MSG_LABEL_BIND, self->iParentId, self->iControlId, 0, 0, items); - msg.SetPointer(items.get()); - g_windowManager.SendThreadMessage(msg, self->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - -PyDoc_STRVAR(addItems__doc__, - "addItems(items) -- Adds a list of listitems or strings to this list control.\n" - "\n" - "items : List - list of strings, unicode objects or ListItems to add.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - " Large lists benefit considerably, than using the standard addItem()" - "\n" - "example:\n" - " - cList.addItems(items=listitems)\n"); - - PyObject* ControlList_AddItems(ControlList *self, PyObject *args, PyObject *kwds) - { - PyObject *pList = NULL; - static const char *keywords[] = { "items", NULL }; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O", - (char**)keywords, - &pList) || pList == NULL || !PyObject_TypeCheck(pList, &PyList_Type)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type List"); - return NULL; - } - - CGUIListItemPtr items(new CFileItemList()); - for (int item = 0; item < PyList_Size(pList); item++) - { - PyObject *pItem = PyList_GetItem(pList, item); - - ListItem* pListItem = NULL; - if (ListItem_CheckExact(pItem)) - { - // object is a listitem - pListItem = (ListItem*)pItem; - Py_INCREF(pListItem); - } - else - { - string strText; - // object is probably a text item - if (!PyXBMCGetUnicodeString(strText, pItem, 1)) return NULL; - // object is a unicode string now, create a new ListItem - pListItem = ListItem_FromString(strText); - } - - // add item to objects vector - self->vecItems.push_back(pListItem); - ((CFileItemList*)items.get())->Add(pListItem->item); - } - - // create message - CGUIMessage msg(GUI_MSG_LABEL_BIND, self->iParentId, self->iControlId, 0, 0, items); - msg.SetPointer(items.get()); - g_windowManager.SendThreadMessage(msg, self->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - /* - * ControlList_SelectItem(int item) - * Select an item by index - */ - PyDoc_STRVAR(selectItem, - "selectItem(item) -- Select an item by index number.\n" - "\n" - "item : integer - index number of the item to select.\n" - "\n" - "example:\n" - " - cList.selectItem(12)\n"); - - PyObject* ControlList_SelectItem(ControlList *self, PyObject *args) - { - long itemIndex; - - if (!PyArg_ParseTuple(args, (char*)"l", &itemIndex)) return NULL; - - // create message - CGUIMessage msg(GUI_MSG_ITEM_SELECT, self->iParentId, self->iControlId, itemIndex); - - // send message - g_windowManager.SendThreadMessage(msg, self->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - // reset() method - PyDoc_STRVAR(reset__doc__, - "reset() -- Clear all ListItems in this control list.\n" - "\n" - "example:\n" - " - cList.reset()\n"); - - PyObject* ControlList_Reset(ControlList *self, PyObject *args) - { - // create message - ControlList *pControl = (ControlList*)self; - CGUIMessage msg(GUI_MSG_LABEL_RESET, pControl->iParentId, pControl->iControlId); - - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - // delete all items from vector - // delete all ListItem from vector - vector<ListItem*>::iterator it = self->vecItems.begin(); - while (it != self->vecItems.end()) - { - ListItem* pListItem = *it; - Py_DECREF(pListItem); - ++it; - } - self->vecItems.clear(); - - Py_INCREF(Py_None); - return Py_None; - } - - // getSpinControl() method - PyDoc_STRVAR(getSpinControl__doc__, - "getSpinControl() -- returns the associated ControlSpin object.\n" - "\n" - "*Note, Not working completely yet -\n" - " After adding this control list to a window it is not possible to change\n" - " the settings of this spin control.\n" - "\n" - "example:\n" - " - ctl = cList.getSpinControl()\n"); - - PyObject* ControlList_GetSpinControl(ControlList *self, PyObject *args) - { - Py_INCREF(self->pControlSpin); - return (PyObject*)self->pControlSpin; - } - - // setImageDimensions() method - PyDoc_STRVAR(setImageDimensions__doc__, - "setImageDimensions(imageWidth, imageHeight) -- Sets the width/height of items icon or thumbnail.\n" - "\n" - "imageWidth : [opt] integer - width of items icon or thumbnail.\n" - "imageHeight : [opt] integer - height of items icon or thumbnail.\n" - "\n" - "example:\n" - " - cList.setImageDimensions(18, 18)\n"); - - PyObject* ControlList_SetImageDimensions(ControlList *self, PyObject *args) - { - if (!PyArg_ParseTuple(args, (char*)"ll", &self->imageWidth, &self->imageHeight)) - { - return NULL; - } - - /* - PyXBMCGUILock(); - if (self->pGUIControl) - { - CGUIListControl* pListControl = (CGUIListControl*) self->pGUIControl; - pListControl->SetImageDimensions((float)self->dwImageWidth, (float)self->dwImageHeight ); - } - PyXBMCGUIUnlock(); - */ - Py_INCREF(Py_None); - return Py_None; - } - - // setItemHeight() method - PyDoc_STRVAR(setItemHeight__doc__, - "setItemHeight(itemHeight) -- Sets the height of items.\n" - "\n" - "itemHeight : integer - height of items.\n" - "\n" - "example:\n" - " - cList.setItemHeight(25)\n"); - - PyObject* ControlList_SetItemHeight(ControlList *self, PyObject *args) - { - if (!PyArg_ParseTuple(args, (char*)"l", &self->itemHeight)) return NULL; - - /* - PyXBMCGUILock(); - if (self->pGUIControl) - { - CGUIListControl* pListControl = (CGUIListControl*) self->pGUIControl; - pListControl->SetItemHeight((float)self->dwItemHeight); - } - PyXBMCGUIUnlock(); - */ - Py_INCREF(Py_None); - return Py_None; - } - - - // setPageControlVisible() method - PyDoc_STRVAR(setPageControlVisible__doc__, - "setPageControlVisible(visible) -- Sets the spin control's visible/hidden state.\n" - "\n" - "visible : boolean - True=visible / False=hidden.\n" - "\n" - "example:\n" - " - cList.setPageControlVisible(True)\n"); - - PyObject* ControlList_SetPageControlVisible(ControlList *self, PyObject *args) - { - char isOn = true; - - if (!PyArg_ParseTuple(args, (char*)"b", &isOn)) return NULL; - - /* - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUIListControl*)self->pGUIControl)->SetPageControlVisible((bool)isOn ); - } - PyXBMCGUIUnlock(); - */ - - Py_INCREF(Py_None); - return Py_None; - } - - // setSpace() method - PyDoc_STRVAR(setSpace__doc__, - "setSpace(space) -- Set's the space between items.\n" - "\n" - "space : [opt] integer - space between items.\n" - "\n" - "example:\n" - " - cList.setSpace(5)\n"); - - PyObject* ControlList_SetSpace(ControlList *self, PyObject *args) - { - if (!PyArg_ParseTuple(args, (char*)"l", &self->space)) return NULL; - - /* - PyXBMCGUILock(); - if (self->pGUIControl) - { - CGUIListControl* pListControl = (CGUIListControl*) self->pGUIControl; - pListControl->SetSpaceBetweenItems((float)self->dwSpace); - } - PyXBMCGUIUnlock(); - */ - - Py_INCREF(Py_None); - return Py_None; - } - - // getSelectedPosition() method - PyDoc_STRVAR(getSelectedPosition__doc__, - "getSelectedPosition() -- Returns the position of the selected item as an integer.\n" - "\n" - "*Note, Returns -1 for empty lists.\n" - "\n" - "example:\n" - " - pos = cList.getSelectedPosition()\n"); - - PyObject* ControlList_GetSelectedPosition(ControlList *self, PyObject *args) - { - // create message - ControlList *pControl = (ControlList*)self; - CGUIMessage msg(GUI_MSG_ITEM_SELECTED, pControl->iParentId, pControl->iControlId); - long pos = -1; - - // send message - PyXBMCGUILock(); - if ((self->vecItems.size() > 0) && pControl->pGUIControl) - { - pControl->pGUIControl->OnMessage(msg); - pos = msg.GetParam1(); - } - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"l", pos); - } - - // getSelectedItem() method - PyDoc_STRVAR(getSelectedItem__doc__, - "getSelectedItem() -- Returns the selected item as a ListItem object.\n" - "\n" - "*Note, Same as getSelectedPosition(), but instead of an integer a ListItem object\n" - " is returned. Returns None for empty lists.\n" - " See windowexample.py on how to use this.\n" - "\n" - "example:\n" - " - item = cList.getSelectedItem()\n"); - - PyObject* ControlList_GetSelectedItem(ControlList *self, PyObject *args) - { - // create message - ControlList *pControl = (ControlList*)self; - CGUIMessage msg(GUI_MSG_ITEM_SELECTED, pControl->iParentId, pControl->iControlId); - PyObject* pListItem = Py_None; - - // send message - PyXBMCGUILock(); - if ((self->vecItems.size() > 0) && pControl->pGUIControl) - { - pControl->pGUIControl->OnMessage(msg); - pListItem = (PyObject*)self->vecItems[msg.GetParam1()]; - } - PyXBMCGUIUnlock(); - - Py_INCREF(pListItem); - return pListItem; - } - - // size() method - PyDoc_STRVAR(size__doc__, - "size() -- Returns the total number of items in this list control as an integer.\n" - "\n" - "example:\n" - " - cnt = cList.size()\n"); - - PyObject* ControlList_Size(ControlList *self) - { - return Py_BuildValue((char*)"l", self->vecItems.size()); - } - - // getListItem() method - PyDoc_STRVAR(getListItem__doc__, - "getListItem(index) -- Returns a given ListItem in this List.\n" - "\n" - "index : integer - index number of item to return.\n" - "\n" - "*Note, throws a ValueError if index is out of range.\n" - "\n" - "example:\n" - " - listitem = cList.getListItem(6)\n"); - - PyObject* ControlList_GetListItem(ControlList *self, PyObject *args) - { - int iPos = -1; - if (!PyArg_ParseTuple(args, (char*)"i", &iPos)) return NULL; - - if (iPos < 0 || iPos >= (int)self->vecItems.size()) - { - PyErr_SetString(PyExc_ValueError, "Index out of range"); - return NULL; - } - - PyObject* pListItem = (PyObject*)self->vecItems[iPos]; - - Py_INCREF(pListItem); - return pListItem; - } - - // getItemHeight() Method - PyDoc_STRVAR(getItemHeight__doc__, - "getItemHeight() -- Returns the control's current item height as an integer.\n" - "\n" - "example:\n" - " - item_height = self.cList.getItemHeight()\n"); - - PyObject* ControlList_GetItemHeight(ControlList *self) - { - return Py_BuildValue((char*)"l", self->itemHeight); - } - - // getSpace() Method - PyDoc_STRVAR(getSpace__doc__, - "getSpace() -- Returns the control's space between items as an integer.\n" - "\n" - "example:\n" - " - gap = self.cList.getSpace()\n"); - - PyObject* ControlList_GetSpace(ControlList *self) - { - return Py_BuildValue((char*)"l", self->space); - } - -PyDoc_STRVAR(setStaticContent__doc__, - "setStaticContent(items) -- Fills a static list with a list of listitems.\n" - "\n" - "items : List - list of listitems to add.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - cList.setStaticContent(items=listitems)\n"); - - PyObject* ControlList_SetStaticContent(ControlList *self, PyObject *args, PyObject *kwds) - { - PyObject *pList = NULL; - static const char *keywords[] = { "items", NULL }; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O", - (char**)keywords, - &pList) || pList == NULL || !PyObject_TypeCheck(pList, &PyList_Type)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type List"); - return NULL; - } - - vector<CGUIListItemPtr> items; - - for (int item = 0; item < PyList_Size(pList); item++) - { - PyObject *pItem = PyList_GetItem(pList, item); - if (!ListItem_CheckExact(pItem)) - { - PyErr_SetString(PyExc_TypeError, "Only ListItems can be passed"); - return NULL; - } - // object is a listitem, and we set m_idpeth to 0 as this - // is used as the visibility condition for the item in the list - ListItem *listItem = (ListItem*)pItem; - listItem->item->m_idepth = 0; - - items.push_back((CFileItemPtr &)listItem->item); - } - // set static list - ((CGUIBaseContainer *)self->pGUIControl)->SetStaticContent(items); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlList_methods[] = { - {(char*)"addItem", (PyCFunction)ControlList_AddItem, METH_VARARGS, addItem__doc__}, - {(char*)"selectItem", (PyCFunction)ControlList_SelectItem, METH_VARARGS, selectItem}, - {(char*)"reset", (PyCFunction)ControlList_Reset, METH_VARARGS, reset__doc__}, - {(char*)"getSpinControl", (PyCFunction)ControlList_GetSpinControl, METH_VARARGS, getSpinControl__doc__}, - {(char*)"getSelectedPosition", (PyCFunction)ControlList_GetSelectedPosition, METH_VARARGS, getSelectedPosition__doc__}, - {(char*)"getSelectedItem", (PyCFunction)ControlList_GetSelectedItem, METH_VARARGS, getSelectedItem__doc__}, - {(char*)"setImageDimensions", (PyCFunction)ControlList_SetImageDimensions, METH_VARARGS, setImageDimensions__doc__}, - {(char*)"setItemHeight", (PyCFunction)ControlList_SetItemHeight, METH_VARARGS, setItemHeight__doc__}, - {(char*)"setSpace", (PyCFunction)ControlList_SetSpace, METH_VARARGS, setSpace__doc__}, - {(char*)"setPageControlVisible", (PyCFunction)ControlList_SetPageControlVisible, METH_VARARGS, setPageControlVisible__doc__}, - {(char*)"size", (PyCFunction)ControlList_Size, METH_VARARGS, size__doc__}, - {(char*)"getItemHeight", (PyCFunction)ControlList_GetItemHeight, METH_VARARGS, getItemHeight__doc__}, - {(char*)"getSpace", (PyCFunction)ControlList_GetSpace, METH_VARARGS, getSpace__doc__}, - {(char*)"getListItem", (PyCFunction)ControlList_GetListItem, METH_VARARGS, getListItem__doc__}, - {(char*)"setStaticContent", (PyCFunction)ControlList_SetStaticContent, METH_VARARGS|METH_KEYWORDS, setStaticContent__doc__}, - {(char*)"addItems", (PyCFunction)ControlList_AddItems, METH_VARARGS|METH_KEYWORDS, addItems__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(controlList__doc__, - "ControlList class.\n" - "\n" - "ControlList(x, y, width, height[, font, textColor, buttonTexture, buttonFocusTexture,\n" - " selectedColor, imageWidth, imageHeight, itemTextXOffset, itemTextYOffset,\n" - " itemHeight, space, alignmentY])\n"//, shadowColor])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "font : [opt] string - font used for items label. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of items label. (e.g. '0xFFFFFFFF')\n" - "buttonTexture : [opt] string - filename for focus texture.\n" - "buttonFocusTexture : [opt] string - filename for no focus texture.\n" - "selectedColor : [opt] integer - x offset of label.\n" - "imageWidth : [opt] integer - width of items icon or thumbnail.\n" - "imageHeight : [opt] integer - height of items icon or thumbnail.\n" - "itemTextXOffset : [opt] integer - x offset of items label.\n" - "itemTextYOffset : [opt] integer - y offset of items label.\n" - "itemHeight : [opt] integer - height of items.\n" - "space : [opt] integer - space between items.\n" - "alignmentY : [opt] integer - Y-axis alignment of items label - *Note, see xbfont.h\n" - //"shadowColor : [opt] hexstring - color of items label's shadow. (e.g. '0xFF000000')\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.cList = xbmcgui.ControlList(100, 250, 200, 250, 'font14', space=5)\n" - ); - -// Restore code and data sections to normal. - - PyTypeObject ControlList_Type; - - void initControlList_Type() - { - PyXBMCInitializeTypeObject(&ControlList_Type); - - ControlList_Type.tp_name = (char*)"xbmcgui.ControlList"; - ControlList_Type.tp_basicsize = sizeof(ControlList); - ControlList_Type.tp_dealloc = (destructor)ControlList_Dealloc; - ControlList_Type.tp_compare = 0; - ControlList_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlList_Type.tp_doc = controlList__doc__; - ControlList_Type.tp_methods = ControlList_methods; - ControlList_Type.tp_base = &Control_Type; - ControlList_Type.tp_new = ControlList_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlprogress.cpp b/xbmc/interfaces/python/xbmcmodule/controlprogress.cpp deleted file mode 100644 index 2e09ede6cb..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlprogress.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIProgressControl.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlProgress_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char* keywords[] = { "x", "y", "width", "height", "texturebg", "textureleft", "texturemid", "textureright", "textureoverlay", NULL }; - - ControlProgress *self; - char *cTextureBg = NULL; - char *cTextureLeft = NULL; - char *cTextureMid = NULL; - char *cTextureRight = NULL; - char *cTextureOverLay = NULL; - - self = (ControlProgress*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strTextureLeft) string(); - new(&self->strTextureMid) string(); - new(&self->strTextureRight) string(); - new(&self->strTextureBg) string(); - new(&self->strTextureOverlay) string(); - - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords(args, kwds, - (char*)"llll|sssss", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cTextureBg, - &cTextureLeft, - &cTextureMid, - &cTextureRight, - &cTextureOverLay)) - { - Py_DECREF( self ); - return NULL; - } - - // if texture is supplied use it, else get default ones - self->strTextureBg = cTextureBg ? cTextureBg : PyXBMCGetDefaultImage((char*)"progress", (char*)"texturebg", (char*)"progress_back.png"); - self->strTextureLeft = cTextureLeft ? cTextureLeft : PyXBMCGetDefaultImage((char*)"progress", (char*)"lefttexture", (char*)"progress_left.png"); - self->strTextureMid = cTextureMid ? cTextureMid : PyXBMCGetDefaultImage((char*)"progress", (char*)"midtexture", (char*)"progress_mid.png"); - self->strTextureRight = cTextureRight ? cTextureRight : PyXBMCGetDefaultImage((char*)"progress", (char*)"righttexture", (char*)"progress_right.png"); - self->strTextureOverlay = cTextureOverLay ? cTextureOverLay : PyXBMCGetDefaultImage((char*)"progress", (char*)"overlaytexture", (char*)"progress_over.png"); - - //if (cColorDiffuse) sscanf(cColorDiffuse, "%x", &self->colorDiffuse); - //else self->colorDiffuse = 0; - - return (PyObject*)self; - } - - void ControlProgress_Dealloc(ControlProgress* self) - { - self->strTextureLeft.~string(); - self->strTextureMid.~string(); - self->strTextureRight.~string(); - self->strTextureBg.~string(); - self->strTextureOverlay.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlProgress_Create(ControlProgress* pControl) - { - pControl->pGUIControl = new CGUIProgressControl(pControl->iParentId, pControl->iControlId,(float)pControl->dwPosX, (float)pControl->dwPosY, - (float)pControl->dwWidth,(float)pControl->dwHeight, - (CStdString)pControl->strTextureBg,(CStdString)pControl->strTextureLeft, - (CStdString)pControl->strTextureMid,(CStdString)pControl->strTextureRight, - (CStdString)pControl->strTextureOverlay); - - if (pControl->pGUIControl && pControl->colorDiffuse) - ((CGUIProgressControl *)pControl->pGUIControl)->SetColorDiffuse(pControl->colorDiffuse); - - return pControl->pGUIControl; - } - - PyDoc_STRVAR(setPercent__doc__, - "setPercent(percent) -- Sets the percentage of the progressbar to show.\n" - "\n" - "percent : float - percentage of the bar to show.\n" - "\n" - "*Note, valid range for percent is 0-100\n" - "\n" - "example:\n" - " - self.progress.setPercent(60)\n"); - - PyObject* ControlProgress_SetPercent(ControlProgress *self, PyObject *args) - { - float fPercent = 0; - if (!PyArg_ParseTuple(args, (char*)"f", &fPercent)) return NULL; - - if (self->pGUIControl) - ((CGUIProgressControl*)self->pGUIControl)->SetPercentage(fPercent); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getPercent__doc__, - "getPercent() -- Returns a float of the percent of the progress.\n" - "\n" - "example:\n" - " - print self.progress.getValue()\n"); - - PyObject* ControlProgress_GetPercent(ControlProgress *self, PyObject *args) - { - float fPercent; - if (self->pGUIControl) - { - fPercent = ((CGUIProgressControl*)self->pGUIControl)->GetPercentage(); - return Py_BuildValue((char*)"f", fPercent); - } - return Py_BuildValue((char*)"f", 0); - } - - PyMethodDef ControlProgress_methods[] = { - {(char*)"setPercent", (PyCFunction)ControlProgress_SetPercent, METH_VARARGS, setPercent__doc__}, - {(char*)"getPercent", (PyCFunction)ControlProgress_GetPercent, METH_VARARGS, getPercent__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlProgress class - PyDoc_STRVAR(ControlProgress__doc__, - "ControlProgress class.\n" - "\n" - "ControlProgress(x, y, width, height[, texturebg, textureleft, texturemid, textureright, textureoverlay])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "texturebg : [opt] string - image filename.\n" - "textureleft : [opt] string - image filename.\n" - "texturemid : [opt] string - image filename.\n" - "textureright : [opt] string - image filename.\n" - "textureoverlay : [opt] string - image filename.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.progress = xbmcgui.ControlProgress(100, 250, 125, 75)\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlProgress_Type; - - void initControlProgress_Type() - { - PyXBMCInitializeTypeObject(&ControlProgress_Type); - - ControlProgress_Type.tp_name = (char*)"xbmcgui.ControlProgress"; - ControlProgress_Type.tp_basicsize = sizeof(ControlProgress); - ControlProgress_Type.tp_dealloc = (destructor)ControlProgress_Dealloc; - ControlProgress_Type.tp_compare = 0; - ControlProgress_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlProgress_Type.tp_doc = ControlProgress__doc__; - ControlProgress_Type.tp_methods = ControlProgress_methods; - ControlProgress_Type.tp_base = &Control_Type; - ControlProgress_Type.tp_new = ControlProgress_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlradiobutton.cpp b/xbmc/interfaces/python/xbmcmodule/controlradiobutton.cpp deleted file mode 100644 index 03339c07f5..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlradiobutton.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUIRadioButtonControl.h" -#include "guilib/GUIFontManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ControlRadioButton_New( - PyTypeObject *type, - PyObject *args, - PyObject *kwds ) - { - static const char *keywords[] = { - "x", "y", "width", "height", "label", - "focusTexture", "noFocusTexture", - "textOffsetX", "textOffsetY", "alignment", - "font", "textColor", "disabledColor", "angle", "shadowColor", "focusedColor", - "TextureRadioFocus", "TextureRadioNoFocus", NULL }; - ControlRadioButton *self; - char* cFont = NULL; - char* cTextureFocus = NULL; - char* cTextureNoFocus = NULL; - char* cTextColor = NULL; - char* cDisabledColor = NULL; - char* cShadowColor = NULL; - char* cFocusedColor = NULL; - char* cTextureRadioFocus = NULL; - char* cTextureRadioNoFocus = NULL; - - PyObject* pObjectText; - - self = (ControlRadioButton*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strFont) string(); - new(&self->strText) string(); - new(&self->strTextureFocus) string(); - new(&self->strTextureNoFocus) string(); - new(&self->strTextureRadioFocus) string(); - new(&self->strTextureRadioNoFocus) string(); - - // set up default values in case they are not supplied - self->textOffsetX = CONTROL_TEXT_OFFSET_X; - self->textOffsetY = CONTROL_TEXT_OFFSET_Y; - self->align = (XBFONT_LEFT | XBFONT_CENTER_Y); - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - self->iAngle = 0; - self->shadowColor = 0; - self->focusedColor = 0xffffffff; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llllO|sslllssslssss", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &pObjectText, - &cTextureFocus, - &cTextureNoFocus, - &self->textOffsetX, - &self->textOffsetY, - &self->align, - &cFont, - &cTextColor, - &cDisabledColor, - &self->iAngle, - &cShadowColor, - &cFocusedColor, - &cTextureRadioFocus, - &cTextureRadioNoFocus)) - { - Py_DECREF( self ); - return NULL; - } - - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) - { - Py_DECREF( self ); - return NULL; - } - - // if texture is supplied use it, else get default ones - self->strTextureFocus = cTextureFocus ? - cTextureFocus : - PyXBMCGetDefaultImage((char*)"radiobutton", (char*)"texturefocus", (char*)"radiobutton-focus.png"); - self->strTextureNoFocus = cTextureNoFocus ? - cTextureNoFocus : - PyXBMCGetDefaultImage((char*)"radiobutton", (char*)"texturenofocus", (char*)"radiobutton-nofocus.jpg"); - self->strTextureRadioFocus = cTextureRadioFocus ? - cTextureRadioFocus : - PyXBMCGetDefaultImage((char*)"radiobutton", (char*)"textureradiofocus", (char*)"radiobutton-focus.png"); - self->strTextureRadioNoFocus = cTextureRadioNoFocus ? - cTextureRadioNoFocus : - PyXBMCGetDefaultImage((char*)"radiobutton", (char*)"textureradionofocus", (char*)"radiobutton-nofocus.jpg"); - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf( cTextColor, "%x", &self->textColor ); - if (cDisabledColor) sscanf( cDisabledColor, "%x", &self->disabledColor ); - if (cShadowColor) sscanf( cShadowColor, "%x", &self->shadowColor ); - if (cFocusedColor) sscanf( cFocusedColor, "%x", &self->focusedColor ); - return (PyObject*)self; - } - - void ControlRadioButton_Dealloc(ControlRadioButton* self) - { - self->strFont.~string(); - self->strText.~string(); - self->strTextureFocus.~string(); - self->strTextureNoFocus.~string(); - self->strTextureRadioFocus.~string(); - self->strTextureRadioNoFocus.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlRadioButton_Create(ControlRadioButton* pControl) - { - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = pControl->textColor; - label.disabledColor = pControl->disabledColor; - label.shadowColor = pControl->shadowColor; - label.focusedColor = pControl->focusedColor; - label.align = pControl->align; - label.offsetX = (float)pControl->textOffsetX; - label.offsetY = (float)pControl->textOffsetY; - label.angle = (float)-pControl->iAngle; - pControl->pGUIControl = new CGUIRadioButtonControl( - pControl->iParentId, - pControl->iControlId, - (float)pControl->dwPosX, - (float)pControl->dwPosY, - (float)pControl->dwWidth, - (float)pControl->dwHeight, - (CStdString)pControl->strTextureFocus, - (CStdString)pControl->strTextureNoFocus, - label, - (CStdString)pControl->strTextureRadioFocus, - (CStdString)pControl->strTextureRadioNoFocus); - - CGUIRadioButtonControl* pGuiButtonControl = - (CGUIRadioButtonControl*)pControl->pGUIControl; - - pGuiButtonControl->SetLabel(pControl->strText); - - return pControl->pGUIControl; - } - - // setSelected() Method - PyDoc_STRVAR(setSelected__doc__, - "setSelected(selected) -- Sets the radio buttons's selected status.\n" - "\n" - "selected : bool - True=selected (on) / False=not selected (off)\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - self.radiobutton.setSelected(True)\n"); - - PyObject* ControlRadioButton_SetSelected(ControlRadioButton *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "selected", - NULL}; - - char selected = false; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"b", - (char**)keywords, - &selected)) - { - return NULL; - } - - PyXBMCGUILock(); - if (self->pGUIControl) - ((CGUIRadioButtonControl*)self->pGUIControl)->SetSelected(0 != selected); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // isSelected() Method - PyDoc_STRVAR(isSelected__doc__, - "isSelected() -- Returns the radio buttons's selected status.\n" - "\n" - "example:\n" - " - is = self.radiobutton.isSelected()\n"); - - PyObject* ControlRadioButton_IsSelected(ControlRadioButton *self, PyObject *args) - { - bool isSelected = false; - - PyXBMCGUILock(); - if (self->pGUIControl) - isSelected = ((CGUIRadioButtonControl*)self->pGUIControl)->IsSelected(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", isSelected); - } - - // setLabel() Method - PyDoc_STRVAR(setLabel__doc__, - "setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor]) -- Set's the radio buttons text attributes.\n" - "\n" - "label : string or unicode - text string.\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled radio button's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled radio button's label. (e.g. '0xFFFF3300')\n" - "shadowColor : [opt] hexstring - color of radio button's label's shadow. (e.g. '0xFF000000')\n" - "focusedColor : [opt] hexstring - color of focused radio button's label. (e.g. '0xFFFFFF00')\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - self.radiobutton.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')\n"); - - PyObject* ControlRadioButton_SetLabel(ControlRadioButton *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "label", - "font", - "textColor", - "disabledColor", - "shadowColor", - "focusedColor", - NULL}; - char *cFont = NULL; - char *cTextColor = NULL; - char *cDisabledColor = NULL; - char *cShadowColor = NULL; - char *cFocusedColor = NULL; - PyObject *pObjectText = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O|sssss", - (char**)keywords, - &pObjectText, - &cFont, - &cTextColor, - &cDisabledColor, - &cShadowColor, - &cFocusedColor)) - { - return NULL; - } - - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 1)) - { - return NULL; - } - - if (cFont) self->strFont = cFont; - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - if (cDisabledColor) sscanf( cDisabledColor, "%x", &self->disabledColor ); - if (cShadowColor) sscanf(cShadowColor, "%x", &self->shadowColor); - if (cFocusedColor) sscanf(cFocusedColor, "%x", &self->focusedColor); - - PyXBMCGUILock(); - if (self->pGUIControl) - { - ((CGUIRadioButtonControl*)self->pGUIControl)->PythonSetLabel( - self->strFont, self->strText, self->textColor, self->shadowColor, self->focusedColor ); - ((CGUIRadioButtonControl*)self->pGUIControl)->PythonSetDisabledColor(self->disabledColor); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setRadioDimension() Method - PyDoc_STRVAR(setRadioDimension__doc__, - "setRadioDimension(x, y, width, height) -- Sets the radio buttons's radio texture's position and size.\n" - "\n" - "x : integer - x coordinate of radio texture.\n" - "y : integer - y coordinate of radio texture.\n" - "width : integer - width of radio texture.\n" - "height : integer - height of radio texture.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - self.radiobutton.setRadioDimension(x=100, y=5, width=20, height=20)\n"); - - PyObject* ControlRadioButton_SetRadioDimension(ControlRadioButton *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "x", - "y", - "width", - "height", - NULL}; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llll", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight)) - { - return NULL; - } - - PyXBMCGUILock(); - if (self->pGUIControl) - ((CGUIRadioButtonControl*)self->pGUIControl)->SetRadioDimensions((float)self->dwPosX, (float)self->dwPosY, (float)self->dwWidth, (float)self->dwHeight); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlRadioButton_methods[] = { - {(char*)"setSelected", (PyCFunction)ControlRadioButton_SetSelected, METH_VARARGS|METH_KEYWORDS, setSelected__doc__}, - {(char*)"isSelected", (PyCFunction)ControlRadioButton_IsSelected, METH_VARARGS, isSelected__doc__}, - {(char*)"setLabel", (PyCFunction)ControlRadioButton_SetLabel, METH_VARARGS|METH_KEYWORDS, setLabel__doc__}, - {(char*)"setRadioDimension", (PyCFunction)ControlRadioButton_SetRadioDimension, METH_VARARGS|METH_KEYWORDS, setRadioDimension__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlRadioButton class - PyDoc_STRVAR(ControlRadioButton__doc__, - "ControlRadioButton class.\n" - "\n" - "ControlRadioButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,\n" - " alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor,\n" - " radioFocusTexture, noRadioFocusTexture])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "label : string or unicode - text string.\n" - "focusTexture : [opt] string - filename for focus texture.\n" - "noFocusTexture : [opt] string - filename for no focus texture.\n" - "textOffsetX : [opt] integer - x offset of label.\n" - "textOffsetY : [opt] integer - y offset of label.\n" - "alignment : [opt] integer - alignment of label - *Note, see xbfont.h\n" - "font : [opt] string - font used for label text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of enabled radio button's label. (e.g. '0xFFFFFFFF')\n" - "disabledColor : [opt] hexstring - color of disabled radio button's label. (e.g. '0xFFFF3300')\n" - "angle : [opt] integer - angle of control. (+ rotates CCW, - rotates CW)\n" - "shadowColor : [opt] hexstring - color of radio button's label's shadow. (e.g. '0xFF000000')\n" - "focusedColor : [opt] hexstring - color of focused radio button's label. (e.g. '0xFF00FFFF')\n" - "radioFocusTexture : [opt] string - filename for radio focus texture.\n" - "noRadioFocusTexture : [opt] string - filename for radio no focus texture.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.radiobutton = xbmcgui.ControlRadioButton(100, 250, 200, 50, 'Status', font='font14')\n"); - - // Restore code and data sections to normal. - - PyTypeObject ControlRadioButton_Type; - - void initControlRadioButton_Type() - { - PyXBMCInitializeTypeObject(&ControlRadioButton_Type); - - ControlRadioButton_Type.tp_name = (char*)"xbmcgui.ControlRadioButton"; - ControlRadioButton_Type.tp_basicsize = sizeof(ControlRadioButton); - ControlRadioButton_Type.tp_dealloc = (destructor)ControlRadioButton_Dealloc; - ControlRadioButton_Type.tp_compare = 0; - ControlRadioButton_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlRadioButton_Type.tp_doc = ControlRadioButton__doc__; - ControlRadioButton_Type.tp_methods = ControlRadioButton_methods; - ControlRadioButton_Type.tp_base = &Control_Type; - ControlRadioButton_Type.tp_new = ControlRadioButton_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlslider.cpp b/xbmc/interfaces/python/xbmcmodule/controlslider.cpp deleted file mode 100644 index 7d2394e9ae..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlslider.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2005-2010 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUISliderControl.h" -#include "control.h" -#include "pyutil.h" -#include "utils/log.h" -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject * ControlSlider_New (PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char* keywords[] = { "x", "y", "width", "height", "textureback", "texture", "texturefocus", NULL }; - - ControlSlider *self; - char *cTextureBack = NULL; - char *cTexture = NULL; - char *cTextureFoc = NULL; - - self = (ControlSlider *) type->tp_alloc (type, 0); - if (!self) return NULL; - new(&self->strTextureBack) string(); - new(&self->strTexture) string(); - new(&self->strTextureFoc) string(); - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - (char*)"llll|sss", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cTextureBack, - &cTexture, - &cTextureFoc)) - { - Py_DECREF( self ); - return NULL; - } - // if texture is supplied use it, else get default ones - self->strTextureBack = cTextureBack ? cTextureBack : PyXBMCGetDefaultImage((char*)"slider", (char*)"texturesliderbar", (char*)"osd_slider_bg_2.png"); - self->strTexture = cTexture ? cTexture : PyXBMCGetDefaultImage((char*)"slider", (char*)"textureslidernib", (char*)"osd_slider_nibNF.png"); - self->strTextureFoc = cTextureFoc ? cTextureFoc : PyXBMCGetDefaultImage((char*)"slider", (char*)"textureslidernibfocus", (char*)"osd_slider_nib.png"); - - return (PyObject*)self; - } - - void ControlSlider_Dealloc(ControlSlider* self) - { - self->strTextureBack.~string(); - self->strTexture.~string(); - self->strTextureFoc.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlSlider_Create (ControlSlider* pControl) - { - - pControl->pGUIControl = new CGUISliderControl(pControl->iParentId, pControl->iControlId,(float)pControl->dwPosX, (float)pControl->dwPosY, - (float)pControl->dwWidth,(float)pControl->dwHeight, - (CStdString)pControl->strTextureBack,(CStdString)pControl->strTexture, - (CStdString)pControl->strTextureFoc,0); - - - return pControl->pGUIControl; - } - - PyDoc_STRVAR(getPercent__doc__, - "getPercent() -- Returns a float of the percent of the slider.\n" - "\n" - "example:\n" - " - print self.slider.getPercent()\n"); - - PyObject* ControlSlider_GetPercent(ControlSlider*self, PyObject *args) - { - if (self->pGUIControl) - { - float fPercent = (float)((CGUISliderControl*)self->pGUIControl)->GetPercentage(); - return Py_BuildValue((char*)"f", fPercent); - } - return Py_BuildValue((char*)"f", 0); - } - - PyDoc_STRVAR(setPercent__doc__, - "setPercent(50) -- Sets the percent of the slider.\n" - "\n" - "example:\n" - "self.slider.setPercent(50)\n"); - - PyObject* ControlSlider_SetPercent(ControlProgress *self, PyObject *args) - { - float fPercent = 0; - if (!PyArg_ParseTuple(args, (char*)"f", &fPercent)) return NULL; - - if (self->pGUIControl) - ((CGUISliderControl*)self->pGUIControl)->SetPercentage((int)fPercent); - - Py_INCREF(Py_None); - return Py_None; - } - - - PyMethodDef ControlSlider_methods[] = { - {(char*)"getPercent", (PyCFunction)ControlSlider_GetPercent, METH_VARARGS, getPercent__doc__}, - {(char*)"setPercent", (PyCFunction)ControlSlider_SetPercent, METH_VARARGS, setPercent__doc__}, - {NULL, NULL, 0, NULL} - }; - - // ControlProgress class - PyDoc_STRVAR(ControlSlider__doc__, - "ControlSlider class.\n" - "\n" - "ControlSlider(x, y, width, height[, textureback, texture, texturefocus])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "textureback : [opt] string - image filename.\n" - "texture : [opt] string - image filename.\n" - "texturefocus : [opt] string - image filename.\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlSlider_Type; - - void initControlSlider_Type() - { - PyXBMCInitializeTypeObject(&ControlSlider_Type); - - ControlSlider_Type.tp_name = (char*)"xbmcgui.ControlSlider"; - ControlSlider_Type.tp_basicsize = sizeof(ControlSlider); - ControlSlider_Type.tp_dealloc = (destructor)ControlSlider_Dealloc; - ControlSlider_Type.tp_compare = 0; - ControlSlider_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlSlider_Type.tp_doc = ControlSlider__doc__; - ControlSlider_Type.tp_methods = ControlSlider_methods; - ControlSlider_Type.tp_base = &Control_Type; - ControlSlider_Type.tp_new = ControlSlider_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controlspin.cpp b/xbmc/interfaces/python/xbmcmodule/controlspin.cpp deleted file mode 100644 index b3231a3c70..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controlspin.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUISpinControl.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - /* - // not used for now - PyObject* ControlSpin_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - ControlSpin *self; - char* cTextureFocus = NULL; - char* cTextureNoFocus = NULL; - - PyObject* pObjectText; - - self = (ControlSpin*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strTextureUp) string(); - new(&self->strTextureDown) string(); - new(&self->strTextureUpFocus) string(); - new(&self->strTextureDownFocus) string(); - - if (!PyArg_ParseTuple(args, "llll|Oss", &self->dwPosX, &self->dwPosY, &self->dwWidth, &self->dwHeight, - &pObjectText, &cTextureFocus, &cTextureNoFocus)) return NULL; - if (!PyXBMCGetUnicodeString(self->strText, pObjectText, 5)) return NULL; - - // SetLabel(const CStdString& strFontName,const CStdString& strLabel,D3DCOLOR dwColor) - self->strFont = "font13"; - self->textColor = 0xffffffff; - self->disabledColor = 0x60ffffff; - - self->strTextureFocus = cTextureFocus ? cTextureFocus : "button-focus.png"; - self->strTextureNoFocus = cTextureNoFocus ? cTextureNoFocus : "button-nofocus.jpg"; - - return (PyObject*)self; - } -*/ - /* - * allocate a new controlspin. Used for c++ and not the python user - */ - PyObject* ControlSpin_New() - { - //ControlSpin* self = (ControlSpin*)_PyObject_New(&ControlSpin_Type); - ControlSpin*self = (ControlSpin*)ControlSpin_Type.tp_alloc(&ControlSpin_Type, 0); - if (!self) return NULL; - new(&self->strTextureUp) string(); - new(&self->strTextureDown) string(); - new(&self->strTextureUpFocus) string(); - new(&self->strTextureDownFocus) string(); - - // default values for spin control - self->color = 0xffffffff; - self->dwPosX = 0; - self->dwPosY = 0; - self->dwWidth = 16; - self->dwHeight = 16; - - // get default images - self->strTextureUp = PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"textureup", (char*)"scroll-up.png"); - self->strTextureDown = PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"texturedown", (char*)"scroll-down.png"); - self->strTextureUpFocus = PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"textureupfocus", (char*)"scroll-up-focus.png"); - self->strTextureDownFocus = PyXBMCGetDefaultImage((char*)"listcontrol", (char*)"texturedownfocus", (char*)"scroll-down-focus.png"); - - return (PyObject*)self; - } - - void ControlSpin_Dealloc(ControlSpin* self) - { - self->strTextureUp.~string(); - self->strTextureDown.~string(); - self->strTextureUpFocus.~string(); - self->strTextureDownFocus.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - PyObject* ControlSpin_SetColor(ControlSpin *self, PyObject *args) - { - char *cColor = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cColor)) return NULL; - - if (cColor) sscanf(cColor, "%x", &self->color); - - PyXBMCGUILock(); - //if (self->pGUIControl) - //((CGUISpinControl*)self->pGUIControl)->SetColor(self->dwDColor); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - /* - * set textures - * (string textureUp, string textureDown, string textureUpFocus, string textureDownFocus) - */ - PyDoc_STRVAR(setTextures__doc__, - "setTextures(up, down, upFocus, downFocus) -- Set's textures for this control.\n" - "\n" - "texture are image files that are used for example in the skin"); - - PyObject* ControlSpin_SetTextures(ControlSpin *self, PyObject *args) - { - char *cLine[4]; - - if (!PyArg_ParseTuple(args, (char*)"ssss", &cLine[0], &cLine[1], &cLine[2], &cLine[3])) return NULL; - - self->strTextureUp = cLine[0]; - self->strTextureDown = cLine[1]; - self->strTextureUpFocus = cLine[2]; - self->strTextureDownFocus = cLine[3]; - /* - PyXBMCGUILock(); - if (self->pGUIControl) - { - CGUISpinControl* pControl = (CGUISpinControl*)self->pGUIControl; - pControl->se - PyXBMCGUIUnlock(); - */ - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlSpin_methods[] = { - //{(char*)"setColor", (PyCFunction)ControlSpin_SetColor, METH_VARARGS, ""}, - {(char*)"setTextures", (PyCFunction)ControlSpin_SetTextures, METH_VARARGS, setTextures__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(controlSpin__doc__, - "ControlSpin class.\n" - "\n" - " - Not working yet -.\n" - "\n" - "you can't create this object, it is returned by objects like ControlTextBox and ControlList."); - -// Restore code and data sections to normal. - - PyTypeObject ControlSpin_Type; - - void initControlSpin_Type() - { - PyXBMCInitializeTypeObject(&ControlSpin_Type); - - ControlSpin_Type.tp_name = (char*)"xbmcgui.ControlSpin"; - ControlSpin_Type.tp_basicsize = sizeof(ControlSpin); - ControlSpin_Type.tp_dealloc = (destructor)ControlSpin_Dealloc; - ControlSpin_Type.tp_compare = 0; - ControlSpin_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlSpin_Type.tp_doc = controlSpin__doc__; - ControlSpin_Type.tp_methods = ControlSpin_methods; - ControlSpin_Type.tp_base = &Control_Type; - ControlSpin_Type.tp_new = 0; //ControlSpin_New - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/controltextbox.cpp b/xbmc/interfaces/python/xbmcmodule/controltextbox.cpp deleted file mode 100644 index e68a3fa24d..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/controltextbox.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "guilib/GUITextBox.h" -#include "guilib/GUIFontManager.h" -#include "guilib/GUIWindowManager.h" -#include "control.h" -#include "pyutil.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - extern PyObject* ControlSpin_New(void); - - PyObject* ControlTextBox_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "x", "y", "width", "height", "font", "textColor", NULL }; - ControlTextBox *self; - char *cFont = NULL; - char *cTextColor = NULL; - - self = (ControlTextBox*)type->tp_alloc(type, 0); - if (!self) return NULL; - - new(&self->strFont) string(); - - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"llll|ss", - (char**)keywords, - &self->dwPosX, - &self->dwPosY, - &self->dwWidth, - &self->dwHeight, - &cFont, - &cTextColor)) - { - Py_DECREF( self ); - return NULL; - } - - // set default values if needed - self->strFont = cFont ? cFont : "font13"; - - if (cTextColor) sscanf(cTextColor, "%x", &self->textColor); - else self->textColor = 0xffffffff; - - return (PyObject*)self; - } - - void ControlTextBox_Dealloc(ControlTextBox* self) - { - //Py_DECREF(self->pControlSpin); - self->strFont.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - CGUIControl* ControlTextBox_Create(ControlTextBox* pControl) - { - // create textbox - CLabelInfo label; - label.font = g_fontManager.GetFont(pControl->strFont); - label.textColor = label.focusedColor = pControl->textColor; - - pControl->pGUIControl = new CGUITextBox(pControl->iParentId, pControl->iControlId, - (float)pControl->dwPosX, (float)pControl->dwPosY, (float)pControl->dwWidth, (float)pControl->dwHeight, - label); - - // reset textbox - CGUIMessage msg(GUI_MSG_LABEL_RESET, pControl->iParentId, pControl->iControlId); - pControl->pGUIControl->OnMessage(msg); - - return pControl->pGUIControl; - } - - // SetText() Method - PyDoc_STRVAR(setText__doc__, - "setText(text) -- Set's the text for this textbox.\n" - "\n" - "text : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.textbox.setText('This is a line of text that can wrap.')"); - - - PyObject* ControlTextBox_SetText(ControlTextBox *self, PyObject *args) - { - PyObject *pObjectText; - string strText; - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - // create message - ControlTextBox *pControl = (ControlTextBox*)self; - CGUIMessage msg(GUI_MSG_LABEL_SET, pControl->iParentId, pControl->iControlId); - msg.SetLabel(strText); - - // send message - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - Py_INCREF(Py_None); - return Py_None; - } - - // scroll() Method - PyDoc_STRVAR(Scroll__doc__, - "scroll(position) -- Scrolls to the given position.\n" - "\n" - "id : integer - position to scroll to.\n" - "\n" - "example:\n" - " - self.textbox.scroll(10)"); - - PyObject* ControlTextBox_Scroll(ControlTextBox *self, PyObject *args) - { - int position = 0; - if (!PyArg_ParseTuple(args, (char*)"l", &position)) - return NULL; - - ControlTextBox *pControl = (ControlTextBox*)self; - static_cast<CGUITextBox*>(pControl->pGUIControl)->Scroll(position); - - return Py_None; - } - - // reset() Method - PyDoc_STRVAR(reset__doc__, - "reset() -- Clear's this textbox.\n" - "\n" - "example:\n" - " - self.textbox.reset()\n"); - - PyObject* ControlTextBox_Reset(ControlTextBox *self, PyObject *args) - { - // create message - ControlTextBox *pControl = (ControlTextBox*)self; - CGUIMessage msg(GUI_MSG_LABEL_RESET, pControl->iParentId, pControl->iControlId); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ControlTextBox_methods[] = { - {(char*)"setText", (PyCFunction)ControlTextBox_SetText, METH_VARARGS, setText__doc__}, - {(char*)"reset", (PyCFunction)ControlTextBox_Reset, METH_VARARGS, reset__doc__}, - {(char*)"scroll",(PyCFunction)ControlTextBox_Scroll, METH_VARARGS, Scroll__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(controlTextBox__doc__, - "ControlTextBox class.\n" - "\n" - "ControlTextBox(x, y, width, height[, font, textColor])\n" - "\n" - "x : integer - x coordinate of control.\n" - "y : integer - y coordinate of control.\n" - "width : integer - width of control.\n" - "height : integer - height of control.\n" - "font : [opt] string - font used for text. (e.g. 'font13')\n" - "textColor : [opt] hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - " After you create the control, you need to add it to the window with addControl().\n" - "\n" - "example:\n" - " - self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')\n"); - -// Restore code and data sections to normal. - - PyTypeObject ControlTextBox_Type; - - void initControlTextBox_Type() - { - PyXBMCInitializeTypeObject(&ControlTextBox_Type); - - ControlTextBox_Type.tp_name = (char*)"xbmcgui.ControlTextBox"; - ControlTextBox_Type.tp_basicsize = sizeof(ControlTextBox); - ControlTextBox_Type.tp_dealloc = (destructor)ControlTextBox_Dealloc; - ControlTextBox_Type.tp_compare = 0; - ControlTextBox_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ControlTextBox_Type.tp_doc = controlTextBox__doc__; - ControlTextBox_Type.tp_methods = ControlTextBox_methods; - ControlTextBox_Type.tp_base = &Control_Type; - ControlTextBox_Type.tp_new = ControlTextBox_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/dialog.cpp b/xbmc/interfaces/python/xbmcmodule/dialog.cpp deleted file mode 100644 index 3fc08b4e56..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/dialog.cpp +++ /dev/null @@ -1,688 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "dialog.h" - -#include "ApplicationMessenger.h" -#include "settings/Settings.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "dialogs/GUIDialogFileBrowser.h" -#include "dialogs/GUIDialogNumeric.h" -#include "guilib/GUIWindowManager.h" -#include "dialogs/GUIDialogOK.h" -#include "dialogs/GUIDialogProgress.h" -#include "dialogs/GUIDialogYesNo.h" -#include "dialogs/GUIDialogSelect.h" - -using namespace std; - -#define ACTIVE_WINDOW g_windowManager.GetActiveWindow() - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* WindowDialog_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - WindowDialog *self; - - self = (WindowDialog*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->sXMLFileName) string(); - new(&self->sFallBackPath) string(); - new(&self->vecControls) std::vector<Control*>(); - - self->iWindowId = -1; - - if (!PyArg_ParseTuple(args, (char*)"|i", &self->iWindowId)) return NULL; - - // create new GUIWindow - if (!Window_CreateNewWindow((Window*)self, true)) - { - // error is already set by Window_CreateNewWindow, just release the memory - self->vecControls.clear(); - self->vecControls.~vector(); - self->sFallBackPath.~string(); - self->sXMLFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - return NULL; - } - - return (PyObject*)self; - } - - PyDoc_STRVAR(ok__doc__, - "ok(heading, line1[, line2, line3]) -- Show a dialog 'OK'.\n" - "\n" - "heading : string or unicode - dialog heading.\n" - "line1 : string or unicode - line #1 text.\n" - "line2 : [opt] string or unicode - line #2 text.\n" - "line3 : [opt] string or unicode - line #3 text.\n" - "\n" - "*Note, Returns True if 'Ok' was pressed, else False.\n" - "\n" - "example:\n" - " - dialog = xbmcgui.Dialog()\n" - " - ok = dialog.ok('XBMC', 'There was an error.')\n"); - - PyObject* Dialog_OK(PyObject *self, PyObject *args) - { - const int window = WINDOW_DIALOG_OK; - PyObject* unicodeLine[4]; - for (int i = 0; i < 4; i++) unicodeLine[i] = NULL; - - // get lines, last 2 lines are optional. - string utf8Line[4]; - if (!PyArg_ParseTuple(args, (char*)"OO|OO", &unicodeLine[0], &unicodeLine[1], &unicodeLine[2], &unicodeLine[3])) return NULL; - - for (int i = 0; i < 4; i++) - { - if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+1)) - return NULL; - } - PyXBMCGUILock(); - CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(window); - if (PyXBMCWindowIsNull(pDialog)) return NULL; - - pDialog->SetHeading(utf8Line[0]); - pDialog->SetLine(0, utf8Line[1]); - pDialog->SetLine(1, utf8Line[2]); - pDialog->SetLine(2, utf8Line[3]); - - PyXBMCGUIUnlock(); - - //send message and wait for user input - PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW); - PyXBMCGUILock(); - bool result = pDialog->IsConfirmed(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", result); - } - - PyDoc_STRVAR(browse__doc__, - "browse(type, heading, shares[, mask, useThumbs, treatAsFolder, default, enableMultiple]) -- Show a 'Browse' dialog.\n" - "\n" - "type : integer - the type of browse dialog.\n" - "heading : string or unicode - dialog heading.\n" - "shares : string or unicode - from sources.xml. (i.e. 'myprograms')\n" - "mask : [opt] string or unicode - '|' separated file mask. (i.e. '.jpg|.png')\n" - "useThumbs : [opt] boolean - if True autoswitch to Thumb view if files exist.\n" - "treatAsFolder : [opt] boolean - if True playlists and archives act as folders.\n" - "default : [opt] string - default path or file.\n" - "\n" - "enableMultiple : [opt] boolean - if True multiple file selection is enabled.\n" - "Types:\n" - " 0 : ShowAndGetDirectory\n" - " 1 : ShowAndGetFile\n" - " 2 : ShowAndGetImage\n" - " 3 : ShowAndGetWriteableDirectory\n" - "\n" - "*Note, If enableMultiple is False (default): returns filename and/or path as a string\n" - " to the location of the highlighted item, if user pressed 'Ok' or a masked item\n" - " was selected. Returns the default value if dialog was canceled.\n" - " If enableMultiple is True: returns tuple of marked filenames as a string," - " if user pressed 'Ok' or a masked item was selected. Returns empty tuple if dialog was canceled.\n" - "\n" - " If type is 0 or 3 the enableMultiple parameter is ignored." - "\n" - "example:\n" - " - dialog = xbmcgui.Dialog()\n" - " - fn = dialog.browse(3, 'XBMC', 'files', '', False, False, False, 'special://masterprofile/script_data/XBMC Lyrics')\n"); - - PyObject* Dialog_Browse(PyObject *self, PyObject *args) - { - int browsetype = 0; - char useThumbs = false; - char useFileDirectories = false; - char enableMultiple = false; - CStdString value; - CStdStringArray valuelist; - PyObject* unicodeLine[3]; - string utf8Line[3]; - char *cDefault = NULL; - PyObject *result; - - for (int i = 0; i < 3; i++) - unicodeLine[i] = NULL; - if (!PyArg_ParseTuple(args, (char*)"iOO|Obbsb", - &browsetype , &unicodeLine[0], - &unicodeLine[1], &unicodeLine[2], - &useThumbs, &useFileDirectories, - &cDefault, &enableMultiple)) - { - return NULL; - } - for (int i = 0; i < 3; i++) - { - if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+1)) - return NULL; - } - VECSOURCES *shares = g_settings.GetSourcesFromType(utf8Line[1]); - if (!shares) return NULL; - - if (useFileDirectories && !utf8Line[2].size() == 0) - utf8Line[2] += "|.rar|.zip"; - - value = cDefault; - - CPyThreadState pyState; - - if (browsetype == 1) - { - if (enableMultiple) - CGUIDialogFileBrowser::ShowAndGetFileList(*shares, utf8Line[2], utf8Line[0], valuelist, 0 != useThumbs, 0 != useFileDirectories); - else - CGUIDialogFileBrowser::ShowAndGetFile(*shares, utf8Line[2], utf8Line[0], value, 0 != useThumbs, 0 != useFileDirectories); - } - else if (browsetype == 2) - { - if (enableMultiple) - CGUIDialogFileBrowser::ShowAndGetImageList(*shares, utf8Line[0], valuelist); - else - CGUIDialogFileBrowser::ShowAndGetImage(*shares, utf8Line[0], value); - } - else - CGUIDialogFileBrowser::ShowAndGetDirectory(*shares, utf8Line[0], value, browsetype != 0); - - pyState.Restore(); - - if (enableMultiple && (browsetype == 1 || browsetype == 2)) - { - result = PyTuple_New(valuelist.size()); - if (!result) - return NULL; - - for (unsigned int i = 0; i < valuelist.size(); i++) - PyTuple_SetItem(result, i, PyString_FromString(valuelist.at(i).c_str())); - - return result; - } - else - return Py_BuildValue((char*)"s", value.c_str()); - } - - PyDoc_STRVAR(numeric__doc__, - "numeric(type, heading[, default]) -- Show a 'Numeric' dialog.\n" - "\n" - "type : integer - the type of numeric dialog.\n" - "heading : string or unicode - dialog heading.\n" - "default : [opt] string - default value.\n" - "\n" - "Types:\n" - " 0 : ShowAndGetNumber (default format: #)\n" - " 1 : ShowAndGetDate (default format: DD/MM/YYYY)\n" - " 2 : ShowAndGetTime (default format: HH:MM)\n" - " 3 : ShowAndGetIPAddress (default format: #.#.#.#)\n" - "\n" - "*Note, Returns the entered data as a string.\n" - " Returns the default value if dialog was canceled.\n" - "\n" - "example:\n" - " - dialog = xbmcgui.Dialog()\n" - " - d = dialog.numeric(1, 'Enter date of birth')\n"); - - PyObject* Dialog_Numeric(PyObject *self, PyObject *args) - { - int inputtype = 0; - CStdString value; - PyObject *heading = NULL; - char *cDefault = NULL; - SYSTEMTIME timedate; - GetLocalTime(&timedate); - if (!PyArg_ParseTuple(args, (char*)"iO|s", &inputtype, &heading, &cDefault)) return NULL; - - CStdString utf8Heading; - if (heading && PyXBMCGetUnicodeString(utf8Heading, heading, 1)) - { - if (inputtype == 1) - { - if (cDefault && strlen(cDefault) == 10) - { - CStdString sDefault = cDefault; - timedate.wDay = atoi(sDefault.Left(2)); - timedate.wMonth = atoi(sDefault.Mid(3,4)); - timedate.wYear = atoi(sDefault.Right(4)); - } - bool gotDate; - Py_BEGIN_ALLOW_THREADS - gotDate = CGUIDialogNumeric::ShowAndGetDate(timedate, utf8Heading); - Py_END_ALLOW_THREADS - if (gotDate) - value.Format("%2d/%2d/%4d", timedate.wDay, timedate.wMonth, timedate.wYear); - else - { - Py_INCREF(Py_None); - return Py_None; - } - } - else if (inputtype == 2) - { - if (cDefault && strlen(cDefault) == 5) - { - CStdString sDefault = cDefault; - timedate.wHour = atoi(sDefault.Left(2)); - timedate.wMinute = atoi(sDefault.Right(2)); - } - bool gotTime; - Py_BEGIN_ALLOW_THREADS - gotTime = CGUIDialogNumeric::ShowAndGetTime(timedate, utf8Heading); - Py_END_ALLOW_THREADS - if (gotTime) - value.Format("%2d:%02d", timedate.wHour, timedate.wMinute); - else - { - Py_INCREF(Py_None); - return Py_None; - } - } - else if (inputtype == 3) - { - value = cDefault; - bool gotIPAddress; - Py_BEGIN_ALLOW_THREADS - gotIPAddress = CGUIDialogNumeric::ShowAndGetIPAddress(value, utf8Heading); - Py_END_ALLOW_THREADS - if (!gotIPAddress) - { - Py_INCREF(Py_None); - return Py_None; - } - } - else - { - value = cDefault; - bool gotNumber; - Py_BEGIN_ALLOW_THREADS - gotNumber = CGUIDialogNumeric::ShowAndGetNumber(value, utf8Heading); - Py_END_ALLOW_THREADS - if (!gotNumber) - { - Py_INCREF(Py_None); - return Py_None; - } - } - } - return Py_BuildValue((char*)"s", value.c_str()); - } - - PyDoc_STRVAR(yesno__doc__, - "yesno(heading, line1[, line2, line3]) -- Show a dialog 'YES/NO'.\n" - "\n" - "heading : string or unicode - dialog heading.\n" - "line1 : string or unicode - line #1 text.\n" - "line2 : [opt] string or unicode - line #2 text.\n" - "line3 : [opt] string or unicode - line #3 text.\n" - "nolabel : [opt] label to put on the no button.\n" - "yeslabel : [opt] label to put on the yes button.\n" - "\n" - "*Note, Returns True if 'Yes' was pressed, else False.\n" - "\n" - "example:\n" - " - dialog = xbmcgui.Dialog()\n" - " - ret = dialog.yesno('XBMC', 'Do you want to exit this script?')\n"); - - PyObject* Dialog_YesNo(PyObject *self, PyObject *args) - { - const int window = WINDOW_DIALOG_YES_NO; - PyObject* unicodeLine[6]; - for (int i = 0; i < 6; i++) unicodeLine[i] = NULL; - - // get lines, last 4 lines are optional. - string utf8Line[6]; - if (!PyArg_ParseTuple(args, (char*)"OO|OOOO", &unicodeLine[0], &unicodeLine[1], &unicodeLine[2], &unicodeLine[3],&unicodeLine[4],&unicodeLine[5])) return NULL; - - for (int i = 0; i < 6; ++i) - { - if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+1)) - return NULL; - } - PyXBMCGUILock(); - CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(window); - if (PyXBMCWindowIsNull(pDialog)) return NULL; - pDialog->SetHeading(utf8Line[0]); - pDialog->SetLine(0, utf8Line[1]); - pDialog->SetLine(1, utf8Line[2]); - pDialog->SetLine(2, utf8Line[3]); - if (utf8Line[4] != "") - pDialog->SetChoice(0,utf8Line[4]); - if (utf8Line[5] != "") - pDialog->SetChoice(1,utf8Line[5]); - PyXBMCGUIUnlock(); - - //send message and wait for user input - PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW); - PyXBMCGUILock(); - bool result = pDialog->IsConfirmed(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", result); - } - - PyDoc_STRVAR(select__doc__, - "select(heading, list) -- Show a select dialog.\n" - "\n" - "heading : string or unicode - dialog heading.\n" - "list : string list - list of items.\n" - "autoclose : [opt] integer - milliseconds to autoclose dialog. (default=do not autoclose)\n" - "\n" - "*Note, Returns the position of the highlighted item as an integer.\n" - "\n" - "example:\n" - " - dialog = xbmcgui.Dialog()\n" - " - ret = dialog.select('Choose a playlist', ['Playlist #1', 'Playlist #2, 'Playlist #3'])\n"); - - PyObject* Dialog_Select(PyObject *self, PyObject *args) - { - const int window = WINDOW_DIALOG_SELECT; - PyObject *heading = NULL; - PyObject *list = NULL; - int autoClose = 0; - - if (!PyArg_ParseTuple(args, (char*)"OO|i", &heading, &list, &autoClose)) return NULL; - if (!PyList_Check(list)) return NULL; - - PyXBMCGUILock(); - CGUIDialogSelect* pDialog= (CGUIDialogSelect*)g_windowManager.GetWindow(window); - if (PyXBMCWindowIsNull(pDialog)) return NULL; - - pDialog->Reset(); - CStdString utf8Heading; - if (heading && PyXBMCGetUnicodeString(utf8Heading, heading, 1)) - pDialog->SetHeading(utf8Heading); - - PyObject *listLine = NULL; - for(int i = 0; i < PyList_Size(list); i++) - { - listLine = PyList_GetItem(list, i); - CStdString utf8Line; - if (listLine && PyXBMCGetUnicodeString(utf8Line, listLine, i)) - pDialog->Add(utf8Line); - } - if (autoClose > 0) - pDialog->SetAutoClose(autoClose); - - PyXBMCGUIUnlock(); - - //send message and wait for user input - PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW); - - PyXBMCGUILock(); - int result = pDialog->GetSelectedLabel(); - PyXBMCGUIUnlock(); - return Py_BuildValue((char*)"i", result); - } - -/***************************************************************** - * start of dialog process methods and python objects - *****************************************************************/ - - PyDoc_STRVAR(create__doc__, - "create(heading[, line1, line2, line3]) -- Create and show a progress dialog.\n" - "\n" - "heading : string or unicode - dialog heading.\n" - "line1 : string or unicode - line #1 text.\n" - "line2 : [opt] string or unicode - line #2 text.\n" - "line3 : [opt] string or unicode - line #3 text.\n" - "\n" - "*Note, Use update() to update lines and progressbar.\n" - "\n" - "example:\n" - " - pDialog = xbmcgui.DialogProgress()\n" - " - ret = pDialog.create('XBMC', 'Initializing script...')\n"); - - PyObject* Dialog_ProgressCreate(PyObject *self, PyObject *args) - { - PyObject* unicodeLine[4]; - for (int i = 0; i < 4; i++) unicodeLine[i] = NULL; - - // get lines, last 3 lines are optional. - if (!PyArg_ParseTuple(args, (char*)"O|OOO", &unicodeLine[0], &unicodeLine[1], &unicodeLine[2], &unicodeLine[3])) return NULL; - - string utf8Line[4]; - for (int i = 0; i < 4; i++) - { - if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+1)) - return NULL; - } - - CGUIDialogProgress* pDialog; - { - CPyThreadState releaseGil; - CSingleLock glock(g_graphicsContext); - - pDialog= (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); - if (!pDialog) - { - glock.Leave(); - releaseGil.Restore(); - PyErr_SetString(PyExc_SystemError, "Error: Window is NULL, this is not possible :-)"); - return NULL; - } - ((DialogProgress*)self)->dlg = pDialog; - - pDialog->SetHeading(utf8Line[0]); - - for (int i = 1; i < 4; i++) - pDialog->SetLine(i - 1,utf8Line[i]); - - pDialog->StartModal(); - } - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(update__doc__, - "update(percent[, line1, line2, line3]) -- Update's the progress dialog.\n" - "\n" - "percent : integer - percent complete. (0:100)\n" - "line1 : [opt] string or unicode - line #1 text.\n" - "line2 : [opt] string or unicode - line #2 text.\n" - "line3 : [opt] string or unicode - line #3 text.\n" - "\n" - "*Note, If percent == 0, the progressbar will be hidden.\n" - "\n" - "example:\n" - " - pDialog.update(25, 'Importing modules...')\n"); - - PyObject* Dialog_ProgressUpdate(PyObject *self, PyObject *args) - { - int percentage = 0; - PyObject *unicodeLine[3]; - for (int i = 0; i < 3; i++) unicodeLine[i] = NULL; - if (!PyArg_ParseTuple(args, (char*)"i|OOO", &percentage,&unicodeLine[0], &unicodeLine[1], &unicodeLine[2])) return NULL; - - string utf8Line[3]; - for (int i = 0; i < 3; i++) - { - if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+2)) - return NULL; - } - - PyXBMCGUILock(); - CGUIDialogProgress* pDialog= ((DialogProgress*)self)->dlg; - if (PyXBMCWindowIsNull(pDialog)) return NULL; - - if (percentage >= 0 && percentage <= 100) - { - pDialog->SetPercentage(percentage); - pDialog->ShowProgressBar(true); - } - else - { - pDialog->ShowProgressBar(false); - } - for (int i = 0; i < 3; i++) - { - if (unicodeLine[i]) - pDialog->SetLine(i,utf8Line[i]); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(isCanceled__doc__, - "iscanceled() -- Returns True if the user pressed cancel.\n" - "\n" - "example:\n" - " - if (pDialog.iscanceled()): return\n"); - - PyObject* Dialog_ProgressIsCanceled(PyObject *self, PyObject *args) - { - bool canceled = false; - CGUIDialogProgress* pDialog= ((DialogProgress*)self)->dlg; - if (PyXBMCWindowIsNull(pDialog)) return NULL; - - PyXBMCGUILock(); - canceled = pDialog->IsCanceled(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", canceled); - } - - PyDoc_STRVAR(close__doc__, - "close() -- Close the progress dialog.\n" - "\n" - "example:\n" - " - pDialog.close()\n"); - - - PyObject* Dialog_ProgressClose(PyObject *self, PyObject *args) - { - CGUIDialogProgress* pDialog= ((DialogProgress*)self)->dlg; - if (PyXBMCWindowIsNull(pDialog)) return NULL; - - { - CPyThreadState state; - pDialog->Close(); - } - - Py_INCREF(Py_None); - return Py_None; - } - - static void Dialog_ProgressDealloc(PyObject *self) - { - CGUIDialogProgress* pDialog= ((DialogProgress*)self)->dlg; - if (pDialog) - { - CPyThreadState state; - pDialog->Close(); - } - - self->ob_type->tp_free((PyObject*)self); - } - - PyMethodDef WindowDialog_methods[] = { - {NULL, NULL, 0, NULL} - }; - - /* xbmc Dialog functions for use in python */ - PyMethodDef Dialog_methods[] = { - {(char*)"yesno", (PyCFunction)Dialog_YesNo, METH_VARARGS, yesno__doc__}, - {(char*)"select", (PyCFunction)Dialog_Select, METH_VARARGS, select__doc__}, - {(char*)"ok", (PyCFunction)Dialog_OK, METH_VARARGS, ok__doc__}, - {(char*)"browse", (PyCFunction)Dialog_Browse, METH_VARARGS, browse__doc__}, - {(char*)"numeric", (PyCFunction)Dialog_Numeric, METH_VARARGS, numeric__doc__}, - {NULL, NULL, 0, NULL} - }; - - /* xbmc progress Dialog functions for use in python */ - PyMethodDef DialogProgress_methods[] = { - {(char*)"create", (PyCFunction)Dialog_ProgressCreate, METH_VARARGS, create__doc__}, - {(char*)"update", (PyCFunction)Dialog_ProgressUpdate, METH_VARARGS, update__doc__}, - {(char*)"close", (PyCFunction)Dialog_ProgressClose, METH_VARARGS, close__doc__}, - {(char*)"iscanceled", (PyCFunction)Dialog_ProgressIsCanceled, METH_VARARGS, isCanceled__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(windowDialog__doc__, - "WindowDialog class.\n"); - - PyDoc_STRVAR(dialog__doc__, - "Dialog class.\n"); - - PyDoc_STRVAR(dialogProgress__doc__, - "DialogProgress class.\n"); - -// Restore code and data sections to normal. - - PyTypeObject WindowDialog_Type; - - void initWindowDialog_Type() - { - PyXBMCInitializeTypeObject(&WindowDialog_Type); - - WindowDialog_Type.tp_name = (char*)"xbmcgui.WindowDialog"; - WindowDialog_Type.tp_basicsize = sizeof(WindowDialog); - WindowDialog_Type.tp_dealloc = (destructor)Window_Dealloc; - WindowDialog_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - WindowDialog_Type.tp_doc = windowDialog__doc__; - WindowDialog_Type.tp_methods = WindowDialog_methods; - WindowDialog_Type.tp_base = &Window_Type; - WindowDialog_Type.tp_new = WindowDialog_New; - } - - PyTypeObject DialogProgress_Type; - - void initDialogProgress_Type() - { - PyXBMCInitializeTypeObject(&DialogProgress_Type); - - DialogProgress_Type.tp_name = (char*)"xbmcgui.DialogProgress"; - DialogProgress_Type.tp_basicsize = sizeof(DialogProgress); - DialogProgress_Type.tp_dealloc = (destructor)Dialog_ProgressDealloc; - DialogProgress_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - DialogProgress_Type.tp_doc = dialogProgress__doc__; - DialogProgress_Type.tp_methods = DialogProgress_methods; - DialogProgress_Type.tp_base = 0; - DialogProgress_Type.tp_new = PyType_GenericNew; - } - - - PyTypeObject Dialog_Type; - - void initDialog_Type() - { - PyXBMCInitializeTypeObject(&Dialog_Type); - - Dialog_Type.tp_name = (char*)"xbmcgui.Dialog"; - Dialog_Type.tp_basicsize = sizeof(Dialog); - Dialog_Type.tp_dealloc = 0; - Dialog_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Dialog_Type.tp_doc = dialog__doc__; - Dialog_Type.tp_methods = Dialog_methods; - Dialog_Type.tp_base = 0; - Dialog_Type.tp_new = PyType_GenericNew; - } -} - -#ifdef __cplusplus -} -#endif - diff --git a/xbmc/interfaces/python/xbmcmodule/dialog.h b/xbmc/interfaces/python/xbmcmodule/dialog.h deleted file mode 100644 index e6d04c8b60..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/dialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "window.h" -#pragma once - - -class CGUIDialogProgress; - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - } Dialog; - - typedef struct { - PyObject_HEAD_XBMC_WINDOW - } WindowDialog; - - struct DialogProgress { - PyObject_HEAD - CGUIDialogProgress* dlg; - - DialogProgress() - { - dlg = 0; - } - }; - - extern PyTypeObject WindowDialog_Type; - extern PyTypeObject DialogProgress_Type; - extern PyTypeObject Dialog_Type; - - void initWindowDialog_Type(); - void initDialogProgress_Type(); - void initDialog_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/infotagmusic.cpp b/xbmc/interfaces/python/xbmcmodule/infotagmusic.cpp deleted file mode 100644 index bf3110b57a..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/infotagmusic.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "infotagmusic.h" -#include "pyutil.h" -#include "../../../utils/StringUtils.h" -#include "../../../settings/AdvancedSettings.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -using namespace MUSIC_INFO; - -namespace PYXBMC -{ - /* - * allocate a new InfoTagMusic. Used for c++ and not the python user - * returns a new reference - */ - InfoTagMusic* InfoTagMusic_FromCMusicInfoTag(const MUSIC_INFO::CMusicInfoTag& infoTag) - { - InfoTagMusic* self = (InfoTagMusic*)InfoTagMusic_Type.tp_alloc(&InfoTagMusic_Type, 0); - if (!self) return NULL; - new(&self->infoTag) MUSIC_INFO::CMusicInfoTag(); - self->infoTag = infoTag; - - return self; - } - - void InfoTagMusic_Dealloc(InfoTagMusic* self) - { - self->infoTag.~CMusicInfoTag(); - self->ob_type->tp_free((PyObject*)self); - } - - // InfoTagMusic_GetURL - PyDoc_STRVAR(getURL__doc__, - "getURL() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetURL(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetURL().c_str()); - } - - // InfoTagMusic_GetTitle - PyDoc_STRVAR(getTitle__doc__, - "getTitle() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetTitle(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetTitle().c_str()); - } - - // InfoTagMusic_GetArtist - PyDoc_STRVAR(getArtist__doc__, - "getArtist() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetArtist(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.GetArtist(), g_advancedSettings.m_musicItemSeparator).c_str()); - } - - // InfoTagMusic_GetAlbumArtist - PyDoc_STRVAR(getAlbumArtist__doc__, - "getAlbumArtist() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetAlbumArtist(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.GetAlbumArtist(), g_advancedSettings.m_musicItemSeparator).c_str()); - } - - // InfoTagMusic_GetAlbum - PyDoc_STRVAR(getAlbum__doc__, - "getAlbum() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetAlbum(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetAlbum().c_str()); - } - - // InfoTagMusic_GetGenre - PyDoc_STRVAR(getGenre__doc__, - "getAlbum() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetGenre(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.GetGenre(), g_advancedSettings.m_musicItemSeparator).c_str()); - } - - // InfoTagMusic_GetDuration - PyDoc_STRVAR(getDuration__doc__, - "getDuration() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetDuration(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetDuration()); - } - - // InfoTagMusic_GetTrack - PyDoc_STRVAR(getTrack__doc__, - "getTrack() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetTrack(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetTrackNumber()); - } - - // InfoTagMusic_GetDisc - PyDoc_STRVAR(getDisc__doc__, - "getDisc() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetDisc(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetDiscNumber()); - } - - // InfoTagMusic_GetTrackAndDisc - PyDoc_STRVAR(getTrackAndDisc__doc__, - "getTrackAndDisc() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetTrackAndDisc(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetTrackAndDiskNumber()); - } - - // InfoTagMusic_ReleaseDate - PyDoc_STRVAR(getReleaseDate__doc__, - "getReleaseDate() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetReleaseDate(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetYearString().c_str()); - } - - // InfoTagMusic_GetListeners - PyDoc_STRVAR(getListeners__doc__, - "getListeners() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetListeners(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetListeners()); - } - - // InfoTagMusic_GetPlayCount - PyDoc_STRVAR(getPlayCount__doc__, - "getPlayCount() -- returns an integer.\n"); - - PyObject* InfoTagMusic_GetPlayCount(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.GetPlayCount()); - } - - // InfoTagMusic_GetLastPlayed - PyDoc_STRVAR(getLastPlayed__doc__, - "getLastPlayed() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetLastPlayed(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetLastPlayed().GetAsLocalizedDate().c_str()); - } - - // InfoTagMusic_GetComment - PyDoc_STRVAR(getComment__doc__, - "getComment() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetComment(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetComment().c_str()); - } - - // InfoTagMusic_GetLyrics - PyDoc_STRVAR(getLyrics__doc__, - "getLyrics() -- returns a string.\n"); - - PyObject* InfoTagMusic_GetLyrics(InfoTagMusic *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetLyrics().c_str()); - } - - PyMethodDef InfoTagMusic_methods[] = { - {(char*)"getURL", (PyCFunction)InfoTagMusic_GetURL, METH_VARARGS, getURL__doc__}, - {(char*)"getTitle", (PyCFunction)InfoTagMusic_GetTitle, METH_VARARGS, getTitle__doc__}, - {(char*)"getAlbum", (PyCFunction)InfoTagMusic_GetAlbum, METH_VARARGS, getAlbum__doc__}, - {(char*)"getArtist", (PyCFunction)InfoTagMusic_GetArtist, METH_VARARGS, getArtist__doc__}, - {(char*)"getAlbumArtist", (PyCFunction)InfoTagMusic_GetAlbumArtist, METH_VARARGS, getAlbumArtist__doc__}, - {(char*)"getGenre", (PyCFunction)InfoTagMusic_GetGenre, METH_VARARGS, getGenre__doc__}, - {(char*)"getDuration", (PyCFunction)InfoTagMusic_GetDuration, METH_VARARGS, getDuration__doc__}, - {(char*)"getTrack", (PyCFunction)InfoTagMusic_GetTrack, METH_VARARGS, getTrack__doc__}, - {(char*)"getDisc", (PyCFunction)InfoTagMusic_GetDisc, METH_VARARGS, getDisc__doc__}, - {(char*)"getTrackAndDisc", (PyCFunction)InfoTagMusic_GetTrackAndDisc, METH_VARARGS, getTrackAndDisc__doc__}, - {(char*)"getReleaseDate", (PyCFunction)InfoTagMusic_GetReleaseDate, METH_VARARGS, getReleaseDate__doc__}, - {(char*)"getListeners", (PyCFunction)InfoTagMusic_GetListeners, METH_VARARGS, getListeners__doc__}, - {(char*)"getPlayCount", (PyCFunction)InfoTagMusic_GetPlayCount, METH_VARARGS, getPlayCount__doc__}, - {(char*)"getLastPlayed", (PyCFunction)InfoTagMusic_GetLastPlayed, METH_VARARGS, getLastPlayed__doc__}, - {(char*)"getComment", (PyCFunction)InfoTagMusic_GetComment, METH_VARARGS, getComment__doc__}, - {(char*)"getLyrics", (PyCFunction)InfoTagMusic_GetLyrics, METH_VARARGS, getLyrics__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(musicInfoTag__doc__, - "InfoTagMusic class.\n" - "\n" - ""); - -// Restore code and data sections to normal. - - PyTypeObject InfoTagMusic_Type; - - void initInfoTagMusic_Type() - { - PyXBMCInitializeTypeObject(&InfoTagMusic_Type); - - InfoTagMusic_Type.tp_name = (char*)"xbmc.InfoTagMusic"; - InfoTagMusic_Type.tp_basicsize = sizeof(InfoTagMusic); - InfoTagMusic_Type.tp_dealloc = (destructor)InfoTagMusic_Dealloc; - InfoTagMusic_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - InfoTagMusic_Type.tp_doc = musicInfoTag__doc__; - InfoTagMusic_Type.tp_methods = InfoTagMusic_methods; - InfoTagMusic_Type.tp_base = 0; - InfoTagMusic_Type.tp_new = 0; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/infotagmusic.h b/xbmc/interfaces/python/xbmcmodule/infotagmusic.h deleted file mode 100644 index 448562bf2c..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/infotagmusic.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "music/tags/MusicInfoTag.h" - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - MUSIC_INFO::CMusicInfoTag infoTag; - } InfoTagMusic; - - extern PyTypeObject InfoTagMusic_Type; - extern InfoTagMusic* InfoTagMusic_FromCMusicInfoTag(const MUSIC_INFO::CMusicInfoTag& infoTag); - - void initInfoTagMusic_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/infotagvideo.cpp b/xbmc/interfaces/python/xbmcmodule/infotagvideo.cpp deleted file mode 100644 index f90bcd4d39..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/infotagvideo.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "infotagvideo.h" -#include "pyutil.h" -#include "settings/AdvancedSettings.h" -#include "utils/StringUtils.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - /* - * allocate a new InfoTagVideo. Used for c++ and not the python user - * returns a new reference - */ - InfoTagVideo* InfoTagVideo_FromCVideoInfoTag(const CVideoInfoTag& infoTag) - { - InfoTagVideo* self = (InfoTagVideo*)InfoTagVideo_Type.tp_alloc(&InfoTagVideo_Type, 0); - if (!self) return NULL; - new(&self->infoTag) CVideoInfoTag(); - self->infoTag = infoTag; - - return self; - } - - void InfoTagVideo_Dealloc(InfoTagVideo* self) - { - self->infoTag.~CVideoInfoTag(); - self->ob_type->tp_free((PyObject*)self); - } - - // InfoTagVideo_GetDirector - PyDoc_STRVAR(getDirector__doc__, - "getDirector() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetDirector(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.m_director, g_advancedSettings.m_videoItemSeparator).c_str()); - } - - // InfoTagVideo_GetWritingCredits - PyDoc_STRVAR(getWritingCredits__doc__, - "getWritingCredits() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetWritingCredits(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.m_writingCredits, g_advancedSettings.m_videoItemSeparator).c_str()); - } - - // InfoTagVideo_GetGenre - PyDoc_STRVAR(getGenre__doc__, - "getGenre() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetGenre(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", StringUtils::Join(self->infoTag.m_genre, g_advancedSettings.m_videoItemSeparator).c_str()); - } - - // InfoTagVideo_GetTagLine - PyDoc_STRVAR(getTagLine__doc__, - "getTagLine() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetTagLine(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strTagLine.c_str()); - } - - // InfoTagVideo_GetPlotOutline - PyDoc_STRVAR(getPlotOutline__doc__, - "getPlotOutline() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetPlotOutline(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strPlotOutline.c_str()); - } - - // InfoTagVideo_GetPlot - PyDoc_STRVAR(getPlot__doc__, - "getPlot() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetPlot(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strPlot.c_str()); - } - - // InfoTagVideo_GetPictureURL - PyDoc_STRVAR(getPictureURL__doc__, - "getPictureURL() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetPictureURL(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strPictureURL.GetFirstThumb().m_url.c_str()); - } - - // InfoTagVideo_GetTitle - PyDoc_STRVAR(getTitle__doc__, - "getTitle() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetTitle(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strTitle.c_str()); - } - - // InfoTagVideo_GetOriginalTitle - PyDoc_STRVAR(getOriginalTitle__doc__, - "getOriginalTitle() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetOriginalTitle(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strOriginalTitle.c_str()); - } - - // InfoTagVideo_GetVotes - PyDoc_STRVAR(getVotes__doc__, - "getVotes() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetVotes(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strVotes.c_str()); - } - - // InfoTagVideo_GetCast - PyDoc_STRVAR(getCast__doc__, - "getCast() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetCast(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.GetCast(true).c_str()); - } - - // InfoTagVideo_GetFile - PyDoc_STRVAR(getFile__doc__, - "getFile() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetFile(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strFile.c_str()); - } - - // InfoTagVideo_GetPath - PyDoc_STRVAR(getPath__doc__, - "getPath() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetPath(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strPath.c_str()); - } - - // InfoTagVideo_GetIMDBNumber - PyDoc_STRVAR(getIMDBNumber__doc__, - "getIMDBNumber() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetIMDBNumber(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_strIMDBNumber.c_str()); - } - - // InfoTagVideo_GetYear - PyDoc_STRVAR(getYear__doc__, - "getYear() -- returns a integer.\n"); - - PyObject* InfoTagVideo_GetYear(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.m_iYear); - } - - // InfoTagVideo_GetPremiered - PyDoc_STRVAR(getPremiered__doc__, - "getPremiered() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetPremiered(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_premiered.GetAsLocalizedDate().c_str()); - } - - // InfoTagVideo_GetFirstAired - PyDoc_STRVAR(getFirstAired__doc__, - "getFirstAired() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetFirstAired(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_firstAired.GetAsLocalizedDate().c_str()); - } - - // InfoTagVideo_GetRating - PyDoc_STRVAR(getRating__doc__, - "getRating() -- returns a float.\n"); - - PyObject* InfoTagVideo_GetRating(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"f", self->infoTag.m_fRating); - } - - // InfoTagVideo_GetPlayCount - PyDoc_STRVAR(getPlayCount__doc__, - "getPlayCount() -- returns a integer.\n"); - - PyObject* InfoTagVideo_GetPlayCount(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"i", self->infoTag.m_playCount); - } - - // InfoTagVideo_GetLastPlayed - PyDoc_STRVAR(getLastPlayed__doc__, - "getLastPlayed() -- returns a string.\n"); - - PyObject* InfoTagVideo_GetLastPlayed(InfoTagVideo *self, PyObject *args) - { - return Py_BuildValue((char*)"s", self->infoTag.m_lastPlayed.GetAsLocalizedDateTime().c_str()); - } - - PyMethodDef InfoTagVideo_methods[] = { - {(char*)"getDirector", (PyCFunction)InfoTagVideo_GetDirector, METH_VARARGS, getDirector__doc__}, - {(char*)"getWritingCredits", (PyCFunction)InfoTagVideo_GetWritingCredits, METH_VARARGS, getWritingCredits__doc__}, - {(char*)"getGenre", (PyCFunction)InfoTagVideo_GetGenre, METH_VARARGS, getGenre__doc__}, - {(char*)"getTagLine", (PyCFunction)InfoTagVideo_GetTagLine, METH_VARARGS, getTagLine__doc__}, - {(char*)"getPlotOutline", (PyCFunction)InfoTagVideo_GetPlotOutline, METH_VARARGS, getPlotOutline__doc__}, - {(char*)"getPlot", (PyCFunction)InfoTagVideo_GetPlot, METH_VARARGS, getPlot__doc__}, - {(char*)"getPictureURL", (PyCFunction)InfoTagVideo_GetPictureURL, METH_VARARGS, getPictureURL__doc__}, - {(char*)"getTitle", (PyCFunction)InfoTagVideo_GetTitle, METH_VARARGS, getTitle__doc__}, - {(char*)"getOriginalTitle", (PyCFunction)InfoTagVideo_GetOriginalTitle, METH_VARARGS, getOriginalTitle__doc__}, - {(char*)"getVotes", (PyCFunction)InfoTagVideo_GetVotes, METH_VARARGS, getVotes__doc__}, - {(char*)"getCast", (PyCFunction)InfoTagVideo_GetCast, METH_VARARGS, getCast__doc__}, - {(char*)"getFile", (PyCFunction)InfoTagVideo_GetFile, METH_VARARGS, getFile__doc__}, - {(char*)"getPath", (PyCFunction)InfoTagVideo_GetPath, METH_VARARGS, getPath__doc__}, - {(char*)"getIMDBNumber", (PyCFunction)InfoTagVideo_GetIMDBNumber, METH_VARARGS, getIMDBNumber__doc__}, - {(char*)"getYear", (PyCFunction)InfoTagVideo_GetYear, METH_VARARGS, getYear__doc__}, - {(char*)"getPremiered", (PyCFunction)InfoTagVideo_GetPremiered, METH_VARARGS, getPremiered__doc__}, - {(char*)"getFirstAired", (PyCFunction)InfoTagVideo_GetFirstAired, METH_VARARGS, getFirstAired__doc__}, - {(char*)"getRating", (PyCFunction)InfoTagVideo_GetRating, METH_VARARGS, getRating__doc__}, - {(char*)"getPlayCount", (PyCFunction)InfoTagVideo_GetPlayCount, METH_VARARGS, getPlayCount__doc__}, - {(char*)"getLastPlayed", (PyCFunction)InfoTagVideo_GetLastPlayed, METH_VARARGS, getLastPlayed__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(videoInfoTag__doc__, - "InfoTagVideo class.\n" - "\n" - ""); - -// Restore code and data sections to normal. - - PyTypeObject InfoTagVideo_Type; - - void initInfoTagVideo_Type() - { - PyXBMCInitializeTypeObject(&InfoTagVideo_Type); - - InfoTagVideo_Type.tp_name = (char*)"xbmc.InfoTagVideo"; - InfoTagVideo_Type.tp_basicsize = sizeof(InfoTagVideo); - InfoTagVideo_Type.tp_dealloc = (destructor)InfoTagVideo_Dealloc; - InfoTagVideo_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - InfoTagVideo_Type.tp_doc = videoInfoTag__doc__; - InfoTagVideo_Type.tp_methods = InfoTagVideo_methods; - InfoTagVideo_Type.tp_base = 0; - InfoTagVideo_Type.tp_new = 0; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/keyboard.cpp b/xbmc/interfaces/python/xbmcmodule/keyboard.cpp deleted file mode 100644 index 83b3c1ec8f..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/keyboard.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "keyboard.h" -#include "pythreadstate.h" -#include "pyutil.h" -#include "guilib/GUIWindowManager.h" -#include "dialogs/GUIDialogKeyboardGeneric.h" -#include "ApplicationMessenger.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* Keyboard_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Keyboard *self; - - self = (Keyboard*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->strDefault) string(); - new(&self->strHeading) string(); - - PyObject *line = NULL; - PyObject *heading = NULL; - char bHidden = false; - if (!PyArg_ParseTuple(args, (char*)"|OOb", &line, &heading, &bHidden)) return NULL; - - string utf8Line; - if (line && !PyXBMCGetUnicodeString(utf8Line, line, 1)) return NULL; - string utf8Heading; - if (heading && !PyXBMCGetUnicodeString(utf8Heading, heading, 2)) return NULL; - - self->strDefault = utf8Line; - self->strHeading = utf8Heading; - self->bHidden = (0 != bHidden); - PyXBMCGUILock(); - self->dlg = (CGUIDialogKeyboardGeneric*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD); - PyXBMCGUIUnlock(); - - return (PyObject*)self; - } - - void Keyboard_Dealloc(Keyboard* self) - { - self->strDefault.~string(); - self->strHeading.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - // doModal() Method - PyDoc_STRVAR(doModal__doc__, - "doModal([autoclose]) -- Show keyboard and wait for user action.\n" - "\n" - "autoclose : [opt] integer - milliseconds to autoclose dialog. (default=do not autoclose)\n" - "\n" - "example:\n" - " - kb.doModal(30000)"); - - PyObject* Keyboard_DoModal(Keyboard *self, PyObject *args) - { - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load virtual keyboard"); - return NULL; - } - int autoClose = 0; - - if (!PyArg_ParseTuple(args, (char*)"|i", &autoClose)) return NULL; - - PyXBMCGUILock(); - pKeyboard->Initialize(); - pKeyboard->SetHeading(self->strHeading); - CStdString strDefault(self->strDefault); - pKeyboard->SetText(strDefault); - pKeyboard->SetHiddenInput(self->bHidden); - if (autoClose > 0) - pKeyboard->SetAutoClose(autoClose); - - // do modal of dialog - PyXBMCGUIUnlock(); - PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_KEYBOARD, g_windowManager.GetActiveWindow()); - - Py_INCREF(Py_None); - return Py_None; - } - - // setDefault() Method - PyDoc_STRVAR(setDefault__doc__, - "setDefault(default) -- Set the default text entry.\n" - "\n" - "default : string - default text entry.\n" - "\n" - "example:\n" - " - kb.setDefault('password')"); - - PyObject* Keyboard_SetDefault(Keyboard *self, PyObject *args) - { - PyObject *line = NULL; - if (!PyArg_ParseTuple(args, (char*)"|O", &line)) return NULL; - - string utf8Line; - if (line && !PyXBMCGetUnicodeString(utf8Line, line, 1)) return NULL; - self->strDefault = utf8Line; - - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); - return NULL; - } - - CStdString strDefault(self->strDefault); - PyXBMCGUILock(); - pKeyboard->SetText(strDefault); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setHiddenInput() Method - PyDoc_STRVAR(setHiddenInput__doc__, - "setHiddenInput(hidden) -- Allows hidden text entry.\n" - "\n" - "hidden : boolean - True for hidden text entry.\n" - "example:\n" - " - kb.setHiddenInput(True)"); - - PyObject* Keyboard_SetHiddenInput(Keyboard *self, PyObject *args) - { - char bHidden = false; - if (!PyArg_ParseTuple(args, (char*)"|b", &bHidden)) return NULL; - self->bHidden = (0 != bHidden); - - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); - return NULL; - } - - PyXBMCGUILock(); - pKeyboard->SetHiddenInput(self->bHidden); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setHeading() Method - PyDoc_STRVAR(setHeading__doc__, - "setHeading(heading) -- Set the keyboard heading.\n" - "\n" - "heading : string - keyboard heading.\n" - "\n" - "example:\n" - " - kb.setHeading('Enter password')"); - - PyObject* Keyboard_SetHeading(Keyboard *self, PyObject *args) - { - PyObject *line = NULL; - if (!PyArg_ParseTuple(args, (char*)"|O", &line)) return NULL; - - string utf8Line; - if (line && !PyXBMCGetUnicodeString(utf8Line, line, 1)) return NULL; - self->strHeading = utf8Line; - - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); - return NULL; - } - - PyXBMCGUILock(); - pKeyboard->SetHeading(self->strHeading); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // getText() Method - PyDoc_STRVAR(getText__doc__, - "getText() -- Returns the user input as a string.\n" - "\n" - "*Note, This will always return the text entry even if you cancel the keyboard.\n" - " Use the isConfirmed() method to check if user cancelled the keyboard.\n" - "\n" - "example:\n" - " - text = kb.getText()"); - - PyObject* Keyboard_GetText(Keyboard *self, PyObject *args) - { - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); - return NULL; - } - - PyXBMCGUILock(); - CStdString result = pKeyboard->GetText(); - PyXBMCGUIUnlock(); - return Py_BuildValue((char*)"s", result.c_str()); - } - - // isConfirmed() Method - PyDoc_STRVAR(isConfirmed__doc__, - "isConfirmed() -- Returns False if the user cancelled the input.\n" - "\n" - "example:\n" - " - if (kb.isConfirmed()):"); - - PyObject* Keyboard_IsConfirmed(Keyboard *self, PyObject *args) - { - CGUIDialogKeyboardGeneric *pKeyboard = ((Keyboard*)self)->dlg; - if(!pKeyboard) - { - PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); - return NULL; - } - - PyXBMCGUILock(); - bool result = pKeyboard->IsConfirmed(); - PyXBMCGUIUnlock(); - return Py_BuildValue((char*)"b", result); - } - - PyMethodDef Keyboard_methods[] = { - {(char*)"doModal", (PyCFunction)Keyboard_DoModal, METH_VARARGS, doModal__doc__}, - {(char*)"setDefault", (PyCFunction)Keyboard_SetDefault, METH_VARARGS, setDefault__doc__}, - {(char*)"setHeading", (PyCFunction)Keyboard_SetHeading, METH_VARARGS, setHeading__doc__}, - {(char*)"setHiddenInput", (PyCFunction)Keyboard_SetHiddenInput, METH_VARARGS, setHiddenInput__doc__}, - {(char*)"getText", (PyCFunction)Keyboard_GetText, METH_VARARGS, getText__doc__}, - {(char*)"isConfirmed", (PyCFunction)Keyboard_IsConfirmed, METH_VARARGS, isConfirmed__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(keyboard__doc__, - "Keyboard class.\n" - "\n" - "Keyboard([default, heading, hidden]) -- Creates a new Keyboard object with default text\n" - " heading and hidden input flag if supplied.\n" - "\n" - "default : [opt] string - default text entry.\n" - "heading : [opt] string - keyboard heading.\n" - "hidden : [opt] boolean - True for hidden text entry.\n" - "\n" - "example:\n" - " - kb = xbmc.Keyboard('default', 'heading', True)\n" - " - kb.setDefault('password') # optional\n" - " - kb.setHeading('Enter password') # optional\n" - " - kb.setHiddenInput(True) # optional\n" - " - kb.doModal()\n" - " - if (kb.isConfirmed()):\n" - " - text = kb.getText()"); - -// Restore code and data sections to normal. - - PyTypeObject Keyboard_Type; - - void initKeyboard_Type() - { - PyXBMCInitializeTypeObject(&Keyboard_Type); - - Keyboard_Type.tp_name = (char*)"xbmc.Keyboard"; - Keyboard_Type.tp_basicsize = sizeof(Keyboard); - Keyboard_Type.tp_dealloc = (destructor)Keyboard_Dealloc; - Keyboard_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Keyboard_Type.tp_doc = keyboard__doc__; - Keyboard_Type.tp_methods = Keyboard_methods; - Keyboard_Type.tp_base = 0; - Keyboard_Type.tp_new = Keyboard_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/keyboard.h b/xbmc/interfaces/python/xbmcmodule/keyboard.h deleted file mode 100644 index 4b2f40d12a..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/keyboard.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include <string> -#pragma once - -class CGUIDialogKeyboardGeneric; - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - std::string strDefault; - std::string strHeading; - bool bHidden; - CGUIDialogKeyboardGeneric* dlg; - } Keyboard; - - extern PyTypeObject Keyboard_Type; - void initKeyboard_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/listitem.cpp b/xbmc/interfaces/python/xbmcmodule/listitem.cpp deleted file mode 100644 index 5aa7363ce1..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/listitem.cpp +++ /dev/null @@ -1,1050 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "listitem.h" -#include "pyutil.h" -#include "video/VideoInfoTag.h" -#include "pictures/PictureInfoTag.h" -#include "music/tags/MusicInfoTag.h" -#include "FileItem.h" -#include "utils/Variant.h" -#include "settings/AdvancedSettings.h" -#include "utils/StringUtils.h" - -using namespace std; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* ListItem_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - ListItem *self; - static const char *keywords[] = { "label", "label2", - "iconImage", "thumbnailImage", "path", NULL }; - - PyObject* label = NULL; - PyObject* label2 = NULL; - PyObject* iconImage = NULL; - PyObject* thumbnailImage = NULL; - PyObject* path = NULL; - - // allocate new object - self = (ListItem*)type->tp_alloc(type, 0); - if (!self) - return NULL; - - self->item.reset(); - - // parse user input - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"|OOOOO", - (char**)keywords, - &label, - &label2, - &iconImage, - &thumbnailImage, - &path)) - { - Py_DECREF( self ); - return NULL; - } - - // create CFileItem - self->item.reset(new CFileItem()); - if (!self->item) - { - Py_DECREF( self ); - return NULL; - } - CStdString utf8String; - if (label && PyXBMCGetUnicodeString(utf8String, label, 1)) - { - self->item->SetLabel( utf8String ); - } - if (label2 && PyXBMCGetUnicodeString(utf8String, label2, 1)) - { - self->item->SetLabel2( utf8String ); - } - if (iconImage && PyXBMCGetUnicodeString(utf8String, iconImage, 1)) - { - self->item->SetIconImage( utf8String ); - } - if (thumbnailImage && PyXBMCGetUnicodeString(utf8String, thumbnailImage, 1)) - { - self->item->SetThumbnailImage( utf8String ); - } - if (path && PyXBMCGetUnicodeString(utf8String, path, 1)) - { - self->item->SetPath(utf8String); - } - return (PyObject*)self; - } - - /* - * allocate a new listitem. Used for c++ and not the python user - * returns a new reference - */ - ListItem* ListItem_FromString(string strLabel) - { - ListItem* self = (ListItem*)ListItem_Type.tp_alloc(&ListItem_Type, 0); - if (!self) return NULL; - - self->item.reset(new CFileItem(strLabel)); - if (!self->item) - { - Py_DECREF( self ); - return NULL; - } - - return self; - } - - void ListItem_Dealloc(ListItem* self) - { - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(getLabel__doc__, - "getLabel() -- Returns the listitem label.\n" - "\n" - "example:\n" - " - label = self.list.getSelectedItem().getLabel()\n"); - - PyObject* ListItem_GetLabel(ListItem *self, PyObject *args) - { - if (!self->item) return NULL; - - PyXBMCGUILock(); - const char *cLabel = self->item->GetLabel().c_str(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"s", cLabel); - } - - PyDoc_STRVAR(getLabel2__doc__, - "getLabel2() -- Returns the listitem's second label.\n" - "\n" - "example:\n" - " - label2 = self.list.getSelectedItem().getLabel2()\n"); - - PyObject* ListItem_GetLabel2(ListItem *self, PyObject *args) - { - if (!self->item) return NULL; - - PyXBMCGUILock(); - const char *cLabel = self->item->GetLabel2().c_str(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"s", cLabel); - } - - PyDoc_STRVAR(setLabel__doc__, - "setLabel(label) -- Sets the listitem's label.\n" - "\n" - "label : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setLabel('Casino Royale')\n"); - - PyObject* ListItem_SetLabel(ListItem *self, PyObject *args) - { - if (!self->item) return NULL; - PyObject* unicodeLine = NULL; - - if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL; - - string utf8Line; - if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1)) - return NULL; - // set label - PyXBMCGUILock(); - self->item->SetLabel(utf8Line); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setLabel2__doc__, - "setLabel2(label2) -- Sets the listitem's second label.\n" - "\n" - "label2 : string or unicode - text string.\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setLabel2('[pg-13]')\n"); - - PyObject* ListItem_SetLabel2(ListItem *self, PyObject *args) - { - PyObject* unicodeLine = NULL; - if (!self->item) return NULL; - - if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL; - - string utf8Line; - if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1)) - return NULL; - // set label - PyXBMCGUILock(); - self->item->SetLabel2(utf8Line); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setIconImage__doc__, - "setIconImage(icon) -- Sets the listitem's icon image.\n" - "\n" - "icon : string or unicode - image filename.\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setIconImage('emailread.png')\n"); - - PyObject* ListItem_SetIconImage(ListItem *self, PyObject *args) - { - PyObject* unicodeLine = NULL; - if (!self->item) return NULL; - - if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL; - - string utf8Line; - if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1)) - return NULL; - - // set label - PyXBMCGUILock(); - self->item->SetIconImage(utf8Line); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setThumbnailImage__doc__, - "setThumbnailImage(thumb) -- Sets the listitem's thumbnail image.\n" - "\n" - "thumb : string or unicode - image filename.\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setThumbnailImage('emailread.png')\n"); - - PyObject* ListItem_SetThumbnailImage(ListItem *self, PyObject *args) - { - PyObject* unicodeLine = NULL; - if (!self->item) return NULL; - - if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL; - - string utf8Line; - if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1)) - return NULL; - - // set label - PyXBMCGUILock(); - self->item->SetThumbnailImage(utf8Line); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(select__doc__, - "select(selected) -- Sets the listitem's selected status.\n" - "\n" - "selected : bool - True=selected/False=not selected\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().select(True)\n"); - - PyObject* ListItem_Select(ListItem *self, PyObject *args) - { - if (!self->item) return NULL; - - char bOnOff = false; - if (!PyArg_ParseTuple(args, (char*)"b", &bOnOff)) return NULL; - - PyXBMCGUILock(); - self->item->Select(0 != bOnOff); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(isSelected__doc__, - "isSelected() -- Returns the listitem's selected status.\n" - "\n" - "example:\n" - " - is = self.list.getSelectedItem().isSelected()\n"); - - PyObject* ListItem_IsSelected(ListItem *self, PyObject *args) - { - if (!self->item) return NULL; - - PyXBMCGUILock(); - bool bOnOff = self->item->IsSelected(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"b", bOnOff); - } - - PyDoc_STRVAR(setInfo__doc__, - "setInfo(type, infoLabels) -- Sets the listitem's infoLabels.\n" - "\n" - "type : string - type of media(video/music/pictures).\n" - "infoLabels : dictionary - pairs of { label: value }.\n" - "\n" - "*Note, To set pictures exif info, prepend 'exif:' to the label. Exif values must be passed\n" - " as strings, separate value pairs with a comma. (eg. {'exif:resolution': '720,480'}\n" - " See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings.\n" - "\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "General Values that apply to all types:\n" - " count : integer (12) - can be used to store an id for later, or for sorting purposes\n" - " size : long (1024) - size in bytes\n" - " date : string (%d.%m.%Y / 01.01.2009) - file date\n" - "\n" - "Video Values:\n" - " genre : string (Comedy)\n" - " year : integer (2009)\n" - " episode : integer (4)\n" - " season : integer (1)\n" - " top250 : integer (192)\n" - " tracknumber : integer (3)\n" - " rating : float (6.4) - range is 0..10\n" - " watched : depreciated - use playcount instead\n" - " playcount : integer (2) - number of times this item has been played\n" - " overlay : integer (2) - range is 0..8. See GUIListItem.h for values\n" - " cast : list (Michal C. Hall)\n" - " castandrole : list (Michael C. Hall|Dexter)\n" - " director : string (Dagur Kari)\n" - " mpaa : string (PG-13)\n" - " plot : string (Long Description)\n" - " plotoutline : string (Short Description)\n" - " title : string (Big Fan)\n" - " originaltitle : string (Big Fan)\n" - " sorttitle : string (Big Fan)\n" - " duration : string (3:18)\n" - " studio : string (Warner Bros.)\n" - " tagline : string (An awesome movie) - short description of movie\n" - " writer : string (Robert D. Siegel)\n" - " tvshowtitle : string (Heroes)\n" - " premiered : string (2005-03-04)\n" - " status : string (Continuing) - status of a TVshow\n" - " code : string (tt0110293) - IMDb code\n" - " aired : string (2008-12-07)\n" - " credits : string (Andy Kaufman) - writing credits\n" - " lastplayed : string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)\n" - " album : string (The Joshua Tree)\n" - " artist : list (['U2'])\n" - " votes : string (12345 votes)\n" - " trailer : string (/home/user/trailer.avi)\n" - " dateadded : string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)\n" - "\n" - "Music Values:\n" - " tracknumber : integer (8)\n" - " duration : integer (245) - duration in seconds\n" - " year : integer (1998)\n" - " genre : string (Rock)\n" - " album : string (Pulse)\n" - " artist : string (Muse)\n" - " title : string (American Pie)\n" - " rating : string (3) - single character between 0 and 5\n" - " lyrics : string (On a dark desert highway...)\n" - " playcount : integer (2) - number of times this item has been played\n" - " lastplayed : string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)\n" - "\n" - "Picture Values:\n" - " title : string (In the last summer-1)\n" - " picturepath : string (/home/username/pictures/img001.jpg)\n" - " exif* : string (See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings)\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setInfo('video', { 'Genre': 'Comedy' })\n"); - - PyObject* ListItem_SetInfo(ListItem *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "type", "infoLabels", NULL }; - char *cType = NULL; - PyObject *pInfoLabels = NULL; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &cType, - &pInfoLabels)) - { - return NULL; - } - if (!PyObject_TypeCheck(pInfoLabels, &PyDict_Type)) - { - PyErr_SetString(PyExc_TypeError, "infoLabels object should be of type Dict"); - return NULL; - } - if (PyDict_Size(pInfoLabels) == 0) - { - PyErr_SetString(PyExc_ValueError, "Empty InfoLabel dictionary"); - return NULL; - } - - PyObject *key, *value; - Py_ssize_t pos = 0; - - PyXBMCGUILock(); - - CStdString tmp; - while (PyDict_Next(pInfoLabels, &pos, &key, &value)) { - if (strcmpi(cType, "video") == 0) - { - if (strcmpi(PyString_AsString(key), "year") == 0) - self->item->GetVideoInfoTag()->m_iYear = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "episode") == 0) - self->item->GetVideoInfoTag()->m_iEpisode = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "season") == 0) - self->item->GetVideoInfoTag()->m_iSeason = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "top250") == 0) - self->item->GetVideoInfoTag()->m_iTop250 = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "tracknumber") == 0) - self->item->GetVideoInfoTag()->m_iTrack = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "count") == 0) - self->item->m_iprogramCount = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "rating") == 0) - self->item->GetVideoInfoTag()->m_fRating = (float)PyFloat_AsDouble(value); - else if (strcmpi(PyString_AsString(key), "size") == 0) - self->item->m_dwSize = (int64_t)PyLong_AsLongLong(value); - else if (strcmpi(PyString_AsString(key), "watched") == 0) // backward compat - do we need it? - self->item->GetVideoInfoTag()->m_playCount = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "playcount") == 0) - self->item->GetVideoInfoTag()->m_playCount = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "overlay") == 0) - { - long overlay = PyInt_AsLong(value); - if (overlay >= 0 && overlay <= 8) - self->item->SetOverlayImage((CGUIListItem::GUIIconOverlay)overlay); - } - else if (strcmpi(PyString_AsString(key), "cast") == 0 || strcmpi(PyString_AsString(key), "castandrole") == 0) - { - if (!PyObject_TypeCheck(value, &PyList_Type)) continue; - self->item->GetVideoInfoTag()->m_cast.clear(); - for (int i = 0; i < PyList_Size(value); i++) - { - PyObject *pTuple = NULL; - pTuple = PyList_GetItem(value, i); - if (pTuple == NULL) continue; - PyObject *pActor = NULL; - PyObject *pRole = NULL; - if (PyObject_TypeCheck(pTuple, &PyTuple_Type)) - { - if (!PyArg_ParseTuple(pTuple, (char*)"O|O", &pActor, &pRole)) continue; - } - else - pActor = pTuple; - SActorInfo info; - if (!PyXBMCGetUnicodeString(info.strName, pActor, 1)) continue; - if (pRole != NULL) - PyXBMCGetUnicodeString(info.strRole, pRole, 1); - self->item->GetVideoInfoTag()->m_cast.push_back(info); - } - } - else if (strcmpi(PyString_AsString(key), "artist") == 0) - { - if (!PyObject_TypeCheck(value, &PyList_Type)) continue; - self->item->GetVideoInfoTag()->m_artist.clear(); - for (int i = 0; i < PyList_Size(value); i++) - { - PyObject *pActor = PyList_GetItem(value, i); - if (pActor == NULL) continue; - CStdString actor; - if (!PyXBMCGetUnicodeString(actor, pActor, 1)) continue; - self->item->GetVideoInfoTag()->m_artist.push_back(actor); - } - } - else - { - if (!PyXBMCGetUnicodeString(tmp, value, 1)) continue; - if (strcmpi(PyString_AsString(key), "genre") == 0) - self->item->GetVideoInfoTag()->m_genre = StringUtils::Split(tmp, g_advancedSettings.m_videoItemSeparator); - else if (strcmpi(PyString_AsString(key), "director") == 0) - self->item->GetVideoInfoTag()->m_director = StringUtils::Split(tmp, g_advancedSettings.m_videoItemSeparator); - else if (strcmpi(PyString_AsString(key), "mpaa") == 0) - self->item->GetVideoInfoTag()->m_strMPAARating = tmp; - else if (strcmpi(PyString_AsString(key), "plot") == 0) - self->item->GetVideoInfoTag()->m_strPlot = tmp; - else if (strcmpi(PyString_AsString(key), "plotoutline") == 0) - self->item->GetVideoInfoTag()->m_strPlotOutline = tmp; - else if (strcmpi(PyString_AsString(key), "title") == 0) - self->item->GetVideoInfoTag()->m_strTitle = tmp; - else if (strcmpi(PyString_AsString(key), "originaltitle") == 0) - self->item->GetVideoInfoTag()->m_strOriginalTitle = tmp; - else if (strcmpi(PyString_AsString(key), "sorttitle") == 0) - self->item->GetVideoInfoTag()->m_strSortTitle = tmp; - else if (strcmpi(PyString_AsString(key), "duration") == 0) - self->item->GetVideoInfoTag()->m_strRuntime = tmp; - else if (strcmpi(PyString_AsString(key), "studio") == 0) - self->item->GetVideoInfoTag()->m_studio = StringUtils::Split(tmp, g_advancedSettings.m_videoItemSeparator); - else if (strcmpi(PyString_AsString(key), "tagline") == 0) - self->item->GetVideoInfoTag()->m_strTagLine = tmp; - else if (strcmpi(PyString_AsString(key), "writer") == 0) - self->item->GetVideoInfoTag()->m_writingCredits = StringUtils::Split(tmp, g_advancedSettings.m_videoItemSeparator); - else if (strcmpi(PyString_AsString(key), "tvshowtitle") == 0) - self->item->GetVideoInfoTag()->m_strShowTitle = tmp; - else if (strcmpi(PyString_AsString(key), "premiered") == 0) - self->item->GetVideoInfoTag()->m_premiered.SetFromDateString(tmp); - else if (strcmpi(PyString_AsString(key), "status") == 0) - self->item->GetVideoInfoTag()->m_strStatus = tmp; - else if (strcmpi(PyString_AsString(key), "code") == 0) - self->item->GetVideoInfoTag()->m_strProductionCode = tmp; - else if (strcmpi(PyString_AsString(key), "aired") == 0) - self->item->GetVideoInfoTag()->m_firstAired.SetFromDateString(tmp); - else if (strcmpi(PyString_AsString(key), "credits") == 0) - self->item->GetVideoInfoTag()->m_writingCredits = StringUtils::Split(tmp, g_advancedSettings.m_videoItemSeparator); - else if (strcmpi(PyString_AsString(key), "lastplayed") == 0) - self->item->GetVideoInfoTag()->m_lastPlayed.SetFromDBDateTime(tmp); - else if (strcmpi(PyString_AsString(key), "album") == 0) - self->item->GetVideoInfoTag()->m_strAlbum = tmp; - else if (strcmpi(PyString_AsString(key), "votes") == 0) - self->item->GetVideoInfoTag()->m_strVotes = tmp; - else if (strcmpi(PyString_AsString(key), "trailer") == 0) - self->item->GetVideoInfoTag()->m_strTrailer = tmp; - else if (strcmpi(PyString_AsString(key), "date") == 0) - { - if (strlen(tmp) == 10) - self->item->m_dateTime.SetDate(atoi(tmp.Right(4).c_str()), atoi(tmp.Mid(3,4).c_str()), atoi(tmp.Left(2).c_str())); - } - else if (strcmpi(PyString_AsString(key), "dateadded") == 0) - self->item->GetVideoInfoTag()->m_dateAdded.SetFromDBDateTime(tmp); - } - } - else if (strcmpi(cType, "music") == 0) - { - if (strcmpi(PyString_AsString(key), "tracknumber") == 0) - self->item->GetMusicInfoTag()->SetTrackNumber(PyInt_AsLong(value)); - else if (strcmpi(PyString_AsString(key), "count") == 0) - self->item->m_iprogramCount = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "size") == 0) - self->item->m_dwSize = (int64_t)PyLong_AsLongLong(value); - else if (strcmpi(PyString_AsString(key), "duration") == 0) - self->item->GetMusicInfoTag()->SetDuration(PyInt_AsLong(value)); - else if (strcmpi(PyString_AsString(key), "year") == 0) - self->item->GetMusicInfoTag()->SetYear(PyInt_AsLong(value)); - else if (strcmpi(PyString_AsString(key), "listeners") == 0) - self->item->GetMusicInfoTag()->SetListeners(PyInt_AsLong(value)); - else if (strcmpi(PyString_AsString(key), "playcount") == 0) - self->item->GetMusicInfoTag()->SetPlayCount(PyInt_AsLong(value)); - else - { - if (!PyXBMCGetUnicodeString(tmp, value, 1)) continue; - if (strcmpi(PyString_AsString(key), "genre") == 0) - self->item->GetMusicInfoTag()->SetGenre(tmp); - else if (strcmpi(PyString_AsString(key), "album") == 0) - self->item->GetMusicInfoTag()->SetAlbum(tmp); - else if (strcmpi(PyString_AsString(key), "artist") == 0) - self->item->GetMusicInfoTag()->SetArtist(tmp); - else if (strcmpi(PyString_AsString(key), "title") == 0) - self->item->GetMusicInfoTag()->SetTitle(tmp); - else if (strcmpi(PyString_AsString(key), "rating") == 0) - self->item->GetMusicInfoTag()->SetRating(*tmp); - else if (strcmpi(PyString_AsString(key), "lyrics") == 0) - self->item->GetMusicInfoTag()->SetLyrics(tmp); - else if (strcmpi(PyString_AsString(key), "lastplayed") == 0) - self->item->GetMusicInfoTag()->SetLastPlayed(tmp); - else if (strcmpi(PyString_AsString(key), "musicbrainztrackid") == 0) - self->item->GetMusicInfoTag()->SetMusicBrainzTrackID(tmp); - else if (strcmpi(PyString_AsString(key), "musicbrainzartistid") == 0) - self->item->GetMusicInfoTag()->SetMusicBrainzArtistID(tmp); - else if (strcmpi(PyString_AsString(key), "musicbrainzalbumid") == 0) - self->item->GetMusicInfoTag()->SetMusicBrainzAlbumID(tmp); - else if (strcmpi(PyString_AsString(key), "musicbrainzalbumartistid") == 0) - self->item->GetMusicInfoTag()->SetMusicBrainzAlbumArtistID(tmp); - else if (strcmpi(PyString_AsString(key), "musicbrainztrmid") == 0) - self->item->GetMusicInfoTag()->SetMusicBrainzTRMID(tmp); - else if (strcmpi(PyString_AsString(key), "comment") == 0) - self->item->GetMusicInfoTag()->SetComment(tmp); - else if (strcmpi(PyString_AsString(key), "date") == 0) - { - if (strlen(tmp) == 10) - self->item->m_dateTime.SetDate(atoi(tmp.Right(4)), atoi(tmp.Mid(3,4)), atoi(tmp.Left(2))); - } - } - self->item->GetMusicInfoTag()->SetLoaded(true); - } - else if (strcmpi(cType, "pictures") == 0) - { - if (strcmpi(PyString_AsString(key), "count") == 0) - self->item->m_iprogramCount = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "size") == 0) - self->item->m_dwSize = (int64_t)PyLong_AsLongLong(value); - else - { - if (!PyXBMCGetUnicodeString(tmp, value, 1)) continue; - if (strcmpi(PyString_AsString(key), "title") == 0) - self->item->m_strTitle = tmp; - else if (strcmpi(PyString_AsString(key), "picturepath") == 0) - self->item->SetPath(tmp); - else if (strcmpi(PyString_AsString(key), "date") == 0) - { - if (strlen(tmp) == 10) - self->item->m_dateTime.SetDate(atoi(tmp.Right(4)), atoi(tmp.Mid(3,4)), atoi(tmp.Left(2))); - } - else - { - CStdString exifkey = PyString_AsString(key); - if (!exifkey.Left(5).Equals("exif:") || exifkey.length() < 6) continue; - int info = CPictureInfoTag::TranslateString(exifkey.Mid(5)); - self->item->GetPictureInfoTag()->SetInfo(info, tmp); - } - } - self->item->GetPictureInfoTag()->SetLoaded(true); - } - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(addStreamInfo__doc__, - "addStreamInfo(type, values) -- Add a stream with details.\n" - "\n" - "type : string - type of stream(video/audio/subtitle).\n" - "values : dictionary - pairs of { label: value }.\n" - "\n" - "Video Values:\n" - " codec : string (h264)\n" - " aspect : float (1.78)\n" - " width : integer (1280)\n" - " height : integer (720)\n" - " duration : integer (seconds)\n" - "\n" - "Audio Values:\n" - " codec : string (dts)\n" - " language : string (en)\n" - " channels : integer (2)\n" - "\n" - "Subtitle Values:\n" - " language : string (en)\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().addStreamInfo('video', { 'Codec': 'h264', 'Width' : 1280 })\n"); - - PyObject* ListItem_AddStreamInfo(ListItem *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "type", "values", NULL }; - char *cType = NULL; - PyObject *pValues = NULL; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &cType, - &pValues)) - { - return NULL; - } - if (!PyObject_TypeCheck(pValues, &PyDict_Type)) - { - PyErr_SetString(PyExc_TypeError, "values object should be of type Dict"); - return NULL; - } - if (PyDict_Size(pValues) == 0) - { - PyErr_SetString(PyExc_ValueError, "Empty values dictionary"); - return NULL; - } - - PyObject *key, *value; - Py_ssize_t pos = 0; - - PyXBMCGUILock(); - - CStdString tmp; - if (strcmpi(cType, "video") == 0) - { - CStreamDetailVideo* video = new CStreamDetailVideo; - while (PyDict_Next(pValues, &pos, &key, &value)) - { - if (strcmpi(PyString_AsString(key), "codec") == 0) - { - if (!PyXBMCGetUnicodeString(video->m_strCodec, value, 1)) - continue; - } - else if (strcmpi(PyString_AsString(key), "aspect") == 0) - video->m_fAspect = (float)PyFloat_AsDouble(value); - else if (strcmpi(PyString_AsString(key), "width") == 0) - video->m_iWidth = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "height") == 0) - video->m_iHeight = PyInt_AsLong(value); - else if (strcmpi(PyString_AsString(key), "duration") == 0) - video->m_iDuration = PyInt_AsLong(value); - } - self->item->GetVideoInfoTag()->m_streamDetails.AddStream(video); - } - else if (strcmpi(cType, "audio") == 0) - { - CStreamDetailAudio* audio = new CStreamDetailAudio; - while (PyDict_Next(pValues, &pos, &key, &value)) - { - if (strcmpi(PyString_AsString(key), "codec") == 0) - { - if (!PyXBMCGetUnicodeString(audio->m_strCodec, value, 1)) - continue; - } - else if (strcmpi(PyString_AsString(key), "language") == 0) - { - if (!PyXBMCGetUnicodeString(audio->m_strLanguage, value, 1)) - continue; - } - else if (strcmpi(PyString_AsString(key), "channels") == 0) - audio ->m_iChannels = PyInt_AsLong(value); - } - self->item->GetVideoInfoTag()->m_streamDetails.AddStream(audio); - } - else if (strcmpi(cType, "subtitle") == 0) - { - CStreamDetailSubtitle* subtitle = new CStreamDetailSubtitle; - while (PyDict_Next(pValues, &pos, &key, &value)) - { - if (strcmpi(PyString_AsString(key), "language") == 0) - { - if (!PyXBMCGetUnicodeString(subtitle->m_strLanguage, value, 1)) - continue; - } - } - self->item->GetVideoInfoTag()->m_streamDetails.AddStream(subtitle); - } - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setProperty__doc__, - "setProperty(key, value) -- Sets a listitem property, similar to an infolabel.\n" - "\n" - "key : string - property name.\n" - "value : string or unicode - value of property.\n" - "\n" - "*Note, Key is NOT case sensitive.\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - " Some of these are treated internally by XBMC.\n" - " Others may be used in the skin to add extra information, such as 'WatchedCount' for tvshow items\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setProperty('AspectRatio', '1.85 : 1')\n" - " - self.list.getSelectedItem().setProperty('TotalTime', '3668.4')\n" - " - self.list.getSelectedItem().setProperty('ResumeTime', '306.8')\n"); - - PyObject* ListItem_SetProperty(ListItem *self, PyObject *args, PyObject *kwds) - { - if (!self->item) return NULL; - - static const char *keywords[] = { "key", "value", NULL }; - char *key = NULL; - PyObject *value = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &key, - &value)) - { - return NULL; - } - if (!key || !value) return NULL; - - string uText; - if (!PyXBMCGetUnicodeString(uText, value, 1)) - return NULL; - - PyXBMCGUILock(); - CStdString lowerKey = key; - if (lowerKey.CompareNoCase("startoffset") == 0) - { // special case for start offset - don't actually store in a property, - // we store it in item.m_lStartOffset instead - self->item->m_lStartOffset = (int)(atof(uText.c_str()) * 75.0); // we store the offset in frames, or 1/75th of a second - } - else if (lowerKey.CompareNoCase("mimetype") == 0) - { // special case for mime type - don't actually stored in a property, - self->item->SetMimeType(uText); - } - else if (lowerKey.CompareNoCase("totaltime") == 0) - self->item->GetVideoInfoTag()->m_resumePoint.totalTimeInSeconds = (float)atof(uText.c_str()); - else if (lowerKey.CompareNoCase("resumetime") == 0) - self->item->GetVideoInfoTag()->m_resumePoint.timeInSeconds = (float)atof(uText.c_str()); - else if (lowerKey.CompareNoCase("specialsort") == 0) - { - if (uText == "bottom") - self->item->SetSpecialSort(SortSpecialOnBottom); - else if (uText == "top") - self->item->SetSpecialSort(SortSpecialOnTop); - } - else - self->item->SetProperty(lowerKey.ToLower(), uText.c_str()); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getProperty__doc__, - "getProperty(key) -- Returns a listitem property as a string, similar to an infolabel.\n" - "\n" - "key : string - property name.\n" - "\n" - "*Note, Key is NOT case sensitive.\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - AspectRatio = self.list.getSelectedItem().getProperty('AspectRatio')\n"); - - PyObject* ListItem_GetProperty(ListItem *self, PyObject *args, PyObject *kwds) - { - if (!self->item) return NULL; - - static const char *keywords[] = { "key", NULL }; - char *key = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &key)) - { - return NULL; - } - if (!key) return NULL; - - PyXBMCGUILock(); - CStdString lowerKey = key; - CStdString value; - if (lowerKey.CompareNoCase("startoffset") == 0) - { // special case for start offset - don't actually store in a property, - // we store it in item.m_lStartOffset instead - value.Format("%f", self->item->m_lStartOffset / 75.0); - } - else if (lowerKey.CompareNoCase("totaltime") == 0) - value.Format("%f", self->item->GetVideoInfoTag()->m_resumePoint.totalTimeInSeconds); - else if (lowerKey.CompareNoCase("resumetime") == 0) - value.Format("%f", self->item->GetVideoInfoTag()->m_resumePoint.timeInSeconds); - else - value = self->item->GetProperty(lowerKey.ToLower()).asString(); - PyXBMCGUIUnlock(); - - return Py_BuildValue((char*)"s", value.c_str()); - } - - // addContextMenuItems() method - PyDoc_STRVAR(addContextMenuItems__doc__, - "addContextMenuItems([(label, action,)*], replaceItems) -- Adds item(s) to the context menu for media lists.\n" - "\n" - "items : list - [(label, action,)*] A list of tuples consisting of label and action pairs.\n" - " - label : string or unicode - item's label.\n" - " - action : string or unicode - any built-in function to perform.\n" - "replaceItems : [opt] bool - True=only your items will show/False=your items will be added to context menu(Default).\n" - "\n" - "List of functions - http://wiki.xbmc.org/?title=List_of_Built_In_Functions \n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - listitem.addContextMenuItems([('Theater Showtimes', 'XBMC.RunScript(special://home/scripts/showtimes/default.py,Iron Man)',)])\n"); - - PyObject* ListItem_AddContextMenuItems(ListItem *self, PyObject *args, PyObject *kwds) - { - if (!self->item) return NULL; - - PyObject *pList = NULL; - char bReplaceItems = false; - static const char *keywords[] = { "items", "replaceItems", NULL }; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O|b", - (char**)keywords, - &pList, - &bReplaceItems) || pList == NULL || !PyObject_TypeCheck(pList, &PyList_Type)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type List"); - return NULL; - } - - for (int item = 0; item < PyList_Size(pList); item++) - { - PyObject *pTuple = NULL; - pTuple = PyList_GetItem(pList, item); - if (!pTuple || !PyObject_TypeCheck(pTuple, &PyTuple_Type)) - { - PyErr_SetString(PyExc_TypeError, "List must only contain tuples"); - return NULL; - } - PyObject *label = NULL; - PyObject *action = NULL; - if (!PyArg_ParseTuple(pTuple, (char*)"OO", &label, &action)) - { - PyErr_SetString(PyExc_TypeError, "Error unpacking tuple found in list"); - return NULL; - } - if (!label || !action) return NULL; - - string uText; - if (!PyXBMCGetUnicodeString(uText, label, 1)) - return NULL; - string uAction; - if (!PyXBMCGetUnicodeString(uAction, action, 1)) - return NULL; - PyXBMCGUILock(); - - CStdString property; - property.Format("contextmenulabel(%i)", item); - self->item->SetProperty(property, uText); - - property.Format("contextmenuaction(%i)", item); - self->item->SetProperty(property, uAction); - - PyXBMCGUIUnlock(); - } - - // set our replaceItems status - if (bReplaceItems) - self->item->SetProperty("pluginreplacecontextitems", 0 != bReplaceItems); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setPath__doc__, - "setPath(path) -- Sets the listitem's path.\n" - "\n" - "path : string or unicode - path, activated when item is clicked.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - self.list.getSelectedItem().setPath(path='ActivateWindow(Weather)')\n"); - - PyObject* ListItem_SetPath(ListItem *self, PyObject *args, PyObject *kwds) - { - if (!self->item) return NULL; - PyObject* pPath = NULL; - - if (!PyArg_ParseTuple(args, (char*)"O", &pPath)) return NULL; - static const char *keywords[] = { "path", NULL }; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O", - (char**)keywords, - &pPath - )) - { - return NULL; - } - - string path; - if (pPath && !PyXBMCGetUnicodeString(path, pPath, 1)) - return NULL; - // set path - PyXBMCGUILock(); - self->item->SetPath(path); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef ListItem_methods[] = { - {(char*)"getLabel" , (PyCFunction)ListItem_GetLabel, METH_VARARGS, getLabel__doc__}, - {(char*)"setLabel" , (PyCFunction)ListItem_SetLabel, METH_VARARGS, setLabel__doc__}, - {(char*)"getLabel2", (PyCFunction)ListItem_GetLabel2, METH_VARARGS, getLabel2__doc__}, - {(char*)"setLabel2", (PyCFunction)ListItem_SetLabel2, METH_VARARGS, setLabel2__doc__}, - {(char*)"setIconImage", (PyCFunction)ListItem_SetIconImage, METH_VARARGS, setIconImage__doc__}, - {(char*)"setThumbnailImage", (PyCFunction)ListItem_SetThumbnailImage, METH_VARARGS, setThumbnailImage__doc__}, - {(char*)"select", (PyCFunction)ListItem_Select, METH_VARARGS, select__doc__}, - {(char*)"isSelected", (PyCFunction)ListItem_IsSelected, METH_VARARGS, isSelected__doc__}, - {(char*)"setInfo", (PyCFunction)ListItem_SetInfo, METH_VARARGS|METH_KEYWORDS, setInfo__doc__}, - {(char*)"setProperty", (PyCFunction)ListItem_SetProperty, METH_VARARGS|METH_KEYWORDS, setProperty__doc__}, - {(char*)"getProperty", (PyCFunction)ListItem_GetProperty, METH_VARARGS|METH_KEYWORDS, getProperty__doc__}, - {(char*)"addContextMenuItems", (PyCFunction)ListItem_AddContextMenuItems, METH_VARARGS|METH_KEYWORDS, addContextMenuItems__doc__}, - {(char*)"addStreamInfo", (PyCFunction)ListItem_AddStreamInfo, METH_VARARGS|METH_KEYWORDS, addStreamInfo__doc__}, - {(char*)"setPath" , (PyCFunction)ListItem_SetPath, METH_VARARGS|METH_KEYWORDS, setPath__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(listItem__doc__, - "ListItem class.\n" - "\n" - "ListItem([label, label2, iconImage, thumbnailImage, path]) -- Creates a new ListItem.\n" - "\n" - "label : [opt] string or unicode - label1 text.\n" - "label2 : [opt] string or unicode - label2 text.\n" - "iconImage : [opt] string - icon filename.\n" - "thumbnailImage : [opt] string - thumbnail filename.\n" - "path : [opt] string or unicode - listitem's path.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - listitem = xbmcgui.ListItem('Casino Royale', '[PG-13]', 'blank-poster.tbn', 'poster.tbn', path='f:\\\\movies\\\\casino_royale.mov')\n"); - -// Restore code and data sections to normal. - - PyTypeObject ListItem_Type; - - void initListItem_Type() - { - PyXBMCInitializeTypeObject(&ListItem_Type); - - ListItem_Type.tp_name = (char*)"xbmcgui.ListItem"; - ListItem_Type.tp_basicsize = sizeof(ListItem); - ListItem_Type.tp_dealloc = (destructor)ListItem_Dealloc; - ListItem_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - ListItem_Type.tp_doc = listItem__doc__; - ListItem_Type.tp_methods = ListItem_methods; - ListItem_Type.tp_base = 0; - ListItem_Type.tp_new = ListItem_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/listitem.h b/xbmc/interfaces/python/xbmcmodule/listitem.h deleted file mode 100644 index 3ec788cbb5..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/listitem.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "FileItem.h" - -#define ListItem_Check(op) PyObject_TypeCheck(op, &ListItem_Type) -#define ListItem_CheckExact(op) ((op)->ob_type == &ListItem_Type) - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - extern PyTypeObject ListItem_Type; - - typedef struct { - PyObject_HEAD - CFileItemPtr item; - } ListItem; - - extern ListItem* ListItem_FromString(std::string strLabel); - - void initListItem_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/monitor.cpp b/xbmc/interfaces/python/xbmcmodule/monitor.cpp deleted file mode 100644 index 1f389ef2d7..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/monitor.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 2005-2012 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "monitor.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "PythonMonitor.h" - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* Monitor_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Monitor *self; - - self = (Monitor*)type->tp_alloc(type, 0); - if (!self) return NULL; - std::string addonId; - if (!PyXBMCGetAddonId(addonId) || addonId.empty()) - { - PyErr_SetString((PyObject*)self, "Unable to identify addon"); - return NULL; - } - CPyThreadState pyState; - self->pMonitor = new CPythonMonitor(); - pyState.Restore(); - self->pMonitor->Id = addonId; - self->pMonitor->SetCallback(PyThreadState_Get(), (PyObject*)self); - - return (PyObject*)self; - } - - void Monitor_Dealloc(Monitor* self) - { - self->pMonitor->SetCallback(NULL, NULL); - - CPyThreadState pyState; - self->pMonitor->Release(); - pyState.Restore(); - - self->pMonitor = NULL; - self->ob_type->tp_free((PyObject*)self); - } - - - // Monitor_onSettingsChanged - PyDoc_STRVAR(onSettingsChanged__doc__, - "onSettingsChanged() -- onSettingsChanged method.\n" - "\n" - "Will be called when addon settings are changed"); - - PyObject* Monitor_OnSettingsChanged(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Monitor_onScreensaverActivated - PyDoc_STRVAR(onScreensaverActivated__doc__, - "onScreensaverActivated() -- onScreensaverActivated method.\n" - "\n" - "Will be called when screensaver kicks in"); - - PyObject* Monitor_OnScreensaverActivated(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Monitor_onScreensaverDeactivated - PyDoc_STRVAR(onScreensaverDeactivated__doc__, - "onScreensaverDeactivated() -- onScreensaverDeactivated method.\n" - "\n" - "Will be called when screensaver goes off"); - - PyObject* Monitor_OnScreensaverDeactivated(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Monitor_onDatabaseUpdated - PyDoc_STRVAR(onDatabaseUpdated__doc__, - "onDatabaseUpdated(database) -- onDatabaseUpdated method.\n" - "\n" - "database - video/music as string" - "\n" - "Will be called when database gets updated and return video or music to indicate which DB has been changed"); - - PyObject* Monitor_OnDatabaseUpdated(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Monitor_onAbortRequested - PyDoc_STRVAR(onAbortRequested__doc__, - "onAbortRequested() -- onAbortRequested method.\n" - "\n" - "Will be called when XBMC requests Abort"); - - PyObject* Monitor_OnAbortRequested(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef Monitor_methods[] = { - {(char*)"onSettingsChanged", (PyCFunction)Monitor_OnSettingsChanged, METH_VARARGS, onSettingsChanged__doc__}, - {(char*)"onScreensaverActivated", (PyCFunction)Monitor_OnScreensaverActivated, METH_VARARGS, onScreensaverActivated__doc__}, - {(char*)"onScreensaverDeactivated", (PyCFunction)Monitor_OnScreensaverDeactivated, METH_VARARGS, onScreensaverDeactivated__doc__}, - {(char*)"onDatabaseUpdated", (PyCFunction)Monitor_OnDatabaseUpdated, METH_VARARGS , onDatabaseUpdated__doc__}, - {(char*)"onAbortRequested", (PyCFunction)Monitor_OnAbortRequested, METH_VARARGS , onAbortRequested__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(monitor__doc__, - "Monitor class.\n" - "\n" - "Monitor() -- Creates a new Monitor to notify addon about changes.\n" - "\n"); - - PyTypeObject Monitor_Type; - - void initMonitor_Type() - { - PyXBMCInitializeTypeObject(&Monitor_Type); - - Monitor_Type.tp_name = (char*)"xbmc.Monitor"; - Monitor_Type.tp_basicsize = sizeof(Monitor); - Monitor_Type.tp_dealloc = (destructor)Monitor_Dealloc; - Monitor_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Monitor_Type.tp_doc = monitor__doc__; - Monitor_Type.tp_methods = Monitor_methods; - Monitor_Type.tp_base = 0; - Monitor_Type.tp_new = Monitor_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/player.cpp b/xbmc/interfaces/python/xbmcmodule/player.cpp deleted file mode 100644 index adc605d322..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/player.cpp +++ /dev/null @@ -1,815 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyutil.h" -#include "Application.h" -#include "ApplicationMessenger.h" -#include "GUIInfoManager.h" -#include "PlayListPlayer.h" -#include "player.h" -#include "pyplaylist.h" -#include "infotagvideo.h" -#include "infotagmusic.h" -#include "listitem.h" -#include "FileItem.h" -#include "utils/LangCodeExpander.h" -#include "settings/Settings.h" -#include "pythreadstate.h" -#include "utils/log.h" - -using namespace MUSIC_INFO; - -// player callback class - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* Player_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Player *self; - int playerCore=EPC_NONE; - - self = (Player*)type->tp_alloc(type, 0); - if (!self) return NULL; - - if (!PyArg_ParseTuple(args, (char*)"|i", &playerCore)) return NULL; - - self->iPlayList = PLAYLIST_MUSIC; - - CPyThreadState pyState; - self->pPlayer = new CPythonPlayer(); - pyState.Restore(); - - self->pPlayer->SetCallback(PyThreadState_Get(), (PyObject*)self); - self->playerCore = EPC_NONE; - - if (playerCore == EPC_DVDPLAYER || - playerCore == EPC_MPLAYER || - playerCore == EPC_PAPLAYER) - { - self->playerCore = (EPLAYERCORES)playerCore; - } - - return (PyObject*)self; - } - - void Player_Dealloc(Player* self) - { - self->pPlayer->SetCallback(NULL, NULL); - - CPyThreadState pyState; - self->pPlayer->Release(); - pyState.Restore(); - - self->pPlayer = NULL; - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(play__doc__, - "play([item, listitem, windowed]) -- Play this item.\n" - "\n" - "item : [opt] string - filename, url or playlist.\n" - "listitem : [opt] listitem - used with setInfo() to set different infolabels.\n" - "windowed : [opt] bool - true=play video windowed, false=play users preference.(default)\n" - "\n" - "*Note, If item is not given then the Player will try to play the current item\n" - " in the current playlist.\n" - "\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - listitem = xbmcgui.ListItem('Ironman')\n" - " - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})\n" - " - xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play(url, listitem, windowed)\n"); - - // play a file or python playlist - PyObject* Player_Play(Player *self, PyObject *args, PyObject *kwds) - { - PyObject *pObject = NULL; - PyObject *pObjectListItem = NULL; - char bWindowed = false; - static const char *keywords[] = { "item", "listitem", "windowed", NULL }; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"|OOb", - (char**)keywords, - &pObject, - &pObjectListItem, - &bWindowed)) - { - return NULL; - } - - // set fullscreen or windowed - g_settings.m_bStartVideoWindowed = (0 != bWindowed); - - // force a playercore before playing - g_application.m_eForcedNextPlayer = self->playerCore; - - if (pObject == NULL) - { - // play current file in playlist - if (g_playlistPlayer.GetCurrentPlaylist() != self->iPlayList) - { - g_playlistPlayer.SetCurrentPlaylist(self->iPlayList); - } - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayListPlayerPlay(g_playlistPlayer.GetCurrentSong()); - } - else if ((PyString_Check(pObject) || PyUnicode_Check(pObject)) && pObjectListItem != NULL && ListItem_CheckExact(pObjectListItem)) - { - // an optional listitem was passed - ListItem* pListItem = NULL; - pListItem = (ListItem*)pObjectListItem; - - // set m_strPath to the passed url - pListItem->item->SetPath(PyString_AsString(pObject)); - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayFile((const CFileItem)*pListItem->item, false); - } - else if (PyString_Check(pObject) || PyUnicode_Check(pObject)) - { - CFileItem item(PyString_AsString(pObject), false); - - CPyThreadState pyState; - CApplicationMessenger::Get().MediaPlay(item.GetPath()); - } - else if (PlayList_Check(pObject)) - { - // play a python playlist (a playlist from playlistplayer.cpp) - PlayList* pPlayList = (PlayList*)pObject; - self->iPlayList = pPlayList->iPlayList; - g_playlistPlayer.SetCurrentPlaylist(pPlayList->iPlayList); - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayListPlayerPlay(); - } - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_Stop - PyDoc_STRVAR(stop__doc__, - "stop() -- Stop playing."); - - PyObject* pyPlayer_Stop(PyObject *self, PyObject *args) - { - CPyThreadState pyState; - CApplicationMessenger::Get().MediaStop(); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_Pause - PyDoc_STRVAR(pause__doc__, - "pause() -- Pause playing."); - - PyObject* Player_Pause(PyObject *self, PyObject *args) - { - CPyThreadState pyState; - CApplicationMessenger::Get().MediaPause(); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_PlayNext - PyDoc_STRVAR(playnext__doc__, - "playnext() -- Play next item in playlist."); - - PyObject* Player_PlayNext(Player *self, PyObject *args) - { - // force a playercore before playing - g_application.m_eForcedNextPlayer = self->playerCore; - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayListPlayerNext(); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_PlayPrevious - PyDoc_STRVAR(playprevious__doc__, - "playprevious() -- Play previous item in playlist."); - - PyObject* Player_PlayPrevious(Player *self, PyObject *args) - { - // force a playercore before playing - g_application.m_eForcedNextPlayer = self->playerCore; - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayListPlayerPrevious(); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_PlaySelected - PyDoc_STRVAR(playselected__doc__, - "playselected() -- Play a certain item from the current playlist."); - - PyObject* Player_PlaySelected(Player *self, PyObject *args) - { - int iItem; - if (!PyArg_ParseTuple(args, (char*)"i", &iItem)) return NULL; - - // force a playercore before playing - g_application.m_eForcedNextPlayer = self->playerCore; - - if (g_playlistPlayer.GetCurrentPlaylist() != self->iPlayList) - { - g_playlistPlayer.SetCurrentPlaylist(self->iPlayList); - } - g_playlistPlayer.SetCurrentSong(iItem); - - CPyThreadState pyState; - CApplicationMessenger::Get().PlayListPlayerPlay(iItem); - pyState.Restore(); - - //g_playlistPlayer.Play(iItem); - //CLog::Log(LOGNOTICE, "Current Song After Play: %i", g_playlistPlayer.GetCurrentSong()); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackStarted - PyDoc_STRVAR(onPlayBackStarted__doc__, - "onPlayBackStarted() -- onPlayBackStarted method.\n" - "\n" - "Will be called when xbmc starts playing a file"); - - PyObject* Player_OnPlayBackStarted(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackEnded - PyDoc_STRVAR(onPlayBackEnded__doc__, - "onPlayBackEnded() -- onPlayBackEnded method.\n" - "\n" - "Will be called when xbmc stops playing a file"); - - PyObject* Player_OnPlayBackEnded(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackStopped - PyDoc_STRVAR(onPlayBackStopped__doc__, - "onPlayBackStopped() -- onPlayBackStopped method.\n" - "\n" - "Will be called when user stops xbmc playing a file"); - - PyObject* Player_OnPlayBackStopped(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackPaused - PyDoc_STRVAR(onPlayBackPaused__doc__, - "onPlayBackPaused() -- onPlayBackPaused method.\n" - "\n" - "Will be called when user pauses a playing file"); - - PyObject* Player_OnPlayBackPaused(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackResumed - PyDoc_STRVAR(onPlayBackResumed__doc__, - "onPlayBackResumed() -- onPlayBackResumed method.\n" - "\n" - "Will be called when user resumes a paused file"); - - PyObject* Player_OnPlayBackResumed(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackSpeedChanged(speed) - PyDoc_STRVAR(onPlayBackSpeedChanged__doc__, - "onPlayBackSpeedChanged(speed) -- onPlayBackSpeedChanged method.\n" - "\n" - "speed : integer - current speed of player.\n" - "\n" - "*Note, negative speed means player is rewinding, 1 is normal playback speed.\n" - "\n" - "Will be called when players speed changes. (eg. user FF/RW)"); - - PyObject* Player_OnPlayBackSpeedChanged(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackSeek(time, seekOffset) - PyDoc_STRVAR(onPlayBackSeek__doc__, - "onPlayBackSeek(time, seekOffset) -- onPlayBackSeek method.\n" - "\n" - "time : integer - time to seek to.\n" - "seekOffset : integer - ?.\n" - "\n" - "Will be called when user seeks to a time"); - - PyObject* Player_OnPlayBackSeek(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnPlayBackSeekChapter(chapter) - PyDoc_STRVAR(onPlayBackSeekChapter__doc__, - "onPlayBackSeekChapter(chapter) -- onPlayBackSeekChapter method.\n" - "\n" - "chapter : integer - chapter to seek to.\n" - "\n" - "Will be called when user performs a chapter seek"); - - PyObject* Player_OnPlayBackSeekChapter(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_OnQueueNextItem() - PyDoc_STRVAR(onQueueNextItem__doc__, - "onQueueNextItem() -- onQueueNextItem method.\n" - "\n" - "Will be called when player requests next item"); - - PyObject* Player_OnQueueNextItem(PyObject *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - // Player_IsPlaying - PyDoc_STRVAR(isPlaying__doc__, - "isPlaying() -- returns True is xbmc is playing a file."); - - PyObject* Player_IsPlaying(PyObject *self, PyObject *args) - { - return Py_BuildValue((char*)"b", g_application.IsPlaying()); - } - - // Player_IsPlayingAudio - PyDoc_STRVAR(isPlayingAudio__doc__, - "isPlayingAudio() -- returns True is xbmc is playing an audio file."); - - PyObject* Player_IsPlayingAudio(PyObject *self, PyObject *args) - { - return Py_BuildValue((char*)"b", g_application.IsPlayingAudio()); - } - - // Player_IsPlayingVideo - PyDoc_STRVAR(isPlayingVideo__doc__, - "isPlayingVideo() -- returns True if xbmc is playing a video."); - - PyObject* Player_IsPlayingVideo(PyObject *self, PyObject *args) - { - return Py_BuildValue((char*)"b", g_application.IsPlayingVideo()); - } - - // Player_GetPlayingFile - PyDoc_STRVAR(getPlayingFile__doc__, - "getPlayingFile() -- returns the current playing file as a string.\n" - "\n" - "Throws: Exception, if player is not playing a file.\n" - ""); - - PyObject* Player_GetPlayingFile(PyObject *self, PyObject *args) - { - if (!g_application.IsPlaying()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any file"); - return NULL; - } - return Py_BuildValue((char*)"s", g_application.CurrentFile().c_str()); - } - - // Player_GetVideoInfoTag - PyDoc_STRVAR(getVideoInfoTag__doc__, - "getVideoInfoTag() -- returns the VideoInfoTag of the current playing Movie.\n" - "\n" - "Throws: Exception, if player is not playing a file or current file is not a movie file.\n" - "\n" - "Note, this doesn't work yet, it's not tested\n" - ""); - - PyObject* Player_GetVideoInfoTag(PyObject *self, PyObject *args) - { - if (!g_application.IsPlayingVideo()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any videofile"); - return NULL; - } - - const CVideoInfoTag* movie = g_infoManager.GetCurrentMovieTag(); - if (movie) - return (PyObject*)InfoTagVideo_FromCVideoInfoTag(*movie); - - CVideoInfoTag movie2; - return (PyObject*)InfoTagVideo_FromCVideoInfoTag(movie2); - } - - // Player_GetMusicInfoTag - PyDoc_STRVAR(getMusicInfoTag__doc__, - "getMusicInfoTag() -- returns the MusicInfoTag of the current playing 'Song'.\n" - "\n" - "Throws: Exception, if player is not playing a file or current file is not a music file.\n" - ""); - - PyObject* Player_GetMusicInfoTag(PyObject *self, PyObject *args) - { - if (g_application.IsPlayingVideo() || !g_application.IsPlayingAudio()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any music file"); - return NULL; - } - - const CMusicInfoTag* tag = g_infoManager.GetCurrentSongTag(); - if (tag) - return (PyObject*)InfoTagMusic_FromCMusicInfoTag(*tag); - - CMusicInfoTag tag2; - return (PyObject*)InfoTagMusic_FromCMusicInfoTag(tag2); - } - - // Player_GetTotalTime - PyDoc_STRVAR(getTotalTime__doc__, - "getTotalTime() -- Returns the total time of the current playing media in\n" - " seconds. This is only accurate to the full second.\n" - "\n" - "Throws: Exception, if player is not playing a file.\n" - ""); - - PyObject* Player_GetTotalTime(PyObject *self) - { - if (!g_application.IsPlaying()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any media file"); - return NULL; - } - - return PyFloat_FromDouble(g_application.GetTotalTime()); - } - - // Player_GetTime - PyDoc_STRVAR(getTime__doc__, - "getTime() -- Returns the current time of the current playing media as fractional seconds.\n" - "\n" - "Throws: Exception, if player is not playing a file.\n" - ""); - - PyObject* Player_GetTime(PyObject *self) - { - double dTime = 0.0; - - if (!g_application.IsPlaying()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any media file"); - return NULL; - } - - dTime = g_application.GetTime(); - return Py_BuildValue((char*)"d", dTime); - } - - // Player_SeekTime - PyDoc_STRVAR(seekTime__doc__, - "seekTime() -- Seeks the specified amount of time as fractional seconds.\n" - " The time specified is relative to the beginning of the\n" - " currently playing media file.\n" - "\n" - "Throws: Exception, if player is not playing a file.\n" - ""); - - PyObject* Player_SeekTime(PyObject *self, PyObject *args) - { - double pTime = 0.0; - - if (!g_application.IsPlaying()) - { - PyErr_SetString(PyExc_Exception, "XBMC is not playing any media file"); - return NULL; - } - - if (!PyArg_ParseTuple(args, (char*)"d", &pTime)) return NULL; - - g_application.SeekTime( pTime ); - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_SetSubtitles - PyDoc_STRVAR(setSubtitles__doc__, - "setSubtitles(path) -- set subtitle file and enable subtitles\n" - "\n" - "path : string or unicode - Path to subtitle\n" - "\n" - "example:\n" - " - setSubtitles('/path/to/subtitle/test.srt')\n"); - - PyObject* Player_SetSubtitles(PyObject *self, PyObject *args) - { - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - if (g_application.m_pPlayer) - { - int nStream = g_application.m_pPlayer->AddSubtitle(cLine); - if(nStream >= 0) - { - g_application.m_pPlayer->SetSubtitle(nStream); - g_application.m_pPlayer->SetSubtitleVisible(true); - g_settings.m_currentVideoSettings.m_SubtitleDelay = 0.0f; - g_application.m_pPlayer->SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay); - } - } - - Py_INCREF(Py_None); - return Py_None; - } - - - // Player_GetSubtitles - PyDoc_STRVAR(getSubtitles__doc__, - "getSubtitles() -- get subtitle stream name\n"); - - PyObject* Player_GetSubtitles(PyObject *self) - { - if (g_application.m_pPlayer) - { - int i = g_application.m_pPlayer->GetSubtitle(); - CStdString strName; - g_application.m_pPlayer->GetSubtitleName(i, strName); - - if (strName == "Unknown(Invalid)") - strName = ""; - return Py_BuildValue((char*)"s", strName.c_str()); - } - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_ShowSubtitles - PyDoc_STRVAR(showSubtitles__doc__, - "showSubtitles(visible) -- enable/disable subtitles\n" - "\n" - "visible : boolean - True for visible subtitles.\n" - "example:\n" - " - xbmc.Player().showSubtitles(True)"); - - PyObject* Player_ShowSubtitles(PyObject *self, PyObject *args) - { - char bVisible; - if (!PyArg_ParseTuple(args, (char*)"b", &bVisible)) return NULL; - if (g_application.m_pPlayer) - { - g_settings.m_currentVideoSettings.m_SubtitleOn = (bVisible != 0); - g_application.m_pPlayer->SetSubtitleVisible(bVisible != 0); - - Py_INCREF(Py_None); - return Py_None; - } - return NULL; - } - - // Player_DisableSubtitles - PyDoc_STRVAR(DisableSubtitles__doc__, - "DisableSubtitles() -- disable subtitles\n"); - - PyObject* Player_DisableSubtitles(PyObject *self) - { - 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) - { - g_settings.m_currentVideoSettings.m_SubtitleOn = false; - g_application.m_pPlayer->SetSubtitleVisible(false); - - Py_INCREF(Py_None); - return Py_None; - } - return NULL; - } - - // Player_getAvailableAudioStreams - PyDoc_STRVAR(getAvailableAudioStreams__doc__, - "getAvailableAudioStreams() -- get Audio stream names\n"); - - PyObject* Player_getAvailableAudioStreams(PyObject *self) - { - if (g_application.m_pPlayer) - { - int i_size = g_application.m_pPlayer->GetAudioStreamCount(); - PyObject *list = PyList_New(i_size); - for (int iStream=0; iStream < i_size; iStream++) - { - CStdString strName; - CStdString FullLang; - g_application.m_pPlayer->GetAudioStreamLanguage(iStream, strName); - g_LangCodeExpander.Lookup(FullLang, strName); - if (FullLang.IsEmpty()) - g_application.m_pPlayer->GetAudioStreamName(iStream, FullLang); - PyList_SetItem(list, iStream, Py_BuildValue((char*)"s", FullLang.c_str())); - //PyList_SetItem() steals the ref count, so no need to DECREF - } - return list; - } - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_setAudioStream - PyDoc_STRVAR(setAudioStream__doc__, - "setAudioStream(stream) -- set Audio Stream \n" - "\n" - "stream : int\n" - "\n" - "example:\n" - " - setAudioStream(1)\n"); - - PyObject* Player_setAudioStream(PyObject *self, PyObject *args) - { - int iStream; - if (!PyArg_ParseTuple(args, (char*)"i", &iStream)) return NULL; - - if (g_application.m_pPlayer) - { - int streamCount = g_application.m_pPlayer->GetAudioStreamCount(); - if(iStream < streamCount) - g_application.m_pPlayer->SetAudioStream(iStream); - } - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_getAvailableSubtitleStreams - PyDoc_STRVAR(getAvailableSubtitleStreams__doc__, - "getAvailableSubtitleStreams() -- get Subtitle stream names\n"); - - PyObject* Player_getAvailableSubtitleStreams(PyObject *self) - { - if (g_application.m_pPlayer) - { - int i_size = g_application.m_pPlayer->GetSubtitleCount(); - PyObject *list = PyList_New(i_size); - for (int iStream=0; iStream < i_size; iStream++) - { - CStdString strName; - CStdString FullLang; - g_application.m_pPlayer->GetSubtitleName(iStream, strName); - if (!g_LangCodeExpander.Lookup(FullLang, strName)) - FullLang = strName; - PyList_SetItem(list, iStream, Py_BuildValue((char*)"s", FullLang.c_str())); - //PyList_SetItem() steals the ref count, so no need to DECREF - } - return list; - } - - Py_INCREF(Py_None); - return Py_None; - } - - // Player_setSubtitleStream - PyDoc_STRVAR(setSubtitleStream__doc__, - "setSubtitleStream(stream) -- set Subtitle Stream \n" - "\n" - "stream : int\n" - "\n" - "example:\n" - " - setSubtitleStream(1)\n"); - - PyObject* Player_setSubtitleStream(PyObject *self, PyObject *args) - { - int iStream; - if (!PyArg_ParseTuple(args, (char*)"i", &iStream)) return NULL; - - if (g_application.m_pPlayer) - { - int streamCount = g_application.m_pPlayer->GetSubtitleCount(); - if(iStream < streamCount) - { - g_application.m_pPlayer->SetSubtitle(iStream); - g_application.m_pPlayer->SetSubtitleVisible(true); - } - } - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef Player_methods[] = { - {(char*)"play", (PyCFunction)Player_Play, METH_VARARGS|METH_KEYWORDS, play__doc__}, - {(char*)"stop", (PyCFunction)pyPlayer_Stop, METH_VARARGS, stop__doc__}, - {(char*)"pause", (PyCFunction)Player_Pause, METH_VARARGS, pause__doc__}, - {(char*)"playnext", (PyCFunction)Player_PlayNext, METH_VARARGS, playnext__doc__}, - {(char*)"playprevious", (PyCFunction)Player_PlayPrevious, METH_VARARGS, playprevious__doc__}, - {(char*)"playselected", (PyCFunction)Player_PlaySelected, METH_VARARGS, playselected__doc__}, - {(char*)"onPlayBackStarted", (PyCFunction)Player_OnPlayBackStarted, METH_VARARGS, onPlayBackStarted__doc__}, - {(char*)"onPlayBackEnded", (PyCFunction)Player_OnPlayBackEnded, METH_VARARGS, onPlayBackEnded__doc__}, - {(char*)"onPlayBackStopped", (PyCFunction)Player_OnPlayBackStopped, METH_VARARGS, onPlayBackStopped__doc__}, - {(char*)"onPlayBackPaused", (PyCFunction)Player_OnPlayBackPaused, METH_VARARGS, onPlayBackPaused__doc__}, - {(char*)"onPlayBackResumed", (PyCFunction)Player_OnPlayBackResumed, METH_VARARGS, onPlayBackResumed__doc__}, - {(char*)"onPlayBackSpeedChanged", (PyCFunction)Player_OnPlayBackSpeedChanged, METH_VARARGS, onPlayBackSpeedChanged__doc__}, - {(char*)"onPlayBackSeek", (PyCFunction)Player_OnPlayBackSeek, METH_VARARGS, onPlayBackSeek__doc__}, - {(char*)"onPlayBackSeekChapter", (PyCFunction)Player_OnPlayBackSeekChapter, METH_VARARGS, onPlayBackSeekChapter__doc__}, - {(char*)"onQueueNextItem", (PyCFunction)Player_OnQueueNextItem, METH_VARARGS, onQueueNextItem__doc__}, - {(char*)"isPlaying", (PyCFunction)Player_IsPlaying, METH_VARARGS, isPlaying__doc__}, - {(char*)"isPlayingAudio", (PyCFunction)Player_IsPlayingAudio, METH_VARARGS, isPlayingAudio__doc__}, - {(char*)"isPlayingVideo", (PyCFunction)Player_IsPlayingVideo, METH_VARARGS, isPlayingVideo__doc__}, - {(char*)"getPlayingFile", (PyCFunction)Player_GetPlayingFile, METH_VARARGS, getPlayingFile__doc__}, - {(char*)"getMusicInfoTag", (PyCFunction)Player_GetMusicInfoTag, METH_VARARGS, getMusicInfoTag__doc__}, - {(char*)"getVideoInfoTag", (PyCFunction)Player_GetVideoInfoTag, METH_VARARGS, getVideoInfoTag__doc__}, - {(char*)"getTotalTime", (PyCFunction)Player_GetTotalTime, METH_NOARGS, getTotalTime__doc__}, - {(char*)"getTime", (PyCFunction)Player_GetTime, METH_NOARGS, getTime__doc__}, - {(char*)"seekTime", (PyCFunction)Player_SeekTime, METH_VARARGS, seekTime__doc__}, - {(char*)"setSubtitles", (PyCFunction)Player_SetSubtitles, METH_VARARGS, setSubtitles__doc__}, - {(char*)"getSubtitles", (PyCFunction)Player_GetSubtitles, METH_NOARGS, getSubtitles__doc__}, - {(char*)"showSubtitles", (PyCFunction)Player_ShowSubtitles, METH_VARARGS, showSubtitles__doc__}, - {(char*)"disableSubtitles", (PyCFunction)Player_DisableSubtitles, METH_NOARGS, DisableSubtitles__doc__}, - {(char*)"getAvailableAudioStreams", (PyCFunction)Player_getAvailableAudioStreams, METH_NOARGS, getAvailableAudioStreams__doc__}, - {(char*)"setAudioStream", (PyCFunction)Player_setAudioStream, METH_VARARGS, setAudioStream__doc__}, - {(char*)"getAvailableSubtitleStreams", (PyCFunction)Player_getAvailableSubtitleStreams, METH_NOARGS, getAvailableSubtitleStreams__doc__}, - {(char*)"setSubtitleStream", (PyCFunction)Player_setSubtitleStream, METH_VARARGS, setSubtitleStream__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(player__doc__, - "Player class.\n" - "\n" - "Player([core]) -- Creates a new Player with as default the xbmc music playlist.\n" - "\n" - "core : (optional) Use a specified playcore instead of letting xbmc decide the playercore to use.\n" - " : - xbmc.PLAYER_CORE_AUTO\n" - " : - xbmc.PLAYER_CORE_DVDPLAYER\n" - " : - xbmc.PLAYER_CORE_MPLAYER\n" - " : - xbmc.PLAYER_CORE_PAPLAYER\n"); - -// Restore code and data sections to normal. - - PyTypeObject Player_Type; - - void initPlayer_Type() - { - PyXBMCInitializeTypeObject(&Player_Type); - - Player_Type.tp_name = (char*)"xbmc.Player"; - Player_Type.tp_basicsize = sizeof(Player); - Player_Type.tp_dealloc = (destructor)Player_Dealloc; - Player_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Player_Type.tp_doc = player__doc__; - Player_Type.tp_methods = Player_methods; - Player_Type.tp_base = 0; - Player_Type.tp_new = Player_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h b/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h deleted file mode 100644 index 6990c68871..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once -/* - * Copyright (C) 2005-2010 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ -#include "system.h" -#include "interfaces/json-rpc/ITransportLayer.h" -#include "interfaces/json-rpc/JSONRPC.h" - -#ifdef HAS_JSONRPC -class CPythonTransport : public JSONRPC::ITransportLayer -{ -public: - virtual bool PrepareDownload(const char *path, CVariant &details, std::string &protocol) { return false; } - virtual bool Download(const char *path, CVariant &result) { return false; } - virtual int GetCapabilities() { return JSONRPC::Response; } - - class CPythonClient : public JSONRPC::IClient - { - public: - virtual int GetPermissionFlags() { return JSONRPC::OPERATION_PERMISSION_ALL; } - virtual int GetAnnouncementFlags() { return 0; } - virtual bool SetAnnouncementFlags(int flags) { return true; } - }; -}; -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/pyplaylist.cpp b/xbmc/interfaces/python/xbmcmodule/pyplaylist.cpp deleted file mode 100644 index 915c4c023e..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyplaylist.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "pyutil.h" -#include "PlayListPlayer.h" -#include "utils/URIUtils.h" -#include "pyplaylist.h" -#include "playlists/PlayListFactory.h" -#include "listitem.h" -#include "playlists/PlayList.h" -#include "video/VideoInfoTag.h" -#include "music/tags/MusicInfoTag.h" - -using namespace std; -using namespace PLAYLIST; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - -/* PlayListItem Functions */ - - PyObject* PlayListItem_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - PlayListItem *self; - - self = (PlayListItem*)type->tp_alloc(type, 0); - if (!self) return NULL; - - self->item.reset(new CFileItem()); - - return (PyObject*)self; - } - - void PlayListItem_Dealloc(PlayListItem* self) - { - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(getDescription__doc__, - "getdescription() -- Returns the description of this PlayListItem.\n"); - - PyObject* PlayListItem_GetDescription(PlayListItem *self, PyObject *key) - { - return Py_BuildValue((char*)"s", self->item->GetLabel().c_str()); - } - - PyDoc_STRVAR(getDuration__doc__, - "getduration() -- Returns the duration of this PlayListItem.\n"); - - PyObject* PlayListItem_GetDuration(PlayListItem *self, PyObject *key) - { - if (self->item->LoadMusicTag()) - return Py_BuildValue((char*)"l", self->item->GetMusicInfoTag()->GetDuration()); - - if (self->item->HasVideoInfoTag()) - return Py_BuildValue((char*)"s", self->item->GetVideoInfoTag()->m_strRuntime.c_str()); - - return Py_BuildValue((char*)"l", 0); - } - - PyDoc_STRVAR(getFilename__doc__, - "getfilename() -- Returns the filename of this PlayListItem.\n"); - - PyObject* PlayListItem_GetFileName(PlayListItem *self, PyObject *key) - { - return Py_BuildValue((char*)"s", self->item->GetPath().c_str()); - } - -/* PlayList Fucntions */ - - PyObject* PlayList_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - int iNr; - PlayList *self; - if (!PyArg_ParseTuple(args, (char*)"i", &iNr)) return NULL; - - self = (PlayList*)type->tp_alloc(type, 0); - if (!self) return NULL; - - // we do not create our own playlist, just using the ones from playlistplayer - if (iNr != PLAYLIST_MUSIC && - iNr != PLAYLIST_VIDEO) - { - PyErr_SetString((PyObject*)self, "PlayList does not exist"); - return NULL; - } - - self->pPlayList = &g_playlistPlayer.GetPlaylist(iNr); - self->iPlayList = iNr; - - return (PyObject*)self; - } - - void PlayList_Dealloc(PlayList* self) - { - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(add__doc__, - "add(url[, listitem, index]) -- Adds a new file to the playlist.\n" - "\n" - "url : string or unicode - filename or url to add.\n" - "listitem : [opt] listitem - used with setInfo() to set different infolabels.\n" - "index : [opt] integer - position to add playlist item. (default=end)\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)\n" - " - video = 'F:\\\\movies\\\\Ironman.mov'\n" - " - listitem = xbmcgui.ListItem('Ironman', thumbnailImage='F:\\\\movies\\\\Ironman.tbn')\n" - " - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})\n" - " - playlist.add(url=video, listitem=listitem, index=7)\n"); - - PyObject* PlayList_Add(PlayList *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "url", - "listitem", - "index", - NULL}; - - PyObject *pObjectUrl = NULL; - PyObject *pObjectListItem = NULL; - int iPos = -1; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O|Ol", - (char**)keywords, - &pObjectUrl, - &pObjectListItem, - &iPos)) - { - return NULL; - } - - CStdString strUrl = ""; - if (!PyXBMCGetUnicodeString(strUrl, pObjectUrl)) return NULL; - - if (pObjectListItem != NULL && !ListItem_CheckExact(pObjectListItem)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type ListItem!"); - return NULL; - } - - CFileItemList items; - - if (pObjectListItem != NULL && ListItem_CheckExact(pObjectListItem)) - { - // an optional listitem was passed - ListItem* pListItem = NULL; - pListItem = (ListItem*)pObjectListItem; - - // set m_strPath to the passed url - pListItem->item->SetPath(strUrl); - - items.Add(pListItem->item); - } - else - { - CFileItemPtr item(new CFileItem(strUrl, false)); - item->SetLabel(strUrl); - - items.Add(item); - } - - self->pPlayList->Insert(items, iPos); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(load__doc__, - "load(filename) -- Load a playlist.\n" - "\n" - "clear current playlist and copy items from the file to this Playlist\n" - "filename can be like .pls or .m3u ...\n" - "returns False if unable to load playlist, True otherwise."); - - PyObject* PlayList_Load(PlayList *self, PyObject *args) - { - char* cFileName = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cFileName)) return NULL; - - CFileItem item(cFileName); - item.SetPath(cFileName); - - if (item.IsPlayList()) - { - // load playlist and copy al items to existing playlist - - // load a playlist like .m3u, .pls - // first get correct factory to load playlist - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); - if ( NULL != pPlayList.get()) - { - // load it - if (!pPlayList->Load(item.GetPath())) - { - //hmmm unable to load playlist? - return Py_BuildValue((char*)"b", false); - } - - // clear current playlist - g_playlistPlayer.ClearPlaylist(self->iPlayList); - - // add each item of the playlist to the playlistplayer - for (int i=0; i < (int)pPlayList->size(); ++i) - { - CFileItemPtr playListItem =(*pPlayList)[i]; - if (playListItem->GetLabel().IsEmpty()) - playListItem->SetLabel(URIUtils::GetFileName(playListItem->GetPath())); - - self->pPlayList->Add(playListItem); - } - } - } - else - { - // filename is not a valid playlist - PyErr_SetString(PyExc_ValueError, "Not a valid playlist"); - return NULL; - } - - return Py_BuildValue((char*)"b", true); - } - - PyDoc_STRVAR(remove__doc__, - "remove(filename) -- remove an item with this filename from the playlist.\n"); - - PyObject* PlayList_Remove(PlayList *self, PyObject *args) - { - char *cFileName = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cFileName)) return NULL; - - self->pPlayList->Remove(cFileName); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(clear__doc__, - "clear() -- clear all items in the playlist.\n"); - - PyObject* PlayList_Clear(PlayList *self, PyObject *args) - { - self->pPlayList->Clear(); - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(shuffle__doc__, - "shuffle() -- shuffle the playlist.\n"); - - PyObject* PlayList_Shuffle(PlayList *self, PyObject *args) - { - self->pPlayList->Shuffle(); - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(unshuffle__doc__, - "unshuffle() -- unshuffle the playlist.\n"); - - PyObject* PlayList_UnShuffle(PlayList *self, PyObject *args) - { - self->pPlayList->UnShuffle(); - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(size__doc__, - "size() -- returns the total number of PlayListItems in this playlist.\n"); - - PyObject* PlayList_Size(PlayList *self, PyObject *key) - { - return Py_BuildValue((char*)"i", self->pPlayList->size()); - } - - Py_ssize_t PlayList_Length(PyObject *self) - { - return ((PlayList*)self)->pPlayList->size(); - } - - PyObject* PlayList_GetItem(PyObject *self, PyObject *pAttr) - { - long pos = -1; - int iPlayListSize = ((PlayList*)self)->pPlayList->size(); - if (PyInt_Check(pAttr)) - { - pos = PyInt_AS_LONG(pAttr); - if (pos < 0) pos += iPlayListSize; - } - else if (PyLong_Check(pAttr)) - { - pos = PyLong_AsLong(pAttr); - if (pos == -1 && PyErr_Occurred()) return NULL; - if (pos < 0) pos += iPlayListSize; - } - else - { - PyErr_SetString(PyExc_TypeError, "playlist indices must be integers"); - return NULL; - } - if (pos < 0 || pos >= iPlayListSize) - { - PyErr_SetString(PyExc_TypeError, "array out of bound"); - return NULL; - } - - PlayListItem* item = (PlayListItem*)PlayListItem_Type.tp_alloc(&PlayListItem_Type, 0); - //Py_INCREF(item); - - CPlayList* p = ((PlayList*)self)->pPlayList; - item->item = (*p)[pos]; - - return (PyObject*)item; - } - - PyDoc_STRVAR(getposition__doc__, - "getposition() -- returns the position of the current song in this playlist.\n"); - - PyObject* PlayList_GetPosition(PlayList *self, PyObject *key) - { - return Py_BuildValue((char*)"i", g_playlistPlayer.GetCurrentSong()); - } - - PyMethodDef PlayListItem_methods[] = { - {(char*)"getdescription", (PyCFunction)PlayListItem_GetDescription, METH_VARARGS, getDescription__doc__}, - {(char*)"getduration", (PyCFunction)PlayListItem_GetDuration, METH_VARARGS, getDuration__doc__}, - {(char*)"getfilename", (PyCFunction)PlayListItem_GetFileName, METH_VARARGS, getFilename__doc__}, - {NULL, NULL, 0, NULL} - }; - - /* - static PyMemberDef PlayList_Members[] = { - {"name", T_INT, offsetof(PlayList, member), READONLY, "Music PlayList"}, - {NULL} - }; - */ - - PyMappingMethods Playlist_as_mapping = { - PlayList_Length, /* inquiry mp_length; __len__ */ - PlayList_GetItem, /* binaryfunc mp_subscript __getitem__ */ - 0, /* objargproc mp_ass_subscript; __setitem__ */ - }; - - PyMethodDef PlayList_methods[] = { - {(char*)"add", (PyCFunction)PlayList_Add, METH_VARARGS|METH_KEYWORDS, add__doc__}, - {(char*)"load", (PyCFunction)PlayList_Load, METH_VARARGS, load__doc__}, - {(char*)"remove", (PyCFunction)PlayList_Remove, METH_VARARGS, remove__doc__}, - {(char*)"clear", (PyCFunction)PlayList_Clear, METH_VARARGS, clear__doc__}, - {(char*)"size", (PyCFunction)PlayList_Size, METH_VARARGS, size__doc__}, - {(char*)"shuffle", (PyCFunction)PlayList_Shuffle, METH_VARARGS, shuffle__doc__}, - {(char*)"unshuffle", (PyCFunction)PlayList_UnShuffle, METH_VARARGS, unshuffle__doc__}, - {(char*)"getposition", (PyCFunction)PlayList_GetPosition, METH_VARARGS, getposition__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(playlistItem__doc__, - "PlayListItem class.\n" - "\n" - "PlayListItem() -- Creates a new PlaylistItem which can be added to a PlayList."); - - PyDoc_STRVAR(playlist__doc__, - "PlayList class.\n" - "\n" - "PlayList(int playlist) -- retrieve a reference from a valid xbmc playlist\n" - "\n" - "int playlist can be one of the next values:\n" - "\n" - " 0 : xbmc.PLAYLIST_MUSIC\n" - " 1 : xbmc.PLAYLIST_VIDEO\n" - "\n" - "Use PlayList[int position] or __getitem__(int position) to get a PlayListItem."); - -// Restore code and data sections to normal. - - PyTypeObject PlayListItem_Type; - - void initPlayListItem_Type() - { - PyXBMCInitializeTypeObject(&PlayListItem_Type); - - PlayListItem_Type.tp_name = (char*)"xbmc.PlayListItem"; - PlayListItem_Type.tp_basicsize = sizeof(PlayListItem); - PlayListItem_Type.tp_dealloc = (destructor)PlayListItem_Dealloc; - PlayListItem_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - PlayListItem_Type.tp_doc = playlistItem__doc__; - PlayListItem_Type.tp_methods = PlayListItem_methods; - PlayListItem_Type.tp_base = 0; - PlayListItem_Type.tp_new = PlayListItem_New; - } - - PyTypeObject PlayList_Type; - - void initPlayList_Type() - { - PyXBMCInitializeTypeObject(&PlayList_Type); - - PlayList_Type.tp_name = (char*)"xbmc.PlayList"; - PlayList_Type.tp_basicsize = sizeof(PlayList); - PlayList_Type.tp_dealloc = (destructor)PlayList_Dealloc; - PlayList_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - PlayList_Type.tp_doc = playlist__doc__; - PlayList_Type.tp_methods = PlayList_methods; - PlayList_Type.tp_as_mapping = &Playlist_as_mapping; - PlayList_Type.tp_base = 0; - PlayList_Type.tp_new = PlayList_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/pyplaylist.h b/xbmc/interfaces/python/xbmcmodule/pyplaylist.h deleted file mode 100644 index 15c1d9b242..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyplaylist.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> -#include "FileItem.h" - -#define PlayList_Check(op) PyObject_TypeCheck(op, &PlayList_Type) -#define PlayList_CheckExact(op) ((op)->ob_type == &PlayList_Type) -#define PlayListItem_Check(op) PyObject_TypeCheck(op, &PlayListItem_Type) -#define PlayListItem_CheckExact(op) ((op)->ob_type == &PlayListItem_Type) - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PLAYLIST -{ - class CPlayList; -} - -namespace PYXBMC -{ - - extern PyTypeObject PlayList_Type; - extern PyTypeObject PlayListItem_Type; - - typedef struct { - PyObject_HEAD - PLAYLIST::CPlayList *pPlayList; - int iPlayList; - } PlayList; - - typedef struct { - PyObject_HEAD - CFileItemPtr item; - } PlayListItem; - - void initPlayList_Type(); - void initPlayListItem_Type(); - -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/pyrendercapture.cpp b/xbmc/interfaces/python/xbmcmodule/pyrendercapture.cpp deleted file mode 100644 index 27f073222d..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyrendercapture.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2011 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyrendercapture.h" - -#ifdef HAS_PYRENDERCAPTURE - -#include "pyutil.h" -#include "pythreadstate.h" -#include "cores/VideoRenderers/RenderManager.h" - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* RenderCapture_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - RenderCapture *self = (RenderCapture*)type->tp_alloc(type, 0); - if (!self) - return NULL; - - self->capture = g_renderManager.AllocRenderCapture(); - if (!self->capture) - { - self->ob_type->tp_free((PyObject*)self); - return PyErr_NoMemory(); - } - - return (PyObject*)self; - } - - void RenderCapture_Dealloc(RenderCapture* self) - { - g_renderManager.ReleaseRenderCapture(self->capture); - self->ob_type->tp_free((PyObject*)self); - } - - // RenderCapture_GetWidth - PyDoc_STRVAR(getWidth__doc__, - "getWidth() -- returns width of captured image.\n"); - - PyObject* RenderCapture_GetWidth(RenderCapture *self, PyObject *args) - { - return Py_BuildValue((char*)"i", (int)self->capture->GetWidth()); - } - - // RenderCapture_GetHeight - PyDoc_STRVAR(getHeight__doc__, - "getHeight() -- returns height of captured image.\n"); - - PyObject* RenderCapture_GetHeight(RenderCapture *self, PyObject *args) - { - return Py_BuildValue((char*)"i", (int)self->capture->GetHeight()); - } - - // RenderCapture_GetCaptureState - PyDoc_STRVAR(getCaptureState__doc__, - "getCaptureState() -- returns processing state of capture request.\n" - "\n" - "The returned value could be compared against the following constants:\n" - "xbmc.CAPTURE_STATE_WORKING : Capture request in progress.\n" - "xbmc.CAPTURE_STATE_DONE : Capture request done. The image could be retrieved with getImage()\n" - "xbmc.CAPTURE_STATE_FAILED : Capture request failed.\n"); - - PyObject* RenderCapture_GetCaptureState(RenderCapture *self, PyObject *args) - { - return Py_BuildValue((char*)"i", (int)self->capture->GetUserState()); - } - - // RenderCapture_GetAspectRatio - PyDoc_STRVAR(getAspectRatio__doc__, - "getAspectRatio() -- returns aspect ratio of currently displayed video.\n"); - - PyObject* RenderCapture_GetAspectRatio(RenderCapture *self, PyObject *args) - { - return Py_BuildValue((char*)"f", g_renderManager.GetAspectRatio()); - } - - // RenderCapture_PixelFormat - PyDoc_STRVAR(getImageFormat__doc__, - "getImageFormat() -- returns format of captured image: 'BGRA' or 'RGBA'.\n"); - - PyObject* RenderCapture_GetImageFormat(RenderCapture *self, PyObject *args) - { - if (self->capture->GetCaptureFormat() == CAPTUREFORMAT_BGRA) - return Py_BuildValue((char*)"s", "BGRA"); - else if (self->capture->GetCaptureFormat() == CAPTUREFORMAT_RGBA) - return Py_BuildValue((char*)"s", "RGBA"); - - Py_INCREF(Py_None); - return Py_None; - } - - // RenderCapture_GetImage - PyDoc_STRVAR(getImage__doc__, - "getImage() -- returns captured image as a bytearray.\n" - "\n" - "The size of the image is getWidth() * getHeight() * 4\n"); - - PyObject* RenderCapture_GetImage(RenderCapture *self, PyObject *args) - { - if (self->capture->GetUserState() != CAPTURESTATE_DONE) - { - PyErr_SetString(PyExc_SystemError, "illegal user state"); - return NULL; - } - - Py_ssize_t size = self->capture->GetWidth() * self->capture->GetHeight() * 4; - return PyByteArray_FromStringAndSize((const char *)self->capture->GetPixels(), size); - } - - // RenderCapture_Capture - PyDoc_STRVAR(capture__doc__, - "capture(width, height [, flags]) -- issue capture request.\n" - "\n" - "width : Width capture image should be rendered to\n" - "height : Height capture image should should be rendered to\n" - "flags : Optional. Flags that control the capture processing.\n" - "\n" - "The value for 'flags' could be or'ed from the following constants:\n" - "xbmc.CAPTURE_FLAG_CONTINUOUS : after a capture is done, issue a new capture request immediately\n" - "xbmc.CAPTURE_FLAG_IMMEDIATELY : read out immediately when capture() is called, this can cause a busy wait\n"); - - PyObject* RenderCapture_Capture(RenderCapture *self, PyObject *args) - { - if (self->capture->GetUserState() != CAPTURESTATE_DONE && self->capture->GetUserState() != CAPTURESTATE_FAILED) - { - PyErr_SetString(PyExc_SystemError, "illegal user state"); - return NULL; - } - - int width, height, flags = 0; - if (!PyArg_ParseTuple(args, "ii|i", &width, &height, &flags)) - return NULL; - - CPyThreadState threadstate; - g_renderManager.Capture(self->capture, (unsigned int)width, (unsigned int)height, flags); - threadstate.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - // RenderCapture_WaitForCaptureStateChangeEvent - PyDoc_STRVAR(waitForCaptureStateChangeEvent__doc__, - "waitForCaptureStateChangeEvent([msecs]) -- wait for capture state change event.\n" - "\n" - "msecs : Milliseconds to wait. Waits forever if not specified.\n" - "\n" - "The method will return 1 if the Event was triggered. Otherwise it will return 0.\n"); - - PyObject* RenderCapture_WaitForCaptureStateChangeEvent(RenderCapture *self, PyObject *args) - { - bool rc; - int msecs = 0; - if (!PyArg_ParseTuple(args, "|i", &msecs)) - return NULL; - - CPyThreadState threadstate; - if (msecs) - rc = self->capture->GetEvent().WaitMSec((unsigned int)msecs); - else - rc = self->capture->GetEvent().Wait(); - threadstate.Restore(); - - return Py_BuildValue((char*)"i", (rc ? 1: 0)); - } - - - PyMethodDef RenderCapture_methods[] = { - {(char*)"getWidth", (PyCFunction)RenderCapture_GetWidth, METH_VARARGS, getWidth__doc__}, - {(char*)"getHeight", (PyCFunction)RenderCapture_GetHeight, METH_VARARGS, getHeight__doc__}, - {(char*)"getCaptureState", (PyCFunction)RenderCapture_GetCaptureState, METH_VARARGS, getCaptureState__doc__}, - {(char*)"getAspectRatio", (PyCFunction)RenderCapture_GetAspectRatio, METH_VARARGS, getAspectRatio__doc__}, - {(char*)"getImageFormat", (PyCFunction)RenderCapture_GetImageFormat, METH_VARARGS, getImageFormat__doc__}, - {(char*)"getImage", (PyCFunction)RenderCapture_GetImage, METH_VARARGS, getImage__doc__}, - {(char*)"capture", (PyCFunction)RenderCapture_Capture, METH_VARARGS, capture__doc__}, - {(char*)"waitForCaptureStateChangeEvent", (PyCFunction)RenderCapture_WaitForCaptureStateChangeEvent, METH_VARARGS, waitForCaptureStateChangeEvent__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(RenderCapture__doc__, - "RenderCapture class.\n" - "\n" - "Capture images of abitrary size of the currently displayed video stream.\n"); - -// Restore code and data sections to normal. - - PyTypeObject RenderCapture_Type; - - void initRenderCapture_Type() - { - PyXBMCInitializeTypeObject(&RenderCapture_Type); - - RenderCapture_Type.tp_name = (char*)"xbmc.RenderCapture"; - RenderCapture_Type.tp_basicsize = sizeof(RenderCapture); - RenderCapture_Type.tp_dealloc = (destructor)RenderCapture_Dealloc; - RenderCapture_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - RenderCapture_Type.tp_doc = RenderCapture__doc__; - RenderCapture_Type.tp_methods = RenderCapture_methods; - RenderCapture_Type.tp_base = 0; - RenderCapture_Type.tp_new = RenderCapture_New; - } -} - -#ifdef __cplusplus -} -#endif - -#endif //HAS_PYRENDERCAPTURE - diff --git a/xbmc/interfaces/python/xbmcmodule/pyrendercapture.h b/xbmc/interfaces/python/xbmcmodule/pyrendercapture.h deleted file mode 100644 index 24498c36b3..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyrendercapture.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2011 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include <Python.h> -#include "cores/VideoRenderers/RenderCapture.h" - -//PyByteArray_FromStringAndSize is only available in python 2.6 and up -#if PY_VERSION_HEX >= 0x02060000 - -#define HAS_PYRENDERCAPTURE - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD - CRenderCapture* capture; - } RenderCapture; - - extern PyTypeObject RenderCapture_Type; - void initRenderCapture_Type(); -} - -#ifdef __cplusplus -} -#endif - -#endif //PY_VERSION_HEX >= 0x02060000 - diff --git a/xbmc/interfaces/python/xbmcmodule/pyutil.cpp b/xbmc/interfaces/python/xbmcmodule/pyutil.cpp deleted file mode 100644 index 25afe573e2..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyutil.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "pyutil.h" -#include "pythreadstate.h" -#include <wchar.h> -#include <vector> -#include "addons/Skin.h" -#include "utils/log.h" -#include "utils/XBMCTinyXML.h" -#include "utils/CharsetConverter.h" -#include "threads/CriticalSection.h" -#include "threads/SingleLock.h" -#include "ApplicationMessenger.h" - -using namespace std; - -static CXBMCTinyXML pySkinReferences; - - -namespace PYXBMC -{ - int PyXBMCGetUnicodeString(string& buf, PyObject* pObject, int pos) - { - // TODO: UTF-8: Does python use UTF-16? - // Do we need to convert from the string charset to UTF-8 - // for non-unicode data? - if (PyUnicode_Check(pObject)) - { - - // Python unicode objects are UCS2 or UCS4 depending on compilation - // options, wchar_t is 16-bit or 32-bit depending on platform. - // Avoid the complexity by just letting python convert the string. - PyObject *utf8_pyString = PyUnicode_AsUTF8String(pObject); - - if (utf8_pyString) - { - buf = PyString_AsString(utf8_pyString); - Py_DECREF(utf8_pyString); - return 1; - } - } - if (PyString_Check(pObject)) - { - CStdString utf8String; - g_charsetConverter.unknownToUTF8(PyString_AsString(pObject), utf8String); - buf = utf8String; - return 1; - } - - // Object is not a unicode or a normal string. - buf = ""; - if (pos != -1) PyErr_Format(PyExc_TypeError, "argument %.200i must be unicode or str", pos); - return 0; - } - - void PyXBMCGUILock() - { - CPyThreadState tsg; - g_graphicsContext.Lock(); - } - - void PyXBMCGUIUnlock() - { - g_graphicsContext.Unlock(); - } - - void PyXBMCWaitForThreadMessage(int message, int param1, int param2) - { - CPyThreadState pyState; - ThreadMessage tMsg = {message, param1, param2}; - CApplicationMessenger::Get().SendMessage(tMsg, true); - } - - static char defaultImage[1024]; - /* - * Looks in references.xml for image name - * If none exist return default image name - */ - const char *PyXBMCGetDefaultImage(char* cControlType, char* cTextureType, char* cDefault) - { - // create an xml block so that we can resolve our defaults - // <control type="type"> - // <description /> - // </control> - TiXmlElement control("control"); - control.SetAttribute("type", cControlType); - TiXmlElement filler("description"); - control.InsertEndChild(filler); - g_SkinInfo->ResolveIncludes(&control); - - // ok, now check for our texture type - TiXmlElement *pTexture = control.FirstChildElement(cTextureType); - if (pTexture) - { - // found our textureType - TiXmlNode *pNode = pTexture->FirstChild(); - if (pNode && pNode->Value()[0] != '-') - { - strncpy(defaultImage, pNode->Value(), sizeof(defaultImage)); - defaultImage[sizeof(defaultImage) - 1] = '\0'; - return defaultImage; - } - } - return cDefault; - } - - bool PyXBMCWindowIsNull(void* pWindow) - { - if (pWindow == NULL) - { - PyErr_SetString(PyExc_SystemError, "Error: Window is NULL, this is not possible :-)"); - return true; - } - return false; - } - - void PyXBMCInitializeTypeObject(PyTypeObject* type_object) - { - static PyTypeObject py_type_object_header = { PyObject_HEAD_INIT(NULL) 0}; - int size = (long*)&(py_type_object_header.tp_name) - (long*)&py_type_object_header; - - memset(type_object, 0, sizeof(PyTypeObject)); - memcpy(type_object, &py_type_object_header, size); - } - - bool PyXBMCGetAddonId(std::string &addonId) - { - // we need to retrieve the addon's ID from python using - // __xbmcaddonid__ so let's get a reference to the main - // module and global dictionary - PyObject* main_module = PyImport_AddModule((char*)"__main__"); - PyObject* global_dict = PyModule_GetDict(main_module); - - // extract a reference to the function "func_name" - // from the global dictionary - PyObject* pyid = PyDict_GetItemString(global_dict, "__xbmcaddonid__"); - - // if we were unable to retrieve the addon's ID return false - if (pyid == NULL) - return false; - - addonId = PyString_AsString(pyid); - return true; - } -} - -struct SPending -{ - int(*func)(void*); - void* args; - PyThreadState* state; -}; - -typedef std::vector<SPending> CallQueue; -static CallQueue g_callQueue; -static CCriticalSection g_critSectionPyCall; - -void _PyXBMC_AddPendingCall(PyThreadState* state, int(*func)(void*), void *arg) -{ - CSingleLock lock(g_critSectionPyCall); - SPending p; - p.func = func; - p.args = arg; - p.state = state; - g_callQueue.push_back(p); -} - -void _PyXBMC_ClearPendingCalls(PyThreadState* state) -{ - CSingleLock lock(g_critSectionPyCall); - for(CallQueue::iterator it = g_callQueue.begin(); it!= g_callQueue.end();) - { - if(it->state == state) - it = g_callQueue.erase(it); - else - it++; - } -} - -void _PyXBMC_MakePendingCalls() -{ - CSingleLock lock(g_critSectionPyCall); - CallQueue::iterator iter = g_callQueue.begin(); - while (iter != g_callQueue.end()) - { - SPending p(*iter); - // only call when we are in the right thread state - if(p.state != PyThreadState_Get()) - { - iter++; - continue; - } - g_callQueue.erase(iter); - lock.Leave(); - if (p.func) - { - p.func(p.args); - - // Since the callback is likely to make it into python, and since - // not all of the callback functions handle errors, the error state - // may remain set from the previous call. As a result subsequent calls - // to callback functions exhibit odd behavior difficult to debug. - if (PyErr_Occurred()) - { - CLog::Log(LOGERROR,"Exception in python script callback execution"); - - // This clears the python error state and prints it to the log - PyErr_Print(); - } - - } - //(*((*iter).first))((*iter).second); - lock.Enter(); - iter = g_callQueue.begin(); - } -} - diff --git a/xbmc/interfaces/python/xbmcmodule/pyutil.h b/xbmc/interfaces/python/xbmcmodule/pyutil.h deleted file mode 100644 index ef2b3620bd..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/pyutil.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "utils/StdString.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// credits and version information -#define PY_XBMC_AUTHOR "Team XBMC <www.xbmc.org>" -#define PY_XBMC_CREDITS "Team XBMC" -#define PY_XBMC_PLATFORM "ALL" - -namespace PYXBMC -{ - int PyXBMCGetUnicodeString(std::string& buf, PyObject* pObject, int pos = -1); - void PyXBMCGUILock(); - void PyXBMCGUIUnlock(); - const char* PyXBMCGetDefaultImage(char* controlType, char* textureType, char* cDefault); - bool PyXBMCWindowIsNull(void* pWindow); - - void PyXBMCInitializeTypeObject(PyTypeObject* type_object); - void PyXBMCWaitForThreadMessage(int message, int param1, int param2); - - bool PyXBMCGetAddonId(std::string &addonId); -} - -// Python doesn't play nice with PyXBMC_AddPendingCall -// and PyXBMC_MakePendingCalls as it only allows them from -// the main python thread, which isn't what we want, so we have our own versions. - -#define PyXBMC_AddPendingCall _PyXBMC_AddPendingCall -#define PyXBMC_MakePendingCalls _PyXBMC_MakePendingCalls -#define PyXBMC_ClearPendingCalls _PyXBMC_ClearPendingCalls - -void _PyXBMC_AddPendingCall(PyThreadState* state, int(*func)(void*), void *arg); -void _PyXBMC_MakePendingCalls(); -void _PyXBMC_ClearPendingCalls(PyThreadState* state); - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/window.cpp b/xbmc/interfaces/python/xbmcmodule/window.cpp deleted file mode 100644 index e24b9c9d29..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/window.cpp +++ /dev/null @@ -1,1189 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "window.h" -#include "dialog.h" -#include "winxml.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "action.h" -#include "GUIPythonWindow.h" -#include "guilib/GUIButtonControl.h" -#include "guilib/GUICheckMarkControl.h" -#include "guilib/GUIRadioButtonControl.h" -#include "guilib/GUIEditControl.h" -#include "guilib/GUIWindowManager.h" -#include "settings/Settings.h" -#include "Application.h" -#include "ApplicationMessenger.h" -#include "threads/SingleLock.h" -#include "utils/log.h" - -using namespace std; - -#define ACTIVE_WINDOW g_windowManager.GetActiveWindow() - - -/** - * A CSingleLock that will relinquish the GIL during the time - * it takes to obtain the CriticalSection - */ -class GilSafeSingleLock : public CPyThreadState, public CSingleLock -{ -public: - GilSafeSingleLock(const CCriticalSection& critSec) : CPyThreadState(true), CSingleLock(critSec) { CPyThreadState::Restore(); } -}; - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - extern PyObject* ControlSpin_New(void); - - // used by Dialog to to create a new dialogWindow - bool Window_CreateNewWindow(Window* pWindow, bool bAsDialog) - { - GilSafeSingleLock lock(g_graphicsContext); - - if (pWindow->iWindowId != -1) - { - // user specified window id, use this one if it exists - // It is not possible to capture key presses or button presses - pWindow->pWindow = g_windowManager.GetWindow(pWindow->iWindowId); - if (!pWindow->pWindow) - { - PyErr_SetString(PyExc_ValueError, "Window id does not exist"); - return false; - } - pWindow->bIsPythonWindow = false; - } - else - { - // window id's 13000 - 13100 are reserved for python - // get first window id that is not in use - int id = WINDOW_PYTHON_START; - // if window 13099 is in use it means python can't create more windows - if (g_windowManager.GetWindow(WINDOW_PYTHON_END)) - { - PyErr_SetString(PyExc_Exception, "maximum number of windows reached"); - return false; - } - while(id < WINDOW_PYTHON_END && g_windowManager.GetWindow(id) != NULL) id++; - - pWindow->iWindowId = id; - pWindow->bIsPythonWindow = true; - - if (pWindow->bUsingXML) - { - if (bAsDialog) - pWindow->pWindow = new CGUIPythonWindowXMLDialog(id,pWindow->sXMLFileName,pWindow->sFallBackPath); - else - pWindow->pWindow = new CGUIPythonWindowXML(id,pWindow->sXMLFileName,pWindow->sFallBackPath); - ((CGUIPythonWindowXML*)pWindow->pWindow)->SetCallbackWindow(PyThreadState_Get(), (PyObject*)pWindow); - } - else - { - if (bAsDialog) - pWindow->pWindow = new CGUIPythonWindowDialog(id); - else - pWindow->pWindow = new CGUIPythonWindow(id); - ((CGUIPythonWindow*)pWindow->pWindow)->SetCallbackWindow(PyThreadState_Get(), (PyObject*)pWindow); - } - - g_windowManager.Add(pWindow->pWindow); - } - pWindow->iOldWindowId = 0; - pWindow->bModal = false; - pWindow->iCurrentControlId = 3000; - return true; - } - - /* Searches for a control in Window->vecControls - * If we can't find any but the window has the controlId (in case of a not python window) - * we create a new control with basic functionality - */ - Control* Window_GetControlById(Window* self, int iControlId) - { - Control* pControl = NULL; - - // find in window vector first!!! - // this saves us from creating a complete new control - vector<Control*>::iterator it = self->vecControls.begin(); - while (it != self->vecControls.end()) - { - Control* control = *it; - if (control->iControlId == iControlId) - { - Py_INCREF(control); - return control; - } else ++it; - } - - // lock xbmc GUI before accessing data from it - GilSafeSingleLock lock(g_graphicsContext); - - // check if control exists - CGUIControl* pGUIControl = (CGUIControl*)self->pWindow->GetControl(iControlId); - if (!pGUIControl) - { - // control does not exist. - CStdString error; - error.Format("Non-Existent Control %d",iControlId); - PyErr_SetString(PyExc_TypeError, error.c_str()); - return NULL; - } - - // allocate a new control with a new reference - CLabelInfo li; - switch(pGUIControl->GetControlType()) - { - case CGUIControl::GUICONTROL_BUTTON: - pControl = (Control*)ControlButton_Type.tp_alloc(&ControlButton_Type, 0); - new(&((ControlButton*)pControl)->strFont) string(); - new(&((ControlButton*)pControl)->strText) string(); - new(&((ControlButton*)pControl)->strText2) string(); - new(&((ControlButton*)pControl)->strTextureFocus) string(); - new(&((ControlButton*)pControl)->strTextureNoFocus) string(); - - li = ((CGUIButtonControl *)pGUIControl)->GetLabelInfo(); - - // note: conversion from infocolors -> plain colors here - ((ControlButton*)pControl)->disabledColor = li.disabledColor; - ((ControlButton*)pControl)->focusedColor = li.focusedColor; - ((ControlButton*)pControl)->textColor = li.textColor; - ((ControlButton*)pControl)->shadowColor = li.shadowColor; - if (li.font) ((ControlButton*)pControl)->strFont = li.font->GetFontName(); - ((ControlButton*)pControl)->align = li.align; - break; - case CGUIControl::GUICONTROL_CHECKMARK: - pControl = (Control*)ControlCheckMark_Type.tp_alloc(&ControlCheckMark_Type, 0); - new(&((ControlCheckMark*)pControl)->strFont) string(); - new(&((ControlCheckMark*)pControl)->strText) string(); - new(&((ControlCheckMark*)pControl)->strTextureFocus) string(); - new(&((ControlCheckMark*)pControl)->strTextureNoFocus) string(); - - li = ((CGUICheckMarkControl *)pGUIControl)->GetLabelInfo(); - - // note: conversion to plain colors from infocolors. - ((ControlCheckMark*)pControl)->disabledColor = li.disabledColor; - //((ControlCheckMark*)pControl)->shadowColor = li.shadowColor; - ((ControlCheckMark*)pControl)->textColor = li.textColor; - if (li.font) ((ControlCheckMark*)pControl)->strFont = li.font->GetFontName(); - ((ControlCheckMark*)pControl)->align = li.align; - break; - case CGUIControl::GUICONTROL_LABEL: - pControl = (Control*)ControlLabel_Type.tp_alloc(&ControlLabel_Type, 0); - new(&((ControlLabel*)pControl)->strText) string(); - new(&((ControlLabel*)pControl)->strFont) string(); - break; - case CGUIControl::GUICONTROL_SPIN: - pControl = (Control*)ControlSpin_Type.tp_alloc(&ControlSpin_Type, 0); - new(&((ControlSpin*)pControl)->strTextureUp) string(); - new(&((ControlSpin*)pControl)->strTextureDown) string(); - new(&((ControlSpin*)pControl)->strTextureUpFocus) string(); - new(&((ControlSpin*)pControl)->strTextureDownFocus) string(); - break; - case CGUIControl::GUICONTROL_FADELABEL: - pControl = (Control*)ControlFadeLabel_Type.tp_alloc(&ControlFadeLabel_Type, 0); - new(&((ControlFadeLabel*)pControl)->strFont) string(); - new(&((ControlFadeLabel*)pControl)->vecLabels) std::vector<string>(); - break; - case CGUIControl::GUICONTROL_TEXTBOX: - pControl = (Control*)ControlTextBox_Type.tp_alloc(&ControlTextBox_Type, 0); - new(&((ControlTextBox*)pControl)->strFont) string(); - break; - case CGUIControl::GUICONTROL_IMAGE: - pControl = (Control*)ControlImage_Type.tp_alloc(&ControlImage_Type, 0); - new(&((ControlImage*)pControl)->strFileName) string(); - break; - case CGUIControl::GUICONTROL_PROGRESS: - pControl = (Control*)ControlProgress_Type.tp_alloc(&ControlProgress_Type, 0); - new(&((ControlProgress*)pControl)->strTextureLeft) string(); - new(&((ControlProgress*)pControl)->strTextureMid) string(); - new(&((ControlProgress*)pControl)->strTextureRight) string(); - new(&((ControlProgress*)pControl)->strTextureBg) string(); - new(&((ControlProgress*)pControl)->strTextureOverlay) string(); - break; - case CGUIControl::GUICONTROL_SLIDER: - pControl = (Control*)ControlSlider_Type.tp_alloc(&ControlSlider_Type, 0); - new(&((ControlSlider*)pControl)->strTextureBack) string(); - new(&((ControlSlider*)pControl)->strTexture) string(); - new(&((ControlSlider*)pControl)->strTextureFoc) string(); - break; - case CGUIControl::GUICONTAINER_LIST: - case CGUIControl::GUICONTAINER_WRAPLIST: - case CGUIControl::GUICONTAINER_FIXEDLIST: - case CGUIControl::GUICONTAINER_PANEL: - pControl = (Control*)ControlList_Type.tp_alloc(&ControlList_Type, 0); - new(&((ControlList*)pControl)->strFont) string(); - new(&((ControlList*)pControl)->strTextureButton) string(); - new(&((ControlList*)pControl)->strTextureButtonFocus) string(); - new(&((ControlList*)pControl)->vecItems) std::vector<PYXBMC::ListItem*>(); - // create a python spin control - ((ControlList*)pControl)->pControlSpin = (ControlSpin*)ControlSpin_New(); - break; - case CGUIControl::GUICONTROL_GROUP: - pControl = (Control*)ControlGroup_Type.tp_alloc(&ControlGroup_Type, 0); - break; - case CGUIControl::GUICONTROL_RADIO: - pControl = (Control*)ControlRadioButton_Type.tp_alloc(&ControlRadioButton_Type, 0); - new(&((ControlRadioButton*)pControl)->strFont) string(); - new(&((ControlRadioButton*)pControl)->strText) string(); - new(&((ControlRadioButton*)pControl)->strTextureFocus) string(); - new(&((ControlRadioButton*)pControl)->strTextureNoFocus) string(); - new(&((ControlRadioButton*)pControl)->strTextureRadioFocus) string(); - new(&((ControlRadioButton*)pControl)->strTextureRadioNoFocus) string(); - - li = ((CGUIRadioButtonControl *)pGUIControl)->GetLabelInfo(); - - // note: conversion from infocolors -> plain colors here - ((ControlRadioButton*)pControl)->disabledColor = li.disabledColor; - ((ControlRadioButton*)pControl)->focusedColor = li.focusedColor; - ((ControlRadioButton*)pControl)->textColor = li.textColor; - ((ControlRadioButton*)pControl)->shadowColor = li.shadowColor; - if (li.font) ((ControlRadioButton*)pControl)->strFont = li.font->GetFontName(); - ((ControlRadioButton*)pControl)->align = li.align; - break; - case CGUIControl::GUICONTROL_EDIT: - pControl = (Control*)ControlEdit_Type.tp_alloc(&ControlEdit_Type, 0); - new(&((ControlEdit*)pControl)->strFont) string(); - new(&((ControlEdit*)pControl)->strText) string(); - new(&((ControlEdit*)pControl)->strTextureFocus) string(); - new(&((ControlEdit*)pControl)->strTextureNoFocus) string(); - - li = ((CGUIEditControl *)pGUIControl)->GetLabelInfo(); - - // note: conversion from infocolors -> plain colors here - ((ControlEdit*)pControl)->disabledColor = li.disabledColor; - ((ControlEdit*)pControl)->textColor = li.textColor; - if (li.font) ((ControlEdit*)pControl)->strFont = li.font->GetFontName(); - ((ControlButton*)pControl)->align = li.align; - break; - default: - break; - } - - if (!pControl) - { - // throw an exeption - PyErr_SetString(PyExc_Exception, "Unknown control type for python"); - return NULL; - } - - Py_INCREF(pControl); - // we have a valid control here, fill in all the 'Control' data - pControl->pGUIControl = pGUIControl; - pControl->iControlId = pGUIControl->GetID(); - pControl->iParentId = self->iWindowId; - pControl->dwHeight = (int)pGUIControl->GetHeight(); - pControl->dwWidth = (int)pGUIControl->GetWidth(); - pControl->dwPosX = (int)pGUIControl->GetXPosition(); - pControl->dwPosY = (int)pGUIControl->GetYPosition(); - pControl->iControlUp = pGUIControl->GetControlIdUp(); - pControl->iControlDown = pGUIControl->GetControlIdDown(); - pControl->iControlLeft = pGUIControl->GetControlIdLeft(); - pControl->iControlRight = pGUIControl->GetControlIdRight(); - - // It got this far so means the control isn't actually in the vector of controls - // so lets add it to save doing all that next time - self->vecControls.push_back(pControl); - - // return the control with increased reference (+1) - return pControl; - } - - PyObject* Window_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - Window *self; - - self = (Window*)type->tp_alloc(type, 0); - if (!self) return NULL; - new(&self->sXMLFileName) string(); - new(&self->sFallBackPath) string(); - new(&self->vecControls) std::vector<Control*>(); - - self->iWindowId = -1; - - if (!PyArg_ParseTuple(args, (char*)"|i", &self->iWindowId)) return NULL; - - // create new GUIWindow - if (!Window_CreateNewWindow(self, false)) - { - // error is already set by Window_CreateNewWindow, just release the memory - self->vecControls.clear(); - self->vecControls.~vector(); - self->sFallBackPath.~string(); - self->sXMLFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - return NULL; - } - - return (PyObject*)self; - } - - void Window_Dealloc(Window* self) - { - GilSafeSingleLock lock(g_graphicsContext); - if (self->bIsPythonWindow) - { - // first change to an existing window - if (ACTIVE_WINDOW == self->iWindowId && !g_application.m_bStop) - { - if(g_windowManager.GetWindow(self->iOldWindowId)) - { - g_windowManager.ActivateWindow(self->iOldWindowId); - } - // old window does not exist anymore, switch to home - else g_windowManager.ActivateWindow(WINDOW_HOME); - } - // no callbacks are possible any longer - ((CGUIPythonWindowXML*)self->pWindow)->SetCallbackWindow(NULL, NULL); - } - else - { - // BUG: - // This is an existing window, so no resources are free'd. Note that - // THIS WILL FAIL for any controls newly created by python - they will - // remain after the script ends. Ideally this would be remedied by - // a flag in Control that specifies that it was python created - any python - // created controls could then be removed + free'd from the window. - // how this works with controlgroups though could be a bit tricky. - } - - // and free our list of controls - std::vector<Control*>::iterator it = self->vecControls.begin(); - while (it != self->vecControls.end()) - { - Control* pControl = *it; - // initialize control to zero - pControl->pGUIControl = NULL; - pControl->iControlId = 0; - pControl->iParentId = 0; - Py_DECREF(pControl); - ++it; - } - - if (self->bIsPythonWindow) - { - if (self->pWindow && g_windowManager.IsWindowVisible(self->iWindowId)) - { - // if window isn't closed - mark it to delete itself after deiniting - // and trigger window closing - if (self->bUsingXML) - ((CGUIPythonWindowXML*)self->pWindow)->SetDestroyAfterDeinit(); - else - ((CGUIPythonWindow*)self->pWindow)->SetDestroyAfterDeinit(); - Window_Close(self, NULL); - } - else - g_windowManager.Delete(self->iWindowId); - } - - lock.Leave(); - self->vecControls.clear(); - self->vecControls.~vector(); - self->sFallBackPath.~string(); - self->sXMLFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - } - - PyDoc_STRVAR(show__doc__, - "show(self) -- Show this window.\n" - "\n" - "Shows this window by activating it, calling close() after it wil activate the\n" - "current window again.\n" - "Note, if your script ends this window will be closed to. To show it forever, \n" - "make a loop at the end of your script ar use doModal() instead"); - - PyObject* Window_Show(Window *self, PyObject *args) - { - if (self->iOldWindowId != self->iWindowId && - self->iWindowId != ACTIVE_WINDOW) - self->iOldWindowId = ACTIVE_WINDOW; - - // if it's a dialog, we have to activate it a bit different - if (WindowDialog_Check(self) || WindowXMLDialog_Check(self)) - { - CPyThreadState pyState; - ThreadMessage tMsg = {TMSG_GUI_PYTHON_DIALOG, WindowXMLDialog_Check(self) ? 1 : 0, 1}; - tMsg.lpVoid = self->pWindow; - CApplicationMessenger::Get().SendMessage(tMsg, true); - } - else - { - CPyThreadState pyState; - vector<CStdString> params; - CApplicationMessenger::Get().ActivateWindow(self->iWindowId, params, false); - } - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(close__doc__, - "close(self) -- Closes this window.\n" - "\n" - "Closes this window by activating the old window.\n" - "The window is not deleted with this method."); - - PyObject* Window_Close(Window *self, PyObject *args) - { - self->bModal = false; - if (self->bIsPythonWindow) - { - if (WindowXML_Check(self)) - ((CGUIPythonWindowXML*)self->pWindow)->PulseActionEvent(); - else if (WindowXMLDialog_Check(self)) - ((CGUIPythonWindowXMLDialog*)self->pWindow)->PulseActionEvent(); - else - ((CGUIPythonWindow*)self->pWindow)->PulseActionEvent(); - } - - // if it's a dialog, we have to close it a bit different - if (WindowDialog_Check(self) || WindowXMLDialog_Check(self)) - { - CPyThreadState pyState; - ThreadMessage tMsg = {TMSG_GUI_PYTHON_DIALOG, WindowXMLDialog_Check(self) ? 1 : 0, 0}; - tMsg.lpVoid = self->pWindow; - CApplicationMessenger::Get().SendMessage(tMsg, true); - } - else - { - CPyThreadState pyState; - vector<CStdString> params; - CApplicationMessenger::Get().ActivateWindow(self->iOldWindowId, params, false); - } - self->iOldWindowId = 0; - - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(onAction__doc__, - "onAction(self, Action action) -- onAction method.\n" - "\n" - "This method will recieve all actions that the main program will send\n" - "to this window.\n" - "By default, only the PREVIOUS_MENU and NAV_BACK actions are handled.\n" - "Overwrite this method to let your script handle all actions.\n" - "Don't forget to capture ACTION_PREVIOUS_MENU or ACTION_NAV_BACK, else the user can't close this window."); - - PyObject* Window_OnAction(Window *self, PyObject *args) - { - Action* action; - if (!PyArg_ParseTuple(args, (char*)"O", &action)) return NULL; - - if(action->id == ACTION_PREVIOUS_MENU || action->id == ACTION_NAV_BACK) - { - Window_Close(self, args); - } - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(onClick__doc__, - "onClick(self, Control control) -- onClick method.\n" - "\n" - "This method will recieve all click events that the main program will send\n" - "to this window.\n"); - - PyDoc_STRVAR(onFocus__doc__, - "onFocus(self, Control control) -- onFocus method.\n" - "\n" - "This method will recieve all focus events that the main program will send\n" - "to this window.\n"); - - PyDoc_STRVAR(onInit__doc__, - "onInit(self) -- onInit method.\n" - "\n" - "This method will be called to initialize the window\n"); - - static PyObject* Window_OnNone(Window *self, PyObject *args) - { - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(doModal__doc__, - "doModal(self) -- Display this window until close() is called."); - - PyObject* Window_DoModal(Window *self, PyObject *args) - { - if (self->bIsPythonWindow) - { - self->bModal = true; - - if(self->iWindowId != ACTIVE_WINDOW) Window_Show(self, NULL); - - while (self->bModal && !g_application.m_bStop) - { - // Check if XBPyThread::stop() raised a SystemExit exception - if (PyThreadState_Get()->async_exc == PyExc_SystemExit) - { - CLog::Log(LOGDEBUG, "PYTHON: doModal() encountered a SystemExit exception, closing window and returning"); - Window_Close(self, NULL); - break; - } - - PyXBMC_MakePendingCalls(); - - CPyThreadState pyState; - if (WindowXML_Check(self)) - ((CGUIPythonWindowXML*)self->pWindow)->WaitForActionEvent(); - else if (WindowXMLDialog_Check(self)) - ((CGUIPythonWindowXMLDialog*)self->pWindow)->WaitForActionEvent(); - else - ((CGUIPythonWindow*)self->pWindow)->WaitForActionEvent(); - } - } - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(addControl__doc__, - "addControl(self, Control) -- Add a Control to this window.\n" - "\n" - "Throws: TypeError, if supplied argument is not a Control type\n" - " ReferenceError, if control is already used in another window\n" - " RuntimeError, should not happen :-)\n" - "\n" - "The next controls can be added to a window atm\n" - "\n" - " -ControlLabel\n" - " -ControlFadeLabel\n" - " -ControlTextBox\n" - " -ControlButton\n" - " -ControlCheckMark\n" - " -ControlList\n" - " -ControlGroup\n" - " -ControlImage\n" - " -ControlRadioButton\n" - " -ControlProgress\n"); - - PyObject* Window_AddControl(Window *self, PyObject *args) - { - PyObject* object; - - if (!PyArg_ParseTuple(args, (char*)"O", &object)) return NULL; - - if (!Window_AddSingleControl(self, object, true)) - return NULL; - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(addControls__doc__, - "addControls(self, List) -- Add a list of Controls to this window.\n" - "\n" - "Throws: TypeError, if supplied argument is not of List type, or a control is not of Control type\n" - " ReferenceError, if control is already used in another window\n" - " RuntimeError, should not happen :-)\n"); - - PyObject* Window_AddControls(Window *self, PyObject *args) - { - PyObject* object; - - if (!PyArg_ParseTuple(args, (char*)"O", &object)) return NULL; - - if (!PyList_Check(object)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - for (int i = 0; i < PyList_Size(object); i++) - { - if (!Window_AddSingleControl(self, PyList_GetItem(object,i), i+1 == PyList_Size(object))) - return NULL; - } - - Py_INCREF(Py_None); - return Py_None; - } - - bool Window_AddSingleControl(Window *self, PyObject *control, bool wait) - { - // type checking, object should be of type Control - if(!Control_Check(control)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return false; - } - Control *pControl = (Control *)control; - - if(pControl->iControlId != 0) - { - PyErr_SetString(PyExc_ReferenceError, "Control is already used"); - return false; - } - - pControl->iParentId = self->iWindowId; - - { // assign control id, if id is already in use, try next id - GilSafeSingleLock lock(g_graphicsContext); - do pControl->iControlId = ++self->iCurrentControlId; - while (self->pWindow->GetControl(pControl->iControlId)); - } - - // Control Label - if (ControlLabel_Check(pControl)) - ControlLabel_Create((ControlLabel*)pControl); - - // Control Fade Label - else if (ControlFadeLabel_Check(pControl)) - ControlFadeLabel_Create((ControlFadeLabel*)pControl); - - // Control TextBox - else if (ControlTextBox_Check(pControl)) - ControlTextBox_Create((ControlTextBox*)pControl); - - // Control Button - else if (ControlButton_Check(pControl)) - ControlButton_Create((ControlButton*)pControl); - - // Control CheckMark - else if (ControlCheckMark_Check(pControl)) - ControlCheckMark_Create((ControlCheckMark*)pControl); - - // Image - else if (ControlImage_Check(pControl)) - ControlImage_Create((ControlImage*)pControl); - - // Control List - else if (ControlList_Check(pControl)) - ControlList_Create((ControlList*)pControl); - - // Control Progress - else if (ControlProgress_Check(pControl)) - ControlProgress_Create((ControlProgress*)pControl); - - // Control Slider - else if (ControlSlider_Check(pControl)) - ControlSlider_Create((ControlSlider*)pControl); - - // Control Group - else if (ControlGroup_Check(pControl)) - ControlGroup_Create((ControlGroup*)pControl); - - // Control RadioButton - else if (ControlRadioButton_Check(pControl)) - ControlRadioButton_Create((ControlRadioButton*)pControl); - - else if (ControlEdit_Check(pControl)) - ControlEdit_Create((ControlEdit*)pControl); - //unknown control type to add, should not happen - else - { - PyErr_SetString(PyExc_RuntimeError, "Object is a Control, but can't be added to a window"); - return false; - } - - Py_INCREF(pControl); - - // set default navigation for control - pControl->iControlUp = pControl->iControlId; - pControl->iControlDown = pControl->iControlId; - pControl->iControlLeft = pControl->iControlId; - pControl->iControlRight = pControl->iControlId; - - pControl->pGUIControl->SetNavigation(pControl->iControlUp, - pControl->iControlDown, pControl->iControlLeft, pControl->iControlRight); - - self->vecControls.push_back(pControl); - { - CPyThreadState state; - CGUIMessage msg(GUI_MSG_ADD_CONTROL, 0, 0); - msg.SetPointer(pControl->pGUIControl); - CApplicationMessenger::Get().SendGUIMessage(msg, self->iWindowId, wait); - } - return true; - } - - bool Window_RemoveSingleControl(Window *self, PyObject *object, bool wait) - { - // type checking, object should be of type Control - if(!Control_Check(object)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return false; - } - Control *pControl = (Control *)object; - - { - CPyThreadState state; - CSingleLock lock(g_graphicsContext); - if(!self->pWindow->GetControl(pControl->iControlId)) - { - lock.Leave(); - state.Restore(); - PyErr_SetString(PyExc_RuntimeError, "Control does not exist in window"); - return false; - } - } - - // delete control from vecControls in window object - for (vector<Control*>::iterator it = self->vecControls.begin(); it != self->vecControls.end(); ++it) - { - if ((*it)->iControlId == pControl->iControlId) - { - self->vecControls.erase(it); - break; - } - } - - { - CPyThreadState state; - CGUIMessage msg(GUI_MSG_REMOVE_CONTROL, 0, 0); - msg.SetPointer(pControl->pGUIControl); - CApplicationMessenger::Get().SendGUIMessage(msg, self->iWindowId, wait); - } - - // initialize control to zero - pControl->pGUIControl = NULL; - pControl->iControlId = 0; - pControl->iParentId = 0; - Py_DECREF(pControl); - return true; - } - - PyDoc_STRVAR(getControl__doc__, - "getControl(self, int controlId) -- Get's the control from this window.\n" - "\n" - "Throws: Exception, if Control doesn't exist\n" - "\n" - "controlId doesn't have to be a python control, it can be a control id\n" - "from a xbmc window too (you can find id's in the xml files\n" - "\n" - "Note, not python controls are not completely usable yet\n" - "You can only use the Control functions\n" - ""); - - PyObject* Window_GetControl(Window *self, PyObject *args) - { - int iControlId; - if (!PyArg_ParseTuple(args, (char*)"i", &iControlId)) return NULL; - - return (PyObject*)Window_GetControlById(self, iControlId); - } - - PyDoc_STRVAR(setFocus__doc__, - "setFocus(self, Control) -- Give the supplied control focus.\n" - "Throws: TypeError, if supplied argument is not a Control type\n" - " SystemError, on Internal error\n" - " RuntimeError, if control is not added to a window\n" - "\n"); - - PyObject* Window_SetFocus(Window *self, PyObject *args) - { - Control* pControl; - if (!PyArg_ParseTuple(args, (char*)"O", &pControl)) return NULL; - // type checking, object should be of type Control - if(!Control_Check(pControl)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type Control"); - return NULL; - } - - CGUIMessage msg = CGUIMessage(GUI_MSG_SETFOCUS,pControl->iParentId, pControl->iControlId); - g_windowManager.SendThreadMessage(msg, pControl->iParentId); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setFocusId__doc__, - "setFocusId(self, int) -- Gives the control with the supplied focus.\n" - "Throws: \n" - " SystemError, on Internal error\n" - " RuntimeError, if control is not added to a window\n" - "\n"); - - PyObject* Window_SetFocusId(Window *self, PyObject *args) - { - int iControlId; - if (!PyArg_ParseTuple(args, (char*)"i", &iControlId)) return NULL; - - CGUIMessage msg = CGUIMessage(GUI_MSG_SETFOCUS,self->iWindowId,iControlId); - g_windowManager.SendThreadMessage(msg, self->iWindowId); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getFocus__doc__, - "getFocus(self, Control) -- returns the control which is focused.\n" - "Throws: SystemError, on Internal error\n" - " RuntimeError, if no control has focus\n" - "\n"); - - PyObject* Window_GetFocus(Window *self, PyObject *args) - { - GilSafeSingleLock lock(g_graphicsContext); - - int iControlId = self->pWindow->GetFocusedControlID(); - if(iControlId == -1) - { - PyErr_SetString(PyExc_RuntimeError, "No control in this window has focus"); - return NULL; - } - lock.Leave(); - - return (PyObject*)Window_GetControlById(self, iControlId); - } - - PyDoc_STRVAR(getFocusId__doc__, - "getFocusId(self, int) -- returns the id of the control which is focused.\n" - "Throws: SystemError, on Internal error\n" - " RuntimeError, if no control has focus\n" - "\n"); - - PyObject* Window_GetFocusId(Window *self, PyObject *args) - { - GilSafeSingleLock lock(g_graphicsContext); - int iControlId = self->pWindow->GetFocusedControlID(); - if(iControlId == -1) - { - PyErr_SetString(PyExc_RuntimeError, "No control in this window has focus"); - return NULL; - } - - return PyLong_FromLong((long)iControlId); - } - - PyDoc_STRVAR(removeControl__doc__, - "removeControl(self, Control) -- Removes the control from this window.\n" - "\n" - "Throws: TypeError, if supplied argument is not a Control type\n" - " RuntimeError, if control is not added to this window\n" - "\n" - "This will not delete the control. It is only removed from the window."); - - PyObject* Window_RemoveControl(Window *self, PyObject *args) - { - PyObject* object; - if (!PyArg_ParseTuple(args, (char*)"O", &object)) return NULL; - - if (!Window_RemoveSingleControl(self, object, true)) - return NULL; - - Py_INCREF(Py_None); - return Py_None; - } - PyDoc_STRVAR(removeControls__doc__, - "removeControls(self, List) -- Removes a list of controls from this window.\n" - "\n" - "Throws: TypeError, if supplied argument is not a Control type\n" - " RuntimeError, if control is not added to this window\n" - "\n" - "This will not delete the controls. They are only removed from the window."); - - PyObject* Window_RemoveControls(Window *self, PyObject *args) - { - PyObject* object; - if (!PyArg_ParseTuple(args, (char*)"O", &object)) return NULL; - - if (!PyList_Check(object)) - { - PyErr_SetString(PyExc_TypeError, "Object should be of type List"); - return NULL; - } - for (int i = 0; i < PyList_Size(object); i++) - { - if (!Window_RemoveSingleControl(self, PyList_GetItem(object,i), i+1 == PyList_Size(object))) - return NULL; - } - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getHeight__doc__, - "getHeight(self) -- Returns the height of this screen."); - - PyObject* Window_GetHeight(Window *self, PyObject *args) - { - return PyLong_FromLong(g_graphicsContext.GetHeight()); - } - - PyDoc_STRVAR(getWidth__doc__, - "getWidth(self) -- Returns the width of this screen."); - - PyObject* Window_GetWidth(Window *self, PyObject *args) - { - return PyLong_FromLong(g_graphicsContext.GetWidth()); - } - - PyDoc_STRVAR(getResolution__doc__, - "getResolution(self) -- Returns the resolution of the screen." - " The returned value is one of the following:\n" - " 0 - 1080i (1920x1080)\n" - " 1 - 720p (1280x720)\n" - " 2 - 480p 4:3 (720x480)\n" - " 3 - 480p 16:9 (720x480)\n" - " 4 - NTSC 4:3 (720x480)\n" - " 5 - NTSC 16:9 (720x480)\n" - " 6 - PAL 4:3 (720x576)\n" - " 7 - PAL 16:9 (720x576)\n" - " 8 - PAL60 4:3 (720x480)\n" - " 9 - PAL60 16:9 (720x480)\n"); - - PyObject* Window_GetResolution(Window *self, PyObject *args) - { - return PyLong_FromLong((long)g_graphicsContext.GetVideoResolution()); - } - - PyDoc_STRVAR(setCoordinateResolution__doc__, - "setCoordinateResolution(self, int resolution) -- Sets the resolution\n" - "that the coordinates of all controls are defined in. Allows XBMC\n" - "to scale control positions and width/heights to whatever resolution\n" - "XBMC is currently using.\n" - " resolution is one of the following:\n" - " 0 - 1080i (1920x1080)\n" - " 1 - 720p (1280x720)\n" - " 2 - 480p 4:3 (720x480)\n" - " 3 - 480p 16:9 (720x480)\n" - " 4 - NTSC 4:3 (720x480)\n" - " 5 - NTSC 16:9 (720x480)\n" - " 6 - PAL 4:3 (720x576)\n" - " 7 - PAL 16:9 (720x576)\n" - " 8 - PAL60 4:3 (720x480)\n" - " 9 - PAL60 16:9 (720x480)\n"); - - PyObject* Window_SetCoordinateResolution(Window *self, PyObject *args) - { - long res; - if (!PyArg_ParseTuple(args, (char*)"l", &res)) return NULL; - - if (res < RES_HDTV_1080i || res > RES_AUTORES) - { - PyErr_SetString(PyExc_RuntimeError, "Invalid resolution."); - return NULL; - } - - GilSafeSingleLock lock(g_graphicsContext); - self->pWindow->SetCoordsRes(g_settings.m_ResInfo[res]); - - Py_INCREF(Py_None); - return Py_None; - } - - // setProperty() method - PyDoc_STRVAR(setProperty__doc__, - "setProperty(key, value) -- Sets a window property, similar to an infolabel.\n" - "\n" - "key : string - property name.\n" - "value : string or unicode - value of property.\n" - "\n" - "*Note, key is NOT case sensitive. Setting value to an empty string is equivalent to clearProperty(key)\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - win = xbmcgui.Window(xbmcgui.getCurrentWindowId())\n" - " - win.setProperty('Category', 'Newest')\n"); - - PyObject* Window_SetProperty(Window *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "key", "value", NULL }; - char *key = NULL; - PyObject *value = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &key, - &value)) - { - return NULL; - } - if (!key || !value) return NULL; - - CStdString uText; - if (!PyXBMCGetUnicodeString(uText, value, 1)) - return NULL; - - CStdString lowerKey = key; - { - CPyThreadState gil; - CSingleLock lock(g_graphicsContext); - - self->pWindow->SetProperty(lowerKey.ToLower(), uText); - } - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getProperty__doc__, - "getProperty(key) -- Returns a window property as a string, similar to an infolabel.\n" - "\n" - "key : string - property name.\n" - "\n" - "*Note, key is NOT case sensitive.\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - win = xbmcgui.Window(xbmcgui.getCurrentWindowId())\n" - " - category = win.getProperty('Category')\n"); - - PyObject* Window_GetProperty(Window *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "key", NULL }; - char *key = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &key)) - { - return NULL; } - if (!key) return NULL; - - GilSafeSingleLock lock(g_graphicsContext); - CStdString lowerKey = key; - string value = self->pWindow->GetProperty(lowerKey.ToLower()).asString(); - - return Py_BuildValue((char*)"s", value.c_str()); - } - - PyDoc_STRVAR(clearProperty__doc__, - "clearProperty(key) -- Clears the specific window property.\n" - "\n" - "key : string - property name.\n" - "\n" - "*Note, key is NOT case sensitive. Equivalent to setProperty(key,'')\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - win = xbmcgui.Window(xbmcgui.getCurrentWindowId())\n" - " - win.clearProperty('Category')\n"); - - PyObject* Window_ClearProperty(Window *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "key", NULL }; - char *key = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &key)) - { - return NULL; - } - if (!key) return NULL; - GilSafeSingleLock lock(g_graphicsContext); - - CStdString lowerKey = key; - self->pWindow->SetProperty(lowerKey.ToLower(), ""); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(clearProperties__doc__, - "clearProperties() -- Clears all window properties.\n" - "\n" - "example:\n" - " - win = xbmcgui.Window(xbmcgui.getCurrentWindowId())\n" - " - win.clearProperties()\n"); - - PyObject* Window_ClearProperties(Window *self, PyObject *args) - { - GilSafeSingleLock lock(g_graphicsContext); - self->pWindow->ClearProperties(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyMethodDef Window_methods[] = { - //{(char*)"load", (PyCFunction)Window_Load, METH_VARARGS, ""}, - {(char*)"onAction", (PyCFunction)Window_OnAction, METH_VARARGS, onAction__doc__}, - {(char*)"onInit" , (PyCFunction)Window_OnNone , METH_VARARGS, onInit__doc__}, - {(char*)"onFocus", (PyCFunction)Window_OnNone, METH_VARARGS , onFocus__doc__}, - {(char*)"onClick", (PyCFunction)Window_OnNone, METH_VARARGS , onClick__doc__}, - {(char*)"doModal", (PyCFunction)Window_DoModal, METH_VARARGS, doModal__doc__}, - {(char*)"show", (PyCFunction)Window_Show, METH_VARARGS, show__doc__}, - {(char*)"close", (PyCFunction)Window_Close, METH_VARARGS, close__doc__}, - {(char*)"addControl", (PyCFunction)Window_AddControl, METH_VARARGS, addControl__doc__}, - {(char*)"addControls", (PyCFunction)Window_AddControls, METH_VARARGS, addControls__doc__}, - {(char*)"getControl", (PyCFunction)Window_GetControl, METH_VARARGS, getControl__doc__}, - {(char*)"removeControl", (PyCFunction)Window_RemoveControl, METH_VARARGS, removeControl__doc__}, - {(char*)"removeControls", (PyCFunction)Window_RemoveControls, METH_VARARGS, removeControls__doc__}, - {(char*)"setFocus", (PyCFunction)Window_SetFocus, METH_VARARGS, setFocus__doc__}, - {(char*)"setFocusId", (PyCFunction)Window_SetFocusId, METH_VARARGS, setFocusId__doc__}, - {(char*)"getFocus", (PyCFunction)Window_GetFocus, METH_VARARGS, getFocus__doc__}, - {(char*)"getFocusId", (PyCFunction)Window_GetFocusId, METH_VARARGS, getFocusId__doc__}, - {(char*)"getHeight", (PyCFunction)Window_GetHeight, METH_VARARGS, getHeight__doc__}, - {(char*)"getWidth", (PyCFunction)Window_GetWidth, METH_VARARGS, getWidth__doc__}, - {(char*)"getResolution", (PyCFunction)Window_GetResolution, METH_VARARGS, getResolution__doc__}, - {(char*)"setCoordinateResolution", (PyCFunction)Window_SetCoordinateResolution, METH_VARARGS, setCoordinateResolution__doc__}, - {(char*)"setProperty", (PyCFunction)Window_SetProperty, METH_VARARGS|METH_KEYWORDS, setProperty__doc__}, - {(char*)"getProperty", (PyCFunction)Window_GetProperty, METH_VARARGS|METH_KEYWORDS, getProperty__doc__}, - {(char*)"clearProperty", (PyCFunction)Window_ClearProperty, METH_VARARGS|METH_KEYWORDS, clearProperty__doc__}, - {(char*)"clearProperties", (PyCFunction)Window_ClearProperties, METH_VARARGS, clearProperties__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(window_documentation, - "Window class.\n" - "\n" - "Window(self[, int windowId) -- Create a new Window to draw on.\n" - " Specify an id to use an existing window.\n" - "\n" - "Throws: ValueError, if supplied window Id does not exist.\n" - " Exception, if more then 200 windows are created.\n" - "\n" - "Deleting this window will activate the old window that was active\n" - "and resets (not delete) all controls that are associated with this window."); - -// Restore code and data sections to normal. - - PyTypeObject Window_Type; - - void initWindow_Type() - { - PyXBMCInitializeTypeObject(&Window_Type); - - Window_Type.tp_name = (char*)"xbmcgui.Window"; - Window_Type.tp_basicsize = sizeof(Window); - Window_Type.tp_dealloc = (destructor)Window_Dealloc; - Window_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - Window_Type.tp_doc = window_documentation; - Window_Type.tp_methods = Window_methods; - Window_Type.tp_new = Window_New; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/window.h b/xbmc/interfaces/python/xbmcmodule/window.h deleted file mode 100644 index 7c7e344875..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/window.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "GUIPythonWindow.h" -#include "GUIPythonWindowXML.h" -#include "GUIPythonWindowXMLDialog.h" -#include "GUIPythonWindowDialog.h" -#include "control.h" - -#pragma once - -#define Window_Check(op) PyObject_TypeCheck(op, &Window_Type) -#define Window_CheckExact(op) ((op)->ob_type == &Window_Type) - -#define WindowXML_Check(op) PyObject_TypeCheck(op, &WindowXML_Type) -#define WindowXML_CheckExact(op) ((op)->ob_type == &WindowXML_Type) - -#define WindowDialog_Check(op) PyObject_TypeCheck(op, &WindowDialog_Type) -#define WindowDialog_CheckExact(op) ((op)->ob_type == &WindowDialog_Type) - -#define WindowXMLDialog_Check(op) PyObject_TypeCheck(op, &WindowXMLDialog_Type) -#define WindowXMLDialog_CheckExact(op) ((op)->ob_type == &WindowXMLDialog_Type) - -#define PyObject_HEAD_XBMC_WINDOW \ - PyObject_HEAD \ - int iWindowId; \ - int iOldWindowId; \ - int iCurrentControlId; \ - bool bIsPythonWindow; \ - bool bModal; \ - bool bUsingXML; \ - std::string sXMLFileName; \ - std::string sFallBackPath; \ - CGUIWindow* pWindow; \ - std::vector<Control*> vecControls; - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - typedef struct { - PyObject_HEAD_XBMC_WINDOW - } Window; - - extern PyMethodDef Window_methods[]; - extern PyTypeObject Window_Type; - - void initWindow_Type(); - - bool Window_CreateNewWindow(Window* pWindow, bool bAsDialog); - bool Window_AddSingleControl(Window* self, PyObject *object, bool wait = true); - bool Window_RemoveSingleControl(Window* self, PyObject *object, bool wait = true); - void Window_Dealloc(Window* self); - PyObject* Window_Close(Window *self, PyObject *args); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/winxml.cpp b/xbmc/interfaces/python/xbmcmodule/winxml.cpp deleted file mode 100644 index 7690686c45..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/winxml.cpp +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "winxml.h" -#include "pyutil.h" -#include "GUIPythonWindowXML.h" -#include "addons/Skin.h" -#include "utils/URIUtils.h" -#include "filesystem/File.h" - -using namespace std; -using namespace ADDON; - -#define ACTIVE_WINDOW g_windowManager.GetActiveWindow() - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - PyObject* WindowXML_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - WindowXML *self; - - self = (WindowXML*)type->tp_alloc(type, 0); - if (!self) return NULL; - - new(&self->sXMLFileName) string(); - new(&self->sFallBackPath) string(); - new(&self->vecControls) std::vector<Control*>(); - - self->iWindowId = -1; - PyObject* pyOXMLname = NULL; - PyObject* pyOname = NULL; - PyObject* pyDName = NULL; - PyObject* pyRes = NULL; - - string strXMLname, strFallbackPath; - string strDefault = "Default"; - string resolution = "720p"; - - if (!PyArg_ParseTuple(args, (char*)"OO|OO", &pyOXMLname, &pyOname, &pyDName, &pyRes)) return NULL; - - PyXBMCGetUnicodeString(strXMLname, pyOXMLname); - PyXBMCGetUnicodeString(strFallbackPath, pyOname); - if (pyDName) PyXBMCGetUnicodeString(strDefault, pyDName); - if (pyRes) PyXBMCGetUnicodeString(resolution, pyRes); - - // Check to see if the XML file exists in current skin. If not use fallback path to find a skin for the script - RESOLUTION_INFO res; - CStdString strSkinPath = g_SkinInfo->GetSkinPath(strXMLname, &res); - - if (!XFILE::CFile::Exists(strSkinPath)) - { - CStdString str("none"); - AddonProps props(str, ADDON_SKIN, "", ""); - CSkinInfo::TranslateResolution(resolution, res); - - CStdString fallbackPath = URIUtils::AddFileToFolder(strFallbackPath, "resources"); - fallbackPath = URIUtils::AddFileToFolder(fallbackPath, "skins"); - CStdString basePath = URIUtils::AddFileToFolder(fallbackPath, g_SkinInfo->ID()); - - // Check for the matching folder for the skin in the fallback skins folder (if it exists) - if (XFILE::CFile::Exists(basePath)) - { - props.path = basePath; - CSkinInfo skinInfo(props, res); - skinInfo.Start(); - strSkinPath = skinInfo.GetSkinPath(strXMLname, &res); - } - - if (!XFILE::CFile::Exists(strSkinPath)) - { - // Finally fallback to the DefaultSkin as it didn't exist in either the XBMC Skin folder or the fallback skin folder - props.path = URIUtils::AddFileToFolder(fallbackPath, strDefault); - CSkinInfo skinInfo(props, res); - - skinInfo.Start(); - strSkinPath = skinInfo.GetSkinPath(strXMLname, &res); - if (!XFILE::CFile::Exists(strSkinPath)) - { - PyErr_SetString(PyExc_TypeError, "XML File for Window is missing"); - return NULL; - } - } - } - - self->sFallBackPath = strFallbackPath; - self->sXMLFileName = strSkinPath; - self->bUsingXML = true; - - // create new GUIWindow - if (!Window_CreateNewWindow((Window*)self, false)) - { - // error is already set by Window_CreateNewWindow, just release the memory - self->vecControls.clear(); - self->vecControls.~vector(); - self->sFallBackPath.~string(); - self->sXMLFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - return NULL; - } - ((CGUIWindow*)(self->pWindow))->SetCoordsRes(res); - return (PyObject*)self; - } - - // removeItem() method - PyDoc_STRVAR(removeItem__doc__, - "removeItem(position) -- Removes a specified item based on position, from the Window List.\n" - "\n" - "position : integer - position of item to remove.\n" - "\n" - "example:\n" - " - self.removeItem(5)\n"); - - PyObject* WindowXML_RemoveItem(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - int itemPosition; - if (!PyArg_ParseTuple(args, (char*)"i", &itemPosition)) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - // Tells the window to remove the item at the specified position from the FileItem vector - PyXBMCGUILock(); - pwx->RemoveItem(itemPosition); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // addItem() method - PyDoc_STRVAR(addItem__doc__, - "addItem(item[, position]) -- Add a new item to this Window List.\n" - "\n" - "item : string, unicode or ListItem - item to add.\n" - "position : [opt] integer - position of item to add. (NO Int = Adds to bottom,0 adds to top, 1 adds to one below from top,-1 adds to one above from bottom etc etc )\n" - " - If integer positions are greater than list size, negative positions will add to top of list, positive positions will add to bottom of list\n" - "example:\n" - " - self.addItem('Reboot XBMC', 0)\n"); - - PyObject* WindowXML_AddItem(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - PyObject *pObject; - int itemPosition = INT_MAX; - if (!PyArg_ParseTuple(args, (char*)"O|i", &pObject, &itemPosition)) return NULL; - - string strText; - ListItem* pListItem = NULL; - - if (ListItem_CheckExact(pObject)) - { - // object is a listitem - pListItem = (ListItem*)pObject; - Py_INCREF(pListItem); - } - else - { - // object is probably a text item - if (!PyXBMCGetUnicodeString(strText, pObject, 1)) return NULL; - // object is a unicode string now, create a new ListItem - pListItem = ListItem_FromString(strText); - } - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - // Tells the window to add the item to FileItem vector - PyXBMCGUILock(); - pwx->AddItem(pListItem->item, itemPosition); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // refreshList() method - /*PyDoc_STRVAR(refreshList__doc__, - "refreshList() -- Updates this Window List. (any new items will be shown once this command is ran.\n" - "\n" - "example:\n" - " - self.refrestList()\n");*/ - - // clearList() method - PyDoc_STRVAR(clearList__doc__, - "clearList() -- Clear the Window List.\n" - "\n" - "example:\n" - " - self.clearList()\n"); - - PyObject* WindowXML_ClearList(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - PyXBMCGUILock(); - pwx->ClearList(); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // setCurrentListPosition() method - PyDoc_STRVAR(setCurrentListPosition__doc__, - "setCurrentListPosition(position) -- Set the current position in the Window List.\n" - "\n" - "position : integer - position of item to set.\n" - "\n" - "example:\n" - " - self.setCurrentListPosition(5)\n"); - - PyObject* WindowXML_SetCurrentListPosition(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - int listPos = -1; - if (!PyArg_ParseTuple(args, (char*)"i", &listPos)) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - PyXBMCGUILock(); - pwx->SetCurrentListPosition(listPos); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - // getCurrentListPosition() method - PyDoc_STRVAR(getCurrentListPosition__doc__, - "getCurrentListPosition() -- Gets the current position in the Window List.\n" - "\n" - "example:\n" - " - pos = self.getCurrentListPosition()\n"); - - PyObject* WindowXML_GetCurrentListPosition(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - PyXBMCGUILock(); - int listPos = pwx->GetCurrentListPosition(); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_BuildValue((char*)"i", listPos); - } - - // getListItem() method - PyDoc_STRVAR(getListItem__doc__, - "getListItem(position) -- Returns a given ListItem in this Window List.\n" - "\n" - "position : integer - position of item to return.\n" - "\n" - "example:\n" - " - listitem = self.getListItem(6)\n"); - - PyObject* WindowXML_GetListItem(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - int listPos = -1; - if (!PyArg_ParseTuple(args, (char*)"i", &listPos)) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - PyXBMCGUILock(); - CFileItemPtr fi = pwx->GetListItem(listPos); - - if (fi == NULL) - { - PyXBMCGUIUnlock(); - PyErr_SetString(PyExc_TypeError, "Index out of range"); - return NULL; - } - - ListItem* sListItem = (ListItem*)ListItem_Type.tp_alloc(&ListItem_Type, 0); - sListItem->item = fi; - PyXBMCGUIUnlock(); - - Py_INCREF(sListItem); - return (PyObject *)sListItem; - } - - // getListSize() method - PyDoc_STRVAR(getListSize__doc__, - "getListSize() -- Returns the number of items in this Window List.\n" - "\n" - "example:\n" - " - listSize = self.getListSize()\n"); - - PyObject* WindowXML_GetListSize(WindowXML *self, PyObject *args) - { - if (!self->pWindow) return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - - PyXBMCGUILock(); - int listSize = pwx->GetListSize(); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_BuildValue((char*)"l", listSize); - } - - // setProperty() method - PyDoc_STRVAR(setProperty__doc__, - "setProperty(key, value) -- Sets a container property, similar to an infolabel.\n" - "\n" - "key : string - property name.\n" - "value : string or unicode - value of property.\n" - "\n" - "*Note, Key is NOT case sensitive.\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - self.setProperty('Category', 'Newest')\n"); - - PyObject* WindowXML_SetProperty(WindowXML *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "key", "value", NULL }; - char *key = NULL; - PyObject *value = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"sO", - (char**)keywords, - &key, - &value)) - { - return NULL; - } - if (!key || !value) return NULL; - - CStdString uText; - if (!PyXBMCGetUnicodeString(uText, value, 1)) - return NULL; - - CGUIPythonWindowXML * pwx = (CGUIPythonWindowXML*)self->pWindow; - CStdString lowerKey = key; - - PyXBMCGUILock(); - pwx->SetProperty(lowerKey.ToLower(), uText.c_str()); - PyXBMCGUIUnlock(); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(windowXML__doc__, - "WindowXML class.\n" - "\n" - "WindowXML(self, xmlFilename, scriptPath[, defaultSkin, defaultRes]) -- Create a new WindowXML script.\n" - "\n" - "xmlFilename : string - the name of the xml file to look for.\n" - "scriptPath : string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())\n" - "defaultSkin : [opt] string - name of the folder in the skins path to look in for the xml. (default='Default')\n" - "defaultRes : [opt] string - default skins resolution. (default='720p')\n" - "\n" - "*Note, skin folder structure is eg(resources/skins/Default/720p)\n" - "\n" - "example:\n" - " - ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')\n" - " ui.doModal()\n" - " del ui\n"); - - PyMethodDef WindowXML_methods[] = { - {(char*)"addItem", (PyCFunction)WindowXML_AddItem, METH_VARARGS, addItem__doc__}, - {(char*)"removeItem", (PyCFunction)WindowXML_RemoveItem, METH_VARARGS, removeItem__doc__}, - {(char*)"getCurrentListPosition", (PyCFunction)WindowXML_GetCurrentListPosition, METH_VARARGS, getCurrentListPosition__doc__}, - {(char*)"setCurrentListPosition", (PyCFunction)WindowXML_SetCurrentListPosition, METH_VARARGS, setCurrentListPosition__doc__}, - {(char*)"getListItem", (PyCFunction)WindowXML_GetListItem, METH_VARARGS, getListItem__doc__}, - {(char*)"getListSize", (PyCFunction)WindowXML_GetListSize, METH_VARARGS, getListSize__doc__}, - {(char*)"clearList", (PyCFunction)WindowXML_ClearList, METH_VARARGS, clearList__doc__}, - {(char*)"setProperty", (PyCFunction)WindowXML_SetProperty, METH_VARARGS|METH_KEYWORDS, setProperty__doc__}, - {NULL, NULL, 0, NULL} - }; -// Restore code and data sections to normal. - - PyTypeObject WindowXML_Type; - - void initWindowXML_Type() - { - PyXBMCInitializeTypeObject(&WindowXML_Type); - - WindowXML_Type.tp_name = (char*)"xbmcgui.WindowXML"; - WindowXML_Type.tp_basicsize = sizeof(WindowXML); - WindowXML_Type.tp_dealloc = (destructor)Window_Dealloc; - WindowXML_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - WindowXML_Type.tp_doc = windowXML__doc__; - WindowXML_Type.tp_methods = WindowXML_methods; - WindowXML_Type.tp_base = &Window_Type; - WindowXML_Type.tp_new = WindowXML_New; - } -} - -#ifdef __cplusplus -} -#endif - - diff --git a/xbmc/interfaces/python/xbmcmodule/winxml.h b/xbmc/interfaces/python/xbmcmodule/winxml.h deleted file mode 100644 index 82e284ee51..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/winxml.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> -#include "window.h" -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - - typedef struct { - PyObject_HEAD_XBMC_WINDOW - } WindowXML; - - typedef struct { - PyObject_HEAD_XBMC_WINDOW - } WindowXMLDialog; - - extern PyTypeObject WindowXML_Type; - extern PyTypeObject WindowXMLDialog_Type; - - void initWindowXML_Type(); - void initWindowXMLDialog_Type(); -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/winxmldialog.cpp b/xbmc/interfaces/python/xbmcmodule/winxmldialog.cpp deleted file mode 100644 index 76aeb6b9a8..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/winxmldialog.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - - -#include "winxml.h" -#include "pyutil.h" -#include "GUIPythonWindowXMLDialog.h" -#include "addons/Skin.h" -#include "utils/URIUtils.h" -#include "filesystem/File.h" - -#define ACTIVE_WINDOW g_windowManager.GetActiveWindow() - - -#ifdef __cplusplus -extern "C" { -#endif - -using namespace std; -using namespace ADDON; - -namespace PYXBMC -{ - PyObject* WindowXMLDialog_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - WindowXMLDialog *self; - - self = (WindowXMLDialog*)type->tp_alloc(type, 0); - if (!self) return NULL; - - new(&self->sXMLFileName) string(); - new(&self->sFallBackPath) string(); - new(&self->vecControls) std::vector<Control*>(); - - self->iWindowId = -1; - PyObject* pyOXMLname = NULL; - PyObject* pyOname = NULL; - PyObject* pyDName = NULL; - PyObject* pyRes = NULL; - - string strXMLname, strFallbackPath; - string strDefault = "Default"; - string resolution = "720p"; - - if (!PyArg_ParseTuple(args, (char*)"OO|OO", &pyOXMLname, &pyOname, &pyDName, &pyRes)) return NULL; - - PyXBMCGetUnicodeString(strXMLname, pyOXMLname); - PyXBMCGetUnicodeString(strFallbackPath, pyOname); - if (pyDName) PyXBMCGetUnicodeString(strDefault, pyDName); - if (pyRes) PyXBMCGetUnicodeString(resolution, pyRes); - - // Check to see if the XML file exists in current skin. If not use fallback path to find a skin for the script - RESOLUTION_INFO res; - CStdString strSkinPath = g_SkinInfo->GetSkinPath(strXMLname, &res); - - if (!XFILE::CFile::Exists(strSkinPath)) - { - CStdString str("none"); - AddonProps props(str, ADDON_SKIN, "", ""); - CSkinInfo::TranslateResolution(resolution, res); - - CStdString fallbackPath = URIUtils::AddFileToFolder(strFallbackPath, "resources"); - fallbackPath = URIUtils::AddFileToFolder(fallbackPath, "skins"); - CStdString basePath = URIUtils::AddFileToFolder(fallbackPath, g_SkinInfo->ID()); - - // Check for the matching folder for the skin in the fallback skins folder (if it exists) - if (XFILE::CFile::Exists(basePath)) - { - props.path = basePath; - CSkinInfo skinInfo(props, res); - skinInfo.Start(); - strSkinPath = skinInfo.GetSkinPath(strXMLname, &res); - } - - if (!XFILE::CFile::Exists(strSkinPath)) - { - // Finally fallback to the DefaultSkin as it didn't exist in either the XBMC Skin folder or the fallback skin folder - props.path = URIUtils::AddFileToFolder(fallbackPath, strDefault); - CSkinInfo skinInfo(props, res); - - skinInfo.Start(); - strSkinPath = skinInfo.GetSkinPath(strXMLname, &res); - if (!XFILE::CFile::Exists(strSkinPath)) - { - PyErr_SetString(PyExc_TypeError, "XML File for Window is missing"); - return NULL; - } - } - } - - self->sFallBackPath = strFallbackPath; - self->sXMLFileName = strSkinPath; - self->bUsingXML = true; - - // create new GUIWindow - if (!Window_CreateNewWindow((Window*)self, true)) - { - // error is already set by Window_CreateNewWindow, just release the memory - self->sFallBackPath.~string(); - self->sXMLFileName.~string(); - self->ob_type->tp_free((PyObject*)self); - return NULL; - } - ((CGUIWindow*)(self->pWindow))->SetCoordsRes(res); - return (PyObject*)self; - } - - PyDoc_STRVAR(windowXMLDialog__doc__, - "WindowXMLDialog class.\n" - "\n" - "WindowXMLDialog(self, xmlFilename, scriptPath[, defaultSkin, defaultRes]) -- Create a new WindowXMLDialog script.\n" - "\n" - "xmlFilename : string - the name of the xml file to look for.\n" - "scriptPath : string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())\n" - "defaultSkin : [opt] string - name of the folder in the skins path to look in for the xml. (default='Default')\n" - "defaultRes : [opt] string - default skins resolution. (default='720p')\n" - "\n" - "*Note, skin folder structure is eg(resources/skins/Default/720p)\n" - "\n" - "example:\n" - " - ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')\n" - " ui.doModal()\n" - " del ui\n"); - - PyMethodDef windowXMLDialog_methods[] = { - {NULL, NULL, 0, NULL} - }; -// Restore code and data sections to normal. - - PyTypeObject WindowXMLDialog_Type; - - void initWindowXMLDialog_Type() - { - PyXBMCInitializeTypeObject(&WindowXMLDialog_Type); - - WindowXMLDialog_Type.tp_name = (char*)"xbmcgui.WindowXMLDialog"; - WindowXMLDialog_Type.tp_basicsize = sizeof(WindowXMLDialog); - WindowXMLDialog_Type.tp_dealloc = (destructor)Window_Dealloc; - WindowXMLDialog_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - WindowXMLDialog_Type.tp_doc = windowXMLDialog__doc__; - WindowXMLDialog_Type.tp_methods = windowXMLDialog_methods; - WindowXMLDialog_Type.tp_base = &WindowXML_Type; - WindowXMLDialog_Type.tp_new = WindowXMLDialog_New; - } -} - -#ifdef __cplusplus -} -#endif - - diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcaddonmodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcaddonmodule.cpp deleted file mode 100644 index aa9bb24757..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/xbmcaddonmodule.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2005-2010 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "PythonAddon.h" -#include "pyutil.h" - - -#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2) -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - /***************************************************************** - * start of xbmcaddon methods - *****************************************************************/ - // put module methods here - - - // define c functions to be used in python here - PyMethodDef xbmcAddonMethods[] = { - {NULL, NULL, 0, NULL} - }; - /***************************************************************** - * end of methods and python objects - *****************************************************************/ - - PyMODINIT_FUNC - InitAddonTypes(void) - { - initAddon_Type(); - - if (PyType_Ready(&Addon_Type) < 0) - return; - } - - PyMODINIT_FUNC - DeinitAddonModule(void) - { - // no need to Py_DECREF our objects (see InitAddonModule()) as they were created only - // so that they could be added to the module, which steals a reference. - } - - PyMODINIT_FUNC - InitAddonModule(void) - { - Py_INCREF(&Addon_Type); - - // init general xbmcaddon modules - PyObject* pXbmcAddonModule; - pXbmcAddonModule = Py_InitModule((char*)"xbmcaddon", xbmcAddonMethods); - if (pXbmcAddonModule == NULL) return; - - PyModule_AddObject(pXbmcAddonModule, (char*)"Addon", (PyObject*)&Addon_Type); - - // constants - PyModule_AddStringConstant(pXbmcAddonModule, (char*)"__author__", (char*)PY_XBMC_AUTHOR); - PyModule_AddStringConstant(pXbmcAddonModule, (char*)"__date__", (char*)"1 May 2010"); - PyModule_AddStringConstant(pXbmcAddonModule, (char*)"__version__", (char*)"1.0"); - PyModule_AddStringConstant(pXbmcAddonModule, (char*)"__credits__", (char*)PY_XBMC_CREDITS); - PyModule_AddStringConstant(pXbmcAddonModule, (char*)"__platform__", (char*)PY_XBMC_PLATFORM); - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcguimodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcguimodule.cpp deleted file mode 100644 index 4bd021b9d3..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/xbmcguimodule.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> -#include <structmember.h> - -#include "control.h" -#include "window.h" -#include "dialog.h" -#include "winxml.h" -#include "pyutil.h" -#include "action.h" -#include "utils/log.h" -#include "guilib/GUIWindowManager.h" -#include "guilib/GUIListItem.h" - - -#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2) -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ - // lock() method - PyDoc_STRVAR(lock__doc__, - "'xbmcgui.lock()' is depreciated and serves no purpose anymore,\n" - "\n" - "it will be removed in future releases\n"); - - PyObject* XBMCGUI_Lock(PyObject *self, PyObject *args) - { - CLog::Log(LOGWARNING,"'xbmcgui.lock()' is depreciated and serves no purpose anymore, it will be removed in future releases"); - Py_INCREF(Py_None); - return Py_None; - } - - // unlock() method - PyDoc_STRVAR(unlock__doc__, - "'xbmcgui.unlock()' is depreciated and serves no purpose anymore,\n" - "\n" - "it will be removed in future releases\n"); - - PyObject* XBMCGUI_Unlock(PyObject *self, PyObject *args) - { - CLog::Log(LOGWARNING,"'xbmcgui.unlock()' is depreciated and serves no purpose anymore, it will be removed in future releases"); - Py_INCREF(Py_None); - return Py_None; - } - - // getCurrentWindowId() method - PyDoc_STRVAR(getCurrentWindowId__doc__, - "getCurrentWindowId() -- Returns the id for the current 'active' window as an integer.\n" - "\n" - "example:\n" - " - wid = xbmcgui.getCurrentWindowId()\n"); - - PyObject* XBMCGUI_GetCurrentWindowId(PyObject *self, PyObject *args) - { - PyXBMCGUILock(); - int id = g_windowManager.GetActiveWindow(); - PyXBMCGUIUnlock(); - return Py_BuildValue((char*)"i", id); - } - - // getCurrentWindowDialogId() method - PyDoc_STRVAR(getCurrentWindowDialogId__doc__, - "getCurrentWindowDialogId() -- Returns the id for the current 'active' dialog as an integer.\n" - "\n" - "example:\n" - " - wid = xbmcgui.getCurrentWindowDialogId()\n"); - - PyObject* XBMCGUI_GetCurrentWindowDialogId(PyObject *self, PyObject *args) - { - PyXBMCGUILock(); - int id = g_windowManager.GetTopMostModalDialogID(); - PyXBMCGUIUnlock(); - return Py_BuildValue((char*)"i", id); - } - - // define c functions to be used in python here - PyMethodDef xbmcGuiMethods[] = { - {(char*)"lock", (PyCFunction)XBMCGUI_Lock, METH_VARARGS, lock__doc__}, - {(char*)"unlock", (PyCFunction)XBMCGUI_Unlock, METH_VARARGS, unlock__doc__}, - {(char*)"getCurrentWindowId", (PyCFunction)XBMCGUI_GetCurrentWindowId, METH_VARARGS, getCurrentWindowId__doc__}, - {(char*)"getCurrentWindowDialogId", (PyCFunction)XBMCGUI_GetCurrentWindowDialogId, METH_VARARGS, getCurrentWindowDialogId__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyDoc_STRVAR(xbmcgui_module_documentation, - // "XBMC GUI Module" - // "\n" - ""); - - PyMODINIT_FUNC - InitGUITypes(void) - { - initWindow_Type(); - initWindowDialog_Type(); - initWindowXML_Type(); - initWindowXMLDialog_Type(); - initListItem_Type(); - initControl_Type(); - initControlSpin_Type(); - initControlLabel_Type(); - initControlFadeLabel_Type(); - initControlTextBox_Type(); - initControlButton_Type(); - initControlCheckMark_Type(); - initControlProgress_Type(); - initControlSlider_Type(); - initControlList_Type(); - initControlImage_Type(); - initControlGroup_Type(); - initDialog_Type(); - initDialogProgress_Type(); - initAction_Type(); - initControlRadioButton_Type(); - initControlEdit_Type(); - - if (PyType_Ready(&Window_Type) < 0 || - PyType_Ready(&WindowDialog_Type) < 0 || - PyType_Ready(&WindowXML_Type) < 0 || - PyType_Ready(&WindowXMLDialog_Type) < 0 || - PyType_Ready(&ListItem_Type) < 0 || - PyType_Ready(&Control_Type) < 0 || - PyType_Ready(&ControlSpin_Type) < 0 || - PyType_Ready(&ControlLabel_Type) < 0 || - PyType_Ready(&ControlFadeLabel_Type) < 0 || - PyType_Ready(&ControlTextBox_Type) < 0 || - PyType_Ready(&ControlButton_Type) < 0 || - PyType_Ready(&ControlCheckMark_Type) < 0 || - PyType_Ready(&ControlList_Type) < 0 || - PyType_Ready(&ControlImage_Type) < 0 || - PyType_Ready(&ControlProgress_Type) < 0 || - PyType_Ready(&ControlGroup_Type) < 0 || - PyType_Ready(&Dialog_Type) < 0 || - PyType_Ready(&DialogProgress_Type) < 0 || - PyType_Ready(&ControlSlider_Type) < 0 || - PyType_Ready(&ControlRadioButton_Type) < 0 || - PyType_Ready(&ControlEdit_Type) < 0 || - PyType_Ready(&Action_Type) < 0) - return; - - } - - PyMODINIT_FUNC - DeinitGUIModule(void) - { - // no need to Py_DECREF our objects (see InitGUIModule()) as they were created only - // so that they could be added to the module, which steals a reference. - } - - PyMODINIT_FUNC - InitGUIModule(void) - { - // init xbmc gui modules - PyObject* pXbmcGuiModule; - - Py_INCREF(&Window_Type); - Py_INCREF(&WindowDialog_Type); - Py_INCREF(&WindowXML_Type); - Py_INCREF(&WindowXMLDialog_Type); - Py_INCREF(&ListItem_Type); - Py_INCREF(&Control_Type); - Py_INCREF(&ControlSpin_Type); - Py_INCREF(&ControlLabel_Type); - Py_INCREF(&ControlFadeLabel_Type); - Py_INCREF(&ControlTextBox_Type); - Py_INCREF(&ControlButton_Type); - Py_INCREF(&ControlCheckMark_Type); - Py_INCREF(&ControlList_Type); - Py_INCREF(&ControlImage_Type); - Py_INCREF(&ControlProgress_Type); - Py_INCREF(&ControlSlider_Type); - Py_INCREF(&ControlGroup_Type); - Py_INCREF(&Dialog_Type); - Py_INCREF(&DialogProgress_Type); - Py_INCREF(&Action_Type); - Py_INCREF(&ControlRadioButton_Type); - Py_INCREF(&ControlEdit_Type); - - pXbmcGuiModule = Py_InitModule3((char*)"xbmcgui", xbmcGuiMethods, xbmcgui_module_documentation); - - if (pXbmcGuiModule == NULL) return; - - PyModule_AddObject(pXbmcGuiModule, (char*)"Window", (PyObject*)&Window_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"WindowDialog", (PyObject*)&WindowDialog_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"WindowXML", (PyObject*)&WindowXML_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"WindowXMLDialog", (PyObject*)&WindowXMLDialog_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ListItem", (PyObject*)&ListItem_Type); - //PyModule_AddObject(pXbmcGuiModule, (char*)"Control", (PyObject*)&Control_Type); - //PyModule_AddObject(pXbmcGuiModule, (char*)"ControlSpin", (PyObject*)&ControlSpin_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlLabel", (PyObject*)&ControlLabel_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlFadeLabel", (PyObject*)&ControlFadeLabel_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlTextBox", (PyObject*)&ControlTextBox_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlButton", (PyObject*)&ControlButton_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlCheckMark", (PyObject*)&ControlCheckMark_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlList", (PyObject*)&ControlList_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlImage", (PyObject*)& ControlImage_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlProgress", (PyObject*)& ControlProgress_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlSlider", (PyObject*)& ControlSlider_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlGroup", (PyObject*)& ControlGroup_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"Dialog", (PyObject *)&Dialog_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"DialogProgress", (PyObject *)&DialogProgress_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"Action", (PyObject *)&Action_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlRadioButton", (PyObject*)&ControlRadioButton_Type); - PyModule_AddObject(pXbmcGuiModule, (char*)"ControlEdit", (PyObject*)&ControlEdit_Type); - - PyModule_AddStringConstant(pXbmcGuiModule, (char*)"__author__", (char*)PY_XBMC_AUTHOR); - PyModule_AddStringConstant(pXbmcGuiModule, (char*)"__date__", (char*)"16 June 2011"); - PyModule_AddStringConstant(pXbmcGuiModule, (char*)"__version__", (char*)"1.5"); - PyModule_AddStringConstant(pXbmcGuiModule, (char*)"__credits__", (char*)PY_XBMC_CREDITS); - PyModule_AddStringConstant(pXbmcGuiModule, (char*)"__platform__", (char*)PY_XBMC_PLATFORM); - - // icon overlay constants - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_NONE", CGUIListItem::ICON_OVERLAY_NONE); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_RAR", CGUIListItem::ICON_OVERLAY_RAR); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_ZIP", CGUIListItem::ICON_OVERLAY_ZIP); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_LOCKED", CGUIListItem::ICON_OVERLAY_LOCKED); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_HAS_TRAINER", CGUIListItem::ICON_OVERLAY_HAS_TRAINER); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_TRAINED", CGUIListItem::ICON_OVERLAY_TRAINED); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_UNWATCHED", CGUIListItem::ICON_OVERLAY_UNWATCHED); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_WATCHED", CGUIListItem::ICON_OVERLAY_WATCHED); - PyModule_AddIntConstant(pXbmcGuiModule, (char*)"ICON_OVERLAY_HD", CGUIListItem::ICON_OVERLAY_HD); - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp deleted file mode 100644 index 7e58ddea02..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp +++ /dev/null @@ -1,1209 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - -#include "player.h" -#include "pyplaylist.h" -#include "keyboard.h" -#ifndef _LINUX -#include <ConIo.h> -#endif -#include "infotagvideo.h" -#include "infotagmusic.h" -#ifdef HAS_HTTPAPI -#include "interfaces/http-api/XBMChttp.h" -#include "interfaces/http-api/HttpApi.h" -#endif -#include "pyjsonrpc.h" -#include "GUIInfoManager.h" -#include "guilib/GUIWindowManager.h" -#include "guilib/GUIAudioManager.h" -#include "Application.h" -#include "ApplicationMessenger.h" -#include "utils/Crc32.h" -#include "utils/URIUtils.h" -#include "Util.h" -#include "filesystem/File.h" -#include "filesystem/SpecialProtocol.h" -#include "settings/GUISettings.h" -#include "guilib/TextureManager.h" -#include "LangInfo.h" -#include "SectionLoader.h" -#include "settings/Settings.h" -#include "guilib/LocalizeStrings.h" -#include "utils/FileUtils.h" -#include "pythreadstate.h" -#include "utils/log.h" -#include "utils/Weather.h" -#include "guilib/GUIFontManager.h" -#include "filesystem/Directory.h" -#include "pyrendercapture.h" -#include "monitor.h" -#include "URL.h" -#include "cores/AudioEngine/AEFactory.h" -#include "storage/MediaManager.h" - -// include for constants -#include "pyutil.h" -#include "PlayListPlayer.h" - -using namespace std; -using namespace XFILE; - - -#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2) -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ -/***************************************************************** - * start of xbmc methods - *****************************************************************/ - - // log() method - PyDoc_STRVAR(log__doc__, - "log(msg[, level]) -- Write a string to XBMC's log file.\n" - "\n" - "msg : string - text to output.\n" - "level : [opt] integer - log level to ouput at. (default=LOGNOTICE)\n" - "\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - " Text is written to the log for the following conditions.\n" - " XBMC loglevel == -1 (NONE, nothing at all is logged)" - " XBMC loglevel == 0 (NORMAL, shows LOGNOTICE, LOGERROR, LOGSEVERE and LOGFATAL)" - " XBMC loglevel == 1 (DEBUG, shows all)" - " See pydocs for valid values for level.\n" - "\n" - "example:\n" - " - xbmc.log(msg='This is a test string.', level=xbmc.LOGDEBUG)\n"); - - PyObject* XBMC_Log(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "msg", - "level", - NULL}; - - char *s_line = NULL; - int iLevel = LOGNOTICE; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s|i", - (char**)keywords, - &s_line, - &iLevel)) - { - return NULL; - } - // check for a valid loglevel - if (iLevel < LOGDEBUG || iLevel > LOGNONE) - iLevel = LOGNOTICE; - CLog::Log(iLevel, "%s", s_line); - - Py_INCREF(Py_None); - return Py_None; - } - - // output() method - PyDoc_STRVAR(output__doc__, - "'xbmc.output()' is depreciated and will be removed in future releases,\n" - "please use 'xbmc.log()' instead"); - - PyObject* XBMC_Output(PyObject *self, PyObject *args, PyObject *kwds) - { - CLog::Log(LOGWARNING,"'xbmc.output()' is depreciated and will be removed in future releases, please use 'xbmc.log()' instead"); - return XBMC_Log(self, args, kwds); - } - - // shutdown() method - PyDoc_STRVAR(shutdown__doc__, - "shutdown() -- Shutdown the system.\n" - "\n" - "example:\n" - " - xbmc.shutdown()\n"); - - PyObject* XBMC_Shutdown(PyObject *self, PyObject *args) - { - ThreadMessage tMsg = {TMSG_SHUTDOWN}; - CApplicationMessenger::Get().SendMessage(tMsg); - - Py_INCREF(Py_None); - return Py_None; - } - - // restart() method - PyDoc_STRVAR(restart__doc__, - "restart() -- Restart the system.\n" - "\n" - "example:\n" - " - xbmc.restart()\n"); - - PyObject* XBMC_Restart(PyObject *self, PyObject *args) - { - ThreadMessage tMsg = {TMSG_RESTART}; - CApplicationMessenger::Get().SendMessage(tMsg); - - Py_INCREF(Py_None); - return Py_None; - } - - // executescript() method - PyDoc_STRVAR(executeScript__doc__, - "executescript(script) -- Execute a python script.\n" - "\n" - "script : string - script filename to execute.\n" - "\n" - "example:\n" - " - xbmc.executescript('special://home/scripts/update.py')\n"); - - PyObject* XBMC_ExecuteScript(PyObject *self, PyObject *args) - { - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - ThreadMessage tMsg = {TMSG_EXECUTE_SCRIPT}; - tMsg.strParam = cLine; - CApplicationMessenger::Get().SendMessage(tMsg); - - Py_INCREF(Py_None); - return Py_None; - } - - // executebuiltin() method - PyDoc_STRVAR(executeBuiltIn__doc__, - "executebuiltin(function) -- Execute a built in XBMC function.\n" - "\n" - "function : string - builtin function to execute.\n" - "wait : [opt] bool - True=Wait for end of execution, False=don't wait (Default)\n" - "\n" - "List of functions - http://wiki.xbmc.org/?title=List_of_Built_In_Functions \n" - "\n" - "NOTE: This function is executed asynchronously, so do not rely on it being done immediately\n" - "\n" - "example:\n" - " - xbmc.executebuiltin('XBMC.RunXBE(c:\\\\avalaunch.xbe)')\n"); - - PyObject* XBMC_ExecuteBuiltIn(PyObject *self, PyObject *args) - { - char *cLine = NULL; - bool bWait = false; - if (!PyArg_ParseTuple(args, (char*)"s|b", &cLine, &bWait)) return NULL; - - CApplicationMessenger::Get().ExecBuiltIn(cLine, bWait); - - Py_INCREF(Py_None); - return Py_None; - } - -#ifdef HAS_HTTPAPI - // executehttpapi() method - PyDoc_STRVAR(executeHttpApi__doc__, - "executehttpapi(httpcommand) -- Execute an HTTP API command.\n" - "\n" - "httpcommand : string - http command to execute.\n" - "\n" - "List of commands - http://wiki.xbmc.org/?title=WebServerHTTP-API#The_Commands \n" - "\n" - "example:\n" - " - response = xbmc.executehttpapi('TakeScreenShot(special://temp/test.jpg,0,false,200,-1,90)')\n"); - - PyObject* XBMC_ExecuteHttpApi(PyObject *self, PyObject *args) - { - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - CPyThreadState pyLock; - - if (!m_pXbmcHttp) - m_pXbmcHttp = new CXbmcHttp(); - CStdString method = cLine; - - int open, close; - CStdString parameter="", cmd=cLine, execute; - open = cmd.Find("("); - if (open>0) - { - close=cmd.length(); - while (close>open && cmd.Mid(close,1)!=")") - close--; - if (close>open) - { - parameter = cmd.Mid(open + 1, close - open - 1); - parameter.Replace(",",";"); - execute = cmd.Left(open); - } - else //open bracket but no close - { - pyLock.Restore(); - return PyString_FromString(""); - } - } - else //no parameters - execute = cmd; - - CURL::Decode(parameter); - - pyLock.Restore(); - return PyString_FromString(CHttpApi::MethodCall(execute, parameter).c_str()); - } -#endif - -#ifdef HAS_JSONRPC - // executehttpapi() method - PyDoc_STRVAR(executeJSONRPC__doc__, - "executeJSONRPC(jsonrpccommand) -- Execute an JSONRPC command.\n" - "\n" - "jsonrpccommand : string - jsonrpc command to execute.\n" - "\n" - "List of commands - \n" - "\n" - "example:\n" - " - response = xbmc.executeJSONRPC('{ \"jsonrpc\": \"2.0\", \"method\": \"JSONRPC.Introspect\", \"id\": 1 }')\n"); - - PyObject* XBMC_ExecuteJSONRPC(PyObject *self, PyObject *args) - { - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) - return NULL; - - CStdString method = cLine; - - CPythonTransport transport; - CPythonTransport::CPythonClient client; - - return PyString_FromString(JSONRPC::CJSONRPC::MethodCall(method, &transport, &client).c_str()); - } -#endif - - // sleep() method - PyDoc_STRVAR(sleep__doc__, - "sleep(time) -- Sleeps for 'time' msec.\n" - "\n" - "time : integer - number of msec to sleep.\n" - "\n" - "*Note, This is useful if you have for example a Player class that is waiting\n" - " for onPlayBackEnded() calls.\n" - "\n" - "Throws: PyExc_TypeError, if time is not an integer.\n" - "\n" - "example:\n" - " - xbmc.sleep(2000) # sleeps for 2 seconds\n"); - - PyObject* XBMC_Sleep(PyObject *self, PyObject *args) - { - PyObject *pObject; - if (!PyArg_ParseTuple(args, (char*)"O", &pObject)) return NULL; - if (!PyInt_Check(pObject)) - { - PyErr_Format(PyExc_TypeError, "argument must be a bool(integer) value"); - return NULL; - } - - long i = PyInt_AsLong(pObject); - //while(i != 0) - //{ - CPyThreadState pyState; - Sleep(i);//(500); - pyState.Restore(); - - PyXBMC_MakePendingCalls(); - //i = PyInt_AsLong(pObject); - //} - - Py_INCREF(Py_None); - return Py_None; - } - - // getLocalizedString() method - PyDoc_STRVAR(getLocalizedString__doc__, - "getLocalizedString(id) -- Returns a localized 'unicode string'.\n" - "\n" - "id : integer - id# for string you want to localize.\n" - "\n" - "*Note, See strings.xml in \\language\\{yourlanguage}\\ for which id\n" - " you need for a string.\n" - "\n" - "example:\n" - " - locstr = xbmc.getLocalizedString(6)\n"); - - PyObject* XBMC_GetLocalizedString(PyObject *self, PyObject *args) - { - int iString; - if (!PyArg_ParseTuple(args, (char*)"i", &iString)) return NULL; - - CStdString label; - if (iString >= 30000 && iString <= 30999) - label = g_localizeStringsTemp.Get(iString); - else if (iString >= 32000 && iString <= 32999) - label = g_localizeStringsTemp.Get(iString); - else - label = g_localizeStrings.Get(iString); - - return PyUnicode_DecodeUTF8(label.c_str(), label.size(), "replace"); - } - - // getSkinDir() method - PyDoc_STRVAR(getSkinDir__doc__, - "getSkinDir() -- Returns the active skin directory as a string.\n" - "\n" - "*Note, This is not the full path like 'special://home/addons/MediaCenter', but only 'MediaCenter'.\n" - "\n" - "example:\n" - " - skindir = xbmc.getSkinDir()\n"); - - PyObject* XBMC_GetSkinDir(PyObject *self, PyObject *args) - { - return PyString_FromString(g_guiSettings.GetString("lookandfeel.skin")); - } - - // getLanguage() method - PyDoc_STRVAR(getLanguage__doc__, - "getLanguage() -- Returns the active language as a string.\n" - "\n" - "example:\n" - " - language = xbmc.getLanguage()\n"); - - PyObject* XBMC_GetLanguage(PyObject *self, PyObject *args) - { - return PyString_FromString(g_guiSettings.GetString("locale.language")); - } - - // getIPAddress() method - PyDoc_STRVAR(getIPAddress__doc__, - "getIPAddress() -- Returns the current ip address as a string.\n" - "\n" - "example:\n" - " - ip = xbmc.getIPAddress()\n"); - - PyObject* XBMC_GetIPAddress(PyObject *self, PyObject *args) - { - char cTitleIP[32]; - sprintf(cTitleIP, "127.0.0.1"); - CNetworkInterface* iface = g_application.getNetwork().GetFirstConnectedInterface(); - if (iface) - return PyString_FromString(iface->GetCurrentIPAddress().c_str()); - - return PyString_FromString(cTitleIP); - } - - // getDVDState() method - PyDoc_STRVAR(getDVDState__doc__, - "getDVDState() -- Returns the dvd state as an integer.\n" - "\n" - "return values are:\n" - " 1 : xbmc.DRIVE_NOT_READY\n" - " 16 : xbmc.TRAY_OPEN\n" - " 64 : xbmc.TRAY_CLOSED_NO_MEDIA\n" - " 96 : xbmc.TRAY_CLOSED_MEDIA_PRESENT\n" - "\n" - "example:\n" - " - dvdstate = xbmc.getDVDState()\n"); - - PyObject* XBMC_GetDVDState(PyObject *self, PyObject *args) - { - return PyInt_FromLong(g_mediaManager.GetDriveStatus()); - } - - // getFreeMem() method - PyDoc_STRVAR(getFreeMem__doc__, - "getFreeMem() -- Returns the amount of free memory in MB as an integer.\n" - "\n" - "example:\n" - " - freemem = xbmc.getFreeMem()\n"); - - PyObject* XBMC_GetFreeMem(PyObject *self, PyObject *args) - { - MEMORYSTATUSEX stat; - stat.dwLength = sizeof(MEMORYSTATUSEX); - GlobalMemoryStatusEx(&stat); - return PyInt_FromLong( (long)(stat.ullAvailPhys / ( 1024 * 1024 )) ); - } - - // getCpuTemp() method - // ## Doesn't work right, use getInfoLabel('System.CPUTemperature') instead. - /*PyDoc_STRVAR(getCpuTemp__doc__, - "getCpuTemp() -- Returns the current cpu temperature as an integer.\n" - "\n" - "example:\n" - " - cputemp = xbmc.getCpuTemp()\n"); - - PyObject* XBMC_GetCpuTemp(PyObject *self, PyObject *args) - { - unsigned short cputemp; - unsigned short cpudec; - - _outp(0xc004, (0x4c<<1)|0x01); - _outp(0xc008, 0x01); - _outpw(0xc000, _inpw(0xc000)); - _outp(0xc002, (0) ? 0x0b : 0x0a); - while ((_inp(0xc000) & 8)); - cputemp = _inpw(0xc006); - - _outp(0xc004, (0x4c<<1)|0x01); - _outp(0xc008, 0x10); - _outpw(0xc000, _inpw(0xc000)); - _outp(0xc002, (0) ? 0x0b : 0x0a); - while ((_inp(0xc000) & 8)); - cpudec = _inpw(0xc006); - - if (cpudec<10) cpudec = cpudec * 100; - if (cpudec<100) cpudec = cpudec *10; - - return PyInt_FromLong((long)(cputemp + cpudec / 1000.0f)); - }*/ - - // getInfolabel() method - PyDoc_STRVAR(getInfoLabel__doc__, - "getInfoLabel(infotag) -- Returns an InfoLabel as a string.\n" - "\n" - "infotag : string - infoTag for value you want returned.\n" - " Also multiple InfoLabels are possible e.x.:\n" - " label = xbmc.getInfoLabel('$INFO[Weather.Conditions] - thats the weather')\n" - "\n" - "List of InfoTags - http://wiki.xbmc.org/?title=InfoLabels \n" - "\n" - "example:\n" - " - label = xbmc.getInfoLabel('Weather.Conditions')\n"); - - PyObject* XBMC_GetInfoLabel(PyObject *self, PyObject *args) - { - std::string cret; - - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - { - CPyThreadState gilRelease; - - int ret = g_infoManager.TranslateString(cLine); - //doesn't seem to be a single InfoTag? - //try full blown GuiInfoLabel then - if (ret == 0) - { - CGUIInfoLabel label(cLine); - cret = label.GetLabel(0); - } - else - { - cret = g_infoManager.GetLabel(ret); - } - } - return Py_BuildValue((char*)"s", cret.c_str()); - } - - // getInfoImage() method - PyDoc_STRVAR(getInfoImage__doc__, - "getInfoImage(infotag) -- Returns a filename including path to the InfoImage's\n" - " thumbnail as a string.\n" - "\n" - "infotag : string - infotag for value you want returned.\n" - "\n" - "List of InfoTags - http://wiki.xbmc.org/?title=InfoLabels \n" - "\n" - "example:\n" - " - filename = xbmc.getInfoImage('Weather.Conditions')\n"); - - PyObject* XBMC_GetInfoImage(PyObject *self, PyObject *args) - { - std::string cret; - - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - { - CPyThreadState gilRelease; - - int ret = g_infoManager.TranslateString(cLine); - cret = g_infoManager.GetImage(ret, WINDOW_INVALID); - } - - return Py_BuildValue((char*)"s", cret.c_str()); - } - - // playSFX() method - PyDoc_STRVAR(playSFX__doc__, - "playSFX(filename) -- Plays a wav file by filename\n" - "\n" - "filename : string - filename of the wav file to play.\n" - "\n" - "example:\n" - " - xbmc.playSFX('special://xbmc/scripts/dingdong.wav')\n"); - - PyObject* XBMC_PlaySFX(PyObject *self, PyObject *args) - { - const char *cFile = NULL; - - if (!PyArg_ParseTuple(args, (char*)"s", &cFile)) return NULL; - - { - CPyThreadState gilRelease; - - if (CFile::Exists(cFile)) - { - g_audioManager.PlayPythonSound(cFile); - } - } - - Py_INCREF(Py_None); - return Py_None; - } - - // enableNavSounds() method - PyDoc_STRVAR(enableNavSounds__doc__, - "enableNavSounds(yesNo) -- Enables/Disables nav sounds\n" - "\n" - "yesNo : integer - enable (True) or disable (False) nav sounds\n" - "\n" - "example:\n" - " - xbmc.enableNavSounds(True)\n"); - - PyObject* XBMC_EnableNavSounds(PyObject *self, PyObject *args) - { - int yesNo = 1; - - if (!PyArg_ParseTuple(args, (char*)"i", &yesNo)) return NULL; - - g_audioManager.Enable(yesNo==1); - - Py_INCREF(Py_None); - return Py_None; - } - - // getCondVisibility() method - PyDoc_STRVAR(getCondVisibility__doc__, - "getCondVisibility(condition) -- Returns True (1) or False (0) as a bool.\n" - "\n" - "condition : string - condition to check.\n" - "\n" - "List of Conditions - http://wiki.xbmc.org/?title=List_of_Boolean_Conditions \n" - "\n" - "*Note, You can combine two (or more) of the above settings by using \"+\" as an AND operator,\n" - "\"|\" as an OR operator, \"!\" as a NOT operator, and \"[\" and \"]\" to bracket expressions.\n" - "\n" - "example:\n" - " - visible = xbmc.getCondVisibility('[Control.IsVisible(41) + !Control.IsVisible(12)]')\n"); - - PyObject* XBMC_GetCondVisibility(PyObject *self, PyObject *args) - { - char *cLine = NULL; - if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; - - bool ret; - { - CPyThreadState gilRelease; - CSingleLock gc(g_graphicsContext); - - int id = g_windowManager.GetTopMostModalDialogID(); - if (id == WINDOW_INVALID) id = g_windowManager.GetActiveWindow(); - ret = g_infoManager.EvaluateBool(cLine,id); - } - - return Py_BuildValue((char*)"b", ret); - } - - // getGlobalIdleTime() method - PyDoc_STRVAR(getGlobalIdleTime__doc__, - "getGlobalIdleTime() -- Returns the elapsed idle time in seconds as an integer.\n" - "\n" - "example:\n" - " - t = xbmc.getGlobalIdleTime()"); - - PyObject* XBMC_GetGlobalIdleTime(PyObject *self) - { - return Py_BuildValue((char*)"i", g_application.GlobalIdleTime()); - } - - // getCacheThumbName function - PyDoc_STRVAR(getCacheThumbName__doc__, - "getCacheThumbName(path) -- Returns a thumb cache filename.\n" - "\n" - "path : string or unicode - path to file\n" - "\n" - "example:\n" - " - thumb = xbmc.getCacheThumbName('f:\\\\videos\\\\movie.avi')\n"); - - PyObject* XBMC_GetCacheThumbName(PyObject *self, PyObject *args) - { - PyObject *pObjectText; - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - - string strText; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - Crc32 crc; - CStdString strPath; - crc.ComputeFromLowerCase(strText); - strPath.Format("%08x.tbn", (unsigned __int32)crc); - return Py_BuildValue((char*)"s", strPath.c_str()); - } - - // makeLegalFilename function - PyDoc_STRVAR(makeLegalFilename__doc__, - "makeLegalFilename(filename[, fatX]) -- Returns a legal filename or path as a string.\n" - "\n" - "filename : string or unicode - filename/path to make legal\n" - "fatX : [opt] bool - True=Xbox file system(Default)\n" - "\n" - "*Note, If fatX is true you should pass a full path. If fatX is false only pass\n" - " the basename of the path.\n" - "\n" - " You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - filename = xbmc.makeLegalFilename('F:\\Trailers\\Ice Age: The Meltdown.avi')\n"); - - PyObject* XBMC_MakeLegalFilename(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "filename", "fatX", NULL }; - PyObject *pObjectText; - char bIsFatX = true; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O|b", - (char**)keywords, - &pObjectText, - &bIsFatX - )) - { - return NULL; - }; - - CStdString strText; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - CStdString strFilename; - strFilename = CUtil::MakeLegalPath(strText); - return Py_BuildValue((char*)"s", strFilename.c_str()); - } - - // translatePath function - PyDoc_STRVAR(translatePath__doc__, - "translatePath(path) -- Returns the translated path.\n" - "\n" - "path : string or unicode - Path to format\n" - "\n" - "*Note, Only useful if you are coding for both Linux and Windows/Xbox.\n" - " e.g. Converts 'special://masterprofile/script_data' -> '/home/user/XBMC/UserData/script_data'\n" - " on Linux. Would return 'special://masterprofile/script_data' on the Xbox.\n" - "\n" - "example:\n" - " - fpath = xbmc.translatePath('special://masterprofile/script_data')\n"); - - PyObject* XBMC_TranslatePath(PyObject *self, PyObject *args) - { - PyObject *pObjectText; - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - - CStdString strText; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - CStdString strPath; - strPath = CSpecialProtocol::TranslatePath(strText); - - return Py_BuildValue((char*)"s", strPath.c_str()); - } - - // getcleanmovietitle function - PyDoc_STRVAR(getCleanMovieTitle__doc__, - "getCleanMovieTitle(path[, usefoldername]) -- Returns a clean movie title and year string if available.\n" - "\n" - "path : string or unicode - String to clean\n" - "bool : [opt] bool - use folder names (defaults to false)\n" - "\n" - "example:\n" - " - title, year = xbmc.getCleanMovieTitle('/path/to/moviefolder/test.avi', True)\n"); - - PyObject* XBMC_GetCleanMovieTitle(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "path", "usefoldername", NULL }; - PyObject *pObjectText; - bool bUseFolderName = false; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"O|b", - (char**)keywords, - &pObjectText, - &bUseFolderName - )) - { - return NULL; - }; - - CStdString strPath; - if (!PyXBMCGetUnicodeString(strPath, pObjectText, 1)) return NULL; - - CFileItem item(strPath, false); - CStdString strName = item.GetMovieName(bUseFolderName); - - CStdString strTitle, strTitleAndYear, strYear; - CUtil::CleanString(strName, strTitle, strTitleAndYear, strYear, bUseFolderName); - - return Py_BuildValue((char*)"s,s", strTitle.c_str(), strYear.c_str()); - } - - // validatePath function - PyDoc_STRVAR(validatePath__doc__, - "validatePath(path) -- Returns the validated path.\n" - "\n" - "path : string or unicode - Path to format\n" - "\n" - "*Note, Only useful if you are coding for both Linux and Windows/Xbox for fixing slash problems.\n" - " e.g. Corrects 'Z://something' -> 'Z:\\something'\n" - "\n" - "example:\n" - " - fpath = xbmc.validatePath(somepath)\n"); - - PyObject* XBMC_ValidatePath(PyObject *self, PyObject *args) - { - PyObject *pObjectText; - if (!PyArg_ParseTuple(args, (char*)"O", &pObjectText)) return NULL; - - CStdString strText; - if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL; - - return Py_BuildValue((char*)"s", CUtil::ValidatePath(strText, true).c_str()); - } - - // getRegion function - PyDoc_STRVAR(getRegion__doc__, - "getRegion(id) -- Returns your regions setting as a string for the specified id.\n" - "\n" - "id : string - id of setting to return\n" - "\n" - "*Note, choices are (dateshort, datelong, time, meridiem, tempunit, speedunit)\n" - "\n" - " You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - date_long_format = xbmc.getRegion('datelong')\n"); - - PyObject* XBMC_GetRegion(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "id", NULL }; - char *id = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &id - )) - { - return NULL; - }; - - CStdString result; - - if (strcmpi(id, "datelong") == 0) - { - result = g_langInfo.GetDateFormat(true); - result.Replace("DDDD", "%A"); - result.Replace("MMMM", "%B"); - result.Replace("D", "%d"); - result.Replace("YYYY", "%Y"); - } - else if (strcmpi(id, "dateshort") == 0) - { - result = g_langInfo.GetDateFormat(false); - result.Replace("MM", "%m"); - result.Replace("DD", "%d"); - result.Replace("YYYY", "%Y"); - } - else if (strcmpi(id, "tempunit") == 0) - result = g_langInfo.GetTempUnitString(); - else if (strcmpi(id, "speedunit") == 0) - result = g_langInfo.GetSpeedUnitString(); - else if (strcmpi(id, "time") == 0) - { - result = g_langInfo.GetTimeFormat(); - result.Replace("H", "%H"); - result.Replace("h", "%I"); - result.Replace("mm", "%M"); - result.Replace("ss", "%S"); - result.Replace("xx", "%p"); - } - else if (strcmpi(id, "meridiem") == 0) - result.Format("%s/%s", g_langInfo.GetMeridiemSymbol(CLangInfo::MERIDIEM_SYMBOL_AM), g_langInfo.GetMeridiemSymbol(CLangInfo::MERIDIEM_SYMBOL_PM)); - - return Py_BuildValue((char*)"s", result.c_str()); - } - - // getSupportedMedia function - PyDoc_STRVAR(getSupportedMedia__doc__, - "getSupportedMedia(media) -- Returns the supported file types for the specific media as a string.\n" - "\n" - "media : string - media type\n" - "\n" - "*Note, media type can be (video, music, picture).\n" - "\n" - " The return value is a pipe separated string of filetypes (eg. '.mov|.avi').\n" - "\n" - " You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - mTypes = xbmc.getSupportedMedia('video')\n"); - - PyObject* XBMC_GetSupportedMedia(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "media", NULL }; - char *media = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &media - )) - { - return NULL; - }; - - CStdString result; - if (strcmpi(media, "video") == 0) - result = g_settings.m_videoExtensions; - else if (strcmpi(media, "music") == 0) - result = g_settings.m_musicExtensions; - else if (strcmpi(media, "picture") == 0) - result = g_settings.m_pictureExtensions; - else - { - PyErr_SetString(PyExc_ValueError, "media = (video, music, picture)"); - return NULL; - } - - return Py_BuildValue((char*)"s", result.c_str()); - } - - // skinHasImage function - PyDoc_STRVAR(skinHasImage__doc__, - "skinHasImage(image) -- Returns True if the image file exists in the skin.\n" - "\n" - "image : string - image filename\n" - "\n" - "*Note, If the media resides in a subfolder include it. (eg. home-myfiles\\\\home-myfiles2.png)\n" - "\n" - " You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - exists = xbmc.skinHasImage('ButtonFocusedTexture.png')\n"); - - PyObject* XBMC_SkinHasImage(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "image", NULL }; - char *image = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"s", - (char**)keywords, - &image - )) - { - return NULL; - }; - - bool exists = g_TextureManager.HasTexture(image); - - return Py_BuildValue((char*)"b", exists); - } - - // startServer() method - PyDoc_STRVAR(startServer__doc__, - "startServer(typ, bStart, bWait) -- start or stop a server.\n" - "\n" - "typ : integer - use SERVER_* constants\n" - "\n" - "bStart : bool - start (True) or stop (False) a server\n" - "\n" - "bWait : [opt] bool - wait on stop before returning (not supported by all servers)\n" - "\n" - "returnValue : bool - True or False\n" - "example:\n" - " - xbmc.startServer(xbmc.SERVER_AIRPLAYSERVER, False)\n"); - - PyObject* XBMC_StartServer(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { - "typ", - "bStart", - "bWait", - NULL}; - - int iTyp = 0; - char bStart = false; - char bWait = false; - bool ret = false; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"ib|b", - (char**)keywords, - &iTyp, - &bStart, - &bWait)) - { - return NULL; - } - - { - CPyThreadState save; - ret = g_application.StartServer((CApplication::ESERVERS)iTyp, bStart != 0, bWait != 0); - } - - return Py_BuildValue((char*)"b", ret); - } - - // AudioSuspend() method - PyDoc_STRVAR(audioSuspend__doc__, - "AudioSuspend() -- Suspend Audio engine.\n" - "\n" - "example:\n" - " xbmc.AudioSuspend()"); - - PyObject* XBMC_AudioSuspend(PyObject *self) - { - CAEFactory::Suspend(); - - Py_INCREF(Py_None); - return Py_None; - } - - // AudioResume() method - PyDoc_STRVAR(audioResume__doc__, - "AudioResume() -- Resume Audio engine.\n" - "\n" - "example:\n" - " xbmc.AudioResume()"); - - PyObject* XBMC_AudioResume(PyObject *self) - { - CAEFactory::Resume(); - - Py_INCREF(Py_None); - return Py_None; - } - - // define c functions to be used in python here - PyMethodDef xbmcMethods[] = { - {(char*)"output", (PyCFunction)XBMC_Output, METH_VARARGS|METH_KEYWORDS, output__doc__}, - {(char*)"log", (PyCFunction)XBMC_Log, METH_VARARGS|METH_KEYWORDS, log__doc__}, - {(char*)"executescript", (PyCFunction)XBMC_ExecuteScript, METH_VARARGS, executeScript__doc__}, - {(char*)"executebuiltin", (PyCFunction)XBMC_ExecuteBuiltIn, METH_VARARGS, executeBuiltIn__doc__}, - - {(char*)"sleep", (PyCFunction)XBMC_Sleep, METH_VARARGS, sleep__doc__}, - {(char*)"shutdown", (PyCFunction)XBMC_Shutdown, METH_VARARGS, shutdown__doc__}, - {(char*)"restart", (PyCFunction)XBMC_Restart, METH_VARARGS, restart__doc__}, - {(char*)"getSkinDir", (PyCFunction)XBMC_GetSkinDir, METH_VARARGS, getSkinDir__doc__}, - {(char*)"getLocalizedString", (PyCFunction)XBMC_GetLocalizedString, METH_VARARGS, getLocalizedString__doc__}, - - {(char*)"getLanguage", (PyCFunction)XBMC_GetLanguage, METH_VARARGS, getLanguage__doc__}, - {(char*)"getIPAddress", (PyCFunction)XBMC_GetIPAddress, METH_VARARGS, getIPAddress__doc__}, - {(char*)"getDVDState", (PyCFunction)XBMC_GetDVDState, METH_VARARGS, getDVDState__doc__}, - {(char*)"getFreeMem", (PyCFunction)XBMC_GetFreeMem, METH_VARARGS, getFreeMem__doc__}, - //{(char*)"getCpuTemp", (PyCFunction)XBMC_GetCpuTemp, METH_VARARGS, getCpuTemp__doc__}, - -#ifdef HAS_HTTPAPI - {(char*)"executehttpapi", (PyCFunction)XBMC_ExecuteHttpApi, METH_VARARGS, executeHttpApi__doc__}, -#endif -#ifdef HAS_JSONRPC - {(char*)"executeJSONRPC", (PyCFunction)XBMC_ExecuteJSONRPC, METH_VARARGS, executeJSONRPC__doc__}, -#endif - {(char*)"getInfoLabel", (PyCFunction)XBMC_GetInfoLabel, METH_VARARGS, getInfoLabel__doc__}, - {(char*)"getInfoImage", (PyCFunction)XBMC_GetInfoImage, METH_VARARGS, getInfoImage__doc__}, - {(char*)"getCondVisibility", (PyCFunction)XBMC_GetCondVisibility, METH_VARARGS, getCondVisibility__doc__}, - {(char*)"getGlobalIdleTime", (PyCFunction)XBMC_GetGlobalIdleTime, METH_VARARGS, getGlobalIdleTime__doc__}, - - {(char*)"playSFX", (PyCFunction)XBMC_PlaySFX, METH_VARARGS, playSFX__doc__}, - {(char*)"enableNavSounds", (PyCFunction)XBMC_EnableNavSounds, METH_VARARGS, enableNavSounds__doc__}, - - {(char*)"getCacheThumbName", (PyCFunction)XBMC_GetCacheThumbName, METH_VARARGS, getCacheThumbName__doc__}, - - {(char*)"makeLegalFilename", (PyCFunction)XBMC_MakeLegalFilename, METH_VARARGS|METH_KEYWORDS, makeLegalFilename__doc__}, - {(char*)"translatePath", (PyCFunction)XBMC_TranslatePath, METH_VARARGS, translatePath__doc__}, - {(char*)"validatePath", (PyCFunction)XBMC_ValidatePath, METH_VARARGS, validatePath__doc__}, - - {(char*)"getRegion", (PyCFunction)XBMC_GetRegion, METH_VARARGS|METH_KEYWORDS, getRegion__doc__}, - {(char*)"getSupportedMedia", (PyCFunction)XBMC_GetSupportedMedia, METH_VARARGS|METH_KEYWORDS, getSupportedMedia__doc__}, - - {(char*)"getCleanMovieTitle", (PyCFunction)XBMC_GetCleanMovieTitle, METH_VARARGS|METH_KEYWORDS, getCleanMovieTitle__doc__}, - - {(char*)"skinHasImage", (PyCFunction)XBMC_SkinHasImage, METH_VARARGS|METH_KEYWORDS, skinHasImage__doc__}, - - {(char*)"startServer", (PyCFunction)XBMC_StartServer, METH_VARARGS|METH_KEYWORDS, startServer__doc__}, - - {(char*)"AudioSuspend", (PyCFunction)XBMC_AudioSuspend, METH_VARARGS, audioSuspend__doc__}, - {(char*)"AudioResume", (PyCFunction)XBMC_AudioResume, METH_VARARGS, audioResume__doc__}, - - {NULL, NULL, 0, NULL} - }; - -/***************************************************************** - * end of methods and python objects - * initxbmc(void); - *****************************************************************/ - PyMODINIT_FUNC - InitXBMCTypes() - { - initKeyboard_Type(); - initPlayer_Type(); - initPlayList_Type(); - initPlayListItem_Type(); - initInfoTagMusic_Type(); - initInfoTagVideo_Type(); - initMonitor_Type(); - -#ifdef HAS_PYRENDERCAPTURE - initRenderCapture_Type(); -#endif - - if (PyType_Ready(&Keyboard_Type) < 0 || - PyType_Ready(&Player_Type) < 0 || - PyType_Ready(&PlayList_Type) < 0 || - PyType_Ready(&PlayListItem_Type) < 0 || - PyType_Ready(&InfoTagMusic_Type) < 0 || - PyType_Ready(&InfoTagVideo_Type) < 0 || - PyType_Ready(&Monitor_Type) < 0) return; - -#ifdef HAS_PYRENDERCAPTURE - if (PyType_Ready(&RenderCapture_Type) < 0) - return; -#endif - } - - PyMODINIT_FUNC - DeinitXBMCModule() - { - // no need to Py_DECREF our objects (see InitXBMCModule()) as they were created only - // so that they could be added to the module, which steals a reference. - } - - PyMODINIT_FUNC - InitXBMCModule() - { - // init general xbmc modules - PyObject* pXbmcModule; - - Py_INCREF(&Keyboard_Type); - Py_INCREF(&Player_Type); - Py_INCREF(&PlayList_Type); - Py_INCREF(&PlayListItem_Type); - Py_INCREF(&InfoTagMusic_Type); - Py_INCREF(&InfoTagVideo_Type); - Py_INCREF(&Monitor_Type); - -#ifdef HAS_PYRENDERCAPTURE - Py_INCREF(&RenderCapture_Type); -#endif - - pXbmcModule = Py_InitModule((char*)"xbmc", xbmcMethods); - if (pXbmcModule == NULL) return; - - PyModule_AddObject(pXbmcModule, (char*)"Keyboard", (PyObject*)&Keyboard_Type); - PyModule_AddObject(pXbmcModule, (char*)"Player", (PyObject*)&Player_Type); - PyModule_AddObject(pXbmcModule, (char*)"PlayList", (PyObject*)&PlayList_Type); - PyModule_AddObject(pXbmcModule, (char*)"PlayListItem", (PyObject*)&PlayListItem_Type); - PyModule_AddObject(pXbmcModule, (char*)"InfoTagMusic", (PyObject*)&InfoTagMusic_Type); - PyModule_AddObject(pXbmcModule, (char*)"InfoTagVideo", (PyObject*)&InfoTagVideo_Type); - PyModule_AddObject(pXbmcModule, (char*)"Monitor", (PyObject*)&Monitor_Type); - - // constants - PyModule_AddStringConstant(pXbmcModule, (char*)"__author__", (char*)PY_XBMC_AUTHOR); - PyModule_AddStringConstant(pXbmcModule, (char*)"__date__", (char*)"16 February 2011"); - PyModule_AddStringConstant(pXbmcModule, (char*)"__version__", (char*)"1.4"); - PyModule_AddStringConstant(pXbmcModule, (char*)"__credits__", (char*)PY_XBMC_CREDITS); - PyModule_AddStringConstant(pXbmcModule, (char*)"__platform__", (char*)PY_XBMC_PLATFORM); - - // playlist constants - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYLIST_MUSIC", PLAYLIST_MUSIC); - //PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYLIST_MUSIC_TEMP", (char*)PLAYLIST_MUSIC_TEMP); - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYLIST_VIDEO", PLAYLIST_VIDEO); - //PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYLIST_VIDEO_TEMP", PLAYLIST_VIDEO_TEMP); - - // player constants - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYER_CORE_AUTO", EPC_NONE); - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYER_CORE_DVDPLAYER", EPC_DVDPLAYER); - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYER_CORE_MPLAYER", EPC_MPLAYER); - PyModule_AddIntConstant(pXbmcModule, (char*)"PLAYER_CORE_PAPLAYER", EPC_PAPLAYER); - - // server constants for startServer method - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_WEBSERVER", CApplication::ES_WEBSERVER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_AIRPLAYSERVER", CApplication::ES_AIRPLAYSERVER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_UPNPSERVER", CApplication::ES_UPNPSERVER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_UPNPRENDERER", CApplication::ES_UPNPRENDERER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_EVENTSERVER", CApplication::ES_EVENTSERVER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_JSONRPCSERVER", CApplication::ES_JSONRPCSERVER); - PyModule_AddIntConstant(pXbmcModule, (char*)"SERVER_ZEROCONF", CApplication::ES_ZEROCONF); - - - // dvd state constants - PyModule_AddIntConstant(pXbmcModule, (char*)"TRAY_OPEN", TRAY_OPEN); - PyModule_AddIntConstant(pXbmcModule, (char*)"DRIVE_NOT_READY", DRIVE_NOT_READY); - PyModule_AddIntConstant(pXbmcModule, (char*)"TRAY_CLOSED_NO_MEDIA", TRAY_CLOSED_NO_MEDIA); - PyModule_AddIntConstant(pXbmcModule, (char*)"TRAY_CLOSED_MEDIA_PRESENT", TRAY_CLOSED_MEDIA_PRESENT); - - // log levels - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGDEBUG", LOGDEBUG); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGINFO", LOGINFO); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGNOTICE", LOGNOTICE); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGWARNING", LOGWARNING); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGERROR", LOGERROR); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGSEVERE", LOGSEVERE); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGFATAL", LOGFATAL); - PyModule_AddIntConstant(pXbmcModule, (char*)"LOGNONE", LOGNONE); - PyModule_AddObject(pXbmcModule, (char*)"abortRequested", PyBool_FromLong(0)); - -#ifdef HAS_PYRENDERCAPTURE - PyModule_AddObject(pXbmcModule, (char*)"RenderCapture", (PyObject*)&RenderCapture_Type); -#endif - - // render capture user states - PyModule_AddIntConstant(pXbmcModule, (char*)"CAPTURE_STATE_WORKING", (int)CAPTURESTATE_WORKING); - PyModule_AddIntConstant(pXbmcModule, (char*)"CAPTURE_STATE_DONE", (int)CAPTURESTATE_DONE); - PyModule_AddIntConstant(pXbmcModule, (char*)"CAPTURE_STATE_FAILED", (int)CAPTURESTATE_FAILED); - - // render capture flags - PyModule_AddIntConstant(pXbmcModule, (char*)"CAPTURE_FLAG_CONTINUOUS", (int)CAPTUREFLAG_CONTINUOUS); - PyModule_AddIntConstant(pXbmcModule, (char*)"CAPTURE_FLAG_IMMEDIATELY", (int)CAPTUREFLAG_IMMEDIATELY); - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcplugin.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcplugin.cpp deleted file mode 100644 index 79de044675..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/xbmcplugin.cpp +++ /dev/null @@ -1,634 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// include for constants -#include "pyutil.h" - -#include "filesystem/PluginDirectory.h" -#include "listitem.h" -#include "FileItem.h" - -using namespace std; -using namespace XFILE; -using namespace ADDON; - - -#ifdef __cplusplus -extern "C" { -#endif - -namespace PYXBMC -{ -/***************************************************************** - * start of xbmc methods - *****************************************************************/ - PyDoc_STRVAR(addDirectoryItem__doc__, - "addDirectoryItem(handle, url, listitem [,isFolder, totalItems]) -- Callback function to pass directory contents back to XBMC.\n" - " - Returns a bool for successful completion.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "url : string - url of the entry. would be plugin:// for another virtual directory\n" - "listitem : ListItem - item to add.\n" - "isFolder : [opt] bool - True=folder / False=not a folder(default).\n" - "totalItems : [opt] integer - total number of items that will be passed.(used for progressbar)\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - if not xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'F:\\\\Trailers\\\\300.mov', listitem, totalItems=50): break\n"); - - PyObject* XBMCPLUGIN_AddDirectoryItem(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "url", "listitem", "isFolder", "totalItems", NULL }; - int handle = -1; - PyObject *pURL = NULL; - PyObject *pItem = NULL; - char bIsFolder = false; - int iTotalItems = 0; - // parse arguments - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"iOO|bi", - (char**)keywords, - &handle, - &pURL, - &pItem, - &bIsFolder, - &iTotalItems - )) - { - return NULL; - }; - - string url; - if (!PyXBMCGetUnicodeString(url, pURL, 1) || !ListItem_CheckExact(pItem)) return NULL; - - ListItem *pListItem = (ListItem *)pItem; - pListItem->item->SetPath(url); - pListItem->item->m_bIsFolder = (0 != bIsFolder); - - // call the directory class to add our item - bool bOk = XFILE::CPluginDirectory::AddItem(handle, pListItem->item.get(), iTotalItems); - return Py_BuildValue((char*)"b", bOk); - } - - PyDoc_STRVAR(addDirectoryItems__doc__, - "addDirectoryItems(handle, items [,totalItems]) -- Callback function to pass directory contents back to XBMC as a list.\n" - " - Returns a bool for successful completion.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "items : List - list of (url, listitem[, isFolder]) as a tuple to add.\n" - "totalItems : [opt] integer - total number of items that will be passed.(used for progressbar)\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - " Large lists benefit over using the standard addDirectoryItem()\n" - " You may call this more than once to add items in chunks\n" - "\n" - "example:\n" - " - if not xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(url, listitem, False,)]: raise\n"); - - PyObject* XBMCPLUGIN_AddDirectoryItems(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - int handle = -1; - PyObject *pItems = NULL; - - static const char *keywords[] = { "handle", "items", "totalItems", NULL }; - - int totalItems = 0; - // parse arguments - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"iO|i", - (char**)keywords, - &handle, - &pItems, - &totalItems - )) - { - return NULL; - }; - - CFileItemList items; - for (int item = 0; item < PyList_Size(pItems); item++) - { - PyObject *pItem = PyList_GetItem(pItems, item); - PyObject *pURL = NULL; - char bIsFolder = false; - // parse arguments - if (!PyArg_ParseTuple( - pItem, - (char*)"OO|b", - &pURL, - &pItem, - &bIsFolder - )) - { - return NULL; - }; - - string url; - if (!PyXBMCGetUnicodeString(url, pURL, 1) || !ListItem_CheckExact(pItem)) return NULL; - - ListItem *pListItem = (ListItem *)pItem; - pListItem->item->SetPath(url); - pListItem->item->m_bIsFolder = (0 != bIsFolder); - items.Add(pListItem->item); - } - // call the directory class to add our items - bool bOk = XFILE::CPluginDirectory::AddItems(handle, &items, totalItems); - - return Py_BuildValue((char*)"b", bOk); - } - - PyDoc_STRVAR(endOfDirectory__doc__, - "endOfDirectory(handle[, succeeded, updateListing, cacheToDisc]) -- Callback function to tell XBMC that the end of the directory listing in a virtualPythonFolder module is reached.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "succeeded : [opt] bool - True=script completed successfully(Default)/False=Script did not.\n" - "updateListing : [opt] bool - True=this folder should update the current listing/False=Folder is a subfolder(Default).\n" - "cacheToDisc : [opt] bool - True=Folder will cache if extended time(default)/False=this folder will never cache to disc.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False)\n"); - - PyObject* XBMCPLUGIN_EndOfDirectory(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "succeeded", "updateListing", "cacheToDisc", NULL }; - int handle = -1; - char bSucceeded = true; - char bUpdateListing = false; - char bCacheToDisc = true; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"i|bbb", - (char**)keywords, - &handle, - &bSucceeded, - &bUpdateListing, - &bCacheToDisc - )) - { - return NULL; - }; - - // tell the directory class that we're done - XFILE::CPluginDirectory::EndOfDirectory(handle, 0 != bSucceeded, 0 != bUpdateListing, 0 != bCacheToDisc); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setResolvedUrl__doc__, - "setResolvedUrl(handle, succeeded, listitem) -- Callback function to tell XBMC that the file plugin has been resolved to a url\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "succeeded : bool - True=script completed successfully/False=Script did not.\n" - "listitem : ListItem - item the file plugin resolved to for playback.\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)\n"); - - PyObject* XBMCPLUGIN_SetResolvedUrl(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "succeeded", "listitem", NULL }; - int handle = -1; - char bSucceeded = true; - PyObject *pItem = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"ibO", - (char**)keywords, - &handle, - &bSucceeded, - &pItem - )) - { - return NULL; - }; - - ListItem *pListItem = (ListItem *)pItem; - - XFILE::CPluginDirectory::SetResolvedUrl(handle, 0 != bSucceeded, pListItem->item.get()); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(addSortMethod__doc__, - "addSortMethod(handle, sortMethod, label2) -- Adds a sorting method for the media list.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "sortMethod : integer - number for sortmethod see FileItem.h.\n" - "label2Mask : [opt] string - the label mask to use for the second label. Defaults to '%D'\n" - " applies to: SORT_METHOD_NONE, SORT_METHOD_UNSORTED, SORT_METHOD_VIDEO_TITLE,\n" - " SORT_METHOD_TRACKNUM, SORT_METHOD_FILE, SORT_METHOD_TITLE\n" - " SORT_METHOD_TITLE_IGNORE_THE, SORT_METHOD_LABEL\n" - " SORT_METHOD_LABEL_IGNORE_THE, SORT_METHOD_VIDEO_SORT_TITLE,\n" - " SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE\n" - "\n" - "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n" - " Once you use a keyword, all following arguments require the keyword.\n" - "\n" - "example:\n" - " - xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_TITLE)\n"); - - PyObject* XBMCPLUGIN_AddSortMethod(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "sortMethod", "label2Mask", NULL }; - int handle = -1; - int sortMethod = -1; - PyObject *mask2 = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"ii|O", - (char**)keywords, - &handle, - &sortMethod, - &mask2 - )) - { - return NULL; - }; - - string label2Mask; - if (mask2) - PyXBMCGetUnicodeString(label2Mask, mask2, 1); - if (label2Mask.empty()) - label2Mask = "%D"; - - // call the directory class to add the sort method. - if (sortMethod >= SORT_METHOD_NONE && sortMethod < SORT_METHOD_MAX) - XFILE::CPluginDirectory::AddSortMethod(handle, (SORT_METHOD)sortMethod, label2Mask); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(getSetting__doc__, - "getSetting(handle, id) -- Returns the value of a setting as a string.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "id : string - id of the setting that the module needs to access.\n" - "\n" - "*Note, You can use the above as a keyword.\n" - "\n" - "example:\n" - " - apikey = xbmcplugin.getSetting(int(sys.argv[1]), 'apikey')\n"); - - PyObject* XBMCPLUGIN_GetSetting(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "id", NULL }; - int handle = -1; - char *id; - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"is", - (char**)keywords, - &handle, - &id - )) - { - return NULL; - }; - - return Py_BuildValue((char*)"s", XFILE::CPluginDirectory::GetSetting(handle, id).c_str()); - } - - PyDoc_STRVAR(setSetting__doc__, - "setSetting(handle, id, value) -- Sets a plugin setting for the current running plugin.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "id : string - id of the setting that the module needs to access.\n" - "value : string or unicode - value of the setting.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - xbmcplugin.setSetting(int(sys.argv[1]), id='username', value='teamxbmc')\n"); - - PyObject* XBMCPLUGIN_SetSetting(PyObject *self, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "id", "value" }; - int handle = -1; - char *id; - PyObject *pValue = NULL; - - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"isO", - (char**)keywords, - &handle, - &id, - &pValue - )) - { - return NULL; - }; - - CStdString value; - if (!id || !PyXBMCGetUnicodeString(value, pValue, 1)) - return NULL; - - XFILE::CPluginDirectory::SetSetting(handle, id, value); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setContent__doc__, - "setContent(handle, content) -- Sets the plugins content.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "content : string - content type (eg. movies)\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - " content: files, songs, artists, albums, movies, tvshows, episodes, musicvideos\n" - "\n" - "example:\n" - " - xbmcplugin.setContent(int(sys.argv[1]), 'movies')\n"); - - PyObject* XBMCPLUGIN_SetContent(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "content", NULL }; - int handle = -1; - char *content; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"is", - (char**)keywords, - &handle, - &content - )) - { - return NULL; - }; - - XFILE::CPluginDirectory::SetContent(handle, content); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setPluginCategory__doc__, - "setPluginCategory(handle, category) -- Sets the plugins name for skins to display.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "category : string or unicode - plugins sub category.\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - xbmcplugin.setPluginCategory(int(sys.argv[1]), 'Comedy')\n"); - - PyObject* XBMCPLUGIN_SetPluginCategory(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "category", NULL }; - int handle = -1; - PyObject *category = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"iO", - (char**)keywords, - &handle, - &category - )) - { - return NULL; - }; - - CStdString uCategory; - if (!category || (category && !PyXBMCGetUnicodeString(uCategory, category, 1))) - return NULL; - - XFILE::CPluginDirectory::SetProperty(handle, "plugincategory", uCategory); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setPluginFanart__doc__, - "setPluginFanart(handle, image, color1, color2, color3) -- Sets the plugins fanart and color for skins to display.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "image : [opt] string - path to fanart image.\n" - "color1 : [opt] hexstring - color1. (e.g. '0xFFFFFFFF')\n" - "color2 : [opt] hexstring - color2. (e.g. '0xFFFF3300')\n" - "color3 : [opt] hexstring - color3. (e.g. '0xFF000000')\n" - "\n" - "*Note, You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - xbmcplugin.setPluginFanart(int(sys.argv[1]), 'special://home/addons/plugins/video/Apple movie trailers II/fanart.png', color2='0xFFFF3300')\n"); - - PyObject* XBMCPLUGIN_SetPluginFanart(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "image", "color1", "color2", "color3", NULL }; - int handle = -1; - char *image = NULL; - char *color1 = NULL; - char *color2 = NULL; - char *color3 = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"i|ssss", - (char**)keywords, - &handle, - &image, - &color1, - &color2, - &color3 - )) - { - return NULL; - }; - - if (image) - XFILE::CPluginDirectory::SetProperty(handle, "fanart_image", image); - if (color1) - XFILE::CPluginDirectory::SetProperty(handle, "fanart_color1", color1); - if (color2) - XFILE::CPluginDirectory::SetProperty(handle, "fanart_color2", color2); - if (color3) - XFILE::CPluginDirectory::SetProperty(handle, "fanart_color3", color3); - - Py_INCREF(Py_None); - return Py_None; - } - - PyDoc_STRVAR(setProperty__doc__, - "setProperty(handle, key, value) -- Sets a container property for this plugin.\n" - "\n" - "handle : integer - handle the plugin was started with.\n" - "key : string - property name.\n" - "value : string or unicode - value of property.\n" - "\n" - "*Note, Key is NOT case sensitive.\n" - " You can use the above as keywords for arguments.\n" - "\n" - "example:\n" - " - xbmcplugin.setProperty(int(sys.argv[1]), 'Emulator', 'M.A.M.E.')\n"); - - PyObject* XBMCPLUGIN_SetProperty(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - static const char *keywords[] = { "handle", "key", "value", NULL }; - int handle = -1; - char *key = NULL; - PyObject *pValue = NULL; - // parse arguments to constructor - if (!PyArg_ParseTupleAndKeywords( - args, - kwds, - (char*)"isO", - (char**)keywords, - &handle, - &key, - &pValue - )) - { - return NULL; - }; - - if (!key || !pValue) return NULL; - CStdString value; - if (!PyXBMCGetUnicodeString(value, pValue, 1)) - return NULL; - - CStdString lowerKey = key; - XFILE::CPluginDirectory::SetProperty(handle, key, value); - - Py_INCREF(Py_None); - return Py_None; - } - - // define c functions to be used in python here - PyMethodDef pluginMethods[] = { - {(char*)"addDirectoryItem", (PyCFunction)XBMCPLUGIN_AddDirectoryItem, METH_VARARGS|METH_KEYWORDS, addDirectoryItem__doc__}, - {(char*)"addDirectoryItems", (PyCFunction)XBMCPLUGIN_AddDirectoryItems, METH_VARARGS|METH_KEYWORDS, addDirectoryItems__doc__}, - {(char*)"endOfDirectory", (PyCFunction)XBMCPLUGIN_EndOfDirectory, METH_VARARGS|METH_KEYWORDS, endOfDirectory__doc__}, - {(char*)"setResolvedUrl", (PyCFunction)XBMCPLUGIN_SetResolvedUrl, METH_VARARGS|METH_KEYWORDS, setResolvedUrl__doc__}, - {(char*)"addSortMethod", (PyCFunction)XBMCPLUGIN_AddSortMethod, METH_VARARGS|METH_KEYWORDS, addSortMethod__doc__}, - {(char*)"getSetting", (PyCFunction)XBMCPLUGIN_GetSetting, METH_VARARGS|METH_KEYWORDS, getSetting__doc__}, - {(char*)"setSetting", (PyCFunction)XBMCPLUGIN_SetSetting, METH_VARARGS|METH_KEYWORDS, setSetting__doc__}, - {(char*)"setContent", (PyCFunction)XBMCPLUGIN_SetContent, METH_VARARGS|METH_KEYWORDS, setContent__doc__}, - {(char*)"setPluginCategory", (PyCFunction)XBMCPLUGIN_SetPluginCategory, METH_VARARGS|METH_KEYWORDS, setPluginCategory__doc__}, - {(char*)"setPluginFanart", (PyCFunction)XBMCPLUGIN_SetPluginFanart, METH_VARARGS|METH_KEYWORDS, setPluginFanart__doc__}, - {(char*)"setProperty", (PyCFunction)XBMCPLUGIN_SetProperty, METH_VARARGS|METH_KEYWORDS, setProperty__doc__}, - {NULL, NULL, 0, NULL} - }; - -/***************************************************************** - * end of methods and python objects - * initxbmcplugin(void); - *****************************************************************/ - - PyMODINIT_FUNC - DeinitPluginModule(void) - { - // no need to Py_DECREF our objects (see InitPluginTypes()) as they were created only - // so that they could be added to the module, which steals a reference. - } - - PyMODINIT_FUNC - InitPluginTypes(void) - { - // no types here - } - - PyMODINIT_FUNC - InitPluginModule() - { - // init general xbmc modules - PyObject* pXbmcPluginModule; - - pXbmcPluginModule = Py_InitModule((char*)"xbmcplugin", pluginMethods); - if (pXbmcPluginModule == NULL) return; - - // constants - PyModule_AddStringConstant(pXbmcPluginModule, (char*)"__author__", (char*)PY_XBMC_AUTHOR); - PyModule_AddStringConstant(pXbmcPluginModule, (char*)"__date__", (char*)"4 March 2009"); - PyModule_AddStringConstant(pXbmcPluginModule, (char*)"__version__", (char*)"1.5"); - PyModule_AddStringConstant(pXbmcPluginModule, (char*)"__credits__", (char*)PY_XBMC_CREDITS); - PyModule_AddStringConstant(pXbmcPluginModule, (char*)"__platform__", (char*)PY_XBMC_PLATFORM); - - // sort method constants - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_NONE", SORT_METHOD_NONE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_LABEL", SORT_METHOD_LABEL); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_LABEL_IGNORE_THE", SORT_METHOD_LABEL_IGNORE_THE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_DATE", SORT_METHOD_DATE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_SIZE", SORT_METHOD_SIZE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_FILE", SORT_METHOD_FILE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_DRIVE_TYPE", SORT_METHOD_DRIVE_TYPE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_TRACKNUM", SORT_METHOD_TRACKNUM); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_DURATION", SORT_METHOD_DURATION); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_TITLE", SORT_METHOD_TITLE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_TITLE_IGNORE_THE", SORT_METHOD_TITLE_IGNORE_THE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_ARTIST", SORT_METHOD_ARTIST); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_ARTIST_IGNORE_THE", SORT_METHOD_ARTIST_IGNORE_THE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_ALBUM", SORT_METHOD_ALBUM); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_ALBUM_IGNORE_THE", SORT_METHOD_ALBUM_IGNORE_THE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_GENRE", SORT_METHOD_GENRE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_YEAR", SORT_METHOD_YEAR); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_RATING", SORT_METHOD_VIDEO_RATING); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_PROGRAM_COUNT", SORT_METHOD_PROGRAM_COUNT); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_PLAYLIST_ORDER", SORT_METHOD_PLAYLIST_ORDER); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_EPISODE", SORT_METHOD_EPISODE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_TITLE", SORT_METHOD_VIDEO_TITLE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_PRODUCTIONCODE", SORT_METHOD_PRODUCTIONCODE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_SONG_RATING", SORT_METHOD_SONG_RATING); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_MPAA_RATING", SORT_METHOD_MPAA_RATING); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_RUNTIME", SORT_METHOD_VIDEO_RUNTIME); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_STUDIO", SORT_METHOD_STUDIO); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_STUDIO_IGNORE_THE", SORT_METHOD_STUDIO_IGNORE_THE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_UNSORTED", SORT_METHOD_UNSORTED); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_BITRATE", SORT_METHOD_BITRATE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_LISTENERS", SORT_METHOD_LISTENERS); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_SORT_TITLE", SORT_METHOD_VIDEO_SORT_TITLE); - PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE", SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE); - } -} - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcvfsmodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcvfsmodule.cpp deleted file mode 100644 index cd13caebac..0000000000 --- a/xbmc/interfaces/python/xbmcmodule/xbmcvfsmodule.cpp +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (C) 2005-2011 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <Python.h> - - -#include "filesystem/Directory.h" -#include "filesystem/File.h" -#include "pyutil.h" -#include "pythreadstate.h" -#include "FileItem.h" -#include "utils/FileUtils.h" -#include "utils/URIUtils.h" -#include "Util.h" - -using namespace std; -using namespace XFILE; -using namespace PYXBMC; - - -#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2) -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - namespace xbmcvfs - { - /***************************************************************** - * start of xbmcvfs methods - *****************************************************************/ - typedef struct { - PyObject_HEAD - CFile* pFile; - } File; - - PyDoc_STRVAR(file__doc__, - "File class.\n" - "\n" - "'w' - opt open for write\n" - "example:\n" - " f = xbmcvfs.File(file, ['w'])\n"); - - PyObject* File_New(PyTypeObject *type, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - char *cLine = NULL; - if (!PyArg_ParseTuple( - args, - (char*)"O|s", - &f_line, - &cLine)) - { - return NULL; - } - File *self = (File *)type->tp_alloc(type, 0); - if (!self) - return NULL; - - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) - return NULL; - - self->pFile = new CFile(); - if (cLine && strncmp(cLine, "w", 1) == 0) - { - CPyThreadState pyState; - self->pFile->OpenForWrite(strSource,true); - pyState.Restore(); - } - else - { - CPyThreadState pyState; - self->pFile->Open(strSource, READ_NO_CACHE); - pyState.Restore(); - } - return (PyObject*)self; - } - - void File_Dealloc(File* self) - { - CPyThreadState pyState; - delete self->pFile; - pyState.Restore(); - - self->pFile = NULL; - self->ob_type->tp_free((PyObject*)self); - } - - // copy() method - PyDoc_STRVAR(copy__doc__, - "copy(source, destination) -- Copy file to destination, returns true/false.\n" - "\n" - "source : file to copy.\n" - "destination : destination file\n" - "\n" - "example:\n" - " - success = xbmcvfs.copy(source, destination)\n"); - - PyObject* vfs_copy(PyObject *self, PyObject *args) - { - PyObject *f_line; - PyObject *d_line; - if (!PyArg_ParseTuple( - args, - (char*)"OO", - &f_line, - &d_line)) - { - return NULL; - } - CStdString strSource; - CStdString strDestnation; - bool bResult = true; - - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - if (!PyXBMCGetUnicodeString(strDestnation, d_line, 1)) return NULL; - - CPyThreadState pyState; - bResult = CFile::Cache(strSource, strDestnation); - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - } - PyDoc_STRVAR(delete__doc__, - "delete(file) -- Delete file\n" - "\n" - "file : file to delete\n" - "\n" - "example:\n" - " - xbmcvfs.delete(file)\n"); - - // delete a file - PyObject* vfs_delete(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - if (!PyArg_ParseTuple( - args, - (char*)"O", - &f_line)) - { - return NULL; - } - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - - CPyThreadState pyState; - self->pFile->Delete(strSource); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - - } - - PyDoc_STRVAR(rename__doc__, - "rename(file, newFileName) -- Rename file, returns true/false.\n" - "\n" - "file : file to reaname\n" - "newFileName : new filename, including the full path\n" - "\n" - "example:\n" - " - success = xbmcvfs.rename(file, newFileName)\n"); - - // rename a file - PyObject* vfs_rename(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - PyObject *d_line; - if (!PyArg_ParseTuple( - args, - (char*)"OO", - &f_line, - &d_line)) - { - return NULL; - } - CStdString strSource; - CStdString strDestnation; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - if (!PyXBMCGetUnicodeString(strDestnation, d_line, 1)) return NULL; - - bool bResult; - - CPyThreadState pyState; - bResult = self->pFile->Rename(strSource,strDestnation); - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - - } - - PyDoc_STRVAR(exists__doc__, - "exists(path) -- Check if file exists, returns true/false.\n" - "\n" - "path : file or folder\n" - "\n" - "example:\n" - " - success = xbmcvfs.exists(path)\n"); - - // check for a file or folder existance, mimics Pythons os.path.exists() - PyObject* vfs_exists(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - if (!PyArg_ParseTuple( - args, - (char*)"O", - &f_line)) - { - return NULL; - } - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - - bool bResult; - - CPyThreadState pyState; - bResult = self->pFile->Exists(strSource, false); - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - } - - PyDoc_STRVAR(mkdir__doc__, - "mkdir(path) -- Create a folder.\n" - "\n" - "path : folder\n" - "\n" - "example:\n" - " - success = xbmcvfs.mkdir(path)\n"); - // make a directory - PyObject* vfs_mkdir(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - if (!PyArg_ParseTuple( - args, - (char*)"O", - &f_line)) - { - return NULL; - } - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - - bool bResult; - - CPyThreadState pyState; - bResult = CDirectory::Create(strSource); - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - } - - PyDoc_STRVAR(mkdirs__doc__, - "mkdirs(path) -- Create folder(s) - it will create all folders in the path.\n" - "\n" - "path : folder\n" - "\n" - "example:\n" - " - success = xbmcvfs.mkdirs(path)\n"); - // make all directories along the path - PyObject* vfs_mkdirs(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - if (!PyArg_ParseTuple( - args, - (char*)"O", - &f_line)) - { - return NULL; - } - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) - return NULL; - - CPyThreadState pyState; - bool bResult = CUtil::CreateDirectoryEx(strSource); - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - } - - PyDoc_STRVAR(rmdir__doc__, - "rmdir(path) -- Remove a folder.\n" - "\n" - "path : folder\n" - "\n" - "example:\n" - " - success = xbmcvfs.rmdir(path)\n"); - // remove a directory - PyObject* vfs_rmdir(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - char bForce = 0; - if (!PyArg_ParseTuple( - args, - (char*)"O|b", - &f_line, - &bForce)) - { - return NULL; - } - CStdString strSource; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL; - - bool bResult; - if (bForce) - { - CPyThreadState pyState; - bResult = CFileUtils::DeleteItem(strSource, bForce); - pyState.Restore(); - } - else - { - CPyThreadState pyState; - bResult = CDirectory::Remove(strSource); - pyState.Restore(); - } - - return Py_BuildValue((char*)"b", bResult); - } - - PyDoc_STRVAR(listdir__doc__, - "listdir(path) -- lists content of a folder.\n" - "\n" - "path : folder\n" - "\n" - "example:\n" - " - dirs, files = xbmcvfs.listdir(path)\n"); - // lists content of a folder - PyObject* vfs_listdir(File *self, PyObject *args, PyObject *kwds) - { - PyObject *f_line; - if (!PyArg_ParseTuple( - args, - (char*)"O", - &f_line)) - { - return NULL; - } - CStdString strSource; - CFileItemList items; - if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) - return NULL; - - CPyThreadState pyState; - CDirectory::GetDirectory(strSource, items); - pyState.Restore(); - - PyObject *fileList = PyList_New(0); - PyObject *folderList = PyList_New(0); - for (int i=0; i < items.Size(); i++) - { - CStdString itemPath = items[i]->GetPath(); - PyObject *obj; - if (URIUtils::HasSlashAtEnd(itemPath)) // folder - { - URIUtils::RemoveSlashAtEnd(itemPath); - CStdString strFileName = URIUtils::GetFileName(itemPath); - obj = Py_BuildValue((char*)"s", strFileName.c_str()); - PyList_Append(folderList, obj); - } - else // file - { - CStdString strFileName = URIUtils::GetFileName(itemPath); - obj = Py_BuildValue((char*)"s", strFileName.c_str()); - PyList_Append(fileList, obj); - } - Py_DECREF(obj); //we have to do this as PyList_Append is known to leak - } - return Py_BuildValue((char*)"O,O", folderList, fileList); - } - - // define c functions to be used in python here - PyMethodDef xbmcvfsMethods[] = { - {(char*)"copy", (PyCFunction)vfs_copy, METH_VARARGS, copy__doc__}, - {(char*)"delete", (PyCFunction)vfs_delete, METH_VARARGS, delete__doc__}, - {(char*)"rename", (PyCFunction)vfs_rename, METH_VARARGS, rename__doc__}, - {(char*)"mkdir", (PyCFunction)vfs_mkdir, METH_VARARGS, mkdir__doc__}, - {(char*)"mkdirs", (PyCFunction)vfs_mkdirs, METH_VARARGS, mkdirs__doc__}, - {(char*)"rmdir", (PyCFunction)vfs_rmdir, METH_VARARGS, rmdir__doc__}, - {(char*)"exists", (PyCFunction)vfs_exists, METH_VARARGS, exists__doc__}, - {(char*)"listdir", (PyCFunction)vfs_listdir, METH_VARARGS, listdir__doc__}, - {NULL, NULL, 0, NULL} - }; - PyDoc_STRVAR(read__doc__, - "read(bytes)\n" - "\n" - "bytes : how many bytes to read [opt]- if not set it will read the whole file" - "\n" - "example:\n" - " f = xbmcvfs.File(file)\n" - " b = f.read()\n" - " f.close()\n"); - - // read a file - PyObject* File_read(File *self, PyObject *args) - { - unsigned int readBytes = 0; - if (!PyArg_ParseTuple(args, (char*)"|i", &readBytes)) - return NULL; - int64_t size = self->pFile->GetLength(); - if (!readBytes || readBytes > size) - readBytes = (unsigned int) size; - char* buffer = new char[readBytes + 1]; - PyObject* ret = NULL; - if (buffer) - { - unsigned int bytesRead; - CPyThreadState pyState; - bytesRead = self->pFile->Read(buffer, readBytes); - pyState.Restore(); - buffer[std::min(bytesRead, readBytes)] = 0; - ret = Py_BuildValue((char*)"s#", buffer,readBytes); - delete[] buffer; - } - return ret; - } - - PyDoc_STRVAR(write__doc__, - "write(buffer)\n" - "\n" - "buffer : buffer to write to file" - "\n" - "example:\n" - " f = xbmcvfs.File(file, 'w', True)\n" - " result = f.write(buffer)\n" - " f.close()\n"); - - // read a file - PyObject* File_write(File *self, PyObject *args) - { - const char* pBuffer; - if (!PyArg_ParseTuple(args, (char*)"s", &pBuffer)) - return NULL; - - CPyThreadState pyState; - bool bResult = self->pFile->Write( (void*) pBuffer, strlen( pBuffer ) + 1 ) > 0 ? true : false; - pyState.Restore(); - - return Py_BuildValue((char*)"b", bResult); - } - - PyDoc_STRVAR(size__doc__, - "size()\n" - "\n" - "example:\n" - " f = xbmcvfs.File(file)\n" - " s = f.size()\n" - " f.close()\n"); - - // size of a file - PyObject* File_size(File *self, PyObject *args) - { - int64_t size; - CPyThreadState pyState; - size = self->pFile->GetLength(); - pyState.Restore(); - - return Py_BuildValue((char*)"L", size); - } - - PyDoc_STRVAR(seek__doc__, - "seek()\n" - "\n" - "FilePosition : position in the file\n" - "Whence : where in a file to seek from[0 begining, 1 current , 2 end possition]\n" - "example:\n" - " f = xbmcvfs.File(file)\n" - " result = f.seek(8129, 0)\n" - " f.close()\n"); - - // seek a file - PyObject* File_seek(File *self, PyObject *args) - { - int64_t seekBytes; - int iWhence; - if (!PyArg_ParseTuple(args, (char*)"Li", &seekBytes, &iWhence )) - return NULL; - - CPyThreadState pyState; - int64_t bResult = self->pFile->Seek(seekBytes,iWhence); - pyState.Restore(); - - return Py_BuildValue((char*)"L", bResult); - } - - PyDoc_STRVAR(close__doc__, - "close()\n" - "\n" - "example:\n" - " f = xbmcvfs.File(file)\n" - " f.close()\n"); - - // close a file - PyObject* File_close(File *self, PyObject *args, PyObject *kwds) - { - CPyThreadState pyState; - self->pFile->Close(); - pyState.Restore(); - - Py_INCREF(Py_None); - return Py_None; - } - - /***************************************************************** - * end of methods and python objects - * initxbmc(void); - *****************************************************************/ - - /************************************************************* - * Meta data for the xbmcvfs.File class - *************************************************************/ - PyMethodDef File_methods[] = { - {(char*)"read", (PyCFunction)File_read, METH_VARARGS, read__doc__}, - {(char*)"write", (PyCFunction)File_write, METH_VARARGS, write__doc__}, - {(char*)"size", (PyCFunction)File_size, METH_NOARGS, size__doc__}, - {(char*)"seek", (PyCFunction)File_seek , METH_VARARGS, seek__doc__}, - {(char*)"close", (PyCFunction)File_close, METH_NOARGS, close__doc__}, - {NULL, NULL, 0, NULL} - }; - - PyTypeObject File_Type; - - void initFile_Type() - { - PyXBMCInitializeTypeObject(&File_Type); - - File_Type.tp_name = (char*)"xbmcvfs.File"; - File_Type.tp_basicsize = sizeof(File); - File_Type.tp_dealloc = (destructor)File_Dealloc; - File_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; - File_Type.tp_doc = file__doc__; - File_Type.tp_methods = File_methods; - File_Type.tp_base = 0; - File_Type.tp_new = File_New; - } - - PyMODINIT_FUNC - DeinitVFSModule() - { - // no need to Py_DECREF our objects (see InitXBMCMVFSModule()) as they were created only - // so that they could be added to the module, which steals a reference. - } - - PyMODINIT_FUNC - InitVFSModule() - { - // init general xbmc modules - PyObject* pXbmcvfsModule; - pXbmcvfsModule = Py_InitModule((char*)"xbmcvfs", xbmcvfsMethods); - if (pXbmcvfsModule == NULL) return; - - Py_INCREF(&File_Type); - PyModule_AddObject(pXbmcvfsModule, (char*)"File", (PyObject*)&File_Type); - - // constants - PyModule_AddStringConstant(pXbmcvfsModule, (char*)"__author__", (char*)PY_XBMC_AUTHOR); - PyModule_AddStringConstant(pXbmcvfsModule, (char*)"__date__", (char*)"25 May 2012"); - PyModule_AddStringConstant(pXbmcvfsModule, (char*)"__version__", (char*)"1.4"); - PyModule_AddStringConstant(pXbmcvfsModule, (char*)"__credits__", (char*)PY_XBMC_CREDITS); - PyModule_AddStringConstant(pXbmcvfsModule, (char*)"__platform__", (char*)PY_XBMC_PLATFORM); - } - - PyMODINIT_FUNC - InitVFSTypes() - { - initFile_Type(); - if (PyType_Ready(&File_Type)) return; - } - } - -#ifdef __cplusplus -} -#endif diff --git a/xbmc/utils/GlobalsHandling.h b/xbmc/utils/GlobalsHandling.h index e1f8373384..919ddb167f 100644 --- a/xbmc/utils/GlobalsHandling.h +++ b/xbmc/utils/GlobalsHandling.h @@ -182,6 +182,14 @@ namespace xbmcutil template <class T> typename GlobalsSingleton<T>::template Deleter<boost::shared_ptr<T> > GlobalsSingleton<T>::instance; template <class T> T* GlobalsSingleton<T>::quick; + + /** + * This is another bit of hackery that will act as a flag for + * whether or not a global/static has been initialized yet. An instance + * should be placed in the cpp file after the static/global it's meant to + * monitor. + */ + class InitFlag { public: InitFlag(bool& flag) { flag = true; } }; } /** |