Dillo v3.1.1-91-g6d5b3ee3
Loading...
Searching...
No Matches
DilloHtml Class Reference

#include <html_common.hh>

Classes

class  HtmlLinkReceiver
 

Public Member Functions

 DilloHtml (BrowserWindow *bw, const DilloUrl *url, const char *content_type)
 Create and initialize a new DilloHtml class.
 
 ~DilloHtml ()
 Free memory used by the DilloHtml class.
 
void bugMessage (const char *format,...)
 Collect HTML error strings.
 
void connectSignals (dw::core::Widget *dw)
 
void write (char *Buf, int BufSize, int Eof)
 Process the newly arrived html and put it into the page structure.
 
int getCurrLineNumber ()
 Return the line number of the tag/word being processed by the parser.
 
void finishParsing (int ClientKey)
 Finish parsing a HTML page.
 
int formNew (DilloHtmlMethod method, const DilloUrl *action, DilloHtmlEnc enc, const char *charset)
 Allocate and insert form information.
 
DilloHtmlForm * getCurrentForm ()
 Get the current form.
 
bool_t unloadedImages ()
 
void loadImages (const DilloUrl *pattern)
 Load images if they were disabled.
 
void addCssUrl (const DilloUrl *url)
 Save URL in a vector (may be loaded later).
 
void startElement (int tag)
 
void startElement (const char *tagname)
 
dw::core::style::StylebackgroundStyle ()
 
dw::core::style::Stylestyle ()
 
dw::core::style::StylewordStyle ()
 
void restyle ()
 

Public Attributes

BrowserWindowbw
 
DilloUrlpage_url
 
DilloUrlbase_url
 
dw::core::Widgetdw
 
char * Start_Buf
 
int Start_Ofs
 
char * content_type
 
char * charset
 
bool stop_parser
 
size_t CurrOfs
 
size_t OldOfs
 
size_t OldLine
 
DilloHtmlDocumentType DocType
 
float DocTypeVersion
 
lout::misc::SimpleVector< DilloUrl * > * cssUrls
 
lout::misc::SimpleVector< DilloHtmlState > * stack
 
StyleEnginestyleEngine
 
int InFlags
 tracks which elements we are in
 
DstrStash
 
bool StashSpace
 
int pre_column
 current column, used in PRE tags with tabs
 
bool PreFirstChar
 used to skip the first CR or CRLF in PRE tags
 
bool PrevWasCR
 Flag to help parsing of "\r\n" in PRE tags.
 
bool PrevWasOpenTag
 Flag to help deferred parsing of white space.
 
bool InVisitedLink
 used to 'contrast_visited_colors'
 
bool ReqTagClose
 Flag to close the stack's top tag.
 
bool TagSoup
 Flag to enable the parser's cleanup functions.
 
bool loadCssFromStash
 current stash content should be loaded as CSS
 
bool PrevWasBodyClose
 set when </body> is found
 
bool PrevWasHtmlClose
 set when </html> is found
 
uchar_t Num_HTML
 element counters: used for validation purposes.
 
uchar_t Num_HEAD
 
uchar_t Num_BODY
 
uchar_t Num_TITLE
 
Dstrattr_data
 Buffer for attribute value.
 
int32_t non_css_link_color
 as provided by link attribute in BODY
 
int32_t non_css_visited_color
 as provided by vlink attribute in BODY
 
int32_t visited_color
 as computed according to CSS
 
lout::misc::SimpleVector< DilloHtmlForm * > * forms
 
lout::misc::SimpleVector< DilloHtmlInput * > * inputs_outside_form
 
lout::misc::SimpleVector< DilloUrl * > * links
 
lout::misc::SimpleVector< DilloHtmlImage * > * images
 
dw::ImageMapsList maps
 

Private Member Functions

void freeParseData ()
 Free parsing data.
 
void initDw ()
 Miscellaneous initializations for Dw.
 

Private Attributes

HtmlLinkReceiver linkReceiver
 

Detailed Description

Definition at line 145 of file html_common.hh.

Constructor & Destructor Documentation

◆ DilloHtml()

◆ ~DilloHtml()

Member Function Documentation

◆ addCssUrl()

void DilloHtml::addCssUrl ( const DilloUrl url)

Save URL in a vector (may be loaded later).

Definition at line 733 of file html.cc.

References a_Url_dup(), cssUrls, lout::misc::SimpleVector< T >::increase(), lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::size().

Referenced by Html_tag_open_link().

◆ backgroundStyle()

