Skip to content

Commit

Permalink
split addon gui for skin and binary addons
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Mar 4, 2015
1 parent 2ad4741 commit 127663d
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 111 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -125,6 +125,7 @@ config.log
/addons/pvr.*
/addons/xbmc.addon/addon.xml
/addons/xbmc.json/addon.xml
/addons/kodi.guilib/addon.xml

# /lib/
/lib/Makefile
Expand Down Expand Up @@ -982,8 +983,8 @@ lib/cpluff/stamp-h1
/addons/library.xbmc.addon/libXBMC_addon.lib
/addons/library.xbmc.codec/libXBMC_codec.dll
/addons/library.xbmc.codec/libXBMC_codec.lib
/addons/library.xbmc.gui/libXBMC_gui.dll
/addons/library.xbmc.gui/libXBMC_gui.lib
/addons/library.kodi.guilib/libKODI_guilib.dll
/addons/library.kodi.guilib/libKODI_guilib.lib
/addons/library.xbmc.pvr/libXBMC_pvr.dll
/addons/library.xbmc.pvr/libXBMC_pvr.lib

Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Expand Up @@ -253,7 +253,7 @@ LIBADDON_DIRS=\
lib/addons/library.xbmc.addon \
lib/addons/library.xbmc.codec \
lib/addons/library.xbmc.pvr \
lib/addons/library.xbmc.gui \
lib/addons/library.kodi.guilib \

CONFLUENCE_MEDIA=addons/skin.confluence/media
SKIN_DIRS=$(CONFLUENCE_MEDIA)
Expand Down Expand Up @@ -402,7 +402,7 @@ screensavers: $(SS_DIRS)
libaddon: exports
$(MAKE) -C lib/addons/library.xbmc.addon
$(MAKE) -C lib/addons/library.xbmc.codec
$(MAKE) -C lib/addons/library.xbmc.gui
$(MAKE) -C lib/addons/library.kodi.guilib
$(MAKE) -C lib/addons/library.xbmc.pvr
dvdpcodecs: dllloader
$(MAKE) -C lib/libdvd
Expand Down
2 changes: 1 addition & 1 deletion Makefile.include.in
Expand Up @@ -39,7 +39,7 @@ LDFLAGS+=@LDFLAGS@
LDFLAGS_FOR_BUILD+=@LDFLAGS_FOR_BUILD@
INCLUDES+=-I@abs_top_srcdir@/lib
INCLUDES+=-I@abs_top_srcdir@/xbmc
INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.gui
INCLUDES+=-I@abs_top_srcdir@/addons/library.kodi.guilib
INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.addon
INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.pvr
INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.codec
Expand Down
7 changes: 7 additions & 0 deletions addons/kodi.guilib/addon.xml.in
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="kodi.guilib" version="@guilib_version@" provider-name="Team-Kodi">
<backwards-compatibility abi="@guilib_version_min@"/>
<requires>
<import addon="xbmc.core" version="0.1.0"/>
</requires>
</addon>

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -2545,7 +2545,7 @@ OUTPUT_FILES="Makefile \
xbmc/windowing/egl/Makefile \
lib/addons/library.xbmc.addon/Makefile \
lib/addons/library.xbmc.codec/Makefile \
lib/addons/library.xbmc.gui/Makefile \
lib/addons/library.kodi.guilib/Makefile \
lib/addons/library.xbmc.pvr/Makefile \
xbmc/visualizations/EGLHelpers/Makefile \
tools/Linux/${APP_NAME_LC}.sh \
Expand Down
34 changes: 34 additions & 0 deletions lib/addons/library.kodi.guilib/Makefile.in
@@ -0,0 +1,34 @@
ARCH=@ARCH@
INCLUDES=-I. -I../../../xbmc/addons/include -I../../../xbmc -I../../../xbmc/cores/dvdplayer/DVDDemuxers
DEFINES+=
CXXFLAGS=-fPIC
LIBNAME=libKODI_guilib
OBJS=$(LIBNAME).o

LIB_INTERFACE=../../../addons/library.kodi.guilib/libKODI_guilib.h
LIB_SHARED=../../../addons/library.kodi.guilib/$(LIBNAME)-$(ARCH).so
GENERATED_ADDON_GUILIB = ../../../addons/kodi.guilib/addon.xml
LIB_VERSION := $(shell sed -n 's/.*KODI_GUILIB_API_VERSION\s*"\(.*\)"/\1/p' $(LIB_INTERFACE))
LIB_VERSION_MIN := $(shell sed -n 's/.*KODI_GUILIB_MIN_API_VERSION\s*"\(.*\)"/\1/p' $(LIB_INTERFACE))

