XmHTML-1.1.7/APPS100644 23564 23564 13404 6601271016 11613 0ustar newtnewtThis is a list of applications that are known to use XmHTML in some way. This list is most likely not complete and probably never will be. ============================================================================== If you have a submission, please supply (at least) the following information: Name program's name Description a short description of the program's purpose. Author author's name and email address; URL url where more information about the application can be obtained; XmHTML short description on how XmHTML is used by this application. Submissions should be sent to: ripley@xs4all.nl ============================================================================== --- Bosy --------------------------------------------------------------------- Description A threaded, online nntp newsreader Author Patrick Caulfield, Url (unknown) XmHTML Used as the message display area --- MinD --------------------------------------------------------------------- Description A (very nice) Motif INterface Designer by flux Software Gmbh. Author Flux Software Gmbh. Url http://www.flux-online.de A (free) demo version is available for download at the above url. XmHTML Used for MinD's help system and supports XmHTML when building interfaces. --- GNOME -------------------------------------------------------------------- Description The GNU Object Model Environment is a very strong-going effort to design a user-friendly desktop. GNOME is based on gtk, the toolkit developed by the Gimp authors. Author Many, many people. and other GNOME mailing lists. Url http://www.gnome.org XmHTML XmHTML has been ported to gtk for use with GNOME by Miguel de Icaza (miguel@nuclecu.unam.mx) and Federico Mena (aka Quartic) (federico@nuclecu.unam.mx) and is used by a few GNOME core applications such as the GNOME help system. --- gnucash ------------------------------------------------------------------ Description A GNOME accounting program, previously known as Xacc. Author Linas Vepstas, Url http://www.gnucash.org XmHTML Used for it's help system. --- GNUsheet ----------------------------------------------------------------- Description A GPL's spreadsheet program under development Author Danny Backx Url http://users.skynet.be/danny.backx/gnusheet.html XmHTML Used for it's help system. --- Balsa -------------------------------------------------------------------- Description GNOME email client. Author Stuart Parmenter Url http://www.balsa.net XmHTML Used as the message display area --- ArahDobby 2.8 ----------------------------------------------------------- Description Textile weaving CAD/CAM application, with on-screen 1:1 fabric simulation and printout, colorimetry support (CIE Lab) support for all Epson printer models (including Photo 700 and EX) JPEG, GIF export of fabric simulation simulation of multiple layer fabrics, denting, regulator weave editor, warp/weft pattern editor, yarn editor consumption calculation, blankets, optional PANTONE Textile Color System (R) support Author Developed by Arahne, d.o.o., Url http://www.arahne.si XmHTML XmHTML is used to display the production data sheet - yarn consumption calculation. The same data is then exported as HTML and printed out to be passed on to the production department of the weaving mill. --- Common Desk Environment (CDE) mail client (dtmail) ----------------------- Description Sun Microsystem's CDE email client for the sending, receiving, and processing of email. Author Many persons over many years. url http://www.sun.com/solaris/cde XmHTML Will be utilized to render html received as email from various other email clients such as Netscape, Outlook Express, Eudora, etc. Note This new version of dtmail is expected to be publicly available early 1999. --- TNTmips ----------------------------------------------------------------- Description A commercial GIS/Image Processing package for Windows, Unix and Mac. Author MicroImages, Inc. Url http://www.microimages.com A lite version is available for download at the above url or can be obtained on CD for about US$35. XmHTML We're using XmHTML for "About" boxes and stuff initially. Plan to eventually use the layout/rendering stuff by itself to render map legends as HTML text blocks. --- NCAR DataVison ---------------------------------------------------------- NCAR = National Center for Atmospheric Research Description GUI for accessing, processing, and visualizing scientific data based on the NCL command language Scheduled Release Date Early 1999 Authors David Brown, Jeff Boote, Ethan Alpert. National Center for Atmospheric Research, URL http://www.ndv.ucar.edu/ XmHTML High level graphical objects (e.g. ContourPlot, VectorPlot) are configured using resources similar to those of Motif or the XmHTML widget itself. A tree widget displays information about the resources and has editable fields for modifying their values. Opening a resource's "Description" row causes an XmHTML widget to display within an XmFrame the documentation for that resource. The XmHTML widget's scrollbars are turned off and the frame is sized to fit the exact length of the resource's description. (Scrolling is provided external to the tree widget.) When more than one "Description" row is open, multiple XmHTML widgets are simultaneously instantiated each displaying a different portion of the document using the same XmHTML layout data structure (which is saved in a cache by the application). Plans call for the XmHTML widget to be embedded at other locations within the application as well. The goal is to make the application fully self-documenting. XmHTML-1.1.7/BUG-REPORTING100644 23564 23564 21164 6522656316 13052 0ustar newtnewt[copied and apdapted from lesstif 0.75a] REPORTING BUGS AND SUBMITTING FIXES =================================== January 30, 1997 Table of Contents ----------------- 1. Introduction 2. What you'll need to find bugs 3. Recommended reading 4. Isolating bugs 5. X Protocol Errors 6. Submitting bug reports 7. Submitting patches 8. Sample bug report 1. Introduction --------------- Bug hunting in XmHTML isn't really all that different from bug hunting in X application code, with a few notable exceptions. We encourage users to help us make XmHTML a better product by doing some preliminary ground-work for the developers when you find a bug in the library. Of course, what we really want is a patch that fixes the bug, but we'll settle for some help. Send your bugreports and patches to: ripley@xs4all.nl 2. What you'll need ------------------- Let's see: o - a computer (Ta-dah!) o - the X Window System, at release level R5 or above. It will probably also work under R4, but that must be verified. o - a compiler/assembler/linker o - a debugger o - some test code Of course, if you don't have that, you probably don't need to read this, do you? 3. Recommended Reading ---------------------- The following list of books are nice to have, especially the Intrinsics and the Motif books, but you can probably get away without them if you have a full set of man pages. One thing, though: if you want to understand what widget methods do, and how a widget works, they are an absolute necessity. The O'Reilly books "The Definitive Guide to the X Window System". Of these, you'll want: Volume 1: Xlib Programming Manual Volume 2: Xlib Reference Manual Volume 4: X Toolkit Intrinsics Programming Manual Volume 5: X Toolkit Intrinsics Reference Manual Volume 6A: Motif Programming Manual Volumn 6B: Motif Reference Manual If you have R6 (Linux, *BSD, others), you'll want: Programmer's Supplement for Release 6 From the OSF, you'll want OSF/Motif Programmer's Reference (for 1.2) OSF/Motif Programmer's Guide (for 1.2) The style guide is nice, but not required. 4. Isolating bugs ----------------- You found a bug in XmHTML, and you want to help. Problems generally fall into four broad categories: o - behavior o - visual o - X Protocol Error o - core dump One thing to keep in mind is that the location that the problem occurs in is not necessarily the same as the location that caused the problem; this is due to the (normally) asynchronous nature of X applications. When your application has a problem, the first thing to do is run the application synchronously, to see if the location of the error changes (you'll be surprised how often it will). Here's how to do it with gdb: hobbes [212][18:39] [/home/newt/src/XmHTML-1.0.4/examples] >gdb example_2 GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.14 (i486-linux), Copyright 1995 Free Software Foundation, Inc... (gdb) run -sync Starting program: /home/newt/src/XmHTML-1.0.4/examples/./example_2 -sync ----- If you run the program with a -d switch, it'll probably spit out a bunch of warnings. Note that the commands passed to the run command are actually command line arguments to the program. On some systems, you may find that you can't set breakpoints at the start if you use shared libraries. That's because the symbols won't be resolved until a process image exists. To work around this, set a breakpoint at main(), and run. Once the breakpoint at main is reached, you'll find that you can set the other breakpoints. Once you've had your program dump core:), just say "where". It will show a trace stack up to the point where the error occured (most likely a sigsegv). This will help you track down what the most probable cause of the error is. 5. About X Protocol Errors -------------------------- Sometimes a program will fail with something like: X Error: Bad Drawable (other stuff) or something similar. This is a problem with something that got sent to the X server. This isn't hard to track down if you've run in synchronous mode. Just set a breakpoint at the exit() function, run with the -sync option, and you'll get a trace from the point where the error occurred, plus some other information. These are crucial to proper XmHTML functionality -- these must be stamped out. X Protocol errors haven't been observed yet with XmHTML directly. It has occured when the parent of XmHTML is a gadget. 6. Submitting bug reports ------------------------- When (not if) you find a problem with XmHTML, we really want to know. Ideally, a patch is what we'd prefer. Failing that, we need sample code, and a stack trace of the problem (even if it was an X Error). If it was a behavioral or visual problem, just a description will do, although some code that exhibits the behavior would be nice. Try to be complete if you send just a description -- meaning if you send something like: "Well, I ran an app, and the thingie at the bottom of the wossname didn't look right" Your are in all likelihood going to be ignored. We also need the version number of the file that had the problem. Please do not tell us the problem two months after you saw it, the code base changes too rapidly for us to be able to make anything meaningful out of a bug report that old. See section 8 for a sample bug report. 7. Submitting patches --------------------- Patches are the preferred form of bug report, as it lessens our efforts to track down where the bugs are. If you do submit a patch, please try to keep a few rules in mind: o when writing your fix, please try to follow the coding style of the file you are fixing. o try not to submit a fix that creates dead code. Using "#if 0" or commented code is discouraged. We can do that (because, after all, we are the elitist core team;), but you are discouraged from that, because it makes the patches hard to read. o do not be discouraged if your patch is not accepted verbatim. Often people submit patches that one or more of the core team will recognize as identifying a problem, but the core member will recognize that your fix will break some other piece of functionality. We'll try to tell you, but we're human, so we may forget. o Remember that relay mailers are free to alter the content of text messages, and often do so. Lines should always be less than 80 characters in length; if you are working on OS/2, remember that mailers will usually convert into just . This has in the past caused patches to be rejected by the patch program, and thus by us. o We prefer patches in the "unified diff" format (with GNU diff, this is "diff -u"). If you have to, you can send a "context diff". Please use one of those two formats. 8. Sample Bug Report -------------------- Shown below is a sample bug report. Feel free to add any extra comments you wish. ======================================================================== From : XmHTML: Motif : X11 : system: File : Bug description: Repeated by: Proposed fix: ======================================================================== A sample: ======================================================================== From : Koen D'Hondt, ripley@xs4all.nl XmHTML: 1004 Motif : 2000 X11 : 11006 system: Linux hobbes 2.0.26 #3 Wed Nov 27 18:16:53 GMT+0100 1996 i586 File : images.c, line 104, revision 1.2 Bug description: a memory leak: the return value from _XmHTMLTagGetValue does not get freed. Repeated by: Proposed fix: add a free(chPtr) ======================================================================== Thanks, and remember: all help is appreciated. XmHTML-1.1.7/CHANGES100644 23564 23564 172146 6445606542 12165 0ustar newtnewtThis file: CHANGES. Describes day to day progress of the XmHTML development. December 15 HTML Form widgets are no longer actively destroyed when the parent HTML widget is destroyed. Previously, this lead to an XError. Bugfix thanks to Richard Offer .
bugfixes: - If a line is ended by a linebreak, any leading space for the first word on the next line is removed. As a result of this, text justification no longer shifts this word; - Paragraphs containing a linebreak could incorrectly double the end-of-paragraph spacing. December 14 Fixed a bug in anchor rendering when it is the first object in a page: XmHTML couldn't find a proper starting point and didn't render the anchor at all. Fixed a bug related to empty named anchors, they used to reset the left margin (this one has been lurking under the carpet for a very long time...). Some improvement in table exposure handling. December 13 Modified handling of the XmNenableBadHTMLWarnings resource: you can now select what type of errors the parser detects will be shown. December 11 libhttp: the HTTPHEAD HTTPLoadMethod now supports both HTTPLoadToFile and HTTPLoadToString. For the latter, any received headers are stored in a new headers (array of type HTTPNamedValues) field in the HTTPRequest return structure. HTML tables: cell width takes horizontal margin into account properly. Previously, the cell width tended to be too small for the widest cell. Bugfix: linebreaks contained in anchors are no longer rendered. Fixed a number of bugs in the Imakefiles. December 9 HTML tables: - Fixed handling of the ROWSPAN attribute: the extra vertical space is now distributed evenly accross spanned rows; - fixed an (important) baseline handling bug; cells now reset the linebreaking mechanism: each cell represents a minipage that must start with a clean slate. Previously paragraph breaks were transferred accross rows and cells. December 8 Fixed a small redraw bug in XmBalloon popup. Changed the handling of
tags: they are now treated as text objects. This fixes a bug in table cell content rendering if a table is placed in an intended paragraph. Added the Composite Extension fix. December 4 Released XmHTML/Beta Version 1.1.1 December 3 Nested tables seem to be working almost flawlessly. Added partial support for the BGCOLOR attribute on all table elements. Still scrolling problems and offsets between different child tables doesn't always work correctly. Loosened the parser to allow appearance of the

element inside elements it shouldn't be appearing the XmNstrictHTMLChecking resource has been set to false. December 1 Tables are really going now: the COLSPAN and ROWSPAN attributes are now working. Table margins, cell and row padding also seems to work. November 26 More work on table layout: cell heights are now computed correctly, cell and rowspacing works, cell and row spanning should work. Nested tables also seems to work but has received little testing. November 25 First success at table displaying! The layout algorithm seems to work rather well (and fast!). Details aren't rendered yet (borders, background color or image), suppport for cell and row spanning hasn't been added and scrolling is sometimes messed up, but the borderline is: the basic table layout computation algorithm works, and it works damn GOOD! November 21 Finally found a satisfying design for table support. Extended the document formatter to fill in the table data structures. November 20 Internal changes to the parser as preparation for progressive document loading. Temporarely removed the ParserObject from the XmHTML Widget library. November 14 Played around with the HTML 4.0 event model: added the XmNeventProc resource to parse any scripts attached to these events and added the XmNeventCallback callback resource whenever an event should be served. Support for all HTML4.0 events is present in the code but currently only the onMouseUp and onMouseDown events are support for anchors. Still thinking about a decent and fast way to handle tables. November 12 Some small performance increases in the document formatter: whenever possible, objects are reused instead of being deleted. November 11 Played around a bit with the HTTP.c code in the contrib dir: - added a timeout on the connect() call using either setsockopt() or a bruteforce alarm() on systems that don't have support the SO_RCVTIMEO setsockopt flag; - added a select() on read() using a user-specified timeout and retry count; - added a small tool, httpget.c, in the tools directory demonstrating a fairly straightforward use of the HTTP code. This little tool can fetch an URL from any site you give feed it. The result of the above changes is that loadHTTPURL will never block again. Modified a few routines in parse.c so that they can now be shared by both XmHTML and XmHTMLParser. Small bugfix in ScrollToLine. November 10 Added the XmNclientData resource. This resource allows one to provide a pointer to client data that should be provided as the last argument to any function installed on any of the functional XmNanchorVisitedProc and XmNimageProc resources. As a logical consequence, the corresponding typedef for these resources now have one additional argument of type XtPointer. November 8 and 9 Working on tables; Much work on example_2.c: I'm completely rewriting it in a rather modular way where a basic Browser object can act in four different ways: as a complete browser, as member of a HTML frameset, as a popup window and as the desktop window. All of which can be used in every possible combination. November 3 All resource strings used by the XmHTML Widget Library are now placed in a separate header file called HTMLStrings.h. November 2 Added a XmBalloon widget to the library. This is a simple ``tooltip'' widget that can be popped up to display a small string. The string can be displayed in a rectangle or an oval (the latter is achieved using the Shape extension). example_2.c contains a possible usage: whenever an anchor is entered that contains the title attribute, this tooltip is popped up. October 31 Modified example_4 so it now also compiles and runs with X11R5 (or earlier) October 28 CDE and Solaris related Imakefile fixes and a workaround for a possible bug in SparcWorks cpp. October 26 Bugfix: the widget's size wasn't always correctly set at creation time. Modified XmHTML's translation table: anchor selection/document scrolling now works with any key combinations but Shift, Meta and Ctrl. The previous table masked of *all* modifiers, making the widget practically unseable if, for instance, the NumLock key was active. October 22 Bugfix on vertical scrolling: any vertical scroll requests are now properly ignored when the currently loaded document doesn't have a vertical scrollbar. October 21 XmHTML's form support is now complete: the XmNformCallback is now fully implemented thanks to Richard Offer (offer@sgi.com) Richard also provided a simple HTTP/1.0 implementation. A *big* round of applause! October 11 Released XmHTML/Beta Version 1.1.0, the first XmHTML Beta Release. October 10 Last preparations for the XmHTML Beta 1.1.0 release. Fixed a small bug in local anchor jumping: XmNanchorVisitedUnderlineType resource wasn't properly honored. Removed a number of unused resource class names from the XmHTML string table (1kb of data), added the XmCAnchorUnderlineType resource class and corresponding converter and added a warning message to the parser (in some cases it forgot to complain about closing elements without an opening counterpart). October 9 Added a ``fast'' mode to the parser which entirely bypasses the document verification and repair routines (as if it wasn't fast enough already :-) If you are absolute sure that a document is fully compliant with the HTML3.2 standard, and all elements for which termination is optional HAVE a terminator, setting the value of the XmNmimeType resource to text/html-perfect will select the fast parser. October 8 Finally fixed a very annoying bug: when the widget is created, the height wasn't always computed correctly, leading to incorrect screen updates when scrolling (small gaps appeared). The only way to get around this bug was to resize the widget. It turned out that the core class height gets modified sometime *after* the Widget's Initialize method has been called, but before it is being mapped to screen. What causes this is a mystery to me. Final preparations for the first official Beta release, 1.1.0: added a collection of manual pages that describe each and every convenience function offered by XmHTML and updated the (hugely out of data) widget description. October 7 Dithering to a fixed palette is now fully possible. There are four different methods available (closest match without error correction, ordered with and without error correction and closest match with error correction). You can specify a palette using the XmNimagePalette resource or let XmHTML create one for you. October 6 Working on implementing support for the XmNimageMapToPalette and XmNimagePalette resources, which allow you to define a palette for XmHTML to use. Besides the obvious advantages this can offer, another advantage is a rather large speedup when switching pages: since a palette contains a fixed number of colors, XmHTML can allocate all colors on startup and doesn't have to free them until it is destroyed. This obliterates the need to release allocated colors each time a new page is loaded. October 3 Replaced the current quantizer with a compacter and faster one. Previously XmHTML carried two quantizers: one for global use and one specifically for PNG images. Fixed a bug in the colormap reading code of GIF images. October 2 Fixed a small bug in form handling: optionmenu's didn't get reset when the reset button was pressed. September 28 Added support for Fast Loadable Graphics. This is a format especially designed for XmHTML and optimized for *very* fast loading of images. The FLG format is actually nothing more than a compacted version of the XmImageInfo structure, and as such it supports plain transparency, alpha channel and animations (with all GIF disposal methods). Data can be stored either compressed or uncompressed. Uncompressed FLG's are the fastest possible way to load an image into XmHTML, but they can take up a huge amount of space. A funny thing I noticed though is that, quite often, an uncompressed FLG takes up less space than the same image saved as a GIF image... Animation support: the global colormap of an animation is now only allocated once for the entire animation instead of being allocated for each frame separatly. This has two significant advantages: memory usage is reduced and less time is spent in allocating colors. XmHTML will now also use the global colormap if the local colormap of an animation frame is equal to the global colormap. September 26 Some changes to reduce memory usage: - Changed the type of the color component fields of the XmImageInfo structure from signed int to unsigned short (can save up to 1.5kb per image). Modified all internal color allocation routines as well; - the size of the clipmasks is now computed correctly: storage occupied by clipmask data has been reduced by a factor 8; - alpha channel processing of PNG images been modified to use a colormap instead of full RGBA quartets: the 24bit RGB data is converted to an 8bit paletted image and the alpha channel is stored separatly. This reduces the memory occupied by these images with at least a factor two; September 22 A lot of improvements in the font allocation/caching routines: - a separate font cache for each display is now maintained. The previous scheme didn't look at which display it was running while the font cache was shared between every XmHTML instance. Displaying multiple instances of a XmHTML widget on different displays should now be possible; - made the font caching scheme a lot more efficient and removed the limit on the maximum number of loadable fonts (it now uses a binary tree lookup instead of a lineair search through a table with fixed size; - fonts are now freed when the widget is destroyed (that is, the actual font data is only freed if the widget being destroyed is the last widget using a display-bound font cache); - modified the internal data structures so font properties are now stored with each font instead of calculating them each time the layout needs to be recalculated; One very major performance enhancement is the introduction of a smart font mapping scheme which maps unknown font names to known ones. I am particularly pleased with this scheme, it allows XmHTML to map fonts it does not know in the beginning to known ones later one. Assuming the helvetica font is present in your font path and arial isn't, the following happens: when XmHTML encounters a tag, it will not know to which font it should be mapped and it will use the default font (whatever that is). However, when at a later stage a is encountered, XmHTML will see that this Arial font can be mapped to the Helvetica font (which it does known), and as a result, any future reference to the Arial font will be mapped to the Helvetica font. XmHTML is smart enough to take any combination of weight, slant and size into account when making these decisions. Performance tests with the new font caching and mapping schemes show some very satisfactory results: the cache hit ratio is steadily increasing, approaching 90 or more percent after about 10 documents with different fonts have been loaded. The average number of search actions seems to remain steady around 7 in this case. The font cache contained 55 fonts (including 10 font mappings) in various families, sizes and styles. As a side note: this new ``font technology'' allows users to define their own font mapping by providing a document with a list of simple font mappings. See html/font_map.html for a sample document. Before I forget: I made the builtin cursor allocation display-independant as well. September 21 First success at flowing text around images with the ALIGN="LEFT" or ALIGN="RIGHT" attribute set. September 20 Small parser bugfix: mime type of a new document wasn't properly saved. Added a ``View Document Source'' menu item to example_2 and fixed a bug in jumping to locations in different files. September 18 Fixed a few important bugs: - imagemap list wasn't properly reset when a document was reformatted. Could lead to a SIGSEGV in some cases; - list of anchor data wasn't properly reset in some cases; XmHTML now properly honors the XmNstringDirection resource: when set to XmSTRING_DIRECTION_R_TO_L, text is properly inversed. Paragraphs contents are ordered from bottom to top. Needs a bit more work though: list markers are always left-aligned at the first line of a paragraph instead of right aligned at the bottom. Modified the linebreaking algorithm to handle line/paragraph breaks properly when the paragraphs contain non-text objects (HTML form components and images). Table support: changed the text layout algorithms to work independantly of XmHTML's dimensions. They now use a (dynamically adjustable) bounding box. September 16 When the title of a document is requested, leading and trailing spaces are now removed. Added the HeadDocType mask bit to the XmHTMLGetHeadAttributes() convenience function. When set, the value of the tag will be returned. Improved path resolution and mime detection routines in example_2.c September 10-12 Some prelimenary work on XmHTMLTextGetFormatted() September 4 Fixed a few important memory leaks. One of those caused the stored anchor data never to be freed. Reverted a few bad fixes. September 1 XmHTMLTextSetString fix, text was always rendered twice. Moved all resources into a stringtable. This actually seems to introduce a rather noticable speedup in document loading. Haven't got the slightest clue why this happens. August 29-31 Numerous bugfixes & memory leak fixups. A GRAND applause to Ricky Ralston for having the courage to run XmHTML through purify. Thanks Ricky!! Started with daily snapshot distribution. August 28 Released XmHTML/Alpha Version 1.0.21, last Alpha release. The next release will be the first publically available Beta. August 26 Rewrote and extended

 support greatly. Plain text, form
	components and images can now be mixed freely.

	Some minor changes in anchor rendering: anchors are now only extended to
	the right when there is room for it, they no longer cover adjacent text
	when activated.

	Added the XmNimageRGBConversion resource which allows one to select
	the conversion method XmHTML should use when converting 24bit to 8bit
	images.

August 25
	Changed the proto's for XmHTMLImageReplace() and XmHTMLImageUpdate():
	they now return a status indicating whether or not the document needs
	a recomputation of document layout if an image is replaced or updated.

	Fixed a bug in the default image processing: when images are delayed, the
	delayed icon wouldn't show up. I forgot to properly propagate the image
	dimensions.

August 21, evening
	Fully restored PNG alpha channeling support, there was a silly bug in
	doing the 24 to 8 bit conversion. Alpha channeling is now also supported
	for delayed images and any combination of background setting, set either
	via the loaded document or the SetValues method.
	See XmHTML PNG Demo for some screenshots.

	Transparent background images are now also supported.

August 21, morning
	Fixed a bug in delayed image loading that caused a fatal crash when
	the delayed image was freed.

	Progressive and normal image loading now share the same XImage creation
	and update routines. Also fixed clipmask creation for progressively
	loaded images.

	Rewrote most part of the handling of PNG images with an alpha channel.

	Several bugfixes and changes to example_2 and it's caching routines.

August 20
	HTML form support: vertical scrolling of a document with a HTML form in
	it should now be correct whether or not a horizontal scrollbar is present.
	Also fixed a bug in the SetValues method which caused XmHTML to ignore the
	already present form widgets.

	Modified the debug routines, output can now be sent to a file.

	Eliminated some dead/duplicate code in the painter and widget methods.

August 19
	HTML form support:

	-	The traversal stuff for tabbing between all HTML form components
		almost works. Still need to figure out the proper XmTextField
		translations so the tab key can be used instead of the enter key;
	-	added support for the HTML 


XmHTML-1.1.7/examples/test-pages/table1.html100644 23564 23564 630 6441401723 17014 0ustar newtnewt
XmNO_LINE /* no underlines */
XmSINGLE_LINE /* a single, solid, underline */
XmDOUBLE_LINE /* a double, solid, underline */
XmSINGLE_DASHED_LINE /* a single, dashed, underline */
XmDOUBLE_DASHED_LINE /* a double, dashed, underline */
XmHTML-1.1.7/examples/test-pages/table10.html100644 23564 23564 3731 6651245707 17134 0ustar newtnewt

Inherited Resources

XmHTML inherits the following resources. The resources are listed alphabetically, along with the superclass that defines them

 

Resource Inherited From Resource Inherited From
XmNaccelerators Core XmNancestorSensitive Core
XmNbackground Core XmNbackgroundPixmap Core
XmNborderColor Core XmNborderPixmap Core
XmNborderWidth Core XmNbottomShadowColor Core
XmNbottomShadowPixmap Core XmNchildren Composite
XmNcolormap Core XmNdepth Core
XmNdestroyCallback Core XmNforeground Manager
XmNhelpCallback Manager XmNheight Core
XmNhighlightColor Manager XmNhightlightPixmap Manager
XmNinitialResourcesPersistent Core XmNinsertPosition Composite
XmNmappedWhenManaged Core XmNnavigationType Manager
XmNnumChildren Composite XmNscreen Core
XmNsensitive Core XmNshadowThickness Manager
XmNstringDirection Manager XmNtopShadowColor Manager
XmNtopShadowPixmap Manager XmNtranslations Core
XmNtraversalOn Manager XmNunitType Manager
XmNuserData Manager XmNwidth Core
XmNx Core XmNy Core

XmHTML-1.1.7/examples/test-pages/table2.html100644 23564 23564 2214 6576005750 17046 0ustar newtnewt
XmNimageMapToPalette
This resource determines if a XmHTML widget should perform dithering to a fixed palette and if so how that should be done.

Possible values are:
XmQUICK A closest distance algorithm is used to map image colors to the palette. No error correction is performed. Fast, but the resulting image quality depends on the distribution of the colors in the image.
XmBEST Ordered dither using predefined error matrices. Offers the best balance between speed and quality but uses a lot of memory (512kb).
XmFAST Simple ordered dither without error correction. This is the fastest method but uses a lot of memory (512kb).
XmSLOW A closest distance algorithm followed by Floyd-Steinberg error diffusion. Slowest method but highest quality.
XmDISABLED disables palette mapping. This is the default setting.

XmHTML-1.1.7/examples/test-pages/table3.html100644 23564 23564 3252 6650743421 17047 0ustar newtnewt
XmQUICK A closest distance algorithm is used to map image colors to the palette. No error correction is performed. Fast, but the resulting image quality depends on the distribution of the colors in the image.
XmBEST Ordered dither using predefined error matrices. Offers the best balance between speed and quality but uses a lot of memory (512kb).
XmFAST Simple ordered dither without error correction. This is the fastest method but uses a lot of memory (512kb).
XmNO_LINE /* no underlines */
XmSINGLE_LINE /* a single, solid, underline */
XmDOUBLE_LINE /* a double, solid, underline */
XmSINGLE_DASHED_LINE /* a single, dashed, underline */
XmDOUBLE_DASHED_LINE /* a double, dashed, underline */
XmSLOW A closest distance algorithm followed by Floyd-Steinberg error diffusion. Slowest method but highest quality.
XmDISABLED disables palette mapping. This is the default setting.
XmHTML-1.1.7/examples/test-pages/table4.html100644 23564 23564 5553 6465621345 17062 0ustar newtnewt
XmQUICK A closest distance algorithm is used to map image colors to the palette. No error correction is performed. Fast, but the resulting image quality depends on the distribution of the colors in the image.
XmBEST Ordered dither using predefined error matrices. Offers the best balance between speed and quality but uses a lot of memory (512kb).
XmFAST Simple ordered dither without error correction. This is the fastest method but uses a lot of memory (512kb).
XmSLOW A closest distance algorithm followed by Floyd-Steinberg error diffusion. Slowest method but highest quality.
XmDISABLED This cell spans two rows and two columns. Lets see how XmHTML deals with this. I'm really curious here, but if all is well this is just needless worrying. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know. Some text to fill this cell up, it's pretty large, you know.
XmDISABLED
XmDISABLED disables palette mapping. This is the default setting.
this row contains 3 (three) cells....
some bogus text to test the colspan attribute in a HTML3.2 table. This text should span accross the entire width of the table, so let's see if it does. If it doesn't I have a problem. The only case in which it shouldn't span the entire table is when the cellpadding attribute is set.
XmDISABLED this cell should span two (2) columns. Same note about cellpadding applies here as well.
Same as previous row, but this time reversed. This cell should span two columns. XmDISABLED
LEFT
CENTER
RIGHT
XmHTML-1.1.7/examples/test-pages/table5.html100644 23564 23564 3143 6441354756 17057 0ustar newtnewt
Headings
  • H1 - Level 1 header
  • H2 - Level 2 header
  • H3 - Level 3 header
  • H4 - Level 4 header
  • H5 - Level 5 header
  • H6 - Level 6 header
Lists
  • UL - Unordered list
  • OL - Ordered list
  • DIR - Directory list
  • MENU - Menu item list
  • LI - List item
  • DL - Definition list
    • DT - Definition term
    • DD- Definition
Text containers Others
  • DIV - Logical division
  • CENTER - Centered division
  • FORM - Input form
  • HR - Horizontal rule
  • TABLE - Tables
XmHTML-1.1.7/examples/test-pages/table6.html100644 23564 23564 2027 6464000761 17045 0ustar newtnewt
A test table with merged cells
Average other
category
Misc
height weight
males 1.9 0.003
females 1.7 0.002

This could appear as follows, in a text browser:

          A test table with merged cells
/--------------------------------------------------\ 
|          |      Average      |  other   |  Misc  |
|          |-------------------| category |--------|
|          |  height |  weight |          |        |
|-----------------------------------------|--------|
| males    |   1.9   |  0.003  |          |        |
|-----------------------------------------|--------|
| females  |   1.7   |  0.002  |          |        |
\--------------------------------------------------/
XmHTML-1.1.7/examples/test-pages/table7.html100600 23564 23564 23014 6441256113 17054 0ustar newtnewt WebCrawler
WebCrawler - Just what you're   
  Home  
yellow pages newsgroups people finder maps
horoscopes classifieds stock quotes weather
Channels
My Page - Your own personalized WebCrawler Channel
Arts & Books   Home & Family
Auto News
Business & Investing People & Chat
Careers & Education Reference
Computers & Internet Relationships
Entertainment Shopping  
Games Sports & Recreation
Health & Fitness Travel

Entertainment: Leo lover got you down?
Rate your Romance and find your zodiac match!

Services


click here
click here

Global Excite: Australia · France · Germany · Japan · Netherlands · Sweden · U.K.
Bookmark WebCrawler  ·  About Excite  ·  Advertise on WebCrawler

.

 copyright © 1997 Excite, Inc.
Your WebCrawler Page Email Help Find & Buy Music Free Classified Ads Buy Books Yellow Pages XmHTML-1.1.7/examples/test-pages/table8.html100644 23564 23564 6031 6441347313 17050 0ustar newtnewt











XmHTML-1.1.7/examples/test-pages/table9.html100644 23564 23564 1175 6441373200 17047 0ustar newtnewt
XmNanchorUnderlineType
Underlining style for anchors. Can be any of the following:

XmNO_LINE /* no underlines */
XmSINGLE_LINE /* a single, solid, underline */
XmDOUBLE_LINE /* a double, solid, underline */
XmSINGLE_DASHED_LINE /* a single, dashed, underline */
XmDOUBLE_DASHED_LINE /* a double, dashed, underline */

This resource is only honored when the XmNanchorButtons resource is set to False

XmHTML-1.1.7/examples/test-pages/table11.html100644 23564 23564 757 6443116330 17106 0ustar newtnewt
XmDISABLED XmFAST XmQUICK Same as previous row, but this time reversed. This cell should span two columns.
LEFT
CENTER
RIGHT
XmHTML-1.1.7/examples/test-pages/icons.html100644 23564 23564 6062 6563144716 17017 0ustar newtnewt

&folder; .
&folder; ..
&archive; libXmHTML.a
&binary.document; images.o
&folder; pixmaps
&text.document; icons.h
&binary.document; parse.o
&text.document; images.c
&text.document; parse.c
&text.document; XmHTMLfuncs.h
&binary.document; debug_menu.o
&binary.document; debug.o
&binary.document; warnings.o
&binary.document; strings.o
&binary.document; private.o
&binary.document; public.o
&binary.document; stack.o
&binary.document; motif.o
&binary.document; output.o
&binary.document; textsel.o
&binary.document; error.o
&binary.document; plc.o
&binary.document; LZWStream.o
&binary.document; quantize.o
&binary.document; XCC.o
&binary.document; map.o
&binary.document; readPNG.o
&binary.document; readJPEGplc.o
&binary.document; readJPEG.o
&binary.document; readXPM.o
&binary.document; readGIFplc.o
&binary.document; readGIF.o
&binary.document; readFLG.o
&binary.document; readBitmap.o
&binary.document; colors.o
&binary.document; paint.o
&binary.document; layout.o
&binary.document; format.o
&binary.document; StringUtil.o
&binary.document; forms.o
&binary.document; frames.o
&binary.document; events.o
&binary.document; callbacks.o
&binary.document; fonts.o
&binary.document; XmImage.o
&binary.document; Balloon.o
&binary.document; XmHTML.o
&text.document; resources.h
&unknown.document; stamp-includes
&binary.document; mkStrings
&text.document; strings.c
&text.document; HTMLStrings.h
&text.document; warnings.c
&text.document; HTMLWarnings.h
&text.document; strings.lst
&text.document; Makefile
&text.document; XmHTMLI.h
&text.document; miniparse.h
&text.document; Makefile.org
&text.document; XmHTMLP.h
&text.document; paint.c
&text.document; layout.c
&text.document; XmHTML.c
&text.document; private.c
&text.document; public.c
&text.document; XmHTML.h
&text.document; HTML.h
&text.document; format.c
&text.document; format_new.c
&text.document; LZWStream.c
&folder; compat
&text.document; StringUtil.c
&folder; bitmaps
&text.document; colors.c
&text.document; toolkit.h
&text.document; fonts.c
&text.document; events.c
&text.document; callbacks.c
&text.document; frames.c
&text.document; motif.c
&folder; gtk-xmhtml
&text.document; Imakefile
&text.document; object.c
&text.document; textsel.c
&text.document; Balloon.c
&text.document; readFLG.c
&text.document; XCC.c
&text.document; readXPM.c
&text.document; readBitmap.c
&text.document; plc.h
&text.document; XCCP.h
&text.document; Balloon.h
&text.document; BalloonP.h
&text.document; debug.c
&text.document; XCC.h
&text.document; readGIF.c
&text.document; readJPEG.c
&text.document; readPNG.c
&text.document; map.c
&text.document; error.c
&text.document; LZWStream.h
&text.document; forms.c
&text.document; XmImage.c
&text.document; quantize.c
&text.document; plc.c
&text.document; debug.h
&text.document; readGIFplc.c
&text.document; readJPEGplc.c
&text.document; mkStrings.c
&text.document; output.c
&text.document; debug_menu.c
&text.document; debug_menu.h
&text.document; escapes.h
&text.document; stack.c
&text.document; stack.h
&text.document; warnings.lst
XmHTML-1.1.7/examples/test-pages/dusan.html100644 23564 23564 11670 6575531666 17046 0ustar newtnewt ArahDobby 2.8f: Saddlew5835

Saddlew5835

ArahDobby 2.8f: Saddlew5835
http://www.arahne.si
© 1993-98 Arahne; pallas:dusan
07.09.1998
Length of fabric 90.00 m
Raw width 155.00 cm
Finished width 150.00 cm
Density Warp10.20 / cm
Density Weft8.10 / cm
Regulator 1
Weaving-in 2.50%
Loss 8.00%
Consumption46.12 kg
Raw weight471.5 g/m
304.2 g/m2
Reed space Reed number Denting Dents
185.50 cm16.00 / cm2804
Repeat
threads
Weave
DesignDenting
Regulator
Weave
Design
Total
Warp64
4 Shafts
64
6.27 cm
2
1 Dents
64
6.27 cm
64
6.27 cm
Weft468
8.29 cm
1
1 advances
68
8.29 cm
68
8.29 cm
Coverfactor
WarpWeftTotalTransparency
78.23%67.45%72.84%7.08%
Warp pattern (25x): 24A 2B 38A
Leftover (8 threads): 8A
WarpRepeat
threads
Design
threads
Selvedges
threads
Total
threads
Repeat
%
Design
kg
Selvedges
kg
Total
kg
A6215582*6157096.8823.2860.17923.465
B2500503.120.7470.0000.747
Total8+25*64=1608+12=162024.033+0.179=24.212
WarpAB
Count (tex)149.00149.00
Twists / m300 Z/2300 Z/2
1
50.0%
50.0%
66.7%
33.3%
218-0121 Elm Green14-6319 Meadow
319-3642 Royal Purple17-3834 Dahlia Purple
Weft pattern: 33(1a 1b) 2c
WeftRepeat
threads
Repeat
%
kg
a3348.5310.632
b3348.5310.632
c22.940.644
Total6821.909
Weftabc
Count (tex)149.00149.00149.00
Twists / m300 Z/2300 Z/2400 S/2
1
50.0%
50.0%
50.0%
50.0%
19-1532 Rosewood
218-1016 Cub14-6305 Pelican17-1118 Lead Gray
316-1126 Antelope18-0939 Drab18-0835 Dried Tobacco
shaft1234
threads402402402402
g/m59.959.959.959.9
XmHTML-1.1.7/examples/test-pages/chinese.html100644 23564 23564 314 6604752121 17263 0ustar newtnewt

ÖÕ¶Ë·ÂÕæÆ÷ÊÇÒ»¸öÏÔʾ¿ØÖƵÄÓ¦ÓóÌÐò

ËüÈÃÄãʹÓÃUNIXÃüÁ²¢ÔÚÖÕ¶Ë ·ÂÕæÆ÷´°¿ÚÄÚ»òÖ®¼ä¼ôÇкÍÕ³ÌùÎı¾

XmHTML-1.1.7/examples/test-pages/english.html100644 23564 23564 321 6604750245 17301 0ustar newtnewt A Very Simple English HTML Page

This is an H1 Header

This is a plain line of text

XmHTML-1.1.7/examples/test-pages/table7.html.swp100600 23564 23564 40000 6646237445 17674 0ustar newtnewtb0VIM 4.6K\…4]P ( newthorizon.rsd.xs4all.nl~newt/src/XmHTML/XmHTML-1.1.7/examples/test-pages/table7.html3210#"! Utpÿ–ÿÿÿÿ«—oBad„–ùò×϶µuoK Ó˦œ”‡nd)"þ Ù › ^ P H A 8 7 ø ó Ë ± œ W "   ß ¶ ­ ¥ ž ‰ R I ? Ò Ä ¹ ¥ š [ 0 "   ø î ¹ ‚ t i U J @ çÙÎÄ»±|QC8.ùÒĹN@5+öÑø®¡˜…{zaZT= ø»«d ü÷ñ±ª^VH?4+#ØÑ™w\RC8.%æØÎ¹±ª„ƒ - Your own personalized WebCrawler Channel My Page
Channels
  •  US Targets Internet Porn
  •  Prosecution Rests in Denver Counsel
  •  Reno Decides No Outside
  • weather stock quotes classifieds horoscopes maps people finder newsgroups yellow pages
      WIDTH="200" HEIGHT="25" ISMAP USEMAP="#gnav" BORDER="0">
    Home     "looking for!" WIDTH="242" HEIGHT="50" BORDER="0"> WebCrawler - Just what you're  WebCrawleradÓoÌ£g_XRIHD;ðéÅ«€oK&ñ Ê ¹ • r a =  ý Ù ´ £  ` U M F 3 ,  Í Â ¬ ˆ Q F 0 Ç ¼ ´ ­ £ ™ ˜ ” S M 4  û õ Á ™ \ 7 / '    Á³ª†L=3-#"˶j4ý½­iY ̱ª“l/ûѪ£›“’ HREF="http://www.microsoft.com/ie/"> HREF="http://home.netscape.com/comprod/mirror/index.html"> HREF="yellowpages.html"> Yellow PagesBuy BooksFree Classified AdsFind & Buy Music HREF="/Help/Help.html"> HelpEmailYour WebCrawler Page Excite, Inc. © 1997  copyright

    USEMAP="#footerbar" BORDER="0"> .

    Advertise on WebCrawler  ·  About Excite  ·  Bookmark WebCrawler U.K. · Sweden · Netherlands · Japan · Germany · France · Australia Global Excite:


    click here WIDTH="125" HEIGHT="48" BORDER="0"> click here) - form-test.pl: small perl script to verify a form submit. To use this script, copy it to your local cgi-bin directory and load the file test-pages/form-test.html in example_4 - HTMLDemos.ad: a default resource file which can be used by all examples. Copy this file to your home directory and rename to HTMLDemos (or include it in your .Xdefaults file and prefix each resource with HTMLDemos*) XmHTML-1.1.7/examples/visual.c100644 23564 23564 16774 6606473110 14433 0ustar newtnewt#ifndef lint static char rcsId[]="$Header: /usr/local/rcs/Newt/XmHTML/RCS/visual.c,v 1.1 1997/05/28 02:01:34 newt Exp newt $"; #endif /***** * visual.c : visual & colormap support code for the XmHTML examples. * * This file Version $Revision: 1.1 $ * * Creation date: Thu May 1 00:17:12 GMT+0100 1997 * Last modification: $Date: 1997/05/28 02:01:34 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: John L. Cwikla * X Programmer * Wolfram Research Inc. * cwikla@wri.com * * Copyright (C) 1996 by John C. Cwikla * Copyright (C) 1997 by 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. * *****/ /***** * ChangeLog * $Log: visual.c,v $ * Revision 1.1 1997/05/28 02:01:34 newt * Initial Revision * *****/ #include #include #include #include /*** External Function Prototype Declarations ***/ /*** Public Variable Declarations ***/ /*** Private Datatype Declarations ****/ #define XmNvisualID "visualID" #define XmNapplicationDepth "applicationDepth" #define XmNvisualClass "visualClass" #define XmNusePrivateColormap "usePrivateColormap" #define XmCVisualID "VisualID" #define XmCApplicationDepth "ApplicationDepth" #define XmCVisualClass "VisualClass" #define XmCUsePrivateColormap "UsePrivateColormap" /*** Private Function Prototype Declarations ****/ /*** Private Variable Declarations ***/ typedef struct _OurResourceStruct { int visualID; int applicationDepth; int visualClass; Boolean usePrivateColormap; }OurResourceStruct, *OurResourcePtr; OurResourceStruct ourResources; #define UNDEFINED_DEFAULT -1 #define TheOffset(a) XtOffset(OurResourcePtr, a) static XtResource AppResources[] = { { XmNvisualID, XmCVisualID, XtRInt, sizeof(int), TheOffset(visualID), XtRImmediate, (XtPointer)UNDEFINED_DEFAULT }, { XmNapplicationDepth, XmCApplicationDepth, XtRInt, sizeof(int), TheOffset(applicationDepth), XtRImmediate, (XtPointer)UNDEFINED_DEFAULT }, { XmNvisualClass, XmCVisualClass, XtRInt, sizeof(int), TheOffset(visualClass), XtRImmediate, (XtPointer)UNDEFINED_DEFAULT }, { XmNusePrivateColormap, XmCUsePrivateColormap, XtRBoolean, sizeof(Boolean), TheOffset(usePrivateColormap), XtRImmediate, (XtPointer)FALSE }, }; /***** * Name: getStartupVisual * Return Type: int * Description: pick visual and colormap that are in balance. * In: * shell: widget for which to pick visual and colormap; * visual: visual picked, updated upon return; * colormap: created colormap (default or privated), updated upon return; * depth: required depth. * Returns: * True when args have been updated, false if not. * Note: * This routine comes from an article of John Cwikla that appeared in the * X Advisor Journal, ``Beyond the Default Visual'', dated june 1995. Read it * to get the full story and why the resources. You can find this article at: * http://www.unx.com/DD/advisor/docs/jun95/jun95.cwikla1.shtml *****/ int getStartupVisual(Widget shell, Visual **visual, int *depth, Colormap *colormap) { Display *display; int success = FALSE, screen; int theVisualClass; XVisualInfo theVisualInfo; static Visual *theVisual; static Colormap theColormap; static int theApplicationDepth; display = XtDisplay(shell); XtGetApplicationResources(shell, &ourResources, AppResources, XtNumber(AppResources), NULL, 0); /* if no resources have been set, just return */ if(ourResources.visualID == UNDEFINED_DEFAULT && ourResources.applicationDepth == UNDEFINED_DEFAULT && ourResources.visualClass == UNDEFINED_DEFAULT && ourResources.usePrivateColormap == FALSE) { return(FALSE); } if(ourResources.visualID != UNDEFINED_DEFAULT) { XVisualInfo vtemp, *vinfos; int vitems; vtemp.visualid = ourResources.visualID; vinfos = XGetVisualInfo(display, VisualIDMask, &vtemp, &vitems); if(vinfos != NULL) { /* Better only be one match! */ theVisual = vinfos[0].visual; theApplicationDepth = vinfos[0].depth; theVisualClass = vinfos[0].class; XFree(vinfos); success = TRUE; } } screen = DefaultScreen(display); if(!success) { /* Step 2 */ if((ourResources.applicationDepth == UNDEFINED_DEFAULT) && (ourResources.visualClass == UNDEFINED_DEFAULT)) { theVisual = DefaultVisual(display, screen); theApplicationDepth = DefaultDepth(display, screen); theVisualClass = theVisual->class; } else { /* Step 3 */ if(ourResources.applicationDepth == UNDEFINED_DEFAULT) theApplicationDepth = DefaultDepth(display, screen); else theApplicationDepth = ourResources.applicationDepth; if(ourResources.visualClass == UNDEFINED_DEFAULT) theVisualClass = DefaultVisual(display, screen)->class; else theVisualClass = ourResources.visualClass; if(XMatchVisualInfo(display, screen, theApplicationDepth, theVisualClass, &theVisualInfo) != 0) { theVisual = theVisualInfo.visual; theApplicationDepth = theVisualInfo.depth; theVisualClass = theVisualInfo.class; } else { /* Step 4 */ XVisualInfo visTemplate; XVisualInfo *visReturn; int numVis, n; visReturn = (XVisualInfo *)NULL; n = 0; /* See if we can find a visual at the depth they ask for. */ if(ourResources.applicationDepth != UNDEFINED_DEFAULT) { visTemplate.depth = ourResources.applicationDepth; visReturn = XGetVisualInfo(display, VisualDepthMask, &visTemplate, &numVis); /* * If numVis > 1 you may want to have it pick your favorite * visual. This is not necessary since the user still has * finer control by setting XtNvisualClass or XtNvisualID. */ /* Step 5 */ if(visReturn == (XVisualInfo *)NULL) { visTemplate.class = theVisualClass; visReturn = XGetVisualInfo(display, VisualClassMask, &visTemplate, &numVis); if(visReturn != (XVisualInfo *)NULL) { int i, d = 0; for(i = 1; i < numVis; i++) { if(d < visReturn[i].depth) { d = visReturn[i].depth; n = i; } } } } /* Step 6 */ if(visReturn == (XVisualInfo *)NULL) { theVisual = DefaultVisual(display, screen); theApplicationDepth = DefaultDepth(display, screen); theVisualClass = theVisual->class; } else { theVisual = visReturn[n].visual; theApplicationDepth = visReturn[n].depth; theVisualClass = visReturn[n].class; } } } } } if((theVisual->visualid == DefaultVisual(display, screen)->visualid) && !ourResources.usePrivateColormap) theColormap = DefaultColormap(display, screen); else theColormap = XCreateColormap(display, RootWindow(display, screen), theVisual, AllocNone); /* get everything, set return values */ *visual = theVisual; *depth = theApplicationDepth; *colormap = theColormap; return(True); } XmHTML-1.1.7/examples/misc.c100644 23564 23564 34220 6606473110 14045 0ustar newtnewt#ifndef lint static char rcsId[]="$Header: /usr/local/rcs/Newt/XmHTML/RCS/misc.c,v 2.3 1997/10/23 00:28:44 newt Exp newt $"; #endif /***** * misc.c : misc. stuff used by the examples. * * This file Version $Revision: 2.3 $ * * Creation date: Wed May 29 22:35:32 GMT+0100 1996 * Last modification: $Date: 1997/10/23 00:28:44 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by Ripley Software Development * All Rights Reserved * * This file is part 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. * * Note: this file has a long history. It's first use was in iEdit, an editor * for programmers I started on way back in '94. It then was changed and * greatly extended for use with Newt, my master thesis study and was * then adapted for use with XntHelp, the help application for both Newt * and eXode. And now it is finding its use with XmHTML as well... * Good software can be quite reusable ;-) *****/ /***** * ChangeLog * $Log: misc.c,v $ * Revision 2.3 1997/10/23 00:28:44 newt * XmHTML Beta 1.1.0 release * * Revision 2.2 1997/05/28 02:14:25 newt * Moved and adapted from XntHelp, the Newt and eXode help tool. * * Revision 2.1 1997/02/11 02:26:07 newt * removed newt specific typedefs * * Revision 2.0 1996/09/19 02:45:20 newt * Updated for source revision 2.0 * * Revision 1.7 1996/06/27 03:54:52 newt * Changes due to the new ntError prototype. * * Revision 1.6 1996/01/16 04:05:52 newt * changed to call to NT_ERROR() to comply with the modified macro: each * NT_() error macro now requires two arguments. * * Revision 1.5 1996/01/13 01:45:46 newt * replaced all malloc/calloc calls with newt memory routines nt_malloc and * nt_calloc. * * Revision 1.4 1996/01/11 23:54:24 newt * made much-called routines inline using FAST * * Revision 1.3 1995/12/14 07:50:04 newt * fixed a few typedefs remaining from importing parseFilename and removeSpaces. * * Revision 1.2 1995/12/14 02:34:06 newt * Added the parseFilename and removeSpaces routines. * * Revision 1.1 1995/12/05 21:12:09 koen * Initial revision * *****/ #include #include #include #ifdef HAVE_STRINGS_H #include #endif #include #include #include #include #include #include #include #include #include "misc.h" #ifdef DMALLOC #include #endif /***** * external function prototypes *****/ /* can be found in XmHTML */ extern char *my_strcasestr(const char *s1, const char *s2); /***** * Local function prototypes *****/ static int normalizePathname(char *pathname); static int compressPathname(char *pathname); static char *nextSlash(char *ptr); static char *prevSlash(char *ptr); static int compareThruSlash(char *string1, char *string2); static void copyThruSlash(char **toString, char **fromString); /***** * countStrings: count the number of strings in a string with a given * separator. * In: * src: source containing strings to be counted * sep: separator used between the strings. * Returns: * the number of strings in src. *****/ short int countStrings(char *src, const char sep) { register char *chPtr; static short int numStr = 0; for(chPtr = &src[0]; *chPtr != '\0'; chPtr++) { if(*chPtr == sep) numStr++; } /* * if the last character in the given string is not terminated by the * given separation character, add one to the counted strings * We always return the total number of separate strings found. The * following test will add 1 to the counted strings if the array given * is not terminated with a closing separator. * As a side effect, it will set numStr to 1 if there is only one string * present. */ if(src[strlen(src)-1] != sep) numStr++; return(numStr); } static char* nextSlash(char *ptr) { for(; *ptr!='/'; ptr++) { if (*ptr == '\0') return(NULL); } return(ptr + 1); } static char* prevSlash(char *ptr) { for(ptr -= 2; *ptr!='/'; ptr--); return(ptr + 1); } static void copyThruSlash(char **toString, char **fromString) { char *to = *toString; char *from = *fromString; while (1) { *to = *from; if (*from =='\0') { *fromString = NULL; return; } if (*from=='/') { *toString = to + 1; *fromString = from + 1; return; } from++; to++; } } static int compareThruSlash(char *string1, char *string2) { while (1) { if (*string1 != *string2) return(0); if (*string1 =='\0' || *string1=='/') return(1); string1++; string2++; } } static int compressPathname(char *pathname) { char *inPtr, *outPtr; /* compress out . and .. */ inPtr = &pathname[1]; /* start after initial / */ outPtr = &pathname[1]; while (1) { /* if the next component is "../", remove previous component */ if ((compareThruSlash(inPtr, "../"))!= 0) { /* error if already at beginning of string */ if (outPtr == &pathname[1]) return(0); /* back up outPtr to remove last path name component */ outPtr = prevSlash(outPtr); inPtr = nextSlash(inPtr); } else if ((compareThruSlash(inPtr, "./"))!= 0) /* don't copy the component if it's a redundant "./" */ inPtr = nextSlash(inPtr); else /* copy the component to outPtr */ copyThruSlash(&outPtr, &inPtr); if (inPtr == NULL) return(1); } } static int normalizePathname(char *pathname) { char oldPathname[MAXPATHLEN+1], wd[MAXPATHLEN+1]; /* If this path is relative, prepend the current working directory */ if (pathname[0] != '/') { strcpy(oldPathname, pathname); getcwd(wd, MAXPATHLEN+1); strcpy(pathname, wd); strcat(pathname, "/"); strcat(pathname, oldPathname); } /* compress out .. and . */ return(compressPathname(pathname)); } /***** * Decompose a Unix file name into a file name and a path * This function originally comes from Nedit. * Used with kind permission of Mark Edel (Author of Nedit). *****/ int parseFilename(char *fullname, char *filename, char *pathname) { int fullLen = strlen(fullname); int i, pathLen, fileLen; /* find the last slash */ for (i=fullLen-1; i>=0; i--) if (fullname[i] == '/') break; /* move chars before / (or ] or :) into pathname,& after into filename */ pathLen = i + 1; fileLen = fullLen - pathLen; strncpy(pathname, fullname, pathLen); pathname[pathLen] = 0; strncpy(filename, &fullname[pathLen], fileLen); filename[fileLen] = 0; return(normalizePathname(pathname)); } /***** * Name: XMessage * Return Type: void * Description: displays a message dialog * In: * widget: parent widget; * msg: message to be displayed; * Returns: * nothing *****/ void XMessage(Widget widget, String msg) { static Widget dialog; Arg args[2]; XmString xms; /* create dialog */ if(!dialog) { dialog = XmCreateInformationDialog(widget, "Message", NULL, 0); /* remove the cancel and help button */ XtUnmanageChild( XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild( XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON)); /* set the title */ XtVaSetValues(XtParent(dialog), XmNtitle, "Message", NULL); } /* create message */ xms = XmStringCreateLtoR(msg, XmSTRING_DEFAULT_CHARSET); /* set it */ XtSetArg(args[0], XmNmessageString, xms); XtSetArg(args[1], XmNmessageAlignment, XmALIGNMENT_CENTER); XtSetValues(dialog, args, 2); /* no longer needed, free it */ XmStringFree(xms); /* show it */ XtManageChild(dialog); XtPopup(XtParent(dialog), XtGrabNone); XMapRaised(XtDisplay(dialog), XtWindow(XtParent(dialog))); } /***** * Name: setBusy * Return Type: void * Description: changes the cursor from or to a stopwatch to indicate we are * busy doing something lengthy processing which can't be * interrupted. * In: * state: True to display the cursor as busy, False to display the * normal cursor. * Returns: * nothing. *****/ void setBusy(Widget w, Boolean state) { static Boolean busy; static Cursor cursor; Display *display = XtDisplay(w); if(!cursor) { cursor = XCreateFontCursor(display, XC_watch); busy = False; } if(busy != state) { busy = state; if(busy) XDefineCursor(display, XtWindow(w), cursor); else XUndefineCursor(display, XtWindow(w)); } XFlush(display); } /***** * Follow symbolic links (if any) to translate filename into the name of the * real file that it represents. Returns TRUE if the call was successful, * meaning the links were translated successfully, or the file was not * linked to begin with (or there was no file). Returns false if some * error prevented the call from determining if there were symbolic links * to process, or there was an error in processing them. The error * can be read from the unix global variable errno. *****/ Boolean followSymLinks(String filename) { /***** * FIXME * * readlink doesn't seem to do anything at all on Linux 2.0.27, * libc 5.3.12 *****/ int cc; char buf[1024]; cc = readlink(filename, buf, 1024); if (cc == -1) { #ifdef __sgi if (errno == EINVAL || errno == ENOENT || errno == ENXIO) #else if (errno == EINVAL || errno == ENOENT) #endif /* no error, just not a symbolic link, or no file */ return(True); else return(False); } else { buf[cc] = '\0'; strcpy(filename, buf); return(True); } } /***** * Name: getMimeType * Return Type: int * Description: make a guess at the mime type of a document by looking at * the extension of the given document. * In: * file: file for which to get a mime-type; * Returns: * mime type of the given file. *****/ mimeType getMimeType(String file) { String chPtr; unsigned char img_type; if((chPtr = strstr(file, ".")) != NULL) { String start; /* first check if this is plain HTML or not */ for(start = &file[strlen(file)-1]; *start && *start != '.'; start--); if(!strcasecmp(start, ".html") || !strcasecmp(start, ".htm")) return(MIME_HTML); if(!strcasecmp(start, ".htmlp")) return(MIME_HTML_PERFECT); } /* something else then? */ /* check if this is an image XmHTML knows of */ if((img_type = XmHTMLImageGetType(file, NULL, 0)) == IMAGE_ERROR) return(MIME_ERR); /***** * Not an image we know of, get first line in file and see if it's * html anyway *****/ if(img_type == IMAGE_UNKNOWN) { FILE *fp; char buf[128]; /* open file */ if((fp = fopen(file, "r")) == NULL) return(MIME_ERR); /* read first line in file */ if((chPtr = fgets(buf, 128, fp)) == NULL) { /* close again */ fclose(fp); return(MIME_ERR); } /* close again */ fclose(fp); /* see if it contains any of these strings */ if(my_strcasestr(buf, " #include #include #include #include "cache.h" /*** External Function Prototype Declarations ***/ /*** Public Variable Declarations ***/ /*** Private Datatype Declarations ****/ /* cache object */ typedef struct _CacheObject{ XtPointer object; /* object data */ String file; /* location of object on local file system */ int ref_count; /* reference count for this entry */ int map_count; /* no of mappings to this entry */ int size; /* size of this object */ struct _CacheObject *prev; /* previous entry */ struct _CacheObject *next; /* next entry */ }CacheObject; /* mapping between object urls and the object cache */ typedef struct _objectMapping{ String url; /* url referencing this object */ int ref_count; /* reference counter for this mapping */ CacheObject *cache_entry; /* ptr. to cache entry */ struct _objectMapping *prev; /* previous entry */ struct _objectMapping *next; /* next entry */ }ObjectMapping; /*** Private Function Prototype Declarations ****/ static void addObjectMapping(CacheObject *cache_entry, String url); static void discardCacheEntry(CacheObject *cache_entry); static void discardMapEntry(ObjectMapping *cache_entry); static ObjectMapping *newMap(ObjectMapping *map, ObjectMapping *prev_map, CacheObject *cache_entry, String url); static CacheObject *newEntry(CacheObject *entry, CacheObject *prev_entry, XtPointer object, String file, String url); /*** Private Variable Declarations ***/ /* initial cache size in bytes: 512 kb */ #define DEFAULT_CACHE_SIZE 524288 static int cacheSize = DEFAULT_CACHE_SIZE; static int currentCacheSize = 0; /* used size of the cache */ static CacheObject *objectCache; /* actual object cache */ static ObjectMapping *objectMapping; /* url->file mapping */ static cleanObjectProc cleanProc = NULL; /* clean-up function */ static sizeObjectProc sizeProc = NULL; /* object size function */ static XtPointer clientData; /* client_data for external funcs */ /****** *** Private functions ******/ /***** * Name: newMap * Return Type: ObjectMapping* * Description: add a new entry to the chain of url->cache_entry mappings * In: * map: parent map; * prev_map: previous map; * cache_e..: cache entry referenced; * url: url used to reference cache_entry * Returns: * a newly created map entry. *****/ static ObjectMapping* newMap(ObjectMapping *map, ObjectMapping *prev_map, CacheObject *cache_entry, String url) { if(map == NULL) { map = (ObjectMapping*)malloc(sizeof(ObjectMapping)); map->url = strdup(url); map->cache_entry = cache_entry; map->next = NULL; map->prev = prev_map; map->ref_count = 1; cache_entry->map_count++; } else map->next = newMap(map->next, map, cache_entry, url); return(map); } /***** * Name: newEntry * Return Type: CacheObject* * Description: add a new entry to the cache * In: * entry: parent entry; * prev_en..: previous entry; * object: data to be stored; * file: location on the local file system; * url: url used to reference this object; * Returns: * *****/ static CacheObject* newEntry(CacheObject *entry, CacheObject *prev_entry, XtPointer object, String file, String url) { if(entry == NULL) { /* entry does not yet exists, add one */ entry = (CacheObject*)malloc(sizeof(CacheObject)); entry->object = object; entry->file = strdup(file); entry->next = NULL; entry->prev = prev_entry; entry->ref_count = 1; entry->map_count = 0; entry->size = sizeof(CacheObject) + strlen(file); if(sizeProc) entry->size += sizeProc(object, clientData); currentCacheSize += entry->size; /* and add a url mapping for this one as well */ addObjectMapping(entry, url); } else entry->next = newEntry(entry->next, entry, object, file, url); return(entry); } /***** * Name: addObjectMapping * Return Type: void * Description: add a mapping between the given cache item and url * In: * cache_e..: cache entry referenced; * url: url used to reference cache_entry * Returns: * nothing, but updates the overall objectMappings. *****/ static void addObjectMapping(CacheObject *cache_entry, String url) { ObjectMapping *tmp; /* see if this mapping has already been added */ for(tmp = objectMapping; tmp != NULL && strcmp(tmp->url, url); tmp = tmp->next); /* entry already exists, return */ if(tmp) { tmp->ref_count++; cache_entry->map_count++; } else objectMapping = newMap(objectMapping, NULL, cache_entry, url); } /***** * Name: discardCacheEntry * Return Type: void * Description: Remove the given object cache entry from the object cache. * Does not delete the entry but removes it from the linked list. * In: * cache_e..: entry to be removed; * Returns: * nothing. *****/ static void discardCacheEntry(CacheObject *cache_entry) { CacheObject *tmp; /* special case if cache_entry is the first entry in the object cache */ if(objectCache == cache_entry) { objectCache = objectCache->next; /* can happen if this is the last item in the list */ if(objectCache != NULL) objectCache->prev = NULL; /* invalidate previous entry */ /* update cache size */ currentCacheSize -= cache_entry->size; return; } for(tmp = objectCache; tmp != NULL; tmp = tmp->next) { if(tmp == cache_entry) { CacheObject *next, *prev; /* update cache size */ currentCacheSize -= tmp->size; /* unhook this entry */ next = tmp->next; /* ptr to next element */ prev = tmp->prev; /* ptr to previous element */ if(tmp->prev) tmp->prev->next = next; if(tmp->next) tmp->next->prev = prev; return; } } } /***** * Name: discardMapEntry * Return Type: void * Description: same as discardCacheEntry but for the mappings * In: * map_e..: mapping to be removed; * Returns: * nothing. *****/ static void discardMapEntry(ObjectMapping *map_entry) { ObjectMapping *tmp; /* special case if map_entry is the first entry in the object cache */ if(objectMapping == map_entry) { objectMapping = objectMapping->next; /* can happen if this is the last item in the list */ if(objectMapping != NULL) objectMapping->prev = NULL; /* invalidate previous entry */ return; } for(tmp = objectMapping; tmp != NULL; tmp = tmp->next) { if(tmp == map_entry) { ObjectMapping *prev, *next; /* unhook this entry */ next = tmp->next; /* ptr to next element */ prev = tmp->prev; /* ptr to previous element */ if(tmp->prev) tmp->prev->next = next; if(tmp->next) tmp->next->prev = prev; return; } } } /****** *** Public functions ******/ /***** * Name: getURLObjectFromCache * Return Type: XtPointer * Description: get an object from the objectCache, given it's url * In: * url: url for which to retrieve a cached object. * Returns: * the cached object if it exists or NULL of it doesn't. *****/ XtPointer getURLObjectFromCache(String url) { ObjectMapping *tmp; if(url == NULL) return(NULL); for(tmp = objectMapping; tmp != NULL && strcmp(tmp->url, url); tmp = tmp->next); if(tmp) return(tmp->cache_entry->object); return(NULL); } /***** * Name: getObjectFromCache * Return Type: XtPointer * Description: get an object from the objectcache, given it's location * In: * file: file name of a cached object. * Returns: * the cached object if it exists or NULL of it doesn't. *****/ XtPointer getObjectFromCache(String file, String url) { CacheObject *tmp; /* no filename given, try matching with url */ if(file == NULL) return(getURLObjectFromCache(url)); /* filename given, try with filename */ for(tmp = objectCache; tmp != NULL && strcmp(tmp->file, file); tmp = tmp->next); if(tmp) return(tmp->object); return(NULL); } /***** * Name: getFuzzyURLObjectFromCache * Return Type: XtPointer * Description: get an object from the objectCache, given it's url * In: * url: url for which to retrieve a cached object. * Returns: * the cached object if it exists or NULL of it doesn't. *****/ XtPointer getFuzzyURLObjectFromCache(String url) { ObjectMapping *tmp; int len; if(url == NULL) return(NULL); len = strlen(url); /* partial match is enough */ for(tmp = objectMapping; tmp != NULL && strncmp(tmp->url, url, len); tmp = tmp->next); if(tmp) return(tmp->cache_entry->object); return(NULL); } /***** * Name: storeObjectInCache * Return Type: void * Description: insert a new entry in the object cache * In: * object: object to be cached; * file: location on local file system; primary object identifier; * url: url referencing object to be cached; secondary object * indentifier. * Returns: * nothing. *****/ void storeObjectInCache(XtPointer object, String file, String url) { CacheObject *tmp; /* check if this file is already stored */ for(tmp = objectCache; tmp != NULL && strcmp(tmp->file, file); tmp = tmp->next); /* entry already exists, check if we need to update the mapping */ if(tmp != NULL) { /* increment reference counter for this object */ tmp->ref_count++; /* add a new mapping for this object as well */ addObjectMapping(tmp, url); } else /* add a new cache item */ objectCache = newEntry(objectCache, NULL, object, file, url); } /***** * Name: replaceObjectInCache * Return Type: void * Description: replace an entry in the object cache with the newly given data * In: * old_object: object to be replaced; * new_object: new data to be stored at the old object's location. * Returns: * nothing. *****/ void replaceObjectInCache(XtPointer old_object, XtPointer new_object) { CacheObject *tmp; /* locate original object and replace with new object data */ for(tmp = objectCache; tmp != NULL && tmp->object != old_object; tmp = tmp->next); /* found it, replace with new data */ if(tmp) { /* update cache size */ currentCacheSize -= tmp->size; /* store new object */ tmp->object = new_object; /* update object */ if(sizeProc) { tmp->size = sizeProc(new_object, clientData); currentCacheSize += tmp->size; } } else fprintf(stderr, "Warning:\n cache replacement: could not locate " "given object in object cache.\n\n"); } /***** * Name: removeURLObjectFromCache * Return Type: void * Description: removes the mapping for the given url. * In: * url: url to be invalidated. * Returns: * nothing. * Note: * This routine does not actually delete a mapping but decrements the * reference counter for the given url and the cache object it's pointing to. *****/ void removeURLObjectFromCache(String url) { ObjectMapping *tmp; for(tmp = objectMapping; tmp != NULL && strcmp(tmp->url, url); tmp = tmp->next); if(tmp) { tmp->ref_count--; tmp->cache_entry->map_count--; } else fprintf(stderr, "Warning:\n cache URL removal: missing object " "entry in object cache.\n (object: %s)\n\n", url); } /***** * Name: removeObjectFromCache * Return Type: void * Description: decrement reference counter for the given file * In: * file: object to be removed * Returns: * nothing. *****/ void removeObjectFromCache(String file) { CacheObject *tmp; for(tmp = objectCache; tmp != NULL && strcmp(tmp->file, file); tmp = tmp->next); if(tmp) tmp->ref_count--; else fprintf(stderr, "Warning:\n cache removal: missing object entry in " "object cache:\n %s\n\n", file); } /***** * Name: cleanObjectCache * Return Type: void * Description: removes unused objects (zero reference count) from the object * cache * In: * nothing * Returns: * nothing *****/ void cleanObjectCache(void) { CacheObject *tmp; ObjectMapping *tmp_map; if(cleanProc == NULL) { fprintf(stderr, "Warning:\n cache cleaning: no clean_proc " "defined!\n The cache list will be updated but stored objects " "are NOT freed.\n\n"); } /* * Cross check object mapping reference counts against cache reference * counts before really freeing an entry. */ for(tmp_map = objectMapping; tmp_map != NULL; tmp_map = tmp_map->next) { /* object reference count is stronger than object mapping count */ if(tmp_map->cache_entry->ref_count <= 0 && tmp_map->ref_count > 0) { /* objects with 0 reference count are always kicked out */ fprintf(stderr, "Warning:\n cache object mapping\n From: %s" "\n To : %s\n has a positive mapping count (%i) while " "object reference count is zero.\n\n", tmp_map->url, tmp_map->cache_entry->file, tmp_map->ref_count); tmp_map->ref_count = 0; } if(tmp_map->ref_count <= 0) { if(tmp_map->cache_entry->ref_count != 0) { fprintf(stderr, "Error:\n cache cleaning: reference count " "for cached object\n %s is non-zero (%i).\n\n", tmp_map->cache_entry->file, tmp_map->cache_entry->ref_count); tmp_map->ref_count = tmp_map->cache_entry->ref_count; } else { ObjectMapping *save; save = (tmp_map->prev ? tmp_map->prev : tmp_map->next); /* discard this mapping */ discardMapEntry(tmp_map); /* and free it */ free(tmp_map->url); free(tmp_map); tmp_map = save; /* sanity if last item in list is removed */ if(tmp_map == NULL) break; } } } for(tmp = objectCache; tmp != NULL; tmp = tmp->next) { /* zero reference count, remove it */ if(tmp->ref_count <= 0) { CacheObject *save; save = (tmp->prev ? tmp->prev : tmp->next); /* discard this cache entry from the objectCache */ discardCacheEntry(tmp); /* call clean function to release cached data */ if(cleanProc) cleanProc(tmp->object, clientData); tmp->ref_count = 0; tmp->map_count = 0; /* and wipe the entry */ free(tmp->file); free(tmp); tmp = save; /* sanity if last item in list is removed */ if(tmp == NULL) break; } } } /***** * Name: destroyObjectCache * Return Type: void * Description: wipes the object cache completely clean. * cache * In: * nothing * Returns: * nothing *****/ void destroyObjectCache(void) { CacheObject *tmp; ObjectMapping *tmp_map; if(cleanProc == NULL) { fprintf(stderr, "Warning:\n cache destruction: no clean_proc " "defined!\n The cache list will be updated but stored objects " "are NOT freed.\n\n"); } /* * Cross check object mapping reference counts against cache reference * counts before really freeing an entry. */ while(objectMapping != NULL) { tmp_map = objectMapping->next; free(objectMapping->url); free(objectMapping); objectMapping = tmp_map; } while(objectCache != NULL) { tmp = objectCache->next; /* call clean function to release cached data */ if(cleanProc) cleanProc(objectCache->object, clientData); /* and wipe the entry */ free(objectCache->file); free(objectCache); objectCache = tmp; } } /***** * Name: pruneObjectCache * Return Type: void * Description: removes all mappings with a reference count of zero and * all objects which are no longer being referred. * In: * nothing; * Returns: * nothing; *****/ void pruneObjectCache(void) { CacheObject *tmp; ObjectMapping *tmp_map; if(cleanProc == NULL) { fprintf(stderr, "Warning:\n object cache pruning: no clean_proc " "defined!\n The cache list will be updated but stored objects " "are NOT freed.\n\n"); } /* remove all unused mappings */ for(tmp_map = objectMapping; tmp_map != NULL; tmp_map = tmp_map->next) { if(tmp_map->ref_count <= 0) { ObjectMapping *save; save = (tmp_map->prev ? tmp_map->prev : tmp_map->next); /* discard this mapping */ discardMapEntry(tmp_map); /* and free it */ free(tmp_map->url); free(tmp_map); tmp_map = save; /* sanity if last item in list is removed */ if(tmp_map == NULL) break; } } /* remove all unused objects */ for(tmp = objectCache; tmp != NULL; tmp = tmp->next) { /* zero reference count, remove it */ if(tmp->map_count == 0) { CacheObject *save; save = (tmp->prev ? tmp->prev : tmp->next); /* discard this cache entry from the objectCache */ discardCacheEntry(tmp); /* call clean function to release cached data */ if(cleanProc) cleanProc(tmp->object, clientData); tmp->ref_count = 0; tmp->map_count = 0; /* and wipe the entry */ free(tmp->file); free(tmp); tmp = save; /* sanity if last item in list is removed */ if(tmp == NULL) break; } } } /***** * Name: destroyCache * Return Type: void * Description: completely obliterates the cache * In: * nothing * Returns: * nothing *****/ void destroyCache(void) { CacheObject *tmp; ObjectMapping *tmp_map; if(cleanProc == NULL) { fprintf(stderr, "Warning:\n cache destruction: no clean_proc " "defined!\n The cache list will be destroyed but stored " "objects are NOT freed.\n\n"); } /* first clean out the cache mappings */ while(objectMapping != NULL) { tmp_map = objectMapping->next; free(objectMapping->url); free(objectMapping); objectMapping = tmp_map; } /* now clean out the cache itself */ while(objectCache != NULL) { tmp = objectCache->next; /* call clean function to release cached data */ if(cleanProc) cleanProc(tmp->object, clientData); /* and wipe the entry */ free(tmp->file); free(tmp); objectCache = tmp; } /* reset everything to default */ objectMapping = (ObjectMapping*)NULL; objectCache = (CacheObject*)NULL; cleanProc = (cleanObjectProc)NULL; sizeProc = (sizeObjectProc)NULL; clientData = (XtPointer)NULL; cacheSize = DEFAULT_CACHE_SIZE; currentCacheSize = 0; } /***** * Name: getCacheInfo * Return Type: void * Description: returns cache usage info * In: * *size: occupied size of image cache; * *nobjects: number of objects stored in cache. * Returns: * nothing but the arguments are updated. *****/ void getCacheInfo(int *size, int *nobjects) { CacheObject *tmp; int i = 0; for(tmp = objectCache; tmp != NULL; tmp = tmp->next, i++); *nobjects = i; *size = currentCacheSize; } /***** * Name: initCache * Return Type: void * Description: initialize the object caching routines. * In: * size: maximum cache size; * clean_proc: procedure to call for actual object destruction; * size_proc: procedure to call for determining the size of a cached object; * client_d..: data to be used as the second arg. when calling the above to * functions. This arg is unused internally. * Returns: * nothing * Note: * cacheSize is unused for now *****/ void initCache(int size, cleanObjectProc clean_proc, sizeObjectProc size_proc, XtPointer client_data) { /* uses default cache size if size is not set */ if(size) cacheSize = size; currentCacheSize = 0; cleanProc = clean_proc; sizeProc = size_proc; clientData = client_data; } /***** * Special debugging functions: * _listCachedObjects(void) * lists all entries in the object cache * _listObjectMappings(void) * lists all url->file mappings in the objectMapping. *****/ #ifdef DEBUG void _listCachedObjects(void) { CacheObject *tmp; int i = 0; printf("Object id : Reference Count\n"); for(tmp = objectCache; tmp != NULL; tmp = tmp->next, i++) printf("%i: %s, %i\n", i, tmp->file, tmp->ref_count); printf("Total objects cached: %i\n", i); } void _listObjectMappings(void) { ObjectMapping *tmp; int i = 0; printf("Mapping id : : \n"); for(tmp = objectMapping; tmp != NULL; tmp = tmp->next, i++) printf("%i:\n\tFrom : %s (%i)\n\tTo : %s (%i)\n", i, tmp->url, tmp->ref_count, tmp->cache_entry->file, tmp->cache_entry->ref_count); printf("Total mappings: %i\n", i); } #endif /* DEBUG */ XmHTML-1.1.7/examples/cache.h100644 23564 23564 10110 6575521627 14166 0ustar newtnewt/***** * cache.h : HTML document & image caching routines * * This file Version $Revision: 1.2 $ * * Creation date: Fri May 23 14:43:04 GMT+0100 1997 * Last modification: $Date: 1997/08/30 01:47:55 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/cache.h,v $ *****/ /***** * ChangeLog * $Log: cache.h,v $ * Revision 1.2 1997/08/30 01:47:55 newt * getObjectFromCache proto changed. Added pruneObjectCache. * * Revision 1.1 1997/05/28 02:01:31 newt * Initial Revision * *****/ #ifndef _cache_h_ #define _cache_h_ /* get an object from the cache, given it's url */ extern XtPointer getURLObjectFromCache(String url); /* get the first object that (partially) matches the given url */ extern XtPointer getFuzzyURLObjectFromCache(String url); /* get an object from the cache, given it's location or reference */ extern XtPointer getObjectFromCache(String file, String url); /* insert a new entry in the cache */ extern void storeObjectInCache(XtPointer object, String file, String url); /* replace the given object in the cache with the newly given object */ extern void replaceObjectInCache(XtPointer old_object, XtPointer new_object); /* decrement reference counter for the given url */ extern void removeURLObjectFromCache(String url); /* decrement reference counter for the given file */ extern void removeObjectFromCache(String file); /* clean the cache: remove all objects which are no longer used */ extern void cleanObjectCache(void); /* prune ObjectCache: remove all objects for which no mappings are present */ extern void pruneObjectCache(void); /* completely destroy the cache */ extern void destroyObjectCache(void); /* get the current size and number of objects stored in the cache */ extern void getCacheInfo(int *size, int *nobjects); /***** * prune the image cache to the requested size. When small_first is True, * pruning is started with the smallest objects, otherwise it starts with * the largest objects. Cache pruning removes cached objects with low * reference counts. *****/ #if 0 extern void pruneCache(int size, int small_first); #endif /***** * Proto for the clean_proc in the initCache proto below. This function * is called when cleanObjectCache want's to destroy a stored object. This * function is called with the following arguments: * * clean_proc(object, client_data) * XtPointer object: object to be destroyed; * client_data: additional data provided by the argument with the same * name in initCache. This object is unused internally. *****/ typedef void (*cleanObjectProc)(XtPointer, XtPointer); /***** * Proto for the size_proc in the initCache proto below. This function is * called whenever a new object is stored in the cache and should return the * size of the given object. The arguments are the same as above. *****/ typedef int (*sizeObjectProc)(XtPointer, XtPointer); /***** * function to initialize object cache. Arguments: * size: maximum cache size (UNUSED) * clean_proc: function to call when a stored object is to be destroyed * clean_data: client_data for the clean_proc. *****/ extern void initCache(int size, cleanObjectProc clean_proc, sizeObjectProc size_proc, XtPointer client_data); /* Don't add anything after this endif! */ #endif /* _cache_h_ */ XmHTML-1.1.7/examples/HTMLDemos.ad100644 23564 23564 41721 6651226515 15021 0ustar newtnewt! ! XmHTML Examples resource file. ! See the XmHTML Reference guide for a full list and description of all ! available resources. ! ! To use this file, copy it to your home directory and rename it to HTMLDemos ! The direction in which text should be rendered. R_TO_L renders text from ! right to left (inverting the contents), while L_TO_R renders from left to ! right. ! ! *stringDirection: XmSTRING_DIRECTION_R_TO_L *xResolution: 100 *yResolution: 100 ! The default alignment to be used for rendering. Possible values: ! XmALIGNMENT_BEGINNING ! align against left window border (default) ! XmALIGNMENT_CENTER ! center everyting; ! XmALIGNMENT_END ! align against right window border. ! !*alignment: XmALIGNMENT_END ! This resource informs XmHTML if it should do anchor highlighting or not. ! When true, an anchor will be highlighted when the pointer is moved over it. ! *highlightOnEnter: True ! This resource determines how many colors each image may take. With the ! default value of 0, XmHTML will try to allocate as many colors as it can ! (with a maximum of 256 colors). Setting this resource to a small value ! without selecting dithering will cause a considerable delay on image-heavy ! pages. ! ! If you have set the imageMapToPalette (see below) resource without providing ! a palette yourself, XmHTML will attempt to allocate a palette with at most ! this many colors (the algorithm used depends on how XmHTML was compiled). ! *maxImageColors: 0 ! This resource allows you to enable/disable animations. ! !*freezeAnimations: False ! This resource determines the conversion XmHTML should use when it's ! converting 24bit PNG images to 8bit ones. ! ! Possible values are: ! quick: first a very quick check is made to see if an image contains ! less than maxImageColors colors. If not, 24->8 bit conversion ! is done using a fixed palette. ! best: first a very quick check is made to see if an image contains ! less than maxImageColors colors. If not, 24->8 bit conversion ! is done using a histogram of the 24bit image. This offers ! the best 24 to 8 bit conversion as 24bit RGB images on web ! pages often have less than 256 colors in them (keeps the size ! small). This is the default. ! fast: dithers to a fixed palette right away. This is the fastest way ! to do 24->8 bit conversion; ! slow: skips the check and does 24->8 bit conversion using a histogram ! right away. ! *imageRGBConversion: best ! perfectColors: controls the final dithering pass on progressively loaded ! image. This is a significantly time-consuming operation and does not always ! produce a visible quality increase of the image. Initial color selection ! of progressively loaded images is done using a simple ordered dithering on ! the colormap of the image in question. This resource affects all images ! containing more than maxImageColors (always True for JPEG and RGB PNG ! images, even with maxImageColors set to 0). Possible values for this ! resource are: ! ! never ! No final dithering pass is performed; ! always ! A final dithering pass is always performed; ! automatic ! XmHTML decides whether or not a final pass will significantly increase ! the quality of the image (its decision is based on the number of colors ! matched in a fixed colormap: when about a third is matched, no dithering ! is done). This is the default behaviour ! *perfectColors: automatic ! imageMapToPalette: determines if XmHTML should perform dithering and if so, ! which type it should use. ! ! Possible Values: ! quick ! Use closest distance algorithm to map colors to the palette. No ! error correction is performed. Fast, but quality heavily depends on the ! distribution of the colors in the image. ! best ! Ordered dither using predefined error matrices. Reasonably fast and ! quite good results; ! fast ! Simple ordered dithering without error correction. Fastest but poorest ! results (relatively spoken, that is :-). ! slow ! closest distance algorithm to map image colors to the palette and ! dynamic error correction. Slowest but best results; ! disabled (default) ! Disable palette mapping; ! ! See also the imagePalette resource below. ! *imageMapToPalette: disabled ! imagePalette: fixed palette against which the images should be dithered. ! ! This is a string consisting of (hexadecimal) RGB triplets. The values of ! each color component in a triplet must be in the range 0-255 (inclusive). ! Each triplet is separated from the next by (an amount of) whitespace. If ! the XmNmaxColors resource isn't set or differs from the number of colors ! in the specified palette, it will be set to the size of this palette (with ! a maximum of 256 colors). ! ! Note: If the imageMapToPalette resource has been set but no palette has been ! specified, XmHTML will allocate one for you. The size of this palette is ! given by the value of the maxImageColors resource. ! ! WARNING: the value of this resource can only be set on CREATION time. ! ! Example specification of a (rather good) palette with 48 colors (note the ! newlines & continuation chars): ! !*imagePalette: 0x00 0x00 0x00 0xff 0xff 0xff 0xdd 0xdd 0xdd \n\ ! 0xbb 0xbb 0xbb 0x99 0x99 0x99 0x77 0x77 0x77 0x55 0x55 0x55 \n\ ! 0x33 0x33 0x33 0x88 0x00 0x00 0xcc 0x00 0x00 0xff 0x00 0x00 \n\ ! 0xff 0x44 0x00 0xff 0x88 0x00 0xff 0xcc 0x00 0xff 0xff 0x00 \n\ ! 0xcc 0xcc 0x00 0x88 0x88 0x00 0x44 0x44 0x00 0x00 0x44 0x00 \n\ ! 0x00 0x88 0x00 0x00 0xcc 0x00 0x00 0xff 0x00 0x00 0x44 0x44 \n\ ! 0x00 0x88 0x88 0x00 0xff 0xff 0x00 0x00 0x44 0x00 0x00 0x88 \n\ ! 0x00 0x00 0xff 0x88 0x00 0x88 0xff 0xcc 0x99 0xcc 0xaa 0x77 \n\ ! 0xaa 0x88 0x55 0x88 0x66 0x33 0x66 0x44 0x11 0x44 0x22 0x00 \n\ ! 0x22 0x00 0x00 0x00 0x44 0x88 0x44 0x88 0xcc 0x88 0xcc 0xff \n\ ! 0x00 0xcc 0x44 0x44 0x88 0x44 0x88 0xcc 0x00 0x22 0x44 0x11 \n\ ! 0x33 0x66 0x22 0x44 0x55 0x33 0x66 0x88 0x44 0x33 0x66 0x22 \n\ ! 0x22 0x44 0x11 ! Progressive Loading resources ! ! The three resources below define the boundaries of the polling interval ! XmHTML should use when walking the list of images that are to be loaded ! progressively. ! ! *progressiveInitialDelay: specifies the initial delay XmHTML should use ! before starting to walk all PLC's, default is 250ms. ! *progressiveMinimumDelay: the minimum delay that can be used. Default is 5ms; ! *progressiveMaximumDelay: the maximum delay that can be used. Default is ! 1000ms (e.i. 1 second). ! ! The latter two resources define the boundaries of the interval XmHTML can ! use when calculating the time to expire before the next PLC is activated. ! ! The internal algorithm dynamically adjusts the polling interval depending on ! the state of each PLC: when the number of suspended PLC's is increasing, the ! polling interval is increased (up to progressiveMaximumDelay), and when it is ! decreasing, the polling interval is decreased (down to ! progressiveMinimumDelay). ! ! The reason behind this dynamic adjustment of the polling interval is that ! it's useless quering your application every 5ms when XmHTML can see that this ! application has a slow connection, and, the other way round, that it's ! annoying to have XmHTML ignore the fact that this application has a fast ! connection by polling the application every second or so. *progressiveInitialDelay: 250 *progressiveMinimumDelay: 100 *progressiveMaximumDelay: 1000 ! Uncompress command to use when using the built-in GIF decoder. ! The uncompresser you tell XmHTML to use must be *fully* compatible with ! standard Unix compress, *and* this compress must be capable of handling ! at least 13 bit codes (-b compress command line option). ! ! *uncompressCommand: gzip -d ! Your screen's gamma value. This value is used to do gamma correction on ! JPEG and PNG images. Note that this is a floating point value. ! For most displays, the default value of 2.2 will be pretty OK. ! For Silicon Graphics display, a gamma value of 1.8 is suggested. ! For the brave souls running MkLinux, a gamma value of 1.4 is suggested. ! Just experiment with different values and see what it does. ! *screenGamma: 2.2 ! Enable text outlining. ! *enableOutlining: True ! Placement of the scrollbars. Possible values are: ! top_left: horizontal (hsb) on top, vertical scrollbar (vsb) on left; ! top_right: hsb on top, vsb on right; ! bottom_left: hsb on bottom, vsb on left; ! bottom_right: hsb on bottom, vsb on left (default). ! !*XmHTML*scrollBarPlacement: bottom_right ! Default background image. Only used when no text/background colors have ! been set in the loaded document. ! !*bodyImage: /home/newt/public-html/RSD/textures/wheat.gif ! ! The other alternative is to set the default background color. This will ! always be used, even if text colors have been specified in the ! element. ! ! *XmHTML.background: white ! ! Use the dot (``.'') to set the default background on the area in which the ! text is displayed. ! Using a wildcard (``*'') will also set the default background color of the ! scrollbars. You could fine-tune it in the following way (for example, see ! the XmScrollBar manual page for other resources): ! ! *XmHTML.background: white ! *XmHTML.horizontalScrollBar.background: gray66 ! *XmHTML.verticalScrollBar.background: gray66 ! *XmHTML.workWindow.background: white ! ! (the workWindow component is the render area. Setting the background color ! for this widget will assure that it uses the correct background when the ! widget is empty.) ! ! If you are setting the above resources, you should also balance the default ! foreground color against the default background setting: ! ! *XmHTML.foreground: black ! *XmHTML.marginHeight: 1 ! *XmHTML.marginWidth: 1 ! Set to False to make the HTML parser a bit more forgiving. Can lead to ! wierd results as this *can* interfere with the document verification and ! repair routines. ! *strictHTMLChecking: False ! Specify what types of warnings you want to get when the parser detects ! bad HTML constructs in the input document. ! ! Possible values (the html_ prefix is optional while you can also use the ! full resource names: XmHTML_NONE, ...): ! ! html_none: no warnings at all, exclusive value; ! html_all : all warnings, exclusive value; ! html_unknown_element: unknown HTML element; ! html_bad: very badly placed element; ! html_open_block: block still open while new block started; ! html_close_block: block closed but was never opened; ! html_open_element: unbalanced terminator; ! html_nested: improperly nested element; ! html_violation: bad content for current block/element; ! ! You can specify multiple warning types for this resource as follows: ! *enableBadHTMLWarnings: unknown_element, bad, open_block ! ! (the value of the separator character doesn't matter) ! *enableBadHTMLWarnings: all ! Set to False if you don't want the anchors to appear as buttons. ! *anchorButtons: True ! Various Anchor underline styles ! *anchorUnderlineType: single_line ! *anchorVisitedUnderlineType: double_line ! *anchorTargetUnderlineType: single_dashed_line ! Various Anchor colors ! *anchorActivatedBackground: white ! *anchorForeground: red ! *anchorVisitedForeground: blue1 ! *anchorTargetForeground: green ! This is how you specify a different anchor cursor: ! *anchorCursor: hand2 ! Set to False if you don't want to honor the color attribute of the ! , , , , , , , , , , | ,
    ,

    thru

    ,
    ,
    , 

    ,

    , !
    and
    HTML tags. ! *enableDocumentColors: True ! Set to False if you want to ignore the size and face attributes of the ! tag. Note that setting both this resource and the previous one ! to False effectively disables support for the tag. ! *enableDocumentFonts: True ! This resource determines whether or not a XmHTML widget should use the ! current document background & foreground colors for any widgets in a ! HTML Form. If False, the default colors are used (whatever that may ! be). Please note that in the latter case, the natural look of the document ! is broken. *enableFormColors: True ! Support for W3C icon entities. Default is False *enableIconEntities: True ! Vertical alignment for the W3C icon entities. ! Resource class is XmCVerticalAlignment. ! Possible values are alignment_baseline_top, alignment_center (default) and ! alignment_baseline_bottom ! *iconAlignment: alignment_baseline_top ! When set to True, XmHTML will draw a bounding box around all areas in images ! serving as an imagemap. ! ! *imagemapDrawBoundingBoxes: True ! color to use when drawing a bounding box. ! ! *imagemapBoundingBoxForeground: red ! The number of milliseconds a key must be pressed before scrolling continues. ! This is a value which requires some experimenting. Setting it to a value ! smaller than 10ms will probably cause improper screen updating while ! scrolling. Setting it to a value higher than, say 100ms, will *definitly* ! cause annoyance since scrolling will appear to be very slow. The default ! value of 25 should give you good performance in both screen update and ! scrolling speed. ! *repeatDelay: 15 ! The default scrolling behavior of XmHTML is to respond immediatly to ! scrolling events and paint the region that has been scrolled into view. ! On fast X servers, this always yields a very smooth scrolling. However, ! fast scrolling on slow servers (or on heavily loaded systems), causes XmHTML ! to miss some events, leading to portions of the document not being rendered ! correctly or not at all. Setting smoothScrolling to False will cause XmHTML ! to wait until all scrolling events have arrived and then render the ! resulting region. This will cause XmHTML to always render the document ! but has the downside that scrolling may seem a *little* jumpy. ! The default for this resource is True. *smoothScrolling: False ! Size of a horizontal tab. ! This resource is used when rendering preformatted text (anything inside !
    ). This must be a positive, non-zero value. The default is 8
    *tabWidth: 4
    
    ! Size of the default font for normal, sup and subscript, H1 thru H6 headers.
    !
    ! *charset: iso8859-1
    *fontSizeList: 12,8,24,18,14,12,10,8
    
    !*charset: jisx0208.1983-0
    !*fontFamily: jis-fixed-normal-c
    
    ! Font selection resources. The set below instructs XmHTML to use the koi8
    ! cyrillic font (if it is installed on your system).
    !
    ! Multiple fontfamilies can be specified by separating them with a ,
    ! The same goes for the charset resource.
    !
    ! *charset: koi8-*
    ! *fontFamily: cronyx-times-*-*
    ! *fontFamilyFixed: cronyx-fixed-*-*
    
    ! Widget size. Note that this resource is explicitly set on the widget directly
    ! and not using a wildcard. This is *very* important as a XmHTML widget creates
    ! three childs: a work area and two scrollbars. Upon creation time, a XmHTML
    ! widget sets the size of the workArea explicitly and uses default values when
    ! creating the scrollbars. The latter is the reason why a . should be used
    ! instead of a *. Not doing this would lead to scrollbars with the same
    ! dimension as the widget itself, which can lead to strange results whenever
    ! the scrollBars are managed. XmHTML will reset the dimensions of the
    ! scrollbars to 15 for the width of the vertical scrollbar and 15 for the
    ! height of the horizontal scrollbar.
    ! The same problem arises with any widgets created when XmHTML needs to create
    ! a HTML form.
    !
    *frame.width: 575
    *frame.height: 600
    
    ! *XmHTML.width: 575
    ! *XmHTML.height: 600
    
    ! If you want to specify the dimensions of the ScrollBar children of a XmHTML
    ! widget you need to do this as follows:
    !
    ! *XmHTML*verticalScrollBar.width: 25
    ! *XmHTML*horizontalScrollBar.height: 25
    
    
    ! non-XmHTML resources.
    !
    ! default font list
    *fontList:               *-adobe-helvetica-bold-r-*-*-*-120-*-*-p-*-*-*
    
    ! The following resources only apply to example_2.c
    !
    ! Set to True if you want to use a private colormap.
    !
    !*usePrivateColormap: True
    !
    ! These resources are for selection of a visual if your display supports
    ! multiple visuals on the same screen. 
    ! For visualClass, the following mapping applies:
    !
    !	StaticGray  -> 0
    !	GrayScale   -> 1
    !	StaticColor -> 2
    !	PseudoColor -> 3
    !	TrueColor   -> 4
    !	DirectColor -> 5
    !
    !*visualID:
    !*applicationDepth: 16
    !*visualClass: 5
    
    
    ! XmHTML Debug resources. Always present but only active when XmHTML has been
    ! compiled with DEBUG defined.
    !
    ! When set, no warnings will be generated
    !
    *debugDisableWarnings: False
    
    ! When set, output from event handlers and thelike will be enabled if the
    ! corresponding source files have been marked for debug output.
    ! Warning: this will generate a *huge* amount of output.
    !
    *debugEnableFullOutput: True
    
    ! When set, parser output is sent to a file with this prefix. The suffix
    ! is a number starting from zero for the first document loaded, and increasing
    ! by one for every new document that is loaded.
    !
    !*debugFilePrefix: parsed_output
    
    ! When set, the clipmasks for every image will be saved as an X11 bitmap in the
    ! current directory.
    !
    *debugSaveClipmasks: False
    
    ! When set, all animations will loop forever; any loopcount specification in
    ! the NETSCAPE2.0 extension is ignored then.
    !
    *debugNoAnimationLoopCount: False
    
    !*debugLevels: 1
    
    !
    ! XmBalloon
    !*XmBalloon*background:  LemonChiffon
    XmHTML-1.1.7/examples/example_4.c100644  23564  23564       32750  6624051626  15002 0ustar  newtnewt#ifndef lint
    static char rcsId[]="$Header: /usr/local/rcs/Newt/XmHTML/RCS/example_4.c,v 1.1 1997/10/23 00:28:33 newt Exp newt $";
    #endif
    /*****
    * example_4.c : XmHTML XmNformCallback & HTTP.c demonstration
    *
    * This file Version	$Revision: 1.1 $
    *
    * Creation date:		Tue Oct 21 01:33:18 GMT+0100 1997
    * Last modification: 	$Date: 1997/10/23 00:28:33 $
    * By:					$Author: newt $
    * Current State:		$State: Exp $
    *
    * Author:				newt
    *
    * Copyright (C) 1994-1997 By Richard Offer (offer@sgi.com)
    *
    * 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.
    *
    * Note from the author:
    *
    *	Most of the code is straight-forward, however since the only real way to 
    *	test the forms support is from a live web server you need some HTTP support.
    *	I've written some code (you'll find it in HTTP.c) that is fairly flakey, 
    *	but at least it should be easy to rip it out and add something better 
    *	(there's only a single API call loadHTTPUrl() and a couple of 
    *	allocation/cleaning up routines. At the least you can use the HTTP code 
    *	as the basis for your own...
    * 
    *	I'm not pretending that this code is anywhere near production quality, and 
    *	I don't intend to use it for my broswer app, so giving anyone else anytype 
    *	of warrenty would be pretty stupid of me.
    * 
    *	I will be tidying this up as I continue to develop my broswer...
    * 
    *	Its also only been tested on Irix 6.{4,5}.
    * 
    *	Before you try and use this with the accompanying html file 
    *	(test-pages/form-test.html) you need to install the file form-test.pl in 
    *	the cgi-bin directory of your web server web server---you may need to be 
    *	root to do this.
    * 
    *	Don't forget to change the first line in the form-test.pl script to point 
    *	to the location of your perl binary
    *
    *****/
    /*****
    * ChangeLog 
    * $Log: example_4.c,v $
    * Revision 1.1  1997/10/23 00:28:33  newt
    * Initial Revision
    *
    *****/ 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    #include 
    
    /* The Header file for my HTTP implementation */
    #include 
    
    /*** External Function Prototype Declarations ***/
    
    /*** Public Variable Declarations ***/
    
    /*** Private Datatype Declarations ****/
    
    /*** Private Function Prototype Declarations ****/
    static XmImageInfo *loadImage(Widget w, String url);
    static void loadFile(Widget w, XtPointer client_data, XtPointer call_data);
    static void loadURLToWidget(Widget html, String url, HTTPNamedValues * formdata,
    	HTTPLoadMethod method);
    static void cleanCache(void);
    
    /** various callbacks **/
    static void formCB(Widget w, XtPointer loadWidget,
    	XmHTMLFormCallbackStruct * form_data);
    static void anchorCB(Widget w, XtPointer loadWidget,
    	XmHTMLAnchorPtr href_data);
    static void destroyCB(Widget w, XtPointer client, XtPointer call);
    
    static void quitCB(Widget w, XtPointer client, XtPointer call);
    static void loadCB(Widget w, XtPointer client, XtPointer call);
    
    /*** Private Variable Declarations ***/
    static String appFallbackResources[] =
    {
    "*fontList:               *-adobe-helvetica-bold-r-*-*-*-120-*-*-p-*-*-*",
    	"*sourceView.width:       550",
    	"*sourceView.height:      500",
    	"*XmHTML.width:           575",
    	"*XmHTML.height:          600",
    	NULL};
    
    Widget TopLevel;
    Widget xmHTML;
    XtAppContext AppContext;
    
    /*****
    * Change this to change the application class of the examples
    *****/
    #define APP_CLASS               "HTMLDemos"
    
    /*****
    * Name:
    * Return Type:
    * Description:
    * In:
    *
    * Returns:
    *
    *****/
    static void 
    loadFile(Widget w, XtPointer client_data, XtPointer call_data)
    {
    	FILE *file;
    	char *filename;
    	int size;
    	static String content;
    	XmFileSelectionBoxCallbackStruct *cbs;
    
    	XtUnmanageChild((Widget)client_data);
    
    	cbs = (XmFileSelectionBoxCallbackStruct*)call_data;
    
    	XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &filename);
    
    	if (filename == NULL)
    		return;
    
    	/* open the given file */
    	if ((file = fopen(filename, "r")) == NULL) {
    		perror(filename);
    		return;
    	}
    	/* see how large this file is */
    	fseek(file, 0, SEEK_END);
    	size = ftell(file);
    	rewind(file);
    
    	/* allocate a buffer large enough to contain the entire file */
    	if ((content = malloc(size + 1)) == NULL) {
    		fprintf(stderr, "malloc failed for %i bytes\n", size);
    		exit(1);
    	}
    	/* now read the contents of this file */
    	if ((fread(content, 1, size, file)) != size)
    		printf("Warning: did not read entire file!\n");
    
    	content[size] = '\0';
    	fclose(file);
    
    	XmHTMLTextSetString(xmHTML, content);
    }
    
    static void
    loadURLToWidget(Widget html, String url, HTTPNamedValues * formdata,
    	HTTPLoadMethod method)
    {
    	HTTPRequest *req = newHTTPRequest();
    	char *userData = NULL;
    
    	XtVaGetValues(html, XmNuserData, &userData, NULL);
    
    	if(!HTTPAbsoluteURL(url))
    		req->url = HTTPFindAbsoluteURL(url, userData);
    	else
    		req->url = NewString(url);
    
    	req->type = HTTPLoadToString;
    	req->method = method;
    
    	if(url)
    	{
    		req->form_data = formdata;
    
    		loadHTTPURL(NULL, req, NULL);
    		if(req->ret == HTTPSuccess)
    		{
    			if(req->url)
    			{
    				char *new_url = NewString(req->url);
    
    				XtVaSetValues(html, XmNuserData, new_url, NULL);
    				if(userData)	/* can be NULL! */
    					free(userData);
    
    				/*
    				* Since this is form data, we want to unescape any
    				* escapes contained in the response string.
    				*/
    				HTTPUnescapeResponse(req->out_data);
    
    				/* set it */
    				XmHTMLTextSetString(html, (String) req->out_data);
    			}
    		}
    		else
    			HTTPError("Request failed", req->ret);
    	}
    	/* Clean up the request */
    	deleteHTTPRequest(req);
    }
    
    static void
    formCB(Widget w, XtPointer loadWidget, XmHTMLFormCallbackStruct * form_data)
    {
    
    	int i;
    	HTTPLoadMethod method = form_data->method == 0 ? HTTPGET : HTTPPOST;
    	HTTPNamedValues *form = NULL;
    
    	/* we don't support the pipe method */
    	if(form_data->method == XmHTML_FORM_PIPE)
    		return;
    
    	/*
    	 * the form data is freed inside the deleteHTTPRequest() function 
    	 * (called from loadURLToWidget())
    	 */
    	form = (HTTPNamedValues *) calloc(form_data->ncomponents + 1,
    									  sizeof(HTTPNamedValues));
    
    	/* we don't pass a length so loop until we see a NULL name */
    	for(i = 0; i < form_data->ncomponents; i++)
    	{
    		form[i].name = NewString(form_data->components[i].name);
    		form[i].value = NewString(form_data->components[i].value);
    	}
    	form[i].name = NULL;
    	form[i].value = NULL;
    
    	loadURLToWidget(loadWidget, form_data->action, form, method);
    }
    
    static void
    anchorCB(Widget w, XtPointer loadWidget, XmHTMLAnchorPtr href_data)
    {
    	/* see if we have been called with a valid reason */
    	if (href_data->reason != XmCR_ACTIVATE)
    		return;
    
    	switch (href_data->url_type)
    	{
    		case ANCHOR_FILE_LOCAL:
    		case ANCHOR_HTTP:
    			loadURLToWidget(loadWidget, href_data->href, NULL, HTTPGET);
    			break;
    		case ANCHOR_JUMP:
    			{
    				int id;
    				if((id = XmHTMLAnchorGetId(loadWidget, href_data->href)) != -1)
    				{
    					/* let XmHTML jump and mark as visited */
    					href_data->doit = True;
    					href_data->visited = True;
    					return;
    				};
    			}
    			break;
    		case ANCHOR_UNKNOWN:
    		default:
    			fprintf(stderr, "don't handle this type of url: %d %s\n",
    				href_data->url_type, href_data->href);
    			break;
    	}
    }
    
    static void
    destroyCB(Widget w, XtPointer client, XtPointer call)
    {
    	void *userData = NULL;
    
    	XtVaGetValues(w, XmNuserData, &userData, NULL);
    
    	if(userData)
    		free((char *)userData);
    }
    
    void 
    cleanCache(void)
    {
    	DIR *dir;
    	struct dirent *fileent;
    
    	/*****
    	* Clean out the image cache dir, mainly I do this to force a re-load of the 
    	* images when I next start the app 
    	*****/
    	dir = opendir(".cache");
    
    	if (dir == NULL)
    	{
    		if(mkdir(".cache", S_IRWXU) != 0)
    		{
    			printf("cannot create image cache dir\n");
    			exit(1);
    		} else
    			dir = opendir(".cache");
    	}
    	while((fileent = readdir(dir)) != NULL)
    	{
    		/* ignore dot files (there shouldn't be any) */
    		if (strncmp(fileent->d_name, ".", 1))
    		{
    			char filename[256];
    			sprintf(filename, "%s/%s", ".cache", fileent->d_name);
    			printf("removing %s\n", filename);
    			unlink(filename);
    		}
    	}
    	if(dir)
    		closedir(dir);
    }
    
    static void
    destroyXmHTMLCB(Widget w, XtPointer client, XtPointer call)
    {
    	XtDestroyWidget(xmHTML);
    }
    
    static void
    quitCB(Widget w, XtPointer client, XtPointer call)
    {
    	cleanCache();
    
    #if (XtSpecificationRelease <= 5)
    	XtDestroyApplicationContext(AppContext);
    	exit(EXIT_SUCCESS);
    #else
    	/***** 
    	* The 'approved' method for killing X11R6 apps, previous versions just use 
    	* exit(0). 
    	*****/
    	XtAppSetExitFlag(AppContext);
    #endif
    
    }
    
    static void
    loadCB(Widget w, XtPointer client, XtPointer call)
    {
    
    	static Widget fsb = NULL;
    	Arg args[2];
    	XmString xmstr;
    
    	if(fsb == NULL)
    	{
    		xmstr = XmStringCreateLocalized("*.html");
    		XtSetArg(args[0], XmNpattern, xmstr);
    
    		fsb = XmCreateFileSelectionDialog(TopLevel, "fileOpen", args, 1);
    
    		XmStringFree(xmstr);
    
    		XtAddCallback(fsb, XmNokCallback,
    					  (XtCallbackProc) loadFile, fsb);
    		XtAddCallback(fsb, XmNcancelCallback,
    					  (XtCallbackProc) XtUnmanageChild, NULL);
    	}
    	XtManageChild(fsb);
    }
    
    int
    main(int argc, char **argv)
    {
    
    	Widget form, menubar, pane, quit, home, dest;
    
    	XtSetLanguageProc(NULL, NULL, NULL);
    
    	/* clean the cache to force all images to be re-loaded */
    	cleanCache();
    
    	/* sessionShellWidgetClass only from R6 on */
    #if (XtSpecificationRelease <= 5)
    	TopLevel = XtVaAppInitialize(&AppContext, APP_CLASS, NULL, 0,
    				&argc, argv, appFallbackResources, NULL, NULL);
    #else
    	TopLevel = XtVaOpenApplication(&AppContext, APP_CLASS, NULL, 0,
    				&argc, argv, appFallbackResources, sessionShellWidgetClass,
    				NULL);
    #endif
    
    	form = XtVaCreateWidget("topForm", xmFormWidgetClass, TopLevel,
    				NULL);
    
    	menubar = XmCreateMenuBar(form, "menuBar", NULL, 0);
    	pane = XmCreatePulldownMenu(menubar, "FilePane", NULL, 0);
    
    	XtVaCreateManagedWidget("File", xmCascadeButtonGadgetClass, menubar,
    			XmNsubMenuId, pane,
    			NULL);
    
    	home = XtVaCreateManagedWidget("load", xmPushButtonGadgetClass, pane, NULL);
    	dest = XtVaCreateManagedWidget("destroy", xmPushButtonGadgetClass, pane,
    			NULL);
    	quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, pane, NULL);
    
    	XtAddCallback(quit, XmNactivateCallback, (XtCallbackProc)quitCB,
    		(XtPointer)NULL);
    	XtAddCallback(dest, XmNactivateCallback, (XtCallbackProc)destroyXmHTMLCB,
    		(XtPointer)NULL);
    
    
    	XtVaSetValues(menubar,
    		XmNtopAttachment, XmATTACH_FORM,
    		XmNleftAttachment, XmATTACH_FORM,
    		XmNrightAttachment, XmATTACH_FORM,
    		NULL);
    
    
    	xmHTML = XtVaCreateManagedWidget("HTML", xmHTMLWidgetClass, form,
    				XmNtopAttachment, XmATTACH_WIDGET,
    				XmNtopWidget, menubar,
    				XmNleftAttachment, XmATTACH_FORM,
    				XmNrightAttachment, XmATTACH_FORM,
    				XmNbottomAttachment, XmATTACH_FORM,
    #ifdef HAVE_GIF_CODEC
    				XmNdecodeGIFProc, decodeGIFImage,
    #endif
    				XmNimageProc, loadImage,
    				XmNenableBadHTMLWarnings, False,
    				XmNuserData, NULL,
    				NULL);
    
    
    	XtAddCallback(home, XmNactivateCallback, (XtCallbackProc)loadCB,
    		(XtPointer)NULL);
    	XtAddCallback(xmHTML, XmNdestroyCallback, (XtCallbackProc)destroyCB,
    		(XtPointer)xmHTML);
    	XtAddCallback(xmHTML, XmNactivateCallback, (XtCallbackProc)anchorCB,
    		(XtPointer)xmHTML);
    	XtAddCallback(xmHTML, XmNformCallback, (XtCallbackProc)formCB,
    		(XtPointer)xmHTML);
    
    	XtManageChild(menubar);
    	XtManageChild(form);
    
    	/* as I check (ha) all read and write return values, ignore SIGPIPE */
    	signal(SIGPIPE, SIG_IGN);
    
    	XtRealizeWidget(TopLevel);
    	XtAppMainLoop(AppContext);
    
    	/*****
    	* if we are using X11R6 then the mainloop is exited without calling exit(), 
    	* so we have time for a proper clean up 
    	*****/
    #if (XtSpecificationRelease == 6)
    	XtDestroyApplicationContext(AppContext);
    #endif
    
    	return(0);
    }
    
    /*****
    * While based on the loadImage routines in the other example, this one gets 
    * the image from a web server and stores in a disk cache
    *****/
    static XmImageInfo*
    loadImage(Widget w, String url)
    {
    	XmImageInfo *image = NULL;
    	int i;
    	char filename[1024];
    	char *userData;
    	HTTPRequest *req = newHTTPRequest();
    
    	if (url != NULL)
    	{
    		char *hostname, *file;
    		struct stat buf;
    
    		XtVaGetValues(w, XmNuserData, &userData, NULL);
    
    		if(!HTTPAbsoluteURL(url))
    			req->url = HTTPFindAbsoluteURL(url, userData);
    		else
    			req->url = NewString(url);
    
    		parseURL(req->url, PARSE_HOSTNAME | PARSE_FILENAME,
    				 NULL, NULL, NULL, &hostname, NULL, &file);
    		sprintf(filename, ".cache/%s%s", hostname, file);
    		freeURL(PARSE_HOSTNAME | PARSE_FILENAME,
    				NULL, NULL, NULL, hostname, 0, file);
    
    		/* when stored in the cache, convert path names to a valid filename */
    		for (i = 7; i < strlen(filename); i++)
    		{
    			if (filename[i] == '/')
    				filename[i] = '@';
    		}
    
    		if(stat(filename, &buf) != 0 && errno == ENOENT)
    		{
    			req->type = HTTPLoadToFile;
    			req->in_data = NewString(filename);
    			loadHTTPURL(NULL, req, NULL);
    			if(req->ret != HTTPSuccess)
    			{
    				/* last ditch attempt to try and load it locally */
    				image = XmHTMLImageDefaultProc(w, req->url, NULL, 0);
    			}else
    				image = XmHTMLImageDefaultProc(w, filename, NULL, 0);
    
    		}else
    			image = XmHTMLImageDefaultProc(w, filename, NULL, 0);
    
    	}
    	deleteHTTPRequest(req);
    	return(image);
    }
    XmHTML-1.1.7/examples/form-test.pl100644  23564  23564        3175  6431721247  15213 0ustar  newtnewt#! /usr/bin/perl
    
    # Test any form with this CGI script.
    # formtest.cgi by David Efflandt (efflandt@xnet.com)
    
    # For UNIX systems:
    # Point the first line of script to your perl.
    # Upload from DOS|Win as ASCII (not binary or zmodem).
    # 'chmod 755 filename' from shell (see 'man chmod').
    
    # HTML header
    print "Content-type: text/html\n\n";
    print "Form Test\n\n";
    print "

    Form Test Results

    \n"; # Print POST data if any if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); print "


    \n

    POST Data

    \n"; print "

    Raw STDIN:

    \n"; print "
    \n$buffer\n
    \n"; &listdata; } # Print GET data (QUERY_STRING) if any if ($ENV{'QUERY_STRING'}) { $buffer = $ENV{'QUERY_STRING'}; print "


    \n

    GET data

    \n"; print "

    Raw QUERY_STRING:

    \n"; print "
    \n$buffer\n
    \n"; &listdata; } # No Data response unless ($buffer) { print "


    \n

    No Form Data Submitted

    \n"; print "This script will display any form data submitted "; print "to it using the GET or POST method.\n"; exit; } print "

    \n"; # List the variables sub listdata { print "

    Variables:

    \n"; # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Plain text values # print "

    $name:

    $value
    \n"; # HTML values print "

    $name = $value\n"; } } XmHTML-1.1.7/examples/misc.h100644 23564 23564 4607 6431721247 14043 0ustar newtnewt/***** * misc.h : routines shared by a number of the example programs * * This file Version $Revision$ * * Creation date: Sun Nov 2 22:17:14 GMT+0100 1997 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: newt * * Copyright (C) 1994-1997 by 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$ *****/ /***** * ChangeLog * $Log$ *****/ #ifndef _misc_h_ #define _misc_h_ /* mime types getMimeType knows about */ typedef enum{ MIME_HTML = 0, /* text/html */ MIME_HTML_PERFECT, /* text/html-perfect */ MIME_IMAGE, /* image/whatever */ MIME_PLAIN, /* text/plain/unknown */ MIME_IMG_UNSUP, /* unsupported image type */ MIME_ERR /* some error occured */ }mimeType; /* determine the mime type of the given file */ extern mimeType getMimeType(String file); /***** * Load a file and return it's contents. Return value must be freed by the * caller. Returns a mime-description string in mime_type *****/ extern String loadFile(String filename, String *mime_type); /* copy and possibly collapse a URL to a string with at most 50 chars */ String collapseURL(String url); /* Returns True if filename is a symbolic link */ extern Boolean followSymLinks(String filename); /***** * Display a Busy cursor when state is True and removes it when state is * False *****/ extern void setBusy(Widget w, Boolean state); /* display a messagebox with the string msg */ extern void XMessage(Widget widget, String msg); /* Decompose a Unix file name into a file name and a path */ int parseFilename(char *fullname, char *filename, char *pathname); /* Don't add anything after this endif! */ #endif /* _misc_h_ */ XmHTML-1.1.7/examples/menu.c100644 23564 23564 37743 6606473110 14073 0ustar newtnewt#ifndef lint static char rcsId[]="$Header: /usr/local/rcs/Newt/libxutil/RCS/menu.c,v 2.1 1997/02/11 02:23:27 newt Exp newt $"; #endif /***** * menu.c : X11/Motif menu creation/convenience routines * * This file Version: $Revision: 2.1 $ * * Creation date: 06/15/1994 * Last modification: $Date: 1997/02/11 02:23:27 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: koen * * Copyright (C) 1994-1997 by 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. * * History: * iEdit * XntHelp *****/ /***** * Revision Log: * $Log: menu.c,v $ * Revision 2.1 1997/02/11 02:23:27 newt * Migration into eXweb * *****/ #include #include #include /* X11 includes */ #include #include /* Motif includes */ #include #include #include #include #include #include #include #include #include /* Local includes */ #include "menu.h" /***** * Name: MenuBuild * Return Type: Widget * Description: multiple menu type creation routine * In: * parent: parent for this menu * type: type of desired menu, see below * title: title for this menu * mnemonic: shortcut key for this menu * items: menu descriptions, see menu.h * Returns: * On success, the created menu. Can exit the application if the menu * specification is invalid * Notes: * - This function is a modified version of the buildMenu function * in The Motif Programming Manual, Volume 6 in the O'Reilly X Window * System Series. * - The menu types supported are: XmMENU_PULLDOWN, XmMENU_OPTION and * XmMENU_POPUP * - The class of the menu buttons can be: * xmCascadeButtonGadgetClass, xmLabelGadgetClass, xmPushButtonGadgetClass, * xmSeparatorGadgetClass, xmToggleButtonGadgetClass and all of their Widget * counterparts. *****/ Widget MenuBuild(Widget parent, int type, String title, KeySym mnemonic, MenuItem *items) { int i, argc = 0; Widget menu, cascade, widget; String resource; char menu_name[512]; Arg args[5]; sprintf(menu_name,"%sMenu", title); /* create appropriate RowColum container */ switch(type) { case XmMENU_PULLDOWN: menu = XmCreatePulldownMenu(parent, menu_name, NULL, 0); break; case XmMENU_OPTION: strcat(menu_name, "_Option"); menu = XmCreatePulldownMenu(parent, menu_name, NULL, 0); break; case XmMENU_POPUP: strcat(menu_name, "_Popup"); menu = XmCreatePopupMenu(parent, menu_name, NULL, 0); break; default: return(NULL); } /* create menu triggerer */ if(type == XmMENU_PULLDOWN) { cascade = XtVaCreateManagedWidget(title, xmCascadeButtonGadgetClass, parent, XmNsubMenuId, menu, NULL); if(mnemonic != None) { XtVaSetValues(cascade, XmNmnemonic, mnemonic, NULL); } } else if(type == XmMENU_OPTION) { argc = 0; XtSetArg(args[argc], XmNsubMenuId, menu); argc++; cascade = XmCreateOptionMenu(parent, title, args, argc); } /* add all menu items */ for(i = 0; items[i].name != NULL; i++) { /* check for pull-rights */ if(items[i].subitems) { if(type == XmMENU_OPTION) { fprintf(stderr, "MenuBuild:\n" "\tsubmenus in option menus are not allowed.\n"); return(NULL); } else widget = MenuBuild(menu, XmMENU_PULLDOWN, items[i].name, items[i].mnemonic, items[i].subitems); } else widget = XtCreateManagedWidget(items[i].name, *items[i].class, menu, NULL, 0); /* configure the new menu item */ if(items[i].class != &xmSeparatorGadgetClass && items[i].class != &xmSeparatorWidgetClass) { argc = 0; /* callback? */ if(items[i].callback) { if(items[i].class == &xmToggleButtonWidgetClass || items[i].class == &xmToggleButtonGadgetClass) resource = XmNvalueChangedCallback; else resource = XmNactivateCallback; XtAddCallback(widget, resource, items[i].callback, items[i].client_data); } /* do we have an mnemonic for this item? */ if(items[i].mnemonic != None) { XtSetArg(args[argc], XmNmnemonic, items[i].mnemonic); argc++; } /* initial state? */ if(items[i].class == &xmToggleButtonWidgetClass || items[i].class == &xmToggleButtonGadgetClass) resource = XmNset; else resource = XmNsensitive; XtSetArg(args[argc], resource, items[i].sensitive); argc++; /* userData? */ if(items[i].id != (XtPointer)-1) { XtSetArg(args[argc], XmNuserData, items[i].id); argc++; } /* set them */ if(argc) XtSetValues(widget, args, argc); } } return(type == XmMENU_POPUP ? menu : cascade); } /***** * Name: MenuBuildShared * Return Type: Widget * Description: creates a ``floating'' menu suitable for sharing between * multiple menubars * In: * parent: parent for this menu; * type: type of menu to be created; * title: name of this menu; * items: items for this menu; * Returns: * the created menu. *****/ Widget MenuBuildShared(Widget parent, int type, String title, MenuItem *items) { int i, argc = 0; Widget menu, widget; String resource; char menu_name[512]; Arg args[5]; sprintf(menu_name,"%sMenu", title); /* create appropriate RowColum container */ switch(type) { case XmMENU_PULLDOWN: menu = XmCreatePulldownMenu(parent, menu_name, NULL, 0); break; case XmMENU_OPTION: strcat(menu_name, "_Option"); menu = XmCreatePulldownMenu(parent, menu_name, NULL, 0); break; case XmMENU_POPUP: strcat(menu_name, "_Popup"); menu = XmCreatePopupMenu(parent, menu_name, NULL, 0); break; default: return(NULL); } /* add all menu items */ for(i = 0; items[i].name != NULL; i++) { /* check for pull-rights */ if(items[i].subitems) { if(type == XmMENU_OPTION) { fprintf(stderr, "MenuBuildShared:\n" "\tsubmenus in option menus are not allowed.\n"); return(NULL); } else widget = MenuBuild(menu, XmMENU_PULLDOWN, items[i].name, items[i].mnemonic, items[i].subitems); } else widget = XtCreateManagedWidget(items[i].name, *items[i].class, menu, NULL, 0); /* configure the new menu item */ if(items[i].class != &xmSeparatorGadgetClass && items[i].class != &xmSeparatorWidgetClass) { argc = 0; /* callback? */ if(items[i].callback) { if(items[i].class == &xmToggleButtonWidgetClass || items[i].class == &xmToggleButtonGadgetClass) resource = XmNvalueChangedCallback; else resource = XmNactivateCallback; XtAddCallback(widget, resource, items[i].callback, items[i].client_data); } /* do we have an mnemonic for this item? */ if(items[i].mnemonic != None) { XtSetArg(args[argc], XmNmnemonic, items[i].mnemonic); argc++; } /* initial state? */ if(items[i].class == &xmToggleButtonWidgetClass || items[i].class == &xmToggleButtonGadgetClass) resource = XmNset; else resource = XmNsensitive; XtSetArg(args[argc], resource, items[i].sensitive); argc++; /* userData? */ if(items[i].id != (XtPointer)-1) { XtSetArg(args[argc], XmNuserData, items[i].id); argc++; } /* set them */ if(argc) XtSetValues(widget, args, argc); } } return(menu); } /***** * Name: MenuAddShared * Return Type: Widget * Description: creates a menubar entry and adds the given menu to it. * In: * parent: parent for this menu * type: type of desired menu, see below * title: title for this menu * mnemonic: shortcut key for this menu * items: menu items; * Returns: * The new menubar entry when a pulldown or optionmenu was requested, NULL * otherwise. *****/ Widget MenuAddShared(Widget parent, int type, String title, KeySym mnemonic, Widget items) { Arg args[2]; int argc = 0; /* create menu triggerer */ switch(type) { case XmMENU_PULLDOWN: XtSetArg(args[argc], XmNsubMenuId, items); argc++; if(mnemonic != None) { XtSetArg(args[argc], XmNmnemonic, mnemonic); argc++; } return(XmCreateCascadeButtonGadget(parent, title, args, argc)); case XmMENU_OPTION: XtSetArg(args[argc], XmNsubMenuId, items); argc++; return(XmCreateOptionMenu(parent, title, args, argc)); default: fprintf(stderr, "MenuAddShared: unknown menu type!\n"); return(NULL); } } /********** ***** Common menu convenience routines **********/ /***** * Name: MenuGetChildren * Return Type: void * Description: Get the children of a menu. * In: * menu: menu of which to get the children * children: children of menu. This elemenent is filled upon return. * num_children: number of elements in children. This element is filled * upon return. * Returns: * nothing *****/ void MenuGetChildren(Widget menu, WidgetList *children, int *num_children) { Widget foo = NULL; *children = NULL; *num_children = 0; if (XtIsSubclass(menu, xmCascadeButtonWidgetClass) || XtIsSubclass(menu, xmCascadeButtonGadgetClass)) { XtVaGetValues(menu, XmNsubMenuId, &foo, NULL); XtVaGetValues(foo, XmNchildren, &*children, XmNnumChildren, &*num_children, NULL); } else if ((XmIsRowColumn(menu)) == 1) { XtVaGetValues(menu, XmNchildren, &*children, XmNnumChildren, &*num_children, NULL); } else { fprintf(stderr, "MenuGetChildren:\n" "\tcan't retrieve children: menu is of unknown class.\n"); return; } } /***** * Name: MenuFindButtonById * Return Type: Widget * Description: Find a widget identified by Id in a pointer array of widgets * In: * menu: list of widgets to search * id: id of widget to find * Returns: * widget found or NULL on failure. *****/ Widget MenuFindButtonById(Widget menu, int id) { register WidgetList child_ptr; WidgetList childs; int num_childs; MenuGetChildren(menu, &childs, &num_childs); for(child_ptr = childs; child_ptr != NULL; child_ptr++) { if((MenuButtonGetId(*child_ptr)) == id) return(*child_ptr); } return(NULL); /* not found */ } /***** * Name: MenuFindButtonByName * Return Type: Widget * Description: Find a named widget in a pointer array of widgets * In: * wlist: list of widgets to search * name: name of widget to find * Returns: * widget found or NULL on failure. *****/ Widget MenuFindButtonByName(WidgetList wlist, String name) { WidgetList child_ptr; Widget child = NULL; for(child_ptr = wlist; child_ptr != NULL; child_ptr++) { child = *child_ptr; if (strcmp(XtName(child),name) == 0) return(child); } return(NULL); /* not found */ } /***** * Name: MenuButtonGetId * Return Type: int * Description: This routine finds out what number a menubutton has by * examining the XmNuserData field of the widget * In: * button: button for which to fetch the userData value * Returns: * value of the XmNuserData resource *****/ int MenuButtonGetId(Widget button) { int w_num = -1; XtVaGetValues(button, XmNuserData, &w_num, NULL); return(w_num); } /***** * Name: MenuIsToggleMenu * Return Type: void * Description: Make a menu with togglebuttons act as a radiobox * In: * menu: menu of which to set state * Returns: * nothing *****/ void MenuIsToggleMenu(Widget menu) { Widget foo = NULL; if (XtIsSubclass(menu, xmCascadeButtonWidgetClass) || XtIsSubclass(menu, xmCascadeButtonGadgetClass)) { XtVaGetValues(menu, XmNsubMenuId, &foo, NULL); XtVaSetValues(foo, XmNradioBehavior, True, XmNradioAlwaysOne, True, NULL); } else { fprintf(stderr, "MenuToggleSet:\n\tmenu %s is no subclass " "of CascadeButton (internal error).\n", XtName(menu)); } } /********** ***** Option menu specific convenience routines **********/ /***** * Name: MenuOptionSelectItem * Return Type: void * Description: selects the given option menu button; * In: * menu: menu of which to select a menu item * id: id of menu item to set * Returns: * nothing *****/ void MenuOptionSelectItem(Widget menu, int id) { Widget option_menu = NULL; Widget pb; /* Get all children and number of items contained */ XtVaGetValues(menu, XmNsubMenuId, &option_menu, NULL); /* sanity check */ if(!option_menu) { fprintf(stderr, "MenuSelectOption:\n" "\tcan't select requested menu: menu has no children.\n"); return; } /* get correct menu entry */ if((pb = MenuFindButtonById(menu, id)) == NULL) { fprintf(stderr, "MenuSelectOption:\n" "\tcan't select requested menu: requested id out of range.\n"); return; } /* Select it */ XtVaSetValues(option_menu, XmNmenuHistory, pb, NULL); } /***** * Name: MenuOptionSetSensitivity * Return Type: void * Description: Set the sensitivity state of an item in a option menu * In: * menu:option menu id * id: id of menu item of which the state is to be set. * Zero based index. * state: state of the item. * Returns: * nothing *****/ void MenuOptionSetSensitivity(Widget menu, int id, int state) { Widget pb; /* get correct menu entry */ if((pb = MenuFindButtonById(menu, id)) == NULL) { fprintf(stderr, "MenuOptionSetSensitivity:\n" "\tcan't select requested menu: requested id out of range.\n"); return; } XtSetSensitive(pb, state); } /***** * Name: MenuOptionGetSelected * Return Type: int * Description: Return the id of the selected option menu item * In: * menu: Option menu of which to return the selected menu item * Returns: * the id (XmNuserData field) of the selected menu item. -1 upon failure. *****/ int MenuOptionGetSelected(Widget menu) { int item_no; Widget item; XtVaGetValues(menu, XmNmenuHistory, &item, NULL); if(!item) { fprintf(stderr, "MenuOptionGetSelected:\n" "\tcan't retrieve selected item in option menu: XtVaGetValues " "returned NULL.\n"); return(-1); } XtVaGetValues(item, XmNuserData, &item_no, NULL); return(item_no); } /********** ***** Toggle menu specific convenience routines **********/ /***** * Name: MenuToggleSelected * Return Type: Boolean * Description: See if a toggle button is checked * In: * toggle: toggle button widget to check * Returns: * selection state of toggle *****/ Boolean MenuToggleSelected(Widget toggle) { Boolean value = False; XtVaGetValues(toggle, XmNset, &value, NULL); return(value); } /***** * Name: MenuToggleSetState * Return Type: void * Description: sets the selection state of a togglebutton. * In: * menu: menu of which an item has to be set; * id: id of menubutton to be set; * state: new toggle state; * Returns: * nothing. *****/ void MenuToggleSetState(Widget menu, int id, Boolean state) { Widget toggle; /* get correct menu entry */ if((toggle = MenuFindButtonById(menu, id)) == NULL) { fprintf(stderr, "MenuToggleSetState:\n" "\tcan't select requested menu: requested id out of range.\n"); return; } XtVaSetValues(toggle, XmNset, state, NULL); } /***** * Name: MenuToggleGetState * Return Type: void * Description: gets the selection state of a togglebutton. * In: * menu: menu for which an item has to be checked; * id: id of menubutton to be checked; * Returns: * False when it's not selected, True otherwise. *****/ Boolean MenuToggleGetState(Widget menu, int id) { Widget toggle; Boolean value = False; /* get correct menu entry */ if((toggle = MenuFindButtonById(menu, id)) == NULL) { fprintf(stderr, "MenuToggleSetState:\n" "\tcan't get requested menu: requested id out of range.\n"); return(False); } XtVaGetValues(toggle, XmNset, &value, NULL); return(value); } XmHTML-1.1.7/examples/menu.h100644 23564 23564 7101 6445051373 14045 0ustar newtnewt/***** * menu.h : menu protos, structures & defines * * This file Version $Revision$ * * Creation date: Sun Nov 9 16:21:52 GMT+0100 1997 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: newt * * Copyright (C) 1994-1997 by 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$ *****/ /***** * ChangeLog * $Log$ *****/ #ifndef _menu_h_ #define _menu_h_ /***** * Definition of the menu items. * The id field in this structure is stored as XmNuserData for the created * menu item. Setting it to -1 will make MenuBuild ignore it. *****/ typedef struct _MenuItem{ char *name; /* menu item name */ WidgetClass *class; /* menu item class */ KeySym mnemonic; /* menu item mnemonic */ Bool sensitive; /* initial menu state */ XtPointer id; /* menu button id */ XtCallbackProc callback; /* menu callback */ XtPointer client_data; /* menu callback data */ struct _MenuItem *subitems; /* pullright menu items */ }MenuItem; /* build an entire menu, including the menubar entry */ extern Widget MenuBuild(Widget parent, int type, String title, KeySym mnemonic, MenuItem *items); /* build an entire ``floating'' menu (no menubar entry) */ extern Widget MenuBuildShared(Widget parent, int type, String title, MenuItem *items); /* create a menubar entry and add the ``floating'' menu to it */ extern Widget MenuAddShared(Widget parent, int type, String title, KeySym mnemonic, Widget items); /***** * common menu convenience routines *****/ /* return the children of the given menu */ extern void MenuGetChildren(Widget menu, WidgetList *children, int *num_children); /* locate a menu button by it's id */ extern Widget MenuFindButtonById(Widget menu, int id); /* locate a menu button by it's name */ extern Widget MenuFindButtonByName(WidgetList wlist, String name); /* return the id of a menu button (value of XmNuserData resource) */ extern int MenuButtonGetId(Widget button); /* make a menu with toggleButtons act as a radiobox */ extern void MenuIsToggleMenu(Widget menu); /***** * Option Menu specific routines *****/ /* select the given OptionMenu menu item */ extern void MenuOptionSelectItem(Widget menu, int id); /* set the state of a Toggle menu item in an OptionMenu */ extern void MenuOptionSetSensitivity(Widget menu, int id, int state); /* return the selected item in an OptionMenu */ extern int MenuOptionGetSelected(Widget menu); /***** * Toggle Menu specific routines *****/ /* return the selection state of a Toggle menu item */ extern Boolean MenuToggleSelected(Widget toggle); /* get the state of a Toggle menu item */ extern Boolean MenuToggleGetState(Widget menu, int id); /* set the state of a Toggle menu item */ extern void MenuToggleSetState(Widget menu, int id, Boolean state); /* Don't add anything after this endif! */ #endif /* _menu_h_ */ XmHTML-1.1.7/examples/menuItems.h100644 23564 23564 27255 6602544332 15100 0ustar newtnewt/***** * menuItems.h : example_2 menu item definitions * * This file Version $Revision$ * * Creation date: Sun Dec 14 17:16:11 GMT+0100 1997 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: newt * * Copyright (C) 1994-1997 by 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$ *****/ /***** * ChangeLog * $Log$ *****/ #ifndef _menuItems_h_ #define _menuItems_h_ #include #include #include #include /**** * Menu defines *****/ /* File Menu defines */ #define FILE_NEW 0 #define FILE_OPEN 1 #define FILE_OPEN_URL 2 #define FILE_SAVEAS 3 #define FILE_RELOAD 4 #define FILE_VIEW 5 #define FILE_PRINT 6 #define FILE_CLOSE 7 #define FILE_QUIT 8 /* File->View defines */ #define VIEW_INFO 0 #define VIEW_SOURCE 1 #define VIEW_FONTS 2 #define VIEW_STRUCTURE 3 /* File->SaveAs defines */ #define SAVE_HTML_PLAIN 0 /* original source */ #define SAVE_HTML_PARSER 1 /* parser output */ #define SAVE_TXT_PLAIN 2 /* plain text */ #define SAVE_TXT_FORMATTED 3 /* formatted text */ #define SAVE_PS 4 /* postscript */ /* Edit Menu defines */ #define EDIT_FIND 0 #define EDIT_FIND_AGAIN 1 /* Option Menu defines */ #define OPTIONS_GENERAL 0 #define OPTIONS_DOCUMENT 1 #define OPTIONS_ANCHOR 2 #define OPTIONS_IMAGES 3 #define OPTIONS_FONTS 4 #define OPTIONS_START 5 #define OPTIONS_ANCHOR_BUTTONS ( OPTIONS_START ) #define OPTIONS_ANCHOR_HIGHLIGHT ( OPTIONS_START + 1 ) #define OPTIONS_ANCHOR_TRACKING ( OPTIONS_START + 2 ) #define OPTIONS_ANCHOR_TIPS ( OPTIONS_START + 3 ) #define OPTIONS_BODY_COLORS ( OPTIONS_START + 4 ) #define OPTIONS_BODY_IMAGES ( OPTIONS_START + 5 ) #define OPTIONS_ALLOW_COLORS ( OPTIONS_START + 6 ) #define OPTIONS_ALLOW_FONTS ( OPTIONS_START + 7 ) #define OPTIONS_JUSTIFY ( OPTIONS_START + 8 ) #define OPTIONS_STRICTHTML ( OPTIONS_START + 9 ) #define OPTIONS_BADHTML ( OPTIONS_START + 10 ) #define OPTIONS_ANIMATION_FREEZE ( OPTIONS_START + 11 ) #define OPTIONS_ENABLE_IMAGES ( OPTIONS_START + 12 ) #define OPTIONS_AUTOLOAD_IMAGES ( OPTIONS_START + 13 ) #define OPTIONS_SAVE ( OPTIONS_START + 14 ) #define OPTIONS_TABWIDTH ( OPTIONS_START + 15 ) #define OPTIONS_ICONSUPPORT ( OPTIONS_START + 16 ) #define OPTIONS_ICON_ALIGN ( OPTIONS_START + 17 ) #define OPTIONS_LAST ( OPTIONS_START + 18 ) /* Warning menu defines correspond with XmHTML warning type defines */ /* Window Menu defines */ #define WINDOW_RAISE 0 #define WINDOW_LOWER 1 /* Help Menu defines */ #define HELP_ABOUT 0 /* Any menu items that are commented out aren't supported (yet) */ static MenuItem viewMenu[] = { {"viewInfo", &xmPushButtonGadgetClass, None, True, (XtPointer)VIEW_INFO, viewCB, NULL, NULL }, {"viewSource", &xmPushButtonGadgetClass, None, True, (XtPointer)VIEW_SOURCE, viewCB, NULL, NULL }, {"viewFonts", &xmPushButtonGadgetClass, None, True, (XtPointer)VIEW_FONTS, viewCB, NULL, NULL }, {"viewStructure", &xmPushButtonGadgetClass, None, True, (XtPointer)VIEW_STRUCTURE, viewCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; /* Any menu items that are commented out aren't supported (yet) */ static MenuItem saveMenu[] = { {"saveHtmlPlain", &xmPushButtonGadgetClass, None, True, (XtPointer)SAVE_HTML_PLAIN, saveCB, NULL, NULL }, {"saveHtmlParser", &xmPushButtonGadgetClass, None, True, (XtPointer)SAVE_HTML_PARSER, saveCB, NULL, NULL }, {"saveTxtPlain", &xmPushButtonGadgetClass, None, True, (XtPointer)SAVE_TXT_PLAIN, saveCB, NULL, NULL }, {"saveTxtFormatted", &xmPushButtonGadgetClass, None, True, (XtPointer)SAVE_TXT_FORMATTED, saveCB, NULL, NULL }, {"savePs", &xmPushButtonGadgetClass, None, True, (XtPointer)SAVE_PS, saveCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; static MenuItem fileMenu[] = { #if 0 {"new", &xmPushButtonGadgetClass, None, False, (XtPointer)FILE_NEW, fileCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, #endif {"open", &xmPushButtonGadgetClass, None, True, (XtPointer)FILE_OPEN, fileCB, NULL, NULL }, #if 0 {"openURL", &xmPushButtonGadgetClass, None, False, (XtPointer)FILE_OPEN_URL, fileCB, NULL, NULL }, #endif {"saveas", &xmPushButtonGadgetClass, None, True, (XtPointer)FILE_SAVEAS, fileCB, NULL, saveMenu }, {"reload", &xmPushButtonGadgetClass, None, False, (XtPointer)FILE_RELOAD, fileCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, {"view", &xmCascadeButtonGadgetClass, None, True, (XtPointer)FILE_VIEW, fileCB, NULL, viewMenu}, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, #if 0 {"print", &xmPushButtonGadgetClass, None, False, (XtPointer)FILE_PRINT, fileCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, {"close", &xmPushButtonGadgetClass, None, False, (XtPointer)FILE_CLOSE, fileCB, NULL, NULL }, #endif {"quit", &xmPushButtonGadgetClass, None, True, (XtPointer)FILE_QUIT, fileCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; static MenuItem warningMenu[] = { {"none", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_NONE, warningCB, NULL, NULL }, {"all", &xmToggleButtonGadgetClass, None, True, (XtPointer)XmHTML_ALL, warningCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, {"unknownElement", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_UNKNOWN_ELEMENT, warningCB, NULL, NULL }, {"bad", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_BAD, warningCB, NULL, NULL }, {"openBlock", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_OPEN_BLOCK, warningCB, NULL, NULL }, {"closeBlock", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_CLOSE_BLOCK, warningCB, NULL, NULL }, {"openElement", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_OPEN_ELEMENT, warningCB, NULL, NULL }, {"nested", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_NESTED, warningCB, NULL, NULL }, {"violation", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmHTML_VIOLATION, warningCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; static MenuItem iconAlignMenu[] = { {"top", &xmToggleButtonGadgetClass, None, False, (XtPointer)XmALIGNMENT_BASELINE_TOP, iconAlignCB, NULL, NULL }, {"middle", &xmToggleButtonGadgetClass, None, True, (XtPointer)XmALIGNMENT_CENTER, iconAlignCB, NULL, NULL }, {"bottom", &xmToggleButtonGadgetClass, None, True, (XtPointer)XmALIGNMENT_BASELINE_BOTTOM, iconAlignCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; static MenuItem optionMenu[] = { #if 0 {"general", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_GENERAL, optionsCB, NULL, NULL }, {"document", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_DOCUMENT, optionsCB, NULL, NULL }, {"anchor", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_ANCHOR, optionsCB, NULL, NULL }, {"images", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_IMAGES, optionsCB, NULL, NULL }, {"fonts", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_FONTS, optionsCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, #endif /* anchor options */ {"anchorButtons", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ANCHOR_BUTTONS, optionsCB, NULL, NULL }, {"highlightOnEnter", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ANCHOR_HIGHLIGHT, optionsCB, NULL, NULL }, {"imageAnchorTracking", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ANCHOR_TRACKING, optionsCB, NULL, NULL }, {"anchorTips", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ANCHOR_TIPS, optionsCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, /* body options */ {"enableBodyColors", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_BODY_COLORS, optionsCB, NULL, NULL }, {"enableBodyImages", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_BODY_IMAGES, optionsCB, NULL, NULL }, {"enableDocumentColors", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ALLOW_COLORS, optionsCB, NULL, NULL }, {"enableDocumentFonts", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ALLOW_FONTS, optionsCB, NULL, NULL }, {"enableOutlining", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_JUSTIFY, optionsCB, NULL, NULL }, {"tabWidth", &xmPushButtonGadgetClass, None, True, (XtPointer)OPTIONS_TABWIDTH, optionsCB, NULL, NULL}, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, {"enableIconSupport", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ICONSUPPORT, optionsCB, NULL, NULL}, {"iconAlign", &xmCascadeButtonGadgetClass, None, True, (XtPointer)OPTIONS_ICON_ALIGN, optionsCB, NULL, iconAlignMenu}, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, /* parser options */ {"strictHTMLChecking", &xmToggleButtonGadgetClass, None, False, (XtPointer)OPTIONS_STRICTHTML, optionsCB, NULL, NULL }, {"warning", &xmCascadeButtonGadgetClass, None, True, (XtPointer)OPTIONS_BADHTML, optionsCB, NULL, warningMenu}, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, /* image options */ {"freezeAnimations", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ANIMATION_FREEZE, optionsCB, NULL, NULL }, {"imageEnable", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_ENABLE_IMAGES, optionsCB, NULL, NULL }, {"autoImageLoad", &xmToggleButtonGadgetClass, None, True, (XtPointer)OPTIONS_AUTOLOAD_IMAGES, optionsCB, NULL, NULL }, {"_separator_", &xmSeparatorGadgetClass, None, True, NULL, NULL, NULL, NULL }, {"save", &xmPushButtonGadgetClass, None, False, (XtPointer)OPTIONS_SAVE, optionsCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; /* the Edit menu */ static MenuItem editMenu[] = { {"find", &xmPushButtonGadgetClass, None, True, (XtPointer)EDIT_FIND, editCB, NULL, NULL }, {"findAgain", &xmPushButtonGadgetClass, None, True, (XtPointer)EDIT_FIND_AGAIN, editCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; /* the Window menu */ static MenuItem windowMenu[] = { {"raise", &xmPushButtonGadgetClass, None, True, (XtPointer)WINDOW_RAISE, windowCB, NULL, NULL }, {"lower", &xmPushButtonGadgetClass, None, True, (XtPointer)WINDOW_LOWER, windowCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; /* the Help menu */ static MenuItem helpMenu[] = { {"about", &xmPushButtonGadgetClass, None, True, (XtPointer)HELP_ABOUT, helpCB, NULL, NULL }, {NULL, NULL, None, True, NULL, NULL, NULL, NULL }, }; /* Don't add anything after this endif! */ #endif /* _menuItems_h_ */ XmHTML-1.1.7/examples/history.c100644 23564 23564 36657 6606473110 14633 0ustar newtnewt#ifndef production static char rcsId[]="$Header$"; #endif /***** * history.c : generic history routines * * This file Version $Revision$ * * Creation date: Sun Aug 30 17:57:36 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by 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. * *****/ /***** * ChangeLog * $Log$ *****/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef WITH_DMALLOC #include #endif #include #include #include #include /* pull in for typedefs */ #include "history.h" #ifdef DEBUG static Boolean debug = False; #define Debug(MSG) do { \ if(debug) { printf MSG ; fflush(stdout); } }while(0) #else #define Debug(MSG) /* emtpy */ #endif /*** External Function Prototype Declarations ***/ /*** Public Variable Declarations ***/ /*** Private Datatype Declarations ****/ typedef struct hnode{ String file; /* file to which this history node belongs */ int line_no; /* referenced line number */ String location; /* referenced hyperlink, NULL = unused */ struct hnode *next; /* next history item */ struct hnode *prev; /* previous history item */ }HistoryNode; typedef struct lnode{ Widget owner; /* owner of this history data */ HistoryNode *head; /* head of history list */ HistoryNode *tail; /* last inserted history item */ HistoryNode *current; /* current history item */ struct lnode *next; /* next history list */ struct lnode *prev; /* previous history list */ }HistoryList; typedef struct{ HistoryList *head; /* head of history data */ HistoryList *tail; /* last inserted history */ }HistoryAdmin; /*** Private Function Prototype Declarations ****/ static HistoryList *historyFind(Widget w); static HistoryList *historyRegister(Widget w, String file, int line_no, String location); static void historyDeleteNodes(HistoryNode *node); static void historyUnregister(Widget w); static HistoryData *historyReturnNode(HistoryNode *node); /*** Private Variable Declarations ***/ static HistoryAdmin root; static Boolean initialized = 0; /********** ***** Private Routines **********/ /***** * Name: historyFind * Return Type: HistoryList* * Description: locate the history list for the given widget. * In: * w: widget for which to locate the history list (if any) * Returns: * A pointer to the historyList for the given widget, or NULL. *****/ static HistoryList* historyFind(Widget w) { HistoryList *hlist = NULL; for(hlist = root.head; hlist != NULL && hlist->owner != w; hlist = hlist->next); return(hlist); } /***** * Name: historyRegister * Return Type: HistoryList* * Description: initialize & register a new history list for the given * widget. The given data is the default history item * for the given widget. * In: * w: widget to register; * file: filename of default history item; * line_no: line number of default history item; * location: location of default history item; * Returns: * A newly allocated history list, or NULL. *****/ static HistoryList* historyRegister(Widget w, String file, int line_no, String location) { HistoryList *hlist = NULL; HistoryNode *node = NULL; if((hlist = (HistoryList*)malloc(sizeof(HistoryList))) == NULL) return(NULL); if((node = (HistoryNode*)malloc(sizeof(HistoryNode))) == NULL) { free(hlist); return(NULL); } /* copy history data into the history node */ node->file = strdup(file); node->line_no = line_no; if(location) node->location = strdup(location); else node->location = NULL; /***** * This is the first history node, so we haven't got a previous or * next node. *****/ node->next = NULL; node->prev = NULL; /* Initialize the HistoryList for this widget */ hlist->owner = w; hlist->head = node; hlist->current = node; hlist->tail = node; hlist->next = NULL; /* no next historylist */ hlist->prev = NULL; /* initialize anyway */ /***** * If we are already managing historyList's for a widget, * append current HistoryList to the list of already managed * historyLists's. *****/ if(root.head) { hlist->prev = root.tail; /* set previous HistoryList */ /***** * Next HistoryList for the current HistoryList is the newly allocated * HistoryList. *****/ root.tail->next = hlist; } else { root.head = hlist; /* very first HistoryList being managed. */ } root.tail = hlist; /* last inserted HistoryList */ /* all done */ return(hlist); } /***** * Name: historyDeleteNodes * Return Type: void * Description: deletes all given history nodes * In: * node: first history node to be deleted. * Returns: * nothing. *****/ static void historyDeleteNodes(HistoryNode *node) { HistoryNode *tmp = node; /* delete all given nodes */ while(tmp != NULL) { node = node->next; free(tmp->file); if(tmp->location) free(tmp->location); free(tmp); tmp = node; } } /***** * Name: historyUnregister * Return Type: void * Description: erase the history list being managed for the given widget. * In: * w: widget for which to delete the history list. * Returns: * nothing. *****/ static void historyUnregister(Widget w) { HistoryList *hlist; /* get the list associated with the given widget */ if((hlist = historyFind(w)) == NULL) return; /* disconnect this historylist from it's pre- and successors */ /* Check if this list is the head of the managed history lists */ if(hlist == root.head) { /* next item becomes the new head of the list */ root.head = hlist->next; /* invalidate previous reference (if any) */ if(root.head) root.head->prev = NULL; else root.tail = NULL; /* this was the last history list */ } else if(hlist == root.tail) { /* It's the last of the managed history lists */ root.tail = hlist->prev; /* this item becomes the new tail */ root.tail->next = NULL; /* which has no next list to it */ } else { /* nor head or tail, reconnect previous and next history list */ hlist->prev->next = hlist->next; hlist->next->prev = hlist->prev; } /* delete all nodes for this list */ historyDeleteNodes(hlist->head); /* and delete the list */ free(hlist); } /***** * Name: * Return Type: * Description: * In: * * Returns: * *****/ static HistoryData* historyReturnNode(HistoryNode *node) { if(node) { static HistoryData hdata; hdata.file = node->file; hdata.line_no = node->line_no; hdata.location = node->location; return(&hdata); } return(NULL); } /********** * Public Routines **********/ /***** * Name: HistoryInitialize * Return Type: void * Description: initializes the root node of the history mechanism. * In: * nothing. * Returns: * nothing. *****/ void HistoryInitialize(int level) { root.head = NULL; root.tail = NULL; initialized = True; #ifdef DEBUG debug = level; #endif } /***** * Name: HistoryAdd * Return Type: Boolean * Description: store data in the history list of the given widget. * In: * w: widget for which to update the history; * file: filename to be stored; * line_no: line number to be stored; * location: location of to be stored; * Returns: * True on success, False on failure. *****/ Boolean HistoryAdd(Widget w, String file, int line_no, String location) { HistoryList *hlist; HistoryNode *node; Debug(("history.c: HistoryAdd, file = %s, location = %s, line = %i\n", file, location ? location : "(null)", line_no)); /* sanity */ if(w == NULL || file == NULL) return(False); if(!initialized) HistoryInitialize(1); if((hlist = historyFind(w)) == NULL) { if((hlist = historyRegister(w, file, line_no, location)) == NULL) return(False); return(True); } /***** * First verify if the current node isn't equal to the data that is * to be stored. *****/ if(hlist->current) { node = hlist->current; if(!strcmp(node->file, file) && node->line_no == line_no && ((location && node->location && !strcmp(node->location, location))|| (!location && !node->location))) return(False); } if((node = (HistoryNode*)malloc(sizeof(HistoryNode))) == NULL) return(False); node->file = strdup(file); node->line_no = line_no; if(location) node->location = strdup(location); else node->location = NULL; /***** * When we get here, we know we already have an item in the list * for this widget (HistoryRegister does that for us), so * we just append the item and don't have to check the validity * of the history head. *****/ node->prev = hlist->current; node->next = NULL; /* delete all items after the current item, they have become invalid */ historyDeleteNodes(hlist->current->next); /* this is the new current item */ hlist->current->next = node; hlist->current = hlist->current->next; /* and it is also the last element in the list */ hlist->tail = hlist->current; /* all done */ return(True); } /***** * Name: HistoryRemove * Return Type: void * Description: remove all history data associated with the given widget. * In: * w: widget for which to destroy all history data. * Returns: * nothing. *****/ void HistoryRemove(Widget w) { /* sanity */ if(w == NULL) return; /* remove the history data for the given widget */ historyUnregister(w); } /***** * Name: HistoryForward * Return Type: HistoryData* * Description: move the history one step forward and return the associated * data. * In: * w: widget for which to return history data. * Returns: * History data, or NULL *****/ HistoryData* HistoryForward(Widget w) { HistoryList *hlist; /* sanity */ if(w == NULL || !initialized) return(NULL); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(NULL); /* move to the next history item in the list */ if(hlist->current && hlist->current->next) { Debug(("history.c: HistoryForward, current: file = %s, location = %s, " "line = %i\n", hlist->current->file, hlist->current->location ? hlist->current->location : "(null)", hlist->current->line_no)); hlist->current = hlist->current->next; Debug(("history.c: HistoryForward, next: file = %s, location = %s, " "line = %i\n", hlist->current->file, hlist->current->location ? hlist->current->location : "(null)", hlist->current->line_no)); return(historyReturnNode(hlist->current)); } /* no items or last item */ return(NULL); } /***** * Name: HistoryCurrent * Return Type: HistoryData* * Description: return the data associated with the current history item. * In: * w: widget for which to return history data. * Returns: * History data, or NULL *****/ HistoryData* HistoryCurrent(Widget w) { HistoryList *hlist; /* sanity */ if(w == NULL || !initialized) return(NULL); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(NULL); return(historyReturnNode(hlist->current)); } /***** * Name: HistoryBack * Return Type: HistoryData* * Description: move the history one step back and return the associated * data. * In: * w: widget for which to return history data. * Returns: * History data, or NULL *****/ HistoryData* HistoryBack(Widget w) { HistoryList *hlist; /* sanity */ if(w == NULL || !initialized) return(NULL); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(NULL); /* move to the previous history item in the list */ if(hlist->current && hlist->current->prev) { Debug(("history.c: HistoryBack, current: file = %s, location = %s, " "line = %i\n", hlist->current->file, hlist->current->location ? hlist->current->location : "(null)", hlist->current->line_no)); hlist->current = hlist->current->prev; Debug(("history.c: HistoryBack, previous: file = %s, location = %s, " "line = %i\n", hlist->current->file, hlist->current->location ? hlist->current->location : "(null)", hlist->current->line_no)); return(historyReturnNode(hlist->current)); } /* no items or first item */ return(NULL); } /***** * Name: HistoryRemove * Return Type: Boolean * Description: remove all references to the given file. * In: * w: widget for which to update the history; * file: file for which to delete all history references; * Returns: * True on success, False on failure. *****/ Boolean HistoryRemoveRefs(Widget w, String file) { HistoryList *hlist; HistoryNode *node, *tmp; /* sanity */ if(w == NULL || file == NULL) return(False); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(False); /* Delete all nodes that reference the given file */ node = hlist->head; do { /* store reference to next item */ tmp = node->next; /* check */ if(!(strcmp(node->file, file))) { /* free allocated memory */ free(node->file); if(node->location) free(node->location); /* reconnect previous and next nodes */ if(node == hlist->current) { /***** * Item to be deleted is the current item. The most logical * thing to do is to move the history forward. *****/ if(node->next) hlist->current = node->next; else hlist->current = node->prev; /* fallback */ } /* this is the head of the stored history data */ if(node == hlist->head) { /* move forward */ hlist->head = node->next; if(hlist->head) hlist->head->prev = NULL; else hlist->tail = NULL; /* this was the last item! */ } else if(node == hlist->tail) { /* It's the last of the managed items */ hlist->tail = node->prev; hlist->tail->next = NULL; /* which has no next item */ } else { /* nor head or tail, reconnect previous and next items */ node->prev->next = node->next; node->next->prev = node->prev; } } node = tmp; }while(node != NULL); /* all done */ return(True); } /***** * Name: HistoryVerifyBack * Return Type: Boolean * Description: verify if a backward move in the history yields a valid * result. * In: * w: widget for which to check the history data. * Returns: * True if a backward move is allowed, False if not. *****/ Boolean HistoryVerifyBack(Widget w) { HistoryList *hlist; /* sanity */ if(w == NULL || !initialized) return(False); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(False); /* Return True if a previous item exists */ return(hlist->current && hlist->current->prev); } /***** * Name: HistoryVerifyForward * Return Type: Boolean * Description: verify if a forward move in the history yields a valid * result. * In: * w: widget for which to check the history data. * Returns: * True if a forward move is allowed, False if not. *****/ Boolean HistoryVerifyForward(Widget w) { HistoryList *hlist; /* sanity */ if(w == NULL || !initialized) return(False); /* get history list for this widget */ if((hlist = historyFind(w)) == NULL) return(False); /* Return True if a next item exists */ return(hlist->current && hlist->current->next); } XmHTML-1.1.7/examples/history.h100644 23564 23564 4603 6572342657 14617 0ustar newtnewt/***** * history.h : public header for XmHTML history routines * * This file Version $Revision: 1.1 $ * * Creation date: Sun Aug 30 21:39:34 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by 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$ *****/ /***** * ChangeLog * $Log$ * *****/ #ifndef _history_h_ #define _history_h_ typedef struct{ String file; int line_no; String location; }HistoryData; /* Initialize the history routines. Level > 0 : debug mode */ extern void HistoryInitialize(int level); /* add an item to the history */ extern Boolean HistoryAdd(Widget w, String file, int line_no, String location); /* remove the history for the given widget */ extern void HistoryRemove(Widget w); /* remove all history items associated with the given file */ extern Boolean HistoryRemoveRefs(Widget w, String file); /***** * History fetching routines. * All these routines return pointers to static data, so do not free * the returned data. *****/ /* get the previous item in the history list */ extern HistoryData *HistoryBack(Widget w); /* get the current item in the history list */ extern HistoryData *HistoryCurrent(Widget w); /* get the next item in the history list */ extern HistoryData *HistoryForward(Widget w); /* verify if a backward move in the history will return valid data */ extern Boolean HistoryVerifyBack(Widget w); /* verify if a forward move in the history will return valid data */ extern Boolean HistoryVerifyForward(Widget w); /* Don't add anything after this endif! */ #endif /* _history_h_ */ XmHTML-1.1.7/examples/ftypes.h100644 23564 23564 7744 6575362317 14437 0ustar newtnewt/***** * ftypes.h : list of file associates. Used by example_2 when displaying * directory contents. * * This file Version $Revision: 1.1 $ * * Creation date: Wed Sep 9 03:46:55 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by Ripley Software Development * All Rights Reserved * * This file is part of no particular project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program 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 * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****/ /***** * $Source$ *****/ /***** * ChangeLog * $Log$ * *****/ #ifndef _ftypes_h_ #define _ftypes_h_ /***** * The first three of these file types are viewable directly with XmHTML. * The DIR and OPENDIR types are read and , processed and displayed via * XmHTML. * All other types require an external viewer. *****/ #define FILE_TXT 0 /* plain text document, XmHTML */ #define FILE_HTML 1 /* HTML document, XmHTML */ #define FILE_IMG 2 /* image, XmHTML */ #define FILE_DIR 3 /* a directory, XmHTML */ #define FILE_OPENDIR 4 /* the current directory, XmHTML */ #define FILE_BIN 5 /* a binary file */ #define FILE_UNKNOWN 6 /* all other types */ typedef struct{ String ext; /* list of extensions, separated by a | */ int type; /* type of file */ String icon; /* name of icon to use */ String descrip; /* accompying description */ #if 0 String mime_type; /* mime type for this entry */ #endif }fileType; /***** * Note on extensions: case is ignored when determining the type of a file! *****/ static fileType FileTypes[] = { /* file types known to example_2 */ { ".c", FILE_TXT, "text.document", "C program text" }, { ".cc|.c++", FILE_TXT, "text.document", "C++ program text" }, { ".h", FILE_TXT, "text.document", "C/C++ header file" }, /* archive types */ { ".tar.gz|.tgz", FILE_BIN, "archive", "Gzipped tar archive" }, { ".tar.z|.tz", FILE_BIN, "archive", "Compressed tar archive" }, { ".tar", FILE_BIN, "archive", "Tar archive" }, { ".rpm.gz", FILE_BIN, "archive", "Gzipped Redhat Package Manager archive" }, { ".rpm.z", FILE_BIN, "archive", "Compressed Redhat Package Manager archive" }, { ".rpm", FILE_BIN, "archive", "Redhat Package Manager archive" }, { ".deb.gz", FILE_BIN, "archive", "Gzipped Debian archive" }, { ".deb.z", FILE_BIN, "archive", "Compressed Debian archive" }, { ".deb", FILE_BIN, "archive", "Debian archive" }, /* compressed files */ { ".gz|.gzip", FILE_BIN, "compressed.document", "Gzipped file" }, { ".z", FILE_BIN, "compressed.document", "Compressed file" }, { ".o", FILE_BIN, "binary.document", "Compiled object module" }, /* image types */ { ".gif", FILE_IMG, "image", "GIF image" }, { ".jpg|.jpeg", FILE_IMG, "image", "JPEG image" }, { ".png", FILE_IMG, "image", "PNG image" }, { ".xpm", FILE_IMG, "image", "X11 Pixmap image" }, { ".xbm", FILE_IMG, "image", "X11 Bitmap image" }, /* document types */ { ".html|.htm", FILE_HTML, "html", "HTML document" }, { ".txt|.text", FILE_TXT, "text.document", "Plain text document"}, { ".doc", FILE_TXT, "document", "Other document"}, /* directory types */ { "..", FILE_DIR, "previous", "Parent directory" }, { NULL, FILE_DIR, "folder", "Directory" }, { NULL, FILE_OPENDIR, "folder.open", "Current directory" }, /* for all other documents */ { NULL, FILE_UNKNOWN, "unknown.document", "" }, }; /* Don't add anything after this endif! */ #endif /* _ftypes_h_ */ XmHTML-1.1.7/html/ 40755 23564 23564 0 6647510260 11761 5ustar newtnewtXmHTML-1.1.7/html/GPL.html100644 23564 23564 33164 6431721247 13415 0ustar newtnewt GNU General Public License

    GNU General Public License

    [Note: if your browser does not know how to handle the start attribute on numbered lists, the section numbering will start at one instead of zero, and subsequent section references in this document will be incorrect.]

     
    GNU GENERAL PUBLIC LICENSE
    Version 1, February 1989

    Copyright (C) 1989 Free Software Foundation, Inc.
    675 Mass Ave, Cambridge, MA 02139, USA
    Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

    Preamble

    The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too.

    When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

    To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

    For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.

    We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

    Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

    The precise terms and conditions for copying, distribution and modification follow.

    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    1. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you".

    2. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy.

    3. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following:

      1. cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and

      2. cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option).

      3. If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License.

      4. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

      Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms.

    4. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following:

      1. accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or,

      2. accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or,

      3. accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.)

      Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system.

    5. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance.

    6. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions.

    7. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein.

    8. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

      Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation.

    9. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

    10. NO WARRANTY

      BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    END OF TERMS AND CONDITIONS

    Appendix: How to Apply These Terms to Your New Programs

    If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

    To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy <name of author>

    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.

    This program 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 General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

    Also add information on how to contact you by electronic and paper mail.

    If the program is interactive, make it output a short notice like this when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19xx name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.

    The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.

    You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names:

    Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker.

    <signature of Ty Coon>, 1 April 1989
    Ty Coon, President of Vice

    That's all there is to it! XmHTML-1.1.7/html/LGPL.html100644 23564 23564 64546 6563324122 13536 0ustar newtnewt GNU Library General Public License

    GNU Library General Public License

    [Note: if your browser does not know how to handle the start attribute on numbered lists, the section numbering will start at one instead of zero, and subsequent section references in this document will be incorrect.]

     
    GNU LIBRARY GENERAL PUBLIC LICENSE
    Version 2, June 1991

    Copyright (C) 1991 Free Software Foundation, Inc.
    675 Mass Ave, Cambridge, MA 02139, USA
    Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

    Preamble

    The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.

    This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too.

    When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

    To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it.

    For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.

    Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.

    Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations.

    Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

    Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.

    The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.

    Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.

    However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.

    The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library.

    Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.

    GNU LIBRARY GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    1. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you".

      A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.

      The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)

      "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.

      Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.

    2. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.

      You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

    3. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

      1. The modified work must itself be a software library.

      2. You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.

      3. You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.

      4. If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.

        (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)

      These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

      Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.

      In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

    4. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.

      Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.

      This option is useful when you wish to copy part of the code of the Library into a program that is not a library.

    5. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.

      If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.

    6. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

      However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.

      When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.

      If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)

      Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.

    7. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.

      You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:

      1. Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)

      2. Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.

      3. If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.

      4. Verify that the user has already received a copy of these materials or that you have already sent this user a copy.

      For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

      It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.

    8. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:

      1. Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.

      2. Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.

    9. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

    10. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.

    11. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

    12. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.

      If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.

      It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

      This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

    13. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

    14. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

      Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.

    15. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

    NO WARRANTY

    1. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    2. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    END OF TERMS AND CONDITIONS

    Appendix: How to Apply These Terms to Your New Libraries

    If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).

    To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

    <one line to give the library's name and a brief idea of what it does.>

    Copyright (C) <year> <name of author>

    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.

    Also add information on how to contact you by electronic and paper mail.

    You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:

    Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker.

    <signature of Ty Coon>, 1 April 1990
    Ty Coon, President of Vice

    That's all there is to it! XmHTML-1.1.7/html/XmHTML.html100644 23564 23564 17666 6602742120 14046 0ustar newtnewt XmHTML: a HTML Widget

    XmHTML Widget Set

    This document is the main index to the XmHTML Widget Set documentation. XmHTML provides a widget capable of displaying HTML 3.2 conforming text.

    These pages will be updated regularly as the development of this widget progresses. Keep an eye on them!

    The XmHTML Widget Set is unique in its kind: it is the only HTML 3.2 widget set available under the GNU Library General Public License. As such, XmHTML can be used for both commercial and non-commercial applications.

    September 11, 1998, released XmHTML Beta 1.1.5

    This page tells you where you can find it.

    XmHTML reaches the press! Read the article about XmHTML Eric Foster-Johnson wrote in his Cross Thoughts column of Unix Review's Performance Computing magazine.

    Table of Contents

    1. Where to get XmHTML and the XmHTML mailing list
    2. XmHTML Widget Set Overview
    3. Description of latest changes
    4. Legal Issues, distribution and licensing
    5. Copyright Notices
    6. XmHTML Widget Set Programmers and Reference Guide
    7. XmHTML Manual Pages
    8. XmHTML PNG Demo Page
    9. HTML Extensions implemented by XmHTML
    10. List of applications using XmHTML

    Pointers to other Web related sites:

    The full package of these web pages is also available for downloading: XmHTML.html.tar.gz (136826 bytes).

    XmHTML Widget Set Overview

    The XmHTML Widget Set currently consists of two widgets:

    • XmHTML, a high performance Motif Widget capable of displaying HTML 3.2 confirming text. Amongst it's many features are the following:
      • builtin image support for X11 bitmaps, X11 pixmaps, GIF87a, GIF89a, JPEG and PNG;
      • GIF images are decoded using a patent free scheme;
      • builtin support for animated GIF89a and animated GIF89a with NETSCAPE2.0 loop extension. XmHTML supports all GIF89a disposal methods;
      • image support covers all X11 visual types and display depths;
      • delayed image loading;
      • progressive image loading;
      • builtin scrolling interface (both keyboard and mouse);
      • anchors can be displayed as pushbuttons;
      • anchor can be highlighted for enhanced visual feedback;
      • autosizing;
      • capable of displaying text/html, text/plain and standalone images;
      • supports the full HTML 3.2 standard; as well as the HTML 4.0 <FRAMESET> tags;
      • an extensive set of callback resources;
      • full text justification;
      • smart and user-definable font mapping;
      • can work with a predefined palette (which it can even create for you);
      • builtin quantizer using Floyd-Steinberg error diffusion;
      • four different dithering methods allow one to achieve an optimum balance between performance and image quality;
      • HTML Table support;
      • Support for HTML4.0 Events;
      • fully compatible with LessTif;
      • comes with an extensive set of documentation (manual pages, Programmers and Reference Guide and a collection of examples);

    • XmBalloon, a very lightweight "tooltip" Widget to show a one-line string in a small popup-window. Features include the following:
      • Choose between a rectangular or shaped window;
      • Popup window can be transparent;
      • User-configurable Popup and popdown delays;
      • very easy to use;

    The XmHTML Widget Set also contain a number of routines which allow one to make full use of XmHTML's image support for purposes other than XmHTML.

    Plans for the future include the migration of XmHTML's image support into a seperate Image library to allow authors to add image support to their applications with a single call.

    Features missing in the current version of XmHTML are the following:

    • Java applets. Kaffe, might offer some solution here.




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 25, 1998 by Koen

    XmHTML-1.1.7/html/getit.html100644 23564 23564 7021 6573477206 14072 0ustar newtnewt XmHTML Sites & Mailing Lists

    XmHTML Distribution Sites

    Master Site: http://www.xs4all.nl/~ripley/XmHTML

    Alternate Sites

    Europe

    United States

    Volunteers for additional distribution sites are welcome.

    Daily Snapshots

    Daily snapshots are also available. They represent my current version and as such may not behave as expected, they may not even compile. Use at your own risk.

    Due to diskspace limitations my ISP poses, only one snapshot is available at any given time. Patches between snapshots are also available so you don't need to download the entire archive, but just have to get the patches to move to the latest version.

    You can find them here and at. http://www.nerdnet.nl

    Mailing Lists

    You can subscribe to the XmHTML mailing list by sending an email to Majordomo@simplicity.net and placing the following in the BODY of your mail:

    subscribe xmhtml-dev <your email address>

    You will receive a message confirming your subscribtion.


    Mail Us

    ©Copyright 1996-1998 by Ripley Software Development
    Last update: September 3, 1998 by Koen
    XmHTML-1.1.7/html/changes.html100644 23564 23564 264734 6606516334 14437 0ustar newtnewt XmHTML: Description of Changes

    XmHTML Current State

    This page is updated almost on a daily basis and describes changes, bugfixes, personal frustrations and victories, milestones and release dates of past, present and future XmHTML alpha versions.

    The first entry dates back to november 12, 1996. While this may seem a long time, I'm doing the development single-handed, making stupid mistakes, writing, rewriting and re-rewriting code. XmHTML has come a long way since then and it's gaining more attention every day. The XmHTML Developers mailing list currently contains about 120 subscribers, and it's still growing.

    This document gives a fairly good description on how XmHTML is progressing, and, most of all, it shows that XmHTML is a project that is alive and kicking!

    October 6
    Hmm, I've been lazy updating this page. Here's what I've been doing during the past weeks:

    • ToolkitAbstraction: been doing a few tests related to formatted text output. These tests went rather smooth: without too much trouble I have gotten XmHTML to render on an off-screen pixmap instead of the display. The next step is to start overriding the composing postscript versions of the various members of the ToolkitAbstraction.

      comment: you are being deceived by your browser. Use the source, Luke! --> I've been also working on making access to the ToolkitAbstraction structure possible so application programmers will be able to override or augment the default ToolkitAbstraction without having to access XmHTML's internals.

    • Made a beginning with I18N. Rob Johnson has been working on patching XmHTML so it will render multibyte characters. His work will form the basis of XmHTML's I18N support. I am planning to extend his work much further to make XmHTML truly multilingual. This will require support for both the HTML 4.0 lang and dir attributes and the addition of a resource that allows one to define a language-character set mapping.

    • HTML4.0 events: Eric Bello reported a fundamental flaw in the event handling: processing of an event during the XmNeventCallback may result in the current document being modified, which will lead to a bunch of FMR's and often a crash.

      As a result, a new field, doc_modified, has been added to the XmHTMLAnchorCallbackStruct, XmHTMLEventCallbackStruct and XmHTMLFormCallbackStruct callback structures. If this field is set to True, XmHTML will no longer reference any data structures referring to the (now obsolete) document when the callback routine returns. With the exception of the onLoad and onUnLoad HTML4.0 events, document modification during anchor, event or form callback procedures should be properly supported.

    • XmHTML now fully supports the following HTML4.0 events:

      1. <A> element: onClick, onMouseDown, onMouseUp, onMouseOver, onMouseMove, and onMouseOut
      2. <BODY> element: onLoad and onUnLoad.

    • In some cases it could happen that a XmNtrackCallback callback procedure was not properly activated when moving from one anchor to another (anchors rendered close to each other, a user moving very fast from one anchor to another). This has been properly fixed.

    • Fixed a bug in the parser: in some cases, the document repair routines could misbehave on nested elements (especially with tables). The rules employed by the parser to deal with this have been updated.

    • Assorted bugfixes (including an important one in named anchor lookup and an equally important one in text justification) and minor code changes (typecasts to deal with strict c++ compilers) reported by a couple of XmHTML users.

    In addition to the above, I've also been thinking about restructering the source tree and splitting the code in common and toolkit-dependent parts. XmHTML will be placed onto the GNOME CVS repository shortly which should speed up the development of the gtk-xmhtml port and XmHTML considerably . To keep a clean oversight and make life easier for the gtk-xmhtml developers and myself, a restructured source tree is very much desired.

    September 11
    Fixed a couple of serious bugs in the table layout algorithm with respect to nested tables. Not entirely perfect yet but things are looking much better.

    I seem to have fixed the layout bug properly, although I still need to verify vertical positioning of images and make a few changes to the layout computation of preformatted text. Proper rendering of table borders is also much closer to the real thing.

    A few problems still remaining: proper handling of getting and setting line numbers. This has been thrown of balance since the positions of all text-based objects has slightly changed. I have added a (temporary) fix which seems to work satisfactory for now.

    Nevertheless, the long awaited XmHTML/Beta Version 1.1.5 has been released as of today.

    September 9
    Added Setvalues support for the XmNenableIconEntities, XmNiconAlignment and XmNtabWidth resources.

    Added support for the above resources to examples/example_2.

    Fixed a bug in the parser: XmHTML could reference an invalid parser tree when a convenience routine was called from inside a XmNdocumentCallback callback function. This in could cause XmHTML to crash.

    September 4
    Added the XmNtabWidth resource: this resource allows one to adjust the width of a horizontal tab in preformatted text.

    Fully incorporated support for W3C icon entities. Added the XmNenableIconEntities and XmNiconAlignment resources.

    September 1
    Updated the XmHTML manual page. I also seem the have the layout bug resolved properly.

    August 31
    Didn't get much to do on XmHTML since I spent almost the entire day trying to recover XmHTML's latest sources after one of my disks died a horrible, screeching death. I did manage to get the disk spinning again by messing with the hardware, only to find it was totally wasted. I won't bother you with further details, I'll suffice to say I had to wade through a dump of over 2gig to recover them...

    As a result I transferred development to another system which supports full mirroring (an IBM 42T in case you're interested).

    It was waaaay past midnight when I finally had everything up and running again.

    August 30
    Reworked the history mechanism in the examples, it works much better after I added two convenience functions that allow one to test the visibility state of a hyperlink: XmHTMLAnchorVisibleById and XmHTMLAnchorVisibleByName.

    Fixed a few bugs here and there. Most importantly, XmHTMLAnchorScrollToId could cause a buffer overrun and subsequently bring XmHTML to a grinding halt.

    August 27
    Minor bug fixes, comment updates. Started to merge in code donated by Eric Bello (belloer@gemse.fr) for embedded object support.

    August 25
    Code review, I need to familiarize myself again with the code, it's been almost three months since I had a look at it...

    Came a long way with fixing a fundamental flaw in the layout code.

    August 24
    I've finally recovered from back problems and a fractured wrist, so after a very long delay I've started working on XmHTML again.

    Target date for (the long overdue) XmHTML Beta 1.1.5 is set for Thursday, September 3, 1998.

    June 4
    Made a start with updating and correcting the manual pages and other documentation.

    Made a beginning with the implementation of support for embedded objects. This will allow programmers to dynamically add their own HTML extensions, create external widgets or start up applications and bring them under XmHTML's management. This hugely extends XmHTML capabilities!

    I also made some progress with further implementation of the ToolkitAbstraction. Still needs some work though.

    Played around with adding autoconf/automake support to the XmHTML source tree. This basically works but needs a lot of tweaking before this system is fully functional. Things that work are:

    • automatic detection of the image libraries (including version checks);
    • static libXmHTML is successfully build on Linux 2.0.32 and AIX 4.1.5;
    • static libhttp is successfully build on Linux 2.0.32 and AIX 4.1.5;
    • all examples are successfully build;

    Building shared libraries needs to be tested.

    Things that don't work (yet) are:

    • generating dependency information. This utterly fails;
    • installing the resulting libraries;
    • building the book, contrib and tools directories;
    • make clean and make distclean completely explode;
    • making distributions;
    • make includes is useless;
    • the current setup conflicts with the current Imakefile configuration.

    I expect to solve these problems during the coming weekend. Stay tuned.

    May 25
    The scrolling problem reported by a number of people finally seems to be solved!

    Eric Bello submitted an optimization for the scrolling which simply collapses all outstanding motion events. The entire chain of events caused by fast scrolling is now more or less handled synchronously and thus this (very important fix) should ensure that the screen is finally updated properly.

    Since this approach may lead to jumpy scrolling on some systems, the XmNsmoothScrolling resource has been introduced. If True, XmHTML will use not collapse motion events and scrolling will always be smooth.

    April 27
    Released XmHTML/Beta Version 1.1.4.

    April 26
    A day dedicated to bugtracking (with many thanks to Marcel Ruff for keeping me busy...)

    Modified the XmImageProc definition from:

    typedef XmImageInfo*(*XmImageProc)(Widget, String, XtPointer);
    	
    to
    typedef XmImageInfo*(*XmImageProc)(Widget, String, Dimension, Dimension, XtPointer);
    	
    The new arguments are the width and height as specified by the width and height attributes on the <IMG> tag.

    This change offers more flexibility for external image caches and is consistent with the way XmHTML performs internal image caching: internally, XmHTML caches images on a per-document basis: before the XmNimageProc resource is called, XmHTML looks at the list of images already loaded for that document. If it finds an image with the same url and dimensions, that image is reused instead of reloaded. Previously, this could lead to inconsistency (images with incorrect dimensions or images not appearing at all) with external image caches that only use the filename or url of a loaded image.

    Several bugfixes:

    • document color handling: if a color was referenced multiple times in the same document, it never got properly freed. This could lead to pretty weird situations and in some cases an X protocol error;
    • image scaling for simple transparent images: the created clipmask was worthless because it used an incorrect reference value for the transparent pixel;
    • replacing/updating animations: when an animation was replaced or updated with a non-animated image, the data was freed properly but the animation flags were not properly reset. This lead to a crash because XmHTML was trying to render frames that were no longer present.

    April 18
    Fixed an important buffer overrun in the parser that made XmHTML terribly unstable...

    April 13
    Greatly improved the table layout algorithm. XmHTML now uses a separate routine to compute the layout inside each cell. This enables XmHTML to make a proper distinction between cells that contain a multitude of images, special centering and linebreaking rules. It also sped up the layout computation of documents without tables in them.

    It's not yet perfect but I'm getting there.

    April 8
    Fixed a few important bugs in table rendering: while scrolling a table with a background specification, the entire background would be repainted but only the newly scrolled content would be rendered making the existing content invisible.

    Loosened HTML conformance checking when the XmNstrictHTMLChecking is set to False: font changes are now allowed to cross all HTML container elements (<H1>, <DIV>...).

    Anchors are now rendered using the current background color instead of the document background color.

    Enhanced the parser to automatically detect and correct a tag without a greater than sign (>).

    April 4
    Released XmHTML/Beta Version 1.1.3.

    Moved all warning messages in a stringtable and made a number of other changes to reduce the data size of the library. That succeeded fairly well, it decreased with more than 20kb.

    Made a few changes in exposure handling, tables seem to behave themselves a lot better now.

    April 3
    A few more optimizations in the document formatter: introduced a generic Stack class and replaced a few small but often used functions by macros.

    Fixed a small bug in table layout: content of cells with a single line of text in them is now properly centered.

    Fixed an important bug in image scaling: previously, XmHTML modified the original image data directly, leading to quality loss when the same image but with the original dimensions is referenced later. XmHTML now works with a copy of the original data when scaling is to be employed.

    April 1
    Added support for relative image dimensions;
    A few optimizations in tag attribute checking: tag attributes are now made caseless when the document is parsed, so attribute checking can now be done caseless as well.

    The COLOR attribute for horizontal rules (<HR>) is now also supported for rules without the NOSHADE attribute set.

    March 13
    Added the XmHTMLGetDocumentInfo convenience routine. This routine returns a list of all images and hyperlinks contained in a document, allowing one to display the structure of a document.

    March 12
    Bummer, haven't had much time the last weeks to work on XmHTML. Nevertheless, the following changes have been made:

    • Started with making daily distributions of my current source tree. This way you are always able to have a look at what I'm doing (or trying to). This page tells you a bit more about it.
    • Fixed a couple of bugs in image layout: paragraphs consisting only of images now have their spacing corrected, no needless horizontal or vertical spacing is added if none has been found in the input. This improves table layout a lot. Check http://www.babylon5.com and see how netscape gets it (a bit) wrong.
    • Default bordering on images has been made context-dependent: if it's a hyperlink, the default is to add a border, it it's not a hyperlink, no border is added. Of course this only applies to images which don't have the BORDER attribute set.
    • Imagemap support has been improved. In some cases, XmHTML would ignore a client-side imagemap if the image using an imagemap was wrapped inside an anchor.
    • a few bugfixes here and there.

    February 15
    Added full text searching using POSIX 1. regular expressions. Works quite well if I may say so...

    February 12
    Fixed an annoying parser bug: trailing contents in closing tags wasn't properly ignored which could lead to badly formatted documents.

    Converted two routines heavily used by the parser to macros to speed it up a little.

    Fixed a bug in anchor painting: when anchor highlighting is turned off, anchors now return to their normal state when they are deselected. Previously they would be painted with the highlightcolor.

    February 9
    Introduced some much needed optimizations after performing some profiling tests: XmHTML now spends less time in color allocation (in some tests even less than 65 percent), caseless string matching and the GIF decoders.

    Fixed some bugs in the 16bit RGB color matching code.

    February 7
    More table fixes: width of nested tables & spanned cells finally computed correctly.

    Modified all color allocation routines to work with 16bit RGB values and subsequently modified the image readers, quantizer and dither engines. Sped up dithering of JPEG images and did some prelimenary work on 16bit image support.

    Modified colorhashing to reduce the number of collisions.

    February 1
    Loosened parsing of RECT <AREA> coordinates: any sequence of non-digit characters is now considered a separator (www.infoseek.com is a site containing very nice examples of bad HTML).

    January 29
    Released XmHTML/Beta Version 1.1.2.

    January 28
    It's been a while since the last update. I have been rather occupied with other items since the last update, but nontheless, a few improvements have been made:

    • Table support is nearing it's completion: borders are rendered, cells can have a background color or image, row and cell spacing is treated correctly, tables can be nested almost indefinitly and dimensions are calculated properly.

      Exposure handling still suffers from a few quirks: although only the exposed region is redrawn, sometimes Expose events seem to be missed and scrolling seems to lose a few pieces of text here and there.

      The only real loose end is vertical alignment.

    • A number of bugfixes in Imakefiles and examples;
    • Explicit linebreaks are now properly ignored when they follow an implicit one (e.i, a <BR> when the current line already caused a linebreak);
    • XmHTML has been ported to Gtk for use with the Gnome Project;
    • Cookie support has been added to libhttp;

    December 31
    Happy Newyear!

    December 15
    HTML Form widgets are no longer actively destroyed when the parent HTML widget is destroyed. Previously, this lead to an XError. Bugfix thanks to Richard Offer.

    <BR> bugfixes:

    • If a line is ended by a linebreak, any leading space for the first word on the next line is removed. As a result of this, text justification no longer shifts this word;
    • Paragraphs containing a linebreak could incorrectly double the end-of-paragraph spacing.

    December 14
    Fixed a bug in anchor rendering when it is the first object in a page: XmHTML couldn't find a proper starting point and didn't render the anchor at all.

    Fixed a bug related to empty named anchors, they used to reset the left margin (this one has been lurking under the carpet for a very long time...).

    Some improvement in table exposure handling.

    December 13
    Modified handling of the XmNenableBadHTMLWarnings resource: you can now select what type of errors the parser detects will be shown.

    December 11
    libhttp: the HTTPHEAD HTTPLoadMethod now supports both HTTPLoadToFile and HTTPLoadToString. For the latter, any received headers are stored in a new headers (array of type HTTPNamedValues) field in the HTTPRequest return structure.

    HTML tables: cell width takes horizontal margin into account properly. Previously, the cell width tended to be too small for the widest cell. Bugfix: linebreaks contained in anchors are no longer rendered.

    Fixed a number of bugs in the Imakefiles.

    December 9
    HTML tables:

    • Fixed handling of the ROWSPAN attribute: the extra vertical space is now distributed evenly accross spanned rows;
    • fixed an (important) baseline handling bug;
    • cells now reset the linebreaking mechanism: each cell represents a minipage that must start with a clean slate. Previously paragraph breaks were transferred accross rows and cells.

    December 8
    Fixed a small redraw bug in XmBalloon popup.

    Changed the handling of <BR> tags: they are now treated as text objects. This fixes a bug in table cell content rendering if a table is placed in an intended paragraph.

    Added the Composite Extension fix.

    December 4
    Released XmHTML/Beta Version 1.1.1.

    December 3
    Nested tables seem to be working almost flawlessly. Added partial support for the BGCOLOR attribute on all table elements. Still scrolling problems and offsets between different child tables doesn't always work correctly.

    Loosened the parser to allow appearance of the <P> element inside elements it shouldn't be appearing the XmNstrictHTMLChecking resource has been set to false.

    December 1
    Tables are really going now: the COLSPAN and ROWSPAN attributes are now working. Table margins, cell and row padding also seems to work. If you care to take a look at a sneak preview, click here and be amazed :-))

    November 26
    More work on table layout: cell heights are now computed correctly, cell and rowspacing works, cell and row spanning should work. Nested tables also seems to work but has received little testing.

    November 25
    First success at table displaying! The layout algorithm seems to work rather well (and fast!). Details aren't rendered yet (borders, background color or image), suppport for cell and row spanning hasn't been added and scrolling is sometimes messed up, but the borderline is: the basic table layout computation algorithm works, and it works damn GOOD!

    November 21
    Finally found a satisfying design for table support. Extended the document formatter to fill in the table data structures.

    November 20
    Internal changes to the parser as preparation for progressive document loading. Temporarely removed the ParserObject from the XmHTML Widget library.

    November 14
    Played around with the HTML 4.0 event model: added the XmNeventProc resource to parse any scripts attached to these events and added the XmNeventCallback callback resource whenever an event should be served. Support for all HTML4.0 events is present in the code but currently only the onMouseUp and onMouseDown events are support for anchors.

    Still thinking about a decent and fast way to handle tables.

    November 12
    Some small performance increases in the document formatter: whenever possible, objects are reused instead of being deleted.

    November 11
    Played around a bit with the HTTP.c code in the contrib dir:

    • added a timeout on the connect() call using either setsockopt() or a bruteforce alarm() on systems that don't have support the SO_RCVTIMEO setsockopt flag;
    • added a select() on read() using a user-specified timeout and retry count;
    • added a small tool, httpget.c, in the tools directory demonstrating a fairly straightforward use of the HTTP code. This little tool can fetch an URL from any site you give feed it.

    The result of the above changes is that loadHTTPURL will never block again.

    Modified a few routines in parse.c so that they can now be shared by both XmHTML and XmHTMLParser.

    Small bugfix in ScrollToLine.

    November 10
    Added the XmNclientData resource. This resource allows one to provide a pointer to client data that should be provided as the last argument to any function installed on any of the functional XmNanchorVisitedProc and XmNimageProc resources. As a logical consequence, the corresponding typedef for these resources now have one additional argument of type XtPointer.

    November 8 and 9
    Working on tables;
    Much work on example_2.c: I'm completely rewriting it in a rather modular way where a basic Browser object can act in four different ways: as a complete browser, as member of a HTML frameset, as a popup window and as the desktop window. All of which can be used in every possible combination.

    November 3
    All resource strings used by the XmHTML Widget Library are now placed in a separate header file called HTMLStrings.h.

    November 2
    Added a XmBalloon widget to the library. This is a simple "tooltip" widget that can be popped up to display a small string. The string can be displayed in a rectangle or an oval (the latter is achieved using the Shape extension). example_2.c contains a possible usage: whenever an anchor is entered that contains the title attribute, this tooltip is popped up.

    October 31
    Modified example_4 so it now also compiles and runs with X11R5 (or earlier)

    October 28
    CDE and Solaris related Imakefile fixes and a workaround for a possible bug in SparcWorks cpp.

    October 26
    Bugfix: the widget's size wasn't always correctly set at creation time.
    Modified XmHTML's translation table: anchor selection/document scrolling now works with any key combinations but Shift, Meta and Ctrl. The previous table masked of all modifiers, making the widget practically unseable if, for instance, the NumLock key was active.

    October 22
    Bugfix on vertical scrolling: any vertical scroll requests are now properly ignored when the currently loaded document doesn't have a vertical scrollbar.

    October 21
    XmHTML's form support is now complete: the XmNformCallback is now fully implemented thanks to Richard Offer!
    Richard also provided a simple HTTP/1.0 implementation. A big round of applause!

    October 11
    Released XmHTML/Beta Version 1.1.0., the first XmHTML Beta Release.

    October 10
    Last preparations for the XmHTML Beta 1.1.0 release.

    Fixed a small bug in local anchor jumping: XmNanchorVisitedUnderlineType resource wasn't properly honored.

    Removed a number of unused resource class names from the XmHTML string table (1kb of data), added the XmCAnchorUnderlineType resource class and corresponding converter and added a warning message to the parser (in some cases it forgot to complain about closing elements without an opening counterpart).

    October 9
    Added a "fast" mode to the parser which entirely bypasses the document verification and repair routines (as if it wasn't fast enough already :-) If you are absolute sure that a document is fully compliant with the HTML3.2 standard, and all elements for which termination is optional have a terminator, setting the value of the XmNmimeType resource to text/html-perfect will select the fast parser.

    October 8
    Finally fixed a very annoying bug: when the widget is created, the height wasn't always computed correctly, leading to incorrect screen updates when scrolling (small gaps appeared). The only way to get around this bug was to resize the widget. It turned out that the core class height gets modified sometime after the Widget's Initialize method has been called, but before it is being mapped to screen. What causes this is a mystery to me.

    Final preparations for the first official Beta release, 1.1.0: added a collection of manual pages that describe each and every convenience function offered by XmHTML and updated the (hugely out of data) widget description.

    October 7
    Dithering to a fixed palette is now fully possible. There are four different methods available (closest match without error correction, ordered with and without error correction and closest match with error correction). You can specify a palette using the XmNimagePalette resource or let XmHTML create one for you.

    October 6
    Working on implementing support for the XmNimageMapToPalette and XmNimagePalette resources, which allow you to define a palette for XmHTML to use. Besides the obvious advantages this can offer, another advantage is a rather large speedup when switching pages: since a palette contains a fixed number of colors, XmHTML can allocate all colors on startup and doesn't have to free them until it is destroyed. This obliterates the need to release allocated colors each time a new page is loaded.

    October 3
    Replaced the current quantizer with a compacter and faster one. Previously XmHTML carried two quantizers: one for global use and one specifically for PNG images.

    Fixed a bug in the colormap reading code of GIF images.

    October 2
    Fixed a small bug in form handling: optionmenu's didn't get reset when the reset button was pressed.

    September 28
    Added support for Fast Loadable Graphics. This is a format especially designed for XmHTML and optimized for very fast loading of images. The FLG format is actually nothing more than a compacted version of the XmImageInfo structure, and as such it supports plain transparency, alpha channel and animations (with all GIF disposal methods).

    Data can be stored either compressed or uncompressed. Uncompressed FLG's are the fastest possible way to load an image into XmHTML, but they can take up a huge amount of space. A funny thing I noticed though is that, quite often, an uncompressed FLG takes up less space than the same image saved as a GIF image...

    Animation support: the global colormap of an animation is now only allocated once for the entire animation instead of being allocated for each frame separatly. This has two significant advantages: memory usage is reduced and less time is spent in allocating colors. XmHTML will now also use the global colormap if the local colormap of an animation frame is equal to the global colormap.

    September 26
    Some changes to reduce memory usage:

    • Changed the type of the color component fields of the XmImageInfo structure from signed int to unsigned short (can save up to 1.5kb per image). Modified all internal color allocation routines as well;
    • the size of the clipmasks is now computed correctly: storage occupied by clipmask data has been reduced by a factor 8;
    • alpha channel processing of PNG images been modified to use a colormap instead of full RGBA quartets: the 24bit RGB data is converted to an 8bit paletted image and the alpha channel is stored separatly. This reduces the memory occupied by these images with at least a factor two;

    September 22
    A lot of improvements in the font allocation/caching routines:

    • a separate font cache for each display is now maintained. The previous scheme didn't look at which display it was running while the font cache was shared between every XmHTML instance. Displaying multiple instances of a XmHTML widget on different displays should now be possible;
    • made the font caching scheme a lot more efficient and removed the limit on the maximum number of loadable fonts (it now uses a binary tree lookup instead of a lineair search through a table with fixed size;
    • fonts are now freed when the widget is destroyed (that is, the actual font data is only freed if the widget being destroyed is the last widget using a display-bound font cache);
    • modified the internal data structures so font properties are now stored with each font instead of calculating them each time the layout needs to be recalculated;

    One very major performance enhancement is the introduction of a smart font mapping scheme which maps unknown font names to known ones. I am particularly pleased with this scheme, it allows XmHTML to map fonts it does not know in the beginning to known ones later one. Assuming the helvetica font is present in your font path and arial isn't, the following happens: when XmHTML encounters a <FONT FACE="Arial"> tag, it will not know to which font it should be mapped and it will use the default font (whatever that is). However, when at a later stage a <FONT FACE="Arial,Helvetica"> is encountered, XmHTML will see that this Arial font can be mapped to the Helvetica font (which it does known), and as a result, any future reference to the Arial font will be mapped to the Helvetica font. XmHTML is smart enough to take any combination of weight, slant and size into account when making these decisions.

    Performance tests with the new font caching and mapping schemes show some very satisfactory results: the cache hit ratio is steadily increasing, approaching 90 or more percent after about 10 documents with different fonts have been loaded. The average number of search actions seems to remain steady around 7 in this case. The font cache contained 55 fonts (including 10 font mappings) in various families, sizes and styles.

    As a side note: this new ``font technology'' allows users to define their own font mapping by providing a document with a list of simple font mappings. Click this link for a sample document.

    Before I forget: I made the builtin cursor allocation display-independant as well.

    September 21
    First success at flowing text around images with the ALIGN="LEFT" or ALIGN="RIGHT" attribute set.

    September 20
    Small parser bugfix: mime type of a new document wasn't properly saved.

    Added a ``View Document Source'' menu item to example_2 and fixed a bug in jumping to locations in different files.

    September 18
    Fixed a few important bugs:
    • imagemap list wasn't properly reset when a document was reformatted. Could lead to a SIGSEGV in some cases;
    • list of anchor data wasn't properly reset in some cases;

    XmHTML now properly honors the XmNstringDirection resource: when set to XmSTRING_DIRECTION_R_TO_L, text is properly inversed. Paragraphs contents are ordered from bottom to top. Needs a bit more work though: list markers are always left-aligned at the first line of a paragraph instead of right aligned at the bottom.

    Modified the linebreaking algorithm to handle line/paragraph breaks properly when the paragraphs contain non-text objects (HTML form components and images).

    Table support: changed the text layout algorithms to work independantly of XmHTML's dimensions. They now use a (dynamically adjustable) bounding box.

    September 16
    When the title of a document is requested, leading and trailing spaces are now removed.
    Added the HeadDocType mask bit to XmHTMLGetHeadAttributes() convenience function. When set, the value of the <!DOCTYPE> tag will be returned.

    Improved path resolution and mime detection routines in example_2.c

    September 10-12
    Some prelimenary work on XmHTMLTextGetFormatted()

    September 4
    Fixed a few important memory leaks. One of those caused the stored anchor data never to be freed.

    Reverted a few bad fixes.

    September 1
    XmHTMLTextSetString fix, text was always rendered twice.

    Moved all resources into a stringtable. This actually seems to introduce a rather noticable speedup in document loading. Haven't got the slightest clue why this happens.

    August 29-31
    Numerous bugfixes & memory leak fixups. A grand applause to Ricky Ralston for having the courage to run XmHTML through purify. Thanks Ricky!!

    Started with daily snapshot distribution.

    August 28
    Released XmHTML/Alpha Version 1.0.21., last Alpha release. The next release will be the first publically available Beta.

    August 26
    Rewrote and extended <PRE> support greatly. Plain text, form components and images can now be mixed freely.

    Some minor changes in anchor rendering: anchors are now only extended to the right when there is room for it, they no longer cover adjacent text when activated. Fixed highlighting of transparent anchored images.

    Added the XmNimageRGBConversion resource which allows one to select the conversion method XmHTML should use when converting 24bit to 8bit images.

    Some minor fixes in the SetValues method: XmHTML now only triggers a redisplay if a resource change requires it.

    August 25
    Changed the proto's for XmHTMLImageReplace() and XmHTMLImageUpdate() : they now return a status indicating whether or not the document needs a recomputation of document layout if an image is replaced or updated.

    Fixed a bug in the default image processing: when images were delayed, the delayed icon wouldn't show up. I forgot to properly propagate the image dimensions.

    August 21, evening
    Fully restored PNG alpha channeling support, there was a silly bug in doing the 24 to 8 bit conversion. Alpha channeling is now also supported for delayed images and any combination of background setting, set either via the loaded document or the SetValues method. See XmHTML PNG Demo for some screenshots.

    Transparent background images are now also supported.

    August 21, morning
    Fixed a bug in delayed image loading that caused a fatal crash when the delayed image was freed.

    Progressive and normal image loading now share the same XImage creation and update routines. Also fixed clipmask creation for progressively loaded images.

    Rewrote most part of the handling of PNG images with an alpha channel.

    Several bugfixes and changes to example_2 and it's caching routines.

    August 20
    HTML form support: vertical scrolling of a document with a HTML form in it should now be correct whether or not a horizontal scrollbar is present. Also fixed a bug in the SetValues method which caused XmHTML to ignore the already present form widgets.

    Modified the debug routines, output can now be sent to a file.

    Eliminated some dead/duplicate code in the painter and widget methods.

    August 19
    HTML form support:
    • The traversal stuff for tabbing between all HTML form components almost works. Still need to figure out the proper XmTextField translations so the tab key can be used instead of the enter key;
    • added support for the HTML <TEXTAREA> form component and got form resetting working. HTML form support is nearly completed: only submit is still missing;
    • scrollbars are no longer covered by the form widgets when the document is scrolled.

    Some code cleanup in the document formatter.

    Experimented with the BaseClass stuff. Gave up on it after half a day or so, implementing it would require a totally different approach and a lot of information on Motif's BaseClass. XmHTML is very much an Intrinsics widget with some added Motif value, and I would keep to like it that way, at least for a while.

    August 18
    Small performance increase: XmHTML now uses Manager's GC's (XmHTML is a subclass of Manager) to paint the anchorbuttons and horizontal rules instead of using it's own GC (and switching colors all the time).

    Changed the XmNanchorHighlightOnArm resource to the standard XmNhighlightOnEnter resource. The highlight color is now computed dynamically depending on the current background color, which makes a lot more sense than having a fixed highlight color.

    Modified the anchor highlighting stuff when anchors are displayed as buttons: with highlighting enabled they now really resemble pushbuttons.

    Extended the supported HTML extensions to now also recognize a color attribute on the <P>, <DIV> and <CENTER> tags. The color attribute is now also supported for <HR> with the noshade attribute set, so you can now have colored lines in your document.

    Progressively loaded images can be scaled on the fly (and as a side effect it resolved a fatal bug in the plc code).

    August 16-17
    Took two days off, needed some rest drastically...

    August 15
    Changing any font resource should now work properly. There was a bug in the font cache and the SetValues method which prevented XmHTML from properly honoring this change. Most of the time XmHTML choose to ignore any changes to the font resources altogether...

    Fixed a very nasty bug which occured with the SetValues/XmNdocumentCallback combination: setting any formatting resource from within the XmNdocumentCallback would sometimes lead to a document being loaded twice, but mostly it just caused a sigsegv.

    SetValues fix: changing the XmNimageEnable, XmNenableBodyImages and XmNbodyImage resources should work properly.

    August 14
    Added the XmNanchorHighlightOnArm resource. Enabling this resource provides a constant visual feedback as each anchor the user moves his/hers mouse over will receive highlighting. The XmNarmColor resource allows one to set the color to use for this anchor highlighting.

    August 10-13
    Lots of bugfixes in the progressive image loading routines. They finally seem to behave in an orderly manner.

    Rather large performance increase in color allocation on PseudoColor and StaticColor displays. XmHTML now uses a hashtable instead of querying the X server.

    Test with dynamically changing of resource setting revealed a couple of bugs in the SetValues method. One of those bugs caused XmHTML to overlook internally cached images.

    August 6
    Setting XmNscrollBarDisplayPolicy to XmSTATIC will now also force a horizontal scrollbar to appear.

    Modified the parser so it will now properly remove the contents of the <SCRIPT> and <STYLE> tags when these tags aren't placed in the <HEAD> tag (which is the only place where they may occur).

    August 5
    Added the XmNenableColorSwitching and XmNenableFontSwitching resources. XmNenableColorSwitching allows one to disable support for the color tag while XmNenableFontSwitching allows one to disable support for the <FONT> element.

    Added an options menu to example_2.

    August 4
    Fixed a parser bug: elements with an optional closure are now being flushed when they prevent a new element from becoming legal. Previously the new element was discarded, which sometimes lead to bad results (pointed out by Danny Backx).

    August 3
    Added an additional pass to the font loading algorithm to search for a font when it can't be found with the current value of the XmNcharset resource.

    Modified the PLC routines to share a single GC for every image that is being loaded.

    July 18-August 2
    Took a much needed holiday.

    July 17
    Released XmHTML/Alpha Version 1.0.20.

    July 15
    Fixed a few bugs in font loading:

    • font changes after a <FONT FACE="SomeTypeFace"> used the document font instead of the new font;
    • successive font changes did not always yield the proper result;
    • incrementing/decrementing the size of a font did not always yield the correct result.

    Text enclosed in a paragraph (<P>...</P> or <DIV>...</DIV>) now also gets a trailing linefeed.

    July 13,14
    Made a start at making XmHTML's image support self-sustaining for various reasons:

    1. allows implementation of a primary and secondary image cache. A primary image cache could for example contain the real image data XmHTML uses internally (pixmaps and thelike) and have a short-time lifespan, while the secondary image cache could contain the XmImageInfo structures required for creating XmHTML's internal images and have a long lifespan.
      This would gain a huge performance increase in switching between documents.
    2. makes it a lot easier for other people to add image capability to their own applications without needing to use XmHTML;
    3. and last but not least, it would make the core of XmHTML a lot lighter.

    Form image buttons work correctly.

    July 11
    Fixed a baseline adjustment bug for image objects.
    Fixed a GIF animation bug with dispose by background disposal method.

    Modified the parser so it is now able to backtrack when unbalanced HTML tags are encountered.

    Fixed progressive image loading to work with buffers as small as one byte. Progressively loading XBM images now works correctly.

    July 9
    More work on forms:

    • fixed XmFontList problems (text on form widgets is now rendered using the default font);
    • added support for <SELECT> form components;
    • form widgets now use the background and foreground colors specified in the document itself.
    • removed highlight rectangle.

    Fixed a memory leak: when freeing anchor data, the value of named anchors wasn't freed properly.

    July 4
    I've found the wonderfull XtInsertEventHandler function! This finally got me to get form scrolling correctly working: I can now simply choose to ignore all exposure events generated all over the place when the form components are being scrolled!

    Fixed a bug in baseline adjustment for form components.

    July 3
    Made a few changes in the text outlining routines, should look a lot better now (the words on a line are distributed more evenly).

    Detected and fixed a number of bugs:

    • lines with different words on them (font, fontstyle, image object, form components and anchors) didn't always get the baseline correct;
    • lineheight of images wasn't always computed correctly;
    • before updating the background image a check is done if the background gc is really present and that the background image isn't delayed or being loaded.

    The background image and X11 Bitmaps can now also be loaded progressively.

    July 2
    Fixed a number of bugs in the progressive JPEG loader that showed up when experimenting with PLC buffer resizing.

    All PLC routines are finally fully reentrant.

    July 1
    The buffers used by the progressive image loader can now be resized by an application.

    GIF images can now also be loaded progressively by using an external GIF decoder installed on the XmNdecodeGIFProc resource. Introduced the XmHTMLGIFStream object which is now the sole argument to any function attached to this resource.

    Modified progressive decoding of GIF images when using the internal GIF decoder to wait until all compressed raster data has been received; progressive decoding of a GIF image by the internal GIF decoder is impossible due to the forking of uncompress(1) (a well, it's not impossible but terribly slow).

    Added a new resource, XmNprogressivePerfectColors, which allows one to instruct XmHTML when and if a final color quantization pass should be performed once a progressive image has been loaded. I've made this into an option instead of doing it always as this is a rather time-consuming operation. Possible values are Never, Always or Automatic (let XmHTML decide when a quality increase can be expected).

    June 26
    Fixed simultaneous updating of multiple copies of the same, progressively loaded, image in the current document.

    Modified XmHTMLXYToInfo() to ignore images that are currently being loaded progressively: most of the XmImageInfo fields returned have a very limited lifespan (a few or so polling intervals) during image load.

    June 25
    Progressive JPEG images that are loaded progressively are now also displayed properly: each pass adds additional detail. XmHTML now requires libjpeg version 6 or above for full jpeg support.

    Added a final color quantization pass in progressive JPEG support (first passes are dithered against a fixed palette, the final pass will do Floyd-Steinberg using a histogram of the image itself).

    Added three convenience functions to suspend, continue and kill progressive image loading.

    Fixed a serious bug in the main plc engine which caused a total server (and system) lock when any mouse button was activated on the display area.

    June 20
    Baseline JPEG images can now also be loaded progressively.

    June 19
    Fixed a bug for transparent frames in animated gifs with dispose by background disposal method; clipmask was used incorrectly when restoring to background.

    June 18
    Interlaced GIF & GZF images are loaded properly now.

    June 17
    First success at progressive image loading!!

    June 16
    Modified XmHTMLAllocColor and XmHTMLFreeColor (two non-XmHTML supporting routines) so they no longer interfere with XmHTML's private color allocation.

    Fixed a bug in the color matching algorithm, RGB values were shifted out of range, causing colors to be mapped to the wrong color or even worse (to black).

    June 15
    All PLC interfacing routines written. Image PLC interfacing routines written and verified. First tests show the scheme is working better than expected.

    June 14
    Most top-level PLC routines written. Image PLC routines nearly finished, GIF and GZF progressive image decoders written.

    June 11
    Rewrote the color allocation routines: profiling showed that XmHTML's old color allocation scheme spends quite a lot of time allocating its colors. The new scheme is nearly 30% faster.

    June 10
    Started on progressive image loading: Progressive Loading Context (PLC) object written. Object-specific structures written. Started splitting the image loading routines so they can be used for progressive image loading.

    June 9
    Wrote a very feasible progressive object loading concept. The implementation will use a ringbuffer with object-specific function pointers, visited by XmHTML using a variable polling interval. The concept allows for an easy implementation of progressive document loading as well.

    June 5
    Alpha channel PNG images are now created when they are needed by the painter. The reason behind this is that when XmHTML is resized horizontally, the position of the image changes with respect to the current background setting, making a redo of alpha channel processing necessary. It works but causes a very undesirable delay. Seems like progressive image loading is becoming a real necessity...

    June 3
    PNG support: XmHTML now supports the following features as set forth in the decoder requirements specified in the W3C Official PNG Recommendation:

    • Gamma correction;
    • all color types and bit depths;
    • full tRNS chunk support;
    • full alpha channel support;
    • bKGD chunk support;

    The tRNS and alpha channel support both work with a fixed background color as well as composing against a background image. As you can see, everything except progressive image loading is now supported. Thanks to Greg Roelofs for the quite usefull PNG Home Page, usefull tips and adding XmHTML to the PNG Supporting Applications page.

    Also upgraded the PNG code to comply with libpng version 0.96.

    June 2
    Finally fixed a transparency bug on animations with a disposal method of none while the first frame contains transparency. This bug has been around since Alpha 1.0.16 or so.

    June 1
    Fixed a bug in image scaling: scaling the clipmask data of transparent images directly was wrong so I now simply recreate the clipmask data out of the scaled image data (which also gains us a small performance increase).

    May 31
    More work on PNG image support: background substitution and RGB images. Alpha channel support and transparency support is partially in.

    Added the XmNscreenGamma resource to fully exploit the gamma correction capabilities of both PNG and JPEG images.

    Released XmHTML/Alpha Version 1.0.19.

    May 29
    Fixed a few more bugs in the parser: the rules for definition lists were not entirely correct. Added a check on invalid nesting of HTML markup elements.

    May 27
    Added a check on the scrollbar dimensions when they are specified using application defaults or in a resource file. Subsequently added a section on specifying XmHTML's dimensions in the same way in the Programmers guide.

    More work on the XmHTML Programmers Guide.

    May 26
    Bugfix 05/26/97-01, a nasty bug which caused XmHTML to crash every so often in the most strangest ways. It turned out to be a stupid typo...

    Rewrote the caching routines in example_2 to be more generic and robust.

    May 23
    Fixed the parser to recognize the contents of the <SCRIPT> and <STYLE> elements. The XmHTMLGetHeadAttributes convenience function now also fills the appropriate fields of the XmHTMLHeadAttributes structure.

    May 22
    Fixed a nasty bug in XmImageFreeImageInfo when it was called by application code. As a result of this the function call itself now takes two arguments: the widget id of a XmHTMLWidget and a pointer to the XmImageInfo structure that is to be released.

    Fixed a bug in comment parsing: single dashes appearing in a HTML comment are now properly ignored.

    Added the XmHTMLAllocColor convenience routine which can be used for easy color allocation using the colormap installed on a given XmHTMLWidget.

    May 18
    Added the XmImageConfig structure for use with XmHTML's external image support. This structure allows one to configure the behaviour of the XmImageCreate... routines and contains various flags to set (amongst others) an external gif decoder, create a clipmask, perform background substitution, color quantization and frame selection on gif animations.

    May 16
    Added support for the XmNmaxImageColors resource: when an image contains more colors than allowed, it will be quantized (and possibly dithered using the Floyd-Steinberg algorithm) to match the maximum number of allowed colors.

    May 15
    Added the XmHTMLGIFtoGZF convenience routine: this routine converts a gif image to a compatible image format in which the LZW compressed raster data has been replaced with deflate compressed raster data. This function can be used by application programmers that want to keep the slowdown caused by XmHTML's gif workaround to an absolute minimum by converting a GIF image to a GZF image and subsequently using the GZF image whenever a corresponding GIF image is to be loaded. The GZF image format is a compatible GIF format, in which only the raster data is compressed in a different format.

    GZF images can be somewhere between 5 and 60%(!) smaller than the original GIF image and it loads considerably faster.

    May 13
    After two weeks of negotiating with Unisys to obtain a license for the use of their patented LZW algorithm for decoding the LZW compressed raster data as found in GIF images, I was utterly frustrated by their absolutely mindboggling attitude towards the use of the LZW algorithm for decoding gif images. I was even more frustrated by the ridiculous restrictions an LZW license would place on the distribution of XmHTML (for instance: a splash screen would be mandatory for every application using XmHTML and I would not be allowed to distribute the LZW decoder to people that don't have an LZW license, even if I have a valid LZW license).

    Instead of removing support for gif images, I decided to replace the built-in LZW decoder with a workaround that translates the LZW compressed raster data to the format used by compress(1), after which XmHTML calls uncompress to perform the actual decoding of the compressed raster data. This workaround causes (surprisingly) a hardly noticable slowdown for single-image and small gif animations. Decoding large animations however takes a bit more time now.

    For those that want to take the risk of violating Unisys's patent policy (or those that have a valid LZW license), the XmNdecodeGIFProc resource has been added. One can use this resource to install an alternate gif decoding procedure and thus surpass XmHTML's workaround.

    May 2
    Released XmHTML/Alpha Version 1.0.18.

    April 30
    XmHTML will now always use any colormap provided for it (thru Core's XmNcolormap resource) instead of using the default colormap. It will also walk the widget tree to find a Shell (or a subclass of Shell) and use the visual provided for that Shell. XmHTML will only use the default visual if no Shell parent can be found. All of this also works for the XmImage type.

    Modified the HTML comment detection routine in the parser so nested and bad HTML comments (dashes don't occur in a multiple of four) are properly dealt with.

    April 28
    Setting the XmNfreezeAnimations resource to True will now restart animations when they were previously frozen.
    Added an additional IMAGE_GIFANIMLOOP type to XmHTMLImageGetType() when the image is an animated gif with the NETSCAPE2.0 loop extension.

    Bugfixes:

    • truly inlined images are now repainted correctly when they are scrolled;
    • animations serving as anchors have their borders painted correctly;
    • all images serving as anchors should now appear properly centered in the anchor bounding box;
    • changing document resources without setting a new text will no longer reload images;

    April 27
    Still busy rewriting the documentation: programming manuals for both XmHTML and XmHTMLParser. The XmHTML manual is halfway now.

    Fixed a lot of minor bugs that I discovered when writing example code for the XmHTML programming manual:

    • XmNresizeWidth and XmNresizeHeight now work properly;
    • setting and getting the XmNtopLine resource works;
    • a few performance enhancements on document scrolling;
    • horizontal scrollbar should now be present when the width of preformatted text or images is somewhere between the widget width minus the margin width;
    • fixed a bug in the paint engine: height of text blocks was computed incorrectly;
    • fixed another bug in the paint engine: linenumbers on preformatted text wasn't set at all;
    • XmHTML's testbed crashes less frequently: both document and image cache are a lot smarter now
    • also on XmHTML's testbed: added code to show possible use for XmNlinkCallback callback resource and XmHTMLXYToInfo (new convenience routine);
    • added the XmImageCreateFromInfo routine which creates a standalone XmImage from the data in a given (XmHTML's) XmImageInfo structure.
    • XmHTMLParserObject example now contains both normal and progressive parsing modes. Added a HTML preview.

    April 20
    Reverted integration of the htmlParserObjectClass. Too many problems and too many overhead involved.
    Made a start with writing programming manuals for both XmHTML and HTMLParserObject.

    Pretty cool news: added the XmImage type which allows using XmHTML's image reading capability to be used by other programs as well.

    April 15
    Moved XmHTML's parser into a seperate widget subclassed from Object. A standalone parser can now be created and configured using the standard X functions. Class pointer of this parser is htmlParserObjectClass.
    The standalone parser is an Intrinsic widget which can be used without Motif.

    Replaced XmHTML built-in parser with this HTMLParserObject (with surprisingly few modifications to XmHTML's interface).

    April 10
    A lot of enhancements to the parser: one can now create and use a standalone HTML parser for a number of purposes. Features include:
    • Progressive (or incremental as you will) parser;
    • aliasing of unknown HTML elements to known ones;
    • a XmNmodifyVerifyCallback;
    • extended XmHTMLParserCallbackStruct to include description of offending and proposed repair elements;
    • multiple passes to increase HTML conformance;
    • dynamic updating of the current source;
    • wrapped all of the above (and more) in a new collective example which demonstrates how to use the XmHTMLParser object for interactive document checking and repair.

    Modified the document verification/repair routines to use better defaults.

    April 6
    Released XmHTML/Alpha Version 1.0.17.

    April 3
    Fixed a problem with scrollbars when XmHTMLRedisplay was called: document length wasn't updated properly.

    Fixed two problems related to documents with a body image: images serving as anchors should no longer disappear when scrolling and regular anchors (XmNanchorButtons == False) should now be rendered transparantly.

    Anchors with mixed fonts are now rendered as a single anchor instead of separate blocks. Mixing images and text in an anchor doesn't work well.

    Underlining and/or striking out of words with mixed fonts is now treated properly.

    Released XmHTML/Alpha Version 1.0.16.

    April 2
    Delayed image loading now also works for the background image.
    Added the XmHTMLFrameGetChild convenience function.
    Fixed the SetValues method for enabling/disabling body colors and body images: the effect should be visible immediatly.

    April 1
    Fixed a problem related to color freeing with StaticGray, GrayScale, DirectColor and TrueColor visuals (colors got freed more than once for these types of visuals). Color freeing should no longer cause X Protocol Errors.

    Fixed a number of things pointed out by Dick Porter:

    • a robuster method for body color allocation;
    • internal images no longer get freed by calling XmHTMLImageFreeImageInfo;
    • corrected layout recomputation when images are updated: XmHTML now uses the new image dimensions instead of the old ones;
    • images of which the dimensions have been specified in a HTML document are now painted immediatly when replacing or updating them instead of just being removed;
    • fixed image transparency problems: XmHTMLImageDefaultProc now always creates a clipmask. Previously, a clipmask was only created if a document contained a background image.

    Animations are now explicitly excluded as a background image. Image scaling now also works properly for delayed images. Finally fixed transparency for the default images.

    March 28
    Released XmHTML/Alpha Version 1.0.15.

    March 27
    The parser now calls the XmNparserCallback resource when installed. Added a new action field to the XmHTMLParserCallbackStruct which allows a user to select certain actions when a fault in a document is encountered. Warning messages caused by the document verification/repair routines are no longer displayed on screen but propagated to the XmNparserCallback instead.

    Fixed a small bug in the text layout routines: text and images are now only centered or adjust to the right margin if their width doesn't exceed the available screen width.

    The scrolling attribute on frames is now properly handled.

    All action routines are now implemented and fully functional.

    March 26
    Frames are in. Not perfect yet but it certainly works! Fixed a few bugs that caused XmHTML to crash when the widget's Destroy method was called. Added the XmNframeCallback resource and XmHTMLFrameCallbackStruct callback structure.

    Fixed a small bug in horizontal scrolling, text should no longer flow onto itself when there isn't a vertical scrollbar present. Fixed a small bug in refreshment if image anchors, images serving as an anchor should now always be selectable.

    March 25
    Bugfix in JPEG loading.
    XmHTML now makes proper use of the core offsets: a XmHTML widget can now be a child of any Motif manager widget at any position.

    March 24
    Released XmHTML/Alpha Version 1.0.14.

    March 23
    Fixed a buffer overrun when converting preformatted text to a series of words.

    Added the XmNmimeType resource: allows XmHTML to be used for documents of which the content-type isn't text/html. Mime types recognized by XmHTML are text/html, text/plain and a number of image mime type specifications.

    March 21
    XmHTML recognizes character escape sequences without a trailing ;. Character escape sequences in the alternate image description are now also expanded.

    More improvements on document verification and repair: really bad HTML documents (numerous and consecutive misplaced elements) are now repaired in such a way that display is possible.

    Animation support: the first frame of an animation now also uses the requested disposal method.

    March 20
    Completely rewrote the HTML parser: document verification and auto-repair of poorly formatted HTML documents has been added. Especially the latter is fairly powerfull. Features include detection and repair of overlapping elements, omitted list start tags and improperly nested font switches. It also includes auto-addition of terminators on elements for which a terminator is optional (dd, dt, li, p, option, td, th and tr). XmHTML can now also handle documents without the required <HTML> and optional <BODY> tags.

    More work on the mixed text/image layout: vertical alignment attributes on images are now properly recognized and dealt with.
    Released XmHTML/Alpha Version 1.0.13.

    March 14
    Again more work on animation frame disposal: both disposal methods (by background and by previous) now work with any background color or image. Animation support is almost fully completed, the only thing missing is the ability to immediatly restore composite animations that are scrolled off and back on screen.

    Added a workaround for incomplete screen updates when scrolling full screen: the XmNrepeatDelay resource now determines the minimum time a key must remain pressed before scrolling continues.
    Text colors are now also properly freed (and fixed a serious bug as well).
    Also some work on example_2: added a global image cache and a per-document history stack.
    Added the XmHTMLImageFreeImageInfo convenience function.

    And last but not least, added PNG image support to the XmHTMLImageDefaultProc convenience function.

    March 13
    More work on animation support: all frame disposal methods are now supported.

    And a lot of bugfixes:
    Font stack is now properly reset when a new document is loaded; named anchors are now rendered in the current text color instead of XmNanchorVisitedForeground; no more color flashing when switching between documents that make heavy use of color-rich images; Images wider than the available screen width are no longer moved downwards; delayed images are now displayed in the correct dimensions when they are flushed to XmHTML and transparent XPM images are now truly transparent.

    March 12
    Colors allocated for images are now properly released when the images are freed.
    Fixed X11 bitmaps. Updated all documentation.

    March 24
    Released XmHTML/Alpha Version 1.0.12 (documentation update).

    March 11

    XmHTML now supports Gif89a animated gifs (Netscape Loop Extensions as well as multi-image Gif89a files). Scrolling composite animations currently doesn't work as it should. Added the XmNfreezeAnimations resource.
    Replaced the XmNimageDefaultProc resource by the XmHTMLImageDefaultProc convenience function.
    All image reading routines now use a memory buffer instead of reading directly from a file. Text layout now considers text and images as the same object.
    XmHTML now properly renders any alternate text if images are disabled. Modified the XmImageInfo structure again and renamed most of the convenience functions to more logical names.

    Released XmHTML/Alpha Version 1.0.11.

    March 5
    XmHTML Developers mailing list is up and running, with 51 subscribers from the first day.

    Many thanks to Brian Dowling and Simplicity Communications for offering me this valuable service. Thanks Brian!

    Released XmHTML/Alpha Version 1.0.10.

    March 4
    Fixed a spacing bug in the text layout routines which caused words that shouldn't be glued together got glued together anyway. Added the animation support.

    March 3
    Added polygon and default shape imagemap support. Delayed Image Loading: XmImageInfo structure updated and three new convenience functions added: XmHTMLUpdateImage, XmHTMLReplaceImage and XmHTMLRedisplay.

    February 28
    A number of changes in the text-layout routines: words should now be glued together properly. Text colors are now preserved accross anchors.

    Released XmHTML/Alpha Version 1.0.8.

    February 27
    More work on Imagemaps: support for external client-side imagemaps has been added but not tested (yet). Added the XmHTMLAddImagemap convenience routine. Added default images which are displayed when the XmNimageEnable resource is set to False or when an unsupported imagetype is encountered. Changed the XmHTMLAnchorCallbackStruct, please be aware of this!

    February 26
    Added client-side imagemaps; rectangular and circle shaped area types work well. Empty as well as combined anchors (both name and href in a single anchor) are now supported. Added the XmNimagemapCallback resource and corresponding callback structure.
    Fixed a small parser bug which sometimes (only seen it once really) caused wrong text alignment. A lot of small bugfixes in anchor creation and selection. Removed the extra field in XmHTMLanchorCallbackStruct and added three new fields instead.

    February 25
    Modified color allocation to get an exact, close or substituted color. This produces *very* nice results. The background attribute on the body tag is properly honored, scrolling with an image as background is very smooth. Images can now also serve as anchors. Mixed text and image layout works but needs a bit more work.

    February 20
    Major News: image support is almost completely added and functional! The default image loading procedure supports X11 bitmaps, X11 XPM pixmaps, JPEG and GIF87a and GIF89a images, PNG is being worked on. This procedure should in theory work properly with every visual class, although only PseudoColor has been tested. Images with a width and height specification different from the real image dimensions are automatically scaled. I hacked this code in on two evenings, and I'm pretty proud of it.

    The XmImageInfo section has been updated and contains some more information on image handling. For future animated image support, a few extra members have been added to the XmImageInfo structure itself.

    I do owe John L. Cwikla a lot of gratitude for his small but very usefull XCC package!

    February 18
    Internationalization: the font loading scheme employed by XmHTML has been modified drastically and is much more robust now. Added the XmNcharset resource to allow specification of the ISO character set and changed the format of the XmNfontFamily and XmNfontFamilyFixed resources.
    (pointed out by Valery Kravchuk)

    February 13
    Added support for the face tag on the font element, e.i. <font face="Helvetica,arial"> is now recognized.

    February 11
    Released XmHTML/Alpha Version 1.0.6.

    February 10
    Fixed a number of potential buffer overruns (suggested by Dick Porter).
    Complete rewrite of the text layout routines. Interword and interline spacing is adjusted depending on the current font. Simplified the outlining and alignment adjustment routines.
    Removed a number of internally unused structure members.
    Changed anchor treatment: consumes less memory and is easier to use.
    Second alpha release shipped.

    February 6
    Fixed interword and interline spacing when different fonts are mixed on a single line: lines do no longer overlap each other and font changes in the middle of a word are properly attached.
    Indentation is now computed regardless of the current font.

    February 4
    Added code to support the BASEFONT element and updated the code that deals with the FONT element accordingly.
    All shorttag elements are now recognized and dealt with properly by the parser (empty tags, empty closing tags, unclosed tags and NULL-end tags). XmHTML passes all example pages from the Dark Side of the HTML without even as much as a single hickup. Watch your browser choke on the test pages at the above URL ;-).

    February 3
    First bug reports are seeping in: fixed a bug in font loading routines, color releasing routines and unknown anchor types.
    Updated the <li> element formatting to recognize the type and value attributes.
    Removed default identation for preformatted text.

    January 31
    Released XmHTML/Alpha Version 1.0.5, first alpha release.

    January 30
    Fixed a bug with jumping to anchors: when jumping to the end of a document, the value of the vertical scrollbar exceeded the maximum allowable value.
    Final preparations for the alpha release. We'll be shipping out any time now.

    January 29
    Reworked some of the anchor parsing/handling routines: anchor activation and anchor tracking callbacks are a little bit more efficient now.
    XmHTML is now able to determine the type of URL referenced by an anchor: added the url_type field to the XmHTMLAnchorCallbackStruct.
    Updated exposure handling after tests with Motif 1.2.0/X11R5.

    Preparations for the alpha release: cleaned up the source and wrote a few examples demonstrating the use of XmHTML.

    January 28
    A lot of memory leaks have been fixed. Switching between documents with/without a <body> color specification seems to be working.

    January 27
    Fixed a serious bug with preformatted text: multiple newlines weren't recognized properly and thus were rendered wrong.

    January 26
    Added a SubstructureNotifyMask so we get notified when the widget is mapped on the screen for the first time. Text is now displayed properly if text is set directly on XtCreateWidget. This fixed a serious bug in SetValues which caused a BadWindow error when setting text on the widget before XtRealizeWidget was called.

    January 25
    Nested aligment is now recognized properly.
    Changed the font routines to use a pointsize specification as mentioned in the documentation. Previously pixel size was used.
    Linespacing for text with a font other than the default font is now correct.

    Public request for XmHTML alpha testers posted on comp.windows.x.motif, comp.windows.x and comp.windows.x.apps

    January 24
    Screen redrawing finally done: only the exposed regions are now redrawn instead of the entire line of which the exposed region was part.
    Preformatted text now also draws anchors correctly.

    January 23
    More work on horizontal scrolling: when scrolling to the left, text drawn previously in the margin is now properly erased. Horizontal redrawing to the right now takes the starting x position of the exposed region into account, instead of repainting the entire screen.
    Preformatted text is now painted properly.

    January 20
    Enhanced the parser to insert closing elements on elements where they are optional (<P>, <LI>, <DT> and <DD>).
    Finally got round to implementing preformatted text.

    January 19
    Scrolling: the widget now remembers it's current vertical text position when it is resized.
    Removed left and right quotes from the list of punctuation characters.

    January 17
    Added the <TAB> element extension.
    Fixed a number of memory leaks reported by dmalloc.
    Fixed a bug in the parser which made it impossible to correctly detect elements with trailing spaces inside them.

    January 16
    Text outlining: bugfixes and few performance enhancements.
    Added the <COLOR> tag extension.

    January 13
    Removed the XmHTMLCallbackStruct and replaced it with callback-specific callback structures: XmHTMLAnchorCallbackStruct, XmHTMLFormCallbackStruct, XmHTMLLinkCallbackStruct and XmHTMLParserCallbackStruct.
    Added jumping to local anchors when a local anchor is pressed.
    Added the XmNanchorVisitedProc resource.
    More work on vertical scrolling.
    XmHTML can now handle named anchors by itself (but it can be vetoed by the programmer).
    Added the following convenience functions: XmHTMLGetAnchorId, XmHTMLScrollToAnchorById, XmHTMLScrollToAnchorByName, XmHTMLScrollToLine.
    Enhanced HTML comment detection in the raw HTML parser.

    January 12
    Accelerated screen update when scrolling vertically. Horizontal scrolling needs a bit more work.
    Nested lists are now rendered as they should: mixing ordered and unordered lists works.
    Added the XmNenableOutlining resource: when enabled (default) all text of which the alignment is not explicitly set will be outlined.
    Implemented the color tag for all elements mentioned in the extensions.

    January 10
    Horizontal scrolling works. Fixed scrollBar offsets when XmNmarginWidth/XmNmarginHeight is smaller than the width of a scrollBar. sliderSize and pageIncrement now reflect the percantage of hidden text.
    Nesting of ordered lists and unordered lists now works when they are not mixed.
    Changed the type of all positions from Position (signed short) to int. Documents larger than SHRT_MAX used to cause a wrap-around of their y-position.

    January 9
    Working on scrolling. Scrollbars are displayed according to the XmNscrollBarPlacement resource. Vertical scrolling works. Changed the linebreaking algorithm to eat multiple block elements without contents. Also a number of aesthetical changes.

    I expect to have an alpha release by the end of this month. Things that need to be implemented before a release will be made are: preformatted text, support for a few image types and nested sorted lists.

    If you want be informed when an alpha release becomes available, please send us a mail.

    January 8
    Added autosizing stuff: setting XmNresizeWidth and/or XmNresizeHeight now causes XmHTML to size itself around the document properly. Rewrote text alignment routines. Fixed a bug in the parser which caused an anchor not be recognized if the name contained the string ``name'' or ``target''.

    January 7
    Fixed text alignment for lines consisting of different text elements. Finished the text outlining algorithm: paragraphs can now be outlined properly, which gives pretty neat results.

    January 6
    Happy Newyear!

    A lot of work and thought went into the render engine. The previous method proved to be very memory- and time consuming, but did have a lot of potential. After a lot of trial and error, the final method is a mix of the original rendering engine and the state machine approach, resulting a an even more flexible (read extensible) and less memory- and time consuming.
    Changed XmNstringDirection to XmNalignment, which makes more sense. Added a description of the implemented HTML 3.2 extensions. Added the XmNparserCallback resource.

    December 19
    Changed rendering completely: a stream of paint commands is now generated whenever a document is loaded. The actual paint engine is represented by a state machine in which parts of the painting stream are poured whenever a screen update is required. This is much more flexible and faster than the previous setup, in which rendering was performed ``just in time''.
    This state machine approach also allows for an easy implementation of forthcoming extensions such as the <OBJECT> tag and HTML math. It also offers considerable advantages for a (possible) conversion of the widget to an HTML editor widget, although that would require an integration of the raw HTML parser and paint stream generator.

    December 18
    Implemented proper rendering of all attributes on horizontal rules. Linefeed checking almost working properly.
    Added the XmNinputCallback and XmNmotionTrackCallback resources and updated action routines accordingly (as suggested by Ricky Ralston). Added the track-motion and help action routines. Added the XmNworkWindow resource.

    December 17
    Rendering of anchors as buttons is now done properly and anchors wrapping around a newline are finally connected as it should: linebreaking algorithm finally working properly.
    Added an outlining algorithm for blocks of plain text (this is for a future OUTLINE attribute on the <DIV> tag). This produces some very nice results!
    Furthermore a number of cosmetic updates on rules, underlining, strikeout and anchor selection rendering. Updated the set-values method: almost all resources can now be set using XtSetValues.

    December 16
    More work on anchor selection: pressing an anchor now highlights that anchor; anchors that wrap around a newline are now redrawn correctly; anchor cursor setting/unsetting finally seems to be working satisfactory. Also added a target field to XmHTMLCallbackStruct to support the frame extension.
    XmNarmCallback implemented. <HR> rules are now painted. Numbered lists with type=i|I are now being rendered for roman numerals upto a value of 4999. Simplified list indentation.
    Corrected a few minor bugs that came up when testing multiple instances of XmHTML widgets.
    Major news: added the XmNanchorButtons resource: anchors can now be rendered as pushbuttons instead of being underlined. Needs some more work though.

    December 13
    XmHTML begins to take real shape! XmNactivateCallback and XmNanchorTrackCallback completely implemented: anchor selection fully functional now. First real XmHTML tests by using it in XntHelp, and it seems to be working quite well!
    Numbered lists with type=1|a|A are now being rendered correctly.
    Fixed a number of major memory leaks and minor small bugs in format.c and the set_values method.

    December 12
    Solid and dashed underlines as well as strikeout are being drawn correctly. List indentation finally correct. All three types of bullets in <UL> are also placed correctly.
    Punctuation characters have a special treatment now so they are attached to words where they should be attached.
    Fixed a few bugs in the font switching routines; nested fonts are rendered correctly now.
    First attempts at anchor tracking have some success, XmNanchorTrackCallback resource treatment partially finished.

    December 10
    Linebreaking algorithm works pretty okay. Horizontal alignment is now also treated correctly. Added the XmNstringDirection resource. Fixed a few bugs in format.c.

    December 9
    First success at text displaying! The paint routines now can display all sort of texts in the selected font and/or color. Added support for a future ``outline'' attribute on the <DIV> tag. The linebreaking algorithm needs a lot more work. Changed the XmNanchorTrackProc resource to a callback: XmNanchorTrackCallback (as suggested by Danny Backx).

    December 6
    ALIGN and VALIGN attributes recognized. Added a few extra attribute parsing routines. Optimized recognition for underlining, strikout and anchors: nested combinations are now treated ok. Checked and corrected a few memory leaks. Performed some robustness checks and corrected bugs detected from this testing.

    December 5
    List support added: indentation and the TYPE attribute are recognized as well as nested lists. Underline, strikeout and anchor stuff written. More work on font routines: nested font combinations are recognized and treated ok.

    Posted very first announcement on XmHTML on comp.windows.x.motif and comp.windows.x.

    December 4
    First implementation of text formatting/painting. Font loading/switching routines written.

    December 2
    Initialize now calls the HTML parser, creates the widget and anchor cursor and calls the HTML formatting routines. XmNlinkCallback installed.
    Prelimenary tests on widget creation and resource setting/changing performed succesfully.

    November 28
    First drafts of expose, layout, resize, set_values, get_values_hook, query_geometry, geometry_manager and destroy methods.

    November 26
    Enhanced the parser to allow strict checking of HTML documents against the HTML 3.2 standard. Added the XmNstrictHTMLChecking resource.

    November 22
    Changed the XmNfontSize resources to XmNfontSizeList. Added XmHTMLLinkCallback, XmNanchorTrackProc, XmNanchorTarget and XmNenableBody resources. Figured out how to use the XmRepType functions. ClassInitialize, ClassPartInitialize and Initialize methods written.

    November 21
    Public and private interfaces defined. Updated Widget interface definition.

    November 20
    XmHTML Widget resources, callbacks and action routines interface definition nearly completed (you're reading it now).

    November 19
    Made some performance enhancements to the HTML parser after testing. When compared to NCSA, our parser is almost twice as fast! (Loading and parsing a 230kb HTML file with 14126 elements takes 0.16 seconds. NCSA takes 0.30 and does not parse table elements).

    November 18
    Final HTML parser completed, performance tests started.

    November 12
    First draft of HTML parser.




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: September 1, 1998 by Koen
    XmHTML-1.1.7/html/copyrights.html100644 23564 23564 13120 6431721247 15154 0ustar newtnewt XmHTML Copyright Statement

    Copyright Notices

    XmHTML Widget Set

    Copyright © 1996-1997 Ripley Software Development

    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.

    See the GNU Library General Public License for the full distribution license.

    Portions Copyright © 1990 - 1994, David Koblas. Used by permission.
    Portions Copyright © 1994 by John Bradley. Used by permission.

    Other Applicable Copyright Notices

    The following copyrights also apply to certain portions of the XmHTML source code.

    JPEG image decoding
    Provided by use of libjpeg version 6.
    libjpeg is copyright © 1991, 1992, 1993, 1994, 1995, Thomas G. Lane, The Independent JPEG Group.

    PNG image decoding
    Provided by use of libpng version 0.90 and zlib version 1.0.4.
    libpng is Copyright © 1995, 1996, 1997 Guy Eric Schalnat, Group 42, Inc.
    zlib is Copyright © 1995-1996 Jean-loup Gailly and Mark Adler.

    GIF87a and GIF89a image decoding
    Based on gifread.c, of which the copyright notice is as follows:

    Copyright © 1990 - 1994, David Koblas. (koblas@netcom.com)
    Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.

    GIF87a and GIF89a LZW Compressed Raster Data Decoding
    The idea for decoding the LZW compressed raster data of gif images using uncompresscomes from Derek B. Noonburg <derekn@ece.cmu.edu>, the author of the excellent xpdf PDF viewing package.

    Image Quantization
    Based on ppmquant.c as found in the pbmplus package, of which the copyright notice is as follows:

    Copyright © 1989, 1991 by Jef Poskanzer.

    Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.

    It also contains the following note to the above:

    Many people get confused by this legalese, especially the part about "without fee". Does this mean you can't charge for any product that uses PBMPLUS? No. All it means is that you don't have to pay me. You can do what you want with this software. Build it into your package, steal code from it, whatever. Just be sure to let people know where it came from.

    XImage Creation
    Based on portions of xvimage.c as found in xv 3.10, an excellent image viewing program by John Bradley. Used by permission.

    XV is Copyright © 1989, 1994 by John Bradley.




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen
    XmHTML-1.1.7/html/debug.html100644 23564 23564 11332 6431721247 14052 0ustar newtnewt XmHTML Debug Resources

    XmHTML Debug Resources

    To somehow ease XmHTML development, a number of debug resources are available. These resources are only effective when XmHTML is compiled with the -DDEBUG symbol defined, although the resource names can be used at all times.

    Debug Resources

    Name Type Default Access
    XmNdisableWarnings Boolean False CSG
    XmNdebugSaveClipmasks Boolean False CSG
    XmNdebugFilePrefix String NULL CSG
    XmNdebugLevels String NULL CSG
    XmNdebugNoAnimationLoopCount Boolean False CSG

    XmNdisableWarnings
    When set to False, XmHTML will show every warning that occurs. If enabled, a lot of warnings will be generated mainly be the parser and formatting routines. This resource has no effect when _XmHTMLWarning has been called with a NULL argument for the widget.

    XmNdebugSaveClipmasks
    When set to True, each time a clipmask is created it will be saved to a file called <image-name>.<number>.xbm.

    XmNdebugFilePrefix
    This resource enables you to take a look at the internal representation of the parsed HTML file, it need not be the same as the input file. This is mainly intended for checking the parser's ability to add closing elements on <p>, <li>, <dd> and <dt>. An output file is generated for every file/text parsed. The name of the output file is the prefix appended with the number of files parsed so far, e.i., the first file will have the extension 0, the next will have 1 and so on.

    XmNdebugLevels
    This is probably the most powerfull debug resource: it enables debug output at a source-file level and allows one to examine closely what XmHTML is doing. This resource is specified as a comma separated list of numbers. Each number represents a separate source file. See the file DEBUGGING for the mapping used.
    The amount of output generated by using this resource can be enormous, so you might whish to save it to a file and examine it later.

    XmNdebugNoAnimationLoopCount
    This resource allows one to take a closer look at animations that have a limited loopcount. A loopcount is the number of times an animation should be run. Setting this resource to True, XmHTML will ignore any loopcount setting found in an animation and thus each animation will run forever.




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen
    XmHTML-1.1.7/html/extensions.html100644 23564 23564 17115 6511044101 15152 0ustar newtnewt XmHTML HTML extensions

    XmHTML HTML Extensions

    XmHTML implements the following extensions to the HTML 3.2 standard.

    The FRAMESET Extension

    XmHTML widget's fully recognize and support the <FRAMESET> extension. See the XmHTML Programmers Manual on how you can add frame support to your application by using XmHTML.

    Extensions to the <A> Element

    Support for the <FRAMESET> extension also implies that XmHTML recognizes the target attribute on the <A> element.

    Besides being usefull for the frameset extension, the target attribute can be usefull in a variety of other ways, e.i., one could use this extension in a Hypertext Help system to indicate that something should be displayed in a popup window.

    Extensions to the <FONT> Element

    XmHTML widget's fully support the FACE tag on the HTML 3.2 <FONT> element. This extension specifies the typeface of a font in which the text that this element encloses should be rendered.

    The value for this tag should be a quoted, comma seperated list of alternative typefaces.

    Extensions to the <OL> Element

    XmHTML introduces the ISINDEX tag to the HTML 3.2 <OL> element. Using this extension produces a Table of Contents by propagating the current item numbering within nested lists:
    <OL>
    	<LI>The Basics of a XmHTML Widget
    	<OL ISINDEX TYPE="a">
    		<LI>Creating a XmHTML Widget
    		<LI>The XmHTML Widget's Text
    	</OL>
    	<LI>Modifying the Document Appearance
    </OL>
    
    is rendered as:
    	1. The Basics of a XmHTML Widget
    		1.a Creating a XmHTML Widget
    		1.b The XmHTML Widget's Text
    	2. Modifying the Document Appearance
    
    This extension can be used with any combination of the TYPE and START tags.

    Extensions to the <INPUT> Element

    A XmHTML Widget fully supports the file form input element. This element is consists of a textfield with a pushbutton. When a user presses this button a file selection dialog is displayed allowing the user to select a file for uploading.

    The following attributes are recognized for this input element:

    NAME=string, VALUE=string, SRC=string, SIZE=n, MULTIPLE

    NAME
    Mandatory, name for this input field;
    VALUE
    optional, a label to be used for the pushbutton. The default value is Browse...;
    SRC
    optional, a file selection pattern to be used for the file selection dialog. The default value is *;
    SIZE
    optional, the width of the textfield. The default value is 20;
    MULTIPLE
    optional, allows multiple file selection. Each file that is selected via the file selection dialog is separated from already selected files by a colon.

    The ALIGN tag

    The ALIGN tag is extended by one additional alignment, namely JUSTIFY. This alignment will cause text to be justified between the text margins, causing each line in a paragraph to have the same left and right margin. The last line in a paragraph is never justified, it's alignment is determined by the default alignment.

    Hyphenation is not supported by this extension, but may be added in the future when a LANGUAGE tag is added to the STYLE element.

    This extension for the ALIGN tag is supported for the following elements:

  • <P>
  • <DIV>
  • <TABLE>
  • <TD>
  • <TH>
  • <H1> thru <H6>
  • The COLOR tag

    XmHTML extends the use of the COLOR tag from the <FONT> element to a number of other HTML elements. These elements are:

  • <CODE>
  • <SAMP>
  • <KBD>
  • <TT>
  • <STRONG>
  • <B>
  • <EM>
  • <VAR>
  • <CITE>
  • <I>
  • <ADDRESS>
  • <H1> thru <H6>
  • <BLOCKQUOTE>
  • <PRE>
  • <DIV> and its derivative <CENTER>
  • <P>
  • <HR> with or without the noshade attribute set. Rules inherit the color attribute from surrounding container tags (such as <DIV> or <CENTER>)
  • Color Specification

    Colors are given in RGB as hexadecimal numbers (e.g. COLOR="#C0FFC0") or as one of 16 widely understood color names. These colors were originally picked as being the standard 16 colors supported with the Windows VGA palette (or how low can you go).
    Color names and sRGB values
     Black = "#000000"  Green = "#008000"
     Silver = "#C0C0C0"  Lime = "#00FF00"
     Gray = "#808080"  Olive = "#808000"
     White = "#FFFFFF"  Yellow = "#FFFF00"
     Maroon = "#800000"  Navy = "#000080"
     Red = "#FF0000"  Blue = "#0000FF"
     Purple = "#800080"  Teal = "#008080"
     Fuchsia = "#FF00FF"  Aqua = "#00FFFF"




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: April 3, 1998 by Koen
    XmHTML-1.1.7/html/legals.html100644 23564 23564 11141 6431721247 14231 0ustar newtnewt XmHTML Legal Issues, Distribution and Licensing

    Introduction

    This document discusses the legal issues involved with using XmHTML in any program, but is mainly intended for those who want to use XmHTML in a commercial program.

    If you intend to use XmHTML with a program which will be distributed under the GPL or combine XmHTML into a library distributed under the LGPL, you can skip this document entirely.

    Licensing and Distribution

    XmHTML is distributed and licensed under the Library GNU Public License (LGPL). This license is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.

    The LGPL distinguishes two different uses of a library, each of which is described in the following paragraphs.

    A work based on the library

    Simply said, this means that you have modified a copy of the library (or any portion of it), or use parts of the library in a program. The resulting library must be distributed and licensed under the same terms, while the resulting program may opt to use the GNU Public License instead.

    A work based on the library may never become commercialized.

    See section 2 and 3 in the LGPL for more details.

    A work that uses the library

    This means: you have written a program the uses the library. (using header files from the library does not make it a work based on the library, header files are public interfaces and as such may be used without further consent).

    Such a program may be distributed under any license you choose, and thus XmHTML can also be used in commercial programs. See the next section for more details on using XmHTML in commercial programs. See section 5 and 6 in the LGPL for more details.

    Use of XmHTML in commercial programs

    Section 6 in the LGPL clearly states the requirements to any commercial program using XmHTML. It is mostly intended to allow users to upgrade and/or modify the library without depending on the vendor of such a program.

    If you find it very hard to comply with the requirements stated in section 6, you can obtain XmHTML under a different license which will allow full commercial use without any restrictions. This license does not exist yet but it will be a one-time source license with no run-time fees associated with it.

    This license however will come with a pricetag attached to it. Please contact us if you want to know more about this.




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen
    XmHTML-1.1.7/html/parser.html100644 23564 23564 35225 6431721247 14267 0ustar newtnewt XmHTML Parser Description

    XmHTML Parser Description

    Overview

    This document describes XmHTML's HTML parser in detail and provides background information on the how and why of document verification and repair. It is targetted towards programmers that want to make full use of the parser and document callback resources as well as programmers that want to use the generated parser tree for different purposes.

    XmHTML's HTML parser is fairly powerfull in that it is capable of repairing even the most terrible HTML documents as well as converting a non HTML 3.2 conforming document to a HTML 3.2 conforming one. The only reason for the existance of these document verification and repair capabilities is that XmHTML only works with fully balanced HTML documents. A balanced HTML document is a document in which each terminated HTML element has its opening and closing members at the same level.

    Parser Tree

    When a document is loaded into XmHTML, the parser translates this document to a doubly linked list of objects (referred to as the Parser Tree). Each object contains either a HTML element (and its attributes) or plain text.
    typedef struct _XmHTMLObject{
    	htmlEnum id;		/* ID for this element */
    	String element;		/* element text */
    	String attributes;	/* attributes for this element, if any */
    	Boolean is_end;		/* true when this is a closing element */
    	Boolean terminated;	/* true when element has a closing counterpart */
    	int line;		/* line number for this element */
    	struct _XmHTMLObject *next;
    	struct _XmHTMLObject *prev;
    }XmHTMLObject;
    
    The id field of this structure describes the type of element. The table at the end of this document lists all elements that XmHTML knows of.

    When id is HT_ZTEXT, the element field contains plain text as read from the document (character escape sequences not expanded). The attributes, is_end and terminated elements are meaningless.

    In all other cases, the element field contains the element name and the attributes field contains possible attributes for this element. When an element is terminated (that is, has a closing counterpart), the terminated field will be True, and the is_end field indicates whether the current element is an opening or a closing one. Only unterminated or opening elements can have attributes.

    The element and attributes fields are contained in the same memory buffer, where the latter is separated from the former by a NULL character. When freeing an object, freeing the element field will also free the attribute field.

    The line field contains the line number in the source document where the element is located.

    The objects field in the XmHTMLDocumentCallbackStruct contains the starting point of the parser tree.

    Programmers that want to use the generated parser tree for different purposes might be interested in some of the XmHTML private functions for extracting attribute values and character escape sequence expansion.

    Document Verification

    Document Repair

    XmNparserCallback

    typedef struct
    {
    	int reason;		/* the reason the callback was called */
    	XEvent *event;		/* always NULL for XmNparserCallback */
    	int no;			/* total error count uptil now */
    	int line_no;		/* input line number where error was detected */
    	int start_pos;		/* absolute index where error starts */
    	int end_pos;		/* absolute index where error ends */
    	parserError error;	/* type of error */
    	int action;		/* suggested correction action */
    	String err_msg;		/* error message */
    }XmHTMLParserCallbackStruct, *XmHTMLParserCallbackStructPtr;
    
    This table lists all possible values for the action field, together with a short description of what the parser response will be.

    Action Description
    XmHTML_REMOVE offending element will be removed
    XmHTML_INSERT insert missing element
    XmHTML_SWITCH switch offending and expected element
    XmHTML_KEEP keep offending element
    XmHTML_IGNORE ignore, proceed as if nothing happened
    XmHTML_TERMINATE terminate parser

    Shown below are all possible values for the error field (default action is displayed in bold), allowed actions and the value of the err_msg field. When the action field is set to an action that is not allowed for an error, XmHTML will use the default action.

    error: HTML_UNKNOWN_ELEMENT
    actions: XmHTML_REMOVE, XmHTML_TERMINATE
    err_msg: %s: unknown HTML identifier

    error: HTML_UNKNOWN_ESCAPE
    actions: XmHTML_REMOVE, XmHTML_TERMINATE
    err_msg: %s: unknown character escape sequence

    error: HTML_BAD
    actions: XmHTML_REMOVE, XmHTML_IGNORE, XmHTML_TERMINATE
    err_msg: Terrible HTML! element %s completely out of balance.

    error: HTML_OPEN_BLOCK
    actions: XmHTML_INSERT, XmHTML_REMOVE, XmHTML_KEEP
    err_msg: A new block level element (%s) was encountered while %s is still open.

    error: HTML_CLOSE_BLOCK
    actions: XmHTML_REMOVE, XmHTML_INSERT, XmHTML_KEEP, XmHTML_TERMINATE
    err_msg: A closing block level element (%s) was encountered while it " was never opened.

    error: HTML_OPEN_ELEMENT
    actions: XmHTML_REMOVE, XmHTML_SWITCH, XmHTML_TERMINATE
    err_msg: Unbalanced terminator: got %s while %s is required.

    error: HTML_VIOLATION
    actions: XmHTML_REMOVE, XmHTML_KEEP, XmHTML_TERMINATE
    err_msg: %s may not occur inside %s

    error: HTML_INTERNAL
    actions: XmHTML_TERMINATE, XmHTML_IGNORE
    err_msg: Internal parser error

    XmNdocumentCallback

    typedef struct
    {
    	int reason;		/* the reason the callback was called */
    	XEvent *event;		/* always NULL for XmNdocumentCallback */
    	Boolean html32;		/* True when document was HTML 3.2 conforming */
    	Boolean verified;	/* True when document has been verified */
    	Boolean balanced;	/* True when parser tree is balanced */
    	int pass_level;		/* current parser level count. Starts at 0 */
    	Boolean redo;		/* See below */
    	XmHTMLObject *objects;	/* parser tree starting point */
    }XmHTMLDocumentCallbackStruct;
    

    Private Functions

    XmHTML uses a number of functions to extract values from the attributes field of the XmHTMLObject structures. This section gives a brief overview of these functions, along with the prototypes. The functions themselves are defined in the header file XmHTMLfuncs.h.
    extern Boolean _XmHTMLTagCheck(char *attributes, char *tag);
    
    Returns True when tag is present in the given attributes.

    extern Boolean _XmHTMLTagCheckValue(char *attributes, char *tag, char *check);
    
    Returns True when tag has the specified value check and False if not.

    extern char *_XmHTMLTagGetValue(char *attributes, char *tag);
    
    Returns the value of tag if found in the given attributes, NULL otherwise. The return value must be freed by the caller.

    extern int _XmHTMLTagGetNumber(char *attributes, char *tag, int def);
    
    Returns the numerical value of tag if found in the given attributes. def specifies the return value if tag is not found.

    The following function searches and expands any character escape sequences in the given string:

    extern void _XmHTMLExpandEscapes(char *string);
    
    This function recognizes all escape sequences from the ISO 8895-1 character set, as well as all &# character escapes below 160. Escape sequences are not required to have a terminating semi-colon.

    XmHTML Element Identifiers

    This table lists the internal identifiers, the name of the corresponding HTML element and whether an element is terminated or not. It includes the complete set of HTML 3.2 elements, as well as a small number of extensions.
    XmHTML Element Identifiers
    id Element Terminated id Element Terminated
    HT_DOCTYPE !doctype False HT_A a True
    HT_ADDRESS address True HT_APPLET applet True
    HT_AREA area False HT_B b True
    HT_BASE base False HT_BASEFONT basefont False
    HT_BIG big True HT_BLOCKQUOTE blockquote True
    HT_BODY body True HT_BR br False
    HT_CAPTION caption True HT_CENTER center True
    HT_CITE cite True HT_CODE, code True
    HT_DD dd True HT_DFN dfn True
    HT_DIR dir True HT_DIV div True
    HT_DL dl True HT_DT dt True
    HT_EM em True HT_FONT font True
    HT_FORM form True HT_FRAME frame True
    HT_FRAMESET frameset True HT_H1 h2 True
    HT_H2 h2 True HT_H3 h3 True
    HT_H4 h4 True HT_H5 h5 True
    HT_H6 h6 True HT_HEAD head True
    HT_HR hr False HT_HTML html True
    HT_I i True HT_IMG img False
    HT_INPUT input False HT_ISINDEX isindex False
    HT_KBD kbd True HT_LI li True
    HT_LINK link False HT_MAP map True
    HT_MENU, menu True HT_META meta False
    HT_NOFRAMES noframes True HT_OL ol True
    HT_OPTION option True HT_P p True
    HT_PARAM param False HT_PRE pre True
    HT_SAMP samp True HT_SCRIPT script True
    HT_SELECT select True HT_SMALL small True
    HT_STRIKE strike True HT_STRONG strong True
    HT_STYLE style True HT_SUB sub True
    HT_SUP sup True HT_TAB tab False
    HT_TABLE table True HT_TD td True
    HT_TEXTAREA textarea True HT_TH th True
    HT_TITLE, title True HT_TR tr True
    HT_TT tt True HT_U u True
    HT_UL ul True HT_VAR var True
    HT_ZTEXT plain text False      




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen
    XmHTML-1.1.7/html/parser_prog.html100644 23564 23564 6514 6431721247 15275 0ustar newtnewt XmHTMLParser Programmers Guide

    3.1 Creating a XmHTMLParser Object

    3.1.1 The XmHTMLParser Object's Text

    3.2 Configuring a XmHTMLParser Object

    3.3 XmHTMLParser Object Callback Functions

    3.3.1 Parser Callback

    3.3.2 ModifyVerify Callback

    3.3.3 Document Verification Callback

    3.4 Advanced XmHTMLParser Programming Techniques

    3.4.1 Progressive Document Parsing

    3.4.2 Accessing XmHTMLParser's Parser Tree

    3.4.3 Creating a HTML Document from XmHTMLParser's Output




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen

    XmHTML-1.1.7/html/parser_ref.html100644 23564 23564 40472 6431721247 15123 0ustar newtnewt XmHTMLParser Reference Guide [Note for Netscape, MSIE, Mosaic and most other browsers: get a browser that supports HTML shorttags. This document is littered with these elements, which are an official part of the HTML standard and have been since HTML 1.0. The HTML Widget Set described on these pages does know about them...]

    XmHTMLParser provides an Object capable of parsing HTML 3.2 text. It offers both HTML 3.2 verification and repair of non-conforming HTML documents as well as incremental document parsing. XmHTMLParser objects can be used for creating a fully interactive HTML 3.2 parser application thru XmHTMLParser's callback resources.


    Class Information

    Include File: <Xm/Parser.h>
    Class Name: XmHTMLParser
    Class Hierarchy: Object->XmHTMLParser
    Class Pointer: xmHTMLParserObjectClass
    Functions/Macros: XmCreateHTMLParser, XmHTMLParser... routines, XmIsHTMLParser.


    New Resources

    XmHTMLParser defines the following resources.

    XmNmimeType String text/html CSG
    XmNparserIsProgressive Boolean False CSG
    XmNretainSource Boolean False CSG
    XmNstrictHTMLChecking Boolean False CSG
    XmNuserData Pointer NULL CSG

    XmNmimeType
    This resource informs how XmHTMLParser should parse text. XmHTMLParser knows how to handle the following mime types: text/html, text/plain and every image mime type specification that starts with /image/.

    XmNparserIsProgressive
    Setting this resource to

    XmNretainSource
    When set to

    XmNstrictHTMLChecking
    This resource enables

    XmNuserData
    A pointer to data that the application can attach to the Object. This resource is unused internally.


    Callback Resources

    XmHTMLParser defines the following callback resources:

    XmNdocumentCallback XmCR_HTML_DOCUMENT XmHTMLDocumentCallbackStruct
    XmNmodifyVerifyCallback XmCR_HTML_MODIFYING_TEXT_VALUE XmHTMLVerifyCallbackStruct
    XmNparserCallback XmCR_HTML_PARSER XmXmHTMLParserCallbackStruct

    All callback resources also reference XmAnyCallbackStruct.

    XmNdocumentCallback is activated when XmHTMLParser has finished parsing a document and before XmHTMLParserSetString or XmHTMLParserUpdateSource returns.

    XmNmodifyVerifyCallback is activated when XmHTMLParser is about to insert or remove text in or from the current source text.

    XmNparserCallback is activated when XmHTMLParser encounters a HTML element that is in error. XmHTMLParser detects unknown, unbalanced, badly placed as well as unterminated HTML elements and HTML 3.2 violations.


    XmHTMLDocumentCallbackStruct

    The XmNdocumentCallback callback resource references the following structure:
    typedef struct
    {
    	int		reason;		/* the reason the callback was called */
    	XEvent		*event;		/* always NULL */
    	Boolean		html32;		/* True when document was HTML 3.2 conforming */
    	Boolean		verified;	/* True when document has been verified */
    	Boolean		balanced;	/* True when parser tree is balanced */
    	Boolean		terminated;	/* True if parser is terminated prematurely */
    	int		pass_level;	/* current parser level count. */
    	Boolean		redo;		/* See below */
    }XmHTMLDocumentCallbackStruct;
    
    The The

    The

    The

    The

    The

    Setting the

    When no XmNdocumentCallback callback resource is installed, XmHTML will make at most two passes on the current document. See the Parser Description document for more information.


    XmHTMLVerifyCallbackStruct

    The XmNmodifyVerifyCallback callback resource references the following structure:
    typedef struct{
    	int 		reason;		/* the reason the callback was called */
    	XEvent		*event;		/* always NULL */
    	Boolean		doit;		/* unused */
    	int		action;		/* type of modification */
    	int		line_no;	/* current line number in input text */
    	int		start_pos;	/* start of text to change */
    	int		end_pos;	/* end of text to change */
    	XmHTMLTextBlock	text;		/* describes text to remove or insert */
    }XmHTMLVerifyCallbackStruct, *XmHTMLVerifyPtr;
    
    The The

    The

    The

    The

    typedef struct{
    	String		ptr;		/* pointer to text to remove/insert */
    	int		len;		/* length of this text */
    }XmHTMLTextBlockRec, *XmHTMLTextBlock;
    

    The


    XmHTMLParserCallbackStruct

    The XmNparserCallback resource references the following structure:
    typedef struct{
    	int		reason;		/* the reason the callback was called */
    	XEvent		*event;		/* always NULL */
    	int		errno;		/* total error count uptil now */
    	int		line_no;	/* current line number in input text */
    	int		start_pos;	/* start of text in error */
    	int		end_pos;	/* end of text in error */
    	parserError	error;		/* type of error */
    	unsigned char	action;		/* suggested correction action */
    	XmHTMLTextBlock	repair;		/* proposed element to insert */
    	XmHTMLTextBlock	current;	/* current element */
    	XmHTMLTextBlock	offender;	/* offending element */
    }XmHTMLParserCallbackStruct, *XmHTMLParserPtr;
    
    The The

    The

    The

    The

    current/repair
    HTML_BAD An element is completely out of order and the internal autocorrection routines cannot find a proper place for this element. HTML_REMOVE Yes/No
    HTML_CLOSE_BLOCK A closing block level element is encountered while it was never opened. HTML_REMOVE No/Yes
    HTML_INTERNAL An internal error was encountered. HTML_TERMINATE No/No
    HTML_NOTIFY Notification of insertion of an optional opening/closing element. HTML_INSERT No/Yes
    HTML_OPEN_BLOCK A new block-level element is encountered while a previous block element is still open. HTML_INSERT Yes/Yes
    HTML_OPEN_ELEMENT an unbalanced terminator is encountered. HTML_SWITCH Yes/Yes
    HTML_VIOLATION a HTML 3.2 violation was encountered. HTML_INSERT, HTML_KEEP or HTML_REMOVE Yes/Dynamic
    HTML_UNKNOWN_ELEMENT an unknown element was encountered. HTML_REMOVE No/No

    The HTML_VIOLATION error is a special case. When XmHTMLParser can find a suitable element that will cause the offending element to be no longer in violation of the HTML 3.2 standard, it will propose to insert this new element. When it can't find one, the default action depends on the value of the XmNstrictHTMLChecking resource. When this resource is set to

    HTML_ALIAS Replace HTML_UNKNOWN_ELEMENT
    HTML_IGNORE Ignore this error, proceed as if nothing happened HTML_BAD, HTML_INTERNAL
    HTML_INSERT Insert HTML_CLOSE_BLOCK, HTML_NOTIFY, HTML_OPEN_BLOCK, HTML_VIOLATION
    HTML_KEEP Keep HTML_CLOSE_BLOCK, HTML_OPEN_BLOCK, HTML_VIOLATION
    HTML_REMOVE Remove all
    HTML_SWITCH Switch HTML_OPEN_ELEMENT
    HTML_TERMINATE Terminate parser All errors


    Inherited Resources

    XmHTMLParser inherits the following resources. The resources are listed alphabetically, along with the superclass that defines them.

    XmNdestroyCallback Object


    Translations

    XmHTMLParser does not define any translations.


    Action Routines

    XmHTMLParser does not define any actions.




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen

    XmHTML-1.1.7/html/progguide.html100644 23564 23564 16413 6535402175 14757 0ustar newtnewt XmHTML Widget Set Programmers Guide

    XmHTML Widget Set Programmers Guide

    This document describes the resources, callbacks and translations associated with XmHTML. XmHTML provides a widget capable of displaying HTML 3.2 confirming text.

    Table of Contents

    1. Legal Issues, distribution and licensing

    2. XmHTML Widget

      1. The Basics of a XmHTML Widget
        1. Creating a XmHTML Widget
        2. The XmHTML Widget's Text
        3. The XmHTML Widget's Dimensions
          1. Autosizing a XmHTML Widget
          2. XmHTML Widget's Dimensions and Resources
        4. Document Scrolling
        5. XmHTML Children
      2. Modifying the Document Appearance
        1. Changing the Anchor Appearance
        2. Marking a Visited Anchor
        3. Specifying the Document Fonts
          1. Specifying the Character Set
          2. Specifying the Font Family
          3. Specifying the Font Sizes
      3. XmHTML and Images
        1. The XmImageInfo Structure
          1. The XmImageInfo Structure Explained
        2. The XmHTMLDefaultImageProc
        3. Animations
        4. XmHTMLs' Imagemap Support
      4. XmHTML Widget Callback Functions
        1. Anchor Activation Callback
        2. Anchor Tracking Callback
        3. Frame Notification Callback
        4. Form Activation Callback
        5. Imagemap Activation Callback
        6. Document Verification Callback
        7. Document Link Callback
        8. Document Motion Callback
        9. Document Arm Callback
        10. Document Input Callback
      5. Collective Example
      6. Advanced XmHTML Programming Techniques
        1. Adding Support for HTML Frames
        2. Delayed Image Loading
        3. Adding Support for Other Imagetypes
        4. Using XmHTML's Image Support for Other Purposes
          1. The XmImage Structure
          2. Creating a XmImage
          3. Destroying a XmImage
          4. How to use a XmImage

    3. XmHTMLParser Widget

      1. Creating a XmHTMLParser Widget
        1. The XmHTMLParser Widget's Text
      2. Configuring a XmHTMLParser Widget
      3. XmHTMLParser Widget Callback Functions
        1. Parser Callback
        2. ModifyVerify Callback
        3. Document Verification Callback
      4. Advanced XmHTMLParser Programming Techniques
        1. Progressive Document Parsing
        2. Accessing XmHTMLParser's Parser Tree
        3. Creating a HTML Document from XmHTMLParser's Output

    4. XmHTML Functions and Macros

    5. XmHTML Widget Classes
      1. XmHTML

    6. Structures

    7. Procedures

    8. Data Types

    9. HTML Extensions




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: June 4, 1998 by Koen
    XmHTML-1.1.7/html/xmhtml_prog.html100644 23564 23564 245111 6512547015 15347 0ustar newtnewt XmHTML Programmers Guide

    Chapter 2
    XmHTML Widgets

     

    Have you ever wanted to write an application capable of displaying HTML documents, went out to find a Widget which offered HTML display capabilities and finally give up on your wonderfull idea when no such widget seemed to be available? Maybe you did find a HTML widget but were not satisfied with its capabilities? With the XmHTML Widget described in this chapter you no longer have to despair.

    With the XmHTML Widget one can create applications that range from simple HTML viewers to full-blown WWW browsers. The XmHTML Widget offers a widget capable of displaying HTML documents and, as one would expect, allows full interactive use of HTML documents thru various callback resources and convenience functions. Besides of being able to display HTML documents, displaying of plain text and images is also supported.

    XmHTML widgets provide the following mechanisms for program control:

    • Resources that access the widget's content and can alter it's appearance.
    • Callback resources that allow navigation through and between HTML documents when hyperlinks are activated.
    • Callback resources that provide both visual and content information about the widget's text.
    • Keyboard management methods that control output (paging style).
    • Convenience routines allowing quick and easy ways to load images, scroll through the widget's text and access document information.

    XmHTML widgets implement the full HTML 3.2 standard as well as a few extensions. The chapter on HTML Extensions lists the supported extensions. One supported extension that is worthwhile to mention is the <FRAMESET> extension.

    The current implementation of the XmHTML widget does have its limitations though. The most important features lacking in the current release (1.0.22 Alpha) are support for HTML tables and progressive document loading. All these features will be added in due time.

    As you will notice in this chapter, the behaviour and name of a number of XmHTML's resources and convenience functions closely resemble those of Motif's Text widget. The first reason for this similarity is that both widget's display text. The second reason is that, if you are already familiar with Motif's Text widget, the interface to a XmHTML widget will also look familiar and thus learning how to use a XmHTML widget will be a bit easier.

    2.1 The Basics of a XmHTML Widget

    To understand and appreciate most of the material described in this chapter, it is important to address some of the basic resources and functions provided by the XmHTML widget. The widget's text and HTML verification process, document fonts, dimensions of the widget and hyperlink resources are among the most important. We begin with how to create a standard XmHTML widget.

    2.1.1 Creating a XmHTML Widget

    Applications that wish to use XmHTML widgets need to include the file <XmHTML.h>. You can create a standard XmHTML widget using the XtVaCreateManagedWidget() function:
    	Widget html_w;
    
    	html_w = XtVaCreateManagedWidget("name", xmHTMLWidgetClass, parent,
    		resource-value pairs,
    		NULL);
    
    The resource-value pairs can be any number of resources specific to the XmHTML widget or its superclasses. Please note that the XmHTML widget is subclassed from the Manager widget class.

    Another way of creating a standard XmHTML widget is by using the XmCreateHTML() convenience function:

    	Widget html_w;
    
    	html_w = XmCreateHTML(parent, "name", args, nargs);
    
    The args argument can be any number of resource-value pairs specified using the XtSetArg function. nargs specifies how many resource-value pairs are contained in the args argument.

    2.1.2 The XmHTML Widget's Text

    The first thing to learn about the XmHTML widget is how to access its internal text storage. The most simple method to do this is by using the XmNvalue resource. Unlike most widgets in the Motif toolkit that use text, the XmHTML widget does not use compound strings for its value. Instead, the value is specified as a regular C string as shown in example 2-1.

    Example 2-1. The simple_html.c program

    /* simple_html.c -- Create a minimally configured XmHTML widget */
    #include <XmHTML.h>
    
    main(int argc, char **argv)
    {
    	Widget toplevel;
    	XtAppContext app;
    
    	toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
    		&argc, argv, NULL, NULL);
    
    	XtVaCreateManagedWidget("html", xmHTMLWidgetClass, toplevel,
    		XmNvalue, "<html><body>A minimally configured XmHTML widget."
    			"</body></html>",
    		NULL);
    
    	XtRealizeWidget(toplevel);
    	XtAppMainLoop(app);
    }
    
    This short program simply creates a XmHTML widget whose initial value is set to "A minimally configured XmHTML widget." (See Figure 2-1).

    [A Simple HTML Widget]
    Figure 2-1. simple_html.c: a minimally configured XmHTML widget

    HTML Verification

    As one can see in the above example, the value of the XmNvalue resource contains five HTML elements: four markup and one text element. This brings us to one of the most important aspects of the XmHTML widget: it is a widget for displaying HTML documents. HTML documents are text documents written in the HyperText Markup Language, which is a language composed of a set of elements that define a document and guide its display.

    In order for XmHTML to display such a document properly, it is necessary that the widget verifies the correctness of these markup elements. It does this by comparing the contents of the document that is to be displayed against the now official W3C HTML 3.2 recommendation (referred to as the HTML 3.2 standard). This standard defines both appearance and content of each markup element. During this verification process (which is performed before anything is displayed), the widget goes thru great lengths as to ensure that the document adheres to this standard. As such, the widget is capable of modifying the specified markup elements substantially (it will never modify text elements). The disadvantage of this document verification is that a document might not look as expected, but the main advantage is that even the most horrid HTML document will be displayed.

    A detailed description of this document verification and repair process is given in the next chapter, so we will only mention that the more a document adheres to the HTML 3.2 standard, the less the widget will modify the markup elements.

    Setting a XmHTML Widget's Text

    The initial value of the XmNvalue resource may be set either at initialization time (as in example 2-1) or by using XtVaSetValues:
    	XtVaSetValues(html_w, XmNvalue, text, NULL);
    
    This resource always represents the entire text of the widget.

    Another method for setting the text in a XmHTML widget is by using the convenience routine XmHTMLTextSetString:

    	void
    	XmHTMLTextSetString(html_w, value)
    		Widget  html_w;
    		char   *value;
    
    Although the two methods produce the same results, the convenience routine may be more efficient since it accesses the internals of the widget directly (The XtVaSetValues() method involves going through the X Toolkit Intrinsics). On the other hand, if you are also setting many other resources at the same time, the XtVaSetValues method is better since it saves the overhead of multiple function calls (All resources can be set in a single call).

    Whichever function you use, the value (however it is provided) is copied into the internals of the widget. This is important to known if you have provided the value via an allocated memory buffer: once the text is set in the widget, you can safely free this memory buffer.

    A XmHTML widget's may contain large amounts of text provided there is enough memory available on the computer running the client application. The upper limit on the number of bytes a XmHTML widget may have is given by the maximum value of an unsigned int (4 gigabyte on 32 bit systems), so it is more likely that the user's computer will run out of memory before the XmHTML widget's maximum capacity is reached.

    Getting a XmHTML Widget's Text

    XmHTML widget's provide several methods for obtaining text. Before learning how to get the widget's text however, it is important to make a distinction between the source text and the displayed text. The source text is the text you have set into a XmHTML widget by using the XmNvalue resource (or by using the XmHTMLTextSetString() convenience function), while the displayed text is the source text after HTML verification has taken place. This distinction is important since XmHTML widget's will never modify the source text but instead create a new HTML document while the HTML verification process is taking place.

    [Note: A new HTML document is not actually created: when text is set in a XmHTML widget, the HTML parser translates the source text to a list of internal objects. The new HTML document that is mentioned in the above paragraph only exists in theory but can be created upon request as we will soon see.]

    You might ask yourself why this distinction is important. The answer is that it depends on the type of application you are using a XmHTML widget for. Lets assume you are using a XmHTML widget in an application that displays HTML documents you have retrieved via a network layer (a WWW browser for example). When the user of your application wishes to save the document he has been viewing, it is most likely he wishes to save the original document and not the verified document. On the other hand, when you are using a XmHTML widget in an application intended for writing and/or verifying HTML documents, the most obvious thing a user would want to save is his verified document.

    Getting the Source Text

    So how does one go about getting a XmHTML widget's text? To get the widget's source text, you can use either XtVaGetValues() or the XmHTMLTextGetSource() convenience function. Both methods return the value of the XmNvalue resource. The value returned is a pointer to the internal text storage, which may never be freed nor modified. The code fragment below demonstrates how to use the convenience function:
    	String text_p;
    
    	if((text_p = XmHTMLTextGetSource(html_w)) != NULL)
    	{
    		/* Save, display the text, but never modify or free it */
    	}
    
    Or, by using the Xt function XtVaGetValues():
    	String text;
    
    	XtVaGetValues(html_w, XmNvalue, &text_p, NULL);
    
    Similar to using the XmHTMLTextSetString() convenience function to set a XmHTML widget's text, using the XmHTMLTextGetSource() to get a XmHTML widget's text may be more efficient since it accesses the internals of the widget directly instead of going through the X Toolkit Intrinsics.

    [Note: It is also worthwhile to mention that all of the XmHTML... convenience functions access the internals of the XmHTML widget directly. None of them involves going through the X Toolkit Intrinsics.]

    If you want to modify the source text, or you just want a copy of the text that you can modify for other reasons, then you must copy the text into your own local dataspace:

    	char *text_p, buf[1024];
    
    	text_p = XmHTMLTextGetSource(html_w);
    
    	(void)strncpy(buf, text_p, 1024);
    	/* modify "buf" all you want */
    
    Here, we don't know how much text text_p points to, but for purposes of this demonstration, we assume it's not more than 1024 bytes. Just to be sure that we don't cause an overflow of buf, we use strncpy(). Let me stress that, unless you are intimately familiar with the nature of the XmHTML widget your are using, it is unwise to make general assumptions about the amount of text you are getting.

    Getting the Displayed Text

    The method to get the displayed text is very similar to the Motif Text XmTextGetString() convenience function: XmHTMLTextGetString(). Both functions allocate enough space (using XtMalloc()) to contain all the text and return a pointer to this newly allocated area. While the pointer can be modified any way you like, you must free it using XtFree() when you are through using it. The code fragment below demonstrates how this function may be used:
    	String text_p;
    
    	if((text_p = XmHTMLTextGetString(html_w)) != NULL)
    	{
    		/*
    		* Allocated memory returned.
    		* do anything with "text_p" you want.
    		*/
    		XtFree(text_p);
    		/* we *must* free "text" or there will be a memory leak */
    	}
    
    This convenience function returns a HTML document created from the XmHTML widget's internal representation of the original source document after HTML verification has taken place. Depending on the adherance to the HTML 3.2 standard of the original source document, the newly created HTML document may or may not differ from the original source document. If there is a difference, it will only be found in the markup elements; XmHTML widget's never modify text elements.

    Getting the displayed text of a XmHTML widget is potentially an expensive operation if the widget contains large amounts of text. A XmHTML widget needs to create a HTML document from the internal representation every time XmHTMLTextGetString() is called.

    2.1.3 XmHTML Widget's Dimensions

    Let's return to Example 2-1 and examine more closely what is exposed to the user. As you can notice from the output of the program (shown in Figure 2-1), a vertical scrollbar is displayed and the text is not entirely visible: the user has to drag the vertical scrollbar to see all the text contained in the XmHTML widget. When no size has been specified, the width of a XmHTML widget defaults to 20 ex (a TEX measure for average character width) and the height of a single line in the default font.

    You specify the size of a XmHTML widget by using the XmNwidth and XmNheight resources (which a XmHTML widget inherits from the Core widget), as shown in Example 2-2:

    Example 2-2. The simple_html2.c program

    /* simple_html2.c -- Create another minimally configured XmHTML widget */
    #include <XmHTML.h>
    
    main(int argc, char **argv)
    {
    	Widget toplevel;
    	XtAppContext app;
    
    	toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
    		&argc, argv, NULL, NULL);
    
    	/* create a XmHTML widget but this time we specify a size */
    	XtVaCreateManagedWidget("html", xmHTMLWidgetClass, toplevel,
    		XmNvalue, "<html><body>Another minimally configured XmHTML "
    			"widget.</body></html>",
    		XmNwidth, 200,
    		XmNheight, 75,
    	NULL);
    
    	XtRealizeWidget(toplevel);
    	XtAppMainLoop(app);
    }
    
    The output of this program is shown in Figure 2-2.

    [Another Simple HTML Widget]
    Figure 2-2. simple_html2.c: another minimally configured XmHTML widget

    The specified width and height are only used at initialization. Once the application is up and running, the user can resize windows and effectively change those dimensions.

    2.1.3.1 Autosizing a XmHTML Widget

    As you can see in Figure 2-2, the widget's text is now entirely visible but a vertical scrollbar is still present. We could remove this vertical scrollbar by obtaining a handle to it and then unmanaging it, but another and more subtle way to remove the vertical scrollbar is to use the autosizing feature of a XmHTML widget as shown in Example 2-3.

    Example 2-3. The autosize_html.c program

    /* autosize_html.c -- Demonstrate the autosizing feature of a XmHTML widget */
    #include <XmHTML.h>
    
    main(int argc, char **argv)
    {
    	Widget toplevel;
    	XtAppContext app;
    
    	toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
    		&argc, argv, NULL, NULL);
    
    	/* make sure we may resize ourselves */
    	XtVaSetValues(toplevel, XmNallowShellResize, True, NULL);
    
    	/* create a XmHTML widget but this time enable autosizing */
    	XtVaCreateManagedWidget("html", xmHTMLWidgetClass, toplevel,
    		XmNvalue, "<html><body>An AutoSizing XmHTML widget.</body></html>",
    		XmNresizeWidth, True,
    		XmNresizeHeight, True,
    	NULL);
    
    	XtRealizeWidget(toplevel);
    	XtAppMainLoop(app);
    }
    
    The output of this program is shown in Figure 2-3.

    [An Autosizing HTML Widget]
    Figure 2-3. autosize_html.c: an autosizing XmHTML widget

    When looking at Example 2-3, we notice a few things that are of interest. First of all, there is the XmNallowShellResize resource. The value of this resource determines whether a Shell widget (or any of its subclasses, in this case a topLevelShellWidget) will honor geometry requests from its children. Since we want the XmHTML widget to compute its own size, we must set this resource to True (it is False by default).

    The second and most interesting thing to notice are the XmNresizeWidth and XmNresizeHeight resources. These resources control the autosizing feature of XmHTML widgets. The first enables autosizing in horizontal direction and the latter in vertical direction. When the XmNresizeWidth resource is set to True, XmHTML widget's base their initial width on the width of the longest text element in the source document, with a maximum of 80 characters. XmHTML widget's with autosizing enabled will never cover the entire screen: the maximum dimensions a XmHTML widget take will never exceed 80% of the available screen dimensions.

    In strong contrast with specifying the dimensions of XmHTML widget's using the XmNwidth and XmNheight resources, autosizing is persistent: When the user resizes a window, the dimensions of a XmHTML widget are not affected. Autosizing remains effective as long as the autosizing resources are set.

    You should use the autosizing feature of XmHTML widget's sparingly. Dynamic resizing of widgets is generally considered as poor design. This is especially true of widgets in a Shell or Dialog with other elements in it.

    An example of acceptable use of dynamic resizing would be when a XmHTML widget is used in a popup dialog used for displaying small amounts of text (such as explanation of terminology in a Hypertext Help system).

    2.1.3.2 XmHTML Widget's Dimensions and Resources

    As we will see in section 2.1.5, XmHTML Children, a XmHTML widget creates three subwidgets: a DrawingArea and two scrollbars.

    When a XmHTML widget is created, the size of the DrawingArea is set explicitly by the widget itself, but it uses the Motif default values when it creates the scrollbars. It is important that you realize this when you set the dimensions of a XmHTML widget by means of application-wide fallback resources or when specifying them in a resource file: if you specify the dimensions of a XmHTML widget using resource wildcarding you can be sure to expect unwanted behaviour whenever text is set into the widget.

    The correct way to specify the widget dimensions is as follows:

    static String fallbackResources[] = {
    	"*XmHTML.width:       575",
    	"*XmHTML.height:      600",
    };
    
    This will only set the width of the DrawingArea subwidget to 575 pixels and the height to 600 pixels, leading to the expected behaviour.

    If on the other hand you incorrectly specify the dimensions as follows:

    static String fallbackResources[] = {
    	"*XmHTML*width:       575",
    	"*XmHTML*height:      600",
    };
    
    you are not only setting the dimensions of the DrawingArea subwidget but also the dimensions for every subwidget created by a XmHTML widget. Needless to say that this kind of behaviour is unwanted. The correct way to specify the dimensions of both a XmHTML widget and its ScrollBar subwidgets is as follows:
    static String fallbackResources[] = {
    	"*XmHTML.width:       575",
    	"*XmHTML.height:      600",
    	"*XmHTML*verticalScrollBar.width:       25",
    	"*XmHTML*horizontalScrollBar.height:    25",
    };
    

    [Note: although it is possible to use resource wildcarding to set the dimensions of a XmHTML widget when the width and height of a ScrollBar are explicitly set, it is advisable that this is never done. The problem is not limited to the dimensions of the ScrollBars subwidgets but extends to any subwidgets a XmHTML widget creates when it encounters a HTML document with a <FORM></FORM> declaration in it.]

    2.1.4 Document Scrolling

    Adding document scrolling to XmHTML widget's is easy: you don't. If you look at the output of Example 2-1 (Figure 2-1), you will notice that a vertical scrollbar is present while we didn't instruct the XmHTML widget to add one. When the XmHTML widget was created it noticed that it wasn't high enough to display all of the text and thus it added a vertical scrollbar to allow the user to view all of the text by dragging the scrollbar. If you resize the window vertically, the vertical scrollbar will disappear when the widget is high enough to contain all text (including the horizontal and vertical margins).

    The behaviour you have observed in Example 2-1 is the default behaviour for the XmHTML widget: when not all of the text can be fitted in the available dimensions, a horizontal and/or vertical scrollbar is added, and when all text can be fitted in the available dimensions, the horizontal and/or vertical scrollbar is removed.

    As there might be cases where you want the presence of a vertical scrollbar while one is not required, you can force the presence of a vertical scrollbar by using the XmNscrollBarDisplayPolicy resource as shown in the following example:

    Example 2-4. The forced_html.c program

    /* forced_html.c -- Force the display of the vertical scrollbar */
    #include <XmHTML.h>
    
    main(int argc, char **argv)
    {
    	Widget toplevel;
    	XtAppContext app;
    
    	toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
    		&argc, argv, NULL, NULL);
    
    	/* create a XmHTML widget but this time we specify a size */
    	XtVaCreateManagedWidget("html", xmHTMLWidgetClass, toplevel,
    		XmNvalue, "<html><body>A minimally configured "
    			"XmHTML widget.</body><html>",
    		XmNwidth, 200,
    		XmNheight, 75,
    		XmNscrollBarDisplayPolicy, XmSTATIC,
    		XmNscrollBarPlacement, XmTOP_LEFT,
    		XmNmarginWidth, 5,
    		XmNmarginHeight, 5,
            NULL);
    
    	XtRealizeWidget(toplevel);
    	XtAppMainLoop(app);
    }
    
    The XmNmarginWidth and XmNmarginHeight resources determine the spacing between the outer borders of a XmHTML widget and the displayed text. For demonstration purposes they have been set to a smaller value than the default value of 20. If you compile and run this program you will see that a vertical scrollbar is present and stays present when the widget is resized, even when the widget is high enough to contain all text.

    Example 2-4 also shows the XmNscrollBarPlacement resource. This resource controls the placement of both horizontal and vertical scrollbar. In this case the vertical scrollbar is placed on the left side of the window and the horizontal scrollbar is placed on top of the window (making the window smaller will show the horizontal scrollbar). Possible values for this resource are:

    • XmTOP_LEFT: vertical ScrollBar on left; horizontal on top;
    • XmBOTTOM_LEFT: vertical ScrollBar on left; horizontal on bottom;
    • XmTOP_RIGHT: vertical ScrollBar on right; horizontal on top;
    • XmBOTTOM_RIGHT: vertical ScrollBar on right; horizontal on bottom;

    XmHTML widget's do not provide any way to force the display of a horizontal scrollbar, you can only control it's placement.

    Keyboard Scrolling

    XmHTML widget's implement a full keyboard navigation interface by installing a number of translations. On most keyboards, the arrows provide the same behaviour as dragging the scrollbars while the PageUp and PageDown keys scroll through a document a page at a time. Additional keys are also available, see the XmHTML Reference Manual for the complete set of translations that XmHTML widget's install.

    2.1.5 XmHTML Children

    A XmHTML widget is made up of a number of subwidgets: a DrawingArea widget in which the document is displayed, and two ScrollBars. You can get the handles to these children using the Xt XtVaGetValues() method, as demonstrated in the following code fragment:
    	Widget work_window, hsb, vsb;
    
    	XtVaGetValues(html_w,
    		XmNworkWindow, &work_window,
    		XmNhorizontalScrollBar, &hsb,
    		XmNverticalScrollBar, &vsb,
    		NULL);
    
    Getting XmHTML widget children can be usefull when you want to install your own event handlers or set additional resources on these children.

    Let us now demonstrate a case where it is usefull to get a handle to one of XmHTML's children: the workWindow. Amongst the many convenience routines offered by the XmHTML widget's is the XmHTMLXYToInfo() function. This function takes a XmHTML widget and a pointer position as it's arguments and returns a structure containing information about the contents of the currently displayed document at the requested pointer position. The structure returned is of type XmHTMLInfoStructure, which is defined as follows:

    typedef struct
    {
    	int line_no;		/* line number at selected position */
    	Boolean is_map;		/* true when clicked image is an imagemap */
    	int x,y;		/* position relative to image corner */
    	XmImageInfo *image;	/* image data */
    	XmHTMLAnchorPtr anchor;	/* possible anchor data */
    }XmHTMLInfoStructure, *XmHTMLInfoPtr;
    
    The XmImageInfo and XmHTMLAnchorPtr members of this structure will be explained in the following sections, so we will now only say that the first structure contains information about an image over which the pointer is located, while the latter contains information about a hyperlink over which the anchor is currently located.

    A perfect way to display this information to the user would be to display a popup menu when the user clicks on the currently displayed document. In order for this to work, we need to attach an event handler to the workWindow of a XmHTML widget. The following example demonstrates how to attach the event handler to the workWindow and how to use the XmHTMLXYToInfo() function:

    Example 2-5. The work_window.c program

    /*
    * work_window.c: attaching an event handler to the work_window of a XmHTML
    * widget.
    */
    #include <XmHTML.h>
    
    void
    attachInfoHandler(Widget html, Widget popup)
    {
    	Widget work_window;
    
    	XtVaGetValues(html, XmNworkWindow, &work_window, NULL);
    
    	/*
    	* Add an event handler which responds to mouse clicks. "popup" is the
    	* popup menu which is to be displayed, it is stored as client_data
    	* for the event handler.
    	*/
    	XtAddEventHandler(work_window, ButtonPressMark, 0,
    		(XtEventHandler)infoHandler, popup);
    }
    
    void
    infoHandler(Widget work_window, Widget popup, XButtonPressedEvent *event)
    {
    	XmHTMLInfoPtr info;
    	Widget html_w;
    	WidgetList children;
    
    	/* we only take events generated by button 3 */
    	if(event->button != 3)
    		return;
    
    	/*
    	* The work_window is a child of a XmHTML widget, so we can get a handle
    	* to the XmHTML widget itself by using Xt's XtParent routine.
    	*/
    	html_w = XtParent(work_window);
    
    	/* get the info for the selected position.  */
    	info = XmHTMLXYToInfo(html_w, event->x, event->y);
    
    	/*
    	* Check the returned info structure. There will be nothing to display
    	* if the pointer wasn't over an image or anchor when the user 
    	* clicked his mouse.
    	*/
    	if(info == NULL || (info->image == NULL && info->anchor == NULL))
    		return;
    
    	/*
    	* For this example we assume that the popup menu has two buttons:
    	* a hyperlink button and an image button. We retrieve these children
    	* of the popup menu using the XmNchildren resource of Motif's
    	* rowColumn widget.
    	*/
    	XtVaGetValues(popup, XmNchildren, &children, NULL);
    
    	/* check if the info structure has an anchor */
    	if(info->anchor)
    	{
    		XmString label;
    		label = XmStringCreateLocalized(info->anchor->href);
    		XtVaSetValues(children[0], XmNlabelString, label, NULL);
    		XmStringFree(label);
    		XtManageChild(children[0]);
    	}
    	else
    		XtUnmanageChild(children[0]);
    
    	/* check if the info structure has an image */
    	if(info->image)
    	{
    		XmString label;
    		label = XmStringCreateLocalized(info->image->url);
    		XtVaSetValues(children[1], XmNlabelString, label, NULL);
    		XmStringFree(label);
    		XtManageChild(children[1]);
    	}
    	else
    		XtUnmanageChild(children[1]);
    
    	/* the "popup" menu has now been configured, pop it up */
    	XmMenuPosition(popup, event);
    	XtManageChild(popup);
    }
    
    Note that the above example does not use any global variables; we can obtain all handles to the widgets we need. The handle to the popup menu is stored as client_data for the event handler, while the handles to the menu buttons of the popup menu can be easily obtained using one of Motif's RowColumn widget resources. It is also important to notice that it is very easy to obtain the widget id of the XmHTML widget. The event handler was attached to the workWindow of a XmHTML widget, and therefore this workWindow is the same widget as the work_window argument to the infoHandler routine. This is the reason why the XtParent(work_window) call returns the handle of the XmHTML widget.

    Also notice that we do not have to free any of the members of the returned XmHTMLInfoStructure structure. In fact, we are not permitted to do this since the image and anchor members of this structure contain pointers to data owned by a XmHTML widget. Unless it is explicitly mentioned, all structures returned by any of XmHTML widget's resources, callback resources or convenience routines should be considered as read only.

    Example 2-5 is a simple demonstration which does not use any callbacks on the popup menu buttons. In a real implementation however, callback resources could be attached to each of the popup menu buttons which would allow the user to jump to the selected hyperlink or display information about the selected image.

    [Note: if you want to specify resource values for the subwidgets mentioned in this chapter by means of application fallback resources or in a resource file, the following names should be used: workWindow for the DrawingArea child, verticalScrollBar for the vertical ScrollBar child and horizontalScrollBar for the horizontal ScrollBar child.]

    2.2 Modifying the Document Appearance

    A HTML document typically contains a number of hyperlinks. Hyperlinks (also referred to as anchors) are often used in HTML documents to allow the reader to navigate the currently displayed document or between different documents. In order for the reader to recognize these anchors they should appear different from the main content of a HTML document. XmHTML widget's provide a number of resources that control the appearance of these anchors.

    Another set of resources allow you to control the fonts that are used to render the displayed text.

    2.2.1 Changing the Anchor Appearance

    XmHTML widget's identify three different types of anchors: a regular anchor, a visited anchor and an anchor which has the target attribute set. The latter is a special type of anchor and is one of the extensions to the HTML 3.2 standard that are implemented by XmHTML. Typical use of this attribute can be found in HTML documents that utilize the HTML <FRAMESET> extension, where this attribute indicates a destination to which the contents of the activated anchor should be sent. This destination can target (amongst others) another XmHTML widget or a new dialog. Other use of this attribute can be found in Hypertext help systems where it might be used to indicate that the contents of the activated anchor should be displayed in a popup window.

    A visited anchor is an anchor that the reader of the document has selected in the past.

    Each anchor has three states: passive, armed and activated. An anchor is considered armed when a user has located the mouse pointer over an anchor. It is active when the user presses the first or second mouse button on an armed anchor. It is considered passive otherwise.

    XmHTML widget's provide four ways to let an anchor stand out:

    • by changing the cursor when an anchor is armed;
    • by actively changing the look of an anchor when it is armed;
    • by rendering the anchor as a pushbutton;
    • by underlining the anchor;

    The first and second item in this list are always selectable, while the third and fourth item are mutually exclusive: you choose either to display the anchors as pushbuttons or to underline them. The latter offers the most control on anchor appearance, while some users may find pushbutton anchors aesthetically more pleasing (although it can be slightly more difficult to identify anchors). Both types allow you to control the color in which the anchor is displayed in both it's passive and activated state.

    XmHTML widget's will display anchors as pushbuttons by default: the default value of the XmNanchorButtons resource is True. By setting this resource to False, anchors will be underlined instead of being displayed as a pushbutton.

    2.2.1.1 Anchor Cursor Resources

    To indicate that an anchor can be activated by the user, it is often convenient to not only render the anchor differently than the remainder of the document but also to change the cursor when the pointer is moved over an anchor.

    XmHTML widget's will change the cursor to a hand with a pointing finger when the user moves the pointer over an anchor. The default cursor is a built-in cursor, but it can be changed to a different cursor by using the XmNanchorCursor resource. Although it will seldomly be needed, the XmNanchorDisplayCursor resource allows you to control whether or not XmHTML widget's should change the cursor when the pointer is moved over an anchor (it is True by default).

    The following code fragment demonstrates how to create, set and destroy a cursor:

    #include <X11/cursorfont.h>	/* standard X cursors */
    #include <XmHTML.h>
    
    void
    setCursor(Widget html_w, Boolean destroy_cursor)
    {
    	static Cursor cursor;
    
    	/* create a standard X cursor when it is not yet created */
    	if(cursor == None)
    		cursor = XCreateFontCursor(XtDisplay(html_w), XC_hand2);
    
    	if(destroy_cursor)
    	{
    		/* only free the cursor when we have created one */
    		if(cursor != None)
    			XFreeCursor(XtDisplay(html_w), cursor);
    		cursor = None;
    	}
    	else	/* set this cursor as the anchor cursor for this XmHTML widget */
    		XtVaSetValues(html_w,
    			XmNanchorCursor, cursor,
    			XmNanchorDisplayCursor, True,
    			NULL);
    }
    
    The cursor is created using XCreateFontCursor(), but this is not required; you may use other functions like XCreateGlyphCursor() or XCreatePixmapCursor(), if you like. See O'Reilly's X Window System Programming guides Volume One, Xlib Programmer's Manual, for more information.

    It is also considered nice programming to use X resources sparingly (although in the case of cursor's it is not really required, they are a virtually unlimited resource under X). This is why the above fragment declares the allocated cursor as a static variable: once allocated the cursor id is always available and we can use it for every XmHTML widget that is provided as an argument to the above routine. When this routine is called with the destroy_cursor argument set to True the cursor is destroyed and reset.

    2.2.1.2 Anchor Display Resources

    Whether or not you select to display anchors as pushbuttons or to underline them, you can always specify the foreground color in which an anchor is rendered. You can specify a different foreground color for the passive state of each of the anchor types mentioned in the introduction to this section:

    • XmNanchorForeground:
      specifies the foreground color that is to be used to render a regular anchor;
    • XmNanchorVisitedForeground:
      specifies the foreground color that is to be used to render a visited anchor;
    • XmNanchorTargetForeground:
      specifies the foreground color that is to be used to render an anchor that has the target attribute set;

    The XmNanchorActivatedForeground resource identifies the foreground color to be used when an anchor is activated. This resource is the same for all three anchor types.

    When you opt to underline the anchors, you can also use the XmNanchorActivatedBackground resource to specify the background color to use when an anchor is activated.

    [Note: When a HTML document contains a background image and displaying of background images is enabled (which is true by default), the XmNanchorActivatedBackground resource is also ignored when anchors are to be underlined, making the anchors appear as being transparent.]

    You need to specify a Pixel for all three resources. You can specify a Pixel value by pre-allocating a pixel (by using any of Xlib's XAllocColor() routines) or by using Xt's XtVaTypedArg method. Both methods have their pro's and con's, but in either case you must free the allocated color values when your application exits.

    When you have set the XmNanchorButtons resource to False, you can also specify the type of underlining for each of the three anchor types. XmHTML widget's support the following types of underlining:

    • XmNO_LINE:
      no lines are drawn;
    • XmSINGLE_LINE:
      a single solid line. This is the default for regular and visited anchors;
    • XmDOUBLE_LINE:
      a double solid line. This is the default for anchors that have the target attribute set;
    • XmSINGLE_DASHED_LINE:
      a single dashed line;
    • XmDOUBLE_DASHED_LINE:
      a double dashed line;

    The resource names are as follows:

    • XmNanchorUnderlineType:
      specifies the type of underlining to use for regular anchors;
    • XmNanchorVisitedUnderlineType:
      specifies the type of underlining to use for visited anchors;
    • XmNanchorTargetUnderlineType:
      specifies the type of underlining to use for anchors that have the target attribute set;

    Finally, there is the XmNhighlightOnEnter resource. When set to True (which is the default), a XmHTML widget will actively modify the look of an anchor whenever it becomes armed by highlighting the anchor. The actual color and type of highlighting used heavily depends on the content of the document that is currently displayed. When a background image is present, a XmHTML widget will base the highlight color on the value of the XmNanchorActivatedForeground resource and render the anchor's text in the computed color. When no background image is present, the highlight color will be based on the current document background and the anchor's text will be rendered in a rectangle filled with the computed color. If you decide to enable this resource, it is adviced that you offer a possibility to the user to toggle the value of this resource: a XmHTML widget attempts to do it's best when computing the highlight color, but might fail to find a suitable color. This can happen, for instance, on documents where the colors used by the background (fixed color or background image), text and anchors are poorly balanced.

    2.2.2 Marking a Visited Anchor

    You now know that XmHTML widget's contain the concept of visited anchors, which are anchors that the reader of the document has selected in the past (e.g, have already been visited). But when the user of your application is switching between documents the following question arises: how do you inform a XmHTML widget that an anchor was previously visited by the user?

    The answer is fairly simple: you use the XmNanchorVisitedProc resource. When a procedure has been installed for this resource, a XmHTML widget will call this procedure to test if an anchor has already been visited. There are two arguments to this procedure: the widget id of a XmHTML widget and the name of the anchor. It should return True when the anchor should be rendered using the XmNanchorVisitedForeground resource and False when it should be rendered as a regular anchor.

    Please note that a XmHTML widget only calls any installed procedure when a document is set into a XmHTML widget, and that it will be called for every anchor that is found in this document.

    The following example shows how easy it can be to use this resource:

    #include <XmHTML.h>
    
    static int num_visited_anchors;
    String visited_anchors[100];
    
    static Boolean
    visitedTestProc(Widget html_w, String anchor)
    {
    	int i;
    
    	for(i = 0; i < num_visited_anchors; i++)
    		if(!strcasecmp(visited_anchors[i], anchor))
    			return(True);
    	return(False);
    }
    
    int
    main(int argc, char **argv)
    {
    	Widget toplevel;
    	XtAppContext app;
    
    	toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
    		&argc, argv, NULL, NULL);
    
    	XtVaCreateManagedWidget("html", xmHTMLWidgetClass, toplevel,
    		XmNanchorVisitedProc, visitedTestProc,
    		NULL);
    
    	XtRealizeWidget(toplevel);
    	XtAppMainLoop(app);
    }
    
    In this example we assume that text can be set in the XmHTML widget, visited_anchors contains a list of already visited anchors and that num_visited_anchors contains the number of items in the visited anchor list. In section 2.5 we will demonstrate how to maintain this list.

    2.2.3 Specifying the Document Fonts

    One of the most important (if not the most important) aspect that will determine the way a document will look to the user concerns the fonts used to render the text in a document. Selecting an appropriate default font (and its size) is a very important decision when using a XmHTML widget, and it is more difficult than it might seem, especially if you want to internationalize your application.

    Font specification for a XmHTML widget does not follow the standard Motif font specification rules (the XmFontList type). Due to the nature of the HTML language this would be rather impossible; it does not only contain font markup elements that allow the writer of a HTML document to change the style of a font, but also to change the typeface and size of a font. To make things even more complicated, all of these font markup elements can be used in arbitrary sequence.

    In order to cope efficiently with this virtually unlimited number of font combinations in HTML documents, XmHTML widget's allocate their fonts directly and employ a smart font caching scheme that will keep the number of required font allocations to an absolute minimum. The font cache is shared by all XmHTML widget's on a per display basis (which effectively means that you can use a XmHTML widget for a multi-display application).

    Another reason why XmHTML widget's do not use the Motif font specification rules is that the XmHTML font allocation routines go thru great lengths to ensure that a requested font is matched. When a requested font can not be exactly matched, the font allocation routines attempt to find a close match by following a number of different paths instead of giving up immediatly and using a default font. XmHTML widget's produce much better looking text than some of the most well known HTML browsers as a result of this.

    Because XmHTML widget's allocate their fonts themselves instead of relying on Motif, a number of resources are offered that allow you, the programmer, to select a character set, foundry, typeface, spacing and size of the fonts that are to be used for displaying a document.

    [Note: In order to fully appreciate the font resources of XmHTML widget's you are encouraged to read Appendix A of O'Reilly's X Window System Programming guides, Volume One, Xlib Programmer's Manual.]

    Before explaining the various font resources I will mention that a XmHTML widget uses the contents of the font resources to compose a X Logical Font Description (XLFD) which is used to query your X server. Knowing this, it is obvious that you are allowed to use wildcards for all font resources (except size of course). This can be potentially dangerous: depending on the configuration of your font path and directories, the font returned by the X server may or may not be what is intended.

    As a final note in this fairly long introduction, the default values for each of the various font resources have been choosen in such a way that every combination represents a font that is present in the default font path of the standard R5 X distribution.

    2.2.3.1 Specifying the Character Set

    The character set resource, XmNcharset, is a string representing the ISO character set encoding to be used. The default character set used by XmHTML widget's, ISO8859-1, represents the ISO Latin-1 character set (which is used by all of the fonts in the 75dpi and 100dpi directories of X's default font path). This character set is a superset of the standard ASCII character set, which includes various special characters used in European languages other than English.

    The XmNcharset resource makes it relatively easy to select a font for non-European (non-English) languages. For example, "XmNcharset: koi8-*" specifies the koi8 Cyrillic font, while "XmNcharset: UJIS-*" identifies a Japanese font.

    It is also important to notice that this resource is very important, if not the most important font resource. If a charset is specified which is unknown to the X server (or the charset is given as a wildcard), a XmHTML widget has almost no control about the fonts to use: the actual charset that is used will then only depend on the fontpath configuration of the X server and the specified font family. Therefore it is considered wise to first verify if the requested character set is available on the system your application is running on before changing it. See also section 2.2.3.2, Specifying the Font Family.

    The font allocation scheme used by XmHTML will first try to load a font for a given character set and font family. When that fails it will wildcard the charset. This causes a XmHTML Widget to honor the following sequence of HTML tags with the default charset:

      <FONT FACE="symbol">alpha</FONT>

    which is rendered as:

      alpha

    [Note: this will render the word alpha in the symbol font if it is installed on your X server, and in english if you are viewing this document with almost any other browser or haven't got the symbol font installed.]

    2.2.3.2 Specifying the Font Family

    XmHTML widget's use two different types of font: a proportional font and a fixed-width font. Proportional fonts are fonts in which each character in a character set has a different width (an example of a proportional font is Times Roman), while fonts in which each character has the same width are called fixed-width fonts. Proportional fonts are more easy for the human eye to read than fixed-width fonts and therefore the main portion of the text in a HTML document is rendered in a proportional font. Fixed-width fonts are used to display preformatted text in a HTML document.

    You specify the proportional font family by using the XmNfontFamily resource, and the fixed-width font family by using the XmNfontFamilyFixed resource. The value for both these resources is a sequence of four dash-seperated strings that define a font family. These four fields are:

    1. foundry: the type foundry that digitized and supplied the font, i.e. Adobe;
    2. family: the font family name (also known as typeface), i.e. roman;
    3. set width: a value describing a font's proportionate width according to the selected foundry, i.e. normal;
    4. spacing: type of character spacing for a font. m (for monospace, i.e. fixed width) or p (proportional, i.e., variable-width) are two well known font spacings.

    The default value for the XmNfontFamily resource is adobe-times-normal-*, and the default value for the XmNfontFamilyFixed resource is adobe-courier-normal-*. Both font families represent a standard, scalable font, present on each X server.

    You should always try to specify a scalable font whenever possible: HTML documents intend to use a lot of differently sized fonts (the header markup elements for example all require a different font size), and the displayed text will generally look much better if a scalable font is used instead of a bitmapped font.

    A note of caution: before changing any of the fontFamily resources, the existence of this font (within the context of the current or new value of the XmNcharset resource) should be verified before actually changing it. An unsuccesfull attempt to change the default font settings can cause a XmHTML widget to exit your application: if it can not find a default font it simply can not display anything.

    2.2.3.3 Specifying the Font Sizes

    The last step in specifying the document fonts is to specify the font sizes for both the proportional and fixed-width font families. Font sizes are always specified in points and not in pixels: specifying a font size in pixels would require you to know in advance the x- and y-resolution of the screen your application is running on. The XmHTML widget determines the screen resolution and selects an appropriate pixel size automatically.

    You can specify the text font size, the sup- and superscript font size and the font size for each of the header markup elements for the proportional font family. For the fixed-width font family you can specify the text font size and sup- and superscript size.

    The sizes for the proportional font family are given by the XmNfontSizeList resource. The value for this resource is a comma seperated list of eight strings. The list below describes the fields in this resource.

    1. normal text size;
    2. sub and superscript font size;
    3. font size for the <H1> markup element;
    4. font size for the <H2> markup element;
    5. font size for the <H3> markup element;
    6. font size for the <H4> markup element;
    7. font size for the <H5> markup element;
    8. font size for the <H6> markup element;

    The default value for this resource is "14,8,24,18,14,12,10,8".

    You do not have to specify all values; when an element in this list has the value 0 (zero), the appropriate default font size is used.

    The sizes for the fixed-width font family are given by the XmNfontSizeFixedList resource. The value for this resource is a comma seperated list of two strings, where the first value describes the normal text size and the second value the size for sup- and superscript text. The default value for this resource is "12,8".

    2.3 XmHTML and Images

    One of the strong and much admired features of the XmHTML Widget is it's built in image support. A XmHTML widget can support a wide range of different image types (from simple X11 bitmaps through complex GIF animations to full 32bit RGB PNG images with an alpha channel). For simple applications one does not need to know anything about this image support as a XmHTML widget can handle almost everything by itself. In fact, you only need to read this section if you want to exploit XmHTML's image support to it's fullest.

    2.3.1 The XmImageInfo Structure

    The basis of XmHTML's image API is formed by the XmImageInfo structure. XmHTML uses this structure to compose the actual image.
    typedef struct _XmImageInfo
    {
        /* regular image fields */
        String url;                    /* original location of image */
        unsigned char *data;           /* raw image data. ZPixmap format */
        unsigned char *clip;           /* raw clipmask data. XYBitmap format */
        Dimension width;               /* used image width, in pixels */
        Dimension height;              /* used image height, in pixels */
        int *reds;                     /* red image pixels */
        int *greens;                   /* green image pixels */
        int *blues;                    /* blue image pixels */
        unsigned int ncolors;          /* Number of colors in the image */
        int bg;                        /* transparent pixel index */
        unsigned char *rgba;           /* image data in rgba format */
        float fg_gamma;                /* image gamma */
        unsigned int options;          /* image option bits */
    
        /* Additional animation data */
        int x;                         /* logical screen x-position for a frame */
        int y;                         /* logical screen y-position for a frame */
        int loop_count;                /* animation loop count */
        unsigned char dispose;         /* image disposal method */
        int timeout;                   /* frame refreshment in milliseconds */
        int nframes;                   /* no of animation frames remaining */
        struct _XmImageInfo *frame;    /* ptr to next animation frame */
    
        /* image classification fields and original data */
        unsigned char type;            /* image type, see below */
        int depth;                     /* bits per pixel for this image */
        unsigned char colorspace;      /* colorspace for this image */
        unsigned char transparency;    /* transparency type for this image */
        Dimension swidth;              /* image width as read from image */
        Dimension sheight;             /* image height as read from image */
        unsigned int scolors;          /* Original number of colors in the image */
    
        XtPointer user_data;           /* any data to be stored with this image */
    }XmImageInfo, *XmImageInfoStruct;
    
    The first part of this structure contains the raw image data XmHTML requires to create an image. The second part is used for creating animations while the third part provides additional information about the image represented by this structure.

    As will be shown in the following sections of this chapter, all of the convenience functions of a XmHTML widget that deal with images work with this structure, either as an argument or as a return value.

    2.3.1.1 The XmImageInfo Structure Explained

    Although this section is mostly intended for those that want to add support for an image type that is unknown to XmHTML, it also contains important information for those that want to enable what is known as delayed image loading or want to exploit XmHTML's built-in image support to its fullest extent. It explains every field in the XmImageInfo structure, what each field should contain and the default values assumed when an image is loaded using the XmHTMLImageDefaultProc.

    url
    This field represents the original location from where the image in question should be or has been obtained. It is actually the contents of the SRC attribute of the <IMG> tag. It is important that this field always contains a value, especially if you want to switch on delayed image loading.

    data
    This field represents the actual image data in ZPixmap format. It is a continuous stream of bytes in which each byte represents an index in the colormap for this image (as defined by the reds, greens and blues fields).

    clip
    This field represents a bitmap (a pixmap with depth 1) which a XmHTML widget will use to create a clipmask. It is a continuous stream of bits, where each bit defines if the underlying pixel should be rendered (bit set to 1) or should be left as it is (bit set to 0). It is only valid for transparent images, although it is very well possible to use this field for defining non-rectangular pixmaps. The dimensions of this bitmap should equal the actual image dimensions.

    width and height
    These fields contain the absolute dimensions of the final pixmap as given by the data field. They are specified in pixel units, and their product must match the size of the data field.

    reds, greens, blues and ncolors
    Each of these fields is an array of color component values which together form the RGB colormap of the image. Each array must have the same size, and this size is given by the value of ncolors. This number must be equal the the number of colors used by the image. A XmHTML widget uses these arrays to allocate the actual image colors and then maps the image data onto these colors.

    bg
    The index of the transparent pixel, or -1 when the image is fully opaque.

    rgba
    This field is only used for images containing an alpha channel. An alpha channel is a series of pixel values in an image used to compute partial pixel transparency. With partial pixel transparency fade in/out or anti-aliasing effects can be achieved regardless of the current background setting. The XmHTMLImageDefaultProc supports alpha channelled PNG images. The format of the data stored in this field is a continuous stream of bytes where each pixel is represented by its red, green, blue and alpha channel component.

    fg_gamma
    This field contains the gamma value of the display on which the image was created. It is only used in combination with alpha channelled images.

    options
    This field contains a combination of OR'd constants which tell a XmHTML Widget what it can and can't do with an XmImageInfo structure. A number of these constants define how and when a XmHTML should free a structure (or members of it), while others determine what type of operations are allowed and how the actual image should be processed.

    "Set by default" indicates a bit set when the XmHTMLImageDefaultProc was used to read an image.

    XmIMAGE_DELAYED
    When set, XmHTML will ignore all fields except url and use a default image instead. This default image can be updated at a later stage using either the XmHTMLImageReplace or XmHTMLImageUpdate convenience function; See the section on Delayed Image Loading for more information.

    XmIMAGE_DEFERRED_FREE
    When set, XmHTML will take care of destroying this structure when a new document is loaded. Set by default;

    XmIMAGE_IMMEDIATE_FREE
    When set, this structure will be destroyed as soon as XmHTML no longer needs it;

    XmIMAGE_RGB_SINGLE
    set this bit when the reds, greens and blues fields have been allocated with one single malloc instead of three separate. Set by default;

    XmIMAGE_ALLOW_SCALE
    set this bit when scaling an image is allowed. Set by default;

    XmIMAGE_FRAME_IGNORE
    use with animations: set this bit when a frame falls outside the logical screen area. No pixmap is created but the timeout for the frame is kept.

    XmIMAGE_CLIPMASK
    This bit is set when the returned XmImageInfo structure contains clipmask data. XmHTML uses this info to create a clipping bitmap. Changing this bit from set to unset will lead to a memory leak while changing it from unset to set without providing a clipmask yourself will cause an error to happen. You can however set this bit when you are providing your own clipmask (to provide non-rectangular images for example), provided you fill the "clip" field with valid bitmap data.

    XmIMAGE_SHARED_DATA
    This bit is set when images share data. XmHTML sets this bit when the image in question is an internal image, e.i., one for which the image data may never be freed. Be carefull setting this bit yourself, since it prevents XmHTML from freeing the image data present in the XmImageInfo structure. It can easily lead to memory leaks when an image is not an internal image.

    XmIMAGE_PROGRESSIVE
    Setting this bit will enable progressive image loading. A function must have been installed on the XmNprogressiveReadProc resource prior to setting this bit. Installing a function on the XmNprogressiveEndProc is optional but strongly advised. When this bit is set all other bits and all members except the url field of the XmImageInfo structure will be ignored.

    XmIMAGE_DELAYED_CREATION
    This bit is read-only. It is used internally by XmHTML for images with an alpha channel. Alpha channel processing merges the current background with the original RGBA data (see above) from the image and uses the result to compose the actual on-screen image (the merged data is stored in the "data" field of the XmImageInfo structure). XmHTML needs to store the original data somewhere, and when this bit is set it is stored in the "rgba" field of the XmImageInfo structure. When this bit is set, the returned structure may not be freed as long as the current document is alive. You can discard it as soon as a new document is loaded.

    type
    This field contains a value which describes the type of image that is represented by this structure. This field is unused internally and is provided for your convenience only. You should consider this value read-only though as it might well be used in the future. Table 2-1 lists all possible values for this field.

    Table 2-1. Supported Image Types
    Type Image description
    IMAGE_ERROR error on image loading
    IMAGE_UNKNOWN unknown image
    IMAGE_XPM X11 pixmap
    IMAGE_XBM X11 bitmap
    IMAGE_GIF CompuServe(C) Gif87a or Gif89a
    IMAGE_GIFANIM animated gif
    IMAGE_GIFANIMLOOP animated gif with NETSCAPE2.0 loop extension
    IMAGE_GZF compatible Gif87a or Gif89a
    IMAGE_GZFANIM compatible animated gif
    IMAGE_GZFANIMLOOP compatible animated gif with NETSCAPE2.0 loop extension
    IMAGE_JPEG JPEG image
    IMAGE_PNG PNG image

    2.3.2 The XmHTMLDefaultImageProc

    2.3.3 Animations

    2.3.4 XmHTML's Imagemap Support

    2.4 XmHTML Widget Callback Functions

    2.4.1 Anchor Activation Callback

    2.4.2 Anchor Tracking Callback

    2.4.3 Frame Notification Callback

    2.4.4 Form Activation Callback

    2.4.5 Imagemap Activation Callback

    2.4.6 Document Verification Callback

    2.4.7 Document Link Callback

    2.4.8 Document Motion Callback

    2.4.9 Document Arm Callback

    2.4.10 Document Input Callback

    2.5 Collective Example

    2.6 Advanced XmHTML Programming Techniques

    2.6.1 Adding Support for HTML Frames

    2.6.2 Delayed Image Loading

    When a document is loaded into a XmHTML widget, it might not always be possible to provide an image when the XmHTML widget encounters one in the document: a net connection might be slow or the image requested can be that large that loading it can take quite a long time. It can be quite annoying if XmHTML should block until the image is available. Therefore, XmHTML offers Delayed Image Loading. Delayed Image Loading fools XmHTML into thinking that it has the image it wants, so it will happily continue without a noticable slowdown, and display the document once it has been parsed and formatted.

    Now, how does it work? Basically it is quite simple: when a XmHTML widget finds a <IMG> tag, it will call the function that has been installed for the XmNimageProc resource function (say, imageProc).

    The XmNimageProc function should then initialise a blank XmImageInfo structure, fill in the url field and set the XmIMAGE_DELAYED bit (this last step is imperative). It should then call a function which requests an image from a remote server and return the new XmImageInfo to XmHTML. The image is retrieved asynchronously.

    At some point in the future, the image has been retrieved by the network layer, and the application calls a routine (say replaceImage) which will replace the blank image in the XmImageInfo structure with the newly loaded one.

    XmHTML widget's provide two functions for replacing or updating a delayed image: XmHTMLImageReplace and XmHTMLImageUpdate. The difference between these two functions is that the former will actually replace the given XmImageInfo structure with a new one while the latter will only update the given image.

    The above will probably make more sense in an example, so here is one.

    Example 2-?: Delayed Image Loading

    #include <XmHTML.h>
    
    XmImageInfo *imageProc(Widget w, String url)
    {
    	String filename;
    	static XmImageInfo *image;
    
    	image = NULL;
    
    	/* test delayed image loading */
    	if((filename = resolveFile(url)) != NULL)
    	{
    		image = XmHTMLImageDefaultProc(html, filename, NULL, 0);
    		image_cache[current_image].image = image;
    		image_cache[current_image++].name = strdup(filename);
    	}
    	else
    	{
    		image = (XmImageInfo*)malloc(sizeof(XmImageInfo));
    		memset(image, 0, sizeof(XmImageInfo));
    		image->options = XmIMAGE_DELAYED; /* Tell XmHTML this image is delayed */
    		image->url = strdup(url);
    		/* associate the new XmImageInfo with this url */
    		image_cache[current_image].image = image;
    		image_cache[current_image++].name = strdup(url);
    		fetchFileFromServer(url);
    	}
    	return(image);
    }
    
    In the above example, it is first tested if the requested image is already available. When it is, XmHTMLImageDefaultProc is called to load the image, and it's return value is stored in an image cache.

    When the requested image is not available on the other hand, a blank XmImageInfo structure is initialized and stored, the delayed bit is set and a function is called which will fetch the image asynchronously from a server. The blank XmImageInfo structure is then returned and XmHTML will continue where it left off. When the image has been received, the application calls the replaceImage function.

    Example 2-?: Updating delayed images

    #include <XmHTML.h>
    
    void replaceImage(String url, unsigned char *buf, int len)
    {
    	int i;
    	XmImageInfo *image;
    
    	for(i = 0; i < image_cache_size; i++)
    	{
    		if(!(strcmp(image_cache[i].name, url)))
    		{
    			image = XmHTMLImageDefaultProc(html, url, buf, len);
    			XmHTMLImageReplace(html, image_cache[i].image, image);
    			image_cache[i].image = image;
    		}
    	}
    }
    
    As already explained in this section, the replaceImage function is called when an image has been retrieved from a server. Contents of the image from location url have been placed in the buffer buf with size len.

    Remember that we have already associated a XmImageInfo structure with a url in the imageProc function, so the first thing we do is get the correct XmImageInfo. When we have found the correct entry, we simply call XmHTMLImageDefaultProc to actually load the image, replace the image represented by our old XmImageInfo structure and update the image cache.

    In a real world implementation the previous XmImageInfo structure would also be freed. It would also call the XmHTMLRedisplay function after all images have been loaded to force XmHTML to do a recalculation of it's screen layout.

    2.6.3 Adding Support for Other Imagetypes

    2.6.4 Using XmHTML's Image Support for Other Purposes

    One of the many nice features in a XmHTML widget is the built-in image support. What is even nicer is that this image support is also available for purposes other than use with a XmHTML widget: the XmHTML widget set contains a number of routines that allow you to read an image of any of the supported image types. You can then use the returned XmImage to your own likings. This section explains the XmImage image datatype and describes how to create, destroy and use such images.

    2.6.4.1 The XmImage Structure

    The basis of the external image support of the XmHTML widget set is formed by the XmImage structure. This structure is defined as follows:
    typedef struct{
    	/* regular image data */
    	String file;		/* originating file */
    	unsigned char type;	/* image type */
    	Pixmap pixmap;		/* actual image	*/
    	Pixmap clip;		/* for transparant pixmaps */
    	int width;		/* image width */
    	int height;		/* image height */	
    
    	/* animation data */
    	XmImageFrame *frames;	/* array of animation frames */
    	int nframes;		/* no of frames following */
    	int current_frame;	/* current frame count */
    	int current_loop;	/* current loop count */
    	int loop_count;		/* maximum loop count */
    	XtIntervalId proc_id;	/* timer id for animations */
    	Widget w;		/* image owner */
    	XtAppContext context;	/* Application context for animations */
    
    	/* Private data */
    	unsigned long *pixels;
    	int npixels;
      	struct _XColorContext *xcc;
    }XmImage;
    
    The pixmap field contains the actual image. It is this pixmap that you should use in a call to XCopyArea to put it directly in a window or in combination with Motif's XmNlabelPixmap resource to put the pixmap in a label widget.

    If the value of the clip field is other than None, it means the original image is a transparent image. You can then use this field as a clipmask of a GC so your image will also be transparent.

    [Note: the clipmask is a pixmap of depth 1, so it is actually a X11 bitmap.]

    One important reminder before explaining how to create and use a XmImage: you should never touch any of the fields in the XmImage structure which are mentioned as private data. This private data is used when the XmImage is destroyed, so modifying any of these fields is a potential danger and leads at least to a memory leak. If you really want to know what these fields represent, here's a very short explanation of what they represent:

    • pixels: an array of allocated pixels values;
    • npixels: the number of elements in pixels;
    • xcc: a structure containing a lot of information about the current visual, colormap, maximum number of colors, color shifts and masks, etc... This structure is used when allocating colors. If you really want to know more about this structure, you should examine the following source files of the XmHTML Widget Set source code: XCC.c, XCC.h and XCCP.h

    2.6.4.2 Creating a XmImage

    You can create an XmImage by using the XmImageCreate convenience function. This function is defined as follows:
    XmImage *XmImageCreate(Widget w, String file, Dimension width,
    	Dimension height);
    
    w must contain the id of a Widget (and not a Gadget) which will be the owner of this image, file is the name of a file representing the image that is to be loaded. The width and height arguments allow you to scale the image. If both have the value 0 (zero), the dimensions of the loaded image will be the dimensions as found in the image. Otherwise, XmImageCreate will scale to image to fit the given dimensions. Scaling is only done in the directions for which a value is given: if you only want to scale the image horizontally, you should only specify a value for width and set height to zero (or a value for height and 0 for width to only scale the image vertically).

    Although the external image support is independent of a XmHTML widget, you can also use the XmImageInfo structure to create a XmImage. An example where this can be usefull is in conjuction with the XmHTMLXYToInfo() convenience function. As you may know by now, the return value of this function can contain a pointer to a XmImageInfo structure. Supposing this is the case and you would want to display a dialog box to the user with a thumbnail of the image, it is much more convenient to create a XmImage directly from the XmImageInfo structure instead of creating it from a file.

    The syntax of the XmImageCreateFromInfo() convenience function is as follows:

    XmImage *XmImageCreateFromInfo(Widget w, XmImageInfo *info, Dimension width,
    	Dimension height);
    
    The only difference with the XmImageCreate() function is that instead of a filename you now supply a XmImageInfo structure.

    2.6.4.3 Destroying a XmImage

    When you are done using a XmImage, you should destroy it using the XmImageDestroy convenience function. The syntax to this function is as follows:
    void XmImageDestroy(XmImage *image);
    
    This function will take care of destroying all pixmaps, possible animation data and will free the colors allocated to this image. When this function returns the given XmImage will no longer be valid.

    One thing that this function will not do is release any XtIntervalId that might be present in the given XmImage structure. It is your responsibility to do this.

    2.6.4.4 How to use a XmImage

    Normal Images

    Running Animations

    For the sake of clarity, we will repeat the animation data of the XmImage structure here:
    	/* animation data */
    	XmImageFrame *frames;	/* array of animation frames */
    	int nframes;		/* no of frames following */
    	int current_frame;	/* current frame count */
    	int current_loop;	/* current loop count */
    	int loop_count;		/* maximum loop count */
    	XtIntervalId proc_id;	/* timer id for animations */
    	Widget w;		/* image owner */
    	XtAppContext context;	/* Application context for animations */
    
    The *frames field points to an array of structures of the following type:
    typedef struct
    {
    	int x;			/* x position in logical screen */
    	int y;			/* y position in logical screen */
    	int w;			/* width of this particular frame */
    	int h;			/* height of this particular frame */
    	int timeout;		/* timeout for the next frame */
    	unsigned char dispose;	/* previous frame disposal method */
    	Pixmap pixmap;		/* actual image */
    	Pixmap clip;		/* image clipmask */
    	Pixmap prev_state;	/* previous screen state */
    
    	/* private data */
    	unsigned long *pixels;
    	int npixels;
    }XmImageFrame;
    
    The total number of frames is given by the nframes field in the XmImage structure. Each member of this array of structures represents a single frame in an animation, so displaying all frames in sequence will result in an animation being shown to the user.

    Before embarking on how to display animations, it is necessary that you understand the what the fields of the XmImageFrame structure represent.

    x, y, w and h

    The first frame in an animation determines the screen size of the animation. This is what is called the logical screen. Every following frame can have a size equal to or less than the logical screen size. The x and y fields of the XmImageFrame structure determine the place of a frame on the logical screen, while the w and h fields determine the size of a frame.

    [Note: Frames crossing logical screen boundaries are automatically clipped by the XmImageCreate routines.]

    timeout

    This field field indicates the number of milliseconds that should expire before the next frame in an animation is displayed.

    loop_count

    This field indicates how many times an animation should be run. A loop_count of zero indicates forever. Any self-respecting application should run animations with a non-zero loop_count only for the specified number of loops.

    dispose

    This indicates how the previous frame should be removed before a new frame is displayed. This field can have the following values:

    XmIMAGE_DISPOSE_NONE (value = 1)
    do nothing, overlay the previous frame with the current frame;
    XmIMAGE_DISPOSE_BY_BACKGROUND (value = 2)
    Restore to background color. The area used by the previous frame should be restored to the background color/image;

    XmIMAGE_DISPOSE_BY_PREVIOUS (value = 3)
    Restore to previous. The area used by the previous frame should be restored to what was there prior to rendering the previous frame.

    Handling disposal methods 2 and 3 are one of the most difficult items to deal with when running an animation. This is the reason why the prev_state field is present in the XmImageFrame structure.

    The use of the remaining fields of the XmImageFrame structure will become clear in the following example which demonstrates how to run an animation and how to deal with the different disposal methods.

    Example 2-?: Running an animation

    [Put in a copy of the src/paint.c, routine DrawFrame]
    




    ©Copyright 1996-1997 by Ripley Software Development
    Last update: September 19, 1997 by Koen
    XmHTML-1.1.7/html/custom_map.html100644 23564 23564 7373 6431721247 15125 0ustar newtnewt Default font map loaded. XmHTML-1.1.7/html/font_map.html100644 23564 23564 15050 6431721247 14570 0ustar newtnewt XmHTML: Sample Font Map Definition

    Sample of a Custom Font Map Definition

    Users of XmHTML can define their own font mappings by providing a document containing various combinations of fonts in different styles and sizes. The document shown below is a typical example of such a font map definition.

    Note that it should be a valid HTML document. It does not need to contain any visible text however.

    custom_map.html

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    	<META NAME="Author" CONTENT="Koen D'Hondt">
    	<META HTTP-EQUIV="Description" CONTENT="XmHTML font mapping.">
    </head>
    <body>
    
    <!--
    	Sample font map definition
     -->
    
    <!-- various forms of helvetica -->
    
    <!-- verdana is helvetica on macintosh -->
    
    <!-- all possible sizes, plain style -->
    <font face="verdana,helvetica" size="1"></font>
    <font face="verdana,helvetica" size="2"></font>
    <font face="verdana,helvetica" size="3"></font>
    <font face="verdana,helvetica" size="4"></font>
    <font face="verdana,helvetica" size="5"></font>
    <font face="verdana,helvetica" size="6"></font>
    <font face="verdana,helvetica" size="7"></font>
    
    <!-- all possible sizes, bold style -->
    <b><font face="verdana,helvetica" size="1"></font></b>
    <b><font face="verdana,helvetica" size="2"></font></b>
    <b><font face="verdana,helvetica" size="3"></font></b>
    <b><font face="verdana,helvetica" size="4"></font></b>
    <b><font face="verdana,helvetica" size="5"></font></b>
    <b><font face="verdana,helvetica" size="6"></font></b>
    <b><font face="verdana,helvetica" size="7"></font></b>
    
    <!-- all possible sizes, italic style -->
    <i><font face="verdana,helvetica" size="1"></font></i>
    <i><font face="verdana,helvetica" size="2"></font></i>
    <i><font face="verdana,helvetica" size="3"></font></i>
    <i><font face="verdana,helvetica" size="4"></font></i>
    <i><font face="verdana,helvetica" size="5"></font></i>
    <i><font face="verdana,helvetica" size="6"></font></i>
    <i><font face="verdana,helvetica" size="7"></font></i>
    
    <!-- all possible sizes, bold-italic style -->
    <b><i><font face="verdana,helvetica" size="1"></font></i></b>
    <b><i><font face="verdana,helvetica" size="2"></font></i></b>
    <b><i><font face="verdana,helvetica" size="3"></font></i></b>
    <b><i><font face="verdana,helvetica" size="4"></font></i></b>
    <b><i><font face="verdana,helvetica" size="5"></font></i></b>
    <b><i><font face="verdana,helvetica" size="6"></font></i></b>
    <b><i><font face="verdana,helvetica" size="7"></font></i></b>
    
    <!-- arial is helvetica on ms-windows -->
    
    <!-- all possible sizes, plain style -->
    <font face="arial,helvetica" size="1"></font>
    <font face="arial,helvetica" size="2"></font>
    <font face="arial,helvetica" size="3"></font>
    <font face="arial,helvetica" size="4"></font>
    <font face="arial,helvetica" size="5"></font>
    <font face="arial,helvetica" size="6"></font>
    <font face="arial,helvetica" size="7"></font>
    
    <!-- all possible sizes, bold style -->
    <b><font face="arial,helvetica" size="1"></font></b>
    <b><font face="arial,helvetica" size="2"></font></b>
    <b><font face="arial,helvetica" size="3"></font></b>
    <b><font face="arial,helvetica" size="4"></font></b>
    <b><font face="arial,helvetica" size="5"></font></b>
    <b><font face="arial,helvetica" size="6"></font></b>
    <b><font face="arial,helvetica" size="7"></font></b>
    
    <!-- all possible sizes, italic style -->
    <i><font face="arial,helvetica" size="1"></font></i>
    <i><font face="arial,helvetica" size="2"></font></i>
    <i><font face="arial,helvetica" size="3"></font></i>
    <i><font face="arial,helvetica" size="4"></font></i>
    <i><font face="arial,helvetica" size="5"></font></i>
    <i><font face="arial,helvetica" size="6"></font></i>
    <i><font face="arial,helvetica" size="7"></font></i>
    
    <!-- all possible sizes, bold-italic style -->
    <b><i><font face="arial,helvetica" size="1"></font></i></b>
    <b><i><font face="arial,helvetica" size="2"></font></i></b>
    <b><i><font face="arial,helvetica" size="3"></font></i></b>
    <b><i><font face="arial,helvetica" size="4"></font></i></b>
    <b><i><font face="arial,helvetica" size="5"></font></i></b>
    <b><i><font face="arial,helvetica" size="6"></font></i></b>
    <b><i><font face="arial,helvetica" size="7"></font></i></b>
    
    <!-- Inform ourselves that we have finished loading the font map -->
    Default font map loaded.
    
    </body>
    </html>
    
    XmHTML-1.1.7/html/custom_map.txt100644 23564 23564 12277 6431721247 15017 0ustar newtnewt<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <META NAME="Author" CONTENT="Koen D'Hondt"> <META HTTP-EQUIV="Description" CONTENT="XmHTML font mapping."> </head> <body> <!-- Sample font map definition --> <!-- various forms of helvetica --> <!-- verdana is helvetica on macintosh --> <!-- all possible sizes, plain style --> <font face="verdana,helvetica" size="1"></font> <font face="verdana,helvetica" size="2"></font> <font face="verdana,helvetica" size="3"></font> <font face="verdana,helvetica" size="4"></font> <font face="verdana,helvetica" size="5"></font> <font face="verdana,helvetica" size="6"></font> <font face="verdana,helvetica" size="7"></font> <!-- all possible sizes, bold style --> <b><font face="verdana,helvetica" size="1"></font></b> <b><font face="verdana,helvetica" size="2"></font></b> <b><font face="verdana,helvetica" size="3"></font></b> <b><font face="verdana,helvetica" size="4"></font></b> <b><font face="verdana,helvetica" size="5"></font></b> <b><font face="verdana,helvetica" size="6"></font></b> <b><font face="verdana,helvetica" size="7"></font></b> <!-- all possible sizes, italic style --> <i><font face="verdana,helvetica" size="1"></font></i> <i><font face="verdana,helvetica" size="2"></font></i> <i><font face="verdana,helvetica" size="3"></font></i> <i><font face="verdana,helvetica" size="4"></font></i> <i><font face="verdana,helvetica" size="5"></font></i> <i><font face="verdana,helvetica" size="6"></font></i> <i><font face="verdana,helvetica" size="7"></font></i> <!-- all possible sizes, bold-italic style --> <b><i><font face="verdana,helvetica" size="1"></font></i></b> <b><i><font face="verdana,helvetica" size="2"></font></i></b> <b><i><font face="verdana,helvetica" size="3"></font></i></b> <b><i><font face="verdana,helvetica" size="4"></font></i></b> <b><i><font face="verdana,helvetica" size="5"></font></i></b> <b><i><font face="verdana,helvetica" size="6"></font></i></b> <b><i><font face="verdana,helvetica" size="7"></font></i></b> <!-- arial is helvetica on ms-windows --> <!-- all possible sizes, plain style --> <font face="arial,helvetica" size="1"></font> <font face="arial,helvetica" size="2"></font> <font face="arial,helvetica" size="3"></font> <font face="arial,helvetica" size="4"></font> <font face="arial,helvetica" size="5"></font> <font face="arial,helvetica" size="6"></font> <font face="arial,helvetica" size="7"></font> <!-- all possible sizes, bold style --> <b><font face="arial,helvetica" size="1"></font></b> <b><font face="arial,helvetica" size="2"></font></b> <b><font face="arial,helvetica" size="3"></font></b> <b><font face="arial,helvetica" size="4"></font></b> <b><font face="arial,helvetica" size="5"></font></b> <b><font face="arial,helvetica" size="6"></font></b> <b><font face="arial,helvetica" size="7"></font></b> <!-- all possible sizes, italic style --> <i><font face="arial,helvetica" size="1"></font></i> <i><font face="arial,helvetica" size="2"></font></i> <i><font face="arial,helvetica" size="3"></font></i> <i><font face="arial,helvetica" size="4"></font></i> <i><font face="arial,helvetica" size="5"></font></i> <i><font face="arial,helvetica" size="6"></font></i> <i><font face="arial,helvetica" size="7"></font></i> <!-- all possible sizes, bold-italic style --> <b><i><font face="arial,helvetica" size="1"></font></i></b> <b><i><font face="arial,helvetica" size="2"></font></i></b> <b><i><font face="arial,helvetica" size="3"></font></i></b> <b><i><font face="arial,helvetica" size="4"></font></i></b> <b><i><font face="arial,helvetica" size="5"></font></i></b> <b><i><font face="arial,helvetica" size="6"></font></i></b> <b><i><font face="arial,helvetica" size="7"></font></i></b> <!-- Inform ourselves that we have finished loading the font map --> Default font map loaded. </body> </html> XmHTML-1.1.7/html/man/ 40755 23564 23564 0 6640070223 12525 5ustar newtnewtXmHTML-1.1.7/html/man/man.tmpl100644 23564 23564 2620 6431721247 14302 0ustar newtnewt XmHTML Programmers Manual: @NAME

    Name

    Synopsis

    Description

    Return Value

    See Also


    ©Copyright 1996-1997 by Ripley Software Development
    October 7, 1997 by Koen

    XmHTML-1.1.7/html/man/TxtScrLn.html100644 23564 23564 4034 6431721247 15241 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextScrollToLine

    Name

    XmHTMLTextScrollToLine - scroll the currently displayed document to the requested line number.

    Synopsis

    void XmHTMLTextScrollToLine(Widget w, int line)

    Description

    XmHTMLTextScrollToLine will scroll the currently displayed document until the requested line number is located at the top of the visible area.

    w
    Specifies the widget ID containing the document that needs to be scrolled;
    line
    Specifies the line that should be scrolled into view. A value of 0 will scroll to the top of the document, while any stupendously large value will scroll to the end of the document.

    See Also

    XmHTML(3X), XmHTMLAnchorScrollToId(3X), XmHTMLAnchorScrollToName(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImDestro.html100644 23564 23564 2735 6431721247 15254 0ustar newtnewt XmHTML Programmers Manual: XmImageDestroy

    Name

    XmImageDestroy - destroy a XmImage structure

    Synopsis

    void XmImageDestroy(XmImage *image)

    Description

    See Also

    XmHTML(3X), XmImageCreate(3X), XmImageCreateFromInfo(3X), XmImage(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImGifGzf.html100644 23564 23564 3042 6431721247 15160 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGIFtoGZF

    Name

    XmHTMLGIFtoGZF - convert a GIF image to a GZF image

    Synopsis

    Boolean XmHTMLGIFtoGZF(String infile, unsigned char *buf, int size, String outfile)

    Description

    Return Value

    See Also

    XmHTML(3X), XmHTMLGIFStream(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/FontInfo.html100644 23564 23564 4630 6431721247 15244 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGetFontCacheInfo

    Name

    XmHTMLGetFontCacheInfo -- obtain information about XmHTML's font cache

    Synopsis

    XmHTMLFontCacheInfo *XmHTMLGetFontCacheInfo(Widget w);

    Description

    Structures

    typedef struct{
    	int nentries;         /* total no of cached fonts              */
    	int nmaps;            /* of which this many are mapped fonts   */
    	int nlookups;         /* no of search actions                  */
    	int nrequests;        /* no of requests made                   */
    	int hits;             /* no of hits                            */
    	int misses;           /* no of misses                          */
    	String *fonts;        /* array of font names, size nentries    */
    	String *mapping;      /* array of font mappings, size nentries */
    	int nwidgets;         /* no of widgets using this cache        */
    	WidgetList widgets;   /* array of widgets                      */
    }XmHTMLFontCacheInfo;
    

    Return Value

    See Also

    XmHTML(3X)

    ©Copyright 1996-1997 by Ripley Software Development
    October 7, 1997 by Koen

    XmHTML-1.1.7/html/man/ImPLCCon.html100644 23564 23564 3401 6431721247 15061 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageProgressiveContinue

    Name

    XmHTMLImageProgressiveContinue - continue progressively loading of images in the currently displayed document.

    Synopsis

    void XmHTMLImageProgressiveContinue(Widget w)

    Description

    Return Value

    See Also

    XmHTML(3X), XmHTMLImageProgressiveSuspend(3X), XmHTMLImageProgressiveKill(3X), XmHTMLPLCStream(3X), XmImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImGetTyp.html100644 23564 23564 5646 6431721247 15234 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageGetType

    Name

    XmHTMLImageGetType - determine the type (format) of an image.

    Synopsis

    unsigned char XmHTMLImageGetType(String file, unsigned char *buf, int size)

    Description

    XmHTMLImageGetType determines the type of a given image. This image can either be loaded from a file or already present in memory.

    file
    Specifies the name of a file representing the image of which the type has to be determined. May not be NULL;
    *buf
    Specifies a pointer to a memory buffer containing the image of which the type has to be determined. Can be NULL;
    size
    Specifies the size of the memory buffer (if any). Can be 0;

    Return Value

    Any of the following values:
    	IMAGE_ERROR         /* error on image loading           */
    	IMAGE_UNKNOWN       /* unknown image                    */
    	IMAGE_XPM           /* X11 pixmap                       */
    	IMAGE_XBM           /* X11 bitmap                       */
    	IMAGE_GIF           /* CompuServe(C) Gif87a or Gif89a   */
    	IMAGE_GIFANIM       /* animated gif                     */
    	IMAGE_GIFANIMLOOP   /* animated gif with loop extension */
    	IMAGE_GZF           /* compatible Gif87a or Gif89a      */
    	IMAGE_GZFANIM       /* compatible animated gif          */
    	IMAGE_GZFANIMLOOP   /* compatible animated gif          */
    	IMAGE_JPEG          /* JPEG image                       */
    	IMAGE_PNG           /* PNG image                        */
    	IMAGE_FLG           /* Fast Loadable Graphic            */
    

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmImageCreate(3X), XmImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImUpdate.html100644 23564 23564 6015 6535376041 15234 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageUpdate

    Name

    XmHTMLImageUpdate - update an image with new information.

    Synopsis

    XmImageStatus XmHTMLImageUpdate(Widget w, XmImageInfo *image)

    Description

    The XmHTMLImageUpdate function can be used to inform a XmHTML widget that the contents of an image have changed and that the display should be updated.

    This function allows one to perform dynamic updating of an image without having to reload the entire document. Examples of images that could require frequent updating are: network statistics, weather reports, financial data, advertisements or even a clock to display how long a document is being viewed.

    w
    Specifies the parent Widget ID, which must be of class xmHTMLWidgetClass.
    *image
    the updated image data.

    Please note that the *image argument must represent a valid XmImageInfo structure, e.i., one that was returned to a XmHTML widget in response to the function installed on the XmNimageProc resource.

    Return Value

    Any of the following values:
    	typedef enum{
    		XmIMAGE_ERROR    /* unknown error occured */
    		XmIMAGE_BAD      /* bad function call: missing arguments */
    		XmIMAGE_UNKNOWN  /* provided XmImageInfo structure unknown/unbound */
    		XmIMAGE_ALMOST   /* action completed, further response necessary */
    		XmIMAGE_OK       /* action completed. */
    	}XmImageStatus;
    
    A return value of XmIMAGE_ALMOST indicates that a redisplay of the current document is necessary (this value can be returned if the dimensions of the image have changed).

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmHTMLImageReplace(3X), XmHTMLRedisplay(3X), XmImageInfo(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man/CrtHTML.html100644 23564 23564 4270 6431721247 14737 0ustar newtnewt XmHTML Programmers Manual: XmCreateHTML

    Name

    XmCreateHTML - create a XmHTML widget.

    Synopsis

    Widget XmCreateHTML(Widget parent, String name, ArgList arglist, Cardinal argcount);

    Description

    XmCreateHTML creates an instance of a XmHTML widget and returns the associated widget ID.

    parent
    Specifies the parent widget ID. This parent must be a Widget and not a Gadget;
    name
    Specifies the name of the created widget;
    arglist
    Specifies the argument list;
    argcount
    Specifies the number of attribute/value pairs in the argument list (arglist);

    For a complete definition of XmHTML and its associated resources, see XmHTML(3X).

    Return Value

    Returns the XmHTML widget ID upon success. Upon failure (NULL parent or a parent that is a subclass of XmGadget), a warning is issued and NULL is returned.

    See Also

    XmHTML(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImFreeIn.html100644 23564 23564 4604 6535373567 15176 0ustar newtnewt XmHTML Programmers Manual: XmImageFreeImageInfo

    Name

    XmHTMLImageFreeImageInfo - release a XmImageInfo structure.

    Synopsis

    void XmHTMLImageFreeImageInfo(Widget w, XmImageInfo *info)

    Description

    XmHTMLImageFreeImageInfo is the only method by which all memory occupied by a XmImageInfo structure can be released safely. This routine will take the various option bits of the given XmImageInfo structure into consideration to determine which members actually have to be released and how (and when) this should be done.

    w
    Specifies the parent Widget ID, which must be of class xmHTMLWidgetClass.
    *info
    Specifies the XmImageInfo structure to be released.

    Return Value

    This function does not return a value. When this function returns, the XmImageInfo structure has become invalid and should no longer be referenced by any means. Depending on the option bits however, some members may have been scheduled for delayed destruction (XmIMAGE_SHARE_DATA bit).

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmHTMLImageFreeAllImages(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man/ImGZFSup.html100644 23564 23564 4720 6431721247 15126 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageGZFSupported, ...

    Name

    XmHTMLImageGZFSupported, XmHTMLImageJPEGSupported, XmHTMLImagePNGSupported - report whether or not support for a specific image format is available.

    Synopsis

    Boolean XmHTMLImageGZFSupported(void)
    Boolean XmHTMLImageJPEGSupported(void)
    Boolean XmHTMLImagePNGSupported(void)

    Description

    Support for these image formats are compile-time options and requires the presence of various libraries. As such, support for any of these image formats may or may not be present in any given XmHTML Widget Library.

    • XmHTMLImageGZFSupported - requires support for libz to be present;
    • XmHTMLImageJPEGSupported - requires support for libjpeg to be present;
    • XmHTMLImagePNGSupported - requires support for libpng and libz to be present (support for the PNG image format implies support for the GZF image format);

    Return Value

    True when support for the requested image format is present, False if not.

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImPLCKil.html100644 23564 23564 3232 6431721247 15063 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageProgressiveKill

    Name

    XmHTMLImageProgressiveKill - abort progressive image loading.

    Synopsis

    void XmHTMLImageProgressiveKill(Widget w)

    Description

    Return Value

    See Also

    XmHTML(3X), XmHTMLImageProgressiveContinue(3X), XmHTMLImageProgressiveSuspend(3X), XmHTMLPLCStream(3X), XmImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImPLCSus.html100644 23564 23564 3657 6431721247 15131 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageProgressiveSuspend

    Name

    XmHTMLImageProgressiveSuspend - temporarily suspend progressive image loading.

    Synopsis

    void XmHTMLImageProgressiveSuspend(Widget w)

    Description

    XmHTMLImageProgressiveSuspend will suspend all images that are being loaded progressively into the currently displayed document. Progressive image loading can be resumed at any stage using the XmHTMLImageProgressiveContinue function.

    Return Value

    See Also

    XmHTML(3X), XmHTMLImageProgressiveContinue(3X), XmHTMLImageProgressiveKill(3X), XmHTMLPLCStream(3X), XmImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImReplac.html100644 23564 23564 6305 6535374711 15224 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageReplace

    Name

    XmHTMLImageReplace - replace an image with another image in the currently displayed document.

    Synopsis

    XmImageStatus XmHTMLImageReplace(Widget w, XmImageInfo *image, XmImageInfo *new_image)

    Description

    XmHTMLImageReplace allows one to replace an existing image with a new one. This function is typically used in combination with delayed image loading. Delayed Image Loading takes place when the function installed on the XmNimageProc resource sets the XmIMAGE_DELAYED option bit on the returned XmImageInfo structure. This bit signals XmHTML that the actual image will be provided at a later stage (for example, the image needs to be fetched from a remote location).

    When the image data has become available, the XmHTMLImageReplace function can be used to inform a XmHTML widget that the image is readily available and the delayed image should be replaced with the real image data.

    w
    Specifies the parent Widget ID, which must be of class xmHTMLWidgetClass.
    *image
    the image that is to be replaced.
    *new_image
    the new image data.

    Return Value

    Any of the following values:
    	typedef enum{
    		XmIMAGE_ERROR    /* unknown error occured */
    		XmIMAGE_BAD      /* bad function call: missing arguments */
    		XmIMAGE_UNKNOWN  /* provided XmImageInfo structure unknown/unbound */
    		XmIMAGE_ALMOST   /* action completed, further response necessary */
    		XmIMAGE_OK       /* action completed. */
    	}XmImageStatus;
    
    A return value of XmIMAGE_ALMOST indicates that a redisplay of the current document is necessary (this value can be returned if the dimensions of the new image differ from the image that it replaced).

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmHTMLImageUpdate(3X), XmHTMLRedisplay(3X), XmImageInfo(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man/ImCrFrIn.html100644 23564 23564 3453 6431721247 15135 0ustar newtnewt XmHTML Programmers Manual: XmImageCreateFromInfo

    Name

    XmImageCreateFromInfo - create a XmImage from a XmImageInfo structure

    Synopsis

    XmImage *XmImageCreateFromInfo(Widget w, XmImageInfo *info, Dimension width, Dimension height, XmImageConfig *config)

    Description

    Return Value

    A pointer to a XmImage structure upon success. NULL on failure.

    See Also

    XmHTML(3X), XmImageCreate(3X), XmImageDestroy(3X), XmHTMLImageDefaultProc(3X), XmImageInfo(3X), XmImage(3X),

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImFreeAl.html100644 23564 23564 4255 6431721247 15151 0ustar newtnewt XmHTML Programmers Manual: XmImageFreeAllImages

    Name

    XmHTMLImageFreeAllImages - release all images in the currently displayed document.

    Synopsis

    void XmHTMLImageFreeAllImages(Widget w)

    Description

    XmHTMLImageFreeAllImages releases all private resources used by the images in the currently displayed document. These resources include memory, colors and pixmaps. Use of this function without having a thorough understanding of the XmHTML Widget internals can easily lead to errors. This function is used internally as the last phase of document destruction.

    w
    Specifies the parent Widget ID containing the document for which all image related resources have to be freed.

    Return Value

    This function does not return a value.

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmHTMLImageFreeImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/ImDefPrc.html100644 23564 23564 12170 6535373410 15171 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageDefaultProc

    Name

    XmHTMLImageDefaultProc - XmHTML default image loading function

    Synopsis

    XmImageInfo *XmHTMLImageDefaultProc(Widget w, String file, unsigned char *buf, int size)

    Description

    XmHTMLImageDefaultProc is the default image loading function of a XmHTML widget. By default, this function is capable of decoding X11 bitmaps (xbm), X11 pixmaps (xpm) and GIF87a and GIF89a images and animations.

    Support for JPEG, PNG and GZF images is a compile time option and as such may or may not be present in your version of the XmHTML library.

    The value returned by this function is a structure containing all the information a XmHTML widget requires to create the image and can be used as the return value for the callback resource installed on the XmNimageProc resource.

    w
    Specifies the parent Widget ID. This must be a widget of class xmHTMLWidgetClass;
    file
    if size is 0, the full path of the image to be decoded. If buf and size are non-zero, the original url of the image that is to be loaded. This argument may never be NULL.
    buf
    preloaded image data. The size of this data is given by the size argument and is ignored if the size argument is zero.
    size
    size of the preloaded image data. This argument is ignored if buf is NULL.

    If size and/or buf is NULL, file must represent the full location of the image that is to be decoded. If this file can not be found or accessed

    To fully appreciate this function, one is advised to read the XmImageInfo(3X) manual page.

    Return Value

    A newly allocated XmImageInfo structure or NULL upon failure.

    Common causes for failure are:

    • the image to be decoded is of an unsupported type;
    • the file argument is NULL;
    • the file argument represents a file that could not be found or accessed.

    Examples

    The simplest example of a function installed for the XmNimageProc resource is the following:
    	XmImageInfo*
    	loadImage(Widget w, String url, Dimension width, Dimension height,
    		XtPointer client_data)
    	{
    		return(XmHTMLImageDefaultProc(w, url, NULL, 0));
    	}
    	
    A more advanced example is:
    	XmImageInfo*
    	loadImage(Widget w, String url, Dimension width, Dimension height,
    		XtPointer client_data)
    	{
    		XmImageInfo *image_info;
    		unsigned char image_type = IMAGE_UNKNOWN;
    
    		/* check if this is a local url */
    		if((XmHTMLGetURLType(url)) != ANCHOR_FILE_LOCAL)
    			return(NULL);
    
    		/* it is a local file. Check if it is of a supported type */
    		image_type = XmHTMLImageGetType(url, NULL, 0);
    
    		if(image_type == IMAGE_ERROR || image_type == IMAGE_UNKNOWN)
    		{
    			/* an error occured or the type of this image is unsupported */
    			return(NULL);
    		}
    
    		/* Load it using the default function */
    		if((image_info = XmHTMLImageDefaultProc(w, url, NULL, 0)) != NULL)
    		{
    			/*
    			 * Prevent a XmHTML widget from freeing this image immediatly.
    			 * Also prevent scaling of the image (scaling images is
    			 * actually a violation of the HTML standard!).
    			 */
    			image_info->options &= ~XmIMAGE_DEFERRED_FREE & ~XmIMAGE_ALLOW_SCALE;
    			return(image_info);
    		}
    		return(NULL);
    	}
    	
    A more advanced version of this function could fetch remote images, check if support for JPEG and PNG images is available before calling XmHTMLImageDefaultProc, use delayed image loading, implement a caching scheme for the returned XmImageInfo structure or add a decoder for image types unsupported by XmHTMLImageDefaultProc (this can include other types of animations as well!).

    See Also

    XmHTML(3X), XmImageInfo(3X), XmImageCreate(3X), XmImageCreateFromInfo(3X), XmImageDestroy(3X), XmImage(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man/ImImgMap.html100644 23564 23564 3150 6431721247 15156 0ustar newtnewt XmHTML Programmers Manual: XmHTMLImageAddImageMap

    Name

    XmHTMLImageAddImageMap - loads an HTML imagemap into the currently displayeddocument.

    Synopsis

    void XmHTMLImageAddImageMap(Widget w, String image_map)

    Description

    Return Value

    See Also

    XmHTML(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/AncGetId.html100644 23564 23564 4247 6431721247 15144 0ustar newtnewt XmHTML Programmers Manual: XmHTMLAnchorGetId

    Name

    XmHTMLAnchorGetId - obtain the id of a HTML anchor in the currently displayed document.

    Synopsis

    int XmHTMLAnchorGetId(Widget w, String anchor)

    Description

    XmHTMLAnchorGetId returns a unique identifier for the requested anchor. This id can subsequently be used to navigate through the currently displayed document.

    w
    Specifies the parent Widget ID. This must be a widget of class xmHTMLWidgetClass;
    anchor
    Specifies the name of the anchor (of the form #name) for which a identifier must be returned. This name must refer an anchor in the currently displayed document;

    Return Value

    The id of the requested anchor or -1 on failure (the named anchor does not exist).

    See Also

    XmHTML(3X), XmHTMLAnchorScrollToId(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/AncScrNm.html100644 23564 23564 4160 6604532350 15161 0ustar newtnewt XmHTML Programmers Manual: XmHTMLAnchorScrollToName

    Name

    XmHTMLAnchorScrollToName - scroll to the requested named anchor

    Synopsis

    void XmHTMLAnchorScrollToName(Widget w, String anchor)

    Description

    XmHTMLAnchorScrollToName scrolls the currently displayed document so the named anchor will be located at the topmost line of the visible area (if possible).

    w
    Specifies the parent Widget ID containing the document to be scrolled. This must be a widget of class xmHTMLWidgetClass;
    anchor
    Specifies the name of the anchor (of the form #name) that must be made visible. It must refer an anchor in the currently displayed document. Please note that the hash sign # must be present for a named anchor to be recognized properly;

    See Also

    XmHTML(3X), XmHTMLAnchorGetId(3X), XmHTMLAnchorScrollToId(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/AncScrId.html100644 23564 23564 3726 6431721247 15155 0ustar newtnewt XmHTML Programmers Manual: XmHTMLAnchorScrollToId

    Name

    XmHTMLAnchorScrollToId - scroll to the requested anchor

    Synopsis

    void XmHTMLAnchorScrollToId(Widget w, int anchor_id)

    Description

    XmHTMLAnchorScrollToId scrolls the currently displayed document so the requested anchor will be located at the topmost line of the visible area (if possible).

    w
    Specifies the parent Widget ID containing the document to be scrolled. This must be a widget of class xmHTMLWidgetClass;
    anchor_id
    Specifies the anchor to be displayed. This id must have been obtained previously using the XmHTMLAnchorGetId(3X) function;

    See Also

    XmHTML(3X), XmHTMLAnchorGetId(3X), XmHTMLAnchorScrollToName(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/TxtGtStr.html100644 23564 23564 4615 6431721247 15270 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextGetString

    Name

    XmHTMLTextGetString - obtain a copy of the HTML parser output.

    Synopsis

    String XmHTMLTextGetString(Widget w)

    Description

    XmHTMLTextGetString returns a copy of the output from the internal HTML parser.

    The returned string need not be identical to the original source text as the internal HTML parser is capable of modifying the original source text to a great extent: it performs a (large) number of consistency checks and verifies HTML3.2 conformance. If necessary, HTML tags are added, moved or removed as the parser sees fit. These modifications made by the internal HTML parser only affect HTML tags, the text that is to be displayed is never modified.

    w
    Specifies the Widget ID from which a copy of the parser output should be retrieved. This widget must be of class xmHTMLWidgetClass.

    Return Value

    A pointer to a newly allocated string. This value must be freed by the caller.

    See Also

    XmHTML(3X), XmHTMLTextGetFormatted(3X), XmHTMLTextGetSource(3X), XmHTMLTextGetString(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/TxtGtSrc.html100644 23564 23564 4054 6431721247 15244 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextGetSource

    Name

    XmHTMLTextGetSource - obtain a pointer to the source text of the currently displayed document.

    Synopsis

    String XmHTMLTextGetSource(Widget w)

    Description

    XmHTMLTextGetSource returns a pointer to the original, unmodified, raw HTML source text of the currently displayed document.

    w
    Specifies the Widget ID from which a source text should be retrieved. This widget must be of class xmHTMLWidgetClass.

    Return Value

    A pointer to the source text of the currently displayed document. This value may never be freed by the caller.

    See Also

    XmHTML(3X), XmHTMLTextGetFormatted(3X), XmHTMLTextGetString(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/TxtGtFmt.html100644 23564 23564 3706 6431721247 15246 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextGetFormatted

    Name

    XmHTMLTextGetFormatted - obtain a formatted (carbon) copy of the currently displayed document.

    Synopsis

    String XmHTMLTextGetFormatted(Widget w, unsigned char papertype, XmHTMLPaperSize *paperdef, unsigned char type, unsigned char PSoptions)

    Description

    UNIMPLEMENTED in XmHTML Beta 1.1.0

    Return Value

    A pointer to a string containing a copy of the currently displayed document in the requested format. This value must be freed by the caller.

    See Also

    XmHTML(3X), XmHTMLTextGetSource(3X), XmHTMLTextGetString(3X), XmHTMLPaperSize(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/TxtStStr.html100644 23564 23564 4173 6535376771 15320 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextSetString

    Name

    XmHTMLTextSetString - set a (new) HTML source text in a XmHTML widget.

    Synopsis

    void XmHTMLTextSetString(Widget w, String text)

    Description

    XmHTMLTextSetString loads a HTML source text in a XmHTML widget. The previously displayed document is destroyed.

    w
    Specifies the widget ID of a widget of class xmHTMLWidgetClass
    text
    Specifies the new, NULL terminated, source text. A value of NULL effectively erases the currently displayed document without displaying a new document. The widget will make a private copy of this new source, so one can safely free text when this function returns.

    Internally, XmHTMLTextSetString references XmHTMLTextSetStringWithLength.

    See Also

    XmHTML(3X), XmHTMLTextGetSource(3X), XmHTMLTextGetString(3X), XmHTMLTextSetStringWithLength(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man/ImCreate.html100644 23564 23564 3273 6431721247 15215 0ustar newtnewt XmHTML Programmers Manual: XmImageCreate

    Name

    XmImageCreate - read an image to a XmImage structure

    Synopsis

    XmImage *XmImageCreate(Widget w, String file, Dimension width, Dimension height, XmImageConfig *config)

    Description

    Return Value

    See Also

    XmHTML(3X), XmImageCreateFromInfo(3X), XmImageDestroy(3X), XmHTMLImageDefaultProc(3X), XmImageInfo(3X), XmImage(3X),

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/man.map100644 23564 23564 3065 6431721247 14107 0ustar newtnewtConvenience Functions --------------------- Filename Manual page for AllocCol.html XmHTMLAllocColor AncGetId.html XmHTMLAnchorGetId AncScrId.html XmHTMLAnchorScrollToId AncScrNm.html XmHTMLAnchorScrollToName CrtHTML.html XmCreateHTML FontInfo.html XmHTMLGetFontCacheInfo FrGtChld.html XmHTMLFrameGetChild FreeCol.html XmHTMLFreeColor GetTitle.html XmHTMLGetTitle GtHdAttr.html XmHTMLGetHeadAttributes GtURLTyp.html XmHTMLGetURLType HTGtVer.html XmHTMLGetVersion, XmHTMLVersion, XmHTMLVERSION_STRING ImCrFrIn.html XmImageCreateFromInfo ImCreate.html XmImageCreate ImDefPrc.html XmHTMLImageDefaultProc ImDestro.html XmImageDestroy ImFreeAl.html XmHTMLImageFreeAllImages ImFreeIn.html XmHTMLImageFreeImageInfo ImGZFSup.html XmHTMLImage[GZF,JPEG,PNG]Supported ImGetTyp.html XmHTMLImageGetType ImGifGzf.html XmHTMLGIFtoGZF ImImgMap.html XmHTMLImageAddImageMap ImPLCCon.html XmHTMLImageProgressiveContinue ImPLCKil.html XmHTMLImageProgressiveKill ImPLCSus.html XmHTMLImageProgressiveSuspend ImReplac.html XmHTMLImageReplace ImUpdate.html XmHTMLImageUpdate Redispla.html XmHTMLRedisplay TxtGtFmt.html XmHTMLTextGetFormatted TxtGtSrc.html XmHTMLTextGetSource TxtGtStr.html XmHTMLTextGetString TxtScrLn.html XmHTMLTextScrollToLine TxtStStr.html XmHTMLTextSetString XYToInfo.html XmHTMLXYToInfo Structures/Datatypes Functions ------------------------------ Filename Manual page for HTML.html XmHTML widget ImInfo.html XmImageInfo structure XmImage.html XmImage structure HTObject.html XmHTMLObject HTPapSiz.html XmHTMLPaperSize HTPLCStr.html XmHTMLPLCStream HTGIFStr.html XmHTMLGIFStream XmHTML-1.1.7/html/man/HTGtVer.html100644 23564 23564 5345 6431721247 15011 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGetVersion, ...

    Name

    XmHTMLGetVersion, XmHTMLVersion, XmHTMLVERSION_STRING - return version information about the XmHTML Widget Library.

    Synopsis

    int XmHTMLGetVersion(void)
    #define XmHTMLVersion
    #define XmHTMLVERSION_STRING

    Description

    The above functions/macros all return version information about the XmHTML Widget Library, and allow one to perform Library version checks between precompiled binaries and shared libraries by comparing the return value of the XmHTMLGetVersion function with the value of the XmHTMLVersion macro.

    The XmHTML Widget Library itself does not perform these checks.

    Return Values

    XmHTMLGetVersion
    A function that teturns the current version number of the Library. This is a hard-coded value and is set to the value of the XmHTMLVersion macro when the Library is compiled;

    XmHTMLVersion
    A macro that returns the current version number of the Library. It is defined in the header file <XmHTML.h>;

    XmHTMLVERSION_STRING
    A macro that returns a string of the form:

    XmHTML Version X.X.XX (C)Ripley Software Development

    where X.X.XX is the version number of the Library in major-minor-revision format. It is defined in the header file <XmHTML.h>.

    See Also

    XmHTML(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/GtURLTyp.html100644 23564 23564 6623 6431721247 15160 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGetURLType

    Name

    XmHTMLGetURLType - obtain the classification of a Uniform Resource Locator.

    Synopsis

    URLType XmHTMLGetURLType(String href)

    Description

    XmHTMLGetURLType classifies Uniform Resource Locators (URLs). A URL can be thought of as a networked extension of the standard filename concept: not only can it point to a file (in a directory), but that file (and directory) can exist on any machine in a network, and can be served via any of several methods. It might not even be a file: URLs can also point to queries, documents stored within databases, the results of commands,...

    href
    Specifies the URL to be classified.

    Return Value

    One of the following constants (port numbers are only shown for demonstration purposes):
    	typedef enum{
    		ANCHOR_UNKNOWN = 0,  /* unknown href                      */
    		ANCHOR_NAMED,        /* name="...."                       */
    		ANCHOR_JUMP,         /* href="#..."                       */
    		ANCHOR_FILE_LOCAL,   /* href="file.html"
                                  * href="file:/file.html" (clearly local)
                                  * href="file:///file.html" (NULL host)
                                  * href="file://localhost/file.html" (localhost)
                                  */
    		ANCHOR_FILE_REMOTE,  /* href="file://foo.bar/file.html"   */
    		ANCHOR_FTP,          /* href="ftp://foo.bar/file"         */
    		ANCHOR_HTTP,         /* href="http://foo.bar/file.html"   */
    		ANCHOR_SECURE_HTTP,  /* href="https://foo.bar/file.html"  */
    		ANCHOR_GOPHER,       /* href="gopher://foo.bar:70"        */
    		ANCHOR_WAIS,         /* href="wais://foo.bar"             */
    		ANCHOR_NEWS,         /* href="news://foo.bar"             */
    		ANCHOR_TELNET,       /* href="telnet://foo.bar:23"        */
    		ANCHOR_MAILTO,       /* href="mailto:foo@bar"             */
    		ANCHOR_EXEC,         /* href="exec:foo_bar"               */
    		ANCHOR_PIPE          /* href="pipe:foo_bar"               */
    	}URLType
    

    See Also

    XmHTML(3X), RFC 1738

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/GetTitle.html100644 23564 23564 3610 6431721247 15240 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGetTitle

    Name

    XmHTMLGetTitle - get the title of the currently displayed document

    Synopsis

    String XmHTMLGetTitle(Widget w)

    Description

    XmHTMLGetTitle returns the title of the currently displayed document. The return value of this function must be freed by the caller.

    w
    Specifies the parent widget ID containing the currently displayed document.

    Return Value

    The title of the document. If the document does not have a title, NULL is returned.

    See Also

    XmHTML(3X), XmHTMLGetHeadAttributes(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/XYToInfo.html100644 23564 23564 5314 6431721247 15201 0ustar newtnewt XmHTML Programmers Manual: XmHTMLXYToInfo

    Name

    XmHTMLXYToInfo - obtain document information at a given location.

    Synopsis

    XmHTMLInfoStructure *XmHTMLXYToInfo(Widget w, int x, int y)

    Description

    XmHTMLXYToInfo returns document information at the specified coordinates. The returned information can include anchor data (if the specified coordinates identify an anchor) and image data (if the specified coordinates identify an image).

    w
    Specifies the parent widget ID. Must be of class xmHTMLWidgetClass
    x,y
    Specifies the coordinates, relative to the upper-left corner of the visible area, for which information must be retrieved.

    Structures

    	typedef struct{
    		Cardinal line;            /* line number at selected position       */
    		Boolean is_map;           /* true when clicked image is an imagemap */
    		int x,y;                  /* position relative to image corner      */
    		XmImageInfo *image;       /* image data, if any                     */
    		XmHTMLAnchorPtr anchor;   /* anchor data, if any                    */
    	}XmHTMLInfoStructure, *XmHTMLInfoPtr;
    

    Return Value

    A pointer to a structure of type XmHTMLInfoStructure. The data within this structure is composed of private widget data, and as such, it may never be freed.

    See Also

    XmHTML(3X), XmImageInfo(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/GtHdAttr.html100644 23564 23564 12155 6431721247 15224 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGetHeadAttributes

    Name

    XmHTMLGetHeadAttributes - obtain the contents of the HEAD section of the currently displayed document.

    Synopsis

    Boolean XmHTMLGetHeadAttributes(Widget w, XmHTMLHeadAttributes *head, unsigned char mask_bits)

    Description

    XmHTMLGetHeadAttributes returns the contents of the document head as well as the contents of the <!DOCTYPE> tag.

    w
    Specifies the parent Widget ID. This must be a widget of class xmHTMLWidgetClass;
    *head
    Specifies a pointer to a structure of type XmHTMLHeadAttributes (see below);
    mask_bits
    Specifies which fields of the document head should be returned. Multiple masking bits can be OR'ed together;

    Upon return, the requested fields of the XmHTMLHeadAttributes structure will be filled with the contents of the corresponding tags of the document head.

    Calling XmHTMLGetHeadAttributes with the HeadClear bit set will cause this function to free all fields of the XmHTMLHeadAttributes structure. Therefore, one must initialize all fields of this structure to NULL before it is used for the first time. Subsequent calls to this function with the same structure do not require re-initialization, nor explicit use of the HeadClear bit, as allocated fields will be released as needed.

    Structures

    	/* possible mask_bit values */
    	#define HeadClear    ((unsigned char)0)
    	#define HeadDocType  (1<<0)
    	#define HeadTitle    (1<<1)
    	#define HeadIsIndex  (1<<2)
    	#define HeadBase     (1<<3)
    	#define HeadMeta     (1<<4)
    	#define HeadLink     (1<<5)
    	#define HeadScript   (1<<6)
    	#define HeadStyle    (1<<7)
    	#define HeadAll      ((unsigned char)~0)
    
    	/* Head member information. */
    	typedef struct{
    		String doctype;          /* doctype data                           */
    		String title;            /* document title                         */
    		Boolean is_index;        /* true when the <isindex> element exists */
    		String base;             /* value of the <base> element            */
    		int num_meta;            /* number of META info to process         */
    		XmHTMLMetaDataPtr meta;  /* array of META info to process          */
    		int num_link;            /* number of LINK info to process         */
    		XmHTMLLinkDataPtr link;  /* array of LINK info to process          */
    		String style_type;       /* value of the style type tag            */
    		String style;            /* <style></style> contents               */
    		String script_lang;      /* value of the language tag              */
    		String script;           /* <script></script> contents             */
    	}XmHTMLHeadAttributes;
    
    	/* Link member information. */
    	typedef struct{
    		String url;              /* value of URL attribute   */
    		String rel;              /* value of REL attribute   */
    		String rev;              /* value of REV attribute   */
    		String title;            /* value of TITLE attribute */
    	}XmHTMLLinkDataRec, *XmHTMLLinkDataPtr;
    
    	/* Meta member information. */
    	typedef struct{
    		String http_equiv;       /* value of HTTP-EQUIV attribute */
    		String name;             /* value of NAME attribute       */
    		String content;          /* value of CONTENT attribute    */
    	}XmHTMLMetaDataRec, *XmHTMLMetaDataPtr;
    
    For a detailed explanation of the members of the above structures, see XmHTMLHeadAttributes(3X)

    Return Value

    True when a HEAD section was found in the currently displayed document. When no such section was found, False is returned indicating that all requested flags, except HeadDocType, could not be honored.

    See Also

    XmHTML(3X), XmHTMLGetTitle(3X), XmHTMLHeadAttributes(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/FrGtChld.html100644 23564 23564 3736 6431721247 15165 0ustar newtnewt XmHTML Programmers Manual: XmHTMLFrameGetChild

    Name

    XmHTMLFrameGetChild - return the Widget ID of a HTML frame child

    Synopsis

    Widget XmHTMLFrameGetChild(Widget w, String name)

    Description

    XmHTMLFrameGetChild returns the Widget ID of the named HTML frame in a HTML 4.0 <FRAMESET> tag.

    w
    Specifies the parent Widget ID. This must be a widget of class xmHTMLWidgetClass;
    name
    the name of the HTML frame for which the Widget ID must be returned.

    Return Value

    The Widget ID of the requested child (which is of class xmHTMLWidgetClass), or NULL when the named child does not exist.

    See Also

    XmHTML(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/Redispla.html100644 23564 23564 3551 6431721247 15266 0ustar newtnewt XmHTML Programmers Manual: XmHTMLRedisplay

    Name

    XmHTMLRedisplay - force a redisplay of the currently displayed document.

    Synopsis

    void XmHTMLRedisplay(Widget w)

    Description

    XmHTMLRedisplay forces a XmHTML widget to redo it's layout calculations and triggers a redisplay of the currently displayed document. Typical use of this function is in combination with the XmHTMLImageReplace and/or XmHTMLImageUpdate functions.

    w
    Specifies the Widget ID containing the document that requires a redisplay.

    See Also

    XmHTML(3X), XmHTMLImageReplace(3X), XmHTMLImageUpdate(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/AllocCol.html100644 23564 23564 5352 6431721247 15214 0ustar newtnewt XmHTML Programmers Manual: XmHTMLAllocColor

    Name

    XmHTMLAllocColor - a convenience function for allocating a color

    Synopsis

    Pixel XmHTMLAllocColor(Widget w, String color, Pixel def_pixel)

    Description

    XmHTMLAllocColor allocates the requested color using the colormap of the given widget. When the color can not be matched exactly, a least squares algorithm is used to search for the closest color in the colormap.

    w
    Specifies the parent Widget ID. Colors are allocated using the colormap of this widget, which does not have to be a XmHTML widget;
    color
    Specifies the color to be allocated. This can be either a symbolic name (e.i., SlateBlue) or an RGB triplet of the form #RRGGBB. Case is ignored;
    def_pixel
    the pixel to be returned if the requested color could not be allocated;

    Return Value

    A pixel value representing the allocated color.

    Examples

    Allocate the (symbolic) color red and return the default black pixel if allocation fails.
    	Pixel pix;
    	Widget w;
    	pix = XmHTMLAllocColor(w, "Red", BlackPixelOfScreen(XtScreen(w)));
    
    Allocate a RGB color and return the default white pixel if allocation fails.
    	Pixel pix;
    	Widget w;
    	pix = XmHTMLAllocColor(w, "#3e0fc1", WhitePixelOfScreen(XtScreen(w)));
    

    See Also

    XmHTMLFreeColor(3X), XParseColor(3X), XAllocColor(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/FreeCol.html100644 23564 23564 3321 6431721247 15035 0ustar newtnewt XmHTML Programmers Manual: XmHTMLFreeColor

    Name

    XmHTMLFreeColor - de-allocate a color.

    Synopsis

    void XmHTMLFreeColor(Widget w, Pixel pixel)

    Description

    XmHTMLFreeColor de-allocates a color previously allocated with XmHTMLAllocColor.

    w
    Specifies the parent Widget ID. The colormap of this widget must match the colormap of the Widget that was used to allocate the color.
    pixel
    the color to be freed;

    See Also

    XmHTMLAllocColor(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/HTML.html100644 23564 23564 167400 6606513253 14333 0ustar newtnewt XmHTML Programmers Manual: XmHTML Widget Class

    Name

    XmHTML - The XmHTML Widget Class

    Synopsis

    #include <XmHTML/XmHTML.h>

    Description

    XmHTML provides a widget capable of displaying HTML 3.2 confirming text. XmHTML widgets can be used for navigating in and between such documents and can also display non HTML 3.2 documents and standalone images. It contains full image support and a keyboard navigation interface which can be customized through XmHTML's translations.

    Class Information

    Class Hierarchy: Core->Composite->Constraint->XmManager->XmHTML

    Class pointer: xmHTMLWidgetClass.

    Class name: XmHTMLWidget

    Functions/Macros: XmCreateHTML, XmHTML... routines, XmIsHTML.

    New Resources

    XmHTML defines the following resources.

    Name Class Type Default Access
    XmNalignment XmCAlignment unsigned char XmALIGNMENT_BEGINNING CSG
    XmNanchorActivatedBackground XmCBackground Pixel white CSG
    XmNanchorActivatedForeground XmCForeground Pixel red CSG
    XmNanchorButtons XmCBoolean Boolean True CSG
    XmNanchorCursor XmCCursor Cursor built-in CSG
    XmNanchorDisplayCursor XmCBoolean Boolean True CSG
    XmNanchorForeground XmCForeground Pixel blue1 CSG
    XmNanchorTargetForeground XmCForeground Pixel blue1 CSG
    XmNanchorTargetUnderlineType XmCAnchorUnderlineType unsigned char XmSINGLE_DASHED_LINE CSG
    XmNanchorUnderlineType XmCAnchorUnderlineType unsigned char XmSINGLE_LINE CSG
    XmNanchorVisitedForeground XmCForeground Pixel blue1 CSG
    XmNanchorVisitedProc XmCAnchorVisitedProc (*)() NULL CSG
    XmNanchorVisitedUnderlineType XmCAnchorUnderlineType unsigned char XmSINGLE_LINE CSG
    XmNbodyImage XmCString String NULL CSG
    XmNcharset XmCString String iso8859-1 CSG
    XmNclientData XmCClientData XtPointer NULL CSG
    XmNdecodeGIFProc XmCDecodeGIFProc XmImageGifProc NULL CSG
    XmNenableBadHTMLWarnings XmCWarningMode Byte XmHTML_ALL CSG
    XmNenableBodyColors XmCBoolean Boolean True CSG
    XmNenableBodyImages XmCBoolean Boolean True CSG
    XmNenableDocumentColors XmCBoolean Boolean True CSG
    XmNenableDocumentFonts XmCBoolean Boolean True CSG
    XmNenableFormColors XmCBoolean Boolean True CSG
    XmNenableIconEntities XmCBoolean Boolean False CSG
    XmNenableOutlining XmCBoolean Boolean False CSG
    XmNeventProc XmCEventProc XmHTMLEventProc NULL CSG
    XmNfontFamily XmCString String adobe-times-normal-* CSG
    XmNfontFamilyFixed XmCString String adobe-courier-normal-* CSG
    XmNfontSizeList XmCString String 14,8,24,18,14,12,10,8 CSG
    XmNfontSizeFixedList XmCString String 12,8 CSG
    XmNfreezeAnimations XmCBoolean Boolean False CSG
    XmNhighlightOnEnter XmCHighlightOnEnter Boolean True CSG
    XmNhorizontalScrollBar XmCHorizontalScrollBar Widget NULL CG
    XmNiconAlignment XmCVerticalAlignment unsigned char XmALIGNMENT_CENTER CSG
    XmNimageEnable XmCBoolean Boolean True CSG
    XmNimagemapDrawBoundingBoxes XmCBoolean Boolean False CSG
    XmNimagemapBoundingBoxForeground XmCForeground Pixel White CSG
    XmNimageMapToPalette XmCConversionMode unsigned char XmDISABLED CSG
    XmNimagePalette XmCString String NULL CG
    XmNimageProc XmCImageProc XmImageProc dynamic CSG
    XmNimageRGBConversion XmCConversionMode unsigned char XmBEST CSG
    XmNmarginHeight XmCMarginHeight Dimension 20 CSG
    XmNmarginWidth XmCMarginWidth Dimension 20 CSG
    XmNmaxImageColors XmCMaxImageColors int 0 CSG
    XmNmimeType XmCString String text/html CSG
    XmNrepeatDelay XmCRepeatDelay int 25 CSG
    XmNresizeHeight XmCResizeHeight Boolean False CSG
    XmNresizeWidth XmCResizeWidth Boolean False CSG
    XmNscreenGamma XmCScreenGamma float 2.2 CSG
    XmNscrollBarDisplayPolicy XmCScrollBarDisplayPolicy unsigned char XmAS_NEEDED CSG
    XmNscrollBarPlacement XmCScrollBarPlacement unsigned char XmBOTTOM_RIGHT CSG
    XmNsmoothScrolling XmCBoolean Boolean True CSG
    XmNstrictHTMLChecking XmCBoolean Boolean False CSG
    XmNStringDirection XmCStringDirection unsigned char XmSTRING_DIRECTION_L_TO_R CSG
    XmNtabWidth XmCTabWidth int 8 CSG
    XmNtopLine XmCTopLine Cardinal 0 CSG
    XmNuncompressCommand XmCString String uncompress CSG
    XmNvalue XmCValue String NULL CSG
    XmNverticalScrollBar XmCVerticalScrollBar Widget NULL CG
    XmNworkWindow XmCWorkWindow Widget NULL CG

    XmNalignment
    Identifies the default alignment (left to right) in which text will be displayed. Possible values are: XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER and XmALIGNMENT_END.

    This resource is only meaningfull when the XmNenableOutlining resource is False.

    XmNanchorActivatedBackground
    The background color to use when an anchor is activated. This resource is only honored when the XmNanchorButtons resource is set to False

    XmNanchorActivatedForeground
    The foreground color to use when an anchor is activated.

    XmNanchorButtons
    When set to True, all anchors will be rendered as pushbuttons instead of being underlined.

    XmNanchorCursor
    The cursor to display when the pointer is moved over an anchor. The built-in cursor is a hand with a pointing finger. Only in effect when the XmNanchorDisplayCursor resource is set.

    XmNanchorDisplayCursor
    When set to True, the cursor will change when the pointer is moved over an anchor.

    XmNanchorForeground
    The color in which anchors will be displayed.

    XmNanchorTargetForeground
    The color in which anchors that have a TARGET attribute specified will be displayed.

    XmNanchorTargetUnderlineType
    Underlining style for anchors that have a TARGET attribute specified. See XmNanchorUnderlineType for possible values. This resource is only honored when the XmNanchorButtons resource is set to False

    XmNanchorUnderlineType
    Underlining style for anchors. Can be any of the following:

    XmNO_LINE /* no underlines */
    XmSINGLE_LINE /* a single, solid, underline */
    XmDOUBLE_LINE /* a double, solid, underline */
    XmSINGLE_DASHED_LINE /* a single, dashed, underline */
    XmDOUBLE_DASHED_LINE /* a double, dashed, underline */

    This resource is only honored when the XmNanchorButtons resource is set to False

    XmNanchorVisitedForeground
    The color in which previously visited anchors will be displayed.

    XmNanchorVisitedProc
    The procedure that should be called to test if an anchor has been activated before. There are three arguments to this procedure: the widget id, the name of the anchor and a pointer to data that the application attached to the widget using the XmNclientData resource. It should return True when the anchor should be rendered using the XmNanchorVisitedForeground resource.

    This procedure is used when a document is loaded into the widget. It is called for every anchor encountered.

    XmNanchorVisitedUnderlineType
    Underlining style for previously visited anchors. See XmNanchorUnderlineType for possible values. This resource is only honored when the XmNanchorButtons resource is set to False

    XmNbodyImage
    The name of the image to be used as the default body image. This resource is only honored when the XmNenableBodyImages resource is set to True

    XmNcharset
    A string representing the ISO character set encoding to be used. The default value (iso8859-1) represents the ISO Latin-1 character set.

    When an attempt is made to set a charset which does not exist on the X server, the XmHTML widget falls back to it's default charset.

    XmNclientData
    A pointer to data that the application can attach to the functions attached to the XmNanchorVisitedProc and XmNimageProc resources. This resource is unused internally.

    XmNdecodeGIFProc
    An alternative procedure that should be used for decoding GIF images.

    To avoid patent issues related to the use of the LZW algorithm (patented by Unisys Coorporation), the default GIF decoder uses a patent-free workaround (involving a system call to the program specified under the XmNuncompressCommand resource). Although this workaround is fairly fast for single-image GIF images, decoding animations can take a considerable amount of time. Therefore, owners of a LZW license or authors of freeware can attach their own LZW decoder to this resource, thereby achieving a small to considerable performance increase.

    See XmHTMLGIFStream --XmHTML External GIF Decoder Interface Definition-- for more information.

    XmNenableBadHTMLWarnings
    Specifies the types of warnings a XmHTML Widget may issues when the HTML parser detects bad HTML constructs in the input document. Unless were noted, multiple warning types can be specified by OR'ing different warning types together.

    Possible values are:
    XmHTML_NONE /* no warnings at all, exclusive value */
    XmHTML_UNKNOWN_ELEMENT /* unknown HTML element */
    XmHTML_BAD /* very badly placed element */
    XmHTML_OPEN_BLOCK /* block still open while new block started */
    XmHTML_CLOSE_BLOCK /* block closed but was never opened */
    XmHTML_OPEN_ELEMENT /* unbalanced terminator */
    XmHTML_NESTED /* improperly nested element */
    XmHTML_VIOLATION /* bad content for current block/element */
    XmHTML_ALL /* show all warnings, exclusive value */

    XmNenableBodyColors
    If True (default), the body and text colors specified in a HTML document will be honored.

    XmNenableBodyImages
    If True (default), the background image specified in a HTML document will be honored.

    XmNenableDocumentColors
    If True (default), the color attribute will be honored for the HTML tags listed in the XmHTML HTML Extensions as well as for the <FONT> element. If set to False no color switching will be performed.

    XmNenableDocumentFonts
    If True (default), the size and face attribute of the <FONT> will be honored. If set to False, no font switching will be performed. Note that setting both XmNenableDocmentColors and XmNenableDocumentFonts to False effectively disables the <FONT> element.

    XmNenableFormColors
    If True (default), any widgets created by a XmHTML Widget as part of a HTML <FORM> tag use the document background and foreground colors. When False, Motif's default values will be used. Please note that in the latter case this will break the natural look of the document.

    XmNenableIconEntities
    If True, support for builtin icon entities will be enabled. This allows the recognition of character escapes that are to be rendered as icons. For example, &folder.open; represents an icon of an open file folder. XmHTML supports all 61 icons listed in the W3C Working Draft WD-wwwicon-960729.

    The default value of this resource is False.

    XmNenableOutlining
    If True (default), all text of which the alignment is not explicitly set will be outlined (justified): every line in a paragraph (or sentence spanning more than a single line) will have the same left and right margin.

    XmNeventProc
    This resource identifies a procedure to be called whenever a HTML4.0 event is encountered while the document is being loaded.

    The call to this procedure contains three arguments: the widget ID of the XmHTML widget, the value of the event (some action that should be performed when a HTML4.0 event occurs) and a pointer to data that the application attached to the widget using the XmNclientData resource.

    The return value of this procedure is a pointer to application data which is used as the data field of the XmNeventCallback whenever a HTML4.0 event occurs. This value is unused internally.

    Note: the XmHTMLGetHeadAttributes convenience function can be used to retrieve the <SCRIPT> source to which these actions most likely refer.

    XmNfontFamily
    A sequence of four, dash-separated strings that make up the family of fonts to be used for displaying text. A fontFamily is composed of the following fields:

    1. foundry: the type foundry that digitized and supplied the font, i.e. Adobe;
    2. family: the font family name, i.e. roman;
    3. set width: a value describing a font's proportionate width according to the selected foundry, i.e. normal;
    4. spacing: type of character spacing for a font. m (for monospace, i.e. fixed width) or p (proportional, i.e., variable-width) are two well known font spacings.

    Wildcards are allowed for all four fields, but can produce unwanted results if your X (or font) server is not configured correctly or if you have a lot of fonts installed. A nominal specification should at least include the family field.

    XmNfontFamilyFixed
    A string describing the family of fonts to be used for displaying text at a fixed width.

    See XmNfontFamily on how to compose this string.

    XmNfontSizeList
    A comma separated list of eight strings describing the various default font sizes to be used, specified in points. The list below describes the various fields in this resource.

    1. default font size.
    2. sub and superscript font size
    3. font size for the <H1> element
    4. font size for the <H2> element
    5. font size for the <H3> element
    6. font size for the <H4> element
    7. font size for the <H5> element
    8. font size for the <H6> element

    When an element in this list has the value 0 (zero), the appropriate default font size is used.

    XmNfontSizeFixedList
    A comma separated list of two strings describing the fixed font sizes to be used, specified in points. The list below describes the various fields in this resource.

    1. default fixed font size.
    2. sub and superscript fixed font size

    When an element in this list has the value 0 (zero), the appropriate default font size is used.

    XmNfreezeAnimations
    When set to True, XmHTML will freeze all animations in a document at the currently displayed frame. Animation will continue when the value of this resource is set to False.

    XmNhighlightOnEnter
    When True (default), an anchor will appear highlighted when the cursor is moved over it. When set to False, anchor highlighting is not performed. The color used for performing anchor highlighting is computed dynamically and depends on the current document foreground color and background setting.

    XmNhorizontalScrollBar
    The widget ID of the horizontal scrollbar.

    XmNiconAlignment
    This resource specifies the default vertical alignment that must be used for icon entities. Only meaningfull when the XmNenableIconEntities resource has been set to True.

    Possible values for this resource are:

    XmALIGNMENT_BASELINE_TOP /* text will be aligned at the top of the icon */
    XmALIGNMENT_CENTER /* text will be aligned at the center of the icon */
    XmALIGNMENT_BASELINE_BOTTOM /* text will be aligned at the bottom of the icon */

    XmNimageEnable
    When True (default) images are displayed.

    XmNimagemapDrawBoundingBoxes
    When True, XmHTML will draw a bounding box around each area in an imagemap. The color used for drawing these bounding boxes can be changed using the XmNimagemapBoundingBoxForeground resource.

    This resource is especially usefull for debugging imagemaps in a document, and it can be an aid to persons with limited visual capability.

    XmNimagemapBoundingBoxForeground
    The color used for drawing imagemap bounding boxes.

    XmNimageMapToPalette
    This resource determines if a XmHTML widget should perform dithering to a fixed palette and if so how that should be done.

    Possible values are:
    XmQUICK A closest distance algorithm is used to map image colors to the palette. No error correction is performed. Fast, but the resulting image quality depends on the distribution of the colors in the image.
    XmBEST Ordered dither using predefined error matrices. Offers the best balance between speed and quality but uses a lot of memory (512kb).
    XmFAST Simple ordered dither without error correction. This is the fastest method but uses a lot of memory (512kb).
    XmSLOW A closest distance algorithm followed by Floyd-Steinberg error diffusion. Slowest method but highest quality.
    XmDISABLED disables palette mapping. This is the default setting.

    XmNimagePalette
    Specifies a fixed palette a XmHTML widget should use. Document colors are mapped onto this palette and document images are dithered against it.

    A palette is defined as a string consisting of RGB triplets. Each color component in a triplet must be given as a hexadecimal string and its value must be in the range 0-255 inclusive. Each color component is separated from the next by a single space. Triplets are separated by (any amount of) whitespace.

    If the XmNmaxColors resource isn't set or differs from the number of colors in the specified palette, it will be set to the size of this palette (with a maximum of 256 colors).

    If the imageMapToPalette resource has been set but no value has been specified for this resource, the XmHTML Widget will create a palette. The size of this palette is given by the value of the maxImageColors resource.

    This resource can only be set at creation time.

    XmNimageProc
    The procedure that should perform image loading. The call to this procedure contains five arguments: the widget ID of the XmHTML widget, the URL where the image can be obtained, the width and height of the image as specified by the width and height attributes on the <IMG> tag (they are 0 (zero) if these attributes have not been specified) and a pointer to data that the application attached to the widget using the XmNclientData resource.

    The return value of this procedure must be a pointer to a XmImageInfo structure. The URL argument to this procedure must be copied into this structure, it has a very limited lifetime within XmHTML itself.

    For common use, this resource should point to a procedure which retrieves the requested image, calls the XmHTMLImageDefaultProc convenience function and returns the obtained XmImageInfo structure.

    When no value is provided for this resource, XmHTML installs an internal procedure that is capable of loading local images only. This resource has no effect if XmNimageEnable is False.

    XmNimageRGBConversion
    This resource determines the conversion XmHTML should use when it's converting 24bit PNG images to 8bit ones.

    Possible values are:
    XmQUICK A fast check is made to see if an image contains less than XmNmaxImageColors colors. If not, 24 to 8 bit conversion is done using (ordered) dither against a fixed palette.
    XmBEST A fast check is made to see if an image contains less than XmNmaxImageColors colors. If not, 24 to 8 bit conversion is done using a histogram of the 24bit image. This offers the best tradeoff between speed and image quality for 24 to 8 bit conversion as 24bit RGB images on web pages often have less than 256 colors. This is the default setting.
    XmFAST dithers to a fixed palette right away. This is the fastest way to do 24 to 8 bit conversion.
    XmSLOW skips the fast check and does 24 to 8 bit conversion using a histogram immediatly. This setting produces the best results.

    XmNmarginHeight
    The spacing at the top and bottom of the display area.

    XmNmarginWidth
    The spacing at the right and left sides of the display area.

    XmNmaxImageColors
    Specifies how many colors each image may take. A value of 0 (default) informs a XmHTML widget that it may allocate as many colors as it can (with a maximum of 256 colors). When set to a non-zero value, images with more colors than allowed will be quantized to reduce the number of colors in the image.

    When the XmNimageMapToPalette resource has a value other than XmDISABLED without providing a palette with the XmNimagePalette resource, a XmHTML widget will create a palette with at most this many colors.

    XmNmimeType
    This resource informs how XmHTML should treat any content specified by the XmNvalue resource. XmHTML knows how to handle the following mime types: text/html, text/plain and every image mime type specification that starts with image/.

    This resource only takes effect when used in combination with the XmNvalue resource.

    XmNrepeatDelay
    The number of milliseconds a button must remain pressed before continuing further scrolling. This resource is used for both the keyboard navigation keys and scrollbars. Depending on the capabilities of your graphics hardware, setting this resource to a small value can cause screen updates to be slow or incomplete.

    XmNresizeHeight
    If False(default), the HTML widget will not expand vertically to fit all of the text. If True, the HTML widget always begins its display with the text at the beginning of the source and expand as much as possible, but it will never exceed 80% of the available screen height.

    XmNresizeWidth
    If False(default), the HTML widget will not expand horizontally to fit its text. If True, the widget tries to change its width, but it will never exceed 80% of the available screen width.

    XmNscreenGamma
    Display gamma correction. The default value of 2.2 will be sufficient for most displays. When using a Silicon Graphics display, this value should be set to 1.8, and when using a Macintosh display (MkLinux) it should be 1.4. This resource is only used for rendering JPEG and PNG images.

    XmNscrollBarDisplayPolicy
    Controls the presence of the Vertical and Horizontal ScrollBars. Possible values:

    XmSTATIC /* scrollbars are always displayed */
    XmAS_NEEDED /* scrollbars are only displayed when view is clipped */

    XmNscrollBarPlacement
    The positions of the ScrollBars relative to the work window. Possible values:

    XmTOP_LEFT /* vertical ScrollBar on left; horizontal on top */
    XmBOTTOM_LEFT /* vertical ScrollBar on left; horizontal on bottom */
    XmTOP_RIGHT /* vertical ScrollBar on right; horizontal on top */
    XmBOTTOM_RIGHT /* vertical ScrollBar on right; horizontal on bottom */

    XmNsmoothScrolling
    If True (default), XmHTML will perform smooth scrolling: any slider movement of the scrollbars will result in an immediate update of the screen.

    In some cases, smooth scrolling may lead to portions of the document not being updated properly (for example, very fast dragging of a scrollbar or a small value for the XmNrepeatDelay resource). If you experience this (unwanted) behavior, try setting this resource to False. XmHTML will then discard any motion events that are still unprocessed if a new motion event arrives. This may lead to jumpy scrolling but ensures that the screen is updated properly.

    XmNstrictHTMLChecking
    This resource enables strict checking of HTML files according to the HTML 3.2 standard. Beware that many HTML files are in violation of this standard and that the result might be not exactly what is intended.

    One important check that is performed when this resource is True concerns the values for all color specifications. When a color is specified by a name, only the 16 standard colors are allowed.

    XmNStringDirection
    The direction in which to render the document contents. Possible values are XmSTRING_DIRECTION_L_TO_R and XmSTRING_DIRECTION_R_TO_L.

    XmNtabWidth
    Specifies the width of a horizontal tab in preformatted text. This resource is specified as a positive, non-zero integer value.

    XmNtopLine
    The number of the line to display at the top of the window. Values for this resource are relative to the beginning of the text, where the first line is defined as 0.

    XmNuncompressCommand
    Specifies the command the internal GIF decoder should use to uncompress compress(1) data. If the target system lacks the presence of compress(1), gzip -d provides a good alternative.

    XmNvalue
    The string value to display in the HTML Widget. Use XtSetValues to copy string values to the internal buffer. XtGetValues will return a pointer to the internal buffer which may not be freed nor modified.

    XmNverticalScrollBar
    The widget ID of the vertical scrollbar.

    XmNworkWindow
    The widget ID of the display area.

    Inherited Resources

    XmHTML inherits the following resources. The resources are listed alphabetically, along with the superclass that defines them

    Resource Inherited From Resource Inherited From
    XmNaccelerators Core XmNancestorSensitive Core
    XmNbackground Core XmNbackgroundPixmap Core
    XmNborderColor Core XmNborderPixmap Core
    XmNborderWidth Core XmNbottomShadowColor Core
    XmNbottomShadowPixmap Core XmNchildren Composite
    XmNcolormap Core XmNdepth Core
    XmNdestroyCallback Core XmNforeground Manager
    XmNhelpCallback Manager XmNheight Core
    XmNhighlightColor Manager XmNhightlightPixmap Manager
    XmNinitialResourcesPersistent Core XmNinsertPosition Composite
    XmNmappedWhenManaged Core XmNnavigationType Manager
    XmNnumChildren Composite XmNscreen Core
    XmNsensitive Core XmNshadowThickness Manager
    XmNstringDirection Manager XmNtopShadowColor Manager
    XmNtopShadowPixmap Manager XmNtranslations Core
    XmNtraversalOn Manager XmNunitType Manager
    XmNuserData Manager XmNwidth Core
    XmNx Core XmNy Core

    Callback Resources

    XmHTMLWidget defines the following callback resources:

    Callback Reason Constant Event Type
    XmNactivateCallback XmCR_ACTIVATE XButtonReleasedEvent
    XmNanchorTrackCallback XmCR_HTML_ANCHORTRACK XMotionEvent, XLeaveWindowEvent, XFocusOutEvent
    XmNarmCallback XmCR_ARM XButtonPressedEvent
    XmNdocumentCallback XmCR_HTML_DOCUMENT NULL
    XmNeventCallback XmCR_HTML_EVENT,
    XmCR_HTML_EVENTDESTROY
    dynamic
    XmNfocusCallback XmCR_FOCUS XFocusInEvent
    XmNformCallback XmCR_HTML_FORM XButtonPressedEvent
    XmNframeCallback XmCR_HTML_FRAME,
    XmCR_HTML_FRAMECREATE,
    XmCR_HTML_FRAMEDESTROY
    NULL
    XmNimagemapCallback XmCR_HTML_IMAGEMAP, XmCR_HTML_IMAGEMAPACTIVATE undefined
    XmNinputCallback XmCR_INPUT XKeyEvent
    XmNlinkCallback XmCR_HTML_LINK NULL
    XmNlosingFocusCallback XmCR_LOSING_FOCUS XFocusOutEvent
    XmNmotionTrackCallback XmCR_HTML_MOTIONTRACK XMotionEvent

    XmNactivateCallback is activated when a BSelect press occurs over an anchor or imagemap.

    XmNanchorTrackCallback is activated when the pointer is moved over an achor or imagemap.

    XmNarmCallback is activated when a BSelect Press occurs when not over an anchor or imagemap.

    XmNdocumentCallback is activated when a XmHTML Widget has parsed a document but before it is displayed.

    XmNeventCallback is activated when a HTML4.0 event is encountered.

    XmNfocusCallback is activated when a XmHTML Widget gains the focus.

    XmNformCallback is activated when a document containing a HTML <FORM> is to be submitted.

    XmNframeCallback is activated when a XmHTML Widget encounters a document containing one or more <FRAMESET> specifications. A XmHTML Widget will only be able to handle framesets if a function has been registed for this callback resource.

    XmNimagemapCallback is actived in any of the following cases:

    1. a BSelect press occurs over an image with the ISMAP attribute set but the USEMAP attribute has not been set or refers to a server-side imagemap;
    2. a remote client-side imagemap should be fetched.

    XmNinputCallback is activated whenever keyboard events that are not served by any of the other callback resources or action routines are received.

    XmNlinkCallback is activated when a document containing <LINK> elements is loaded into the a XmHTML widget. It is activated only once for a document.

    XmNlosingFocusCallback is activated when a XmHTML Widget loses the focus. XmNmotionTrackCallback complements the XmNanchorTrackCallback resource. It is activated when pointer movement does not take place over an anchor or imagemap.

    Callback Structures

    Each callback function is passed the following structure:
    typedef struct{
        int reason;     /* the reason the callback was called */
        XEvent *event;  /* points to event structure that triggered callback */
    }XmAnyCallbackStruct;
    	
    None of the fields in this structure (and any other callback structure for that matter) may be freed, unless explicitly noted otherwise.

    In addition, several callback resources reference additional structures.

    XmNactivateCallback, XmNanchorTrackCallback

    XmNactivateCallback and XmNanchorTrackCallback reference the following structure:

    typedef struct{
        int reason;             /* the reason the callback was called       */
        XEvent *event;          /* event structure that triggered callback  */
        URLType url_type;       /* type of url referenced                   */
        Cardinal line;          /* line number of the selected anchor       */
        String href;            /* pointer to the anchor value              */
        String target;          /* pointer to target value                  */
        String rel;             /* pointer to rel value                     */
        String rev;             /* pointer to rev value                     */
        String title;           /* pointer to title value                   */
        Boolean is_frame;       /* true when inside a frame                 */
        Boolean doit;           /* local anchor vetoing flag                */
        Boolean visited;        /* local anchor visited flag                */
        Boolean doc_modified;   /* document modification flag               */
    }XmHTMLAnchorCallbackStruct;
    	
    The doit member is only meaningfull when the callback reason is XmCR_ACTIVATE and the referenced anchor is a local (named) anchor. When set to True, the widget will scroll to the referenced anchor. When this member is False (default), the widget will not scroll to the named anchor.

    The visited member is only meaningfull when the callback reason is XmCR_ACTIVATE and the referenced anchor is a local (named) anchor. When set to True, the referenced anchor will be rendered using the XmNanchorVisitedForeground and XmNanchorVisitedUnderlineType resources. The default value for this member is False.

    The doc_modified member should be set to True when an action taken during processing of this callback results in a modification of the currently displayed document. The default value for this member is False.

    The XmNanchorTrackCallback callback is called twice for an anchor: once when the pointer is moved into an anchor and once when it is moved away from an anchor. In the latter case, all fields except reason and event will be NULL.

    See XmHTMLGetURLType(3X) for possible values and meaning of the url_type field.

    XmNdocumentCallback

    XmNdocumentCallback references the following structure:

    typedef struct{
        int reason;             /* the reason the callback was called       */
        XEvent *event;          /* always NULL for XmNdocumentCallback      */
        Boolean html32;         /* True if document was HTML 3.2 conforming */
        Boolean verified;       /* True if document has been verified       */
        Boolean balanced;       /* True if parser tree is balanced          */
        Boolean terminated;     /* True if parser terminated prematurely    */
        int pass_level;         /* current parser level count. Starts at 1  */
        Boolean redo;           /* perform another pass?                    */
    }XmHTMLDocumentCallbackStruct, *XmHTMLDocumentPtr;
    	
    The verified field is set to True when the internal parses has successfully verified the HTML semantics of the loaded document, while the balanced field will be True when the parser has generated a balanced tree. A balanced tree is one in which all terminated HTML elements have their opening and closing members at the same level in the tree. The pass_level field contains the number of passes performed so far by the parser.

    Setting the redo field to True will instruct the parser to make another pass on the current document. It is only effective when the parser failed to generate a balanced tree since using an unbalanced tree can lead to weird markup. When the balanced field is false, the default value for this field is True.

    When no XmNdocumentCallback callback resource is installed, the internal HTML parses will make at most two passes on the current document.

    XmNeventCallback

    XmNeventCallback references the following structure:

    typedef struct{
        int reason;             /* the reason the callback was called       */
        XEvent *event;          /* event structure that triggered callback  */
        int type;               /* HTML4.0 event type, see below            */
        XtPointer data;         /* HTML4.0 event callback data              */
        Boolean doc_modified;   /* document modification flag               */
    }XmHTMLEventCallbackStruct;
    	
    Where type identifies a HTML4.0 event and data any data returned by the function installed on the XmNeventProc resource.

    The doc_modified member should be set to True when an action taken during processing of an event results in a modification of the currently displayed document. Failing to update this member properly while the document is changed during event processing will lead to serious problems since XmHTML's internal data structures will then no longer refer to the currently displayed document.

    The table shown below lists all events for which a modification of the document is supported during event processing. The default value for this member is False.

    type can have any of the following values:

    type value HTML4.0 event doc_modified allowed?
    XmCR_HTML_LOAD onLoad No
    XmCR_HTML_UNLOAD onUnLoad No
    XmCR_HTML_SUBMIT onSubmit Yes
    XmCR_HTML_RESET onReset Yes
    XmCR_HTML_FOCUS onFocus Yes
    XmCR_HTML_BLUR onBlur Yes
    XmCR_HTML_SELECT onSelect Yes
    XmCR_HTML_CHANGE onChange Yes
    XmCR_HTML_CLICK onClick Yes
    XmCR_HTML_DOUBLE_CLICK onDblClick Yes
    XmCR_HTML_MOUSEDOWN onMouseDown Yes
    XmCR_HTML_MOUSEUP onMouseUp Yes
    XmCR_HTML_MOUSEOVER onMouseOver Yes
    XmCR_HTML_MOUSEMOVE onMouseMove Yes
    XmCR_HTML_MOUSEOUT onMouseOut Yes
    XmCR_HTML_KEYPRESS onKeyPress Yes
    XmCR_HTML_KEYDOWN onKeyDown Yes
    XmCR_HTML_KEYUP onKeyUp Yes

    The expected behavior depends on the value of the reason field:

    XmCR_EVENT
    A HTML4.0 event occured on an element in the currently displayed document. The application should undertake any actions that correspond to the HTML4.0 event type. data identifies the data associated with this particular event (which can be different depending on the HTML tag that triggered this event).

    XmCR_EVENTDESTROY
    This reason occurs as part of the document unloading process, e.i., prior before a new document is loaded. Any application data stored to serve the HTML4.0 event type can be freed safely.

    XmNformCallback

    XmNformCallback references the following structure:

    typedef struct{
        int reason;             /* the reason the callback was called       */
        XEvent *event;          /* event structure that triggered callback  */
        String action;          /* URL or cgi-bin destination               */
        String enctype;         /* form encoding                            */
        int method;             /* Form Method, GET (0) or POST (1)         */
        int ncomponents;        /* no of components in this form            */
        XmHTMLFormDataPtr components;
        Boolean doc_modified;   /* document modification flag               */
    }XmHTMLFormCallbackStruct, *XmHTMLFormPtr;
    	
    Where the XmHTMLFormDataPtr field points to an array of structures of the following type:

    typedef struct{
        componentType type;     /* Form component type  */
        String name;            /* component name       */
        String value;           /* component value      */
    }XmHTMLFormDataRec, *XmHTMLFormDataPtr;
    	
    The componentType type identifies the type of the form member that is to be submitted. Possible values are:

    typedef enum{
        FORM_TEXT = 1,          /* textfield            */
        FORM_PASSWD,            /* password textfield   */
        FORM_CHECK,             /* checkbox             */
        FORM_RADIO,             /* radiobox             */
        FORM_RESET,             /* reset button         */
        FORM_FILE,              /* filelisting          */
        FORM_SELECT,            /* select parent        */
        FORM_OPTION,            /* select child         */
        FORM_TEXTAREA,          /* multiline edit field */
        FORM_IMAGE,             /* drawbutton           */
        FORM_HIDDEN,            /* hidden input         */
        FORM_SUBMIT             /* submit button        */
    }componentType;
    	

    The doc_modified member should be set to True when an action taken during processing of this callback results in a modification of the currently displayed document. The default value for this member is False.

    XmNframeCallback

    XmNframeCallback references the following structure:

    typedef struct{
        int reason;         /* the reason the callback was called       */
        XEvent *event;      /* event structure that triggered callback  */
        String src;         /* requested document                       */
        String name;        /* frame name                               */
        Widget html;        /* XmHTML widget id                         */
        Boolean doit;       /* destroy/create vetoing flag              */
    }XmHTMLFrameCallbackStruct, *XmHTMLFramePtr;
    	
    The expected behavior depends on the value of the reason field:

    XmCR_HTML_FRAMECREATE
    A XmHTML Widget is about to create a xmHTMLWidgetClass widget (referred to as a frame) to be used as part of a HTML frameset.

    The src field contains the URL where a source document destined for this frame can be obtained. The name field contains the name given to this frame by the author of the document. If no name has been provided in the frameset definition, XmHTML will use _frame appended with a rank number as a default name.

    The doit field is set to True by default. When this field is set to False and the html field (which is initially NULL) is set to contain the id of a xmHTMLWidgetClass widget, XmHTML will use this widget as a frame and will not create a new one when this callback function returns. When the doit field is unchanged, or when the provided widget ID does not identify a Widget of class xmHTMLWidgetClass, XmHTML will create a frame.

    Each frame created by XmHTML in response to a HTML frameset will be a child of the XmHTML widget in which the original document was loaded.

    XmCR_HTML_FRAME
    A XmHTML Widget XmHTML has created a frame (or prepared the widget provided by the previous callback reason). The src and name field are unchanged, while the html field contains a valid widget id.

    This callback reason allows one to (amongst others) add callbacks (most noticeably a XmNactivateCallback) and resources (such as a XmNimageProc handler) to this newly created or reused widget.

    XmCR_HTML_FRAMEDESTROY
    A XmHTML Widget is about to destroy a frame. The src, name and html fields identify the frame that is to be destroyed. Modifying the value of the doit field from True (default) to False will veto the destruction of this frame, and subsequently this frame can be reused at a later stage.

    The name field is rather important for navigating between different frames in a frameset: anchors can reference to another frame by using the target attribute on the <A> tag. Knowing this, the reasons for this type of approach becomes apparent: to allow navigation between different frames in a frameset, one should not only know the name of the referenced frame but also the widget id of the corresponding frame. And this is exactly what this approach provides.

    XmNimagemapCallback

    XmNimagemapCallback references the following structure:

    typedef struct{
        int reason;           /* the reason the callback was called */
        XEvent *event;        /* points to event structure that triggered callback */
        int x,y;              /* pointer position relative to the upper-left
                               * corner of the image.
                               */
        String image_name;    /* name of referenced image  */
        String map_name;      /* name of imagemap to fetch */
        String map_contents;  /* contents of fetched imagemap */
    }XmHTMLImagemapCallbackStruct, *XmHTMLImagemapCallbackStructPtr;
    	
    The expected behavior depends on the value of the reason field:

    XmCR_HTML_IMAGEMAPACTIVATE

    THIS REASON IS UNIMPLEMENTED

    user clicked on an image. All fields except map_name are valid. x and y are relative to the upper-left corner of the image. Only invoked when an image has it's ismap attribute set and no client-side usemap is present for this image.

    XmCR_HTML_IMAGEMAP
    an image requires an external imagemap. Valid fields are image_name and map_name. The latter contains the location of the imagemap to fetch. If the contents of this imagemap are set in the map_contents field, it will be copied by the widget. Alternatively, one could also use the XmHTMLAddImagemap convenience function to set an imagemap into the widget.

    XmNlinkCallback

    XmNlinkCallback references the following structure:

    typedef struct{
        int reason;                 /* the reason the callback was called       */
        XEvent *event;              /* event structure that triggered callback  */
        int num_link;               /* number of LINK info to process           */
        XmHTMLLinkDataPtr link;     /* array of LINK info to process            */
    }XmHTMLLinkCallbackStruct, *XmHTMLLinkPtr;
    	
    Where the XmHTMLLinkDataPtr field points to an array of structures of the following type:
    typedef struct{
        String url;             /* value of URL tag     */
        String rel;             /* value of REL tag     */
        String rev;             /* value of REV tag     */
        String title;           /* value of TITLE tag   */
    }XmHTMLLinkDataRec, *XmHTMLLinkDataPtr;
    	

    Translations

    The translations for XmHTML include those from Manager, as well as the following.

    Virtual Event Actual Event Action
    BSelect Press None<Btn1>Press extend-start()
    BDrag Press None<Btn2>Press extend-start()
    BSelect Motion None<Btn1>Motion extend-adjust()
    BDrag Motion None<Btn2>Motion extend-adjust()
    BSelect Release None<Btn1>Release extend-end()
    BDrag Release None<Btn1>Release extend-end()
    Motion Motion track-motion()
    KHelp None<Key>osfHelp ManagerGadgetHelp()
    KPageUp None<Key>osfPageUp page-up-or-left(0)
    KPageDown None<Key>osfPageDown page-down-or-right(0)
    KPageLeft !Ctrl<Key>osfPageUp page-up-or-left(1)
    KPageRight !Ctrl<Key>osfPageDown page-down-or-right(1)
    KUp None<Key>osfUp increment-up-or-left(0)
    KDown None<Key>osfDown increment-down-or-right(0)
    KLeft None<Key>osfLeft increment-up-or-left(1)
    KRight None<Key>osfRight increment-down-or-right(1)
    KBeginData !Ctrl<Key>osfBeginLine top-or-bottom(0)
    KEndData !Ctrl<Key>osfEndLine top-or-bottom(1)
    Press <Key>Press process-html-input()
    Release <Key>Release process-html-input()

    These translations mask off any key and button modifiers (except where noted otherwise), and as such application programmers can use any modifiers on the events shown above for their own purposes.

    Action Routines

    XmHTML defines the following action routines:
    extend-adjust()
    Selects text that is between the pointer anchor and the current pointer location, while deselecting text that is outside this area. As a result of this action, when the pointer moves past lines of text, these lines are selected and the current line is selected up to the position of the pointer.

    extend-end()
    Ends the selection performed by extend-adjust. When the current selection is an exclusive HTML anchor, this action routine also invokes the list of callbacks specified by XmNactivateCallback.

    extend-start()
    Invalidates any previous selection, sets the pointer anchor and prepares for selecting text via the extend-adjust action. This action routine invokes the list of callbacks specified by XmNarmCallback.

    increment-up-or-left(flag)
    Moves the visible area by one increment - upward if flag is 0; to the left if flag is 1.

    increment-down-or-right(flag)
    Moves the visible area by one increment - downward if flag is 0; to the right if flag is 1.

    page-up-or-left(flag)
    Moves the visible area by one page - upward if flag is 0; to the left if flag is 1.

    page-down-or-right(flag)
    Moves the visible area by one page - downward if flag is 0; to the right if flag is 1.

    process-html-input()
    This action routine processes all remaining keyboard events and invokes the list of callbacks specified by XmNinputCallback.

    top-or-bottom(flag)
    Moves the visible area - to the top of the text if flag is 0; to the bottom of the text if flag is 1.

    track-motion
    This action routine processes any pointer movement events. When pointer movement takes place over a HTML anchor, the list of callbacks specified by XmNanchorTrackCallback is invoked, otherwise it invokes the list of callbacks specified by XmNmotionTrackCallback.

    Additional Behavior

    XmHTML has additional behavior associated with <Leave> and <FocusOut> which invokes the list of callbacks specified by XmNanchorTrackCallback. Also, XmHTML attaches Manager's ManagerGadgetHelp() action routine to the workWindow.

    See Also

    Core(3X), Composite(3X), Constraint(3X), Manager(3X),

    XmHTML, September 1, 1998 XmHTML-1.1.7/html/man/ImInfo.html100644 23564 23564 35555 6431721247 14735 0ustar newtnewt XmHTML Programmers Manual: XmImageInfo Structure

    Name

    XmImageInfo structure - XmHTML External Image definition.

    Description

    The XmImageInfo structure forms the core of the image support offered by a XmHTML Widget. The information contained within this structure allow a XmHTML Widget to correctly create and display the image represented by this structure.

    Structures

    	typedef struct _XmImageInfo{
    	    /* regular image fields */
    	    String url;                  /* original location of image        */
    	    unsigned char *data;         /* raw image data.                   */
    	    unsigned char *clip;         /* raw clipmask data. XYBitmap format*/
    	    Dimension width;             /* used image width, in pixels       */
    	    Dimension height;            /* used image height, in pixels      */
    	    Dimension *reds;             /* red image pixels                  */
    	    Dimension *greens;           /* green image pixels                */
    	    Dimension *blues;            /* blue image pixels                 */
    	    int bg;                      /* transparent pixel index           */
    	    unsigned int ncolors;        /* Used number of colors             */
    	    unsigned int options;        /* configuration options             */
    
    	    /* image classification fields and original data */
    	    unsigned char type;          /* image type                        */
    	    unsigned char depth;         /* image bits per pixel              */
    	    unsigned char colorspace;    /* image colorspace                  */
    	    unsigned char transparency;  /* image transparency type           */
    	    Dimension swidth;            /* original image width              */
    	    Dimension sheight;           /* original image height             */
    	    unsigned int scolors;        /* original number of colors         */
    
    	    /* Alpha Channel Section */
    	    unsigned char *alpha;        /* alpha channel data                */
    	    float fg_gamma;              /* image gamma                       */
    
    	    /* Additional animation data */
    	    int x;                       /* frame x-position                  */
    	    int y;                       /* frame y-position                  */
    	    int loop_count;              /* animation loop count              */
    	    unsigned char dispose;       /* image disposal method             */
    	    int timeout;                 /* frame refreshment in milliseconds */
    	    int nframes;                 /* no of animation frames remaining  */
    	    struct _XmImageInfo *frame;  /* ptr to next animation frame       */
    
    	    XtPointer user_data;         /* room for user data                */
    	}XmImageInfo, *XmImageInfoStruct;
    
    As one can see, there are four different sections to this structure.

    Regular Image Data Section

    Specifies all the data required by a XmHTML Widget to create and display an image.

    • url
        Specifies the name of the image;
    • data
        Specifies the actual image data. This is a stream of bytes in which each byte represents an index in the image's colormap. Each value must lie in the range 0-255 inclusive;
    • clip
         Specifies possible image clipmask data. This is a stream of bytes in XYBitmap format. A XmHTML Widget will use this data to create a clipping bitmap which will cause the displayed image to be transparent;
    • width, height
         Specifies the dimensions of the image. The size of the image data is taken as the product of these two numbers;
    • reds, greens, blues
         Specifies the colormap used by the image. These arrays contain respectively the red, green and blue components that make up a color. Each value must lie in the range 0-255 inclusive. Each byte in the actual image data represents an index into each of these arrays;
    • ncolors
         Specifies the number of entries for each of the red, green and blue color arrays with a maximum value of 256;
    • bg
         Specifies the transparent pixel index. Each byte in the image data that has this value is considered as being transparent. A value of -1 specifies that the image is not transparent;
    • ncolors
         image configuration options. See below.

    Alpha Channel Section

    An Alpha Channel is a (complex) method to achieve transparency at pixel level. It is a series of values used to compute partial pixel transparency. These values range from 0 (fully transparent) to 255 (fully opaque). All intermediate values specify a certain amount of transparency for each pixel in the image.

    • alpha
         Specifies alpha channel data. The size of this array must be equal to the size of the image data;
    • fg_gamma
         Specifies the foreground gamma correction. It is used in combination with the display gamma value to correct the brightness for each color.

    Animation Section

    Specifies additional data a XmHTML Widget will use to create and display an animation. An animation consists of a number of frames which are all displayed in sequence. The size of the first frame in an animation defines the logical screen area: each subsequent frame will be positioned relative to and in this area. Frames of which the dimensions exceed the logical screen area and frames of which portions fall outside the logical screen area will be automatically clipped.

    • x,y
         Specify the position of the current frame with respect to the dimensions of the logical screen;
    • loop_count
         Specifies the number of times an animation should be repeated. A value of zero specifies infinite repetition;
    • dispose
         The disposal method that is to be used for this frame. Possible values are: XmIMAGE_DISPOSE_NONE (do nothing, overlays the previous frame with the current frame), XmIMAGE_DISPOSE_BY_BACKGROUND (Restore to background setting, the area used by the previous frame is restored to current background color or image) and XmIMAGE_DISPOSE_BY_PREVIOUS (restore to previous, the area used by the previous frame is restored to what was there prior to rendering the previous frame).
    • timeout
         Specifies the number of milliseconds that is to be waited before the next frame is displayed;
    • nframes
         Specifies the total number of frames in an animation;
    • frame
         Specifies the next frame;

    Image Classification Section

    This section contains data that is unused by a XmHTML Widget but is provided for your convenience. It provides additional information about the image.

    • type
         Specifies the original format of the image. See XmHTMLImageGetType for a list of possible values;
    • depth
         Specifies the number of bits per pixel. It indicates how many bits are used to store a single color, and hints to the maximum number of colors the image can have.
    • colorspace
         Specifies the original colorspace used by this image. Possible values are: XmIMAGE_COLORSPACE_GRAYSCALE (only shades of gray, all components in a shade have the same value), XmIMAGE_COLORSPACE_INDEXED (original image refers to a predefined colormap) and XmIMAGE_COLORSPACE_RGB (the original image data is in rgb format);
    • transparency
         Specifies the type of transparency that is to be employed for this image. Possible values are: XmIMAGE_NONE (the image is fully opaque), XmIMAGE_TRANSPARENCY_BG (the image achieves transparency by substituting the current background setting) and XmIMAGE_TRANSPARENCY_ALPHA(the image achieves transparency by using an alpha channel. This is currently only used by PNG images with an alpha channel or a tRNS chunk).
    • swidth, sheight
         Specify the original image dimensions. These values can differ from the width and height fields if the image has been scaled;
    • scolors
         Specifies the original number of colors in the image. This value is smaller than the ncolors field if the image has been quantized, and it can be larger than, equal to or less than the ncolors field if the image has been dithered; It's value is rather meaningless for the XmIMAGE_COLORSPACE_RGB colorspace.

    The last field in the structure (the user_data field) is unused by a XmHTML Widget and can be used to store any data one might want to associate with this image (when this image is being loaded progressively for example, this field can be used to store administration data).

    Options

    There are several options that influence the behaviour of the XmImageInfo structure. These options affect the actual image creation, the way the actual image should be created, if and when this structure should be destroyed and how this should be done. Each option sets a specific bit and multiple options can be OR'd together.

    The available options are listed below. When the description reads "Set By Default" it indicates an option that is set when a XmImageInfo structure was obtained using the XmHTMLImageDefaultProc convenience function.

    #define XmIMAGE_DELAYED          (1<<1)
    Indicates the image is delayed, e.i. it will be provided at a later stage. When a XmHTML Widget encounters this bit, it will display a default image instead of the actual image (the actual image data is unknown at this point). Once the final image data is available, this bit should be unset and one should use either the XmHTMLImageUpdate or XmHTMLImageReplace convenience function to instruct a XmHTML Widget to create the actual image;

    #define XmIMAGE_DEFERRED_FREE    (1<<2)
    Indicates XmHTML may free this structure when a new document is loaded.
    Set By default;

    #define XmIMAGE_IMMEDIATE_FREE  (1<<3)
    Indicates XmHTML may free this structure when XmHTML no longer needs it;

    #define XmIMAGE_RGB_SINGLE       (1<<4)
    Indicates that the reds, greens and blues fields are allocated in a single memory area instead of three seperate memory arrays.
    Set By Default;

    #define XmIMAGE_ALLOW_SCALE      (1<<5)
    Indicates that a XmHTML Widget is allowed to scale an image. This option has been made available after carefull consideration: the HTML 3.2 standard specifically forbids scaling of images if the width and height arguments of the <IMG> tag do not match the actual image dimensions. However, it is common use to specify incorrect dimensions to scale the image and hence one can choose to adhere to the standard or allow this common misbehaviour.
    WARNING: not setting this bit will prevent an image to be scaled.
    Set By Default;

    #define XmIMAGE_FRAME_IGNORE     (1<<6)
    Use with animations: set this bit when a frame falls outside the logical screen area. No pixmap is created but the timeout for the frame is kept.

    #define XmIMAGE_CLIPMASK         (1<<7)
    This bit should be set a XmImageInfo structure contains clipmask data. XmHTML uses this info to create a clipping bitmap. Changing this bit from set to unset will lead to a memory leak while changing it from unset to set without providing a clipmask yourself will cause an error to happen. You can set this bit when you are providing your own clipmask (to provide non-rectangular images for example), PROVIDED you fill the "clip" field with valid bitmap data;

    #define XmIMAGE_SHARED_DATA      (1<<8)
    This bit should be set when images share data. XmHTML sets this bit when the image in question is an internal image, e.i., one for which the image data may never be freed. Be carefull setting this bit yourself, since it prevents XmHTML from freeing the image data present in the XmImageInfo structure. It can easily lead to memory leaks when an image is not an internal image.

    #define XmIMAGE_PROGRESSIVE      (1<<9)
    Setting this bit will enable XmHTML progressive image loading. The present XmHTML Beta (1.1.0 as of this writing) contains a number of provisions to enable progressive image loading, but the interface is not yet fully defined.

    #define XmIMAGE_DELAYED_CREATION (1<<10)
    Set this bit for images with an alpha channel present. Alpha channel processing merges the current background with the original image data using the alpha channel data to compose the actual on-screen image. When this bit is set, the XmImageInfo structure may not be freed as long as the current document is alive: to properly compose the actual image, both information on the current background and the on-screen position is required.

    See Also

    XmHTML(3X), XmHTMLImageDefaultProc(3X), XmHTMLImageFreeImageInfo(3X), XmImageCreate(3X), XmImageCreateFromInfo(3X), XmImageDestroy(3X), XmImage(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/XmImage.html100644 23564 23564 14154 6431721247 15073 0ustar newtnewt XmHTML Programmers Manual: XmImage Structure

    Name

    XmImage structure - XmImage Image definition.

    Description

    A XmImage structure is returned by the XmImageCreate and XmImageCreateFromInfo convenience routines.

    See XmImageInfo(3X) for more information about the dispose field in the XmImageFrame structure.

    The pixmap and clip fields in the XmImage structure can be used directly in calls to XCopyArea(3X).

    Structures

    	/* XmImage definition */
    
    	typedef struct{
    	    String file;                /* originating file                    */
    	    unsigned char type;         /* image type, see XmHTMLImageGetType  */
    	    Pixmap pixmap;              /* actual image                        */
    	    Pixmap clip;                /* for transparant pixmaps             */
    	    unsigned int options;       /* image option bits                   */
    	    int width;                  /* current image width, in pixels      */
    	    int height;                 /* current image height, in pixels     */
    	    int ncolors;                /* no of colors in this image          */
    	    int scolors;                /* specified no of colors              */
    	    int swidth;                 /* image width as read from image      */
    	    int sheight;                /* image height as read from image     */
    	    int depth;                  /* depth of this image                 */
    	    int npixels;                /* no of really allocated pixels       */
    	    GC gc;                      /* graphics context for rendering      */
    
    	    /* animation data */
    	    XmImageFrame *frames;       /* array of animation frames           */
    	    int nframes;                /* no of frames following              */
    	    int current_frame;          /* current frame count                 */
    	    int current_loop;           /* current loop count                  */
    	    int loop_count;             /* maximum loop count                  */
    	    XtIntervalId proc_id;       /* timer id for animations             */
    	    Widget w;                   /* image owner                         */
    	    XtAppContext context;       /* Application context for animations  */
    
    	    /* private data */
    	    struct _XColorContext *xcc; /* a lot of visual info                */
    	}XmImage;
    
    	/* XmImageFrame: animation frame definition */
    
    	typedef struct{
    	    int x;                  /* x position in logical screen        */
    	    int y;                  /* y position in logical screen        */
    	    int w;                  /* width of this particular frame      */
    	    int h;                  /* height of this particular frame     */
    	    int timeout;            /* timeout for the next frame          */
    	    unsigned char dispose;  /* previous frame disposal method      */
    	    Pixmap pixmap;          /* actual image                        */
    	    Pixmap clip;            /* image clipmask                      */
    	    Pixmap prev_state;      /* previous screen state               */
    	}XmImageFrame;
    
    	/*
    	 * XmImage options bits (defined in XmHTMLP.h).
    	 * There are more options defined but they are private to XmHTML.
    	 * The IMG_ISANIM and IMG_HASSTATE bits may not be touched when
    	 * they have been set.
    	 */
    
    	#define IMG_ISANIM          (1L<<4) /* is an animation                  */
    	#define IMG_FRAMEREFRESH    (1L<<5) /* animation is running             */
    	#define IMG_HASSTATE        (1L<<7) /* current state pixmap present     */
    
    	/* XmImage configuration flags */
    
    	#define ImageFSDither       (1L<<1) /* Floyd-Steinberg error correction */
    	#define ImageCreateGC       (1L<<2) /* create gc for image              */
    	#define ImageWorkSpace      (1L<<3) /* create animation workspace       */
    	#define ImageClipmask       (1L<<4) /* create clipmask                  */
    	#define ImageBackground     (1L<<5) /* substitute background pixel      */
    	#define ImageQuantize       (1L<<6) /* quantize image                   */
    	#define ImageMaxColors      (1L<<7) /* sets maximum colors              */
    	#define ImageGifDecodeProc  (1L<<8) /* gif lzw decoder function         */
    	#define ImageGifzCmd        (1L<<9) /* gif lzw uncompress command       */
    	#define ImageFrameSelect    (1L<<10)/* frame selection                  */
    	#define ImageScreenGamma    (1L<<11)/* gamma correction. JPEG/ PNG only */
    
    	/* XmImage configuration */
    
    	typedef struct{
    	    unsigned long flags;        /* XmImage configuration flags,    */
    	    int ncolors;                /* desired number of colors        */
    	    int which_frames;           /* animation frames selection flag */
    	    int bg_color;               /* transparent pixel               */
    	    String z_cmd;               /* gif uncompress command          */
    	    XmImageGifProc gif_proc;    /* external gif decoder            */
    	    float gamma;                /* gamma correction. JPEG/PNG only */
    	}XmImageConfig;
    

    See Also

    XmHTML(3X), XmImageCreate(3X), XmImageCreateFromInfo(3X), XmImageDestroy(3X), XmImageInfo(3X), XmHTMLGIFStream(3X)

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/HTObject.html100644 23564 23564 2546 6431721247 15170 0ustar newtnewt XmHTML Programmers Manual: @NAME

    Name

    Synopsis

    Description

    Return Value

    See Also


    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/HTPapSiz.html100644 23564 23564 2546 6431721247 15170 0ustar newtnewt XmHTML Programmers Manual: @NAME

    Name

    Synopsis

    Description

    Return Value

    See Also


    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/HTPLCStr.html100644 23564 23564 2546 6431721247 15071 0ustar newtnewt XmHTML Programmers Manual: @NAME

    Name

    Synopsis

    Description

    Return Value

    See Also


    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/HTGIFStr.html100644 23564 23564 16145 6431721247 15100 0ustar newtnewt XmHTML Programmers Manual: XmHTMLGIFStream Structure

    Name

    XmHTMLGIFStream structure - XmHTML External GIF Decoder Interface Definition.

    Description

    The XmHTMLGIFStream structure is the sole argument to any function installed on the XmNdecodeGIFProc resource of a XmHTML Widget or the gif_proc field of the XmImage structure.

    This interface definition allows one to override the default GIF decoder employed by a XmHTML Widget.

    You might ask yourself: Why is this beast even present? The answer is that the image data in a GIF image is stored using the LZW (Lev-Zempel-Welch) compression method, the patent of which is owned by Unisys Corp. In order to use this algorithm (for either compression or decompression of compressed data), Unisys Corp. requires one to obtain a (costly) license. The default GIF decoded used by a XmHTML widget employs a work-around method (which involves the use of compress(1) or gzip(1)) that is a tad slower when compared with a real LZW decoder.

    The XmHTMLGIFStream structure and XmImageGifProc prototype allow holders of a LZW patent and authors of free software to surpass this workaround and hence achieve a (small to considerable) performance increase.

    Structures

    	/* Prototype for the XmNdecodeGIFProc resource */
    	typedef int (*XmImageGifProc)(XmHTMLGIFStream*);
    
    	/*
    	 * Possible return values for the XmNdecodeGIFProc resource and 
    	 * values for the XmHTMLGIFStream state field.
    	 */
    
    	#define GIF_STREAM_OK		 2
    	#define GIF_STREAM_END		 1
    	#define GIF_STREAM_ERR		 0
    	#define GIF_STREAM_INIT		-1
    	#define GIF_STREAM_FINAL	-2
    
    	/* XmHTMLGIFStream definition */
    
    	typedef struct _XmHTMLGIFStream{
    	    /* read-only fields */
    	    int state;                  /* decoder state                        */
    	    int codesize;               /* initial LZW codesize                 */
    	    Boolean is_progressive;     /* when used by a progressive loader    */
    	    unsigned char *next_in;     /* next input byte                      */
    	    Cardinal avail_in;          /* number of bytes available at next_in */
    	    Cardinal total_in;          /* total nb of input bytes read so far  */
    
    	    /* fields to be updated by caller */
    	    unsigned char *next_out;    /* next output byte should be put here  */
    	    Cardinal avail_out;         /* remaining free space at next_out     */
    	    Cardinal total_out;         /* total nb of bytes outputted so far   */
    
    	    String msg;                 /* last error message, or NULL          */
    	    XtPointer external_state;   /* room for decoder-specific data       */
    	}XmHTMLGIFStream;
    
    

    Examples

    Shown below is a typical example of a custom GIF decoder that demonstrates the proper use of the XmHTMLGIFStream structure.
    	int decodeGIF(XmHTMLGIFStream *gstream)
    	{
    	    int v;
    	    unsigned char *dp;
    
    	    /* XmHTML is initializing itself */
    	    if(gstream->state == GIF_STREAM_INIT )
    	    {
    	        gstream->external_state = some_LZW_init_func(gstream->codesize);
    	        /* and return OK */
    	        return(GIF_STREAM_OK);
    	    }
    
    	    /* end-of-data ? */
    	    if(gstream->state == GIF_STREAM_FINAL ||
    	        gstream->state == GIF_STREAM_END )
    	    {
    	        some_LZW_cleanup_func(gstream->external_state);
    	        return(GIF_STREAM_END);
    	    }
    
    	    /* current position in decoded output buffer */
    	    dp = gstream->next_out;
    
    	    for( ; gstream->avail_out ; gstream->total_out++,
    	        gstream->avail_out-- )
    	    {
    	        if((v = some_LZW_decoder_func(gstream->external_state))
    	            < some_valid_value)
    	        {
    	            if(v == some_end_of_data_signal)
    	                return(GIF_STREAM_END);
    	            /* processed all current data */
    	            return(GIF_STREAM_OK);
    	        }
    	        *dp++ = v;
    	    }
    	    /* end if we run out of data */
    	    return(gstream->avail_out ? GIF_STREAM_OK : GIF_STREAM_END);
    	}
    

    Disclaimer

    THIS INFORMATION IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND. THE AUTHOR SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE OR ANY PART THEREOF. IN NO EVENT WILL THE AUTHOR BE LIABLE FOR ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL DAMAGES.

    IF YOU DECIDE TO USE THE INFORMATION CONTAINED IN THIS FILE TO CONSTRUCT AND USE THE LZW ALGORITHM YOU AGREE TO ACCEPT FULL RESPONSIBILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRECTS OR ANY PATENTS. IN NO EVENT WILL THE AUTHOR BE LIABLE FOR ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL DAMAGES, INCLUDING BUT NOT LIMITED TO ANY DAMAGES RESULTING FROM ANY ACTIONS IN A COURT OF LAW.

    YOU ARE HEREBY WARNED THAT USE OF THE LZW ALGORITHM WITHOUT HAVING OBTAINED A PROPER LICENSE FROM UNISYS CONSTITUTES A VIOLATION OF APPLICABLE PATENT LAW. AS SUCH YOU WILL BE HELD LEGALLY RESPONSIBLE FOR ANY INFRINGEMENT OF THE UNISYS LZW PATENT.

    UNISYS REQUIRES YOU TO HAVE A LZW LICENSE FOR EVERY TASK IN WHICH THE LZW ALGORITHM IS BEING USED (WHICH INCLUDES DECODING THE LZW COMPRESSED RASTER DATA AS FOUND IN GIF IMAGES). THE FACT THAT YOUR APPLICATION MAY OR MAY NOT BE DISTRIBUTED AS SHAREWARE IS OF NO CONCERN TO UNISYS.

    IF YOU RESIDE IN A COUNTRY WHERE SOFTWARE PATENT LAWS DO NOT APPLY, PLEASE BE WARNED THAT EXPORTING SOFTWARE CONTAINING THE LZW ALGORITHM TO COUNTRIES WHERE SOFTWARE PATENT LAW *DOES* APPLY WITHOUT A VALID LICENSE ALSO CONSTITUTES A VIOLATION OF PATENT LAW IN THE COUNTRY OF DESTINATION.

    The Unisys Corporation Licensing Department can be contacted at lzw_info@unisys.com.

    See Also

    XmHTML(3X), XmImage(3X), U.S. Patent 4,558,302

    XmHTML, October 7, 1997 XmHTML-1.1.7/html/man/empty.html100644 23564 23564 2035 6535406330 14653 0ustar newtnewt XmHTML Programmers Manual: TBD

    Sorry, this information is not yet available.


    ©Copyright 1996-1997 by Ripley Software Development
    June 4, 1998 by Koen

    XmHTML-1.1.7/html/man/TxtStrWl.html100644 23564 23564 4531 6535377155 15307 0ustar newtnewt XmHTML Programmers Manual: XmHTMLTextSetString

    Name

    XmHTMLTextSetStringWithLength - set a (new) HTML source text in a XmHTML widget.

    Synopsis

    void XmHTMLTextSetStringWithLength(Widget w, String text, size_t len)

    Description

    XmHTMLTextSetStringWithLength loads a HTML source text in a XmHTML widget. The previously displayed document is destroyed.

    The sole difference with the XmHTMLTextSetString convenience function is that the text argument need not be null terminated. This function allows one to display text as it is being received and can be used as a limited form of dynamic document loading.

    w
    Specifies the widget ID of a widget of class xmHTMLWidgetClass
    text
    Specifies the new source text. A value of NULL effectively erases the currently displayed document without displaying a new document. The widget will make a private copy of this new source, so one can safely free text when this function returns.
    len
    length of text.

    See Also

    XmHTML(3X), XmHTMLTextGetSource(3X), XmHTMLTextGetString(3X)

    XmHTML, June 4, 1998 XmHTML-1.1.7/html/man.html100644 23564 23564 7222 6535402057 13522 0ustar newtnewt XmHTML Programmers Manual: Manual Pages

    XmHTML Widget Set Manual Pages

    XmHTML Convenience Functions




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: June 4, 1998 by Koen

    XmHTML-1.1.7/html/datatypes.html100644 23564 23564 15351 6535406044 14767 0ustar newtnewt XmHTML Programmers Manual: Datatypes

    XmHTML Widget Set Datatypes

    XmHTML Datatypes

    componentType
    An enumeration value used by the XmNformCallback callback resource. Identifies the type of a form member. Possible values are:

    FORM_CHECK checkbox
    FORM_FILE file selection box
    FORM_HIDDEN hidden input
    FORM_IMAGE drawnbutton
    FORM_OPTION select child
    FORM_PASSWD password textfield
    FORM_RADIO radiobox
    FORM_RESET reset button
    FORM_SELECT select parent
    FORM_SUBMIT submit button
    FORM_TEXT singleline textfield
    FORM_TEXTAREA multiline edit field
    FORM_UNKNOWN unknown type

    htmlEnum
    An enumeration value representing a HTML tag. There are too many values to list them all (more than 70). See <XmHTML/HTML.h> for a complete list of the possible values this datatype can have.

    URLType
    An enumeration value representing the type of a Uniform Resource Locater. Possible values are:

    ANCHOR_ABOUT href="about:..."
    ANCHOR_EXEC href="exec:foo_bar"
    ANCHOR_FILE_REMOTE href="file://foo.bar/file.html"
    ANCHOR_FTP href="ftp://foo.bar/file"
    ANCHOR_GOPHER href="gopher://foo.bar:70"
    ANCHOR_HTTP href="http://foo.bar/file.html"
    ANCHOR_SECURE_HTTP href="https://foo.bar/file.html"
    ANCHOR_INFO href="info:.."
    ANCHOR_MAILTO href="mailto:foo@bar"
    ANCHOR_MAN href="man:..."
    ANCHOR_NEWS href="news://foo.bar"
    ANCHOR_PIPE href="pipe:foo_bar"
    ANCHOR_TELNET href="telnet://foo.bar:23"
    ANCHOR_WAIS href="wais://foo.bar"
    ANCHOR_XEXEC href="xexec:foo_bar"
    ANCHOR_UNKNOWN unknown href
    ANCHOR_FILE_LOCAL href="file.html"
    ANCHOR_JUMP href="#..."
    ANCHOR_NAMED name="...."

    XmHTMLDirection
    Specifies the search direction. Valid values are: XmHTML_FORWARD, search forward, and XmHTML_BACKWARD, search backwards.

    XmHTMLElementId
    An opaque type representing a user-installed HTML element. Used by the XmNobjectCallback callback resource.

    XmHTMLObjectId
    An opaque type representing an embedded object. Used by the XmNobjectCallback callback resource.

    XmHTMLRegexStatus
    Specifies the return value of the XmHTMLTextFindString convenience function. Possible values are:

    XmREG_ERROR indicates an error occured
    XmREG_NOMATCH end of text reached but no matching text found
    XmREG_MATCH a valid match was found

    XmHTMLTextFinder
    An opaque type representing a HTML text search engine.

    XmHTMLTextPosition
    An opaque type representing a location in the currently displayed document.

    XmHTMLObjectStatus
    An enumeration representing return values from the XmHTMLObject convenience functions. Possible values are:

    OBJECT_ALMOST action completed, further action required
    OBJECT_DESTROYED object has been destroyed
    OBJECT_EMPTY object is empty
    OBJECT_ERROR unknown error
    OBJECT_FATAL fatal object error has occured
    OBJECT_INVALID invalid object
    OBJECT_INVALID_LOCATION object has an invalid location
    OBJECT_INVALID_SIZE object has an invalid size
    OBJECT_LOWERED object is lowered into the current document
    OBJECT_MAPPED object is mapped to screen
    OBJECT_OK action completed succesfully
    OBJECT_ORPHANED object has no parent
    OBJECT_PARENTED object already has a parent
    OBJECT_RAISED object is raised out of the current document
    OBJECT_UNIMPLEMENTED requested function is unimplemented
    OBJECT_UNKNOWN unknown object
    OBJECT_UNKNOWN_ELEMENT invalid element id
    OBJECT_UNMAPPED object has been unmapped
    OBJECT_UNUSED object is not being used
    OBJECT_USED object is currently being used
    OBJECT_VISIBLE object is visible

    XmImageStatus
    An enumeration value representing the return value from the various XmImage convenience functions.

    XmIMAGE_ERROR unknown error occured
    XmIMAGE_BAD bad function call: missing arguments
    XmIMAGE_UNKNOWN provided XmImageInfo structure unknown/unbound
    XmIMAGE_ALMOST action completed, further response necessary
    XmIMAGE_OK action completed successfully




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: June 4, 1998 by Koen

    XmHTML-1.1.7/html/structures.html100644 23564 23564 6243 6535402043 15167 0ustar newtnewt XmHTML Programmers Manual: XmHTML Structures

    XmHTML Widget Set Manual Pages

    XmHTML Structures

    XmHTML Callback Structures




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: June 4, 1998 by Koen

    XmHTML-1.1.7/html/procedures.html100644 23564 23564 3751 6535402254 15124 0ustar newtnewt XmHTML Programmers Manual: Procedures

    XmHTML Widget Set Datatypes

    XmHTML Procedures




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: June 4, 1998 by Koen

    XmHTML-1.1.7/html/apps.html100644 23564 23564 27453 6603035777 13751 0ustar newtnewt XmHTML Widget Set Applications Page

    XmHTML Widget Set Applications Page

    This is a list of applications that are known to use XmHTML in some way. This list is most likely not complete and probably never will be.

    Name: Bosy
    Description: A threaded, online nntp newsreader
    Author: Patrick Caulfield, patrick@pandh.demon.co.uk
    URL: http://www.pandh.demon.co.uk/bosy.html
    XmHTML: Used as the message display area
      
    Name: MinD
    Description: A Motif INterface Designer by flux Software Gmbh.
    Author: Flux Software Gmbh.
    URL: http://www.flux-online.de
    A (free) demo version is available for download.
    XmHTML: Used for MinD's help system and supports XmHTML when building interfaces.
      
    Name: GNOME
    Description: The GNU Object Model Environment is a very strong-going effort to design a user-friendly desktop. GNOME is based on gtk, the toolkit developed by the Gimp authors.
    Author: Many, many people. gnome-list@gnome.org and other GNOME mailing lists.
    URL: http://www.gnome.org
    XmHTML: XmHTML has been ported to gtk for use with GNOME by Miguel de Icaza and Federico Mena and is used by a few GNOME core applications such as the GNOME help system.
      
    Name: gnucash
    Description: A GNOME accounting program, previously known as Xacc.
    Author Linas Vepstas, linas@fc.net
    URL: http://www.gnucash.org
    XmHTML: Used for it's help system.
      
    Name: GNUsheet
    Description: A GPL's spreadsheet program under development
    Author: Danny Backx Danny.Backx@kb.be
    URL: http://users.skynet.be/danny.backx/gnusheet.html
    XmHTML: Used for it's help system.
      
    Name: Balsa
    Description: GNOME email client.
    Author: Stuart Parmenter pavlov@innerx.net
    URL: http://www.balsa.net
    XmHTML: Used as the message display area
      
    Name: ArahDobby 2.8
    Description: Textile weaving CAD/CAM application, with on-screen 1:1 fabric simulation and printout, colorimetry support (CIE Lab) support for all Epson printer models (including Photo 700 and EX) JPEG, GIF export of fabric simulation simulation of multiple layer fabrics, denting, regulator weave editor, warp/weft pattern editor, yarn editor consumption calculation, blankets, optional PANTONE Textile Color System (R) support
    Author: Developed by Arahne, d.o.o., arahne@arahne.si
    URL: http://www.arahne.si
    XmHTML: XmHTML is used to display the production data sheet - yarn consumption calculation. The same data is then exported as HTML and printed out to be passed on to the production department of the weaving mill.
      
    Name: Common Desk Environment (CDE) email client (dtmail)
    Description: Sun Microsystem's CDE email client for the sending, receiving, and processing of email.
    Scheduled Release Date: Early 1999
    Author: Many persons over many years.
    URL: http://www.sun.com/solaris/cde
    XmHTML: Will be utilized to render html received as email from various other email clients such as Netscape, Outlook Express, Eudora, etc.
      
    Name: TNTmips
    Description: A commercial GIS/Image Processing package for Windows, Unix and Mac.
    Author: MicroImages, Inc.
    URL: http://www.microimages.com A lite version is available for download at the above url or can be obtained on CD for about US$35.
    XmHTML: We're using XmHTML for "About" boxes and stuff initially. Plan to eventually use the layout/rendering stuff by itself to render map legends as HTML text blocks.
      
    Name: NCAR DataVision
    (NCAR = National Center for Atmospheric Research)
    Description: GUI for accessing, processing, and visualizing scientific data based on the NCL command language
    Scheduled Release Date: Early 1999
    Authors: David Brown, Jeff Boote, Ethan Alpert. ncarginf@ucar.edu
    URL: http://www.ndv.ucar.edu/
    XmHTML: High level graphical objects (e.g. ContourPlot, VectorPlot) are configured using resources similar to those of Motif or the XmHTML widget itself. A tree widget displays information about the resources and has editable fields for modifying their values. Opening a resource's "Description" row causes an XmHTML widget to display within an XmFrame the documentation for that resource. The XmHTML widget's scrollbars are turned off and the frame is sized to fit the exact length of the resource's description. (Scrolling is provided external to the tree widget.) When more than one "Description" row is open, multiple XmHTML widgets are simultaneously instantiated each displaying a different portion of the document using the same XmHTML layout data structure (which is saved in a cache by the application). Plans call for the XmHTML widget to be embedded at other locations within the application as well. The goal is to make the application fully self-documenting.

     

    Submitting entries

    If you have a submission, please supply the following information:
    Name
    program's name

    Description
    a short description of the program's purpose.

    Scheduled Release Date
    Expected release date of the application (alpha, beta or final doesn't matter);

    Author
    author's name and email address;

    URL
    url where more information about the application can be obtained;

    XmHTML
    short description on how XmHTML is used by this application.

    Or you can mail your submissions to ripley@xs4all.nl.




    ©Copyright 1996-1998 by Ripley Software Development
    Last update: September 25, 1998 by Koen
    XmHTML-1.1.7/http/ 40755 23564 23564 0 6654200020 11760 5ustar newtnewtXmHTML-1.1.7/http/HTTP.c100644 23564 23564 100327 6640040350 13046 0ustar newtnewt#ifndef lint static char rcsId[]="$Header: /usr/local/rcs/Newt/XmHTML/RCS/HTTP.c,v 1.1 1997/10/23 00:28:23 newt Exp newt $"; #endif /***** * HTTP.c : A first attempt at a simple HTTP library. * * This file Version $Revision: 1.1 $ * * Creation date: Tue Oct 21 01:41:31 GMT+0100 1997 * Last modification: $Date: 1997/10/23 00:28:23 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: Richard Offer * * Copyright (C) 1994-1997 by Richard Offer * All Rights Reserved * * 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. * * Note from the Author: * * A first attempt at a simple HTTP library, mainly used as a test harness for * the forms work in XmHTML, it does lots of bad things and isn't a complete * implementation. I didn't use the W3C libww 'cause its too big and doesn't * seem to work for POSTs --- rmo * * The code is based on a quick read of the HTTP 1.0 rfc, with ideas for * implementation taken from the Chimera Browser. * *****/ /***** * ChangeLog * $Log: HTTP.c,v $ * Revision 1.1 1997/10/23 00:28:23 newt * Initial Revision * *****/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_STRINGS_H #include #endif #include #include #include #include #ifdef HAVE_SYS_SELECT_H #include /* select() */ #endif #include #include #include #include #include #ifndef SO_RCVTIMEO #include #include #endif #include #ifdef DMALLOC #include #endif /* DMALLOC */ #ifdef NEED_SOCKS /* This is _very_ firewall specific, this works for me (after much trial and * error --- offer */ #include "socks.h" #define connect Rconnect #endif /* NEED_SOCKS */ /*** External Function Prototype Declarations ***/ /*** Public Variable Declarations ***/ #ifdef DEBUG int http_debug = 0; #endif /*** Private Datatype Declarations ****/ /*** Private Function Prototype Declarations ****/ /* delete a no longer required response */ static void deleteResponse(HTTPResponse * res); /* create a new response */ static HTTPResponse *newResponse(char *buf); /***** * hexify src and append to dest. Return value points to the next available * position in dest. *****/ static char *appendHex(char *dest, char *src); /* convert all name-value pairs to a valid QUERY_STRING format */ static char *encodeFormData(HTTPNamedValues * formdata); #ifndef SO_RCVTIMEO static void connectTimeout(int signal); #endif /*** Private Variable Declarations ***/ #ifndef SO_RCVTIMEO static jmp_buf http_setjmp_buffer; #endif #ifndef SO_RCVTIMEO static void connectTimeout(int signal) { if(signal == SIGALRM) longjmp(http_setjmp_buffer, 1); } #endif /* This is the main routine for sending a request and getting a response, * everything else in this file is waffle */ void loadHTTPURL(void *unused, HTTPRequest * request, HTTPCookieRequest *cookieReq) { struct hostent *server; struct sockaddr_in name; int sock; char *scheme = NULL, *username = NULL, *password = NULL; char *hostname = NULL, *filename = NULL; int port; char *buf = NULL; size_t offset = 0, bufsize = 0; HTTPResponse *res; ssize_t val; fd_set rfds; struct timeval tv; int retval, retry_count, nreads; char *cookie = NULL ; /* see if we have an URI */ if(request->url == NULL) { request->ret = HTTPBadURL; return; } /* verify request type */ if(request->type != HTTPLoadToString && request->type != HTTPLoadToFile) { request->ret = HTTPBadLoadType; return; } /* resolve the url */ parseURL(request->url, PARSE_URL, &scheme, &username, &password, &hostname, &port, &filename); re_issue_request: /* check protocol */ if(scheme == NULL || strncasecmp(scheme, "http", 4)) { /* free off the output from parseURL() */ freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); request->ret = HTTPBadProtocol; return; } #ifdef DEBUG if(http_debug) fprintf(stderr, "Lookin up host %s...\n", hostname); #endif /* see if we can resolve the host */ if((server = gethostbyname(hostname)) == NULL) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); request->ret = HTTPBadHost; return; } /* we've got the host, open a socket */ if((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); request->ret = HTTPNoSocket; return; } #ifdef DEBUG if(http_debug) fprintf(stderr, "Found, connecting to %s (port %i)\n", hostname, port); #endif name.sin_family = AF_INET; name.sin_port = htons(port); #ifdef linux memcpy(&name.sin_addr, server->h_addr, server->h_length); #else memcpy(&name.sin_addr.s_addr, server->h_addr, server->h_length); #endif /***** * Wouldn't the world be easy if each system knew SO_RCVTIMEO. * But this is not the case on at least linux, so we use a brute force * approach: alarm. * * Just in case your system can enable timeouts on sockets, here's a piece * of code that should work. *****/ #ifdef SO_RCVTIMEO /* set socket timeout */ tv.tv_sec = request->timeout; tv.tv_usec = 0; if(setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval))) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); request->ret = HTTPNoSocket; close(sock); return; } #else if(setjmp(http_setjmp_buffer)) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); #ifdef DEBUG if(http_debug) fprintf(stderr, "connect() timed out\n"); #endif request->ret = HTTPConnectTimeout; signal(SIGALRM, SIG_DFL); close(sock); return; } signal(SIGALRM, connectTimeout); alarm((long)request->timeout); #endif if(connect(sock, (struct sockaddr*)&name, sizeof(name)) < 0) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); if(errno == EWOULDBLOCK) { #ifdef DEBUG if(http_debug) fprintf(stderr, "connect() timed out\n"); #endif request->ret = HTTPConnectTimeout; } else request->ret = HTTPNoConnection; close(sock); return; } #ifndef SO_RCVTIMEO /* remove connection timeout */ signal(SIGALRM, SIG_DFL); alarm(0L); #endif #ifdef DEBUG if(http_debug) fprintf(stderr, "sending request (%i)\n", request->method); #endif if( cookieReq != NULL && cookieReq->cookieList != NULL ) cookie = makeCookie(cookieReq->cookieList); #ifdef DEBUG if( http_debug ) if( cookie ) fprintf(stderr,"The server wants a cookie '%s'\n",cookie); #endif /* _DEBUG */ switch(request->method) { case HTTPGET: { char *formStr = NULL, *reqStr = NULL; if(request->form_data) { formStr = encodeFormData((HTTPNamedValues*)request->form_data); } reqStr = (char*)malloc(strlen(GET_METHOD) + strlen(filename) + (formStr ? strlen(formStr) + 1 : 0) + strlen(HTTPVERSIONHDR) + strlen(USER_AGENT) + (cookie ? strlen(cookie) + 1 : 0) + strlen(NEWLINE) + 3); sprintf(reqStr, "%s%s%s%s%s%s%s%s", GET_METHOD, filename, (formStr ? "?" : ""), /* cgi stuff requires a ? */ (formStr ? formStr : ""), HTTPVERSIONHDR, USER_AGENT, ( cookie ? cookie : "" ), NEWLINE); val = write(sock, reqStr, strlen(reqStr) + 1); free(reqStr); if(formStr) free(formStr); } break; case HTTPPOST: { char *formStr = NULL, *fullReqStr; char *reqStr = (char *) malloc(strlen(POST_METHOD) + strlen(filename) + strlen(HTTPVERSIONHDR) + (cookie ? strlen(cookie) + 1 : 0) + strlen(USER_AGENT) + strlen(NEWLINE) + 2); sprintf(reqStr, "%s%s%s%s%s", POST_METHOD, filename, HTTPVERSIONHDR, USER_AGENT, ( cookie ? cookie : "" ) ); if(request->form_data) { formStr = encodeFormData((HTTPNamedValues*)request->form_data); } fullReqStr = calloc(strlen(reqStr) + strlen(CONTENT_LEN) + strlen(CONTENT_TYPE) + MAX_FORM_LEN + (formStr ? strlen(formStr) : 0 )+ 10 /* safety */, sizeof(char)); sprintf(fullReqStr, "%s%s%d%s%s%s%s%s%s", reqStr, CONTENT_LEN, (formStr ? strlen(formStr) : 0), NEWLINE, CONTENT_TYPE, NEWLINE, NEWLINE, formStr, NEWLINE); val = write(sock, fullReqStr, strlen(fullReqStr) + 1); free(reqStr); if(formStr) free(formStr); free(fullReqStr); } break; case HTTPHEAD: /* not sure about cookies for HEAD, supported ? */ { char *reqStr = NULL; reqStr = (char*)malloc(strlen(HEAD_METHOD) + strlen(filename) + strlen(HTTPVERSIONHDR) + strlen(USER_AGENT) + strlen(NEWLINE) + 3); sprintf(reqStr, "%s%s%s%s%s", HEAD_METHOD, filename, HTTPVERSIONHDR, USER_AGENT, NEWLINE); val = write(sock, reqStr, strlen(reqStr) + 1); free(reqStr); } break; default: /* free off the output from parseURL() */ freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); close(sock); request->ret = HTTPMethodUnsupported; return; } /* read output from remote HTTP server */ offset = 0; val = 0; bufsize = CHUNKSIZE; buf = calloc(bufsize, sizeof(char)); nreads = 0; retry_count = 0; #ifdef DEBUG if(http_debug) fprintf(stderr, "awaiting input\n"); #endif /* watch socket to see when it has input */ while(1) { /* no of bytes read from socket */ val = 0; FD_ZERO(&rfds); FD_SET(sock, &rfds); /* wait up to the given no of seconds */ tv.tv_sec = request->timeout; tv.tv_usec = 0; retval = select(sock+1, &rfds, NULL, NULL, &tv); if(retval) { #ifdef DEBUG if(http_debug) fprintf(stderr, "reading socket.\n"); #endif val = read(sock, buf + offset, bufsize - offset); if(val <= 0) /* error or end of input */ break; #ifdef DEBUG if(http_debug) fprintf(stderr, "read %i bytes, offset: %i)\n", val, offset); #endif /* keep room for at least CHUNKSIZE bytes */ if(bufsize - (offset + val) < CHUNKSIZE) { bufsize += CHUNKSIZE; buf = realloc(buf, bufsize); } offset += val; buf[offset] = '\0'; /* NULL terminate */ } else { #ifdef DEBUG if(http_debug) fprintf(stderr, "timed out after %i seconds.\n", request->timeout); #endif /* * abort if we're timed out, have reached the maximum retry * times and no input was received. */ if(retry_count == request->retry && offset == 0) { close(sock); free(buf); request->ret = HTTPTimeout; return; } /* break out when we have an offset and this read timed out */ else if(offset && val <= 0) break; else { /* read timed out before any input was received */ retry_count++; } #ifdef DEBUG if(http_debug) fprintf(stderr, "retrying for the %ith time.\n", retry_count); #endif } } /* now parse the read message for headers */ res = newResponse(buf); free(buf); /* set appropriate return code */ if(val < 0) request->ret = HTTPPartialContent; else request->ret = res->status_code; #if defined(PRINT_HDRS) && defined(DEBUG) { int i; for(i = 0; i < res->num_headers; i++) { printf("hdr %s = %s\n", res->headers[i].name, res->headers[i].value); } } #endif /* valid return code? */ if(request->ret > 199 && request->ret < 299) { /* get or post include data, which head does not contain */ if(request->method != HTTPHEAD) { int i; /* parse the headers for any cookies */ for (i = 0; i < res->num_headers; i++ ) { if(!strcasecmp(res->headers[i].name, "Set-Cookie")) setCookie(cookieReq,SetCookie,res->headers[i].value, hostname); else if(!strcasecmp(res->headers[i].name, "Set-Cookie2")) setCookie(cookieReq, SetCookie2, res->headers[i].value, hostname); } /* store data in string (most likely this was a cgi request) */ if(request->type == HTTPLoadToString) { size_t len = (res->data ? strlen((char *) res->data) : 0); for (i = 0; i < res->num_headers; i++) { if(!strcasecmp(res->headers[i].name, "Content-length")) len = atoi(res->headers[i].value); } request->out_data = calloc(len + 1, sizeof(char)); memcpy((void *) request->out_data, res->data, len); request->out_data[len] = '\0'; request->length = len; } else if(request->type == HTTPLoadToFile) { /* this was a request for a remote file. Save it */ FILE *fp; if((fp = fopen((char *) request->in_data, "w")) == NULL) { request->ret = HTTPCannotCreateFile; } else { int i; size_t len = (res->data ? strlen((char *) res->data) : 0); size_t written; for (i = 0; i < res->num_headers; i++) { if(!strcasecmp(res->headers[i].name, "Content-length")) len = atoi(res->headers[i].value); } /* flush data */ written = fwrite(res->data, sizeof(char), len, fp); fflush(fp); fclose(fp); } } } else { /* store data in string (most likely this was a cgi request) */ if(request->type == HTTPLoadToString) { /***** * Transfer header array from the result structure to the * request. *****/ request->headers = res->headers; request->num_headers = res->num_headers; res->headers = NULL; res->num_headers = 0; } else if(request->type == HTTPLoadToFile) { /* this was a request for a remote file. Save it */ FILE *fp; if((fp = fopen((char *) request->in_data, "w")) == NULL) { request->ret = HTTPCannotCreateFile; } else { int i; for (i = 0; i < res->num_headers; i++) { fprintf(fp, "%s = %s\n", res->headers[i].name, res->headers[i].value); } /* flush data */ fflush(fp); fclose(fp); } } } } else { /***** * if the URL has moved (_or_ the user left off a trailing '/' from a * directory request), then look in the Location: header for the * correct URL and re-issue the request --- offer dec 97 *****/ if(request->ret == 301 || request->ret == 302 ) { int i; for(i=0; i< res->num_headers; i++) { if(!strcasecmp(res->headers[i].name, "location")) { freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); parseURL(res->headers[i].value, PARSE_URL, &scheme, &username, &password, &hostname, &port, &filename); free(request->url); /***** * Update the URL that was requested to point to the * correct one *****/ request->url = NewString(res->headers[i].value); goto re_issue_request; } } } } deleteResponse(res); /* free off the output from parseURL() */ freeURL(PARSE_URL, scheme, username, password, hostname, port, filename); /* all done */ close(sock); } void deleteHTTPRequest(HTTPRequest * req) { int i; if(req->in_data) free(req->in_data); if(req->form_data) { i = 0; while (req->form_data[i].name != NULL) { if(req->form_data[i].name) free(req->form_data[i].name); if(req->form_data[i].value) free(req->form_data[i].value); i++; } free(req->form_data); } for(i = 0; i < req->num_headers; i++) { if(req->headers[i].name) free(req->headers[i].name); if(req->headers[i].value) free(req->headers[i].value); } if(req->headers) free(req->headers); if(req->out_data) free(req->out_data); if(req->url) free(req->url); free(req); } HTTPRequest * newHTTPRequest(void) { HTTPRequest *new_r = (HTTPRequest *) calloc(1, sizeof(HTTPRequest)); new_r->type = HTTPLoadToString; new_r->in_data = NULL; new_r->form_data = NULL; new_r->out_data = NULL; new_r->method = HTTPGET; new_r->url = NULL; new_r->ret = HTTPInvalid; new_r->timeout = DEFAULT_TIMEOUT; new_r->retry = DEFAULT_RETRY; new_r->headers = NULL; new_r->num_headers = 0; return(new_r); } static void deleteResponse(HTTPResponse * res) { int i; if(res->data) free(res->data); for(i = 0; i < res->num_headers; i++) { if(res->headers[i].name) free(res->headers[i].name); if(res->headers[i].value) free(res->headers[i].value); } if(res->headers) free(res->headers); free(res); } /***** * unescape HTTP escaped chars. * Replacement is done inline. *****/ void HTTPUnescapeResponse(char *buf) { register unsigned int x, y; register char digit; for(x = 0, y = 0; buf[y]; ++x, ++y) { if((buf[x] = buf[y]) == '%') { y++; digit = (buf[y] >= 'A' ? ((buf[y] & 0xdf)-'A')+10 : (buf[y]-'0')); y++; digit *= 16; digit += (buf[y] >= 'A' ? ((buf[y] & 0xdf)-'A')+10 : (buf[y]-'0')); buf[x] = digit; } } buf[x] = '\0'; } static HTTPResponse * newResponse(char *buf) { HTTPResponse *res = (HTTPResponse *) calloc(1, sizeof(HTTPResponse)); int ver, code; int i, start; int SOL; size_t len = 0; char *EOL; if(strncasecmp(buf, "HTTP", 4)) { res->http_version = HTTP_VERSION_09; res->headers = NULL; res->num_headers = 0; res->status_code = HTTPInvalid; res->data = (unsigned char *) NewString(buf); return res; } sscanf(buf, "HTTP/1.%d %d", &ver, &code); EOL = strstr(buf, "\r\n"); start = EOL - buf + 2; #ifdef DEBUG if(http_debug) fprintf(stderr, "\nHTTP 1.%d return code = %d\n", ver, code); #endif if(ver == 0) res->http_version = HTTP_VERSION_10; else res->http_version = HTTP_VERSION_11; res->status_code = (HTTPRequestReturn) code; for (i = start, SOL = start; i < strlen(buf); i++) { if(buf[i] == '\r' || buf[i] == '\n') { if(buf[i] == '\r' && buf[i + 1] && buf[i + 1] == '\n') { char *colon = strchr(&buf[SOL], ':'); if(colon == NULL) break; if(res->headers == NULL) res->headers = (HTTPNamedValues *) malloc(sizeof(HTTPNamedValues)); else res->headers = realloc((void *)res->headers, sizeof(HTTPNamedValues) * (res->num_headers + 1)); res->headers[res->num_headers].name = NewNString(&buf[SOL], colon - &buf[SOL]); res->headers[res->num_headers].value = NewNString(colon + 2, &buf[i] - colon - 2); if(!strcasecmp(res->headers[res->num_headers].name, "Content-length")) len = atoi(res->headers[res->num_headers].value); res->num_headers++; if(buf[i + 2] && buf[i + 2] == '\r' && buf[i + 3] && buf[i + 3] == '\n') { if(len == 0) len = strlen(&buf[i + 4]); res->data = calloc(len + 1, sizeof(char)); memcpy((void *) res->data, &buf[i + 4], len); res->data[len] = '\0'; goto finish; } i++; } SOL = i + 1; } } finish: return(res); } /***** * Fast lookup table to determine which characters should be left alone and * which should be encoded. Much faster than the Chimera implementation -- kdh * const qualifier should put it in the text segment *****/ static const unsigned char allow[97] = {/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ 0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1, /* 2x !"#$%&'()*+,-./ */ 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 3x 0123456789:;<=>? */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4x @ABCDEFGHIJKLMNO */ 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* 5X PQRSTUVWXYZ[\]^_ */ 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6x `abcdefghijklmno */ 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 /* 7X pqrstuvwxyz{\}~ DEL */ }; static const char *hex = "0123456789ABCDEF"; /***** * Name: appendHex * Return Type: char* * Description: appends src to dest, translating certain chars to their * hexadecimal representation as we do; * In: * dest: destination buffer. This buffer must be large enough to contain * the expanded source text; * src: text to be appended; * Returns: * a ptr pointing to the next available position in dest. * Note: * added 97/10/21 by kdh and based on HTEscape() from libwww *****/ static char* appendHex(char *dest, char *src) { register char *ptr, *chPtr; for(ptr = dest, chPtr = src; *chPtr!= '\0'; chPtr++) { /* no negative values */ int c = (int)((unsigned char)(*chPtr)); if(*chPtr == ' ') /* bloody exception */ *ptr++ = '+'; else if(c >= 32 && c <= 127 && allow[c-32]) *ptr++ = *chPtr; /* acceptable char */ else { *ptr++ = '%'; /* hex is following */ *ptr++ = hex[c >> 4]; *ptr++ = hex[c & 15]; } } return(ptr); } /***** * Name: encodeFormData * Return Type: char* * Description: creates a fully valid QUERY_STRING from the given name/value * pairs. * In: * formdata: array of name/value pairs from a form submit. Encoding * terminates when a NULL name has been detected. * Returns: * an allocated and hex-encoded QUERY_STRING. * Note: * - this function is based on the corresponding one from Chimera (rmo) * - 97/10/21, heavily modified by kdh *****/ static char* encodeFormData(HTTPNamedValues * formdata) { char *data, *chPtr; int nvalues, i, len = 0; /***** * First count how many bytes we have to allocate. Each entry gets two * additional bytes: the equal sign and a spacer. Each entry is also * multiplied by three to allow full expansion. * Count no of entries as well. *****/ for(i = 0; formdata[i].name != NULL; i++) { if(formdata[i].name) { len += strlen(formdata[i].name) * 3; if(formdata[i].value) len += strlen(formdata[i].value) * 3; len += 2; /* equal sign and spacer */ } } nvalues = i; /* allocate & reset query string */ data = (char*)calloc(len + 1, sizeof(char)); /***** * Now compose query string: append & convert to hex at the same time. * We can safely do this as we've already allocated room for hexadecimal * expansion of the *entire* query string. * Room for optimisation: appendHex could be done inline *****/ chPtr = data; for(i = 0; i < nvalues; i++) { if(formdata[i].name) { chPtr = appendHex(chPtr, formdata[i].name); *chPtr++ = '='; if(formdata[i].value) chPtr = appendHex(chPtr, formdata[i].value); *chPtr++ = '&'; /* spacer */ } } /* mask off last & */ data[strlen(data)-1] = '\0'; #ifdef DEBUG if(http_debug) { fprintf(stderr, "encodeFormData, computed string length: %i, " "used: %i\n", len+1, strlen(data)); fprintf(stderr, "return value: %s\n", data); } #endif /***** * Could resize data to fit exactly the no of bytes used, but I wonder * if it's worth it as this data has a pretty short lifetime --- kdh *****/ return(data); } /* * stolen from the chimera browser --- rmo. * */ #define isspace8(a) ((a) < 33 && (a) > 0) void parseURL(char *url, long parse, char **scheme, char **username, char **password, char **hostname, int *port, char **filename) { char *start; char *colon, *slash, *fslash; char *at; /* username/password @ */ char *ucolon; /* username colon */ char *pcolon; /* port number colon */ struct _part { int start; int len; } sp, up, pwp, hp, pp, fp; sp.start = 0; sp.len = 0; up.start = 0; up.len = 0; pwp.start = 0; pwp.len = 0; hp.start = 0; hp.len = 0; pp.start = 0; pp.len = 0; fp.start = 0; fp.len = 0; if(url == NULL) return; /* skip leading white-space (if any) */ for (start = url; isspace8(*start); start++); /* Look for indication of a scheme. */ colon = strchr(start, ':'); /* * Search for characters that indicate the beginning of the * path/params/query/fragment part. */ slash = strchr(start, '/'); if(slash == NULL) slash = strchr(start, ';'); if(slash == NULL) slash = strchr(start, '?'); if(slash == NULL) slash = strchr(start, '#'); /* * Check to see if there is a scheme. There is a scheme only if * all other separators appear after the colon. */ if(colon != NULL && (slash == NULL || colon < slash)) { sp.start = 0; sp.len = colon - start; } /* * If there is a slash then sort out the hostname and filename. * If there is no slash then there is no hostname but there is a * filename. */ if(slash != NULL) { /* Check for leading //. If its there then there is a host string. */ if((*(slash + 1) == '/') && ((colon == NULL && slash == start) || (colon != NULL && slash == colon + 1))) { /* Check for filename at end of host string */ slash += 2; if((fslash = strchr(slash, '/')) != NULL) { hp.start = slash - start;; hp.len = fslash - slash; fp.start = fslash - start; fp.len = strlen(fslash); } else { /* there is no filename */ hp.start = slash - start; hp.len = strlen(slash); } } else { /* * the rest is a filename because there is no // or it appears * after other characters */ if(colon != NULL && colon < slash) { fp.start = colon + 1 - start; fp.len = strlen(colon + 1); } else { fp.start = slash - start; fp.len = strlen(slash); } } } else { /* No slashes at all so the rest must be a filename */ if(colon == NULL) { fp.start = 0; fp.len = strlen(start); } else { fp.start = colon - start + 1; fp.len = strlen(colon + 1); } } /* * If there is a host string then divide it into * username:password@hostname:port as needed. */ if(hp.len != 0) { /* Look for username:password. */ if((at = strchr(&url[hp.start], '@')) != NULL) { up.start = hp.start; up.len = at - start - hp.start; hp.start = at + 1 - start; if((ucolon = strchr(&url[up.start], ':')) != NULL) { if(ucolon - start < hp.start) { pwp.start = ucolon + 1 - start; pwp.len = hp.start - pwp.start; } } } /* Grab the port. */ if((pcolon = strchr(&url[hp.start], ':')) != NULL && pcolon < ( &url[hp.start + hp.len]) ) { pp.start = pcolon + 1 - start; pp.len = fp.start - pp.start; hp.len -= pp.len + 1; } } /* now have all the fragments, make them into strings */ if(parse & PARSE_SCHEME) { if(sp.len > 0) *scheme = NewNString(&url[sp.start], sp.len); else *scheme = NULL; } if(parse & PARSE_USER) { if(up.len > 0) *username = NewNString(&url[up.start], up.len); else *username = NULL; } if(parse & PARSE_PASSWORD) { if(pwp.len > 0) *password = NewNString(&url[pwp.start], pwp.len); else *password = NULL; } if(parse & PARSE_HOSTNAME) { if(hp.len > 0) *hostname = NewNString(&url[hp.start], hp.len); else *hostname = NULL; } if(parse & PARSE_PORT) { if(pp.len > 0) { char *tmp = NewNString(&url[pp.start], pp.len); *port = atoi(tmp); free(tmp); } else *port = 80; } if(parse & PARSE_FILENAME) { if(fp.len > 0) *filename = NewString(&url[fp.start]); else *filename = NewString("/"); } return; } /* this is brain dead, needs to be expanded to cover non http schemes -- rmo */ int HTTPAbsoluteURL(char *url) { if(strncasecmp(url, "http", 4)) return(0); else return(1); } /* This is a very flakey routine and it needs a lot of work, it doesn't do compression of full paths, but it proved adequet for simple testing */ char * HTTPFindAbsoluteURL(char *url, char *baseUrl) { char new_url[1024]; char *tmpP; char *u_scheme, *u_username, *u_password, *u_hostname, *u_filename; char *b_scheme, *b_username, *b_password, *b_hostname, *b_filename; int u_port, b_port; if(baseUrl == NULL || *baseUrl == '\0') return (NewString(url)); parseURL(url, PARSE_URL, &u_scheme, &u_username, &u_password, &u_hostname, &u_port, &u_filename); parseURL(baseUrl, PARSE_URL, &b_scheme, &b_username, &b_password, &b_hostname, &b_port, &b_filename); if(u_scheme) sprintf(new_url, "%s://", u_scheme); else sprintf(new_url, "%s://", b_scheme); if(u_hostname) strcat(new_url, u_hostname); else if(b_hostname) strcat(new_url, b_hostname); else strcat(new_url, "localhost"); if(u_filename && u_filename[0] == '/') { strcat(new_url, u_filename); } else if(u_filename && u_filename[0] == '~') { strcat(new_url, u_filename); strcat(new_url, "/"); } else { if(b_filename == NULL || b_filename[0] != '/') printf("still to do\n"); else { strcat(new_url, b_filename); tmpP = strrchr(new_url, '/'); if(*tmpP++) { *tmpP = '\0'; strcat(tmpP, u_filename); } else strcat(new_url, u_filename); } } freeURL(PARSE_URL, u_scheme, u_username, u_password, u_hostname, u_port, u_filename); freeURL(PARSE_URL, b_scheme, b_username, b_password, b_hostname, b_port, b_filename); return (NewString(new_url)); } void freeURL(long parse, char *scheme, char *username, char *password, char *hostname, int port, char *filename) { if((parse & PARSE_SCHEME) && scheme) free(scheme); if((parse & PARSE_USER) && username) free(username); if((parse & PARSE_PASSWORD) && password) free(password); if((parse & PARSE_HOSTNAME) && hostname) free(hostname); if((parse & PARSE_FILENAME) && filename) free(filename); } void HTTPError(char *msg, HTTPRequestReturn error) { fprintf(stderr, "%s: %s.\n", msg, HTTPErrorString(error)); } const char* HTTPErrorString(HTTPRequestReturn error) { switch(error) { /* 0 and up (client messages) */ case HTTPInvalid: return("Invalid request (client failure)"); case HTTPBadProtocol: return("Invalid protocol requested (client failure)"); case HTTPBadHost: return("Invalid hostname (client failure)"); case HTTPBadURL: return("Invalid URL (client failure)"); case HTTPBadLoadType: return("Invalid load type (client failure)"); case HTTPMethodUnsupported: return("Unsupported method (client failure)"); case HTTPNoSocket: return("Could not open socket (client failure)"); case HTTPNoConnection: return("Not connected (client failure)"); case HTTPBadHttp10: return("Invalid HTTP/1.0 request (client failure)"); case HTTPCannotCreateFile: return("Could not create file (client failure)"); case HTTPConnectTimeout: return("Could not connect: timed out (client failure)"); case HTTPTimeout: return("Connection timed out"); /* 100 and up (informative messages) */ case HTTPContinue: return("Continue"); case HTTPSwitchProtocols: return("Bad protocol, switch required"); /* 200 and up (request succeeded) */ case HTTPSuccess: return("No error"); case HTTPCreated: return("Document created"); case HTTPAccepted: return("Request accepted"); case HTTPNonAuthoritativeInfo: return("Non-authoritative information"); case HTTPNoContent: return("Document is empty"); case HTTPResetContent: return("Content has been reset"); case HTTPPartialContent: return("Partial content"); /* 300 and up (non-fatal errors, retry possible) */ case HTTPMultipleChoices: return("Request not unique, multiple choices possible"); case HTTPPermMoved: return("Document has been permanently removed"); case HTTPTempMoved: return("Document has been temporarely moved"); case HTTPSeeOther: return("Site has move"); case HTTPNotModified: return("Document not modified since last access"); case HTTPUseProxy: return("Document only accessible through proxy"); /* 400 and up (fatal request errors) */ case HTTPBadRequest: return("Invalid HTTP request"); case HTTPUnauthorised: return("Client not authorized"); case HTTPPaymentReq: return("Payment required"); case HTTPForbidden: return("Access forbidden"); case HTTPNotFound: return("Document not found"); case HTTPMethodNotAllowed: return("Access method not allowed"); case HTTPNotAcceptable: return("Unacceptable request"); case HTTPProxyAuthReq: return("Proxy authorization required"); case HTTPRequestTimeOut: return("Timed out"); case HTTPConflict: return("Conflict of interest"); case HTTPGone: return("Document has moved"); case HTTPLengthReq: return("Invalid request length"); case HTTPPreCondFailed: return("Condition failed"); case HTTPReqEntityTooBig: return("Request entity too large"); case HTTPURITooBig: return("URI specification too big"); case HTTPUnsupportedMediaType: return("Unsupported media type"); /* 500 and up (server errors) */ case HTTPInternalServerError: return("Internal server error"); case HTTPNotImplemented: return("Method not implemented"); case HTTPBadGateway: return("Invalid gateway"); case HTTPServiceUnavailable: return("Service unavailable"); case HTTPGatewayTimeOut: return("Gateway timed out"); case HTTPHTTPVersionNotSupported: return("Unsupported HTPP version"); default: return("unknown error"); } } XmHTML-1.1.7/http/README.http100644 23564 23564 7116 6432160775 13740 0ustar newtnewtThis File: README for HTTP.c ----------------------------------------------------------------------- Note: This file is in pieces until I get around to write a proper set of documentation. ----------------------------------------------------------------------- HTTP is a simple implementation of the HTTP1.0 protocol. It has been written by Richard Offer (offer@sgi.com) and expanded by Koen D'Hondt (ripley@xs4all.nl). Implementation details ---------------------- HTTP uses non-blocking communication with a user-selectable timeout and retry count. On systems that do not support the SO_RCVTIMEO setsockopt() option, alarm() is used to enforce a timeout on connect(). Once a connection has been established, HTTP uses a select() on read() to ensure the read operation doesn't block. HTTP Return Values ------------------ Upon return of loadHTTPURL(), the ret field of the HTTPRequest structure contains a HTTPRequestReturn code indicating success, partial success or failure to honor the request. Return values 0-99 are library errors All return values above 99 are messages returned by the server HTTP is connecting to. Classes: 100-199 : informative messages, can be ignored; 200-299 : request accepted 300-399 : non-fatal request errors 400-499 : fatal request errors 500-600 : remote server errors The convenience routine HTTPErrorString(error) returns a string containing an appropriate error message while the convienence routine HTTPError(msg, error) prints a user-supplied message (which may be NULL) together with an appropriate error message. Value and Meaning of the HTTP Return Values ------------------------------------------- Value Name Meaning 0 HTTPInvalid invalid request type 1 HTTPBadProtocol unsupported protocol requested. Currently only http is supported 2 HTTPBadHost hostname could not be resolved 3 HTTPBadURL badly formed URI in the HTTPRequest 4 HTTPBadLoadType unsupported data return method requested. 5 HTTPMethodUnsupported unsupported HTTP method requested. GET, POST and HEAD are the only supported (and possible) methods 6 HTTPNoSocket could not create a socket 7 HTTPNoConnection connect() failed 8 HTTPBadHttp10 unused 9 HTTPCannotCreateFile library could not create the file requested by the HTTPLoadToFile LoadType 10 HTTPConnectTimeout initial connect() failed, timed out. 11 HTTPTimeout read() timeout 100 HTTPContinue 101 HTTPSwitchProtocols 200 HTTPSuccess request succeeded and fully honored 201 HTTPCreated 202 HTTPAccepted 203 HTTPNonAuthoritativeInfo 204 HTTPNoContent 205 HTTPResetContent 206 HTTPPartialContent request only partially served 300 HTTPMultipleChoices 301 HTTPPermMoved document permanently moved to a new location 302 HTTPTempMoved document temporarely moved to a new location 303 HTTPSeeOther 304 HTTPNotModified document not modified since last request (proxy message?) 305 HTTPUseProxy 400 HTTPBadRequest 401 HTTPUnauthorised access denied, authorization required 402 HTTPPaymentReq access denied, first you must pay 403 HTTPForbidden access forbidden 404 HTTPNotFound requested document not found 405 HTTPMethodNotAllowed 406 HTTPNotAcceptable 407 HTTPProxyAuthReq proxy authorization required 408 HTTPRequestTimeOut request timed out 409 HTTPConflict 410 HTTPGone 411 HTTPLengthReq 412 HTTPPreCondFailed 413 HTTPReqEntityTooBig 414 HTTPURITooBig 415 HTTPUnsupportedMediaType 500 HTTPInternalServerError 501 HTTPNotImplemented 502 HTTPBadGateway 503 HTTPServiceUnavailable 504 HTTPGatewayTimeOut 505 HTTPHTTPVersionNotSupported XmHTML-1.1.7/http/Makefile100644 23564 23564 2411 6656166457 13546 0ustar newtnewt# # lint configuration. I use lclint. # LIBRARY=libhttp.a # List of source, object and header files SRCS=HTTP.c cookie.c OBJS=HTTP.o cookie.o HEADERS=HTTP.h HTTPP.h # Target to make TARGET=$(LIBRARY) # Subdirectories to visit SUBDIRS= # rule to create .o files from .c files .c.o: $(RM) $@ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $< all: $(TARGET) # targets to build $(TARGET):: $(OBJS) $(RM) $@ \ $(AR) $@ $(OBJS) $(RANLIB) $@ stamp-includes: @if [ -d ../include ]; then set +x; \ else (set -x; mkdir ../include); fi @if [ -d ../include/XmHTML ]; then set +x; \ else (set -x; mkdir ../include/XmHTML); fi @(set -x; cd ../include/XmHTML; for i in $(HEADERS); do \ $(RM) $$i; \ $(LN) ../../http/$$i .; \ done) touch $@ includes:: stamp-includes depend:: $(SRCS) $(MAKEDEPEND) $(INCLUDES) $(CPPFLAGS) $(SRCS) clean:: $(RM) $(OBJS) $(RM) $(TARGET) distclean:: clean $(RM) core *.out *.log make.world *.bak *.last *.auto *.rej *.orig $(RM) *.lh *.lcs *.lint stamp-includes $(CP) Makefile.org Makefile realclean:: distclean #-------------------------------------------------------------------------- # don't delete anything below this line, makedepend depends on it #-------------------------------------------------------------------------- XmHTML-1.1.7/http/Makefile.org100644 23564 23564 2411 6460010065 14304 0ustar newtnewt# # lint configuration. I use lclint. # LIBRARY=libhttp.a # List of source, object and header files SRCS=HTTP.c cookie.c OBJS=HTTP.o cookie.o HEADERS=HTTP.h HTTPP.h # Target to make TARGET=$(LIBRARY) # Subdirectories to visit SUBDIRS= # rule to create .o files from .c files .c.o: $(RM) $@ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $< all: $(TARGET) # targets to build $(TARGET):: $(OBJS) $(RM) $@ \ $(AR) $@ $(OBJS) $(RANLIB) $@ stamp-includes: @if [ -d ../include ]; then set +x; \ else (set -x; mkdir ../include); fi @if [ -d ../include/XmHTML ]; then set +x; \ else (set -x; mkdir ../include/XmHTML); fi @(set -x; cd ../include/XmHTML; for i in $(HEADERS); do \ $(RM) $$i; \ $(LN) ../../http/$$i .; \ done) touch $@ includes:: stamp-includes depend:: $(SRCS) $(MAKEDEPEND) $(INCLUDES) $(CPPFLAGS) $(SRCS) clean:: $(RM) $(OBJS) $(RM) $(TARGET) distclean:: clean $(RM) core *.out *.log make.world *.bak *.last *.auto *.rej *.orig $(RM) *.lh *.lcs *.lint stamp-includes $(CP) Makefile.org Makefile realclean:: distclean #-------------------------------------------------------------------------- # don't delete anything below this line, makedepend depends on it #-------------------------------------------------------------------------- XmHTML-1.1.7/http/Imakefile100644 23564 23564 10677 6460007721 13731 0ustar newtnewtXCOMM XCOMM Imakefile for libhttp XCOMM XCOMM (C)Copyright 1995-1997 Ripley Software Development XCOMM All Rights Reserved XCOMM XCOMM This file is part of the XmHTML Widget Library. XCOMM XCOMM See the file LICENSE for the full copyright statement. XCOMM XCOMM Include the XmHTML configuration file #include "../XmHTML.cf" XCOMM No need to change anything below this line XCOMM XCOMM SGI requires a specification file for shared library that we don't have XCOMM (Irix below 6.2) #if defined(SGIArchitecture) && !SystemV4 && HasSharedLibraries && \ (OSMajorVersion <= 6) && (OSMinorVersion <= 4) # undef SharedLibXmHTML # undef NormalLibXmHTML # define SharedLibXmHTML NO # define NormalLibXmHTML YES #endif XCOMM Linux requires a specification file for a.out shared libraries that we XCOMM don't have. XCOMM #if defined(LinuxArchitecture) && defined(UseElfFormat) && (UseElfFormat == NO) # undef SharedLibXmHTML # undef NormalLibXmHTML # define SharedLibXmHTML NO # define NormalLibXmHTML YES #endif HTTPLIBDIR = XmHTMLLibDir HTTPINCDIR = XmHTMLIncDir INCDIR = XmHTMLIncDir XCOMM Get version numbering for shared libraries from the HTTP include file #define _LIBRARY #include "HTTP.h" XCOMM Make translation from make variables to Imake variables XCOMM (convention is that all uppercase are Make variables, mixed case are XCOMM Imake variables) #ifndef HTTPVERSION #define HTTPVERSION 0 #endif #ifndef HTTPREVISION #define HTTPREVISION 1 #endif #ifndef HTTPUPDATE_LEVEL #define HTTPUPDATE_LEVEL 1 #endif HTTPVersionNum = HTTPVERSION HTTPRevision = HTTPREVISION HTTPUpdateLevel = HTTPUPDATE_LEVEL XCOMM I don't know whether or not X11R5/R4 image has got a Concat3. XCOMM This works. #if (ProjectX < 6) SOHTTPLIBREV = $(HTTPVersionNum)./**/$(HTTPRevision)./**/$(HTTPUpdateLevel) #else #ifdef SGIArchitecture SOHTTPLIBREV = Concat3(.$(HTTPVersionNum).,$(HTTPRevision).,$(HTTPUpdateLevel)) LDREQLIBS = -lc #else SOHTTPLIBREV = Concat3($(HTTPVersionNum).,$(HTTPRevision).,$(HTTPUpdateLevel)) #endif /* SGIArchitecture */ #endif HEADERS = HTTP.h HTTPP.h SRCS = HTTP.c cookie.c OBJS = HTTP.o cookie.o INSTALLFLAGS = $(INSTINCFLAGS) #define DoSharedLib SharedLibXmHTML #define DoNormalLib NormalLibXmHTML #define DoDebugLib DebugLibXmHTML #if (ProjectX < 5) STD_DEFINES = LibraryDefines CDEBUGFLAGS = LibraryCDebugFlags #else # define LibName http # define SoRev SOHTTPLIBREV XCOMM dumb stuff to prevent generation of bad includes:: rule # define LibHeaders foo # include #endif XCOMM XCOMM Ruleset for doing make includes XCOMM LinkFileList(link-includes,$(HEADERS), ../include/XmHTML,../../http) stamp-includes: link-includes touch link-includes touch $@ includes:: stamp-includes XCOMM XCOMM No stuff required when X revision >= 6, Library.tmpl does it for us XCOMM #if (ProjectX < 6) # if (ProjectX < 5) # if DoSharedLib SharedLibraryObjectRule() NormalSharedLibraryTarget(http,$(SOHTTPLIBREV),$(OBJS)) InstallSharedLibrary(http,$(SOHTTPLIBREV),$(HTTPLIBDIR)) # else /* No shared libs */ NormalLibraryObjectRule() # endif /* DoSharedLib */ NormalLibraryTarget(http,$(OBJS)) InstallLibrary(http,$(XPMLIBDIR)) # if DoDebugLib DebuggedLibObjCompile() DebuggedLibraryTarget(http,$(OBJS)) # endif /* DoDebugLib */ # else /* ProjectX == 5 */ LibraryObjectRule() # if DoSharedLib SharedLibraryTarget(http,$(SOHTTPLIBREV),$(OBJS),shared,..) InstallSharedLibrary(http,$(SOHTTPLIBREV),$(HTTPLIBDIR)) # endif /* DoSharedLib */ # if DoNormalLib NormalLibraryTarget(http,$(OBJS)) InstallLibrary(http,$(HTTPLIBDIR)) # endif /* DoNormalLib */ # if DoDebugLib DebuggedLibraryTarget(http,$(OBJS)) InstallLibrary(http_d,$(HTTPLIBDIR)) # endif /* DoDebugLib */ # endif /* ProjectX < 5 */ #else /* X11R6 */ XCOMM make a compiler friendly target libhttp.so #if DoSharedLib install all:: lib$(LIBNAME).so #ifdef SGIArchitecture lib$(LIBNAME).so: lib$(LIBNAME).so$(SOHTTPLIBREV) $(RM) $@ ln -s $@$(SOHTTPLIBREV) $@ #else lib$(LIBNAME).so: lib$(LIBNAME).so.$(SOHTTPLIBREV) $(RM) $@ ln -s $@$(SOHTTPLIBREV) $@ #endif /* SGIArchitecture */ clean:: $(RM) lib$(LIBNAME).so #endif /* DoSharedLib */ #endif /* ProjectX < 6 */ XCOMM rule to install header files InstallMultiple($(HEADERS),$(HTTPINCDIR)) DependTarget() XCOMM Special rule for creating a distribution with the barebone makefiles XCOMM distclean:: clean $(RM) libhttp.so.* $(RM) -r debugger shared unshared $(RM) core *.out make.world *.bak *.last *.auto $(RM) stamp-includes link-includes $(CP) Makefile.org Makefile XmHTML-1.1.7/http/cookie.c100644 23564 23564 44205 6624051737 13537 0ustar newtnewt #ifndef lint static char rcsId[] = "$Header$"; #endif /* lint */ /* * Cookie support for the simple HTTP library. * * Copyright (c) 1997-1998 Richard Offer * * 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. * */ /* Author's Note * Cookies are currently undergoing standardisation, the current accepted * practise is based on Netscapes implementation. The IETF has issued * RFC2109 in Feb97, its been ammended since then, and I'm working from * the 21Nov97 version. I expect it to change before its issued. * * Pending the widespread acceptance of a standard, I've taken a few * short-cuts, namely: * * 1) no support to restrict the ports of a cookie. * 2) interaction between Netscape and RFC2109 cookies isn't 100% * * Watch this space... */ /* ChangeLog * $Log$ * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include /* for malloc */ #include /* for strstr() */ #ifdef HAVE_STRINGS_H #include #endif #include /* for mktime() */ #include #ifdef DMALLOC #include #endif /* DMALLOC */ #ifndef True #define True (1) #endif /* True */ #ifndef False #define False (0) #endif /* False */ /* static function decls */ static HTTPCookie * newCookie(void); static void freeCookie(HTTPCookie *); static HTTPCookieList * newCookieList(void); static HTTPCookieRequest * newCookieRequest(void); static HTTPCookie * newCookie() { HTTPCookie *new_c = (HTTPCookie *) calloc(1, sizeof(HTTPCookie)); return (new_c); } void freeCookie(HTTPCookie *cookie) { if ( cookie ) { if ( cookie->domain) free(cookie->domain); if ( cookie->comment) free(cookie->comment); if ( cookie->commentURL) free(cookie->commentURL); if ( cookie->cookie.name) free(cookie->cookie.name); if ( cookie->cookie.value) free(cookie->cookie.value); if ( cookie->path) free(cookie->path); if ( cookie->port) free(cookie->port); free(cookie); } cookie = NULL; } /* This doesn't free the actual cookie, just the linked list */ static void freeCookieList(HTTPCookieList *list) { HTTPCookieList *tmp = list; HTTPCookieList *tmp2; if(!list) return; while ( tmp->next ) { tmp2 = tmp->next; free(tmp); tmp = tmp2; } if ( tmp ) free(tmp); } void freeCookieRequest(HTTPCookieRequest *req) { if ( req->cookieList ) freeCookieList(req->cookieList); if ( req->setCookie ) freeCookieList(req->setCookie); free( req); } void freeCookieCache(HTTPCookieCache *cache, int free_cookies) { int i; if(cache == NULL) return; if ( free_cookies ) { for (i=0; i< cache->ncookies ; i++ ) freeCookie(cache->cookies[i]); } free( (void *) cache->cookies ); free( (void *) cache->filename ); free(cache); } static HTTPCookieRequest * newCookieRequest() { HTTPCookieRequest *new_c = (HTTPCookieRequest *) calloc(1, sizeof(HTTPCookieRequest) ); new_c->sendCookie = True; return new_c; } static HTTPCookieList * newCookieList() { HTTPCookieList *new_c = (HTTPCookieList *) calloc(1, sizeof(HTTPCookieList)); return (new_c); } static HTTPCookieCache * newCookieCache(void) { HTTPCookieCache *new_cc = (HTTPCookieCache *) calloc(1, sizeof(HTTPCookieCache)); new_cc->cookies = (HTTPCookie **) NULL; new_cc->ncookies = 0; new_cc->filename = NULL; new_cc->fileType = 0; return (new_cc); } int sortCookies(const void *s1, const void *s2) { HTTPCookie *c1 = *(HTTPCookie **) s1; HTTPCookie *c2 = *(HTTPCookie **) s2; int c = 0; if (c1->domain && c2->domain ) c = strcasecmp(c1->domain, c2->domain); if ( c == 0 && c2->path && c1->path ) /* reverse sense of sort */ return strcmp(c2->path, c1->path); return c; } HTTPCookieCache * loadCookieFileToCache(char *filename, char fileType) { HTTPCookieCache *cc = newCookieCache(); HTTPCookie *cookie; FILE *fp; cc->filename = NewString(filename); cc->fileType = fileType; if ((fp = fopen(filename, "r")) != NULL) { char line[4097]; /* the maximum length of a cookie as defined by the spec. */ char domain[128]; char allInDomain[128]; char path[128]; char secure[128]; int expires; char name[128]; char value[128]; char comment[128]; char commentURL[128]; int version; char port[128]; int allHostsInDomain, sec; while (fgets(line, 4096, fp) != NULL) { /* very early versions of netscape (seen on 1.12) mark the first line of the * cookie file with MCOM-HTTP-Cookie-file-1 */ if (strlen(line) == 0 || line[0] == '#' || line[0] == '\n' || !strcmp(line, "MCOM-HTTP-Cookie-file-1")) continue; switch (fileType) { case NetscapeCookieFile: /* allow white space in name and value items */ sscanf(line, "%s\t%s\t%s\t%s\t%d\t%[ -~]\t%[ -~]", domain, allInDomain, path, secure, &expires, name, value); cookie = newCookie(); cookie->domain = NewString(domain); cookie->exactHostMatch = ! stringToBoolean(allInDomain); cookie->path = NewString(path); cookie->secure = stringToBoolean(secure); cookie->expires = expires; cookie->cookie.name = NewString(name); cookie->cookie.value = NewString(value); break; case CookieJar: /* allow white space in name and value items */ sscanf(line, "%s\t%d\t%d\t%s\t%s\t%d%d\t%[ -~]\t%[ -~]\t%[ -~]\t%[ -~]", domain, &version, &allHostsInDomain, path, port, &sec, &expires, comment, commentURL, name, value); cookie = newCookie(); cookie->domain = NewString(domain); cookie->exactHostMatch = allHostsInDomain; cookie->path = NewString(path); cookie->port = NewString(port); cookie->secure = sec; cookie->expires = expires; cookie->comment = NewString(comment); cookie->commentURL = NewString(commentURL); cookie->cookie.name = NewString(name); cookie->cookie.value = NewString(value); break; } if (cc->ncookies == 0) { cc->cookies = (HTTPCookie **) calloc(1, sizeof(HTTPCookie *)); } else { cc->cookies = (HTTPCookie **) realloc((void *) cc->cookies, (cc->ncookies + 1) * sizeof(HTTPCookie *)); } cc->cookies[cc->ncookies] = cookie; cc->ncookies++; } fclose(fp); } /* sort the cookies on domain and reversed path, makes it easier * generating the cookieList. * * According to the spec (example 2), more specific paths come before * the less specific one. */ qsort((void *) cc->cookies, cc->ncookies, sizeof(HTTPCookie *), sortCookies); return cc; } HTTPCookieRequest * getCookieFromCache(HTTPCookieCache * cache, char *url) { HTTPCookieRequest *req = newCookieRequest(); HTTPCookieList *cLP = req->cookieList; int i; char *hostname, *filename; char *domain; char tmpHost[128]; parseURL(url, PARSE_HOSTNAME | PARSE_FILENAME, NULL, NULL, NULL, &hostname, NULL, &filename); for (i = 0; i < cache->ncookies; i++) { memset((void *) tmpHost, 0, 128); strcat(tmpHost, hostname); /* if the cookie has expired, ignore it (it wont get written out when we save * the cache ) */ if (cache->cookies[i]->expires < time(NULL)) continue; if ((domain = strstr(tmpHost, cache->cookies[i]->domain)) != NULL) { if (cache->cookies[i]->exactHostMatch) { if (!strcasecmp(cache->cookies[i]->domain, tmpHost) && !strncmp(filename, cache->cookies[i]->path, strlen(filename))) { /* ToDo check port numbers */ if (cLP == NULL) { req->cookieList = cLP = newCookieList(); } else if (cLP->next == NULL) { cLP->next = newCookieList(); cLP = cLP->next; } cLP->cookie = cache->cookies[i]; } } else { domain[0] = '\0'; /* hostnames with embedded dots are not allowed and the domain name must have * at least one dot */ if ( strchr(tmpHost, '.') || strchr(cache->cookies[i]->domain, '.') == NULL ) continue; if (cLP == NULL) { req->cookieList = cLP = newCookieList(); } else if (cLP->next == NULL) { cLP->next = newCookieList(); cLP = cLP->next; } cLP->cookie = cache->cookies[i]; } } } freeURL(PARSE_HOSTNAME | PARSE_FILENAME, NULL, NULL, NULL, hostname, (int)NULL, filename); return req; } char * makeCookie(HTTPCookieList *cookieList ) { char cookie[4097]; /* max length of a cookie */ /* tell the server that we support RFC2109 style cookies (if the server * does as well, it will reply with Set-Cookie2 * * Note: assume that if one cookie is version 0 they all will be (for this URL). * This IS an ASSUMPTION (the spec says that it is allowable to send two * cookies of different versions, but is this likely ? */ if ( cookieList->cookie->version == 0 ) sprintf(cookie,"Cookie2: $VERSION=\"1\"\r\nCookie: $VERSION=\"%d\"; ",cookieList->cookie->version); else sprintf(cookie,"Cookie: $VERSION=\"%d\"; ",cookieList->cookie->version); while ( cookieList ) { strcat(cookie, cookieList->cookie->cookie.name); strcat(cookie, "="); strcat(cookie, cookieList->cookie->cookie.value); strcat(cookie, ";"); if ( cookieList->cookie->type == SetCookie2 ) { if ( cookieList->cookie->path ) { strcat(cookie, "$Path"); strcat(cookie, "="); strcat(cookie, cookieList->cookie->path); strcat(cookie, ";"); } if ( cookieList->cookie->domain ) { strcat(cookie, "$Domain"); strcat(cookie, "="); strcat(cookie, cookieList->cookie->domain); strcat(cookie, ";"); } /* ToDo: Port support */ } cookieList = cookieList->next; } strcat(cookie, "\r\n"); return NewString(cookie); } void addCookieListToCache(HTTPCookieCache * cache, HTTPCookieList * cookieList) { while ( cookieList ) { int i; int install = 1; /* we look to see if the cookie is already in the cache, if so we replace it * _unless_ it has a newer VERSION */ for ( i=0; i< cache->ncookies; i++ ) { if ( ! strcasecmp(cache->cookies[i]->domain, cookieList->cookie->domain) ) if ( ! strcmp(cache->cookies[i]->path, cookieList->cookie->path) ) if ( ! strcmp(cache->cookies[i]->cookie.name, cookieList->cookie->cookie.name) && cache->cookies[i]->version >= cookieList->cookie->version ) { freeCookie(cache->cookies[i]); cache->cookies[i] = cookieList->cookie; install = 0; } } if ( install ) { cache->cookies = (HTTPCookie **) realloc((void *) cache->cookies, (cache->ncookies + 1) * sizeof(HTTPCookie *)); cache->cookies[cache->ncookies] = cookieList->cookie; cache->ncookies++; } cookieList = cookieList->next; } qsort((void *) cache->cookies, cache->ncookies, sizeof(HTTPCookie *), sortCookies); } void writeCookieCache(HTTPCookieCache * cache) { if ( cache->fileType != NetscapeCookieFile ) { FILE *fp; int i; time_t t = time(NULL); if ( (fp=fopen(cache->filename, "w") ) != NULL ) { fprintf(fp,"# CookieJar-1\n"); fprintf(fp,"# This file is autogenerated, don't edit it\n"); fprintf(fp,"# format designed by Richard Offer for HTTP cookies that \n"); fprintf(fp,"# comply with both Netscape format and the 21-Nov-97 draft of HTTP State \n"); fprintf(fp,"# Management Mechanism (was RFC2109)\n\n"); #ifdef DEBUG fprintf(fp,"# format:\n"); fprintf(fp,"# domain (String)\n"); fprintf(fp,"# \n"); fprintf(fp,"# version (int) (0==SetCookie, 1==SetCookie2)\n"); fprintf(fp,"# \n"); fprintf(fp,"# exactHostMatch (int) (0=all machines in domain can access cookie\n"); fprintf(fp,"# \n"); fprintf(fp,"# path (String)\n"); fprintf(fp,"# \n"); fprintf(fp,"# port (String) comma-separated list of ports\n"); fprintf(fp,"# \n"); fprintf(fp,"# secure (int)\n"); fprintf(fp,"# \n"); fprintf(fp,"# expires (int)\n"); fprintf(fp,"# \n"); fprintf(fp,"# comment (String)\n"); fprintf(fp,"# \n"); fprintf(fp,"# commentURL (String)\n"); fprintf(fp,"# \n"); fprintf(fp,"# name (String)\n"); fprintf(fp,"# \n"); fprintf(fp,"# value (String)\n\n"); fprintf(fp,"# Netscape style cookies do not include port comment or commentURL\n"); #endif /* DEBUG */ for (i=0; i< cache->ncookies; i++ ) { if ( ! cache->cookies[i]->discard && cache->cookies[i]->expires > t ) { fprintf(fp,"%s\t",cache->cookies[i]->domain); fprintf(fp,"%d\t",cache->cookies[i]->version); fprintf(fp,"%d\t",cache->cookies[i]->exactHostMatch); fprintf(fp,"%s\t",cache->cookies[i]->path); fprintf(fp,"%s\t",cache->cookies[i]->port ? cache->cookies[i]->port : "" ); fprintf(fp,"%d\t",cache->cookies[i]->secure); fprintf(fp,"%d\t",cache->cookies[i]->expires); fprintf(fp,"%s\t",cache->cookies[i]->comment ? cache->cookies[i]->comment : "" ); fprintf(fp,"%s\t",cache->cookies[i]->commentURL ? cache->cookies[i]->commentURL : "" ); fprintf(fp,"%s\t",cache->cookies[i]->cookie.name); fprintf(fp,"%s\n",cache->cookies[i]->cookie.value); } } fclose(fp); } } } void setCookie(HTTPCookieRequest *req, int type, char *string, char *host) { HTTPCookieList *cLP = req->setCookie; char *name, *value; char *str; int i=0; if (cLP == NULL) { cLP = newCookieList(); } else if (cLP->next == NULL) { cLP->next = newCookieList(); cLP = cLP->next; } cLP->cookie = newCookie(); /* removes leading and trailing white space */ #define TRIM(str) \ { \ int n; \ while ( *str && *str == ' ' ) \ (*str)++; \ n=strlen(str)-1; \ while ( n && str[n] == ' ' ) { \ str[n] = '\0';\ n--; \ } \ } while ( str[i] ) { name = &str[i]; while ( str[i] && str[i] != '=' ) { i++; } if ( str[i] ) { str[i] = '\0'; i++; value = &str[i]; while ( str[i] && str[i] != ';' ) { i++; } if ( str[i] ) str[i] = '\0'; i++; TRIM(name); TRIM(value); if ( strlen(value)) { if ( type == SetCookie2 ) { if ( strcasecmp(name,"comment") ) cLP->cookie->comment = NewString(value); else if ( strcasecmp(name,"commenturl") ) cLP->cookie->commentURL = NewString(value); else if ( strcasecmp(name,"discard") ) cLP->cookie->discard = True; else if ( strcasecmp(name,"domain") ) { /* if first char isn't a dot add one - spec says this */ if ( value[0] != '.' ) { char d[128]; d[0] = '.'; strcat(d,value); cLP->cookie->domain = NewString(d); } else cLP->cookie->domain = NewString(value); } else if ( strcasecmp(name,"max-age") ) { int j = atoi(value); if ( j != 0 ) cLP->cookie->expires = time(NULL) + j; else /* TODO dump cookie immediately */ ; } else if ( strcasecmp(name,"path") ) cLP->cookie->path = NewString(value); else if ( strcasecmp(name,"port" ) ) { /* TODO */ ; } else if ( strcasecmp(name,"version") ) cLP->cookie->version = atoi(value); } else { /* Netscape format cookie */ if ( strcasecmp(name,"domain") ) { /* if first char isn't a dot add one - spec says this */ if ( value[0] != '.' ) { char d[128]; d[0] = '.'; strcat(d,value); cLP->cookie->domain = NewString(d); } else cLP->cookie->domain = NewString(value); } else if ( strcasecmp(name,"path") ) cLP->cookie->path = NewString(value); } } else { /* a value that has no associated value */ if ( type == SetCookie2 ) { if ( strcasecmp(name,"discard" ) ) cLP->cookie->discard = True; else if ( strcasecmp(name, "secure") ) cLP->cookie->secure = True; } else { if ( strcasecmp(name, "expires" ) ) { /* typical of netscape they have a non-standard and facist-to-parse date * format */ char day[16],month[3]; int date,mon,yr,hr,min,sec; struct tm timeStruct; time_t t; sscanf(name, "expires %s, %d-%s-%d %d:%d%d", day, &date, month, &yr, &hr, &min, &sec); if ( month[0] == 'J' ) { if ( month[1] == 'a' ) mon = 0; else if ( month[2] == 'n' ) mon = 5; else mon = 6; } else if ( month[0] == 'F' ) mon = 1; else if ( month[0] == 'M' ) { if ( month[2] == 'r' ) mon = 2; else mon = 4; } else if ( month[0] == 'A' ) { if ( month[1] == 'p' ) mon = 3; else mon= 7; } else if ( month[0] == 'S' ) mon = 8; else if ( month[0] == 'O' ) mon = 9; else if ( month[0] == 'N' ) mon = 10; else if ( month[0] == 'D' ) mon = 11; timeStruct.tm_sec = sec; timeStruct.tm_min = min; timeStruct.tm_hour = hr; timeStruct.tm_mday = date; timeStruct.tm_mon = mon; timeStruct.tm_isdst = -1; /* the don't know flag */ t = mktime( & timeStruct ); if ( t != -1 ) cLP->cookie->expires = t ; } if ( strcasecmp(name, "secure") ) cLP->cookie->secure = True; } } } } if ( cLP->cookie->domain == NULL ) { cLP->cookie->domain = NewString(host); } if ( cLP->cookie->path == NULL ) { cLP->cookie->path = NewString("/"); } } void mergeCookieCache(HTTPCookieCache *c1, HTTPCookieCache *c2) { if ( c1 && c2 ) { c1->cookies = (HTTPCookie **) realloc( (void *) c1->cookies, (c1->ncookies + c2->ncookies) * sizeof(HTTPCookie) ); memcpy( (void *) & (c1->cookies[c1->ncookies]), (void *) c2->cookies, c2->ncookies * sizeof(HTTPCookie *) ); c1->ncookies += c2->ncookies; } } XmHTML-1.1.7/include/ 40755 23564 23564 0 6656073330 12442 5ustar newtnewtXmHTML-1.1.7/include/XmHTML/ 40755 23564 23564 0 6651241640 13507 5ustar newtnewtXmHTML-1.1.7/include/XmHTML/Balloon.h100644 23564 23564 5337 6533065602 15354 0ustar newtnewt/***** * Balloon.h : XmBalloon Widget public header file * * This file Version $Revision: 1.1 $ * * Creation date: Sun Nov 2 19:18:40 GMT+0100 1997 * Last modification: $Date: 1998/04/04 06:27:16 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/Balloon.h,v $ *****/ /***** * ChangeLog * $Log: Balloon.h,v $ * Revision 1.1 1998/04/04 06:27:16 newt * Initial Revision * *****/ #ifndef _Balloon_h_ #define _Balloon_h_ /* required includes */ #include #include #include _XFUNCPROTOBEGIN /* XmBalloon type defines */ typedef struct _XmBalloonClassRec *XmBalloonWidgetClass; typedef struct _XmBalloonRec *XmBalloonWidget; externalref WidgetClass xmBalloonWidgetClass; /* XmBalloonWidget subclassing macro */ #ifndef XmIsBalloon #define XmIsBalloon(w) XtIsSubclass(w, xmBalloonWidgetClass) #endif /* XmIsBalloon */ /***** * Possible values for XmNcornerStyle * The TFolder widget also has this so we check against it. *****/ #ifndef _XmTabFolder_h enum{ XmCORNER_STRAIGHT = 0, XmCORNER_BEVELED, XmCORNER_SLANT, XmCORNER_ROUND }; #endif /***** * Possible values for XmNballoonStyle *****/ enum{ XmBALLOON_SQUARE = 0, XmBALLOON_SHAPED }; /******* Public Function Declarations ********/ /* create an XmBalloon Widget */ Widget XmCreateBalloon(Widget parent, String name, ArgList arglist, Cardinal argcount); /***** * Popup an XmBalloon Widget. x and y specify the position where the balloon * should popup. They are relative to the upper-left corner of the Balloon's * parent. If both are 0, the balloon is popped up right under the current * pointer's position. *****/ void XmBalloonPopup(Widget w, Position x, Position y, String label); /* popdown an XmBalloon Widget */ void XmBalloonPopdown(Widget w); _XFUNCPROTOEND /* Don't add anything after this endif! */ #endif /* _Balloon_h_ */ XmHTML-1.1.7/include/XmHTML/BalloonP.h100644 23564 23564 10720 6533065602 15504 0ustar newtnewt/***** * BalloonP.h : XmBalloon private header file * * This file Version $Revision: 1.1 $ * * Creation date: Sun Nov 2 19:18:42 GMT+0100 1997 * Last modification: $Date: 1998/04/04 06:27:17 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/BalloonP.h,v $ *****/ /***** * ChangeLog * $Log: BalloonP.h,v $ * Revision 1.1 1998/04/04 06:27:17 newt * Initial Revision * *****/ #ifndef _BalloonP_h_ #define _BalloonP_h_ #include /* we're subclassing from overrideShell */ /* Required includes */ #include _XFUNCPROTOBEGIN /***** * Class Pointer *****/ typedef struct { XtPointer extensions; /* Pointer to extension record */ }XmBalloonClassPart; typedef struct _XmBalloonClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; OverrideShellClassPart override_shell_class; XmBalloonClassPart balloon_class; }XmBalloonClassRec; /***** * Supporting structures *****/ typedef struct _transform { double mx, bx; double my, by; }Transform; typedef struct _TPoint { double x, y; }TPoint; /***** * XmBalloon instance definition *****/ typedef struct _XmBalloonPart { /* public widget data */ String label; /* original label as set by user */ String source; /* privatly owner copy */ int source_len; /* size of label */ int popup_delay; /* delay before popping up */ int popdown_delay; /* delay before popping down */ Dimension margin_width; /* horizontal margin spacing */ Dimension margin_height; /* vertical margin spacing */ int left_offset; /* left cursor offset */ int top_offset; /* top cursor offset */ float border_size; /* thickness of the border */ Pixel foreground; /* foreground pixel to be used */ #if XtSpecificationRelease < 5 XFontStruct *font; /* X11R4 font to be used */ #else XFontSet fontset; /* X11R5 or above uses fontSets */ #endif unsigned char corner_style; /* how corners should be drawn */ unsigned char balloon_style; /* balloon style */ Boolean transparent; /* make balloon fully transparent */ int backing_store; /* * select appropriate amount of * backing store */ /* private widget data */ Position pop_x; /* relative x-popup position */ Position pop_y; /* relative y-popup position */ Dimension font_width; /* width of common (1 TeX em) */ Dimension font_height; /* font height (row spacing) */ Dimension baseline; /* baseline offset */ GC gc; /* text rendering gc */ GC top_gc; /* top shadow gc */ GC bottom_gc; /* bottom shadow gc */ GC shape_gc; /* shaped window gc */ XtIntervalId popup_id; /* popup timeout id */ XtIntervalId popdown_id; /* popdown timout id */ XtAppContext context; /* application context for timeouts */ Boolean popped; /* True when we are being displayed */ /* Shaped Window data */ Boolean shape_window; /* use shaped window extension? */ Pixmap shape_mask; /* window shape */ int shape_width; /* last shaped window width */ int shape_height; /* last shaped window height */ Transform t; Transform maskt; }XmBalloonPart; typedef struct _XmBalloonRec { CorePart core; CompositePart composite; ShellPart shell; OverrideShellPart override; XmBalloonPart balloon; }XmBalloonRec; externalref XmBalloonClassRec xmBalloonClassRec; /* Never define _LIBRARY yourself */ #ifdef VERSION # ifndef _LIBRARY # define _LIBRARY # endif #endif _XFUNCPROTOEND /* Don't add anything after this endif! */ #endif /* _BalloonP_h_ */ XmHTML-1.1.7/include/XmHTML/HTML.h100644 23564 23564 144737 6640200010 14561 0ustar newtnewt/***** * HTML.h : XmHTML Widget public header file. * Resource defines, enumerations and structures. * * This file Version $Revision: 1.8 $ * * Creation date: Tue Apr 15 23:39:26 GMT+0100 1997 * Last modification: $Date: 1998/04/27 06:54:30 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/HTML.h,v $ *****/ /***** * ChangeLog * $Log: HTML.h,v $ * Revision 1.8 1998/04/27 06:54:30 newt * Changed XmImageProc proto * * Revision 1.7 1998/04/04 06:27:46 newt * XmHTML Beta 1.1.3 * * Revision 1.6 1997/10/23 00:24:27 newt * XmHTML Beta 1.1.0 release * * Revision 1.5 1997/08/31 17:30:39 newt * Removed HT_TEXTFLOW * * Revision 1.4 1997/08/30 00:22:46 newt * Alpha channel resources: XmNalphaChannelProcessing and * XmNimageRGBConversion. Updated comments and reorganized a bunch of things. * * Revision 1.3 1997/08/01 12:52:11 newt * Progressive image loading changes * * Revision 1.2 1997/05/28 01:29:28 newt * XmImage changes: added the XmImageConfig structure and configuration flags. * Added support for the XmNdecodeGIFProc resource. * * Revision 1.1 1997/04/29 14:19:18 newt * Initial Revision * *****/ #ifndef _HTML_h_ #define _HTML_h_ /* include our new resources */ #include /****************************************************************************** * Enumerations and other constants ******************************************************************************/ /***** * HTML Elements internal id's * This list is alphabetically sorted to speed up the searching process. * DO NOT MODIFY *****/ typedef enum{ HT_DOCTYPE, HT_A, HT_ADDRESS, HT_APPLET, HT_AREA, HT_B, HT_BASE, HT_BASEFONT, HT_BIG, HT_BLOCKQUOTE, HT_BODY, HT_BR, HT_CAPTION, HT_CENTER, HT_CITE, HT_CODE, HT_DD, HT_DFN, HT_DIR, HT_DIV, HT_DL, HT_DT, HT_EM, HT_FONT, HT_FORM, HT_FRAME, HT_FRAMESET, HT_H1, HT_H2, HT_H3, HT_H4, HT_H5, HT_H6, HT_HEAD, HT_HR, HT_HTML, HT_I, HT_IMG, HT_INPUT, HT_ISINDEX, HT_KBD, HT_LI, HT_LINK, HT_MAP, HT_MENU, HT_META, HT_NOFRAMES, HT_OL, HT_OPTION, HT_P, HT_PAGE, HT_PARAM, HT_PRE, HT_SAMP, HT_SCRIPT, HT_SELECT, HT_SMALL, HT_STRIKE, HT_STRONG, HT_STYLE, HT_SUB, HT_SUP, HT_TAB, HT_TABLE, HT_TD, HT_TEXTAREA, HT_TH, HT_TITLE, HT_TR, HT_TT, HT_U, HT_UL, HT_VAR, HT_ZTEXT }htmlEnum; /***** * Corresponding HTML element name table. Indexing with the above enumeration * will give the corresponding element name. *****/ extern String *html_tokens; /***** * XmHTML defines the following callback reasons. This might produce strange * results once Motif decides to uses enum values above 16383. * Send us a mail at ripley@xs4all.nl if you get problems that are due to * these enumeration values. *****/ enum{ XmCR_HTML_ANCHORTRACK = 16384, /* XmNanchorTrackCallback */ XmCR_HTML_DOCUMENT, /* XmNdocumentCallback */ XmCR_HTML_FORM, /* XmNformCallback */ XmCR_HTML_FRAME, /* XmNframeCallback */ XmCR_HTML_FRAMECREATE, /* XmNframeCallback */ XmCR_HTML_FRAMEDESTROY, /* XmNframeCallback */ XmCR_HTML_IMAGEMAPACTIVATE, /* XmNimagemapCallback */ XmCR_HTML_IMAGEMAP, /* XmNimagemapCallback */ XmCR_HTML_LINK, /* XmNlinkCallback */ XmCR_HTML_MODIFYING_TEXT_VALUE, /* XmNmodifyVerifyCallback */ XmCR_HTML_MOTIONTRACK, /* XmNmotionTrackCallback */ XmCR_HTML_PARSER, /* XmNparserCallback */ XmCR_HTML_EVENT, /* XmNeventCallback */ XmCR_HTML_EVENTDESTROY, /* XmNeventCallback */ XmCR_HTML_OBJECT, /* XmNobjectCallback */ XmCR_HTML_OBJECTCREATE, /* XmNobjectCallback */ XmCR_HTML_OBJECTDESTROY /* XmNobjectCallback */ }; /***** * XmNeventCallback sub event types *****/ enum{ /* Document/Frame specific events */ XmCR_HTML_LOAD = 0, /* onLoad */ XmCR_HTML_UNLOAD, /* onUnLoad */ /* HTML Form specific events */ XmCR_HTML_SUBMIT, /* onSubmit */ XmCR_HTML_RESET, /* onReset */ XmCR_HTML_FOCUS, /* onFocus */ XmCR_HTML_BLUR, /* onBlur */ XmCR_HTML_SELECT, /* onSelect */ XmCR_HTML_CHANGE, /* onChange */ /* object events */ XmCR_HTML_CLICK, /* onClick */ XmCR_HTML_DOUBLE_CLICK, /* onDblClick */ XmCR_HTML_MOUSEDOWN, /* onMouseDown */ XmCR_HTML_MOUSEUP, /* onMouseUp */ XmCR_HTML_MOUSEOVER, /* onMouseOver */ XmCR_HTML_MOUSEMOVE, /* onMouseMove */ XmCR_HTML_MOUSEOUT, /* onMouseOut */ XmCR_HTML_KEYPRESS, /* onKeyPress */ XmCR_HTML_KEYDOWN, /* onKeyDown */ XmCR_HTML_KEYUP, /* onKeyUp */ XmCR_HTML_USEREVENT /* must always be last */ }; /***** * URL types XmHTML knows of. * The hostnames, files and port numbers are only shown for demonstration * purposes, XmHTML doesn't care whether they are present or not. * The first 16 elements are alphabetically sorted to speed up URL * translations. *****/ typedef enum{ ANCHOR_ABOUT = 0, /* href="about:..." */ ANCHOR_EXEC, /* href="exec:foo_bar" */ ANCHOR_FILE_REMOTE, /* href="file://foo.bar/file.html" */ ANCHOR_FTP, /* href="ftp://foo.bar/file" */ ANCHOR_GOPHER, /* href="gopher://foo.bar:70" */ ANCHOR_HELP, /* href="help:..." */ ANCHOR_HTTP, /* href="http://foo.bar/file.html" */ ANCHOR_SECURE_HTTP, /* href="https://foo.bar/file.html" */ ANCHOR_INFO, /* href="info:.." */ ANCHOR_MAILTO, /* href="mailto:foo@bar" */ ANCHOR_MAN, /* href="man:..." */ ANCHOR_NEWS, /* href="news://foo.bar" */ ANCHOR_PIPE, /* href="pipe:foo_bar" */ ANCHOR_TELNET, /* href="telnet://foo.bar:23" */ ANCHOR_WAIS, /* href="wais://foo.bar" */ ANCHOR_XEXEC, /* href="xexec:foo_bar" */ ANCHOR_UNKNOWN, /* unknown href */ ANCHOR_FILE_LOCAL, /* href="file.html" */ ANCHOR_FORM_IMAGE, /* , only used internally */ ANCHOR_JUMP, /* href="#..." */ ANCHOR_NAMED /* name="...." */ }URLType; /***** * Various methods of loading documents. * LOAD_NORMAL * The entire document is provided. This is the default method of loading * documents. * LOAD_PROGRESSIVE * Progressive document load. A complete source is provided each time: * caller takes care of appending new text to th current buffer before * flushing it to XmHTML. * LOAD_INCREMENTAL * Progressive document load. A new chunk is provided each time: XmHTML * takes care of appending new text to the already existing text. * LOAD_SUSPEND * Suspend progressive or incremental loading. XmHTML display the document * upto the last valid combination of tokens. * LOAD_ABORT * Abort progressive or icremental loading. XmHTML will flush it's * buffers and display all the data (including any constructs it * requires to close the document). *****/ enum{ XmLOAD_NORMAL = 0, /* normal load, all data at once */ XmLOAD_PROGRESSIVE, /* progressive load, use new text */ XmLOAD_INCREMENTAL, /* progressive load, append new text */ XmLOAD_SUSPEND, /* suspend load */ XmLOAD_ABORT /* abort load */ }; /***** * Procedure to be called whenever a reference to any of the HTML4.0 events is * encountered * Arguments: * Widget: XmHTMLWidget id * String: script data * XtPointer: XmNclientData value * Return value: * data to be stored with this event. * This data is unused internally and is provided as the user_data * argument in the XmHTMLEvent structure. For example, the return value * could be a pointer into some internal procedural database, a ptr to a * compiled script procedure or the script source text if you want to * process it at some later time (when the event occurs). * * When NULL is returned the event in question is disabled. * * Note that, most of the time, the script data will reference a script defined * with the HTML elements. *****/ typedef XtPointer (*XmHTMLEventProc)(Widget, String, XtPointer); /***** * Definition of * * Definition of a script: * * * Your XmHTMLScriptProc should be able to handle both. * *****/ typedef void (*XmHTMLScriptProc)(Widget, XmHTMLScriptData*, XtPointer); /***** * HTML Form component types. Alphabetically sorted to speed up searching. *****/ typedef enum{ FORM_CHECK = 0, /* checkbox */ FORM_FILE, /* file selection box */ FORM_HIDDEN, /* hidden input */ FORM_IMAGE, /* drawnbutton */ FORM_OPTION, /* select child */ FORM_PASSWD, /* password textfield */ FORM_RADIO, /* radiobox */ FORM_RESET, /* reset button */ FORM_SELECT, /* select parent */ FORM_SUBMIT, /* submit button */ FORM_TEXT, /* singleline textfield */ FORM_TEXTAREA, /* multiline edit field */ FORM_UNKNOWN /* unknown type */ }componentType; /***** * Supported HTML Form method types *****/ enum{ XmHTML_FORM_GET = 0, /* method = get */ XmHTML_FORM_POST, /* method = post */ XmHTML_FORM_PIPE /* method = pipe */ }; /***** * possible error codes for XmNparserCallback *****/ typedef enum{ HTML_UNKNOWN_ELEMENT = 1, /* unknown HTML element */ HTML_BAD, /* very badly placed element */ HTML_OPEN_BLOCK, /* block still open while new block started */ HTML_CLOSE_BLOCK, /* block closed but was never opened */ HTML_OPEN_ELEMENT, /* unbalanced terminator */ HTML_NESTED, /* improperly nested element */ HTML_VIOLATION, /* bad content for current block/element */ HTML_NOTIFY, /* notification of text insertion/removal */ HTML_INTERNAL /* internal parser error */ }parserError; /***** * And corresponding values for XmNenableBadHTMLWarnings. * These are or'd together. * XmNONE disables warnings and XmHTML_ALL enables all warnings. * See parserError for their meaning. *****/ enum{ XmHTML_NONE = 0, /* no warnings */ XmHTML_UNKNOWN_ELEMENT = 1, XmHTML_BAD = 2, XmHTML_OPEN_BLOCK = 4, XmHTML_CLOSE_BLOCK = 8, XmHTML_OPEN_ELEMENT = 16, XmHTML_NESTED = 32, XmHTML_VIOLATION = 64, XmHTML_ALL = 127 /* all warnings */ }; /***** * possible action codes for the action field in the XmHTMLParserCallbackStruct *****/ enum{ HTML_REMOVE = 1, /* remove offending element */ HTML_INSERT, /* insert missing element */ HTML_SWITCH, /* switch offending and expected element */ HTML_KEEP, /* keep offending element */ HTML_IGNORE, /* ignore, proceed as if nothing happened */ HTML_ALIAS, /* alias an unknown element to known one */ HTML_TERMINATE /* terminate parser */ }; /***** * Possible return codes for XmHTMLImageGetType(). *****/ enum{ IMAGE_ERROR = 0, /* error on image loading */ IMAGE_UNKNOWN, /* unknown image */ IMAGE_XPM, /* X11 pixmap */ IMAGE_XBM, /* X11 bitmap */ IMAGE_GIF, /* CompuServe(C) Gif87a or Gif89a */ IMAGE_GIFANIM, /* animated gif */ IMAGE_GIFANIMLOOP, /* animated gif with loop extension */ IMAGE_GZF, /* compatible Gif87a or Gif89a */ IMAGE_GZFANIM, /* compatible animated gif */ IMAGE_GZFANIMLOOP, /* compatible animated gif */ IMAGE_JPEG, /* JPEG image */ IMAGE_PNG, /* PNG image */ IMAGE_FLG /* Fast Loadable Graphic */ }; /***** * Possible return values for a function installed on the * XmNprogressiveReadProc resource. *****/ #define STREAM_OK 1 /* internally used value */ #define STREAM_END 0 /* data stream ended (no more data) */ #define STREAM_SUSPEND -1 /* data stream suspended (not enough data) */ #define STREAM_ABORT -2 /* data stream aborted */ #define STREAM_RESIZE -3 /* resize input buffer */ /***** * Possible return values for the XmNdecodeGIFProc resource and * values for the XmHTMLGIFStream state. *****/ #define GIF_STREAM_OK 2 #define GIF_STREAM_END 1 #define GIF_STREAM_ERR 0 #define GIF_STREAM_INIT -1 #define GIF_STREAM_FINAL -2 /***** * Possible return values from a number of image related routines. * The actual meaning depends on the routine used. *****/ typedef enum{ XmIMAGE_ERROR = 0, /* unknown error occured */ XmIMAGE_BAD, /* bad function call: missing arg or so */ XmIMAGE_UNKNOWN, /* provided XmImage/XmImageInfo unknown/unbound */ XmIMAGE_ALMOST, /* action completed, further response necessary */ XmIMAGE_OK /* action completed. */ }XmImageStatus; /***** * Possible values for transparency (value for the "bg" field in both * XmImage and XmImageInfo structures). Possible values are: * * XmIMAGE_NONE * indicates the image is not transparent * XmIMAGE_TRANSPARENCY_BG * indicates the image achieves transparency by substituting the current * background setting (can be a single color or background image. Internally, * such transparency is achieved by using a clipmask). * XmIMAGE_TRANSPARENCY_ALPHA * indicates the image achieves transparency by using an alpha channel. * This transparency is currently only used by PNG images with an alpha * channel or a tRNS chunk (which is expanded to an alpha channel internally). *****/ enum{ XmIMAGE_NONE = 0, XmIMAGE_TRANSPARENCY_BG, XmIMAGE_TRANSPARENCY_ALPHA }; /***** * Possible values for the colorspace value. * * XmIMAGE_COLORSPACE_GRAYSCALE * image contains only shades of gray. The colorcube is reduced to a 1D * representation. All components in a shade have the same value. The * pixel values are equal to the value of a single color component. * XmIMAGE_COLORSPACE_INDEXED * image uses a fixed palette. Colorcube is mapped to a 1D lookup-table. * XmIMAGE_COLORSPACE_RGB * image uses a full 3D colorcube. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_COLORSPACE_GRAYSCALE = 1, XmIMAGE_COLORSPACE_INDEXED, XmIMAGE_COLORSPACE_RGB }; /***** * XmImageInfo structure options field bits. * The ``Set by default'' indicates a bit set when the XmHTMLImageDefaultProc * is used to read an image. The ``Read Only'' indicates a bit you should * consider as read-only. * XmIMAGE_DELAYED * Indicates the image is delayed, e.i. it will be provided at a later stage; * XmIMAGE_DEFERRED_FREE * Indicates XmHTML may free this structure when a new document is loaded. * XmIMAGE_IMMEDIATE_FREE * Indicates XmHTML may free this structure when XmHTML no longer needs it; * XmIMAGE_RGB_SINGLE * Indicates that the reds, greens and blues fields are allocated in a single * memory area instead of three seperate memory arrays. * XmIMAGE_ALLOW_SCALE * Indicates that scaling an image is allowed. * XmIMAGE_FRAME_IGNORE * Use with animations: set this bit when a frame falls outside the logical * screen area. No pixmap is created but the timeout for the frame is kept. * XmIMAGE_CLIPMASK * This bit is set when the returned XmImageInfo structure contains clipmask * data. XmHTML uses this info to create a clipping bitmap. Changing this * bit from set to unset will lead to a memory leak while changing it from * unset to set *without* providing a clipmask yourself *will* cause an error * to happen. You can set this bit when you are providing your own clipmask * (to provide non-rectangular images for example), PROVIDED you fill the * ``clip'' field with valid bitmap data (a stream of bytes in XYBitmap format * and the same size of the image). * XmIMAGE_SHARED_DATA * This bit is set when images share data. XmHTML sets this bit when the image * in question is an internal image, e.i., one for which the image data may * never be freed. Be carefull setting this bit yourself, since it prevents * XmHTML from freeing the image data present in the XmImageInfo structure. * It can easily lead to memory leaks when an image is *not* an internal * image. * XmIMAGE_PROGRESSIVE * Setting this bit will enable XmHTML progressive image loading. A function * *must* have been installed on the XmNprogressiveReadProc resource *prior* * to setting this bit. Installing a function on the XmNprogressiveEndProc * is optional. When this bit is set all other bits will be ignored. * XmIMAGE_DELAYED_CREATION * This bit is read-only. It is used internally by XmHTML for images with * an alpha channel. Alpha channel processing merges the current background * with the original RGB data from the image and uses the result to compose * the actual on-screen image (the merged data is stored in the ``data'' * field of the XmImageInfo structure). XmHTML needs to store the original * data somewhere, and when this bit is set it is stored in the ``rgb'' field * of the XmImageInfo structure. * When this bit is set, the returned XmImageInfo may *NOT BE FREED* as long * as the current document is alive. You can discard it as soon as a new * document is loaded. *****/ #define XmIMAGE_DELAYED (1<<1) #define XmIMAGE_DEFERRED_FREE (1<<2) /* set by default */ #define XmIMAGE_IMMEDIATE_FREE (1<<3) #define XmIMAGE_RGB_SINGLE (1<<4) /* set by default */ #define XmIMAGE_ALLOW_SCALE (1<<5) /* set by default */ #define XmIMAGE_FRAME_IGNORE (1<<6) #define XmIMAGE_CLIPMASK (1<<7) /* Read Only */ #define XmIMAGE_SHARED_DATA (1<<8) /* Read Only */ #define XmIMAGE_PROGRESSIVE (1<<9) #define XmIMAGE_DELAYED_CREATION (1<<10) /* Read Only */ /***** * XmImageInfo animation disposal values * A disposal method specifies what should be done before the current frame is * rendered. Possible values are: * XmIMAGE_DISPOSE_NONE * do nothing, overlays the previous frame with the current frame. * XmIMAGE_DISPOSE_BY_BACKGROUND * Restore to background color. The area used by the previous frame must * be restored to the background color/image * XmIMAGE_DISPOSE_BY_PREVIOUS * Restore to previous. The area used by the previous frame must be * restored to what was there prior to rendering the previous frame. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_DISPOSE_NONE = 1, /* default behaviour */ XmIMAGE_DISPOSE_BY_BACKGROUND, XmIMAGE_DISPOSE_BY_PREVIOUS }; /***** * Primary image cache actions * (unimplemented) *****/ #define IMAGE_STORE 0 /* store an image in the cache */ #define IMAGE_GET 1 /* retrieve an image from the cache */ #define IMAGE_DISCARD 2 /* discard an image from the cache */ /***** * XmNperfectColors/XmNalphaChannelProcessing resource values. * * Note: these values are represented by the XmCEnableMode resource class. *****/ enum{ /* XmAUTOMATIC */ XmALWAYS = 1, XmNEVER }; /***** * Possible XmNimageMapToPalette/XmNimageRGBConversion resource values: * * XmQUICK * RGBConversion: * first checks if the 24bit image contains less than XmNmaxImageColors. * If not, XmHTML will dither to a fixed palette. This is fast but has * the disadvantage that the background color in an alpha channelled * image will not be matched exactly. * MapToPalette: * Use closest distance algorithm to map colors to the palette. No * error correction is performed. Reasonably fast, but quality * heavily depends on the distribution of the colors in the image. * XmBEST * RGBConversion (default): * first checks if the 24bit image contains less than XmNmaxImageColors. * If it is, the actual image colors are used. If not, a histogram of the * image is computed, the most used colors are selected and the resulting * image is dithered to this palette. * Offers best 24 to 8bit conversion and is probably faster than XmSLOW * as only images with more than XmNmaxImageColors will be dithered. * MapToPalette: * Ordered dithering using predefined error matrices. Reasonably fast and * quite good results; * XmFAST * RGBConversion: * Skips the check and dithers to a fixed palette right away. This is the * fastest way to do 24 to 8bit conversion but has the disadvantage that * every 24bit image is dithered to a fixed palette, regardless of the * actual no of colors in the image. * MapToPalette: * Simple ordered dithering. Fastest but probably the poorest results. * XmSLOW * RGBConversion: * Skips the check and does histogram stuff right away. * MapToPalette: * closest distance algorithm to map image colors to the palette and use * dynamic error correction. Slowest but best results; * XmDISABLED * RGBConversion: * ignored; * MapToPalette (default): * Disables palette mapping; * * Note: these values are represented by the XmCConversionMode resource class. *****/ enum{ XmQUICK = 0, XmBEST, XmFAST, XmSLOW, XmDISABLED }; /***** * Embedded object flags. These flags tell XmHTML which attributes are * defined for an object. *****/ #define HT_TAG_CLASSID (1<<1) /* classid, defines an implementation */ #define HT_TAG_CODEBASE (1<<2) /* base url for applet */ #define HT_TAG_DATA (1<<3) /* object data */ #define HT_TAG_SRC (1<<4) /* object data */ #define HT_TAG_TYPE (1<<5) /* internet data content type */ #define HT_TAG_CODETYPE (1<<6) /* internet code content type */ #define HT_TAG_STANDBY (1<<7) /* standby message */ #define HT_TAG_ALIGN (1<<8) /* global alignment */ #define HT_TAG_HALIGN (1<<9) /* horizontal alignment */ #define HT_TAG_VALIGN (1<<10) /* vertical alignment */ #define HT_TAG_HEIGHT (1<<11) /* suggested height */ #define HT_TAG_WIDTH (1<<12) /* suggested width */ #define HT_TAG_BORDER (1<<13) /* suggested border width */ #define HT_TAG_HSPACE (1<<14) /* suggested horizontal gutting space */ #define HT_TAG_VSPACE (1<<15) /* suggested vertical gutting space */ #define HT_TAG_USEMAP (1<<16) /* imagemap reference */ #define HT_TAG_BACKGROUND (1<<17) /* background image specification */ #define HT_TAG_BGCOLOR (1<<18) /* background color specification */ #define HT_TAG_HREF (1<<19) /* hyperlink */ #define HT_TAG_NAME (1<<20) /* object name/named hyperlink */ #define HT_TAG_EVENTS (1<<21) /* HTML4.0 events */ /***** * Possible return values for the embedded object convenience functions *****/ typedef enum{ OBJECT_ALMOST = 0, /* action completed, further action required */ OBJECT_DESTROYED, /* object has been destroyed */ OBJECT_EMPTY, /* object is empty */ OBJECT_ERROR, /* unknown error */ OBJECT_FATAL, /* fatal object error has occured */ OBJECT_INVALID, /* invalid object */ OBJECT_INVALID_LOCATION,/* object has an invalid location */ OBJECT_INVALID_SIZE, /* object has an invalid size */ OBJECT_LOWERED, /* object is lowered */ OBJECT_MAPPED, /* object is mapped to screen */ OBJECT_OK, /* action completed succesfully */ OBJECT_ORPHANED, /* object has no parent */ OBJECT_PARENTED, /* object already has a parent */ OBJECT_RAISED, /* object is raised */ OBJECT_UNIMPLEMENTED, /* requested function unimplemented */ OBJECT_UNKNOWN, /* unknown object */ OBJECT_UNKNOWN_ELEMENT, /* invalid element id */ OBJECT_UNMAPPED, /* object has been unmapped */ OBJECT_UNUSED, /* object is not being used */ OBJECT_USED, /* object is currently being used */ OBJECT_VISIBLE /* object is visible */ }XmHTMLObjectStatus; /***** * Search directions: forward or backward search *****/ typedef enum{ XmHTML_FORWARD = 0, XmHTML_BACKWARD }XmHTMLDirection; /***** * XmHTMLTextFind return codes *****/ typedef enum{ XmREG_ERROR = 0, /* An error occured */ XmREG_NOMATCH, /* end of text and no match found */ XmREG_MATCH /* a match was found */ }XmHTMLRegexStatus; /***** * In addition to the POSIX regex error codes, XmHTMLTextFinderGetError * can return the following errors *****/ #define RE_EEMPTY -1 /* no search string given */ #define RE_ENOMEM -2 /* out of memory */ #define RE_EBADPARENT -3 /* parent is not of class xmHTMLWidgetClass */ #define RE_EWORDS -4 /* no words to be searched (empty document) */ #define RE_ERROR -5 /* unknown error */ /***** * Finder is a fully opaque types. *****/ typedef struct _XmHTMLTextFinder *XmHTMLTextFinder; /***** * Custom Papersize dimension unit type * (under construction) *****/ enum{ XmHTML_CHAR = 0, XmHTML_CENTIMETER, /* 1cm = 0.39in */ XmHTML_MILLIMETER, /* 1mm = 0.1cm */ XmHTML_INCH, /* 1in = 2.54cm */ XmHTML_PICA, /* 1pc = 12pt */ XmHTML_POINT /* 1in = 72.27pt, 1cm = 28.45pt */ }; /***** * XmHTMLTextGetFormatted paper size defines * (under construction) *****/ enum{ XmHTMLTEXT_PAPERSIZE_A4 = 0, XmHTMLTEXT_PAPERSIZE_LETTER, XmHTMLTEXT_PAPERSIZE_CUSTOM }; /***** * XmHTMLTextGetFormatted type definitions * (under construction) *****/ enum{ XmHTMLTEXT_PLAIN = 0, /* generate plain ASCII document */ XmHTMLTEXT_FORMATTED, /* generate formatted ASCII document */ XmHTMLTEXT_POSTSCRIPT /* generate formatted Postscript output */ }; /***** * XmHTMLTextGetFormatted Postscript option bits * (under construction) * The MIMIC_FONTS bit instructs XmHTML to use any of the supported postscript * fonts to approach the fonts used in the document. When set, all other font * bits are ignored. When not used, the PSFONT bits can be or'd together. * XmHTML will attempt to do the following mapping: * PSFONT_ROMAN/PSFONT_CENTURY -> default text font; * PSFONT_HELVETICA/PSFONT_LUCIDA -> fixed width font; * If only one of the PSFONT bits is set, the entire document will be rendered * in that font. *****/ #define XmHTMLTEXT_ANCHORFOOTNOTES (1L<<0) /* footnote anchors */ #define XmHTMLTEXT_ADDHEADER (1L<<1) /* put title */ #define XmHTMLTEXT_ADDFOOTER (1L<<2) /* put pagenumbers */ #define XmHTMLTEXT_PSFONT_ROMAN (1L<<3) #define XmHTMLTEXT_PSFONT_HELVETICA (1L<<4) #define XmHTMLTEXT_PSFONT_CENTURY (1L<<5) #define XmHTMLTEXT_PSFONT_LUCIDA (1L<<6) #define XmHTMLTEXT_MIMIC_FONTS (1L<<7) /***** * XmHTMLGetHeadAttributes mask bits *****/ #define HeadClear ((unsigned char)0) /* clear everything */ #define HeadDocType (1<<0) /* fill doctype member */ #define HeadTitle (1<<1) /* fill title member */ #define HeadIsIndex (1<<2) /* fill isIndex member */ #define HeadBase (1<<3) /* fill Base member */ #define HeadMeta (1<<4) /* fill meta members */ #define HeadLink (1<<5) /* fill link members */ #define HeadScript (1<<6) /* fill script members */ #define HeadStyle (1<<7) /* fill Style members */ #define HeadAll ((unsigned char)~0) /* fill all members */ /***** * XmImage frame selection flags. * any positive number will return the requested frame. If larger than * total framecount, last frame is returned. *****/ #define AllFrames -1 /* do all frames */ #define FirstFrame -2 /* only use first frame */ #define LastFrame -3 /* only do last frame */ /***** * XmImage configuration flags *****/ #define ImageFSDither (1L<<1) /* Floyd-Steinberg on quantized images */ #define ImageCreateGC (1L<<2) /* create gc for image */ #define ImageWorkSpace (1L<<3) /* create animation workspace */ #define ImageClipmask (1L<<4) /* create clipmask */ #define ImageBackground (1L<<5) /* substitute background pixel */ #define ImageQuantize (1L<<6) /* quantize image */ #define ImageMaxColors (1L<<7) /* sets maximum colors */ #define ImageGifDecodeProc (1L<<8) /* gif lzw decoder function */ #define ImageGifzCmd (1L<<9) /* gif lzw uncompress command */ #define ImageFrameSelect (1L<<10)/* frame selection */ #define ImageScreenGamma (1L<<11)/* gamma correction. JPEG and PNG only */ /****************************************************************************** * Commonly used structures ******************************************************************************/ /***** * Representation of parsed HTML elements *****/ typedef struct _XmHTMLObject{ htmlEnum id; /* internal ID for this element */ String element; /* element text */ String attributes; /* element attributes (if any) */ Boolean is_end; /* true if this is a closing element */ Boolean terminated; /* true if element has closing counterpart */ Cardinal line; /* line number in input for this element */ struct _XmHTMLObject *next; struct _XmHTMLObject *prev; }XmHTMLObject; /***** * Custom papersize definition *****/ typedef struct _XmHTMLPaperSize{ unsigned char unit_type; /* unit in which dimensions are specified */ unsigned char paper_type; /* type of paper: A4, US or custom */ Cardinal width; /* total paper width */ Cardinal height; /* total paper height */ Cardinal left_margin; /* left text margin */ Cardinal right_margin; /* right text margin */ Cardinal top_margin; /* top text margin */ Cardinal bottom_margin; /* bottom text margin */ }XmHTMLPaperSize; /***** * Definition of a HTMLTextPosition. * Should be considered an opaque object. *****/ typedef struct _XmHTMLTextPosition{ struct _XmHTMLObjectTable *start; /* selection start */ int idx; /* first word in selection start */ int nwords; /* no of words in selection start */ int fc; /* first char in selection start */ }XmHTMLTextPosition; /***** * The following structure is returned by the XmHTMLImageDefaultProc convenience * function. When a procedure for the XmNimageProc resource is installed, * it *must* return this structure. *****/ typedef struct _XmImageInfo { /* regular image fields */ String url; /* original location of image */ unsigned char *data; /* raw image data. ZPixmap format */ unsigned char *clip; /* raw clipmask data. XYBitmap format */ Dimension width; /* used image width, in pixels */ Dimension height; /* used image height, in pixels */ Dimension *reds; /* red image pixels */ Dimension *greens; /* green image pixels */ Dimension *blues; /* blue image pixels */ int bg; /* transparent pixel index/type */ unsigned int ncolors; /* Number of colors in the image */ unsigned int options; /* image option bits */ /* image classification fields and original data */ unsigned char type; /* image type, see the IMAGE_ enum above */ unsigned char depth; /* bits per pixel for this image */ unsigned char colorspace; /* colorspace for this image */ unsigned char transparency; /* transparency type for this image */ Dimension swidth; /* image width as read from image */ Dimension sheight; /* image height as read from image */ unsigned int scolors; /* Original number of colors in the image */ /* Special fields for images with an alpha channel */ unsigned char *alpha; /* alpha channel data */ float fg_gamma; /* image gamma */ /* Additional animation data */ int x; /* logical screen x-position for this frame */ int y; /* logical screen y-position for this frame */ int loop_count; /* animation loop count */ unsigned char dispose; /* image disposal method */ int timeout; /* frame refreshment in milliseconds */ int nframes; /* no of animation frames remaining */ struct _XmImageInfo *frame; /* ptr to next animation frame */ XtPointer user_data; /* any data to be stored with this image */ }XmImageInfo, *XmImageInfoStruct; /* XmHTML method to load images */ typedef XmImageInfo* (*XmImageProc)(Widget, String, Dimension, Dimension, XtPointer); /**** * The next two structures constitute the XmImage definition which are used by * the XmImageCreate and XmImageDestroy routines. Please note that the *only* * safe way to destroy an XmImage is to use the XmImageDestroy function. * XmHTML does not use the XmImage structure, it is provided for your * convenience. ****/ /**** * Animation frame data. ****/ typedef struct{ int x; /* x position in logical screen */ int y; /* y position in logical screen */ int w; /* width of this particular frame */ int h; /* height of this particular frame */ int timeout; /* timeout for the next frame */ unsigned char dispose; /* previous frame disposal method */ Pixmap pixmap; /* actual image */ Pixmap clip; /* image clipmask */ Pixmap prev_state; /* previous screen state */ }XmImageFrame; /***** * Actual image definition. * If you want access to the xcc member, include the XCC.h header file. *****/ typedef struct{ String file; /* originating file */ unsigned char type; /* image type, see the IMAGE_ enum below */ Pixmap pixmap; /* actual image */ Pixmap clip; /* for transparant pixmaps */ unsigned int options; /* image option bits */ int width; /* current image width, in pixels */ int height; /* current image height, in pixels */ int ncolors; /* no of colors in this image */ int scolors; /* specified no of colors */ int swidth; /* image width as read from image */ int sheight; /* image height as read from image */ int depth; /* depth of this image */ int npixels; /* no of really allocated pixels */ GC gc; /* graphics context for rendering */ /* animation data */ XmImageFrame *frames; /* array of animation frames */ int nframes; /* no of frames following */ int current_frame; /* current frame count */ int current_loop; /* current loop count */ int loop_count; /* maximum loop count */ XtIntervalId proc_id; /* timer id for animations */ Widget w; /* image owner */ XtAppContext context; /* Application context for animations */ /* private data */ struct _XColorContext *xcc; /* a lot of visual info */ struct _ToolkitAbstraction *tka; }XmImage; /***** * Link member information. *****/ typedef struct { String url; /* value of URL tag */ String rel; /* value of REL tag */ String rev; /* value of REV tag */ String title; /* value of TITLE tag */ }XmHTMLLinkDataRec, *XmHTMLLinkDataPtr; /***** * Meta member information. *****/ typedef struct { String http_equiv; /* value of HTTP-EQUIV tag */ String name; /* value of NAME tag */ String content; /* value of CONTENT tag */ }XmHTMLMetaDataRec, *XmHTMLMetaDataPtr; /***** * XmHTMLHeadAttributes definition *****/ typedef struct{ String doctype; /* doctype data */ String title; /* document title */ Boolean is_index; /* true when the element exists */ String base; /* value of the element */ int num_meta; /* number of META info to process */ XmHTMLMetaDataPtr meta; /* array of META info to process */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ String style_type; /* value of the style type element tag */ String style; /* contents */ String script_lang; /* value of the language element tag */ String script; /* contents */ }XmHTMLHeadAttributes; /***** * Document Information. * images and anchors contain all src and href's in a single string. Entries * are separated by the null char and terminated by two null chars. *****/ typedef struct{ String bg_image; /* background image (if any) */ String images; /* list of all images (if any) */ String anchors; /* list of all anchors (excluding named) */ }XmHTMLDocumentInfo; /***** * XmHTMLFontCacheInfo definition. This structure is returned by the * XmHTMLGetFontCacheInfo convenience routine and contains information about * the font cache bound to the display of a given widget. * The fonts and mapping arrays are in sync: when a name in the fonts array * has a non-NULL entry at the corresponding position in the mapping array, * the value of the mapping entry is the real font being used. *****/ typedef struct{ int nentries; /* total no of cached fonts */ int nmaps; /* of which this many are mapped fonts */ int nlookups; /* no of search actions */ int nrequests; /* no of requests made */ int hits; /* no of hits */ int misses; /* no of misses */ String *fonts; /* array of font names, size nentries */ String *mapping; /* array of font mappings, size nentries */ int nwidgets; /* no of widgets using this cache */ WidgetList widgets; /* array of widgets */ }XmHTMLFontCacheInfo; /***** * forward declaration of XmHTMLAnchorCallback structure *****/ typedef struct _XmHTMLAnchorCallbackStruct *XmHTMLAnchorPtr; /***** * XmHTMLXYToInfo return value * This structure and any of it members may *never* be freed by the caller. *****/ typedef struct { Cardinal line; /* line number at selected position */ Boolean is_map; /* true when clicked image is an imagemap */ int x,y; /* position relative to image corner */ XmImageInfo *image; /* image data */ XmHTMLAnchorPtr anchor; /* possible anchor data */ }XmHTMLInfoStructure, *XmHTMLInfoPtr; /***** * XmHTML progressive object loading * (PLC stands for Progressive Loader Context) *****/ typedef struct _XmHTMLPLCStream{ Cardinal total_in; /* no of bytes received so far */ Cardinal min_out; /* minimum number of bytes requested */ Cardinal max_out; /* maximum number of bytes requested */ XtPointer user_data; /* any data registered on this PLC */ unsigned char pad[24]; /* reserved for future use */ }XmHTMLPLCStream; /***** * External GIF decoder stream object. This is the only argument to any * procedure installed on the XmNdecodeGIFProc resource. * * The first block is kept up to date by XmHTML and is read-only. When state * is GIF_STREAM_INIT, the decoder should initialize it's private data and store * it in the external_state field so that it can be used for successive calls * to the decoder. When state is GIF_STREAM_FINAL, the decoder should wrapup * and flush all pending data. It can also choose to destruct it's internal * data structures here (another call with state set to GIF_STREAM_END will be * made when the internal loader is destroying it's internal objects as * well). * * All following fields are the ``public'' fields and must be updated by the * external decoder. The msg field can be set to an error message if the * external decoder fails for some reason. XmHTML will then display this * error message and abort this image. *****/ typedef struct _XmHTMLGIFStream{ /* read-only fields */ int state; /* decoder state */ int codesize; /* initial LZW codesize */ Boolean is_progressive; /* when used by a progressive loader */ unsigned char *next_in; /* next input byte */ Cardinal avail_in; /* number of bytes available at next_in */ Cardinal total_in; /* total nb of input bytes read so far */ /* fields to be updated by caller */ unsigned char *next_out; /* next output byte should be put there */ Cardinal avail_out; /* remaining free space at next_out */ Cardinal total_out; /* total nb of bytes output so far */ String msg; /* last error message, or NULL */ XtPointer external_state; /* room for decoder-specific data */ }XmHTMLGIFStream; /* and the proto for the XmNdecodeGIFProc resource */ typedef int (*XmImageGifProc)(XmHTMLGIFStream*); /***** * Progressive Loading function prototypes. * XmHTMLGetDataProc: proto for function installed on the * XmNprogressiveReadProc resource; * XmHTMLEndDataProc: proto for function installed on the * XmNprogressiveEndProc resource; *****/ typedef int (*XmHTMLGetDataProc)(XmHTMLPLCStream*, XtPointer); typedef void (*XmHTMLEndDataProc)(XmHTMLPLCStream*, XtPointer, int, Boolean); /***** * possible values for the third argument on the EndDataProc *****/ enum{ /* XmHTML_NONE = 0 */ /* PLCObject referenced by all objects */ XmPLC_IMAGE, /* PLCObject for an image */ XmPLC_DOCUMENT, /* PLCObject for a document */ XmPLC_FINISHED /* indicates all plc's have been processed */ }; /***** * XmImage configuration *****/ typedef struct{ unsigned long flags; /* XmImage configuration flags, see above */ int ncolors; /* desired number of colors */ int which_frames; /* animation frames selection flag */ int bg_color; /* background pixel on transparent images */ String z_cmd; /* gif uncompress command */ XmImageGifProc gif_proc; /* external gif decoder */ float gamma; /* gamma correction. JPEG and PNG only */ struct _ToolkitAbstraction *tka; /* private data */ }XmImageConfig; /***** * HTML4.0 Event structure *****/ typedef struct _XmHTMLEvent{ int type; /* HTML4.0 event type, see above */ String script; /* contents of event */ }XmHTMLEvent; /***** * XmNobjectCallback tag_attributes substructure. *****/ typedef struct{ unsigned long flags; /* defines which fields have a value */ String attributes; /* unfiltered attributes */ String classid; /* contents of the classid attribute */ String codebase; /* contents of the codebase attribute */ String data; /* location of object data */ String src; /* location of object data */ String type; /* type of object data */ String codetype; /* type of codebase */ String standby; /* message to display while loading */ String align; /* global alignment */ String halign; /* horizontal alignment */ String valign; /* vertical alignment */ int height; /* following five fields are always integers*/ int width; int border; /* border = 0: no border */ int hspace; int vspace; String usemap; /* location or name of imagemap */ String background; /* location of background image */ String bgcolor; /* name of background color */ String href; /* hyperlink reference */ String name; /* named hyperlink */ XmHTMLEvent *events; /* defined events */ int nevents; /* no of events */ }XmHTMLTagAttributes; /***** * The XmHTMLElementId and XmHTMLObjectId are opaque structures. They * are fully defined in XmHTMLP.h *****/ typedef struct _XmHTMLParserTag *XmHTMLElementId; typedef struct _XmHTMLExtObj *XmHTMLObjectId; /****************************************************************************** * Callback structures * Unless explicitly mentioned, *none* of these structures (or any of its * members) may be freed. ******************************************************************************/ /***** * XmNactivateCallback and XmNanchorTrackCallback callback structure. *****/ typedef struct _XmHTMLAnchorCallbackStruct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ URLType url_type; /* type of url referenced */ Cardinal line; /* line number of the selected anchor */ String href; /* pointer to the anchor value */ String target; /* pointer to target value */ String rel; /* pointer to rel value */ String rev; /* pointer to rev value */ String title; /* pointer to title value */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* local anchor vetoing flag */ Boolean visited; /* local anchor visited flag */ Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLAnchorCallbackStruct; typedef Boolean (*XmHTMLAnchorProc)(Widget, String, XtPointer); /***** * XmNeventCallback callback structure. * * Note on the doc_modified field: this field *MUST* be set to True if the * processing of this event leads to a modification of the currently * displayed document (XmHTMLTextSetString for example) or even destruction * of the widget. It informs XmHTML of the fact that it can no longer rely on * the consistency of it's internal data structures. * * Note on processing of the XmCR_HTML_LOAD and XmCR_HTML_UNLOAD events: * processing of these events may *NEVER* cause a modification of the currently * displayed document. It is a FATAL ERROR if it does change: XmHTML can no * longer guarantee the consistency of it's internal data. *****/ typedef struct{ int reason; /* the reason the event was called */ XEvent *event; /* event triggering this action */ int type; /* HTML4.0 event type, see above */ XtPointer data; /* HTML4.0 event callback data */ Boolean doc_modified; /* Set to True when document is modified*/ }XmHTMLEventCallbackStruct, *XmHTMLEventCallbackPtr; /***** * XmNdocumentCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* always NULL for XmNdocumentCallback */ Boolean html32; /* True if document was HTML 3.2 conforming */ Boolean verified; /* True if document has been verified */ Boolean balanced; /* True if parser tree is balanced */ Boolean terminated; /* True if parser terminated prematurely */ int pass_level; /* current parser level count. Starts at 1 */ Boolean redo; /* perform another pass? */ }XmHTMLDocumentCallbackStruct, *XmHTMLDocumentPtr; /***** * XmNformCallback callback structure. *****/ /***** * Form Component data *****/ typedef struct { componentType type; /* Form component type */ String name; /* component name */ String value; /* component value */ }XmHTMLFormDataRec, *XmHTMLFormDataPtr; /***** * Actual XmNformCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String action; /* URL or cgi-bin destination */ String enctype; /* form encoding */ int method; /* Form Method, GET, POST or PIPE */ int ncomponents; /* no of components in this form */ XmHTMLFormDataPtr components; Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLFormCallbackStruct, *XmHTMLFormPtr; /***** * XmNframeCallback callback structure. * This callback is activated when one of the following events occurs: * 1. XmHTML wants to create a frame, reason = XmCR_HTML_FRAMECREATE * can be veto'd by setting doit to False and supplying a HTML widget * id yourself; * 2. XmHTML wants to destroy a frame, reason = XmCR_HTML_FRAMEDESTROY * can be veto'd by setting doit to False (widget reuse). * 3. XmHTML has finished creating a frame, reason = XmCR_HTML_FRAME. * This is the time to attach callbacks and set additional resources on the * newly created XmHTMLWidget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String src; /* requested document */ String name; /* frame name */ Widget html; /* XmHTML widget id */ Boolean doit; /* destroy/create vetoing flag */ }XmHTMLFrameCallbackStruct, *XmHTMLFramePtr; /***** * XmNimagemapCallback callback structure. * callback reasons can be one of the following: * XmCR_HTML_IMAGEMAP_ACTIVATE * user clicked on an image. Valid fields are x, y and image_name. x and y * are relative to the upper-left corner of the image. Only invoked when * an image has it's ismap attribute set and no client-side imagemap is * present for this image. * XmCR_HTML_IMAGEMAP * an image requires an external imagemap. The only valid field is map_name * which contains the location of the imagemap to fetch. If the contents * of this imagemap is set in the map_contents field, it will be loaded * by the widget. Alternatively, one could also use the XmHTMLAddImagemap * convenience routine to set an imagemap into the widget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int x,y; /* position relative to the upper-left image corner */ String image_name; /* name of referenced image, value of src attribute */ String map_name; /* name of imagemap to fetch/referenced */ String map_contents;/* contents of fetched imagemap */ XmImageInfo *image; /* image data */ }XmHTMLImagemapCallbackStruct, *XmHTMLImagemapPtr; /***** * XmNlinkCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ }XmHTMLLinkCallbackStruct, *XmHTMLLinkPtr; /***** * XmNpageCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ Cardinal curr_page; /* current page */ Cardinal total_pages; /* no of pages in document */ }XmHTMLPageCallbackStruct, *XmHTMLPagePtr; /***** * XmNobjectCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int object_id; /* id of object, set by XmHTML */ int tag_id; /* HTML tag identifying an embedded object */ XtPointer tag_user_data;/* any data associated with this tag */ XmHTMLTagAttributes *attributes; /* parsed attributes, immutable */ Widget parent; /* Widget id of parent. */ Widget object; Window window; Boolean scrollable; /* If True, object is part of document * If False, object stays on top of document. */ Boolean wrap; /* Only used when scrollable == False. * If False, document scrolls underneath * the object. * If True, document scrolls around object. */ Boolean reparent; /* If True, XmHTML will reparent the window */ XtPointer user_data; /* additional data registered for this object. * Unused by XmHTML. */ /* Next two fields are only meaningfull when scrollable == False */ int x; /* suggested upper-left position */ int y; /* suggested upper-left position */ Dimension width; /* suggested object width */ Dimension height; /* suggested object height */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* destruct veto flag */ }XmHTMLObjectCallbackStruct, *XmHTMLObjectPtr; /* Don't add anything after this endif! */ #endif /* _HTML_h_ */ XmHTML-1.1.7/include/XmHTML/HTML.h.new100644 23564 23564 150706 6634724240 15365 0ustar newtnewt/***** * HTML.h : XmHTML Widget public header file. * Resource defines, enumerations and structures. * * This file Version $Revision: 1.8 $ * * Creation date: Tue Apr 15 23:39:26 GMT+0100 1997 * Last modification: $Date: 1998/04/27 06:54:30 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/HTML.h,v $ *****/ /***** * ChangeLog * $Log: HTML.h,v $ * Revision 1.8 1998/04/27 06:54:30 newt * Changed XmImageProc proto * * Revision 1.7 1998/04/04 06:27:46 newt * XmHTML Beta 1.1.3 * * Revision 1.6 1997/10/23 00:24:27 newt * XmHTML Beta 1.1.0 release * * Revision 1.5 1997/08/31 17:30:39 newt * Removed HT_TEXTFLOW * * Revision 1.4 1997/08/30 00:22:46 newt * Alpha channel resources: XmNalphaChannelProcessing and * XmNimageRGBConversion. Updated comments and reorganized a bunch of things. * * Revision 1.3 1997/08/01 12:52:11 newt * Progressive image loading changes * * Revision 1.2 1997/05/28 01:29:28 newt * XmImage changes: added the XmImageConfig structure and configuration flags. * Added support for the XmNdecodeGIFProc resource. * * Revision 1.1 1997/04/29 14:19:18 newt * Initial Revision * *****/ #ifndef _HTML_h_ #define _HTML_h_ /* include our new resources */ #include /****************************************************************************** * Enumerations and other constants ******************************************************************************/ /***** * HTML Elements internal id's * This list is alphabetically sorted to speed up the searching process. * DO NOT MODIFY *****/ typedef enum{ HT_DOCTYPE, HT_A, HT_ADDRESS, HT_APPLET, HT_AREA, HT_B, HT_BASE, HT_BASEFONT, HT_BIG, HT_BLOCKQUOTE, HT_BODY, HT_BR, HT_CAPTION, HT_CENTER, HT_CITE, HT_CODE, HT_DD, HT_DFN, HT_DIR, HT_DIV, HT_DL, HT_DT, HT_EM, HT_FONT, HT_FORM, HT_FRAME, HT_FRAMESET, HT_H1, HT_H2, HT_H3, HT_H4, HT_H5, HT_H6, HT_HEAD, HT_HR, HT_HTML, HT_I, HT_IMG, HT_INPUT, HT_ISINDEX, HT_KBD, HT_LI, HT_LINK, HT_MAP, HT_MENU, HT_META, HT_NOFRAMES, HT_OL, HT_OPTION, HT_P, HT_PAGE, HT_PARAM, HT_PRE, HT_SAMP, HT_SCRIPT, HT_SELECT, HT_SMALL, HT_STRIKE, HT_STRONG, HT_STYLE, HT_SUB, HT_SUP, HT_TAB, HT_TABLE, HT_TD, HT_TEXTAREA, HT_TH, HT_TITLE, HT_TR, HT_TT, HT_U, HT_UL, HT_VAR, HT_ZTEXT }htmlEnum; /***** * Corresponding HTML element name table. Indexing with the above enumeration * will give the corresponding element name. *****/ extern String *html_tokens; /***** * XmHTML defines the following callback reasons. This might produce strange * results once Motif decides to uses enum values above 16383. * Send us a mail at ripley@xs4all.nl if you get problems that are due to * these enumeration values. *****/ enum{ XmCR_HTML_ANCHORTRACK = 16384, /* XmNanchorTrackCallback */ XmCR_HTML_DOCUMENT, /* XmNdocumentCallback */ XmCR_HTML_FORM, /* XmNformCallback */ XmCR_HTML_FRAME, /* XmNframeCallback */ XmCR_HTML_FRAMECREATE, /* XmNframeCallback */ XmCR_HTML_FRAMEDESTROY, /* XmNframeCallback */ XmCR_HTML_IMAGEMAPACTIVATE, /* XmNimagemapCallback */ XmCR_HTML_IMAGEMAP, /* XmNimagemapCallback */ XmCR_HTML_LINK, /* XmNlinkCallback */ XmCR_HTML_MODIFYING_TEXT_VALUE, /* XmNmodifyVerifyCallback */ XmCR_HTML_MOTIONTRACK, /* XmNmotionTrackCallback */ XmCR_HTML_PARSER, /* XmNparserCallback */ XmCR_HTML_EVENT, /* XmNeventCallback */ XmCR_HTML_EVENTDESTROY, /* XmNeventCallback */ XmCR_HTML_OBJECT, /* XmNobjectCallback */ XmCR_HTML_OBJECTCREATE, /* XmNobjectCallback */ XmCR_HTML_OBJECTDESTROY, /* XmNobjectCallback */ XmCR_HTML_LANGUAGE /* XmNlanguageCallback */ }; /***** * XmNeventCallback sub event types *****/ enum{ /* Document/Frame specific events */ XmCR_HTML_LOAD = 0, /* onLoad */ XmCR_HTML_UNLOAD, /* onUnLoad */ /* HTML Form specific events */ XmCR_HTML_SUBMIT, /* onSubmit */ XmCR_HTML_RESET, /* onReset */ XmCR_HTML_FOCUS, /* onFocus */ XmCR_HTML_BLUR, /* onBlur */ XmCR_HTML_SELECT, /* onSelect */ XmCR_HTML_CHANGE, /* onChange */ /* object events */ XmCR_HTML_CLICK, /* onClick */ XmCR_HTML_DOUBLE_CLICK, /* onDblClick */ XmCR_HTML_MOUSEDOWN, /* onMouseDown */ XmCR_HTML_MOUSEUP, /* onMouseUp */ XmCR_HTML_MOUSEOVER, /* onMouseOver */ XmCR_HTML_MOUSEMOVE, /* onMouseMove */ XmCR_HTML_MOUSEOUT, /* onMouseOut */ XmCR_HTML_KEYPRESS, /* onKeyPress */ XmCR_HTML_KEYDOWN, /* onKeyDown */ XmCR_HTML_KEYUP, /* onKeyUp */ XmCR_HTML_USEREVENT /* must always be last */ }; /***** * URL types XmHTML knows of. * The hostnames, files and port numbers are only shown for demonstration * purposes, XmHTML doesn't care whether they are present or not. * The first 16 elements are alphabetically sorted to speed up URL * translations. *****/ typedef enum{ ANCHOR_ABOUT = 0, /* href="about:..." */ ANCHOR_EXEC, /* href="exec:foo_bar" */ ANCHOR_FILE_REMOTE, /* href="file://foo.bar/file.html" */ ANCHOR_FTP, /* href="ftp://foo.bar/file" */ ANCHOR_GOPHER, /* href="gopher://foo.bar:70" */ ANCHOR_HELP, /* href="help:..." */ ANCHOR_HTTP, /* href="http://foo.bar/file.html" */ ANCHOR_SECURE_HTTP, /* href="https://foo.bar/file.html" */ ANCHOR_INFO, /* href="info:.." */ ANCHOR_MAILTO, /* href="mailto:foo@bar" */ ANCHOR_MAN, /* href="man:..." */ ANCHOR_NEWS, /* href="news://foo.bar" */ ANCHOR_PIPE, /* href="pipe:foo_bar" */ ANCHOR_TELNET, /* href="telnet://foo.bar:23" */ ANCHOR_WAIS, /* href="wais://foo.bar" */ ANCHOR_XEXEC, /* href="xexec:foo_bar" */ ANCHOR_UNKNOWN, /* unknown href */ ANCHOR_FILE_LOCAL, /* href="file.html" */ ANCHOR_FORM_IMAGE, /* , only used internally */ ANCHOR_JUMP, /* href="#..." */ ANCHOR_NAMED /* name="...." */ }URLType; /***** * Various methods of loading documents. * LOAD_NORMAL * The entire document is provided. This is the default method of loading * documents. * LOAD_PROGRESSIVE * Progressive document load. A complete source is provided each time: * caller takes care of appending new text to th current buffer before * flushing it to XmHTML. * LOAD_INCREMENTAL * Progressive document load. A new chunk is provided each time: XmHTML * takes care of appending new text to the already existing text. * LOAD_SUSPEND * Suspend progressive or incremental loading. XmHTML display the document * upto the last valid combination of tokens. * LOAD_ABORT * Abort progressive or icremental loading. XmHTML will flush it's * buffers and display all the data (including any constructs it * requires to close the document). *****/ enum{ XmLOAD_NORMAL = 0, /* normal load, all data at once */ XmLOAD_PROGRESSIVE, /* progressive load, use new text */ XmLOAD_INCREMENTAL, /* progressive load, append new text */ XmLOAD_SUSPEND, /* suspend load */ XmLOAD_ABORT /* abort load */ }; /***** * Procedure to be called whenever a script is encountered * Arguments: * Widget: XmHTMLWidget id * String: script source text * XtPointer: XmNclientData value * Return value: * data to be stored whenever a document event should be processed. * This data is unused internally and is provided as the user_data * argument in the XmHTMLEvent structure. For example, the return value * could be a pointer into some internal procedural database, a ptr to a * compiled script procedure or the script source text if you want to * process it at some later time (when the event occurs). * * When NULL is returned the event in question is disabled. *****/ typedef XtPointer (*XmHTMLEventProc)(Widget, String, XtPointer); /***** * HTML Form component types. Alphabetically sorted to speed up searching. *****/ typedef enum{ FORM_CHECK = 0, /* checkbox */ FORM_FILE, /* file selection box */ FORM_HIDDEN, /* hidden input */ FORM_IMAGE, /* drawnbutton */ FORM_OPTION, /* select child */ FORM_PASSWD, /* password textfield */ FORM_RADIO, /* radiobox */ FORM_RESET, /* reset button */ FORM_SELECT, /* select parent */ FORM_SUBMIT, /* submit button */ FORM_TEXT, /* singleline textfield */ FORM_TEXTAREA, /* multiline edit field */ FORM_UNKNOWN /* unknown type */ }componentType; /***** * Supported HTML Form method types *****/ enum{ XmHTML_FORM_GET = 0, /* method = get */ XmHTML_FORM_POST, /* method = post */ XmHTML_FORM_PIPE /* method = pipe */ }; /***** * possible error codes for XmNparserCallback *****/ typedef enum{ HTML_UNKNOWN_ELEMENT = 1, /* unknown HTML element */ HTML_BAD, /* very badly placed element */ HTML_OPEN_BLOCK, /* block still open while new block started */ HTML_CLOSE_BLOCK, /* block closed but was never opened */ HTML_OPEN_ELEMENT, /* unbalanced terminator */ HTML_NESTED, /* improperly nested element */ HTML_VIOLATION, /* bad content for current block/element */ HTML_NOTIFY, /* notification of text insertion/removal */ HTML_INTERNAL /* internal parser error */ }parserError; /***** * And corresponding values for XmNenableBadHTMLWarnings. * These are or'd together. * XmNONE disables warnings and XmHTML_ALL enables all warnings. * See parserError for their meaning. *****/ enum{ XmHTML_NONE = 0, /* no warnings */ XmHTML_UNKNOWN_ELEMENT = 1, XmHTML_BAD = 2, XmHTML_OPEN_BLOCK = 4, XmHTML_CLOSE_BLOCK = 8, XmHTML_OPEN_ELEMENT = 16, XmHTML_NESTED = 32, XmHTML_VIOLATION = 64, XmHTML_ALL = 127 /* all warnings */ }; /***** * possible action codes for the action field in the XmHTMLParserCallbackStruct *****/ enum{ HTML_REMOVE = 1, /* remove offending element */ HTML_INSERT, /* insert missing element */ HTML_SWITCH, /* switch offending and expected element */ HTML_KEEP, /* keep offending element */ HTML_IGNORE, /* ignore, proceed as if nothing happened */ HTML_ALIAS, /* alias an unknown element to known one */ HTML_TERMINATE /* terminate parser */ }; /***** * Possible return codes for XmHTMLImageGetType(). * These are all reserved values and represent image types * XmHTML is able to recognize. * User-defined images start from IMAGE_USER. *****/ enum{ IMAGE_ERROR = 0, /* error on image loading */ IMAGE_UNKNOWN, /* unknown image */ IMAGE_XPM, /* X11 pixmap */ IMAGE_XBM, /* X11 bitmap */ IMAGE_GIF, /* CompuServe(C) Gif87a or Gif89a */ IMAGE_GIFANIM, /* animated gif */ IMAGE_GIFANIMLOOP, /* animated gif with loop extension */ IMAGE_GZF, /* compatible Gif87a or Gif89a */ IMAGE_GZFANIM, /* compatible animated gif */ IMAGE_GZFANIMLOOP, /* compatible animated gif */ IMAGE_JPEG, /* JPEG image */ IMAGE_PNG, /* PNG image */ IMAGE_FLG, /* Fast Loadable Graphic */ IMAGE_USER = 64 /* user defined image */ }; /***** * Possible return values for a function installed on the * XmNprogressiveReadProc resource. *****/ #define STREAM_OK 1 /* internally used value */ #define STREAM_END 0 /* data stream ended (no more data) */ #define STREAM_SUSPEND -1 /* data stream suspended (not enough data) */ #define STREAM_ABORT -2 /* data stream aborted */ #define STREAM_RESIZE -3 /* resize input buffer */ /***** * Possible return values for the XmNdecodeGIFProc resource and * values for the XmHTMLGIFStream state. *****/ #define GIF_STREAM_OK 2 #define GIF_STREAM_END 1 #define GIF_STREAM_ERR 0 #define GIF_STREAM_INIT -1 #define GIF_STREAM_FINAL -2 /***** * Possible return values from a number of image related routines. * The actual meaning depends on the routine used. *****/ typedef enum{ XmIMAGE_ERROR = 0, /* unknown error occured */ XmIMAGE_BAD, /* bad function call: missing arg or so */ XmIMAGE_UNKNOWN, /* provided XmImage/XmImageInfo unknown/unbound */ XmIMAGE_ALMOST, /* action completed, further response necessary */ XmIMAGE_OK /* action completed. */ }XmImageStatus; /***** * Possible values for transparency (value for the "bg" field in both * XmImage and XmImageInfo structures). Possible values are: * * XmIMAGE_NONE * indicates the image is not transparent * XmIMAGE_TRANSPARENCY_BG * indicates the image achieves transparency by substituting the current * background setting (can be a single color or background image. Internally, * such transparency is achieved by using a clipmask). * XmIMAGE_TRANSPARENCY_ALPHA * indicates the image achieves transparency by using an alpha channel. * This transparency is currently only used by PNG images with an alpha * channel or a tRNS chunk (which is expanded to an alpha channel internally). *****/ enum{ XmIMAGE_NONE = 0, XmIMAGE_TRANSPARENCY_BG, XmIMAGE_TRANSPARENCY_ALPHA }; /***** * Possible values for the colorspace value. * * XmIMAGE_COLORSPACE_GRAYSCALE * image contains only shades of gray. The colorcube is reduced to a 1D * representation. All components in a shade have the same value. The * pixel values are equal to the value of a single color component. * XmIMAGE_COLORSPACE_INDEXED * image uses a fixed palette. Colorcube is mapped to a 1D lookup-table. * XmIMAGE_COLORSPACE_RGB * image uses a full 3D colorcube. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_COLORSPACE_GRAYSCALE = 1, XmIMAGE_COLORSPACE_INDEXED, XmIMAGE_COLORSPACE_RGB }; /***** * XmImageInfo structure options field bits. * The ``Set by default'' indicates a bit set when the XmHTMLImageDefaultProc * is used to read an image. The ``Read Only'' indicates a bit you should * consider as read-only. * XmIMAGE_DELAYED * Indicates the image is delayed, e.i. it will be provided at a later stage; * XmIMAGE_DEFERRED_FREE * Indicates XmHTML may free this structure when a new document is loaded. * XmIMAGE_IMMEDIATE_FREE * Indicates XmHTML may free this structure when XmHTML no longer needs it; * XmIMAGE_RGB_SINGLE * Indicates that the reds, greens and blues fields are allocated in a single * memory area instead of three seperate memory arrays. * XmIMAGE_ALLOW_SCALE * Indicates that scaling an image is allowed. * XmIMAGE_FRAME_IGNORE * Use with animations: set this bit when a frame falls outside the logical * screen area. No pixmap is created but the timeout for the frame is kept. * XmIMAGE_CLIPMASK * This bit is set when the returned XmImageInfo structure contains clipmask * data. XmHTML uses this info to create a clipping bitmap. Changing this * bit from set to unset will lead to a memory leak while changing it from * unset to set *without* providing a clipmask yourself *will* cause an error * to happen. You can set this bit when you are providing your own clipmask * (to provide non-rectangular images for example), PROVIDED you fill the * ``clip'' field with valid bitmap data (a stream of bytes in XYBitmap format * and the same size of the image). * XmIMAGE_SHARED_DATA * This bit is set when images share data. XmHTML sets this bit when the image * in question is an internal image, e.i., one for which the image data may * never be freed. Be carefull setting this bit yourself, since it prevents * XmHTML from freeing the image data present in the XmImageInfo structure. * It can easily lead to memory leaks when an image is *not* an internal * image. * XmIMAGE_PROGRESSIVE * Setting this bit will enable XmHTML progressive image loading. A function * *must* have been installed on the XmNprogressiveReadProc resource *prior* * to setting this bit. Installing a function on the XmNprogressiveEndProc * is optional. When this bit is set all other bits will be ignored. * XmIMAGE_DELAYED_CREATION * This bit is read-only. It is used internally by XmHTML for images with * an alpha channel. Alpha channel processing merges the current background * with the original RGB data from the image and uses the result to compose * the actual on-screen image (the merged data is stored in the ``data'' * field of the XmImageInfo structure). XmHTML needs to store the original * data somewhere, and when this bit is set it is stored in the ``rgb'' field * of the XmImageInfo structure. * When this bit is set, the returned XmImageInfo may *NOT BE FREED* as long * as the current document is alive. You can discard it as soon as a new * document is loaded. *****/ #define XmIMAGE_DELAYED (1<<1) #define XmIMAGE_DEFERRED_FREE (1<<2) /* set by default */ #define XmIMAGE_IMMEDIATE_FREE (1<<3) #define XmIMAGE_RGB_SINGLE (1<<4) /* set by default */ #define XmIMAGE_ALLOW_SCALE (1<<5) /* set by default */ #define XmIMAGE_FRAME_IGNORE (1<<6) #define XmIMAGE_CLIPMASK (1<<7) /* Read Only */ #define XmIMAGE_SHARED_DATA (1<<8) /* Read Only */ #define XmIMAGE_PROGRESSIVE (1<<9) #define XmIMAGE_DELAYED_CREATION (1<<10) /* Read Only */ /***** * XmImageInfo animation disposal values * A disposal method specifies what should be done before the current frame is * rendered. Possible values are: * XmIMAGE_DISPOSE_NONE * do nothing, overlays the previous frame with the current frame. * XmIMAGE_DISPOSE_BY_BACKGROUND * Restore to background color. The area used by the previous frame must * be restored to the background color/image * XmIMAGE_DISPOSE_BY_PREVIOUS * Restore to previous. The area used by the previous frame must be * restored to what was there prior to rendering the previous frame. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_DISPOSE_NONE = 1, /* default behaviour */ XmIMAGE_DISPOSE_BY_BACKGROUND, XmIMAGE_DISPOSE_BY_PREVIOUS }; /***** * Primary image cache actions * (unimplemented) *****/ #define IMAGE_STORE 0 /* store an image in the cache */ #define IMAGE_GET 1 /* retrieve an image from the cache */ #define IMAGE_DISCARD 2 /* discard an image from the cache */ /***** * XmNperfectColors/XmNalphaChannelProcessing resource values. * * Note: these values are represented by the XmCEnableMode resource class. *****/ enum{ /* XmAUTOMATIC */ XmALWAYS = 1, XmNEVER }; /***** * Possible XmNimageMapToPalette/XmNimageRGBConversion resource values: * * XmQUICK * RGBConversion: * first checks if the 24bit image contains less than XmNmaxImageColors. * If not, XmHTML will dither to a fixed palette. This is fast but has * the disadvantage that the background color in an alpha channelled * image will not be matched exactly. * MapToPalette: * Use closest distance algorithm to map colors to the palette. No * error correction is performed. Reasonably fast, but quality * heavily depends on the distribution of the colors in the image. * XmBEST * RGBConversion (default): * first checks if the 24bit image contains less than XmNmaxImageColors. * If it is, the actual image colors are used. If not, a histogram of the * image is computed, the most used colors are selected and the resulting * image is dithered to this palette. * Offers best 24 to 8bit conversion and is probably faster than XmSLOW * as only images with more than XmNmaxImageColors will be dithered. * MapToPalette: * Ordered dithering using predefined error matrices. Reasonably fast and * quite good results; * XmFAST * RGBConversion: * Skips the check and dithers to a fixed palette right away. This is the * fastest way to do 24 to 8bit conversion but has the disadvantage that * every 24bit image is dithered to a fixed palette, regardless of the * actual no of colors in the image. * MapToPalette: * Simple ordered dithering. Fastest but probably the poorest results. * XmSLOW * RGBConversion: * Skips the check and does histogram stuff right away. * MapToPalette: * closest distance algorithm to map image colors to the palette and use * dynamic error correction. Slowest but best results; * XmDISABLED * RGBConversion: * ignored; * MapToPalette (default): * Disables palette mapping; * * Note: these values are represented by the XmCConversionMode resource class. *****/ enum{ XmQUICK = 0, XmBEST, XmFAST, XmSLOW, XmDISABLED }; /***** * Embedded object flags. These flags tell XmHTML which attributes are * defined for an object. *****/ #define HT_TAG_CLASSID (1<<1) /* classid, defines an implementation */ #define HT_TAG_CODEBASE (1<<2) /* base url for applet */ #define HT_TAG_DATA (1<<3) /* object data */ #define HT_TAG_SRC (1<<4) /* object data */ #define HT_TAG_TYPE (1<<5) /* internet data content type */ #define HT_TAG_CODETYPE (1<<6) /* internet code content type */ #define HT_TAG_STANDBY (1<<7) /* standby message */ #define HT_TAG_ALIGN (1<<8) /* global alignment */ #define HT_TAG_HALIGN (1<<9) /* horizontal alignment */ #define HT_TAG_VALIGN (1<<10) /* vertical alignment */ #define HT_TAG_HEIGHT (1<<11) /* suggested height */ #define HT_TAG_WIDTH (1<<12) /* suggested width */ #define HT_TAG_BORDER (1<<13) /* suggested border width */ #define HT_TAG_HSPACE (1<<14) /* suggested horizontal gutting space */ #define HT_TAG_VSPACE (1<<15) /* suggested vertical gutting space */ #define HT_TAG_USEMAP (1<<16) /* imagemap reference */ #define HT_TAG_BACKGROUND (1<<17) /* background image specification */ #define HT_TAG_BGCOLOR (1<<18) /* background color specification */ #define HT_TAG_HREF (1<<19) /* hyperlink */ #define HT_TAG_NAME (1<<20) /* object name/named hyperlink */ #define HT_TAG_EVENTS (1<<21) /* HTML4.0 events */ /***** * Possible return values for the embedded object convenience functions *****/ typedef enum{ OBJECT_ALMOST = 0, /* action completed, further action required */ OBJECT_DESTROYED, /* object has been destroyed */ OBJECT_EMPTY, /* object is empty */ OBJECT_ERROR, /* unknown error */ OBJECT_FATAL, /* fatal object error has occured */ OBJECT_INVALID, /* invalid object */ OBJECT_INVALID_LOCATION,/* object has an invalid location */ OBJECT_INVALID_SIZE, /* object has an invalid size */ OBJECT_LOWERED, /* object is lowered */ OBJECT_MAPPED, /* object is mapped to screen */ OBJECT_OK, /* action completed succesfully */ OBJECT_ORPHANED, /* object has no parent */ OBJECT_PARENTED, /* object already has a parent */ OBJECT_RAISED, /* object is raised */ OBJECT_UNIMPLEMENTED, /* requested function unimplemented */ OBJECT_UNKNOWN, /* unknown object */ OBJECT_UNKNOWN_ELEMENT, /* invalid element id */ OBJECT_UNMAPPED, /* object has been unmapped */ OBJECT_UNUSED, /* object is not being used */ OBJECT_USED, /* object is currently being used */ OBJECT_VISIBLE /* object is visible */ }XmHTMLObjectStatus; /***** * Search directions: forward or backward search *****/ typedef enum{ XmHTML_FORWARD = 0, XmHTML_BACKWARD }XmHTMLDirection; /***** * XmHTMLTextFind return codes *****/ typedef enum{ XmREG_ERROR = 0, /* An error occured */ XmREG_NOMATCH, /* end of text and no match found */ XmREG_MATCH /* a match was found */ }XmHTMLRegexStatus; /***** * In addition to the POSIX regex error codes, XmHTMLTextFinderGetError * can return the following errors *****/ #define RE_EEMPTY -1 /* no search string given */ #define RE_ENOMEM -2 /* out of memory */ #define RE_EBADPARENT -3 /* parent is not of class xmHTMLWidgetClass */ #define RE_EWORDS -4 /* no words to be searched (empty document) */ #define RE_ERROR -5 /* unknown error */ /***** * Finder is a fully opaque type. *****/ typedef struct _XmHTMLTextFinder *XmHTMLTextFinder; /***** * Custom Papersize dimension unit type *****/ enum{ XmHTML_CHAR = 0, XmHTML_CENTIMETER, /* 1cm = 0.39in */ XmHTML_MILLIMETER, /* 1mm = 0.1cm */ XmHTML_INCH, /* 1in = 2.54cm */ XmHTML_PICA, /* 1pc = 12pt */ XmHTML_POINT /* 1in = 72.27pt, 1cm = 28.45pt */ }; /***** * XmHTMLTextGetFormatted paper size defines *****/ enum{ XmHTMLTEXT_PAPERSIZE_A4 = 0, XmHTMLTEXT_PAPERSIZE_LETTER, XmHTMLTEXT_PAPERSIZE_CUSTOM }; /***** * XmHTMLTextGetFormatted type definitions *****/ enum{ XmHTMLTEXT_PLAIN = 0, /* generate plain ASCII document */ XmHTMLTEXT_FORMATTED, /* generate formatted ASCII document */ XmHTMLTEXT_POSTSCRIPT /* generate formatted Postscript output */ }; /***** * XmHTMLTextGetFormatted Postscript option bits * (under construction) * The MIMIC_FONTS bit instructs XmHTML to use any of the supported postscript * fonts to approach the fonts used in the document. When set, all other font * bits are ignored. When not used, the PSFONT bits can be or'd together. * XmHTML will attempt to do the following mapping: * PSFONT_ROMAN/PSFONT_CENTURY -> default text font; * PSFONT_HELVETICA/PSFONT_LUCIDA -> fixed width font; * If only one of the PSFONT bits is set, the entire document will be rendered * in that font. *****/ #define XmHTMLTEXT_ANCHORFOOTNOTES (1L<<0) /* footnote anchors */ #define XmHTMLTEXT_ADDHEADER (1L<<1) /* put title */ #define XmHTMLTEXT_ADDFOOTER (1L<<2) /* put pagenumbers */ #define XmHTMLTEXT_PSFONT_ROMAN (1L<<3) #define XmHTMLTEXT_PSFONT_HELVETICA (1L<<4) #define XmHTMLTEXT_PSFONT_CENTURY (1L<<5) #define XmHTMLTEXT_PSFONT_LUCIDA (1L<<6) #define XmHTMLTEXT_MIMIC_FONTS (1L<<7) /***** * XmHTMLGetHeadAttributes mask bits *****/ #define HeadClear ((unsigned char)0) /* clear everything */ #define HeadDocType (1<<0) /* fill doctype member */ #define HeadTitle (1<<1) /* fill title member */ #define HeadIsIndex (1<<2) /* fill isIndex member */ #define HeadBase (1<<3) /* fill Base member */ #define HeadMeta (1<<4) /* fill meta members */ #define HeadLink (1<<5) /* fill link members */ #define HeadScript (1<<6) /* fill script members */ #define HeadStyle (1<<7) /* fill Style members */ #define HeadAll ((unsigned char)~0) /* fill all members */ /***** * XmImage frame selection flags. * any positive number will return the requested frame. If larger than * total framecount, last frame is returned. *****/ #define AllFrames -1 /* do all frames */ #define FirstFrame -2 /* only use first frame */ #define LastFrame -3 /* only do last frame */ /***** * XmImage configuration flags *****/ #define ImageFSDither (1L<<1) /* Floyd-Steinberg on quantized images */ #define ImageCreateGC (1L<<2) /* create gc for image */ #define ImageWorkSpace (1L<<3) /* create animation workspace */ #define ImageClipmask (1L<<4) /* create clipmask */ #define ImageBackground (1L<<5) /* substitute background pixel */ #define ImageQuantize (1L<<6) /* quantize image */ #define ImageMaxColors (1L<<7) /* sets maximum colors */ #define ImageGifDecodeProc (1L<<8) /* gif lzw decoder function */ #define ImageGifzCmd (1L<<9) /* gif lzw uncompress command */ #define ImageFrameSelect (1L<<10)/* frame selection */ #define ImageScreenGamma (1L<<11)/* gamma correction. JPEG and PNG only */ /****************************************************************************** * Commonly used structures ******************************************************************************/ /***** * Representation of parsed HTML elements *****/ typedef struct _XmHTMLObject{ htmlEnum id; /* internal ID for this element */ String element; /* element text */ String attributes; /* element attributes (if any) */ Boolean is_end; /* true if this is a closing element */ Boolean terminated; /* true if element has closing counterpart */ Cardinal line; /* line number in input for this element */ struct _XmHTMLObject *next; struct _XmHTMLObject *prev; }XmHTMLObject; /***** * Custom papersize definition *****/ typedef struct _XmHTMLPaperSize{ unsigned char unit_type; /* unit in which dimensions are specified */ unsigned char paper_type; /* type of paper: A4, US or custom */ Cardinal width; /* total paper width */ Cardinal height; /* total paper height */ Cardinal left_margin; /* left text margin */ Cardinal right_margin; /* right text margin */ Cardinal top_margin; /* top text margin */ Cardinal bottom_margin; /* bottom text margin */ }XmHTMLPaperSize; /***** * Definition of a HTMLTextPosition. * Should be considered an opaque object. *****/ typedef struct _XmHTMLTextPosition{ struct _XmHTMLObjectTable *start; /* selection start */ int idx; /* first word in selection start */ int nwords; /* no of words in selection start */ int fc; /* first char in selection start */ }XmHTMLTextPosition; /***** * The following structure is returned by the XmHTMLImageDefaultProc convenience * function. When a procedure for the XmNimageProc resource is installed, * it *must* return this structure. *****/ typedef struct _XmImageInfo { /* regular image fields */ String url; /* original location of image */ unsigned char *data; /* raw image data. ZPixmap format */ unsigned char *clip; /* raw clipmask data. XYBitmap format */ Dimension width; /* used image width, in pixels */ Dimension height; /* used image height, in pixels */ Dimension *reds; /* red image pixels */ Dimension *greens; /* green image pixels */ Dimension *blues; /* blue image pixels */ int bg; /* transparent pixel index/type */ unsigned int ncolors; /* Number of colors in the image */ unsigned int options; /* image option bits */ /* image classification fields and original data */ unsigned char type; /* image type, see the IMAGE_ enum above */ unsigned char depth; /* bits per pixel for this image */ unsigned char colorspace; /* colorspace for this image */ unsigned char transparency; /* transparency type for this image */ Dimension swidth; /* image width as read from image */ Dimension sheight; /* image height as read from image */ unsigned int scolors; /* Original number of colors in the image */ /* Special fields for images with an alpha channel */ unsigned char *alpha; /* alpha channel data */ float fg_gamma; /* image gamma */ /* Additional animation data */ int x; /* logical screen x-position for this frame */ int y; /* logical screen y-position for this frame */ int loop_count; /* animation loop count */ unsigned char dispose; /* image disposal method */ int timeout; /* frame refreshment in milliseconds */ int nframes; /* no of animation frames remaining */ struct _XmImageInfo *frame; /* ptr to next animation frame */ XtPointer user_data; /* any data to be stored with this image */ }XmImageInfo, *XmImageInfoStruct; /* XmHTML method to load images */ typedef XmImageInfo* (*XmImageProc)(Widget, String, Dimension, Dimension, XtPointer); /**** * The next two structures constitute the XmImage definition which are used by * the XmImageCreate and XmImageDestroy routines. Please note that the *only* * safe way to destroy an XmImage is to use the XmImageDestroy function. * XmHTML does not use the XmImage structure, it is provided for your * convenience. ****/ /**** * Animation frame data. ****/ typedef struct{ int x; /* x position in logical screen */ int y; /* y position in logical screen */ int w; /* width of this particular frame */ int h; /* height of this particular frame */ int timeout; /* timeout for the next frame */ unsigned char dispose; /* previous frame disposal method */ Pixmap pixmap; /* actual image */ Pixmap clip; /* image clipmask */ Pixmap prev_state; /* previous screen state */ }XmImageFrame; /***** * Actual image definition. * If you want access to the xcc member, include the XCC.h header file. *****/ typedef struct{ String file; /* originating file */ unsigned char type; /* image type, see the IMAGE_ enum below */ Pixmap pixmap; /* actual image */ Pixmap clip; /* for transparant pixmaps */ unsigned int options; /* image option bits */ int width; /* current image width, in pixels */ int height; /* current image height, in pixels */ int ncolors; /* no of colors in this image */ int scolors; /* specified no of colors */ int swidth; /* image width as read from image */ int sheight; /* image height as read from image */ int depth; /* depth of this image */ int npixels; /* no of really allocated pixels */ GC gc; /* graphics context for rendering */ /* animation data */ XmImageFrame *frames; /* array of animation frames */ int nframes; /* no of frames following */ int current_frame; /* current frame count */ int current_loop; /* current loop count */ int loop_count; /* maximum loop count */ XtIntervalId proc_id; /* timer id for animations */ Widget w; /* image owner */ XtAppContext context; /* Application context for animations */ /* private data */ struct _XColorContext *xcc; /* a lot of visual info */ struct _ToolkitAbstraction *tka; }XmImage; /***** * Link member information. *****/ typedef struct { String url; /* value of URL tag */ String rel; /* value of REL tag */ String rev; /* value of REV tag */ String title; /* value of TITLE tag */ }XmHTMLLinkDataRec, *XmHTMLLinkDataPtr; /***** * Meta member information. *****/ typedef struct { String http_equiv; /* value of HTTP-EQUIV tag */ String name; /* value of NAME tag */ String content; /* value of CONTENT tag */ }XmHTMLMetaDataRec, *XmHTMLMetaDataPtr; /***** * XmHTMLHeadAttributes definition *****/ typedef struct{ String doctype; /* doctype data */ String title; /* document title */ Boolean is_index; /* true when the element exists */ String base; /* value of the element */ int num_meta; /* number of META info to process */ XmHTMLMetaDataPtr meta; /* array of META info to process */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ String style_type; /* value of the style type element tag */ String style; /* contents */ String script_lang; /* value of the language element tag */ String script; /* contents */ }XmHTMLHeadAttributes; /***** * Document Information. * images and anchors contain all src and href's in a single string. Entries * are separated by the null char and terminated by two null chars. *****/ typedef struct{ String bg_image; /* background image (if any) */ String images; /* list of all images (if any) */ String anchors; /* list of all anchors (excluding named) */ }XmHTMLDocumentInfo; /***** * XmHTMLFontCacheInfo definition. This structure is returned by the * XmHTMLGetFontCacheInfo convenience routine and contains information about * the font cache bound to the display of a given widget. * The fonts and mapping arrays are in sync: when a name in the fonts array * has a non-NULL entry at the corresponding position in the mapping array, * the value of the mapping entry is the real font being used. *****/ typedef struct{ int nentries; /* total no of cached fonts */ int nmaps; /* of which this many are mapped fonts */ int nlookups; /* no of search actions */ int nrequests; /* no of requests made */ int hits; /* no of hits */ int misses; /* no of misses */ String *fonts; /* array of font names, size nentries */ String *mapping; /* array of font mappings, size nentries */ int nwidgets; /* no of widgets using this cache */ WidgetList widgets; /* array of widgets */ }XmHTMLFontCacheInfo; /***** * forward declaration of XmHTMLAnchorCallback structure *****/ typedef struct _XmHTMLAnchorCallbackStruct *XmHTMLAnchorPtr; /***** * XmHTMLXYToInfo return value * This structure and any of it members may *never* be freed by the caller. *****/ typedef struct { Cardinal line; /* line number at selected position */ Boolean is_map; /* true when clicked image is an imagemap */ int x,y; /* position relative to image corner */ XmImageInfo *image; /* image data */ XmHTMLAnchorPtr anchor; /* possible anchor data */ }XmHTMLInfoStructure, *XmHTMLInfoPtr; /***** * XmHTML progressive object loading * (PLC stands for Progressive Loader Context) *****/ typedef struct _XmHTMLPLCStream{ Cardinal total_in; /* no of bytes received so far */ Cardinal min_out; /* minimum number of bytes requested */ Cardinal max_out; /* maximum number of bytes requested */ XtPointer user_data; /* any data registered on this PLC */ unsigned char pad[24]; /* reserved for future use */ }XmHTMLPLCStream; /***** * External GIF decoder stream object. This is the only argument to any * procedure installed on the XmNdecodeGIFProc resource. * * The first block is kept up to date by XmHTML and is read-only. When state * is GIF_STREAM_INIT, the decoder should initialize it's private data and store * it in the external_state field so that it can be used for successive calls * to the decoder. When state is GIF_STREAM_FINAL, the decoder should wrapup * and flush all pending data. It can also choose to destruct it's internal * data structures here (another call with state set to GIF_STREAM_END will be * made when the internal loader is destroying it's internal objects as * well). * * All remaining fields are the ``public'' fields and must be updated by the * external decoder. The msg field can be set to an error message if the * external decoder fails for some reason. XmHTML will then display this * error message and abort this image. *****/ typedef struct _XmHTMLGIFStream{ /* read-only fields */ int state; /* decoder state */ int codesize; /* initial LZW codesize */ Boolean is_progressive; /* when used by a progressive loader */ unsigned char *next_in; /* next input byte */ Cardinal avail_in; /* number of bytes available at next_in */ Cardinal total_in; /* total nb of input bytes read so far */ /* fields to be updated by caller */ unsigned char *next_out; /* next output byte should be put there */ Cardinal avail_out; /* remaining free space at next_out */ Cardinal total_out; /* total nb of bytes output so far */ String msg; /* last error message, or NULL */ XtPointer external_state; /* room for decoder-specific data */ }XmHTMLGIFStream; /* and the proto for the XmNdecodeGIFProc resource */ typedef int (*XmImageGifProc)(XmHTMLGIFStream*); /***** * Progressive Loading function prototypes. * XmHTMLGetDataProc: proto for function installed on the * XmNprogressiveReadProc resource; * XmHTMLEndDataProc: proto for function installed on the * XmNprogressiveEndProc resource; *****/ typedef int (*XmHTMLGetDataProc)(XmHTMLPLCStream*, XtPointer); typedef void (*XmHTMLEndDataProc)(XmHTMLPLCStream*, XtPointer, int, Boolean); /***** * possible values for the third argument on the EndDataProc *****/ enum{ /* XmHTML_NONE = 0 */ /* PLCObject referenced by all objects */ XmPLC_IMAGE, /* PLCObject for an image */ XmPLC_DOCUMENT, /* PLCObject for a document */ XmPLC_FINISHED /* indicates all plc's have been processed */ }; /***** * XmImage configuration *****/ typedef struct{ unsigned long flags; /* XmImage configuration flags, see above */ int ncolors; /* desired number of colors */ int which_frames; /* animation frames selection flag */ int bg_color; /* background pixel on transparent images */ String z_cmd; /* gif uncompress command */ XmImageGifProc gif_proc; /* external gif decoder */ float gamma; /* gamma correction. JPEG and PNG only */ struct _ToolkitAbstraction *tka; /* private data */ }XmImageConfig; /***** * HTML4.0 Event structure *****/ typedef struct _XmHTMLEvent{ int type; /* HTML4.0 event type, see above */ String script; /* contents of event */ }XmHTMLEvent; /***** * XmNobjectCallback tag_attributes substructure. *****/ typedef struct{ unsigned long flags; /* defines which fields have a value */ String attributes; /* unfiltered attributes */ String classid; /* contents of the classid attribute */ String codebase; /* contents of the codebase attribute */ String data; /* location of object data */ String src; /* location of object data */ String type; /* type of object data */ String codetype; /* type of codebase */ String standby; /* message to display while loading */ String align; /* global alignment */ String halign; /* horizontal alignment */ String valign; /* vertical alignment */ int height; /* following five fields are always integers*/ int width; int border; /* border = 0: no border */ int hspace; int vspace; String usemap; /* location or name of imagemap */ String background; /* location of background image */ String bgcolor; /* name of background color */ String href; /* hyperlink reference */ String name; /* named hyperlink */ XmHTMLEvent *events; /* defined events */ int nevents; /* no of events */ }XmHTMLTagAttributes; /***** * The XmHTMLElementId and XmHTMLObjectId are opaque structures. They * are fully defined in XmHTMLP.h *****/ typedef struct _XmHTMLParserTag *XmHTMLElementId; typedef struct _XmHTMLExtObj *XmHTMLObjectId; /****************************************************************************** * Callback structures * Unless explicitly mentioned, *none* of these structures (or any of its * members) may be freed. ******************************************************************************/ /***** * XmNactivateCallback and XmNanchorTrackCallback callback structure. *****/ typedef struct _XmHTMLAnchorCallbackStruct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ URLType url_type; /* type of url referenced */ Cardinal line; /* line number of the selected anchor */ String href; /* pointer to the anchor value */ String target; /* pointer to target value */ String rel; /* pointer to rel value */ String rev; /* pointer to rev value */ String title; /* pointer to title value */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* local anchor vetoing flag */ Boolean visited; /* local anchor visited flag */ Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLAnchorCallbackStruct; typedef Boolean (*XmHTMLAnchorProc)(Widget, String, XtPointer); /***** * XmNeventCallback callback structure. * * Note on the doc_modified field: this field *MUST* be set to True if the * processing of this event leads to a modification of the currently * displayed document (XmHTMLTextSetString for example) or even destruction * of the widget. It informs XmHTML of the fact that it can no longer rely on * the consistency of it's internal data structures. * * Note on processing of the XmCR_HTML_LOAD and XmCR_HTML_UNLOAD events: * processing of these events may *NEVER* cause a modification of the currently * displayed document. It is a FATAL ERROR if it does change: XmHTML can no * longer guarantee the consistency of it's internal data. *****/ typedef struct{ int reason; /* the reason the event was called */ XEvent *event; /* event triggering this action */ int type; /* HTML4.0 event type, see above */ XtPointer data; /* HTML4.0 event callback data */ Boolean doc_modified; /* Set to True when document is modified*/ }XmHTMLEventCallbackStruct, *XmHTMLEventCallbackPtr; /***** * XmNdocumentCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* always NULL for XmNdocumentCallback */ Boolean html32; /* True if document was HTML 3.2 conforming */ Boolean verified; /* True if document has been verified */ Boolean balanced; /* True if parser tree is balanced */ Boolean terminated; /* True if parser terminated prematurely */ int pass_level; /* current parser level count. Starts at 1 */ Boolean redo; /* perform another pass? */ }XmHTMLDocumentCallbackStruct, *XmHTMLDocumentPtr; /***** * XmNformCallback callback structure. *****/ /***** * Form Component data *****/ typedef struct { componentType type; /* Form component type */ String name; /* component name */ String value; /* component value */ }XmHTMLFormDataRec, *XmHTMLFormDataPtr; /***** * Actual XmNformCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String action; /* URL or cgi-bin destination */ String enctype; /* form encoding */ int method; /* Form Method, GET, POST or PIPE */ int ncomponents; /* no of components in this form */ XmHTMLFormDataPtr components; Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLFormCallbackStruct, *XmHTMLFormPtr; /***** * XmNframeCallback callback structure. * This callback is activated when one of the following events occurs: * 1. XmHTML wants to create a frame, reason = XmCR_HTML_FRAMECREATE * can be veto'd by setting doit to False and supplying a HTML widget * id yourself; * 2. XmHTML wants to destroy a frame, reason = XmCR_HTML_FRAMEDESTROY * can be veto'd by setting doit to False (widget reuse). * 3. XmHTML has finished creating a frame, reason = XmCR_HTML_FRAME. * This is the time to attach callbacks and set additional resources on the * newly created XmHTMLWidget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String src; /* requested document */ String name; /* frame name */ Widget html; /* XmHTML widget id */ Boolean doit; /* destroy/create vetoing flag */ }XmHTMLFrameCallbackStruct, *XmHTMLFramePtr; /***** * XmNimagemapCallback callback structure. * callback reasons can be one of the following: * XmCR_HTML_IMAGEMAP_ACTIVATE * user clicked on an image. Valid fields are x, y and image_name. x and y * are relative to the upper-left corner of the image. Only invoked when * an image has it's ismap attribute set and no client-side imagemap is * present for this image. * XmCR_HTML_IMAGEMAP * an image requires an external imagemap. The only valid field is map_name * which contains the location of the imagemap to fetch. If the contents * of this imagemap is set in the map_contents field, it will be loaded * by the widget. Alternatively, one could also use the XmHTMLAddImagemap * convenience routine to set an imagemap into the widget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int x,y; /* position relative to the upper-left image corner */ String image_name; /* name of referenced image, value of src attribute */ String map_name; /* name of imagemap to fetch/referenced */ String map_contents;/* contents of fetched imagemap */ XmImageInfo *image; /* image data */ }XmHTMLImagemapCallbackStruct, *XmHTMLImagemapPtr; /***** * XmNlinkCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ }XmHTMLLinkCallbackStruct, *XmHTMLLinkPtr; /***** * XmNpageCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ Cardinal total_pages; /* no of pages in document */ }XmHTMLPageCallbackStruct, *XmHTMLPagePtr; /***** * XmNobjectCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int object_id; /* id of object, set by XmHTML */ int tag_id; /* HTML tag identifying an embedded object */ XtPointer tag_user_data;/* any data associated with this tag */ XmHTMLTagAttributes *attributes; /* parsed attributes, immutable */ Widget parent; /* Widget id of parent. */ Widget object; Window window; Boolean scrollable; /* If True, object is part of document * If False, object stays on top of document. */ Boolean wrap; /* Only used when scrollable == False. * If False, document scrolls underneath * the object. * If True, document scrolls around object. */ Boolean reparent; /* If True, XmHTML will reparent the window */ XtPointer user_data; /* additional data registered for this object. * Unused by XmHTML. */ /* Next two fields are only meaningfull when scrollable == False */ int x; /* suggested upper-left position */ int y; /* suggested upper-left position */ Dimension width; /* suggested object width */ Dimension height; /* suggested object height */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* destruct veto flag */ }XmHTMLObjectCallbackStruct, *XmHTMLObjectPtr; /***** * XmNlanguageCallback structure. * The event member is always NULL. * The language, country and text fields are owned by XmHTML and should never * be freed. * * The language field specifies the requested language name, per iso639; * * The country field specifies the requested country, per iso3166; * * The ltor field indicates if XmHTML should render the text left to right * (value: True) or right to left (value: False). The default is True, unless the * "dir" attribute indicates right-to-left rendering; * * The toptobot field indicates if XmHTML should render text from top to bottom * (value: True) or bottom to top (value: False). The default is True. * * The multibyte field indicates if the text to be rendered contains multibyte * characters. It's value is True if multibyte chars have been detected. False * otherwise. * * The text field represents a pointer to the text that is to be rendered in the * specified language. This field is owned by XmHTML and may not be freed. * * The fontfamily[fixed] fields specify the proportional and fixed font families * XmHTML intends to use for rendering text in the requested language. * Can be overridden by the application. * * The charset field specifies the document encoding XmHTML intends to use for * rendering text in the requested language. * Can be overridden by the application. * * To override the fontFamily and charset fields, the application should provide * appropriate values. The provided (default) values may *never* be freed, and * XmHTML will *never* free the provided values. Simply replace the pointers. * * The fontset field allows one to specify a full X11 fontSet, following the * X11 fontset specification rules. This field has no default, but can be provided * by the application. If provided, XmHTML will use this information to create * a fontset. This field is never freed by XmHTML. The x and y resolution to be * used when creating the fontSet members can be deduced by requesting the values * for the XmNxResolution and XmNyResolution resources. * * The XmNlanguageCallback is called under any of the following circumstances: * - A declaration with "http-equiv" set to "Content-Type" and a value set * for "charset". Specifies the default document encoding; * - A declaration with "http-equiv" set to "Content-Type" and a value set * for "language". Specifies the default document language (closely intertwined * with the "charset" specification); * - All terminated HTML elements (<>...) with a value for "lang". * Specifies the language of the enclosed text. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String language; /* language name according to iso639 */ String country; /* country name according to iso3166 */ Boolean ltor; /* left to right or vice-versa rendering */ Boolean toptobot; /* top to bottom or vice-versa rendering */ Boolean multibyte; /* True if requested for multibyte text */ String text; /* text using the requested font */ String fontFamily; /* proposed proportional fontFamily */ String fontFamilyFixed; /* proposed fixed fontFamily */ String charset; /* proposed charset to be used */ String fontset; /* Full fontSet specification */ }XmHTMLLanguageCallbackStruct, *XmHTMLLanguagePtr; /* Don't add anything after this endif! */ #endif /* _HTML_h_ */ XmHTML-1.1.7/include/XmHTML/XCC.h100644 23564 23564 14457 6624314535 14431 0ustar newtnewt/***** * XCC.h : XCC.c public header file: XColorContext routines * * This file Version $Revision: 1.14 $ * * Creation date: Mon Mar 3 00:28:18 GMT+0100 1997 * Last modification: $Date: 1997/10/23 00:24:42 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: John L. Cwikla * * Copyright 1994,1995 John L. Cwikla * Copyright (C) 1997 by Ripley Software Development * All Rights Reserved * * This file is part of the XmHTML Widget Library. * * See below for John L. Cwikla's original copyright notice and distribution * Policy. * * 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. * *****/ /***** * $Id: XCC.h,v 1.6 1995/08/04 17:46:53 cwikla * * Copyright 1994,1995 John L. Cwikla * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appears in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of John L. Cwikla or * Wolfram Research, Inc not be used in advertising or publicity * pertaining to distribution of the software without specific, written * prior permission. John L. Cwikla and Wolfram Research, Inc make no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * John L. Cwikla and Wolfram Research, Inc disclaim all warranties with * regard to this software, including all implied warranties of * merchantability and fitness, in no event shall John L. Cwikla or * Wolfram Research, Inc be liable for any special, indirect or * consequential damages or any damages whatsoever resulting from loss of * use, data or profits, whether in an action of contract, negligence or * other tortious action, arising out of or in connection with the use or * performance of this software. * * Author: * John L. Cwikla * X Programmer * Wolfram Research Inc. * * cwikla@wri.com * *****/ /***** * $Source: /usr/local/rcs/Newt/XmHTML/RCS/XCC.h,v $ *****/ /***** * ChangeLog * $Log: XCC.h,v $ * Revision 1.14 1997/10/23 00:24:42 newt * XmHTML Beta 1.1.0 release * * Revision 1.13 1997/08/31 17:31:55 newt * log edit * * Revision 1.12 1997/08/30 00:32:02 newt * Fixed palette preparations & changed proto's for XCCGetPixels and * XCCGetPixelsIncremental. * * Revision 1.11 1997/08/01 12:54:41 newt * Proto for XCCGetPixelsIncremental added. * * Revision 1.10 1997/05/28 01:35:04 newt * Updated XCCCreate proto. * * Revision 1.9 1997/04/03 05:29:02 newt * Added XCCFreeColors proto * * Revision 1.8 1997/03/20 08:03:19 newt * XCCGetPixels proto updated * * Revision 1.7 1997/03/02 23:44:25 newt * Expanded copyright marker * *****/ #ifndef _xcc_h_ #define _xcc_h_ typedef struct _XColorContext *XCC; _XFUNCPROTOBEGIN extern XCC XCCCreate(Widget w, Visual *_visual, Colormap _colormap); /* copy an XCC entirely */ extern XCC XCCCopy(XCC src); extern XCC XCCMonoCreate(Display *_dpy, Visual *_visual, Colormap _colormap); extern void XCCFree(XCC _xcc); extern unsigned long XCCGetPixel(XCC _xcc, unsigned short _red, unsigned short _green, unsigned short _blue, Boolean *failed); extern void XCCGetPixels(XCC _xcc, unsigned short *reds, unsigned short *greens, unsigned short *blues, int ncolors, unsigned long *colors, int *nallocated); extern void XCCGetPixelsIncremental(XCC _xcc, unsigned short *reds, unsigned short *greens, unsigned short *blues, int ncolors, Boolean *used, unsigned long *colors, int *nallocated); extern int XCCGetNumColors(XCC _xcc); extern Colormap XCCGetColormap(XCC _xcc); extern Visual *XCCGetVisual(XCC _xcc); extern XVisualInfo *XCCGetVisualInfo(XCC _xcc); extern int XCCGetDepth(XCC _xcc); extern int XCCGetClass(XCC _xcc); extern Display *XCCGetDisplay(XCC _xcc); extern int XCCQueryColor(XCC _xcc, XColor *_color); extern int XCCQueryColors(XCC _xcc, XColor *_colors, int _numColors); /* get colorcomponents of the given color */ extern int XCCGetColor(XCC _xcc, unsigned long pixel_val, unsigned short *red, unsigned short *green, unsigned short *blue); /***** * Returns visual of either the widget (or any parent that is a subclass of * shell) or the default visual *****/ extern Visual *XCCGetParentVisual(Widget w); /***** * Add a palette to the given XCC. All colors will then be mapped onto this * palette. *****/ extern int XCCAddPalette(XCC _xcc, XColor *palette, int num_palette); /***** * Initialize dithering: allocate & initialize a precomputed error correction * matrices. *****/ extern void XCCInitDither(XCC _xcc); /* and free it again */ extern void XCCFreeDither(XCC _xcc); /***** * Pick a color using an installed palette. If a direct match is not found, * a least squares algorithm is used to map the color components. * The failed arg will be True if the mapping failed. In all other cases a * pixel value is returned and the _red, _green and _blue args will contain * the difference between the original and used component (which can be * negative, hence these args are signed). If they are all equal to 0 a * perfect match was found (which I suspect will be seldomly the case). * * The intended use of this routine is dithering. Either using ordered or * Floyd-Steinberg. *****/ unsigned long XCCGetPixelFromPalette(XCC _xcc, unsigned short *_red, unsigned short *_green, unsigned short *_blue, Boolean *failed); /***** * Same as above, but this time the *index* into the palette at which the * requested color can be found is returned. Used by the dither algorithms. *****/ extern unsigned char XCCGetIndexFromPalette(XCC _xcc, int *_red, int *_green, int *_blue, Boolean *failed); _XFUNCPROTOEND /* Don't add anything after this endif! */ #endif /* _xcc_h_ */ XmHTML-1.1.7/include/XmHTML/XCCP.h100644 23564 23564 13305 6624037707 14543 0ustar newtnewt/***** * XCCP.h : XCC.c private header file * * This file Version $Revision: 1.10 $ * * Creation date: Mon Mar 3 00:28:18 GMT+0100 1997 * Last modification: $Date: 1998/04/04 06:27:50 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: John L. Cwikla * * Copyright 1994,1995 John L. Cwikla * Copyright (C) 1997 by Ripley Software Development * All Rights Reserved * * This file is part of the XmHTML Widget Library. * * See below for John L. Cwikla's original copyright notice and distribution * Policy. * * 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. * *****/ /***** * Id: XCCP.h,v 1.5 1995/08/04 17:46:17 cwikla * * Copyright 1994,1995 John L. Cwikla * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appears in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of John L. Cwikla or * Wolfram Research, Inc not be used in advertising or publicity * pertaining to distribution of the software without specific, written * prior permission. John L. Cwikla and Wolfram Research, Inc make no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * John L. Cwikla and Wolfram Research, Inc disclaim all warranties with * regard to this software, including all implied warranties of * merchantability and fitness, in no event shall John L. Cwikla or * Wolfram Research, Inc be liable for any special, indirect or * consequential damages or any damages whatsoever resulting from loss of * use, data or profits, whether in an action of contract, negligence or * other tortious action, arising out of or in connection with the use or * performance of this software. * * Author: * John L. Cwikla * X Programmer * Wolfram Research Inc. * * cwikla@wri.com * *****/ /***** * $Source: /usr/local/rcs/Newt/XmHTML/RCS/XCCP.h,v $ *****/ /***** * ChangeLog * $Log: XCCP.h,v $ * Revision 1.10 1998/04/04 06:27:50 newt * XmHTML Beta 1.1.3 * * Revision 1.9 1997/08/30 00:32:27 newt * Fixed palette preparations & color HashTable changes. * * Revision 1.8 1997/05/28 01:35:16 newt * Added some additional comments. * * Revision 1.7 1997/04/03 05:29:41 newt * corrected a typo * * Revision 1.6 1997/03/02 23:44:30 newt * Expanded copyright marker * *****/ #ifndef _xccp_h_ #define _xccp_h_ #include #define MODE_UNDEFINED 0 /* UNKNOWN */ #define MODE_BW 1 /* Default B+W */ #define MODE_STDCMAP 2 /* Has a stdcmap */ #define MODE_TRUE 3 /* Is a TrueColor/DirectColor visual */ #define MODE_MY_GRAY 4 /* my grayramp */ #define MODE_PALETTE 5 /* has pre-allocated palette */ typedef struct XCCDither{ int fast_rgb[32][32][32]; /* quick lookuptable for faster rendering */ int fast_err[32][32][32]; /* internal RGB error information */ int fast_erg[32][32][32]; int fast_erb[32][32][32]; }XCCDither; typedef struct _HashEntry{ struct _HashEntry *nptr; struct _HashEntry *pptr; /* linked list */ unsigned long key; unsigned long data; #ifdef DEBUG int ncoll; /* no of collisions for this entry */ #endif struct _HashEntry *next; /* next on the linked-list for collisions */ }HashEntry; /* A generic hash table structure */ typedef struct _HashTable{ int elements; /* elements stored in the table */ int size; /* size of the table */ HashEntry **table; HashEntry *last; /* last on the linked list */ #ifdef DEBUG int requests, hits, misses, puts, collisions; #endif }HashTable; struct _XColorContext { Display *dpy; Visual *visual; Colormap colormap; XVisualInfo *visualInfo; int numColors; /* available no of colors in colormap */ int maxColors; /* maximum no of colors */ int numAllocated; /* no of allocated colors */ char mode; char needToFreeColormap; Atom stdCmapAtom; XStandardColormap stdCmap; unsigned long *CLUT; /* Color LookUp Table */ XColor *CMAP; /* colormap */ HashTable *color_hash; /* hashtable of allocated colors */ XColor *palette; /* preallocated palette */ int num_palette; /* size of palette */ XCCDither *fast_dither; /* fast dither matrix */ struct { int red; int green; int blue; } shifts; struct { unsigned long red; unsigned long green; unsigned long blue; } masks; struct { int red; int green; int blue; } bits; unsigned long maxEntry; unsigned long blackPixel, whitePixel; }; /* initialize the given hashtable. */ extern HashTable *_XCCHashInit(HashTable *table); /* put a new entry in the hashtable */ extern void _XCCHashPut(HashTable *table, unsigned long key, unsigned long data); /* get an entry from the hashtable */ extern Boolean _XCCHashGet(HashTable *table, unsigned long key, unsigned long *data); /* delete an entry from the hashtable */ extern void _XCCHashDelete(HashTable *table, unsigned long key); /* completely wipe the given hashtable */ extern void _XCCHashDestroy(HashTable *table); /* Don't add anything after this endif! */ #endif /* _xccp_h_ */ XmHTML-1.1.7/include/XmHTML/XmHTML.h100644 23564 23564 42603 6646513215 15057 0ustar newtnewt/***** * 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 7 #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.7 (C)Ripley Software Development" /* Required includes */ #include #include #include #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); /***** * 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 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 * 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 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_ */ XmHTML-1.1.7/include/XmHTML/XmHTMLP.h100644 23564 23564 141527 6651235247 15226 0ustar newtnewt/***** * XmHTMLP.h : XmHTML Widget private header file * * This file Version $Revision: 1.20 $ * * Creation date: Tue Nov 19 23:18:41 GMT+0100 1996 * Last modification: $Date: 1998/04/27 06:57:28 $ * 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/XmHTMLP.h,v $ *****/ /***** * ChangeLog * $Log: XmHTMLP.h,v $ * Revision 1.20 1998/04/27 06:57:28 newt * Started initial work on a rewrite of the layout routines (XmHTMLSubDoc * and XmHTMLLayer structures) * * Revision 1.19 1998/04/04 06:27:55 newt * XmHTML Beta 1.1.3 * * Revision 1.18 1997/10/26 23:50:04 newt * Added internal symbol defines (_LIBRARY stuff) * * Revision 1.17 1997/10/23 00:24:47 newt * XmHTML Beta 1.1.0 release * * Revision 1.16 1997/08/31 17:32:58 newt * log edit * * Revision 1.15 1997/08/30 00:42:16 newt * Reorganized a number of things and moved all private XmHTML functions to * the XmHTMLI.h include file. * * Revision 1.14 1997/08/01 12:55:01 newt * Progressive image loading changes. * * Revision 1.13 1997/05/28 01:43:05 newt * Made all image options a long instead of a Byte. Additional protos for the * XmNdecodeGIFProc resource. * * Revision 1.12 1997/04/29 14:23:03 newt * Moved all XmHTML private functions in. * * Revision 1.11 1997/04/03 05:31:52 newt * Added an additional base field to the XmHTMLWord structure. * * Revision 1.10 1997/03/28 07:06:26 newt * Frame interface support. * * Revision 1.9 1997/03/20 08:06:11 newt * XmNrepeatDelay, moved HTML enumeration table from XmHTML.h in here * * Revision 1.8 1997/03/11 19:50:50 newt * Changes in XmHTMLImage, XmHTMLWord and XmHTMLObjectTable * * Revision 1.7 1997/03/04 18:46:42 newt * XmHTMLImage changed for animation support; imagemap_fg and imagemap_draw added * * Revision 1.6 1997/03/04 00:56:58 newt * Removed some obsolete fields * * Revision 1.5 1997/03/02 23:09:30 newt * XmHTMLImage, XmHTMLImageMap, XmHTMLAnchor structs modified. * * Revision 1.4 1997/02/11 02:02:11 newt * Removed obsolete fields from XmHTMLWord, XmHTMLObjectTable. * Added stuff for new anchor treatment. * * Revision 1.3 1997/01/09 06:55:56 newt * expanded copyright marker * * Revision 1.2 1997/01/09 06:48:29 newt * changes in XmHTMLWord. Added all image structures and enums. * * Revision 1.1 1996/12/19 02:17:16 newt * Initial Revision * *****/ #ifndef _XmHTMLP_h_ #define _XmHTMLP_h_ #include /* property defines */ #include /* fast macros */ #include /* must be below, it includes X11/Intrinsic.h */ #include /* index defines & private motif functions */ #include /* Required includes */ #include #if 0 #include #endif /***** * NEVER define VERSION *or* _LIBRARY yourself. These are defines required * for compiling the library. When defined, they pull in a number of other * header files which are normally *not* installed. *****/ #ifdef VERSION # ifndef _LIBRARY # define _LIBRARY # endif #endif/* VERSION */ /***** * prevent multiple decls when building the lib. * zconf.h (which gets included by png.h) also typedefs Byte to unsigned char. * The compiler warning is annoying, so just don't typedef it again. * XCC is an opaque object defined in XCCP.h *****/ #ifdef _LIBRARY # include "XCC.h" /* XColorContext definitions and protos */ # ifdef _ZCONF_H # ifndef BYTE_ALREADY_TYPEDEFED # define BYTE_ALREADY_TYPEDEFED # endif /* BYTE_ALREADY_TYPEDEFED */ # endif /* _ZCONF_H */ #else typedef struct _XColorContext *XCC; #endif /* _LIBRARY */ #ifndef BYTE_ALREADY_TYPEDEFED #define BYTE_ALREADY_TYPEDEFED typedef unsigned char Byte; #endif /* BYTE_ALREADY_TYPEDEFED */ /***** * Currently, the only supported method of form scrolling is by * mapping/unmapping all form elements *****/ #define UNMAP_FORMS 1 _XFUNCPROTOBEGIN /***** * Class pointer and extension record definition *****/ typedef struct { XtPointer extension; /* Pointer to extension record */ }XmHTMLClassPart; typedef struct _XmHTMLClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmHTMLClassPart html_class; }XmHTMLClassRec; /***** * A whole slew of states for all kinds of internal objects. *****/ /***** * Line styles *****/ #define LINE_SOLID (1<<1) /* paint a solid line */ #define LINE_DASHED (1<<2) /* paint a dashed line */ #define LINE_SINGLE (1<<3) /* paint a single line */ #define LINE_DOUBLE (1<<4) /* paint a double line */ #define LINE_STRIKE (1<<5) /* render as strikeout */ #define LINE_UNDER (1<<6) /* render as underline */ #define NO_LINE 0 /* no lines at all */ /***** * Spacing and anchor text data bits *****/ #define TEXT_SPACE_NONE (1<<0) /* no spacing at all */ #define TEXT_SPACE_LEAD (1<<1) /* add a leading space */ #define TEXT_SPACE_TRAIL (1<<2) /* add a trailing space */ #define TEXT_ANCHOR (1<<3) /* a regular anchor */ #define TEXT_ANCHOR_INTERN (1<<4) /* internal anchor flag */ #define TEXT_IMAGE (1<<5) /* indicates an image member */ #define TEXT_FORM (1<<6) /* indicates a form member */ #define TEXT_BREAK (1<<7) /* indicates a linebreak */ /***** * HTML list marker enumeration type *****/ typedef enum{ XmMARKER_NONE = 0, XmMARKER_ARABIC = 10, XmMARKER_ALPHA_LOWER, XmMARKER_ALPHA_UPPER, XmMARKER_ROMAN_LOWER, XmMARKER_ROMAN_UPPER, XmMARKER_DISC = 15, XmMARKER_SQUARE, XmMARKER_CIRCLE }Marker; /***** * Horizontal/Vertical alignment data *****/ typedef enum{ XmHALIGN_NONE = 0, /* horizontal alignment */ XmHALIGN_LEFT, XmHALIGN_CENTER, XmHALIGN_RIGHT, XmHALIGN_JUSTIFY, /* extension for fully justified text */ XmVALIGN_NONE = 8, /* vertical alignment */ XmVALIGN_TOP, XmVALIGN_MIDDLE, XmVALIGN_BOTTOM, XmVALIGN_BASELINE }Alignment; /***** * Possible types of HTML objects. * All text types are only used when computing the screen layout *****/ typedef enum{ OBJ_NONE = 0, OBJ_TEXT, /* text element */ OBJ_PRE_TEXT, /* preformatted text */ OBJ_BULLET, /* all types of markers for lists */ OBJ_HRULE, /* horizontal rule */ OBJ_TABLE, /* table elements */ OBJ_TABLE_FRAME, /* table caption, row, cell elements */ OBJ_IMG, /* image elements */ OBJ_FORM, /* form elements */ OBJ_APPLET, /* applet elements */ OBJ_BLOCK /* other block level elements */ }ObjectType; /***** * linefeed types *****/ #define CLEAR_NONE -1 /* stay on the same line */ #define CLEAR_SOFT 0 /* return + move single line downard */ #define CLEAR_HARD 1 /* return + move two lines downward */ #define CLEAR_ALL 2 /* return + move baseline fully down */ /***** * Server/client side and map type values *****/ typedef enum{ XmMAP_NONE = 1, XmMAP_SERVER, XmMAP_CLIENT }Imagemap; /***** * Image option bits. * Each of these bits represents certain state information about an image. *****/ #define IMG_ISBACKGROUND (1L<<1) /* is a background image */ #define IMG_ISINTERNAL (1L<<2) /* is an internal image */ #define IMG_ISCOPY (1L<<3) /* is a referential copy */ #define IMG_ISANIM (1L<<4) /* is an animation */ #define IMG_FRAMEREFRESH (1L<<5) /* set when running an animation */ #define IMG_HASDIMENSIONS (1L<<6) /* dimensions are given in */ #define IMG_HASSTATE (1L<<7) /* current state pixmap present */ #define IMG_INFOFREED (1L<<8) /* imageinfo has been freed */ #define IMG_DELAYED_CREATION (1L<<9) /* create when needed */ #define IMG_ORPHANED (1L<<10)/* indicates orphaned image */ #define IMG_PROGRESSIVE (1L<<11)/* indicates image is being loaded */ /***** * Possible colorclass an image can have. *****/ #define COLOR_CLASS_GRAYSCALE 0 #define COLOR_CLASS_INDEXED 1 #define COLOR_CLASS_RGB 2 /***** * What type of scrolling a frame should employ. *****/ typedef enum{ FRAME_SCROLL_NONE = 1, FRAME_SCROLL_AUTO, FRAME_SCROLL_YES }FrameScrolling; /***** * Possible types of frame sizes *****/ typedef enum{ FRAME_SIZE_FIXED = 1, /* size specified in pixels */ FRAME_SIZE_RELATIVE, /* size is relative */ FRAME_SIZE_OPTIONAL /* size is optional */ }FrameSize; /***** * Possible Frame layout policies *****/ typedef enum{ FRAMESET_LAYOUT_ROWS = 1, /* rows only */ FRAMESET_LAYOUT_COLS = 2, /* columns only */ FRAMESET_LAYOUT_ROW_COLS = 4 /* left to right, top to bottom */ }FramesetLayout; /***** * The three possible anchor selection states *****/ #define ANCHOR_UNSELECTED (Byte)0 /* default anchor state */ #define ANCHOR_INSELECT (Byte)1 /* anchor is gaining selection */ #define ANCHOR_SELECTED (Byte)2 /* anchor is selected */ /***** * XmHTML font style bits *****/ #define FONT_BOLD (1<<1) #define FONT_MEDIUM (1<<2) #define FONT_ITALIC (1<<3) #define FONT_REGULAR (1<<4) #define FONT_FIXED (1<<5) #define FONT_SCALABLE (1<<6) /***** * Supported font types *****/ #define XmHTML_FONT (1<<1) #define XmHTML_FONTSET (1<<2) /***** * A XmHTML font. XmHTML uses it's own font definition for performance * reasons (the layout routines use a *lot* of font properties). *****/ typedef struct _XmHTMLFont{ Byte type; /* font type, XFontStruct or XFontSet */ Byte style; /* this font's style */ String font_name; /* full XLFD */ String font_family; /* fontFamily (foundry-family-sw-spacing) */ XtPointer xfont; /* ptr to font definition */ /* Can be a XFontSet when the library was */ /* compiled with full I18N support. */ /* font properties */ int ptsize; /* font pointsize */ int height; /* height of largest character */ int lineheight; /* suggested lineheight */ Cardinal isp; /* normal interword spacing */ Cardinal eol_sp; /* additional end-of-line spacing */ int sup_xoffset; /* additional superscript x-offset */ int sup_yoffset; /* additional superscript y-offset */ int sub_xoffset; /* additional subscript x-offset */ int sub_yoffset; /* additional subscript y-offset */ int ul_offset; /* additional underline offset */ Cardinal ul_thickness; /* underline thickness */ int st_offset; /* additional strikeout offset */ Cardinal st_thickness; /* strikeout thickness */ short m_lbearing; /* maximum character left bearing */ short m_rbearing; /* maximum character right bearing */ short m_width; /* maximum character width */ short m_ascent; /* maximum character ascent */ short m_descent; /* maximum character descent */ short ascent; /* average character ascent */ short descent; /* average character descent */ }XmHTMLfont; /********** ****** Definition of all possible Objects **********/ /***** * HTML4.0 Events *****/ typedef struct _HTEvent{ int type; /* HTML4.0 event type */ XtPointer data; /* event user data */ }HTEvent; /***** * All possible events that HTML4.0 defines * All fields are ptrs into XmHTML HTEvent array. *****/ typedef struct _AllEvents{ /* Document/Frame specific events */ HTEvent *onLoad; HTEvent *onUnload; /* HTML Form specific events */ HTEvent *onSubmit; HTEvent *onReset; HTEvent *onFocus; HTEvent *onBlur; HTEvent *onSelect; HTEvent *onChange; /* object events */ HTEvent *onClick; HTEvent *onDblClick; HTEvent *onMouseDown; HTEvent *onMouseUp; HTEvent *onMouseOver; HTEvent *onMouseMove; HTEvent *onMouseOut; HTEvent *onKeyPress; HTEvent *onKeyDown; HTEvent *onKeyUp; }AllEvents; /***** * event Bitmask values *****/ #define EVENT_LOAD (1L<<0) #define EVENT_UNLOAD (1L<<1) #define EVENT_SUBMIT (1L<<2) #define EVENT_RESET (1L<<3) #define EVENT_FOCUS (1L<<4) #define EVENT_BLUR (1L<<5) #define EVENT_SELECT (1L<<6) #define EVENT_CHANGE (1L<<7) #define EVENT_CLICK (1L<<8) #define EVENT_DOUBLECLICK (1L<<9) #define EVENT_MOUSEDOWN (1L<<10) #define EVENT_MOUSEUP (1L<<11) #define EVENT_MOUSEOVER (1L<<12) #define EVENT_MOUSEMOVE (1L<<13) #define EVENT_MOUSEOUT (1L<<14) #define EVENT_KEYPRESS (1L<<15) #define EVENT_KEYDOWN (1L<<16) #define EVENT_KEYUP (1L<<17) /***** * Definition of an anchor * URLType is an enumeration type defined in HTML.h *****/ typedef struct _XmHTMLAnchor{ URLType url_type; /* url type of anchor */ String name; /* name if it's a named anchor */ String href; /* referenced URL */ String target; /* target spec */ String rel; /* possible rel */ String rev; /* possible rev */ String title; /* possible title */ unsigned long event_mask; /* defined events */ AllEvents *events; /* events to be served */ Cardinal line; /* location of this anchor */ Boolean visited; /* true when anchor is visited */ struct _XmHTMLAnchor *next; /* ptr to next anchor */ }XmHTMLAnchor; /***** * Definition of a word (a word can be plain text, an image, a form member * or a linebreak). *****/ typedef struct _XmHTMLWord{ int x; /* x-position for this word */ int y; /* y-position for this word */ Dimension width; /* pixel width of word */ Dimension height; /* pixel height of word */ Cardinal line; /* line for this word */ ObjectType type; /* type of word, used by

    ,	*/
    	String 				word;		/* word to display						*/
    	int 				len;		/* string length of word				*/
    	XmHTMLfont	 		*font;		/* font to use							*/
    	Byte 				line_data;	/* line data (underline/strikeout)		*/
    	Byte				spacing;	/* leading/trailing/nospace allowed		*/
    	Byte				posbits;	/* Position bits for anchors/lined		*/
    	AllEvents			*events;	/* events to be served					*/
    	struct _XmHTMLImage *image;		/* when this is an image				*/
    	struct _XmHTMLForm	*form;		/* when this is a form element			*/
    	struct _XmHTMLExtObj *embed;	/* when this is an embedded element		*/
    	struct _XmHTMLWord	*base;		/* baseline word for a line				*/
    	struct _XmHTMLWord	*self; 		/* ptr to itself, for anchor adjustment	*/
    	struct _XmHTMLObjectTable *owner;	/* owner of this worddata			*/
    }XmHTMLWord;
    
    /*****
    * Definition of an embedded object to the parser.
    *****/
    typedef struct _XmHTMLParserTag{
    	/* user-provided data fields */
    	String			tag;			/* name of tag							*/
    	Boolean			terminated;		/* tag has a terminating counterpart	*/
    	unsigned long	flags;			/* defined attributes					*/
    	XtPointer		user_data;		/* external tag data, unused internally	*/
    
    	/* internal fields */
    	int				id;				/* internal id, -1 == unused 			*/
    }XmHTMLParserTag;
    
    /*****
    * Definition of an embedded object. This object allows programmers to 
    * dynamically extend XmHTML with private HTML tags.
    *****/
    typedef struct _XmHTMLExtObj{
    	int 				x;			/* x-position for this object			*/
    	int					y;			/* y-position for this object			*/
    	Dimension 			width;		/* absolute width of object				*/
    	Dimension 			height;		/* absolute height of object			*/
    	int					id;			/* object identifier					*/
    	String				name;		/* object identifier					*/
    	Widget				w;			/* object container						*/
    
    	XmHTMLParserTag		*tag;		/* parser element defining this object	*/
    	XmHTMLTagAttributes	*attributes;/* attributes for this element			*/
    
    	/*****
    	* Possible attributes that can influence the layout of an embedded object.
    	* They are derived from the HTML4.0 OBJECT element.
    	*****/
    	Alignment			halign;		/* horizontal alignment					*/
    	Alignment			valign;		/* vertical alignment					*/
    	Dimension			border;		/* border thickness						*/ 
    	AllEvents			*events;	/* events to be served					*/
    
    	XtPointer			user_data;	/* user data, unused by XmHTML			*/
    
    	Boolean				scrollable;	/* true if object is anchored in doc.	*/
    	Boolean				wrap;		/* wrap/don't wrap text around object	*/
    	Boolean 			mapped;		/* True when displayed, false otherwise */
    
    	struct _XmHTMLObjectTable *data;/* owning data object					*/
    	struct _XmHTMLExtObj *prev;		/* ptr to previous record				*/
    	struct _XmHTMLExtObj *next;		/* ptr to next record					*/
    }XmHTMLExtObj;
    
    /* area definition. See map.c for the full definition */
    typedef struct _mapArea mapArea;
    
    /*****
    * Client-side imagemap information
    * mapArea is a transparent object and is defined in map.c
    *****/
    typedef struct _XmHTMLImageMap{
    	String				name;		/* name of map			*/
    	int					nareas;		/* no of areas			*/
    	mapArea				*areas;		/* list of areas		*/
    	struct _XmHTMLImageMap *next;	/* ptr to next imagemap */
    }XmHTMLImageMap;
    
    /*****
    * XmHTML's internal image format.
    * One very important thing to note is that the meaning of the (width,height)
    * and (swidth,sheight) members of this structure is exactly *OPPOSITE* to
    * the members with the same name in the public structures (XmImageInfo and
    * XmImage).
    *****/
    typedef struct _XmHTMLImage{
    	/* Normal image data */
    	Byte			magic;			/* structure identifier */
    	String			url;			/* raw src specification */
    	XmImageInfo		*html_image;	/* local image data */
    	Pixmap			pixmap;			/* actual image */
    	Pixmap			clip;			/* for transparant pixmaps */
    	unsigned long	options;		/* image option bits */
    	int				width;			/* resulting image width */
    	int				height;			/* resulting image height */
    	int				npixels;		/* no of allocated pixels */
    	XCC             xcc;			/* a lot of visual info */
    
    	/* Possible  attributes */
    	int				swidth;			/* requested image width */
    	int				sheight;		/* requested image height */
    	String			alt;			/* alternative image text */
    	Alignment		align;			/* image alignment */
    	Imagemap		map_type;		/* type of map to use */
    	String			map_url;		/* image map url/name */
    	Dimension		border;			/* image border thickness */
    	Dimension		hspace;			/* horizontal spacing */
    	Dimension		vspace;			/* vertical spacing */
    
    	struct _XmHTMLObjectTable *owner;	/* owner of this image */
    	struct _XmHTMLImage *child;		/* ptr to copies of this image */
    	struct _XmHTMLImage *next;		/* ptr to next image */
    
    	/* animation data */
    	XmImageFrame 	*frames;		/* array of animation frames */
    	int				nframes;		/* no of frames following */
    	int				current_frame;	/* current frame count */
    	int				current_loop;	/* current loop count */
    	int				loop_count;		/* maximum loop count */
    	XtIntervalId	proc_id;		/* timer id for animations */
    	XmHTMLWidget	html;			/* image owner */
    	XtAppContext	context;		/* Application context for animations */
    
    	/* other data */
    	AllEvents			*events;	/* events to be served */
    }XmHTMLImage;
    
    /*****
    * The following structure is used to mimic file access in memory.
    * It's only used for loading images, hence the name ImageBuffer.
    *****/
    typedef struct{
    	char *file;					/* name of file */
    	Byte *buffer;				/* memory buffer */
    	Byte *curr_pos;				/* current position in buffer */
    	size_t next;				/* current block count */
    	size_t size;				/* total size of in-memory file */
    	Boolean may_free;			/* True when we must free this block */
    	unsigned char type;			/* type of image */
    	int depth;					/* depth of this image */
    }ImageBuffer;
    
    /*****
    * Definition of HTML form components
    *****/
    typedef struct _XmHTMLForm{
    	int	 			x;				/* x-position for this widget */
    	int 			y;				/* y-position for this widget */
    	Dimension 		width;			/* width of this widget */
    	Dimension 		height;			/* height of this widget */
    	Cardinal		line;			/* starting line number of this object */
    	Widget 			w;				/* Widget ID */
    	Widget			child;			/* child id for scrolled stuff */
    	String 			name;			/* name for this widget */
    	Byte 			type;			/* Widget type (see HTML.h) */
    	int				size;			/* cols in text(field)/items in select */
    	int				maxlength;		/* max chars to enter/rows in textarea */
    	String 			value;			/* default text */
    	String			content;		/* entered text(field) contents */
    	Alignment		align;			/* image/file browse button position */
    	Boolean			multiple;		/* multiple select flag */
    	int				selected;		/* default state */
    	Boolean 		checked;		/* check value for option/radio buttons. */
    	Boolean 		mapped;			/* True when displayed, false otherwise */
    	struct _XmHTMLForm *options;	/* option items for select */
    	struct _XmHTMLObjectTable *data;/* owning data object */
    	struct _XmHTMLFormData *parent;	/* parent form */
    	struct _XmHTMLForm *prev;		/* ptr to previous record */
    	struct _XmHTMLForm *next;		/* ptr to next record */
    }XmHTMLForm;
    
    /*****
    * Definition of form data
    *****/
    typedef struct _XmHTMLFormData{
    	Widget		html;				/* owner of this form					*/
    	Boolean		can_clip;			/* can we perform form clipping?		*/
    	Pixmap		clip;				/* clipmask to use for scrolling		*/
    	int			x;					/* absolute position of top-left corner	*/
    	int			y;					/* absolute position of top-left corner	*/
    	Dimension	width;				/* width of form						*/
    	Dimension	height;				/* height of form						*/
    	String		action;				/* destination url/cgi-bin				*/
    	int			method;				/* XmHTML_FORM_GET,POST,PIPE			*/
    	String		enctype;			/* form encoding						*/
    	int			ncomponents;		/* no of items in this form				*/
    	Widget		fileSB;				/* input == file						*/
    	XmHTMLForm	*components;		/* list of form items					*/
    	struct _XmHTMLFormData *prev;	/* ptr to previous form					*/
    	struct _XmHTMLFormData *next;	/* ptr to next form						*/
    }XmHTMLFormData;
    
    /*****
    * Definition of XmHTML tables
    *
    * Dimensions:
    * positive -> absolute number;
    * negative -> relative number;
    * 0        -> no dimension specified;
    *
    * Each component in a table has a set of core properties. Properties are
    * inherited from top to bottom and can be overriden.
    *
    * Content containers render the contents of all objects between
    * start (inclusive) and end (exclusive).
    *****/
    /* possible framing types */
    typedef enum{
    	TFRAME_VOID = 0,			/* no borders		*/
    	TFRAME_ABOVE,				/* only top side	*/
    	TFRAME_BELOW,				/* only bottom side	*/
    	TFRAME_LEFT,				/* only left side	*/
    	TFRAME_RIGHT,				/* only right side	*/
    	TFRAME_HSIDES,				/* top & bottom		*/
    	TFRAME_VSIDES,				/* left & right		*/
    	TFRAME_BOX,					/* all sides		*/
    	TFRAME_BORDER				/* all sides		*/
    }TableFraming;
    
    /* possible ruling types */
    typedef enum{
    	TRULE_NONE = 0,				/* no rules			*/
    	TRULE_GROUPS,				/* only colgroups	*/
    	TRULE_ROWS,					/* only rows		*/
    	TRULE_COLS,					/* only columns		*/
    	TRULE_ALL					/* all cells		*/
    }TableRuling;
    
    /* cell borders to be rendered */
    #define CELL_TOP	(1<<1)
    #define CELL_LEFT	(1<<2)
    #define CELL_BOTTOM	(1<<3)
    #define CELL_RIGHT	(1<<4)
    #define CELL_BOX	(CELL_TOP|CELL_LEFT|CELL_BOTTOM|CELL_RIGHT)
    #define CELL_NONE	~(CELL_BOX)
    
    /*****
    * Properties shared by all table elements. These are inherited from top to
    * bottom and can be overriden by the appropriate tag attributes.
    *****/
    typedef struct _TableProperties{
    	int				border;				/* border width, 0 = noborder	*/
    	Alignment		halign;				/* content horizontal alignment	*/
    	Alignment		valign;				/* content vertical alignment	*/
    	Pixel			bg;					/* content background color		*/
    	XmHTMLImage		*bg_image;			/* content background image		*/
    	TableFraming	framing;			/* what frame should we use?	*/
    	TableRuling		ruling;				/* what rules should we draw?	*/
    	Boolean			nowrap;				/* don't break lines			*/
    }TableProperties;
    
    /*****
    * a Cell, can be a header cell or a simple cell.
    *****/
    typedef struct _TableCell{
    	Boolean			header;				/* True if a header cell	*/
    	int				width;				/* suggested cell width		*/
    	int				height;				/* suggested cell height	*/
    	int				rowspan;			/* no of rows spanned		*/
    	int				colspan;			/* no of cells spanned		*/
    	TableProperties	*props;				/* properties for this cell	*/
    	Byte			borders;			/* borders to render		*/
    	struct _XmHTMLObjectTable *start;	/* first object to render	*/
    	struct _XmHTMLObjectTable *end;		/* last object to render	*/
    	struct _XmHTMLObjectTable *owner;	/* owning object			*/
    	struct _TableRow *parent;			/* parent of this cell		*/
    }TableCell;
    
    /* A row. A row consists of a number of Cells */
    typedef struct _TableRow{
    	TableCell		*cells;				/* all cells in this row	*/
    	int				ncells;				/* no of cells in row		*/
    	int				lastcell;			/* last used cell			*/
    	TableProperties	*props;				/* properties for this row	*/
    	struct _XmHTMLObjectTable *start;	/* first object to render	*/
    	struct _XmHTMLObjectTable *end;		/* last object to render	*/
    	struct _XmHTMLObjectTable *owner;	/* owning object			*/
    	struct _XmHTMLTable *parent;		/* parent of this row		*/
    }TableRow;
    
    /*****
    * A table. A table consists of a Caption and a number of Rows
    * The caption is a special row: it has only one cell that stretches
    * across the entire table: itself.
    *****/
    typedef struct _XmHTMLTable{
    	/* overall table properties */
    	int				width;				/* suggested table width	*/
    	int				hmargin;			/* horizontal cell margin	*/
    	int				vmargin;			/* vertical cell margin		*/
    	int				hpadding;			/* horizontal cell padding	*/
    	int				vpadding;			/* vertical row padding		*/
    	int				ncols;				/* no of columns			*/
    	TableProperties *props;				/* master table properties	*/
    
    	TableRow		*caption;			/* table caption			*/
    	TableRow		*rows;				/* all table rows			*/
    	int				nrows;				/* no of rows in table		*/
    	int				lastrow;			/* last used row			*/
    
    	struct _XmHTMLTable *parent;		/* parent table (for childs)*/
    	struct _XmHTMLTable *childs;		/* table child				*/
    	int				nchilds;			/* no of child tables		*/
    	int				lastchild;			/* last used table			*/
    
    	struct _XmHTMLObjectTable *start;	/* first object in table	*/
    	struct _XmHTMLObjectTable *end;		/* last object in table		*/
    
    	struct _XmHTMLObjectTable *owner;	/* owner of this table		*/
    
    	struct _XmHTMLTable *next;			/* ptr to next table		*/
    }XmHTMLTable;
    
    /*****
    * Definition of formatted HTML elements
    *****/
    typedef struct _XmHTMLObjectTable{
    	int				x;				/* x position for this element		*/
    	int				y;				/* y position for this element		*/
    	Dimension		width;			/* width of this element			*/
    	Dimension		height;			/* height of this element			*/
    	Cardinal		line;			/* starting line number of this object */
    	Cardinal		id;				/* object identifier (anchors only)	*/
    	ObjectType		object_type;	/* element type						*/
    	String			text;			/* cleaned text						*/
    	Byte			text_data;		/* text/image/anchor data bits		*/
    	int				len;			/* length of text or width of a rule*/
    	int				y_offset;		/* offset for sub/sup, 
    noshade flag */ int x_offset; /* additional offset for sub/sup */ XmHTMLObject *object; /* object data (raw text) */ XmHTMLAnchor *anchor; /* ptr to anchor data */ XmHTMLWord *words; /* words to be displayed */ XmHTMLForm *form; /* form data */ XmHTMLTable *table; /* table data */ int n_words; /* number of words */ Byte anchor_state; /* anchor selection state identifier*/ Alignment halign; /* horizontal line alignment */ int linefeed; /* linebreak type */ Dimension ident; /* xoffset for list indentation */ Marker marker; /* marker to use in lists */ int list_level; /* current count of list element. */ XmHTMLfont *font; /* font to be used for this object */ Pixel fg; /* foreground color for this object */ Pixel bg; /* background color for this object */ struct _XmHTMLObjectTable *next; struct _XmHTMLObjectTable *prev; }XmHTMLObjectTable, *XmHTMLObjectTableElement; /***** * Line lookups *****/ typedef struct{ Boolean used; /* entry is being used */ int y; /* first offset where line occurs */ XmHTMLObjectTable *start; /* first element on line */ XmHTMLObjectTable *end; /* last element on line */ }XmHTMLLineTable; /***** * The following two structures are not yet used by XmHTML. They are intended * to serve as the basis for layered HTML documents (including transparent * layers), progressive document loading and rendering to non-display * devices. *****/ typedef struct _XmHTMLSubDoc{ int x; /* document upper left corner */ int y; /* document upper left corner */ Dimension width; /* width of document */ Dimension height; /* height of document */ Cardinal nlines; /* no of lines occupied by doc */ XmHTMLObject *elements; /* list of raw objects */ XmHTMLObjectTable *start; /* first element in document */ XmHTMLObjectTable *end; /* last element in document */ struct sd_funcs{ void (*parse)(); /* subdoc parser function */ void (*format)(); /* subdoc formatter function */ void (*layout)(); /* subdoc layout function */ void (*paint)(); /* subdoc paint function */ }sd; struct _XmHTMLSubDoc *child; /* child documents */ struct _XmHTMLSubDoc *prev; /* ptr to previous document */ struct _XmHTMLSubDoc *next; /* ptr to next document */ struct _ToolkitAbstraction *tka; }XmHTMLSubDoc; #define LAY_SCROLLABLE (1<<1) /* layer is scrollable */ #define LAY_FIXED (1<<2) /* layer has fixed position */ #define LAY_FIXED_REL (1<<3) /* layer fixed to position in doc */ #define LAY_VISIBLE (1<<4) /* layer is visible */ #define LAY_RAISE (1<<5) /* layer can be raised */ #define LAY_LOWER (1<<6) /* layer can be lowered */ #define LAY_SEND_EVENTS (1<<7) /* layer can send events */ #define LAY_RECV_EVENTS (1<<8) /* layer can receive events */ #define LAY_BG_IMAGE (1<<9) /* layer has background image */ #define LAY_BG_COLOR (1<<10) /* layer has background color */ #define LAY_TRANSPARENT (1<<11) /* layer is transparent */ #define LAY_WINDOW (1<<12) /* layer has got a window */ #define LAY_INPUT_OUTPUT (1<<13) /* layer can do input and output */ #define LAY_INPUT_ONLY (1<<14) /* layer can only accept input */ #define LAY_OUTPUT_ONLY (1<<15) /* layer can only do output */ typedef struct _XmHTMLLayer{ struct _XmHTMLLayer *self; /* ptr to self */ int x; /* layer upper left corner */ int y; /* layer upper left corner */ Dimension width; /* width of layer */ Dimension height; /* height of layer */ unsigned long flags; /* layer flags */ unsigned long state; /* current layer flags */ Byte zpos; /* layer stacking position */ XmHTMLImage *background; /* background image */ Pixel bg; /* background color */ Pixmap mask; /* transparency mask */ Window window; /* layer's window */ XmHTMLSubDoc *subdoc; /* layer document */ struct l_funcs{ void (*send_event)(); /* layer send-event function */ void (*read_event)(); /* layer read-event function */ void (*pass_event)(); /* layer event passing function */ void (*refresh)(); /* layer refresh function */ void (*raise)(); /* layer raise function */ void (*lower)(); /* layer lower function */ void (*scroll)(); /* layer scroll function */ void (*map)(); /* layer map function */ void (*unmap)(); /* layer unmap function */ }lf; struct _XmHTMLLayer *parent; /* parent of this layer */ struct _XmHTMLLayer *upper; /* layer on top of this layer */ struct _XmHTMLLayer *lower; /* layer below this layer */ struct _XmHTMLLayer *prev; /* ptr to previous layer */ struct _XmHTMLLayer *next; /* ptr to next layer */ }XmHTMLLayer; /***** * A stripped down array of all words that are searchable. Contains enough * information to search for text and provide information about the * selection that should be made to display the text found. *****/ struct _XmHTMLSearchableWord{ String word; /* word to display */ int len; /* string length of word */ Byte spacing; /* leading/trailing/nospace allowed */ XmHTMLObjectTable *owner; /* owner of this word */ int word_idx; /* index of word in owner word array */ }; /***** * definition of frame childs *****/ typedef struct _XmHTMLFrameWidget{ int x; /* computed frame x-position */ int y; /* computed frame y-position */ Dimension width; /* computed frame width */ Dimension height; /* computed frame height */ Dimension size_s; /* saved frame size */ FrameSize size_type; /* horizontal frame size specification */ FrameScrolling scroll_type; /* frame scrolling */ String src; /* source document */ String name; /* internal frame name */ Dimension margin_width; /* frame margin width */ Dimension margin_height; /* frame margin height */ Boolean resize; /* may we resize this frame? */ int border; /* add a border around this frame? */ Widget frame; /* XmHTMLWidget id for this frame */ /* Frame resizing */ int drag_x; /* Amount dragged in x-direction */ int drag_y; /* Amount dragged in y-direction */ /* Added June 11 by Eric Bello */ Boolean is_frameset; /* true frame or frameset? */ struct _XmHTMLFrameWidget *frameset; /* parent frameset, if any */ struct _XmHTMLFrameWidget *next; /* next frame child, if any */ struct _XmHTMLFrameWidget *prev; /* prev. frame child, if any */ struct _XmHTMLFrameWidget *children; /* list of frames */ FramesetLayout layout; /* frameset layout policy */ }XmHTMLFrameWidget; /***** * Definition of page keywords *****/ typedef struct _XmHTMLPageData{ XmHTMLObject *data; /* page contents */ /* display data */ String window; /* display type */ String title; /* page title */ /* index generation */ int id; /* id of current page */ int depth; /* toc depth */ String name; /* name of current page */ Boolean noindex; /* skip for index generation*/ /* Search data */ Boolean nosearch; /* skip from searching */ String keywords; /* searchable keywords */ String desc; /* page description */ /* References */ int next_id; /* id of next page */ int prev_id; /* id of previous page */ int *seealso; /* list of related pages */ struct _XmHTMLPageData *children; /* page children */ struct _XmHTMLPageData *next; /* next page */ struct _XmHTMLPageData *prev; /* previous page */ }XmHTMLPageHeader; /***** * Definition of a Page *****/ typedef struct _XmHTMLPage{ XmHTMLObject *start; /* first object in page */ XmHTMLObject *end; /* last object in page */ int page_no; /* page number */ Boolean redo_layout; /* needs reformatting */ Boolean input_complete; /* True when input was completed */ /* anchor colors */ Pixel anchor_fg; Pixel anchor_visited_fg; Pixel anchor_target_fg; Pixel anchor_activated_fg; Pixel anchor_activated_bg; /* background image/color and text color resources */ Pixel body_bg; /* current background color */ Pixel body_fg; /* current foreground color */ String body_image_url; /* background image location */ XmHTMLImage *body_image; /* background image data */ /* Formatted document resources */ int formatted_width; /* total width of document */ int formatted_height; /* total height of document */ int num_named_anchors; /* total no of named anchors */ int anchor_words; /* total no of anchor words */ XmHTMLWord *anchors; /* for quick anchor lookup */ XmHTMLObjectTable *named_anchors; /* for quick named anchor lookup */ XmHTMLAnchor *anchor_data; /* parsed anchor data */ XmHTMLObjectTable *formatted; /* display object data */ Cardinal top_line; /* current topline */ Cardinal nlines; /* no of lines in document */ /* Table resources */ XmHTMLTable *tables; /* list of all tables */ /* HTML Form resources */ XmHTMLFormData *form_data; /* all forms in the current document */ /* All images */ XmHTMLImage *images; /* list of images in current doc */ }XmHTMLPage; /***** * Parser state stack object *****/ typedef struct _stateStack{ htmlEnum id; /* current state id */ struct _stateStack *next; /* ptr to next record */ }stateStack; /***** * Progressive Loading Context. This is an opaque object fully defined in * plc.h. It's a rather complex thing for all objects than can be loaded * progressively. It maintains the state of each object (data as well as data * processing functions) and does a bunch of nifty things. *****/ typedef struct _PLC *PLCPtr; /***** * This struct is required to properly perform alpha channel processing. * It contains information about the current background setting. * * Alpha channel processing is done for PNG images with (obviously) an alpha * channel. The data used for creating the pixmap is a merger of the original * image data with the current background setting (fixed color or an image). * When a document with such an image contains a background image, XmHTML needs * to redo this alpha processing whenever the document layout is changed: the * exact result of this merger depends on the position of the image. This can * be a rather slow process (alpha channels require floating point ops), and * by at least storing the current background info we can achieve some * performance increase. *****/ typedef struct _AlphaChannelInfo{ int fb_maxsample; /* frame buffer maximum sample value */ int background[3]; /* solid background color: R, G, B */ int ncolors; /* size of background image colormap */ XColor *bg_cmap; /* background image colormap */ }AlphaChannelInfo, *AlphaPtr; /***** * HTML Parser data *****/ typedef struct _Parser{ String source; /* text being parsed */ int index; /* last known position */ int len; /* length of input text */ int num_lines; /* current line count */ Dimension line_len; /* maximum line length so far */ Dimension cnt; /* current line length */ void (*store_text)( #ifdef NeedFunctionPrototypes struct _Parser *parser, char *start, char *end #endif ); /* text insertion function */ /* running list of inserted elements */ int num_elements; /* no of tags inserted so far */ int num_text; /* no of text elements inserted so far */ XmHTMLObject *head; /* head of object list */ XmHTMLObject *current; /* lastly inserted element */ XmHTMLObject *last; /* last valid element (progressive mode)*/ stateStack state_base; /* stack base point */ stateStack *state_stack; /* actual stack */ int cstart; /* current element start position */ int cend; /* current element end position */ int inserted; /* no of auto-inserted chars */ Cardinal err_count; /* no of errors so far */ Cardinal loop_count; /* no of loops made so far */ Boolean strict_checking; /* HTML 3.2 looseness flag */ Boolean have_body; /* indicates presence of tag */ Boolean have_page; /* indicates presence of tag */ Byte warn; /* warn about bad html constructs */ Boolean bad_html; /* bad HTML document flag */ Boolean html32; /* HTML32 conforming document flag */ Boolean automatic; /* when in automatic mode */ Boolean do_icons; /* check for icon entities? */ Widget widget; /* for the warning messages */ }Parser; /***** * XmHTMLPart definition *****/ typedef struct _XmHTMLPart { /* Original document Resources */ String value; /* raw HTML text, copied to the parser */ String source; /* copy used by XmHTML */ String mime_type; /* mime type of this text/image (?) */ Byte mime_id; /* internal mime id */ Boolean input_complete; /* True when input was completed */ /* Anchor resources */ Cursor anchor_cursor; Boolean anchor_display_cursor; Boolean anchor_buttons; /* anchor colors */ Pixel anchor_fg; Pixel anchor_visited_fg; Pixel anchor_target_fg; Pixel anchor_activated_fg; Pixel anchor_activated_bg; Boolean highlight_on_enter; /* anchor highlighting */ /* anchor underlining styles */ Byte anchor_underline_type; Byte anchor_visited_underline_type; Byte anchor_target_underline_type; /* internal underlining styles, translated from above */ Byte anchor_line; Byte anchor_target_line; Byte anchor_visited_line; Position anchor_position_x; /* for server-side imagemaps */ Position anchor_position_y; /* for server-side imagemaps */ XmHTMLObjectTable *armed_anchor; /* current anchor */ XmHTMLAnchor *anchor_current_cursor_element; XmHTMLAnchorProc anchor_visited_proc; /* background image/color and text color resources */ Boolean body_colors_enabled; Boolean body_images_enabled; Boolean allow_color_switching; Boolean allow_form_coloring; /* body colors on HTML forms */ Boolean freeze_animations; Boolean icon_entities_enabled; Byte icon_valign; Pixel body_bg; /* current background color */ Pixel body_fg; /* current foreground color */ String body_image_url; /* background image location */ String def_body_image_url; /* default bg image location */ XmHTMLImage *body_image; /* background image data */ GC bg_gc; /* background render gc */ /* Font resources */ String charset; String font_family; String font_family_fixed; String font_sizes; String font_sizes_fixed; XmHTMLfont *default_font; Byte string_direction; Byte alignment; Alignment default_halign; Boolean allow_font_switching; int tabwidth; int res_x; int res_y; /* Image resources */ Boolean images_enabled; /* True -> show images */ int max_image_colors; /* 0 -> as much as possible */ float screen_gamma; /* gamma correction for this display */ XmImageProc image_proc; /* external image loader */ XmImageGifProc gif_proc; /* external gif decoder */ String zCmd; /* uncompress command for LZWStream */ XmHTMLImage *images; /* list of images in current doc */ Boolean delayed_creation; /* delayed image creation */ XCC xcc; /* a lot of visual info */ Byte map_to_palette; /* if and how to map to palette */ String palette; /* palette to use */ /* Imagemap resources */ XmHTMLImageMap *image_maps; /* array of client-side imagemaps */ Pixel imagemap_fg; /* bounding box color */ Boolean imagemap_draw; /* draw imagemap bounding boxes */ /* Frame resources */ Boolean is_frame; /* true when this is a frame */ FrameScrolling scroll_type; /* frame scrolling */ int frame_border; /* add a border to the frames? */ int nframes; /* no of frames managed */ XmHTMLFrameWidget **frames; /* list of frame childs */ /* Document resources */ Boolean strict_checking; Boolean enable_outlining; Byte bad_html_warnings; XtPointer client_data; /* client_data for functional res. */ /* Private Resources */ Dimension margin_width; /* document margins */ Dimension margin_height; Widget work_area; /* render area */ Dimension work_width; /* render area dimensions */ Dimension work_height; Boolean resize_height; /* True -> autosize vertically */ Boolean resize_width; /* True -> autosize horizontally */ /* Progressive Loader Context buffer and interval */ PLCPtr plc_buffer; /* PLC ringbuffer */ int num_plcs; /* no of PLC's in ringbuffer */ int plc_def_delay; /* default PLC timeout delay */ int plc_delay; /* PLC timeout delay */ int plc_min_delay; /* PLC minimum timeout delay */ int plc_max_delay; /* PLC maximum timeout delay */ XtIntervalId plc_proc_id; /* timer id for main plc cycler */ XmHTMLGetDataProc get_data; /* PLC data request function */ XmHTMLEndDataProc end_data; /* PLC end signal function */ Boolean plc_suspended; /* Global PLC suspension flag */ GC plc_gc; /* gc used by all plc's */ Byte load_type; /* current loading method */ /* perform final dithering pass/use image colors */ Byte perfect_colors; /* Internal stuff for alpha channelled PNG images */ AlphaPtr alpha_buffer; Byte rgb_conv_mode; /* 24 to 8bit conversion method */ Byte alpha_processing; /* do alpha channel stuff? */ /* * Fallback colors, required for proper color resetting between documents * with and without a color spec. */ Pixel anchor_fg_save; Pixel anchor_visited_fg_save; Pixel anchor_target_fg_save; Pixel anchor_activated_fg_save; Pixel anchor_activated_bg_save; Pixel body_bg_save; Pixel body_fg_save; /* Scrollbar resources */ Widget hsb; /* vertical scrollbar widget id */ Widget vsb; /* horizontal scrollbar widget id */ Byte sb_policy; /* scrollbar display policy */ Byte sb_placement; /* scrollbar placement policy */ int scroll_x; /* current horizontal position */ int scroll_y; /* current vertical position */ Boolean needs_hsb; /* True -> hsb required */ Boolean needs_vsb; /* True -> vsb required */ /* Callback resources */ XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList anchor_track_callback; XtCallbackList frame_callback; XtCallbackList form_callback; XtCallbackList input_callback; XtCallbackList link_callback; XtCallbackList motion_track_callback; XtCallbackList imagemap_callback; XtCallbackList document_callback; XtCallbackList focus_callback; XtCallbackList losing_focus_callback; XtCallbackList event_callback; XtCallbackList object_callback; XtCallbackList page_callback; Boolean need_tracking; /* serve mouse/focus tracking? */ XmHTMLEventProc event_proc; /* HTML4.0 event processing proc */ HTEvent **events; /* HTML4.0 event data */ int nevents; /* no of events watched */ unsigned long event_mask; /* Body events */ AllEvents *body_events; /* Body events: onLoad/unLoad */ XmHTMLScriptProc script_proc; /* contents */ }XmHTMLHeadAttributes; /***** * XmHTMLFontCacheInfo definition. This structure is returned by the * XmHTMLGetFontCacheInfo convenience routine and contains information about * the font cache bound to the display of a given widget. * The fonts and mapping arrays are in sync: when a name in the fonts array * has a non-NULL entry at the corresponding position in the mapping array, * the value of the mapping entry is the real font being used. *****/ typedef struct{ int nentries; /* total no of cached fonts */ int nmaps; /* of which this many are mapped fonts */ int nlookups; /* no of search actions */ int nrequests; /* no of requests made */ int hits; /* no of hits */ int misses; /* no of misses */ String *fonts; /* array of font names, size nentries */ String *mapping; /* array of font mappings, size nentries */ int nwidgets; /* no of widgets using this cache */ GdkWidget **widgets; /* array of widgets */ }XmHTMLFontCacheInfo; /***** * forward declaration of XmHTMLAnchorCallback structure *****/ typedef struct _XmHTMLAnchorCallbackStruct *XmHTMLAnchorPtr; /***** * XmHTMLXYToInfo return value * This structure and any of it members may *never* be freed by the caller. *****/ typedef struct { Cardinal line; /* line number at selected position */ Boolean is_map; /* true when clicked image is an imagemap */ int x,y; /* position relative to image corner */ XmImageInfo *image; /* image data */ XmHTMLAnchorPtr anchor; /* possible anchor data */ }XmHTMLInfoStructure, *XmHTMLInfoPtr; /***** * XmHTML progressive object loading * (PLC stands for Progressive Loader Context) *****/ typedef struct _XmHTMLPLCStream{ Cardinal total_in; /* no of bytes received so far */ Cardinal min_out; /* minimum number of bytes requested */ Cardinal max_out; /* maximum number of bytes requested */ gpointer user_data; /* any data registered on this PLC */ unsigned char pad[24]; /* reserved for future use */ }XmHTMLPLCStream; /***** * External GIF decoder stream object. This is the only argument to any * procedure installed on the XmNdecodeGIFProc resource. * * The first block is kept up to date by XmHTML and is read-only. When state * is GIF_STREAM_INIT, the decoder should initialize it's private data and store * it in the external_state field so that it can be used for successive calls * to the decoder. When state is GIF_STREAM_FINAL, the decoder should wrapup * and flush all pending data. It can also choose to destruct it's internal * data structures here (another call with state set to GIF_STREAM_END will be * made when the internal loader is destroying it's internal objects as * well). * * All following fields are the ``public'' fields and must be updated by the * external decoder. The msg field can be set to an error message if the * external decoder fails for some reason. XmHTML will then display this * error message and abort this image. *****/ typedef struct _XmHTMLGIFStream{ /* read-only fields */ int state; /* decoder state */ int codesize; /* initial LZW codesize */ Boolean is_progressive; /* when used by a progressive loader */ unsigned char *next_in; /* next input byte */ Cardinal avail_in; /* number of bytes available at next_in */ Cardinal total_in; /* total nb of input bytes read so far */ /* fields to be updated by caller */ unsigned char *next_out; /* next output byte should be put there */ Cardinal avail_out; /* remaining free space at next_out */ Cardinal total_out; /* total nb of bytes output so far */ String msg; /* last error message, or NULL */ gpointer external_state; /* room for decoder-specific data */ }XmHTMLGIFStream; /* and the proto for the XmNdecodeGIFProc resource */ typedef int (*XmImageGifProc)(XmHTMLGIFStream*); /***** * Progressive Loading function prototypes. * XmHTMLGetDataProc: proto for function installed on the * XmNprogressiveReadProc resource; * XmHTMLEndDataProc: proto for function installed on the * XmNprogressiveEndProc resource; *****/ typedef int (*XmHTMLGetDataProc)(XmHTMLPLCStream*, gpointer); typedef void (*XmHTMLEndDataProc)(XmHTMLPLCStream*, gpointer, int, Boolean); /***** * possible values for the third argument on the EndDataProc *****/ enum{ /* XmHTML_NONE = 0 */ /* PLCObject referenced by all objects */ XmPLC_IMAGE, /* PLCObject for an image */ XmPLC_DOCUMENT, /* PLCObject for a document */ XmPLC_FINISHED /* indicates all plc's have been processed */ }; /***** * XmImage configuration *****/ typedef struct{ unsigned long flags; /* XmImage configuration flags, see above */ int ncolors; /* desired number of colors */ int which_frames; /* animation frames selection flag */ int bg_color; /* background pixel on transparent images */ String z_cmd; /* gif uncompress command */ XmImageGifProc gif_proc; /* external gif decoder */ float gamma; /* gamma correction. JPEG and PNG only */ }XmImageConfig; /****************************************************************************** * Callback structures * Unless explicitly mentioned, *none* of these structures (or any of its * members) may be freed. ******************************************************************************/ /***** * XmAnyCallbackStruct *****/ typedef struct _XmAnyCallbackStruct{ int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ }XmAnyCallbackStruct, gtk_xmhtml_callback_info; /***** * XmNactivateCallback and XmNanchorTrackCallback callback structure. *****/ typedef struct _XmHTMLAnchorCallbackStruct{ int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ URLType url_type; /* type of url referenced */ Cardinal line; /* line number of the selected anchor */ String href; /* pointer to the anchor value */ String target; /* pointer to target value */ String rel; /* pointer to rel value */ String rev; /* pointer to rev value */ String title; /* pointer to title value */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* local anchor vetoing flag */ Boolean visited; /* local anchor visited flag */ }XmHTMLAnchorCallbackStruct; typedef Boolean (*XmHTMLAnchorProc)(GtkXmHTML*, String, gpointer); /***** * XmNeventCallback callback structure. *****/ typedef struct{ int reason; /* the reason the event was called */ GdkEvent *event; /* event triggering this action */ int type; /* HTML4.0 event type, see above */ gpointer data; /* HTML4.0 event callback data */ }XmHTMLEventCallbackStruct; /***** * XmNdocumentCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ GdkEvent *event; /* always NULL for XmNdocumentCallback */ Boolean html32; /* True if document was HTML 3.2 conforming */ Boolean verified; /* True if document has been verified */ Boolean balanced; /* True if parser tree is balanced */ Boolean terminated; /* True if parser terminated prematurely */ int pass_level; /* current parser level count. Starts at 1 */ Boolean redo; /* perform another pass? */ }XmHTMLDocumentCallbackStruct, *XmHTMLDocumentPtr; /***** * XmNformCallback callback structure. *****/ /***** * Form Component data *****/ typedef struct { componentType type; /* Form component type */ String name; /* component name */ String value; /* component value */ }XmHTMLFormDataRec, *XmHTMLFormDataPtr; /***** * Actual XmNformCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ String action; /* URL or cgi-bin destination */ String enctype; /* form encoding */ int method; /* Form Method, GET, POST or PIPE */ int ncomponents; /* no of components in this form */ XmHTMLFormDataPtr components; }XmHTMLFormCallbackStruct, *XmHTMLFormPtr; /***** * XmNframeCallback callback structure. * This callback is activated when one of the following events occurs: * 1. XmHTML wants to create a frame, reason = XmCR_HTML_FRAMECREATE * can be veto'd by setting doit to False and supplying a HTML widget * id yourself; * 2. XmHTML wants to destroy a frame, reason = XmCR_HTML_FRAMEDESTROY * can be veto'd by setting doit to False (widget reuse). * 3. XmHTML has finished creating a frame, reason = XmCR_HTML_FRAME. * This is the time to attach callbacks and set additional resources on the * newly created XmHTMLWidget. *****/ typedef struct { int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ String src; /* requested document */ String name; /* frame name */ GtkXmHTML* html; /* XmHTML widget id */ Boolean doit; /* destroy/create vetoing flag */ }XmHTMLFrameCallbackStruct, *XmHTMLFramePtr; /***** * XmNimagemapCallback callback structure. * callback reasons can be one of the following: * XmCR_HTML_IMAGEMAP_ACTIVATE * user clicked on an image. Valid fields are x, y and image_name. x and y * are relative to the upper-left corner of the image. Only invoked when * an image has it's ismap attribute set and no usemap is present for this * image. * XmCR_HTML_IMAGEMAP * an image requires an external imagemap. The only valid field is map_name * which contains the location of the imagemap to fetch. If the contents * of this imagemap is set in the map_contents field, it will be loaded * by the widget. Alternatively, one could also use the XmHTMLAddImagemap * convenience routine to set an imagemap into the widget. *****/ typedef struct { int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ int x,y; /* position relative to the upper-left image corner */ String image_name; /* name of referenced image, value of src attribute */ String map_name; /* name of imagemap to fetch */ String map_contents;/* contents of fetched imagemap */ XmImageInfo *image; /* image data */ }XmHTMLImagemapCallbackStruct, *XmHTMLImagemapPtr; /***** * XmNlinkCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ GdkEvent *event; /* event structure that triggered callback */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ }XmHTMLLinkCallbackStruct, *XmHTMLLinkPtr; /* Don't add anything after this endif! */ #endif /* _gtk_html_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/gtk-xmhtml-p.h100644 23564 23564 113541 6651102145 17372 0ustar newtnewt/***** * gtk-xmhtml-p.h : XmHTML Private Header file for the Gtk toolkit * * This file Version $Revision: 1.8 $ * * Creation date: Tue Jan 13 19:29:30 GMT+0100 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: newt * * Copyright (C) 1994-1998 by 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$ *****/ /***** * ChangeLog * $Log: XmHTMLP.h,v $ * Revision 1.8 1998/01/07 01:45:36 unammx * Gtk/XmHTML is ready to be used by the Gnome hackers now! * Weeeeeee! * * This afternoon: * * - Changes to integrate gtk-xmhtml into an autoconf setup. * * - Changes to make gtk-xmhtml a library to be used by Gnome * (simply include /* property defines */ /* Required includes */ #include #include /***** * NEVER define VERSION *or* _LIBRARY yourself. These are defines required * for compiling the library. When defined, they pull in a number of other * header files which are normally *not* installed. *****/ #ifdef GNOME_LIB # ifndef VERSION # define VERSION # endif #endif #ifdef VERSION # ifndef _LIBRARY # define _LIBRARY # endif #endif/* VERSION */ /***** * prevent multiple decls when building the lib. * zconf.h (which gets included by png.h) also typedefs Byte to unsigned char. * The compiler warning is annoying, so just don't typedef it again. * XCC is an opaque object defined in XCCP.h *****/ #ifdef _LIBRARY typedef GdkColorContext *XCC; # ifdef _ZCONF_H # ifndef BYTE_ALREADY_TYPEDEFED # define BYTE_ALREADY_TYPEDEFED # endif /* BYTE_ALREADY_TYPEDEFED */ # endif /* _ZCONF_H */ #else typedef struct _GdkColorContext *XCC; #endif /* _LIBRARY */ #ifndef BYTE_ALREADY_TYPEDEFED #define BYTE_ALREADY_TYPEDEFED typedef unsigned char Byte; #endif /* BYTE_ALREADY_TYPEDEFED */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /***** * A whole slew of states for all kinds of internal objects. *****/ /***** * Line styles *****/ #define LINE_SOLID (1<<1) /* paint a solid line */ #define LINE_DASHED (1<<2) /* paint a dashed line */ #define LINE_SINGLE (1<<3) /* paint a single line */ #define LINE_DOUBLE (1<<4) /* paint a double line */ #define LINE_STRIKE (1<<5) /* render as strikeout */ #define LINE_UNDER (1<<6) /* render as underline */ #define NO_LINE 0 /* no lines at all */ /***** * Spacing and anchor text data bits *****/ #define TEXT_SPACE_NONE (1<<0) /* no spacing at all */ #define TEXT_SPACE_LEAD (1<<1) /* add a leading space */ #define TEXT_SPACE_TRAIL (1<<2) /* add a trailing space */ #define TEXT_ANCHOR (1<<3) /* a regular anchor */ #define TEXT_ANCHOR_INTERN (1<<4) /* internal anchor flag */ #define TEXT_IMAGE (1<<5) /* indicates an image member */ #define TEXT_FORM (1<<6) /* indicates a form member */ #define TEXT_BREAK (1<<7) /* indicates a linebreak */ /***** * HTML list marker enumeration type *****/ typedef enum{ XmMARKER_NONE = 0, XmMARKER_ARABIC = 10, XmMARKER_ALPHA_LOWER, XmMARKER_ALPHA_UPPER, XmMARKER_ROMAN_LOWER, XmMARKER_ROMAN_UPPER, XmMARKER_DISC = 15, XmMARKER_SQUARE, XmMARKER_CIRCLE }Marker; /***** * Horizontal/Vertical alignment data *****/ typedef enum{ XmHALIGN_NONE = 0, /* horizontal alignment */ XmHALIGN_LEFT, XmHALIGN_CENTER, XmHALIGN_RIGHT, XmHALIGN_JUSTIFY, /* extension for fully justified text */ XmVALIGN_NONE = 8, /* vertical alignment */ XmVALIGN_TOP, XmVALIGN_MIDDLE, XmVALIGN_BOTTOM, XmVALIGN_BASELINE }Alignment; /***** * Possible types of HTML objects. * All text types are only used when computing the screen layout *****/ typedef enum{ OBJ_NONE = 0, OBJ_TEXT, /* text element */ OBJ_PRE_TEXT, /* preformatted text */ OBJ_BULLET, /* all types of markers for lists */ OBJ_HRULE, /* horizontal rule */ OBJ_TABLE, /* table elements */ OBJ_TABLE_FRAME, /* table caption, row, cell elements */ OBJ_IMG, /* image elements */ OBJ_FORM, /* form elements */ OBJ_APPLET, /* applet elements */ OBJ_BLOCK /* other block level elements */ }ObjectType; /***** * linefeed types *****/ #define CLEAR_NONE -1 /* stay on the same line */ #define CLEAR_SOFT 0 /* return + move single line downard */ #define CLEAR_HARD 1 /* return + move two lines downward */ #define CLEAR_ALL 2 /* return + move baseline fully down */ /***** * Server/client side and map type values *****/ typedef enum{ XmMAP_NONE = 1, XmMAP_SERVER, XmMAP_CLIENT }Imagemap; /***** * Image option bits. * Each of these bits represents certain state information about an image. *****/ #define IMG_ISBACKGROUND (1L<<1) /* is a background image */ #define IMG_ISINTERNAL (1L<<2) /* is an internal image */ #define IMG_ISCOPY (1L<<3) /* is a referential copy */ #define IMG_ISANIM (1L<<4) /* is an animation */ #define IMG_FRAMEREFRESH (1L<<5) /* set when running an animation */ #define IMG_HASDIMENSIONS (1L<<6) /* dimensions are given in */ #define IMG_HASSTATE (1L<<7) /* current state pixmap present */ #define IMG_INFOFREED (1L<<8) /* imageinfo has been freed */ #define IMG_DELAYED_CREATION (1L<<9) /* create when needed */ #define IMG_ORPHANED (1L<<10)/* indicates orphaned image */ #define IMG_PROGRESSIVE (1L<<11)/* indicates image is being loaded */ /***** * Possible colorclass an image can have. *****/ #define COLOR_CLASS_GRAYSCALE 0 #define COLOR_CLASS_INDEXED 1 #define COLOR_CLASS_RGB 2 /***** * What type of scrolling a frame should employ. *****/ typedef enum{ FRAME_SCROLL_NONE = 1, FRAME_SCROLL_AUTO, FRAME_SCROLL_YES }FrameScrolling; /***** * Possible types of frame sizes *****/ typedef enum{ FRAME_SIZE_FIXED = 1, /* size specified in pixels */ FRAME_SIZE_RELATIVE, /* size is relative */ FRAME_SIZE_OPTIONAL /* size is optional */ }FrameSize; /***** * The three possible anchor selection states *****/ #define ANCHOR_UNSELECTED (Byte)0 /* default anchor state */ #define ANCHOR_INSELECT (Byte)1 /* anchor is gaining selection */ #define ANCHOR_SELECTED (Byte)2 /* anchor is selected */ /***** * XmHTML font style bits *****/ #define FONT_BOLD (1<<1) #define FONT_MEDIUM (1<<2) #define FONT_ITALIC (1<<3) #define FONT_REGULAR (1<<4) #define FONT_FIXED (1<<5) #define FONT_SCALABLE (1<<6) /***** * A XmHTML font. XmHTML uses it's own font definition for performance * reasons (the layout routines use a *lot* of font properties). *****/ typedef struct{ Byte style; /* this font's style */ String font_name; /* full XLFD */ String font_family; /* fontFamily (foundry-family-sw-spacing) */ GdkFont *xfont; /* ptr to font definition */ int height; /* height of largest character */ int lineheight; /* suggested lineheight */ Cardinal isp; /* normal interword spacing */ Cardinal eol_sp; /* additional end-of-line spacing */ int sup_xoffset; /* additional superscript x-offset */ int sup_yoffset; /* additional superscript y-offset */ int sub_xoffset; /* additional subscript x-offset */ int sub_yoffset; /* additional subscript y-offset */ int ul_offset; /* additional underline offset */ Cardinal ul_thickness; /* underline thickness */ int st_offset; /* additional strikeout offset */ Cardinal st_thickness; /* strikeout thickness */ }XmHTMLfont; /********** ****** Definition of all possible Objects **********/ /***** * HTML4.0 Events *****/ typedef struct _HTEvent{ int type; /* HTML4.0 event type */ gpointer data; /* event user data */ }HTEvent; /***** * All possible events that HTML4.0 defines * All fields are ptrs into XmHTML HTEvent array. *****/ typedef struct _AllEvents{ /* Document/Frame specific events */ HTEvent *onLoad; HTEvent *onUnload; /* HTML Form specific events */ HTEvent *onSubmit; HTEvent *onReset; HTEvent *onFocus; HTEvent *onBlur; HTEvent *onSelect; HTEvent *onChange; /* object events */ HTEvent *onClick; HTEvent *onDblClick; HTEvent *onMouseDown; HTEvent *onMouseUp; HTEvent *onMouseOver; HTEvent *onMouseMove; HTEvent *onMouseOut; HTEvent *onKeyPress; HTEvent *onKeyDown; HTEvent *onKeyUp; }AllEvents; /***** * Definition of an anchor * URLType is an enumeration type defined in HTML.h *****/ typedef struct _XmHTMLAnchor{ URLType url_type; /* url type of anchor */ String name; /* name if it's a named anchor */ String href; /* referenced URL */ String target; /* target spec */ String rel; /* possible rel */ String rev; /* possible rev */ String title; /* possible title */ AllEvents *events; /* events to be served */ Cardinal line; /* location of this anchor */ Boolean visited; /* true when anchor is visited */ struct _XmHTMLAnchor *next; /* ptr to next anchor */ }XmHTMLAnchor; /***** * Definition of a word (a word can be plain text, an image, a form member * or a linebreak). *****/ typedef struct _XmHTMLWord{ int x; /* x-position for this word */ int y; /* y-position for this word */ Dimension width; /* pixel width of word */ Dimension height; /* pixel height of word */ Cardinal line; /* line for this word */ ObjectType type; /* type of word, used by
    ,	*/
    	String 				word;		/* word to display						*/
    	int 				len;		/* string length of word				*/
    	XmHTMLfont	 		*font;		/* font to use							*/
    	Byte 				line_data;	/* line data (underline/strikeout)		*/
    	Byte				spacing;	/* leading/trailing/nospace allowed		*/
    	AllEvents			*events;	/* events to be served					*/
    	struct _XmHTMLImage *image;		/* when this is an image				*/
    	struct _XmHTMLForm	*form;		/* when this is a form element			*/
    	struct _XmHTMLWord	*base;		/* baseline word for a line				*/
    	struct _XmHTMLWord	*self; 		/* ptr to itself, for anchor adjustment	*/
    	struct _XmHTMLObjectTable *owner;	/* owner of this worddata			*/
    }XmHTMLWord;
    
    /* area definition. See map.c for the full definition */
    typedef struct _mapArea mapArea;
    
    /*****
    * Client-side imagemap information
    * mapArea is a transparent object and is defined in map.c
    *****/
    typedef struct _XmHTMLImageMap{
    	String				name;		/* name of map			*/
    	int					nareas;		/* no of areas			*/
    	mapArea				*areas;		/* list of areas		*/
    	struct _XmHTMLImageMap *next;	/* ptr to next imagemap */
    }XmHTMLImageMap;
    
    /*****
    * XmHTML's internal image format.
    * One very important thing to note is that the meaning of the (width,height)
    * and (swidth,sheight) members of this structure is exactly *OPPOSITE* to
    * the members with the same name in the public structures (XmImageInfo and
    * XmImage).
    *****/
    typedef struct _XmHTMLImage{
    	/* Normal image data */
    	Byte			magic;			/* structure identifier */
    	String			url;			/* raw src specification */
    	XmImageInfo		*html_image;	/* local image data */
    	GdkPixmap		*pixmap;		/* actual image */
    	GdkPixmap		*clip;			/* for transparant pixmaps */
    	unsigned long	options;		/* image option bits */
    	int				width;			/* resulting image width */
    	int				height;			/* resulting image height */
    	int				npixels;		/* no of allocated pixels */
    	XCC             xcc;			/* a lot of visual info */
    
    	/* Possible  attributes */
    	int				swidth;			/* requested image width */
    	int				sheight;		/* requested image height */
    	String			alt;			/* alternative image text */
    	Alignment		align;			/* image alignment */
    	Imagemap		map_type;		/* type of map to use */
    	String			map_url;		/* image map url/name */
    	Dimension		border;			/* image border thickness */
    	Dimension		hspace;			/* horizontal spacing */
    	Dimension		vspace;			/* vertical spacing */
    
    	struct _XmHTMLObjectTable *owner;	/* owner of this image */
    	struct _XmHTMLImage *child;		/* ptr to copies of this image */
    	struct _XmHTMLImage *next;		/* ptr to next image */
    
    	/* animation data */
    	XmImageFrame 	*frames;		/* array of animation frames */
    	int				nframes;		/* no of frames following */
    	int				current_frame;	/* current frame count */
    	int				current_loop;	/* current loop count */
    	int				loop_count;		/* maximum loop count */
    	gint			proc_id;		/* timer id for animations */
    	XmHTMLWidget	html;			/* image owner */
    	GdkAppContext	context;		/* Application context for animations */
     
     	/* other data */
    	AllEvents			*events;	/* events to be served */
    }XmHTMLImage;
    
    /*****
    * The following structure is used to mimic file access in memory.
    *****/
    typedef struct{
    	char *file;					/* name of file */
    	Byte *buffer;				/* memory buffer */
    	Byte *curr_pos;				/* current position in buffer */
    	size_t next;				/* current block count */
    	size_t size;				/* total size of in-memory file */
    	Boolean may_free;			/* True when we must free this block */
    	unsigned char type;			/* type of image */
    	int depth;					/* depth of this image */
    }ImageBuffer;
    
    /*****
    * Definition of HTML form components
    *****/
    typedef struct _XmHTMLForm{
    	int	 			x;				/* x-position for this widget */
    	int 			y;				/* y-position for this widget */
    	Dimension 		width;			/* width of this widget */
    	Dimension 		height;			/* height of this widget */
    	Cardinal		line;			/* starting line number of this object */
    	GtkWidget 		*w;				/* TWidget ID */
    	GtkWidget		*child;			/* child id for scrolled stuff */
    	String 			name;			/* name for this TWidget */
    	Byte 			type;			/* TWidget type (see HTML.h) */
    	int				size;			/* cols in text(field)/items in select */
    	int				maxlength;		/* max chars to enter/rows in textarea */
    	String 			value;			/* default text */
    	String			content;		/* entered text(field) contents */
    	Alignment		align;			/* image/file browse button position */
    	Boolean			multiple;		/* multiple select flag */
    	int				selected;		/* default state */
    	Boolean 		checked;		/* check value for option/radio buttons. */
    	Boolean 		mapped;			/* True when displayed, false otherwise */
    	struct _XmHTMLForm *options;	/* option items for select */
    	struct _XmHTMLObjectTable *data;/* owning data object */
    	struct _XmHTMLFormData *parent;	/* parent form */
    	struct _XmHTMLForm *prev;		/* ptr to previous record */
    	struct _XmHTMLForm *next;		/* ptr to next record */
    }XmHTMLForm;
    
    /*****
    * Definition of form data
    *****/
    typedef struct _XmHTMLFormData{
    	GtkWidget *html;				/* owner of this form */
    	String action;					/* destination url/cgi-bin */
    	int method;						/* XmHTML_FORM_GET,POST,PIPE */
    	String enctype;					/* form encoding */
    	int ncomponents;				/* no of items in this form */
    	GtkWidget *fileSB;				/* input == file */
    	XmHTMLForm *components;			/* list of form items */
    	struct _XmHTMLFormData *prev;	/* ptr to previous form */
    	struct _XmHTMLFormData *next;	/* ptr to next form */
    }XmHTMLFormData;
    
    /*****
    * Definition of XmHTML tables
    *
    * Dimensions:
    * positive -> absolute number;
    * negative -> relative number;
    * 0        -> no dimension specified;
    *
    * Each component in a table has a set of core properties. Properties are
    * inherited from top to bottom and can be overriden.
    *
    * Content containers render the contents of all objects between
    * start (inclusive) and end (exclusive).
    *****/
    /* possible framing types */
    typedef enum{
    	TFRAME_VOID = 0,			/* no borders		*/
    	TFRAME_ABOVE,				/* only top side	*/
    	TFRAME_BELOW,				/* only bottom side	*/
    	TFRAME_LEFT,				/* only left side	*/
    	TFRAME_RIGHT,				/* only right side	*/
    	TFRAME_HSIDES,				/* top & bottom		*/
    	TFRAME_VSIDES,				/* left & right		*/
    	TFRAME_BOX,					/* all sides		*/
    	TFRAME_BORDER				/* all sides		*/
    }TableFraming;
    
    /* possible ruling types */
    typedef enum{
    	TRULE_NONE = 0,				/* no rules			*/
    	TRULE_GROUPS,				/* only colgroups	*/
    	TRULE_ROWS,					/* only rows		*/
    	TRULE_COLS,					/* only columns		*/
    	TRULE_ALL					/* all cells		*/
    }TableRuling;
    
    /*****
    * Properties shared by all table elements. These are inherited from top to
    * bottom and can be overriden by the appropriate tag attributes.
    *****/
    typedef struct _TableProperties{
    	int				border;				/* border width, 0 = noborder	*/
    	Alignment		halign;				/* content horizontal alignment	*/
    	Alignment		valign;				/* content vertical alignment	*/
    	Pixel			bg;					/* content background color		*/
    	XmHTMLImage		*bg_image;			/* content background image		*/
    	TableFraming	framing;			/* what frame should we use?	*/
    	TableRuling		ruling;				/* what rules should we draw?	*/
    }TableProperties;
    
    /*****
    * a Cell, can be a header cell or a simple cell.
    *****/
    typedef struct _TableCell{
    	Boolean			header;				/* True if a header cell	*/
    	int				width;				/* suggested cell width		*/
    	int				height;				/* suggested cell height	*/
    	int				rowspan;			/* no of rows spanned		*/
    	int				colspan;			/* no of cells spanned		*/
    	TableProperties	*props;				/* properties for this cell	*/
    	struct _XmHTMLObjectTable *start;	/* first object to render	*/
    	struct _XmHTMLObjectTable *end;		/* last object to render	*/
    	struct _XmHTMLObjectTable *owner;	/* owning object			*/
    	struct _TableRow *parent;			/* parent of this cell		*/
    }TableCell;
    
    /* A row. A row consists of a number of Cells */
    typedef struct _TableRow{
    	TableCell		*cells;				/* all cells in this row	*/
    	int				ncells;				/* no of cells in row		*/
    	int				lastcell;			/* last used cell			*/
    	TableProperties	*props;				/* properties for this row	*/
    	struct _XmHTMLObjectTable *start;	/* first object to render	*/
    	struct _XmHTMLObjectTable *end;		/* last object to render	*/
    	struct _XmHTMLObjectTable *owner;	/* owning object			*/
    	struct _XmHTMLTable *parent;		/* parent of this row		*/
    }TableRow;
    
    /*****
    * A table. A table consists of a Caption and a number of Rows
    * The caption is a special row: it has only one cell that stretches
    * across the entire table: itself.
    *****/
    typedef struct _XmHTMLTable{
    	/* overall table properties */
    	int				width;				/* suggested table width	*/
    	int				hmargin;			/* horizontal cell margin	*/
    	int				vmargin;			/* vertical cell margin		*/
    	int				hpadding;			/* horizontal cell padding	*/
    	int				vpadding;			/* vertical row padding		*/
    	int				ncols;				/* no of columns			*/
    	TableProperties *props;				/* master table properties	*/
    
    	TableRow		*caption;			/* table caption			*/
    	TableRow		*rows;				/* all table rows			*/
    	int				nrows;				/* no of rows in table		*/
    	int				lastrow;			/* last used row			*/
    
    	struct _XmHTMLTable *parent;		/* parent table (for childs)*/
    	struct _XmHTMLTable *childs;		/* table child				*/
    	int				nchilds;			/* no of child tables		*/
    	int				lastchild;			/* last used table			*/
    
    	struct _XmHTMLObjectTable *start;	/* first object in table	*/
    	struct _XmHTMLObjectTable *end;		/* last object in table		*/
    
    	struct _XmHTMLObjectTable *owner;	/* owner of this table		*/
    
    	struct _XmHTMLTable *next;			/* ptr to next table		*/
    }XmHTMLTable;
    
    /*****
    * Definition of formatted HTML elements
    *****/
    typedef struct _XmHTMLObjectTable{
    	int				x;				/* x position for this element		*/
    	int				y;				/* y position for this element		*/
    	Dimension		width;			/* width of this element			*/
    	Dimension		height;			/* height of this element			*/
    	Cardinal		line;			/* starting line number of this object */
    	Cardinal		id;				/* object identifier (anchors only)	*/
    	ObjectType		object_type;	/* element type						*/
    	String			text;			/* cleaned text						*/
    	Byte			text_data;		/* text/image/anchor data bits		*/
    	int				len;			/* length of text or width of a rule*/
    	int				y_offset;		/* offset for sub/sup, 
    noshade flag */ int x_offset; /* additional offset for sub/sup */ XmHTMLObject *object; /* object data (raw text) */ XmHTMLAnchor *anchor; /* ptr to anchor data */ XmHTMLWord *words; /* words to be displayed */ XmHTMLForm *form; /* form data */ XmHTMLTable *table; /* table data */ int n_words; /* number of words */ Byte anchor_state; /* anchor selection state identifier*/ Alignment halign; /* horizontal line alignment */ int linefeed; /* linebreak type */ Dimension ident; /* xoffset for list indentation */ Marker marker; /* marker to use in lists */ int list_level; /* current count of list element. */ XmHTMLfont *font; /* font to be used for this object */ Pixel fg; /* foreground color for this object */ Pixel bg; /* background color for this object */ struct _XmHTMLObjectTable *next; struct _XmHTMLObjectTable *prev; }XmHTMLObjectTable, *XmHTMLObjectTableElement; /***** * *****/ typedef struct _XmHTMLSelection{ XmHTMLObjectTable *start; /* selection start object */ int start_word; /* first word index */ int start_nwords; /* word count */ XmHTMLObjectTable *end; /* ending start object (inclusive) */ int end_word; /* first word index */ int end_nwords; /* word count */ }XmHTMLSelection; /***** * definition of frame childs *****/ typedef struct _XmHTMLFrameWidget{ int x; /* computed frame x-position */ int y; /* computed frame y-position */ Dimension width; /* computed frame width */ Dimension height; /* computed frame height */ int xs; /* saved x-position */ int ys; /* saved y-position */ Dimension width_s; /* saved frame width */ Dimension height_s; /* saved frame height */ FrameSize width_type; /* horizontal frame size specification */ FrameSize height_type; /* vertical frame size specification */ FrameScrolling scroll_type; /* frame scrolling */ String src; /* source document */ String name; /* internal frame name */ Dimension margin_width; /* frame margin width */ Dimension margin_height; /* frame margin height */ Boolean resize; /* may we resize this frame? */ int border; /* add a border around this frame? */ GtkWidget *frame; /* XmHTMLWidget id for this frame */ }XmHTMLFrameWidget; /***** * Parser state stack object *****/ typedef struct _stateStack{ htmlEnum id; /* current state id */ struct _stateStack *next; /* ptr to next record */ }stateStack; /***** * Progressive Loading Context. This is an opaque object fully defined in * plc.h. It's a rather complex thing for all objects than can be loaded * progressively. It maintains the state of each object (data as well as data * processing functions) and does a bunch of nifty things. *****/ typedef struct _PLC *PLCPtr; /***** * This struct is required to properly perform alpha channel processing. * It contains information about the current background setting. * * Alpha channel processing is done for PNG images with (obviously) an alpha * channel. The data used for creating the pixmap is a merger of the original * image data with the current background setting (fixed color or an image). * When a document with such an image contains a background image, XmHTML needs * to redo this alpha processing whenever the document layout is changed: the * exact result of this merger depends on the position of the image. This can * be a rather slow process (alpha channels require floating point ops), and * by at least storing the current background info we can achieve some * performance increase. *****/ typedef struct _AlphaChannelInfo{ int fb_maxsample; /* frame buffer maximum sample value */ int background[3]; /* solid background color: R, G, B */ int ncolors; /* size of background image colormap */ GdkColor *bg_cmap; /* background image colormap */ }AlphaChannelInfo, *AlphaPtr; /***** * XmHTMLPart definition *****/ typedef struct _XmHTMLPart{ /* Original document Resources */ String value; /* raw HTML text, copied to the parser */ String source; /* copy used by XmHTML */ String mime_type; /* mime type of this text/image (?) */ Byte mime_id; /* internal mime id */ /* Anchor resources */ GdkCursor *anchor_cursor; Boolean anchor_display_cursor; Boolean anchor_buttons; /* anchor colors */ Pixel anchor_fg; Pixel anchor_visited_fg; Pixel anchor_target_fg; Pixel anchor_activated_fg; Pixel anchor_activated_bg; Boolean highlight_on_enter; /* anchor highlighting */ /* anchor underlining styles */ Byte anchor_underline_type; Byte anchor_visited_underline_type; Byte anchor_target_underline_type; /* internal underlining styles, translated from above */ Byte anchor_line; Byte anchor_target_line; Byte anchor_visited_line; Position anchor_position_x; /* for server-side imagemaps */ Position anchor_position_y; /* for server-side imagemaps */ XmHTMLObjectTable *armed_anchor; /* current anchor */ XmHTMLAnchor *anchor_current_cursor_element; XmHTMLAnchorProc anchor_visited_proc; /* background image/color and text color resources */ Boolean body_colors_enabled; Boolean body_images_enabled; Boolean allow_color_switching; Boolean allow_form_coloring; /* body colors on HTML forms */ Boolean freeze_animations; Pixel body_bg; /* current background color */ Pixel body_fg; /* current foreground color */ String body_image_url; /* background image location */ String def_body_image_url; /* default bg image location */ XmHTMLImage *body_image; /* background image data */ GdkGC *bg_gc; /* background render gc */ /* Font resources */ String charset; String font_family; String font_family_fixed; String font_sizes; String font_sizes_fixed; XmHTMLfont *default_font; Byte string_direction; Byte alignment; Alignment default_halign; Boolean allow_font_switching; /* Image resources */ Boolean images_enabled; /* True -> show images */ int max_image_colors; /* 0 -> as much as possible */ float screen_gamma; /* gamma correction for this display */ XmImageProc image_proc; /* external image loader */ XmImageGifProc gif_proc; /* external gif decoder */ String zCmd; /* uncompress command for LZWStream */ XmHTMLImage *images; /* list of images in current doc */ Boolean delayed_creation; /* delayed image creation */ XCC xcc; /* a lot of visual info */ Byte map_to_palette; /* if and how to map to palette */ String palette; /* palette to use */ /* Imagemap resources */ XmHTMLImageMap *image_maps; /* array of client-side imagemaps */ Pixel imagemap_fg; /* bounding box color */ Boolean imagemap_draw; /* draw imagemap bounding boxes */ /* Frame resources */ Boolean is_frame; /* true when this is a frame */ FrameScrolling scroll_type; /* frame scrolling */ int frame_border; /* add a border to the frames? */ int nframes; /* no of frames managed */ XmHTMLFrameWidget **frames; /* list of frame childs */ /* Document resources */ Boolean strict_checking; Boolean enable_outlining; Byte bad_html_warnings; gpointer client_data; /* client_data for functional res. */ /* Private Resources */ Dimension margin_width; /* document margins */ Dimension margin_height; GtkWidget *work_area; /* render area */ Dimension work_width; /* render area dimensions */ Dimension work_height; Boolean resize_height; /* True -> autosize vertically */ Boolean resize_width; /* True -> autosize horizontally */ /* Progressive Loader Context buffer and interval */ PLCPtr plc_buffer; /* PLC ringbuffer */ int num_plcs; /* no of PLC's in ringbuffer */ int plc_def_delay; /* default PLC timeout delay */ int plc_delay; /* PLC timeout delay */ int plc_min_delay; /* PLC minimum timeout delay */ int plc_max_delay; /* PLC maximum timeout delay */ gint plc_proc_id; /* timer id for main plc cycler */ XmHTMLGetDataProc get_data; /* PLC data request function */ XmHTMLEndDataProc end_data; /* PLC end signal function */ Boolean plc_suspended; /* Global PLC suspension flag */ GdkGC *plc_gc; /* gc used by all plc's */ /* perform final dithering pass/use image colors */ Byte perfect_colors; /* Internal stuff for alpha channelled PNG images */ AlphaPtr alpha_buffer; Byte rgb_conv_mode; /* 24 to 8bit conversion method */ Byte alpha_processing; /* do alpha channel stuff? */ /* * Fallback colors, required for proper color resetting between documents * with and without a color spec. */ Pixel anchor_fg_save; Pixel anchor_visited_fg_save; Pixel anchor_target_fg_save; Pixel anchor_activated_fg_save; Pixel anchor_activated_bg_save; Pixel body_bg_save; Pixel body_fg_save; /* Scrollbar resources */ GtkWidget *hsb; /* vertical scrollbar TWidget id */ GtkWidget *vsb; /* horizontal scrollbar TWidget id */ Byte sb_policy; /* scrollbar display policy */ Byte sb_placement; /* scrollbar placement policy */ int scroll_x; /* current horizontal position */ int scroll_y; /* current vertical position */ Boolean needs_hsb; /* True -> hsb required */ Boolean needs_vsb; /* True -> vsb required */ /* Callback resources */ GList *activate_callback; GList *arm_callback; GList *anchor_track_callback; GList *frame_callback; GList *form_callback; GList *input_callback; GList *link_callback; GList *motion_track_callback; GList *imagemap_callback; GList *document_callback; GList *focus_callback; GList *losing_focus_callback; GList *event_callback; Boolean need_tracking; /* serve mouse/focus tracking? */ XmHTMLEventProc event_proc; /* HTML4.0 script processing proc */ HTEvent *events; /* HTML4.0 event data */ int nevents; /* no of events watched */ /* Formatted document resources */ int formatted_width; /* total width of document */ int formatted_height; /* total height of document */ int num_anchors; /* total no of anchors in doc */ int num_named_anchors; /* total no of named anchors */ int anchor_words; /* total no of anchor words */ XmHTMLWord *anchors; /* for quick anchor lookup */ XmHTMLObject *elements; /* unfiltered parser output */ XmHTMLObjectTable *named_anchors; /* for quick named anchor lookup */ XmHTMLAnchor *anchor_data; /* parsed anchor data */ XmHTMLObjectTable *formatted; /* display object data */ XmHTMLObjectTable *paint_start; /* first paint command */ XmHTMLObjectTable *paint_end; /* last paint command */ int paint_x; /* horizontal paint start x-pos */ int paint_y; /* vertical paint start y-pos */ int paint_width; /* horizontal paint end x-pos */ int paint_height; /* vertical paint end y-pos */ Cardinal top_line; /* current topline */ Cardinal nlines; /* no of lines in document */ /* Table resources */ XmHTMLTable *tables; /* list of all tables */ /* Anchor activation resources */ int press_x; /* ptr coordinates */ int press_y; Time pressed_time; /* time of anchor activation */ Time selected_time; /* unused for now */ XmHTMLAnchor *selected; /* selected anchor */ XmHTMLObjectTable *current_anchor;/* selected object */ /* Text selection resources */ XmHTMLObjectTable *selection; /* reserved for future use */ int select_start; /* reserved for future use */ int select_end; /* reserved for future use */ /* HTML Form resources */ XmHTMLFormData *form_data; /* all forms in the current document */ /* Misc. resources */ int repeat_delay; /* keyboard and scrollbar delay */ GdkGC *gc; /* main rendering gc */ Boolean in_layout; /* layout blocking flag. * Also used as SetValues blocking * flag by the parser. */ int visibility; /* visibility state of work_area */ ToolkitAbstraction *tka; /* toolkit abstraction */ #ifdef DEBUG Boolean debug_disable_warnings; /* warning msg blocking flag */ Boolean debug_full_output; /* allow output from FullDebug */ Boolean debug_save_clipmasks; /* save clipmasks as bitmaps */ Boolean debug_no_loopcount; /* ignore loop_count in anims */ String debug_prefix; /* debug file prefix */ String debug_levels; /* debug levels to enable */ #endif unsigned char pad[60]; /* reserved for future use */ }XmHTMLPart; /***** * FakeManagerPart: a structure that defines some of the fields defined by the * Motif xmManagerWidgetClass. XmHTML is a subclass of XmManager and as such * it accesses some of the instance fields of XmManager. * In this way, source code compatibility is enhanced considerably. *****/ typedef struct _FakeManagerPart{ guint shadow_thickness; /* thickness of bordering shadow */ gulong foreground; /* current foreground color */ gulong highlight_color; /* current highlight color */ GdkGC *highlight_GC; /* gc to use for highlighting */ GdkGC *top_shadow_GC; /* top shadow GC (lines and anchors) */ GdkGC *bottom_shadow_GC; /* bottom shadow GC (lines and anchors) */ }FakeManagerPart; /* public interface part */ struct _GtkXmHTML { GtkContainer widget; XmHTMLPart html; /* Scrollbar adjustements */ GtkObject *vsba; GtkObject *hsba; /* managing our code */ int frozen; int parse_needed; int reformat_needed; int redraw_needed; int free_images_needed; int layout_needed; int initialized; GList *children; /* fake XmManager */ FakeManagerPart manager; }; struct _GtkXmHTMLClass { GtkContainerClass parent_class; void (*activate) (GtkXmHTML *, void *); void (*arm) (GtkXmHTML *, void *); void (*anchor_track) (GtkXmHTML *, void *); void (*frame) (GtkXmHTML *, void *); void (*form) (GtkXmHTML *, void *); void (*input) (GtkXmHTML *, void *); void (*link) (GtkXmHTML *, void *); void (*motion) (GtkXmHTML *, void *); void (*imagemap) (GtkXmHTML *, void *); void (*document) (GtkXmHTML *, void *); void (*focus) (GtkXmHTML *, void *); void (*losing_focus) (GtkXmHTML *, void *); void (*motion_track) (GtkXmHTML *, void *); void (*html_event) (GtkXmHTML *, void *); /* HTML 4.0 event */ /***** * FIXME * anchor_visited is NO signal function, there is no user-specific * event associated with it. XmHTML uses it to find out how it should * render an anchor: if this function returns True, it will render it * as visited. *****/ void (*anchor_visited) (GtkXmHTML *, char *, void *); }; /***** * Pull in other private headers (internal function proto's, warning message * table, compile-time configuration) when building the library. *****/ #ifdef _LIBRARY #include "XmHTMLI.h" #include "HTMLWarnings.h" #include "gtk-xmhtmlfuncs.h" #include "XmHTMLconf.h" #include "debug.h" #endif enum{ GTK_XMHTML_ACTIVATE, GTK_XMHTML_ARM, GTK_XMHTML_ANCHOR_TRACK, GTK_XMHTML_FRAME, GTK_XMHTML_FORM, GTK_XMHTML_INPUT, GTK_XMHTML_LINK, GTK_XMHTML_MOTION, GTK_XMHTML_IMAGEMAP, GTK_XMHTML_DOCUMENT, GTK_XMHTML_FOCUS, GTK_XMHTML_LOSING_FOCUS, GTK_XMHTML_MOTION_TRACK, GTK_XMHTML_HTML_EVENT, GTK_XMHTML_ANCHOR_VISITED, GTK_XMHTML_LAST_SIGNAL }; /***** * These defines are used by the gtk TkaCallCallback macro in toolkit.h * to index the list of signals gtk-xmhtml can emit. ******/ #define GTK_XMHTML_activate GTK_XMHTML_ACTIVATE #define GTK_XMHTML_arm GTK_XMHTML_ARM #define GTK_XMHTML_anchor_track GTK_XMHTML_ANCHOR_TRACK #define GTK_XMHTML_frame GTK_XMHTML_FRAME #define GTK_XMHTML_form GTK_XMHTML_FORM #define GTK_XMHTML_input GTK_XMHTML_INPUT #define GTK_XMHTML_link GTK_XMHTML_LINK #define GTK_XMHTML_motion GTK_XMHTML_MOTION #define GTK_XMHTML_imagemap GTK_XMHTML_IMAGEMAP #define GTK_XMHTML_document GTK_XMHTML_DOCUMENT #define GTK_XMHTML_focus GTK_XMHTML_FOCUS #define GTK_XMHTML_losing_focus GTK_XMHTML_LOSING_FOCUS #define GTK_XMHTML_motion_track GTK_XMHTML_MOTION_TRACK #define GTK_XMHTML_html_event GTK_XMHTML_HTML_EVENT #define GTK_XMHTML_anchor_visited GTK_XMHTML_ANCHOR_VISITED #define GTK_XMHTML_last_signal GTK_XMHTML_LAST_SIGNAL extern gint gtk_xmhtml_signals []; enum { XmCR_ACTIVATE, XmCR_FOCUS, XmCR_LOSING_FOCUS, XmCR_ARM }; #ifdef __cplusplus } #endif /* __cplusplus */ /* Don't add anything after this endif! */ #endif /* _gtk_xmhtml_p_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/README100644 23564 23564 315 6570525472 15476 0ustar newtnewtThis File: README for the Gtk/XmHTML port. Get a working version at http://www.gnome.org, this code is very prelimenary as I need to merge Miguel's changes into something usefull and handy for me. Koen. XmHTML-1.1.7/include/gtk-xmhtml/HTML.h100644 23564 23564 141610 6624041534 15607 0ustar newtnewt/***** * HTML.h : XmHTML Widget public header file. * Resource defines, enumerations and structures. * * This file Version $Revision: 1.8 $ * * Creation date: Tue Apr 15 23:39:26 GMT+0100 1997 * Last modification: $Date: 1998/04/27 06:54:30 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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/HTML.h,v $ *****/ /***** * ChangeLog * $Log: HTML.h,v $ * Revision 1.8 1998/04/27 06:54:30 newt * Changed XmImageProc proto * * Revision 1.7 1998/04/04 06:27:46 newt * XmHTML Beta 1.1.3 * * Revision 1.6 1997/10/23 00:24:27 newt * XmHTML Beta 1.1.0 release * * Revision 1.5 1997/08/31 17:30:39 newt * Removed HT_TEXTFLOW * * Revision 1.4 1997/08/30 00:22:46 newt * Alpha channel resources: XmNalphaChannelProcessing and * XmNimageRGBConversion. Updated comments and reorganized a bunch of things. * * Revision 1.3 1997/08/01 12:52:11 newt * Progressive image loading changes * * Revision 1.2 1997/05/28 01:29:28 newt * XmImage changes: added the XmImageConfig structure and configuration flags. * Added support for the XmNdecodeGIFProc resource. * * Revision 1.1 1997/04/29 14:19:18 newt * Initial Revision * *****/ #ifndef _HTML_h_ #define _HTML_h_ /* include our new resources */ #include /****************************************************************************** * Enumerations and other constants ******************************************************************************/ /***** * HTML Elements internal id's * This list is alphabetically sorted to speed up the searching process. * DO NOT MODIFY *****/ typedef enum{ HT_DOCTYPE, HT_A, HT_ADDRESS, HT_APPLET, HT_AREA, HT_B, HT_BASE, HT_BASEFONT, HT_BIG, HT_BLOCKQUOTE, HT_BODY, HT_BR, HT_CAPTION, HT_CENTER, HT_CITE, HT_CODE, HT_DD, HT_DFN, HT_DIR, HT_DIV, HT_DL, HT_DT, HT_EM, HT_FONT, HT_FORM, HT_FRAME, HT_FRAMESET, HT_H1, HT_H2, HT_H3, HT_H4, HT_H5, HT_H6, HT_HEAD, HT_HR, HT_HTML, HT_I, HT_IMG, HT_INPUT, HT_ISINDEX, HT_KBD, HT_LI, HT_LINK, HT_MAP, HT_MENU, HT_META, HT_NOFRAMES, HT_OL, HT_OPTION, HT_P, HT_PAGE, HT_PARAM, HT_PRE, HT_SAMP, HT_SCRIPT, HT_SELECT, HT_SMALL, HT_STRIKE, HT_STRONG, HT_STYLE, HT_SUB, HT_SUP, HT_TAB, HT_TABLE, HT_TD, HT_TEXTAREA, HT_TH, HT_TITLE, HT_TR, HT_TT, HT_U, HT_UL, HT_VAR, HT_ZTEXT }htmlEnum; /***** * Corresponding HTML element name table. Indexing with the above enumeration * will give the corresponding element name. *****/ extern String *html_tokens; /***** * XmHTML defines the following callback reasons. This might produce strange * results once Motif decides to uses enum values above 16383. * Send us a mail at ripley@xs4all.nl if you get problems that are due to * these enumeration values. *****/ enum{ XmCR_HTML_ANCHORTRACK = 16384, /* XmNanchorTrackCallback */ XmCR_HTML_DOCUMENT, /* XmNdocumentCallback */ XmCR_HTML_FORM, /* XmNformCallback */ XmCR_HTML_FRAME, /* XmNframeCallback */ XmCR_HTML_FRAMECREATE, /* XmNframeCallback */ XmCR_HTML_FRAMEDESTROY, /* XmNframeCallback */ XmCR_HTML_IMAGEMAPACTIVATE, /* XmNimagemapCallback */ XmCR_HTML_IMAGEMAP, /* XmNimagemapCallback */ XmCR_HTML_LINK, /* XmNlinkCallback */ XmCR_HTML_MODIFYING_TEXT_VALUE, /* XmNmodifyVerifyCallback */ XmCR_HTML_MOTIONTRACK, /* XmNmotionTrackCallback */ XmCR_HTML_PARSER, /* XmNparserCallback */ XmCR_HTML_EVENT, /* XmNeventCallback */ XmCR_HTML_EVENTDESTROY, /* XmNeventCallback */ XmCR_HTML_OBJECT, /* XmNobjectCallback */ XmCR_HTML_OBJECTCREATE, /* XmNobjectCallback */ XmCR_HTML_OBJECTDESTROY /* XmNobjectCallback */ }; /***** * XmNeventCallback sub event types *****/ enum{ /* Document/Frame specific events */ XmCR_HTML_LOAD = 0, /* onLoad */ XmCR_HTML_UNLOAD, /* onUnLoad */ /* HTML Form specific events */ XmCR_HTML_SUBMIT, /* onSubmit */ XmCR_HTML_RESET, /* onReset */ XmCR_HTML_FOCUS, /* onFocus */ XmCR_HTML_BLUR, /* onBlur */ XmCR_HTML_SELECT, /* onSelect */ XmCR_HTML_CHANGE, /* onChange */ /* object events */ XmCR_HTML_CLICK, /* onClick */ XmCR_HTML_DOUBLE_CLICK, /* onDblClick */ XmCR_HTML_MOUSEDOWN, /* onMouseDown */ XmCR_HTML_MOUSEUP, /* onMouseUp */ XmCR_HTML_MOUSEOVER, /* onMouseOver */ XmCR_HTML_MOUSEMOVE, /* onMouseMove */ XmCR_HTML_MOUSEOUT, /* onMouseOut */ XmCR_HTML_KEYPRESS, /* onKeyPress */ XmCR_HTML_KEYDOWN, /* onKeyDown */ XmCR_HTML_KEYUP, /* onKeyUp */ XmCR_HTML_USEREVENT /* must always be last */ }; /***** * URL types XmHTML knows of. * The hostnames, files and port numbers are only shown for demonstration * purposes, XmHTML doesn't care whether they are present or not. * The first 16 elements are alphabetically sorted to speed up URL * translations. *****/ typedef enum{ ANCHOR_ABOUT = 0, /* href="about:..." */ ANCHOR_EXEC, /* href="exec:foo_bar" */ ANCHOR_FILE_REMOTE, /* href="file://foo.bar/file.html" */ ANCHOR_FTP, /* href="ftp://foo.bar/file" */ ANCHOR_GOPHER, /* href="gopher://foo.bar:70" */ ANCHOR_HELP, /* href="help:..." */ ANCHOR_HTTP, /* href="http://foo.bar/file.html" */ ANCHOR_SECURE_HTTP, /* href="https://foo.bar/file.html" */ ANCHOR_INFO, /* href="info:.." */ ANCHOR_MAILTO, /* href="mailto:foo@bar" */ ANCHOR_MAN, /* href="man:..." */ ANCHOR_NEWS, /* href="news://foo.bar" */ ANCHOR_PIPE, /* href="pipe:foo_bar" */ ANCHOR_TELNET, /* href="telnet://foo.bar:23" */ ANCHOR_WAIS, /* href="wais://foo.bar" */ ANCHOR_XEXEC, /* href="xexec:foo_bar" */ ANCHOR_UNKNOWN, /* unknown href */ ANCHOR_FILE_LOCAL, /* href="file.html" */ ANCHOR_FORM_IMAGE, /* , only used internally */ ANCHOR_JUMP, /* href="#..." */ ANCHOR_NAMED /* name="...." */ }URLType; /***** * Various methods of loading documents. * LOAD_NORMAL * The entire document is provided. This is the default method of loading * documents. * LOAD_PROGRESSIVE * Progressive document load. A complete source is provided each time: * caller takes care of appending new text to th current buffer before * flushing it to XmHTML. * LOAD_INCREMENTAL * Progressive document load. A new chunk is provided each time: XmHTML * takes care of appending new text to the already existing text. * LOAD_SUSPEND * Suspend progressive or incremental loading. XmHTML display the document * upto the last valid combination of tokens. * LOAD_ABORT * Abort progressive or icremental loading. XmHTML will flush it's * buffers and display all the data (including any constructs it * requires to close the document). *****/ enum{ XmLOAD_NORMAL = 0, /* normal load, all data at once */ XmLOAD_PROGRESSIVE, /* progressive load, use new text */ XmLOAD_INCREMENTAL, /* progressive load, append new text */ XmLOAD_SUSPEND, /* suspend load */ XmLOAD_ABORT /* abort load */ }; /***** * Procedure to be called whenever a script is encountered * Arguments: * Widget: XmHTMLWidget id * String: script source text * XtPointer: XmNclientData value * Return value: * data to be stored whenever a document event should be processed. * This data is unused internally and is provided as the user_data * argument in the XmHTMLEvent structure. For example, the return value * could be a pointer into some internal procedural database, a ptr to a * compiled script procedure or the script source text if you want to * process it at some later time (when the event occurs). * * When NULL is returned the event in question is disabled. *****/ typedef XtPointer (*XmHTMLEventProc)(Widget, String, XtPointer); /***** * HTML Form component types. Alphabetically sorted to speed up searching. *****/ typedef enum{ FORM_CHECK = 0, /* checkbox */ FORM_FILE, /* file selection box */ FORM_HIDDEN, /* hidden input */ FORM_IMAGE, /* drawnbutton */ FORM_OPTION, /* select child */ FORM_PASSWD, /* password textfield */ FORM_RADIO, /* radiobox */ FORM_RESET, /* reset button */ FORM_SELECT, /* select parent */ FORM_SUBMIT, /* submit button */ FORM_TEXT, /* singleline textfield */ FORM_TEXTAREA, /* multiline edit field */ FORM_UNKNOWN /* unknown type */ }componentType; /***** * Supported HTML Form method types *****/ enum{ XmHTML_FORM_GET = 0, /* method = get */ XmHTML_FORM_POST, /* method = post */ XmHTML_FORM_PIPE /* method = pipe */ }; /***** * possible error codes for XmNparserCallback *****/ typedef enum{ HTML_UNKNOWN_ELEMENT = 1, /* unknown HTML element */ HTML_BAD, /* very badly placed element */ HTML_OPEN_BLOCK, /* block still open while new block started */ HTML_CLOSE_BLOCK, /* block closed but was never opened */ HTML_OPEN_ELEMENT, /* unbalanced terminator */ HTML_NESTED, /* improperly nested element */ HTML_VIOLATION, /* bad content for current block/element */ HTML_NOTIFY, /* notification of text insertion/removal */ HTML_INTERNAL /* internal parser error */ }parserError; /***** * And corresponding values for XmNenableBadHTMLWarnings. * These are or'd together. * XmNONE disables warnings and XmHTML_ALL enables all warnings. * See parserError for their meaning. *****/ enum{ XmHTML_NONE = 0, /* no warnings */ XmHTML_UNKNOWN_ELEMENT = 1, XmHTML_BAD = 2, XmHTML_OPEN_BLOCK = 4, XmHTML_CLOSE_BLOCK = 8, XmHTML_OPEN_ELEMENT = 16, XmHTML_NESTED = 32, XmHTML_VIOLATION = 64, XmHTML_ALL = 127 /* all warnings */ }; /***** * possible action codes for the action field in the XmHTMLParserCallbackStruct *****/ enum{ HTML_REMOVE = 1, /* remove offending element */ HTML_INSERT, /* insert missing element */ HTML_SWITCH, /* switch offending and expected element */ HTML_KEEP, /* keep offending element */ HTML_IGNORE, /* ignore, proceed as if nothing happened */ HTML_ALIAS, /* alias an unknown element to known one */ HTML_TERMINATE /* terminate parser */ }; /***** * Possible return codes for XmHTMLImageGetType(). *****/ enum{ IMAGE_ERROR = 0, /* error on image loading */ IMAGE_UNKNOWN, /* unknown image */ IMAGE_XPM, /* X11 pixmap */ IMAGE_XBM, /* X11 bitmap */ IMAGE_GIF, /* CompuServe(C) Gif87a or Gif89a */ IMAGE_GIFANIM, /* animated gif */ IMAGE_GIFANIMLOOP, /* animated gif with loop extension */ IMAGE_GZF, /* compatible Gif87a or Gif89a */ IMAGE_GZFANIM, /* compatible animated gif */ IMAGE_GZFANIMLOOP, /* compatible animated gif */ IMAGE_JPEG, /* JPEG image */ IMAGE_PNG, /* PNG image */ IMAGE_FLG /* Fast Loadable Graphic */ }; /***** * Possible return values for a function installed on the * XmNprogressiveReadProc resource. *****/ #define STREAM_OK 1 /* internally used value */ #define STREAM_END 0 /* data stream ended (no more data) */ #define STREAM_SUSPEND -1 /* data stream suspended (not enough data) */ #define STREAM_ABORT -2 /* data stream aborted */ #define STREAM_RESIZE -3 /* resize input buffer */ /***** * Possible return values for the XmNdecodeGIFProc resource and * values for the XmHTMLGIFStream state. *****/ #define GIF_STREAM_OK 2 #define GIF_STREAM_END 1 #define GIF_STREAM_ERR 0 #define GIF_STREAM_INIT -1 #define GIF_STREAM_FINAL -2 /***** * Possible return values from a number of image related routines. * The actual meaning depends on the routine used. *****/ typedef enum{ XmIMAGE_ERROR = 0, /* unknown error occured */ XmIMAGE_BAD, /* bad function call: missing arg or so */ XmIMAGE_UNKNOWN, /* provided XmImage/XmImageInfo unknown/unbound */ XmIMAGE_ALMOST, /* action completed, further response necessary */ XmIMAGE_OK /* action completed. */ }XmImageStatus; /***** * Possible values for transparency (value for the "bg" field in both * XmImage and XmImageInfo structures). Possible values are: * * XmIMAGE_NONE * indicates the image is not transparent * XmIMAGE_TRANSPARENCY_BG * indicates the image achieves transparency by substituting the current * background setting (can be a single color or background image. Internally, * such transparency is achieved by using a clipmask). * XmIMAGE_TRANSPARENCY_ALPHA * indicates the image achieves transparency by using an alpha channel. * This transparency is currently only used by PNG images with an alpha * channel or a tRNS chunk (which is expanded to an alpha channel internally). *****/ enum{ XmIMAGE_NONE = 0, XmIMAGE_TRANSPARENCY_BG, XmIMAGE_TRANSPARENCY_ALPHA }; /***** * Possible values for the colorspace value. * * XmIMAGE_COLORSPACE_GRAYSCALE * image contains only shades of gray. The colorcube is reduced to a 1D * representation. All components in a shade have the same value. The * pixel values are equal to the value of a single color component. * XmIMAGE_COLORSPACE_INDEXED * image uses a fixed palette. Colorcube is mapped to a 1D lookup-table. * XmIMAGE_COLORSPACE_RGB * image uses a full 3D colorcube. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_COLORSPACE_GRAYSCALE = 1, XmIMAGE_COLORSPACE_INDEXED, XmIMAGE_COLORSPACE_RGB }; /***** * XmImageInfo structure options field bits. * The ``Set by default'' indicates a bit set when the XmHTMLImageDefaultProc * is used to read an image. The ``Read Only'' indicates a bit you should * consider as read-only. * XmIMAGE_DELAYED * Indicates the image is delayed, e.i. it will be provided at a later stage; * XmIMAGE_DEFERRED_FREE * Indicates XmHTML may free this structure when a new document is loaded. * XmIMAGE_IMMEDIATE_FREE * Indicates XmHTML may free this structure when XmHTML no longer needs it; * XmIMAGE_RGB_SINGLE * Indicates that the reds, greens and blues fields are allocated in a single * memory area instead of three seperate memory arrays. * XmIMAGE_ALLOW_SCALE * Indicates that scaling an image is allowed. * XmIMAGE_FRAME_IGNORE * Use with animations: set this bit when a frame falls outside the logical * screen area. No pixmap is created but the timeout for the frame is kept. * XmIMAGE_CLIPMASK * This bit is set when the returned XmImageInfo structure contains clipmask * data. XmHTML uses this info to create a clipping bitmap. Changing this * bit from set to unset will lead to a memory leak while changing it from * unset to set *without* providing a clipmask yourself *will* cause an error * to happen. You can set this bit when you are providing your own clipmask * (to provide non-rectangular images for example), PROVIDED you fill the * ``clip'' field with valid bitmap data (a stream of bytes in XYBitmap format * and the same size of the image). * XmIMAGE_SHARED_DATA * This bit is set when images share data. XmHTML sets this bit when the image * in question is an internal image, e.i., one for which the image data may * never be freed. Be carefull setting this bit yourself, since it prevents * XmHTML from freeing the image data present in the XmImageInfo structure. * It can easily lead to memory leaks when an image is *not* an internal * image. * XmIMAGE_PROGRESSIVE * Setting this bit will enable XmHTML progressive image loading. A function * *must* have been installed on the XmNprogressiveReadProc resource *prior* * to setting this bit. Installing a function on the XmNprogressiveEndProc * is optional. When this bit is set all other bits will be ignored. * XmIMAGE_DELAYED_CREATION * This bit is read-only. It is used internally by XmHTML for images with * an alpha channel. Alpha channel processing merges the current background * with the original RGB data from the image and uses the result to compose * the actual on-screen image (the merged data is stored in the ``data'' * field of the XmImageInfo structure). XmHTML needs to store the original * data somewhere, and when this bit is set it is stored in the ``rgb'' field * of the XmImageInfo structure. * When this bit is set, the returned XmImageInfo may *NOT BE FREED* as long * as the current document is alive. You can discard it as soon as a new * document is loaded. *****/ #define XmIMAGE_DELAYED (1<<1) #define XmIMAGE_DEFERRED_FREE (1<<2) /* set by default */ #define XmIMAGE_IMMEDIATE_FREE (1<<3) #define XmIMAGE_RGB_SINGLE (1<<4) /* set by default */ #define XmIMAGE_ALLOW_SCALE (1<<5) /* set by default */ #define XmIMAGE_FRAME_IGNORE (1<<6) #define XmIMAGE_CLIPMASK (1<<7) /* Read Only */ #define XmIMAGE_SHARED_DATA (1<<8) /* Read Only */ #define XmIMAGE_PROGRESSIVE (1<<9) #define XmIMAGE_DELAYED_CREATION (1<<10) /* Read Only */ /***** * XmImageInfo animation disposal values * A disposal method specifies what should be done before the current frame is * rendered. Possible values are: * XmIMAGE_DISPOSE_NONE * do nothing, overlays the previous frame with the current frame. * XmIMAGE_DISPOSE_BY_BACKGROUND * Restore to background color. The area used by the previous frame must * be restored to the background color/image * XmIMAGE_DISPOSE_BY_PREVIOUS * Restore to previous. The area used by the previous frame must be * restored to what was there prior to rendering the previous frame. *****/ enum{ /* XmIMAGE_NONE */ XmIMAGE_DISPOSE_NONE = 1, /* default behaviour */ XmIMAGE_DISPOSE_BY_BACKGROUND, XmIMAGE_DISPOSE_BY_PREVIOUS }; /***** * Primary image cache actions * (unimplemented) *****/ #define IMAGE_STORE 0 /* store an image in the cache */ #define IMAGE_GET 1 /* retrieve an image from the cache */ #define IMAGE_DISCARD 2 /* discard an image from the cache */ /***** * XmNperfectColors/XmNalphaChannelProcessing resource values. * * Note: these values are represented by the XmCEnableMode resource class. *****/ enum{ /* XmAUTOMATIC */ XmALWAYS = 1, XmNEVER }; /***** * Possible XmNimageMapToPalette/XmNimageRGBConversion resource values: * * XmQUICK * RGBConversion: * first checks if the 24bit image contains less than XmNmaxImageColors. * If not, XmHTML will dither to a fixed palette. This is fast but has * the disadvantage that the background color in an alpha channelled * image will not be matched exactly. * MapToPalette: * Use closest distance algorithm to map colors to the palette. No * error correction is performed. Reasonably fast, but quality * heavily depends on the distribution of the colors in the image. * XmBEST * RGBConversion (default): * first checks if the 24bit image contains less than XmNmaxImageColors. * If it is, the actual image colors are used. If not, a histogram of the * image is computed, the most used colors are selected and the resulting * image is dithered to this palette. * Offers best 24 to 8bit conversion and is probably faster than XmSLOW * as only images with more than XmNmaxImageColors will be dithered. * MapToPalette: * Ordered dithering using predefined error matrices. Reasonably fast and * quite good results; * XmFAST * RGBConversion: * Skips the check and dithers to a fixed palette right away. This is the * fastest way to do 24 to 8bit conversion but has the disadvantage that * every 24bit image is dithered to a fixed palette, regardless of the * actual no of colors in the image. * MapToPalette: * Simple ordered dithering. Fastest but probably the poorest results. * XmSLOW * RGBConversion: * Skips the check and does histogram stuff right away. * MapToPalette: * closest distance algorithm to map image colors to the palette and use * dynamic error correction. Slowest but best results; * XmDISABLED * RGBConversion: * ignored; * MapToPalette (default): * Disables palette mapping; * * Note: these values are represented by the XmCConversionMode resource class. *****/ enum{ XmQUICK = 0, XmBEST, XmFAST, XmSLOW, XmDISABLED }; /***** * Embedded object flags. These flags tell XmHTML which attributes are * defined for an object. *****/ #define HT_TAG_CLASSID (1<<1) /* classid, defines an implementation */ #define HT_TAG_CODEBASE (1<<2) /* base url for applet */ #define HT_TAG_DATA (1<<3) /* object data */ #define HT_TAG_SRC (1<<4) /* object data */ #define HT_TAG_TYPE (1<<5) /* internet data content type */ #define HT_TAG_CODETYPE (1<<6) /* internet code content type */ #define HT_TAG_STANDBY (1<<7) /* standby message */ #define HT_TAG_ALIGN (1<<8) /* global alignment */ #define HT_TAG_HALIGN (1<<9) /* horizontal alignment */ #define HT_TAG_VALIGN (1<<10) /* vertical alignment */ #define HT_TAG_HEIGHT (1<<11) /* suggested height */ #define HT_TAG_WIDTH (1<<12) /* suggested width */ #define HT_TAG_BORDER (1<<13) /* suggested border width */ #define HT_TAG_HSPACE (1<<14) /* suggested horizontal gutting space */ #define HT_TAG_VSPACE (1<<15) /* suggested vertical gutting space */ #define HT_TAG_USEMAP (1<<16) /* imagemap reference */ #define HT_TAG_BACKGROUND (1<<17) /* background image specification */ #define HT_TAG_BGCOLOR (1<<18) /* background color specification */ #define HT_TAG_HREF (1<<19) /* hyperlink */ #define HT_TAG_NAME (1<<20) /* object name/named hyperlink */ #define HT_TAG_EVENTS (1<<21) /* HTML4.0 events */ /***** * Possible return values for the embedded object convenience functions *****/ typedef enum{ OBJECT_ALMOST = 0, /* action completed, further action required */ OBJECT_DESTROYED, /* object has been destroyed */ OBJECT_EMPTY, /* object is empty */ OBJECT_ERROR, /* unknown error */ OBJECT_FATAL, /* fatal object error has occured */ OBJECT_INVALID, /* invalid object */ OBJECT_INVALID_LOCATION,/* object has an invalid location */ OBJECT_INVALID_SIZE, /* object has an invalid size */ OBJECT_LOWERED, /* object is lowered */ OBJECT_MAPPED, /* object is mapped to screen */ OBJECT_OK, /* action completed succesfully */ OBJECT_ORPHANED, /* object has no parent */ OBJECT_PARENTED, /* object already has a parent */ OBJECT_RAISED, /* object is raised */ OBJECT_UNIMPLEMENTED, /* requested function unimplemented */ OBJECT_UNKNOWN, /* unknown object */ OBJECT_UNKNOWN_ELEMENT, /* invalid element id */ OBJECT_UNMAPPED, /* object has been unmapped */ OBJECT_UNUSED, /* object is not being used */ OBJECT_USED, /* object is currently being used */ OBJECT_VISIBLE /* object is visible */ }XmHTMLObjectStatus; /***** * Search directions: forward or backward search *****/ typedef enum{ XmHTML_FORWARD = 0, XmHTML_BACKWARD }XmHTMLDirection; /***** * XmHTMLTextFind return codes *****/ typedef enum{ XmREG_ERROR = 0, /* An error occured */ XmREG_NOMATCH, /* end of text and no match found */ XmREG_MATCH /* a match was found */ }XmHTMLRegexStatus; /***** * In addition to the POSIX regex error codes, XmHTMLTextFinderGetError * can return the following errors *****/ #define RE_EEMPTY -1 /* no search string given */ #define RE_ENOMEM -2 /* out of memory */ #define RE_EBADPARENT -3 /* parent is not of class xmHTMLWidgetClass */ #define RE_EWORDS -4 /* no words to be searched (empty document) */ #define RE_ERROR -5 /* unknown error */ /***** * Finder is a fully opaque types. *****/ typedef struct _XmHTMLTextFinder *XmHTMLTextFinder; /***** * Custom Papersize dimension unit type * (under construction) *****/ enum{ XmHTML_CHAR = 0, XmHTML_CENTIMETER, /* 1cm = 0.39in */ XmHTML_MILLIMETER, /* 1mm = 0.1cm */ XmHTML_INCH, /* 1in = 2.54cm */ XmHTML_PICA, /* 1pc = 12pt */ XmHTML_POINT /* 1in = 72.27pt, 1cm = 28.45pt */ }; /***** * XmHTMLTextGetFormatted paper size defines * (under construction) *****/ enum{ XmHTMLTEXT_PAPERSIZE_A4 = 0, XmHTMLTEXT_PAPERSIZE_LETTER, XmHTMLTEXT_PAPERSIZE_CUSTOM }; /***** * XmHTMLTextGetFormatted type definitions * (under construction) *****/ enum{ XmHTMLTEXT_PLAIN = 0, /* generate plain ASCII document */ XmHTMLTEXT_FORMATTED, /* generate formatted ASCII document */ XmHTMLTEXT_POSTSCRIPT /* generate formatted Postscript output */ }; /***** * XmHTMLTextGetFormatted Postscript option bits * (under construction) * The MIMIC_FONTS bit instructs XmHTML to use any of the supported postscript * fonts to approach the fonts used in the document. When set, all other font * bits are ignored. When not used, the PSFONT bits can be or'd together. * XmHTML will attempt to do the following mapping: * PSFONT_ROMAN/PSFONT_CENTURY -> default text font; * PSFONT_HELVETICA/PSFONT_LUCIDA -> fixed width font; * If only one of the PSFONT bits is set, the entire document will be rendered * in that font. *****/ #define XmHTMLTEXT_ADDHEADER (1<<1) #define XmHTMLTEXT_ADDFOOTER (1<<2) #define XmHTMLTEXT_PSFONT_ROMAN (1<<3) #define XmHTMLTEXT_PSFONT_HELVETICA (1<<4) #define XmHTMLTEXT_PSFONT_CENTURY (1<<5) #define XmHTMLTEXT_PSFONT_LUCIDA (1<<6) #define XmHTMLTEXT_MIMIC_FONTS (1<<7) /***** * XmHTMLGetHeadAttributes mask bits *****/ #define HeadClear ((unsigned char)0) /* clear everything */ #define HeadDocType (1<<0) /* fill doctype member */ #define HeadTitle (1<<1) /* fill title member */ #define HeadIsIndex (1<<2) /* fill isIndex member */ #define HeadBase (1<<3) /* fill Base member */ #define HeadMeta (1<<4) /* fill meta members */ #define HeadLink (1<<5) /* fill link members */ #define HeadScript (1<<6) /* fill script members */ #define HeadStyle (1<<7) /* fill Style members */ #define HeadAll ((unsigned char)~0) /* fill all members */ /***** * XmImage frame selection flags. * any positive number will return the requested frame. If larger than * total framecount, last frame is returned. *****/ #define AllFrames -1 /* do all frames */ #define FirstFrame -2 /* only use first frame */ #define LastFrame -3 /* only do last frame */ /***** * XmImage configuration flags *****/ #define ImageFSDither (1L<<1) /* Floyd-Steinberg on quantized images */ #define ImageCreateGC (1L<<2) /* create gc for image */ #define ImageWorkSpace (1L<<3) /* create animation workspace */ #define ImageClipmask (1L<<4) /* create clipmask */ #define ImageBackground (1L<<5) /* substitute background pixel */ #define ImageQuantize (1L<<6) /* quantize image */ #define ImageMaxColors (1L<<7) /* sets maximum colors */ #define ImageGifDecodeProc (1L<<8) /* gif lzw decoder function */ #define ImageGifzCmd (1L<<9) /* gif lzw uncompress command */ #define ImageFrameSelect (1L<<10)/* frame selection */ #define ImageScreenGamma (1L<<11)/* gamma correction. JPEG and PNG only */ /****************************************************************************** * Commonly used structures ******************************************************************************/ /***** * Representation of parsed HTML elements *****/ typedef struct _XmHTMLObject{ htmlEnum id; /* internal ID for this element */ String element; /* element text */ String attributes; /* element attributes (if any) */ Boolean is_end; /* true if this is a closing element */ Boolean terminated; /* true if element has closing counterpart */ Cardinal line; /* line number in input for this element */ struct _XmHTMLObject *next; struct _XmHTMLObject *prev; }XmHTMLObject; /***** * Custom papersize definition *****/ typedef struct _XmHTMLPaperSize{ unsigned char unit_type; /* unit in which dimensions are specified */ unsigned char paper_type; /* type of paper: A4, US or custom */ Cardinal width; /* total paper width */ Cardinal height; /* total paper height */ Cardinal left_margin; /* left text margin */ Cardinal right_margin; /* right text margin */ Cardinal top_margin; /* top text margin */ Cardinal bottom_margin; /* bottom text margin */ }XmHTMLPaperSize; /***** * Definition of a HTMLTextPosition. * Should be considered an opaque object. *****/ typedef struct _XmHTMLTextPosition{ struct _XmHTMLObjectTable *start; /* selection start */ int idx; /* first word in selection start */ int nwords; /* no of words in selection start */ int fc; /* first char in selection start */ }XmHTMLTextPosition; /***** * The following structure is returned by the XmHTMLImageDefaultProc convenience * function. When a procedure for the XmNimageProc resource is installed, * it *must* return this structure. *****/ typedef struct _XmImageInfo { /* regular image fields */ String url; /* original location of image */ unsigned char *data; /* raw image data. ZPixmap format */ unsigned char *clip; /* raw clipmask data. XYBitmap format */ Dimension width; /* used image width, in pixels */ Dimension height; /* used image height, in pixels */ Dimension *reds; /* red image pixels */ Dimension *greens; /* green image pixels */ Dimension *blues; /* blue image pixels */ int bg; /* transparent pixel index/type */ unsigned int ncolors; /* Number of colors in the image */ unsigned int options; /* image option bits */ /* image classification fields and original data */ unsigned char type; /* image type, see the IMAGE_ enum above */ unsigned char depth; /* bits per pixel for this image */ unsigned char colorspace; /* colorspace for this image */ unsigned char transparency; /* transparency type for this image */ Dimension swidth; /* image width as read from image */ Dimension sheight; /* image height as read from image */ unsigned int scolors; /* Original number of colors in the image */ /* Special fields for images with an alpha channel */ unsigned char *alpha; /* alpha channel data */ float fg_gamma; /* image gamma */ /* Additional animation data */ int x; /* logical screen x-position for this frame */ int y; /* logical screen y-position for this frame */ int loop_count; /* animation loop count */ unsigned char dispose; /* image disposal method */ int timeout; /* frame refreshment in milliseconds */ int nframes; /* no of animation frames remaining */ struct _XmImageInfo *frame; /* ptr to next animation frame */ XtPointer user_data; /* any data to be stored with this image */ }XmImageInfo, *XmImageInfoStruct; /* XmHTML method to load images */ typedef XmImageInfo* (*XmImageProc)(Widget, String, Dimension, Dimension, XtPointer); /**** * The next two structures constitute the XmImage definition which are used by * the XmImageCreate and XmImageDestroy routines. Please note that the *only* * safe way to destroy an XmImage is to use the XmImageDestroy function. * XmHTML does not use the XmImage structure, it is provided for your * convenience. ****/ /**** * Animation frame data. ****/ typedef struct{ int x; /* x position in logical screen */ int y; /* y position in logical screen */ int w; /* width of this particular frame */ int h; /* height of this particular frame */ int timeout; /* timeout for the next frame */ unsigned char dispose; /* previous frame disposal method */ Pixmap pixmap; /* actual image */ Pixmap clip; /* image clipmask */ Pixmap prev_state; /* previous screen state */ }XmImageFrame; /***** * Actual image definition. * If you want access to the xcc member, include the XCC.h header file. *****/ typedef struct{ String file; /* originating file */ unsigned char type; /* image type, see the IMAGE_ enum below */ Pixmap pixmap; /* actual image */ Pixmap clip; /* for transparant pixmaps */ unsigned int options; /* image option bits */ int width; /* current image width, in pixels */ int height; /* current image height, in pixels */ int ncolors; /* no of colors in this image */ int scolors; /* specified no of colors */ int swidth; /* image width as read from image */ int sheight; /* image height as read from image */ int depth; /* depth of this image */ int npixels; /* no of really allocated pixels */ GC gc; /* graphics context for rendering */ /* animation data */ XmImageFrame *frames; /* array of animation frames */ int nframes; /* no of frames following */ int current_frame; /* current frame count */ int current_loop; /* current loop count */ int loop_count; /* maximum loop count */ XtIntervalId proc_id; /* timer id for animations */ Widget w; /* image owner */ XtAppContext context; /* Application context for animations */ /* private data */ struct _XColorContext *xcc; /* a lot of visual info */ struct _ToolkitAbstraction *tka; }XmImage; /***** * Link member information. *****/ typedef struct { String url; /* value of URL tag */ String rel; /* value of REL tag */ String rev; /* value of REV tag */ String title; /* value of TITLE tag */ }XmHTMLLinkDataRec, *XmHTMLLinkDataPtr; /***** * Meta member information. *****/ typedef struct { String http_equiv; /* value of HTTP-EQUIV tag */ String name; /* value of NAME tag */ String content; /* value of CONTENT tag */ }XmHTMLMetaDataRec, *XmHTMLMetaDataPtr; /***** * XmHTMLHeadAttributes definition *****/ typedef struct{ String doctype; /* doctype data */ String title; /* document title */ Boolean is_index; /* true when the element exists */ String base; /* value of the element */ int num_meta; /* number of META info to process */ XmHTMLMetaDataPtr meta; /* array of META info to process */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ String style_type; /* value of the style type element tag */ String style; /* contents */ String script_lang; /* value of the language element tag */ String script; /* contents */ }XmHTMLHeadAttributes; /***** * Document Information. * images and anchors contain all src and href's in a single string. Entries * are separated by the null char and terminated by two null chars. *****/ typedef struct{ String bg_image; /* background image (if any) */ String images; /* list of all images (if any) */ String anchors; /* list of all anchors (excluding named) */ }XmHTMLDocumentInfo; /***** * XmHTMLFontCacheInfo definition. This structure is returned by the * XmHTMLGetFontCacheInfo convenience routine and contains information about * the font cache bound to the display of a given widget. * The fonts and mapping arrays are in sync: when a name in the fonts array * has a non-NULL entry at the corresponding position in the mapping array, * the value of the mapping entry is the real font being used. *****/ typedef struct{ int nentries; /* total no of cached fonts */ int nmaps; /* of which this many are mapped fonts */ int nlookups; /* no of search actions */ int nrequests; /* no of requests made */ int hits; /* no of hits */ int misses; /* no of misses */ String *fonts; /* array of font names, size nentries */ String *mapping; /* array of font mappings, size nentries */ int nwidgets; /* no of widgets using this cache */ WidgetList widgets; /* array of widgets */ }XmHTMLFontCacheInfo; /***** * forward declaration of XmHTMLAnchorCallback structure *****/ typedef struct _XmHTMLAnchorCallbackStruct *XmHTMLAnchorPtr; /***** * XmHTMLXYToInfo return value * This structure and any of it members may *never* be freed by the caller. *****/ typedef struct { Cardinal line; /* line number at selected position */ Boolean is_map; /* true when clicked image is an imagemap */ int x,y; /* position relative to image corner */ XmImageInfo *image; /* image data */ XmHTMLAnchorPtr anchor; /* possible anchor data */ }XmHTMLInfoStructure, *XmHTMLInfoPtr; /***** * XmHTML progressive object loading * (PLC stands for Progressive Loader Context) *****/ typedef struct _XmHTMLPLCStream{ Cardinal total_in; /* no of bytes received so far */ Cardinal min_out; /* minimum number of bytes requested */ Cardinal max_out; /* maximum number of bytes requested */ XtPointer user_data; /* any data registered on this PLC */ unsigned char pad[24]; /* reserved for future use */ }XmHTMLPLCStream; /***** * External GIF decoder stream object. This is the only argument to any * procedure installed on the XmNdecodeGIFProc resource. * * The first block is kept up to date by XmHTML and is read-only. When state * is GIF_STREAM_INIT, the decoder should initialize it's private data and store * it in the external_state field so that it can be used for successive calls * to the decoder. When state is GIF_STREAM_FINAL, the decoder should wrapup * and flush all pending data. It can also choose to destruct it's internal * data structures here (another call with state set to GIF_STREAM_END will be * made when the internal loader is destroying it's internal objects as * well). * * All following fields are the ``public'' fields and must be updated by the * external decoder. The msg field can be set to an error message if the * external decoder fails for some reason. XmHTML will then display this * error message and abort this image. *****/ typedef struct _XmHTMLGIFStream{ /* read-only fields */ int state; /* decoder state */ int codesize; /* initial LZW codesize */ Boolean is_progressive; /* when used by a progressive loader */ unsigned char *next_in; /* next input byte */ Cardinal avail_in; /* number of bytes available at next_in */ Cardinal total_in; /* total nb of input bytes read so far */ /* fields to be updated by caller */ unsigned char *next_out; /* next output byte should be put there */ Cardinal avail_out; /* remaining free space at next_out */ Cardinal total_out; /* total nb of bytes output so far */ String msg; /* last error message, or NULL */ XtPointer external_state; /* room for decoder-specific data */ }XmHTMLGIFStream; /* and the proto for the XmNdecodeGIFProc resource */ typedef int (*XmImageGifProc)(XmHTMLGIFStream*); /***** * Progressive Loading function prototypes. * XmHTMLGetDataProc: proto for function installed on the * XmNprogressiveReadProc resource; * XmHTMLEndDataProc: proto for function installed on the * XmNprogressiveEndProc resource; *****/ typedef int (*XmHTMLGetDataProc)(XmHTMLPLCStream*, XtPointer); typedef void (*XmHTMLEndDataProc)(XmHTMLPLCStream*, XtPointer, int, Boolean); /***** * possible values for the third argument on the EndDataProc *****/ enum{ /* XmHTML_NONE = 0 */ /* PLCObject referenced by all objects */ XmPLC_IMAGE, /* PLCObject for an image */ XmPLC_DOCUMENT, /* PLCObject for a document */ XmPLC_FINISHED /* indicates all plc's have been processed */ }; /***** * XmImage configuration *****/ typedef struct{ unsigned long flags; /* XmImage configuration flags, see above */ int ncolors; /* desired number of colors */ int which_frames; /* animation frames selection flag */ int bg_color; /* background pixel on transparent images */ String z_cmd; /* gif uncompress command */ XmImageGifProc gif_proc; /* external gif decoder */ float gamma; /* gamma correction. JPEG and PNG only */ struct _ToolkitAbstraction *tka; /* private data */ }XmImageConfig; /***** * HTML4.0 Event structure *****/ typedef struct _XmHTMLEvent{ int type; /* HTML4.0 event type, see above */ String script; /* contents of event */ }XmHTMLEvent; /***** * XmNobjectCallback tag_attributes substructure. *****/ typedef struct{ unsigned long flags; /* defines which fields have a value */ String attributes; /* unfiltered attributes */ String classid; /* contents of the classid attribute */ String codebase; /* contents of the codebase attribute */ String data; /* location of object data */ String src; /* location of object data */ String type; /* type of object data */ String codetype; /* type of codebase */ String standby; /* message to display while loading */ String align; /* global alignment */ String halign; /* horizontal alignment */ String valign; /* vertical alignment */ int height; /* following five fields are always integers*/ int width; int border; /* border = 0: no border */ int hspace; int vspace; String usemap; /* location or name of imagemap */ String background; /* location of background image */ String bgcolor; /* name of background color */ String href; /* hyperlink reference */ String name; /* named hyperlink */ XmHTMLEvent *events; /* defined events */ int nevents; /* no of events */ }XmHTMLTagAttributes; /***** * The XmHTMLElementId and XmHTMLObjectId are opaque structures. They * are fully defined in XmHTMLP.h *****/ typedef struct _XmHTMLParserTag *XmHTMLElementId; typedef struct _XmHTMLExtObj *XmHTMLObjectId; /****************************************************************************** * Callback structures * Unless explicitly mentioned, *none* of these structures (or any of its * members) may be freed. ******************************************************************************/ /***** * XmNactivateCallback and XmNanchorTrackCallback callback structure. *****/ typedef struct _XmHTMLAnchorCallbackStruct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ URLType url_type; /* type of url referenced */ Cardinal line; /* line number of the selected anchor */ String href; /* pointer to the anchor value */ String target; /* pointer to target value */ String rel; /* pointer to rel value */ String rev; /* pointer to rev value */ String title; /* pointer to title value */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* local anchor vetoing flag */ Boolean visited; /* local anchor visited flag */ Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLAnchorCallbackStruct; typedef Boolean (*XmHTMLAnchorProc)(Widget, String, XtPointer); /***** * XmNeventCallback callback structure. * * Note on the doc_modified field: this field *MUST* be set to True if the * processing of this event leads to a modification of the currently * displayed document (XmHTMLTextSetString for example) or even destruction * of the widget. It informs XmHTML of the fact that it can no longer rely on * the consistency of it's internal data structures. * * Note on processing of the XmCR_HTML_LOAD and XmCR_HTML_UNLOAD events: * processing of these events may *NEVER* cause a modification of the currently * displayed document. It is a FATAL ERROR if it does change: XmHTML can no * longer guarantee the consistency of it's internal data. *****/ typedef struct{ int reason; /* the reason the event was called */ XEvent *event; /* event triggering this action */ int type; /* HTML4.0 event type, see above */ XtPointer data; /* HTML4.0 event callback data */ Boolean doc_modified; /* Set to True when document is modified*/ }XmHTMLEventCallbackStruct, *XmHTMLEventCallbackPtr; /***** * XmNdocumentCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* always NULL for XmNdocumentCallback */ Boolean html32; /* True if document was HTML 3.2 conforming */ Boolean verified; /* True if document has been verified */ Boolean balanced; /* True if parser tree is balanced */ Boolean terminated; /* True if parser terminated prematurely */ int pass_level; /* current parser level count. Starts at 1 */ Boolean redo; /* perform another pass? */ }XmHTMLDocumentCallbackStruct, *XmHTMLDocumentPtr; /***** * XmNformCallback callback structure. *****/ /***** * Form Component data *****/ typedef struct { componentType type; /* Form component type */ String name; /* component name */ String value; /* component value */ }XmHTMLFormDataRec, *XmHTMLFormDataPtr; /***** * Actual XmNformCallback callback structure. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String action; /* URL or cgi-bin destination */ String enctype; /* form encoding */ int method; /* Form Method, GET, POST or PIPE */ int ncomponents; /* no of components in this form */ XmHTMLFormDataPtr components; Boolean doc_modified; /* Set to True when document is modified */ }XmHTMLFormCallbackStruct, *XmHTMLFormPtr; /***** * XmNframeCallback callback structure. * This callback is activated when one of the following events occurs: * 1. XmHTML wants to create a frame, reason = XmCR_HTML_FRAMECREATE * can be veto'd by setting doit to False and supplying a HTML widget * id yourself; * 2. XmHTML wants to destroy a frame, reason = XmCR_HTML_FRAMEDESTROY * can be veto'd by setting doit to False (widget reuse). * 3. XmHTML has finished creating a frame, reason = XmCR_HTML_FRAME. * This is the time to attach callbacks and set additional resources on the * newly created XmHTMLWidget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ String src; /* requested document */ String name; /* frame name */ Widget html; /* XmHTML widget id */ Boolean doit; /* destroy/create vetoing flag */ }XmHTMLFrameCallbackStruct, *XmHTMLFramePtr; /***** * XmNimagemapCallback callback structure. * callback reasons can be one of the following: * XmCR_HTML_IMAGEMAP_ACTIVATE * user clicked on an image. Valid fields are x, y and image_name. x and y * are relative to the upper-left corner of the image. Only invoked when * an image has it's ismap attribute set and no client-side imagemap is * present for this image. * XmCR_HTML_IMAGEMAP * an image requires an external imagemap. The only valid field is map_name * which contains the location of the imagemap to fetch. If the contents * of this imagemap is set in the map_contents field, it will be loaded * by the widget. Alternatively, one could also use the XmHTMLAddImagemap * convenience routine to set an imagemap into the widget. *****/ typedef struct { int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int x,y; /* position relative to the upper-left image corner */ String image_name; /* name of referenced image, value of src attribute */ String map_name; /* name of imagemap to fetch/referenced */ String map_contents;/* contents of fetched imagemap */ XmImageInfo *image; /* image data */ }XmHTMLImagemapCallbackStruct, *XmHTMLImagemapPtr; /***** * XmNlinkCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int num_link; /* number of LINK info to process */ XmHTMLLinkDataPtr link; /* array of LINK info to process */ }XmHTMLLinkCallbackStruct, *XmHTMLLinkPtr; /***** * XmNpageCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ Cardinal total_pages; /* no of pages in document */ }XmHTMLPageCallbackStruct, *XmHTMLPagePtr; /***** * XmNobjectCallback callback structure. *****/ typedef struct{ int reason; /* the reason the callback was called */ XEvent *event; /* event structure that triggered callback */ int object_id; /* id of object, set by XmHTML */ int tag_id; /* HTML tag identifying an embedded object */ XtPointer tag_user_data;/* any data associated with this tag */ XmHTMLTagAttributes *attributes; /* parsed attributes, immutable */ Widget parent; /* Widget id of parent. */ Widget object; Window window; Boolean scrollable; /* If True, object is part of document * If False, object stays on top of document. */ Boolean wrap; /* Only used when scrollable == False. * If False, document scrolls underneath * the object. * If True, document scrolls around object. */ Boolean reparent; /* If True, XmHTML will reparent the window */ XtPointer user_data; /* additional data registered for this object. * Unused by XmHTML. */ /* Next two fields are only meaningfull when scrollable == False */ int x; /* suggested upper-left position */ int y; /* suggested upper-left position */ Dimension width; /* suggested object width */ Dimension height; /* suggested object height */ Boolean is_frame; /* true when inside a frame */ Boolean doit; /* destruct veto flag */ }XmHTMLObjectCallbackStruct, *XmHTMLObjectPtr; /* Don't add anything after this endif! */ #endif /* _HTML_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/toolkit.h100644 23564 23564 21522 6624060311 16501 0ustar newtnewt/***** * toolkit.h : Gtk/XmHTML function & data type wrappers * * This file Version $Revision: 1.2 $ * * Creation date: Thu Jan 8 04:32:19 GMT+0100 1998 * Last modification: $Date: 1998/04/27 07:03:52 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by 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. * * About this file: * * XmHTML is originally an Xt/Motif based Widget. To make porting to * other toolkits a bit easier, XmHTML uses a toolkit abstraction and a * set of defines that allow you to replace all X/Xt/Xm functions used by * XmHTML. * * All Xt/Xm functions are wrapped together in what I call a * ToolkitAbstraction (see tka.h for the definition, motif.c for * the Motif ToolkitAbstraction and gtk.c for the gtk ToolkitAbstraction). * * There is one assumption though: that you never include a header containing * Xt or Xm specifics. If you do this however, you will need to override * a whole bunch of routines, typedefs and constants (don't worry, they * are all listed). * *****/ /***** * $Source: /usr/local/rcs/Newt/XmHTML/RCS/toolkit.h,v $ *****/ /***** * ChangeLog * $Log: toolkit.h,v $ * Revision 1.2 1998/04/27 07:03:52 newt * more tka stuff * * Revision 1.1 1998/04/04 06:27:29 newt * Initial Revision * *****/ #ifndef _toolkit_h_ #define _toolkit_h_ #include #include /* Required for at least font properties */ #include #include /* Private Header to be included for Gtk */ #define XmHTMLPrivateHeader "gtk-xmhtml-p.h" /* No XCCP.h as our XCC adaption has been integrated in gdk :-) */ /* #define HAVE_XCCP_H */ /* No illegal xt access 'cause we're not using xt at all! */ #ifndef NO_XLIB_ILLEGAL_ACCESS #define NO_XLIB_ILLEGAL_ACCESS 1 #endif /***** * Define if you want XmHTML not to use illegal access to gdk/gtk data * structures *****/ /* #undef NO_GTK_ILLEGAL_ACCESS */ /***** * X/Xt types & constants for which gdk/gtk provides it's own implementation. *****/ /* common types */ typedef GdkColor XCOLOR; typedef GdkColormap *COLORMAP; typedef GdkPixmap *PIXMAP; typedef GdkWindow *WINDOW; typedef GdkImage XIMAGE; typedef GdkFont XFONTSTRUCT; typedef GdkVisual VISUAL; typedef GdkGC *XGC; typedef GdkDrawable *DRAWABLE; typedef XCharStruct XCHARSTRUCT; /* no gdk equivalent */ typedef GdkEvent XEVENT; typedef GdkEventButton XBUTTONPRESSEDEVENT; typedef GdkEventButton XBUTTONRELEASEDEVENT; /* Color access macros */ #define GETP(c) (c).pixel #define GETR(C) (c).red #define GETG(C) (c).green #define GETB(C) (c).blue #define GETPP(c) (c)->pixel #define GETPR(c) (c)->red #define GETPG(c) (c)->green #define GETPB(c) (c)->blue /* byte ordering for this host */ #define LSBFIRST GDK_LSB_FIRST #define MSBFIRST GDK_MSB_FIRST /***** * Provide (or override) a number of Xt typedefs *****/ #ifdef _XtIntrinsic_h /* Gtk applications should never include */ #error Gtk/XmHTML may not include . #else /***** * typedefs for Xlib/Xt types used throughout XmHTML. * Note that Pixel is also a typedef: it is not defined by Xlib but by * the Intrinsics toolkit. *****/ typedef GtkWidget *Widget; typedef GtkWidget **WidgetList; typedef gpointer XtAppContext; typedef GList XtCallbackList; typedef gint XtIntervalId; typedef gpointer XtPointer; typedef gchar *String; typedef guint Cardinal; typedef gushort Dimension; typedef gshort Position; typedef gulong Pixel; /* Straight from Intrinsic.h */ #ifdef CRAY typedef glong Boolean; typedef glong XtEnum; #else typedef gchar Boolean; typedef guchar XtEnum; #endif /* CRAY */ #endif /***** * X Function Wrappers *****/ #define TkaCurrentTime GDK_CURRENT_TIME /***** * XFontStruct access macro's *****/ #define TkaFont(XF) (GDK_FONT_XFONT(XF)) #define TkaFontLeftBearing(XF) ((TkaFont(XF))->max_bounds.lbearing) #define TkaFontRightBearing(XF) ((TkaFont(XF))->max_bounds.rbearing) #define TkaFontWidth(XF) ((TkaFont(XF))->max_bounds.width) #define TkaFontAscent(XF) ((TkaFont(XF))->ascent) #define TkaFontDescent(XF) ((TkaFont(XF))->descent) #define TkaFontMaxAscent(XF) ((TkaFont(XF))->max_bounds.ascent) #define TkaFontMaxDescent(XF) ((TkaFont(XF))->max_bounds.descent) #define TkaFontLineheight(XF) (TkaFont(XF))->ascent + (TkaFont(XF))->descent) /***** * XImage wrappers & access macros. *****/ #define TkaImageData(image) \ (image->mem) /* GdkImage has bytes per pixel, not bits per pixel */ #define TkaImageBitsPerPixel(image) \ (image->bpp*8) #define TkaImageBytesPerLine(image) \ (image->bpl) #define TkaImageByteOrder(image) \ (image->byte_order) #define TkaImageBitmapBitOrder(image) \ (((GdkImagePrivate*)image)->ximage->bitmap_bit_order) /***** * check support for various combinations of bits per pixel * FIXME: * Gdk misses support for 2 and 4 bits per pixel. *****/ #define TkaImageCheck2bpp(image) FALSE #define TkaImageCheck4bpp(image) FALSE #define TkaImageCheck24bpp(image) (image->bpp == 3) #define TkaImageCheck32bpp(image) (image->bpp == 4) /***** * Xt Function wrappers *****/ /* Check for the presence of a callback function */ #define TkaHasCallback(W,C) \ gtk_xmhtml_signal_get_handlers (W, gtk_xmthml_signals[GTK_XMHTML_##C) /* Activate a callback function */ #define TkaCallCallbackList(W,C,D) \ gtk_signal_emit(GTK_OBJECT(W), gtk_xmhtml_signals[GTK_XMHTML_##C], D) /* Set the position of a scrollbar slider */ #define TkaScrollbarSliderSetPosition(W,V) do{ \ GtkAdjustment *adj = gtk_range_get_adjustment(GTK_RANGE((W))); \ gtk_adjustment_set_value(adj, (gfloat)(V)); \ }while(0) /* XtName, XtClass */ #ifdef NO_GTK_ILLEGAL_ACCESS #define TkaWidgetName(w) gtk_widget_get_name(GTK_WIDGET(w)) #define TkaWidgetClassName(w) gtk_type_name(GTK_WIDGET_TYPE(w)) #else #define TkaWidgetName(w) ((w)->name == NULL ? "(unnamed)" : (w)->name) #define TkaWidgetClassName(w) ((w)->object->klass->type) #endif #define XtAppWarning(CTX,MSG) g_warning(MSG) #define XtWarning(MSG) g_warning(MSG) #define XtAppError(CTX,MSG) g_error(MSG) #define XtError(MSG) g_error(MSG) /* gdk doesn't have the concept of Application Contexts */ #define XtWidgetToApplicationContext(widget) NULL /***** * Motif Wrappers *****/ /***** * In Motif, XmUpdateDisplay causes all events that are still left on the * queue to be flushed *AND* to wait until all requests have been delivered. * I guess an XFlush followed by an XSync will do the same (sort of). *****/ #define XmUpdateDisplay(widget) do { \ gdk_flush(); \ }while(0) /***** * Widget internal access wrappers *****/ #define HTML_ATTR(field) ((XmHTMLWidget)html)->html.field #define CORE_ATTR(field) (GTK_WIDGET(html)->allocation).field #define MGR_ATTR(field) ((XmHTMLWidget)html)->manager.field /* subclass access methods */ #define ATTR_CORE(widget,field) \ (GTK_WIDGET((widget))->allocation).(field) #define ATTR_MGR(widget,field) \ ((XmHTMLWidget)widget)->manager.field #define ATTR_HTML(widget,field) \ ((XmHTMLWidget)widget)->html.field /* widely used subclass properties */ #define TkaGetColormap(widget) gtk_widget_get_colormap (GTK_WIDGET (widget)) #define TkaVisualGetDepth(widget) \ ATTR_HTML(widget,xcc->visual->depth) #define TkaVisualGetMapEntries(visual) \ GDK_VISUAL_XVISUAL(visual)->map_entries /***** * XColorContext Wrappers *****/ #define XCCCreate(w,v,c) \ gdk_color_context_new (v, c) #define XCCFree(c) \ gdk_color_context_free (c) #define XCCGetDepth(c) \ (c)->visual->depth #define XCCGetNumColors(c) \ (c)->num_colors #define XCCGetParentVisual(w) \ gtk_widget_get_visual(w) #define XCCGetPixels(cc,r,g,b,n,co,a) \ gdk_color_context_get_pixels (cc,r,g,b,n,co,a) #define XCCGetPixelsIncremental(cc,r,g,b,n,u,co,na) do{ \ gdk_color_context_get_pixels_incremental (cc,r,g,b,n,u,co,na); \ }while (0) #define XCCAddPalette(c,p,n) \ gdk_color_context_add_palette (c,p,n) #define XCCInitDither(cc) \ gdk_color_context_init_dither (cc) #define XCCGetIndexFromPalette(cc,r,g,b,f) \ gdk_color_context_get_index_from_palette(cc,r,g,b,f) #define XCCFreeDither(cc) \ gdk_color_context_free_dither (cc) typedef GdkColorContextDither XCCDither; /* Don't add anything after this endif! */ #endif /* _toolkit_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/tka.h100644 23564 23564 34560 6624060000 15574 0ustar newtnewt/***** * tka.h : XmHTML Toolkit Abstraction Public Interface, Gtk version. * * This file Version $Revision: 1.1 $ * * Creation date: Mon Sep 28 08:49:25 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by Ripley Software Development * All Rights Reserved * * This file is part of no particular project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program 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 * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****/ /***** * $Source$ *****/ /***** * ChangeLog * $Log$ * *****/ #ifndef _tka_h_ #define _tka_h_ #ifndef NeedFunctionPrototypes #ifdef __STDC__ #define NeedFunctionPrototypes 1 #endif /* __STDC__ */ #endif /* NeedFunctionPrototypes */ /***** * Toolkit independent rendering functions. This enables us to use the * same engine for rendering to a display, text or postscript. * * This abstraction makes it a *lot* easier when porting XmHTML to other * toolkits, provided the display functions know how to deal/convert the * X-specific types. *****/ #define GC_FILL_SOLID 0 #define GC_FILL_TILED 1 #define GC_FILL_STIPPLED 2 #define GC_FILL_OPAQUE_STIPPLED 3 #define GC_CAP_NOT_LAST 0 #define GC_CAP_BUTT 1 #define GC_CAP_ROUND 2 #define GC_CAP_PROJECTING 3 #define GC_LINE_SOLID 0 #define GC_LINE_ON_OFF_DASH 1 #define GC_LINE_DOUBLE_DASH 2 #define GC_JOIN_MITER 0 #define GC_JOIN_ROUND 1 #define GC_JOIN_BEVEL 2 #define GC_GXcopy 0 #define GC_COORDMODE_ORIGIN 0 #define GC_COORDMODE_PREVIOUS 1 typedef struct _ToolkitAbstraction{ void *dpy; /* unused by gtk/XmHTML */ GdkDrawable *win; /* render area */ Drawable defaultRoot; /* this is an X drawable, not a gtk drawable */ /***** * Screen definitions *****/ gint width; /* width in pixels */ gint height; /* height in pixels */ gint widthMM; /* width in millimeters */ gint heightMM; /* height in millimeters */ /********** * Xlib function wrappers **********/ /***** * GC properties *****/ gint fill_style[4]; gint cap_style[4]; gint line_style[3]; gint join_style[3]; gint gc_func[2]; gint coord_mode[2]; /***** * GC functions *****/ GdkGC* (*CreateGC)( #ifdef NeedFunctionPrototypes void* /* display */, GdkWindow* /* d */, gulong /* valuemask */, GdkGCValues* /* values */ #endif ); gint (*FreeGC)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */ #endif ); gint (*CopyGC)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* src */, gulong /* valuemask */, GdkGC* /* dest */ #endif ); gint (*SetFunction)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gint /* function */ #endif ); gint (*SetClipMask)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, GdkPixmap* /* pixmap */ #endif ); gint (*SetClipOrigin)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gint /* clip_x_origin */, gint /* clip_y_origin */ #endif ); gint (*SetTile)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, GdkPixmap* /* tile */ #endif ); gint (*SetTSOrigin)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gint /* ts_x_origin */, gint /* ts_y_origin */ #endif ); gint (*SetFillStyle)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gint /* fill_style */ #endif ); gint (*SetFont)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, struct _XmHTMLFont* /* font */ #endif ); gint (*SetForeground)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gulong /* foreground */ #endif ); gint (*SetBackground)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, gulong /* background */ #endif ); gint (*SetLineAttributes)( #ifdef NeedFunctionPrototypes void* /* display */, GdkGC* /* gc */, guint /* line_width */, gint /* line_style */, gint /* cap_style */, gint /* join_style */ #endif ); /***** * Font functions *****/ XFontStruct* (*LoadQueryFont)( #ifdef NeedFunctionPrototypes void* /* display */, const gchar* /* name */ #endif ); gint (*FreeFont)( #ifdef NeedFunctionPrototypes void* /* display */, GdkFont* /* font_struct */ #endif ); gint (*GetFontProperty)( #ifdef NeedFunctionPrototypes GdkFont* /* font_struct */, Atom /* atom */, gulong* /* value_return */ #endif ); /***** * Cursor & pointer functions *****/ gint (*UngrabPointer)( #ifdef NeedFunctionPrototypes void* /* display */, Time /* time */ #endif ); gint (*DefineCursor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkWindow* /* w */, GdkCursor* /* cursor */ #endif ); gint (*UndefineCursor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkWindow* /* w */ #endif ); gint (*FreeCursor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkCursor* /* cursor */ #endif ); /***** * Color functions *****/ gint (*ParseColor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkColormap* /* colormap */, const gchar* /* spec */, GdkColor* /* exact_def_return */ #endif ); gint (*AllocColor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkColormap* /* colormap */, GdkColor* /* screen_in_out */ #endif ); gint (*QueryColor)( #ifdef NeedFunctionPrototypes void* /* display */, GdkColormap* /* colormap */, GdkColor* /* def_in_out */ #endif ); gint (*QueryColors)( #ifdef NeedFunctionPrototypes void* /* display */, GdkColormap* /* colormap */, GdkColor* /* defs_in_out */, gint /* ncolors */ #endif ); gint (*FreeColors)( #ifdef NeedFunctionPrototypes void* /* display */, GdkColormap* /* colormap */, gulong* /* pixels */, gint /* npixels */, gulong /* planes */ #endif ); /***** * Pixmap functions *****/ GdkPixmap* (*CreatePixmap)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, guint /* width */, guint /* height */, guint /* depth */ #endif ); GdkPixmap* (*CreatePixmapFromBitmapData)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, gchar* /* data */, guint /* width */, guint /* height */, gulong /* fg */, gulong /* bg */, guint /* depth */ #endif ); gint (*FreePixmap)( #ifdef NeedFunctionPrototypes void* /* display */, GdkPixmap* /* pixmap */ #endif ); /***** * XImage functions *****/ GdkImage *(*CreateImage)( #ifdef NeedFunctionPrototypes void* /* display */, GdkVisual* /* visual */, guint /* depth */, gint /* format */, gint /* offset */, gchar* /* data */, guint /* width */, guint /* height */, gint /* bitmap_pad */, gint /* bytes_per_line */ #endif ); void (*DestroyImage)( #ifdef NeedFunctionPrototypes GdkImage *image /* image */ #endif ); gint (*PutImage)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, GdkImage* /* image */, gint /* src_x */, gint /* src_y */, gint /* dest_x */, gint /* dest_y */, guint /* width */, guint /* height */ #endif ); GdkImage (*GetImage)( #if NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, gint /* x */, gint /* y */, guint /* width */, guint /* height */, gulong /* plane_mask */, gint /* format */ #endif ); gulong (*GetPixel)( #if NeedFunctionPrototypes GdkImage* /* image */, gushort /* x coordinate */, gushort /* y coordinate */ #endif ); /***** * string/text functions *****/ gint (*TextWidth)( #ifdef NeedFunctionPrototypes GdkFont* /* font_struct */, const gchar* /* string */, gint /* count */ #endif ); gint (*TextExtents)( #ifdef NeedFunctionPrototypes GdkFont* /* font_struct */, const gchar* /* string */, gint /* nchars */, gint* /* direction_return */, gint* /* font_ascent_return */, gint* /* font_descent_return */, XCharStruct* /* overall_return, no gdk equiv. */ #endif ); /***** * Render functions *****/ gint (*DrawString)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, struct _XmHTMLFont* /* font */, GdkGC* /* gc */, gint /* x */, gint /* y */, const gchar* /* string */, gint /* length */ #endif ); /***** * Render functions *****/ gint (*DrawLine)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, gint /* x1 */, gint /* x2 */, gint /* y1 */, gint /* y2 */ #endif ); gint (*DrawLines)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, GdkPoint* /* points */, gint /* npoints */, gint /* mode */ #endif ); gint (*DrawRectangle)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, gint /* x */, gint /* y */, guint /* width */, guint /* height */ #endif ); gint (*FillRectangle)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, gint /* x */, gint /* y */, guint /* width */, guint /* height */ #endif ); gint (*DrawArc)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, gint /* x */, gint /* y */, guint /* width */, guint /* height */, gint /* angle1 */, gint /* angle2 */ #endif ); gint (*FillArc)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* d */, GdkGC* /* gc */, gint /* x */, gint /* y */, guint /* width */, guint /* height */, gint /* angle1 */, gint /* angle2 */ #endif ); /***** * misc. functions *****/ gint (*CopyArea)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* src */, GdkDrawable* /* dest */, GdkGC* /* gc */, gint /* src_x */, gint /* src_y */, guint /* width */, guint /* height */, gint /* dest_x */, gint /* dest_y */ #endif ); gint (*ClearArea)( #ifdef NeedFunctionPrototypes void* /* display */, GdkDrawable* /* w */, gint /* x */, gint /* y */, guint /* width */, guint /* height */, Boolean /* exposures */ #endif ); gint (*Sync)( #ifdef NeedFunctionPrototypes void* /* display */, Boolean /* discard */ #endif ); /********** * X Toolkit Intrinsics wrappers **********/ Boolean (*IsRealized)( #ifdef NeedFunctionPrototypes GtkWidget* /* widget */ #endif ); Boolean (*IsManaged)( #ifdef NeedFunctionPrototypes GtkWidget* /* rectobj */ #endif ); void (*ManageChild)( #ifdef NeedFunctionPrototypes GtkWidget* /* child */ #endif ); void (*UnmanageChild)( #ifdef NeedFunctionPrototypes GtkWidget* /* child */ #endif ); void (*MoveWidget)( #ifdef NeedFunctionPrototypes GtkWidget* /* widget */, gshort /* x */, gshort /* y */ #endif ); void (*ResizeWidget)( #ifdef NeedFunctionPrototypes GtkWidget* /* widget */, gushort /* width */, gushort /* height */, gushort /* border_width */ #endif ); void (*ConfigureWidget)( #ifdef NeedFunctionPrototypes GtkWidget* /* widget */, gshort /* x */, gshort /* y */, gushort /* width */, gushort /* height */, gushort /* border_width */ #endif ); void (*DestroyWidget)( #ifdef NeedFunctionPrototypes GdkWidget* /* widget */ #endif ); void (*SetMappedWhenManaged)( #ifdef NeedFunctionPrototypes GtkWidget* /* widget */, Boolean /* mapped_when_managed */ #endif ); void (*RemoveTimeOut)( #ifdef NeedFunctionPrototypes guint /* timer */ #endif ); guint (*AddTimeOut)( #ifdef NeedFunctionPrototypes void* /* app_context */, guint32 /* interval */, GtkFunction /* proc */, gpointer /* closure */ #endif ); /********** * Motif Wrappers **********/ void (*DrawShadows)( #ifdef NeedFunctionPrototypes void *display, GdkDrawable* d, GdkGC* top_gc, GdkGC* bottom_gc, #if NeedWidePrototypes gint x, gint y, gint width, gint height, gint shad_thick, #else gshort x, gshort y, gushort width, gushort height, gushort shad_thick, #endif /* NeedWidePrototypes */ guint shad_type #endif ); /********** * Implementation Specific data **********/ void *data; void (*FreeData)( #ifdef NeedFunctionPrototypes void* #endif ); }ToolkitAbstraction; /* Create a new toolkit abstraction */ extern ToolkitAbstraction *XmHTMLTkaCreate(void); /* destroy a toolkit abstraction */ extern void XmHTMLTkaDestroy(ToolkitAbstraction *tka); /* Supply a new toolkit abstraction to a XmHTML Widget */ #ifdef NOTYET extern Boolean XmHTMLTkaSet(GtkWidget *w, ToolkitAbstraction *tka); #endif /* Set the render area for a tka to use */ extern void XmHTMLTkaSetDrawable(ToolkitAbstraction *tka, GdkDrawable *drawable); /* Set the display area for a tka to use */ extern void XmHTMLTkaSetDisplay(ToolkitAbstraction *tka, GtkWidget *w); /* Recompute new top, bottom & highlight colors */ extern void XmHTMLTkaRecomputeColors(XmHTMLWidget html, Pixel bg_pixel); /* Recompute highlight color */ extern void XmHTMLTkaRecomputeHighlightColor(XmHTMLWidget html, Pixel bg_pixel); /* Recompute top & shadow colors */ extern void XmHTMLTkaRecomputeShadowColors(XmHTMLWidget html, Pixel base); /* Don't add anything after this endif! */ #endif /* _tka_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/gtk-tka.h100644 23564 23564 11450 6610747573 16376 0ustar newtnewt/***** * gtk-tka.h : Gtk/XmHTML Toolkit Abstraction Public Interface * * This file Version $Revision: 1.1 $ * * Creation date: Mon Sep 28 08:49:25 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by Ripley Software Development * All Rights Reserved * * This file is part of no particular project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program 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 * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****/ /***** * $Source$ *****/ /***** * ChangeLog * $Log$ * *****/ #ifndef _tka_h_ #define _tka_h_ /***** * Toolkit independent rendering functions. This enables us to use the * same engine for rendering to a display, text or postscript. * * This abstraction makes it a *lot* easier when porting XmHTML to other * toolkits, provided the display functions know how to deal/convert the * X-specific types. *****/ #define GC_FILL_SOLID 0 #define GC_FILL_TILED 1 #define GC_FILL_STIPPLED 2 #define GC_FILL_OPAQUE_STIPPLED 3 #define GC_CAP_NOT_LAST 0 #define GC_CAP_BUTT 1 #define GC_CAP_ROUND 2 #define GC_CAP_PROJECTING 3 #define GC_LINE_SOLID 0 #define GC_LINE_ON_OFF_DASH 1 #define GC_LINE_DOUBLE_DASH 2 #define GC_JOIN_MITER 0 #define GC_JOIN_ROUND 1 #define GC_JOIN_BEVEL 2 #define GC_GXcopy 0 #define GC_COORDMODE_ORIGIN 0 #define GC_COORDMODE_PREVIOUS 1 typedef struct _ToolkitAbstraction{ void *dpy; GdkWindow *win; Window DefaultRoot; /***** * Screen definitions *****/ gint width; /* width in pixels */ gint height; /* height in pixels */ gint widthMM; /* width in millimeters */ gint heightMM; /* height in millimeters */ /********** * Xlib function wrappers **********/ /***** * GC properties *****/ gint fill_style[4]; gint cap_style[4]; gint line_style[3]; gint join_style[3]; gint gc_func[2]; gint coord_mode[2]; /***** * GC functions *****/ GdkGC *(*CreateGC)(); gint (*FreeGC)(); gint (*CopyGC)(); gint (*SetFunction)(); gint (*SetClipMask)(); gint (*SetClipOrigin)(); gint (*SetTile)(); gint (*SetTSOrigin)(); gint (*SetFillStyle)(); gint (*SetFont)(); gint (*SetForeground)(); gint (*SetBackground)(); gint (*SetLineAttributes)(); /***** * Font functions *****/ GdkFont* (*LoadQueryFont)(); gint (*FreeFont)(); gint (*GetFontProperty)(); /***** * Cursor & pointer functions *****/ gint (*UngrabPointer)(); gint (*DefineCursor)(); gint (*UndefineCursor)(); gint (*FreeCursor)(); /***** * Color functions *****/ gint (*ParseColor)(); gint (*AllocColor)(); gint (*QueryColor)(); gint (*QueryColors)(); gint (*FreeColors)(); /***** * Pixmap functions *****/ GdkPixmap *(*CreatePixmap)(); GdkPixmap *(*CreatePixmapFromBitmapData)(); gint (*FreePixmap)(); /***** * XImage functions *****/ GdkImage *(*CreateImage)(); void (*DestroyImage)(); gint (*PutImage)(); GdkImage *(*GetImage)(); gulong (*GetPixel)(); /***** * string/text functions *****/ gint (*TextWidth)(); gint (*TextExtents)(); gint (*DrawString)(); /***** * Render functions *****/ gint (*DrawLine)(); gint (*DrawLines)(); gint (*DrawRectangle)(); gint (*FillRectangle)(); gint (*DrawArc)(); gint (*FillArc)(); /***** * misc. functions *****/ gint (*CopyArea)(); gint (*ClearArea)(); gint (*Sync)(); /********** * X Toolkit Intrinsics wrappers **********/ Boolean (*IsRealized)(); Boolean (*IsManaged)(); void (*ManageChild)(); void (*UnmanageChild)(); void (*MoveWidget)(); void (*ResizeWidget)(); void (*ConfigureWidget)(); void (*DestroyWidget)(); void (*SetMappedWhenManaged)(); void (*RemoveTimeOut)(); glong (*AddTimeOut)(); /********** * Motif Wrappers **********/ void (*DrawShadows)(); /********** * Implementation Specific data **********/ void *data; void (*FreeData)(); }ToolkitAbstraction; /* Create a new toolkit abstraction */ extern ToolkitAbstraction *XmHTMLToolkitAbstractionCreate(void); /* destroy a toolkit abstraction */ extern void XmHTMLToolkitAbstractionDestroy(ToolkitAbstraction *tka); /* Supply a new toolkit abstraction to a XmHTML Widget */ extern Boolean XmHTMLToolkitAbstractionSet(Widget w, ToolkitAbstraction *tka); /* Don't add anything after this endif! */ #endif /* _tka_h_ */ XmHTML-1.1.7/include/gtk-xmhtml/gtk-xmhtmlfuncs.h100644 23564 23564 11143 6610746065 20161 0ustar newtnewt/***** * XmHTMLfuncs.h : memory allocation macros. * * This file Version $Revision: 1.18 $ * * Creation date: Tue Dec 3 15:00:14 GMT+0100 1996 * Last modification: $Date: 1998/04/27 06:58:02 $ * 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/XmHTMLfuncs.h,v $ *****/ /***** * ChangeLog * $Log: XmHTMLfuncs.h,v $ * Revision 1.18 1998/04/27 06:58:02 newt * Added a few more default values * * Revision 1.17 1998/04/04 06:27:56 newt * XmHTML Beta 1.1.3 * * Revision 1.16 1997/10/23 00:24:48 newt * XmHTML Beta 1.1.0 release * * Revision 1.15 1997/08/30 00:43:02 newt * HashTable stuff. Changed proto's for almost every routine in here. * * Revision 1.14 1997/08/01 12:56:02 newt * Progressive image loading changes. Changes to debug memory alloc protos. * * Revision 1.13 1997/05/28 01:43:34 newt * Added protos and defines for debug memory allocation functions. * * Revision 1.12 1997/04/29 14:23:32 newt * Moved all XmHTML private functions to XmHTMLP.h * * Revision 1.11 1997/04/03 05:32:52 newt * ImageInfoShared macro. _XmHTMLLoadBodyImage proto * * Revision 1.10 1997/03/28 07:06:42 newt * Frame interface prototypes from frames.c * * Revision 1.9 1997/03/20 08:07:25 newt * added external html_tokens definition, _XmHTMLReplaceOrUpdateImage * * Revision 1.8 1997/03/11 19:52:05 newt * ImageBuffer; XmHTMLImage and XmImageInfo macros; new protos for animated Gifs * * Revision 1.7 1997/03/04 18:47:01 newt * _XmHTMLDrawImagemapSelection proto added * * Revision 1.6 1997/03/04 00:57:29 newt * Delayed Image Loading: _XmHTMLReplaceImage and _XmHTMLUpdateImage * * Revision 1.5 1997/03/02 23:14:13 newt * malloc defines; function proto's for all private image/imagemap routines * * Revision 1.4 1997/02/11 02:02:57 newt * Changes for NEED_STRCASECMP * * Revision 1.3 1997/01/09 06:55:59 newt * expanded copyright marker * * Revision 1.2 1997/01/09 06:48:43 newt * updated function definitions * * Revision 1.1 1996/12/19 02:17:18 newt * Initial Revision * *****/ #ifndef _XmHTMLfuncs_h_ #define _XmHTMLfuncs_h_ #include #include /* for Widget definition & fast macros */ /***** * Using #if !defined(DMALLOC) && !defined(DEBUG) seems to trigger a bug * on SparcWorks CPP, so we use the old #ifndef combi's to work around it. * Fix 10/27/97-01, shl. *****/ #ifndef DMALLOC #ifndef DEBUG /* Normal builds use Xt memory functions */ #define malloc(SZ) g_malloc((SZ)) #define calloc(N,SZ) g_malloc0((N),(SZ)) #define realloc(PTR,SZ) g_realloc((gpointer)(PTR),(SZ)) #define free(PTR) g_free((gpointer)(PTR)) /***** * gtk doesn't provide a strdup, so we provide our own (one with error * checking) in gtk.c ******/ extern String g_strdup_wrapper(String string); #define strdup(STR) g_strdup_wrapper((STR)) #else /* DEBUG defined */ /* debug builds use asserted functions unless DMALLOC is defined */ extern char *__rsd_malloc(size_t size, char *file, int line); extern char *__rsd_calloc(size_t nmemb, size_t size, char *file, int line); extern char *__rsd_realloc(void *ptr, size_t size, char *file, int line); extern char *__rsd_strdup(const char *s1, char *file, int line); extern void __rsd_free(void *ptr, char *file, int line); /* redefine the real functions to use our private ones */ #define malloc(SZ) __rsd_malloc((SZ), __FILE__, __LINE__) #define calloc(N,SZ) __rsd_calloc((N),(SZ), __FILE__, __LINE__) #define realloc(PTR,SZ) __rsd_realloc((PTR),(SZ), __FILE__, __LINE__) #define free(PTR) __rsd_free((PTR), __FILE__, __LINE__) #define strdup(STR) __rsd_strdup((STR), __FILE__, __LINE__) #endif /* DEBUG */ #else /* DMALLOC */ /* let dmalloc.h define it all */ #include #endif /* DMALLOC */ /* Don't add anything after this endif! */ #endif /* _XmHTMLfuncs_h_ */ XmHTML-1.1.7/include/bitmaps/ 40755 23564 23564 0 6563146157 14106 5ustar newtnewtXmHTML-1.1.7/include/bitmaps/fingers.xbm100644 23564 23564 525 6444100311 16306 0ustar newtnewt#define fingers_width 16 #define fingers_height 16 #define fingers_x_hot 4 #define fingers_y_hot 0 static unsigned char fingers_bits[] = { 0xcf, 0xff, 0xb7, 0xff, 0xb7, 0xff, 0xb7, 0xff, 0x37, 0x92, 0xb7, 0x6d, 0xb1, 0x6d, 0xb6, 0x6d, 0xb6, 0x6d, 0xf6, 0x7f, 0xf6, 0x7f, 0xfd, 0x7f, 0xfd, 0xbf, 0xfb, 0xbf, 0xfb, 0xbf, 0x03, 0x80}; XmHTML-1.1.7/include/bitmaps/fingers_m.xbm100644 23564 23564 453 6444100322 16624 0ustar newtnewt#define fingers_m_width 16 #define fingers_m_height 16 static unsigned char fingers_m_bits[] = { 0x30, 0x00, 0x78, 0x00, 0x78, 0x00, 0x78, 0x00, 0xf8, 0x6d, 0xf8, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f}; XmHTML-1.1.7/include/pixmaps/ 40755 23564 23564 0 6602511011 14103 5ustar newtnewtXmHTML-1.1.7/include/pixmaps/archive.xpm100644 23564 23564 1077 6544776474 16413 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_archive[] = { /* width height ncolors chars_per_pixel */ "20 17 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "... ........ ....", ".... .... ......", "..... . .........", "....... .........", "...... .. ........", ".. ", ". .... ............ ", ". .", "...... .............", ". .", " ..... ........... .", " ..", "...... ............", "... .", ".. .... ......... .", ".. ..", "........ ........." }; XmHTML-1.1.7/include/pixmaps/audio.xpm100644 23564 23564 1417 6544776474 16071 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_audio[] = { /* width height ncolors chars_per_pixel */ "20 22 8 1", /* colors */ " c #000000", ". c #999999", "X c #660000", "o c #333333", "O c #CCCCCC", "+ c none", "@ c #FFFFFF", "# c #FF3333", /* pixels */ "++++++++++++++++++++", "++++++++++++++++++++", "++++++++++o++++##+++", "+++++++++ +##++##++", "++++++++ . ++##++##+", "+++++++ .@ +++##+##+", "++++++ .@@ +#++#++##", "+ .@@@ +##+##+X#", " .....@@@@ +##+X#+X#", " .@@@@@@@@ +X#+X#+X#", " .@@@@@@@@ +X#+X#+X#", " .@@@@@@@@ +X#+X#+X#", " .@@@@@@@@ +X#+X#+X#", " .o.o.o@@@ +##+X#+X#", "+ Oo@@ +##+##+X#", "++oooo Oo@ +#++#++##", "++++++o Oo +++##+##+", "+++++++o O ++##++#++", "++++++++o +##++##++", "+++++++++oo++++##+++", "++++++++++++++++++++", "++++++++++++++++++++" }; XmHTML-1.1.7/include/pixmaps/binhex.document.xpm100644 23564 23564 1373 6544776474 20063 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_binhex_document[] = { /* width height ncolors chars_per_pixel */ "20 22 6 1", /* colors */ " c #000000", ". c #999999", "X c #756646", "o c #333333", "O c none", "+ c #FFFFFF", /* pixels */ "oooooooooooooOOOOOOO", "o++++++++++o+oOOOOOO", "o+ +o++oOOOOO", "o+ +o+++oOOOO", "o++++ ++++o++++oOOO", "o+ + o o o OO", "o+ + OO", "o++++++++++++.... OO", "o+. .++++... OO", "o+ ++++++. OO", "o+ ++++++ ++++++. OO", "o+o ++++++. OO", "o+ X .++++++. OO", "o+.+++++++++++++. OO", "o+ o++o ++++++. OO", "o+ ++++++. OO", "o++++ +++++++++. OO", "o+ ++++++. OO", "o+ o++o ++++++. OO", "o+++++++++++++++. OO", "oo..............o OO", "OO OO" }; XmHTML-1.1.7/include/pixmaps/boomerang.xpm100644 23564 23564 2762 6431721247 16724 0ustar newtnewt/* XPM */ static char * boomerang_xpm[] = { /* width height ncolors chars_per_pixel */ "32 32 16 1", /* colors */ " s None c None", ". c #FFCC9A", "X c #DDDDDD", "o c #6699FF", "O c #FF9966", "+ c white", "@ c #0000EF", "# c #9A6633", "$ c #CB6532", "% c #FF6666", "& c #FE0000", "* c #890000", "= c #BBBBBB", "- c #663300", "; c #666666", ": c #000066", /* pixels */ " .......XXo ", " ....OOOOOOO++@oXX ", " ...OOO###$$##$++@@++%%% ", " ..OO##$##$$#$#$$XX@@++&&&*", " .O####$#$###$#$#$==@@==&&**", " .O#$####$###------;;::;;*** ", " .O#$#######---:::-# ", " .O$######---:# ", " .O#######--:# ", " .O######--: ", " .######--: ", " .O#####--: ", " .O####--: ", " .O####-: ", " .####--# ", ".O#$##-: ", ".O#$##-# ", ".O$##-: ", ".O$##-: ", ".O###-: ", ".O$##-- ", ".O$$$$# ", "X++X=; ", "X++X=; ", "o@@@@: ", " o@@@: ", " X++=; ", " X++=; ", " %&&* ", " %&&* ", " %&** ", " ** "}; XmHTML-1.1.7/include/pixmaps/calculator.xpm100644 23564 23564 1071 6544776474 17115 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_calculator[] = { /* width height ncolors chars_per_pixel */ "15 21 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " ............. ", " . . ", " . ......... . ", " . ......... . ", " . . ", " ............. ", " ............. ", " . . . . ", " . . . . . . . ", " . . . . ", " ............. ", " . . . . ", " . . . . . . . ", " . . . . ", " ............. ", " . . . . ", " . . . . . . . ", " . . . . ", " ............. ", " " }; XmHTML-1.1.7/include/pixmaps/caution.xpm100644 23564 23564 1421 6544776474 16425 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_caution[] = { /* width height ncolors chars_per_pixel */ "20 22 8 1", /* colors */ " c #000000", ". c #999999", "X c #660000", "o c #333333", "O c none", "+ c #FFCC99", "@ c #FFFFFF", "# c #FF3333", /* pixels */ "oooooooooooooOOOOOOO", "o@@@@@@@@@@o@oOOOOOO", "o@@@@@@@@@@o@@oOOOOO", "o@@@@@XXXX@o@@@oOOOO", "o@@@@@X###@o@@@@oOOO", "o@@@@@X###@ o o o OO", "o@@@@@X###@ OO", "o@@@@@X###@@..... OO", "o@@@@@X###@@@.... OO", "o@@@@@X###@@@@@@. OO", "o@@@@@X###@@@@@@. OO", "o@@@@@+##+@@@@@@. OO", "o@@@@@@##@@@@@@@. OO", "o@@@@@@##@@@@@@@. OO", "o@@@@@@@@@@@@@@@. OO", "o@@@@@XXXX@@@@@@. OO", "o@@@@@X###@@@@@@. OO", "o@@@@@X###@@@@@@. OO", "o@@@@@@@@@@@@@@@. OO", "o@@@@@@@@@@@@@@@. OO", "oo..............o OO", "OO OO" }; XmHTML-1.1.7/include/pixmaps/cd_i.xpm100644 23564 23564 1234 6544776474 15663 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_cd_i[] = { /* width height ncolors chars_per_pixel */ "20 21 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "....... ........", "..... ..... ......", "... ......... ....", ".. ............. ...", ".. ....... ", ". .. . . ", ". ........ ........ ", " ....... ........ ", " ...... .. ", " . . .. .. .. .. .. ", " ...... .. .. .. .. ", " ....... ", ". ........ .. .. .. ", ". ........ .. .. .. ", ".. . . .. ", ".. ....... .. .. .. ", "... ..... .. .. .. ", "..... ... ", "....... .. .. .. ", ".......... .. .. .. ", ".......... " }; XmHTML-1.1.7/include/pixmaps/cd_rom.xpm100644 23564 23564 1133 6544776474 16226 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_cd_rom[] = { /* width height ncolors chars_per_pixel */ "19 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "....... .......", "..... ..... .....", "... ......... ...", ".. ... ..... ..", ".. ............. ..", ". ... .... .", ". ............... .", " ....... ....... ", " ...... ...... ", " ...... .. . . ", " ...... ...... ", " ....... ....... ", ". ............... .", ". ... .... .", ".. ............. ..", ".. ... ..... ..", "... ......... ...", "..... ..... .....", "....... ......." }; XmHTML-1.1.7/include/pixmaps/clock.xpm100644 23564 23564 1132 6544776474 16055 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_clock[] = { /* width height ncolors chars_per_pixel */ "19 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "...... ......", ".... ....... ....", "... ..... ..... ...", ".. ...... ...... ..", ". ....... ....... .", ". ....... ....... .", " ........ ........ ", " ........ ........ ", " ........ ........ ", " .... ....... ", " ........ ........ ", " ................. ", " ................. ", ". ............... .", ". ............... .", ".. ............. ..", "... ........... ...", ".... ....... ....", "...... ......" }; XmHTML-1.1.7/include/pixmaps/compressed.document.xpm100644 23564 23564 1416 6544776474 20750 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_compressed_document[] = { /* width height ncolors chars_per_pixel */ "20 22 7 1", /* colors */ " c #000000", ". c #999999", "X c #660000", "o c #333333", "O c none", "+ c #FFFFFF", "@ c #FF3333", /* pixels */ "OOOOoooooOOOOOOOOOOO", "OOOOo++o+oOOOOOOOOOO", "OOOOo++o++oOOOOOOOOO", "OOOOo++o+++oOOOOOOOO", "OOOOo++o++++oOOOOOOO", "OOOOo++ o o o OOOOOO", "OOOOo++ OOOOOO", "OOOOo++++.... OOOOOO", "X@OOo+++++... OO@XOO", "X@@Oo+++++++. O@@XOO", "X@@@o+++++++. @@@XOO", "X@@@@+++++++.@@@@XOO", "X@@@@@++++++@@@@@XOO", "X@@@@X++++++X@@@@XOO", "X@@@X+++++++.X@@@XOO", "X@@Xo+++++++. X@@XOO", "X@XOo+++++++. OX@XOO", "XXOOo+++++++. OOXXOO", "OOOOo+++++++. OOOOOO", "OOOOo+++++++. OOOOOO", "OOOOoo......o OOOOOO", "OOOOOO OOOOOO" }; XmHTML-1.1.7/include/pixmaps/disk.drive.xpm100644 23564 23564 662 6544776474 17013 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_disk_drive[] = { /* width height ncolors chars_per_pixel */ "20 11 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .................. ", " . ............... ", " . ............... ", " ...... ...... ", " . . ", " ...... ...... ", " .................. ", " .................. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/diskette.xpm100644 23564 23564 1064 6544776474 16602 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_diskette[] = { /* width height ncolors chars_per_pixel */ "18 18 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ..", " ... ........ .. .", " ... ........ ... ", " ... ........ ... ", " ... ........ ... ", " ... ... ", " ................ ", " ....... ....... ", " ...... .. ...... ", " ...... .. ...... ", " ....... ....... ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " " }; XmHTML-1.1.7/include/pixmaps/display.xpm100644 23564 23564 1157 6544776474 16436 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_display[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ". .", ". .", ". .......... .", ". ............ .", ". .............. .", ". .............. .", ". .............. .", ". .............. .", ". .............. .", ". .............. .", ". .............. .", ". .............. .", ". ............ .", ". .......... .", ". .", ".. ..", ". ................ .", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/document.xpm100644 23564 23564 1345 6544776474 16606 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_document[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", /* pixels */ "XXXXXXXXXXXXXooooooo", "XOOOOOOOOOOXOXoooooo", "XOOOOOOOOOOXOOXooooo", "XOOOOOOOOOOXOOOXoooo", "XOOOOOOOOOOXOOOOXooo", "XOOOOOOOOOO X X X oo", "XOOOOOOOOOO oo", "XOOOOOOOOOOOO.... oo", "XOOOOOOOOOOOOO... oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XX..............X oo", "oo oo" }; XmHTML-1.1.7/include/pixmaps/fax.xpm100644 23564 23564 1153 6544776474 15543 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_fax[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. .......", ".. ......... ......", ".. ......... . .....", ".. ......... .. ....", ".. ......... ... ...", ".. ......... ..", ".. .............. ..", ".. .............. ..", " ", " .................. ", " .................. ", " .................. ", " .... .... ", " .. .. ", " . ...... . ", " . ........ . ", " .. ........ .. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/filing.cabinet.xpm100644 23564 23564 1174 6544776474 17644 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_filing_cabinet[] = { /* width height ncolors chars_per_pixel */ "17 22 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. ", " ", " .............. ", " . . ", " . .......... . ", " . .......... . ", " . ... .. ... . ", " . ... ... . ", " . .......... . ", " . .......... . ", " . . ", " .............. ", " . . ", " . .......... . ", " . .......... . ", " . ... .. ... . ", " . ... ... . ", " . .......... . ", " . .......... . ", " . . ", " .............. ", " ." }; XmHTML-1.1.7/include/pixmaps/film.xpm100644 23564 23564 1435 6544776474 15717 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_film[] = { /* width height ncolors chars_per_pixel */ "20 22 9 1", /* colors */ " c #000000", ". c #003366", "X c #999999", "o c #756646", "O c #333333", "+ c #CCCCCC", "@ c none", "# c #FFFFFF", "$ c #008D7D", /* pixels */ " @@@", " ++ ++ O@@", " ++ oooooooo# ++ O@@", " oXXXXXXX# O@@", " ++ XXXXXXXX# ++ O@@", " ++ oXXXXXXX# ++ O@@", " $XXXXXXX# O@@", " ++ oXXXXXXX# ++ O@@", " ++ oXXXXXXX# ++ O@@", " ######### O@@", " ++ ++ O@@", " ++ oooooooo# ++ O@@", " oXXXXXXX# O@@", " ++ XXXXXXXX# ++ O@@", " ++ .XXXXXXX# ++ O@@", " oXXXXXXX# O@@", " ++ XXXXXXXX# ++ O@@", " ++ oXXXXXXX# ++ O@@", " ######### O@@", " ++ ++ O@@", " ++ ++ O@@", "@OOOOOOOOOOOOOOOOO@@" }; XmHTML-1.1.7/include/pixmaps/fixed.disk.xpm100644 23564 23564 742 6544776474 17000 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_fixed_disk[] = { /* width height ncolors chars_per_pixel */ "20 13 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .................. ", " . ............... ", " . .. . ", " .................. ", " .................. ", " ..... . ", " .................. ", " .................. ", " ..... . ", " .................. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/folder.open.xpm100644 23564 23564 1657 6544776474 17211 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_folder_open[] = { /* width height ncolors chars_per_pixel */ "27 22 8 1", /* colors */ " c #000000", ". c #996633", "X c #BFB6B6", "o c #333333", "O c #CCCCCC", "+ c none", "@ c #FFCC99", "# c #66CCFF", /* pixels */ "+++++++++++++++++++++++++++", "+++++++++++++++++++++++++++", "+++++++++++++++++++++++++++", "+++++++++++++++++++++++++++", "++ +++++++++++++++++", "+ XXXXXXXX ++++++++++++++++", " XXXXXXXXXX ++++++++++", " XOXXOXOXXXXXXXXX +++++++++", " XXXXXXXXXXOXXXXXX ++++++++", " XXOXXXXOX XXOXXOXX +", " XXXXXXXX @ XXXXXX @@@@@@. ", " XXX#XOX @@@ @@@@@@.o ", " XOXXXX @@@@@@@@@@@@@@@.o +", " XXXXX @@@@@@@@@@@@@@@.o ++", " XXXO @@@@@@@@@@@@@@@.o +++", " XOX @@@@@@@@@@@@@@@.o ++++", " XX @@@@@@@@@@@@@@@.o +++++", " X @@@@@@@@@@@@@@@.o ++++++", " @@@@@@@@@@@@@@@.o +++++++", "+ ..............oo ++++++++", "++ ooooooooooooo +++++++++", "+++ ++++++++++" }; XmHTML-1.1.7/include/pixmaps/folder.xpm100644 23564 23564 1343 6544776474 16241 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_folder[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #996633", "X c #333333", "o c none", "O c #FFCC99", /* pixels */ "oooooooooooooooooooo", "oooooooooooooooooooo", "oooooooooooooooooooo", "oooooooooooooooooooo", "oo oooooooooo", "o OOOOOOOO ooooooooo", " OOOOOOOOOO ooo", " .OOOOOOOO.OOOOOO oo", " O........OOOOOOO. o", " OOOOOOOOOOOOOOO..X ", " OOOOOOOOOOOOOOOO.X ", " OOOOOOOOOOOOOOO..X ", " OOOOOOOOOOOOOOOO.X ", " OOOOOOOOOOOOOOO..X ", " OOOOOOOOOOOOOOOO.X ", " OOOOOOOOOOOOOOO..X ", " OOOOOOOOOOOOOOOO.X ", " OOOOOOOOOOOOOOO..X ", " OO.O.O.O.O.O.O.O.X ", "o ...............XX ", "oo XXXXXXXXXXXXXXX X", "ooo Xo" }; XmHTML-1.1.7/include/pixmaps/form.xpm100644 23564 23564 1314 6544776474 15727 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_form[] = { /* width height ncolors chars_per_pixel */ "20 23 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ....", " .. .... ...... ....", " .. .... ...... ....", " .. .... ...... ....", " .. ...... ....", " .......... ... ... ", " ......... ... .. .", " . .... . . ", " . ... ..... . .", " .. . ...... . . ", " .. . ..... . . ", " .. . . .... . . ", " .. ... . . .", " ........... .. ..", " .......... .... ...", " .. .. .. ....", " .. .... . . ....", " .. .... . ... ....", " .. .... ...... ....", " .. .... ...... ....", " .. ...... ....", " .............. ....", " ...." }; XmHTML-1.1.7/include/pixmaps/ftp.xpm100644 23564 23564 1376 6544776474 15565 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_ftp[] = { /* width height ncolors chars_per_pixel */ "20 22 7 1", /* colors */ " c #000000", ". c #999999", "X c #660000", "o c #333333", "O c none", "+ c #FFFFFF", "@ c #FF3333", /* pixels */ "OOOOoooooOOOOOOOOOOO", "OOOOo++o+oOOOOOOOOOO", "OOOOo++o++oOOOOOOOOO", "OOOOo++o+++oOOOOOOOO", "OOOOo++o++++oOOOOOOO", "OOOOo++ o o o OOOOOO", "OOOOo++ OOOOOO", "OOOOo++++.... OOOOOO", "OOOO@X++++..X@OOOOOO", "OOO@@X++++++X@@OOOOO", "OO@@@X++++++X@@@OOOO", "O@@@@@@@@@@@@@@@@OOO", "@@@@@@@@@@@@@@@@@@OO", "X@@@@@@@@@@@@@@@@XOO", "OX@@@XXXXXXXX@@@XOOO", "OOX@@X++++++X@@XOOOO", "OOOX@X++++++X@XOOOOO", "OOOOXX++++++XXOOOOOO", "OOOOo+++++++. OOOOOO", "OOOOo+++++++. OOOOOO", "OOOOoo......o OOOOOO", "OOOOOO OOOOOO" }; XmHTML-1.1.7/include/pixmaps/glossary.xpm100644 23564 23564 753 6544776474 16615 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_glossary[] = { /* width height ncolors chars_per_pixel */ "15 17 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " .. ", "...............", "..... ..", "...............", "..... .", "...............", "...............", " ... .", "...............", "..... ....", "...............", "...............", " .. ", "...............", "..... .", "...............", "..... ..." }; XmHTML-1.1.7/include/pixmaps/gopher.xpm100644 23564 23564 1076 6544776474 16255 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_gopher[] = { /* width height ncolors chars_per_pixel */ "20 17 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "........ ........", "....... .. . .......", "...... . .... ......", ". .. .. .", " .. . . .. . .. ", " .. .......... ... ", " ... . . .. . ... ", ". .. .... .... .. .", ".. .. ........ ..", "... .. . .. ......", "...... . . . . .....", ".... .. ... ... ....", ".. .... . ... ..", "........ .. .......", "....... ..... ......", "...... .... ......", "...... ...... ....." }; XmHTML-1.1.7/include/pixmaps/home.xpm100644 23564 23564 1204 6544776474 15712 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_home[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .................. ", " . ........ ", " . ......... ", " . .......... ", " . .......... ", " . ......... ", " . ........ ", " . ....... ", " . .. ....... ", " . .... ........ ", " ....... ......... ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/html.xpm100644 23564 23564 1124 6544776474 15727 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_html[] = { /* width height ncolors chars_per_pixel */ "20 18 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. ..........", ".. ...... ..........", ".. . .. . ..........", ".. .. ..........", ".. .. ..........", ".. .. ..........", ".. .. ..........", ".. .. ..........", " .. .... . ..", " ... . ..", " . ... . . ..", " . ... . ..", " ... . . . ..", " . ... ... . ..", " . ... ... . ..", " . ... ... . ..", " . ... ... . . ", " . ... ... . " }; XmHTML-1.1.7/include/pixmaps/image.xpm100644 23564 23564 1571 6544776474 16053 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_image[] = { /* width height ncolors chars_per_pixel */ "20 22 15 1", /* colors */ " c #000000", ". c #003366", "X c #999999", "o c #FFCC33", "O c #660000", "+ c #756646", "@ c #BFB6B6", "# c #333333", "$ c #CCCCCC", "% c none", "& c #FFCC99", "* c #FFFFFF", "= c #FF3333", "- c #008D7D", "; c #66CCFF", /* pixels */ "#############%%%%%%%", "#**********#*#%%%%%%", "#**********#**#%%%%%", "#**********#***#%%%%", "#*=======$*#****#%%%", "#*=======O* # # # %%", "#*=======O* %%", "#*=======O***XXXX %%", "#*=====----@**XXX %%", "#*====-**o--$***X %%", "#*$==-&$----#**$X %%", "#*$OO-&-----#*$.X %%", "#****-------#$-.X %%", "#****#-----+#;-.X %%", "#****$#---+#--;.X %%", "#*****&####;-;-.X %%", "#*****%**$--;-;.X %%", "#*******@;-;-;-.X %%", "#******$........X %%", "#***************X %%", "##XXXXXXXXXXXXXX# %%", "%% %%" }; XmHTML-1.1.7/include/pixmaps/index.xpm100644 23564 23564 1361 6544776474 16075 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_index[] = { /* width height ncolors chars_per_pixel */ "20 22 6 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", "+ c #66CCFF", /* pixels */ "XXXXXXXXXXXXXooooooo", "XOOOOOOOOOOXOXoooooo", "XOOOOOOOOOOXOOXooooo", "XOOOOOOOOOOXOOOXoooo", "XOOOOOOOOOOXOOOOXooo", "XOOOOOOOOOO X X X oo", "XOOOOOOOOOO oo", "XOOOOO....OOO.... oo", "XOOO.X X.OO... oo", "XOO. X.++.X .OOO. oo", "XOOXX++++++XXOOO. oo", "XO. .+OO+++. X X ", "XO. ++O+++++ XXXXXX ", "XO. ++++++++ ...... ", "XO. .++++++. ", "XOOXX++++++XXOOO. oo", "XOO. X.++.X .OOO. oo", "XOOO.X X.OOOO. oo", "XOOOOO....OOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XX..............X oo", "oo oo" }; XmHTML-1.1.7/include/pixmaps/keyboard.xpm100644 23564 23564 740 6544776474 16546 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_keyboard[] = { /* width height ncolors chars_per_pixel */ "20 13 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .................. ", " .................. ", " . . . . . . ", " . . . . . . ", " .................. ", " . . . . . . ", " . . . . . . ", " .................. ", " .... .... ", " .... .... ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/mail.in.xpm100644 23564 23564 1317 6544776474 16316 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_mail_in[] = { /* width height ncolors chars_per_pixel */ "20 23 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ". .", ". .............. .", ". . ............ . .", ". .. .......... .. .", ". ... ...... ... .", ". ..... .... ..... .", ". ...... .. ...... .", ". ....... ....... .", ". ................ .", ". ................ .", ". ................ .", ". ........ ..... .", ". .", ".......... .......", ".......... .......", "........ .....", "......... ......", ".......... .......", "........... ........", " ............ ", " .. .. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/mail.out.xpm100644 23564 23564 1320 6544776474 16511 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_mail_out[] = { /* width height ncolors chars_per_pixel */ "20 23 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "........ ...........", "....... ..........", "...... .........", "..... ........", "....... ..........", "....... ..........", ". .", ". .... ....... .", ". . ............ . .", ". .. .......... .. .", ". ... ...... ... .", ". ..... .... ..... .", ". ...... .. ...... .", ". ....... ....... .", ". ................ .", ". ................ .", ". ................ .", ". .", "....................", " ............ ", " .. .. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/mail.xpm100644 23564 23564 702 6544776474 15666 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_mail[] = { /* width height ncolors chars_per_pixel */ "18 13 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .............. ", " . ............ . ", " .. .......... .. ", " ... ...... ... ", " ..... .... ..... ", " ...... .. ...... ", " ....... ....... ", " ................ ", " ................ ", " ................ ", " ................ ", " " }; XmHTML-1.1.7/include/pixmaps/map.xpm100644 23564 23564 1313 6544776474 15540 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_map[] = { /* width height ncolors chars_per_pixel */ "20 23 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. .. ........ .....", ".. .. ........ .....", ".. ... ....... .....", " . ", ".. ... ....... .....", ".. ... ....... .....", ".. .... ...... .....", ".. .... ...... .....", ".. .... .. . ", ".. .... . ", ".. ... ... .....", ".. ... ...... .....", ".. .. ....... .....", ".. .. ....... .....", ".. .. ....... .....", " .. ", ".. .. ....... .....", ".. .. ....... .....", ".. .. ....... .. ", ".. .. ..... . ...", ".. ... .. .....", ".. ... ...... .....", ".. ... ...... ....." }; XmHTML-1.1.7/include/pixmaps/mouse.xpm100644 23564 23564 1061 6544776474 16113 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_mouse[] = { /* width height ncolors chars_per_pixel */ "14 22 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "...... ......", "..... ........", "...... ......", "........ ....", ".......... ...", ".......... ...", ". .", " ...... ..... ", " ...... ..... ", " ...... ..... ", " ...... ..... ", " ...... ..... ", " ", " ............ ", " ............ ", " ........... ", " ............ ", " ........... ", " .......... . ", ". ....... . .", ".. . . . ..", ".... ...." }; XmHTML-1.1.7/include/pixmaps/network.xpm100644 23564 23564 1237 6544776474 16461 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_network[] = { /* width height ncolors chars_per_pixel */ "20 21 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "... ..........", "... ..... ..........", "... ..... ..........", "... ..... ..........", "... ..........", ".. .........", ".. ....... .........", ".. .........", "...... .............", "...... .............", " ", "............. ......", "............. ......", ".......... ...", ".......... ..... ...", ".......... ..... ...", ".......... ..... ...", ".......... ...", "......... ..", "......... ....... ..", "......... .." }; XmHTML-1.1.7/include/pixmaps/new.xpm100644 23564 23564 1357 6544776474 15564 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_new[] = { /* width height ncolors chars_per_pixel */ "20 22 6 1", /* colors */ " c #000000", ". c #996633", "X c #FFCC33", "o c #756646", "O c #333333", "+ c none", /* pixels */ "++++++++++++++++++++", "++++++++++++++++++++", "++++++++++++++++++++", "++++++++ ++++ ++++++", "+++++++ . ++ +++ +", "+++++++ X. .. + . +", "++++++ .XXXXXX .X +", "+ XXXXXXXXXX. +", " .XXXXXXXXXXXXXXX O+", "O .XXXXXXXXXXXXXX O+", "+O XXXXXXXXXXXXXX. +", "++ XXXXXXXXXXXXXXX. ", "+ .XXXXXXXXXXXXX. O", "+ XXXXXXXXXXXXX OO+", " .XXXXXXXXXXXXX O+++", " XXXXXXXXXXX. +++", "+OO XXXXXXXX. .. +++", "+++ XX .XXXX O +++", "+++ o O .XXXO+OOO+++", "+++O O+OO . O+++++++", "++++O+++OO O++++++++", "++++++++++O+++++++++" }; XmHTML-1.1.7/include/pixmaps/next.xpm100644 23564 23564 1341 6544776474 15742 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_next[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #756646", "o c #333333", "O c none", /* pixels */ "OOOOOOOOOOOOOOOOOOOO", "OOOOOOOOooOXOOOOOOOO", "OOOOOoooooo.OOOOOOOO", "OOOoooooooOXOOOOOOOO", "OOooooooooo.OOOOOOOO", "OoooooooooOXOOOOOOOO", "ooooooooooo.OOOOOOOO", " OooooooooOXOOOOOOOO", " OOooooooOOOOOOOOOO", " o.OOoOOOOOOOOOOOO", " o.OOOOOO OOOOO", " o.OOO OOOO", " OOO", "o OO", ". O", "OX ", "OO.o O", "OOOOO.o OO", "OOOOOOOOO.o OOO", "OOOOOOOOOOOOOO OOOO", "OOOOOOOOOOOOOO OOOOO", "OOOOOOOOOOOOOOOOOOOO" }; XmHTML-1.1.7/include/pixmaps/noboomerang.xpm100644 23564 23564 2745 6431721247 17262 0ustar newtnewt/* XPM */ static char * noboomerang_xpm[] = { /* width height ncolors chars_per_pixel */ "32 32 15 1", /* colors */ " s None c None", ". c #FE0000", "X c #FF6666", "o c #FFCC9A", "O c #DDDDDD", "+ c #6699FF", "@ c #890000", "# c #FF9966", "$ c #0000EF", "% c #9A6633", "& c #CB6532", "* c #BBBBBB", "= c #653232", "- c #666666", "; c black", /* pixels */ "..X oooooooOO+ X..", "@..X oooo####### $+OOX...", "@@..X ooo###%%%&&%%& $$ X...@", " @@..Xoo##%%&%%&&%&%&&OO$$X...@@", " @@..X%%%%&%&%%%&%&%&**$X...@@@", " @@..X%%%%&%%%======--X...@@@ ", " o@@..X%%%%%===;;;=% X...@ ", " o#@@..X%%===;% X...@ ", " o#%%@@..X==;% X...@ ", " o#%%%@@..X; X...@ ", " o%%%%%@@..X X...@ ", " o#%%%%%=@@..X X...@ ", " o#%%%%==;@@..X X...@ ", " o#%%%%=; @@..XX...@ ", " o%%%%==% @@.....@ ", "o#%&%%=; @@..@@ ", "o#%&%%=% X....X ", "o#&%%=; X..@@..X ", "o#&%%=; X...@@@..X ", "o#%%%=; X...@ @@..X ", "o#&%%== X...@ @@..X ", "o#&&&&% X...@ @@..X ", "O O*- X...@ @@..X ", "O O*-X...@ @@..X ", "+$$$$X...@ @@..X ", " +$$X...@ @@..X ", " O X...@ @@..X ", " OX...@ @@..X ", " X...@ @@..X ", "X...@@ @@..X", "...@@@ @@@@", "..@@@ @@@"}; XmHTML-1.1.7/include/pixmaps/notebook.xpm100644 23564 23564 1270 6544776474 16605 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_notebook[] = { /* width height ncolors chars_per_pixel */ "20 22 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".... .. .. .. .. ...", ".. ", ".. . .. .. .. .. .. ", ".. . .. .. .. .. .. ", ".. ................ ", ".. ................ ", ".. ................ ", ".. ...... ....... ", ".. .... .. ....... ", ".. ... . .. ....... ", ".. .. ... ........ ", ".. . .... ........ ", ".. .... ......... ", ".. .... .......... ", ". .... ..... ", " .... ...... .... ", " ... ....... ... . ", " . ........ .. .. ", ". ......... . ... ", ".. .......... .... ", ".. ..... ", "... " }; XmHTML-1.1.7/include/pixmaps/parent.xpm100644 23564 23564 1206 6544776474 16255 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_parent[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " ........ ........ ", " ....... ....... ", " ...... ...... ", " ..... ..... ", " .... .... ", " ... ... ", " .. .. ", " . . ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/play.fast.forward.xpm100644 23564 23564 1171 6544776474 20331 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_play_fast_forward[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ......... .........", " ........ ........", " . ....... . .......", " .. ...... .. ......", " ... ..... ... .....", " .... .... .... ....", " ..... ... ..... ...", " ...... .. ...... ..", " ....... . ....... .", " ........ ........ ", " ....... . ....... .", " ...... .. ...... ..", " ..... ... ..... ...", " .... .... .... ....", " ... ..... ... .....", " .. ...... .. ......", " . ....... . .......", " ........ ........", " ......... ........." }; XmHTML-1.1.7/include/pixmaps/play.fast.reverse.xpm100644 23564 23564 1171 6544776474 20340 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_play_fast_reverse[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "......... ......... ", "........ ........ ", "....... . ....... . ", "...... .. ...... .. ", "..... ... ..... ... ", ".... .... .... .... ", "... ..... ... ..... ", ".. ...... .. ...... ", ". ....... . ....... ", " ........ ........ ", ". ....... . ....... ", ".. ...... .. ...... ", "... ..... ... ..... ", ".... .... .... .... ", "..... ... ..... ... ", "...... .. ...... .. ", "....... . ....... . ", "........ ........ ", "......... ......... " }; XmHTML-1.1.7/include/pixmaps/play.pause.xpm100644 23564 23564 1170 6544776474 17045 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_play_pause[] = { /* width height ncolors chars_per_pixel */ "18 21 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " .... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " ..... .... ..... ", " .... " }; XmHTML-1.1.7/include/pixmaps/play.start.xpm100644 23564 23564 1137 6544776474 17070 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_play_start[] = { /* width height ncolors chars_per_pixel */ "19 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ..................", " ................", " .. ..............", " .... ............", " ...... ..........", " ........ ........", " .......... ......", " ............ ....", " .............. ..", " ................ ", " ............... .", " ............. ...", " ........... .....", " ......... .......", " ....... .........", " ..... ...........", " ... .............", " . ...............", " ................." }; XmHTML-1.1.7/include/pixmaps/play.stop.xpm100644 23564 23564 1167 6544776474 16723 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_play_stop[] = { /* width height ncolors chars_per_pixel */ "18 21 2 1", /* colors */ " c #000000", ". c none", /* pixels */ " ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " ................ ", " " }; XmHTML-1.1.7/include/pixmaps/previous.xpm100644 23564 23564 1345 6544776474 16644 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_previous[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #756646", "o c #333333", "O c none", /* pixels */ "OOOOOOOOOOOOOOOOOOOO", "OOOOOOOOXOooOOOOOOOO", "OOOOOOOO.ooooooOOOOO", "OOOOOOOOXOoooooooOOO", "OOOOOOOO.oooooooooOO", "OOOOOOOOXOoooooooooO", "OOOOOOOO.ooooooooooo", "OOOOOOOOXOooooooooO ", "OOOOOOOOOOooooooOO ", "OOOOOOOOOOOOoOO.o ", "OOOOO OOOOOO.o ", "OOOO OOO.o ", "OOO ", "OO o", "O .", " XO", "O o.OO", "OO o.OOOOO", "OOO o.OOOOOOOOO", "OOOO OOOOOOOOOOOOOO", "OOOOO OOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOO" }; XmHTML-1.1.7/include/pixmaps/printer.xpm100644 23564 23564 1157 6544776474 16454 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_printer[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. .......", ".. ......... ......", ".. ......... . .....", ".. ......... .. ....", ".. ......... ... ...", ".. ......... ..", ".. .............. ..", ".. .............. ..", ".. .............. ..", ".. .............. ..", " .............. ", " . .............. . ", " . . ", " .................. ", " .................. ", " .................. ", " .................. ", " .................. ", " " }; XmHTML-1.1.7/include/pixmaps/stop.xpm100644 23564 23564 1154 6544776474 15753 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_stop[] = { /* width height ncolors chars_per_pixel */ "20 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "..... .....", ".... .......... ....", "... .. .. ...", ".. .. .. ..", ". .. .. .", " .. .. ", " . .. ... .. ... . ", " . . . . . . . . ", " . . . . . . . . ", " . ... . . . ... . ", " . . . . . . . ", " . . . . . . . ", " . ... . ... . . ", " .. .. ", ". .. .. .", ".. .. .. ..", "... .. .. ...", ".... .......... ....", "..... ....." }; XmHTML-1.1.7/include/pixmaps/sadsmiley.xpm100644 23564 23564 1211 6544776474 16752 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_sadsmiley[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "....... .......", "..... ...... .....", ".... .......... ....", "... ............ ...", ".. .............. ..", ". ................ .", ". ... ...... ... .", " ... .... ... ", " .... ...... .... ", " .................. ", " .................. ", " .................. ", " ....... ....... ", ". .... .... .... .", ". ... ........ ... .", ".. .............. ..", "... ............ ...", ".... .......... ....", "..... ...... .....", "....... ......." }; XmHTML-1.1.7/include/pixmaps/smiley.xpm100644 23564 23564 1206 6544776474 16266 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_smiley[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "....... .......", "..... ...... .....", ".... .......... ....", "... ............ ...", ".. .............. ..", ". ................ .", ". ... ...... ... .", " ... .... ... ", " .... .. .. .... ", " ........ ........ ", " ........ ........ ", " ........ ........ ", " .................. ", ". ... ........ ... .", ". ... ........ ... .", ".. ... .... ... ..", "... .... .... ...", ".... .......... ....", "..... ...... .....", "....... ......." }; XmHTML-1.1.7/include/pixmaps/summary.xpm100644 23564 23564 1134 6544776474 16461 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_summary[] = { /* width height ncolors chars_per_pixel */ "19 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "...... ......", ".... ....", "... ...", ".. ..", ". ......... .", ". .. .. .", " .. ", " .. ", " .. ", " .. ", " . ", " . ", " . . ", ". .......... .", ". ......... .", ".. ..", "... ...", ".... ....", "...... ......" }; XmHTML-1.1.7/include/pixmaps/telephone.xpm100644 23564 23564 1113 6544776474 16744 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_telephone[] = { /* width height ncolors chars_per_pixel */ "18 19 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. .............", ". ... ............", ". ... ............", " ..... ...........", " ..... ...........", " ..... ...........", ". ... ............", ". ... ............", ".. ... ...........", ".. .... ..........", "... .... .........", "... ..... ... ....", ".... ..... . . ..", "..... ..... .... .", "...... .......... ", "....... ......... ", "........ ....... ", ".......... ... .", "............ ..." }; XmHTML-1.1.7/include/pixmaps/telnet.xpm100644 23564 23564 1362 6544776474 16262 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_telnet[] = { /* width height ncolors chars_per_pixel */ "20 22 6 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", "+ c #66CCFF", /* pixels */ "oooooooooooooooooooo", "oooooooooooooooooooo", "oooooooooooooooooooo", "oooo ooooo", "ooo OOOOOOOOOOO oooo", "ooo O O Xooo", "ooo O OO+++++XO Xooo", "ooo O O++++++XO Xooo", "ooo O +++++++XO Xooo", "ooo O +++++++XO Xooo", "ooo O XXXXXXXXO Xooo", "ooo OOOOOOOOOOO Xooo", "oXXX XXXoo", "oX...............X o", "oX.XXXXXXXXXXXXXXX o", "oX...............X o", "oX. . . .X o", "oo .OOOOOOOOOOO. oo", "o .OX.X.X.X.X.XO. o", " .OX.X.X.X.X.X.XO. X", " X", "oXXXXXXXXXXXXXXXXXXo" }; XmHTML-1.1.7/include/pixmaps/text.document.xpm100644 23564 23564 1352 6544776474 17567 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_text_document[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", /* pixels */ "XXXXXXXXXXXXXooooooo", "XOOOOOOOOOOXOXoooooo", "XOOOOOOOOOOXOOXooooo", "XOOOOOOOOOOXOOOXoooo", "XOOOOOOOOOOXOOOOXooo", "XOO OO X X X oo", "XOOOOOOOOOO oo", "XOO OOOO.... oo", "XOOOOOOOOOOOOO... oo", "XOO OOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOO OOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOO OOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOO OOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOO OOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XX..............X oo", "oo oo" }; XmHTML-1.1.7/include/pixmaps/tn3270.xpm100644 23564 23564 1206 6544776474 15721 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_tn3270[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ". .", ". ................ .", ". ... ... .", ". .. .. .", ". . . .", ". .... ... ... ... .", ". . . . . . . . .", ". . .. . . . . .", ". . . . . . . .", ". .... ... . ... .", ". . . .", ". . . .", ". .. .. .", ". ... ... .", ". ................ .", ".. ..", ".. . . . . . . . ..", ". . . . . . . . . .", " . . . . . . . . .. ", " " }; XmHTML-1.1.7/include/pixmaps/toc.xpm100644 23564 23564 1063 6544776474 15552 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_toc[] = { /* width height ncolors chars_per_pixel */ "16 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "..... ......", "..... ......", "................", "................", " ... ", "................", "................", " ....... ", "................", "................", " ...... ", "................", "................", " ......... ", "................", "................", " ....... ", "................", "................", " ..... " }; XmHTML-1.1.7/include/pixmaps/trash.xpm100644 23564 23564 1135 6544776474 16106 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_trash[] = { /* width height ncolors chars_per_pixel */ "18 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ". .", " ................ ", " ", " .............. ", ". ... ... ... .. .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .. ... ... ... .", ". .............. .", ".. .." }; XmHTML-1.1.7/include/pixmaps/unknown.document.xpm100644 23564 23564 1355 6544776474 20305 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_unknown_document[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", /* pixels */ "XXXXXXXXXXXXXooooooo", "XOOOOOOOOOOXOXoooooo", "XOOOOOOOOOOXOOXooooo", "XOOO.. XOOOXoooo", "XOO. XOOOOXooo", "XOO. X X X oo", "XOO .O. oo", "XOO OOO ... oo", "XOOOOOOOO. ... oo", "XOOOOOO. OO. oo", "XOOOOO. .OO. oo", "XOOOOO .OOO. oo", "XOOOOO .OOOOO. oo", "XOOOOO OOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOO OOOOOO. oo", "XOOOOO OOOOOO. oo", "XOOOOO OOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XX..............X oo", "oo oo" }; XmHTML-1.1.7/include/pixmaps/uuencoded.document.xpm100644 23564 23564 1357 6544776474 20563 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_uuencoded_document[] = { /* width height ncolors chars_per_pixel */ "20 22 5 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c none", "O c #FFFFFF", /* pixels */ "XXXXXXXXXXXXXooooooo", "XOOOOOOOOOOXOXoooooo", "XO. OXOOXooooo", "XO OXOOOXoooo", "XO OOOOOOOXOOOOXooo", "XO O X X X oo", "XO. O oo", "XOOOOOOOOOOOO.... oo", "XO. OOOO... oo", "XO OOOOOO. oo", "XO OOOOOOOOOOOO. oo", "XO OOOOOO. oo", "XO. OOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XOOOOOOOOOOOOOOO. oo", "XX..............X oo", "oo oo" }; XmHTML-1.1.7/include/pixmaps/work.xpm100644 23564 23564 1204 6544776474 15744 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_work[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1", /* colors */ " c #000000", ". c none", /* pixels */ "........ ........", "....... .. .......", "...... .... ......", "..... ...... .....", ".... ... ... ....", "... .... ... ...", ".. ..... ..... ..", ". ..... ....... .", " .... ........ ", " ...... ........ ", " ..... .. ....... ", " .... . .... .... ", ". .. .. ... .. .", ".. . .. .. ..", "... .......... ...", ".... ........ ....", "..... ...... .....", "...... .... ......", "....... .. .......", "........ ........" }; XmHTML-1.1.7/include/pixmaps/www.xpm100644 23564 23564 1235 6544776474 15612 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_www[] = { /* width height ncolors chars_per_pixel */ "19 22 2 1", /* colors */ " c #000000", ". c none", /* pixels */ ".. ........... ", ".. . ........... . ", ".. . ........... . ", "... . ......... . .", ". . ... ... .", ". . ... . ... .", ". .. ... .. .", ".. . . . . . ..", " . . . ..", " . . . .. . ..", " . . . ..", ". . . . ...", ". . . ...", ". . . . ...", ". . ... . ...", ".. . . . . ....", ".. . . . . . ....", ".. . . . . . ....", ".. . . ... . . ....", "... .. ... .. .....", "... . ..... . .....", "... ..... ....." }; XmHTML-1.1.7/include/pixmaps/binary.document.xpm100644 23564 23564 1373 6561175521 20053 0ustar newtnewt/* XPM */ static char *__builtin_w3c_icon_binary_document[] = { /* width height ncolors chars_per_pixel */ "20 22 6 1", /* colors */ " c #000000", ". c #999999", "X c #333333", "o c #CCCCCC", "O c none", "+ c #FFFFFF", /* pixels */ "XXXXXXXXXXXXXOOOOOOO", "X++++++++++X+XOOOOOO", "X+ +o o+X++XOOOOO", "X+ + + +X+++XOOOO", "X+ + + +X++++XOOO", "X+ + + + X X X OO", "X+ +o o+ OO", "X++++++++++++.... OO", "X+o o+ ++++... OO", "X+ + + ++++++. OO", "X+ + + ++++++. OO", "X+ + + ++++++. OO", "X+o o+ ++++++. OO", "X+++++++++++++++. OO", "X+ +o o++++++. OO", "X+ + + ++++++. OO", "X+ + + ++++++. OO", "X+ + + ++++++. OO", "X+ +o o++++++. OO", "X+++++++++++++++. OO", "XX..............X OO", "OO OO" }; XmHTML-1.1.7/include/pixmaps/tags/ 40755 23564 23564 0 6604540632 15056 5ustar newtnewtXmHTML-1.1.7/include/pixmaps/tags/DOCTYPE.xpm100644 23564 23564 2430 6602511531 17001 0ustar newtnewt/* XPM */ static char * DOCTYPE_xpm[] = { "63 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .... .... .......... .. ...... ...... ", " .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .... ...... ...... ", " .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. ", " ..... .... .... .. .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/A.xpm100644 23564 23564 574 6602511531 16041 0ustar newtnewt/* XPM */ static char * A_xpm[] = { "12 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ", " .... ", " . . ", " .. .. ", " .. .. ", " ...... ", " .. .. ", " .. .. ", " .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/ADDRESS.xpm100644 23564 23564 2474 6602511531 16767 0ustar newtnewt/* XPM */ static char * ADDRESS_xpm[] = { "65 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ..... ..... ...... ...... ..... ..... ", " .... .. .. .. .. .. .. .. .. .. .. .. ", " . . .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ... ... ", " .. .. .. .. .. .. ...... ...... ... ... ", " ...... .. .. .. .. .. .. .. ... ... ", " .. .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. ..... ..... .. .. ...... ..... ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/APPLET.xpm100644 23564 23564 2077 6602511531 16666 0ustar newtnewt/* XPM */ static char * APPLET_xpm[] = { "51 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ...... ...... .. ...... ........ ", " .... .. .. .. .. .. .. .. ", " . . .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " .. .. ...... ...... .. ...... .. ", " ...... .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. ...... ...... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/AREA.xpm100644 23564 23564 1501 6602511531 16400 0ustar newtnewt/* XPM */ static char * AREA_xpm[] = { "37 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ...... ...... .. ", " .... .. .. .. .... ", " . . .. .. .. . . ", " .. .. .. .. .. .. .. ", " .. .. ...... ...... .. .. ", " ...... .. .. .. ...... ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. ...... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/B.xpm100644 23564 23564 616 6602511531 16037 0ustar newtnewt/* XPM */ static char * B_xpm[] = { "13 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ", " .. .. ", " .. .. ", " .. .. ", " ...... ", " .. .. ", " .. .. ", " .. .. ", " ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BASE.xpm100644 23564 23564 1523 6602511531 16406 0ustar newtnewt/* XPM */ static char * BASE_xpm[] = { "38 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. ..... ...... ", " .. .. .... .. .. .. ", " .. .. . . .. .. .. ", " .. .. .. .. ... .. ", " ...... .. .. ... ...... ", " .. .. ...... ... .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " ...... .. .. ..... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BASEFONT.xpm100644 23564 23564 2673 6602511531 17104 0ustar newtnewt/* XPM */ static char * BASEFONT_xpm[] = { "72 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. ..... ...... ...... .... .. .. ........ ", " .. .. .... .. .. .. .. .. .. ... .. .. ", " .. .. . . .. .. .. .. .. .. ... .. .. ", " .. .. .. .. ... .. .. .. .. .. . .. .. ", " ...... .. .. ... ...... ..... .. .. .. . .. .. ", " .. .. ...... ... .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. .. .. .. .. .. ", " ...... .. .. ..... ...... .. .... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BIG.xpm100644 23564 23564 1214 6602511531 16272 0ustar newtnewt/* XPM */ static char * BIG_xpm[] = { "27 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. ..... ", " .. .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ...... .. .. .... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ...... .. .... . ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BLOCKQUOTE.xpm100644 23564 23564 3445 6602511531 17351 0ustar newtnewt/* XPM */ static char * BLOCKQUOTE_xpm[] = { "92 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. .... .... .. .. .... .. .. .... ........ ...... ", " .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .... .. .. .. .. .. .. .. .. ", " ...... .. .. .. .. .... .. .. .. .. .. .. .. ...... ", " .. .. .. .. .. .. .. .. .. . .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .... .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ", " ...... ...... .... .... .. .. ...... ..... .... .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BODY.xpm100644 23564 23564 1567 6602511531 16441 0ustar newtnewt/* XPM */ static char * BODY_xpm[] = { "40 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .... ..... .. .. ", " .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. ", " ...... .. .. .. .. .... ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " ...... .... ..... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/BR.xpm100644 23564 23564 1061 6602511531 16174 0ustar newtnewt/* XPM */ static char * BR_xpm[] = { "22 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ...... ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ...... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/CAPTION.xpm100644 23564 23564 2320 6602511531 16765 0ustar newtnewt/* XPM */ static char * CAPTION_xpm[] = { "59 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... .. ...... ........ .. .... .. .. ", " .. .. .... .. .. .. .. .. .. ... .. ", " .. . . .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. .. .. . .. ", " .. .. .. ...... .. .. .. .. .. . .. ", " .. ...... .. .. .. .. .. .. ... ", " .. .. .. .. .. .. .. .. .. ... ", " .. .... .. .. .. .. .. .. .. .. ", " .... .. .. .. .. .. .... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/CENTER.xpm100644 23564 23564 2165 6602511532 16660 0ustar newtnewt/* XPM */ static char * CENTER_xpm[] = { "54 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... ...... .. .. ........ ...... ...... ", " .. .. .. ... .. .. .. .. .. ", " .. .. ... .. .. .. .. .. ", " .. .. .. . .. .. .. .. .. ", " .. ...... .. . .. .. ...... ...... ", " .. .. .. ... .. .. .. .. ", " .. .. .. ... .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " .... ...... .. .. .. ...... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/CITE.xpm100644 23564 23564 1347 6602511532 16425 0ustar newtnewt/* XPM */ static char * CITE_xpm[] = { "32 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... .. ........ ...... ", " .. .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. .. ", " .... .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/CODE.xpm100644 23564 23564 1545 6602511532 16413 0ustar newtnewt/* XPM */ static char * CODE_xpm[] = { "39 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... .... ..... ...... ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. ...... ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .... .... ..... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DD.xpm100644 23564 23564 1061 6602511532 16161 0ustar newtnewt/* XPM */ static char * DD_xpm[] = { "22 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ..... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ..... ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DFN.xpm100644 23564 23564 1260 6602511532 16302 0ustar newtnewt/* XPM */ static char * DFN_xpm[] = { "29 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ...... .. .. ", " .. .. .. ... .. ", " .. .. .. ... .. ", " .. .. .. .. . .. ", " .. .. ..... .. . .. ", " .. .. .. .. ... ", " .. .. .. .. ... ", " .. .. .. .. .. ", " ..... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DIR.xpm100644 23564 23564 1172 6602511532 16313 0ustar newtnewt/* XPM */ static char * DIR_xpm[] = { "26 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. ...... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. ...... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ..... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DIV.xpm100644 23564 23564 1150 6602511532 16313 0ustar newtnewt/* XPM */ static char * DIV_xpm[] = { "25 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. . . ", " .. .. .. .... ", " .. .. .. .. ", " ..... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DL.xpm100644 23564 23564 1015 6602511532 16170 0ustar newtnewt/* XPM */ static char * DL_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ..... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/DT.xpm100644 23564 23564 1037 6602511532 16204 0ustar newtnewt/* XPM */ static char * DT_xpm[] = { "21 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ........ ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ..... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/EM.xpm100644 23564 23564 1103 6602511532 16170 0ustar newtnewt/* XPM */ static char * EM_xpm[] = { "23 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. .. ", " .. .. .. ", " .. ... ... ", " .. ... ... ", " ...... .... .... ", " .. .. . . .. ", " .. .. ... .. ", " .. .. . .. ", " ...... .. . .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/FONT.xpm100644 23564 23564 1523 6602511532 16443 0ustar newtnewt/* XPM */ static char * FONT_xpm[] = { "38 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .... .. .. ........ ", " .. .. .. ... .. .. ", " .. .. .. ... .. .. ", " .. .. .. .. . .. .. ", " ..... .. .. .. . .. .. ", " .. .. .. .. ... .. ", " .. .. .. .. ... .. ", " .. .. .. .. .. .. ", " .. .... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/FORM.xpm100644 23564 23564 1611 6602511532 16436 0ustar newtnewt/* XPM */ static char * FORM_xpm[] = { "41 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .... ...... .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. ... ... ", " .. .. .. .. .. ... ... ", " ..... .. .. ...... .... .... ", " .. .. .. .. .. .. . . .. ", " .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. . .. ", " .. .... .. .. .. . .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/FRAME.xpm100644 23564 23564 1766 6602511532 16540 0ustar newtnewt/* XPM */ static char * FRAME_xpm[] = { "47 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ...... .. .. .. ...... ", " .. .. .. .... .. .. .. ", " .. .. .. . . ... ... .. ", " .. .. .. .. .. ... ... .. ", " ..... ...... .. .. .... .... ...... ", " .. .. .. ...... .. . . .. .. ", " .. .. .. .. .. .. ... .. .. ", " .. .. .. .. .. .. . .. .. ", " .. .. .. .. .. .. . .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/FRAMESET.xpm100644 23564 23564 2673 6602511532 17112 0ustar newtnewt/* XPM */ static char * FRAMESET_xpm[] = { "72 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ...... .. .. .. ...... ..... ...... ........ ", " .. .. .. .... .. .. .. .. .. .. .. ", " .. .. .. . . ... ... .. .. .. .. .. ", " .. .. .. .. .. ... ... .. ... .. .. ", " ..... ...... .. .. .... .... ...... ... ...... .. ", " .. .. .. ...... .. . . .. .. ... .. .. ", " .. .. .. .. .. .. ... .. .. .. .. .. .. ", " .. .. .. .. .. .. . .. .. .. .. .. .. ", " .. .. .. .. .. .. . .. ...... ..... ...... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H1.xpm100644 23564 23564 1015 6602511532 16141 0ustar newtnewt/* XPM */ static char * H1_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ", " .. .. .... ", " .. .. .. ", " .. .. .. ", " ....... .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H2.xpm100644 23564 23564 1015 6602511532 16142 0ustar newtnewt/* XPM */ static char * H2_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .... ", " .. .. .. .. ", " .. .. .. ", " .. .. .. ", " ....... .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H3.xpm100644 23564 23564 1015 6602511533 16144 0ustar newtnewt/* XPM */ static char * H3_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .... ", " .. .. .. .. ", " .. .. .. ", " .. .. ... ", " ....... .. ", " .. .. .. ", " .. .. .. ", " .. .. .. .. ", " .. .. .... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H4.xpm100644 23564 23564 1015 6602511533 16145 0ustar newtnewt/* XPM */ static char * H4_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ", " .. .. ... ", " .. .. . .. ", " .. .. . .. ", " ....... . .. ", " .. .. . .. ", " .. .. ....... ", " .. .. .. ", " .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H5.xpm100644 23564 23564 1015 6602511533 16146 0ustar newtnewt/* XPM */ static char * H5_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ..... ", " .. .. .. ", " .. .. .. ", " .. .. ..... ", " ....... .. ", " .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/H6.xpm100644 23564 23564 1015 6602511533 16147 0ustar newtnewt/* XPM */ static char * H6_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .... ", " .. .. .. .. ", " .. .. .. ", " .. .. .. ", " ....... ..... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/HEAD.xpm100644 23564 23564 1523 6602511533 16377 0ustar newtnewt/* XPM */ static char * HEAD_xpm[] = { "38 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ...... .. ..... ", " .. .. .. .... .. .. ", " .. .. .. . . .. .. ", " .. .. .. .. .. .. .. ", " ....... ...... .. .. .. .. ", " .. .. .. ...... .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. ...... .. .. ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/HR.xpm100644 23564 23564 1061 6602511533 16204 0ustar newtnewt/* XPM */ static char * HR_xpm[] = { "22 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ....... ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/HTML.xpm100644 23564 23564 1545 6602511533 16446 0ustar newtnewt/* XPM */ static char * HTML_xpm[] = { "39 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ........ .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. ... ... .. ", " .. .. .. ... ... .. ", " ....... .. .... .... .. ", " .. .. .. .. . . .. .. ", " .. .. .. .. ... .. .. ", " .. .. .. .. . .. .. ", " .. .. .. .. . .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/I.xpm100644 23564 23564 463 6602511533 16050 0ustar newtnewt/* XPM */ static char * I_xpm[] = { "8 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ", " .. ", " .. ", " .. ", " .. ", " .. ", " .. ", " .. ", " .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/IMG.xpm100644 23564 23564 1260 6602511533 16310 0ustar newtnewt/* XPM */ static char * IMG_xpm[] = { "29 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ..... ", " .. .. .. .. .. ", " .. ... ... .. ", " .. ... ... .. ", " .. .... .... .. .... ", " .. .. . . .. .. .. ", " .. .. ... .. .. .. ", " .. .. . .. .. .. ", " .. .. . .. .... . ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/INPUT.xpm100644 23564 23564 1634 6602511533 16600 0ustar newtnewt/* XPM */ static char * INPUT_xpm[] = { "42 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ...... .. .. ........ ", " .. ... .. .. .. .. .. .. ", " .. ... .. .. .. .. .. .. ", " .. .. . .. .. .. .. .. .. ", " .. .. . .. ...... .. .. .. ", " .. .. ... .. .. .. .. ", " .. .. ... .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. ..... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/ISINDEX.xpm100644 23564 23564 2210 6602511533 16773 0ustar newtnewt/* XPM */ static char * ISINDEX_xpm[] = { "55 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. ..... .. .. .. ..... ...... .. .. ", " .. .. .. .. ... .. .. .. .. .. .. ", " .. .. .. .. ... .. .. .. .. .. .. ", " .. ... .. .. . .. .. .. .. .... ", " .. ... .. .. . .. .. .. ...... .. ", " .. ... .. .. ... .. .. .. .... ", " .. .. .. .. .. ... .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. ", " .. ..... .. .. .. ..... ...... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/KBD.xpm100644 23564 23564 1324 6602511533 16275 0ustar newtnewt/* XPM */ static char * KBD_xpm[] = { "31 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ...... ..... ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .... .. .. .. .. ", " .... ...... .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. ...... ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/LI.xpm100644 23564 23564 663 6602511533 16166 0ustar newtnewt/* XPM */ static char * LI_xpm[] = { "15 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " ...... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/LINK.xpm100644 23564 23564 1371 6602511533 16434 0ustar newtnewt/* XPM */ static char * LINK_xpm[] = { "33 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. .. .. .. ", " .. .. ... .. .. .. ", " .. .. ... .. .. .. ", " .. .. .. . .. .... ", " .. .. .. . .. .... ", " .. .. .. ... .. .. ", " .. .. .. ... .. .. ", " .. .. .. .. .. .. ", " ...... .. .. .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/MAP.xpm100644 23564 23564 1324 6602511533 16312 0ustar newtnewt/* XPM */ static char * MAP_xpm[] = { "31 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ...... ", " .. .. .... .. .. ", " ... ... . . .. .. ", " ... ... .. .. .. .. ", " .... .... .. .. ...... ", " .. . . .. ...... .. ", " .. ... .. .. .. .. ", " .. . .. .. .. .. ", " .. . .. .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/MENU.xpm100644 23564 23564 1611 6602511533 16440 0ustar newtnewt/* XPM */ static char * MENU_xpm[] = { "41 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ...... .. .. .. .. ", " .. .. .. ... .. .. .. ", " ... ... .. ... .. .. .. ", " ... ... .. .. . .. .. .. ", " .... .... ...... .. . .. .. .. ", " .. . . .. .. .. ... .. .. ", " .. ... .. .. .. ... .. .. ", " .. . .. .. .. .. .. .. ", " .. . .. ...... .. .. ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/META.xpm100644 23564 23564 1545 6602511534 16431 0ustar newtnewt/* XPM */ static char * META_xpm[] = { "39 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ...... ........ .. ", " .. .. .. .. .... ", " ... ... .. .. . . ", " ... ... .. .. .. .. ", " .... .... ...... .. .. .. ", " .. . . .. .. .. ...... ", " .. ... .. .. .. .. .. ", " .. . .. .. .. .. .. ", " .. . .. ...... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/NOFRAMES.xpm100644 23564 23564 2761 6602511534 17116 0ustar newtnewt/* XPM */ static char * NOFRAMES_xpm[] = { "75 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .... ...... ...... .. .. .. ...... ..... ", " ... .. .. .. .. .. .. .... .. .. .. .. .. ", " ... .. .. .. .. .. .. . . ... ... .. .. .. ", " .. . .. .. .. .. .. .. .. .. ... ... .. ... ", " .. . .. .. .. ..... ...... .. .. .... .... ...... ... ", " .. ... .. .. .. .. .. ...... .. . . .. .. ... ", " .. ... .. .. .. .. .. .. .. .. ... .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. . .. .. .. .. ", " .. .. .... .. .. .. .. .. .. . .. ...... ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/OL.xpm100644 23564 23564 1037 6602511534 16211 0ustar newtnewt/* XPM */ static char * OL_xpm[] = { "21 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/OPTION.xpm100644 23564 23564 2143 6602511534 16706 0ustar newtnewt/* XPM */ static char * OPTION_xpm[] = { "53 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .... ...... ........ .. .... .. .. ", " .. .. .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. .. . .. ", " .. .. ...... .. .. .. .. .. . .. ", " .. .. .. .. .. .. .. .. ... ", " .. .. .. .. .. .. .. .. ... ", " .. .. .. .. .. .. .. .. .. ", " .... .. .. .. .... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/P.xpm100644 23564 23564 574 6602511534 16063 0ustar newtnewt/* XPM */ static char * P_xpm[] = { "12 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ", " .. .. ", " .. .. ", " .. .. ", " ...... ", " .. ", " .. ", " .. ", " .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/PAGE.xpm100644 23564 23564 1523 6602511534 16413 0ustar newtnewt/* XPM */ static char * PAGE_xpm[] = { "38 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. ..... ...... ", " .. .. .... .. .. .. ", " .. .. . . .. .. ", " .. .. .. .. .. .. ", " ...... .. .. .. .... ...... ", " .. ...... .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .... . ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/PARAM.xpm100644 23564 23564 2010 6602511534 16527 0ustar newtnewt/* XPM */ static char * PARAM_xpm[] = { "48 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... .. ...... .. .. .. ", " .. .. .... .. .. .... .. .. ", " .. .. . . .. .. . . ... ... ", " .. .. .. .. .. .. .. .. ... ... ", " ...... .. .. ...... .. .. .... .... ", " .. ...... .. .. ...... .. . . .. ", " .. .. .. .. .. .. .. .. ... .. ", " .. .. .. .. .. .. .. .. . .. ", " .. .. .. .. .. .. .. .. . .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/PRE.xpm100644 23564 23564 1260 6602511534 16323 0ustar newtnewt/* XPM */ static char * PRE_xpm[] = { "29 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ...... ...... ...... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ...... ...... ...... ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SAMP.xpm100644 23564 23564 1567 6602511534 16447 0ustar newtnewt/* XPM */ static char * SAMP_xpm[] = { "40 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. .. .. ...... ", " .. .. .... .. .. .. .. ", " .. .. . . ... ... .. .. ", " ... .. .. ... ... .. .. ", " ... .. .. .... .... ...... ", " ... ...... .. . . .. .. ", " .. .. .. .. .. ... .. .. ", " .. .. .. .. .. . .. .. ", " ..... .. .. .. . .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SCRIPT.xpm100644 23564 23564 2055 6602511534 16704 0ustar newtnewt/* XPM */ static char * SCRIPT_xpm[] = { "50 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .... ...... .. ...... ........ ", " .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " ... .. .. .. .. .. .. .. ", " ... .. ...... .. ...... .. ", " ... .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " ..... .... .. .. .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SELECT.xpm100644 23564 23564 2121 6602511534 16651 0ustar newtnewt/* XPM */ static char * SELECT_xpm[] = { "52 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ...... .. ...... .... ........ ", " .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " ... .. .. .. .. .. ", " ... ...... .. ...... .. .. ", " ... .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. ", " ..... ...... ...... ...... .... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SMALL.xpm100644 23564 23564 1744 6602511534 16554 0ustar newtnewt/* XPM */ static char * SMALL_xpm[] = { "46 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. .. .. .. .. ", " .. .. .. .. .... .. .. ", " .. .. ... ... . . .. .. ", " ... ... ... .. .. .. .. ", " ... .... .... .. .. .. .. ", " ... .. . . .. ...... .. .. ", " .. .. .. ... .. .. .. .. .. ", " .. .. .. . .. .. .. .. .. ", " ..... .. . .. .. .. ...... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SUB.xpm100644 23564 23564 1324 6602511534 16327 0ustar newtnewt/* XPM */ static char * SUB_xpm[] = { "31 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. .. ...... ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " ... .. .. .. .. ", " ... .. .. ...... ", " ... .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " ..... ..... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/STRIKE.xpm100644 23564 23564 2077 6602511534 16705 0ustar newtnewt/* XPM */ static char * STRIKE_xpm[] = { "51 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ........ ...... .. .. .. ...... ", " .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " ... .. .. .. .. .... .. ", " ... .. ...... .. .... ...... ", " ... .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. ", " ..... .. .. .. .. .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/STRONG.xpm100644 23564 23564 2317 6602511534 16715 0ustar newtnewt/* XPM */ static char * STRONG_xpm[] = { "59 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... ........ ...... .... .. .. ..... ", " .. .. .. .. .. .. .. ... .. .. .. ", " .. .. .. .. .. .. .. ... .. .. ", " ... .. .. .. .. .. .. . .. .. ", " ... .. ...... .. .. .. . .. .. .... ", " ... .. .. .. .. .. .. ... .. .. ", " .. .. .. .. .. .. .. .. ... .. .. ", " .. .. .. .. .. .. .. .. .. .. .. ", " ..... .. .. .. .... .. .. .... . ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/STYLE.xpm100644 23564 23564 1700 6602511534 16574 0ustar newtnewt/* XPM */ static char * STYLE_xpm[] = { "44 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .......... .. .. ...... ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " ... .. .. .. .. .. ", " ... .. .... .. ...... ", " ... .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " ..... .. .. ...... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/SUP.xpm100644 23564 23564 1302 6602511535 16342 0ustar newtnewt/* XPM */ static char * SUP_xpm[] = { "30 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ..... .. .. ...... ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " ... .. .. .. .. ", " ... .. .. ...... ", " ... .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ..... ..... .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TAB.xpm100644 23564 23564 1260 6602511535 16304 0ustar newtnewt/* XPM */ static char * TAB_xpm[] = { "29 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ .. ...... ", " .. .... .. .. ", " .. . . .. .. ", " .. .. .. .. .. ", " .. .. .. ...... ", " .. ...... .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TABLE.xpm100644 23564 23564 1700 6602511535 16524 0ustar newtnewt/* XPM */ static char * TABLE_xpm[] = { "44 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ .. ...... .. ...... ", " .. .... .. .. .. .. ", " .. . . .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. ...... .. ...... ", " .. ...... .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. ", " .. .. .. ...... ...... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TD.xpm100644 23564 23564 1037 6602511535 16207 0ustar newtnewt/* XPM */ static char * TD_xpm[] = { "21 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ ..... ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TEXTAREA.xpm100644 23564 23564 2605 6602511535 17117 0ustar newtnewt/* XPM */ static char * TEXTAREA_xpm[] = { "69 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ ...... .. .......... .. ...... ...... .. ", " .. .. .. .. .. .... .. .. .. .... ", " .. .. .. .. .. . . .. .. .. . . ", " .. .. .... .. .. .. .. .. .. .. .. ", " .. ...... .. .. .. .. ...... ...... .. .. ", " .. .. .... .. ...... .. .. .. ...... ", " .. .. .. .. .. .. .. .. .. .. .. .. ", " .. .. .. .. .. .. .. .. .. .. .. .. ", " .. ...... .. .. .. .. .. .. .. ...... .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TH.xpm100644 23564 23564 1037 6602511535 16213 0ustar newtnewt/* XPM */ static char * TH_xpm[] = { "21 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. ....... ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TITLE.xpm100644 23564 23564 1546 6602511535 16566 0ustar newtnewt/* XPM */ static char * TITLE_xpm[] = { "39 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ .. ........ .. ...... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. ...... ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. ...... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TR.xpm100644 23564 23564 1037 6602511535 16225 0ustar newtnewt/* XPM */ static char * TR_xpm[] = { "21 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ........ ...... ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. ...... ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/TT.xpm100644 23564 23564 1015 6602511535 16223 0ustar newtnewt/* XPM */ static char * TT_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ................ ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/U.xpm100644 23564 23564 616 6602511535 16066 0ustar newtnewt/* XPM */ static char * U_xpm[] = { "13 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " ..... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/UL.xpm100644 23564 23564 1015 6602511535 16214 0ustar newtnewt/* XPM */ static char * UL_xpm[] = { "20 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " .. .. .. ", " ..... ...... ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/VAR.xpm100644 23564 23564 1260 6602511535 16326 0ustar newtnewt/* XPM */ static char * VAR_xpm[] = { "29 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " .. .. .. ...... ", " .. .. .... .. .. ", " .. .. . . .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. ...... ", " . . ...... .. .. ", " .... .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/ZTEXT.xpm100644 23564 23564 1656 6602511535 16625 0ustar newtnewt/* XPM */ static char * ZTEXT_xpm[] = { "43 18 2 1", " c #FFFFFFFF0000", ". c #000000000000", " ", " ", " ", " ", " ............... ...... .. .......... ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. .... .. ", " .. .. ...... .. .. ", " .. .. .. .... .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " ....... .. ...... .. .. .. ", " ", " ", " ", " ", " "}; XmHTML-1.1.7/include/pixmaps/tags/tags.html100644 23564 23564 4210 6604540631 16773 0ustar newtnewt
    XmHTML-1.1.7/include/common/ 40755 23564 23564 0 6651263112 13724 5ustar newtnewtXmHTML-1.1.7/include/common/LZWStream.h100644 23564 23564 7567 6533065602 16044 0ustar newtnewt/***** * LZWStream.h : LZW uncompressor public header file * * This file Version $Revision: 1.3 $ * * Creation date: Thu May 8 04:57:06 GMT+0100 1997 * Last modification: $Date: 1997/08/30 00:25:02 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1997 by Ripley Software Development * All Rights Reserved * * This file is part of the XmHTML Widget Library. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. This software is provided "as is" without express or * implied warranty. * * Based on an idea from Derek D. Noonburg , author of * the public domain xpdf package, a PDF viewer. * *****/ /***** * $Source: /usr/local/rcs/Newt/XmHTML/RCS/LZWStream.h,v $ *****/ /***** * ChangeLog * $Log: LZWStream.h,v $ * Revision 1.3 1997/08/30 00:25:02 newt * Changed copyright. Use of the LZWStream package is now totally unrestricted. * * Revision 1.2 1997/08/01 12:52:23 newt * Progressive image loading changes * * Revision 1.1 1997/05/28 01:27:04 newt * Initial Revision * *****/ #ifndef _LZWStream_h_ #define _LZWStream_h_ #define BUFFERSIZE 512 /***** * LZW stream definition *****/ typedef struct _LZWStream{ FILE *zPipe; /* uncompress file handle */ FILE *f; /* compress file handle */ char zCmd[256]; /* uncompress command */ char *zName; /* compress file name, indexes in zCmd */ int error; /* uncompress error flag */ int uncompressed; /* uncompress finished flag */ ImageBuffer *ib; /* master input buffer */ unsigned char accum[BUFFERSIZE]; /* buffered output */ int acount; /* current char count */ /* LZW code computation variables */ char buf[280]; /* input buffer */ int curBit; /* no of bits processed so far */ int lastBit; /* bitcount of last bit in input buffer */ int lastByte; /* last known processed byte */ int done; /* input done flag */ int nextCode; /* LZW code counter */ /* global raster data variables */ int codeSize; /* bits per pixel */ int codeBits; /* bits used by each LZW code */ int clearCode; /* reset signal table signal */ int endCode; /* end-of-data signal */ int maxCode; /* start code signal */ int maxCodeSize; /* maximum signal table size */ char outBuf[16]; /* compress output buffer */ /* variables for images with 7 or less bits per pixel */ int offset; /* current bit offset */ int freeEntry; /* compress code counter */ int n_bits; /* output code size */ int maxcode8; /* maximum output signal */ int clearFlag; /* clear signal table flag */ /* data readers */ size_t (*readOK)(ImageBuffer*, unsigned char*, int); size_t (*getData)(ImageBuffer*, unsigned char*); char *err_msg; /* error description */ }LZWStream; /* create a new stream object */ extern LZWStream *LZWStreamCreate(ImageBuffer *ib, char *zCmd); /***** * Initialize uncompression. Possible return codes: * -2: the read functions haven't been set; * -1: temp file couldn't be opened; * 0: gif code size is invalid/couldn't be read; * 1: success. *****/ extern int LZWStreamInit(LZWStream *lzw); /* convert GIF LZW to compress LZW */ extern void LZWStreamConvert(LZWStream *lzw); /* destroy the stream object */ extern void LZWStreamDestroy(LZWStream *lzw); /* return an allocated buffer with uncompressed stream data */ extern unsigned char *LZWStreamUncompress(LZWStream *lzw, int *size); /* read uncompressed data from the stream */ extern int LZWStreamFillBuffer(LZWStream *lzw, unsigned char *data, int size); /* return original bits per pixel */ extern int LZWStreamGetCodeSize(LZWStream *lzw); /* Don't add anything after this endif! */ #endif /* _LZWStream_h_ */ XmHTML-1.1.7/include/common/stack.h100644 23564 23564 6121 6607231641 15302 0ustar newtnewt/***** * stack.h : generic stack routines * * This file Version $Revision: 1.1 $ * * Creation date: Thu Apr 2 12:26:52 GMT+0100 1998 * Last modification: $Date: 1998/04/04 06:27:26 $ * By: $Author: newt $ * Current State: $State: Exp $ * * Author: newt * * Copyright (C) 1994-1998 by 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/stack.h,v $ *****/ /***** * ChangeLog * $Log: stack.h,v $ * Revision 1.1 1998/04/04 06:27:26 newt * Initial Revision * *****/ #ifndef _stack_h_ #define _stack_h_ /* Stack is an opaque definition, defined in stack.c */ typedef struct _StackRegistry *Stack; /***** * Create a stack. * fallback: data to return when the stack is becoming negative. * destroy_data_func is a function that will be called when the stack * is destroyed while items are still remaining on the stack. *****/ extern Stack StackCreate(void *fallback, void (*destroy_data_func)(void*)); /* create a stack that can stack two sets of data */ extern Stack StackCreateDouble(void *fallback_data1, void *fallback_data2, void (*destroy_data_func)(void*), void (*second_destroy_data_func)(void*)); /***** * Destroy the given stack (and any data remaining). Returns the no * of items that still remained on the stack. *****/ extern int StackDestroy(Stack stack); /***** * Push data onto a stack. data is the data to be pushed, and should be cast * to void* by the caller. Returns 1 when data was successfully pushed, 0 * if not. *****/ extern int StackPushData(Stack stack, void *data); /* push two sets of data on the stack */ extern int StackPushDoubleData(Stack stack, void *data1, void *data2); /***** * Pop data from the stack. Returned data should be cast to an appropriate * type by the caller. *****/ extern void* StackPopData(Stack stack); /* pop two sets of data from the stack */ extern void* StackPopDoubleData(Stack stack, void **data); /* return size of the stack */ extern int StackSize(Stack stack); /* convenient macros, take care of typecasting when pushing & popping data */ #define StackPush(S,D) StackPushData(S,(void*)(D)) #define StackPop(S) StackPopData(S) #define StackPushDouble(S,D1,D2) \ StackPushDoubleData(S,(void*)(D1), (void*)(D2)) #define StackPopDouble(S,D) \ StackPopDoubleData(S,(void**)&(D)) /* Don't add anything after this endif! */ #endif /* _stack_h_ */ XmHTML-1.1.7/include/common/debug.h100644 23564 23564 12137 6533065602 15307 0ustar newtnewt/***** * debug.h : ntUtil debug defines * * This file Version $Revision: 1.7 $ * * Creation date: Fri Oct 18 04:52:25 GMT+0100 1996 * Last modification: $Date: 1998/04/27 06:58:50 $ * 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/debug.h,v $ *****/ /***** * ChangeLog * $Log: debug.h,v $ * Revision 1.7 1998/04/27 06:58:50 newt * made completely tka * * Revision 1.6 1998/04/04 06:28:04 newt * XmHTML Beta 1.1.3 * * Revision 1.5 1997/08/30 00:47:36 newt * debug to file changes. * * Revision 1.4 1997/08/01 12:58:54 newt * Updated function protos. * * Revision 1.3 1997/03/02 23:16:20 newt * Modified header files. * * Revision 1.2 1997/01/09 06:56:02 newt * expanded copyright marker * * Revision 1.1 1996/12/19 02:17:19 newt * Initial Revision * *****/ #ifndef _debug_h_ #define _debug_h_ /* obliterate when NDEBUG has been defined */ #if defined(DEBUG) && defined(NDEBUG) # ifdef DEBUG # undef DEBUG # endif #endif #ifndef NDEBUG #define MAX_DEBUG_LEVELS 64 /* array of selected debug levels */ extern int __rsd__debug_levels_defined[]; /* full debug selection flag */ extern int __rsd__debug_full; /* global warning disable flag */ extern int debug_disable_warnings; extern int __rsd_selectDebugLevels(char *levels); extern void __rsd_setDebugLevels(int *argc, char **argv); extern void __rsd_initDebug(int initial); extern void __rsd_fprintf(char *fmt, ...); #endif /* NDEBUG */ #ifdef DEBUG /* macro to display an error message and dump the core */ #define my_assert(TST) if((TST) != True) do { \ fprintf(stderr, "Assertion failed: %s\n (file %s, line %i)\n", \ #TST, __FILE__, __LINE__); \ abort(); \ }while(0) /* * Select possible debug levels * levels _can_ start with a ``-d'', so you can call this routine * from a routine that processes the command line options. * Calling this routine with a NULL param deselects all debug levels * Calling this routine with the string "all" selects all debug levels. */ #define _XmHTMLSelectDebugLevels(LEVELS) __rsd_selectDebugLevels(LEVELS) #define _XmHTMLSetDebugLevels(ARGC, ARGV) __rsd_setDebugLevels(ARGC, ARGV) #define _XmHTMLInitDebug(LEVEL) __rsd_initDebug(LEVEL) #define _XmHTMLSetFullDebug(STATE) __rsd__debug_full = STATE /* display a debug message */ #define _XmHTMLDebug(LEVEL,MSG) do {\ if(__rsd__debug_levels_defined[LEVEL]) \ { __rsd_fprintf MSG;} \ }while(0) /* * flush a message to the output file. Mainly intended for XmHTML's warning * & error routines. * The level MAX_DEBUG_LEVELS (unselectable by itself) will be valid * if debug to file has been selected. */ #define _XmHTMLDebugMirrorToFile(MSG) do {\ if(__rsd__debug_levels_defined[MAX_DEBUG_LEVELS]) \ { __rsd_fprintf MSG;} \ }while(0) /* display a debug message */ #define _XmHTMLFullDebug(LEVEL,MSG) do {\ if(__rsd__debug_levels_defined[LEVEL] && __rsd__debug_full == True) \ { __rsd_fprintf MSG;} \ }while(0) #else /* !DEBUG */ #define my_assert(TST) /* empty */ #define _XmHTMLDebug(LEVEL,MSG) /* empty */ #define _XmHTMLFullDebug(LEVEL,MSG) /* empty */ #define _XmHTMLDebugMirrorToFile(MSG) /* empty */ #define _XmHTMLSelectDebugLevels(LEVELS) /* empty */ #define _XmHTMLSetDebugLevels(ARGC, ARGV) /* empty */ #define _XmHTMLSetFullDebug(STATE) /* empty */ #define _XmHTMLInitDebug(LEVEL) /* empty */ #endif /* DEBUG */ /***** * Timing defines. * Only available when compiled with GCC and when requested. * Defining _WANT_TIMINGS yourself doesn't have *any* effect, its defined in * source files where I want to known how much time a routine requires to * perform it's task (crude profiling). *****/ #if defined(DEBUG) && defined(_WANT_TIMINGS) && defined(__GNUC__) #include /* timeval def */ #include /* gettimeofday() */ static struct timeval tstart, tend; #define SetTimer gettimeofday(&tstart,NULL) #define ShowTimer(LEVEL, FUNC) do { \ int secs, usecs; \ gettimeofday(&tend, NULL); \ secs = (int)(tend.tv_sec - tstart.tv_sec); \ usecs = (int)(tend.tv_usec - tstart.tv_usec); \ if(usecs < 0) usecs *= -1; \ _XmHTMLDebug(LEVEL,("%s: done in %i.%i seconds\n",FUNC,secs,usecs)); \ }while(0) #else #define SetTimer /* empty */ #define ShowTimer(LEVEL,FUNC) /* empty */ #endif /* Don't add anything after this endif! */ #endif /* _debug_h_ */ XmHTML-1.1.7/include/common/escapes.h100644 23564 23564 15310 6533065602 15640 0ustar newtnewt/***** * escapes.h : HTML iso escape code table * * This file Version $Revision: 1.2 $ * * Creation date: Tue Nov 19 05:13:58 GMT+0100 1996 * Last modification: $Date: 1997/01/09 06:56:05 $ * 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/escapes.h,v $ *****/ /***** * ChangeLog * $Log: escapes.h,v $ * Revision 1.2 1997/01/09 06:56:05 newt * expanded copyright marker * * Revision 1.1 1996/12/19 02:17:20 newt * Initial Revision * *****/ #ifndef _escapes_h_ #define _escapes_h_ typedef struct{ char *escape; /* escape character sequence */ char token; /* corresponding iso-char */ int len; /* length of escape sequence */ }escape_data; /* * List of all possible HTML escape codes. This list has been alphabetically * sorted to speed up the search process. * This list contains 198 elements. The last element is the NULL element. * The first part of this table contains the hash escapes, the second part * contains the named entity escapes. */ #define NUM_ESCAPES 198 static escape_data escapes[NUM_ESCAPES] = { {"#160;", '\240', 5}, {"#161;", '\241', 5}, {"#162;", '\242', 5}, {"#163;", '\243', 5}, {"#164;", '\244', 5}, {"#165;", '\245', 5}, {"#166;", '\246', 5}, {"#167;", '\247', 5}, {"#168;", '\250', 5}, {"#169;", '\251', 5}, {"#170;", '\252', 5}, {"#171;", '\253', 5}, {"#172;", '\254', 5}, {"#173;", '\255', 5}, {"#174;", '\256', 5}, {"#175;", '\257', 5}, {"#176;", '\260', 5}, {"#177;", '\261', 5}, {"#178;", '\262', 5}, {"#179;", '\263', 5}, {"#180;", '\264', 5}, {"#181;", '\265', 5}, {"#182;", '\266', 5}, {"#183;", '\267', 5}, {"#184;", '\270', 5}, {"#185;", '\271', 5}, {"#186;", '\272', 5}, {"#187;", '\273', 5}, {"#188;", '\274', 5}, {"#189;", '\275', 5}, {"#190;", '\276', 5}, {"#191;", '\277', 5}, {"#192;", '\300', 5}, {"#193;", '\301', 5}, {"#194;", '\302', 5}, {"#195;", '\303', 5}, {"#196;", '\304', 5}, {"#197;", '\305', 5}, {"#198;", '\306', 5}, {"#199;", '\307', 5}, {"#200;", '\310', 5}, {"#201;", '\311', 5}, {"#202;", '\312', 5}, {"#203;", '\313', 5}, {"#204;", '\314', 5}, {"#205;", '\315', 5}, {"#206;", '\316', 5}, {"#207;", '\317', 5}, {"#208;", '\320', 5}, {"#209;", '\321', 5}, {"#210;", '\322', 5}, {"#211;", '\323', 5}, {"#212;", '\324', 5}, {"#213;", '\325', 5}, {"#214;", '\326', 5}, {"#215;", '\327', 5}, {"#216;", '\330', 5}, {"#217;", '\331', 5}, {"#218;", '\332', 5}, {"#219;", '\333', 5}, {"#220;", '\334', 5}, {"#221;", '\335', 5}, {"#222;", '\336', 5}, {"#223;", '\337', 5}, {"#224;", '\340', 5}, {"#225;", '\341', 5}, {"#226;", '\342', 5}, {"#227;", '\343', 5}, {"#228;", '\344', 5}, {"#229;", '\345', 5}, {"#230;", '\346', 5}, {"#231;", '\347', 5}, {"#232;", '\350', 5}, {"#233;", '\351', 5}, {"#234;", '\352', 5}, {"#235;", '\353', 5}, {"#236;", '\354', 5}, {"#237;", '\355', 5}, {"#238;", '\356', 5}, {"#239;", '\357', 5}, {"#240;", '\360', 5}, {"#241;", '\361', 5}, {"#242;", '\362', 5}, {"#243;", '\363', 5}, {"#244;", '\364', 5}, {"#245;", '\365', 5}, {"#246;", '\366', 5}, {"#247;", '\367', 5}, {"#248;", '\370', 5}, {"#249;", '\371', 5}, {"#250;", '\372', 5}, {"#251;", '\373', 5}, {"#252;", '\374', 5}, {"#253;", '\375', 5}, {"#254;", '\376', 5}, {"#255;", '\377', 5}, {"AElig;", '\306', 6}, {"Aacute;", '\301', 7}, {"Acirc;", '\302', 6}, {"Agrave;", '\300', 7}, {"Aring;", '\305', 6}, {"Atilde;", '\303', 7}, {"Auml;", '\304', 5}, {"Ccedil;", '\307', 7}, {"ETH;", '\320', 4}, {"Eacute;", '\311', 7}, {"Ecirc;", '\312', 6}, {"Egrave;", '\310', 7}, {"Euml;", '\313', 5}, {"Iacute;", '\315', 7}, {"Icirc;", '\316', 6}, {"Igrave;", '\314', 7}, {"Iuml;", '\317', 5}, {"Ntilde;", '\321', 7}, {"Oacute;", '\323', 7}, {"Ocirc;", '\324', 6}, {"Ograve;", '\322', 7}, {"Oslash;", '\330', 7}, {"Otilde;", '\325', 7}, {"Ouml;", '\326', 5}, {"THORN;", '\336', 6}, {"Uacute;", '\332', 7}, {"Ucirc;", '\333', 6}, {"Ugrave;", '\331', 7}, {"Uuml;", '\334', 5}, {"Yacute;", '\335', 7}, {"aacute;", '\341', 7}, {"acirc;", '\342', 6}, {"acute;", '\264', 6}, {"aelig;", '\346', 6}, {"agrave;", '\340', 7}, {"amp;", '&', 4}, {"aring;", '\345', 6}, {"atilde;", '\343', 7}, {"auml;", '\344', 5}, {"brvbar;", '\246', 7}, {"ccedil;", '\347', 7}, {"cedil;", '\270', 6}, {"cent;", '\242', 5}, {"copy;", '\251', 5}, {"curren;", '\244', 7}, {"deg;", '\260', 4}, {"divide;", '\367', 7}, {"eacute;", '\351', 7}, {"ecirc;", '\352', 6}, {"egrave;", '\350', 7}, {"eth;", '\360', 4}, {"euml;", '\353', 5}, {"frac12;", '\275', 7}, {"frac14;", '\274', 7}, {"frac34;", '\276', 7}, {"gt;", '>', 3}, {"hibar;", '\257', 6}, {"iacute;", '\355', 7}, {"icirc;", '\356', 6}, {"iexcl;", '\241', 6}, {"igrave;", '\354', 7}, {"iquest;", '\277', 7}, {"iuml;", '\357', 5}, {"laquo;", '\253', 6}, {"lt;", '<', 3}, {"macr;", '\257', 5}, {"micro;", '\265', 6}, {"middot;", '\267', 7}, {"nbsp;", '\240', 5}, {"not;", '\254', 4}, {"ntilde;", '\361', 7}, {"oacute;", '\363', 7}, {"ocirc;", '\364', 6}, {"ograve;", '\362', 7}, {"ordf;", '\252', 5}, {"ordm;", '\272', 5}, {"oslash;", '\370', 7}, {"otilde;", '\365', 7}, {"ouml;", '\366', 5}, {"para;", '\266', 5}, {"plusmn;", '\261', 7}, {"pound;", '\243', 6}, {"quot;", '\"', 5}, {"raquo;", '\273', 6}, {"reg;", '\256', 4}, {"sect;", '\247', 5}, {"shy;", '\255', 4}, {"sup1;", '\271', 5}, {"sup2;", '\262', 5}, {"sup3;", '\263', 5}, {"szlig;", '\337', 6}, {"thorn;", '\376', 6}, {"times;", '\327', 6}, {"uacute;", '\372', 7}, {"ucirc;", '\373', 6}, {"ugrave;", '\371', 7}, {"uml;", '\250', 4}, {"uuml;", '\374', 5}, {"yacute;", '\375', 7}, {"yen;", '\245', 4}, {"yuml;", '\377', 5}, {NULL, 0, 0} }; /* Don't add anything after this endif! */ #endif /* _escapes_h_ */ XmHTML-1.1.7/include/common/icons.h100644 23564 23564 15470 6602510530 15327 0ustar newtnewt/***** * icons.h : HTML Predefined icon-like symbols * Based on W3C Working Draft WD-wwwicn-960729 * * This file Version $Revision: 1.1 $ * * Creation date: Fri Jun 26 21:48:39 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by 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$ *****/ /***** * ChangeLog * $Log$ * *****/ #ifndef _icons_h_ #define _icons_h_ /* for use with the standalone HTML parser */ #ifdef MINIPARSE /***** * Definition of a W3C icon entity. *****/ typedef struct { char *escape; char *data; char *icon; int len; }IconEntity; #define W3CICON(NAME) #NAME #define NUM_ESCAPE_ICONS 61 #else /* !MINIPARSE, XmHTML */ #define W3CICON(NAME) __builtin_w3c_icon_##NAME /***** * The builtin-icons. * All color icons share the same colormap, which has at most 16 entries. *****/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* !MINIPARSE */ /***** * List of all proposed HTML icon-like symbols. This list has been * alphabetically sorted to speed up the search process. * This list contains 61 elements. The last element is the NULL element. *****/ IconEntity _XmHTMLIconEntities[NUM_ESCAPE_ICONS] = { {"archive;", W3CICON(archive), NULL, 8 }, {"audio;", W3CICON(audio), NULL, 6 }, {"binary.document;", W3CICON(binary_document), NULL, 16}, {"binhex.document;", W3CICON(binhex_document), NULL, 16}, {"calculator;", W3CICON(calculator), NULL, 11}, {"caution;", W3CICON(caution), NULL, 8 }, {"cd.i;", W3CICON(cd_i), NULL, 5 }, {"cd.rom;", W3CICON(cd_rom), NULL, 7 }, {"clock;", W3CICON(clock), NULL, 6 }, {"compressed.document;",W3CICON(compressed_document), NULL, 20}, {"disk.drive;", W3CICON(disk_drive), NULL, 11}, {"diskette;", W3CICON(diskette), NULL, 9 }, {"display;", W3CICON(display), NULL, 8 }, {"document;", W3CICON(document), NULL, 9 }, {"fax;", W3CICON(fax), NULL, 4 }, {"filing.cabinet;", W3CICON(filing_cabinet), NULL, 15}, {"film;", W3CICON(film), NULL, 5 }, {"fixed.disk;", W3CICON(fixed_disk), NULL, 11}, {"folder.open;", W3CICON(folder_open), NULL, 12}, {"folder;", W3CICON(folder), NULL, 7 }, {"form;", W3CICON(form), NULL, 5 }, {"ftp;", W3CICON(ftp), NULL, 4 }, {"glossary;", W3CICON(glossary), NULL, 9 }, {"gopher;", W3CICON(gopher), NULL, 7 }, {"home;", W3CICON(home), NULL, 5 }, {"html;", W3CICON(html), NULL, 5 }, {"image;", W3CICON(image), NULL, 6 }, {"index;", W3CICON(index), NULL, 6 }, {"keyboard;", W3CICON(keyboard), NULL, 9 }, {"mail.in;", W3CICON(mail_in), NULL, 8 }, {"mail.out;", W3CICON(mail_out), NULL, 9 }, {"mail;", W3CICON(mail), NULL, 5 }, {"map;", W3CICON(map), NULL, 4 }, {"mouse;", W3CICON(mouse), NULL, 6 }, {"network;", W3CICON(network), NULL, 8 }, {"new;", W3CICON(new), NULL, 4 }, {"next;", W3CICON(next), NULL, 5 }, {"notebook;", W3CICON(notebook), NULL, 9 }, {"parent;", W3CICON(parent), NULL, 7 }, {"play.fast.forward;", W3CICON(play_fast_forward), NULL, 18}, {"play.fast.reverse;", W3CICON(play_fast_reverse), NULL, 18}, {"play.pause;", W3CICON(play_pause), NULL, 11}, {"play.start;", W3CICON(play_start), NULL, 11}, {"play.stop;", W3CICON(play_stop), NULL, 10}, {"previous;", W3CICON(previous), NULL, 9 }, {"printer;", W3CICON(printer), NULL, 8 }, {"sadsmiley;", W3CICON(sadsmiley), NULL, 10}, {"smiley;", W3CICON(smiley), NULL, 7 }, {"stop;", W3CICON(stop), NULL, 5 }, {"summary;", W3CICON(summary), NULL, 8 }, {"telephone;", W3CICON(telephone), NULL, 10}, {"telnet;", W3CICON(telnet), NULL, 7 }, {"text.document;", W3CICON(text_document), NULL, 14}, {"tn3270;", W3CICON(tn3270), NULL, 7 }, {"toc;", W3CICON(toc), NULL, 4 }, {"trash;", W3CICON(trash), NULL, 6 }, {"unknown.document;", W3CICON(unknown_document), NULL, 17}, {"uuencoded.document;", W3CICON(uuencoded_document), NULL, 19}, {"work;", W3CICON(work), NULL, 5 }, {"www;", W3CICON(www), NULL, 4 }, {NULL, NULL, NULL, 0 } }; /* Don't add anything after this endif! */ #endif /* _icons_h_ */ XmHTML-1.1.7/include/common/xpmtags.h100644 23564 23564 11710 6607232051 15674 0ustar newtnewt/***** * Automatically generated file. * *** DO NOT EDIT THIS FILE *** *****/ /***** * File created at Thu Sep 24 20:45:45 CEST 1998 by newt *****/ #ifndef _xpmtags_h_ #define _xpmtags_h_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define NUM_TAG_ICONS 74 /***** * List of all HTML tags and their corresponding icons *****/ IconEntity _XmHTMLTagIcons[NUM_TAG_ICONS] = { {"DOCTYPE", DOCTYPE_xpm, NULL, 7}, {"A", A_xpm, NULL, 1}, {"ADDRESS", ADDRESS_xpm, NULL, 7}, {"APPLET", APPLET_xpm, NULL, 6}, {"AREA", AREA_xpm, NULL, 4}, {"B", B_xpm, NULL, 1}, {"BASE", BASE_xpm, NULL, 4}, {"BASEFONT", BASEFONT_xpm, NULL, 8}, {"BIG", BIG_xpm, NULL, 3}, {"BLOCKQUOTE", BLOCKQUOTE_xpm, NULL, 10}, {"BODY", BODY_xpm, NULL, 4}, {"BR", BR_xpm, NULL, 2}, {"CAPTION", CAPTION_xpm, NULL, 7}, {"CENTER", CENTER_xpm, NULL, 6}, {"CITE", CITE_xpm, NULL, 4}, {"CODE", CODE_xpm, NULL, 4}, {"DD", DD_xpm, NULL, 2}, {"DFN", DFN_xpm, NULL, 3}, {"DIR", DIR_xpm, NULL, 3}, {"DIV", DIV_xpm, NULL, 3}, {"DL", DL_xpm, NULL, 2}, {"DT", DT_xpm, NULL, 2}, {"EM", EM_xpm, NULL, 2}, {"FONT", FONT_xpm, NULL, 4}, {"FORM", FORM_xpm, NULL, 4}, {"FRAME", FRAME_xpm, NULL, 5}, {"FRAMESET", FRAMESET_xpm, NULL, 8}, {"H1", H1_xpm, NULL, 2}, {"H2", H2_xpm, NULL, 2}, {"H3", H3_xpm, NULL, 2}, {"H4", H4_xpm, NULL, 2}, {"H5", H5_xpm, NULL, 2}, {"H6", H6_xpm, NULL, 2}, {"HEAD", HEAD_xpm, NULL, 4}, {"HR", HR_xpm, NULL, 2}, {"HTML", HTML_xpm, NULL, 4}, {"I", I_xpm, NULL, 1}, {"IMG", IMG_xpm, NULL, 3}, {"INPUT", INPUT_xpm, NULL, 5}, {"ISINDEX", ISINDEX_xpm, NULL, 7}, {"KBD", KBD_xpm, NULL, 3}, {"LI", LI_xpm, NULL, 2}, {"LINK", LINK_xpm, NULL, 4}, {"MAP", MAP_xpm, NULL, 3}, {"MENU", MENU_xpm, NULL, 4}, {"META", META_xpm, NULL, 4}, {"NOFRAMES", NOFRAMES_xpm, NULL, 8}, {"OL", OL_xpm, NULL, 2}, {"OPTION", OPTION_xpm, NULL, 6}, {"P", P_xpm, NULL, 1}, {"PAGE", PAGE_xpm, NULL, 4}, {"PARAM", PARAM_xpm, NULL, 5}, {"PRE", PRE_xpm, NULL, 3}, {"SAMP", SAMP_xpm, NULL, 4}, {"SCRIPT", SCRIPT_xpm, NULL, 6}, {"SELECT", SELECT_xpm, NULL, 6}, {"SMALL", SMALL_xpm, NULL, 5}, {"STRIKE", STRIKE_xpm, NULL, 6}, {"STRONG", STRONG_xpm, NULL, 6}, {"STYLE", STYLE_xpm, NULL, 5}, {"SUB", SUB_xpm, NULL, 3}, {"SUP", SUP_xpm, NULL, 3}, {"TAB", TAB_xpm, NULL, 3}, {"TABLE", TABLE_xpm, NULL, 5}, {"TD", TD_xpm, NULL, 2}, {"TEXTAREA", TEXTAREA_xpm, NULL, 8}, {"TH", TH_xpm, NULL, 2}, {"TITLE", TITLE_xpm, NULL, 5}, {"TR", TR_xpm, NULL, 2}, {"TT", TT_xpm, NULL, 2}, {"U", U_xpm, NULL, 1}, {"UL", UL_xpm, NULL, 2}, {"VAR", VAR_xpm, NULL, 3}, {"ZTEXT", ZTEXT_xpm, NULL, 5}, {NULL, NULL, NULL, 0} }; /* Don't add anything after this endif! */ #endif /* _xpmtags_h_ */ XmHTML-1.1.7/include/common/XmHTMLconf.h100644 23564 23564 21604 6650763625 16151 0ustar newtnewt/***** * XmHTMLconf.h : overall configuration settings. * * This file Version $Revision: 1.1 $ * * Creation date: Tue Oct 13 23:49:13 CEST 1998 * Last modification: $Date$ * By: $Author$ * Current State: $State$ * * Author: XmHTML Developers Account * * Copyright (C) 1994-1998 by 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$ *****/ /***** * ChangeLog * $Log$ * *****/ /***** * This file contains a number of default values that can only be set at * compile-time. These values modify the default behaviour of the XmHTML * widget, so be carefull when modifying these values. *****/ #ifndef _XmHTMLconf_h_ #define _XmHTMLconf_h_ #include #ifndef BYTE_ALREADY_TYPEDEFED #define BYTE_ALREADY_TYPEDEFED typedef unsigned char Byte; #endif /* BYTE_ALREADY_TYPEDEFED */ /***** * Time window in which button press & release trigger an anchor activation. * (specified in milliseconds). *****/ #define XmHTML_BUTTON_RELEASE_TIME 500 /***** * Default horizontal & vertical marginwidth. *****/ #define XmHTML_DEFAULT_MARGIN 20 /***** * Number of pixels to scroll when the scrollbar isn't being dragged but * moved by either keyboard actions or arrow pressing. Be warned that * using large values will cause a jumpy scrolling as XmHTML will have to * render increasing amounts of data. *****/ #define XmHTML_HORIZONTAL_SCROLL_INCREMENT 12 /* average char width */ #define XmHTML_VERTICAL_SCROLL_INCREMENT 18 /* average line height */ /***** * Width of a horizontal tab (in spaces) for preformatted text. *****/ #define XmHTML_DEFAULT_TABWIDTH 8 /***** * Number of milliseconds that must elapse before the next scroll movement * (through the keyboard interface) will be honored. *****/ #define XmHTML_DEFAULT_REPEAT_DELAY 25 /***** * Absolute maximum no of colors XmHTML may use. It is the maximum value for * the XmNmaxImageColors resource. * Increasing this number isn't a wise thing to do since all image routines * are optimized for using paletted images. If you want XmHTML to handle more * than 256 colors, you will have to modify the code. *****/ #define XmHTML_MAX_IMAGE_COLORS 256 /***** * Initial size of the Pixel hashtable. A large value will provide a sparse * hashtable with few collisions. A small value will make the table compact * but can lead to a (considerable) number of collisions. * Calculating the optimal value is a tradeoff between speed and memory: * in a sparse table, few collisions will occur but the memory consumption * will be considerable (each entry occupies 28 bytes). A compact table will * undoubtably lead to a number of collisions which has its impact on both * storing and retrieving a value from the hashtable. * Note: this setting is unused by Gtk/XmHTML, it uses hashing routines * provided for by gtk. *****/ #define XmHTML_COLORHASH_SIZE 1024 /***** * Default character set and fonts sets for proportional and fixed * text. *****/ #define XmHTML_DEFAULT_CHARSET "iso8859-1" #define XmHTML_DEFAULT_PROPORTIONAL_FONT "adobe-times-normal-*" #define XmHTML_DEFAULT_FIXED_FONT "adobe-courier-normal-*" /***** * Default font sizes * Scalable size array: default,sub/superscript,h1,h2,h3,h4,h5,h6 * Fixed size array : default,sub/superscript *****/ #define XmHTML_DEFAULT_FONT_SCALABLE_SIZES "14,8,24,18,14,12,10,8" #define XmHTML_DEFAULT_FONT_FIXED_SIZES "12,8" /***** * Default Table border width, cell & row spacing and padding. * Default border width is only used if the border attribute is present * but doesn't have a value. * BTW: the rowspacing and rowpadding attributes are not part of the * HTML spec. *****/ #define XmHTML_DEFAULT_TABLE_BORDERWIDTH 1 #define XmHTML_DEFAULT_CELLSPACING 0 #define XmHTML_DEFAULT_ROWSPACING 0 #define XmHTML_DEFAULT_CELLPADDING 2 #define XmHTML_DEFAULT_ROWPADDING 2 /***** * Maximum depth of nested lists and the default indentation for a single * list item. *****/ #define XmHTML_NESTED_LISTS_MAX 26 #define XmHTML_INDENT_SPACES 3 /***** * Maximum number of iterations the text-justification routines may reach. * Decreasing the default value of 1500 will lead to an increasing amount * of warnings. *****/ #define XmHTML_MAX_JUSTIFY_ITERATIONS 1500 /***** * Maximum number of iterations the table layout computation routines may * reach. This only occurs when the minimum suggested table width is smaller * than the available width and the maximum suggested table width is larger * than the available width. In this case, the layout routines have to compute * an optimum balance between the different column widths within the available * width. The algorithm used should be convergent, but could be divergent for * nested tables or tables prefixed with an extreme indentation (nested lists * and such). Hence the safeguard. *****/ #define XmHTML_MAX_TABLE_ITERATIONS 128 /***** * Default gamma correction value for your display. This is only used for * images that support gamma correction (JPEG and PNG). * 2.2 is a good assumption for almost every X display. * For a Silicon Graphics displays, change this to 1.8 * For Macintosh displays (MkLinux), change this to 1.4 (so I've been told) * If you change this value, it *must* be a floating point value. * Note: this define is the default value for the XmNscreenGamma resource. *****/ #define XmHTML_DEFAULT_GAMMA 2.2 /***** * Maximum size of the PLC get_data() buffer. This is the maximum amount * of data that will be requested to a function installed on the * XmNprogressiveReadProc. Although this define can have any value, using * a very small value will make progressive loading very slow, while using * a large value will make the response of XmHTML slow while any PLC's are * active. * The first call to the get_data() routine will request PLC_MAX_BUFFER_SIZE * bytes, while the size requested by any following calls will depend on the * type of image being loaded and the amount of data left in the current input * buffer. *****/ #define PLC_MAX_BUFFER_SIZE 2048 /***** * The default timeout value for the Progressive Loader Context. This * timeout is the default value for the XmNprogressiveInitialDelay and * specifies the polling interval between subsequent PLC calls. * * Specified in milliseconds (1 second = 1000 milliseconds) * XmHTML dynamically adjusts the timeout value as necessary and recomputes * it after each PLC call. * PLC_MIN_DELAY is the minimum value XmHTML can reduce the timeout to while * PLC_MAX_DELAY is the maximum value XmHTML can increase the timeout to. *****/ #define PLC_DEFAULT_DELAY 250 #define PLC_MIN_DELAY 5 #define PLC_MAX_DELAY 1000 /***************** End of User configurable section *****************/ /***** * magic number for the XmHTMLImage structure. XmHTML uses this field to verify * the return value from a user-installed primary image cache. *****/ #define XmHTML_IMAGE_MAGIC 0xce /***** * Number of default icon entities. This number must equal the number * of elements in the _XmHTMLIconEntities array in icons.h *****/ #define NUM_ESCAPE_ICONS 61 /* lint kludge */ #ifdef lint #undef True #undef False #define True ((Boolean)1) #define False ((Boolean)0) #endif /* lint */ /***** * When X was written, noboby ever heard of C++, let alone what words * would be reserved for this language, and as a result of this, a few * structures in X contain words that could cause a problem when compiling * XmHTML with a C++ compiler. *****/ #if defined(__cplusplus) || defined(c_plusplus) #define MEMBER_CLASS c_class #define MEMBER_NEW c_new #define MEMBER_DELETE c_delete #else #define MEMBER_CLASS class #define MEMBER_NEW new #define MEMBER_DELETE delete #endif /***** * None can be undefined if we aren't compiled for Xt/Motif. *****/ #ifndef None #define None 0 #endif #define IdleKeep False #define IdleRemove True #define NullTimeout None /***** * Sanity check: production is only allowed when both ndebug and _library * have been defined. *****/ #ifdef production # ifndef NDEBUG # error You can not define production without defining NDEBUG. # endif /* NDEBUG */ # ifndef _LIBRARY # error Configuration error: production defined without _LIBRARY defined. # endif /* _LIBRARY */ #endif /* production */ /* Don't add anything after this endif! */ #endif /* _XmHTMLconf_h_ */ XmHTML-1.1.7/include/common/HTMLWarnings.h100644 23564 23564 47630 6607233160 16502 0ustar newtnewt/***** * Automatically generated file. * ***DO NOT EDIT THIS FILE*** *****/ /***** * mkStrings Version 1.30, Build Date: Oct 9 1998 00:01:43 * File created at: Fri Oct 9 00:01:45 1998 *****/ #ifndef __XmHTML_Messages_h__ #define __XmHTML_Messages_h__ _XFUNCPROTOBEGIN /***** * Don't define XmHTML_STRINGDEFINES if you want to save space *****/ #ifndef XmHTML_STRINGDEFINES # ifndef _XmConst # ifdef __STDC__ # define _XmConst const # else # define _XmConst # endif # endif extern _XmConst char _XmHTMLMessages[]; #endif #ifdef XmHTML_STRINGDEFINES # define XMHTML_MSG_0 \ "Bad %s value, reset to %s " # define XMHTML_MSG_1 \ "Shape extension not supported by XServer, resetting XmNballoonStyle to XmBALLOON_SQUARE." # define XMHTML_MSG_2 \ "XmBalloon requires a non-NULL parent" # define XMHTML_MSG_3 \ "Invalid escape sequence: %s..." # define XMHTML_MSG_4 \ "tag %s has no value." # define XMHTML_MSG_5 \ "Failed to allocate colors, falling back to black and white." # define XMHTML_MSG_6 \ "Non default visual detected, using private colormap" # define XMHTML_MSG_7 \ "Oops! no colors available, images will look *really* ugly." # define XMHTML_MSG_8 \ "Representation type resource convertor %s not found/installed.\n Please contact ripley@xs4all.nl." # define XMHTML_MSG_9 \ "The specified value for %s (%i) is too small.\n Reset to %i" # define XMHTML_MSG_10 \ "Internal Error: unknown scrollbar!" # define XMHTML_MSG_11 \ "%s of %s scrollbar (%i) exceeds %s of parent widget (%i).\n Reset to %i." # define XMHTML_MSG_12 \ "%s is a ReadOnly resource, it can not be modified." # define XMHTML_MSG_13 \ "%s: invalid num_params. Must be exactly 1." # define XMHTML_MSG_14 \ "server side imagemaps not supported yet." # define XMHTML_MSG_15 \ "Bad value for XmNmaxImageColors: %i colors selected while display only\n supports %i colors. Reset to %i." # define XMHTML_MSG_16 \ "Invalid value for XmNprogressive%sDelay (%i)\n Reset to %i." # define XMHTML_MSG_17 \ "XmNprogressiveMaximumDelay (%i) less than XmNprogressive%sDelay (%i).\n Set to %i" # define XMHTML_MSG_18 \ "Misaligned anchor stack (id=%i), trying to recover." # define XMHTML_MSG_19 \ "String to Warning conversion may not have any arguments." # define XMHTML_MSG_20 \ "Cannot convert string \"%s\" to XmCWarningMode." # define XMHTML_MSG_21 \ "%s passed to %s." # define XMHTML_MSG_22 \ "Formatted text output: postscript requires a papertype." # define XMHTML_MSG_23 \ "Formatted text output: custom papersize misses a papersize definition." # define XMHTML_MSG_24 \ "Formatted text output: Invalid type selected." # define XMHTML_MSG_25 \ "XmImageDestroy: can't find display on which image was created.\n image %s not destroyed." # define XMHTML_MSG_26 \ "Can't export image type GIF: LZW support not available (and never will \n until Unisys decides to change their stupid licensing policy." # define XMHTML_MSG_27 \ "Can't export image type %s. This image requires support for %s, which\n was disabled when this version of the XmHTML Widget Library was build.\n To enable support for this image type, you will have to recompile\n this library." # define XMHTML_MSG_28 \ "Can't locate named anchor %s.\n" # define XMHTML_MSG_29 \ "Bad color name %s." # define XMHTML_MSG_30 \ "XAllocColor failed for color %s." # define XMHTML_MSG_31 \ "HTML 3.2 color violation: color %s not known, ignoring.\n" # define XMHTML_MSG_32 \ "Bad color entry on line %i of palette." # define XMHTML_MSG_33 \ "Requested XmNmaxImageColors value of %i could not be matched exactly.\n Using %i colors out of %i total." # define XMHTML_MSG_34 \ "%s parent passed to %s." # define XMHTML_MSG_35 \ "Failed to load font %s\n Font probably doesn't exist. Ignored." # define XMHTML_MSG_36 \ "Failed to load default font %s\n Guessing for one." # define XMHTML_MSG_37 \ "Unknown font switch. Using default font." # define XMHTML_MSG_38 \ "Font cache corrupted: could not find an entry for this %s." # define XMHTML_MSG_39 \ "XmHTMLGetFontCacheInfo: can't find info for display %s." # define XMHTML_MSG_40 \ "Empty
    Chapter 3
    XmHTMLParser Objects