◆ bugMessage()

void DilloHtml::bugMessage ( const char *  format,
  ... 
)

◆ connectSignals()

void DilloHtml::connectSignals ( dw::core::Widget dw)

◆ finishParsing()

void DilloHtml::finishParsing ( int  ClientKey)

Finish parsing a HTML page.

Close the parser and close the client. The class is not deleted here, it remains until the widget is destroyed.

Definition at line 641 of file html.cc.

References a_Bw_close_client(), bw, dReturn_if, lout::misc::SimpleVector< T >::getRef(), Html_tag_cleanup_at_close(), IN_EOF, InFlags, lout::misc::SimpleVector< T >::size(), stack, stop_parser, and DilloHtmlState::tag_idx.

Referenced by Html_callback().

◆ formNew()

int DilloHtml::formNew ( DilloHtmlMethod  method,
const DilloUrl action,
DilloHtmlEnc  enc,
const char *  charset 
)

◆ freeParseData()

void DilloHtml::freeParseData ( )
private

Free parsing data.

Definition at line 627 of file html.cc.

References attr_data, charset, content_type, dFree(), dStr_free(), stack, Stash, and TRUE.

Referenced by ~DilloHtml().

◆ getCurrentForm()

DilloHtmlForm * DilloHtml::getCurrentForm ( )

◆ getCurrLineNumber()

int DilloHtml::getCurrLineNumber ( )

Return the line number of the tag/word being processed by the parser.

Also update the offsets.

Definition at line 605 of file html.cc.

References CurrOfs, dReturn_val_if, dReturn_val_if_fail, IN_META_HACK, InFlags, OldLine, OldOfs, and Start_Buf.

Referenced by bugMessage().

◆ initDw()

void DilloHtml::initDw ( )
private

◆ loadImages()

void DilloHtml::loadImages ( const DilloUrl pattern)

◆ restyle()

void DilloHtml::restyle ( )
inline

Definition at line 251 of file html_common.hh.

References bw, StyleEngine::restyle(), and styleEngine.

Referenced by Html_tag_open_body().

◆ startElement() [1/2]

void DilloHtml::startElement ( const char *  tagname)
inline

Definition at line 241 of file html_common.hh.

References bw, StyleEngine::startElement(), and styleEngine.

◆ startElement() [2/2]

void DilloHtml::startElement ( int  tag)
inline

◆ style()

◆ unloadedImages()

bool_t DilloHtml::unloadedImages ( )

◆ wordStyle()

◆ write()

void DilloHtml::write ( char *  Buf,
int  BufSize,
int  Eof 
)

Process the newly arrived html and put it into the page structure.