all: $(LIB_SHARED) $(GENERATED_ADDON_GUILIB)

$(LIB_SHARED): $(OBJS) $(LIB_INTERFACE)
ifeq ($(findstring osx,$(ARCH)), osx)
$(CXX) $(LDFLAGS) -Wl,-alias_list,@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias \
-bundle -undefined dynamic_lookup -o $@ \
@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
else
$(CXX) $(CFLAGS) $(LDFLAGS) -shared -g -o $(LIB_SHARED) $(OBJS)
endif

$(GENERATED_ADDON_GUILIB) : $(LIB_INTERFACE)
sed -e s/@guilib_version@/$(LIB_VERSION)/g -e s/@guilib_version_min@/$(LIB_VERSION_MIN)/g $@.in > $@

CLEAN_FILES = \
$(LIB_SHARED) \

DISTCLEAN_FILES= \
Makefile \

include ../../../Makefile.include
Expand Up @@ -18,10 +18,11 @@
*
*/

#include "../../../addons/library.kodi.guilib/libKODI_guilib.h"

#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "../../../addons/library.xbmc.gui/libXBMC_gui.h"
#include "addons/AddonCallbacks.h"

#ifdef _WIN32
Expand Down
Expand Up @@ -10,6 +10,9 @@
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\libKODI_guilib.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}</ProjectGuid>
<RootNamespace>XBMC_VDR</RootNamespace>
Expand Down Expand Up @@ -59,6 +62,9 @@
<Link>
<OutputFile>..\..\..\..\..\addons\library.xbmc.gui\$(ProjectName).dll</OutputFile>
</Link>
<PostBuildEvent>
<Command>powershell -ExecutionPolicy ByPass -File $(ProjectDir)\post-build.ps1 $(ProjectDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand All @@ -71,10 +77,10 @@
<Link>
<OutputFile>../../../../../addons/library.xbmc.gui/$(ProjectName).dll</OutputFile>
</Link>
<PostBuildEvent>
<Command>powershell -ExecutionPolicy ByPass -File $(ProjectDir)\post-build.ps1 $(ProjectDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\libXBMC_gui.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
Expand Up @@ -11,7 +11,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\libXBMC_gui.cpp">
<ClCompile Include="..\..\libKODI_guilib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
Expand Down
@@ -0,0 +1,21 @@
param (
[string]$ProjectDir
)

$LIB_INTERFACE = "$ProjectDir\..\..\..\..\..\addons\library.kodi.guilib\libKODI_guilib.h"
$GENERATED_ADDON_GUILIB = "$ProjectDir\..\..\..\..\..\addons\kodi.guilib\addon.xml"

$LIB_VERSION = ""
$LIB_VERSION_MIN = ""
cat $LIB_INTERFACE | %{
if ($_ -match 'KODI_GUILIB_API_VERSION\s*"(.*)"'){
$LIB_VERSION = $matches[1]
}
if ($_ -match 'KODI_GUILIB_MIN_API_VERSION\s*"(.*)"'){
$LIB_VERSION_MIN = $matches[1]
}
}

$ADDON_GUILIB = $GENERATED_ADDON_GUILIB + ".in"
cat $ADDON_GUILIB | % { $_ -replace "@guilib_version@", $LIB_VERSION `
-replace "@guilib_version_min@", $LIB_VERSION_MIN} > $GENERATED_ADDON_GUILIB
27 changes: 0 additions & 27 deletions lib/addons/library.xbmc.gui/Makefile.in

This file was deleted.

2 changes: 1 addition & 1 deletion project/VS2010Express/XBMC for Windows.sln
Expand Up @@ -65,7 +65,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhdhomerun_dll", "..\..\l
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libXBMC_addon", "..\..\lib\addons\library.xbmc.addon\project\VS2010Express\libXBMC_addon.vcxproj", "{2DCEA60B-4EBC-4DB7-9FBD-297C1EFD95D7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libXBMC_gui", "..\..\lib\addons\library.xbmc.gui\project\VS2010Express\libXBMC_gui.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libKODI_guilib", "..\..\lib\addons\library.kodi.guilib\project\VS2010Express\libKODI_guilib.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libXBMC_pvr", "..\..\lib\addons\library.xbmc.pvr\project\VS2010Express\libXBMC_pvr.vcxproj", "{6D8C91F8-992F-4C83-9DE3-485D64EF8420}"
EndProject
Expand Down
3 changes: 2 additions & 1 deletion xbmc/addons/AddonCallbacks.h
Expand Up @@ -20,10 +20,11 @@
*/

#include <stdint.h>

#include "../../addons/library.kodi.guilib/libKODI_guilib.h"
#include "cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.h"
#include "addons/include/xbmc_pvr_types.h"
#include "addons/include/xbmc_codec_types.h"
#include "../../addons/library.xbmc.gui/libXBMC_gui.h"

#ifdef TARGET_WINDOWS
#ifndef _SSIZE_T_DEFINED
Expand Down
2 changes: 1 addition & 1 deletion xbmc/addons/addon-bindings.mk
Expand Up @@ -15,7 +15,7 @@ BINDINGS+=xbmc/addons/include/xbmc_vis_dll.h
BINDINGS+=xbmc/addons/include/xbmc_vis_types.h
BINDINGS+=xbmc/addons/include/xbmc_stream_utils.hpp
BINDINGS+=addons/library.xbmc.addon/libXBMC_addon.h
BINDINGS+=addons/library.xbmc.gui/libXBMC_gui.h
BINDINGS+=addons/library.kodi.guilib/libKODI_guilib.h
BINDINGS+=addons/library.xbmc.pvr/libXBMC_pvr.h
BINDINGS+=addons/library.xbmc.codec/libXBMC_codec.h
BINDINGS+=xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
Expand Down
6 changes: 3 additions & 3 deletions xbmc/addons/include/xbmc_pvr_dll.h
Expand Up @@ -176,7 +176,7 @@ extern "C"
* Show the channel scan dialog if this backend supports it.
* @return PVR_ERROR_NO_ERROR if the dialog was displayed successfully.
* @remarks Required if bSupportsChannelScan is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
* @note see libXBMC_gui.h about related parts
* @note see libKODI_guilib.h about related parts
*/
PVR_ERROR OpenDialogChannelScan(void);

Expand Down Expand Up @@ -227,7 +227,7 @@ extern "C"
* @param channel The channel to show the dialog for.
* @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully.
* @remarks Required if bSupportsChannelSettings is set to true.
* @note see libXBMC_gui.h about related parts
* @note see libKODI_guilib.h about related parts
*/
PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL& channel);

Expand All @@ -236,7 +236,7 @@ extern "C"
* @param channel The channel to add.
* @return PVR_ERROR_NO_ERROR if the channel has been added successfully.
* @remarks Required if bSupportsChannelSettings is set to true.
* @note see libXBMC_gui.h about related parts
* @note see libKODI_guilib.h about related parts
*/
PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL& channel);
//@}
Expand Down
6 changes: 3 additions & 3 deletions xbmc/pvr/addons/PVRClient.cpp
Expand Up @@ -325,8 +325,8 @@ bool CPVRClient::IsCompatibleAPIVersion(const ADDON::AddonVersion &minVersion, c

bool CPVRClient::IsCompatibleGUIAPIVersion(const ADDON::AddonVersion &minVersion, const ADDON::AddonVersion &version)
{
AddonVersion myMinVersion = AddonVersion(XBMC_GUI_MIN_API_VERSION);
AddonVersion myVersion = AddonVersion(XBMC_GUI_API_VERSION);
AddonVersion myMinVersion = AddonVersion(KODI_GUILIB_MIN_API_VERSION);
AddonVersion myVersion = AddonVersion(KODI_GUILIB_API_VERSION);
return (version >= myMinVersion && minVersion <= myVersion);
}

Expand All @@ -345,7 +345,7 @@ bool CPVRClient::CheckAPIVersion(void)

/* check the GUI API version */
AddonVersion guiVersion = AddonVersion("0.0.0");
minVersion = AddonVersion(XBMC_GUI_MIN_API_VERSION);
minVersion = AddonVersion(KODI_GUILIB_MIN_API_VERSION);
try { guiVersion = AddonVersion(m_pStruct->GetGUIAPIVersion()); }
catch (std::exception &e) { LogException(e, "GetGUIAPIVersion()"); return false; }

Expand Down

0 comments on commit 127663d

Please sign in to comment.