00001 /***** 00002 * mi32/html.h - XmHTML Widget public header file. 00003 * Resource defines, enumerations and structures. 00004 * 00005 * This file Version $Revision: 1.3 $ 00006 * 00007 * Creation date: Tue Apr 15 23:39:26 GMT+0100 1997 00008 * Last modification: $Date: 2003/09/15 13:49:56 $ 00009 * By: $Author: fileserver!dwilliss $ 00010 * Current State: $State: Exp $ 00011 * 00012 * Author: newt 00013 * 00014 * Copyright (C) 1994-1997 by Ripley Software Development 00015 * All Rights Reserved 00016 * 00017 * This file is part of the XmHTML Widget Library 00018 * 00019 * This library is free software; you can redistribute it and/or 00020 * modify it under the terms of the GNU Library General Public 00021 * License as published by the Free Software Foundation; either 00022 * version 2 of the License, or (at your option) any later version. 00023 * 00024 * This library is distributed in the hope that it will be useful, 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00027 * Library General Public License for more details. 00028 * 00029 * You should have received a copy of the GNU Library General Public 00030 * License along with this library; if not, write to the Free 00031 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00032 * 00033 *****/ 00034 00035 #ifndef INC_MI32_HTML_H 00036 #define INC_MI32_HTML_H 00037 00038 /***** 00039 * $Source: /usr/local/tntsdk/tnt72/include/mi32/RCS/html.h_v $ 00040 *****/ 00041 /***** 00042 * ChangeLog 00043 * $Log: html.h_v $ 00044 * Revision 1.3 2003/09/15 13:49:56 fileserver!dwilliss 00045 * Doxygen 00046 * 00047 * Revision 1.2 1998/09/16 16:48:35 coffee!dwilliss 00048 * Update to 1.1.5 00049 * 00050 * Revision 1.8 1998/04/27 06:54:30 newt 00051 * Changed XmImageProc proto 00052 * 00053 * Revision 1.7 1998/04/04 06:27:46 newt 00054 * XmHTML Beta 1.1.3 00055 * 00056 * Revision 1.6 1997/10/23 00:24:27 newt 00057 * XmHTML Beta 1.1.0 release 00058 * 00059 * Revision 1.5 1997/08/31 17:30:39 newt 00060 * Removed HT_TEXTFLOW 00061 * 00062 * Revision 1.4 1997/08/30 00:22:46 newt 00063 * Alpha channel resources: XmNalphaChannelProcessing and 00064 * XmNimageRGBConversion. Updated comments and reorganized a bunch of things. 00065 * 00066 * Revision 1.3 1997/08/01 12:52:11 newt 00067 * Progressive image loading changes 00068 * 00069 * Revision 1.2 1997/05/28 01:29:28 newt 00070 * XmImage changes: added the XmImageConfig structure and configuration flags. 00071 * Added support for the XmNdecodeGIFProc resource. 00072 * 00073 * Revision 1.1 1997/04/29 14:19:18 newt 00074 * Initial Revision 00075 * 00076 *****/ 00077 00078 #ifndef _HTML_h_ 00079 #define _HTML_h_ 00080 00081 /* include our new resources */ 00082 #include <mi32/htmlstrs.h> 00083 00084 /****************************************************************************** 00085 * Enumerations and other constants 00086 ******************************************************************************/ 00087 00088 /***** 00089 * HTML Elements internal id's 00090 * This list is alphabetically sorted to speed up the searching process. 00091 * DO NOT MODIFY 00092 *****/ 00093 typedef enum{ 00094 HT_DOCTYPE, HT_A, HT_ADDRESS, HT_APPLET, HT_AREA, HT_B, HT_BASE, HT_BASEFONT, 00095 HT_BIG, HT_BLOCKQUOTE, HT_BODY, HT_BR, HT_CAPTION, HT_CENTER, HT_CITE, HT_CODE, 00096 HT_DD, HT_DFN, HT_DIR, HT_DIV, HT_DL, HT_DT, HT_EM, HT_FONT, HT_FORM, HT_FRAME, 00097 HT_FRAMESET, HT_H1, HT_H2, HT_H3, HT_H4, HT_H5, HT_H6, HT_HEAD, HT_HR, HT_HTML, 00098 HT_I, HT_IMG, HT_INPUT, HT_ISINDEX, HT_KBD, HT_LI, HT_LINK, HT_MAP, HT_MENU, 00099 HT_META, HT_NOFRAMES, HT_OL, HT_OPTION, HT_P, HT_PAGE, HT_PARAM, HT_PRE, 00100 HT_SAMP, HT_SCRIPT, HT_SELECT, HT_SMALL, HT_STRIKE, HT_STRONG, HT_STYLE, HT_SUB, 00101 HT_SUP, HT_TAB, HT_TABLE, HT_TD, HT_TEXTAREA, HT_TH, HT_TITLE, 00102 HT_TR, HT_TT, HT_U, HT_UL, HT_VAR, HT_ZTEXT 00103 }htmlEnum; 00104 00105 /***** 00106 * Corresponding HTML element name table. Indexing with the above enumeration 00107 * will give the corresponding element name. 00108 *****/ 00109 extern String *html_tokens; 00110 00111 /***** 00112 * XmHTML defines the following callback reasons. This might produce strange 00113 * results once Motif decides to uses enum values above 16383. 00114 * Send us a mail at ripley@xs4all.nl if you get problems that are due to 00115 * these enumeration values. 00116 *****/ 00117 enum{ 00118 XmCR_HTML_ANCHORTRACK = 16384, //!< XmNanchorTrackCallback 00119 XmCR_HTML_DOCUMENT, //!< XmNdocumentCallback 00120 XmCR_HTML_FORM, //!< XmNformCallback 00121 XmCR_HTML_FRAME, //!< XmNframeCallback 00122 XmCR_HTML_FRAMECREATE, //!< XmNframeCallback 00123 XmCR_HTML_FRAMEDESTROY, //!< XmNframeCallback 00124 XmCR_HTML_IMAGEMAPACTIVATE, //!< XmNimagemapCallback 00125 XmCR_HTML_IMAGEMAP, //!< XmNimagemapCallback 00126 XmCR_HTML_LINK, //!< XmNlinkCallback 00127 XmCR_HTML_MODIFYING_TEXT_VALUE, //!< XmNmodifyVerifyCallback 00128 XmCR_HTML_MOTIONTRACK, //!< XmNmotionTrackCallback 00129 XmCR_HTML_PARSER, //!< XmNparserCallback 00130 XmCR_HTML_EVENT, //!< XmNeventCallback 00131 XmCR_HTML_EVENTDESTROY, //!< XmNeventCallback 00132 XmCR_HTML_OBJECT, //!< XmNobjectCallback 00133 XmCR_HTML_OBJECTCREATE, //!< XmNobjectCallback 00134 XmCR_HTML_OBJECTDESTROY //!< XmNobjectCallback 00135 }; 00136 00137 /***** 00138 * XmNeventCallback sub event types 00139 *****/ 00140 enum{ 00141 /* Document/Frame specific events */ 00142 XmCR_HTML_LOAD = 0, //!< onLoad 00143 XmCR_HTML_UNLOAD, //!< onUnLoad 00144 00145 /* HTML Form specific events */ 00146 XmCR_HTML_SUBMIT, //!< onSubmit 00147 XmCR_HTML_RESET, //!< onReset 00148 XmCR_HTML_FOCUS, //!< onFocus 00149 XmCR_HTML_BLUR, //!< onBlur 00150 XmCR_HTML_SELECT, //!< onSelect 00151 XmCR_HTML_CHANGE, //!< onChange 00152 00153 /* object events */ 00154 XmCR_HTML_CLICK, //!< onClick 00155 XmCR_HTML_DOUBLE_CLICK, //!< onDblClick 00156 XmCR_HTML_MOUSEDOWN, //!< onMouseDown 00157 XmCR_HTML_MOUSEUP, //!< onMouseUp 00158 XmCR_HTML_MOUSEOVER, //!< onMouseOver 00159 XmCR_HTML_MOUSEMOVE, //!< onMouseMove 00160 XmCR_HTML_MOUSEOUT, //!< onMouseOut 00161 XmCR_HTML_KEYPRESS, //!< onKeyPress 00162 XmCR_HTML_KEYDOWN, //!< onKeyDown 00163 XmCR_HTML_KEYUP, //!< onKeyUp 00164 XmCR_HTML_USEREVENT //!< must always be last 00165 }; 00166 00167 /***** 00168 * URL types XmHTML knows of. 00169 * The hostnames, files and port numbers are only shown for demonstration 00170 * purposes, XmHTML doesn't care whether they are present or not. 00171 * The first 16 elements are alphabetically sorted to speed up URL 00172 * translations. 00173 *****/ 00174 typedef enum{ 00175 ANCHOR_ABOUT = 0, //!< href="about:..." 00176 ANCHOR_EXEC, //!< href="exec:foo_bar" 00177 ANCHOR_FILE_REMOTE, //!< href="file://!foo.bar/file.html" 00178 ANCHOR_FTP, //!< href="ftp://!foo.bar/file" 00179 ANCHOR_GOPHER, //!< href="gopher://!foo.bar:70" 00180 ANCHOR_HTTP, //!< href="http://!foo.bar/file.html" 00181 ANCHOR_SECURE_HTTP, //!< href="https://!foo.bar/file.html" 00182 ANCHOR_INFO, //!< href="info:.." 00183 ANCHOR_MAILTO, //!< href="mailto:foo@bar" 00184 ANCHOR_MAN, //!< href="man:..." 00185 ANCHOR_NEWS, //!< href="news://!foo.bar" 00186 ANCHOR_PIPE, //!< href="pipe:foo_bar" 00187 ANCHOR_TELNET, //!< href="telnet://!foo.bar:23" 00188 ANCHOR_WAIS, //!< href="wais://!foo.bar" 00189 ANCHOR_XEXEC, //!< href="xexec:foo_bar" 00190 ANCHOR_UNKNOWN, //!< unknown href 00191 ANCHOR_FILE_LOCAL, //!< href="file.html" 00192 ">, only used internally">ANCHOR_FORM_IMAGE, //!< <input type=image>, only used internally 00193 ANCHOR_JUMP, //!< href="#..." 00194 ANCHOR_NAMED //!< name="...." 00195 }URLType; 00196 00197 /***** 00198 * Various methods of loading documents. 00199 * LOAD_NORMAL 00200 * The entire document is provided. This is the default method of loading 00201 * documents. 00202 * LOAD_PROGRESSIVE 00203 * Progressive document load. A complete source is provided each time: 00204 * caller takes care of appending new text to th current buffer before 00205 * flushing it to XmHTML. 00206 * LOAD_INCREMENTAL 00207 * Progressive document load. A new chunk is provided each time: XmHTML 00208 * takes care of appending new text to the already existing text. 00209 * LOAD_SUSPEND 00210 * Suspend progressive or incremental loading. XmHTML display the document 00211 * upto the last valid combination of tokens. 00212 * LOAD_ABORT 00213 * Abort progressive or icremental loading. XmHTML will flush it's 00214 * buffers and display all the data (including any constructs it 00215 * requires to close the document). 00216 *****/ 00217 typedef enum{ 00218 XmLOAD_NORMAL = 0, //!< normal load, all data at once 00219 XmLOAD_PROGRESSIVE, //!< progressive load, use new text 00220 XmLOAD_INCREMENTAL, //!< progressive load, append new text 00221 XmLOAD_SUSPEND, //!< suspend load 00222 XmLOAD_ABORT //!< abort load 00223 }XmHTMLLoadType; 00224 00225 /***** 00226 * Procedure to be called whenever a script is encountered 00227 * Arguments: 00228 * Widget: XmHTMLWidget id 00229 * String: script source text 00230 * XtPointer: XmNclientData value 00231 * Return value: 00232 * data to be stored whenever a document event should be processed. 00233 * This data is unused internally and is provided as the user_data 00234 * argument in the XmHTMLEvent structure. For example, the return value 00235 * could be a pointer into some internal procedural database, a ptr to a 00236 * compiled script procedure or the script source text if you want to 00237 * process it at some later time (when the event occurs). 00238 * 00239 * When NULL is returned the event in question is disabled. 00240 *****/ 00241 typedef XtPointer (*XmHTMLEventProc)(Widget, String, XtPointer); 00242 00243 /***** 00244 * HTML Form component types. Alphabetically sorted to speed up searching. 00245 *****/ 00246 typedef enum{ 00247 FORM_CHECK = 0, //!< checkbox 00248 FORM_FILE, //!< file selection box 00249 FORM_HIDDEN, //!< hidden input 00250 FORM_IMAGE, //!< drawnbutton 00251 FORM_OPTION, //!< select child 00252 FORM_PASSWD, //!< password textfield 00253 FORM_RADIO, //!< radiobox 00254 FORM_RESET, //!< reset button 00255 FORM_SELECT, //!< select parent 00256 FORM_SUBMIT, //!< submit button 00257 FORM_TEXT, //!< singleline textfield 00258 FORM_TEXTAREA, //!< multiline edit field 00259 FORM_UNKNOWN //!< unknown type 00260 }componentType; 00261 00262 /***** 00263 * Supported HTML Form method types 00264 *****/ 00265 enum{ 00266 XmHTML_FORM_GET = 0, //!< method = get 00267 XmHTML_FORM_POST, //!< method = post 00268 XmHTML_FORM_PIPE //!< method = pipe 00269 }; 00270 00271 /***** 00272 * possible error codes for XmNparserCallback 00273 *****/ 00274 typedef enum{ 00275 HTML_UNKNOWN_ELEMENT = 1, //!< unknown HTML element 00276 HTML_BAD, //!< very badly placed element 00277 HTML_OPEN_BLOCK, //!< block still open while new block started 00278 HTML_CLOSE_BLOCK, //!< block closed but was never opened 00279 HTML_OPEN_ELEMENT, //!< unbalanced terminator 00280 HTML_NESTED, //!< improperly nested element 00281 HTML_VIOLATION, //!< bad content for current block/element 00282 HTML_NOTIFY, //!< notification of text insertion/removal 00283 HTML_INTERNAL //!< internal parser error 00284 }parserError; 00285 00286 /***** 00287 * And corresponding values for XmNenableBadHTMLWarnings. 00288 * These are or'd together. 00289 * XmNONE disables warnings and XmHTML_ALL enables all warnings. 00290 * See parserError for their meaning. 00291 *****/ 00292 enum{ 00293 XmHTML_NONE = 0, //!< no warnings 00294 XmHTML_UNKNOWN_ELEMENT = 1, 00295 XmHTML_BAD = 2, 00296 XmHTML_OPEN_BLOCK = 4, 00297 XmHTML_CLOSE_BLOCK = 8, 00298 XmHTML_OPEN_ELEMENT = 16, 00299 XmHTML_NESTED = 32, 00300 XmHTML_VIOLATION = 64, 00301 XmHTML_ALL = 127 //!< all warnings 00302 }; 00303 00304 /***** 00305 * possible action codes for the action field in the XmHTMLParserCallbackStruct 00306 *****/ 00307 enum{ 00308 HTML_REMOVE = 1, //!< remove offending element 00309 HTML_INSERT, //!< insert missing element 00310 HTML_SWITCH, //!< switch offending and expected element 00311 HTML_KEEP, //!< keep offending element 00312 HTML_IGNORE, //!< ignore, proceed as if nothing happened 00313 HTML_ALIAS, //!< alias an unknown element to known one 00314 HTML_TERMINATE //!< terminate parser 00315 }; 00316 00317 /***** 00318 * Possible return codes for XmHTMLImageGetType(). 00319 *****/ 00320 enum{ 00321 IMAGE_ERROR = 0, //!< error on image loading 00322 IMAGE_UNKNOWN, //!< unknown image 00323 IMAGE_XPM, //!< X11 pixmap 00324 IMAGE_XBM, //!< X11 bitmap 00325 IMAGE_GIF, //!< CompuServe(C) Gif87a or Gif89a 00326 IMAGE_GIFANIM, //!< animated gif 00327 IMAGE_GIFANIMLOOP, //!< animated gif with loop extension 00328 IMAGE_GZF, //!< compatible Gif87a or Gif89a 00329 IMAGE_GZFANIM, //!< compatible animated gif 00330 IMAGE_GZFANIMLOOP, //!< compatible animated gif 00331 IMAGE_JPEG, //!< JPEG image 00332 IMAGE_PNG, //!< PNG image 00333 IMAGE_FLG //!< Fast Loadable Graphic 00334 }; 00335 00336 /***** 00337 * Possible return values for a function installed on the 00338 * XmNprogressiveReadProc resource. 00339 *****/ 00340 #define STREAM_OK 1 //!< internally used value 00341 #define STREAM_END 0 //!< data stream ended (no more data) 00342 #define STREAM_SUSPEND -1 //!< data stream suspended (not enough data) 00343 #define STREAM_ABORT -2 //!< data stream aborted 00344 #define STREAM_RESIZE -3 //!< resize input buffer 00345 00346 /***** 00347 * Possible return values for the XmNdecodeGIFProc resource and 00348 * values for the XmHTMLGIFStream state. 00349 *****/ 00350 #define GIF_STREAM_OK 2 00351 #define GIF_STREAM_END 1 00352 #define GIF_STREAM_ERR 0 00353 #define GIF_STREAM_INIT -1 00354 #define GIF_STREAM_FINAL -2 00355 00356 /***** 00357 * Possible return values from a number of image related routines. 00358 * The actual meaning depends on the routine used. 00359 *****/ 00360 typedef enum{ 00361 XmIMAGE_ERROR = 0, //!< unknown error occured 00362 XmIMAGE_BAD, //!< bad function call: missing arg or so 00363 XmIMAGE_UNKNOWN, //!< provided XmImage/XmImageInfo unknown/unbound 00364 XmIMAGE_ALMOST, //!< action completed, further response necessary 00365 XmIMAGE_OK //!< action completed. 00366 }XmImageStatus; 00367 00368 /***** 00369 * Possible values for transparency (value for the "bg" field in both 00370 * XmImage and XmImageInfo structures). Possible values are: 00371 * 00372 * XmIMAGE_NONE 00373 * indicates the image is not transparent 00374 * XmIMAGE_TRANSPARENCY_BG 00375 * indicates the image achieves transparency by substituting the current 00376 * background setting (can be a single color or background image. Internally, 00377 * such transparency is achieved by using a clipmask). 00378 * XmIMAGE_TRANSPARENCY_ALPHA 00379 * indicates the image achieves transparency by using an alpha channel. 00380 * This transparency is currently only used by PNG images with an alpha 00381 * channel or a tRNS chunk (which is expanded to an alpha channel internally). 00382 *****/ 00383 enum{ 00384 XmIMAGE_NONE = 0, 00385 XmIMAGE_TRANSPARENCY_BG, 00386 XmIMAGE_TRANSPARENCY_ALPHA 00387 }; 00388 00389 /***** 00390 * Possible values for the colorspace value. 00391 * 00392 * XmIMAGE_COLORSPACE_GRAYSCALE 00393 * image contains only shades of gray. The colorcube is reduced to a 1D 00394 * representation. All components in a shade have the same value. The 00395 * pixel values are equal to the value of a single color component. 00396 * XmIMAGE_COLORSPACE_INDEXED 00397 * image uses a fixed palette. Colorcube is mapped to a 1D lookup-table. 00398 * XmIMAGE_COLORSPACE_RGB 00399 * image uses a full 3D colorcube. 00400 *****/ 00401 enum{ 00402 /* XmIMAGE_NONE */ 00403 XmIMAGE_COLORSPACE_GRAYSCALE = 1, 00404 XmIMAGE_COLORSPACE_INDEXED, 00405 XmIMAGE_COLORSPACE_RGB 00406 }; 00407 00408 /***** 00409 * XmImageInfo structure options field bits. 00410 * The ``Set by default'' indicates a bit set when the XmHTMLImageDefaultProc 00411 * is used to read an image. The ``Read Only'' indicates a bit you should 00412 * consider as read-only. 00413 * XmIMAGE_DELAYED 00414 * Indicates the image is delayed, e.i. it will be provided at a later stage; 00415 * XmIMAGE_DEFERRED_FREE 00416 * Indicates XmHTML may free this structure when a new document is loaded. 00417 * XmIMAGE_IMMEDIATE_FREE 00418 * Indicates XmHTML may free this structure when XmHTML no longer needs it; 00419 * XmIMAGE_RGB_SINGLE 00420 * Indicates that the reds, greens and blues fields are allocated in a single 00421 * memory area instead of three seperate memory arrays. 00422 * XmIMAGE_ALLOW_SCALE 00423 * Indicates that scaling an image is allowed. 00424 * XmIMAGE_FRAME_IGNORE 00425 * Use with animations: set this bit when a frame falls outside the logical 00426 * screen area. No pixmap is created but the timeout for the frame is kept. 00427 * XmIMAGE_CLIPMASK 00428 * This bit is set when the returned XmImageInfo structure contains clipmask 00429 * data. XmHTML uses this info to create a clipping bitmap. Changing this 00430 * bit from set to unset will lead to a memory leak while changing it from 00431 * unset to set *without* providing a clipmask yourself *will* cause an error 00432 * to happen. You can set this bit when you are providing your own clipmask 00433 * (to provide non-rectangular images for example), PROVIDED you fill the 00434 * ``clip'' field with valid bitmap data (a stream of bytes in XYBitmap format 00435 * and the same size of the image). 00436 * XmIMAGE_SHARED_DATA 00437 * This bit is set when images share data. XmHTML sets this bit when the image 00438 * in question is an internal image, e.i., one for which the image data may 00439 * never be freed. Be carefull setting this bit yourself, since it prevents 00440 * XmHTML from freeing the image data present in the XmImageInfo structure. 00441 * It can easily lead to memory leaks when an image is *not* an internal 00442 * image. 00443 * XmIMAGE_PROGRESSIVE 00444 * Setting this bit will enable XmHTML progressive image loading. A function 00445 * *must* have been installed on the XmNprogressiveReadProc resource *prior* 00446 * to setting this bit. Installing a function on the XmNprogressiveEndProc 00447 * is optional. When this bit is set all other bits will be ignored. 00448 * XmIMAGE_DELAYED_CREATION 00449 * This bit is read-only. It is used internally by XmHTML for images with 00450 * an alpha channel. Alpha channel processing merges the current background 00451 * with the original RGB data from the image and uses the result to compose 00452 * the actual on-screen image (the merged data is stored in the ``data'' 00453 * field of the XmImageInfo structure). XmHTML needs to store the original 00454 * data somewhere, and when this bit is set it is stored in the ``rgb'' field 00455 * of the XmImageInfo structure. 00456 * When this bit is set, the returned XmImageInfo may *NOT BE FREED* as long 00457 * as the current document is alive. You can discard it as soon as a new 00458 * document is loaded. 00459 *****/ 00460 #define XmIMAGE_DELAYED (1<<1) 00461 #define XmIMAGE_DEFERRED_FREE (1<<2) /* set by default */ 00462 #define XmIMAGE_IMMEDIATE_FREE (1<<3) 00463 #define XmIMAGE_RGB_SINGLE (1<<4) /* set by default */ 00464 #define XmIMAGE_ALLOW_SCALE (1<<5) /* set by default */ 00465 #define XmIMAGE_FRAME_IGNORE (1<<6) 00466 #define XmIMAGE_CLIPMASK (1<<7) /* Read Only */ 00467 #define XmIMAGE_SHARED_DATA (1<<8) /* Read Only */ 00468 #define XmIMAGE_PROGRESSIVE (1<<9) 00469 00470 #define XmIMAGE_DELAYED_CREATION (1<<10) /* Read Only */ 00471 00472 /***** 00473 * XmImageInfo animation disposal values 00474 * A disposal method specifies what should be done before the current frame is 00475 * rendered. Possible values are: 00476 * XmIMAGE_DISPOSE_NONE 00477 * do nothing, overlays the previous frame with the current frame. 00478 * XmIMAGE_DISPOSE_BY_BACKGROUND 00479 * Restore to background color. The area used by the previous frame must 00480 * be restored to the background color/image 00481 * XmIMAGE_DISPOSE_BY_PREVIOUS 00482 * Restore to previous. The area used by the previous frame must be 00483 * restored to what was there prior to rendering the previous frame. 00484 *****/ 00485 enum{ 00486 /* XmIMAGE_NONE */ 00487 XmIMAGE_DISPOSE_NONE = 1, //!< default behaviour 00488 XmIMAGE_DISPOSE_BY_BACKGROUND, 00489 XmIMAGE_DISPOSE_BY_PREVIOUS 00490 }; 00491 00492 /***** 00493 * Primary image cache actions 00494 * (unimplemented) 00495 *****/ 00496 #define IMAGE_STORE 0 //!< store an image in the cache 00497 #define IMAGE_GET 1 //!< retrieve an image from the cache 00498 #define IMAGE_DISCARD 2 //!< discard an image from the cache 00499 00500 /***** 00501 * XmNperfectColors/XmNalphaChannelProcessing resource values. 00502 * 00503 * Note: these values are represented by the XmCEnableMode resource class. 00504 *****/ 00505 enum{ 00506 /* XmAUTOMATIC */ 00507 XmALWAYS = 1, 00508 XmNEVER 00509 }; 00510 00511 /***** 00512 * Possible XmNimageMapToPalette/XmNimageRGBConversion resource values: 00513 * 00514 * XmQUICK 00515 * RGBConversion: 00516 * first checks if the 24bit image contains less than XmNmaxImageColors. 00517 * If not, XmHTML will dither to a fixed palette. This is fast but has 00518 * the disadvantage that the background color in an alpha channelled 00519 * image will not be matched exactly. 00520 * MapToPalette: 00521 * Use closest distance algorithm to map colors to the palette. No 00522 * error correction is performed. Reasonably fast, but quality 00523 * heavily depends on the distribution of the colors in the image. 00524 * XmBEST 00525 * RGBConversion (default): 00526 * first checks if the 24bit image contains less than XmNmaxImageColors. 00527 * If it is, the actual image colors are used. If not, a histogram of the 00528 * image is computed, the most used colors are selected and the resulting 00529 * image is dithered to this palette. 00530 * Offers best 24 to 8bit conversion and is probably faster than XmSLOW 00531 * as only images with more than XmNmaxImageColors will be dithered. 00532 * MapToPalette: 00533 * Ordered dithering using predefined error matrices. Reasonably fast and 00534 * quite good results; 00535 * XmFAST 00536 * RGBConversion: 00537 * Skips the check and dithers to a fixed palette right away. This is the 00538 * fastest way to do 24 to 8bit conversion but has the disadvantage that 00539 * every 24bit image is dithered to a fixed palette, regardless of the 00540 * actual no of colors in the image. 00541 * MapToPalette: 00542 * Simple ordered dithering. Fastest but probably the poorest results. 00543 * XmSLOW 00544 * RGBConversion: 00545 * Skips the check and does histogram stuff right away. 00546 * MapToPalette: 00547 * closest distance algorithm to map image colors to the palette and use 00548 * dynamic error correction. Slowest but best results; 00549 * XmDISABLED 00550 * RGBConversion: 00551 * ignored; 00552 * MapToPalette (default): 00553 * Disables palette mapping; 00554 * 00555 * Note: these values are represented by the XmCConversionMode resource class. 00556 *****/ 00557 enum{ 00558 XmQUICK = 0, 00559 XmBEST, 00560 XmFAST, 00561 XmSLOW, 00562 XmDISABLED 00563 }; 00564 00565 /***** 00566 * Embedded object flags. These flags tell XmHTML which attributes are 00567 * defined for an object. 00568 *****/ 00569 #define HT_TAG_CLASSID (1<<1) /* classid, defines an implementation */ 00570 #define HT_TAG_CODEBASE (1<<2) /* base url for applet */ 00571 #define HT_TAG_DATA (1<<3) /* object data */ 00572 #define HT_TAG_SRC (1<<4) /* object data */ 00573 #define HT_TAG_TYPE (1<<5) /* internet data content type */ 00574 #define HT_TAG_CODETYPE (1<<6) /* internet code content type */ 00575 #define HT_TAG_STANDBY (1<<7) /* standby message */ 00576 #define HT_TAG_ALIGN (1<<8) /* global alignment */ 00577 #define HT_TAG_HALIGN (1<<9) /* horizontal alignment */ 00578 #define HT_TAG_VALIGN (1<<10) /* vertical alignment */ 00579 #define HT_TAG_HEIGHT (1<<11) /* suggested height */ 00580 #define HT_TAG_WIDTH (1<<12) /* suggested width */ 00581 #define HT_TAG_BORDER (1<<13) /* suggested border width */ 00582 #define HT_TAG_HSPACE (1<<14) /* suggested horizontal gutting space */ 00583 #define HT_TAG_VSPACE (1<<15) /* suggested vertical gutting space */ 00584 #define HT_TAG_USEMAP (1<<16) /* imagemap reference */ 00585 #define HT_TAG_BACKGROUND (1<<17) /* background image specification */ 00586 #define HT_TAG_BGCOLOR (1<<18) /* background color specification */ 00587 #define HT_TAG_HREF (1<<19) /* hyperlink */ 00588 #define HT_TAG_NAME (1<<20) /* object name/named hyperlink */ 00589 #define HT_TAG_EVENTS (1<<21) /* HTML4.0 events */ 00590 00591 /***** 00592 * Possible return values for the embedded object convenience functions 00593 *****/ 00594 typedef enum{ 00595 OBJECT_ALMOST = 0, //!< action completed, further action required 00596 OBJECT_DESTROYED, //!< object has been destroyed 00597 OBJECT_EMPTY, //!< object is empty 00598 OBJECT_ERROR, //!< unknown error 00599 OBJECT_FATAL, //!< fatal object error has occured 00600 OBJECT_INVALID, //!< invalid object 00601 OBJECT_INVALID_LOCATION,//!< object has an invalid location 00602 OBJECT_INVALID_SIZE, //!< object has an invalid size 00603 OBJECT_LOWERED, //!< object is lowered 00604 OBJECT_MAPPED, //!< object is mapped to screen 00605 OBJECT_OK, //!< action completed succesfully 00606 OBJECT_ORPHANED, //!< object has no parent 00607 OBJECT_PARENTED, //!< object already has a parent 00608 OBJECT_RAISED, //!< object is raised 00609 OBJECT_UNIMPLEMENTED, //!< requested function unimplemented 00610 OBJECT_UNKNOWN, //!< unknown object 00611 OBJECT_UNKNOWN_ELEMENT, //!< invalid element id 00612 OBJECT_UNMAPPED, //!< object has been unmapped 00613 OBJECT_UNUSED, //!< object is not being used 00614 OBJECT_USED, //!< object is currently being used 00615 OBJECT_VISIBLE //!< object is visible 00616 }XmHTMLObjectStatus; 00617 00618 /***** 00619 * Search directions: forward or backward search 00620 *****/ 00621 typedef enum{ 00622 XmHTML_FORWARD = 0, 00623 XmHTML_BACKWARD 00624 }XmHTMLDirection; 00625 00626 /***** 00627 * XmHTMLTextFind return codes 00628 *****/ 00629 typedef enum{ 00630 XmREG_ERROR = 0, //!< An error occured 00631 XmREG_NOMATCH, //!< end of text and no match found 00632 XmREG_MATCH //!< a match was found 00633 }XmHTMLRegexStatus; 00634 00635 /***** 00636 * In addition to the POXIX regex error codes, XmHTMLTextFinderGetError 00637 * can return the following errors 00638 *****/ 00639 #define RE_EEMPTY -1 //!< no search string given 00640 #define RE_ENOMEM -2 //!< out of memory 00641 #define RE_EBADPARENT -3 //!< parent is not of class xmHTMLWidgetClass 00642 #define RE_EWORDS -4 //!< no words to be searched (empty document) 00643 #define RE_ERROR -5 //!< unknown error 00644 00645 /***** 00646 * Finder is a fully opaque types. 00647 *****/ 00648 typedef struct _XmHTMLTextFinder *XmHTMLTextFinder; 00649 00650 /***** 00651 * Custom Papersize dimension unit type 00652 * (under construction) 00653 *****/ 00654 enum{ 00655 XmHTML_CHAR = 0, 00656 XmHTML_CENTIMETER, //!< 1cm = 0.39in 00657 XmHTML_MILLIMETER, //!< 1mm = 0.1cm 00658 XmHTML_INCH, //!< 1in = 2.54cm 00659 XmHTML_PICA, //!< 1pc = 12pt 00660 XmHTML_POINT //!< 1in = 72.27pt, 1cm = 28.45pt 00661 }; 00662 00663 /***** 00664 * XmHTMLTextGetFormatted paper size defines 00665 * (under construction) 00666 *****/ 00667 enum{ 00668 XmHTMLTEXT_PAPERSIZE_A4 = 0, 00669 XmHTMLTEXT_PAPERSIZE_LETTER, 00670 XmHTMLTEXT_PAPERSIZE_CUSTOM 00671 }; 00672 00673 /***** 00674 * XmHTMLTextGetFormatted type definitions 00675 * (under construction) 00676 *****/ 00677 enum{ 00678 XmHTMLTEXT_PLAIN = 0, //!< generate plain ASCII document 00679 XmHTMLTEXT_FORMATTED, //!< generate formatted ASCII document 00680 XmHTMLTEXT_POSTSCRIPT //!< generate formatted Postscript output 00681 }; 00682 00683 /***** 00684 * XmHTMLTextGetFormatted Postscript option bits 00685 * (under construction) 00686 * The MIMIC_FONTS bit instructs XmHTML to use any of the supported postscript 00687 * fonts to approach the fonts used in the document. When set, all other font 00688 * bits are ignored. When not used, the PSFONT bits can be or'd together. 00689 * XmHTML will attempt to do the following mapping: 00690 * PSFONT_ROMAN/PSFONT_CENTURY -> default text font; 00691 * PSFONT_HELVETICA/PSFONT_LUCIDA -> fixed width font; 00692 * If only one of the PSFONT bits is set, the entire document will be rendered 00693 * in that font. 00694 *****/ 00695 #define XmHTMLTEXT_ADDHEADER (1<<1) 00696 #define XmHTMLTEXT_ADDFOOTER (1<<2) 00697 #define XmHTMLTEXT_PSFONT_ROMAN (1<<3) 00698 #define XmHTMLTEXT_PSFONT_HELVETICA (1<<4) 00699 #define XmHTMLTEXT_PSFONT_CENTURY (1<<5) 00700 #define XmHTMLTEXT_PSFONT_LUCIDA (1<<6) 00701 #define XmHTMLTEXT_MIMIC_FONTS (1<<7) 00702 00703 /***** 00704 * XmHTMLGetHeadAttributes mask bits 00705 *****/ 00706 #define HeadClear ((unsigned char)0) /* clear everything */ 00707 #define HeadDocType (1<<0) /* fill doctype member */ 00708 #define HeadTitle (1<<1) /* fill title member */ 00709 #define HeadIsIndex (1<<2) /* fill isIndex member */ 00710 #define HeadBase (1<<3) /* fill Base member */ 00711 #define HeadMeta (1<<4) /* fill meta members */<