Ignore:
Timestamp:
Aug 9, 2006, 3:45:40 PM (15 years ago)
Author:
Eugene Romanenko
Message:

more comments, new method isFixedImage(), fixed keyboard selection of printer in printer dialog

Location:
trunk/Lucide/SOURCE/plugins/ludoc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.cpp

    r92 r95  
    9999{
    100100    return FALSE;
     101}
     102
     103
     104SOM_Scope boolean  SOMLINK isFixedImage(LuDocument *somSelf,
     105                                         Environment *ev)
     106{
     107    return TRUE;
    101108}
    102109
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.idl

    r92 r95  
    3434     *
    3535     * Return value: TRUE if file loaded, FALSE otherwise.
     36     * Default return value: FALSE
    3637     *
    3738     * Note: error string allocated using SOMMalloc(),
     
    4546     *
    4647     * Return value: Number of bytes per pixel used for draw.
     48     *               Allowed values is 3 (24 bit) or 4 (32 bit).
     49     *               4 bytes per pixel is same as 3, but padded
     50     *               with dummy byte.
     51     * Default return value: 0
    4752     **/
    4853    short getBpp();
     
    5459     *
    5560     * Return value: TRUE if document scalable, FALSE otherwise.
     61     * Default return value: FALSE
    5662     **/
    5763    boolean isScalable();
     
    5965
    6066    /**
     67     * isFixedImage
     68     *
     69     * Determines if upscaling doesn't improve image quality.
     70     * Must return TRUE for fixed-size images/bitmaps.
     71     * Must return FALSE for documents which renders fonts/vector images,
     72     *   so upscaling improves quality of rendered image.
     73     *
     74     * Used to determine better printing parameters.
     75     * Default return value: TRUE
     76     **/
     77    boolean isFixedImage();
     78
     79
     80    /**
    6181     * isRotable
    6282     *
     
    6484     *
    6585     * Return value: TRUE if document can be rotated, FALSE otherwise.
     86     * Default return value: FALSE
    6687     **/
    6788    boolean isRotable();
     
    7495     *
    7596     * Return value: Number of pages
     97     * Default return value: 0
    7698     **/
    7799    long getPageCount();
     
    101123     *        (if isScalable() is FALSE, scale ignored and assumed 1.0)
    102124     * rotation: rotate the document by the specified degree
     125     *           allowed values is 0, 90, 180, 270
    103126     *        (if isRotable() is FALSE, rotation ignored and assumed 0)
    104127     * pixbuf: pixbuf to render into
     
    119142     *
    120143     * Return value: TRUE if document can be rendered asynchronously.
     144     * Default return value: FALSE
    121145     **/
    122146    boolean isAsynchRenderingSupported();
     
    130154     * Callback functions must be defined as
    131155     * long _System *asynchCallbackFn( void *data );
     156     *
     157     * Note: you must implement renderPageToPixbuf() also, as
     158     *       it used during printing.
    132159     **/
    133160    void renderPageToPixbufAsynch( in long pagenum, in long src_x,
     
    144171     *
    145172     * Return value: TRUE if document will render directly into
    146      *               presentation space.
     173     *               presentation space using renderPageToPS().
     174     *
     175     * Note: You may not implement renderPageToPixbuf() if
     176     *       isRenderIntoPS() is TRUE.
     177     *
     178     * Default return value: FALSE
    147179     **/
    148180    boolean isRenderIntoPS();
     
    159191     *        (if isScalable() is FALSE, scale ignored and assumed 1.0)
    160192     * rotation: rotate the document by the specified degree
     193     *           allowed values is 0, 90, 180, 270
    161194     *        (if isRotable() is FALSE, rotation ignored and assumed 0)
    162195     * hps: handle of presentation space to render into
     
    181214     *               can be selected by user, searched, etc,
    182215     *               FALSE otherwise.
     216     * Default return value: FALSE
    183217     **/
    184218    boolean isHaveText();
     
    197231     *               nothing selected or document doesn't have
    198232     *               selectable text
     233     * Default return value: NULL
    199234     *
    200235     * Note: SOMMalloc() must be used for all memory allocations.
     
    226261     *
    227262     * Note: Charset of returned string must be UTF-8
     263     * Default return value: NULL
    228264     **/
    229265    string getText( in long pagenum, in LuRectangle selection );
     
    237273     * Return value: TRUE if document may contain navigable links,
    238274     *               FALSE otherwise.
     275     * Default return value: FALSE
    239276     **/
    240277    boolean isHaveLinks();
     
    253290     *
    254291     * Note: SOMMalloc() must be used for all memory allocations.
     292     * Default return value: NULL
    255293     **/
    256294    LuLinkMapSequence *getLinkMapping( in long pagenum );
     
    272310     * Return value: TRUE if document can be saved in same format
    273311     *               as original, FALSE otherwise.
     312     * Default return value: FALSE
    274313     **/
    275314    boolean isSaveable();
     
    284323     * Return value: TRUE, if the document was successfully saved,
    285324     *               FALSE otherwise.
     325     * Default return value: FALSE
    286326     **/
    287327    boolean saveAs( in string filename );
     
    293333     * Return value: TRUE if document can be exported to
    294334     *               PostScript, FALSE otherwise.
     335     * Default return value: FALSE
    295336     **/
    296337    boolean isPostScriptExportable();
     
    314355     *
    315356     * Create a new postscript file and render document to.
    316      * Return value: TRUE if PS document was generated successfully, or
     357     * Return value: TRUE if PS document was generated successfully or
    317358     *               generation was interrupted, FALSE otherwise.
     359     * Default return value: FALSE
    318360     **/
    319361    boolean exportToPostScript( in string filename,
     
    330372     * Return value: TRUE if getFontInfo() can return information about
    331373     *               fonts used in document, FALSE otherwise.
     374     * Default return value: FALSE
    332375     **/
    333376    boolean isHaveFontInfo();
     
    344387     * Returned sequence must be freed with freeFontInfo() when done.
    345388     * Note: SOMMalloc() must be used for all memory allocations.
     389     * Default return value: NULL
    346390     **/
    347391    LuFontInfoSequence *getFontInfo();
     
    366410     *
    367411     * Return value: TRUE if document have index, FALSE otherwise.
     412     * Default return value: FALSE
    368413     **/
    369414    boolean isHaveIndex();
     
    398443     * Return value: a new LuIndexNode, which represents an index root,
    399444     *               or NULL, if document doesn't have an index.
     445     * Default return value: NULL
    400446     **/
    401447    LuIndexNode getIndex();
     
    433479     *
    434480     * Return value: TRUE, if page has a thumbnail associated with it.
     481     * Default return value: FALSE
    435482     **/
    436483    boolean getThumbnailSize( in long pagenum, in short suggested_width, inout short width, inout short height );
     
    447494     * Return value: pointer to LuPixbuf, if page has a thumbnail associated with it
    448495     *               or NULL.
     496     * Default return value: NULL
    449497     **/
    450498    LuPixbuf getThumbnail( in long pagenum, in short suggested_width );
     
    462510     * Return value: a newly allocated LuRectSequence, or NULL if
    463511     *               nothing found
     512     * Default return value: NULL
    464513     *
    465514     * Note: SOMMalloc() must be used for all memory allocations.
     
    483532                      isHaveIndex, getIndex, getDocumentInfo,
    484533                      freeDocumentInfo, getThumbnailSize, getThumbnail,
    485                       searchText;
     534                      searchText, isFixedImage;
    486535
    487536
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xh

    r92 r95  
    174174        somMToken getThumbnail;
    175175        somMToken searchText;
     176        somMToken isFixedImage;
    176177} SOMDLINK LuDocumentClassData;
    177178#define _LuDocument LuDocumentClassData.classObject
     
    196197typedef boolean   SOMLINK somTP_LuDocument_isScalable(LuDocument *somSelf, Environment *ev);
    197198typedef somTP_LuDocument_isScalable *somTD_LuDocument_isScalable;
     199typedef boolean   SOMLINK somTP_LuDocument_isFixedImage(LuDocument *somSelf, Environment *ev);
     200typedef somTP_LuDocument_isFixedImage *somTD_LuDocument_isFixedImage;
    198201typedef boolean   SOMLINK somTP_LuDocument_isRotable(LuDocument *somSelf, Environment *ev);
    199202typedef somTP_LuDocument_isRotable *somTD_LuDocument_isRotable;
     
    524527
    525528
     529/* method: isFixedImage */
     530boolean   isFixedImage(Environment *ev)
     531{
     532   return SOM_ResolveD(this,LuDocument,LuDocument,isFixedImage)
     533        (this, ev);
     534}
     535
     536
    526537/* method: isRotable */
    527538boolean   isRotable(Environment *ev)
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xih

    r92 r95  
    3232#endif
    3333
    34 #define LuDocument_MaxNoMethods 32
     34#define LuDocument_MaxNoMethods 33
    3535
    3636/*
     
    9292  #define _getBpp somSelf->getBpp
    9393  #define _isScalable somSelf->isScalable
     94  #define _isFixedImage somSelf->isFixedImage
    9495  #define _isRotable somSelf->isRotable
    9596  #define _getPageCount somSelf->getPageCount
     
    197198
    198199/*
     200 * New Method: isFixedImage
     201 */
     202SOM_Scope boolean  SOMLINK isFixedImage(LuDocument *somSelf, Environment *ev);
     203#ifndef somMN_isFixedImage_defined
     204#define somMN_isFixedImage_defined
     205static char *somMN_isFixedImage = "isFixedImage";
     206static somId somId_isFixedImage = &somMN_isFixedImage;
     207#endif  /* somMN_isFixedImage_defined */
     208#ifndef somDS_isFixedImage_defined
     209#define somDS_isFixedImage_defined
     210static char *somDS_isFixedImage = "::LuDocument::isFixedImage";
     211static somId somDI_isFixedImage = &somDS_isFixedImage;
     212#endif  /* somDS_isFixedImage_defined */
     213
     214static somMethodInfo isFixedImageMethodInfo = {10, 8, 0};
     215
     216static somApRdInfo isFixedImageStubs = {0, 0, &isFixedImageMethodInfo};
     217
     218/*
    199219 * New Method: isRotable
    200220 */
     
    785805         (somMethodProc *) ((void*) &isScalableStubs) },
    786806#endif
     807    {    &LuDocumentClassData.isFixedImage,
     808         &somId_isFixedImage,
     809         &somDI_isFixedImage,
     810         (somMethodProc *) isFixedImage,
     811         (somMethodProc *)((void*)-1),
     812#ifdef isFixedImage_somApRdDefault
     813         0},
     814#else
     815         (somMethodProc *) ((void*) &isFixedImageStubs) },
     816#endif
    787817    {    &LuDocumentClassData.isRotable,
    788818         &somId_isRotable,
     
    10681098
    10691099static somStaticClassInfo LuDocumentSCI = {
    1070     4, 28, 1, 0, 4, 0, /* layout version 4 */
     1100    4, 29, 1, 0, 4, 0, /* layout version 4 */
    10711101    LuDocument_MajorVersion, LuDocument_MinorVersion,
    10721102    0, LuDocument_MaxNoMethods, 1,
     
    10911121    0, /* number of SelectInheritedMethods */
    10921122    0, /* no SelectInheritedMethods */
    1093     32, /* number of classdata entries */
     1123    33, /* number of classdata entries */
    10941124    0, /* no list provided currently */
    10951125    0, /* number of migrated methods */
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.idl

    r27 r95  
    1414interface LuPixbuf : SOMObject
    1515{
     16
     17    /**
     18     * LuPixbufInit: init routine (constructor)
     19     * w: width of newly created pixbuf
     20     * h: height of newly created pixbuf
     21     * bpp: bytes per pixel, 3 or 4
     22     **/
    1623    void LuPixbufInit( inout somInitCtrl ctrl, in long w, in long h, in short bpp );
     24   
     25    /**
     26     * getWidth
     27     *
     28     * Returns pixbuf width
     29     **/
    1730    long getWidth();
     31   
     32    /**
     33     * getHeight
     34     *
     35     * Returns pixbuf height
     36     **/
    1837    long getHeight();
     38   
     39    /**
     40     * getBpp
     41     *
     42     * Returns number of bytes per pixel (3 or 4)
     43     **/
    1944    short getBpp();
     45   
     46    /**
     47     * getRowSize
     48     *
     49     * Returns size of one row, in bytes
     50     *
     51     * Note: (getWidth()*getBpp()) MAY NOT EQUAL getRowSize() as
     52     *       row size may be padded to be four-bytes aligned
     53     **/
    2054    long getRowSize();
     55   
     56    /**
     57     * getDataLen
     58     *
     59     * Returns length of pixbuf data in bytes (getRowSize()*getHeight())
     60     **/
    2161    long getDataLen();
     62   
     63    /**
     64     * getDataPtr
     65     *
     66     * Returns pointer to pixbuf data
     67     **/
    2268    void *getDataPtr();
     69   
     70    /**
     71     * putAt
     72     *
     73     * Puts a data of another pixbuf (p) to specified position (x, y)
     74     **/
    2375    void putAt( in LuPixbuf p, in long x, in long y );
    2476
Note: See TracChangeset for help on using the changeset viewer.