/usr/include/XmHTML/XmHTML.h is in libxmhtml-dev 1.1.10-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | /*****
* XmHTML.h : XmHTML Widget public header file
*
* This file Version $Revision: 1.21 $
*
* Creation date: Tue Nov 19 23:18:37 GMT+0100 1996
* Last modification: $Date: 1998/04/27 06:56:31 $
* By: $Author: newt $
* Current State: $State: Exp $
*
* Author: newt
* (C)Copyright 1995-1996 Ripley Software Development
* All Rights Reserved
*
* This file is part of the XmHTML Widget Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****/
/*****
* $Source: /usr/local/rcs/Newt/XmHTML/RCS/XmHTML.h,v $
*****/
/*****
* ChangeLog
* $Log: XmHTML.h,v $
* Revision 1.21 1998/04/27 06:56:31 newt
* Updated version number
*
* Revision 1.20 1998/04/04 06:27:53 newt
* XmHTML Beta 1.1.3
*
* Revision 1.19 1997/10/26 23:49:52 newt
* Moved internal symbol defines to XmHTMLP.h
*
* Revision 1.18 1997/10/23 00:24:44 newt
* XmHTML Beta 1.1.0 release
*
* Revision 1.17 1997/08/31 17:32:43 newt
* log edit
*
* Revision 1.16 1997/08/30 00:40:16 newt
* Changed proto's for XmHTMLImageReplace and XmHTMLImageUpdate. They now
* return an XmImageStatus instead of void.
*
* Revision 1.15 1997/08/01 12:54:55 newt
* Progressive image loading changes.
*
* Revision 1.14 1997/05/28 01:41:04 newt
* Added the XmHTMLImageGZFSupported, XmHTMLGIFtoGZF, XmHTMLGifReadOK and
* XmHTMLGifGetDataBlock convienience routines to convert GIF images to an
* alternate format. Added the XmHTMLAllocColor and XmHTMLFreeColor protos for
* easy color allocation. Modified the XmImageCreate routines to use a
* XmImageConfig structure.
*
* Revision 1.13 1997/04/29 14:22:35 newt
* Completely revised due to XmHTMLParserObject integration
*
* Revision 1.12 1997/04/03 05:31:30 newt
* XmHTMLFrameGetChild proto. XmIMAGE_SHARED_DATA option bit added.
*
* Revision 1.11 1997/03/28 07:06:14 newt
* XmNframeCallback, XmHTMLFrameCallbackStruct. XmHTMLParserCallback changes.
*
* Revision 1.10 1997/03/20 08:05:02 newt
* XmHTMLImageFreeImageInfo, XmNrepeatDelay
*
* Revision 1.9 1997/03/11 19:50:27 newt
* Changes in XmImageInfo; grouped and renamed convenience functions
*
* Revision 1.8 1997/03/04 18:45:55 newt
* XmNimagemapBoundingBoxForeground and XmCImagemapDrawBoundingBoxes
* resources added
*
* Revision 1.7 1997/03/04 00:56:30 newt
* Delayed Image Loading: added the delayed field to the XmImageInfo structure.
* Removed a number of obsolete defines
*
* Revision 1.6 1997/03/02 23:07:10 newt
* Image/Imagemap related changes. XmHTMLAnchorCallbackStruct changed
*
* Revision 1.5 1997/02/11 02:01:26 newt
* Added the XmNhandleShortTags resource
*
* Revision 1.4 1997/02/04 02:55:57 newt
* added the basefont element
*
* Revision 1.3 1997/01/09 06:55:53 newt
* expanded copyright marker
*
* Revision 1.2 1997/01/09 06:47:58 newt
* New resource: XmNparserCallback and corresponding error structure/defines
*
* Revision 1.1 1996/12/19 02:17:14 newt
* Initial Revision
*
*****/
/*****
* Public interfaces are listed at the end of this file
*****/
#ifndef _XmHTML_h_
#define _XmHTML_h_
#define XmHTMLVERSION 1
#define XmHTMLREVISION 1
#define XmHTMLUPDATE_LEVEL 10
#define XmHTMLVersion \
(XmHTMLVERSION * 1000 + XmHTMLREVISION * 100 + XmHTMLUPDATE_LEVEL)
/* used by Imake to get Shared library version numbering */
#ifndef _LIBRARY
#define XmHTMLVERSION_STRING \
"XmHTML Beta Version 1.1.10 (C)Ripley Software Development"
/* Required includes */
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <XmHTML/HTML.h>
#ifndef XmHTML_LIBEXPORT
#define XmHTML_LIBEXPORT extern
#endif
_XFUNCPROTOBEGIN
/* XmHTML type defines */
typedef struct _XmHTMLClassRec *XmHTMLWidgetClass;
typedef struct _XmHTMLRec *XmHTMLWidget;
/*****
* VMS works differently here: it defines externalref to globalref,
* so guard against incorrectly overriding the externaldef define.
*****/
#ifdef VMS
externalref WidgetClass xmHTMLWidgetClass;
#else
XmHTML_LIBEXPORT WidgetClass xmHTMLWidgetClass;
#endif
/* XmHTML Widget subclassing macro */
#ifndef XmIsHTML
#define XmIsHTML(w) XtIsSubclass(w, xmHTMLWidgetClass)
#endif /* XmIsHTML */
/******** Public Function Declarations ********/
/*****
* Convenience/public functions
* There are six categories:
* - image related
* - anchor related
* - text related
* - tag analyzers
* - object related
* - functions that don't fit in any of the above three
*****/
/*****
* Image related convenience functions
*****/
XmHTML_LIBEXPORT XmImageInfo *XmHTMLImageDefaultProc(Widget w, String file,
unsigned char *buf, int size);
/* Return image type */
XmHTML_LIBEXPORT unsigned char XmHTMLImageGetType(String file,
unsigned char *buf, int size);
/* returns True if XmHTMLImageDefaultProc supports JPEG images */
XmHTML_LIBEXPORT Boolean XmHTMLImageJPEGSupported(void);
/* returns True if XmHTMLImageDefaultProc supports PNG images */
XmHTML_LIBEXPORT Boolean XmHTMLImagePNGSupported(void);
/* returns True if XmHTMLImageDefaultProc supports GZF images */
XmHTML_LIBEXPORT Boolean XmHTMLImageGZFSupported(void);
/* Replace image with new_image */
XmHTML_LIBEXPORT XmImageStatus XmHTMLImageReplace(Widget w, XmImageInfo *image,
XmImageInfo *new_image);
/* update image */
XmHTML_LIBEXPORT XmImageStatus XmHTMLImageUpdate(Widget w, XmImageInfo *image);
/* release all memory occupied by the images */
XmHTML_LIBEXPORT void XmHTMLImageFreeAllImages(Widget w);
/* add an imagemap to a HTML widget. */
XmHTML_LIBEXPORT void XmHTMLImageAddImageMap(Widget w, String image_map);
/* free an XmImageInfo structure */
XmHTML_LIBEXPORT void XmHTMLImageFreeImageInfo(Widget w, XmImageInfo *info);
/* return the total size of a given XmImageInfo structure */
XmHTML_LIBEXPORT int XmHTMLImageGetImageInfoSize(XmImageInfo *info);
/* suspend progressive image loading */
XmHTML_LIBEXPORT void XmHTMLImageProgressiveSuspend(Widget w);
/* reactivate progressive image loading */
XmHTML_LIBEXPORT void XmHTMLImageProgressiveContinue(Widget w);
/* terminate progressive image loading */
XmHTML_LIBEXPORT void XmHTMLImageProgressiveKill(Widget w);
/*****
* Special image functions
*****/
/*****
* Create and return a XmImage for use other than with XmHTML.
* When width and height are non-zero, the image read is scaled to the specified
* dimensions.
*****/
XmHTML_LIBEXPORT XmImage *XmImageCreate(Widget w, String file,
Dimension width, Dimension height, XmImageConfig *config);
/*****
* Create an XmImage from the given XmImageInfo. When the image type is
* IMAGE_UNKNOWN, but the url field represents a local file, this routine
* calls XmImageCreate with the url field as the file argument.
* Only honors the ImageFrameSelect, ImageCreateGC and ImageBackground
* XmImageConfig flag and appropriate fields of that structure.
*****/
XmHTML_LIBEXPORT XmImage *XmImageCreateFromInfo(Widget w, XmImageInfo *info,
Dimension width, Dimension height, XmImageConfig *config);
/* destroy a XmImage */
XmHTML_LIBEXPORT void XmImageDestroy(XmImage *image);
/*****
* Tiles "dest" with the given XmImage. Please note that "src" *must* have been
* created with the ImageCreateGC flag, otherwise this function does nothing and
* returns -1. Returns 0 upon success.
* Internally, this routine is more or less a combination of XSetTile,
* XSetTSOrigin and XFillRectangle in one.
*
* (UNTESTED)
*****/
XmHTML_LIBEXPORT int XmImageSetBackgroundImage(XmImage *src, Drawable dest,
int src_x, int src_y, int width, int height, int dest_x, int dest_y);
/*****
* XCopyArea for an XmImage which also takes a possible clipmask into account.
* Please note that "image" *must* have been created with the ImageCreateGC
* flag, otherwise this function does nothing and returns -1.
* Returns 0 upon success.
*
* (UNTESTED)
*****/
XmHTML_LIBEXPORT int XmImageDrawImage(XmImage *image, Drawable dest, int src_x,
int src_y, int dest_x, int dest_y);
/*****
* Write an image to file. Returns False upon failure.
* Saving an image in the GIF format is *not* possible due to Unisys's
* stupid LZW licensing policy. Exporting an image as PNG, JPEG or GZF is only
* possible if support for the required libraries has been compiled in.
*
* (UNIMPLEMENTED, always returns False)
*****/
XmHTML_LIBEXPORT Boolean XmImageExport(XmImageInfo *info, String file,
Dimension width, Dimension height, unsigned char type);
/* convert a GIF image to a GZF image */
XmHTML_LIBEXPORT Boolean XmHTMLGIFtoGZF(String infile, unsigned char *buf,
int size, String outfile);
/*****
* Anchor related convenience functions
* These routines can be used to jump to named anchors.
*****/
/* return the internal id of a named anchor given it's name or -1. */
XmHTML_LIBEXPORT int XmHTMLAnchorGetId(Widget w, String anchor);
/* scroll to a named anchor, given it's id */
XmHTML_LIBEXPORT void XmHTMLAnchorScrollToId(Widget w, int anchor_id);
/* scroll to a named anchor, given it's name */
XmHTML_LIBEXPORT void XmHTMLAnchorScrollToName(Widget w, String anchor);
/* return True if a named anchor is currently visible, given it's id */
XmHTML_LIBEXPORT Boolean XmHTMLAnchorVisibleByName(Widget w, String anchor);
/* return True if a named anchor is currently visible, given it's name */
XmHTML_LIBEXPORT Boolean XmHTMLAnchorVisibleById(Widget w, int anchor_id);
/*****
* misc scroll functions
*****/
/* scroll to the given y-position */
void XmHTMLScrollToYPos(Widget w, int ypos);
/*****
* Checks a HTML instance against a current href name and alters any
* matching anchors to visited and causes a refesh.
* If visited is True, the matching anchor is rendered as visited. If it's
* False, it will be rendered as not visited.
*****/
XmHTML_LIBEXPORT void XmHTMLAnchorReEval(Widget w, String href,
Boolean visited);
/*****
* Text related convenience functions
*****/
/* This macro sets the given text into a HTML widget */
#define XmHTMLTextSet(WIDGET,TEXT) XtVaSetValues((WIDGET), \
XmNvalue, (TEXT), NULL)
/* scroll to the requested line number */
XmHTML_LIBEXPORT void XmHTMLTextScrollToLine(Widget w, int line);
/* set text into a html widget */
XmHTML_LIBEXPORT void XmHTMLTextSetString(Widget w, String text);
/*****
* same as XmHTMLTextSetString with one fundamental difference: text doesn't
* have to be NULL terminated. The size of the input string is instead
* given by len. If text is NULL or len is 0, the current contents are
* cleared.
*****/
XmHTML_LIBEXPORT void XmHTMLTextSetStringWithLength(Widget w, String text,
size_t len);
/* return a *pointer* to the original text */
XmHTML_LIBEXPORT String XmHTMLTextGetSource(Widget w);
/* return a copy of the current parser output */
XmHTML_LIBEXPORT String XmHTMLTextGetString(Widget w);
/*****
* Return a formatted copy of the current widget contents
* (UNIMPLEMENTED, always returns NULL)
*****/
XmHTML_LIBEXPORT String XmHTMLTextGetFormatted(Widget w,
unsigned char papertype, XmHTMLPaperSize *paperdef, unsigned char type,
unsigned long PSoptions);
XmHTML_LIBEXPORT String XmHTMLTextGetSelection(Widget w);
XmHTML_LIBEXPORT void XmHTMLTextClearSelection(Widget w, Time time);
XmHTML_LIBEXPORT Boolean XmHTMLTextSetSelection(Widget w,
XmHTMLTextPosition first, XmHTMLTextPosition last, Time time);
XmHTML_LIBEXPORT void XmHTMLTextSetHighlight(Widget w, XmHTMLTextPosition first,
XmHTMLTextPosition last, XmHighlightMode mode);
XmHTML_LIBEXPORT Boolean XmHTMLTextCopy(Widget w, Time time);
XmHTML_LIBEXPORT Boolean XmHTMLTextShowPosition(Widget w,
XmHTMLTextPosition position);
/* text search functions */
XmHTML_LIBEXPORT XmHTMLTextFinder XmHTMLTextFinderCreate(Widget w);
XmHTML_LIBEXPORT void XmHTMLTextFinderDestroy(XmHTMLTextFinder finder);
XmHTML_LIBEXPORT Boolean XmHTMLTextFinderSetPattern(XmHTMLTextFinder finder,
String to_find);
XmHTML_LIBEXPORT Boolean
XmHTMLTextFinderSetPatternFlags(XmHTMLTextFinder finder, int flags,
Boolean ignore_case, XmHTMLDirection direction);
/* return the id of the last known regex error */
XmHTML_LIBEXPORT int XmHTMLTextFinderGetError(XmHTMLTextFinder finder);
/* same as above but now returns a string which must be freed by caller */
XmHTML_LIBEXPORT String XmHTMLTextFinderGetErrorString(XmHTMLTextFinder finder);
XmHTML_LIBEXPORT XmHTMLRegexStatus XmHTMLTextFindString(Widget w,
XmHTMLTextFinder finder);
XmHTML_LIBEXPORT void XmHTMLTextFinderReset(XmHTMLTextFinder finder);
XmHTML_LIBEXPORT Boolean XmHTMLTextFindToPosition(Widget w,
XmHTMLTextFinder finder, XmHTMLTextPosition *start,
XmHTMLTextPosition *end);
/*****
* Tag analyzers.
* These routines allow you to filter values out of the attributes
* attached to a HTML element.
*****/
XmHTML_LIBEXPORT int XmHTMLTagGetNumber(String attributes, String tag,
int default_value);
XmHTML_LIBEXPORT int XmHTMLTagCheckNumber(String attributes, String tag,
int default_value);
XmHTML_LIBEXPORT String XmHTMLTagGetValue(String attributes, String tag);
XmHTML_LIBEXPORT Boolean XmHTMLTagCheck(String attributes, String tag);
XmHTML_LIBEXPORT Boolean XmHTMLTagCheckValue(String attributes, String tag,
String check);
/*****
* Object related convenience functions.
* These functions allow one to define custom HTML elements to XmHTML.
*****/
/* define a new element to the HTML parser */
XmHTML_LIBEXPORT XmHTMLElementId XmHTMLObjectDefine(String element,
Boolean terminated, unsigned long attribute_flags, XtPointer user_data);
/* undefine a previously defined element */
XmHTML_LIBEXPORT XmHTMLObjectStatus
XmHTMLObjectUndefine(XmHTMLElementId element_id);
/* reconfigure the given object (change position and/or size) */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectReconfigure(Widget w,
XmHTMLObjectId object_id, int x, int y, Dimension width, Dimension height);
/* show/hide the given object */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectShow(Widget w,
XmHTMLObjectId object_id, Boolean show);
/* raise the given object from the currently displayed document */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectRaise(Widget w,
XmHTMLObjectId object_id);
/* lower the given object into the currently displayed document */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectLower(Widget w,
XmHTMLObjectId object_id);
/* Create an external object corresponding to a previously defined element */
XmHTML_LIBEXPORT XmHTMLObjectId XmHTMLObjectCreate(XmHTMLElementId element_id);
/* Destroy an external object */
XmHTML_LIBEXPORT void XmHTMLObjectDestroy(XmHTMLObjectId object_id);
/* register an external object for use with XmHTML */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectRegister(Widget w,
XmHTMLObjectId object_id);
/* unregister a previously registered object from XmHTML */
XmHTML_LIBEXPORT XmHTMLObjectStatus XmHTMLObjectUnregister(Widget w,
XmHTMLObjectId object_id);
/* fetch the element data from the given object */
XmHTML_LIBEXPORT XmHTMLElementId XmHTMLObjectGetElement(Widget w,
XmHTMLObjectId object_id);
/*****
* Miscelleneous convenience functions
*****/
/* return the library version number */
XmHTML_LIBEXPORT int XmHTMLGetVersion(void);
/* return version string */
XmHTML_LIBEXPORT char *XmHTMLGetVersionString(void);
/* return the URL type of the given href */
XmHTML_LIBEXPORT URLType XmHTMLGetURLType(String href);
/* return the value of the <TITLE></TITLE> element */
XmHTML_LIBEXPORT String XmHTMLGetTitle(Widget w);
/* return an info structure for the specified location */
XmHTML_LIBEXPORT XmHTMLInfoStructure *XmHTMLXYToInfo(Widget w, int x, int y);
/* return document structure (list of images & hyperlinks) */
XmHTML_LIBEXPORT XmHTMLDocumentInfo *XmHTMLGetDocumentInfo(Widget w);
/* free a document structure */
XmHTML_LIBEXPORT void XmHTMLFreeDocumentInfo(XmHTMLDocumentInfo *doc_info);
/****
* Return the contents of the document head. Returns True when a <head></head>
* section is present in the current document, False if not. When mask_bits
* only contains HeadClear, the given attribute structure is wiped clean and
* this function will return False immediatly.
* The only exception concerns the <!DOCTYPE> tag and the HeadDocType mask bit:
* if this bit is set, the value of this tag is returned whether or not a
* head is present.
****/
XmHTML_LIBEXPORT Boolean XmHTMLGetHeadAttributes(Widget w,
XmHTMLHeadAttributes *head, unsigned char mask_bits);
/* return the widget id of a framechild given its name */
XmHTML_LIBEXPORT Widget XmHTMLFrameGetChild(Widget w, String name);
/* Create a HTML widget if parent is not null and no subclass of XmGadget */
XmHTML_LIBEXPORT Widget XmCreateHTML(Widget parent, String name,
ArgList arglist,
Cardinal argcount);
/* force a recomputation of screen layout and trigger a redisplay */
XmHTML_LIBEXPORT void XmHTMLRedisplay(Widget w);
/* return info about the font cache for display of the given widget */
XmHTML_LIBEXPORT XmHTMLFontCacheInfo *XmHTMLGetFontCacheInfo(Widget w);
/* free the given font cache info */
XmHTML_LIBEXPORT void XmHTMLFreeFontCacheInfo(XmHTMLFontCacheInfo *info);
/*
* Allocate given color (symbolic name of rgb triplet) using the widget's
* colormap. Works with the XmNmaxImageColors resource.
*/
XmHTML_LIBEXPORT Pixel XmHTMLAllocColor(Widget w, String color,
Pixel def_pixel);
/* free a color allocated with XmHTMLAllocColor */
XmHTML_LIBEXPORT void XmHTMLFreeColor(Widget w, Pixel pixel);
_XFUNCPROTOEND
#endif /* _LIBRARY */
/* Don't add anything after this endif! */
#endif /* _XmHTML_h_ */
|