[61] | 1 | |
---|
| 2 | /* |
---|
| 3 | * This file was generated by the SOM Compiler. |
---|
| 4 | * Generated using: |
---|
| 5 | * SOM incremental update: 2.24 |
---|
| 6 | */ |
---|
| 7 | |
---|
[92] | 8 | |
---|
[35] | 9 | /* ***** BEGIN LICENSE BLOCK ***** |
---|
| 10 | * Version: CDDL 1.0/LGPL 2.1 |
---|
| 11 | * |
---|
| 12 | * The contents of this file are subject to the COMMON DEVELOPMENT AND |
---|
| 13 | * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use |
---|
| 14 | * this file except in compliance with the License. You may obtain a copy of |
---|
| 15 | * the License at http://www.sun.com/cddl/ |
---|
| 16 | * |
---|
| 17 | * Software distributed under the License is distributed on an "AS IS" basis, |
---|
| 18 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
---|
| 19 | * for the specific language governing rights and limitations under the |
---|
| 20 | * License. |
---|
| 21 | * |
---|
| 22 | * The Initial Developer of the Original Code is |
---|
| 23 | * Eugene Romanenko, netlabs.org. |
---|
| 24 | * Portions created by the Initial Developer are Copyright (C) 2006 |
---|
| 25 | * the Initial Developer. All Rights Reserved. |
---|
| 26 | * |
---|
| 27 | * Contributor(s): |
---|
| 28 | * |
---|
| 29 | * Alternatively, the contents of this file may be used under the terms of |
---|
| 30 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
---|
| 31 | * in which case the provisions of the LGPL are applicable instead of those |
---|
| 32 | * above. If you wish to allow use of your version of this file only under the |
---|
| 33 | * terms of the LGPL, and not to allow others to use your version of this file |
---|
| 34 | * under the terms of the CDDL, indicate your decision by deleting the |
---|
| 35 | * provisions above and replace them with the notice and other provisions |
---|
| 36 | * required by the LGPL. If you do not delete the provisions above, a recipient |
---|
| 37 | * may use your version of this file under the terms of any one of the CDDL |
---|
| 38 | * or the LGPL. |
---|
| 39 | * |
---|
| 40 | * ***** END LICENSE BLOCK ***** */ |
---|
[2] | 41 | |
---|
[35] | 42 | |
---|
| 43 | |
---|
[2] | 44 | /* |
---|
| 45 | * This file was generated by the SOM Compiler and Emitter Framework. |
---|
| 46 | * Generated using template emitter: |
---|
| 47 | * SOM Emitter emitxtm: 2.23.1.9 |
---|
| 48 | */ |
---|
| 49 | |
---|
| 50 | #ifndef SOM_Module_ludoc_Source |
---|
| 51 | #define SOM_Module_ludoc_Source |
---|
| 52 | #endif |
---|
| 53 | #define LuDocument_Class_Source |
---|
| 54 | |
---|
| 55 | #include "ludoc.xih" |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | unsigned _System LibMain( unsigned hmod, unsigned termination ) |
---|
| 59 | { |
---|
| 60 | if ( termination ) { |
---|
| 61 | /* DLL is detaching from process */ |
---|
| 62 | } else { |
---|
| 63 | /* DLL is attaching to process */ |
---|
| 64 | } |
---|
| 65 | return( 1 ); |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | extern "C" LuDocument * _System createObject() |
---|
| 70 | { |
---|
| 71 | return new LuDocument; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | extern "C" char * _System getSupportedExtensions() |
---|
| 75 | { |
---|
| 76 | return ""; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | extern "C" char * _System getDescription() |
---|
| 80 | { |
---|
| 81 | return "NULL plugin, abstract base class for Lucide plugins."; |
---|
| 82 | } |
---|
| 83 | |
---|
[27] | 84 | |
---|
| 85 | /* |
---|
| 86 | * SOM_Scope long SOMLINK getBpp(LuDocument *somSelf, Environment *ev) |
---|
| 87 | */ |
---|
| 88 | |
---|
| 89 | /* |
---|
| 90 | * The prototype for getBpp was replaced by the following prototype: |
---|
| 91 | */ |
---|
| 92 | SOM_Scope short SOMLINK getBpp(LuDocument *somSelf, Environment *ev) |
---|
| 93 | { |
---|
| 94 | // Abstract method does nothing |
---|
| 95 | return 0; |
---|
| 96 | } |
---|
| 97 | |
---|
[2] | 98 | SOM_Scope boolean SOMLINK isScalable(LuDocument *somSelf, Environment *ev) |
---|
| 99 | { |
---|
| 100 | return FALSE; |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | |
---|
[95] | 104 | SOM_Scope boolean SOMLINK isFixedImage(LuDocument *somSelf, |
---|
| 105 | Environment *ev) |
---|
| 106 | { |
---|
| 107 | return TRUE; |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | |
---|
[2] | 111 | SOM_Scope boolean SOMLINK isRotable(LuDocument *somSelf, Environment *ev) |
---|
| 112 | { |
---|
| 113 | return FALSE; |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | SOM_Scope long SOMLINK getPageCount(LuDocument *somSelf, Environment *ev) |
---|
| 118 | { |
---|
| 119 | // Abstract method does nothing |
---|
| 120 | return 0; |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | SOM_Scope void SOMLINK getPageSize(LuDocument *somSelf, Environment *ev, |
---|
| 125 | long pagenum, double* width, |
---|
| 126 | double* height) |
---|
| 127 | { |
---|
| 128 | // Abstract method does nothing |
---|
| 129 | } |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | SOM_Scope void SOMLINK renderPageToPixbuf(LuDocument *somSelf, |
---|
| 133 | Environment *ev, |
---|
| 134 | long pagenum, long src_x, |
---|
| 135 | long src_y, long src_width, |
---|
| 136 | long src_height, double scale, |
---|
| 137 | long rotation, LuPixbuf* pixbuf) |
---|
| 138 | { |
---|
| 139 | // Abstract method does nothing |
---|
| 140 | } |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | SOM_Scope boolean SOMLINK isAsynchRenderingSupported(LuDocument *somSelf, |
---|
| 144 | Environment *ev) |
---|
| 145 | { |
---|
| 146 | return FALSE; |
---|
| 147 | } |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | SOM_Scope void SOMLINK renderPageToPixbufAsynch(LuDocument *somSelf, |
---|
| 151 | Environment *ev, |
---|
| 152 | long pagenum, |
---|
| 153 | long src_x, |
---|
| 154 | long src_y, |
---|
| 155 | long src_width, |
---|
| 156 | long src_height, |
---|
| 157 | double scale, |
---|
| 158 | long rotation, |
---|
| 159 | LuPixbuf* pixbuf, |
---|
| 160 | LuDocument_asynchCallbackFn fnd, |
---|
| 161 | LuDocument_asynchCallbackFn fna, |
---|
| 162 | somToken fndata) |
---|
| 163 | { |
---|
| 164 | // Abstract method does nothing |
---|
| 165 | } |
---|
| 166 | |
---|
[61] | 167 | |
---|
| 168 | SOM_Scope boolean SOMLINK isRenderIntoPS(LuDocument *somSelf, |
---|
| 169 | Environment *ev) |
---|
| 170 | { |
---|
| 171 | return FALSE; |
---|
| 172 | } |
---|
| 173 | |
---|
| 174 | SOM_Scope void SOMLINK renderPageToPS(LuDocument *somSelf, Environment *ev, |
---|
| 175 | long pagenum, long src_x, |
---|
| 176 | long src_y, long src_width, |
---|
| 177 | long src_height, double scale, |
---|
| 178 | long rotation, unsigned long hps, |
---|
| 179 | somMToken rect) |
---|
| 180 | { |
---|
| 181 | // Abstract method does nothing |
---|
| 182 | } |
---|
| 183 | |
---|
| 184 | |
---|
[2] | 185 | SOM_Scope boolean SOMLINK isHaveText(LuDocument *somSelf, |
---|
| 186 | Environment *ev) |
---|
| 187 | { |
---|
| 188 | return FALSE; |
---|
| 189 | } |
---|
| 190 | |
---|
| 191 | |
---|
| 192 | SOM_Scope LuDocument_LuRectSequence* SOMLINK getSelectionRectangles(LuDocument *somSelf, |
---|
| 193 | Environment *ev, |
---|
| 194 | long pagenum, |
---|
| 195 | LuRectangle* selection) |
---|
| 196 | { |
---|
| 197 | // Abstract method does nothing |
---|
| 198 | return NULL; |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | SOM_Scope void SOMLINK freeRectangles(Environment *ev, |
---|
| 203 | LuDocument_LuRectSequence* rectangles) |
---|
| 204 | { |
---|
| 205 | if ( rectangles != NULL ) |
---|
| 206 | { |
---|
| 207 | if ( ( ( rectangles->_maximum != 0 ) || |
---|
| 208 | ( rectangles->_length != 0 ) ) && |
---|
| 209 | ( rectangles->_buffer != NULL ) ) |
---|
| 210 | { |
---|
| 211 | SOMFree( rectangles->_buffer ); |
---|
| 212 | } |
---|
| 213 | SOMFree( rectangles ); |
---|
| 214 | } |
---|
| 215 | } |
---|
| 216 | |
---|
| 217 | |
---|
| 218 | SOM_Scope string SOMLINK getText(LuDocument *somSelf, Environment *ev, |
---|
| 219 | long pagenum, LuRectangle* selection) |
---|
| 220 | { |
---|
| 221 | // Abstract method does nothing |
---|
| 222 | return NULL; |
---|
| 223 | } |
---|
| 224 | |
---|
| 225 | |
---|
| 226 | SOM_Scope boolean SOMLINK isHaveLinks(LuDocument *somSelf, Environment *ev) |
---|
| 227 | { |
---|
| 228 | return FALSE; |
---|
| 229 | } |
---|
| 230 | |
---|
| 231 | |
---|
| 232 | SOM_Scope LuDocument_LuLinkMapSequence* SOMLINK getLinkMapping(LuDocument *somSelf, |
---|
| 233 | Environment *ev, |
---|
| 234 | long pagenum) |
---|
| 235 | { |
---|
[126] | 236 | // Abstract method, returns empty sequence |
---|
| 237 | LuDocument_LuLinkMapSequence *mapping = NULL; |
---|
| 238 | mapping = (LuDocument_LuLinkMapSequence *)SOMMalloc( sizeof( LuDocument_LuLinkMapSequence ) ); |
---|
| 239 | mapping->_maximum = 0; |
---|
| 240 | mapping->_length = 0; |
---|
| 241 | mapping->_buffer = NULL; |
---|
| 242 | return mapping; |
---|
[2] | 243 | } |
---|
| 244 | |
---|
| 245 | |
---|
| 246 | SOM_Scope void SOMLINK freeLinkMapping(Environment *ev, |
---|
| 247 | LuDocument_LuLinkMapSequence* mapping) |
---|
| 248 | { |
---|
| 249 | if ( mapping != NULL ) |
---|
| 250 | { |
---|
| 251 | if ( ( ( mapping->_maximum != 0 ) || |
---|
| 252 | ( mapping->_length != 0 ) ) && |
---|
| 253 | ( mapping->_buffer != NULL ) ) |
---|
| 254 | { |
---|
| 255 | for ( int i = 0; i < mapping->_length; i++ ) |
---|
| 256 | { |
---|
| 257 | if ( mapping->_buffer[ i ].link.title != NULL ) { |
---|
| 258 | SOMFree( mapping->_buffer[ i ].link.title ); |
---|
| 259 | } |
---|
| 260 | if ( mapping->_buffer[ i ].link.uri != NULL ) { |
---|
| 261 | SOMFree( mapping->_buffer[ i ].link.uri ); |
---|
| 262 | } |
---|
| 263 | } |
---|
| 264 | |
---|
| 265 | SOMFree( mapping->_buffer ); |
---|
| 266 | } |
---|
| 267 | SOMFree( mapping ); |
---|
| 268 | } |
---|
| 269 | } |
---|
| 270 | |
---|
| 271 | |
---|
| 272 | SOM_Scope boolean SOMLINK isSaveable(LuDocument *somSelf, Environment *ev) |
---|
| 273 | { |
---|
| 274 | return FALSE; |
---|
| 275 | } |
---|
| 276 | |
---|
| 277 | |
---|
| 278 | SOM_Scope boolean SOMLINK saveAs(LuDocument *somSelf, Environment *ev, |
---|
| 279 | string filename) |
---|
| 280 | { |
---|
| 281 | // Abstract method does nothing |
---|
| 282 | return FALSE; |
---|
| 283 | } |
---|
| 284 | |
---|
| 285 | |
---|
[61] | 286 | SOM_Scope boolean SOMLINK isPostScriptExportable(LuDocument *somSelf, |
---|
[2] | 287 | Environment *ev) |
---|
| 288 | { |
---|
| 289 | return FALSE; |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | |
---|
[92] | 293 | SOM_Scope boolean SOMLINK exportToPostScript(LuDocument *somSelf, |
---|
| 294 | Environment *ev, |
---|
| 295 | string filename, |
---|
| 296 | long first_page, |
---|
| 297 | long last_page, |
---|
| 298 | double width, double height, |
---|
| 299 | boolean* brkExport) |
---|
[2] | 300 | { |
---|
| 301 | // Abstract method does nothing |
---|
[91] | 302 | return FALSE; |
---|
[2] | 303 | } |
---|
| 304 | |
---|
| 305 | |
---|
| 306 | SOM_Scope boolean SOMLINK isHaveFontInfo(LuDocument *somSelf, |
---|
| 307 | Environment *ev) |
---|
| 308 | { |
---|
| 309 | return FALSE; |
---|
| 310 | } |
---|
| 311 | |
---|
| 312 | |
---|
| 313 | SOM_Scope LuDocument_LuFontInfoSequence* SOMLINK getFontInfo(LuDocument *somSelf, |
---|
| 314 | Environment *ev) |
---|
| 315 | { |
---|
| 316 | // Abstract method does nothing |
---|
| 317 | return NULL; |
---|
| 318 | } |
---|
| 319 | |
---|
| 320 | |
---|
| 321 | SOM_Scope void SOMLINK freeFontInfo(Environment *ev, |
---|
| 322 | LuDocument_LuFontInfoSequence* fonts) |
---|
| 323 | { |
---|
| 324 | if ( fonts != NULL ) |
---|
| 325 | { |
---|
| 326 | if ( ( ( fonts->_maximum != 0 ) || |
---|
| 327 | ( fonts->_length != 0 ) ) && |
---|
| 328 | ( fonts->_buffer != NULL ) ) |
---|
| 329 | { |
---|
| 330 | for ( int i = 0; i < fonts->_length; i++ ) |
---|
| 331 | { |
---|
| 332 | if ( fonts->_buffer[ i ].name != NULL ) { |
---|
| 333 | SOMFree( fonts->_buffer[ i ].name ); |
---|
| 334 | } |
---|
| 335 | if ( fonts->_buffer[ i ].type != NULL ) { |
---|
| 336 | SOMFree( fonts->_buffer[ i ].type ); |
---|
| 337 | } |
---|
| 338 | } |
---|
| 339 | |
---|
| 340 | SOMFree( fonts->_buffer ); |
---|
| 341 | } |
---|
| 342 | SOMFree( fonts ); |
---|
| 343 | } |
---|
| 344 | } |
---|
| 345 | |
---|
| 346 | |
---|
| 347 | SOM_Scope boolean SOMLINK isHaveIndex(LuDocument *somSelf, Environment *ev) |
---|
| 348 | { |
---|
| 349 | return FALSE; |
---|
| 350 | } |
---|
| 351 | |
---|
| 352 | |
---|
| 353 | SOM_Scope LuIndexNode* SOMLINK getIndex(LuDocument *somSelf, |
---|
| 354 | Environment *ev) |
---|
| 355 | { |
---|
| 356 | // Abstract method does nothing |
---|
| 357 | return NULL; |
---|
| 358 | } |
---|
| 359 | |
---|
| 360 | |
---|
| 361 | SOM_Scope LuDocumentInfo* SOMLINK getDocumentInfo(LuDocument *somSelf, |
---|
| 362 | Environment *ev) |
---|
| 363 | { |
---|
| 364 | LuDocumentInfo *info = (LuDocumentInfo *)SOMMalloc( sizeof( LuDocumentInfo ) ); |
---|
| 365 | memset( info, 0, sizeof( LuDocumentInfo ) ); |
---|
| 366 | return info; |
---|
| 367 | } |
---|
| 368 | |
---|
| 369 | |
---|
| 370 | SOM_Scope void SOMLINK freeDocumentInfo(Environment *ev, LuDocumentInfo* info) |
---|
| 371 | { |
---|
| 372 | if ( info != NULL ) |
---|
| 373 | { |
---|
| 374 | if ( info->fields_mask & LU_DOCUMENT_INFO_TITLE ) { |
---|
| 375 | SOMFree( info->title ); |
---|
| 376 | } |
---|
| 377 | if ( info->fields_mask & LU_DOCUMENT_INFO_FORMAT ) { |
---|
| 378 | SOMFree( info->format ); |
---|
| 379 | } |
---|
| 380 | if ( info->fields_mask & LU_DOCUMENT_INFO_AUTHOR ) { |
---|
| 381 | SOMFree( info->author ); |
---|
| 382 | } |
---|
| 383 | if ( info->fields_mask & LU_DOCUMENT_INFO_SUBJECT ) { |
---|
| 384 | SOMFree( info->subject ); |
---|
| 385 | } |
---|
| 386 | if ( info->fields_mask & LU_DOCUMENT_INFO_KEYWORDS ) { |
---|
| 387 | SOMFree( info->keywords ); |
---|
| 388 | } |
---|
| 389 | if ( info->fields_mask & LU_DOCUMENT_INFO_CREATOR ) { |
---|
| 390 | SOMFree( info->creator ); |
---|
| 391 | } |
---|
| 392 | if ( info->fields_mask & LU_DOCUMENT_INFO_PRODUCER ) { |
---|
| 393 | SOMFree( info->producer ); |
---|
| 394 | } |
---|
| 395 | |
---|
| 396 | SOMFree( info ); |
---|
| 397 | } |
---|
| 398 | } |
---|
| 399 | |
---|
| 400 | |
---|
| 401 | SOM_Scope boolean SOMLINK getThumbnailSize(LuDocument *somSelf, |
---|
| 402 | Environment *ev, |
---|
| 403 | long pagenum, |
---|
| 404 | short suggested_width, |
---|
| 405 | short* width, short* height) |
---|
| 406 | { |
---|
| 407 | // Abstract method does nothing |
---|
| 408 | return FALSE; |
---|
| 409 | } |
---|
| 410 | |
---|
| 411 | |
---|
| 412 | SOM_Scope LuPixbuf* SOMLINK getThumbnail(LuDocument *somSelf, |
---|
| 413 | Environment *ev, long pagenum, |
---|
| 414 | short suggested_width) |
---|
| 415 | { |
---|
| 416 | // Abstract method does nothing |
---|
| 417 | return NULL; |
---|
| 418 | } |
---|
| 419 | |
---|
| 420 | |
---|
| 421 | SOM_Scope LuDocument_LuRectSequence* SOMLINK searchText(LuDocument *somSelf, |
---|
| 422 | Environment *ev, |
---|
| 423 | long pagenum, |
---|
| 424 | string text, |
---|
| 425 | boolean caseSensitive ) |
---|
| 426 | { |
---|
| 427 | // Abstract method does nothing |
---|
| 428 | return NULL; |
---|
| 429 | } |
---|
| 430 | |
---|
| 431 | |
---|
[153] | 432 | SOM_Scope boolean SOMLINK isCreateFileThumbnail(LuDocument *somSelf, |
---|
| 433 | Environment *ev) |
---|
| 434 | { |
---|
| 435 | return FALSE; |
---|
| 436 | } |
---|
| 437 | |
---|
| 438 | |
---|
[2] | 439 | SOM_Scope void SOMLINK somDefaultInit(LuDocument *somSelf, som3InitCtrl* ctrl) |
---|
| 440 | { |
---|
| 441 | somInitCtrl globalCtrl; |
---|
| 442 | somBooleanVector myMask; |
---|
| 443 | LuDocument_BeginInitializer_somDefaultInit; |
---|
| 444 | LuDocument_Init_SOMObject_somDefaultInit(somSelf, ctrl); |
---|
| 445 | } |
---|
| 446 | |
---|
| 447 | |
---|
| 448 | SOM_Scope boolean SOMLINK loadFile(LuDocument *somSelf, Environment *ev, |
---|
| 449 | string filename, string password, |
---|
| 450 | string* error) |
---|
| 451 | { |
---|
| 452 | // Abstract method does nothing |
---|
| 453 | return FALSE; |
---|
| 454 | } |
---|
| 455 | |
---|