From f68e16c5fcf53c411742c8338a290addc5fb4b62 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 May 2010 23:12:25 +0000 Subject: [PATCH] Add tag and limited support for CSS styles to wxHTML. Parse "style" attributes of the HTML tags and honour those of them that can be mapped to the HTML 3 attributes. Also add a handler for tag. Closes #10631. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 33 +++++++++ build/bakefiles/files.bkl | 3 + build/msw/makefile.bcc | 32 +++++++++ build/msw/makefile.gcc | 32 +++++++++ build/msw/makefile.vc | 32 +++++++++ build/msw/makefile.wat | 32 +++++++++ build/msw/wx_core.dsp | 4 ++ build/msw/wx_html.dsp | 12 ++++ build/msw/wx_vc7_core.vcproj | 3 + build/msw/wx_vc7_html.vcproj | 9 +++ build/msw/wx_vc8_core.vcproj | 4 ++ build/msw/wx_vc8_html.vcproj | 12 ++++ build/msw/wx_vc9_core.vcproj | 4 ++ build/msw/wx_vc9_html.vcproj | 12 ++++ docs/changes.txt | 1 + docs/doxygen/overviews/html.h | 8 +++ include/wx/html/forcelnk.h | 1 + include/wx/html/htmltag.h | 4 ++ include/wx/html/styleparams.h | 53 ++++++++++++++ include/wx/html/winpars.h | 2 + interface/wx/html/htmltag.h | 17 +++++ samples/html/test/test.htm | 16 +++++ src/html/htmltag.cpp | 39 ++++++++++- src/html/m_span.cpp | 125 ++++++++++++++++++++++++++++++++++ src/html/styleparams.cpp | 78 +++++++++++++++++++++ src/html/winpars.cpp | 25 +++++++ 26 files changed, 590 insertions(+), 3 deletions(-) create mode 100644 include/wx/html/styleparams.h create mode 100644 src/html/m_span.cpp create mode 100644 src/html/styleparams.cpp diff --git a/Makefile.in b/Makefile.in index df18b82b86..fa8349f713 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1548,8 +1548,10 @@ HTMLDLL_OBJECTS = \ htmldll_m_links.o \ htmldll_m_list.o \ htmldll_m_pre.o \ + htmldll_m_span.o \ htmldll_m_style.o \ htmldll_m_tables.o \ + htmldll_styleparams.o \ htmldll_winpars.o \ htmldll_htmllbox.o HTMLDLL_ODEP = $(_____pch_wxprec_htmldll_wx_wxprec_h_gch___depname) @@ -1579,8 +1581,10 @@ HTMLLIB_OBJECTS = \ htmllib_m_links.o \ htmllib_m_list.o \ htmllib_m_pre.o \ + htmllib_m_span.o \ htmllib_m_style.o \ htmllib_m_tables.o \ + htmllib_styleparams.o \ htmllib_winpars.o \ htmllib_htmllbox.o HTMLLIB_ODEP = $(_____pch_wxprec_htmllib_wx_wxprec_h_gch___depname) @@ -4003,6 +4007,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/html/htmlwin.h \ wx/html/htmprint.h \ wx/html/m_templ.h \ + wx/html/styleparams.h \ wx/html/winpars.h \ wx/wxhtml.h \ wx/htmllbox.h \ @@ -4287,8 +4292,10 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ monodll_m_links.o \ monodll_m_list.o \ monodll_m_pre.o \ + monodll_m_span.o \ monodll_m_style.o \ monodll_m_tables.o \ + monodll_styleparams.o \ monodll_winpars.o \ monodll_htmllbox.o \ monodll_debugrpt.o \ @@ -6153,8 +6160,10 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ monolib_m_links.o \ monolib_m_list.o \ monolib_m_pre.o \ + monolib_m_span.o \ monolib_m_style.o \ monolib_m_tables.o \ + monolib_styleparams.o \ monolib_winpars.o \ monolib_htmllbox.o \ monolib_debugrpt.o \ @@ -16768,12 +16777,18 @@ monodll_m_list.o: $(srcdir)/src/html/m_list.cpp $(MONODLL_ODEP) monodll_m_pre.o: $(srcdir)/src/html/m_pre.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/m_pre.cpp +monodll_m_span.o: $(srcdir)/src/html/m_span.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/m_span.cpp + monodll_m_style.o: $(srcdir)/src/html/m_style.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/m_style.cpp monodll_m_tables.o: $(srcdir)/src/html/m_tables.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/m_tables.cpp +monodll_styleparams.o: $(srcdir)/src/html/styleparams.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/styleparams.cpp + monodll_winpars.o: $(srcdir)/src/html/winpars.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/html/winpars.cpp @@ -21964,12 +21979,18 @@ monolib_m_list.o: $(srcdir)/src/html/m_list.cpp $(MONOLIB_ODEP) monolib_m_pre.o: $(srcdir)/src/html/m_pre.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/m_pre.cpp +monolib_m_span.o: $(srcdir)/src/html/m_span.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/m_span.cpp + monolib_m_style.o: $(srcdir)/src/html/m_style.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/m_style.cpp monolib_m_tables.o: $(srcdir)/src/html/m_tables.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/m_tables.cpp +monolib_styleparams.o: $(srcdir)/src/html/styleparams.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/styleparams.cpp + monolib_winpars.o: $(srcdir)/src/html/winpars.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/html/winpars.cpp @@ -35173,12 +35194,18 @@ htmldll_m_list.o: $(srcdir)/src/html/m_list.cpp $(HTMLDLL_ODEP) htmldll_m_pre.o: $(srcdir)/src/html/m_pre.cpp $(HTMLDLL_ODEP) $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/m_pre.cpp +htmldll_m_span.o: $(srcdir)/src/html/m_span.cpp $(HTMLDLL_ODEP) + $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/m_span.cpp + htmldll_m_style.o: $(srcdir)/src/html/m_style.cpp $(HTMLDLL_ODEP) $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/m_style.cpp htmldll_m_tables.o: $(srcdir)/src/html/m_tables.cpp $(HTMLDLL_ODEP) $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/m_tables.cpp +htmldll_styleparams.o: $(srcdir)/src/html/styleparams.cpp $(HTMLDLL_ODEP) + $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/styleparams.cpp + htmldll_winpars.o: $(srcdir)/src/html/winpars.cpp $(HTMLDLL_ODEP) $(CXXC) -c -o $@ $(HTMLDLL_CXXFLAGS) $(srcdir)/src/html/winpars.cpp @@ -35251,12 +35278,18 @@ htmllib_m_list.o: $(srcdir)/src/html/m_list.cpp $(HTMLLIB_ODEP) htmllib_m_pre.o: $(srcdir)/src/html/m_pre.cpp $(HTMLLIB_ODEP) $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/m_pre.cpp +htmllib_m_span.o: $(srcdir)/src/html/m_span.cpp $(HTMLLIB_ODEP) + $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/m_span.cpp + htmllib_m_style.o: $(srcdir)/src/html/m_style.cpp $(HTMLLIB_ODEP) $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/m_style.cpp htmllib_m_tables.o: $(srcdir)/src/html/m_tables.cpp $(HTMLLIB_ODEP) $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/m_tables.cpp +htmllib_styleparams.o: $(srcdir)/src/html/styleparams.cpp $(HTMLLIB_ODEP) + $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/styleparams.cpp + htmllib_winpars.o: $(srcdir)/src/html/winpars.cpp $(HTMLLIB_ODEP) $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/winpars.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 2b15444e21..08a5499a17 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -3249,8 +3249,10 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/html/m_links.cpp src/html/m_list.cpp src/html/m_pre.cpp + src/html/m_span.cpp src/html/m_style.cpp src/html/m_tables.cpp + src/html/styleparams.cpp src/html/winpars.cpp src/generic/htmllbox.cpp @@ -3273,6 +3275,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/html/htmlwin.h wx/html/htmprint.h wx/html/m_templ.h + wx/html/styleparams.h wx/html/winpars.h wx/wxhtml.h diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index d96c4140dc..8fe2aee5cb 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -1026,8 +1026,10 @@ HTMLDLL_OBJECTS = \ $(OBJS)\htmldll_m_links.obj \ $(OBJS)\htmldll_m_list.obj \ $(OBJS)\htmldll_m_pre.obj \ + $(OBJS)\htmldll_m_span.obj \ $(OBJS)\htmldll_m_style.obj \ $(OBJS)\htmldll_m_tables.obj \ + $(OBJS)\htmldll_styleparams.obj \ $(OBJS)\htmldll_winpars.obj \ $(OBJS)\htmldll_htmllbox.obj HTMLLIB_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ @@ -1061,8 +1063,10 @@ HTMLLIB_OBJECTS = \ $(OBJS)\htmllib_m_links.obj \ $(OBJS)\htmllib_m_list.obj \ $(OBJS)\htmllib_m_pre.obj \ + $(OBJS)\htmllib_m_span.obj \ $(OBJS)\htmllib_m_style.obj \ $(OBJS)\htmllib_m_tables.obj \ + $(OBJS)\htmllib_styleparams.obj \ $(OBJS)\htmllib_winpars.obj \ $(OBJS)\htmllib_htmllbox.obj QADLL_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ @@ -1553,8 +1557,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_m_links.obj \ $(OBJS)\monodll_m_list.obj \ $(OBJS)\monodll_m_pre.obj \ + $(OBJS)\monodll_m_span.obj \ $(OBJS)\monodll_m_style.obj \ $(OBJS)\monodll_m_tables.obj \ + $(OBJS)\monodll_styleparams.obj \ $(OBJS)\monodll_winpars.obj \ $(OBJS)\monodll_htmllbox.obj \ $(OBJS)\monodll_debugrpt.obj \ @@ -2260,8 +2266,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_m_links.obj \ $(OBJS)\monolib_m_list.obj \ $(OBJS)\monolib_m_pre.obj \ + $(OBJS)\monolib_m_span.obj \ $(OBJS)\monolib_m_style.obj \ $(OBJS)\monolib_m_tables.obj \ + $(OBJS)\monolib_styleparams.obj \ $(OBJS)\monolib_winpars.obj \ $(OBJS)\monolib_htmllbox.obj \ $(OBJS)\monolib_debugrpt.obj \ @@ -6428,12 +6436,18 @@ $(OBJS)\monodll_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\monodll_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\monodll_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\monodll_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\monodll_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\monodll_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\monodll_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -8629,12 +8643,18 @@ $(OBJS)\monolib_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\monolib_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\monolib_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\monolib_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\monolib_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\monolib_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\monolib_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -13745,12 +13765,18 @@ $(OBJS)\htmldll_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\htmldll_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\htmldll_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\htmldll_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\htmldll_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\htmldll_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\htmldll_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) -q -c -P -o$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -13820,12 +13846,18 @@ $(OBJS)\htmllib_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\htmllib_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\htmllib_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\htmllib_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\htmllib_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\htmllib_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\htmllib_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) -q -c -P -o$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\winpars.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 5d58b19075..2c4b833b7b 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -1023,8 +1023,10 @@ HTMLDLL_OBJECTS = \ $(OBJS)\htmldll_m_links.o \ $(OBJS)\htmldll_m_list.o \ $(OBJS)\htmldll_m_pre.o \ + $(OBJS)\htmldll_m_span.o \ $(OBJS)\htmldll_m_style.o \ $(OBJS)\htmldll_m_tables.o \ + $(OBJS)\htmldll_styleparams.o \ $(OBJS)\htmldll_winpars.o \ $(OBJS)\htmldll_htmllbox.o HTMLLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ @@ -1058,8 +1060,10 @@ HTMLLIB_OBJECTS = \ $(OBJS)\htmllib_m_links.o \ $(OBJS)\htmllib_m_list.o \ $(OBJS)\htmllib_m_pre.o \ + $(OBJS)\htmllib_m_span.o \ $(OBJS)\htmllib_m_style.o \ $(OBJS)\htmllib_m_tables.o \ + $(OBJS)\htmllib_styleparams.o \ $(OBJS)\htmllib_winpars.o \ $(OBJS)\htmllib_htmllbox.o QADLL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) \ @@ -1562,8 +1566,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_m_links.o \ $(OBJS)\monodll_m_list.o \ $(OBJS)\monodll_m_pre.o \ + $(OBJS)\monodll_m_span.o \ $(OBJS)\monodll_m_style.o \ $(OBJS)\monodll_m_tables.o \ + $(OBJS)\monodll_styleparams.o \ $(OBJS)\monodll_winpars.o \ $(OBJS)\monodll_htmllbox.o \ $(OBJS)\monodll_debugrpt.o \ @@ -2275,8 +2281,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_m_links.o \ $(OBJS)\monolib_m_list.o \ $(OBJS)\monolib_m_pre.o \ + $(OBJS)\monolib_m_span.o \ $(OBJS)\monolib_m_style.o \ $(OBJS)\monolib_m_tables.o \ + $(OBJS)\monolib_styleparams.o \ $(OBJS)\monolib_winpars.o \ $(OBJS)\monolib_htmllbox.o \ $(OBJS)\monolib_debugrpt.o \ @@ -6577,12 +6585,18 @@ $(OBJS)\monodll_m_list.o: ../../src/html/m_list.cpp $(OBJS)\monodll_m_pre.o: ../../src/html/m_pre.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_m_span.o: ../../src/html/m_span.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_m_style.o: ../../src/html/m_style.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\monodll_m_tables.o: ../../src/html/m_tables.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_styleparams.o: ../../src/html/styleparams.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_winpars.o: ../../src/html/winpars.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -8778,12 +8792,18 @@ $(OBJS)\monolib_m_list.o: ../../src/html/m_list.cpp $(OBJS)\monolib_m_pre.o: ../../src/html/m_pre.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_m_span.o: ../../src/html/m_span.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_m_style.o: ../../src/html/m_style.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\monolib_m_tables.o: ../../src/html/m_tables.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_styleparams.o: ../../src/html/styleparams.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_winpars.o: ../../src/html/winpars.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -13894,12 +13914,18 @@ $(OBJS)\htmldll_m_list.o: ../../src/html/m_list.cpp $(OBJS)\htmldll_m_pre.o: ../../src/html/m_pre.cpp $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\htmldll_m_span.o: ../../src/html/m_span.cpp + $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\htmldll_m_style.o: ../../src/html/m_style.cpp $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\htmldll_m_tables.o: ../../src/html/m_tables.cpp $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\htmldll_styleparams.o: ../../src/html/styleparams.cpp + $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\htmldll_winpars.o: ../../src/html/winpars.cpp $(CXX) -c -o $@ $(HTMLDLL_CXXFLAGS) $(CPPDEPS) $< @@ -13969,12 +13995,18 @@ $(OBJS)\htmllib_m_list.o: ../../src/html/m_list.cpp $(OBJS)\htmllib_m_pre.o: ../../src/html/m_pre.cpp $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\htmllib_m_span.o: ../../src/html/m_span.cpp + $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\htmllib_m_style.o: ../../src/html/m_style.cpp $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\htmllib_m_tables.o: ../../src/html/m_tables.cpp $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\htmllib_styleparams.o: ../../src/html/styleparams.cpp + $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\htmllib_winpars.o: ../../src/html/winpars.cpp $(CXX) -c -o $@ $(HTMLLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index 62b38a978f..a7c8632dbc 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -1080,8 +1080,10 @@ HTMLDLL_OBJECTS = \ $(OBJS)\htmldll_m_links.obj \ $(OBJS)\htmldll_m_list.obj \ $(OBJS)\htmldll_m_pre.obj \ + $(OBJS)\htmldll_m_span.obj \ $(OBJS)\htmldll_m_style.obj \ $(OBJS)\htmldll_m_tables.obj \ + $(OBJS)\htmldll_styleparams.obj \ $(OBJS)\htmldll_winpars.obj \ $(OBJS)\htmldll_htmllbox.obj HTMLDLL_RESOURCES = \ @@ -1119,8 +1121,10 @@ HTMLLIB_OBJECTS = \ $(OBJS)\htmllib_m_links.obj \ $(OBJS)\htmllib_m_list.obj \ $(OBJS)\htmllib_m_pre.obj \ + $(OBJS)\htmllib_m_span.obj \ $(OBJS)\htmllib_m_style.obj \ $(OBJS)\htmllib_m_tables.obj \ + $(OBJS)\htmllib_styleparams.obj \ $(OBJS)\htmllib_winpars.obj \ $(OBJS)\htmllib_htmllbox.obj QADLL_CXXFLAGS = /M$(__RUNTIME_LIBS_333)$(__DEBUGRUNTIME) /DWIN32 \ @@ -1761,8 +1765,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_m_links.obj \ $(OBJS)\monodll_m_list.obj \ $(OBJS)\monodll_m_pre.obj \ + $(OBJS)\monodll_m_span.obj \ $(OBJS)\monodll_m_style.obj \ $(OBJS)\monodll_m_tables.obj \ + $(OBJS)\monodll_styleparams.obj \ $(OBJS)\monodll_winpars.obj \ $(OBJS)\monodll_htmllbox.obj \ $(OBJS)\monodll_debugrpt.obj \ @@ -2474,8 +2480,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_m_links.obj \ $(OBJS)\monolib_m_list.obj \ $(OBJS)\monolib_m_pre.obj \ + $(OBJS)\monolib_m_span.obj \ $(OBJS)\monolib_m_style.obj \ $(OBJS)\monolib_m_tables.obj \ + $(OBJS)\monolib_styleparams.obj \ $(OBJS)\monolib_winpars.obj \ $(OBJS)\monolib_htmllbox.obj \ $(OBJS)\monolib_debugrpt.obj \ @@ -7008,12 +7016,18 @@ $(OBJS)\monodll_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\monodll_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\monodll_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\monodll_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\monodll_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\monodll_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\monodll_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -9209,12 +9223,18 @@ $(OBJS)\monolib_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\monolib_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\monolib_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\monolib_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\monolib_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\monolib_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\monolib_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -14325,12 +14345,18 @@ $(OBJS)\htmldll_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\htmldll_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\htmldll_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\htmldll_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\htmldll_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\htmldll_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\htmldll_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLDLL_CXXFLAGS) ..\..\src\html\winpars.cpp @@ -14400,12 +14426,18 @@ $(OBJS)\htmllib_m_list.obj: ..\..\src\html\m_list.cpp $(OBJS)\htmllib_m_pre.obj: ..\..\src\html\m_pre.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_pre.cpp +$(OBJS)\htmllib_m_span.obj: ..\..\src\html\m_span.cpp + $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_span.cpp + $(OBJS)\htmllib_m_style.obj: ..\..\src\html\m_style.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_style.cpp $(OBJS)\htmllib_m_tables.obj: ..\..\src\html\m_tables.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\m_tables.cpp +$(OBJS)\htmllib_styleparams.obj: ..\..\src\html\styleparams.cpp + $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\styleparams.cpp + $(OBJS)\htmllib_winpars.obj: ..\..\src\html\winpars.cpp $(CXX) /c /nologo /TP /Fo$@ $(HTMLLIB_CXXFLAGS) ..\..\src\html\winpars.cpp diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat index 81955a3e7b..62ce320d17 100644 --- a/build/msw/makefile.wat +++ b/build/msw/makefile.wat @@ -123,8 +123,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_m_links.obj & $(OBJS)\monodll_m_list.obj & $(OBJS)\monodll_m_pre.obj & + $(OBJS)\monodll_m_span.obj & $(OBJS)\monodll_m_style.obj & $(OBJS)\monodll_m_tables.obj & + $(OBJS)\monodll_styleparams.obj & $(OBJS)\monodll_winpars.obj & $(OBJS)\monodll_htmllbox.obj & $(OBJS)\monodll_debugrpt.obj & @@ -841,8 +843,10 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_m_links.obj & $(OBJS)\monolib_m_list.obj & $(OBJS)\monolib_m_pre.obj & + $(OBJS)\monolib_m_span.obj & $(OBJS)\monolib_m_style.obj & $(OBJS)\monolib_m_tables.obj & + $(OBJS)\monolib_styleparams.obj & $(OBJS)\monolib_winpars.obj & $(OBJS)\monolib_htmllbox.obj & $(OBJS)\monolib_debugrpt.obj & @@ -4227,8 +4231,10 @@ HTMLDLL_OBJECTS = & $(OBJS)\htmldll_m_links.obj & $(OBJS)\htmldll_m_list.obj & $(OBJS)\htmldll_m_pre.obj & + $(OBJS)\htmldll_m_span.obj & $(OBJS)\htmldll_m_style.obj & $(OBJS)\htmldll_m_tables.obj & + $(OBJS)\htmldll_styleparams.obj & $(OBJS)\htmldll_winpars.obj & $(OBJS)\htmldll_htmllbox.obj HTMLLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & @@ -4262,8 +4268,10 @@ HTMLLIB_OBJECTS = & $(OBJS)\htmllib_m_links.obj & $(OBJS)\htmllib_m_list.obj & $(OBJS)\htmllib_m_pre.obj & + $(OBJS)\htmllib_m_span.obj & $(OBJS)\htmllib_m_style.obj & $(OBJS)\htmllib_m_tables.obj & + $(OBJS)\htmllib_styleparams.obj & $(OBJS)\htmllib_winpars.obj & $(OBJS)\htmllib_htmllbox.obj QADLL_CXXFLAGS = -bd $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & @@ -6835,12 +6843,18 @@ $(OBJS)\monodll_m_list.obj : .AUTODEPEND ..\..\src\html\m_list.cpp $(OBJS)\monodll_m_pre.obj : .AUTODEPEND ..\..\src\html\m_pre.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +$(OBJS)\monodll_m_span.obj : .AUTODEPEND ..\..\src\html\m_span.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< + $(OBJS)\monodll_m_style.obj : .AUTODEPEND ..\..\src\html\m_style.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< $(OBJS)\monodll_m_tables.obj : .AUTODEPEND ..\..\src\html\m_tables.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +$(OBJS)\monodll_styleparams.obj : .AUTODEPEND ..\..\src\html\styleparams.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< + $(OBJS)\monodll_winpars.obj : .AUTODEPEND ..\..\src\html\winpars.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -9036,12 +9050,18 @@ $(OBJS)\monolib_m_list.obj : .AUTODEPEND ..\..\src\html\m_list.cpp $(OBJS)\monolib_m_pre.obj : .AUTODEPEND ..\..\src\html\m_pre.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +$(OBJS)\monolib_m_span.obj : .AUTODEPEND ..\..\src\html\m_span.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< + $(OBJS)\monolib_m_style.obj : .AUTODEPEND ..\..\src\html\m_style.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< $(OBJS)\monolib_m_tables.obj : .AUTODEPEND ..\..\src\html\m_tables.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +$(OBJS)\monolib_styleparams.obj : .AUTODEPEND ..\..\src\html\styleparams.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< + $(OBJS)\monolib_winpars.obj : .AUTODEPEND ..\..\src\html\winpars.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -14152,12 +14172,18 @@ $(OBJS)\htmldll_m_list.obj : .AUTODEPEND ..\..\src\html\m_list.cpp $(OBJS)\htmldll_m_pre.obj : .AUTODEPEND ..\..\src\html\m_pre.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< +$(OBJS)\htmldll_m_span.obj : .AUTODEPEND ..\..\src\html\m_span.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< + $(OBJS)\htmldll_m_style.obj : .AUTODEPEND ..\..\src\html\m_style.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< $(OBJS)\htmldll_m_tables.obj : .AUTODEPEND ..\..\src\html\m_tables.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< +$(OBJS)\htmldll_styleparams.obj : .AUTODEPEND ..\..\src\html\styleparams.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< + $(OBJS)\htmldll_winpars.obj : .AUTODEPEND ..\..\src\html\winpars.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLDLL_CXXFLAGS) $< @@ -14227,12 +14253,18 @@ $(OBJS)\htmllib_m_list.obj : .AUTODEPEND ..\..\src\html\m_list.cpp $(OBJS)\htmllib_m_pre.obj : .AUTODEPEND ..\..\src\html\m_pre.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< +$(OBJS)\htmllib_m_span.obj : .AUTODEPEND ..\..\src\html\m_span.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< + $(OBJS)\htmllib_m_style.obj : .AUTODEPEND ..\..\src\html\m_style.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< $(OBJS)\htmllib_m_tables.obj : .AUTODEPEND ..\..\src\html\m_tables.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< +$(OBJS)\htmllib_styleparams.obj : .AUTODEPEND ..\..\src\html\styleparams.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< + $(OBJS)\htmllib_winpars.obj : .AUTODEPEND ..\..\src\html\winpars.cpp $(CXX) -bt=nt -zq -fo=$^@ $(HTMLLIB_CXXFLAGS) $< diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp index 41b9e4405d..cd967f3707 100644 --- a/build/msw/wx_core.dsp +++ b/build/msw/wx_core.dsp @@ -5722,6 +5722,10 @@ SOURCE=..\..\include\wx\html\m_templ.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\html\styleparams.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\html\winpars.h # End Source File # End Group diff --git a/build/msw/wx_html.dsp b/build/msw/wx_html.dsp index 14b834ae2e..bd3585020c 100644 --- a/build/msw/wx_html.dsp +++ b/build/msw/wx_html.dsp @@ -381,6 +381,10 @@ SOURCE=..\..\src\html\m_pre.cpp # End Source File # Begin Source File +SOURCE=..\..\src\html\m_span.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\html\m_style.cpp # End Source File # Begin Source File @@ -389,6 +393,10 @@ SOURCE=..\..\src\html\m_tables.cpp # End Source File # Begin Source File +SOURCE=..\..\src\html\styleparams.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\html\winpars.cpp # End Source File # End Group @@ -694,6 +702,10 @@ SOURCE=..\..\include\wx\html\m_templ.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\html\styleparams.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\html\winpars.h # End Source File # End Group diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index 4382629c53..7140616f8b 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -4897,6 +4897,9 @@ RelativePath="..\..\include\wx\html\m_templ.h"> + + diff --git a/build/msw/wx_vc7_html.vcproj b/build/msw/wx_vc7_html.vcproj index 11e7b4c541..d63f1fcfd8 100644 --- a/build/msw/wx_vc7_html.vcproj +++ b/build/msw/wx_vc7_html.vcproj @@ -670,12 +670,18 @@ RelativePath="..\..\src\html\m_pre.cpp"> + + + + @@ -905,6 +911,9 @@ RelativePath="..\..\include\wx\html\m_templ.h"> + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index 2ab2c1b531..68dd8aa2cf 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -6547,6 +6547,10 @@ > + + diff --git a/build/msw/wx_vc8_html.vcproj b/build/msw/wx_vc8_html.vcproj index 0548808b71..71e523a04f 100644 --- a/build/msw/wx_vc8_html.vcproj +++ b/build/msw/wx_vc8_html.vcproj @@ -926,6 +926,10 @@ > + + @@ -934,6 +938,10 @@ > + + @@ -1225,6 +1233,10 @@ > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 3eb0cddf4c..1530323594 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -6543,6 +6543,10 @@ > + + diff --git a/build/msw/wx_vc9_html.vcproj b/build/msw/wx_vc9_html.vcproj index 560836aff7..d6ade79ba2 100644 --- a/build/msw/wx_vc9_html.vcproj +++ b/build/msw/wx_vc9_html.vcproj @@ -922,6 +922,10 @@ > + + @@ -930,6 +934,10 @@ > + + @@ -1221,6 +1229,10 @@ > + + diff --git a/docs/changes.txt b/docs/changes.txt index 80cd2d646f..cf099e3225 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -472,6 +472,7 @@ All (GUI): - wxGrid: add possibility to prevent resizing of individual rows/columns. - wxGrid: allow changing the horizontal alignment of numeric cells. - wxHTML: add support for table borders width (Laurent Humbertclaude). +- wxHTML: add limited support for span elements styles (Nigel Paton). - Added wxMouseEventsManager. - Building OpenGL library is now enabled by default. - Fixed wxDataViewCtrl::Set{Foreground,Background}Colour(). diff --git a/docs/doxygen/overviews/html.h b/docs/doxygen/overviews/html.h index bb6569a44e..d3f6d48ed4 100644 --- a/docs/doxygen/overviews/html.h +++ b/docs/doxygen/overviews/html.h @@ -543,6 +543,7 @@ P ALIGN=[alignment] PRE SAMP SMALL +SPAN STRIKE STRONG SUB @@ -576,5 +577,12 @@ U UL @endcode +@subsection overview_html_suppstyles_list List of supported styles + +wxHTML doesn't really have CSS support but it does support a few simple styles: +you can use @c "text-align", @c "width", @c "vertical-align" and @c +"background" with all elements and for @c SPAN elements the @c "color", @c +"font-size" and @c "font-weight" are additionally recognized. + */ diff --git a/include/wx/html/forcelnk.h b/include/wx/html/forcelnk.h index 9b00b9a9e5..beee677d75 100644 --- a/include/wx/html/forcelnk.h +++ b/include/wx/html/forcelnk.h @@ -56,6 +56,7 @@ See mod_*.cpp and htmlwin.cpp for example :-) FORCE_LINK(m_hline) \ FORCE_LINK(m_links) \ FORCE_LINK(m_tables) \ + FORCE_LINK(m_span) \ FORCE_LINK(m_style) diff --git a/include/wx/html/htmltag.h b/include/wx/html/htmltag.h index 46f724cc78..79dc4d6988 100644 --- a/include/wx/html/htmltag.h +++ b/include/wx/html/htmltag.h @@ -97,6 +97,10 @@ public: // (or ("WhaT.jpg") if with_quotes == true) wxString GetParam(const wxString& par, bool with_quotes = false) const; + // Return true if the string could be parsed as an HTML colour and false + // otherwise. + static bool ParseAsColour(const wxString& str, wxColour *clr); + // Convenience functions: bool GetParamAsColour(const wxString& par, wxColour *clr) const; bool GetParamAsInt(const wxString& par, int *clr) const; diff --git a/include/wx/html/styleparams.h b/include/wx/html/styleparams.h new file mode 100644 index 0000000000..a9374c0aa7 --- /dev/null +++ b/include/wx/html/styleparams.h @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/html/styleparams.h +// Purpose: wxHtml helper code for extracting style parameters +// Author: Nigel Paton +// RCS-ID: $Id$ +// Copyright: wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_HTML_STYLEPARAMS_H_ +#define _WX_HTML_STYLEPARAMS_H_ + +#include "wx/defs.h" + +#if wxUSE_HTML + +#include "wx/arrstr.h" + +class WXDLLIMPEXP_FWD_HTML wxHtmlTag; + +// This is a private class used by wxHTML to parse "style" attributes of HTML +// elements. Currently both parsing and support for the parsed values is pretty +// trivial. +class WXDLLIMPEXP_HTML wxHtmlStyleParams +{ +public: + // Construct a style parameters object corresponding to the style attribute + // of the given HTML tag. + wxHtmlStyleParams(const wxHtmlTag& tag); + + // Check whether the named parameter is present or not. + bool HasParam(const wxString& par) const + { + return m_names.Index(par, false /* ignore case */) != wxNOT_FOUND; + } + + // Get the value of the named parameter, return empty string if none. + wxString GetParam(const wxString& par) const + { + int index = m_names.Index(par, false); + return index == wxNOT_FOUND ? wxString() : m_values[index]; + } + +private: + // Arrays if names and values of the parameters + wxArrayString + m_names, + m_values; +}; + +#endif // wxUSE_HTML + +#endif // _WX_HTML_STYLEPARAMS_H_ diff --git a/include/wx/html/winpars.h b/include/wx/html/winpars.h index ebc4bc1f6e..f155127cdf 100644 --- a/include/wx/html/winpars.h +++ b/include/wx/html/winpars.h @@ -107,6 +107,8 @@ public: int GetFontSize() const {return m_FontSize;} void SetFontSize(int s); + // Try to map a font size in points to the HTML 1-7 font size range. + void SetFontPointSize(int pt); int GetFontBold() const {return m_FontBold;} void SetFontBold(int x) {m_FontBold = x;} int GetFontItalic() const {return m_FontItalic;} diff --git a/interface/wx/html/htmltag.h b/interface/wx/html/htmltag.h index 3745c06d8b..3305929a19 100644 --- a/interface/wx/html/htmltag.h +++ b/interface/wx/html/htmltag.h @@ -108,6 +108,8 @@ public: Returns @true on success and @false if @a par is not colour specification or if the tag has no such parameter. + + @see ParseAsColour() */ bool GetParamAsColour(const wxString& par, wxColour* clr) const; @@ -148,6 +150,21 @@ public: */ bool HasParam(const wxString& par) const; + /** + Parses the given string as an HTML colour. + + This function recognizes the standard named HTML 4 colours as well as + the usual RGB syntax. + + @since 2.9.1 + + @see wxColour::Set() + + @return @true if the string was successfully parsed and @a clr was + filled with the result or @false otherwise. + */ + static bool ParseAsColour(const wxString& str, wxColour *clr); + //@{ /** This method scans the given parameter. Usage is exactly the same as sscanf's diff --git a/samples/html/test/test.htm b/samples/html/test/test.htm index 2ca1052a2c..64cc34ac20 100644 --- a/samples/html/test/test.htm +++ b/samples/html/test/test.htm @@ -6,6 +6,21 @@ + + + + + + + +
+ Header using styles + + + Next + +
+ click here to go to tables test page