(This function is called by Html_callback whenever there's new data)

Definition at line 578 of file html.cc.

References _MSG, bufsize, dFree(), dReturn_if, dStrndup(), Html_write_raw(), MSG, Start_Buf, Start_Ofs, and stop_parser.

Referenced by Html_callback().

Member Data Documentation

◆ attr_data

Dstr* DilloHtml::attr_data

Buffer for attribute value.

Definition at line 204 of file html_common.hh.

Referenced by DilloHtml(), freeParseData(), Html_get_attr2(), and Html_get_javascript_link().

◆ base_url

◆ bw

◆ charset

char * DilloHtml::charset

◆ content_type

char* DilloHtml::content_type

◆ cssUrls

lout::misc::SimpleVector<DilloUrl*>* DilloHtml::cssUrls

Definition at line 179 of file html_common.hh.

Referenced by addCssUrl(), DilloHtml(), Html_tag_close_head(), and ~DilloHtml().

◆ CurrOfs

size_t DilloHtml::CurrOfs

Definition at line 173 of file html_common.hh.

Referenced by DilloHtml(), getCurrLineNumber(), and Html_write_raw().

◆ DocType

◆ DocTypeVersion

◆ dw

◆ forms

lout::misc::SimpleVector<DilloHtmlForm*>* DilloHtml::forms

Definition at line 213 of file html_common.hh.

Referenced by DilloHtml(), formNew(), getCurrentForm(), Html_contains_form(), and ~DilloHtml().

◆ images

◆ InFlags

◆ inputs_outside_form

lout::misc::SimpleVector<DilloHtmlInput*>* DilloHtml::inputs_outside_form

◆ InVisitedLink

bool DilloHtml::InVisitedLink

used to 'contrast_visited_colors'

Definition at line 193 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_close_a(), Html_tag_open_a(), and Html_tag_open_font().

◆ linkReceiver

HtmlLinkReceiver DilloHtml::linkReceiver
private

Definition at line 157 of file html_common.hh.

Referenced by DilloHtml().

◆ links

◆ loadCssFromStash

bool DilloHtml::loadCssFromStash

current stash content should be loaded as CSS

Definition at line 196 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_close_style(), and Html_tag_open_style().

◆ maps

dw::ImageMapsList DilloHtml::maps

◆ non_css_link_color

int32_t DilloHtml::non_css_link_color

as provided by link attribute in BODY

Definition at line 206 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_open_a(), and Html_tag_open_body().

◆ non_css_visited_color

int32_t DilloHtml::non_css_visited_color

as provided by vlink attribute in BODY

Definition at line 207 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_open_a(), and Html_tag_open_body().

◆ Num_BODY

uchar_t DilloHtml::Num_BODY

Definition at line 202 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_close_body(), and Html_tag_open_body().

◆ Num_HEAD

uchar_t DilloHtml::Num_HEAD

◆ Num_HTML

uchar_t DilloHtml::Num_HTML

element counters: used for validation purposes.

ATM they're used as three state flags {0,1,>1}

Definition at line 202 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_close_html(), and Html_tag_open_html().

◆ Num_TITLE

uchar_t DilloHtml::Num_TITLE

◆ OldLine

size_t DilloHtml::OldLine

Definition at line 173 of file html_common.hh.

Referenced by DilloHtml(), and getCurrLineNumber().

◆ OldOfs

size_t DilloHtml::OldOfs

Definition at line 173 of file html_common.hh.

Referenced by DilloHtml(), and getCurrLineNumber().

◆ page_url

◆ pre_column

int DilloHtml::pre_column

current column, used in PRE tags with tabs

Definition at line 189 of file html_common.hh.

Referenced by DilloHtml(), Html_process_space(), Html_process_tag(), and Html_process_word().

◆ PreFirstChar

bool DilloHtml::PreFirstChar

used to skip the first CR or CRLF in PRE tags

Definition at line 190 of file html_common.hh.

Referenced by DilloHtml(), Html_process_space(), Html_process_tag(), and Html_process_word().

◆ PrevWasBodyClose

bool DilloHtml::PrevWasBodyClose

set when </body> is found

Definition at line 197 of file html_common.hh.

Referenced by DilloHtml(), Html_process_tag(), Html_process_word(), and Html_tag_cleanup_to_idx().

◆ PrevWasCR

bool DilloHtml::PrevWasCR

Flag to help parsing of "\r\n" in PRE tags.

Definition at line 191 of file html_common.hh.

Referenced by DilloHtml(), Html_process_space(), and Html_process_space_pre_line().

◆ PrevWasHtmlClose

bool DilloHtml::PrevWasHtmlClose

set when </html> is found

Definition at line 198 of file html_common.hh.

Referenced by DilloHtml(), Html_process_tag(), Html_process_word(), and Html_tag_cleanup_to_idx().

◆ PrevWasOpenTag

bool DilloHtml::PrevWasOpenTag

Flag to help deferred parsing of white space.

Definition at line 192 of file html_common.hh.

◆ ReqTagClose

bool DilloHtml::ReqTagClose

Flag to close the stack's top tag.

Definition at line 194 of file html_common.hh.

Referenced by DilloHtml(), Html_process_tag(), Html_tag_cleanup_to_idx(), Html_tag_open_body(), Html_tag_open_head(), and Html_tag_open_html().

◆ stack

◆ Start_Buf

char* DilloHtml::Start_Buf

Definition at line 168 of file html_common.hh.

Referenced by DilloHtml(), getCurrLineNumber(), and write().

◆ Start_Ofs

int DilloHtml::Start_Ofs

Definition at line 169 of file html_common.hh.

Referenced by DilloHtml(), Html_write_raw(), and write().

◆ Stash

◆ StashSpace

bool DilloHtml::StashSpace

◆ stop_parser

bool DilloHtml::stop_parser

◆ styleEngine

◆ TagSoup

bool DilloHtml::TagSoup

Flag to enable the parser's cleanup functions.

Definition at line 195 of file html_common.hh.

Referenced by DilloHtml(), Html_stack_cleanup_at_open(), and Html_tag_open_meta().

◆ visited_color

int32_t DilloHtml::visited_color

as computed according to CSS

Definition at line 208 of file html_common.hh.

Referenced by DilloHtml(), Html_tag_open_body(), and Html_tag_open_font().


The documentation for this class was generated from the following files: