- ported ghostview backend to libqgs, finally compiles

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=486812
remotes/origin/okular3-playground
Piotr Szymanski 21 years ago
parent 69539574fc
commit b59e6dcf8b
  1. 2
      generators/chm/Makefile.am
  2. 4
      generators/chm/kio-msits/Makefile.am
  3. 4
      generators/chm/lib/Makefile.am
  4. 7
      generators/ghostview/Makefile.am
  5. 4
      generators/ghostview/conf/Makefile.am
  6. 2
      generators/ghostview/generator_ghostview.cpp
  7. 6
      generators/ghostview/gvlogwindow.cpp
  8. 39
      generators/ghostview/interpreter_cmd.cpp
  9. 4
      generators/ghostview/interpreter_cmd.h
  10. 2
      generators/ghostview/kpdflibgsasyncgenerator.cpp

@ -13,7 +13,7 @@ INCLUDES = -I$(srcdir)/../.. -I$(top_builddir)/kpdf $(all_includes)
libokularGenerator_chmlib_la_LIBADD = $(top_builddir)/kpdf/core/liboKularcore.la \
$(top_builddir)/kpdf/conf/liboKularconf.la \
lib/libchmfile.la \
$(LIB_KDEPRINT) $(LIB_KDEUI) $(LIB_KHTML)
$(LIB_KDEPRINT) $(LIB_KDEUI) $(LIB_KHTML) -lchm
libokularGenerator_chmlib_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
libokularGenerator_chmlib_la_SOURCES = generator_t.cpp
METASOURCES = AUTO

@ -1,10 +1,10 @@
METASOURCES = AUTO
INCLUDES = $(QT_INCLUDES) -I$(CHM_INCLUDES) $(KDE_INCLUDES)
INCLUDES = $(QT_INCLUDES) -I$(CHM_INCLUDES) $(KDE_INCLUDES) $(all_includes)
kde_module_LTLIBRARIES = kio_msits.la
kio_msits_la_SOURCES = msits.cpp
kio_msits_la_LIBADD = -lkio -lchm
kio_msits_la_LIBADD = $(LIB_KIO) -lchm
kio_msits_la_LDFLAGS = -module -avoid-version $(QT_LIBS) $(KDE_LDFLAGS) $(KDE_LIBS) $(KDE_PLUGIN)
protocol_DATA = msits.protocol

@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libchmfile.la
INCLUDES = -I$(srcdir)/../.. -I$(top_builddir)/kpdf $(all_includes)
libchmfile_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -lqt-mt -lchm
libchmfile_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
libchmfile_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
libchmfile_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIB_QT) -lchm
libchmfile_la_SOURCES = kchmtextencoding.cpp xchmfile.cpp iconstorage.cpp kchmurl.cpp kchmtreeviewitem.cpp

@ -7,11 +7,12 @@ KDE_CXXFLAGS=-Wall
bin_PROGRAMS = kpdflibgsasyncgenerator
kpdflibgsasyncgenerator_SOURCES = kpdflibgsasyncgenerator.cpp
kpdflibgsasyncgenerator_LDFLAGS = $(LIB_QT) -lkgs
kpdflibgsasyncgenerator_LDFLAGS = $(QT_LDFLAGS) $(all_libraries) -L$(LIB_GS_PATH)
kpdflibgsasyncgenerator_LDADD = -lqgs $(LIB_QT) $(LIB_KDECORE)
kde_module_LTLIBRARIES = libokularGenerator_ghostview.la
libokularGenerator_ghostview_la_LIBADD = $(top_builddir)/kpdf/core/liboKularcore.la $(top_builddir)/kpdf/conf/liboKularconf.la -lkgs -lkdeui -lkdeprint
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)
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

@ -2,8 +2,8 @@ noinst_LTLIBRARIES = libgssettings.la
INCLUDES = -I$(srcdir)/../.. -I$(top_builddir)/kpdf $(all_includes)
libgssettings_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -lqt-mt
libgssettings_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
libgssettings_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
libgssettings_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIB_QT)
libgssettings_la_SOURCES = empty.cpp gssettings.kcfgc gssettingswidget.ui
kde_kcfg_DATA = gssettings.kcfg

