Commit eabbaeae authored by Albert Astals Cid's avatar Albert Astals Cid

oKular is now okular

svn path=/branches/work/kde4/playground/graphics/okular/; revision=550782
parent 5b41a8a4
project(oKular)
project(okular)
option(
OKULAR_FORCE_DRM
"Forces oKular to check for DRM to decide if you can copy/print protected pdf. (default=no)"
"Forces okular to check for DRM to decide if you can copy/print protected pdf. (default=no)"
OFF
)
if(OKULAR_FORCE_DRM STREQUAL "ON")
......@@ -29,7 +29,7 @@ include_directories(
########### next target ###############
set(oKularconf_SRCS
set(okularconf_SRCS
conf/preferencesdialog.cpp
conf/dlgaccessibility.cpp
conf/dlggeneral.cpp
......@@ -37,14 +37,14 @@ set(oKularconf_SRCS
conf/dlgpresentation.cpp
)
kde4_add_ui_files(oKularconf_SRCS
kde4_add_ui_files(okularconf_SRCS
conf/dlgaccessibilitybase.ui
conf/dlggeneralbase.ui
conf/dlgperformancebase.ui
conf/dlgpresentationbase.ui
)
set(oKularcore_SRCS
set(okularcore_SRCS
core/annotations.cpp
core/area.cpp
core/chooseenginedialog.cpp
......@@ -56,11 +56,11 @@ set(oKularcore_SRCS
core/textpage.cpp
)
kde4_add_ui_files(oKularcore_SRCS
kde4_add_ui_files(okularcore_SRCS
core/chooseenginewidget.ui
)
set(oKularui_SRCS
set(okularui_SRCS
ui/embeddedfilesdialog.cpp
ui/minibar.cpp
ui/newstuff.cpp
......@@ -76,42 +76,42 @@ set(oKularui_SRCS
ui/toc.cpp
)
set(oKularagg2_SRCS
set(okularagg2_SRCS
ui/painter_agg2/agg_bezier_arc.cpp
ui/painter_agg2/agg_path_storage.cpp
ui/painter_agg2/agg_rasterizer_scanline_aa.cpp
ui/painter_agg2/agg_trans_affine.cpp
ui/painter_agg2/agg_vcgen_stroke.cpp
)
kde4_add_kcfg_files(oKularconf_SRCS conf/settings.kcfgc )
kde4_add_kcfg_files(okularconf_SRCS conf/settings.kcfgc )
set(oKularcore_SRCS ${oKularconf_SRCS} ${oKularcore_SRCS} )
set(okularcore_SRCS ${okularconf_SRCS} ${okularcore_SRCS} )
kde4_automoc(${oKularcore_SRCS})
kde4_automoc(${okularcore_SRCS})
kde4_add_library(oKularcore SHARED ${oKularcore_SRCS})
kde4_add_library(okularcore SHARED ${okularcore_SRCS})
target_link_libraries(oKularcore ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} m )
target_link_libraries(okularcore ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} m )
install_targets(${LIB_INSTALL_DIR} oKularcore )
install_targets(${LIB_INSTALL_DIR} okularcore )
set(oKularpart_PART_SRCS part.cpp ${oKularui_SRCS} ${oKularagg2_SRCS} )
set(okularpart_PART_SRCS part.cpp ${okularui_SRCS} ${okularagg2_SRCS} )
kde4_automoc(${oKularpart_PART_SRCS})
kde4_automoc(${okularpart_PART_SRCS})
kde4_add_plugin(oKularpart WITH_PREFIX ${oKularpart_PART_SRCS})
kde4_add_plugin(okularpart WITH_PREFIX ${okularpart_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} oKularpart )
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularpart )
target_link_libraries(oKularpart oKularcore ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEPRINT_LIBS} ${KDE4_KUTILS_LIBS} ${KDE4_KNEWSTUFF_LIBS} ${KDE4_KHTML_LIBS} m ${X11_Xrender_LIB} )
target_link_libraries(okularpart okularcore ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEPRINT_LIBS} ${KDE4_KUTILS_LIBS} ${KDE4_KNEWSTUFF_LIBS} ${KDE4_KHTML_LIBS} m ${X11_Xrender_LIB} )
install_targets(${PLUGIN_INSTALL_DIR} oKularpart )
install_targets(${PLUGIN_INSTALL_DIR} okularpart )
########### install files ###############
install_files( ${SERVICES_INSTALL_DIR} FILES oKular_part.desktop )
install_files( ${DATA_INSTALL_DIR}/oKularpart FILES part.rc )
install_files( ${SERVICES_INSTALL_DIR} FILES okular_part.desktop )
install_files( ${DATA_INSTALL_DIR}/okularpart FILES part.rc )
kde4_install_icons( ${ICON_INSTALL_DIR} hicolor )
......@@ -129,26 +129,26 @@ kde4_install_icons( ${ICON_INSTALL_DIR} hicolor )
#
#messages: rc.cpp
# $(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui"` >> rc.cpp
# $(XGETTEXT) `find . -name "*.cpp" -o -name "*.cc" -o -name "*.h"` -o $(podir)/oKular.pot
# $(XGETTEXT) `find . -name "*.cpp" -o -name "*.cc" -o -name "*.h"` -o $(podir)/okular.pot
#
#KDE_ICON = oKular
#KDE_ICON = okular
#
##########################################################################
## KPART SECTION
##########################################################################
#kde_module_LTLIBRARIES = liboKularpart.la
#kde_module_LTLIBRARIES = libokularpart.la
#
#liboKularpart_la_SOURCES = dcop.skel part.cpp
#liboKularpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
#liboKularpart_la_LIBADD = conf/liboKularconf.la core/liboKularcore.la \
# ui/liboKularui.la ui/painter_agg2/libagg2.la $(LIB_KPARTS) \
#libokularpart_la_SOURCES = dcop.skel part.cpp
#libokularpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
#libokularpart_la_LIBADD = conf/libokularconf.la core/libokularcore.la \
# ui/libokularui.la ui/painter_agg2/libagg2.la $(LIB_KPARTS) \
# $(LIB_KFILE) $(LIB_KDEPRINT) $(LIB_KUTILS) $(LIB_KNEWSTUFF) \
# $(LIB_KHTML) -lm
#
#partdesktopdir = $(kde_servicesdir)
#partdesktop_DATA = oKular_part.desktop
#partdesktop_DATA = okular_part.desktop
#
#partrcdir = $(kde_datadir)/oKularpart
#partrcdir = $(kde_datadir)/okularpart
#partrc_DATA = part.rc
#
#part.lo: conf/settings.h
......
TODO - oKular
TODO - okular
Legend:
ADD - ADDed (new feature)
CHG - CHanGed (existing behavior)
......
install_files( ${KCFG_INSTALL_DIR} FILES oKular.kcfg )
install_files( ${KCFG_INSTALL_DIR} FILES okular.kcfg )
#original Makefile.am contents follow:
......@@ -6,12 +6,12 @@ install_files( ${KCFG_INSTALL_DIR} FILES oKular.kcfg )
#
#METASOURCES = AUTO
#
#liboKularconf_la_SOURCES = dlggeneral.ui dlgperformance.ui dlgaccessibility.ui \
#libokularconf_la_SOURCES = dlggeneral.ui dlgperformance.ui dlgaccessibility.ui \
# dlgpresentation.ui \
# preferencesdialog.cpp settings.kcfgc
#
#noinst_LTLIBRARIES = liboKularconf.la
#noinst_LTLIBRARIES = libokularconf.la
#
#kde_kcfg_DATA = oKular.kcfg
#kde_kcfg_DATA = okular.kcfg
#
#preferencesdialog.lo: settings.h
......@@ -26,7 +26,7 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
m_accessibility = new DlgAccessibility(0);
m_presentation = new DlgPresentation(0);
addPage( m_general, i18n("General"), "oKular", i18n("General Options") );
addPage( m_general, i18n("General"), "okular", i18n("General Options") );
addPage( m_accessibility, i18n("Accessibility"), "access", i18n("Reading Aids") );
addPage( m_performance, i18n("Performance"), "launch", i18n("Performance Tuning") );
addPage( m_presentation, i18n("Presentation"), "kpresenter_kpr",
......
ClassName=KpdfSettings
File=oKular.kcfg
File=okular.kcfg
Mutators=true
Singleton=true
Visibility=OKULAR_EXPORT
......
/* Defines if force the use DRM in oKular */
/* Defines if force the use DRM in okular */
#define OKULAR_FORCE_DRM ${_OKULAR_FORCE_DRM}
install_files( ${SERVICETYPES_INSTALL_DIR} FILES oKularGenerator.desktop )
install_files( ${SERVICETYPES_INSTALL_DIR} FILES okularGenerator.desktop )
#original Makefile.am contents follow:
......@@ -8,14 +8,14 @@ install_files( ${SERVICETYPES_INSTALL_DIR} FILES oKularGenerator.desktop )
#
#METASOURCES = AUTO
#
#liboKularcore_la_SOURCES = chooseenginedialog.ui generator.cpp area.cpp textpage.cpp page.cpp document.cpp link.cpp annotations.cpp \
#libokularcore_la_SOURCES = chooseenginedialog.ui generator.cpp area.cpp textpage.cpp page.cpp document.cpp link.cpp annotations.cpp \
# pagetransition.cpp
#liboKularcore_la_LIBADD = $(KDE_LDFLAGS) $(LIB_KIO)
#libokularcore_la_LIBADD = $(KDE_LDFLAGS) $(LIB_KIO)
#
#kde_servicetypes_DATA = \
# oKularGenerator.desktop
# okularGenerator.desktop
#
#noinst_LTLIBRARIES = liboKularcore.la
#noinst_LTLIBRARIES = libokularcore.la
#
#document.lo: ../conf/settings.h
#page.lo: ../conf/settings.h
......@@ -659,11 +659,11 @@ void HighlightAnnotation::store( QDomNode & node, QDomDocument & document ) cons
/** StampAnnotation [Annotation] */
StampAnnotation::StampAnnotation()
: Annotation(), stampIconName( "oKular" )
: Annotation(), stampIconName( "okular" )
{}
StampAnnotation::StampAnnotation( const QDomNode & node )
: Annotation( node ), stampIconName( "oKular" )
: Annotation( node ), stampIconName( "okular" )
{
// loop through the whole children looking for a 'stamp' element
QDomNode subNode = node.firstChild();
......@@ -693,7 +693,7 @@ void StampAnnotation::store( QDomNode & node, QDomDocument & document ) const
node.appendChild( stampElement );
// append the optional attributes
if ( stampIconName != "oKular" )
if ( stampIconName != "okular" )
stampElement.setAttribute( "icon", stampIconName );
}
......
......@@ -158,7 +158,7 @@ bool KPDFDocument::openDocument( const QString & docFile, const KUrl& url, const
// 0. load Generator
// request only valid non-disabled plugins suitable for the mimetype
QString constraint("([X-KDE-Priority] > 0) and (exist Library)") ;
KService::List offers = KMimeTypeTrader::self()->query(mime->name(),"oKular/Generator",constraint);
KService::List offers = KMimeTypeTrader::self()->query(mime->name(),"okular/Generator",constraint);
if (offers.isEmpty())
{
kWarning() << "No plugin for '" << mime->name() << "' mimetype." << endl;
......@@ -217,7 +217,7 @@ bool KPDFDocument::openDocument( const QString & docFile, const KUrl& url, const
kWarning() << "Sth broke." << endl;
return false;
}
if ( offers[hRank]->property("[X-KDE-oKularHasInternalSettings]").toBool() )
if ( offers[hRank]->property("[X-KDE-okularHasInternalSettings]").toBool() )
{
m_loadedGenerators->insert(propName,generator);
m_usingCachedGenerator=true;
......@@ -1131,7 +1131,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
{
// this case is a link pointing to an executable with a parameter
// that also is an executable, possibly a hand-crafted pdf
KMessageBox::information( 0, i18n("The pdf file is trying to execute an external application and for your safety oKular does not allow that.") );
KMessageBox::information( 0, i18n("The pdf file is trying to execute an external application and for your safety okular does not allow that.") );
return;
}
}
......@@ -1139,7 +1139,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
{
// this case is a link pointing to an executable with no parameters
// core developers find unacceptable executing it even after asking the user
KMessageBox::information( 0, i18n("The pdf file is trying to execute an external application and for your safety oKular does not allow that.") );
KMessageBox::information( 0, i18n("The pdf file is trying to execute an external application and for your safety okular does not allow that.") );
return;
}
}
......
......@@ -3,7 +3,7 @@
* @short The source of information about the Generator
*
* The goal of this class is to provide per Generator settings,
* about data and other stuff not related with generating oKular
* about data and other stuff not related with generating okular
* content, but still needed for a full-featured plugin system.
*
*/
......@@ -14,4 +14,4 @@ class Informator
virtual void addConfigurationPages ( KConfigDialog* cfg ) = 0;
virtual KAboutData about();
virtual QStringList mimetypes() = 0;
}
\ No newline at end of file
}
[Desktop Entry]
Type=ServiceType
X-KDE-ServiceType=oKular/Generator
Comment=File format backend for oKular
X-KDE-ServiceType=okular/Generator
Comment=File format backend for okular
# Priority of the plugin. 0 - disabled
[PropertyDef::X-KDE-Priority]
Type=int
# Version of the API.
[PropertyDef::X-KDE-oKularAPIVersion]
[PropertyDef::X-KDE-okularAPIVersion]
Type=int
# Has configuration option
[PropertyDef::X-KDE-oKularHasInternalSettings]
[PropertyDef::X-KDE-okularHasInternalSettings]
Type=bool
......@@ -30,7 +30,7 @@ kde4_add_plugin(okularGenerator_chmlib WITH_PREFIX ${okularGenerator_chmlib_PART
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularGenerator_chmlib )
target_link_libraries(okularGenerator_chmlib ${KDE4_KDECORE_LIBS} oKularcore ${CHM_LIBRARY} ${KDE4_KDEPRINT_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KHTML_LIBS} )
target_link_libraries(okularGenerator_chmlib ${KDE4_KDECORE_LIBS} okularcore ${CHM_LIBRARY} ${KDE4_KDEPRINT_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KHTML_LIBS} )
install_targets(${PLUGIN_INSTALL_DIR} okularGenerator_chmlib )
......@@ -55,8 +55,8 @@ install_files( ${SERVICES_INSTALL_DIR} FILES libokularGenerator_chmlib.desktop
#
#INCLUDES = -I$(srcdir)/../.. -I../.. $(all_includes)
#
#libokularGenerator_chmlib_la_LIBADD = ../../core/liboKularcore.la \
# ../../conf/liboKularconf.la \
#libokularGenerator_chmlib_la_LIBADD = ../../core/libokularcore.la \
# ../../conf/libokularconf.la \
# lib/libchmfile.la \
# $(LIB_KDEPRINT) $(LIB_KDEUI) $(LIB_KHTML) -lchm
#libokularGenerator_chmlib_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
......
......@@ -2,10 +2,10 @@
Encoding=UTF-8
Type=Service
Name=chmlib
Comment=Windows HTMLHelp backend for oKular
ServiceTypes=oKular/Generator
Comment=Windows HTMLHelp backend for okular
ServiceTypes=okular/Generator
MimeType=application/chm
X-KDE-Library=libokularGenerator_chmlib.la
X-KDE-Priority=2
X-KDE-oKularAPIVersion=1
X-KDE-oKularHasInternalSettings=false
X-KDE-okularAPIVersion=1
X-KDE-okularHasInternalSettings=false
......@@ -18,7 +18,7 @@ kde4_add_plugin(okularGenerator_djvu WITH_PREFIX ${okularGenerator_djvu_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularGenerator_djvu )
target_link_libraries(okularGenerator_djvu ${KDE4_KDECORE_LIBS} oKularcore ${DJVULIBRE_LIBRARY} ${KDE4_KDEPRINT_LIBS} ${KDE4_KDEUI_LIBS} )
target_link_libraries(okularGenerator_djvu ${KDE4_KDECORE_LIBS} okularcore ${DJVULIBRE_LIBRARY} ${KDE4_KDEPRINT_LIBS} ${KDE4_KDEUI_LIBS} )
install_targets(${PLUGIN_INSTALL_DIR} okularGenerator_djvu )
......
......@@ -2,10 +2,10 @@
Encoding=UTF-8
Type=Service
Name=djvu
Comment=DjVu backend for oKular
ServiceTypes=oKular/Generator
Comment=DjVu backend for okular
ServiceTypes=okular/Generator
MimeType=image/x-djvu
X-KDE-Library=libokularGenerator_djvu.la
X-KDE-Priority=2
X-KDE-oKularAPIVersion=1
X-KDE-oKularHasInternalSettings=false
X-KDE-okularAPIVersion=1
X-KDE-okularHasInternalSettings=false
......@@ -17,7 +17,7 @@ kde4_add_plugin(okularGenerator_fax WITH_PREFIX ${okularGenerator_fax_PART_SRCS}
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularGenerator_fax )
target_link_libraries(okularGenerator_fax ${KDE4_KDECORE_LIBS} oKularcore ${KDE4_KDEUI_LIBS} kfaximage )
target_link_libraries(okularGenerator_fax ${KDE4_KDECORE_LIBS} okularcore ${KDE4_KDEUI_LIBS} kfaximage )
install_targets(${PLUGIN_INSTALL_DIR} okularGenerator_fax )
......@@ -41,8 +41,8 @@ kde4_install_icons( ${ICON_INSTALL_DIR} hicolor )
#kde_module_LTLIBRARIES = \
# libokularGenerator_fax.la
#
#libokularGenerator_fax_la_LIBADD = ../../core/liboKularcore.la \
# ../../conf/liboKularconf.la $(LIB_KDEUI) \
#libokularGenerator_fax_la_LIBADD = ../../core/libokularcore.la \
# ../../conf/libokularconf.la $(LIB_KDEUI) \
# libkfaximage/libkfaximage.la
#
#libokularGenerator_fax_la_LDFLAGS = -module -avoid-version $(KDE_PLUGIN) $(all_libraries)
......
......@@ -29,7 +29,7 @@
This class provides a well-documented reference implementation of a
Generator, suitable as a starting point for a real-world
implementation. This class is responsible for providing abstract layer of oKular
implementation. This class is responsible for providing abstract layer of okular
with all the needed document information.
*/
......
......@@ -2,10 +2,10 @@
Encoding=UTF-8
Type=Service
Name=KDE fax libraries
Comment=Fax backend for oKular
ServiceTypes=oKular/Generator
Comment=Fax backend for okular
ServiceTypes=okular/Generator
MimeType=image/fax-g3;image/tiff;
X-KDE-Library=libokularGenerator_fax.la
X-KDE-Priority=4
X-KDE-oKularAPIVersion=1
X-KDE-oKularHasInternalSettings=false
X-KDE-okularAPIVersion=1
X-KDE-okularHasInternalSettings=false
......@@ -47,7 +47,7 @@ kde4_add_plugin(okularGenerator_ghostview WITH_PREFIX ${okularGenerator_ghostvie
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularGenerator_ghostview )
target_link_libraries(okularGenerator_ghostview ${KDE4_KDECORE_LIBS} oKularcore qgs ${KDE4_KDEUI_LIBRARY} ${KDE4_KDEPRINT_LIBRARY} )
target_link_libraries(okularGenerator_ghostview ${KDE4_KDECORE_LIBS} okularcore qgs ${KDE4_KDEUI_LIBRARY} ${KDE4_KDEPRINT_LIBRARY} )
install_targets(${PLUGIN_INSTALL_DIR} okularGenerator_ghostview )
......@@ -74,7 +74,7 @@ install_files( ${SERVICES_INSTALL_DIR} FILES libokularGenerator_ghostview.deskt
#kde_module_LTLIBRARIES = libokularGenerator_ghostview.la
#
#libokularGenerator_ghostview_la_LIBADD = $(top_builddir)/kpdf/generators/ghostview/conf/libgssettings.la \
# $(top_builddir)/kpdf/core/liboKularcore.la $(top_builddir)/kpdf/conf/liboKularconf.la -lqgs $(LIB_KDEUI) $(LIB_KDEPRINT)
# $(top_builddir)/kpdf/core/libokularcore.la $(top_builddir)/kpdf/conf/libokularconf.la -lqgs $(LIB_KDEUI) $(LIB_KDEPRINT)
#libokularGenerator_ghostview_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -L$(LIB_GS_PATH)
#libokularGenerator_ghostview_la_SOURCES = interpreter_cmd.cpp internaldocument.cpp generator_ghostview.cpp gvlogwindow.cpp dscparse_adapter.cpp ps.c dscparse.cpp
##libokularGenerator_ghostview_la_METASOURCES = AUTO
......
......@@ -41,7 +41,7 @@ GSGenerator::GSGenerator( KPDFDocument * doc ) :
Generator ( doc ),
m_converted(false)
{
// pixGenerator = 0;
pixGenerator = 0;
asyncGenerator = 0;
internalDoc = 0;
dscForPDF = 0;
......@@ -59,7 +59,7 @@ GSGenerator::GSGenerator( KPDFDocument * doc ) :
GSGenerator::~GSGenerator()
{
delete asyncGenerator;
// delete pixGenerator;
delete pixGenerator;
}
void GSGenerator::addPages( KConfigDialog *dlg )
......@@ -181,45 +181,45 @@ bool GSGenerator::loadDocument( const QString & fileName, QVector< KPDFPage * >
connect (asyncGenerator, SIGNAL (Finished(QPixmap *)),
this, SLOT(slotAsyncPixmapGenerated (QPixmap *)));
}
// if( !pixGenerator )
// {
// pixGenerator = new GSInterpreterLib ();
// connect (pixGenerator, SIGNAL (Finished(const QImage*)),
// this, SLOT(slotPixmapGenerated (const QImage*)));
//
// if ( GSSettings::messages() )
// {
// pixGenerator->setBuffered(true);
// connect (pixGenerator, SIGNAL (io( GSInterpreterLib::MessageType, const char*, int )),
// m_logWindow, SLOT (append(GSInterpreterLib::MessageType, const char*,int)));
// }
// }
if( !pixGenerator )
{
pixGenerator = new GSInterpreterLib ();
connect (pixGenerator, SIGNAL (Finished(const QImage*)),
this, SLOT(slotPixmapGenerated (const QImage*)));
if ( GSSettings::messages() )
{
pixGenerator->setBuffered(true);
connect (pixGenerator, SIGNAL (io( GSInterpreterLib::MessageType, const char*, int )),
m_logWindow, SLOT (append(GSInterpreterLib::MessageType, const char*,int)));
}
}
if ( GSSettings::platformFonts() )
{
// pixGenerator->setPlatformFonts(false);
pixGenerator->setPlatformFonts(false);
asyncGenerator->setPlatformFonts(false);
}
if ( GSSettings::antialiasing())
{
// pixGenerator->setAABits(4,2);
pixGenerator->setAABits(4,2);
asyncGenerator->setAABits(4,2);
}
else
{
// pixGenerator->setAABits(1,1);
pixGenerator->setAABits(1,1);
asyncGenerator->setAABits(1,1);
}
// pixGenerator->setProgressive(false);
pixGenerator->setProgressive(false);
// ESTO YA ESTAVA COMENTADO m_pages=pagesVector;
return loadDocumentWithDSC(name,pagesVector,ps);
}
void GSGenerator::slotPixmapGenerated(const QImage* img)
{
/* kWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <<m_sRequest->width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl;
kWarning() << "sync gen is ready:" << pixGenerator->ready() << endl;
kWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <<m_sRequest->width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl;
// kWarning() << "sync gen is ready:" << pixGenerator->ready() << endl;
QPixmap * rPix;
rPix = new QPixmap(img->size());
rPix->fill();
......@@ -229,7 +229,7 @@ void GSGenerator::slotPixmapGenerated(const QImage* img)
kWarning() << "unlocking \n";
syncLock.unlock();
m_sRequest->page->setPixmap( m_sRequest->id, rPix );
signalRequestDone( m_sRequest );*/
signalRequestDone( m_sRequest );
}
void GSGenerator::slotAsyncPixmapGenerated(QPixmap * pix)
......@@ -332,7 +332,7 @@ bool GSGenerator::loadPages( QVector< KPDFPage * > & pagesVector )
bool GSGenerator::initInterpreter()
{
/* if (! pixGenerator->running())
if (! pixGenerator->running())
{
if( pixGenerator->start(true) && internalDoc->dsc()->isStructured() )
{
......@@ -342,8 +342,7 @@ bool GSGenerator::initInterpreter()
pixGenerator->run ( internalDoc->file() , internalDoc->setup(), false );
}
}
return pixGenerator->running();*/
return true;
return pixGenerator->running();
}
bool GSGenerator::loadDocumentWithDSC( const QString & name, QVector< KPDFPage * > & pagesVector, bool ps )
......@@ -392,7 +391,7 @@ void GSGenerator::generatePixmap( PixmapRequest * req )
}
else
{
/*
syncLock.lock();
// disconnect (pixGenerator, SIGNAL (Finished(const QImage*)),
// this, SLOT(slotPixmapGenerated (const QImage*)));
......@@ -412,11 +411,11 @@ void GSGenerator::generatePixmap( PixmapRequest * req )
}
/* connect (pixGenerator, SIGNAL (Finished(const QImage*)),
this, SLOT(slotPixmapGenerated (const QImage*)));*/
/* this->m_sRequest=req;
this->m_sRequest=req;
kWarning() << "checking req id=" << req->id << " " <<req->width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl;
kWarning() << "generator running : " << pixGenerator->running() << endl;
pixGenerator->run ( internalDoc->file() , internalDoc->pagePos(pgNo),true);
*/
}
}
......@@ -424,8 +423,8 @@ kWarning() << "generator running : " << pixGenerator->running() << endl;
bool GSGenerator::canGeneratePixmap( bool async )
{
// kWarning () << "ready Async/Sync " << (! docLock.locked()) << "/ " << (( pixGenerator ) ? !syncLock.locked() : true) << " asking for async: " << async << endl;
/*if (async)*/ return !docLock.locked();
// return ( pixGenerator ) ? pixGenerator->ready() && !syncLock.locked() : true;
if (async) return !docLock.locked();
return !syncLock.locked();
}
const DocumentInfo * GSGenerator::generateDocumentInfo()
......
......@@ -101,7 +101,7 @@ class GSGenerator : public Generator
PixmapRequest* m_sRequest;
// backendish stuff
// GSInterpreterLib* pixGenerator;
GSInterpreterLib* pixGenerator;
GSInterpreterCMD* asyncGenerator;
GSInternalDocument* internalDoc;
......
......@@ -342,15 +342,18 @@ bool GSInterpreterCMD::run( GSInterpreterLib::Position pos)
m_info.pos=pos;
m_info.sync=true;
m_info.handle=m_pixmap->handle();
kDebug() << "CUNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO1 running:" << isRunning() << endl;
if ( isRunning() )
{
// in my mind we should never reach here but it seems we do
// so wait a bit until the thread has really ended
wait();
}
start();
kDebug() << "CUNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO2" << endl;
return true;
}
void GSInterpreterCMD::run()
{
kDebug() << "CUNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO3" << endl;
lock();
// we are inside a thread
kDebug(4655)<< "Generation thread started " << getpid() << endl;
......
......@@ -2,10 +2,10 @@
Encoding=UTF-8
Type=Service
Name=Ghostscript
Comment=Ghostscript PS/PDF backend for oKular
ServiceTypes=oKular/Generator
Comment=Ghostscript PS/PDF backend for okular
ServiceTypes=okular/Generator
MimeType=application/postscript;image/x-eps;
X-KDE-Library=libokularGenerator_ghostview.la
X-KDE-Priority=2
X-KDE-oKularAPIVersion=1
X-KDE-oKularHasInternalSettings=true
X-KDE-okularAPIVersion=1
X-KDE-okularHasInternalSettings=true
......@@ -13,7 +13,7 @@ kde4_add_plugin(okularGenerator_kimgio WITH_PREFIX ${okularGenerator_kimgio_PART
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} okularGenerator_kimgio )
target_link_libraries(okularGenerator_kimgio ${KDE4_KDECORE_LIBS} oKularcore ${KDE4_KDEUI_LIBS} )
target_link_libraries(okularGenerator_kimgio ${KDE4_KDECORE_LIBS} okularcore ${KDE4_KDEUI_LIBS} )
install_targets(${PLUGIN_INSTALL_DIR} okularGenerator_kimgio )
...