diff options
author | Timothy Pearson <[email protected]> | 2011-12-16 09:59:00 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-16 09:59:00 -0600 |
commit | ec1fddcd0d6663ad273af85357f04abbc5689468 (patch) | |
tree | 6cb946ab8b4771868c6eee8d1aa5213d6ec246e2 /kviewshell/plugins/djvu/libdjvu | |
parent | c2637a0da6d9a1c8626ca39f8451ab3b7cda487a (diff) | |
download | tdegraphics-ec1fddcd0d6663ad273af85357f04abbc5689468.tar.gz tdegraphics-ec1fddcd0d6663ad273af85357f04abbc5689468.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit c2637a0da6d9a1c8626ca39f8451ab3b7cda487a.
Diffstat (limited to 'kviewshell/plugins/djvu/libdjvu')
26 files changed, 425 insertions, 425 deletions
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp index 9e8b5fd7..d6f5555c 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp @@ -147,13 +147,13 @@ DjVmNav::DjVuBookMark::encode(const GP<ByteStream> &gstr) ByteStream &bs=*gstr; #ifdef DJVMNAV_WITH_256LIMIT if (count>255) - G_THROW("Excessive number of children in bookmark tree"); + G_THROW("Excessive number of tqchildren in bookmark tree"); bs.write8(count); textsize = displayname.length(); bs.write24( textsize ); #else if (count>65535) - G_THROW("Excessive number of children in bookmark tree"); + G_THROW("Excessive number of tqchildren in bookmark tree"); bs.write8( count & 0xff ); bs.write8( (count>>8) & 0xff ); textsize = displayname.length(); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h index 46c5d57f..612cd100 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h @@ -115,7 +115,7 @@ private: /** The DjVuBookMark. Each entry in the Navigation chunk (NAVM) is a bookmark. A bookmark - contains a count of immediate children, a display string and a url. + contains a count of immediate tqchildren, a display string and a url. **/ class DjVmNav::DjVuBookMark : public GPEnabled @@ -131,7 +131,7 @@ public: void encode(const GP<ByteStream> &stream); void dump(const GP<ByteStream> &stream); void decode(const GP<ByteStream> &stream); - int count; // count of immediate children. + int count; // count of immediate tqchildren. GUTF8String displayname; // example: "Section 3.5 - Encryption" GUTF8String url; // url, may be blank or relative. }; diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp index 7cece60b..f3a53bf7 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp @@ -978,16 +978,16 @@ DjVuANT::get_mode(GLParser & parser) return retval; } -static inline DjVuANT::alignment +static inline DjVuANT::tqalignment legal_halign(const int i) { - DjVuANT::alignment retval; - switch((DjVuANT::alignment)i) + DjVuANT::tqalignment retval; + switch((DjVuANT::tqalignment)i) { case DjVuANT::ALIGN_LEFT: case DjVuANT::ALIGN_CENTER: case DjVuANT::ALIGN_RIGHT: - retval=(DjVuANT::alignment)i; + retval=(DjVuANT::tqalignment)i; break; default: retval=DjVuANT::ALIGN_UNSPEC; @@ -996,16 +996,16 @@ legal_halign(const int i) return retval; } -static inline DjVuANT::alignment +static inline DjVuANT::tqalignment legal_valign(const int i) { - DjVuANT::alignment retval; - switch((DjVuANT::alignment)i) + DjVuANT::tqalignment retval; + switch((DjVuANT::tqalignment)i) { case DjVuANT::ALIGN_CENTER: case DjVuANT::ALIGN_TOP: case DjVuANT::ALIGN_BOTTOM: - retval=(DjVuANT::alignment)i; + retval=(DjVuANT::tqalignment)i; break; default: retval=DjVuANT::ALIGN_UNSPEC; @@ -1014,12 +1014,12 @@ legal_valign(const int i) return retval; } -DjVuANT::alignment +DjVuANT::tqalignment DjVuANT::get_hor_align(GLParser & parser) { DEBUG_MSG("DjVuAnt::get_hor_align(): getting hor page alignemnt ...\n"); DEBUG_MAKE_INDENT(3); - alignment retval=ALIGN_UNSPEC; + tqalignment retval=ALIGN_UNSPEC; G_TRY { GP<GLObject> obj=parser.get_object(ALIGN_TAG); @@ -1030,7 +1030,7 @@ DjVuANT::get_hor_align(GLParser & parser) for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i) { - const alignment j=legal_halign(i); + const tqalignment j=legal_halign(i); if((i == (int)j)&&(align == align_strings[i])) { retval=j; @@ -1048,18 +1048,18 @@ DjVuANT::get_hor_align(GLParser & parser) #ifndef NDEBUG if(retval == ALIGN_UNSPEC) { - DEBUG_MSG("resetting alignment to ALIGN_UNSPEC\n"); + DEBUG_MSG("resetting tqalignment to ALIGN_UNSPEC\n"); } #endif // NDEBUG return retval; } -DjVuANT::alignment +DjVuANT::tqalignment DjVuANT::get_ver_align(GLParser & parser) { DEBUG_MSG("DjVuAnt::get_ver_align(): getting vert page alignemnt ...\n"); DEBUG_MAKE_INDENT(3); - alignment retval=ALIGN_UNSPEC; + tqalignment retval=ALIGN_UNSPEC; G_TRY { GP<GLObject> obj=parser.get_object(ALIGN_TAG); @@ -1069,7 +1069,7 @@ DjVuANT::get_ver_align(GLParser & parser) DEBUG_MSG("ver_align='" << align << "'\n"); for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i) { - const alignment j=legal_valign(i); + const tqalignment j=legal_valign(i); if((i == (int)j)&&(align == align_strings[i])) { retval=j; @@ -1087,7 +1087,7 @@ DjVuANT::get_ver_align(GLParser & parser) #ifndef NDEBUG if(retval == ALIGN_UNSPEC) { - DEBUG_MSG("resetting alignment to ALIGN_UNSPEC\n"); + DEBUG_MSG("resetting tqalignment to ALIGN_UNSPEC\n"); } #endif // NDEBUG return retval; @@ -1166,38 +1166,38 @@ DjVuANT::get_map_areas(GLParser & parser) DEBUG_MSG("found maparea '" << comment << "' (" << url << ":" << target << ")\n"); - GLObject * shape=obj[2]; + GLObject * tqshape=obj[2]; GP<GMapArea> map_area; - if (shape->get_type()==GLObject::LIST) + if (tqshape->get_type()==GLObject::LIST) { - if (shape->get_name()==GMapArea::RECT_TAG) + if (tqshape->get_name()==GMapArea::RECT_TAG) { DEBUG_MSG("it's a rectangle.\n"); - GRect grect((*shape)[0]->get_number(), - (*shape)[1]->get_number(), - (*shape)[2]->get_number(), - (*shape)[3]->get_number()); + GRect grect((*tqshape)[0]->get_number(), + (*tqshape)[1]->get_number(), + (*tqshape)[2]->get_number(), + (*tqshape)[3]->get_number()); GP<GMapRect> map_rect=GMapRect::create(grect); map_area=(GMapRect *)map_rect; - } else if (shape->get_name()==GMapArea::POLY_TAG) + } else if (tqshape->get_name()==GMapArea::POLY_TAG) { DEBUG_MSG("it's a polygon.\n"); - int points=shape->get_list().size()/2; + int points=tqshape->get_list().size()/2; GTArray<int> xx(points-1), yy(points-1); for(int i=0;i<points;i++) { - xx[i]=(*shape)[2*i]->get_number(); - yy[i]=(*shape)[2*i+1]->get_number(); + xx[i]=(*tqshape)[2*i]->get_number(); + yy[i]=(*tqshape)[2*i+1]->get_number(); } GP<GMapPoly> map_poly=GMapPoly::create(xx,yy,points); map_area=(GMapPoly *)map_poly; - } else if (shape->get_name()==GMapArea::OVAL_TAG) + } else if (tqshape->get_name()==GMapArea::OVAL_TAG) { DEBUG_MSG("it's an ellipse.\n"); - GRect grect((*shape)[0]->get_number(), - (*shape)[1]->get_number(), - (*shape)[2]->get_number(), - (*shape)[3]->get_number()); + GRect grect((*tqshape)[0]->get_number(), + (*tqshape)[1]->get_number(), + (*tqshape)[2]->get_number(), + (*tqshape)[3]->get_number()); GP<GMapOval> map_oval=GMapOval::create(grect); map_area=(GMapOval *)map_oval; } diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h index ed82f933..b59fe37d 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h @@ -104,7 +104,7 @@ class ByteStream; // -------- DJVUANT -------- /** This class contains some trivial annotations of the page or of the - document such as page border color, page alignment, initial zoom and + document such as page border color, page tqalignment, initial zoom and display mode, hyperlinks and highlighted areas. All this information is put inside a textual chunk #ANTa# in pseudo-lisp format. Decoding and encoding are normally done by \Ref{DjVuANT::decode}() and @@ -120,7 +120,7 @@ public: enum { MODE_UNSPEC=0, MODE_COLOR, MODE_FORE, MODE_BACK, MODE_BW }; enum { ZOOM_STRETCH=-4, ZOOM_ONE2ONE=-3, ZOOM_WIDTH=-2, ZOOM_PAGE=-1, ZOOM_UNSPEC=0 }; - enum alignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, + enum tqalignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_TOP, ALIGN_BOTTOM }; /// Creates an empty annotation object. @@ -152,12 +152,12 @@ public: special cases. \end{description} */ int mode; - /**Qt::Horizontal page alignment. Possible values are #ALIGN_LEFT#, + /**Qt::Horizontal page tqalignment. Possible values are #ALIGN_LEFT#, #ALIGN_CENTER#, #ALIGN_RIGHT# and #ALIGN_UNSPEC#. */ - alignment hor_align; - /**Qt::Vertical page alignment. Possible values are #ALIGN_TOP#, + tqalignment hor_align; + /**Qt::Vertical page tqalignment. Possible values are #ALIGN_TOP#, #ALIGN_CENTER#, #ALIGN_BOTTOM# and #ALIGN_UNSPEC#. */ - alignment ver_align; + tqalignment ver_align; /** List of defined map areas. They may be just areas of highlighting or hyperlink. Please refer to \Ref{GMapArea}, \Ref{GMapRect}, \Ref{GMapPoly} and \Ref{GMapOval} for details. */ @@ -213,8 +213,8 @@ private: static unsigned long int get_bg_color(class GLParser & parser); static int get_zoom(class GLParser & parser); static int get_mode(class GLParser & parser); - static alignment get_hor_align(class GLParser & parser); - static alignment get_ver_align(class GLParser & parser); + static tqalignment get_hor_align(class GLParser & parser); + static tqalignment get_ver_align(class GLParser & parser); static GPList<GMapArea> get_map_areas(class GLParser & parser); #ifndef NO_METADATA_IN_ANT_CHUNK static GMap<GUTF8String, GUTF8String>get_metadata(GLParser & parser); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp index 542faa7a..67223e1f 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp @@ -651,7 +651,7 @@ DjVuDocEditor::insert_file(const GP<DataPool> &file_pool, // Good. Before we continue with the included files we want to // complete insertion of this one. Notice, that insertion of - // children may fail, in which case we will have to modify + // tqchildren may fail, in which case we will have to modify // data for this file to get rid of invalid INCL // Create a file record with the chosen ID @@ -994,7 +994,7 @@ DjVuDocEditor::remove_file(const GUTF8String &id, bool remove_unref, // We will accumulate errors here. GUTF8String errors; - // Now modify the ref_map and process children if necessary + // Now modify the ref_map and process tqchildren if necessary GP<DjVuFile> file=get_djvu_file(id); if (file) { diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp index e7c74b84..c765fdd0 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp @@ -102,7 +102,7 @@ DjVuErrorList::notify_error(const DjVuPort * source, const GUTF8String & msg) bool DjVuErrorList::notify_status(const DjVuPort * source, const GUTF8String &msg) { - Status.append(msg); + tqStatus.append(msg); return 1; } @@ -120,16 +120,16 @@ DjVuErrorList::GetError(void) } GUTF8String -DjVuErrorList::GetStatus(void) +DjVuErrorList::GettqStatus(void) { - GUTF8String PrevStatus; + GUTF8String PrevtqStatus; GPosition pos; - if((pos=Status)) + if((pos=tqStatus)) { - PrevStatus=Status[pos]; - Status.del(pos); + PrevtqStatus=tqStatus[pos]; + tqStatus.del(pos); } - return PrevStatus; + return PrevtqStatus; } GP<DataPool> diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h index 885e76aa..c42e96e2 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h @@ -126,13 +126,13 @@ public: inline GList<GUTF8String> GetStatusList(void); /// Just clear the list. - inline void ClearStatus(void); + inline void CleartqStatus(void); /// Get one status message and clear that message from the list. - GUTF8String GetStatus(void); + GUTF8String GettqStatus(void); /// Check if there are any more status messages. - inline bool HasStatus(void) const; + inline bool HastqStatus(void) const; /** This gets the data. We can't use the simple port's request data since we want to allow the user to specify the ByteStream. */ @@ -143,7 +143,7 @@ private: GURL pool_url; GP<DataPool> pool; GList<GUTF8String> Errors; - GList<GUTF8String> Status; + GList<GUTF8String> tqStatus; private: //dummy stuff static GURL set_stream(ByteStream *); }; @@ -167,22 +167,22 @@ DjVuErrorList::ClearError(void) inline GList<GUTF8String> DjVuErrorList::GetStatusList(void) { - GList<GUTF8String> retval=(const GList<GUTF8String>)Status; - Status.empty(); + GList<GUTF8String> retval=(const GList<GUTF8String>)tqStatus; + tqStatus.empty(); return retval; } inline void -DjVuErrorList::ClearStatus(void) -{ Status.empty(); } +DjVuErrorList::CleartqStatus(void) +{ tqStatus.empty(); } inline bool DjVuErrorList::HasError(void) const { return !Errors.isempty(); } inline bool -DjVuErrorList::HasStatus(void) const -{ return !Status.isempty(); } +DjVuErrorList::HastqStatus(void) const +{ return !tqStatus.isempty(); } #ifdef HAVE_NAMESPACES diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp index 73e3a9c2..862c5fd0 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp @@ -419,7 +419,7 @@ DjVuFile::notify_file_flags_changed(const DjVuFile * src, { if (src!=this && are_incl_files_created() && is_data_present()) { - // Check if all children have data + // Check if all tqchildren have data bool all=true; { GCriticalSectionLock lock(&inc_files_lock); @@ -488,7 +488,7 @@ DjVuFile::decode_func(void) while(wait_for_finish(0)) continue; - DEBUG_MSG("waiting for children termination\n"); + DEBUG_MSG("waiting for tqchildren termination\n"); // Check for termination status GCriticalSectionLock lock(&inc_files_lock); for(GPosition pos=inc_files_list;pos;++pos) @@ -928,7 +928,7 @@ DjVuFile::decode_chunk( const GUTF8String &id, const GP<ByteStream> &gbs, GP<JB2Dict> fgjd = JB2Dict::create(); fgjd->decode(gbs); this->fgjd = fgjd; - desc.format( ERR_MSG("DjVuFile.shape_dict") "\t%d", fgjd->get_shape_count() ); + desc.format( ERR_MSG("DjVuFile.tqshape_dict") "\t%d", fgjd->get_tqshape_count() ); } // Sjbz (JB2 encoded mask) diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h index ea0e6db3..e81ef2d5 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h @@ -134,7 +134,7 @@ class DjVuNavDir; {\bf Inclusion} is also a new feature specifically designed for a multipage document. Indeed, inside a given document there can be a lot of things shared between its pages. Examples can be the document - annotation (\Ref{DjVuAnno}) and other things like shared shapes and + annotation (\Ref{DjVuAnno}) and other things like shared tqshapes and dictionary (to be implemented). To avoid putting these chunks into every page, we have invented new chunk called #INCL# which purpose is to make the decoder open the specified file and decode it. @@ -217,7 +217,7 @@ public: GP<GPixmap> bgpm; /// Pointer to the mask of foreground component of DjVu image (JB2 encoded). GP<JB2Image> fgjb; - /// Pointer to the optional shape dictionary for the mask (JB2 encoded). + /// Pointer to the optional tqshape dictionary for the mask (JB2 encoded). GP<JB2Dict> fgjd; /// Pointer to a colors layer for the foreground component of DjVu image. GP<GPixmap> fgpm; @@ -648,7 +648,7 @@ private: const GP<ByteStream> &str, bool djvi, bool djvu, bool iw44); int get_dpi(int w, int h); - // Functions dealing with the shape directory (fgjd) + // Functions dealing with the tqshape directory (fgjd) static GP<JB2Dict> static_get_fgjd(void *); GP<JB2Dict> get_fgjd(int block=0); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp index f384ce97..54f24f1e 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp @@ -428,7 +428,7 @@ DjVuImage::notify_chunk_done(const DjVuPort *, const GUTF8String & name) !name.cmp("PMxx", 2) || !name.cmp("BMxx", 2) ) ) { - DjVuPort::get_portcaster()->notify_relayout(this); + DjVuPort::get_portcaster()->notify_retqlayout(this); relayout_sent=true; } else if (!name.cmp("Sxxx", 1) || @@ -461,7 +461,7 @@ public: GP<DataPool> request_data(const DjVuPort *src, const GURL & url); void notify_chunk_done(const DjVuPort *, const GUTF8String &name); void notify_redisplay(const class DjVuImage * source); - void notify_relayout(const class DjVuImage * source); + void notify_retqlayout(const class DjVuImage * source); }; DjVuImageNotifier::DjVuImageNotifier(DjVuInterface *notifier) @@ -485,10 +485,10 @@ DjVuImageNotifier::notify_redisplay(const class DjVuImage * source) } void -DjVuImageNotifier::notify_relayout(const class DjVuImage * source) +DjVuImageNotifier::notify_retqlayout(const class DjVuImage * source) { if (notifier) - notifier->notify_relayout(); + notifier->notify_retqlayout(); } void @@ -848,17 +848,17 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, for (int blitno = 0; blitno < jimg->get_blit_count(); blitno++) { const JB2Blit *pblit = jimg->get_blit(blitno); - const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); - if (pshape.bits && + const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); + if (ptqshape.bits && pblit->left <= rect.xmax * subsample && pblit->bottom <= rect.ymax * subsample && - pblit->left + (int)pshape.bits->columns() >= rect.xmin * subsample && - pblit->bottom + (int)pshape.bits->rows() >= rect.ymin * subsample ) + pblit->left + (int)ptqshape.bits->columns() >= rect.xmin * subsample && + pblit->bottom + (int)ptqshape.bits->rows() >= rect.ymin * subsample ) { // Record component list if (fgbc) components.append(blitno); // Blit - bm->blit(pshape.bits, + bm->blit(ptqshape.bits, pblit->left - rxmin, pblit->bottom - rymin, subsample); } @@ -902,9 +902,9 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, lastx = pblit->left; if (fg->colordata[blitno] == colorindex) { - const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); + const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); GRect rect(pblit->left, pblit->bottom, - pshape.bits->columns(), pshape.bits->rows()); + ptqshape.bits->columns(), ptqshape.bits->rows()); comprect.recthull(comprect, rect); compset.insert_before(nullpos, components, pos); continue; @@ -927,8 +927,8 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect, { int blitno = compset[pos]; const JB2Blit *pblit = jimg->get_blit(blitno); - const JB2Shape &pshape = jimg->get_shape(pblit->shapeno); - bm->blit(pshape.bits, + const JB2Shape &ptqshape = jimg->get_tqshape(pblit->tqshapeno); + bm->blit(ptqshape.bits, pblit->left - rxmin, pblit->bottom - rymin, subsample); } diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h index 57b40938..84c9165d 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h @@ -123,7 +123,7 @@ class DjVuInterface public: virtual ~DjVuInterface(); virtual void notify_chunk(const char *chkid, const char *msg) = 0; - virtual void notify_relayout(void) = 0; + virtual void notify_retqlayout(void) = 0; virtual void notify_redisplay(void) = 0; }; @@ -353,7 +353,7 @@ public: GP<GPixmap> get_pixmap(const GRect &rect, const GRect &all, double gamma=0) const; /** Renders the mask of the foreground layer of the DjVu image. This functions is a wrapper for \Ref{JB2Image::get_bitmap}. Argument #align# - specified the alignment of the rows of the returned images. Setting + specified the tqalignment of the rows of the returned images. Setting #align# to #4#, for instance, will adjust the bitmap border in order to make sure that each row of the returned image starts on a word (four byte) boundary. This function returns a null pointer if there is not diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp index 5e8a25c9..8cf9b967 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp @@ -557,12 +557,12 @@ DjVuPortcaster::notify_redisplay(const DjVuImage * source) } void -DjVuPortcaster::notify_relayout(const DjVuImage * source) +DjVuPortcaster::notify_retqlayout(const DjVuImage * source) { GPList<DjVuPort> list; compute_closure(source, list); for(GPosition pos=list; pos; ++pos) - list[pos]->notify_relayout(source); + list[pos]->notify_retqlayout(source); } void @@ -626,7 +626,7 @@ void DjVuPort::notify_redisplay(const DjVuImage *) {} void -DjVuPort::notify_relayout(const DjVuImage *) {} +DjVuPort::notify_retqlayout(const DjVuImage *) {} void DjVuPort::notify_chunk_done(const DjVuPort *, const GUTF8String &) {} diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h index 99c165fb..3e63c901 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h @@ -213,10 +213,10 @@ public: @param source The sender of the request */ virtual void notify_redisplay(const class DjVuImage * source); - /** This notification is sent by \ref{DjVuImage} when its geometry + /** This notification is sent by \ref{DjVuImage} when its tqgeometry has been changed as a result of decoding. It may be used to implement progressive redisplay. */ - virtual void notify_relayout(const class DjVuImage * source); + virtual void notify_retqlayout(const class DjVuImage * source); /** This notification is sent when a new chunk has been decoded. */ virtual void notify_chunk_done(const DjVuPort * source, const GUTF8String &name); @@ -448,7 +448,7 @@ public: /** Computes destination list for #source# and calls the corresponding function in each of the ports from the destination list starting from the closest. */ - virtual void notify_relayout(const class DjVuImage * source); + virtual void notify_retqlayout(const class DjVuImage * source); /** Computes destination list for #source# and calls the corresponding function in each of the ports from the destination list starting from diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp index 5be8cbe7..6b460864 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp @@ -108,8 +108,8 @@ DjVuTXT::Zone::append_child() empty.text_start = 0; empty.text_length = 0; empty.zone_parent=this; - children.append(empty); - return & children[children.lastpos()]; + tqchildren.append(empty); + return & tqchildren[tqchildren.lastpos()]; } void @@ -117,8 +117,8 @@ DjVuTXT::Zone::cleartext() { text_start = 0; text_length = 0; - for (GPosition i=children; i; ++i) - children[i].cleartext(); + for (GPosition i=tqchildren; i; ++i) + tqchildren[i].cleartext(); } void @@ -128,8 +128,8 @@ DjVuTXT::Zone::normtext(const char *instr, GUTF8String &outstr) { // Descend collecting text below text_start = outstr.length(); - for (GPosition i=children; i; ++i) - children[i].normtext(instr, outstr); + for (GPosition i=tqchildren; i; ++i) + tqchildren[i].normtext(instr, outstr); text_length = outstr.length() - text_start; // Ignore empty zones if (text_length == 0) @@ -142,8 +142,8 @@ DjVuTXT::Zone::normtext(const char *instr, GUTF8String &outstr) outstr = outstr + GUTF8String(instr+text_start, text_length); text_start = new_start; // Clear textual information on lower level nodes - for (GPosition i=children; i; ++i) - children[i].cleartext(); + for (GPosition i=tqchildren; i; ++i) + tqchildren[i].cleartext(); } // Determine standard separator char sep; @@ -174,8 +174,8 @@ unsigned int DjVuTXT::Zone::memuse() const { int memuse = sizeof(*this); - for (GPosition i=children; i; ++i) - memuse += children[i].memuse(); + for (GPosition i=tqchildren; i; ++i) + memuse += tqchildren[i].memuse(); return memuse; } @@ -228,15 +228,15 @@ DjVuTXT::Zone::encode( // Encode text info bs.write16(0x8000+start); bs.write24(text_length); - // Encode number of children - bs.write24(children.size()); + // Encode number of tqchildren + bs.write24(tqchildren.size()); const Zone * prev_child=0; - // Encode all children - for (GPosition i=children; i; ++i) + // Encode all tqchildren + for (GPosition i=tqchildren; i; ++i) { - children[i].encode(gbs, this, prev_child); - prev_child=&children[i]; + tqchildren[i].encode(gbs, this, prev_child); + prev_child=&tqchildren[i]; } } #endif @@ -280,16 +280,16 @@ DjVuTXT::Zone::decode(const GP<ByteStream> &gbs, int maxtext, text_start+=parent->text_start; } rect=GRect(x, y, width, height); - // Get children size + // Get tqchildren size int size = bs.read24(); // Checks if (rect.isempty() || text_start<0 || text_start+text_length>maxtext ) G_THROW( ERR_MSG("DjVuText.corrupt_text") ); - // Process children + // Process tqchildren const Zone * prev_child=0; - children.empty(); + tqchildren.empty(); while (size-- > 0) { Zone *z = append_child(); @@ -311,7 +311,7 @@ DjVuTXT::has_valid_zones() const { if (!textUTF8) return false; - if (page_zone.children.isempty() || page_zone.rect.isempty()) + if (page_zone.tqchildren.isempty() || page_zone.rect.isempty()) return false; return true; } @@ -382,7 +382,7 @@ void DjVuTXT::Zone::get_text_with_rect(const GRect &box, int &string_start, int &string_end) const { - GPosition pos=children; + GPosition pos=tqchildren; if(pos?box.contains(rect):intersects_zone(box,rect)) { const int text_end=text_start+text_length; @@ -401,7 +401,7 @@ DjVuTXT::Zone::get_text_with_rect(const GRect &box, { do { - children[pos].get_text_with_rect(box,string_start,string_end); + tqchildren[pos].get_text_with_rect(box,string_start,string_end); } while(++pos); } } @@ -419,18 +419,18 @@ DjVuTXT::Zone::find_zones(GList<Zone *> &list, } else if(text_start < string_end) { - if (children.size()) - for (GPosition pos=children; pos; ++pos) - children[pos].find_zones(list,string_start,string_end); + if (tqchildren.size()) + for (GPosition pos=tqchildren; pos; ++pos) + tqchildren[pos].find_zones(list,string_start,string_end); else list.append(const_cast<Zone *>(this)); } } else if( text_end > string_start) { - if (children.size()) - for (GPosition pos=children; pos; ++pos) - children[pos].find_zones(list,string_start,string_end); + if (tqchildren.size()) + for (GPosition pos=tqchildren; pos; ++pos) + tqchildren[pos].find_zones(list,string_start,string_end); else list.append(const_cast<Zone *>(this)); } @@ -439,11 +439,11 @@ DjVuTXT::Zone::find_zones(GList<Zone *> &list, void DjVuTXT::Zone::get_smallest(GList<GRect> &list) const { - GPosition pos=children; + GPosition pos=tqchildren; if(pos) { do { - children[pos].get_smallest(list); + tqchildren[pos].get_smallest(list); } while (++pos); } else @@ -455,11 +455,11 @@ DjVuTXT::Zone::get_smallest(GList<GRect> &list) const void DjVuTXT::Zone::get_smallest(GList<GRect> &list, const int padding) const { - GPosition pos=children; + GPosition pos=tqchildren; if(pos) { do { - children[pos].get_smallest(list,padding); + tqchildren[pos].get_smallest(list,padding); } while (++pos); } else if(zone_parent && zone_parent->ztype >= PARAGRAPH) @@ -493,17 +493,17 @@ DjVuTXT::get_zones(int zone_type, const Zone *parent, for( int cur_ztype=zone->ztype; cur_ztype<zone_type; ++cur_ztype ) { GPosition pos; - for(pos=zone->children; pos; ++pos) + for(pos=zone->tqchildren; pos; ++pos) { - Zone *zcur=(Zone *)&zone->children[pos]; + Zone *zcur=(Zone *)&zone->tqchildren[pos]; if ( zcur->ztype == zone_type ) { GPosition zpos=zone_list; if ( !zone_list.search(zcur,zpos) ) zone_list.append(zcur); } - else if ( zone->children[pos].ztype < zone_type ) - get_zones(zone_type, &zone->children[pos], zone_list); + else if ( zone->tqchildren[pos].ztype < zone_type ) + get_zones(zone_type, &zone->tqchildren[pos], zone_list); } } } @@ -864,7 +864,7 @@ static void writeText( ByteStream & str_out, const GUTF8String &textUTF8, const DjVuTXT::ZoneType zlayer, - const GList<DjVuTXT::Zone> &children, + const GList<DjVuTXT::Zone> &tqchildren, const int WindowHeight ) { // assert( txt->has_valid_zones() ); @@ -873,12 +873,12 @@ writeText( ByteStream & str_out, // Beginning tags for missing layers int layer=(int)zlayer; // Output the next layer - for(GPosition pos=children ; pos ; ++pos ) + for(GPosition pos=tqchildren ; pos ; ++pos ) { - str_out.writestring(tolayer(layer,children[pos].ztype)); + str_out.writestring(tolayer(layer,tqchildren[pos].ztype)); writeText( str_out, textUTF8, - children[pos], + tqchildren[pos], WindowHeight ); } str_out.writestring(tolayer(layer,zlayer)); @@ -893,7 +893,7 @@ writeText( ByteStream & str_out, // DEBUG_MSG( "--zonetype=" << zone.ztype << "\n" ); const GUTF8String xindent(indent( 2 * zone.ztype + 2 )); - GPosition pos=zone.children; + GPosition pos=zone.tqchildren; // Build attribute string if( ! pos ) { @@ -908,7 +908,7 @@ writeText( ByteStream & str_out, str_out.writestring(end_tag(zone.ztype)); } else { - writeText(str_out,textUTF8,zone.ztype,zone.children,WindowHeight); + writeText(str_out,textUTF8,zone.ztype,zone.tqchildren,WindowHeight); } } @@ -917,7 +917,7 @@ DjVuTXT::writeText(ByteStream &str_out,const int height) const { if(has_valid_zones()) { - ::writeText(str_out,textUTF8,DjVuTXT::PAGE,page_zone.children,height); + ::writeText(str_out,textUTF8,DjVuTXT::PAGE,page_zone.tqchildren,height); }else { str_out.writestring(start_tag(DjVuTXT::PAGE)); diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.h b/kviewshell/plugins/djvu/libdjvu/DjVuText.h index b06536c7..54708324 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuText.h +++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.h @@ -133,8 +133,8 @@ public: int text_start; /** Length of the zone text in string #textUTF8#. */ int text_length; - /** List of children zone. */ - GList<Zone> children; + /** List of tqchildren zone. */ + GList<Zone> tqchildren; /** Appends another subzone inside this zone. The new zone is initialized with an empty rectangle, empty text, and has the same type as this zone. */ diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp index d18c7801..618cb108 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp @@ -953,14 +953,14 @@ print_fg_2layer(ByteStream &str, if (options.get_color()) { write(str,"/%d %d %d %f %f %f c\n", - blit->shapeno, + blit->tqshapeno, blit->left-currentx, blit->bottom-currenty, ramp[p.r]/255.0, ramp[p.g]/255.0, ramp[p.b]/255.0); } else { write(str,"/%d %d %d %f c\n", - blit->shapeno, + blit->tqshapeno, blit->left-currentx, blit->bottom-currenty, ramp[GRAY(p.r, p.g, p.b)]/255.0); } @@ -968,7 +968,7 @@ print_fg_2layer(ByteStream &str, else { write(str,"/%d %d %d s\n", - blit->shapeno, + blit->tqshapeno, blit->left-currentx, blit->bottom-currenty); } currentx = blit->left; @@ -1047,8 +1047,8 @@ print_fg_3layer(ByteStream &str, { JB2Blit *blit = jb2->get_blit(current_blit); GRect rect2(blit->left, blit->bottom, - jb2->get_shape(blit->shapeno).bits->columns(), - jb2->get_shape(blit->shapeno).bits->rows()); + jb2->get_tqshape(blit->tqshapeno).bits->columns(), + jb2->get_tqshape(blit->tqshapeno).bits->rows()); if (rect2.intersect(rect1,rect2)) break; } @@ -1087,12 +1087,12 @@ print_fg_3layer(ByteStream &str, { JB2Blit *blit = jb2->get_blit(current_blit); GRect rect2(blit->left, blit->bottom, - jb2->get_shape(blit->shapeno).bits->columns(), - jb2->get_shape(blit->shapeno).bits->rows()); + jb2->get_tqshape(blit->tqshapeno).bits->columns(), + jb2->get_tqshape(blit->tqshapeno).bits->rows()); if (rect2.intersect(rect1,rect2)) { write(str,"/%d %d %d s\n", - blit->shapeno, + blit->tqshapeno, blit->left-currentx, blit->bottom-currenty); currentx = blit->left; currenty = blit->bottom; @@ -1113,27 +1113,27 @@ print_fg(ByteStream &str, GP<JB2Image> jb2=dimg->get_fgjb(); if (! jb2) return; int num_blits = jb2->get_blit_count(); - int num_shapes = jb2->get_shape_count(); - unsigned char *dict_shapes = 0; + int num_tqshapes = jb2->get_tqshape_count(); + unsigned char *dict_tqshapes = 0; unsigned char *blit_list = 0; - GPBuffer<unsigned char> gdict_shapes(dict_shapes,num_shapes); + GPBuffer<unsigned char> gdict_tqshapes(dict_tqshapes,num_tqshapes); GPBuffer<unsigned char> gblit_list(blit_list,num_blits); - for(int i=0; i<num_shapes; i++) + for(int i=0; i<num_tqshapes; i++) { - dict_shapes[i]=0; + dict_tqshapes[i]=0; } for(int current_blit=0; current_blit<num_blits; current_blit++) { JB2Blit *blit = jb2->get_blit(current_blit); - JB2Shape *shape = & jb2->get_shape(blit->shapeno); + JB2Shape *tqshape = & jb2->get_tqshape(blit->tqshapeno); blit_list[current_blit] = 0; - if (! shape->bits) + if (! tqshape->bits) continue; GRect rect2(blit->left, blit->bottom, - shape->bits->columns(), shape->bits->rows()); + tqshape->bits->columns(), tqshape->bits->rows()); if (rect2.intersect(rect2, prn_rect)) { - dict_shapes[blit->shapeno] = 1; + dict_tqshapes[blit->tqshapeno] = 1; blit_list[current_blit] = 1; } } @@ -1152,13 +1152,13 @@ print_fg(ByteStream &str, "0 1 1 {Encoding exch /.notdef put} for \n" "CharStrings begin\n" "/.notdef {} def\n", - num_shapes+1); - for(int current_shape=0; current_shape<num_shapes; current_shape++) + num_tqshapes+1); + for(int current_tqshape=0; current_tqshape<num_tqshapes; current_tqshape++) { - if (dict_shapes[current_shape]) + if (dict_tqshapes[current_tqshape]) { - JB2Shape *shape = & jb2->get_shape(current_shape); - GP<GBitmap> bitmap = shape->bits; + JB2Shape *tqshape = & jb2->get_tqshape(current_tqshape); + GP<GBitmap> bitmap = tqshape->bits; int rows = bitmap->rows(); int columns = bitmap->columns(); int nbytes = (columns+7)/8*rows+1; @@ -1173,7 +1173,7 @@ print_fg(ByteStream &str, GPBuffer<unsigned char> gs_start(s_start,nbytes); unsigned char *s_ascii; GPBuffer<unsigned char> gs_ascii(s_ascii,nbytes*2); - write(str,"/%d {",current_shape); + write(str,"/%d {",current_tqshape); unsigned char *s = s_start; for(int current_row=0; current_row<rows; current_row++) @@ -1942,8 +1942,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone, default: separator = 0; break; } - // Zone children - if (zone.children.isempty()) + // Zone tqchildren + if (zone.tqchildren.isempty()) { const char *data = (const char*)txt.textUTF8 + zone.text_start; int length = zone.text_length; @@ -1968,8 +1968,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone, message.format("%d F\n",zone.rect.ymax-zone.rect.ymin); out.write((const char*)message,message.length()); } - for (GPosition pos=zone.children; pos; ++pos) - print_txt_sub(txt, zone.children[pos], out,lastx,lasty); + for (GPosition pos=zone.tqchildren; pos; ++pos) + print_txt_sub(txt, zone.tqchildren[pos], out,lastx,lasty); } } diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.h b/kviewshell/plugins/djvu/libdjvu/GBitmap.h index 74669c05..4eef4e2a 100644 --- a/kviewshell/plugins/djvu/libdjvu/GBitmap.h +++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.h @@ -365,7 +365,7 @@ public: discussion, the position is (#x/subsample#,#y/subsample#). In other words, you can position the blit with a sub-pixel resolution. The resulting anti-aliasing changes are paramount to the image quality. */ - void blit(const GBitmap *shape, int x, int y, int subsample); + void blit(const GBitmap *tqshape, int x, int y, int subsample); //@} /** @name Saving images. diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp index 5a85e1fc..ef364e79 100644 --- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp +++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp @@ -953,7 +953,7 @@ static GUTF8String GMapArea2xmltag(const GMapArea &area,const GUTF8String &coords) { GUTF8String retval("<AREA coords=\"" - +coords+"\" shape=\""+area.get_shape_name()+"\" " + +coords+"\" tqshape=\""+area.get_tqshape_name()+"\" " +"alt=\""+area.comment.toEscaped()+"\" "); if(area.url.length()) { diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h index 251427ed..f96c0695 100644 --- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h +++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h @@ -86,12 +86,12 @@ namespace DJVU { The currently supported areas can be rectangular (\Ref{GMapRect}), elliptical (\Ref{GMapOval}) and polygonal (\Ref{GMapPoly}). Every - map area besides the definition of its shape contains information + map area besides the definition of its tqshape contains information about display style and optional {\bf URL}, which it may refer to. If this {\bf URL} is not empty then the map area will work like a hyperlink. - The classes also implement some useful functions to ease geometry + The classes also implement some useful functions to ease tqgeometry manipulations @memo Definition of base map area classes @@ -247,10 +247,10 @@ public: virtual GUTF8String get_xmltag(const int height) const=0; - /// Virtual function returning the shape type. - virtual MapAreaType const get_shape_type( void ) const { return UNKNOWN; }; - /// Virtual function returning the shape name. - virtual char const * const get_shape_name(void) const=0; + /// Virtual function returning the tqshape type. + virtual MapAreaType const get_tqshape_type( void ) const { return UNKNOWN; }; + /// Virtual function returning the tqshape name. + virtual char const * const get_tqshape_name(void) const=0; /// Virtual function generating a copy of this object virtual GP<GMapArea> get_copy(void) const=0; /// Virtual function generating a list of defining coordinates @@ -305,7 +305,7 @@ public: /// Returns the height of the rectangle int get_height(void) const { return ymax-ymin; } - /// Changes the #GMapRect#'s geometry + /// Changes the #GMapRect#'s tqgeometry GMapRect & operator=(const GRect & rect); /// Returns \Ref{GRect} describing the map area's rectangle @@ -313,9 +313,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapRect - virtual MapAreaType const get_shape_type( void ) const { return RECT; }; + virtual MapAreaType const get_tqshape_type( void ) const { return RECT; }; /// Returns #"rect"# - virtual char const * const get_shape_name(void) const; + virtual char const * const get_tqshape_name(void) const; /// Returns a copy of the rectangle virtual GP<GMapArea> get_copy(void) const; /// Virtual function maps rectangle from one area to another using mapper @@ -392,9 +392,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapPoly - virtual MapAreaType const get_shape_type( void ) const { return POLY; }; + virtual MapAreaType const get_tqshape_type( void ) const { return POLY; }; /// Returns #"poly"# all the time - virtual char const * const get_shape_name(void) const; + virtual char const * const get_tqshape_name(void) const; /// Returns a copy of the polygon virtual GP<GMapArea> get_copy(void) const; /// Virtual function generating a list of defining coordinates @@ -458,9 +458,9 @@ public: virtual GUTF8String get_xmltag(const int height) const; /// Returns MapOval - virtual MapAreaType const get_shape_type( void ) const { return OVAL; }; + virtual MapAreaType const get_tqshape_type( void ) const { return OVAL; }; /// Returns #"oval"# - virtual char const * const get_shape_name(void) const; + virtual char const * const get_tqshape_name(void) const; /// Returns a copy of the oval virtual GP<GMapArea> get_copy(void) const; /// Virtual function maps oval from one area to another using mapper @@ -509,7 +509,7 @@ inline char const * const GMapRect::gma_check_object(void) const{ return ""; } inline char const * const -GMapRect::get_shape_name(void) const { return RECT_TAG; } +GMapRect::get_tqshape_name(void) const { return RECT_TAG; } inline int GMapPoly::get_points_num(void) const { return points; } @@ -524,7 +524,7 @@ inline int GMapPoly::get_y(int i) const { return yy[i]; } inline char const * const -GMapPoly::get_shape_name(void) const { return POLY_TAG; } +GMapPoly::get_tqshape_name(void) const { return POLY_TAG; } inline int GMapOval::get_a(void) const { return a; } @@ -551,7 +551,7 @@ inline int GMapOval::gma_get_ymax(void) const { return ymax; } inline char const * const -GMapOval::get_shape_name(void) const { return OVAL_TAG; } +GMapOval::get_tqshape_name(void) const { return OVAL_TAG; } //@} diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp index 2cadf4f9..4ddc297e 100644 --- a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp +++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp @@ -638,7 +638,7 @@ IW44Image::Map::alloc(int n) short ** IW44Image::Map::allocp(int n) { - // Allocate enough room for pointers plus alignment + // Allocate enough room for pointers plus tqalignment short *p = alloc( (n+1) * sizeof(short*) / sizeof(short) ); // Align on pointer size while ( ((long)p) & (sizeof(short*)-1) ) diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.h b/kviewshell/plugins/djvu/libdjvu/IW44Image.h index 56cf00fa..43c14be9 100644 --- a/kviewshell/plugins/djvu/libdjvu/IW44Image.h +++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.h @@ -618,7 +618,7 @@ public: int pixsep=1, int fast=0); // array of blocks IW44Image::Block *blocks; - // geometry + // tqgeometry int iw, ih; int bw, bh; int nb; diff --git a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp index 054d4e09..8abefffe 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp +++ b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp @@ -104,13 +104,13 @@ public: protected: void CodeNum(const int num, const int lo, const int hi, NumContext &ctx); - void encode_libonly_shape(const GP<JB2Image> &jim, int shapeno); + void encode_libonly_tqshape(const GP<JB2Image> &jim, int tqshapeno); // virtual bool CodeBit(const bool bit, BitContext &ctx); void code_comment(GUTF8String &comment); void code_record_type(int &rectype); int code_match_index(int &index, JB2Dict &jim); - void code_inherited_shape_count(JB2Dict &jim); + void code_inherited_tqshape_count(JB2Dict &jim); void code_image_size(JB2Dict &jim); void code_image_size(JB2Image &jim); void code_absolute_location(JB2Blit *jblt, int rows, int columns); @@ -228,18 +228,18 @@ JB2Dict::JB2Codec::Encode::code_record_type(int &rectype) int JB2Dict::JB2Codec::Encode::code_match_index(int &index, JB2Dict &jim) { - int match=shape2lib[index]; - CodeNum(match, 0, lib2shape.hbound(), dist_match_index); + int match=tqshape2lib[index]; + CodeNum(match, 0, lib2tqshape.hbound(), dist_match_index); return match; } // CODE PAIRS void -JB2Dict::JB2Codec::Encode::code_inherited_shape_count(JB2Dict &jim) +JB2Dict::JB2Codec::Encode::code_inherited_tqshape_count(JB2Dict &jim) { - CodeNum(jim.get_inherited_shape_count(), - 0, BIGPOSITIVE, inherited_shape_count_dist); + CodeNum(jim.get_inherited_tqshape_count(), + 0, BIGPOSITIVE, inherited_tqshape_count_dist); } void @@ -360,12 +360,12 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim) // ------------------------- // THIS IS THE ENCODING PART // ------------------------- - int firstshape = jim.get_inherited_shape_count(); - int nshape = jim.get_shape_count(); + int firsttqshape = jim.get_inherited_tqshape_count(); + int ntqshape = jim.get_tqshape_count(); init_library(jim); // Code headers. int rectype = RETQUIRED_DICT_OR_RESET; - if (jim.get_inherited_shape_count() > 0) + if (jim.get_inherited_tqshape_count() > 0) code_record(rectype, gjim, 0); rectype = START_OF_DATA; code_record(rectype, gjim, 0); @@ -373,18 +373,18 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim) rectype = PRESERVED_COMMENT; if (!! jim.comment) code_record(rectype, gjim, 0); - // Encode every shape - int shapeno; - DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nshape-firstshape); - for (shapeno=firstshape; shapeno<nshape; shapeno++) + // Encode every tqshape + int tqshapeno; + DJVU_PROGRESS_TASK(jb2code,"jb2 encode", ntqshape-firsttqshape); + for (tqshapeno=firsttqshape; tqshapeno<ntqshape; tqshapeno++) { - DJVU_PROGRESS_RUN(jb2code, (shapeno-firstshape)|0xff); - // Code shape - JB2Shape &jshp = jim.get_shape(shapeno); + DJVU_PROGRESS_RUN(jb2code, (tqshapeno-firsttqshape)|0xff); + // Code tqshape + JB2Shape &jshp = jim.get_tqshape(tqshapeno); rectype=(jshp.parent >= 0) ?MATCHED_REFINE_LIBRARY_ONLY:NEW_MARK_LIBRARY_ONLY; code_record(rectype, gjim, &jshp); - add_library(shapeno, jshp); + add_library(tqshapeno, jshp); // Check numcoder status if (cur_ncell > CELLCHUNK) { @@ -413,35 +413,35 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) // ------------------------- int i; init_library(jim); - int firstshape = jim.get_inherited_shape_count(); - int nshape = jim.get_shape_count(); + int firsttqshape = jim.get_inherited_tqshape_count(); + int ntqshape = jim.get_tqshape_count(); int nblit = jim.get_blit_count(); - // Initialize shape2lib - shape2lib.resize(0,nshape-1); - for (i=firstshape; i<nshape; i++) - shape2lib[i] = -1; - // Determine shapes that go into library (shapeno>=firstshape) - // shape2lib is -2 if used by one blit - // shape2lib is -3 if used by more than one blit - // shape2lib is -4 if used as a parent + // Initialize tqshape2lib + tqshape2lib.resize(0,ntqshape-1); + for (i=firsttqshape; i<ntqshape; i++) + tqshape2lib[i] = -1; + // Determine tqshapes that go into library (tqshapeno>=firsttqshape) + // tqshape2lib is -2 if used by one blit + // tqshape2lib is -3 if used by more than one blit + // tqshape2lib is -4 if used as a parent for (i=0; i<nblit; i++) { JB2Blit *jblt = jim.get_blit(i); - int shapeno = jblt->shapeno; - if (shapeno < firstshape) + int tqshapeno = jblt->tqshapeno; + if (tqshapeno < firsttqshape) continue; - if (shape2lib[shapeno] >= -2) - shape2lib[shapeno] -= 1; - shapeno = jim.get_shape(shapeno).parent; - while (shapeno>=firstshape && shape2lib[shapeno]>=-3) + if (tqshape2lib[tqshapeno] >= -2) + tqshape2lib[tqshapeno] -= 1; + tqshapeno = jim.get_tqshape(tqshapeno).parent; + while (tqshapeno>=firsttqshape && tqshape2lib[tqshapeno]>=-3) { - shape2lib[shapeno] = -4; - shapeno = jim.get_shape(shapeno).parent; + tqshape2lib[tqshapeno] = -4; + tqshapeno = jim.get_tqshape(tqshapeno).parent; } } // Code headers. int rectype = RETQUIRED_DICT_OR_RESET; - if (jim.get_inherited_shape_count() > 0) + if (jim.get_inherited_tqshape_count() > 0) code_record(rectype, gjim, 0, 0); rectype = START_OF_DATA; code_record(rectype, gjim, 0, 0); @@ -456,20 +456,20 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) { DJVU_PROGRESS_RUN(jb2code, blitno|0xff); JB2Blit *jblt = jim.get_blit(blitno); - int shapeno = jblt->shapeno; - JB2Shape &jshp = jim.get_shape(shapeno); - // Tests if shape exists in library - if (shape2lib[shapeno] >= 0) + int tqshapeno = jblt->tqshapeno; + JB2Shape &jshp = jim.get_tqshape(tqshapeno); + // Tests if tqshape exists in library + if (tqshape2lib[tqshapeno] >= 0) { int rectype = MATCHED_COPY; code_record(rectype, gjim, 0, jblt); } - // Avoid coding null shapes/blits + // Avoid coding null tqshapes/blits else if (jshp.bits) { // Make sure all parents have been coded - if (jshp.parent>=0 && shape2lib[jshp.parent]<0) - encode_libonly_shape(gjim, jshp.parent); + if (jshp.parent>=0 && tqshape2lib[jshp.parent]<0) + encode_libonly_tqshape(gjim, jshp.parent); // Allocate library entry when needed #define LIBRARY_CONTAINS_ALL int libraryp = 0; @@ -478,7 +478,7 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) libraryp = 1; #endif #ifdef LIBRARY_CONTAINS_SHARED // worse - if (shape2lib[shapeno] <= -3) + if (tqshape2lib[tqshapeno] <= -3) libraryp = 1; #endif #ifdef LIBRARY_CONTAINS_ALL // better @@ -500,9 +500,9 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) int rectype = (libraryp ? MATCHED_REFINE : MATCHED_REFINE_IMAGE_ONLY); code_record(rectype, gjim, &jshp, jblt); } - // Add shape to library + // Add tqshape to library if (libraryp) - add_library(shapeno, jshp); + add_library(tqshapeno, jshp); } // Check numcoder status if (cur_ncell > CELLCHUNK) @@ -522,27 +522,27 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim) //////////////////////////////////////// void -JB2Dict::JB2Codec::Encode::encode_libonly_shape( - const GP<JB2Image> &gjim, int shapeno ) +JB2Dict::JB2Codec::Encode::encode_libonly_tqshape( + const GP<JB2Image> &gjim, int tqshapeno ) { if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Image &jim=*gjim; - // Recursively encode parent shape - JB2Shape &jshp = jim.get_shape(shapeno); - if (jshp.parent>=0 && shape2lib[jshp.parent]<0) - encode_libonly_shape(gjim, jshp.parent); - // Test that library shape must be encoded - if (shape2lib[shapeno] < 0) + // Recursively encode parent tqshape + JB2Shape &jshp = jim.get_tqshape(tqshapeno); + if (jshp.parent>=0 && tqshape2lib[jshp.parent]<0) + encode_libonly_tqshape(gjim, jshp.parent); + // Test that library tqshape must be encoded + if (tqshape2lib[tqshapeno] < 0) { // Code library entry int rectype=(jshp.parent >= 0) ?NEW_MARK_LIBRARY_ONLY:MATCHED_REFINE_LIBRARY_ONLY; code_record(rectype, gjim, &jshp, 0); - // Add shape to library - add_library(shapeno, jshp); + // Add tqshape to library + add_library(tqshapeno, jshp); // Check numcoder status if (cur_ncell > CELLCHUNK) { diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp index bbc06623..7cd8a46e 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp +++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp @@ -110,7 +110,7 @@ protected: void code_comment(GUTF8String &comment); void code_record_type(int &rectype); int code_match_index(int &index, JB2Dict &jim); - void code_inherited_shape_count(JB2Dict &jim); + void code_inherited_tqshape_count(JB2Dict &jim); void code_image_size(JB2Dict &jim); void code_image_size(JB2Image &jim); void code_absolute_location(JB2Blit *jblt, int rows, int columns); @@ -136,28 +136,28 @@ private: JB2Dict::JB2Dict() - : inherited_shapes(0) + : inherited_tqshapes(0) { } void JB2Dict::init() { - inherited_shapes = 0; + inherited_tqshapes = 0; inherited_dict = 0; - shapes.empty(); + tqshapes.empty(); } JB2Shape & -JB2Dict::get_shape(const int shapeno) +JB2Dict::get_tqshape(const int tqshapeno) { JB2Shape *retval; - if(shapeno >= inherited_shapes) + if(tqshapeno >= inherited_tqshapes) { - retval=&shapes[shapeno - inherited_shapes]; + retval=&tqshapes[tqshapeno - inherited_tqshapes]; }else if(inherited_dict) { - retval=&(inherited_dict->get_shape(shapeno)); + retval=&(inherited_dict->get_tqshape(tqshapeno)); }else { G_THROW( ERR_MSG("JB2Image.bad_number") ); @@ -166,15 +166,15 @@ JB2Dict::get_shape(const int shapeno) } const JB2Shape & -JB2Dict::get_shape(const int shapeno) const +JB2Dict::get_tqshape(const int tqshapeno) const { const JB2Shape *retval; - if(shapeno >= inherited_shapes) + if(tqshapeno >= inherited_tqshapes) { - retval=&shapes[shapeno - inherited_shapes]; + retval=&tqshapes[tqshapeno - inherited_tqshapes]; }else if(inherited_dict) { - retval=&(inherited_dict->get_shape(shapeno)); + retval=&(inherited_dict->get_tqshape(tqshapeno)); }else { G_THROW( ERR_MSG("JB2Image.bad_number") ); @@ -185,16 +185,16 @@ JB2Dict::get_shape(const int shapeno) const void JB2Dict::set_inherited_dict(const GP<JB2Dict> &dict) { - if (shapes.size() > 0) + if (tqshapes.size() > 0) G_THROW( ERR_MSG("JB2Image.cant_set") ); if (inherited_dict) G_THROW( ERR_MSG("JB2Image.cant_change") ); inherited_dict = dict; - inherited_shapes = dict->get_shape_count(); + inherited_tqshapes = dict->get_tqshape_count(); // Make sure that inherited bitmaps are marked as shared - for (int i=0; i<inherited_shapes; i++) + for (int i=0; i<inherited_tqshapes; i++) { - JB2Shape &jshp = dict->get_shape(i); + JB2Shape &jshp = dict->get_tqshape(i); if (jshp.bits) jshp.bits->share(); } } @@ -202,30 +202,30 @@ JB2Dict::set_inherited_dict(const GP<JB2Dict> &dict) void JB2Dict::compress() { - for (int i=shapes.lbound(); i<=shapes.hbound(); i++) - shapes[i].bits->compress(); + for (int i=tqshapes.lbound(); i<=tqshapes.hbound(); i++) + tqshapes[i].bits->compress(); } unsigned int JB2Dict::get_memory_usage() const { unsigned int usage = sizeof(JB2Dict); - usage += sizeof(JB2Shape) * shapes.size(); - for (int i=shapes.lbound(); i<=shapes.hbound(); i++) - if (shapes[i].bits) - usage += shapes[i].bits->get_memory_usage(); + usage += sizeof(JB2Shape) * tqshapes.size(); + for (int i=tqshapes.lbound(); i<=tqshapes.hbound(); i++) + if (tqshapes[i].bits) + usage += tqshapes[i].bits->get_memory_usage(); return usage; } int -JB2Dict::add_shape(const JB2Shape &shape) +JB2Dict::add_tqshape(const JB2Shape &tqshape) { - if (shape.parent >= get_shape_count()) - G_THROW( ERR_MSG("JB2Image.bad_parent_shape") ); - int index = shapes.size(); - shapes.touch(index); - shapes[index] = shape; - return index + inherited_shapes; + if (tqshape.parent >= get_tqshape_count()) + G_THROW( ERR_MSG("JB2Image.bad_parent_tqshape") ); + int index = tqshapes.size(); + tqshapes.touch(index); + tqshapes[index] = tqshape; + return index + inherited_tqshapes; } void @@ -277,8 +277,8 @@ JB2Image::set_dimension(int awidth, int aheight) int JB2Image::add_blit(const JB2Blit &blit) { - if (blit.shapeno >= (unsigned int)get_shape_count()) - G_THROW( ERR_MSG("JB2Image.bad_shape") ); + if (blit.tqshapeno >= (unsigned int)get_tqshape_count()) + G_THROW( ERR_MSG("JB2Image.bad_tqshape") ); int index = blits.size(); blits.touch(index); blits[index] = blit; @@ -298,9 +298,9 @@ JB2Image::get_bitmap(int subsample, int align) const for (int blitno = 0; blitno < get_blit_count(); blitno++) { const JB2Blit *pblit = get_blit(blitno); - const JB2Shape &pshape = get_shape(pblit->shapeno); - if (pshape.bits) - bm->blit(pshape.bits, pblit->left, pblit->bottom, subsample); + const JB2Shape &ptqshape = get_tqshape(pblit->tqshapeno); + if (ptqshape.bits) + bm->blit(ptqshape.bits, pblit->left, pblit->bottom, subsample); } return bm; } @@ -320,9 +320,9 @@ JB2Image::get_bitmap(const GRect &rect, int subsample, int align, int dispy) con for (int blitno = 0; blitno < get_blit_count(); blitno++) { const JB2Blit *pblit = get_blit(blitno); - const JB2Shape &pshape = get_shape(pblit->shapeno); - if (pshape.bits) - bm->blit(pshape.bits, pblit->left-rxmin, pblit->bottom-rymin+dispy, subsample); + const JB2Shape &ptqshape = get_tqshape(pblit->tqshapeno); + if (ptqshape.bits) + bm->blit(ptqshape.bits, pblit->left-rxmin, pblit->bottom-rymin+dispy, subsample); } return bm; } @@ -397,7 +397,7 @@ JB2Dict::JB2Codec::JB2Codec(const bool xencoding) abs_size_x(0), abs_size_y(0), image_size_dist(0), - inherited_shape_count_dist(0), + inherited_tqshape_count_dist(0), offset_type_dist(0), rel_loc_x_current(0), rel_loc_x_last(0), @@ -428,7 +428,7 @@ JB2Dict::JB2Codec::reset_numcoder() abs_size_x = 0; abs_size_y = 0; image_size_dist = 0; - inherited_shape_count_dist = 0; + inherited_tqshape_count_dist = 0; rel_loc_x_current = 0; rel_loc_x_last = 0; rel_loc_y_current = 0; @@ -573,27 +573,27 @@ JB2Dict::JB2Codec::Decode::code_comment(GUTF8String &comment) void JB2Dict::JB2Codec::init_library(JB2Dict &jim) { - int nshape = jim.get_inherited_shape_count(); - shape2lib.resize(0,nshape-1); - lib2shape.resize(0,nshape-1); - libinfo.resize(0,nshape-1); - for (int i=0; i<nshape; i++) + int ntqshape = jim.get_inherited_tqshape_count(); + tqshape2lib.resize(0,ntqshape-1); + lib2tqshape.resize(0,ntqshape-1); + libinfo.resize(0,ntqshape-1); + for (int i=0; i<ntqshape; i++) { - shape2lib[i] = i; - lib2shape[i] = i; - JB2Shape &jshp = jim.get_shape(i); + tqshape2lib[i] = i; + lib2tqshape[i] = i; + JB2Shape &jshp = jim.get_tqshape(i); libinfo[i].compute_bounding_box(*(jshp.bits)); } } int -JB2Dict::JB2Codec::add_library(const int shapeno, JB2Shape &jshp) +JB2Dict::JB2Codec::add_library(const int tqshapeno, JB2Shape &jshp) { - const int libno = lib2shape.hbound() + 1; - lib2shape.touch(libno); - lib2shape[libno] = shapeno; - shape2lib.touch(shapeno); - shape2lib[shapeno] = libno; + const int libno = lib2tqshape.hbound() + 1; + lib2tqshape.touch(libno); + lib2tqshape[libno] = tqshapeno; + tqshape2lib.touch(tqshapeno); + tqshape2lib[tqshapeno] = libno; libinfo.touch(libno); libinfo[libno].compute_bounding_box(*(jshp.bits)); return libno; @@ -611,8 +611,8 @@ JB2Dict::JB2Codec::Decode::code_record_type(int &rectype) int JB2Dict::JB2Codec::Decode::code_match_index(int &index, JB2Dict &) { - int match=CodeNum(0, lib2shape.hbound(), dist_match_index); - index = lib2shape[match]; + int match=CodeNum(0, lib2tqshape.hbound(), dist_match_index); + index = lib2tqshape[match]; return match; } @@ -638,9 +638,9 @@ JB2Dict::JB2Codec::update_short_list(const int v) void -JB2Dict::JB2Codec::Decode::code_inherited_shape_count(JB2Dict &jim) +JB2Dict::JB2Codec::Decode::code_inherited_tqshape_count(JB2Dict &jim) { - int size=CodeNum(0, BIGPOSITIVE, inherited_shape_count_dist); + int size=CodeNum(0, BIGPOSITIVE, inherited_tqshape_count_dist); { GP<JB2Dict> dict = jim.get_inherited_dict(); if (!dict && size>0) @@ -653,7 +653,7 @@ JB2Dict::JB2Codec::Decode::code_inherited_shape_count(JB2Dict &jim) } if (!dict && size>0) G_THROW( ERR_MSG("JB2Image.need_dict") ); - if (dict && size!=dict->get_shape_count()) + if (dict && size!=dict->get_tqshape_count()) G_THROW( ERR_MSG("JB2Image.bad_dict") ); } } @@ -927,7 +927,7 @@ JB2Dict::JB2Codec::code_record( { GP<GBitmap> cbm; GP<GBitmap> bm; - int shapeno = -1; + int tqshapeno = -1; // Code record type code_record_type(rectype); @@ -983,7 +983,7 @@ JB2Dict::JB2Codec::code_record( JB2Dict &jim=*gjim; JB2Shape &jshp=*xjshp; int match = code_match_index (jshp.parent, jim); - cbm = jim.get_shape(jshp.parent).bits; + cbm = jim.get_tqshape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, jshp.parent); @@ -1003,12 +1003,12 @@ JB2Dict::JB2Codec::code_record( { if (! gotstartrecordp) { - // Indicates need for a shape dictionary + // Indicates need for a tqshape dictionary if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } - code_inherited_shape_count(*gjim); + code_inherited_tqshape_count(*gjim); }else // Reset all numerical contexts to zero reset_numcoder(); @@ -1026,7 +1026,7 @@ JB2Dict::JB2Codec::code_record( // Post-coding action if (!encoding) { - // add shape to dictionary + // add tqshape to dictionary switch(rectype) { case NEW_MARK_LIBRARY_ONLY: @@ -1037,8 +1037,8 @@ JB2Dict::JB2Codec::code_record( G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Shape &jshp=*xjshp; - shapeno = gjim->add_shape(jshp); - add_library(shapeno, jshp); + tqshapeno = gjim->add_tqshape(jshp); + add_library(tqshapeno, jshp); break; } } @@ -1064,10 +1064,10 @@ JB2Dict::JB2Codec::Decode::code(const GP<JB2Dict> &gjim) // THIS IS THE DECODING PART // ------------------------- int rectype; - JB2Shape tmpshape; + JB2Shape tmptqshape; do { - code_record(rectype, gjim, &tmpshape); + code_record(rectype, gjim, &tmptqshape); } while(rectype != END_OF_DATA); if (!gotstartrecordp) @@ -1085,7 +1085,7 @@ JB2Dict::JB2Codec::code_record( { GP<GBitmap> bm; GP<GBitmap> cbm; - int shapeno = -1; + int tqshapeno = -1; int match; // Code record type @@ -1163,7 +1163,7 @@ JB2Dict::JB2Codec::code_record( JB2Shape &jshp=*xjshp; JB2Image &jim=*gjim; match = code_match_index (jshp.parent, jim); - cbm = jim.get_shape(jshp.parent).bits; + cbm = jim.get_tqshape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, match); @@ -1179,7 +1179,7 @@ JB2Dict::JB2Codec::code_record( JB2Image &jim=*gjim; JB2Shape &jshp=*xjshp; match = code_match_index (jshp.parent, jim); - cbm = jim.get_shape(jshp.parent).bits; + cbm = jim.get_tqshape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); break; @@ -1193,7 +1193,7 @@ JB2Dict::JB2Codec::code_record( JB2Image &jim=*gjim; JB2Shape &jshp=*xjshp; match = code_match_index (jshp.parent, jim); - cbm = jim.get_shape(jshp.parent).bits; + cbm = jim.get_tqshape(jshp.parent).bits; LibRect &l = libinfo[match]; code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); code_bitmap_by_cross_coding (*bm, cbm, match); @@ -1203,15 +1203,15 @@ JB2Dict::JB2Codec::code_record( case MATCHED_COPY: { int temp; - if (encoding) temp = jblt->shapeno; + if (encoding) temp = jblt->tqshapeno; if(!gjim) { G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Image &jim=*gjim; match = code_match_index (temp, jim); - if (!encoding) jblt->shapeno = temp; - bm = jim.get_shape(jblt->shapeno).bits; + if (!encoding) jblt->tqshapeno = temp; + bm = jim.get_tqshape(jblt->tqshapeno).bits; LibRect &l = libinfo[match]; jblt->left += l.left; jblt->bottom += l.bottom; @@ -1248,8 +1248,8 @@ JB2Dict::JB2Codec::code_record( } JB2Image &jim=*gjim; if (! gotstartrecordp) - // Indicates need for a shape dictionary - code_inherited_shape_count(jim); + // Indicates need for a tqshape dictionary + code_inherited_tqshape_count(jim); else // Reset all numerical contexts to zero reset_numcoder(); @@ -1268,7 +1268,7 @@ JB2Dict::JB2Codec::code_record( // Post-coding action if (!encoding) { - // add shape to image + // add tqshape to image switch(rectype) { case NEW_MARK: @@ -1284,13 +1284,13 @@ JB2Dict::JB2Codec::code_record( G_THROW( ERR_MSG("JB2Image.bad_number") ); } JB2Shape &jshp=*xjshp; - shapeno = gjim->add_shape(jshp); - shape2lib.touch(shapeno); - shape2lib[shapeno] = -1; + tqshapeno = gjim->add_tqshape(jshp); + tqshape2lib.touch(tqshapeno); + tqshape2lib[tqshapeno] = -1; break; } } - // add shape to library + // add tqshape to library switch(rectype) { case NEW_MARK: @@ -1301,7 +1301,7 @@ JB2Dict::JB2Codec::code_record( { G_THROW( ERR_MSG("JB2Image.bad_number") ); } - add_library(shapeno, *xjshp); + add_library(tqshapeno, *xjshp); break; } // make sure everything is compacted @@ -1316,7 +1316,7 @@ JB2Dict::JB2Codec::code_record( case MATCHED_REFINE: case MATCHED_REFINE_IMAGE_ONLY: case NON_MARK_DATA: - jblt->shapeno = shapeno; + jblt->tqshapeno = tqshapeno; case MATCHED_COPY: if(!gjim) { @@ -1344,10 +1344,10 @@ JB2Dict::JB2Codec::Decode::code(const GP<JB2Image> &gjim) // ------------------------- int rectype; JB2Blit tmpblit; - JB2Shape tmpshape; + JB2Shape tmptqshape; do { - code_record(rectype, gjim, &tmpshape, &tmpblit); + code_record(rectype, gjim, &tmptqshape, &tmpblit); } while(rectype!=END_OF_DATA); if (!gotstartrecordp) diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.h b/kviewshell/plugins/djvu/libdjvu/JB2Image.h index 6733e9f5..0cf9da47 100644 --- a/kviewshell/plugins/djvu/libdjvu/JB2Image.h +++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.h @@ -83,47 +83,47 @@ be implemented in the future. {\bf JB2 Images} --- Class \Ref{JB2Image} is the central data structure - implemented here. A #JB2Image# is composed of an array of shapes - and an array of blits. Each shape contains a small bitmap representing an + implemented here. A #JB2Image# is composed of an array of tqshapes + and an array of blits. Each tqshape contains a small bitmap representing an elementary blob of ink, such as a character or a segment of line art. - Each blit instructs the decoder to render a particular shape at a + Each blit instructs the decoder to render a particular tqshape at a specified position in the image. Some compression is already achieved - because several blits can refer to the same shape. A shape can also - contain a pointer to a parent shape. Additional compression is achieved - when both shapes are similar because each shape is encoded using the - parent shape as a model. A #"O"# shape for instance could be a parent for - both a #"C"# shape and a #"Q"# shape. + because several blits can refer to the same tqshape. A tqshape can also + contain a pointer to a parent tqshape. Additional compression is achieved + when both tqshapes are similar because each tqshape is encoded using the + parent tqshape as a model. A #"O"# tqshape for instance could be a parent for + both a #"C"# tqshape and a #"Q"# tqshape. {\bf JB2 Dictionary} --- Class \Ref{JB2Dict} is a peculiar kind of - JB2Image which only contains an array of shapes. These shapes can be + JB2Image which only contains an array of tqshapes. These tqshapes can be referenced from another JB2Dict/JB2Image. This is arranged by setting the ``inherited dictionary'' of a JB2Dict/JB2Image using function - \Ref{JB2Dict::set_inherited_dict}. Several JB2Images can use shapes from a + \Ref{JB2Dict::set_inherited_dict}. Several JB2Images can use tqshapes from a same JB2Dict encoded separately. This is how several pages of a same document can share information. {\bf Decoding JB2 data} --- The first step for decoding JB2 data consists of creating an empty #JB2Image# object. Function \Ref{JB2Image::decode} then - reads the data and populates the #JB2Image# with the shapes and the blits. + reads the data and populates the #JB2Image# with the tqshapes and the blits. Function \Ref{JB2Image::get_bitmap} finally produces an anti-aliased image. {\bf Encoding JB2 data} --- The first step for decoding JB2 data also consists of creating an empty #JB2Image# object. You must then use - functions \Ref{JB2Image::add_shape} and \Ref{JB2Image::add_blit} to + functions \Ref{JB2Image::add_tqshape} and \Ref{JB2Image::add_blit} to populate the #JB2Image# object. Function \Ref{JB2Image::encode} finally produces the JB2 data. Function #encode# sequentially encodes the blits - and the necessary shapes. The compression ratio depends on several + and the necessary tqshapes. The compression ratio depends on several factors: \begin{itemize} - \item Blits should reuse shapes as often as possible. + \item Blits should reuse tqshapes as often as possible. \item Blits should be sorted in reading order because this facilitates the prediction of the blit coordinates. \item Shapes should be sorted according to the order of first appearance in the sequence of blits because this facilitates the prediction of the - shape indices. - \item Shapes should be compared to all previous shapes in the shape array. - The shape parent pointer should be set to a suitable parent shape if - such a parent shape exists. The parent shape should have almost the + tqshape indices. + \item Shapes should be compared to all previous tqshapes in the tqshape array. + The tqshape parent pointer should be set to a suitable parent tqshape if + such a parent tqshape exists. The parent tqshape should have almost the same size and the same pixels. \end{itemize} All this is quite easy to achieve in the case of an electronically @@ -131,16 +131,16 @@ characters are and where they are located. If you only have a scanned image however you must first locate the characters (connected component analysis) and cut the remaining pieces of ink into smaller blobs. - Ordering the blits and matching the shapes is then an essentially + Ordering the blits and matching the tqshapes is then an essentially heuristic process. Although the quality of the heuristics substantially - effects the file size, misordering blits or mismatching shapes never + effects the file size, misordering blits or mismatching tqshapes never effects the quality of the image. The last refinement consists in - smoothing the shapes in order to reduce the noise and maximize the - similarities between shapes. + smoothing the tqshapes in order to reduce the noise and maximize the + similarities between tqshapes. {\bf JB2 extensions} --- Two extensions of the JB2 encoding format have been introduced with DjVu files version 21. The first - extension addresses the shared shape dictionaries. The second extension + extension addresses the shared tqshape dictionaries. The second extension bounds the number of probability contexts used for coding numbers. Both extensions maintain backward compatibility with JB2 as described in the ICFDD proposal. A more complete discussion @@ -190,10 +190,10 @@ class ByteStream; /** Blit data structure. A #JB2Image# contains an array of #JB2Blit# data structures. Each array entry instructs the decoder to render a particular - shape at a particular location. Members #left# and #bottom# specify the - coordinates of the bottom left corner of the shape bitmap. All + tqshape at a particular location. Members #left# and #bottom# specify the + coordinates of the bottom left corner of the tqshape bitmap. All coordinates are relative to the bottom left corner of the image. Member - #shapeno# is the subscript of the shape to be rendered. */ + #tqshapeno# is the subscript of the tqshape to be rendered. */ class JB2Blit { public: @@ -201,31 +201,31 @@ public: unsigned short left; /**Qt::Vertical coordinate of the blit. */ unsigned short bottom; - /** Index of the shape to blit. */ - unsigned int shapeno; + /** Index of the tqshape to blit. */ + unsigned int tqshapeno; }; /** Shape data structure. A #JB2Image# contains an array of #JB2Shape# data structures. Each array entry represents an elementary blob of ink such as a character or a segment of line art. Member #bits# points to a bilevel - image representing the shape pixels. Member #parent# is the subscript of - the parent shape. */ + image representing the tqshape pixels. Member #parent# is the subscript of + the parent tqshape. */ class JB2Shape { public: - /** Subscript of the parent shape. The parent shape must always be located - before the current shape in the shape array. A negative value indicates + /** Subscript of the parent tqshape. The parent tqshape must always be located + before the current tqshape in the tqshape array. A negative value indicates that this shape.has no parent. Any negative values smaller than #-1# - further indicates that this shape does not look like a character. This + further indicates that this tqshape does not look like a character. This is used to enable a few internal optimizations. This information is saved into the JB2 file, but the actual value of the #parent# variable is not. */ int parent; - /** Bilevel image of the shape pixels. This must be a pointer to a bilevel + /** Bilevel image of the tqshape pixels. This must be a pointer to a bilevel #GBitmap# image. This pointer can also be null. The encoder will just - silently discard all blits referring to a shape containing a null + silently discard all blits referring to a tqshape containing a null bitmap. */ GP<GBitmap> bits; /** Private user data. This long word is provided as a convenience for users @@ -238,14 +238,14 @@ public: /** JB2 Dictionary callback. The decoding function call this callback function when they discover that - the current JB2Image or JB2Dict needs a pre-existing shape dictionary. + the current JB2Image or JB2Dict needs a pre-existing tqshape dictionary. The callback function must return a pointer to the dictionary or NULL if none is found. */ typedef GP<JB2Dict> JB2DecoderCallback ( void* ); -/** Dictionary of JB2 shapes. */ +/** Dictionary of JB2 tqshapes. */ class JB2Dict : public GPEnabled { @@ -257,43 +257,43 @@ public: // CONSTRUCTION /** Default creator. Constructs an empty #JB2Dict# object. You can then call the decoding function #decode#. You can also manually set the - image size using #add_shape#. */ + image size using #add_tqshape#. */ static GP<JB2Dict> create(void); // INITIALIZATION - /** Resets the #JB2Image# object. This function reinitializes both the shape + /** Resets the #JB2Image# object. This function reinitializes both the tqshape and the blit arrays. All allocated memory is freed. */ void init(void); // INHERITED /** Returns the inherited dictionary. */ GP<JB2Dict> get_inherited_dict(void) const; - /** Returns the number of inherited shapes. */ - int get_inherited_shape_count(void) const; + /** Returns the number of inherited tqshapes. */ + int get_inherited_tqshape_count(void) const; /** Sets the inherited dictionary. */ void set_inherited_dict(const GP<JB2Dict> &dict); // ACCESSING THE SHAPE LIBRARY - /** Returns the total number of shapes. - Shape indices range from #0# to #get_shape_count()-1#. */ - int get_shape_count(void) const; - /** Returns a pointer to shape #shapeno#. - The returned pointer directly points into the shape array. - This pointer can be used for reading or writing the shape data. */ - JB2Shape &get_shape(const int shapeno); - /** Returns a constant pointer to shape #shapeno#. - The returned pointer directly points into the shape array. - This pointer can only be used for reading the shape data. */ - const JB2Shape &get_shape(const int shapeno) const; - /** Appends a shape to the shape array. This function appends a copy of - shape #shape# to the shape array and returns the subscript of the new - shape. The subscript of the parent shape #shape.parent# must - actually designate an already existing shape. */ - int add_shape(const JB2Shape &shape); + /** Returns the total number of tqshapes. + Shape indices range from #0# to #get_tqshape_count()-1#. */ + int get_tqshape_count(void) const; + /** Returns a pointer to tqshape #tqshapeno#. + The returned pointer directly points into the tqshape array. + This pointer can be used for reading or writing the tqshape data. */ + JB2Shape &get_tqshape(const int tqshapeno); + /** Returns a constant pointer to tqshape #tqshapeno#. + The returned pointer directly points into the tqshape array. + This pointer can only be used for reading the tqshape data. */ + const JB2Shape &get_tqshape(const int tqshapeno) const; + /** Appends a tqshape to the tqshape array. This function appends a copy of + tqshape #tqshape# to the tqshape array and returns the subscript of the new + tqshape. The subscript of the parent tqshape #tqshape.parent# must + actually designate an already existing tqshape. */ + int add_tqshape(const JB2Shape &tqshape); // MEMORY OPTIMIZATION - /** Compresses all shape bitmaps. This function reduces the memory required - by the #JB2Image# by calling \Ref{GBitmap::compress} on all shapes + /** Compresses all tqshape bitmaps. This function reduces the memory required + by the #JB2Image# by calling \Ref{GBitmap::compress} on all tqshapes bitmaps. This function is best called after decoding a #JB2Image#, because function \Ref{get_bitmap} can directly use the compressed bitmaps. */ @@ -307,9 +307,9 @@ public: This function generates the JB2 data stream without any header. */ void encode(const GP<ByteStream> &gbs) const; /** Decodes JB2 data from ByteStream #bs#. This function decodes the image - size and populates the shape and blit arrays. The callback function + size and populates the tqshape and blit arrays. The callback function #cb# is called when the decoder determines that the ByteStream data - requires a shape dictionary which has not been set with + requires a tqshape dictionary which has not been set with \Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg# and must return a suitable dictionary which will be installed as the inherited dictionary. The callback should return null if no such @@ -322,15 +322,15 @@ public: GUTF8String comment; private: - int inherited_shapes; + int inherited_tqshapes; GP<JB2Dict> inherited_dict; - GArray<JB2Shape> shapes; + GArray<JB2Shape> tqshapes; }; -/** Main JB2 data structure. Each #JB2Image# consists of an array of shapes +/** Main JB2 data structure. Each #JB2Image# consists of an array of tqshapes and an array of blits. These arrays can be populated by hand using - functions \Ref{add_shape} and \Ref{add_blit}, or by decoding JB2 data + functions \Ref{add_tqshape} and \Ref{add_blit}, or by decoding JB2 data using function \Ref{decode}. You can then use function \Ref{get_bitmap} to render anti-aliased images, or use function \Ref{encode} to generate JB2 data. */ @@ -343,12 +343,12 @@ public: /** Creates an empty #JB2Image# object. You can then call the decoding function #decode#. You can also manually set the - image size using #set_dimension# and populate the shape and blit arrays - using #add_shape# and #add_blit#. */ + image size using #set_dimension# and populate the tqshape and blit arrays + using #add_tqshape# and #add_blit#. */ static GP<JB2Image> create(void) { return new JB2Image(); } // INITIALIZATION - /** Resets the #JB2Image# object. This function reinitializes both the shape + /** Resets the #JB2Image# object. This function reinitializes both the tqshape and the blit arrays. All allocated memory is freed. */ void init(void); @@ -370,7 +370,7 @@ public: JB2Image as a bilevel or gray level image. Argument #subsample# specifies the desired subsampling ratio in range #1# to #15#. The returned image uses #1+subsample^2# gray levels for representing - anti-aliased edges. Argument #align# specified the alignment of the + anti-aliased edges. Argument #align# specified the tqalignment of the rows of the returned images. Setting #align# to #4#, for instance, will adjust the bitmap border in order to make sure that each row of the returned image starts on a word (four byte) boundary. */ @@ -380,7 +380,7 @@ public: this function first renders the full JB2Image with subsampling ratio #subsample# and then extracts rectangle #rect# in the subsampled image. Both operations of course are efficiently performed simultaneously. - Argument #align# specified the alignment of the rows of the returned + Argument #align# specified the tqalignment of the rows of the returned images, as explained above. Argument #dispy# should remain null. */ GP<GBitmap> get_bitmap(const GRect &rect, int subsample=1, int align=1, int dispy=0) const; @@ -393,13 +393,13 @@ public: This pointer can be used for reading or writing the blit data. */ JB2Blit *get_blit(int blitno); /** Returns a constant pointer to blit #blitno#. - The returned pointer directly points into the shape array. - This pointer can only be used for reading the shape data. */ + The returned pointer directly points into the tqshape array. + This pointer can only be used for reading the tqshape data. */ const JB2Blit *get_blit(int blitno) const; /** Appends a blit to the blit array. This function appends a copy of blit #blit# to the blit array and returns the subscript of the new blit. The - shape subscript #blit.shapeno# must actually designate an already - existing shape. */ + tqshape subscript #blit.tqshapeno# must actually designate an already + existing tqshape. */ int add_blit(const JB2Blit &blit); // MEMORY OPTIMIZATION @@ -412,9 +412,9 @@ public: This function generates the JB2 data stream without any header. */ void encode(const GP<ByteStream> &gbs) const; /** Decodes JB2 data from ByteStream #bs#. This function decodes the image - size and populates the shape and blit arrays. The callback function + size and populates the tqshape and blit arrays. The callback function #cb# is called when the decoder determines that the ByteStream data - requires a shape dictionary which has not been set with + requires a tqshape dictionary which has not been set with \Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg# and must return a suitable dictionary which will be installed as the inherited dictionary. The callback should return null if no such @@ -438,15 +438,15 @@ public: // JB2DICT INLINE FUNCTIONS inline int -JB2Dict::get_shape_count(void) const +JB2Dict::get_tqshape_count(void) const { - return inherited_shapes + shapes.size(); + return inherited_tqshapes + tqshapes.size(); } inline int -JB2Dict::get_inherited_shape_count(void) const +JB2Dict::get_inherited_tqshape_count(void) const { - return inherited_shapes; + return inherited_tqshapes; } inline GP<JB2Dict> @@ -612,7 +612,7 @@ protected: void reset_numcoder(void); inline void code_eventual_lossless_refinement(void); void init_library(JB2Dict &jim); - int add_library(const int shapeno, JB2Shape &jshp); + int add_library(const int tqshapeno, JB2Shape &jshp); void code_relative_location(JB2Blit *jblt, int rows, int columns); void code_bitmap_directly (GBitmap &bm); void code_bitmap_by_cross_coding (GBitmap &bm, GP<GBitmap> &cbm, const int libno); @@ -640,7 +640,7 @@ protected: virtual void code_comment(GUTF8String &comment) = 0; virtual void code_record_type(int &rectype) = 0; virtual int code_match_index(int &index, JB2Dict &jim)=0; - virtual void code_inherited_shape_count(JB2Dict &jim)=0; + virtual void code_inherited_tqshape_count(JB2Dict &jim)=0; virtual void code_image_size(JB2Dict &jim); virtual void code_image_size(JB2Image &jim); virtual void code_absolute_location(JB2Blit *jblt, int rows, int columns)=0; @@ -678,8 +678,8 @@ protected: NumContext dist_match_index; BitContext dist_refinement_flag; // Library - GTArray<int> shape2lib; - GTArray<int> lib2shape; + GTArray<int> tqshape2lib; + GTArray<int> lib2tqshape; GTArray<LibRect> libinfo; // Code pairs NumContext abs_loc_x; @@ -687,7 +687,7 @@ protected: NumContext abs_size_x; NumContext abs_size_y; NumContext image_size_dist; - NumContext inherited_shape_count_dist; + NumContext inherited_tqshape_count_dist; BitContext offset_type_dist; NumContext rel_loc_x_current; NumContext rel_loc_x_last; diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp index f0185bc8..5d3d62ef 100644 --- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp +++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp @@ -933,16 +933,16 @@ MMRDecoder::decode(GP<ByteStream> gbs) // Insert blocks into JB2Image for (int b=0; b<blocksperline; b++) { - JB2Shape shape; - shape.bits = blocks[b]; - if (shape.bits) + JB2Shape tqshape; + tqshape.bits = blocks[b]; + if (tqshape.bits) { - shape.parent = -1; - shape.bits->compress(); + tqshape.parent = -1; + tqshape.bits->compress(); JB2Blit blit; blit.left = b*blocksize; blit.bottom = line+1; - blit.shapeno = jimg->add_shape(shape); + blit.tqshapeno = jimg->add_tqshape(tqshape); jimg->add_blit(blit); } } diff --git a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp index b1d9f469..0c39a745 100644 --- a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp +++ b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp @@ -373,20 +373,20 @@ lt_XMLParser::Impl::ChangeAnno( } } } - GUTF8String shape; + GUTF8String tqshape; { - GPosition shape_pos=args.contains("shape"); - if(shape_pos) + GPosition tqshape_pos=args.contains("tqshape"); + if(tqshape_pos) { - shape=args[shape_pos]; + tqshape=args[tqshape_pos]; } } GP<GMapArea> a; - if(shape == "default") + if(tqshape == "default") { GRect rect(0,0,w,h); a=GMapRect::create(rect); - }else if(!shape.length() || shape == "rect") + }else if(!tqshape.length() || tqshape == "rect") { int xx[4]; int i=0; @@ -420,7 +420,7 @@ lt_XMLParser::Impl::ChangeAnno( } GRect rect(xmin,ymin,xmax-xmin,ymax-ymin); a=GMapRect::create(rect); - }else if(shape == "circle") + }else if(tqshape == "circle") { int xx[4]; int i=0; @@ -440,7 +440,7 @@ lt_XMLParser::Impl::ChangeAnno( int x=xx[0],y=xx[1],rx=xx[2],ry=(h-xx[3])-1; GRect rect(x-rx,y-ry,2*rx,2*ry); a=GMapOval::create(rect); - }else if(shape == "oval") + }else if(tqshape == "oval") { int xx[4]; int i=0; @@ -474,7 +474,7 @@ lt_XMLParser::Impl::ChangeAnno( } GRect rect(xmin,ymin,xmax-xmin,ymax-ymin); a=GMapOval::create(rect); - }else if(shape == "poly") + }else if(tqshape == "poly") { GP<GMapPoly> p=GMapPoly::create(); for(GPosition poly_pos=coords;poly_pos;++poly_pos) @@ -489,7 +489,7 @@ lt_XMLParser::Impl::ChangeAnno( a=p; }else { - G_THROW( ( ERR_MSG("XMLAnno.unknown_shape") "\t")+shape ); + G_THROW( ( ERR_MSG("XMLAnno.unknown_tqshape") "\t")+tqshape ); } if(a) { |