lib versioning

This commit is contained in:
louis 2015-04-03 09:18:26 +02:00
parent e48aa00164
commit 051cefafd3
3 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,7 @@ LIBS += $(shell xml2-config --libs)
INCLUDES += $(shell pkg-config --cflags libskindesignerapi)
LIBS += $(shell pkg-config --libs libskindesignerapi)
DEFINES += -DLIBSKINDESIGNERAPIVERSION='"$(shell pkg-config --modversion libskindesignerapi)"'
### The object files:
OBJS = $(PLUGIN).o \

View File

@ -52,6 +52,7 @@ class cPluginStructure {
public:
cPluginStructure(void) {
name = "";
libskindesignerAPIVersion = "undefined";
};
void SetMenu(int key, string templateName) {
menus.insert(pair<int, string>(key, templateName));
@ -84,6 +85,7 @@ public:
}
}
string name; //name of plugin
string libskindesignerAPIVersion; //skindesigner API Version plugin is using
map< int, string > menus; //menus as key -> templatename hashmap
map< int, string> views; //standalone views as key -> templatename hashmap
multimap< int, pair <int, string> > subViews; //subviews of standalone views as view -> (subview, templatename) multimap

View File

@ -25,6 +25,7 @@ static const char *DESCRIPTION = trNOOP("Skin Designer");
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
private:
vector<cSkinDesigner*> skins;
string libskindesignerApiVersion;
protected:
bool ServiceRegisterPlugin(skindesignerapi::cPluginStructure *plugStructure);
skindesignerapi::ISDDisplayMenu *ServiceGetDisplayMenu(void);
@ -53,6 +54,7 @@ public:
};
cPluginSkinDesigner::cPluginSkinDesigner(void) {
libskindesignerApiVersion = "undefined";
}
cPluginSkinDesigner::~cPluginSkinDesigner() {
@ -107,6 +109,10 @@ bool cPluginSkinDesigner::Start(void) {
trueColorAvailable = false;
} else
dsyslog("skindesigner: TrueColor OSD found");
libskindesignerApiVersion = LIBSKINDESIGNERAPIVERSION;
dsyslog("skindesigner: using libskindesigner API Version %s", libskindesignerApiVersion.c_str());
config.SetOsdLanguage();
config.SetPathes();
config.ReadSkins();
@ -240,6 +246,7 @@ bool cPluginSkinDesigner::ServiceRegisterPlugin(skindesignerapi::cPluginStructur
esyslog("skindesigner: error - plugin without menus or views registered");
return false;
}
dsyslog("skindesigner: plugin %s uses libskindesigner API Version %s", plugStructure->name.c_str(), plugStructure->libskindesignerAPIVersion.c_str());
config.AddPluginMenus(plugStructure->name, plugStructure->menus);
config.AddPluginViews(plugStructure->name, plugStructure->views, plugStructure->subViews, plugStructure->viewElements, plugStructure->viewGrids);
if (plugStructure->menus.size() > 0)