Fine-tuning for glib2 init

This commit is contained in:
Manuel Reimer 2014-11-23 13:07:43 +01:00
parent 17fcf85158
commit 9bc7af5d5d
4 changed files with 15 additions and 3 deletions

2
README
View File

@ -28,7 +28,7 @@ Requirements
- cairo
- librsvg-2
- librsvg-2 >= 2.36.0
- libxml2

View File

@ -139,7 +139,6 @@ void cImageImporterPNG::GetImageSize(int &width, int &height) {
//
cImageImporterSVG::cImageImporterSVG() {
g_type_init();
handle = NULL;
}
@ -185,6 +184,12 @@ void cImageImporterSVG::GetImageSize(int &width, int &height) {
}
}
void cImageImporterSVG::InitLibRSVG() {
#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
#endif
}
//
// Image importer for JPG
//

View File

@ -3,8 +3,9 @@
#include <cairo.h>
#include <librsvg/rsvg.h>
#ifndef LIBRSVG_VERSION // Workaround for librsvg < 2.36.2
#ifndef LIBRSVG_CHECK_VERSION // Workaround for librsvg < 2.36.2
#include <librsvg/rsvg-cairo.h>
#include <librsvg/librsvg-features.h>
#endif
#include <jpeglib.h>
#include <setjmp.h>
@ -36,6 +37,10 @@ private:
};
// Image importer for SVG
#if !LIBRSVG_CHECK_VERSION(2, 36, 0)
#error librsvg version 2.36.0 or above required!
#endif
class cImageImporterSVG : public cImageImporter {
public:
cImageImporterSVG();
@ -43,6 +48,7 @@ public:
bool LoadImage(const char *path);
void DrawToCairo(cairo_t *cr);
void GetImageSize(int &width, int &height);
static void InitLibRSVG();
private:
RsvgHandle *handle;
};

View File

@ -96,6 +96,7 @@ bool cPluginSkinDesigner::Initialize(void) {
bool cPluginSkinDesigner::Start(void) {
cXmlParser::InitLibXML();
cImageImporterSVG::InitLibRSVG();
bool trueColorAvailable = true;
if (!cOsdProvider::SupportsTrueColor()) {
esyslog("skindesigner: No TrueColor OSD found! Using default Skin LCARS!");