• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

DjVuAnno.h

Go to the documentation of this file.
00001 //C-  -*- C++ -*-
00002 //C- -------------------------------------------------------------------
00003 //C- DjVuLibre-3.5
00004 //C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
00005 //C- Copyright (c) 2001  AT&T
00006 //C-
00007 //C- This software is subject to, and may be distributed under, the
00008 //C- GNU General Public License, Version 2. The license should have
00009 //C- accompanied the software or you may obtain a copy of the license
00010 //C- from the Free Software Foundation at http://www.fsf.org .
00011 //C-
00012 //C- This program is distributed in the hope that it will be useful,
00013 //C- but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //C- GNU General Public License for more details.
00016 //C- 
00017 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
00018 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech 
00019 //C- Software authorized us to replace the original DjVu(r) Reference 
00020 //C- Library notice by the following text (see doc/lizard2002.djvu):
00021 //C-
00022 //C-  ------------------------------------------------------------------
00023 //C- | DjVu (r) Reference Library (v. 3.5)
00024 //C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
00025 //C- | The DjVu Reference Library is protected by U.S. Pat. No.
00026 //C- | 6,058,214 and patents pending.
00027 //C- |
00028 //C- | This software is subject to, and may be distributed under, the
00029 //C- | GNU General Public License, Version 2. The license should have
00030 //C- | accompanied the software or you may obtain a copy of the license
00031 //C- | from the Free Software Foundation at http://www.fsf.org .
00032 //C- |
00033 //C- | The computer code originally released by LizardTech under this
00034 //C- | license and unmodified by other parties is deemed "the LIZARDTECH
00035 //C- | ORIGINAL CODE."  Subject to any third party intellectual property
00036 //C- | claims, LizardTech grants recipient a worldwide, royalty-free, 
00037 //C- | non-exclusive license to make, use, sell, or otherwise dispose of 
00038 //C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the 
00039 //C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU 
00040 //C- | General Public License.   This grant only confers the right to 
00041 //C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to 
00042 //C- | the extent such infringement is reasonably necessary to enable 
00043 //C- | recipient to make, have made, practice, sell, or otherwise dispose 
00044 //C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to 
00045 //C- | any greater extent that may be necessary to utilize further 
00046 //C- | modifications or combinations.
00047 //C- |
00048 //C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
00049 //C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
00050 //C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
00051 //C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00052 //C- +------------------------------------------------------------------
00053 // 
00054 // $Id: DjVuAnno.h,v 1.8 2003/11/07 22:08:20 leonb Exp $
00055 // $Name: release_3_5_15 $
00056 
00057 #ifndef _DJVUANNO_H
00058 #define _DJVUANNO_H
00059 #ifdef HAVE_CONFIG_H
00060 #include "config.h"
00061 #endif
00062 #if NEED_GNUG_PRAGMAS
00063 # pragma interface
00064 #endif
00065 
00066 
00067 
00090 
00091 
00092 #include "GString.h"
00093 
00094 #ifdef HAVE_NAMESPACES
00095 namespace DJVU {
00096 # ifdef NOT_DEFINED // Just to fool emacs c++ mode
00097 }
00098 #endif
00099 #endif
00100 
00101 class GMapArea;
00102 class ByteStream;
00103 
00104 // -------- DJVUANT --------
00105 
00113 class DjVuANT : public GPEnabled
00114 {
00115 protected:
00117    DjVuANT(void);
00118 
00119 public:
00120    enum { MODE_UNSPEC=0, MODE_COLOR, MODE_FORE, MODE_BACK, MODE_BW };
00121    enum { ZOOM_STRETCH=-4, ZOOM_ONE2ONE=-3, ZOOM_WIDTH=-2,
00122       ZOOM_PAGE=-1, ZOOM_UNSPEC=0 };
00123    enum alignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT,
00124       ALIGN_TOP, ALIGN_BOTTOM };
00125 
00127    static GP<DjVuANT> create(void) { return new DjVuANT; }
00128    virtual ~DjVuANT();
00129 
00132    unsigned long int    bg_color;
00141    int      zoom;
00154    int      mode;
00157    alignment hor_align;
00160    alignment ver_align;
00164    GPList<GMapArea> map_areas;
00165 #ifndef NO_METADATA_IN_ANT_CHUNK
00166 
00167    GMap<GUTF8String,GUTF8String> metadata;
00168 #endif
00169 
00171    bool     is_empty(void) const;
00172 
00177    void decode(ByteStream &bs);
00178 
00181    void merge(ByteStream & bs);
00182 
00186    void encode(ByteStream &bs);
00187 
00189    GUTF8String encode_raw(void) const;
00190 
00192    GP<DjVuANT>  copy(void) const;
00193    
00196    unsigned int get_memory_usage() const;
00197 
00199    static unsigned long int cvt_color(const char * color, unsigned long int def);
00201    GUTF8String get_xmlmap(const GUTF8String &name, const int height) const;
00203    void writeMap(
00204      ByteStream &bs,const GUTF8String &name, const int height) const;
00206    GUTF8String get_paramtags(void) const;
00208    void writeParam(ByteStream &out_str) const;
00209 private:
00210    void decode(class GLParser & parser);
00211    static GUTF8String read_raw(ByteStream & str);
00212    static unsigned char decode_comp(char ch1, char ch2);
00213    static unsigned long int get_bg_color(class GLParser & parser);
00214    static int get_zoom(class GLParser & parser);
00215    static int get_mode(class GLParser & parser);
00216    static alignment get_hor_align(class GLParser & parser);
00217    static alignment get_ver_align(class GLParser & parser);
00218    static GPList<GMapArea> get_map_areas(class GLParser & parser);
00219 #ifndef NO_METADATA_IN_ANT_CHUNK
00220    static GMap<GUTF8String, GUTF8String>get_metadata(GLParser & parser);
00221 #endif
00222    static void del_all_items(const char * name, class GLParser & parser);
00223 };
00224 
00225 // -------- DJVUANNO --------
00226 
00227 
00235 class DjVuAnno : public GPEnabled
00236 {
00237 protected:
00238    DjVuAnno(void) {}
00239 public:
00241    static GP<DjVuAnno> create(void) { return new DjVuAnno; }
00242 
00243    GP<DjVuANT>  ant;
00244 
00249    void decode(const GP<ByteStream> &bs);
00250 
00253    void encode(const GP<ByteStream> &bs);
00254 
00256    GP<DjVuAnno> copy(void) const;
00257 
00260    void     merge(const GP<DjVuAnno> & anno);
00261 
00264    inline unsigned int get_memory_usage() const;
00266    GUTF8String get_xmlmap(const GUTF8String &name, const int height) const;
00268    void writeMap(
00269      ByteStream &bs,const GUTF8String &name, const int height) const;
00271    GUTF8String get_paramtags(void) const;
00273    void writeParam(ByteStream &out_str) const;
00274 private: // dummy stuff
00275    static void decode(ByteStream *);
00276    static void encode(ByteStream *);
00277 };
00278 
00280 
00281 inline unsigned int 
00282 DjVuAnno::get_memory_usage() const
00283 {
00284   return (ant)?(ant->get_memory_usage()):0;
00285 }
00286 
00287 // ----- THE END
00288 
00289 #ifdef HAVE_NAMESPACES
00290 }
00291 # ifndef NOT_USING_DJVU_NAMESPACE
00292 using namespace DJVU;
00293 # endif
00294 #endif
00295 #endif

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal