, outside of */
DILLO_HTML_TABLE_MODE_TD /* inside of | */
} DilloHtmlTableMode;
typedef enum {
HTML_LIST_NONE,
HTML_LIST_UNORDERED,
HTML_LIST_ORDERED
} DilloHtmlListMode;
enum DilloHtmlProcessingState {
IN_NONE = 0,
IN_HTML = 1 << 0,
IN_HEAD = 1 << 1,
IN_BODY = 1 << 2,
IN_FORM = 1 << 3,
IN_SELECT = 1 << 4,
IN_TEXTAREA = 1 << 5,
IN_MAP = 1 << 6,
IN_PRE = 1 << 7,
IN_BUTTON = 1 << 8
};
struct _DilloHtmlState {
char *tag_name;
//DwStyle *style, *table_cell_style;
dw::core::style::Style *style, *table_cell_style;
DilloHtmlParseMode parse_mode;
DilloHtmlTableMode table_mode;
bool_t cell_text_align_set;
DilloHtmlListMode list_type;
int list_number;
/* TagInfo index for the tag that's being processed */
int tag_idx;
dw::core::Widget *textblock, *table;
/* This is used to align list items (especially in enumerated lists) */
dw::core::Widget *ref_list_item;
/* This makes image processing faster than a function
a_Dw_widget_get_background_color. */
int32_t current_bg_color;
/* This is used for list items etc; if it is set to TRUE, breaks
have to be "handed over" (see Html_add_indented and
Html_eventually_pop_dw). */
bool_t hand_over_break;
};
typedef enum {
DILLO_HTML_METHOD_UNKNOWN,
DILLO_HTML_METHOD_GET,
DILLO_HTML_METHOD_POST
} DilloHtmlMethod;
typedef enum {
DILLO_HTML_ENC_URLENCODING
} DilloHtmlEnc;
struct _DilloHtmlForm {
DilloHtmlMethod method;
DilloUrl *action;
DilloHtmlEnc enc;
misc::SimpleVector *inputs;
int num_entry_fields;
int num_submit_buttons;
form::Form *form_receiver;
};
struct _DilloHtmlOption {
//GtkWidget *menuitem;
char *value;
bool_t init_val;
};
struct _DilloHtmlSelect {
//GtkWidget *menu;
int size;
DilloHtmlOption *options;
int num_options;
int num_options_max;
};
typedef enum {
DILLO_HTML_INPUT_UNKNOWN,
DILLO_HTML_INPUT_TEXT,
DILLO_HTML_INPUT_PASSWORD,
DILLO_HTML_INPUT_CHECKBOX,
DILLO_HTML_INPUT_RADIO,
DILLO_HTML_INPUT_IMAGE,
DILLO_HTML_INPUT_FILE,
DILLO_HTML_INPUT_BUTTON,
DILLO_HTML_INPUT_HIDDEN,
DILLO_HTML_INPUT_SUBMIT,
DILLO_HTML_INPUT_RESET,
DILLO_HTML_INPUT_BUTTON_SUBMIT,
DILLO_HTML_INPUT_BUTTON_RESET,
DILLO_HTML_INPUT_SELECT,
DILLO_HTML_INPUT_SEL_LIST,
DILLO_HTML_INPUT_TEXTAREA,
DILLO_HTML_INPUT_INDEX
} DilloHtmlInputType;
struct _DilloHtmlInput {
DilloHtmlInputType type;
void *widget; /* May be a FLTKWidget or a Dw Widget. */
void *embed; /* May be NULL */
char *name;
char *init_str; /* note: some overloading - for buttons, init_str
is simply the value of the button; for text
entries, it is the initial value */
DilloHtmlSelect *select;
bool_t init_val; /* only meaningful for buttons */
};
struct _DilloHtml {
dw::core::Widget *dw; /* this is duplicated in the stack (page) */
DilloHtmlLB *linkblock;
char *Start_Buf;
size_t Start_Ofs;
size_t CurrTagOfs;
size_t OldTagOfs, OldTagLine;
DilloHtmlDocumentType DocType; /* as given by DOCTYPE tag */
float DocTypeVersion; /* HTML or XHTML version number */
misc::SimpleVector *stack;
int InFlags; /* tracks which tags we are in */
Dstr *Stash;
bool_t StashSpace;
char *SPCBuf; /* Buffer for white space */
int pre_column; /* current column, used in PRE tags with tabs */
bool_t PreFirstChar; /* used to skip the first CR or CRLF in PRE tags */
bool_t PrevWasCR; /* Flag to help parsing of "\r\n" in PRE tags */
bool_t PrevWasOpenTag; /* Flag to help deferred parsing of white space */
bool_t SPCPending; /* Flag to help deferred parsing of white space */
bool_t InVisitedLink; /* used to 'contrast_visited_colors' */
bool_t ReqTagClose; /* Flag to help handling bad-formed HTML */
bool_t CloseOneTag; /* Flag to help Html_tag_cleanup_at_close() */
bool_t TagSoup; /* Flag to enable the parser's cleanup functions */
char *NameVal; /* used for validation of "NAME" and "ID" in */
/* element counters: used for validation purposes */
uchar_t Num_HTML, Num_HEAD, Num_BODY, Num_TITLE;
Dstr *attr_data;
BrowserWindow *bw;
};
/*
* Exported functions
*/
void a_Html_form_event_handler(void *data,
form::Form *form_receiver,
void *v_resource);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __HTML_HH__ */
|