Ignore:
Timestamp:
May 3, 2006, 10:14:37 AM (15 years ago)
Author:
Eugene Romanenko
Message:

update makefiles, remove absolute paths, update djvulibre to version 3.5.17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/ddjvuapi.h

    r15 r17  
    5353//C- */
    5454
    55 /* $Id: ddjvuapi.h,v 1.34 2005/10/31 16:44:10 leonb Exp $ */
     55/* $Id: ddjvuapi.h,v 1.46 2006/01/30 14:28:55 leonb Exp $ */
    5656
    5757#ifndef DDJVUAPI_H
     
    100100   Version   Change
    101101   -----------------------------
    102      16    Addition of miniexp.h and related functions:
    103               ddjvu_miniexp_release()
    104               ddjvu_document_get_outline/pagetext/pageanno()
    105               ddjvu_anno_get_XXX()
     102     17    Addition of:
     103              ddjvu_page_get_initial_rotation(), ddjvu_code_get_version()
     104              ddjvu_document_get_filenum(), ddjvu_document_get_fileinfo()
     105              ddjvu_document_search_pageno(), ddjvu_document_check_pagedata()
     106              ddjvu_rectmapper_t and related functions.
     107     16    Addition of:
     108              miniexp.h and related functions.
    106109     15    Addition of:
    107110              ddjvu_document_get_pageinfo()
     
    110113*/
    111114
    112 #define DDJVUAPI_VERSION 16
    113 
    114 typedef struct ddjvu_context_s  ddjvu_context_t;
    115 typedef union  ddjvu_message_s  ddjvu_message_t;
    116 typedef struct ddjvu_job_s      ddjvu_job_t;
    117 typedef struct ddjvu_document_s ddjvu_document_t;
    118 typedef struct ddjvu_page_s     ddjvu_page_t;
    119 typedef struct ddjvu_format_s   ddjvu_format_t;
     115#define DDJVUAPI_VERSION 17
     116
     117typedef struct ddjvu_context_s    ddjvu_context_t;
     118typedef union  ddjvu_message_s    ddjvu_message_t;
     119typedef struct ddjvu_job_s        ddjvu_job_t;
     120typedef struct ddjvu_document_s   ddjvu_document_t;
     121typedef struct ddjvu_page_s       ddjvu_page_t;
     122typedef struct ddjvu_format_s     ddjvu_format_t;
     123typedef struct ddjvu_rect_s       ddjvu_rect_t;
     124typedef struct ddjvu_rectmapper_s ddjvu_rectmapper_t;
    120125
    121126
     
    140145   - Please read the djvu man page: <"tools/djvu.1">.
    141146   - Please browse the file format specifications
    142      <"doc/djvu3changes.txt"> and <"doc/djvu2spec.djvu">.
     147     <"doc/djvu3changes.txt"> and <"doc/djvu3spec.djvu">.
    143148*/
    144149
     
    404409   asynchronously.  Member <message> is the error message.
    405410   Members <function>, <filename> and <lineno>
    406    indicates the place where the error was detected.
    407 */
     411   indicates the place where the error was detected. */
    408412
    409413struct ddjvu_message_error_s {  /* ddjvu_message_t::m_error */
     
    466470
    467471
    468 /* ddjvu_document_create_from_file ---
     472/* ddjvu_document_create_by_filename ---
    469473   Creates a document for a DjVu document stored in a file.
    470474   The document will directly access the specified DjVu file
     
    595599   about the document has been obtained and decoded.
    596600   Not much can be done before this happens.
    597  */
     601   Call <ddjvu_document_decoding_status> to determine
     602   whether the operation was successful. */
    598603
    599604struct ddjvu_message_docinfo_s {
     
    629634
    630635
     636
     637/* ------- ADVANCED ------- */
     638
     639
     640/* ddjvu_document_get_filenum --
     641   Returns the number of component files.
     642   This function might return 1 when called
     643   before receiving a <m_docinfo> message */
     644   
     645DDJVUAPI int
     646ddjvu_document_get_filenum(ddjvu_document_t *document);
     647
     648
     649/* ddjvu_document_get_fileinfo --
     650   Returns information about component file <fileno>.
     651   This function might return <DDJVU_JOB_STARTED> when
     652   called before receiving a <m_docinfo> message.
     653   String pointers in the returned data structure
     654   might be null. Strings are UTF8 encoded and remain
     655   allocated as long as the ddjvu_document_t object exists.*/
     656
     657typedef struct ddjvu_fileinfo_s {
     658  char  type;                   /* [P]age, [T]humbnails, [I]nclude. */
     659  int   pageno;                 /* Zero when not applicable. */
     660  int   size;                   /* Zero when unknown. */
     661  const char *id;               /* File identifier. */
     662  const char *name;             /* Name for indirect documents. */
     663  const char *title;            /* Page title. */
     664} ddjvu_fileinfo_t;
     665
     666DDJVUAPI ddjvu_status_t
     667ddjvu_document_get_fileinfo(ddjvu_document_t *document,
     668                            int fileno, ddjvu_fileinfo_t *info);
     669
     670
     671/* ddjvu_document_search_pageno ---
     672   Searches the page number of the page named <name>.
     673   Argument <name> is an UTF8 encoded string that is
     674   matched against the page ids, page names, and page titles.
     675   Numerical names are also interpreted as page numbers.
     676   This functions returns <-1> when an error occurs,
     677   when the page is not found, or when called before
     678   receiving a <m_docinfo> message. */
     679
     680DDJVUAPI int
     681ddjvu_document_search_pageno(ddjvu_document_t *document, const char *name);
     682
     683
     684/* ddjvu_document_check_pagedata ---
     685   Returns a non zero result if the data for page <pageno>
     686   is already in memory. When this is the case, functions
     687   <ddjvu_document_get_pageinfo>, <ddjvu_document_get_pagetext>
     688   and <ddjvu_document_get_pageanno> return the information immediately.
     689   This function causes the emission of <m_pageinfo> messages
     690   with zero in the <m_any.page> field.
     691*/
     692
     693DDJVUAPI int
     694ddjvu_document_check_pagedata(ddjvu_document_t *document, int pageno);
     695
     696
    631697/* ddjvu_document_get_pageinfo ---
    632698   Attempts to obtain information about page <pageno>
     
    644710   if (r>=DDJVU_JOB_FAILED)
    645711     signal_error();
    646 
    647    When the djvu document comes from the network, the above idiom
    648    is very slow because it waits until the data for all page is present.
    649712*/     
    650713
    651714typedef struct ddjvu_pageinfo_s {
    652   int width;
    653   int height;
    654   int dpi;
     715  int width;                    /* page width (in pixels) */
     716  int height;                   /* page height (in pixels) */
     717  int dpi;                      /* page resolution (in dots per inche) */
    655718} ddjvu_pageinfo_t;
    656719
    657720DDJVUAPI ddjvu_status_t
    658 ddjvu_document_get_pageinfo(ddjvu_document_t *document, int pageno,
    659                             ddjvu_pageinfo_t *info);
     721ddjvu_document_get_pageinfo(ddjvu_document_t *document,
     722                            int pageno, ddjvu_pageinfo_t *info);
     723
     724
    660725
    661726
     
    670735   <ddjvu_page_t> object with this function.  Argument
    671736   <pageno> indicates the page number, starting with page
    672    <0> to <pagenum-1>. This function can be called
    673    immediately after creating the <ddjvu_document_t> object.
    674    It also initiates the data transfer and the decoding threads
    675    for the specified page.  Various messages will document
    676    the progress of these operations. Error messages will be
    677    generated if the page does not exists. */
     737   <0> to <pagenum-1>. This function may return NULL
     738   when called before receiving the <m_docinfo> message.
     739   Calling this function also initiates the data transfer
     740   and the decoding threads for the specified page. 
     741   Various messages will document the progress of these
     742   operations. Error messages will be generated if
     743   the page does not exists. */
    678744
    679745DDJVUAPI ddjvu_page_t *
     
    743809   - when the page decoding thread terminates.
    744810   You can distinguish both cases using
    745    function ddjvu_page_decoding_done().
     811   function ddjvu_page_decoding_status().
    746812   Messages <m_pageinfo> are also generated as a consequence of
    747813   functions such as <ddjvu_document_get_pageinfo>.
     
    793859   objects.  When receiving <m_redisplay>, the viewer should invalidate the
    794860   image area so that the gui toolkint calls the repaint event handler. This
    795    handler should call ddjvu_page_render() and paint the part og the
     861   handler should call ddjvu_page_render() and paint the part of the
    796862   image that needs repainting. */
    797863
     
    841907ddjvu_page_get_version(ddjvu_page_t *page);
    842908
     909/* ddjvu_code_get_version ---
     910   Returns the version of the djvu file format
     911   implemented by this library. More or less graceful
     912   degradation might arise if this is smaller than
     913   the number returned by <ddjvu_page_get_version>. */
     914
     915DDJVUAPI int
     916ddjvu_code_get_version(void);
    843917
    844918/* ddjvu_page_get_type ---
     
    856930DDJVUAPI ddjvu_page_type_t
    857931ddjvu_page_get_type(ddjvu_page_t *page);
     932
    858933
    859934/* ddjvu_page_get_short_description ---
     
    873948
    874949
    875 /* ddjvu_page_get_rotation ---
    876    Returns the rotation angle for the DjVu page.
    877    The rotation is automatically taken into account
    878    by <ddjvu_page_render>, <ddjvu_page_get_width>
    879    and <ddjvu_page_get_height>. */
     950/* ddjvu_page_set_rotation ---
     951   Changes the counter-clockwise rotation angle for a DjVu page.
     952   Calling this function before receiving a <m_pageinfo>
     953   message has no good effect. */
    880954
    881955typedef enum {
     
    886960} ddjvu_page_rotation_t;
    887961
     962DDJVUAPI void
     963ddjvu_page_set_rotation(ddjvu_page_t *page,
     964                        ddjvu_page_rotation_t rot);
     965
     966
     967/* ddjvu_page_get_rotation ---
     968   Returns the counter-clockwise rotation angle for the DjVu page.
     969   The rotation is automatically taken into account
     970   by <ddjvu_page_render>, <ddjvu_page_get_width>
     971   and <ddjvu_page_get_height>. */
     972
    888973DDJVUAPI ddjvu_page_rotation_t
    889974ddjvu_page_get_rotation(ddjvu_page_t *page);
    890975
    891976
    892 /* ddjvu_page_set_rotation ---
    893    Changes the rotation angle for a DjVu page.
    894    Calling this function before receiving a <m_pageinfo>
    895    message has no effect. */
    896 
    897 DDJVUAPI void
    898 ddjvu_page_set_rotation(ddjvu_page_t *page,
    899                         ddjvu_page_rotation_t rot);
     977/* ddjvu_page_get_initial_rotation ---
     978   Returns the page rotation specified by the
     979   orientation flags in the DjVu file.
     980   [brain damage warning] This is useful because
     981   maparea coordinates in the annotation chunks
     982   are expressed relative to the rotated coordinates
     983   whereas text coordinates in the hidden text data
     984   are expressed relative to the unrotated coordinates. */
     985
     986DDJVUAPI ddjvu_page_rotation_t
     987ddjvu_page_get_initial_rotation(ddjvu_page_t *page);
    900988
    901989
    902990
    903991/* ------- RENDER ------- */
    904 
    905 
    906 /* ddjvu_rect_t ---
    907    This structure specifies the location of a rectangle.
    908    Coordinates are usually expressed in pixels relative to
    909    the BOTTOM LEFT CORNER (but see ddjvu_format_set_y_direction).
    910    Members <x> and <y> indicate the position of the bottom left
    911    corner of the rectangle Members <w> and <h> indicate the
    912    width and height of the rectangle. */
    913 
    914 typedef struct ddjvu_rect_s {
    915   int x, y;
    916   unsigned int w, h;
    917 } ddjvu_rect_t;
    918992
    919993
     
    9311005
    9321006
     1007/* ddjvu_rect_t ---
     1008   This structure specifies the location of a rectangle.
     1009   Coordinates are usually expressed in pixels relative to
     1010   the BOTTOM LEFT CORNER (but see ddjvu_format_set_y_direction).
     1011   Members <x> and <y> indicate the position of the bottom left
     1012   corner of the rectangle Members <w> and <h> indicate the
     1013   width and height of the rectangle. */
     1014
     1015struct ddjvu_rect_s {
     1016  int x, y;
     1017  unsigned int w, h;
     1018};
     1019
    9331020
    9341021/* ddjvu_page_render --
     
    9631050                  unsigned long rowsize,
    9641051                  char *imagebuffer );
     1052
     1053
     1054
     1055
     1056/* -------------------------------------------------- */
     1057/* COORDINATE TRANSFORMS                              */
     1058/* -------------------------------------------------- */
     1059
     1060/* ddjvu_rectmapper_create --
     1061   Creates a <ddjvu_rectmapper_t> data structure
     1062   representing an affine coordinate transformation that
     1063   maps points from rectangle <input> to rectangle <output>.
     1064   The transformation maintains the positions relative
     1065   to the coordinates of the rectangle corners. */
     1066
     1067DDJVUAPI ddjvu_rectmapper_t *
     1068ddjvu_rectmapper_create(ddjvu_rect_t *input, ddjvu_rect_t *output);
     1069
     1070
     1071/* ddjvu_rectmapper_modify ---
     1072   Modifies the coordinate transform <mapper> by redefining
     1073   which corners of the output rectangle match those of the
     1074   input rectangle. This function first applies a counter-clockwise
     1075   rotation of <rotation> quarter-turns, and then reverses the X
     1076   (resp. Y) coordinates when <mirrorx> (resp. <mirrory>) is non zero. */
     1077
     1078DDJVUAPI void
     1079ddjvu_rectmapper_modify(ddjvu_rectmapper_t *mapper,
     1080                        int rotation, int mirrorx, int mirrory);
     1081
     1082
     1083/* ddjvu_rectmapper_release ---
     1084   Destroys the <ddjvu_rect_mapper_t> structure
     1085   returned by <ddjvu_rect_mapper_create>. */
     1086
     1087DDJVUAPI void
     1088ddjvu_rectmapper_release(ddjvu_rectmapper_t *mapper);
     1089
     1090/* ddjvu_map_point, ddjvu_map_rect ---
     1091   Applies the coordinate transform
     1092   to a point or a rectangle */
     1093
     1094DDJVUAPI void
     1095ddjvu_map_point(ddjvu_rectmapper_t *mapper, int *x, int *y);
     1096
     1097DDJVUAPI void
     1098ddjvu_map_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect);
     1099
     1100
     1101/* ddjvu_unmap_point, ddjvu_unmap_rect ---
     1102   Applies the inverse coordinate transform
     1103   to a point or a rectangle */
     1104
     1105DDJVUAPI void
     1106ddjvu_unmap_point(ddjvu_rectmapper_t *mapper, int *x, int *y);
     1107
     1108DDJVUAPI void
     1109ddjvu_unmap_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect);
    9651110
    9661111
     
    9921137   Argument <args> is an array of <nargs> unsigned ints
    9931138   providing additionnal information:
    994    - When style is <RGBMASK*>, argument <nargs> must be <3>
    995      and array <args> contains three contiguous bit masks for
    996      the red, green, and blue components of each pixel.
     1139   - When style is <RGBMASK*>, argument <nargs> must be <3> or <4>.
     1140     The three first entries of array <args> are three contiguous
     1141     bit masks for the red, green, and blue components of each pixel.
     1142     The resulting color is then xored with the optional fourth entry.
    9971143   - When style is <PALETTE*>, argument <nargs> must be <216>
    9981144     and array <args> contains the 6*6*6 entries of a web
     
    11041250
    11051251
    1106 
    11071252/* ddjvu_message_t::m_progress ---
    11081253   These messages are generated to indicate progress
     
    11351280
    11361281
    1137 /* NOT YET IMPLEMENTED ---
     1282/* ddjvu_document_save ---
    11381283   Saves the djvu document as a bundled djvu file.
    11391284   This function works asynchronously in a separate thread.
     
    11451290     
    11461291   The bundled djvu data is written to file <output>
    1147    which must be seekable. Arguments <optc> and <optv>
    1148    exactly like command line arguments of a program.
    1149    The only supported option is "-page=<pagespec>".
    1150    See the man page for <djvups> for more information
    1151    about page specifications.
     1292   which must be seekable. Arguments <optc> and <optv>
     1293   are intended for enabling future extensions
     1294   of this function.
    11521295*/
    11531296DDJVUAPI ddjvu_job_t *
     
    11571300
    11581301
     1302
    11591303/* -------------------------------------------------- */
    11601304/* S-EXPRESSIONS                                      */
    11611305/* -------------------------------------------------- */
     1306
    11621307
    11631308/* DjVu files can contain ancillary information such as
Note: See TracChangeset for help on using the changeset viewer.