@@ -19,6 +34,7 @@

some wxHTML regression tests +

Agrave = 'à'

diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 4cd0412e95..3f88bf3edc 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -23,6 +23,8 @@ #endif #include "wx/html/htmlpars.h" +#include "wx/html/styleparams.h" + #include "wx/vector.h" #include // for vsscanf @@ -430,6 +432,32 @@ wxHtmlTag::wxHtmlTag(wxHtmlTag *parent, #if WXWIN_COMPATIBILITY_2_8 m_sourceStart = source->begin(); #endif + + // Try to parse any style parameters that can be handled simply by + // converting them to the equivalent HTML 3 attributes: this is a far cry + // from perfect but better than nothing. + static const struct EquivAttr + { + const char *style; + const char *attr; + } equivAttrs[] = + { + { "text-align", "ALIGN" }, + { "width", "WIDTH" }, + { "vertical-align", "VALIGN" }, + { "background", "BGCOLOR" }, + }; + + wxHtmlStyleParams styleParams(*this); + for ( unsigned n = 0; n < WXSIZEOF(equivAttrs); n++ ) + { + const EquivAttr& ea = equivAttrs[n]; + if ( styleParams.HasParam(ea.style) && !HasParam(ea.attr) ) + { + m_ParamNames.Add(ea.attr); + m_ParamValues.Add(styleParams.GetParam(ea.style)); + } + } } wxHtmlTag::~wxHtmlTag() @@ -481,12 +509,11 @@ int wxHtmlTag::ScanParam(const wxString& par, return wxSscanf(parval, format, param); } -bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const +/* static */ +bool wxHtmlTag::ParseAsColour(const wxString& str, wxColour *clr) { wxCHECK_MSG( clr, false, wxT("invalid colour argument") ); - wxString str = GetParam(par); - // handle colours defined in HTML 4.0 first: if (str.length() > 1 && str[0] != wxT('#')) { @@ -522,6 +549,12 @@ bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const return false; } +bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const +{ + const wxString str = GetParam(par); + return !str.empty() && ParseAsColour(str, clr); +} + bool wxHtmlTag::GetParamAsInt(const wxString& par, int *clr) const { if ( !HasParam(par) ) diff --git a/src/html/m_span.cpp b/src/html/m_span.cpp new file mode 100644 index 0000000000..6df438311f --- /dev/null +++ b/src/html/m_span.cpp @@ -0,0 +1,125 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/html/m_span.cpp +// Purpose: wxHtml module for span handling +// Author: Nigel Paton +// RCS-ID: $Id$ +// Copyright: wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_HTML + +#include "wx/html/forcelnk.h" +#include "wx/html/m_templ.h" +#include "wx/fontenum.h" +#include "wx/tokenzr.h" +#include "wx/html/styleparams.h" + +FORCE_LINK_ME(m_span) + + +TAG_HANDLER_BEGIN(SPAN, "SPAN" ) + + TAG_HANDLER_VARS + wxArrayString m_Faces; + + TAG_HANDLER_CONSTR(SPAN) { } + + TAG_HANDLER_PROC(tag) + { + wxColour oldclr = m_WParser->GetActualColor(); + int oldsize = m_WParser->GetFontSize(); + int oldbold = m_WParser->GetFontBold(); + + // Load any style parameters + wxHtmlStyleParams styleParams(tag); + + wxString str; + + str = styleParams.GetParam(wxS("color")); + if ( !str.empty() ) + { + wxColour clr; + if ( wxHtmlTag::ParseAsColour(str, &clr) ) + { + m_WParser->SetActualColor(clr); + m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr)); + } + } + + str = styleParams.GetParam(wxS("font-size")); + if ( !str.empty() ) + { + // Point size + int foundIndex = str.Find(wxS("pt")); + if (foundIndex != wxNOT_FOUND) + { + str.Truncate(foundIndex); + + long sizeValue; + if (str.ToLong(&sizeValue) == true) + { + // Set point size + m_WParser->SetFontPointSize(sizeValue); + m_WParser->GetContainer()->InsertCell( + new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + } + } + // else: check for other ways of specifying size (TODO) + } + + str = styleParams.GetParam(wxS("font-weight")); + if ( !str.empty() ) + { + // Only bold and normal supported just now + if ( str == wxS("bold") ) + { + m_WParser->SetFontBold(true); + m_WParser->GetContainer()->InsertCell( + new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + } + else if ( str == wxS("normal") ) + { + m_WParser->SetFontBold(false); + m_WParser->GetContainer()->InsertCell( + new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + } + } + + ParseInner(tag); + + if (oldbold != m_WParser->GetFontBold()) + { + m_WParser->SetFontBold(oldbold); + m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + } + if (oldsize != m_WParser->GetFontSize()) + { + m_WParser->SetFontSize(oldsize); + m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); + } + if (oldclr != m_WParser->GetActualColor()) + { + m_WParser->SetActualColor(oldclr); + m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); + } + + return true; + } + +TAG_HANDLER_END(SPAN) + + +TAGS_MODULE_BEGIN(Spans) + + TAGS_MODULE_ADD(SPAN) + +TAGS_MODULE_END(Spans) + +#endif // wxUSE_HTML diff --git a/src/html/styleparams.cpp b/src/html/styleparams.cpp new file mode 100644 index 0000000000..54636b8a94 --- /dev/null +++ b/src/html/styleparams.cpp @@ -0,0 +1,78 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/html/styleparams.cpp +// Purpose: wxHtml helper code for extracting style parameters +// Author: Nigel Paton +// RCS-ID: $Id$ +// Copyright: wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" +#include "wx/tokenzr.h" +#include "wx/html/htmltag.h" +#include "wx/html/styleparams.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_HTML + +wxHtmlStyleParams::wxHtmlStyleParams(const wxHtmlTag& tag) +{ + wxString wd = tag.GetParam(wxT("STYLE")); + + // Make sure no whitespace + wd.Trim(true).Trim(false); + if ( wd.empty() ) + return; + + // Check for bracketed entries + // Only support element properties and not pseudo-element or pseudo-classes + if (wd.Find('{') == 0) + { + // Extract string up to end bracket + int endBracket = wd.Find('}'); + if (endBracket != wxNOT_FOUND) + { + // Replace original string with bracketed options + wd = wd.SubString(1, endBracket - 1); + // Make sure no whitespace + wd.Trim(true).Trim(false); + } + else + { + // Syntax problem change to blank string + wd = ""; + } + } + + // Should now have a semi-colon delimited list of options + // Each option is a name and a value separated by a colon + // Split the list into names and values + wxStringTokenizer tkz(wd, wxT(";"), wxTOKEN_STRTOK); + while ( tkz.HasMoreTokens() ) + { + wxString token = tkz.GetNextToken(); + // Split into name and value + int colonIndex = token.Find(':'); + if ((colonIndex != wxNOT_FOUND) && // Not a name value pair + (colonIndex != 0)) // No name + { + wxString tempString; + // Extract and trim name + tempString = token.SubString(0, colonIndex - 1); + tempString.Trim(true).Trim(false); + // Add to name list + m_names.Add(tempString); + + // Extract and trim values + tempString = token.SubString(colonIndex + 1, token.Length() - 1); + tempString.Trim(true).Trim(false); + // Add to values list + m_values.Add(tempString); + } + } +} + +#endif // wxUSE_HTML diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 7f3fc64e50..9deb4545c0 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -559,6 +559,31 @@ void wxHtmlWinParser::SetDC(wxDC *dc, double pixel_scale, double font_scale) m_FontScale = font_scale; } +void wxHtmlWinParser::SetFontPointSize(int pt) +{ + if (pt <= m_FontsSizes[0]) + m_FontSize = 1; + else if (pt >= m_FontsSizes[6]) + m_FontSize = 7; + else + { + // Find the font closest to the given value with a simple linear search + // (binary search is not worth it here for so small number of elements) + for ( int n = 0; n < 6; n++ ) + { + if ( (pt > m_FontsSizes[n]) && (pt <= m_FontsSizes[n + 1]) ) + { + // In this range, find out which entry it is closest to + if ( (pt - m_FontsSizes[n]) < (m_FontsSizes[n + 1] - pt) ) + m_FontSize = n; + else + m_FontSize = n + 1; + + break; + } + } + } +} wxFont* wxHtmlWinParser::CreateCurrentFont() { -- 2.45.2