projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented wxSS::GetMetric on wxGTK2 (patch 950618)
[wxWidgets.git]
/
src
/
html
/
m_layout.cpp
diff --git
a/src/html/m_layout.cpp
b/src/html/m_layout.cpp
index f99e547ca131f3ee46105740960182708da3be17..ee1e782205c6c00608f6664021ca8084d5d50f22 100644
(file)
--- a/
src/html/m_layout.cpp
+++ b/
src/html/m_layout.cpp
@@
-4,9
+4,9
@@
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) 1999 Vaclav Slavik
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) 1999 Vaclav Slavik
-// Licence: wxWindows
L
icence
+// Licence: wxWindows
l
icence
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation
#endif
#pragma implementation
#endif
@@
-30,8
+30,11
@@
FORCE_LINK_ME(m_layout)
FORCE_LINK_ME(m_layout)
-
-#include <stdlib.h> // bsearch()
+#ifdef __WXWINCE__
+ #include "wx/msw/wince/missing.h" // for bsearch()
+#else
+ #include <stdlib.h> // bsearch()
+#endif
//-----------------------------------------------------------------------------
// wxHtmlPageBreakCell
//-----------------------------------------------------------------------------
// wxHtmlPageBreakCell
@@
-66,7
+69,7
@@
FORCE_LINK_ME(m_layout)
// array wxHtmlPrintout::m_PageBreaks of pagebreaks already set, and
// set a new one only if it's not in that array.
// array wxHtmlPrintout::m_PageBreaks of pagebreaks already set, and
// set a new one only if it's not in that array.
-class
WXDLLEXPORT
wxHtmlPageBreakCell : public wxHtmlCell
+class wxHtmlPageBreakCell : public wxHtmlCell
{
public:
wxHtmlPageBreakCell() {}
{
public:
wxHtmlPageBreakCell() {}
@@
-77,14
+80,14
@@
public:
void Draw(wxDC& WXUNUSED(dc),
int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(view_y1), int WXUNUSED(view_y2),
void Draw(wxDC& WXUNUSED(dc),
int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(view_y1), int WXUNUSED(view_y2),
- wxHtmlRendering
State& WXUNUSED(state
)) {}
+ wxHtmlRendering
Info& WXUNUSED(info
)) {}
private:
DECLARE_NO_COPY_CLASS(wxHtmlPageBreakCell)
};
// Comparison routine for bsearch into an int* array of pagebreaks.
private:
DECLARE_NO_COPY_CLASS(wxHtmlPageBreakCell)
};
// Comparison routine for bsearch into an int* array of pagebreaks.
-
static int i
nteger_compare(void const* i0, void const* i1)
+
extern "C" int wxCMPFUNC_CONV wxI
nteger_compare(void const* i0, void const* i1)
{
return *(int*)i0 - *(int*)i1;
}
{
return *(int*)i0 - *(int*)i1;
}
@@
-119,7
+122,7
@@
bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, int* known_pagebreaks,
// zero plus one element for each page.
int* where = (int*) bsearch(&total_height, known_pagebreaks,
1 + number_of_pages, sizeof(int),
// zero plus one element for each page.
int* where = (int*) bsearch(&total_height, known_pagebreaks,
1 + number_of_pages, sizeof(int),
-
i
nteger_compare);
+
wxI
nteger_compare);
// Add a pagebreak only if there isn't one already set here.
if(NULL != where)
{
// Add a pagebreak only if there isn't one already set here.
if(NULL != where)
{
@@
-133,10
+136,11
@@
bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, int* known_pagebreaks,
}
TAG_HANDLER_BEGIN(P, "P")
}
TAG_HANDLER_BEGIN(P, "P")
+ TAG_HANDLER_CONSTR(P) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
- if (m_WParser->GetContainer()->GetFirstC
ell
() != NULL)
+ if (m_WParser->GetContainer()->GetFirstC
hild
() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
@@
-151,6
+155,7
@@
TAG_HANDLER_END(P)
TAG_HANDLER_BEGIN(BR, "BR")
TAG_HANDLER_BEGIN(BR, "BR")
+ TAG_HANDLER_CONSTR(BR) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-170,6
+175,7
@@
TAG_HANDLER_END(BR)
TAG_HANDLER_BEGIN(CENTER, "CENTER")
TAG_HANDLER_BEGIN(CENTER, "CENTER")
+ TAG_HANDLER_CONSTR(CENTER) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-177,7
+183,7
@@
TAG_HANDLER_BEGIN(CENTER, "CENTER")
wxHtmlContainerCell *c = m_WParser->GetContainer();
m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
wxHtmlContainerCell *c = m_WParser->GetContainer();
m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
- if (c->GetFirstC
ell
() != NULL)
+ if (c->GetFirstC
hild
() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
@@
-190,7
+196,7
@@
TAG_HANDLER_BEGIN(CENTER, "CENTER")
ParseInner(tag);
m_WParser->SetAlign(old);
ParseInner(tag);
m_WParser->SetAlign(old);
- if (c->GetFirstC
ell
() != NULL)
+ if (c->GetFirstC
hild
() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
@@
-208,6
+214,7
@@
TAG_HANDLER_END(CENTER)
TAG_HANDLER_BEGIN(DIV, "DIV")
TAG_HANDLER_BEGIN(DIV, "DIV")
+ TAG_HANDLER_CONSTR(DIV) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-231,7
+238,7
@@
TAG_HANDLER_BEGIN(DIV, "DIV")
{
int old = m_WParser->GetAlign();
wxHtmlContainerCell *c = m_WParser->GetContainer();
{
int old = m_WParser->GetAlign();
wxHtmlContainerCell *c = m_WParser->GetContainer();
- if (c->GetFirstC
ell
() != NULL)
+ if (c->GetFirstC
hild
() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
@@
-248,7
+255,7
@@
TAG_HANDLER_BEGIN(DIV, "DIV")
ParseInner(tag);
m_WParser->SetAlign(old);
ParseInner(tag);
m_WParser->SetAlign(old);
- if (c->GetFirstC
ell
() != NULL)
+ if (c->GetFirstC
hild
() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
@@
-256,11
+263,20
@@
TAG_HANDLER_BEGIN(DIV, "DIV")
else
c->SetAlignHor(old);
else
c->SetAlignHor(old);
- return
TRUE
;
+ return
true
;
}
else
{
}
else
{
- return FALSE;
+ // Same as BR
+ int al = m_WParser->GetContainer()->GetAlignHor();
+ wxHtmlContainerCell *c;
+
+ m_WParser->CloseContainer();
+ c = m_WParser->OpenContainer();
+ c->SetAlignHor(al);
+ c->SetAlign(tag);
+ c->SetMinHeight(m_WParser->GetCharHeight());
+ return false;
}
}
}
}
@@
-270,6
+286,7
@@
TAG_HANDLER_END(DIV)
TAG_HANDLER_BEGIN(TITLE, "TITLE")
TAG_HANDLER_BEGIN(TITLE, "TITLE")
+ TAG_HANDLER_CONSTR(TITLE) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-278,9
+295,11
@@
TAG_HANDLER_BEGIN(TITLE, "TITLE")
wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow());
if (wfr)
{
wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow());
if (wfr)
{
- const wxString& src = *m_WParser->GetSource();
- wfr->OnSetTitle(src.Mid(tag.GetBeginPos(),
- tag.GetEndPos1()-tag.GetBeginPos()));
+ wxString title = m_WParser->GetSource()->Mid(
+ tag.GetBeginPos(),
+ tag.GetEndPos1()-tag.GetBeginPos());
+ title = m_WParser->GetEntitiesParser()->Parse(title);
+ wfr->OnSetTitle(title);
}
}
return TRUE;
}
}
return TRUE;
@@
-292,6
+311,7
@@
TAG_HANDLER_END(TITLE)
TAG_HANDLER_BEGIN(BODY, "BODY")
TAG_HANDLER_BEGIN(BODY, "BODY")
+ TAG_HANDLER_CONSTR(BODY) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-321,6
+341,7
@@
TAG_HANDLER_END(BODY)
TAG_HANDLER_BEGIN(BLOCKQUOTE, "BLOCKQUOTE")
TAG_HANDLER_BEGIN(BLOCKQUOTE, "BLOCKQUOTE")
+ TAG_HANDLER_CONSTR(BLOCKQUOTE) { }
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_PROC(tag)
{
@@
-351,7
+372,9
@@
TAG_HANDLER_END(BLOCKQUOTE)
// Tag handler for tags that we have to ignore, otherwise non-text data
// would show up as text:
TAG_HANDLER_BEGIN(DoNothing, "SCRIPT")
// Tag handler for tags that we have to ignore, otherwise non-text data
// would show up as text:
TAG_HANDLER_BEGIN(DoNothing, "SCRIPT")
- TAG_HANDLER_PROC(tag)
+ TAG_HANDLER_CONSTR(DoNothing) { }
+
+ TAG_HANDLER_PROC(WXUNUSED(tag))
{
return true;
}
{
return true;
}