@ -177,7 +177,7 @@ bool GSGenerator::loadDocument( const QString & fileName, QValueVector< KPDFPage
{
asyncGenerator= new GSInterpreterCMD ( fileName );
connect (asyncGenerator, SIGNAL (Finished(QPixmap *)),
this, SLOT(slotAsyncPixmapGenerated (QPixmap *));
this, SLOT(slotAsyncPixmapGenerated (QPixmap *)));
}
if( !pixGenerator )
{

@ -66,15 +66,15 @@ void GSLogWindow::append( GSInterpreterLib::MessageType t, const QString &text)
KListViewItem* tmp;
switch(t)
{
case Error:
case GSInterpreterLib::Error:
tmp=new KListViewItem( m_msgList , *it, "Error" );
tmp->setPixmap(m_tCol,SmallIcon( "messagsebox_critical" ));
break;
case Input:
case GSInterpreterLib::Input:
tmp=new KListViewItem( m_msgList , *it, "Input" );
tmp->setPixmap(m_tCol,SmallIcon( "1leftarrow" ));
break;
case Output:
case GSInterpreterLib::Output:
tmp=new KListViewItem( m_msgList , *it, "Output" );
tmp->setPixmap(m_tCol,SmallIcon( "1rightarrow" ));
break;

@ -71,7 +71,10 @@ GSInterpreterCMD::GSInterpreterCMD( const QString & fileName ) :
m_structurePending( false ),
m_magnify ( 1 ),
m_orientation ( CDSC_PORTRAIT ),
m_name ( fileName )
m_name ( fileName ),
m_aaGfx (1),
m_aaText (1),
m_pfonts (false)
{
kdDebug(4655) << "Constructing async interpreter!" << endl;
m_pixmap=0;
@ -203,7 +206,10 @@ bool GSInterpreterCMD::start()
<< QString::number ( m_magnify )
<< QString::number ( m_orientation )
<< QString::number ( m_width )
<< QString::number ( m_height );
<< QString::number ( m_height )
<< QString::number ( m_pfonts ? 1 : 0 )
<< QString::number (m_aaText)
<< QString::number (m_aaGfx);
kdDebug(4655) << "Argument count: " << list.count() << endl;
(*m_process) << list;
@ -268,6 +274,18 @@ void GSInterpreterCMD::setMedia( QString media )
unlock();
}
void GSInterpreterCMD::setPlatformFonts(bool pfonts)
{
lock();
if( m_pfonts != pfonts )
{
m_pfonts = pfonts;
stop();
}
unlock();
}
void GSInterpreterCMD::setSize( int w, int h )
{
lock();
@ -285,6 +303,23 @@ void GSInterpreterCMD::setSize( int w, int h )
unlock();
}
void GSInterpreterCMD::setAABits(int text, int graphics)
{
lock();
if ( m_aaText!= text )
{
m_aaText=text;
stop();
}
if ( m_aaGfx != graphics )
{
m_aaGfx=graphics;
stop();
}
unlock();
}
bool GSInterpreterCMD::run( GSInterpreterLib::Position pos)
{
kdDebug(4655) << "Running request with size: " << m_width << "x" << m_height << endl;

@ -54,6 +54,8 @@ class GSInterpreterCMD : public QObject , public QThread
// void setGhostscriptArguments( const QStringList& arguments );
void setOrientation( int orientation );
void setSize( int w, int h );
void setPlatformFonts(bool pfonts=true);
void setAABits(int text=1, int graphics=1);
void setMagnify( double magnify );
void setMedia (QString media) ;
// void setBoundingBox( const KDSCBBOX& boundingBox );
@ -93,6 +95,8 @@ class GSInterpreterCMD : public QObject , public QThread
// change everytime new request is done
bool m_structurePending;
double m_magnify;
int m_aaText,m_aaGfx;
bool m_pfonts;
// prolog/setup positions
GSInterpreterLib::Position m_data[2];
bool m_haveStructure;

@ -87,6 +87,8 @@ int main (int argc, char* argv[])
interpreter->setMagnify ( QString(argv[5]).toDouble() );
interpreter->setOrientation ( QString(argv[6]).toInt() );
interpreter->setSize ( QString(argv[7]).toInt(), QString(argv[8]).toInt() );
interpreter->setPlatformFonts ( QString(argv[9]).toInt() !=0 );
interpreter->setAABits(QString(argv[10]).toInt(), QString(argv[11]).toInt() );
KApplication app(argc,argv,QCString("kpdflibgsasyncgenerator"));
PixHandler pxHandler;

Loading…
Cancel
Save