Changes between Version 4 and Version 5 of Lucide-Plugin-API
- Timestamp:
- Sep 21, 2016, 3:48:47 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Lucide-Plugin-API
v4 v5 1 1 = Lucide Plugin API = 2 2 [[PageOutline]] 3 A bird's eye view of how a plugin is constructed may be seen in plugins/ludoc/ludoc.idl.3 A well-commented, working plugin may be seen in [/lucide/browser/trunk/Lucide/plugins/ludoc/ludoc.idl ludoc.idl]. 4 4 5 5 == Available methods == … … 15 15 ||error||return location for an error, or NULL|| 16 16 Return value: 17 TRUE if file has loaded ,FALSE otherwise.17 TRUE if file has loaded; FALSE otherwise. 18 18 Default return value: 19 19 FALSE … … 36 36 {{{getBpp();}}} 37 37 38 === isScalable() ===39 Description: 40 See: [#renderPageToPixbuf renderPageToPixbuf()], scale.41 Return value: 42 TRUE if document is scalable ,FALSE otherwise.38 === isScalable() [=#isScalable] 39 Description: 40 See: [#renderPageToPixbuf_scale renderPageToPixbuf(), scale]. 41 Return value: 42 TRUE if document is scalable; FALSE otherwise. 43 43 Default return value: 44 44 FALSE … … 52 52 Determines if upscaling improves image quality. Must return TRUE for fixed-size images/bitmaps. Must return FALSE for documents which render fonts/vector images, to indicate that upscaling improves the quality of the rendered image. Used to determine better printing parameters. 53 53 Return value: 54 TRUE if document is fixed-size ,FALSE otherwise.54 TRUE if document is fixed-size; FALSE otherwise. 55 55 Default return value: 56 56 TRUE … … 60 60 {{{isFixedImage();}}} 61 61 62 === isRotable() ===63 Description: 64 See: [ =#renderPageToPixbuf renderPageToPixbuf()], rotation.65 Return value: 66 TRUE if document can be rotated ,FALSE otherwise.62 === isRotable() [=#isRotable] 63 Description: 64 See: [#renderPageToPixbuf_rotation renderPageToPixbuf(), rotation]. 65 Return value: 66 TRUE if document can be rotated; FALSE otherwise. 67 67 Default return value: 68 68 FALSE … … 96 96 {{{getPageSize( in long pagenum, inout double width, inout double height );}}} 97 97 98 [=#renderPageToPixbuf ] 99 === renderPageToPixbuf() === 98 === renderPageToPixbuf() [=#renderPageToPixbuf] 100 99 Description: 101 100 First, scale the document to match the specified pixels per point, then render the rectangle given by the upper left corner at (src_x, src_y) and src_width by src_height. … … 106 105 ||src_width||width of rectangle to render|| 107 106 ||src_height||height of rectangle to render|| 108 || scale||scale specified as pixels per point (if isScalable()is FALSE, scale is ignored and assumed to be 1.0)||109 || rotation||rotate the document by the specified degree (allowed values are 0, 90, 180, 270) (if isRotable()is FALSE, rotation is ignored and assumed to be 0)||107 ||[=#renderPageToPixbuf_scale scale]||scale specified as pixels per point (if [#isScalable isScalable()] is FALSE, scale is ignored and assumed to be 1.0)|| 108 ||[=#renderPageToPixbuf_rotation rotation]||rotate the document by the specified degree (allowed values are 0, 90, 180, 270) (if [#isRotable isRotable()] is FALSE, rotation is ignored and assumed to be 0)|| 110 109 ||pixbuf||pixbuf into which we are to render|| 111 110 ||errorCode||return location for an error/warning code, or NULL|| … … 118 117 in LuPixbuf pixbuf, 119 118 out long errorCode, inout string error ); 120 }}}119 }}} 121 120 122 121 === isAsynchRenderingSupported() === … … 132 131 {{{isAsynchRenderingSupported();}}} 133 132 134 [=#renderPageToPixbufAsynch ] 135 === renderPageToPixbufAsynch() === 136 Description: 137 Same as [#renderPageToPixbuf renderPageToPixbuf()], but received pointers to draw function, abort function and functions data. Callback functions must be defined as long _System *asynchCallbackFn( void *data ); 133 === renderPageToPixbufAsynch() [=#renderPageToPixbufAsynch] 134 Description: 135 Same as [#renderPageToPixbuf renderPageToPixbuf()], but received pointers to draw function, abort function and functions data. Callback functions must be defined as long {{{_System *asynchCallbackFn( void *data );}}}. 138 136 Parameters: 139 137 ||errorCode||return location for an error/warning code, or NULL|| … … 153 151 }}} 154 152 155 === isRenderIntoPS() ===153 === isRenderIntoPS() [=#isRenderIntoPS] 156 154 Description: 157 155 See: [#renderPageToPS renderPageToPS()]. … … 161 159 FALSE 162 160 Note: 163 You may not implement renderPageToPixbuf() if isRenderIntoPS()is TRUE.161 You may not implement [#renderPageToPixbuf renderPageToPixbuf()] if [#isRenderIntoPS isRenderIntoPS()] is TRUE. 164 162 Type: 165 163 boolean … … 167 165 {{{isRenderIntoPS();}}} 168 166 169 [=#renderPageToPS ] 170 === renderPageToPS() === 167 === renderPageToPS() [=#renderPageToPS] 171 168 Description: 172 169 First scale the document to match the specified pixels per point, then render the rectangle given by the upper left corner at (src_x, src_y) and src_width and src_height. … … 177 174 ||src_width||width of rectangle to render|| 178 175 ||src_height||height of rectangle to render|| 179 ||scale||scale specified as pixels per point (if isScalable()is FALSE, scale is ignored and assumed to be 1.0)||180 ||rotation||rotate the document by the specified degree (allowed values are 0, 90, 180, 270) (if isRotable()is FALSE, rotation is ignored and assumed to be 0)||176 ||scale||scale specified as pixels per point (if [#isScalable isScalable()] is FALSE, scale is ignored and assumed to be 1.0)|| 177 ||rotation||rotate the document by the specified degree (allowed values are 0, 90, 180, 270) (if [#isRotable isRotable()] is FALSE, rotation is ignored and assumed to be 0)|| 181 178 ||hps||handle of presentation space into which we are to render|| 182 179 ||rect||pointer to RECTL structure, defines render area on HPS|| … … 204 201 {{{isHaveText();}}} 205 202 206 [=#getSelectionRectangles ] 207 === getSelectionRectangles() === 203 === getSelectionRectangles() [=#getSelectionRectangles] 208 204 Description: 209 205 Returns a sequence of rectangles containing the area that would be rendered as "selected." The returned sequence must be freed with [#freeRectangles freeRectangles()]. … … 212 208 ||selection||start and end point of selection as a rectangle|| 213 209 Return value: 214 A newly allocated LuRectSequence, or NULL if nothing is selected or the document doesn't have selectable text.210 A newly allocated !LuRectSequence, or NULL if nothing is selected or the document doesn't have selectable text. 215 211 Default return value: 216 212 NULL … … 220 216 {{{LuRectSequence *getSelectionRectangles( in long pagenum, in LuRectangle selection );}}} 221 217 222 [=#freeRectangles ] 223 === freeRectangles() === 218 === freeRectangles() [=#freeRectangles] 224 219 Description: 225 220 Deallocates a sequence of rectangles allocated by [#getSelectionRectangles getSelectionRectangles()] or [#searchText searchText()]. … … 229 224 {{{freeRectangles( in LuRectSequence rectangles );}}} 230 225 231 === getText() ===226 === getText() [=#getText] 232 227 Description: 233 228 Retrieves the contents of the specified rectangle as text. … … 236 231 ||selection||the rectangle including the text|| 237 232 Return value: 238 A pointer to the contents of the rectangle as a string or NULL. The pointer is valid until next getText() call, or untilLuDocument object is destroyed.233 A pointer to the contents of the rectangle as a string or NULL. The pointer is valid until next [#getText getText()] call, or until !LuDocument object is destroyed. 239 234 Default return value: 240 235 NULL … … 250 245 See: [#getLinkMapping getLinkMapping()]. 251 246 Return value: 252 TRUE if document may contain navigable links ,FALSE otherwise.247 TRUE if document may contain navigable links; FALSE otherwise. 253 248 Default return value: 254 249 FALSE … … 258 253 {{{isHaveLinks();}}} 259 254 260 [=#getLinkMapping ] 261 === getLinkMapping() === 262 Description: 263 Returns a sequence of LuLinkMapping items. This sequence must be freed with [#freeLinkMapping freeLinkMapping()] when done. 264 Parameters: 265 ||pagenum||page number|| 266 Return value: 267 A pointer to sequence of LuLinkMapping. 268 Default return value: 269 A pointer to an empty LuLinkMapSequence. 255 === getLinkMapping() [=#getLinkMapping] 256 Description: 257 Returns a sequence of !LuLinkMapping items. This sequence must be freed with [#freeLinkMapping freeLinkMapping()] when done. 258 Parameters: 259 ||pagenum||page number|| 260 Return value: 261 A pointer to sequence of !LuLinkMapping. 262 Default return value: 263 A pointer to an empty !LuLinkMapSequence. 270 264 Note: 271 265 SOMMalloc() must be used for all memory allocations. … … 273 267 {{{LuLinkMapSequence *getLinkMapping( in long pagenum );}}} 274 268 275 [=#freeLinkMapping ] 276 === freeLinkMapping() === 277 Description: 278 Frees a sequence of LuLinkMapping allocated by [#getLinkMapping getLinkMapping()]. 279 Parameters: 280 ||mapping||A sequence of LuLinkMapping|| 269 === freeLinkMapping() [=#freeLinkMapping] 270 Description: 271 Frees a sequence of !LuLinkMapping allocated by [#getLinkMapping getLinkMapping()]. 272 Parameters: 273 ||mapping||A sequence of !LuLinkMapping|| 281 274 Type: 282 275 void … … 288 281 Describes whether the current document may be saved. 289 282 Return value: 290 TRUE if document can be saved in same format as original ,FALSE otherwise.283 TRUE if document can be saved in same format as original; FALSE otherwise. 291 284 Default return value: 292 285 FALSE … … 303 296 304 297 Return value: 305 TRUE, if the document was successfully saved ,FALSE otherwise.298 TRUE, if the document was successfully saved; FALSE otherwise. 306 299 Default return value: 307 300 FALSE … … 313 306 === isPostScriptExportable() === 314 307 Description: 315 Describes whether the current document may be exported to PostScript.316 Return value: 317 TRUE if document can be exported to PostScript,FALSE otherwise.308 Describes whether the current document may be exported to !PostScript. 309 Return value: 310 TRUE if document can be exported to !PostScript; FALSE otherwise. 318 311 Default return value: 319 312 FALSE … … 325 318 === exportToPostScript() === 326 319 Description: 327 Create a new postscript file and generate the document to it.320 Create a new !PostScript file and generate the document to it. 328 321 Parameters: 329 322 ||filename||the path of the output filename|| … … 332 325 ||width||the paper width in 1/72 inch|| 333 326 ||height||the paper height in 1/72 inch|| 334 ||brkExport||pointer to boolean variable which must be checked during generating postscript; if TRUE, interrupt generation process.||335 Return value: 336 TRUE if PS document was generated successfully or generation was interrupted,FALSE otherwise.337 Default return value: 338 FALSE 339 Note: 340 Values for width and height will end up in the DocumentMedia, the BoundingBox DSC comments, and other places in the generatedPostScript.327 ||brkExport||pointer to boolean variable which must be checked during generating !PostScript; if TRUE, interrupt generation process.|| 328 Return value: 329 TRUE if !PostScript document was generated successfully or generation was interrupted; FALSE otherwise. 330 Default return value: 331 FALSE 332 Note: 333 Values for width and height will end up in the !DocumentMedia, the !BoundingBox DSC comments, and other places in the generated !PostScript. 341 334 Syntax: 342 335 {{{ … … 351 344 See: [#getFontInfo getFontInfo()]. 352 345 Return value: 353 TRUE if getFontInfo() can return information about fonts used in the document,FALSE otherwise.346 TRUE if [#getFontInfo getFontInfo()] can return information about fonts used in the document; FALSE otherwise. 354 347 Default return value: 355 348 FALSE … … 359 352 {{{isHaveFontInfo();}}} 360 353 361 [=#getFontInfo ] 362 === getFontInfo() === 354 === getFontInfo() [=#getFontInfo] 363 355 Description: 364 356 Returns information about fonts used in document. Returned sequence must be freed with [#freeFontInfo freeFontInfo()] when done. 365 357 Return value: 366 A pointer to the sequence of LuFontInfo or NULL if no font information.358 A pointer to the sequence of !LuFontInfo or NULL if no font information. 367 359 Default return value: 368 360 NULL … … 372 364 {{{LuFontInfoSequence *getFontInfo();}}} 373 365 374 [=#freeFontInfo ] 375 === freeFontInfo() === 376 Description: 377 Frees a sequence of LuFontInfo allocated by [#getFontInfo getFontInfo()]. 378 Parameters: 379 ||fonts||A sequence of LuFontInfo|| 366 === freeFontInfo() [=#freeFontInfo] 367 Description: 368 Frees a sequence of !LuFontInfo allocated by [#getFontInfo getFontInfo()]. 369 Parameters: 370 ||fonts||A sequence of !LuFontInfo|| 380 371 Type: 381 372 void … … 385 376 === isHaveIndex() === 386 377 Description: 387 Determines if the document has an index associated with it. See [#getIndex getIndex()]. 388 Return value: 389 TRUE if the document has an index, FALSE otherwise. 390 Default return value: 391 FALSE 392 Type: 393 boolean 394 Syntax: 395 isHaveIndex(); 396 397 [=#getIndex ] 398 === getIndex() === 399 Description: 400 Certain documents have an index associated with them. This index can be used to help the user navigate the document, and is similar to a table of contents. Each node in the index will contain a LuLink which can be displayed to the user. 378 Determines if the document has an index associated with it. See: [#getIndex getIndex()]. 379 Return value: 380 TRUE if the document has an index; FALSE otherwise. 381 Default return value: 382 FALSE 383 Type: 384 boolean 385 Syntax: 386 {{{isHaveIndex();}}} 387 388 === getIndex() [=#getIndex] 389 Description: 390 Certain documents have an index associated with them. This index can be used to help the user navigate the document, and is similar to a table of contents. Each node in the index will contain a !LuLink which can be displayed to the user. 401 391 402 392 Here is a simple example of some code that walks the full index: … … 418 408 }}} 419 409 Return value: 420 A new LuIndexNode, which represents an index root, or NULL, if the document doesn't have an index.410 A new !LuIndexNode, which represents an index root, or NULL, if the document doesn't have an index. 421 411 Default return value: 422 412 NULL … … 424 414 {{{LuIndexNode getIndex();}}} 425 415 426 [=#getDocumentInfo ] 427 === getDocumentInfo() === 416 === getDocumentInfo() [=#getDocumentInfo] 428 417 Description: 429 418 Returns information about the current document. Returned sequence must be freed with [#freeDocumentInfo freeDocumentInfo()] when done. 430 419 Return value: 431 A pointer to the sequence of LuDocumentInfo or NULL if no information is available.420 A pointer to the sequence of !LuDocumentInfo or NULL if no information is available. 432 421 Default return value: 433 422 NULL … … 435 424 {{{LuDocumentInfo *getDocumentInfo();}}} 436 425 437 [=#freeDocumentInfo ] 438 === freeDocumentInfo() === 439 Description: 440 Frees a LuDocumentInfo structure allocated by [#getDocumentInfo getDocumentInfo()]. 441 Parameters: 442 ||info||LuDocumentInfo structure allocated by [#getDocumentInfo getDocumentInfo()]|| 426 === freeDocumentInfo() [=#freeDocumentInfo] 427 Description: 428 Frees a !LuDocumentInfo structure allocated by [#getDocumentInfo getDocumentInfo()]. 429 Parameters: 430 ||info||!LuDocumentInfo structure allocated by [#getDocumentInfo getDocumentInfo()]|| 443 431 Type: 444 432 void … … 455 443 ||height||value for height|| 456 444 Return value: 457 TRUE, if the page has a thumbnail associated with it ,FALSE otherwise.445 TRUE, if the page has a thumbnail associated with it; FALSE otherwise. 458 446 Default return value: 459 447 FALSE … … 463 451 === getThumbnail() === 464 452 Description: 465 Returns pointer to LuPixbuf.453 Returns pointer to !LuPixbuf. 466 454 Parameters: 467 455 ||pagenum||page number|| 468 456 ||suggested_width||if thumbnail doesn't have a predefined width, it will be created with suggested_width.|| 469 457 Return value: 470 Pointer to LuPixbuf, if page has a thumbnail associated with it, or NULL.458 Pointer to !LuPixbuf, if page has a thumbnail associated with it, or NULL. 471 459 Default return value: 472 460 NULL … … 474 462 {{{LuPixbuf getThumbnail( in long pagenum, in short suggested_width );}}} 475 463 476 [=#searchText ] 477 === searchText() === 464 === searchText() [=#searchText] 478 465 Description: 479 466 Returns a sequence of rectangles for each occurrence of the text found on the page. The returned sequence must be freed with [#freeRectangles freeRectangles()]. … … 482 469 ||text||the text to find (in system encoding)|| 483 470 Return value: 484 A newly allocated LuRectSequence, or NULL if nothing found471 A newly allocated !LuRectSequence, or NULL if nothing found 485 472 Default return value: 486 473 NULL … … 497 484 If this method returns TRUE, then GUI may create a thumbnail for this file and write it into the file's EAs. 498 485 Return value: 499 TRUE, if thumbnail may be created ,FALSE otherwise.486 TRUE, if thumbnail may be created; FALSE otherwise. 500 487 Default return value: 501 488 FALSE … … 507 494 === isHaveInputFields() === 508 495 Description: 509 Returns TRUE if the document contains input fields ,FALSE otherwise. See: [#getInputFields getInputFields()].510 Return value: 511 TRUE, if the document contains input fields ,FALSE otherwise.496 Returns TRUE if the document contains input fields; FALSE otherwise. See: [#getInputFields getInputFields()]. 497 Return value: 498 TRUE, if the document contains input fields; FALSE otherwise. 512 499 Default return value: 513 500 FALSE … … 517 504 {{{isHaveInputFields();}}} 518 505 519 [=#getInputFields ] 520 === getInputFields() === 521 Description: 522 Returns a sequence of LuInputField items that may be used to enter data into the document. This sequence must be freed with [#freeInputFields freeInputFields()] when done. 523 Parameters: 524 ||pagenum||page number|| 525 Return value: 526 A pointer to sequence of valid LuInputField items. 527 Default return value: 528 A pointer to an empty LuInputFieldSequence. 506 === getInputFields() [=#getInputFields] 507 Description: 508 Returns a sequence of !LuInputField items that may be used to enter data into the document. This sequence must be freed with [#freeInputFields freeInputFields()] when done. 509 Parameters: 510 ||pagenum||page number|| 511 Return value: 512 A pointer to sequence of valid !LuInputField items. 513 Default return value: 514 A pointer to an empty !LuInputFieldSequence. 529 515 Note: 530 516 The returned sequence must be allocated with SOMMalloc(), each element must be a newly created SOM object. … … 532 518 {{{LuInputFieldSequence *getInputFields( in long pagenum );}}} 533 519 534 [=#freeInputFields ] 535 === freeInputFields() === 520 === freeInputFields() [=#freeInputFields] 536 521 Description: 537 522 Frees the input field sequence returned by [#getInputFields getInputFields()]. Subclasses should never override this method.