CFLAGS += -DGPL3
endif
-CXXFLAGS += $(CFLAGS) $(QTCXXFLAGS) $(EXIFCXXFLAGS) -Wno-deprecated
+CXXFLAGS += $(CFLAGS) $(QTCXXFLAGS) $(EXIFCXXFLAGS) $(KDECXXFLAGS) -Wno-deprecated
-LDFLAGS += $(QTLIBS) $(EXIFLIBS)
+LDFLAGS += $(QTLIBS) $(EXIFLIBS) $(KDELIBS)
-ifdef USE_KDE
+ifdef USE_KDE3
LDFLAGS += -lkio
endif
else
if [ -d "$kde_includedir" ]
then
- echo "#define USE_KDE" >> config.h
- echo "USE_KDE=1" >> config.mak
+ echo "#define USE_KDE3" >> config.h
+ echo "USE_KDE3=1" >> config.mak
echo "#define USE_QT3" >> config.h
echo "USE_QT3=1" >> config.mak
echo QTCXXFLAGS=-I$qimage_includedir -I$kde_includedir -DQT_THREAD_SUPPORT >> config.mak
touch ../disable-qimage
fi
fi
+
+ if [ "$qt4_found" != "" ]
+ then
+ # test if we have KDE4, required on some systems to get QImage extra formats (xcf, ...)
+ if [ "$kde_includedir" = "" ]
+ then
+ if [ -f "/usr/include/kcomponentdata.h" ]
+ then
+ kde_includedir="/usr/include"
+ elif [ -f "/usr/local/include/kcomponentdata.h" ]
+ then
+ kde_includedir="/usr/local/include"
+ fi
+ fi
+ if [ -d "$kde_includedir" ]
+ then
+ echo "KDE version 4.x detected, will enable extra image formats"
+ echo "#define USE_KDE4" >> config.h
+ echo "USE_KDE4=1" >> config.mak
+ echo KDECXXFLAGS=-I$kde_includedir >> config.mak
+ echo KDELIBS=-lkdecore >> config.mak
+ fi
+ fi
+
[ "$gpl3" = "true" ] && echo GPL3=1 >> config.mak
exit 0
fi
// Get the properties interface
mlt_properties properties = MLT_PRODUCER_PROPERTIES( &self->parent );
- // Callback registration
-#ifdef USE_KDE
+ // Initialize KDE image plugins
init_qimage();
-#endif
+
+ // Callback registration
producer->get_frame = producer_get_frame;
producer->close = ( mlt_destructor )producer_close;
#include <qimage.h>
#include <qmutex.h>
-#ifdef USE_KDE
+#ifdef USE_KDE3
#include <kinstance.h>
#include <kimageio.h>
#endif
-
#endif
+#ifdef USE_KDE4
+#include <kcomponentdata.h>
+#endif
#ifdef USE_QT4
#include <QtGui/QImage>
#include <framework/mlt_pool.h>
#include <framework/mlt_cache.h>
-#ifdef USE_KDE
+#ifdef USE_KDE4
+static KComponentData *instance = 0L;
+#elif USE_KDE3
static KInstance *instance = 0L;
#endif
QImage *image = ( QImage * )data;
delete image;
image = NULL;
-#ifdef USE_KDE
+#if defined(USE_KDE3) || defined(USE_KDE4)
if (instance) delete instance;
instance = 0L;
#endif
+
}
-#ifdef USE_KDE
void init_qimage()
{
- if (!instance) {
- instance = new KInstance("qimage_prod");
+#ifdef USE_KDE4
+ if ( !instance ) {
+ instance = new KComponentData( "qimage_prod" );
+ }
+#elif defined(USE_KDE3)
+ if ( !instance ) {
+ instance = new KInstance( "qimage_prod" );
KImageIO::registerFormats();
}
-}
#endif
+
+}
static QImage* reorient_with_exif( producer_qimage self, int image_idx, QImage *qimage )
{
extern int refresh_qimage( producer_qimage self, mlt_frame frame );
extern void refresh_image( producer_qimage, mlt_frame, mlt_image_format, int width, int height );
extern void make_tempfile( producer_qimage, const char *xml );
-
-#ifdef USE_KDE
extern void init_qimage();
-#endif
+
#ifdef __cplusplus
}