]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a class for parsing simple markup.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:46:42 +0000 (12:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:46:42 +0000 (12:46 +0000)
This code is not used anywhere yet, this commit only adds the parser for the
markup and the related classes as well as the corresponding unit test.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

23 files changed:
Makefile.in
build/bakefiles/files.bkl
build/msw/makefile.bcc
build/msw/makefile.gcc
build/msw/makefile.vc
build/msw/makefile.wat
build/msw/wx_core.dsp
build/msw/wx_vc7_core.vcproj
build/msw/wx_vc8_core.vcproj
build/msw/wx_vc9_core.vcproj
include/wx/private/markupparser.h [new file with mode: 0644]
src/common/markupparser.cpp [new file with mode: 0644]
tests/Makefile.in
tests/controls/markuptest.cpp [new file with mode: 0644]
tests/makefile.bcc
tests/makefile.gcc
tests/makefile.vc
tests/makefile.wat
tests/test.bkl
tests/test_test_gui.dsp
tests/test_vc7_test_gui.vcproj
tests/test_vc8_test_gui.vcproj
tests/test_vc9_test_gui.vcproj

index 8238041d2b988bcf2777c10c1024118620a6ea03..82cd930de3ac4e9336f461cc156365b27fbad565 100644 (file)
@@ -4553,6 +4553,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS =  \
        monodll_layout.o \
        monodll_lboxcmn.o \
        monodll_listctrlcmn.o \
+       monodll_markupparser.o \
        monodll_matrix.o \
        monodll_menucmn.o \
        monodll_mousemanager.o \
@@ -4767,6 +4768,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS =  \
        monodll_layout.o \
        monodll_lboxcmn.o \
        monodll_listctrlcmn.o \
+       monodll_markupparser.o \
        monodll_matrix.o \
        monodll_menucmn.o \
        monodll_mousemanager.o \
@@ -6467,6 +6469,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 =  \
        monolib_layout.o \
        monolib_lboxcmn.o \
        monolib_listctrlcmn.o \
+       monolib_markupparser.o \
        monolib_matrix.o \
        monolib_menucmn.o \
        monolib_mousemanager.o \
@@ -6681,6 +6684,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 =  \
        monolib_layout.o \
        monolib_lboxcmn.o \
        monolib_listctrlcmn.o \
+       monolib_markupparser.o \
        monolib_matrix.o \
        monolib_menucmn.o \
        monolib_mousemanager.o \
@@ -8565,6 +8569,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 =  \
        coredll_layout.o \
        coredll_lboxcmn.o \
        coredll_listctrlcmn.o \
+       coredll_markupparser.o \
        coredll_matrix.o \
        coredll_menucmn.o \
        coredll_mousemanager.o \
@@ -8779,6 +8784,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 =  \
        coredll_layout.o \
        coredll_lboxcmn.o \
        coredll_listctrlcmn.o \
+       coredll_markupparser.o \
        coredll_matrix.o \
        coredll_menucmn.o \
        coredll_mousemanager.o \
@@ -10141,6 +10147,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 =  \
        corelib_layout.o \
        corelib_lboxcmn.o \
        corelib_listctrlcmn.o \
+       corelib_markupparser.o \
        corelib_matrix.o \
        corelib_menucmn.o \
        corelib_mousemanager.o \
@@ -10355,6 +10362,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 =  \
        corelib_layout.o \
        corelib_lboxcmn.o \
        corelib_listctrlcmn.o \
+       corelib_markupparser.o \
        corelib_matrix.o \
        corelib_menucmn.o \
        corelib_mousemanager.o \
@@ -19956,6 +19964,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@monodll_listctrlcmn.o: $(srcdir)/src/common/listctrlcmn.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/listctrlcmn.cpp
 
+@COND_USE_GUI_1@monodll_markupparser.o: $(srcdir)/src/common/markupparser.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/markupparser.cpp
+
 @COND_USE_GUI_1@monodll_matrix.o: $(srcdir)/src/common/matrix.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/matrix.cpp
 
@@ -25239,6 +25250,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@monolib_listctrlcmn.o: $(srcdir)/src/common/listctrlcmn.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/listctrlcmn.cpp
 
+@COND_USE_GUI_1@monolib_markupparser.o: $(srcdir)/src/common/markupparser.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/markupparser.cpp
+
 @COND_USE_GUI_1@monolib_matrix.o: $(srcdir)/src/common/matrix.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/matrix.cpp
 
@@ -30702,6 +30716,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@coredll_listctrlcmn.o: $(srcdir)/src/common/listctrlcmn.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/listctrlcmn.cpp
 
+@COND_USE_GUI_1@coredll_markupparser.o: $(srcdir)/src/common/markupparser.cpp $(COREDLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/markupparser.cpp
+
 @COND_USE_GUI_1@coredll_matrix.o: $(srcdir)/src/common/matrix.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/matrix.cpp
 
@@ -34668,6 +34685,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@corelib_listctrlcmn.o: $(srcdir)/src/common/listctrlcmn.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/listctrlcmn.cpp
 
+@COND_USE_GUI_1@corelib_markupparser.o: $(srcdir)/src/common/markupparser.cpp $(CORELIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/markupparser.cpp
+
 @COND_USE_GUI_1@corelib_matrix.o: $(srcdir)/src/common/matrix.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/matrix.cpp
 
index ef758cb73ebd976ff650cb8cffd1def3b21235a4..041a497f3b1b067f7121eec99f5a0a3a968594f7 100644 (file)
@@ -726,6 +726,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/common/layout.cpp
     src/common/lboxcmn.cpp
     src/common/listctrlcmn.cpp
+    src/common/markupparser.cpp
     src/common/matrix.cpp
     src/common/menucmn.cpp
     src/common/mousemanager.cpp
index d6cc10a67f3bc86c61282c8e0fd1a01725011121..5b4b295f0c5c2970e6c20d1892fd9698e68eae07 100644 (file)
@@ -1865,6 +1865,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.obj \\r
        $(OBJS)\monodll_lboxcmn.obj \\r
        $(OBJS)\monodll_listctrlcmn.obj \\r
+       $(OBJS)\monodll_markupparser.obj \
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
        $(OBJS)\monodll_mousemanager.obj \\r
@@ -2128,6 +2129,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.obj \\r
        $(OBJS)\monodll_lboxcmn.obj \\r
        $(OBJS)\monodll_listctrlcmn.obj \\r
+       $(OBJS)\monodll_markupparser.obj \
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
        $(OBJS)\monodll_mousemanager.obj \\r
@@ -2622,6 +2624,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.obj \\r
        $(OBJS)\monolib_lboxcmn.obj \\r
        $(OBJS)\monolib_listctrlcmn.obj \\r
+       $(OBJS)\monolib_markupparser.obj \
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
        $(OBJS)\monolib_mousemanager.obj \\r
@@ -2885,6 +2888,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.obj \\r
        $(OBJS)\monolib_lboxcmn.obj \\r
        $(OBJS)\monolib_listctrlcmn.obj \\r
+       $(OBJS)\monolib_markupparser.obj \
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
        $(OBJS)\monolib_mousemanager.obj \\r
@@ -3267,6 +3271,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.obj \\r
        $(OBJS)\coredll_lboxcmn.obj \\r
        $(OBJS)\coredll_listctrlcmn.obj \\r
+       $(OBJS)\coredll_markupparser.obj \
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
        $(OBJS)\coredll_mousemanager.obj \\r
@@ -3530,6 +3535,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.obj \\r
        $(OBJS)\coredll_lboxcmn.obj \\r
        $(OBJS)\coredll_listctrlcmn.obj \\r
+       $(OBJS)\coredll_markupparser.obj \
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
        $(OBJS)\coredll_mousemanager.obj \\r
@@ -3801,6 +3807,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.obj \\r
        $(OBJS)\corelib_lboxcmn.obj \\r
        $(OBJS)\corelib_listctrlcmn.obj \\r
+       $(OBJS)\corelib_markupparser.obj \
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
        $(OBJS)\corelib_mousemanager.obj \\r
@@ -4064,6 +4071,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.obj \\r
        $(OBJS)\corelib_lboxcmn.obj \\r
        $(OBJS)\corelib_listctrlcmn.obj \\r
+       $(OBJS)\corelib_markupparser.obj \
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
        $(OBJS)\corelib_mousemanager.obj \\r
@@ -7630,6 +7638,11 @@ $(OBJS)\monodll_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -9962,6 +9975,11 @@ $(OBJS)\monolib_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -12288,6 +12306,11 @@ $(OBJS)\coredll_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -13675,6 +13698,11 @@ $(OBJS)\corelib_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
index 7e7bca6276acc8f48e298527e36cded8eb56ebaa..789e3105d722aa8ad5cb7c059130cb661a0ef112 100644 (file)
@@ -1876,6 +1876,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.o \\r
        $(OBJS)\monodll_lboxcmn.o \\r
        $(OBJS)\monodll_listctrlcmn.o \\r
+       $(OBJS)\monodll_markupparser.o \
        $(OBJS)\monodll_matrix.o \\r
        $(OBJS)\monodll_menucmn.o \\r
        $(OBJS)\monodll_mousemanager.o \\r
@@ -2141,6 +2142,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.o \\r
        $(OBJS)\monodll_lboxcmn.o \\r
        $(OBJS)\monodll_listctrlcmn.o \\r
+       $(OBJS)\monodll_markupparser.o \
        $(OBJS)\monodll_matrix.o \\r
        $(OBJS)\monodll_menucmn.o \\r
        $(OBJS)\monodll_mousemanager.o \\r
@@ -2639,6 +2641,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.o \\r
        $(OBJS)\monolib_lboxcmn.o \\r
        $(OBJS)\monolib_listctrlcmn.o \\r
+       $(OBJS)\monolib_markupparser.o \
        $(OBJS)\monolib_matrix.o \\r
        $(OBJS)\monolib_menucmn.o \\r
        $(OBJS)\monolib_mousemanager.o \\r
@@ -2904,6 +2907,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.o \\r
        $(OBJS)\monolib_lboxcmn.o \\r
        $(OBJS)\monolib_listctrlcmn.o \\r
+       $(OBJS)\monolib_markupparser.o \
        $(OBJS)\monolib_matrix.o \\r
        $(OBJS)\monolib_menucmn.o \\r
        $(OBJS)\monolib_mousemanager.o \\r
@@ -3300,6 +3304,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.o \\r
        $(OBJS)\coredll_lboxcmn.o \\r
        $(OBJS)\coredll_listctrlcmn.o \\r
+       $(OBJS)\coredll_markupparser.o \
        $(OBJS)\coredll_matrix.o \\r
        $(OBJS)\coredll_menucmn.o \\r
        $(OBJS)\coredll_mousemanager.o \\r
@@ -3565,6 +3570,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.o \\r
        $(OBJS)\coredll_lboxcmn.o \\r
        $(OBJS)\coredll_listctrlcmn.o \\r
+       $(OBJS)\coredll_markupparser.o \
        $(OBJS)\coredll_matrix.o \\r
        $(OBJS)\coredll_menucmn.o \\r
        $(OBJS)\coredll_mousemanager.o \\r
@@ -3842,6 +3848,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.o \\r
        $(OBJS)\corelib_lboxcmn.o \\r
        $(OBJS)\corelib_listctrlcmn.o \\r
+       $(OBJS)\corelib_markupparser.o \
        $(OBJS)\corelib_matrix.o \\r
        $(OBJS)\corelib_menucmn.o \\r
        $(OBJS)\corelib_mousemanager.o \\r
@@ -4107,6 +4114,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.o \\r
        $(OBJS)\corelib_lboxcmn.o \\r
        $(OBJS)\corelib_listctrlcmn.o \\r
+       $(OBJS)\corelib_markupparser.o \
        $(OBJS)\corelib_matrix.o \\r
        $(OBJS)\corelib_menucmn.o \\r
        $(OBJS)\corelib_mousemanager.o \\r
@@ -7780,6 +7788,11 @@ $(OBJS)\monodll_listctrlcmn.o: ../../src/common/listctrlcmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monodll_markupparser.o: ../../src/common/markupparser.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monodll_matrix.o: ../../src/common/matrix.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -10112,6 +10125,11 @@ $(OBJS)\monolib_listctrlcmn.o: ../../src/common/listctrlcmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monolib_markupparser.o: ../../src/common/markupparser.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monolib_matrix.o: ../../src/common/matrix.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -12438,6 +12456,11 @@ $(OBJS)\coredll_listctrlcmn.o: ../../src/common/listctrlcmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\coredll_markupparser.o: ../../src/common/markupparser.cpp
+       $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\coredll_matrix.o: ../../src/common/matrix.cpp\r
        $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -13825,6 +13848,11 @@ $(OBJS)\corelib_listctrlcmn.o: ../../src/common/listctrlcmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\corelib_markupparser.o: ../../src/common/markupparser.cpp
+       $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\corelib_matrix.o: ../../src/common/matrix.cpp\r
        $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
index 41467604fd6757a044166df0f906bde05a49d81f..888543651a111f66a4789708331c093b3898deb6 100644 (file)
@@ -2073,6 +2073,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.obj \\r
        $(OBJS)\monodll_lboxcmn.obj \\r
        $(OBJS)\monodll_listctrlcmn.obj \\r
+       $(OBJS)\monodll_markupparser.obj \
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
        $(OBJS)\monodll_mousemanager.obj \\r
@@ -2336,6 +2337,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_layout.obj \\r
        $(OBJS)\monodll_lboxcmn.obj \\r
        $(OBJS)\monodll_listctrlcmn.obj \\r
+       $(OBJS)\monodll_markupparser.obj \
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
        $(OBJS)\monodll_mousemanager.obj \\r
@@ -2836,6 +2838,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.obj \\r
        $(OBJS)\monolib_lboxcmn.obj \\r
        $(OBJS)\monolib_listctrlcmn.obj \\r
+       $(OBJS)\monolib_markupparser.obj \
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
        $(OBJS)\monolib_mousemanager.obj \\r
@@ -3099,6 +3102,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_layout.obj \\r
        $(OBJS)\monolib_lboxcmn.obj \\r
        $(OBJS)\monolib_listctrlcmn.obj \\r
+       $(OBJS)\monolib_markupparser.obj \
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
        $(OBJS)\monolib_mousemanager.obj \\r
@@ -3547,6 +3551,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.obj \\r
        $(OBJS)\coredll_lboxcmn.obj \\r
        $(OBJS)\coredll_listctrlcmn.obj \\r
+       $(OBJS)\coredll_markupparser.obj \
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
        $(OBJS)\coredll_mousemanager.obj \\r
@@ -3810,6 +3815,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_layout.obj \\r
        $(OBJS)\coredll_lboxcmn.obj \\r
        $(OBJS)\coredll_listctrlcmn.obj \\r
+       $(OBJS)\coredll_markupparser.obj \
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
        $(OBJS)\coredll_mousemanager.obj \\r
@@ -4087,6 +4093,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.obj \\r
        $(OBJS)\corelib_lboxcmn.obj \\r
        $(OBJS)\corelib_listctrlcmn.obj \\r
+       $(OBJS)\corelib_markupparser.obj \
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
        $(OBJS)\corelib_mousemanager.obj \\r
@@ -4350,6 +4357,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_layout.obj \\r
        $(OBJS)\corelib_lboxcmn.obj \\r
        $(OBJS)\corelib_listctrlcmn.obj \\r
+       $(OBJS)\corelib_markupparser.obj \
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
        $(OBJS)\corelib_mousemanager.obj \\r
@@ -8210,6 +8218,11 @@ $(OBJS)\monodll_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -10542,6 +10555,11 @@ $(OBJS)\monolib_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -12868,6 +12886,11 @@ $(OBJS)\coredll_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
@@ -14255,6 +14278,11 @@ $(OBJS)\corelib_listctrlcmn.obj: ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_markupparser.obj: ..\..\src\common\markupparser.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\markupparser.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_matrix.obj: ..\..\src\common\matrix.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\matrix.cpp\r
 !endif\r
index c3da4d7c5847158d1e6e08e9078406fb7c945401..0f9c1c8c8a8be9b188db13eec782db40ac8c4265 100644 (file)
@@ -427,6 +427,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_layout.obj &\r
        $(OBJS)\monodll_lboxcmn.obj &\r
        $(OBJS)\monodll_listctrlcmn.obj &\r
+       $(OBJS)\monodll_markupparser.obj &
        $(OBJS)\monodll_matrix.obj &\r
        $(OBJS)\monodll_menucmn.obj &\r
        $(OBJS)\monodll_mousemanager.obj &\r
@@ -692,6 +693,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_layout.obj &\r
        $(OBJS)\monodll_lboxcmn.obj &\r
        $(OBJS)\monodll_listctrlcmn.obj &\r
+       $(OBJS)\monodll_markupparser.obj &
        $(OBJS)\monodll_matrix.obj &\r
        $(OBJS)\monodll_menucmn.obj &\r
        $(OBJS)\monodll_mousemanager.obj &\r
@@ -1195,6 +1197,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_layout.obj &\r
        $(OBJS)\monolib_lboxcmn.obj &\r
        $(OBJS)\monolib_listctrlcmn.obj &\r
+       $(OBJS)\monolib_markupparser.obj &
        $(OBJS)\monolib_matrix.obj &\r
        $(OBJS)\monolib_menucmn.obj &\r
        $(OBJS)\monolib_mousemanager.obj &\r
@@ -1460,6 +1463,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_layout.obj &\r
        $(OBJS)\monolib_lboxcmn.obj &\r
        $(OBJS)\monolib_listctrlcmn.obj &\r
+       $(OBJS)\monolib_markupparser.obj &
        $(OBJS)\monolib_matrix.obj &\r
        $(OBJS)\monolib_menucmn.obj &\r
        $(OBJS)\monolib_mousemanager.obj &\r
@@ -1867,6 +1871,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_layout.obj &\r
        $(OBJS)\coredll_lboxcmn.obj &\r
        $(OBJS)\coredll_listctrlcmn.obj &\r
+       $(OBJS)\coredll_markupparser.obj &
        $(OBJS)\coredll_matrix.obj &\r
        $(OBJS)\coredll_menucmn.obj &\r
        $(OBJS)\coredll_mousemanager.obj &\r
@@ -2132,6 +2137,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_layout.obj &\r
        $(OBJS)\coredll_lboxcmn.obj &\r
        $(OBJS)\coredll_listctrlcmn.obj &\r
+       $(OBJS)\coredll_markupparser.obj &
        $(OBJS)\coredll_matrix.obj &\r
        $(OBJS)\coredll_menucmn.obj &\r
        $(OBJS)\coredll_mousemanager.obj &\r
@@ -2411,6 +2417,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_layout.obj &\r
        $(OBJS)\corelib_lboxcmn.obj &\r
        $(OBJS)\corelib_listctrlcmn.obj &\r
+       $(OBJS)\corelib_markupparser.obj &
        $(OBJS)\corelib_matrix.obj &\r
        $(OBJS)\corelib_menucmn.obj &\r
        $(OBJS)\corelib_mousemanager.obj &\r
@@ -2676,6 +2683,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_layout.obj &\r
        $(OBJS)\corelib_lboxcmn.obj &\r
        $(OBJS)\corelib_listctrlcmn.obj &\r
+       $(OBJS)\corelib_markupparser.obj &
        $(OBJS)\corelib_matrix.obj &\r
        $(OBJS)\corelib_menucmn.obj &\r
        $(OBJS)\corelib_mousemanager.obj &\r
@@ -8039,6 +8047,11 @@ $(OBJS)\monodll_listctrlcmn.obj :  .AUTODEPEND ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monodll_markupparser.obj :  .AUTODEPEND ..\..\src\common\markupparser.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monodll_matrix.obj :  .AUTODEPEND ..\..\src\common\matrix.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 !endif\r
@@ -10371,6 +10384,11 @@ $(OBJS)\monolib_listctrlcmn.obj :  .AUTODEPEND ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monolib_markupparser.obj :  .AUTODEPEND ..\..\src\common\markupparser.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monolib_matrix.obj :  .AUTODEPEND ..\..\src\common\matrix.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 !endif\r
@@ -12697,6 +12715,11 @@ $(OBJS)\coredll_listctrlcmn.obj :  .AUTODEPEND ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\coredll_markupparser.obj :  .AUTODEPEND ..\..\src\common\markupparser.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\coredll_matrix.obj :  .AUTODEPEND ..\..\src\common\matrix.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
 !endif\r
@@ -14084,6 +14107,11 @@ $(OBJS)\corelib_listctrlcmn.obj :  .AUTODEPEND ..\..\src\common\listctrlcmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\corelib_markupparser.obj :  .AUTODEPEND ..\..\src\common\markupparser.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\corelib_matrix.obj :  .AUTODEPEND ..\..\src\common\matrix.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
 !endif\r
index c83236a012d57f6ba37c9c4cde4830f634a542a1..ed7f043b32f5df1f25fa39c6d759456c9cfb769b 100644 (file)
@@ -566,6 +566,10 @@ SOURCE=..\..\src\common\listctrlcmn.cpp
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\src\common\markupparser.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\common\matrix.cpp\r
 # End Source File\r
 # Begin Source File\r
index 33f28f7fe6ceeea6d2fb5576797ae90f96a3412e..cfed66795e9a53157dac39e1262f484b4dc314e3 100644 (file)
                                RelativePath="..\..\src\common\listctrlcmn.cpp">\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\src\common\markupparser.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\src\common\matrix.cpp">\r
                        </File>\r
                        <File\r
index 7de9ab20791806968fe95b51300fd805a0500db5..bd519fbde06b548fd13c15fdc62885a75f3a3ae8 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\src\common\markupparser.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\src\common\matrix.cpp"\r
                                >\r
                        </File>\r
index 709266b643bd080891673e092eaf29fa831009df..1510b5a7e70ac70cb42dfc885f9a151d5b023f22 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\src\common\markupparser.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\src\common\matrix.cpp"\r
                                >\r
                        </File>\r
diff --git a/include/wx/private/markupparser.h b/include/wx/private/markupparser.h
new file mode 100644 (file)
index 0000000..e0eb0a8
--- /dev/null
@@ -0,0 +1,167 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/private/markupparser.h
+// Purpose:     Classes for parsing simple markup.
+// Author:      Vadim Zeitlin
+// Created:     2011-02-16
+// RCS-ID:      $Id: $
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_PRIVATE_MARKUPPARSER_H_
+#define _WX_PRIVATE_MARKUPPARSER_H_
+
+#include "wx/string.h"
+
+// ----------------------------------------------------------------------------
+// wxMarkupSpanAttributes: information about attributes for a markup span.
+// ----------------------------------------------------------------------------
+
+struct wxMarkupSpanAttributes
+{
+    enum OptionalBool
+    {
+        Unspecified = -1,
+        No,
+        Yes
+    };
+
+    wxMarkupSpanAttributes()
+    {
+        m_sizeKind = Size_Unspecified;
+
+        m_isBold =
+        m_isItalic =
+        m_isUnderlined =
+        m_isStrikethrough = Unspecified;
+    }
+
+    // If a string is empty, it means that the corresponding attribute is not
+    // set.
+    wxString m_fgCol,
+             m_bgCol,
+             m_fontFace;
+
+    // There are many ways of specifying the size. First of all, the size may
+    // be relative in which case m_fontSize is either -1 or +1 meaning that
+    // it's one step smaller or larger than the current font. Second, it may be
+    // absolute in which case m_fontSize contains either the size in 1024th of
+    // a point (Pango convention) or its values are in [-3, 3] interval and map
+    // to [xx-small, xx-large] CSS-like font size specification. And finally it
+    // may be not specified at all, of course, in which case the value of
+    // m_fontSize doesn't matter and it shouldn't be used.
+    enum
+    {
+        Size_Unspecified,
+        Size_Relative,
+        Size_Symbolic,
+        Size_PointParts
+    } m_sizeKind;
+    int m_fontSize;
+
+    // If the value is Unspecified, the attribute wasn't given.
+    OptionalBool m_isBold,
+                 m_isItalic,
+                 m_isUnderlined,
+                 m_isStrikethrough;
+};
+
+// ----------------------------------------------------------------------------
+// wxMarkupParserOutput: gathers the results of parsing markup.
+// ----------------------------------------------------------------------------
+
+class wxMarkupParserOutput
+{
+public:
+    wxMarkupParserOutput() { }
+
+    // Virtual functions called by wxMarkupParser while parsing the markup.
+
+    // Called for a run of normal text.
+    virtual void OnText(const wxString& text) = 0;
+
+    // These functions correspond to the simple tags without parameters.
+    virtual void OnBoldStart() = 0;
+    virtual void OnBoldEnd() = 0;
+
+    virtual void OnItalicStart() = 0;
+    virtual void OnItalicEnd() = 0;
+
+    virtual void OnUnderlinedStart() = 0;
+    virtual void OnUnderlinedEnd() = 0;
+
+    virtual void OnStrikethroughStart() = 0;
+    virtual void OnStrikethroughEnd() = 0;
+
+    virtual void OnBigStart() = 0;
+    virtual void OnBigEnd() = 0;
+
+    virtual void OnSmallStart() = 0;
+    virtual void OnSmallEnd() = 0;
+
+    virtual void OnTeletypeStart() = 0;
+    virtual void OnTeletypeEnd() = 0;
+
+    // The generic span start and end functions.
+    virtual void OnSpanStart(const wxMarkupSpanAttributes& attrs) = 0;
+    virtual void OnSpanEnd(const wxMarkupSpanAttributes& attrs) = 0;
+
+private:
+    wxDECLARE_NO_COPY_CLASS(wxMarkupParserOutput);
+};
+
+// ----------------------------------------------------------------------------
+// wxMarkupParser: parses the given markup text into wxMarkupParserOutput.
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxMarkupParser
+{
+public:
+    // Initialize the parser with the object that will receive parsing results.
+    // This object lifetime must be greater than ours.
+    explicit wxMarkupParser(wxMarkupParserOutput& output)
+        : m_output(output)
+    {
+    }
+
+    // Parse the entire string and call wxMarkupParserOutput methods.
+    //
+    // Return true if the string was successfully parsed or false if it failed
+    // (presumably because of syntax errors in the markup).
+    bool Parse(const wxString& text);
+
+    // Quote a normal string, not meant to be interpreted as markup, so that it
+    // produces the same string when parsed as markup. This means, for example,
+    // replacing '<' in the input string with "&lt;" to prevent them from being
+    // interpreted as tag opening characters.
+    static wxString Quote(const wxString& text);
+
+private:
+    // Simple struct combining the name of a tag and its attributes.
+    struct TagAndAttrs
+    {
+        TagAndAttrs(const wxString& name_) : name(name_) { }
+
+        wxString name;
+        wxMarkupSpanAttributes attrs;
+    };
+
+    // Call the wxMarkupParserOutput method corresponding to the given tag.
+    //
+    // Return false if the tag doesn't match any of the known ones.
+    bool OutputTag(const TagAndAttrs& tagAndAttrs, bool start);
+
+    // Parse the attributes and fill the provided TagAndAttrs object with the
+    // information about them. Does nothing if attrs string is empty.
+    //
+    // Returns empty string on success of a [fragment of an] error message if
+    // we failed to parse the attributes.
+    wxString ParseAttrs(wxString attrs, TagAndAttrs& tagAndAttrs);
+
+
+    wxMarkupParserOutput& m_output;
+
+    wxDECLARE_NO_COPY_CLASS(wxMarkupParser);
+};
+
+#endif // _WX_PRIVATE_MARKUPPARSER_H_
diff --git a/src/common/markupparser.cpp b/src/common/markupparser.cpp
new file mode 100644 (file)
index 0000000..535e62b
--- /dev/null
@@ -0,0 +1,427 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/common/markupparser.cpp
+// Purpose:     Implementation of wxMarkupParser.
+// Author:      Vadim Zeitlin
+// Created:     2011-02-16
+// RCS-ID:      $Id: $
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#endif // WX_PRECOMP
+
+#include "wx/private/markupparser.h"
+
+#include "wx/stack.h"
+
+namespace
+{
+
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// Array containing the predefined XML 1.0 entities.
+const struct XMLEntity
+{
+    const char *name;
+    int len;            // == strlen(name)
+    char value;
+} xmlEntities[] =
+{
+    { "lt",     2,  '<' },
+    { "gt",     2,  '>' },
+    { "amp",    3,  '&' },
+    { "apos",   4,  '\''},
+    { "quot",   4,  '"' },
+};
+
+// ----------------------------------------------------------------------------
+// helper functions
+// ----------------------------------------------------------------------------
+
+wxString
+ExtractUntil(char ch, wxString::const_iterator& it, wxString::const_iterator end)
+{
+    wxString str;
+    for ( ; it != end; ++it )
+    {
+        if ( *it == ch )
+            return str;
+
+        str += *it;
+    }
+
+    // Return empty string to indicate that we didn't find ch at all.
+    return wxString();
+}
+
+} // anonymous namespace
+
+// ============================================================================
+// wxMarkupParser implementation
+// ============================================================================
+
+wxString
+wxMarkupParser::ParseAttrs(wxString attrs, TagAndAttrs& tagAndAttrs)
+{
+    if ( tagAndAttrs.name.CmpNoCase("span") != 0 && !attrs.empty() )
+    {
+        return wxString::Format("tag \"%s\" can't have attributes",
+                                tagAndAttrs.name);
+    }
+
+    // TODO: Parse more attributes described at
+    //       http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html
+    //       and at least ignore them gracefully instead of giving errors (but
+    //       quite a few of them could be supported as well, notable font_desc).
+
+    wxMarkupSpanAttributes& spanAttrs = tagAndAttrs.attrs;
+
+    while ( !attrs.empty() )
+    {
+        wxString rest;
+        const wxString attr = attrs.BeforeFirst(' ', &rest);
+        attrs = rest;
+
+        // The "original" versions are used for error messages only.
+        wxString valueOrig;
+        const wxString nameOrig = attr.BeforeFirst('=', &valueOrig);
+
+        const wxString name = nameOrig.Lower();
+        wxString value = valueOrig.Lower();
+
+        // All attributes values must be quoted.
+        if ( value.length() < 2 ||
+                (value[0] != value.Last()) ||
+                    (value[0] != '"' && value[0] != '\'') )
+        {
+            return wxString::Format("bad quoting for value of \"%s\"",
+                                    nameOrig);
+        }
+
+        value.assign(value, 1, value.length() - 2);
+
+        if ( name == "foreground" || name == "fgcolor" || name == "color" )
+        {
+            spanAttrs.m_fgCol = value;
+        }
+        else if ( name == "background" || name == "bgcolor" )
+        {
+            spanAttrs.m_bgCol = value;
+        }
+        else if ( name == "font_family" || name == "face" )
+        {
+            spanAttrs.m_fontFace = value;
+        }
+        else if ( name == "font_weight" || name == "weight" )
+        {
+            unsigned long weight;
+
+            if ( value == "ultralight" || value == "light" || value == "normal" )
+                spanAttrs.m_isBold = wxMarkupSpanAttributes::No;
+            else if ( value == "bold" || value == "ultrabold" || value == "heavy" )
+                spanAttrs.m_isBold = wxMarkupSpanAttributes::Yes;
+            else if ( value.ToULong(&weight) )
+                spanAttrs.m_isBold = weight >= 600 ? wxMarkupSpanAttributes::Yes
+                                                   : wxMarkupSpanAttributes::No;
+            else
+                return wxString::Format("invalid font weight \"%s\"", valueOrig);
+        }
+        else if ( name == "font_style" || name == "style" )
+        {
+            if ( value == "normal" )
+                spanAttrs.m_isItalic = wxMarkupSpanAttributes::No;
+            else if ( value == "oblique" || value == "italic" )
+                spanAttrs.m_isItalic = wxMarkupSpanAttributes::Yes;
+            else
+                return wxString::Format("invalid font style \"%s\"", valueOrig);
+        }
+        else if ( name == "size" )
+        {
+            unsigned long size;
+            if ( value.ToULong(&size) )
+            {
+                spanAttrs.m_sizeKind = wxMarkupSpanAttributes::Size_PointParts;
+                spanAttrs.m_fontSize = size;
+            }
+            else if ( value == "smaller" || value == "larger" )
+            {
+                spanAttrs.m_sizeKind = wxMarkupSpanAttributes::Size_Relative;
+                spanAttrs.m_fontSize = value == "smaller" ? -1 : +1;
+            }
+            else // Must be a CSS-like size specification
+            {
+                int cssSize = 1;
+                wxString rest;
+                if ( value.StartsWith("xx-", &rest) )
+                    cssSize = 3;
+                else if ( value.StartsWith("x-", &rest) )
+                    cssSize = 2;
+                else if ( value == "medium" )
+                    cssSize = 0;
+                else
+                    rest = value;
+
+                if ( cssSize != 0 )
+                {
+                    if ( rest == "small" )
+                        cssSize = -cssSize;
+                    else if ( rest != "large" )
+                        return wxString::Format("invalid font size \"%s\"",
+                                                valueOrig);
+                }
+
+                spanAttrs.m_sizeKind = wxMarkupSpanAttributes::Size_Symbolic;
+                spanAttrs.m_fontSize = cssSize;
+            }
+        }
+    }
+
+    return wxString();
+}
+
+bool wxMarkupParser::OutputTag(const TagAndAttrs& tagAndAttrs, bool start)
+{
+    if ( tagAndAttrs.name.CmpNoCase("span") == 0 )
+    {
+        if ( start )
+            m_output.OnSpanStart(tagAndAttrs.attrs);
+        else
+            m_output.OnSpanEnd(tagAndAttrs.attrs);
+
+        return true;
+    }
+    else // non-span tag
+    {
+        static const struct TagHandler
+        {
+            const char *name;
+            void (wxMarkupParserOutput::*startFunc)();
+            void (wxMarkupParserOutput::*endFunc)();
+        } tagHandlers[] =
+        {
+            { "b", &wxMarkupParserOutput::OnBoldStart,
+                   &wxMarkupParserOutput::OnBoldEnd },
+            { "i", &wxMarkupParserOutput::OnItalicStart,
+                   &wxMarkupParserOutput::OnItalicEnd },
+            { "u", &wxMarkupParserOutput::OnUnderlinedStart,
+                   &wxMarkupParserOutput::OnUnderlinedEnd },
+            { "s", &wxMarkupParserOutput::OnStrikethroughStart,
+                   &wxMarkupParserOutput::OnStrikethroughEnd },
+            { "big", &wxMarkupParserOutput::OnBigStart,
+                     &wxMarkupParserOutput::OnBigEnd },
+            { "small", &wxMarkupParserOutput::OnSmallStart,
+                       &wxMarkupParserOutput::OnSmallEnd },
+            { "tt", &wxMarkupParserOutput::OnTeletypeStart,
+                    &wxMarkupParserOutput::OnTeletypeEnd },
+        };
+
+        for ( unsigned n = 0; n < WXSIZEOF(tagHandlers); n++ )
+        {
+            const TagHandler& h = tagHandlers[n];
+
+            if ( tagAndAttrs.name.CmpNoCase(h.name) == 0 )
+            {
+                if ( start )
+                    (m_output.*(h.startFunc))();
+                else
+                    (m_output.*(h.endFunc))();
+
+                return true;
+            }
+        }
+    }
+
+    // Unknown tag name.
+    return false;
+}
+
+bool wxMarkupParser::Parse(const wxString& text)
+{
+    // The stack containing the names and corresponding attributes (which are
+    // actually only used for <span> tags) of all of the currently opened tag
+    // or none if we're not inside any tag.
+    wxStack<TagAndAttrs> tags;
+
+    // Current run of text.
+    wxString current;
+
+    const wxString::const_iterator end = text.end();
+    for ( wxString::const_iterator it = text.begin(); it != end; ++it )
+    {
+        switch ( (*it).GetValue() )
+        {
+            case '<':
+                {
+                    // Flush the text preceding the tag, if any.
+                    if ( !current.empty() )
+                    {
+                        m_output.OnText(current);
+                        current.clear();
+                    }
+
+                    // Remember the tag starting position for the error
+                    // messages.
+                    const size_t pos = it - text.begin();
+
+                    bool start = true;
+                    if ( ++it != end && *it == '/' )
+                    {
+                        start = false;
+                        ++it;
+                    }
+
+                    const wxString tag = ExtractUntil('>', it, end);
+                    if ( tag.empty() )
+                    {
+                        wxLogDebug("%s at %lu.",
+                                   it == end ? "Unclosed tag starting"
+                                             : "Empty tag",
+                                   pos);
+                        return false;
+                    }
+
+                    if ( start )
+                    {
+                        wxString attrs;
+                        const wxString name = tag.BeforeFirst(' ', &attrs);
+
+                        TagAndAttrs tagAndAttrs(name);
+                        const wxString err = ParseAttrs(attrs, tagAndAttrs);
+                        if ( !err.empty() )
+                        {
+                            wxLogDebug("Bad attributes for \"%s\" "
+                                       "at %lu: %s.",
+                                       name, pos, err);
+                            return false;
+                        }
+
+                        tags.push(tagAndAttrs);
+                    }
+                    else // end tag
+                    {
+                        if ( tags.empty() || tags.top().name != tag )
+                        {
+                            wxLogDebug("Unmatched closing tag \"%s\" at %lu.",
+                                       tag, pos);
+                            return false;
+                        }
+                    }
+
+                    if ( !OutputTag(tags.top(), start) )
+                    {
+                        wxLogDebug("Unknown tag at %lu.", pos);
+                        return false;
+                    }
+
+                    if ( !start )
+                        tags.pop();
+                }
+                break;
+
+            case '>':
+                wxLogDebug("'>' should be escaped as \"&gt\"; at %lu.",
+                           it - text.begin());
+                break;
+
+            case '&':
+                // Processing is somewhat complicated: we need to recognize at
+                // least the "&lt;" entity to allow escaping left square
+                // brackets in the markup and, in fact, we recognize all of the
+                // standard XML entities for consistency with Pango markup
+                // parsing.
+                //
+                // However we also allow '&' to appear unescaped, i.e. directly
+                // and not as "&amp;" when it is used to introduce the mnemonic
+                // for the label. In this case we simply leave it alone.
+                //
+                // Notice that this logic makes it impossible to have a label
+                // with "lt;" inside it and using "l" as mnemonic but hopefully
+                // this shouldn't be a problem in practice.
+                {
+                    const size_t pos = it - text.begin() + 1;
+
+                    unsigned n;
+                    for ( n = 0; n < WXSIZEOF(xmlEntities); n++ )
+                    {
+                        const XMLEntity& xmlEnt = xmlEntities[n];
+                        if ( text.compare(pos, xmlEnt.len, xmlEnt.name) == 0
+                                && text[pos + xmlEnt.len] == ';' )
+                        {
+                            // Escape the ampersands if needed to protect them
+                            // from being interpreted as mnemonics indicators.
+                            if ( xmlEnt.value == '&' )
+                                current += "&&";
+                            else
+                                current += xmlEnt.value;
+
+                            it += xmlEnt.len + 1; // +1 for '&' itself
+
+                            break;
+                        }
+                    }
+
+                    if ( n < WXSIZEOF(xmlEntities) )
+                        break;
+                    //else: fall through, '&' is not special
+                }
+
+            default:
+                current += *it;
+        }
+    }
+
+    if ( !tags.empty() )
+    {
+        wxLogDebug("Missing closing tag for \"%s\"", tags.top().name);
+        return false;
+    }
+
+    if ( !current.empty() )
+        m_output.OnText(current);
+
+    return true;
+}
+
+/* static */
+wxString wxMarkupParser::Quote(const wxString& text)
+{
+    wxString quoted;
+    quoted.reserve(text.length());
+
+    for ( wxString::const_iterator it = text.begin(); it != text.end(); ++it )
+    {
+        unsigned n;
+        for ( n = 0; n < WXSIZEOF(xmlEntities); n++ )
+        {
+            const XMLEntity& xmlEnt = xmlEntities[n];
+            if ( *it == xmlEnt.value )
+            {
+                quoted << '&' << xmlEnt.name << ';';
+                break;
+            }
+        }
+
+        if ( n == WXSIZEOF(xmlEntities) )
+            quoted += *it;
+    }
+
+    return quoted;
+}
index 9c57cd3d22deb788c5aa286b2f8f116a96b2c8bb..1df92ac2d3974b909ad59751e24cdd993e6882cc 100644 (file)
@@ -178,6 +178,7 @@ TEST_GUI_OBJECTS =  \
        test_gui_listboxtest.o \
        test_gui_listctrltest.o \
        test_gui_listviewtest.o \
+       test_gui_markuptest.o \
        test_gui_notebooktest.o \
        test_gui_ownerdrawncomboboxtest.o \
        test_gui_pickerbasetest.o \
@@ -764,6 +765,9 @@ test_gui_listctrltest.o: $(srcdir)/controls/listctrltest.cpp $(TEST_GUI_ODEP)
 test_gui_listviewtest.o: $(srcdir)/controls/listviewtest.cpp $(TEST_GUI_ODEP)
        $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/listviewtest.cpp
 
+test_gui_markuptest.o: $(srcdir)/controls/markuptest.cpp $(TEST_GUI_ODEP)
+       $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/markuptest.cpp
+
 test_gui_notebooktest.o: $(srcdir)/controls/notebooktest.cpp $(TEST_GUI_ODEP)
        $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/notebooktest.cpp
 
diff --git a/tests/controls/markuptest.cpp b/tests/controls/markuptest.cpp
new file mode 100644 (file)
index 0000000..789598b
--- /dev/null
@@ -0,0 +1,198 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        tests/controls/markup.cpp
+// Purpose:     wxMarkupParser and related classes unit tests
+// Author:      Vadim Zeitlin
+// Created:     2011-02-17
+// RCS-ID:      $Id$
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+///////////////////////////////////////////////////////////////////////////////
+
+#include "testprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#endif // WX_PRECOMP
+
+#include "wx/private/markupparser.h"
+
+class MarkupTestCase : public CppUnit::TestCase
+{
+public:
+    MarkupTestCase() { }
+
+private:
+    CPPUNIT_TEST_SUITE( MarkupTestCase );
+        CPPUNIT_TEST( RoundTrip );
+        CPPUNIT_TEST( Quote );
+    CPPUNIT_TEST_SUITE_END();
+
+    void RoundTrip();
+    void Quote();
+
+    wxDECLARE_NO_COPY_CLASS(MarkupTestCase);
+};
+
+// register in the unnamed registry so that these tests are run by default
+CPPUNIT_TEST_SUITE_REGISTRATION( MarkupTestCase );
+
+// also include in it's own registry so that these tests can be run alone
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MarkupTestCase, "MarkupTestCase" );
+
+void MarkupTestCase::RoundTrip()
+{
+    // Define a wxMarkupParserOutput object which produces the same markup
+    // string on output. This is, of course, perfectly useless, but allows us
+    // to test that parsing works as expected.
+    class RoundTripOutput : public wxMarkupParserOutput
+    {
+    public:
+        RoundTripOutput() { }
+
+        void Reset() { m_text.clear(); }
+
+        const wxString& GetText() const { return m_text; }
+
+
+        virtual void OnText(const wxString& text) { m_text += text; }
+
+        virtual void OnBoldStart() { m_text += "<b>"; }
+        virtual void OnBoldEnd() { m_text += "</b>"; }
+
+        virtual void OnItalicStart() { m_text += "<i>"; }
+        virtual void OnItalicEnd() { m_text += "</i>"; }
+
+        virtual void OnUnderlinedStart() { m_text += "<u>"; }
+        virtual void OnUnderlinedEnd() { m_text += "</u>"; }
+
+        virtual void OnStrikethroughStart() { m_text += "<s>"; }
+        virtual void OnStrikethroughEnd() { m_text += "</s>"; }
+
+        virtual void OnBigStart() { m_text += "<big>"; }
+        virtual void OnBigEnd() { m_text += "</big>"; }
+
+        virtual void OnSmallStart() { m_text += "<small>"; }
+        virtual void OnSmallEnd() { m_text += "</small>"; }
+
+        virtual void OnTeletypeStart() { m_text += "<tt>"; }
+        virtual void OnTeletypeEnd() { m_text += "</tt>"; }
+
+        virtual void OnSpanStart(const wxMarkupSpanAttributes& attrs)
+        {
+            m_text << "<span";
+
+            if ( !attrs.m_fgCol.empty() )
+                m_text << " foreground=\"" << attrs.m_fgCol << "\"";
+
+            if ( !attrs.m_bgCol.empty() )
+                m_text << " background=\"" << attrs.m_bgCol << "\"";
+
+            if ( !attrs.m_fontFace.empty() )
+                m_text << " face=\"" << attrs.m_fontFace << "\"";
+
+            wxString size;
+            switch ( attrs.m_sizeKind )
+            {
+                case wxMarkupSpanAttributes::Size_Unspecified:
+                    break;
+
+                case wxMarkupSpanAttributes::Size_Relative:
+                    size << (attrs.m_fontSize > 0 ? "larger" : "smaller");
+                    break;
+
+                case wxMarkupSpanAttributes::Size_Symbolic:
+                    {
+                        CPPUNIT_ASSERT( attrs.m_fontSize >= -3 &&
+                                            attrs.m_fontSize <= 3 );
+                        static const char *cssSizes[] =
+                        {
+                            "xx-small", "x-small", "small",
+                            "medium",
+                            "large", "x-large", "xx-large",
+                        };
+
+                        size << cssSizes[attrs.m_fontSize + 3];
+                    }
+                    break;
+
+                case wxMarkupSpanAttributes::Size_PointParts:
+                    size.Printf("%u", attrs.m_fontSize);
+                    break;
+            }
+
+            if ( !size.empty() )
+                m_text << " size=\"" << size << '"';
+
+            // TODO: Handle the rest of attributes.
+
+            m_text << ">";
+        }
+
+        virtual void OnSpanEnd(const wxMarkupSpanAttributes& WXUNUSED(attrs))
+        {
+            m_text += "</span>";
+        }
+
+    private:
+        wxString m_text;
+    };
+
+
+    RoundTripOutput output;
+    wxMarkupParser parser(output);
+
+    #define CHECK_PARSES_OK(text) \
+        output.Reset(); \
+        CPPUNIT_ASSERT( parser.Parse(text) ); \
+        CPPUNIT_ASSERT_EQUAL( text, output.GetText() )
+
+    #define CHECK_PARSES_AS(text, result) \
+        output.Reset(); \
+        CPPUNIT_ASSERT( parser.Parse(text) ); \
+        CPPUNIT_ASSERT_EQUAL( result, output.GetText() )
+
+    #define CHECK_DOESNT_PARSE(text) \
+        CPPUNIT_ASSERT( !parser.Parse(text) )
+
+    CHECK_PARSES_OK( "" );
+    CHECK_PARSES_OK( "foo" );
+    CHECK_PARSES_OK( "foo<b>bar</b>" );
+    CHECK_PARSES_OK( "1<big>2<small>3</small>4<big>5</big></big>6" );
+    CHECK_PARSES_OK( "first <span foreground=\"red\">second</span> last" );
+    CHECK_PARSES_OK( "first <span foreground=\"red\" "
+                                 "background=\"#ffffff\">second </span> last" );
+    CHECK_PARSES_OK( "<span size=\"10240\">10pt</span>" );
+    CHECK_PARSES_OK( "<span size=\"x-small\">much smaller</span>" );
+    CHECK_PARSES_OK( "<span size=\"larger\">larger</span>" );
+    CHECK_PARSES_OK
+    (
+        "<u>Please</u> notice: <i><b>any</b></i> <span foreground=\"grey\">"
+        "<s><tt>bugs</tt></s></span> in this code are <span foreground=\"red\" "
+        "size=\"xx-large\">NOT</span> allowed."
+    );
+
+    CHECK_PARSES_OK( "foo&bar" );
+    CHECK_PARSES_AS( "foo&amp;bar", "foo&&bar" );
+    CHECK_PARSES_AS( "&lt;O&apos;Reilly&gt;", "<O'Reilly>" );
+
+    CHECK_DOESNT_PARSE( "<" );
+    CHECK_DOESNT_PARSE( "<b" );
+    CHECK_DOESNT_PARSE( "<b>" );
+    CHECK_DOESNT_PARSE( "<b></i>" );
+    CHECK_DOESNT_PARSE( "<b><i></b></i>" );
+    CHECK_DOESNT_PARSE( "<foo></foo>" );
+
+    #undef CHECK_PARSES_OK
+    #undef CHECK_DOESNT_PARSE
+}
+
+void MarkupTestCase::Quote()
+{
+    CPPUNIT_ASSERT_EQUAL( "", wxMarkupParser::Quote("") );
+    CPPUNIT_ASSERT_EQUAL( "foo", wxMarkupParser::Quote("foo") );
+    CPPUNIT_ASSERT_EQUAL( "&lt;foo&gt;", wxMarkupParser::Quote("<foo>") );
+    CPPUNIT_ASSERT_EQUAL( "B&amp;B", wxMarkupParser::Quote("B&B") );
+    CPPUNIT_ASSERT_EQUAL( "&quot;&quot;", wxMarkupParser::Quote("\"\"") );
+}
index f6a49b636b48364f9c27c36f927edaaafb2b08e1..2f07c1b1cdbdb4b0c39b4f1bc11df999e41c3f2d 100644 (file)
@@ -163,6 +163,7 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_listboxtest.obj \\r
        $(OBJS)\test_gui_listctrltest.obj \\r
        $(OBJS)\test_gui_listviewtest.obj \\r
+       $(OBJS)\test_gui_markuptest.obj \
        $(OBJS)\test_gui_notebooktest.obj \\r
        $(OBJS)\test_gui_ownerdrawncomboboxtest.obj \\r
        $(OBJS)\test_gui_pickerbasetest.obj \\r
@@ -812,6 +813,9 @@ $(OBJS)\test_gui_listctrltest.obj: .\controls\listctrltest.cpp
 $(OBJS)\test_gui_listviewtest.obj: .\controls\listviewtest.cpp\r
        $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\listviewtest.cpp\r
 \r
+$(OBJS)\test_gui_markuptest.obj: .\controls\markuptest.cpp
+       $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\markuptest.cpp
+
 $(OBJS)\test_gui_notebooktest.obj: .\controls\notebooktest.cpp\r
        $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\notebooktest.cpp\r
 \r
index 52490dd62f15bbdddbecb33f30c0f4be4602d0b4..d8559c080b706b3924c98d7ebd50b9e643fad2f4 100644 (file)
@@ -156,6 +156,7 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_listboxtest.o \\r
        $(OBJS)\test_gui_listctrltest.o \\r
        $(OBJS)\test_gui_listviewtest.o \\r
+       $(OBJS)\test_gui_markuptest.o \
        $(OBJS)\test_gui_notebooktest.o \\r
        $(OBJS)\test_gui_ownerdrawncomboboxtest.o \\r
        $(OBJS)\test_gui_pickerbasetest.o \\r
@@ -793,6 +794,9 @@ $(OBJS)\test_gui_listctrltest.o: ./controls/listctrltest.cpp
 $(OBJS)\test_gui_listviewtest.o: ./controls/listviewtest.cpp\r
        $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<\r
 \r
+$(OBJS)\test_gui_markuptest.o: ./controls/markuptest.cpp
+       $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\test_gui_notebooktest.o: ./controls/notebooktest.cpp\r
        $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<\r
 \r
index 19f365c0ad48b00c7b180cfad1f12254093078d9..7d33b327e63bc143746c05411f9f860c7b63a8df 100644 (file)
@@ -158,6 +158,7 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_listboxtest.obj \\r
        $(OBJS)\test_gui_listctrltest.obj \\r
        $(OBJS)\test_gui_listviewtest.obj \\r
+       $(OBJS)\test_gui_markuptest.obj \
        $(OBJS)\test_gui_notebooktest.obj \\r
        $(OBJS)\test_gui_ownerdrawncomboboxtest.obj \\r
        $(OBJS)\test_gui_pickerbasetest.obj \\r
@@ -938,6 +939,9 @@ $(OBJS)\test_gui_listctrltest.obj: .\controls\listctrltest.cpp
 $(OBJS)\test_gui_listviewtest.obj: .\controls\listviewtest.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\listviewtest.cpp\r
 \r
+$(OBJS)\test_gui_markuptest.obj: .\controls\markuptest.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\markuptest.cpp
+
 $(OBJS)\test_gui_notebooktest.obj: .\controls\notebooktest.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\notebooktest.cpp\r
 \r
index 6500836f23e04047c756322de9007414ae613d17..7c563fdaae3d5842d77e3b9381b8d8d41f832e90 100644 (file)
@@ -402,6 +402,7 @@ TEST_GUI_OBJECTS =  &
        $(OBJS)\test_gui_listboxtest.obj &\r
        $(OBJS)\test_gui_listctrltest.obj &\r
        $(OBJS)\test_gui_listviewtest.obj &\r
+       $(OBJS)\test_gui_markuptest.obj &
        $(OBJS)\test_gui_notebooktest.obj &\r
        $(OBJS)\test_gui_ownerdrawncomboboxtest.obj &\r
        $(OBJS)\test_gui_pickerbasetest.obj &\r
@@ -852,6 +853,9 @@ $(OBJS)\test_gui_listctrltest.obj :  .AUTODEPEND .\controls\listctrltest.cpp
 $(OBJS)\test_gui_listviewtest.obj :  .AUTODEPEND .\controls\listviewtest.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<\r
 \r
+$(OBJS)\test_gui_markuptest.obj :  .AUTODEPEND .\controls\markuptest.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
+
 $(OBJS)\test_gui_notebooktest.obj :  .AUTODEPEND .\controls\notebooktest.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<\r
 \r
index bea939d1aef5416239d22915b3a1dd9cdd07a3b3..2f5d0aa81bfe6da31e1099a633350bd5f1ffbd15 100644 (file)
             controls/listboxtest.cpp
             controls/listctrltest.cpp
             controls/listviewtest.cpp
+            controls/markuptest.cpp
             controls/notebooktest.cpp
             controls/ownerdrawncomboboxtest.cpp
             controls/pickerbasetest.cpp
index 382ecd8890cb55a24c77c583f7784ec64eeadd1b..89461de8e366c8a3b1e4e190fe2d92484548997a 100644 (file)
@@ -393,6 +393,10 @@ SOURCE=.\controls\listviewtest.cpp
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\controls\markuptest.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\graphics\measuring.cpp\r
 # End Source File\r
 # Begin Source File\r
index d2bd4c2d73bd471ec88cf6a0b0add36a03a92c19..8694367444289b5c0bb1099c8f5f40bf5a5611c2 100644 (file)
                                RelativePath=".\controls\listviewtest.cpp">\r
                        </File>\r
                        <File\r
+                               RelativePath=".\controls\markuptest.cpp">
+                       </File>
+                       <File
                                RelativePath=".\graphics\measuring.cpp">\r
                        </File>\r
                        <File\r
index 8099a9a808f6f466eea291985b9c1820a9d8a978..19d026ee2e356205f0b75aed4fda5135616f8dce 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\controls\markuptest.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\graphics\measuring.cpp"\r
                                >\r
                        </File>\r
index c11080f5936b37ef991a5b7bfcb8d7b92a44d692..a6b4a266a35375b19cd92732726ea254cb26cb69 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\controls\markuptest.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\graphics\measuring.cpp"\r
                                >\r
                        </File>\r