home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / lo_ele.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  34.2 KB  |  1,318 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. /******************
  21.  * Structures used by the layout engine which will be passed
  22.  * on to the front end in the front-end to layout interface
  23.  * functions.
  24.  *
  25.  * All the major element structures have an entry
  26.  * called FE_Data.  This is to be used by the front end to
  27.  * store front-end specific data that the layout ill pass
  28.  * back to it later.
  29.  ******************/
  30. #ifndef _LayoutElements_
  31. #define _LayoutElements_
  32.  
  33.  
  34. #include "xp_core.h"
  35. #include "xp_mem.h"
  36. #include "xp_rect.h"
  37. #include "cl_types.h"
  38. #include "ntypes.h"
  39. #include "edttypes.h"
  40. #include "il_types.h"
  41.  
  42. /*
  43.  * Colors - some might say that some of this should be user-customizable.
  44.  */
  45.  
  46. #define LO_DEFAULT_FG_RED         0
  47. #define LO_DEFAULT_FG_GREEN       0
  48. #define LO_DEFAULT_FG_BLUE        0
  49.  
  50. #define LO_DEFAULT_BG_RED         192
  51. #define LO_DEFAULT_BG_GREEN       192
  52. #define LO_DEFAULT_BG_BLUE        192
  53.  
  54. #define LO_UNVISITED_ANCHOR_RED   0
  55. #define LO_UNVISITED_ANCHOR_GREEN 0
  56. #define LO_UNVISITED_ANCHOR_BLUE  238
  57.  
  58. #define LO_VISITED_ANCHOR_RED     85
  59. #define LO_VISITED_ANCHOR_GREEN   26
  60. #define LO_VISITED_ANCHOR_BLUE    139
  61.  
  62. #define LO_SELECTED_ANCHOR_RED    255
  63. #define LO_SELECTED_ANCHOR_GREEN  0
  64. #define LO_SELECTED_ANCHOR_BLUE   0
  65.  
  66. /*
  67.  * Color enumeration for getting/setting defaults
  68.  */
  69. #define LO_COLOR_BG    0
  70. #define LO_COLOR_FG    1
  71. #define LO_COLOR_LINK    2
  72. #define LO_COLOR_VLINK    3
  73. #define LO_COLOR_ALINK    4
  74.  
  75. #define LO_NCOLORS    5
  76.  
  77.  
  78. /*
  79.  * Values for scrolling grid cells to control scrollbars
  80.  * AUTO means only use them if needed.
  81.  */
  82. #define LO_SCROLL_NO    0
  83. #define LO_SCROLL_YES    1
  84. #define LO_SCROLL_AUTO    2
  85. #define LO_SCROLL_NEVER 3
  86.  
  87. /*
  88.  * Relative font sizes that the user can tweak from the FE
  89.  */
  90. #define XP_SMALL  1
  91. #define XP_MEDIUM 2
  92. #define XP_LARGE  3
  93.  
  94. /* --------------------------------------------------------------------------
  95.  * Layout bit flags for text and bullet types
  96.  */
  97. #define LO_UNKNOWN      -1
  98. #define LO_NONE         0
  99. #define LO_TEXT         1
  100. #define LO_LINEFEED     2
  101. #define LO_HRULE        3
  102. #define LO_IMAGE        4
  103. #define LO_BULLET       5
  104. #define LO_FORM_ELE     6
  105. #define LO_SUBDOC       7
  106. #define LO_TABLE        8
  107. #define LO_CELL         9
  108. #define LO_EMBED        10
  109. #define LO_EDGE         11
  110. #define LO_JAVA         12
  111. #define LO_SCRIPT       13
  112. #define LO_OBJECT       14
  113. #define LO_PARAGRAPH    15
  114. #define LO_CENTER        16
  115. #define LO_MULTICOLUMN    17
  116. #define LO_FLOAT        18    
  117. #define LO_TEXTBLOCK    19
  118. #define LO_LIST            20
  119. #define LO_DESCTITLE    21
  120. #define LO_DESCTEXT        22
  121. #define LO_BLOCKQUOTE    23
  122. #define LO_LAYER        24
  123. #define LO_HEADING        25
  124. #define LO_SPAN            26
  125. #define LO_DIV            27
  126. #define LO_SPACER        28
  127.  
  128. #define LO_FONT_NORMAL      0x0000
  129. #define LO_FONT_BOLD        0x0001
  130. #define LO_FONT_ITALIC      0x0002
  131. #define LO_FONT_FIXED       0x0004
  132.  
  133. #define LO_ATTR_ANCHOR      0x0008
  134. #define LO_ATTR_UNDERLINE   0x0010
  135. #define LO_ATTR_STRIKEOUT   0x0020
  136. #define LO_ATTR_BLINK        0x0040
  137. #define LO_ATTR_ISMAP        0x0080
  138. #define LO_ATTR_ISFORM        0x0100
  139. #define LO_ATTR_DISPLAYED   0x0200
  140. #define LO_ATTR_BACKDROP    0x0400
  141. #define LO_ATTR_STICKY      0x0800
  142. #define LO_ATTR_INTERNAL_IMAGE  0x1000
  143. #define LO_ATTR_MOCHA_IMAGE 0x2000 /* Image loaded at behest of JavaScript */
  144. #define LO_ATTR_ON_IMAGE_LIST   0x4000 /* Image on top_state->image_list */
  145. #define LO_ATTR_CELL_BACKDROP   0x8000
  146. #define LO_ATTR_SPELL       0x00010000
  147. #define LO_ATTR_INLINEINPUT     0x00020000
  148. #define LO_ATTR_INLINEINPUTTHICK     0x00040000
  149. #define LO_ATTR_INLINEINPUTDOTTED    0x00080000
  150. #define    LO_ATTR_LAYER_BACKDROP       0x00100000
  151.  
  152. /*
  153.  * Different bullet types.   The front end should only ever see
  154.  *  bullets of type BULLET_ROUND and BULLET_SQUARE
  155.  */
  156. #define BULLET_NONE             0
  157. #define BULLET_BASIC            1
  158. #define BULLET_NUM              2
  159. #define BULLET_NUM_L_ROMAN      3
  160. #define BULLET_NUM_S_ROMAN      4
  161. #define BULLET_ALPHA_L          5
  162. #define BULLET_ALPHA_S          6
  163. #define BULLET_ROUND            7
  164. #define BULLET_SQUARE           8
  165. #define BULLET_MQUOTE           9
  166. /* A bullet type of WORDBREAK in a LO_TEXT element tells the relayout code to
  167.    skip that text element. */
  168. #define WORDBREAK               10
  169.  
  170. /*
  171.  * Different border types.
  172.  */
  173. #define    BORDER_NONE                0
  174. #define    BORDER_DOTTED            1
  175. #define    BORDER_DASHED            2
  176. #define    BORDER_SOLID            3
  177. #define    BORDER_DOUBLE            4
  178. #define    BORDER_GROOVE            5
  179. #define    BORDER_RIDGE            6
  180. #define    BORDER_INSET            7
  181. #define    BORDER_OUTSET            8
  182.  
  183. /* Values for flag in LO_AnchorData */
  184. #define ANCHOR_SUPPRESS_FEEDBACK        1
  185.  
  186. /*
  187.  * Generic union of all the possible element structure types.
  188.  * Defined at end of file.
  189.  */
  190. union LO_Element_struct;
  191.  
  192. /*
  193.  * Anchors can be targeted to named windows now, so anchor data is
  194.  * more than just a URL, it is a URL, and a possible target window
  195.  * name.
  196.  */
  197. struct LO_AnchorData_struct {
  198.         PA_Block anchor;        /* really a (char *) */
  199.         PA_Block target;        /* really a (char *) */
  200.         PA_Block alt;           /* really a (char *) */
  201. #ifdef MOCHA
  202.         LO_Element *element;    /* Needed for mocha reflection
  203.                    of layout position. */
  204.         CL_Layer *layer;    /* Layer containing anchor */
  205.     struct JSObject *mocha_object;
  206.     XP_Bool event_handler_present; /*Indicates whether there's a JS handler */
  207. #endif
  208.         uint8 flags;            /* Indicates whether to suppress visual feedback */
  209.         double prevalue;    /* <A HREF="http://gagan/PrefetchingThoughts.html" PRE=0.5> */
  210. };
  211.  
  212. /*
  213.  * Basic RGB triplet
  214.  */
  215. struct LO_Color_struct {
  216.         uint8 red, green, blue;
  217. };
  218.  
  219. /* 
  220.  * Contains initialization parameters for new layers. Exported here
  221.  * so that mocha can set these on resize.
  222.  */
  223. /* Possible values for clip_policy */
  224. #define LO_AUTO_EXPAND_NONE          0x00
  225. #define LO_AUTO_EXPAND_CLIP_BOTTOM   0x01
  226. #define LO_AUTO_EXPAND_CLIP_RIGHT    0x02
  227. #define LO_AUTO_EXPAND_CLIP_TOP      0x04
  228. #define LO_AUTO_EXPAND_CLIP_LEFT     0x08
  229. #define LO_AUTO_EXPAND_CLIP (LO_AUTO_EXPAND_CLIP_LEFT |    \
  230.                              LO_AUTO_EXPAND_CLIP_RIGHT |   \
  231.                              LO_AUTO_EXPAND_CLIP_TOP  |    \
  232.                              LO_AUTO_EXPAND_CLIP_BOTTOM)
  233.  
  234. typedef struct LO_BlockInitializeStruct_struct {
  235.     XP_Bool has_left;
  236.     int32 left;
  237.     XP_Bool has_top;
  238.     int32 top;
  239.     XP_Bool has_width;
  240.     int32 width;
  241.     XP_Bool has_height;
  242.     int32 height;
  243.     char *name;
  244.     char *id;
  245.     char *above;
  246.     char *below;
  247.     XP_Bool has_zindex;
  248.     int32 zindex;
  249.     char *visibility;
  250.     char *bgcolor;
  251.     XP_Bool is_style_bgcolor;
  252.     char *bgimage;
  253.     char *src;
  254.     XP_Rect *clip;
  255.     int clip_expansion_policy;
  256.     char *overflow;
  257.     PA_Tag *tag;
  258.     PA_Tag *ss_tag;
  259. } LO_BlockInitializeStruct;
  260.  
  261. /*
  262.  * Attributes of the text we are currently drawing in.
  263.  *
  264.  * if font weight is specified then the "bold" fontmask attribute
  265.  * should be ignored
  266.  *
  267.  * if font face is specified then the "fixed" fontmask attribute 
  268.  * should be ignored
  269.  */
  270. struct LO_TextAttr_struct {
  271.         int16 size;
  272.         int32 fontmask;   /* bold, italic, fixed */                                     
  273.         LO_Color fg, bg;
  274.         Bool no_background; /* unused, text on image? */
  275.         int32 attrmask;   /* anchor, underline, strikeout, blink(gag) */
  276.         char *font_face;
  277.         double point_size;   /* 1.0pt through 72.0pt and above */
  278.         uint16 font_weight;  /* 100, 200, ... 900 */
  279.         void *FE_Data;     /* For the front end to store font IDs */
  280.         struct LO_TextAttr_struct *next; /* to chain in hash table */
  281.         int16 charset;
  282. };
  283.  
  284. /*
  285.  * Information about the current text segment as rendered
  286.  * by the front end that the layout engine can use to place
  287.  * the text segment.
  288.  */
  289. struct LO_TextInfo_struct {
  290.         intn max_width;
  291.         int16 ascent, descent;
  292.         int16 lbearing, rbearing;
  293. };
  294.  
  295.  
  296. /*
  297.  * Bit flags for the ele_attrmask.
  298.  */
  299. #define    LO_ELE_BREAKABLE      0x0001
  300. #define    LO_ELE_SECURE          0x0002
  301. #define    LO_ELE_SELECTED          0x0004
  302. #define    LO_ELE_BREAKING          0x0008
  303. #define    LO_ELE_FLOATING          0x0010
  304. #define    LO_ELE_SHADED          0x0020
  305. #define    LO_ELE_DELAY_CENTER      0x0040
  306. #define    LO_ELE_DELAY_RIGHT      0x0080
  307. #define    LO_ELE_DELAY_JUSTIFY  0x00c0
  308. #define    LO_ELE_DELAY_ALIGNED  0x00c0
  309. #define LO_ELE_INVISIBLE      0x0100 /* Invisible form, applet or embed; Not from tag attributes */
  310. #define LO_ELE_HIDDEN         0x0200 /* Element occupies no screen real-estate */
  311. #define LO_ELE_DRAWN          0x0400 /* Indicates that the element has been drawn at least once before */
  312. #define LO_ELE_STREAM_STARTED 0x0800
  313. /* Special selection signal for Composer
  314.  * Used for visual feedback during dragNdrop of table cells
  315.  * (used for cells that will replaced)
  316.  * and also for the non-focus cells when > 1 cells are selected
  317.  *   and the cell properties are being edited
  318. */
  319. #define    LO_ELE_SELECTED_SPECIAL 0x1000
  320. #ifdef DOM
  321. #define    LO_ELE_IN_SPAN            0x2000
  322. #endif /* DOM */
  323.  
  324. /*
  325.  * This structure heads up a group of text elements. It contains the actual text buffer
  326.  * and all the word breaking information.
  327.  */
  328. typedef struct LO_TextBlock_struct {
  329.         /* the base layout struct */
  330.         int16 type;
  331.         int16 x_offset;
  332.         int32 ele_id;
  333.         int32 x, y;
  334.         int32 y_offset;
  335.         int32 width, height;
  336.         int32 line_height;
  337.         LO_Element *next;
  338.         LO_Element *prev;
  339.         ED_Element *edit_element;
  340.         int32 edit_offset;
  341.  
  342.         /* textblock specific */
  343.         LO_TextAttr *    text_attr;
  344.         LO_AnchorData *    anchor_href;
  345.         uint16            ele_attrmask; /* breakable, secure, selected, etc. */
  346.         uint16            format_mode;
  347.         
  348.         LO_TextStruct *    startTextElement;
  349.         LO_TextStruct *    endTextElement;
  350.         
  351.         uint8 *            text_buffer;
  352.         uint32            buffer_length;
  353.         uint32            buffer_write_index;
  354.         uint32            last_buffer_write_index;
  355.         uint32            buffer_read_index;
  356.         uint32            last_line_break;
  357.         
  358.         uint32 *         break_table;
  359.         uint32            break_length;
  360.         uint32            break_write_index;
  361.         uint32            break_read_index;
  362.         uint32            last_break_offset;
  363.         uint32            multibyte_index;
  364.         uint32            multibyte_length;
  365.  
  366.         LO_TextStruct *    old_break;
  367.         uint32            old_break_pos;
  368.         uint32            old_break_width;
  369.         
  370.         uint32            totalWidth;
  371.         uint32            totalChars;
  372.         uint8            break_pending;
  373.         uint8            last_char_is_whitespace;
  374.  
  375.         int16            ascent;                /* font information for relayout */
  376.         int16            descent;
  377. } LO_TextBlock;
  378.  
  379.  
  380. /*
  381.  * This is the structure that the layout module will
  382.  * pass to the front-end and ask the front end to render
  383.  * this text segment in the x,y location specified.
  384.  * The selected flag in combination with the text_attr
  385.  * structure will tell the front-end how to render the text.
  386.  */
  387. struct LO_TextStruct_struct {
  388.         int16 type;
  389.         int16 x_offset;
  390.         int32 ele_id;
  391.         int32 x, y;
  392.         int32 y_offset;
  393.         int32 width, height;
  394.         int32 line_height;
  395.         LO_Element *next;
  396.         LO_Element *prev;
  397.         ED_Element *edit_element;
  398.         int32 edit_offset;
  399.  
  400.         void *FE_Data;
  401. #if defined(XP_WIN)
  402.         union {
  403.             PA_Block text;        /* lock to a (char *) */
  404.             char *pText;
  405.         };
  406. #else
  407.         PA_Block text;        /* lock to a (char *) */
  408. #endif
  409.         uint16 block_offset;    /* offset to this line in the parent text block */
  410.         uint16 doc_width;        /* doc width that this line was layed out into */
  411.         LO_AnchorData *anchor_href;
  412.         LO_TextAttr *text_attr;
  413.         uint16 ele_attrmask; /* breakable, secure, selected, etc. */
  414.         int16 text_len;
  415.         int16 sel_start;
  416.         int16 sel_end;
  417.         intn bullet_type;        /* set to MQUOTE in lo_make_quote_text, and other things in lo_PlaceBulletStr. */
  418. };
  419.  
  420.  
  421.  
  422. /*****************
  423.  * Similar to the structures above, these are the structures
  424.  * used to manage image elements between the layout and the 
  425.  * front-end.
  426.  ****************/
  427.  
  428. /*
  429.  * Current status of a displayed image.
  430.  * ImageData (above) can be reused for a single
  431.  * image displayed multiple times, but ImageAttr is
  432.  * unique to a particular instance of a displayed image.
  433.  */
  434. struct LO_ImageAttr_struct {
  435.         int32 attrmask;   /* anchor, delayed, ismap */
  436.         intn alignment;
  437.         int32 layer_id;
  438.         intn form_id;
  439.         char *usemap_name;    /* Use named client-side map if here */
  440.         void *usemap_ptr;    /* private, used by layout only! */
  441.         intn submit_x;        /* for form, last click coord */
  442.         intn submit_y;        /* for form, last click coord */
  443. };
  444.  
  445.  
  446. /* Suppression of feedback such as the drawing of the delayed icon, temporary
  447.    border and alt text when an image is coming in, and the drawing of keyboard
  448.    navigation feedback. */
  449. typedef enum {
  450.     LO_SUPPRESS_UNDEFINED,
  451.     LO_SUPPRESS,
  452.     LO_DONT_SUPPRESS
  453. } lo_SuppressMode;
  454.  
  455. /*
  456.  * This is the structure that the layout module will
  457.  * pass to the front-end and ask the front end to render
  458.  * this image at the x,y location specified.
  459.  * The selected flag in combination with the image_attr
  460.  * structure will tell the front-end how to render the image.
  461.  * alt is alternate text to display if the image is not to
  462.  * be displayed.
  463.  */
  464. struct LO_ImageStruct_struct {
  465.         int16 type;
  466.         int16 x_offset;
  467.         int32 ele_id;
  468.         int32 x, y;
  469.         int32 y_offset;
  470.         int32 width, height;
  471.         int32 line_height;
  472.         LO_Element *next;
  473.         LO_Element *prev;
  474.         ED_Element *edit_element;
  475.         int32 edit_offset;
  476.  
  477.         int32 layer_id;
  478.  
  479.         int32 percent_width;    /* For relayout */
  480.         int32 percent_height;    /* For relayout */
  481.     
  482. #ifdef MOCHA
  483.         struct JSObject *mocha_object;
  484. #endif
  485.         CL_Layer *layer;
  486.         XP_Rect valid_rect;
  487.         IL_ImageReq *image_req; /* Image library representation. */
  488.         IL_ImageReq *lowres_image_req; /* Handle on lowres image while
  489.                                           highres image is coming in. */
  490.         uint8 is_icon;          /* Is this an image or an icon? */
  491.         uint16 icon_number;     /* If this is an icon, the icon number. */
  492.         PA_Block alt;
  493.         LO_AnchorData *anchor_href;
  494.         PA_Block image_url;
  495.         PA_Block lowres_image_url;
  496.         LO_ImageAttr *image_attr;
  497.         LO_TextAttr *text_attr;
  498.         int32 border_width;
  499.         int32 border_vert_space;
  500.         int32 border_horiz_space;
  501.         uint16 ele_attrmask; /* floating, secure, selected, etc. */
  502.         uint16 image_status;
  503.         uint8 is_transparent;
  504.         lo_SuppressMode suppress_mode; /* For temp icon, temp border, etc. */
  505.         int16 alt_len;
  506.         int16 sel_start;
  507.         int16 sel_end;
  508.         intn seq_num;
  509.         PRPackedBool pending_mocha_event;
  510.         LO_ImageStruct *next_image; /* next image in list for this document */
  511. };
  512.  
  513. /* Tiling mode for implementing CSS's background-repeat property */
  514. typedef enum {
  515.         /* The code depends on specific values for this enum - don't change them. */
  516.         LO_TILE_BOTH  = 0,          /* Tile in both X and Y direction */
  517.         LO_TILE_HORIZ = 1,          /* Tile horizontally only */
  518.         LO_TILE_VERT  = 2,          /* Tile vertically only */
  519.         LO_NO_TILE    = 3           /* Don't tile */
  520. } lo_TileMode;
  521.  
  522. /* An (optionally) tiled backdrop image, optionally on top of a solid color */
  523. typedef struct {
  524.         LO_Color *bg_color;         /* Solid color, or NULL, if transparent */
  525.         char *url;                  /* String URL or NULL, if no backdrop image */
  526.         lo_TileMode tile_mode;      /* CSS tiling mode for backdrop image */
  527. } lo_Backdrop;
  528.  
  529. struct LO_SubDocStruct_struct {
  530.         int16 type;
  531.         int16 x_offset;
  532.         int32 ele_id;
  533.         int32 x, y;
  534.         int32 y_offset;
  535.         int32 width, height;
  536.         int32 line_height;
  537.         LO_Element *next;
  538.         LO_Element *prev;
  539.         ED_Element *edit_element;
  540.         int32 edit_offset;
  541.  
  542.         void *FE_Data;
  543.         void *state;    /* Hack-o-rama to opaque the lo_DocState type */
  544.         lo_Backdrop backdrop; /* To carry over into CellStruct */
  545.         LO_AnchorData *anchor_href;
  546.         LO_TextAttr *text_attr;
  547.         int32 alignment;
  548.         int32 vert_alignment;
  549.         int32 horiz_alignment;
  550.         int32 border_width;
  551.         int32 border_vert_space;
  552.         int32 border_horiz_space;
  553.         uint16 ele_attrmask; /* floating, secure, selected, etc. */
  554.         int16 sel_start;
  555.         int16 sel_end;
  556. };
  557.  
  558.  
  559. /*
  560.  * This is the structure that the layout module will
  561.  * pass to the front-end and ask the front end to render
  562.  * this form element at the x,y location specified.
  563.  * The widget_data field holds state data for this form
  564.  * element, such as the current text in a text entry area.
  565.  */
  566. #define FORM_TYPE_NONE          0
  567. #define FORM_TYPE_TEXT          1
  568. #define FORM_TYPE_RADIO         2
  569. #define FORM_TYPE_CHECKBOX      3
  570. #define FORM_TYPE_HIDDEN        4
  571. #define FORM_TYPE_SUBMIT        5
  572. #define FORM_TYPE_RESET         6
  573. #define FORM_TYPE_PASSWORD      7
  574. #define FORM_TYPE_BUTTON        8
  575. #define FORM_TYPE_JOT           9
  576. #define FORM_TYPE_SELECT_ONE    10
  577. #define FORM_TYPE_SELECT_MULT   11
  578. #define FORM_TYPE_TEXTAREA      12
  579. #define FORM_TYPE_ISINDEX       13
  580. #define FORM_TYPE_IMAGE         14
  581. #define FORM_TYPE_FILE          15
  582. #define FORM_TYPE_KEYGEN        16
  583. #define FORM_TYPE_READONLY      17
  584. #define FORM_TYPE_OBJECT        18
  585.  
  586. #define FORM_METHOD_GET        0
  587. #define FORM_METHOD_POST    1
  588.  
  589. #define TEXTAREA_WRAP_OFF    0
  590. #define TEXTAREA_WRAP_SOFT    1
  591. #define TEXTAREA_WRAP_HARD    2
  592.  
  593. #define INPUT_TYPE_ENCODING_NORMAL 0
  594. #define INPUT_TYPE_ENCODING_MACBIN 1
  595.  
  596.  
  597.  
  598. /*
  599.  * Union of all different form element data structures
  600.  */
  601. union LO_FormElementData_struct;
  602.  
  603. /*
  604.  * This is the element_data structure for elements whose
  605.  * element_type = FORM_TYPE_SELECT_ONE, FORM_TYPE_SELECT_MULT.
  606.  */
  607.  
  608. /*
  609.  * nesting deeper and deeper, harder and harder, go, go, oh, OH, OHHHHH!!
  610.  * Sorry, got carried away there.
  611.  */
  612. struct lo_FormElementOptionData_struct {
  613.     PA_Block text_value;
  614.         PA_Block value;
  615.         Bool def_selected;
  616.         Bool selected;
  617. };
  618.  
  619.  
  620. struct lo_FormElementSelectData_struct {
  621.     int32 type;
  622.     void *FE_Data;
  623.     PA_Block name;
  624.     int32 size;
  625.     Bool disabled;
  626.         Bool multiple;
  627.         Bool options_valid;
  628.     int32 option_cnt;
  629.     PA_Block options;    /* really a (lo_FormElementOptionData *) */
  630.     PA_Tag *saved_tag;    /* mocha weazels need for threading */
  631. };
  632.  
  633. /*
  634.  * This is the element_data structure for elements whose
  635.  * element_type = FORM_TYPE_TEXT, FORM_TYPE_PASSWORD, FORM_TYPE_FILE.
  636.  */
  637. struct lo_FormElementTextData_struct {
  638.     int32 type;
  639.     void *FE_Data;
  640.     PA_Block name;
  641.     PA_Block default_text;
  642.     Bool disabled;
  643.     Bool readonly;
  644.     PA_Block current_text;
  645.     int32 size;
  646.     int32 max_size;
  647.     int32 encoding;
  648. };
  649.  
  650.  
  651. /*
  652.  * This is the element_data structure for elements whose
  653.  * element_type = FORM_TYPE_TEXTAREA.
  654.  */
  655. struct lo_FormElementTextareaData_struct {
  656.     int32 type;
  657.     void *FE_Data;
  658.     PA_Block name;
  659.     PA_Block default_text;
  660.     Bool disabled;
  661.     Bool readonly;
  662.     PA_Block current_text;
  663.     int32 rows;
  664.     int32 cols;
  665.     uint8 auto_wrap;
  666.     PA_Tag *saved_tag;    /* mocha weazels need for threading */
  667. };
  668.  
  669.  
  670. /*
  671.  * This is the element_data structure for elements whose
  672.  * element_type = FORM_TYPE_HIDDEN, FORM_TYPE_SUBMIT, FORM_TYPE_RESET,
  673.  *           FORM_TYPE_BUTTON, FORM_TYPE_READONLY.
  674.  */
  675. struct lo_FormElementMinimalData_struct {
  676.     int32 type;
  677.     void *FE_Data;
  678.     PA_Block name;
  679.     PA_Block value;
  680.     Bool disabled;
  681. };
  682.  
  683.  
  684. /*
  685.  * This is the element_data structure for elements whose
  686.  * element_type = FORM_TYPE_RADIO, FORM_TYPE_CHECKBOX.
  687.  */
  688. struct lo_FormElementToggleData_struct {
  689.     int32 type;
  690.     void *FE_Data;
  691.     PA_Block name;
  692.     PA_Block value;
  693.     Bool disabled;
  694.     Bool default_toggle;
  695.     Bool toggled;
  696. };
  697.  
  698.  
  699. /*
  700.  * This is the element_data structure for elements whose
  701.  * element_type = FORM_TYPE_OBJECT.
  702.  */
  703. struct lo_FormElementObjectData_struct {
  704.     int32 type;
  705.     void *FE_Data;
  706.     PA_Block name;
  707.     LO_JavaAppStruct *object;
  708. };
  709.  
  710.  
  711. /*
  712.  * This is the element_data structure for elements whose
  713.  * element_type = FORM_TYPE_KEYGEN.
  714.  */
  715. struct lo_FormElementKeygenData_struct {
  716.     int32 type;
  717.     PA_Block name;
  718.     PA_Block challenge;
  719.     PA_Block key_type;
  720.     PA_Block pqg; /* DSA only */
  721.     char *value_str;
  722.     PRBool dialog_done;
  723. };
  724.  
  725.  
  726. union LO_FormElementData_struct {
  727.     int32 type;
  728.     lo_FormElementTextData ele_text;
  729.     lo_FormElementTextareaData ele_textarea;
  730.     lo_FormElementMinimalData ele_minimal;
  731.     lo_FormElementToggleData ele_toggle;
  732.     lo_FormElementObjectData ele_object;
  733.     lo_FormElementSelectData ele_select;
  734.     lo_FormElementKeygenData ele_keygen;
  735. };
  736.  
  737.  
  738. struct LO_FormSubmitData_struct {
  739.     PA_Block action;
  740.     PA_Block encoding;
  741.     PA_Block window_target;
  742.     int32 method;
  743.     int32 value_cnt;
  744.     PA_Block name_array;
  745.     PA_Block value_array;
  746.     PA_Block type_array;
  747.     PA_Block encoding_array;
  748. };
  749.  
  750.  
  751. struct LO_FormElementStruct_struct {
  752.         int16 type;
  753.         int16 x_offset;
  754.         int32 ele_id;
  755.         int32 x, y;
  756.         int32 y_offset;
  757.         int32 width, height;
  758.         int32 line_height;
  759.         LO_Element *next;
  760.         LO_Element *prev;
  761.         ED_Element *edit_element;
  762.         int32 edit_offset;
  763.  
  764.         int32 layer_id;
  765. #ifdef MOCHA
  766.         struct JSObject *mocha_object;
  767.         XP_Bool event_handler_present; /*Indicates whether there's a JS handler */
  768. #endif
  769.  
  770.         int16 border_vert_space;
  771.         int16 border_horiz_space;
  772.         int32 element_index;
  773.         LO_FormElementData *element_data;
  774.         LO_TextAttr *text_attr;
  775.         int32 baseline;
  776.         uint16 ele_attrmask; /* secure, selected, etc. */
  777.         int16 form_id;
  778.         int16 sel_start;
  779.         int16 sel_end;
  780.                 CL_Layer *layer;
  781. };
  782.  
  783.  
  784. /*
  785.  * This is the structure that the layout module will
  786.  * pass to the front-end and ask the front end to render
  787.  * a linefeed at the x,y location specified.
  788.  * Linefeeds are rendered as just a filled rectangle.
  789.  * Height should be the height of the tallest element
  790.  * on the line.
  791.  */
  792.  
  793. #define LO_LINEFEED_BREAK_SOFT 0
  794. #define LO_LINEFEED_BREAK_HARD 1
  795. #define LO_LINEFEED_BREAK_PARAGRAPH 2
  796.  
  797. #define LO_CLEAR_NONE 0
  798. #define LO_CLEAR_TO_LEFT 1
  799. #define LO_CLEAR_TO_RIGHT 2
  800. #define LO_CLEAR_TO_ALL 3
  801. #define LO_CLEAR_TO_BOTH 4
  802.  
  803. struct LO_LinefeedStruct_struct {
  804.         int16 type;
  805.         int16 x_offset;
  806.         int32 ele_id;
  807.         int32 x, y;
  808.         int32 y_offset;
  809.         int32 width, height;
  810.         int32 line_height;
  811.         LO_Element *next;
  812.         LO_Element *prev;
  813.         ED_Element *edit_element;
  814.         int32 edit_offset;
  815.  
  816.         void *FE_Data;
  817.         LO_AnchorData *anchor_href;
  818.         LO_TextAttr *text_attr;
  819.         int32 baseline;
  820.         uint16 ele_attrmask; /* breaking, secure, selected, etc. */
  821.         int16 sel_start;
  822.         int16 sel_end;
  823.         uint8 break_type;        /* is this an end-of-paragraph or a break? */
  824.         uint8 clear_type;        /* the clear="" attribute */
  825. };
  826.  
  827.  
  828. struct LO_HorizRuleStruct_struct {
  829.         int16 type;
  830.         int16 x_offset;
  831.         int32 ele_id;
  832.         int32 x, y;
  833.         int32 y_offset;
  834.         int32 width, height;
  835.         int32 line_height;
  836.         LO_Element *next;
  837.         LO_Element *prev;
  838.         ED_Element *edit_element;
  839.         int32 edit_offset;
  840.  
  841.         int32 end_x, end_y;
  842.         void *FE_Data;
  843.         uint16 ele_attrmask; /* shaded, secure, selected, etc. */
  844.         int16 alignment;
  845.         int16 thickness; /* 1 - 100 */
  846.         int16 sel_start;
  847.         int16 sel_end;
  848.  
  849.         int32 percent_width; /* needed for relayout. */
  850.         int32 width_in_initial_layout;  /* needed for relayout. */
  851. };
  852.  
  853. struct LO_BulletStruct_struct {
  854.         int16 type;
  855.         int16 x_offset;
  856.         int32 ele_id;
  857.         int32 x, y;
  858.         int32 y_offset;
  859.         int32 width, height;
  860.         int32 line_height;
  861.         LO_Element *next;
  862.         LO_Element *prev;
  863.         ED_Element *edit_element;
  864.         int32 edit_offset;
  865.  
  866.         void *FE_Data;
  867.         int32 bullet_type;
  868.         int32 bullet_size;
  869.         LO_TextAttr *text_attr;
  870.         uint16 ele_attrmask; /* secure, selected, etc. */
  871.         int16 level;
  872.         int16 sel_start;
  873.         int16 sel_end;
  874. };
  875.  
  876.  
  877. struct LO_TableStruct_struct {
  878.         int16 type;
  879.         int16 x_offset;
  880.         int32 ele_id;
  881.         int32 x, y;
  882.         int32 y_offset;
  883.         int32 width, height;
  884.         int32 line_height;
  885.         LO_Element *next;
  886.         LO_Element *prev;
  887.         ED_Element *edit_element;
  888.         int32 edit_offset;
  889.  
  890.         void *FE_Data;
  891.         LO_AnchorData *anchor_href;
  892.         int32 expected_y;
  893.         int32 alignment;
  894.         LO_Color border_color;
  895.         int32 border_style;
  896.         int32 border_width;
  897.         int32 border_top_width;
  898.         int32 border_right_width;
  899.         int32 border_bottom_width;
  900.         int32 border_left_width;
  901.         int32 border_vert_space;
  902.         int32 border_horiz_space;
  903.         uint16 ele_attrmask; /* floating, secure, selected, etc. */
  904.         int16 sel_start;
  905.         int16 sel_end;
  906.         int32 inter_cell_space;  /*cmanske: CELLSPACING value - used when drawing table selection feedback */
  907.         void *table;        /* Actually a lo_TableRec *.  Added for relayout */
  908. };
  909.  
  910. struct LO_CellStruct_struct {
  911.         int16 type;
  912.         int16 x_offset;
  913.         int32 ele_id;
  914.         int32 x, y;
  915.         int32 y_offset;
  916.         int32 width, height;
  917.         int32 line_height;
  918.         LO_Element *next;
  919.         LO_Element *prev;
  920.         ED_Element *edit_element;
  921.         int32 edit_offset;
  922.  
  923.         void *FE_Data;
  924.         LO_Element *cell_list;
  925.         LO_Element *cell_list_end;
  926.         LO_Element *cell_float_list;
  927.         lo_Backdrop backdrop;
  928.         int32 border_width;
  929.         int32 border_vert_space;
  930.         int32 border_horiz_space;
  931.         uint16 ele_attrmask; /* secure, selected, etc. */
  932.         int16 sel_start;
  933.         int16 sel_end;
  934.         int32 inter_cell_space;  /*cmanske: CELLSPACING value - used when drawing cell selection feedback */        
  935.         CL_Layer *cell_inflow_layer; /* Non-NULL if this cell
  936.                                                 exists to encapsulate
  937.                                                 an in-flow layer (ILAYER) */
  938.         CL_Layer *cell_bg_layer; /* BGCOLOR/BACKGROUND for cell */
  939.         void *table_cell;    /* An lo_TableCell *.  For use during relayout without reload. */
  940.         void *table_row;    /* An lo_TableRow *.  Parent row state struct */
  941.         void *table;        /* An lo_TableRec *. Parent table state struct */
  942.         Bool isCaption;        /* Needed for relayout without reload */
  943. };
  944.  
  945.  
  946. struct LO_EmbedStruct_struct {
  947.         int16 type;
  948.         int16 x_offset;
  949.         int32 ele_id;
  950.         int32 x, y;
  951.         int32 y_offset;
  952.         int32 width, height;
  953.         int32 line_height;
  954.         LO_Element *next;
  955.         LO_Element *prev;
  956.         ED_Element *edit_element;
  957.         int32 edit_offset;
  958.  
  959.         void * FE_Data;
  960.         void *session_data;
  961.         PA_Block embed_src;
  962.         int32 attribute_cnt;
  963.         char **attribute_list;
  964.         char **value_list;
  965.         int32 alignment;
  966.         int32 border_width;
  967.         int32 border_vert_space;
  968.         int32 border_horiz_space;
  969.         uint16 ele_attrmask; /* floating, secure, selected, etc. */
  970.         int32 embed_index;    /* Unique ID within this doc */
  971.         struct LO_EmbedStruct_struct *nextEmbed;
  972. #ifdef MOCHA
  973.         struct JSObject *mocha_object;
  974. #endif
  975.         PA_Tag *tag;
  976.         CL_Layer *layer;
  977.  
  978.         int32 percent_width; /* needed for relayout. */
  979.         int32 percent_height; /* needed for relayout. */
  980. };
  981.  
  982. #define LO_JAVA_SELECTOR_APPLET             0
  983. #define LO_JAVA_SELECTOR_OBJECT_JAVA        1
  984. #define LO_JAVA_SELECTOR_OBJECT_JAVAPROGRAM 2
  985. #define LO_JAVA_SELECTOR_OBJECT_JAVABEAN    3
  986.  
  987. struct LO_JavaAppStruct_struct {
  988.         int16 type;
  989.         int16 x_offset;
  990.         int32 ele_id;
  991.         int32 x, y;
  992.         int32 y_offset;
  993.         int32 width, height;
  994.         int32 line_height;
  995.         LO_Element *next;
  996.         LO_Element *prev;
  997.         ED_Element *edit_element;
  998.         int32 edit_offset;
  999.  
  1000.         void * FE_Data;
  1001.         void *session_data;
  1002.         PA_Block base_url;
  1003.         PA_Block attr_code;
  1004.         PA_Block attr_codebase;
  1005.         PA_Block attr_archive;
  1006.         PA_Block attr_name;
  1007.         int32 param_cnt;
  1008.         char **param_names;
  1009.         char **param_values;
  1010.         int32 alignment;
  1011.         int32 border_width;
  1012.         int32 border_vert_space;
  1013.         int32 border_horiz_space;
  1014.         uint16 ele_attrmask; /* floating, secure, selected, etc. */
  1015.         int32 embed_index;    /* Unique ID within this doc */
  1016.         Bool may_script;
  1017.         /* linked list thread for applets in the current document.
  1018.          * should be "prev" since they're in reverse order but who's
  1019.          * counting? */
  1020.         struct LO_JavaAppStruct_struct *nextApplet;
  1021. #ifdef MOCHA
  1022.         struct JSObject *mocha_object;
  1023. #endif
  1024.         PA_Tag *tag;
  1025.         CL_Layer *layer;
  1026.         /* selector_type indicates whether the tag was an
  1027.          * APPLET tag or OBJECT tag, and if it was an OBJECT tag,
  1028.          * whether the protocol selector in CLASSID was "java:",
  1029.          * "javaprogram:", or "javabean:".
  1030.          */
  1031.         int32 selector_type;
  1032.  
  1033.         int32 percent_width;    /* For relayout */
  1034.         int32 percent_height;    /* For relayout */
  1035. };
  1036.  
  1037.  
  1038. struct LO_EdgeStruct_struct {
  1039.         int16 type;
  1040.         int16 x_offset;
  1041.         int32 ele_id;
  1042.         int32 x, y;
  1043.         int32 y_offset;
  1044.         int32 width, height;
  1045.         int32 line_height;
  1046.         LO_Element *next;
  1047.         LO_Element *prev;
  1048.  
  1049.         void * FE_Data;
  1050.         void *lo_edge_info;
  1051.         LO_Color *bg_color;
  1052.         int16 size;
  1053.         Bool visible;
  1054.         Bool movable;
  1055.         Bool is_vertical;
  1056.         int32 left_top_bound;
  1057.         int32 right_bottom_bound;
  1058. };
  1059.  
  1060. struct LO_Any_struct {
  1061.         int16 type;
  1062.         int16 x_offset;
  1063.         int32 ele_id;
  1064.         int32 x, y;
  1065.         int32 y_offset;
  1066.         int32 width, height;
  1067.         int32 line_height;
  1068.         LO_Element *next;
  1069.         LO_Element *prev;
  1070.         ED_Element *edit_element;
  1071.         int32 edit_offset;
  1072. };
  1073.  
  1074. /* some DocState mutating elements.  */
  1075. typedef struct LO_CenterStruct_struct {
  1076.   LO_Any lo_any;
  1077.  
  1078.   /* nothing really to center elements */
  1079.   Bool is_end;
  1080. } LO_CenterStruct;
  1081.  
  1082. typedef struct LO_MulticolumnStruct_struct {
  1083.   LO_Any lo_any;
  1084.  
  1085.   Bool is_end;
  1086.   PA_Tag *tag;
  1087.   void *multicol;   /* Pointer to lo_MultiCol struct */
  1088. } LO_MulticolumnStruct;
  1089.  
  1090. typedef struct LO_SpacerStruct_struct {
  1091.     LO_Any lo_any;
  1092.     
  1093.     int32 size;
  1094.     int8 type;
  1095.     int32 alignment;
  1096.     Bool floating;
  1097.     Bool is_percent_width;
  1098.     int32 width;
  1099.     Bool is_percent_height;
  1100.     int32 height;
  1101.     PA_Tag *tag;
  1102. } LO_SpacerStruct;
  1103.  
  1104. typedef struct LO_NoBreakStruct_struct {
  1105.   LO_Any lo_any;
  1106.  
  1107.   /* nothing really to nobreak elements */
  1108.   Bool is_end;
  1109. } LO_NoBreakStruct;
  1110.  
  1111. typedef struct LO_ParagraphStruct_struct {
  1112.   LO_Any lo_any;
  1113.  
  1114.   Bool is_end;
  1115.   intn blank_lines;
  1116.  
  1117.   /* only used in the close element */
  1118.   Bool implicit_end;
  1119.  
  1120.   /* only used in the open element */
  1121.   Bool alignment_set;
  1122.   int32 alignment;
  1123.   Bool has_top_ss_margin;
  1124.   Bool has_bottom_ss_margin;
  1125. } LO_ParagraphStruct;
  1126.  
  1127. typedef struct LO_FloatStruct_struct {
  1128.     LO_Any lo_any;
  1129.  
  1130.     LO_Element *float_ele;
  1131. } LO_FloatStruct;
  1132.  
  1133. typedef struct LO_ListStruct_struct {
  1134.   LO_Any lo_any;
  1135.  
  1136.   Bool is_end;
  1137.  
  1138.   PA_Tag *tag;
  1139.   int32 bullet_type;
  1140.   int32 bullet_start;
  1141.   int32 quote_type;
  1142.   Bool compact;
  1143.  
  1144. } LO_ListStruct;
  1145.  
  1146. typedef struct LO_DescTitle_struct {
  1147.   LO_Any lo_any;
  1148. } LO_DescTitleStruct;
  1149.  
  1150. typedef struct LO_DescText_struct {
  1151.   LO_Any lo_any;
  1152. } LO_DescTextStruct;
  1153.  
  1154. typedef struct LO_BlockQuote_struct {
  1155.   LO_Any lo_any;
  1156.  
  1157.   Bool is_end;
  1158.   int8 quote_type;
  1159.   PA_Tag *tag;
  1160.  
  1161. } LO_BlockQuoteStruct;
  1162.  
  1163. typedef struct LO_Layer_struct {
  1164.     LO_Any lo_any;
  1165.  
  1166.     Bool is_end;
  1167.     LO_BlockInitializeStruct *initParams;
  1168. } LO_LayerStruct;
  1169.  
  1170. typedef struct LO_Heading_struct {
  1171.     LO_Any lo_any;
  1172.     
  1173.     Bool is_end;
  1174.     int32 alignment;
  1175. } LO_HeadingStruct;
  1176.  
  1177. typedef struct LO_Span_struct {
  1178.   LO_Any lo_any;
  1179.  
  1180.   Bool is_end;
  1181.   /* should probably keep some stuff in here... perhaps
  1182.      the tag, so we can look up the inline style. */
  1183. } LO_SpanStruct;
  1184.  
  1185. typedef struct LO_Div_struct {
  1186.   LO_Any lo_any;
  1187.  
  1188.   Bool is_end;
  1189.   /* should probably keep some stuff in here... perhaps
  1190.      the tag, so we can look up the inline style. */
  1191. } LO_DivStruct;
  1192.  
  1193. union LO_Element_struct {
  1194.     int16 type;
  1195.     LO_Any lo_any;
  1196.     LO_TextStruct lo_text;
  1197.     LO_TextBlock lo_textBlock;
  1198.     LO_ImageStruct lo_image;
  1199.     LO_SubDocStruct lo_subdoc;
  1200.     LO_FormElementStruct lo_form;
  1201.     LO_LinefeedStruct lo_linefeed;
  1202.     LO_HorizRuleStruct lo_hrule;
  1203.     LO_BulletStruct lo_bullet;
  1204.     LO_TableStruct lo_table;
  1205.     LO_CellStruct lo_cell;
  1206.     LO_EmbedStruct lo_embed;
  1207.     LO_EdgeStruct lo_edge;
  1208.     LO_JavaAppStruct lo_java;
  1209.  
  1210.     /* These next elements do nothing but mutate the doc state. */
  1211.     LO_CenterStruct lo_center;
  1212.     LO_FloatStruct lo_float;
  1213.     LO_ParagraphStruct lo_paragraph;
  1214.     LO_MulticolumnStruct lo_multicolumn;
  1215.     LO_NoBreakStruct lo_nobreak;
  1216.     LO_ListStruct lo_list;
  1217.     LO_DescTitleStruct lo_desctitle;
  1218.     LO_DescTextStruct lo_desctext;
  1219.     LO_BlockQuoteStruct lo_blockquote;
  1220.     LO_LayerStruct lo_layer;
  1221.     LO_HeadingStruct lo_heading;
  1222.     LO_SpanStruct lo_span;
  1223.     LO_DivStruct lo_div;
  1224.     LO_SpacerStruct lo_spacer;
  1225. };
  1226.  
  1227. struct LO_ObjectStruct_struct {
  1228.     LO_Element lo_element;
  1229.     void* stream_closure;
  1230. };
  1231.  
  1232. /* #ifndef NO_TAB_NAVIGATION */
  1233. #define tabFocusListMax        8
  1234. struct LO_tabFocus_struct {
  1235.     LO_Element        *pElement;
  1236.     int32            mapAreaIndex;        /* 0 means no focus, start with index 1. */
  1237.     LO_AnchorData    *pAnchor;
  1238. };
  1239. /* NO_TAB_NAVIGATION  */
  1240.  
  1241. struct LO_Position_struct {
  1242.     LO_Element* element;  /* The element */
  1243.     int32 position;    /* The position within the element. */
  1244. };
  1245.  
  1246. /* begin always <= end. Both begin and end are included in
  1247.  * the selected region. (i.e. it's closed. Half-open would
  1248.  * be better, since then we could also express insertion
  1249.  * points.)
  1250.  */
  1251.  
  1252. struct LO_Selection_struct {
  1253.     LO_Position begin;
  1254.     LO_Position end;
  1255. };
  1256.  
  1257. /* Hit test results */
  1258.  
  1259. #define LO_HIT_UNKNOWN  0
  1260. #define LO_HIT_LINE  1
  1261. #define LO_HIT_ELEMENT  2
  1262.  
  1263. #define LO_HIT_LINE_REGION_BEFORE  0
  1264. #define LO_HIT_LINE_REGION_AFTER  1
  1265.  
  1266. #define LO_HIT_ELEMENT_REGION_BEFORE  0
  1267. #define LO_HIT_ELEMENT_REGION_MIDDLE  1
  1268. #define LO_HIT_ELEMENT_REGION_AFTER  2
  1269.  
  1270. struct LO_HitLineResult_struct {
  1271.     int16 type;         /* LO_HIT_LINE */
  1272.     int16 region;     /* LO_HIT_LINE_POSITION_XXX */
  1273.     LO_Selection selection; /* The line */
  1274. };
  1275.  
  1276. struct LO_HitElementResult_struct {
  1277.     int16 type;         /* LO_HIT_ELEMENT */
  1278.     int16 region;     /* LO_HIT_ELEMENT_POSITION_XXX */
  1279.     LO_Position position;    /* The element that was hit. */
  1280.  
  1281. };
  1282.  
  1283. union LO_HitResult_struct {
  1284.     int16 type;
  1285.     LO_HitLineResult lo_hitLine;
  1286.     LO_HitElementResult lo_hitElement;
  1287. };
  1288.  
  1289. /* Logical navigation chunks */
  1290.  
  1291. #define LO_NA_CHARACTER 0
  1292. #define LO_NA_WORD 1
  1293. #define LO_NA_LINEEDGE 2
  1294. #define LO_NA_DOCUMENT 3
  1295.  
  1296. /* It's unclear if we shouldn't figure out how to move these
  1297.    declarations and defines into layout-private header files. */
  1298. typedef enum LO_LayerType_enum {
  1299.     LO_BLINK_LAYER,
  1300.     LO_IMAGE_LAYER,
  1301.     LO_HTML_BLOCK_LAYER,    /* Contents of <LAYER> tag, not including bg */
  1302.     LO_HTML_BODY_LAYER,        /* Contents of <BODY> tag, not including bg */
  1303.     LO_HTML_BACKGROUND_LAYER,    /* Background for <BODY> or <LAYER> */
  1304.     LO_GROUP_LAYER,        /* Parent with child background and content layers */
  1305.     LO_EMBEDDED_OBJECT_LAYER    /* Form, applet, plugin */
  1306. } LO_LayerType;
  1307.  
  1308. #define LO_DOCUMENT_LAYER_NAME "_DOCUMENT"
  1309. #define LO_BACKGROUND_LAYER_NAME "_BACKGROUND"
  1310. #define LO_BODY_LAYER_NAME "_BODY"
  1311. #define LO_BLINK_GROUP_NAME "_BLINKGROUP"
  1312. #define LO_CONTENT_LAYER_NAME "_CONTENT"
  1313. #define LO_EMBED_LAYER_NAME "_EMBED"
  1314.  
  1315. #define LO_DOCUMENT_LAYER_ID 0
  1316.  
  1317. #endif /* _LayoutElements_ */
  1318.