bridge.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:4k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. typedef float HTCoord;
  2. typedef int HTColor;            /* Sorry about the US spelling! */
  3. typedef long int HTLMFont; /* For now */
  4. #define HT_NON_BREAK_SPACE ((char)1) /* For now */
  5. #define HT_FONT 0
  6. #define HT_CAPITALS 1
  7. #define HT_BOLD 2
  8. #define HT_UNDERLINE 4
  9. #define HT_INVERSE 8
  10. #define HT_DOUBLE 0x10
  11. #define HT_BLACK 0
  12. #define HT_WHITE 1
  13. typedef struct {
  14.     short               kind;           /* only NX_LEFTTAB implemented*/
  15.     HTCoord             position;       /* x coordinate for stop */
  16. } HTTabStop;
  17. struct _HTStyle {
  18. /*      Style management information
  19. */
  20.     struct _HTStyle     *next;          /* Link for putting into stylesheet */
  21.     char *              name;           /* Style name */
  22.     char *              SGMLTag;        /* Tag name to start */
  23. /*      Character attributes    (a la NXRun)
  24. */
  25.     HTFont              font;           /* Font id */
  26.     HTCoord             fontSize;       /* The size of font, not independent */
  27.     HTColor             color;  /* text gray of current run */
  28.     int                 superscript;    /* superscript (-sub) in points */
  29.     HTAnchor            *anchor;        /* Anchor id if any, else zero */
  30. /*      Paragraph Attribtes     (a la NXTextStyle)
  31. */
  32.     HTCoord             indent1st;      /* how far first line in paragraph is
  33.                                  * indented */
  34.     HTCoord             leftIndent;     /* how far second line is indented */
  35.     HTCoord             rightIndent;    /* (Missing from NeXT version */
  36.     short               alignment;      /* quad justification */
  37.     HTCoord             lineHt;         /* line height */
  38.     HTCoord             descentLine;    /* descender bottom from baseline */
  39.     HTTabStop           *tabs;          /* array of tab stops, 0 terminated */
  40.     BOOL                wordWrap;       /* Yes means wrap at space not char */
  41.     BOOL                freeFormat;     /* Yes means n is just white space */
  42.     HTCoord             spaceBefore;    /* Omissions from NXTextStyle */
  43.     HTCoord             spaceAfter;
  44.     int                 paraFlags;      /* Paragraph flags, bits as follows: */
  45. #define PARA_KEEP       1       /* Do not break page within this paragraph */
  46. #define PARA_WITH_NEXT  2       /* Do not break page after this paragraph */
  47. #define HT_JUSTIFY 0            /* For alignment */
  48. #define HT_LEFT 1
  49. #define HT_RIGHT 2
  50. #define HT_CENTER 3
  51. };
  52. typedef struct _line {
  53. struct _line *next;
  54. struct _line *prev;
  55. short unsigned offset; /* Implicit initial spaces */
  56. short unsigned size; /* Number of characters */
  57. BOOL split_after; /* Can we split after? */
  58. BOOL bullet; /* Do we bullet? */
  59. char data[1]; /* Space for terminator at least! */
  60. } HTLine;
  61. #define LINE_SIZE(l) (sizeof(HTLine)+(l)) /* allow for terminator */
  62. typedef struct _TextAnchor {
  63. struct _TextAnchor * next;
  64. int number; /* For user interface */
  65. int start; /* Characters */
  66. int extent; /* Characters */
  67. HTChildAnchor * anchor;
  68. } TextAnchor;
  69. struct _HText {
  70. HTParentAnchor * node_anchor;
  71. char * title;
  72. HTLine *          last_line; /* howcome */
  73. int lines; /* Number of them */
  74. int chars; /* Number of them */
  75. TextAnchor * first_anchor; /* Singly linked list */
  76. TextAnchor * last_anchor;
  77. int last_anchor_number; /* user number */
  78. /* For Internal use: */
  79. HTStyle * style; /* Current style */
  80. int display_on_the_fly; /* Lines left */
  81. BOOL all_pages; /* Loop on the fly */
  82. int top_of_screen; /* Line number */
  83. HTLine * top_of_screen_line; /* Top */
  84. HTLine * next_line; /* Bottom + 1 */
  85. int permissible_split; /* in last line */
  86. BOOL in_line_1; /* of paragraph */
  87. BOOL stale; /* Must refresh */
  88. HTStream* target; /* Output stream */
  89. HTStreamClass targetClass; /* Output routines */
  90. };