2 Copyright © 2004, Martin Gierich. All rights reserved.
3 Licensed under the terms of the AROS Public License (APL)
6 Desc: Structs for both HTML parser and layout engine
15 #define G(o) ((struct Gadget *)(o))
17 #include <clib/alib_protos.h>
18 #include <proto/exec.h>
19 #define MALLOC(pool,size) AllocPooled((pool),(size))
20 #define MFREE(pool,ptr)
21 typedef unsigned char u_char
;
22 typedef unsigned short u_short
;
25 #include <aros/debug.h>
30 #define MALLOC(pool,size) malloc(size)
31 #define MFREE(pool,ptr) free(ptr)
35 /*******************************************************************************************/
39 typedef union _para_flags para_flags
;
40 typedef union _style_flags style_flags
;
41 typedef struct _image_struct image_struct
;
42 typedef struct _seg_struct seg_struct
;
43 typedef struct _page_struct page_struct
;
44 typedef struct _parse_struct parse_struct
;
45 typedef struct _layout_struct layout_struct
;
48 page_struct
* parse_init( void *mempool
);
49 int parse_do( page_struct
*page
, string inbuf
, int inbufbytes
);
50 int parse_end( page_struct
*page
);
51 void parse_free( page_struct
*page
);
52 int layout_init( page_struct
*page
);
53 int layout_do( page_struct
*page
, int winwidth
, int *width
, int *height
);
54 void layout_free( page_struct
*page
);
56 /*******************************************************************************************/
57 /* Structures common to parse and layout */
73 #define ALIGN_CENTER 2
74 #define ALIGN_JUSTIFY 3
76 } __attribute__((packed
));
82 } __attribute__((packed
));
91 } __attribute__((packed
));
97 } __attribute__((packed
));
107 /*******************************************************************************************/
125 #define SEG_CMD_MASK 0x1f
126 #define SEG_CMD_LAST 0x80
136 style_flags stylemask
;
145 style_flags styleflags
;
146 para_flags paraflags
;
148 } __attribute__((packed
));
150 /*******************************************************************************************/
151 /* Layout Prototypes */
152 int text_len( layout_struct
*ldata
, string str
, int strlen
);
153 int text_height( layout_struct
*ldata
);
154 int text_fit( layout_struct
*ldata
, string str
, int strlen
, int *strsize
, int maxwidth
);
156 int linelist_init( layout_struct
*ldata
);
157 void * linelist_store( layout_struct
*ldata
, string textseg
, u_short textlen
,
158 u_short xpos
, u_short ypos
, u_short width
, u_short height
, style_flags style
, int linebreak
);
159 void * linelist_addlf( layout_struct
*ldata
, void * line
);
160 void linelist_free( layout_struct
*ldata
);
162 /*******************************************************************************************/
163 /* Private Layout Data */
165 struct _layout_struct
174 para_flags paraflags
;
175 style_flags styleflags
;