- if (tag.GetName() == "IMG")
- {
- if (tag.HasParam("SRC")) {
- int w = -1, h = -1;
- int al;
- wxFSFile *str;
- wxString tmp = tag.GetParam("SRC");
- wxString mn = wxEmptyString;
-
- str = m_WParser -> GetFS() -> OpenFile(tmp);
- if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
- if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
- al = HTML_ALIGN_BOTTOM;
- if (tag.HasParam("ALIGN")) {
- wxString alstr = tag.GetParam("ALIGN");
- alstr.MakeUpper(); // for the case alignment was in ".."
- if (alstr == "TEXTTOP") al = HTML_ALIGN_TOP;
- else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = HTML_ALIGN_CENTER;
- }
- if (tag.HasParam("USEMAP"))
- {
- mn = tag.GetParam( "USEMAP" );
- if (mn[ 0 ] == '#')
+ if (tag.GetName() == wxT("IMG"))
+ {
+ if (tag.HasParam(wxT("SRC")))
+ {
+ int w = -1, h = -1;
+ int al;
+ wxFSFile *str;
+ wxString tmp = tag.GetParam(wxT("SRC"));
+ wxString mn = wxEmptyString;
+
+ str = m_WParser->GetFS()->OpenFile(tmp);
+ if (tag.HasParam(wxT("WIDTH"))) tag.ScanParam(wxT("WIDTH"), wxT("%i"), &w);
+ if (tag.HasParam(wxT("HEIGHT"))) tag.ScanParam(wxT("HEIGHT"), wxT("%i"), &h);
+ al = wxHTML_ALIGN_BOTTOM;
+ if (tag.HasParam(wxT("ALIGN")))
+ {
+ wxString alstr = tag.GetParam(wxT("ALIGN"));
+ alstr.MakeUpper(); // for the case alignment was in ".."
+ if (alstr == wxT("TEXTTOP")) al = wxHTML_ALIGN_TOP;
+ else if ((alstr == wxT("CENTER")) || (alstr == wxT("ABSCENTER"))) al = wxHTML_ALIGN_CENTER;
+ }
+ if (tag.HasParam(wxT("USEMAP")))
+ {
+ mn = tag.GetParam( wxT("USEMAP") );
+ if (mn[ (unsigned int) 0 ] == wxT('#'))
+ {
+ mn = mn.Mid( 1 );
+ }
+ }
+ wxHtmlImageCell *cel = NULL;
+ if (str)
+ {
+ cel = new wxHtmlImageCell(str, w, h, m_WParser->GetPixelScale(), al, mn);
+ cel->SetLink(m_WParser->GetLink());
+ m_WParser->GetContainer()->InsertCell(cel);
+ delete str;
+ }
+ }
+ }
+ if (tag.GetName() == wxT("MAP"))
+ {
+ m_WParser->CloseContainer();
+ m_WParser->OpenContainer();
+ if (tag.HasParam(wxT("NAME")))
+ {
+ wxString tmp = tag.GetParam(wxT("NAME"));
+ wxHtmlImageMapCell *cel = new wxHtmlImageMapCell( tmp );
+ m_WParser->GetContainer()->InsertCell( cel );
+ }
+ ParseInner( tag );
+ m_WParser->CloseContainer();
+ m_WParser->OpenContainer();
+ }
+ if (tag.GetName() == wxT("AREA"))
+ {
+ if (tag.HasParam(wxT("SHAPE")))
+ {
+ wxString tmp = tag.GetParam(wxT("SHAPE"));
+ wxString coords = wxEmptyString;
+ tmp.MakeUpper();
+ wxHtmlImageMapAreaCell *cel = NULL;
+ if (tag.HasParam(wxT("COORDS")))
+ {
+ coords = tag.GetParam(wxT("COORDS"));
+ }
+ if (tmp == wxT("POLY"))
+ {
+ cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::POLY, coords, m_WParser->GetPixelScale() );
+ }
+ else if (tmp == wxT("CIRCLE"))
+ {
+ cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords, m_WParser->GetPixelScale() );
+ }
+ else if (tmp == wxT("RECT"))