@ -25,7 +25,6 @@
# include <libdjvu/miniexp.h>
# include <stdio.h>
# include <KDebug>
QDebug & operator < < ( QDebug & s , const ddjvu_rect_t & r )
{
@ -36,22 +35,22 @@ QDebug &operator<<( QDebug & s, const ddjvu_rect_t &r )
static void which_ddjvu_message ( const ddjvu_message_t * msg )
{
# ifdef KDJVU_DEBUG
k Debug( ) < < " which_djvu_message(...): " < < msg - > m_any . tag ;
q Debug( ) < < " which_djvu_message(...): " < < msg - > m_any . tag ;
switch ( msg - > m_any . tag )
{
case DDJVU_ERROR :
k Debug( ) . nospace ( ) < < " ERROR: file " < < msg - > m_error . filename < < " , line " < < msg - > m_error . lineno ;
k Debug( ) . nospace ( ) < < " ERROR: function ' " < < msg - > m_error . function < < " ' " ;
k Debug( ) . nospace ( ) < < " ERROR: ' " < < msg - > m_error . message < < " ' " ;
q Debug( ) . nospace ( ) < < " ERROR: file " < < msg - > m_error . filename < < " , line " < < msg - > m_error . lineno ;
q Debug( ) . nospace ( ) < < " ERROR: function ' " < < msg - > m_error . function < < " ' " ;
q Debug( ) . nospace ( ) < < " ERROR: ' " < < msg - > m_error . message < < " ' " ;
break ;
case DDJVU_INFO :
k Debug( ) . nospace ( ) < < " INFO: ' " < < msg - > m_info . message < < " ' " ;
q Debug( ) . nospace ( ) < < " INFO: ' " < < msg - > m_info . message < < " ' " ;
break ;
case DDJVU_CHUNK :
k Debug( ) . nospace ( ) < < " CHUNK: ' " < < QByteArray ( msg - > m_chunk . chunkid ) < < " ' " ;
q Debug( ) . nospace ( ) < < " CHUNK: ' " < < QByteArray ( msg - > m_chunk . chunkid ) < < " ' " ;
break ;
case DDJVU_PROGRESS :
k Debug( ) . nospace ( ) < < " PROGRESS: ' " < < msg - > m_progress . percent < < " ' " ;
q Debug( ) . nospace ( ) < < " PROGRESS: ' " < < msg - > m_progress . percent < < " ' " ;
break ;
default : ;
}
@ -478,7 +477,7 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
renderrect . w = realwidth ;
renderrect . h = realheight ;
# ifdef KDJVU_DEBUG
k Debug( ) < < " renderrect: " < < renderrect ;
q Debug( ) < < " renderrect: " < < renderrect ;
# endif
ddjvu_rect_t pagerect ;
pagerect . x = 0 ;
@ -486,7 +485,7 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
pagerect . w = width ;
pagerect . h = height ;
# ifdef KDJVU_DEBUG
k Debug( ) < < " pagerect: " < < pagerect ;
q Debug( ) < < " pagerect: " < < pagerect ;
# endif
handle_ddjvu_messages ( m_djvu_cxt , false ) ;
QImage res_img ( realwidth , realheight , QImage : : Format_RGB32 ) ;
@ -496,7 +495,7 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
res = ddjvu_page_render ( djvupage , DDJVU_RENDER_COLOR ,
& pagerect , & renderrect , m_format , res_img . bytesPerLine ( ) , ( char * ) res_img . bits ( ) ) ;
# ifdef KDJVU_DEBUG
k Debug( ) < < " rendering result: " < < res ;
q Debug( ) < < " rendering result: " < < res ;
# endif
handle_ddjvu_messages ( m_djvu_cxt , false ) ;
@ -679,7 +678,7 @@ bool KDjVu::openFile( const QString & fileName )
return false ;
}
k Debug( ) < < " # of pages: " < < ddjvu_document_get_pagenum ( d - > m_djvu_document ) ;
q Debug( ) < < " # of pages: " < < ddjvu_document_get_pagenum ( d - > m_djvu_document ) ;
int numofpages = ddjvu_document_get_pagenum ( d - > m_djvu_document ) ;
d - > m_pages . clear ( ) ;
d - > m_pages . resize ( numofpages ) ;
@ -723,7 +722,7 @@ bool KDjVu::openFile( const QString & fileName )
handle_ddjvu_messages ( d - > m_djvu_cxt , true ) ;
if ( sts > = DDJVU_JOB_FAILED )
{
k Debug( ) . nospace ( ) < < " \t >>> page " < < i < < " failed: " < < sts ;
q Debug( ) . nospace ( ) < < " \t >>> page " < < i < < " failed: " < < sts ;
return false ;
}
@ -1049,7 +1048,7 @@ bool KDjVu::exportAsPostScript( QFile* file, const QList<int>& pageList ) const
FILE * f = fdopen ( file - > handle ( ) , " w+ " ) ;
if ( ! f )
{
k Debug( ) < < " error while getting the FILE* " ;
q Debug( ) < < " error while getting the FILE* " ;
return false ;
}