]> git.saurik.com Git - wxWidgets.git/commitdiff
Factor out text measurement from wxDC and wxWindow into wxTextMeasure.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 17 Oct 2012 22:35:49 +0000 (22:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 17 Oct 2012 22:35:49 +0000 (22:35 +0000)
Add a new private wxTextMeasure class implementing methods for measuring text
and move the often duplicated (but not always identically) code for doing the
same from wxDC and wxWindow into it.

Currently this class is only really implemented in wxMSW and wxGTK.

Also extend the test for text measuring functions and rename it to
MeasuringTextTestCase from MeasuringContextTestCase as it's not wxGC-specific
any more.

Closes #14705.

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

24 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/generic/private/textmeasure.h [new file with mode: 0644]
include/wx/gtk/private/textmeasure.h [new file with mode: 0644]
include/wx/msw/private/textmeasure.h [new file with mode: 0644]
include/wx/private/textmeasure.h [new file with mode: 0644]
src/common/dcbase.cpp
src/common/textmeasurecmn.cpp [new file with mode: 0644]
src/generic/textmeasure.cpp [new file with mode: 0644]
src/gtk/dcclient.cpp
src/gtk/textmeasure.cpp [new file with mode: 0644]
src/gtk/window.cpp
src/msw/dc.cpp
src/msw/textmeasure.cpp [new file with mode: 0644]
src/msw/window.cpp
tests/graphics/measuring.cpp

index 073ae2ebefd771789caa5d6d302e7c24d8c4e482..ce7fc8ac94bb9c93672dd630cfc099c523d1761c 100644 (file)
@@ -4814,6 +4814,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS =  \
        monodll_tbarbase.o \
        monodll_textcmn.o \
        monodll_textentrycmn.o \
+       monodll_textmeasurecmn.o \
        monodll_toplvcmn.o \
        monodll_treebase.o \
        monodll_uiactioncmn.o \
@@ -5031,6 +5032,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS =  \
        monodll_tbarbase.o \
        monodll_textcmn.o \
        monodll_textentrycmn.o \
+       monodll_textmeasurecmn.o \
        monodll_toplvcmn.o \
        monodll_treebase.o \
        monodll_uiactioncmn.o \
@@ -5086,6 +5088,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS =  \
        monodll_generic_icon.o \
        monodll_generic_imaglist.o \
        monodll_mask.o \
+       monodll_generic_textmeasure.o \
        monodll_dfb_app.o \
        monodll_dfb_bitmap.o \
        monodll_dfb_brush.o \
@@ -5119,6 +5122,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS =  \
        monodll_utilsx11.o \
        monodll_generic_icon.o \
        monodll_paletteg.o \
+       monodll_generic_textmeasure.o \
        monodll_gtk1_app.o \
        monodll_gtk1_bitmap.o \
        monodll_gtk1_brush.o \
@@ -5176,6 +5180,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS =  \
        monodll_gtk_region.o \
        monodll_gtk_renderer.o \
        monodll_gtk_settings.o \
+       monodll_gtk_textmeasure.o \
        monodll_gtk_timer.o \
        monodll_gtk_tooltip.o \
        monodll_gtk_toplevel.o \
@@ -5213,6 +5218,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS =  \
        monodll_gtk_region.o \
        monodll_gtk_renderer.o \
        monodll_gtk_settings.o \
+       monodll_gtk_textmeasure.o \
        monodll_gtk_timer.o \
        monodll_gtk_tooltip.o \
        monodll_gtk_toplevel.o \
@@ -5229,6 +5235,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS =  \
        monodll_unix_fontutil.o \
        monodll_uiactionx11.o \
        monodll_utilsx11.o \
+       monodll_generic_textmeasure.o \
        monodll_x11_bitmap.o \
        monodll_x11_brush.o \
        monodll_x11_palette.o \
@@ -5279,6 +5286,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS =  \
        monodll_msw_region.o \
        monodll_msw_renderer.o \
        monodll_msw_settings.o \
+       monodll_msw_textmeasure.o \
        monodll_msw_tooltip.o \
        monodll_msw_toplevel.o \
        monodll_uiaction.o \
@@ -5341,6 +5349,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS =  \
        monodll_msw_region.o \
        monodll_msw_renderer.o \
        monodll_msw_settings.o \
+       monodll_msw_textmeasure.o \
        monodll_msw_tooltip.o \
        monodll_msw_toplevel.o \
        monodll_uiaction.o \
@@ -5359,6 +5368,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS =  \
        monodll_uiactionx11.o \
        monodll_utilsx11.o \
        monodll_generic_icon.o \
+       monodll_generic_textmeasure.o \
        monodll_generic_timer.o \
        monodll_x11_app.o \
        monodll_x11_bitmap.o \
@@ -5476,7 +5486,8 @@ COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS =  \
        monodll_generic_listctrl.o \
        monodll_paletteg.o \
        monodll_regiong.o \
-       monodll_generic_statusbr.o
+       monodll_generic_statusbr.o \
+       monodll_generic_textmeasure.o
 @COND_TOOLKIT_COCOA@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS =  \
        monodll_generic_accel.o \
@@ -5871,6 +5882,7 @@ COND_TOOLKIT_PM___GUI_SRC_OBJECTS =  \
        monodll_mdig.o \
        monodll_prntdlgg.o \
        monodll_generic_statusbr.o \
+       monodll_generic_textmeasure.o \
        monodll_os2_accel.o \
        monodll_os2_app.o \
        monodll_os2_bitmap.o \
@@ -6024,6 +6036,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_generic_icon.o \
        monodll_generic_imaglist.o \
        monodll_mask.o \
+       monodll_generic_textmeasure.o \
        monodll_dfb_app.o \
        monodll_dfb_bitmap.o \
        monodll_dfb_brush.o \
@@ -6057,6 +6070,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_utilsx11.o \
        monodll_generic_icon.o \
        monodll_paletteg.o \
+       monodll_generic_textmeasure.o \
        monodll_gtk1_app.o \
        monodll_gtk1_bitmap.o \
        monodll_gtk1_brush.o \
@@ -6114,6 +6128,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_gtk_region.o \
        monodll_gtk_renderer.o \
        monodll_gtk_settings.o \
+       monodll_gtk_textmeasure.o \
        monodll_gtk_timer.o \
        monodll_gtk_tooltip.o \
        monodll_gtk_toplevel.o \
@@ -6151,6 +6166,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_gtk_region.o \
        monodll_gtk_renderer.o \
        monodll_gtk_settings.o \
+       monodll_gtk_textmeasure.o \
        monodll_gtk_timer.o \
        monodll_gtk_tooltip.o \
        monodll_gtk_toplevel.o \
@@ -6167,6 +6183,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_unix_fontutil.o \
        monodll_uiactionx11.o \
        monodll_utilsx11.o \
+       monodll_generic_textmeasure.o \
        monodll_x11_bitmap.o \
        monodll_x11_brush.o \
        monodll_x11_palette.o \
@@ -6217,6 +6234,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_msw_region.o \
        monodll_msw_renderer.o \
        monodll_msw_settings.o \
+       monodll_msw_textmeasure.o \
        monodll_msw_tooltip.o \
        monodll_msw_toplevel.o \
        monodll_uiaction.o \
@@ -6279,6 +6297,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_msw_region.o \
        monodll_msw_renderer.o \
        monodll_msw_settings.o \
+       monodll_msw_textmeasure.o \
        monodll_msw_tooltip.o \
        monodll_msw_toplevel.o \
        monodll_uiaction.o \
@@ -6297,6 +6316,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_uiactionx11.o \
        monodll_utilsx11.o \
        monodll_generic_icon.o \
+       monodll_generic_textmeasure.o \
        monodll_generic_timer.o \
        monodll_x11_app.o \
        monodll_x11_bitmap.o \
@@ -7024,6 +7044,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 =  \
        monolib_tbarbase.o \
        monolib_textcmn.o \
        monolib_textentrycmn.o \
+       monolib_textmeasurecmn.o \
        monolib_toplvcmn.o \
        monolib_treebase.o \
        monolib_uiactioncmn.o \
@@ -7241,6 +7262,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 =  \
        monolib_tbarbase.o \
        monolib_textcmn.o \
        monolib_textentrycmn.o \
+       monolib_textmeasurecmn.o \
        monolib_toplvcmn.o \
        monolib_treebase.o \
        monolib_uiactioncmn.o \
@@ -7296,6 +7318,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_generic_icon.o \
        monolib_generic_imaglist.o \
        monolib_mask.o \
+       monolib_generic_textmeasure.o \
        monolib_dfb_app.o \
        monolib_dfb_bitmap.o \
        monolib_dfb_brush.o \
@@ -7329,6 +7352,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_utilsx11.o \
        monolib_generic_icon.o \
        monolib_paletteg.o \
+       monolib_generic_textmeasure.o \
        monolib_gtk1_app.o \
        monolib_gtk1_bitmap.o \
        monolib_gtk1_brush.o \
@@ -7386,6 +7410,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_gtk_region.o \
        monolib_gtk_renderer.o \
        monolib_gtk_settings.o \
+       monolib_gtk_textmeasure.o \
        monolib_gtk_timer.o \
        monolib_gtk_tooltip.o \
        monolib_gtk_toplevel.o \
@@ -7423,6 +7448,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_gtk_region.o \
        monolib_gtk_renderer.o \
        monolib_gtk_settings.o \
+       monolib_gtk_textmeasure.o \
        monolib_gtk_timer.o \
        monolib_gtk_tooltip.o \
        monolib_gtk_toplevel.o \
@@ -7439,6 +7465,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_unix_fontutil.o \
        monolib_uiactionx11.o \
        monolib_utilsx11.o \
+       monolib_generic_textmeasure.o \
        monolib_x11_bitmap.o \
        monolib_x11_brush.o \
        monolib_x11_palette.o \
@@ -7489,6 +7516,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_msw_region.o \
        monolib_msw_renderer.o \
        monolib_msw_settings.o \
+       monolib_msw_textmeasure.o \
        monolib_msw_tooltip.o \
        monolib_msw_toplevel.o \
        monolib_uiaction.o \
@@ -7551,6 +7579,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_msw_region.o \
        monolib_msw_renderer.o \
        monolib_msw_settings.o \
+       monolib_msw_textmeasure.o \
        monolib_msw_tooltip.o \
        monolib_msw_toplevel.o \
        monolib_uiaction.o \
@@ -7569,6 +7598,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_uiactionx11.o \
        monolib_utilsx11.o \
        monolib_generic_icon.o \
+       monolib_generic_textmeasure.o \
        monolib_generic_timer.o \
        monolib_x11_app.o \
        monolib_x11_bitmap.o \
@@ -7686,7 +7716,8 @@ COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_1 =  \
        monolib_generic_listctrl.o \
        monolib_paletteg.o \
        monolib_regiong.o \
-       monolib_generic_statusbr.o
+       monolib_generic_statusbr.o \
+       monolib_generic_textmeasure.o
 @COND_TOOLKIT_COCOA@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_1)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_1 =  \
        monolib_generic_accel.o \
@@ -8081,6 +8112,7 @@ COND_TOOLKIT_PM___GUI_SRC_OBJECTS_1 =  \
        monolib_mdig.o \
        monolib_prntdlgg.o \
        monolib_generic_statusbr.o \
+       monolib_generic_textmeasure.o \
        monolib_os2_accel.o \
        monolib_os2_app.o \
        monolib_os2_bitmap.o \
@@ -8234,6 +8266,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_generic_icon.o \
        monolib_generic_imaglist.o \
        monolib_mask.o \
+       monolib_generic_textmeasure.o \
        monolib_dfb_app.o \
        monolib_dfb_bitmap.o \
        monolib_dfb_brush.o \
@@ -8267,6 +8300,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_utilsx11.o \
        monolib_generic_icon.o \
        monolib_paletteg.o \
+       monolib_generic_textmeasure.o \
        monolib_gtk1_app.o \
        monolib_gtk1_bitmap.o \
        monolib_gtk1_brush.o \
@@ -8324,6 +8358,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_gtk_region.o \
        monolib_gtk_renderer.o \
        monolib_gtk_settings.o \
+       monolib_gtk_textmeasure.o \
        monolib_gtk_timer.o \
        monolib_gtk_tooltip.o \
        monolib_gtk_toplevel.o \
@@ -8361,6 +8396,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_gtk_region.o \
        monolib_gtk_renderer.o \
        monolib_gtk_settings.o \
+       monolib_gtk_textmeasure.o \
        monolib_gtk_timer.o \
        monolib_gtk_tooltip.o \
        monolib_gtk_toplevel.o \
@@ -8377,6 +8413,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_unix_fontutil.o \
        monolib_uiactionx11.o \
        monolib_utilsx11.o \
+       monolib_generic_textmeasure.o \
        monolib_x11_bitmap.o \
        monolib_x11_brush.o \
        monolib_x11_palette.o \
@@ -8427,6 +8464,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_msw_region.o \
        monolib_msw_renderer.o \
        monolib_msw_settings.o \
+       monolib_msw_textmeasure.o \
        monolib_msw_tooltip.o \
        monolib_msw_toplevel.o \
        monolib_uiaction.o \
@@ -8489,6 +8527,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_msw_region.o \
        monolib_msw_renderer.o \
        monolib_msw_settings.o \
+       monolib_msw_textmeasure.o \
        monolib_msw_tooltip.o \
        monolib_msw_toplevel.o \
        monolib_uiaction.o \
@@ -8507,6 +8546,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_uiactionx11.o \
        monolib_utilsx11.o \
        monolib_generic_icon.o \
+       monolib_generic_textmeasure.o \
        monolib_generic_timer.o \
        monolib_x11_app.o \
        monolib_x11_bitmap.o \
@@ -9409,6 +9449,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 =  \
        coredll_tbarbase.o \
        coredll_textcmn.o \
        coredll_textentrycmn.o \
+       coredll_textmeasurecmn.o \
        coredll_toplvcmn.o \
        coredll_treebase.o \
        coredll_uiactioncmn.o \
@@ -9626,6 +9667,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 =  \
        coredll_tbarbase.o \
        coredll_textcmn.o \
        coredll_textentrycmn.o \
+       coredll_textmeasurecmn.o \
        coredll_toplvcmn.o \
        coredll_treebase.o \
        coredll_uiactioncmn.o \
@@ -9681,6 +9723,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_generic_icon.o \
        coredll_generic_imaglist.o \
        coredll_mask.o \
+       coredll_generic_textmeasure.o \
        coredll_dfb_app.o \
        coredll_dfb_bitmap.o \
        coredll_dfb_brush.o \
@@ -9714,6 +9757,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_utilsx11.o \
        coredll_generic_icon.o \
        coredll_paletteg.o \
+       coredll_generic_textmeasure.o \
        coredll_gtk1_app.o \
        coredll_gtk1_bitmap.o \
        coredll_gtk1_brush.o \
@@ -9771,6 +9815,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_gtk_region.o \
        coredll_gtk_renderer.o \
        coredll_gtk_settings.o \
+       coredll_gtk_textmeasure.o \
        coredll_gtk_timer.o \
        coredll_gtk_tooltip.o \
        coredll_gtk_toplevel.o \
@@ -9808,6 +9853,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_gtk_region.o \
        coredll_gtk_renderer.o \
        coredll_gtk_settings.o \
+       coredll_gtk_textmeasure.o \
        coredll_gtk_timer.o \
        coredll_gtk_tooltip.o \
        coredll_gtk_toplevel.o \
@@ -9824,6 +9870,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_unix_fontutil.o \
        coredll_uiactionx11.o \
        coredll_utilsx11.o \
+       coredll_generic_textmeasure.o \
        coredll_x11_bitmap.o \
        coredll_x11_brush.o \
        coredll_x11_palette.o \
@@ -9874,6 +9921,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_msw_region.o \
        coredll_msw_renderer.o \
        coredll_msw_settings.o \
+       coredll_msw_textmeasure.o \
        coredll_msw_tooltip.o \
        coredll_msw_toplevel.o \
        coredll_uiaction.o \
@@ -9936,6 +9984,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_msw_region.o \
        coredll_msw_renderer.o \
        coredll_msw_settings.o \
+       coredll_msw_textmeasure.o \
        coredll_msw_tooltip.o \
        coredll_msw_toplevel.o \
        coredll_uiaction.o \
@@ -9954,6 +10003,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_uiactionx11.o \
        coredll_utilsx11.o \
        coredll_generic_icon.o \
+       coredll_generic_textmeasure.o \
        coredll_generic_timer.o \
        coredll_x11_app.o \
        coredll_x11_bitmap.o \
@@ -10071,7 +10121,8 @@ COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_2 =  \
        coredll_generic_listctrl.o \
        coredll_paletteg.o \
        coredll_regiong.o \
-       coredll_generic_statusbr.o
+       coredll_generic_statusbr.o \
+       coredll_generic_textmeasure.o
 @COND_TOOLKIT_COCOA@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_2)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_2 =  \
        coredll_generic_accel.o \
@@ -10466,6 +10517,7 @@ COND_TOOLKIT_PM___GUI_SRC_OBJECTS_2 =  \
        coredll_mdig.o \
        coredll_prntdlgg.o \
        coredll_generic_statusbr.o \
+       coredll_generic_textmeasure.o \
        coredll_os2_accel.o \
        coredll_os2_app.o \
        coredll_os2_bitmap.o \
@@ -10619,6 +10671,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_generic_icon.o \
        coredll_generic_imaglist.o \
        coredll_mask.o \
+       coredll_generic_textmeasure.o \
        coredll_dfb_app.o \
        coredll_dfb_bitmap.o \
        coredll_dfb_brush.o \
@@ -10652,6 +10705,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_utilsx11.o \
        coredll_generic_icon.o \
        coredll_paletteg.o \
+       coredll_generic_textmeasure.o \
        coredll_gtk1_app.o \
        coredll_gtk1_bitmap.o \
        coredll_gtk1_brush.o \
@@ -10709,6 +10763,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_gtk_region.o \
        coredll_gtk_renderer.o \
        coredll_gtk_settings.o \
+       coredll_gtk_textmeasure.o \
        coredll_gtk_timer.o \
        coredll_gtk_tooltip.o \
        coredll_gtk_toplevel.o \
@@ -10746,6 +10801,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_gtk_region.o \
        coredll_gtk_renderer.o \
        coredll_gtk_settings.o \
+       coredll_gtk_textmeasure.o \
        coredll_gtk_timer.o \
        coredll_gtk_tooltip.o \
        coredll_gtk_toplevel.o \
@@ -10762,6 +10818,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_unix_fontutil.o \
        coredll_uiactionx11.o \
        coredll_utilsx11.o \
+       coredll_generic_textmeasure.o \
        coredll_x11_bitmap.o \
        coredll_x11_brush.o \
        coredll_x11_palette.o \
@@ -10812,6 +10869,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_msw_region.o \
        coredll_msw_renderer.o \
        coredll_msw_settings.o \
+       coredll_msw_textmeasure.o \
        coredll_msw_tooltip.o \
        coredll_msw_toplevel.o \
        coredll_uiaction.o \
@@ -10874,6 +10932,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_msw_region.o \
        coredll_msw_renderer.o \
        coredll_msw_settings.o \
+       coredll_msw_textmeasure.o \
        coredll_msw_tooltip.o \
        coredll_msw_toplevel.o \
        coredll_uiaction.o \
@@ -10892,6 +10951,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_uiactionx11.o \
        coredll_utilsx11.o \
        coredll_generic_icon.o \
+       coredll_generic_textmeasure.o \
        coredll_generic_timer.o \
        coredll_x11_app.o \
        coredll_x11_bitmap.o \
@@ -11058,6 +11118,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 =  \
        corelib_tbarbase.o \
        corelib_textcmn.o \
        corelib_textentrycmn.o \
+       corelib_textmeasurecmn.o \
        corelib_toplvcmn.o \
        corelib_treebase.o \
        corelib_uiactioncmn.o \
@@ -11275,6 +11336,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 =  \
        corelib_tbarbase.o \
        corelib_textcmn.o \
        corelib_textentrycmn.o \
+       corelib_textmeasurecmn.o \
        corelib_toplvcmn.o \
        corelib_treebase.o \
        corelib_uiactioncmn.o \
@@ -11330,6 +11392,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_generic_icon.o \
        corelib_generic_imaglist.o \
        corelib_mask.o \
+       corelib_generic_textmeasure.o \
        corelib_dfb_app.o \
        corelib_dfb_bitmap.o \
        corelib_dfb_brush.o \
@@ -11363,6 +11426,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_utilsx11.o \
        corelib_generic_icon.o \
        corelib_paletteg.o \
+       corelib_generic_textmeasure.o \
        corelib_gtk1_app.o \
        corelib_gtk1_bitmap.o \
        corelib_gtk1_brush.o \
@@ -11420,6 +11484,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_gtk_region.o \
        corelib_gtk_renderer.o \
        corelib_gtk_settings.o \
+       corelib_gtk_textmeasure.o \
        corelib_gtk_timer.o \
        corelib_gtk_tooltip.o \
        corelib_gtk_toplevel.o \
@@ -11457,6 +11522,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_gtk_region.o \
        corelib_gtk_renderer.o \
        corelib_gtk_settings.o \
+       corelib_gtk_textmeasure.o \
        corelib_gtk_timer.o \
        corelib_gtk_tooltip.o \
        corelib_gtk_toplevel.o \
@@ -11473,6 +11539,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_unix_fontutil.o \
        corelib_uiactionx11.o \
        corelib_utilsx11.o \
+       corelib_generic_textmeasure.o \
        corelib_x11_bitmap.o \
        corelib_x11_brush.o \
        corelib_x11_palette.o \
@@ -11523,6 +11590,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_msw_region.o \
        corelib_msw_renderer.o \
        corelib_msw_settings.o \
+       corelib_msw_textmeasure.o \
        corelib_msw_tooltip.o \
        corelib_msw_toplevel.o \
        corelib_uiaction.o \
@@ -11585,6 +11653,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_msw_region.o \
        corelib_msw_renderer.o \
        corelib_msw_settings.o \
+       corelib_msw_textmeasure.o \
        corelib_msw_tooltip.o \
        corelib_msw_toplevel.o \
        corelib_uiaction.o \
@@ -11603,6 +11672,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_uiactionx11.o \
        corelib_utilsx11.o \
        corelib_generic_icon.o \
+       corelib_generic_textmeasure.o \
        corelib_generic_timer.o \
        corelib_x11_app.o \
        corelib_x11_bitmap.o \
@@ -11720,7 +11790,8 @@ COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_3 =  \
        corelib_generic_listctrl.o \
        corelib_paletteg.o \
        corelib_regiong.o \
-       corelib_generic_statusbr.o
+       corelib_generic_statusbr.o \
+       corelib_generic_textmeasure.o
 @COND_TOOLKIT_COCOA@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_COCOA___GUI_SRC_OBJECTS_3)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_3 =  \
        corelib_generic_accel.o \
@@ -12115,6 +12186,7 @@ COND_TOOLKIT_PM___GUI_SRC_OBJECTS_3 =  \
        corelib_mdig.o \
        corelib_prntdlgg.o \
        corelib_generic_statusbr.o \
+       corelib_generic_textmeasure.o \
        corelib_os2_accel.o \
        corelib_os2_app.o \
        corelib_os2_bitmap.o \
@@ -12268,6 +12340,7 @@ COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_generic_icon.o \
        corelib_generic_imaglist.o \
        corelib_mask.o \
+       corelib_generic_textmeasure.o \
        corelib_dfb_app.o \
        corelib_dfb_bitmap.o \
        corelib_dfb_brush.o \
@@ -12301,6 +12374,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_utilsx11.o \
        corelib_generic_icon.o \
        corelib_paletteg.o \
+       corelib_generic_textmeasure.o \
        corelib_gtk1_app.o \
        corelib_gtk1_bitmap.o \
        corelib_gtk1_brush.o \
@@ -12358,6 +12432,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_gtk_region.o \
        corelib_gtk_renderer.o \
        corelib_gtk_settings.o \
+       corelib_gtk_textmeasure.o \
        corelib_gtk_timer.o \
        corelib_gtk_tooltip.o \
        corelib_gtk_toplevel.o \
@@ -12395,6 +12470,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_3___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_gtk_region.o \
        corelib_gtk_renderer.o \
        corelib_gtk_settings.o \
+       corelib_gtk_textmeasure.o \
        corelib_gtk_timer.o \
        corelib_gtk_tooltip.o \
        corelib_gtk_toplevel.o \
@@ -12411,6 +12487,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_unix_fontutil.o \
        corelib_uiactionx11.o \
        corelib_utilsx11.o \
+       corelib_generic_textmeasure.o \
        corelib_x11_bitmap.o \
        corelib_x11_brush.o \
        corelib_x11_palette.o \
@@ -12461,6 +12538,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_msw_region.o \
        corelib_msw_renderer.o \
        corelib_msw_settings.o \
+       corelib_msw_textmeasure.o \
        corelib_msw_tooltip.o \
        corelib_msw_toplevel.o \
        corelib_uiaction.o \
@@ -12523,6 +12601,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_msw_region.o \
        corelib_msw_renderer.o \
        corelib_msw_settings.o \
+       corelib_msw_textmeasure.o \
        corelib_msw_tooltip.o \
        corelib_msw_toplevel.o \
        corelib_uiaction.o \
@@ -12541,6 +12620,7 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_uiactionx11.o \
        corelib_utilsx11.o \
        corelib_generic_icon.o \
+       corelib_generic_textmeasure.o \
        corelib_generic_timer.o \
        corelib_x11_app.o \
        corelib_x11_bitmap.o \
@@ -14432,7 +14512,8 @@ COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS =  \
        monodll_fontpickerg.o \
        monodll_generic_listctrl.o \
        monodll_prntdlgg.o \
-       monodll_generic_statusbr.o
+       monodll_generic_statusbr.o \
+       monodll_generic_textmeasure.o
 @COND_PLATFORM_MACOSX_1@__OSX_CARBON_COCOA_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS)
 COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS =  \
        monodll_generic_caret.o \
@@ -14561,7 +14642,8 @@ COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_12 =  \
        monolib_fontpickerg.o \
        monolib_generic_listctrl.o \
        monolib_prntdlgg.o \
-       monolib_generic_statusbr.o
+       monolib_generic_statusbr.o \
+       monolib_generic_textmeasure.o
 @COND_PLATFORM_MACOSX_1@__OSX_CARBON_COCOA_SRC_OBJECTS_12 = $(COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_12)
 COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_17 =  \
        monolib_generic_caret.o \
@@ -14690,7 +14772,8 @@ COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_14 =  \
        coredll_fontpickerg.o \
        coredll_generic_listctrl.o \
        coredll_prntdlgg.o \
-       coredll_generic_statusbr.o
+       coredll_generic_statusbr.o \
+       coredll_generic_textmeasure.o
 @COND_PLATFORM_MACOSX_1@__OSX_CARBON_COCOA_SRC_OBJECTS_14 = $(COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_14)
 COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_1_1 =  \
        coredll_generic_caret.o \
@@ -14807,7 +14890,8 @@ COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_1_0 =  \
        corelib_fontpickerg.o \
        corelib_generic_listctrl.o \
        corelib_prntdlgg.o \
-       corelib_generic_statusbr.o
+       corelib_generic_statusbr.o \
+       corelib_generic_textmeasure.o
 @COND_PLATFORM_MACOSX_1@__OSX_CARBON_COCOA_SRC_OBJECTS_1_0 = $(COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_1_0)
 COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_1_4 =  \
        corelib_generic_caret.o \
@@ -19065,6 +19149,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_settings.o: $(srcdir)/src/gtk/settings.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/settings.cpp
 
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monodll_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monodll_gtk_timer.o: $(srcdir)/src/gtk/timer.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/timer.cpp
 
@@ -19110,6 +19200,33 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_dcscreen.o: $(srcdir)/src/gtk/dcscreen.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/dcscreen.cpp
 
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_X11_USE_GUI_1@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_X11_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monodll_gtk1_app.o: $(srcdir)/src/gtk1/app.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk1/app.cpp
 
@@ -19485,6 +19602,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@monodll_msw_settings.o: $(srcdir)/src/msw/settings.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/settings.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_tooltip.o: $(srcdir)/src/msw/tooltip.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/tooltip.cpp
 
@@ -21690,6 +21813,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@monodll_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
 
+@COND_USE_GUI_1@monodll_textmeasurecmn.o: $(srcdir)/src/common/textmeasurecmn.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/textmeasurecmn.cpp
+
 @COND_USE_GUI_1@monodll_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
 
@@ -24768,6 +24894,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_settings.o: $(srcdir)/src/gtk/settings.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/settings.cpp
 
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monolib_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monolib_gtk_timer.o: $(srcdir)/src/gtk/timer.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/timer.cpp
 
@@ -24813,6 +24945,33 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_dcscreen.o: $(srcdir)/src/gtk/dcscreen.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/dcscreen.cpp
 
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_X11_USE_GUI_1@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_X11_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monolib_gtk1_app.o: $(srcdir)/src/gtk1/app.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk1/app.cpp
 
@@ -25188,6 +25347,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@monolib_msw_settings.o: $(srcdir)/src/msw/settings.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/settings.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_tooltip.o: $(srcdir)/src/msw/tooltip.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/tooltip.cpp
 
@@ -27393,6 +27558,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@monolib_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
 
+@COND_USE_GUI_1@monolib_textmeasurecmn.o: $(srcdir)/src/common/textmeasurecmn.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/textmeasurecmn.cpp
+
 @COND_USE_GUI_1@monolib_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
 
@@ -30636,6 +30804,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_settings.o: $(srcdir)/src/gtk/settings.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/settings.cpp
 
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@coredll_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@coredll_gtk_timer.o: $(srcdir)/src/gtk/timer.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/timer.cpp
 
@@ -30681,6 +30855,33 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_dcscreen.o: $(srcdir)/src/gtk/dcscreen.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/dcscreen.cpp
 
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_X11_USE_GUI_1@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_X11_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@coredll_gtk1_app.o: $(srcdir)/src/gtk1/app.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk1/app.cpp
 
@@ -31056,6 +31257,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@coredll_msw_settings.o: $(srcdir)/src/msw/settings.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/settings.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_tooltip.o: $(srcdir)/src/msw/tooltip.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/tooltip.cpp
 
@@ -33261,6 +33468,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@coredll_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
 
+@COND_USE_GUI_1@coredll_textmeasurecmn.o: $(srcdir)/src/common/textmeasurecmn.cpp $(COREDLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/textmeasurecmn.cpp
+
 @COND_USE_GUI_1@coredll_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
 
@@ -34887,6 +35097,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_settings.o: $(srcdir)/src/gtk/settings.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/settings.cpp
 
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@corelib_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_textmeasure.o: $(srcdir)/src/gtk/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@corelib_gtk_timer.o: $(srcdir)/src/gtk/timer.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/timer.cpp
 
@@ -34932,6 +35148,33 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_dcscreen.o: $(srcdir)/src/gtk/dcscreen.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/dcscreen.cpp
 
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_X11_USE_GUI_1@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_X11_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_generic_textmeasure.o: $(srcdir)/src/generic/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/textmeasure.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@corelib_gtk1_app.o: $(srcdir)/src/gtk1/app.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk1/app.cpp
 
@@ -35307,6 +35550,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@corelib_msw_settings.o: $(srcdir)/src/msw/settings.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/settings.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_msw_textmeasure.o: $(srcdir)/src/msw/textmeasure.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/textmeasure.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_tooltip.o: $(srcdir)/src/msw/tooltip.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/tooltip.cpp
 
@@ -37512,6 +37761,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@corelib_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
 
+@COND_USE_GUI_1@corelib_textmeasurecmn.o: $(srcdir)/src/common/textmeasurecmn.cpp $(CORELIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/textmeasurecmn.cpp
+
 @COND_USE_GUI_1@corelib_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
 
index 2084242cf8f159bbb1d5220742f6fb50dd05530b..5a3bbffc34db357294a41d9b84c7d338dbb4315c 100644 (file)
@@ -737,6 +737,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/common/tbarbase.cpp
     src/common/textcmn.cpp
     src/common/textentrycmn.cpp
+    src/common/textmeasurecmn.cpp
     src/common/toplvcmn.cpp
     src/common/treebase.cpp
     src/common/uiactioncmn.cpp
@@ -1082,6 +1083,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/gtk/region.cpp
     src/gtk/renderer.cpp
     src/gtk/settings.cpp
+    src/gtk/textmeasure.cpp
     src/gtk/timer.cpp
     src/gtk/tooltip.cpp
     src/gtk/toplevel.cpp
@@ -1255,6 +1257,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     $(XWIN_LOWLEVEL_SRC)
     src/generic/icon.cpp
     src/generic/paletteg.cpp
+    src/generic/textmeasure.cpp
     src/gtk1/app.cpp
     src/gtk1/bitmap.cpp
     src/gtk1/brush.cpp
@@ -1416,6 +1419,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 
 <set var="MOTIF_LOWLEVEL_SRC" hints="files">
     $(XWIN_LOWLEVEL_SRC)
+    src/generic/textmeasure.cpp
     src/x11/bitmap.cpp
     src/x11/brush.cpp
     src/x11/palette.cpp
@@ -1581,6 +1585,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 <set var="X11_LOWLEVEL_SRC" hints="files">
     $(XWIN_LOWLEVEL_SRC)
     src/generic/icon.cpp
+    src/generic/textmeasure.cpp
     src/generic/timer.cpp
     src/x11/app.cpp
     src/x11/bitmap.cpp
@@ -1692,6 +1697,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/msw/region.cpp
     src/msw/renderer.cpp
     src/msw/settings.cpp
+    src/msw/textmeasure.cpp
     src/msw/tooltip.cpp
     src/msw/toplevel.cpp
     src/msw/uiaction.cpp
@@ -1965,6 +1971,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/generic/icon.cpp
     src/generic/imaglist.cpp
     src/generic/mask.cpp
+    src/generic/textmeasure.cpp
     src/dfb/app.cpp
     src/dfb/bitmap.cpp
     src/dfb/brush.cpp
@@ -2041,6 +2048,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/generic/mdig.cpp
     src/generic/prntdlgg.cpp
     src/generic/statusbr.cpp
+    src/generic/textmeasure.cpp
     <!-- OS/2 specific files: -->
     src/os2/accel.cpp
     src/os2/app.cpp
@@ -2316,6 +2324,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/generic/listctrl.cpp
     src/generic/prntdlgg.cpp
     src/generic/statusbr.cpp
+    src/generic/textmeasure.cpp
 </if>
 </set>
 
@@ -2658,6 +2667,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/generic/paletteg.cpp
     src/generic/regiong.cpp
     src/generic/statusbr.cpp
+    src/generic/textmeasure.cpp
 </set>
 <set var="COCOA_HDR" hints="files">
     wx/cocoa/NSApplication.h
index e6fb7888a3107ce4efed5e7095c11bd13e7d49e3..ab39f43537f97b14abb461b064d615ebdafeaf5d 100644 (file)
@@ -1796,6 +1796,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.obj \\r
        $(OBJS)\monodll_renderer.obj \\r
        $(OBJS)\monodll_settings.obj \\r
+       $(OBJS)\monodll_textmeasure.obj \
        $(OBJS)\monodll_tooltip.obj \\r
        $(OBJS)\monodll_toplevel.obj \\r
        $(OBJS)\monodll_uiaction.obj \\r
@@ -1981,6 +1982,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.obj \\r
        $(OBJS)\monodll_textcmn.obj \\r
        $(OBJS)\monodll_textentrycmn.obj \\r
+       $(OBJS)\monodll_textmeasurecmn.obj \
        $(OBJS)\monodll_toplvcmn.obj \\r
        $(OBJS)\monodll_treebase.obj \\r
        $(OBJS)\monodll_uiactioncmn.obj \\r
@@ -2071,6 +2073,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.obj \\r
        $(OBJS)\monodll_renderer.obj \\r
        $(OBJS)\monodll_settings.obj \\r
+       $(OBJS)\monodll_textmeasure.obj \
        $(OBJS)\monodll_tooltip.obj \\r
        $(OBJS)\monodll_toplevel.obj \\r
        $(OBJS)\monodll_uiaction.obj \\r
@@ -2250,6 +2253,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.obj \\r
        $(OBJS)\monodll_textcmn.obj \\r
        $(OBJS)\monodll_textentrycmn.obj \\r
+       $(OBJS)\monodll_textmeasurecmn.obj \
        $(OBJS)\monodll_toplvcmn.obj \\r
        $(OBJS)\monodll_treebase.obj \\r
        $(OBJS)\monodll_uiactioncmn.obj \\r
@@ -2587,6 +2591,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.obj \\r
        $(OBJS)\monolib_renderer.obj \\r
        $(OBJS)\monolib_settings.obj \\r
+       $(OBJS)\monolib_textmeasure.obj \
        $(OBJS)\monolib_tooltip.obj \\r
        $(OBJS)\monolib_toplevel.obj \\r
        $(OBJS)\monolib_uiaction.obj \\r
@@ -2772,6 +2777,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.obj \\r
        $(OBJS)\monolib_textcmn.obj \\r
        $(OBJS)\monolib_textentrycmn.obj \\r
+       $(OBJS)\monolib_textmeasurecmn.obj \
        $(OBJS)\monolib_toplvcmn.obj \\r
        $(OBJS)\monolib_treebase.obj \\r
        $(OBJS)\monolib_uiactioncmn.obj \\r
@@ -2862,6 +2868,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.obj \\r
        $(OBJS)\monolib_renderer.obj \\r
        $(OBJS)\monolib_settings.obj \\r
+       $(OBJS)\monolib_textmeasure.obj \
        $(OBJS)\monolib_tooltip.obj \\r
        $(OBJS)\monolib_toplevel.obj \\r
        $(OBJS)\monolib_uiaction.obj \\r
@@ -3041,6 +3048,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.obj \\r
        $(OBJS)\monolib_textcmn.obj \\r
        $(OBJS)\monolib_textentrycmn.obj \\r
+       $(OBJS)\monolib_textmeasurecmn.obj \
        $(OBJS)\monolib_toplvcmn.obj \\r
        $(OBJS)\monolib_treebase.obj \\r
        $(OBJS)\monolib_uiactioncmn.obj \\r
@@ -3259,6 +3267,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.obj \\r
        $(OBJS)\coredll_renderer.obj \\r
        $(OBJS)\coredll_settings.obj \\r
+       $(OBJS)\coredll_textmeasure.obj \
        $(OBJS)\coredll_tooltip.obj \\r
        $(OBJS)\coredll_toplevel.obj \\r
        $(OBJS)\coredll_uiaction.obj \\r
@@ -3444,6 +3453,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.obj \\r
        $(OBJS)\coredll_textcmn.obj \\r
        $(OBJS)\coredll_textentrycmn.obj \\r
+       $(OBJS)\coredll_textmeasurecmn.obj \
        $(OBJS)\coredll_toplvcmn.obj \\r
        $(OBJS)\coredll_treebase.obj \\r
        $(OBJS)\coredll_uiactioncmn.obj \\r
@@ -3534,6 +3544,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.obj \\r
        $(OBJS)\coredll_renderer.obj \\r
        $(OBJS)\coredll_settings.obj \\r
+       $(OBJS)\coredll_textmeasure.obj \
        $(OBJS)\coredll_tooltip.obj \\r
        $(OBJS)\coredll_toplevel.obj \\r
        $(OBJS)\coredll_uiaction.obj \\r
@@ -3713,6 +3724,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.obj \\r
        $(OBJS)\coredll_textcmn.obj \\r
        $(OBJS)\coredll_textentrycmn.obj \\r
+       $(OBJS)\coredll_textmeasurecmn.obj \
        $(OBJS)\coredll_toplvcmn.obj \\r
        $(OBJS)\coredll_treebase.obj \\r
        $(OBJS)\coredll_uiactioncmn.obj \\r
@@ -3807,6 +3819,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.obj \\r
        $(OBJS)\corelib_renderer.obj \\r
        $(OBJS)\corelib_settings.obj \\r
+       $(OBJS)\corelib_textmeasure.obj \
        $(OBJS)\corelib_tooltip.obj \\r
        $(OBJS)\corelib_toplevel.obj \\r
        $(OBJS)\corelib_uiaction.obj \\r
@@ -3992,6 +4005,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.obj \\r
        $(OBJS)\corelib_textcmn.obj \\r
        $(OBJS)\corelib_textentrycmn.obj \\r
+       $(OBJS)\corelib_textmeasurecmn.obj \
        $(OBJS)\corelib_toplvcmn.obj \\r
        $(OBJS)\corelib_treebase.obj \\r
        $(OBJS)\corelib_uiactioncmn.obj \\r
@@ -4082,6 +4096,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.obj \\r
        $(OBJS)\corelib_renderer.obj \\r
        $(OBJS)\corelib_settings.obj \\r
+       $(OBJS)\corelib_textmeasure.obj \
        $(OBJS)\corelib_tooltip.obj \\r
        $(OBJS)\corelib_toplevel.obj \\r
        $(OBJS)\corelib_uiaction.obj \\r
@@ -4261,6 +4276,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.obj \\r
        $(OBJS)\corelib_textcmn.obj \\r
        $(OBJS)\corelib_textentrycmn.obj \\r
+       $(OBJS)\corelib_textmeasurecmn.obj \
        $(OBJS)\corelib_toplvcmn.obj \\r
        $(OBJS)\corelib_treebase.obj \\r
        $(OBJS)\corelib_uiactioncmn.obj \\r
@@ -7496,6 +7512,11 @@ $(OBJS)\monodll_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -8151,6 +8172,11 @@ $(OBJS)\monodll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -9922,6 +9948,11 @@ $(OBJS)\monolib_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -10577,6 +10608,11 @@ $(OBJS)\monolib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -12312,6 +12348,11 @@ $(OBJS)\coredll_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -12967,6 +13008,11 @@ $(OBJS)\coredll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -13732,6 +13778,11 @@ $(OBJS)\corelib_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -14387,6 +14438,11 @@ $(OBJS)\corelib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
index 7200c59fe4d543d55c542f2cb217fb49d1b95979..80c4ad14de1ee84a4f849838efac8264fe4d1d8a 100644 (file)
@@ -1809,6 +1809,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.o \\r
        $(OBJS)\monodll_renderer.o \\r
        $(OBJS)\monodll_settings.o \\r
+       $(OBJS)\monodll_textmeasure.o \
        $(OBJS)\monodll_tooltip.o \\r
        $(OBJS)\monodll_toplevel.o \\r
        $(OBJS)\monodll_uiaction.o \\r
@@ -1994,6 +1995,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.o \\r
        $(OBJS)\monodll_textcmn.o \\r
        $(OBJS)\monodll_textentrycmn.o \\r
+       $(OBJS)\monodll_textmeasurecmn.o \
        $(OBJS)\monodll_toplvcmn.o \\r
        $(OBJS)\monodll_treebase.o \\r
        $(OBJS)\monodll_uiactioncmn.o \\r
@@ -2086,6 +2088,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.o \\r
        $(OBJS)\monodll_renderer.o \\r
        $(OBJS)\monodll_settings.o \\r
+       $(OBJS)\monodll_textmeasure.o \
        $(OBJS)\monodll_tooltip.o \\r
        $(OBJS)\monodll_toplevel.o \\r
        $(OBJS)\monodll_uiaction.o \\r
@@ -2265,6 +2268,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.o \\r
        $(OBJS)\monodll_textcmn.o \\r
        $(OBJS)\monodll_textentrycmn.o \\r
+       $(OBJS)\monodll_textmeasurecmn.o \
        $(OBJS)\monodll_toplvcmn.o \\r
        $(OBJS)\monodll_treebase.o \\r
        $(OBJS)\monodll_uiactioncmn.o \\r
@@ -2606,6 +2610,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.o \\r
        $(OBJS)\monolib_renderer.o \\r
        $(OBJS)\monolib_settings.o \\r
+       $(OBJS)\monolib_textmeasure.o \
        $(OBJS)\monolib_tooltip.o \\r
        $(OBJS)\monolib_toplevel.o \\r
        $(OBJS)\monolib_uiaction.o \\r
@@ -2791,6 +2796,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.o \\r
        $(OBJS)\monolib_textcmn.o \\r
        $(OBJS)\monolib_textentrycmn.o \\r
+       $(OBJS)\monolib_textmeasurecmn.o \
        $(OBJS)\monolib_toplvcmn.o \\r
        $(OBJS)\monolib_treebase.o \\r
        $(OBJS)\monolib_uiactioncmn.o \\r
@@ -2883,6 +2889,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.o \\r
        $(OBJS)\monolib_renderer.o \\r
        $(OBJS)\monolib_settings.o \\r
+       $(OBJS)\monolib_textmeasure.o \
        $(OBJS)\monolib_tooltip.o \\r
        $(OBJS)\monolib_toplevel.o \\r
        $(OBJS)\monolib_uiaction.o \\r
@@ -3062,6 +3069,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.o \\r
        $(OBJS)\monolib_textcmn.o \\r
        $(OBJS)\monolib_textentrycmn.o \\r
+       $(OBJS)\monolib_textmeasurecmn.o \
        $(OBJS)\monolib_toplvcmn.o \\r
        $(OBJS)\monolib_treebase.o \\r
        $(OBJS)\monolib_uiactioncmn.o \\r
@@ -3294,6 +3302,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.o \\r
        $(OBJS)\coredll_renderer.o \\r
        $(OBJS)\coredll_settings.o \\r
+       $(OBJS)\coredll_textmeasure.o \
        $(OBJS)\coredll_tooltip.o \\r
        $(OBJS)\coredll_toplevel.o \\r
        $(OBJS)\coredll_uiaction.o \\r
@@ -3479,6 +3488,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.o \\r
        $(OBJS)\coredll_textcmn.o \\r
        $(OBJS)\coredll_textentrycmn.o \\r
+       $(OBJS)\coredll_textmeasurecmn.o \
        $(OBJS)\coredll_toplvcmn.o \\r
        $(OBJS)\coredll_treebase.o \\r
        $(OBJS)\coredll_uiactioncmn.o \\r
@@ -3571,6 +3581,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.o \\r
        $(OBJS)\coredll_renderer.o \\r
        $(OBJS)\coredll_settings.o \\r
+       $(OBJS)\coredll_textmeasure.o \
        $(OBJS)\coredll_tooltip.o \\r
        $(OBJS)\coredll_toplevel.o \\r
        $(OBJS)\coredll_uiaction.o \\r
@@ -3750,6 +3761,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.o \\r
        $(OBJS)\coredll_textcmn.o \\r
        $(OBJS)\coredll_textentrycmn.o \\r
+       $(OBJS)\coredll_textmeasurecmn.o \
        $(OBJS)\coredll_toplvcmn.o \\r
        $(OBJS)\coredll_treebase.o \\r
        $(OBJS)\coredll_uiactioncmn.o \\r
@@ -3850,6 +3862,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.o \\r
        $(OBJS)\corelib_renderer.o \\r
        $(OBJS)\corelib_settings.o \\r
+       $(OBJS)\corelib_textmeasure.o \
        $(OBJS)\corelib_tooltip.o \\r
        $(OBJS)\corelib_toplevel.o \\r
        $(OBJS)\corelib_uiaction.o \\r
@@ -4035,6 +4048,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.o \\r
        $(OBJS)\corelib_textcmn.o \\r
        $(OBJS)\corelib_textentrycmn.o \\r
+       $(OBJS)\corelib_textmeasurecmn.o \
        $(OBJS)\corelib_toplvcmn.o \\r
        $(OBJS)\corelib_treebase.o \\r
        $(OBJS)\corelib_uiactioncmn.o \\r
@@ -4127,6 +4141,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.o \\r
        $(OBJS)\corelib_renderer.o \\r
        $(OBJS)\corelib_settings.o \\r
+       $(OBJS)\corelib_textmeasure.o \
        $(OBJS)\corelib_tooltip.o \\r
        $(OBJS)\corelib_toplevel.o \\r
        $(OBJS)\corelib_uiaction.o \\r
@@ -4306,6 +4321,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.o \\r
        $(OBJS)\corelib_textcmn.o \\r
        $(OBJS)\corelib_textentrycmn.o \\r
+       $(OBJS)\corelib_textmeasurecmn.o \
        $(OBJS)\corelib_toplvcmn.o \\r
        $(OBJS)\corelib_treebase.o \\r
        $(OBJS)\corelib_uiactioncmn.o \\r
@@ -7665,6 +7681,11 @@ $(OBJS)\monodll_settings.o: ../../src/msw/settings.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monodll_textmeasure.o: ../../src/msw/textmeasure.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monodll_tooltip.o: ../../src/msw/tooltip.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -8320,6 +8341,11 @@ $(OBJS)\monodll_textentrycmn.o: ../../src/common/textentrycmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monodll_textmeasurecmn.o: ../../src/common/textmeasurecmn.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monodll_toplvcmn.o: ../../src/common/toplvcmn.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -10091,6 +10117,11 @@ $(OBJS)\monolib_settings.o: ../../src/msw/settings.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monolib_textmeasure.o: ../../src/msw/textmeasure.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monolib_tooltip.o: ../../src/msw/tooltip.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -10746,6 +10777,11 @@ $(OBJS)\monolib_textentrycmn.o: ../../src/common/textentrycmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monolib_textmeasurecmn.o: ../../src/common/textmeasurecmn.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monolib_toplvcmn.o: ../../src/common/toplvcmn.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -12481,6 +12517,11 @@ $(OBJS)\coredll_settings.o: ../../src/msw/settings.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\coredll_textmeasure.o: ../../src/msw/textmeasure.cpp
+       $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\coredll_tooltip.o: ../../src/msw/tooltip.cpp\r
        $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -13136,6 +13177,11 @@ $(OBJS)\coredll_textentrycmn.o: ../../src/common/textentrycmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\coredll_textmeasurecmn.o: ../../src/common/textmeasurecmn.cpp
+       $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\coredll_toplvcmn.o: ../../src/common/toplvcmn.cpp\r
        $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -13901,6 +13947,11 @@ $(OBJS)\corelib_settings.o: ../../src/msw/settings.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\corelib_textmeasure.o: ../../src/msw/textmeasure.cpp
+       $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\corelib_tooltip.o: ../../src/msw/tooltip.cpp\r
        $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -14556,6 +14607,11 @@ $(OBJS)\corelib_textentrycmn.o: ../../src/common/textentrycmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\corelib_textmeasurecmn.o: ../../src/common/textmeasurecmn.cpp
+       $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\corelib_toplvcmn.o: ../../src/common/toplvcmn.cpp\r
        $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
index 6a6aafad9318b1b8acf6b55423d1f9935bb5072f..8951e51d02f829f119b94ec8d07de7a99e63211f 100644 (file)
@@ -2088,6 +2088,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.obj \\r
        $(OBJS)\monodll_renderer.obj \\r
        $(OBJS)\monodll_settings.obj \\r
+       $(OBJS)\monodll_textmeasure.obj \
        $(OBJS)\monodll_tooltip.obj \\r
        $(OBJS)\monodll_toplevel.obj \\r
        $(OBJS)\monodll_uiaction.obj \\r
@@ -2273,6 +2274,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.obj \\r
        $(OBJS)\monodll_textcmn.obj \\r
        $(OBJS)\monodll_textentrycmn.obj \\r
+       $(OBJS)\monodll_textmeasurecmn.obj \
        $(OBJS)\monodll_toplvcmn.obj \\r
        $(OBJS)\monodll_treebase.obj \\r
        $(OBJS)\monodll_uiactioncmn.obj \\r
@@ -2363,6 +2365,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_region.obj \\r
        $(OBJS)\monodll_renderer.obj \\r
        $(OBJS)\monodll_settings.obj \\r
+       $(OBJS)\monodll_textmeasure.obj \
        $(OBJS)\monodll_tooltip.obj \\r
        $(OBJS)\monodll_toplevel.obj \\r
        $(OBJS)\monodll_uiaction.obj \\r
@@ -2542,6 +2545,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_tbarbase.obj \\r
        $(OBJS)\monodll_textcmn.obj \\r
        $(OBJS)\monodll_textentrycmn.obj \\r
+       $(OBJS)\monodll_textmeasurecmn.obj \
        $(OBJS)\monodll_toplvcmn.obj \\r
        $(OBJS)\monodll_treebase.obj \\r
        $(OBJS)\monodll_uiactioncmn.obj \\r
@@ -2885,6 +2889,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.obj \\r
        $(OBJS)\monolib_renderer.obj \\r
        $(OBJS)\monolib_settings.obj \\r
+       $(OBJS)\monolib_textmeasure.obj \
        $(OBJS)\monolib_tooltip.obj \\r
        $(OBJS)\monolib_toplevel.obj \\r
        $(OBJS)\monolib_uiaction.obj \\r
@@ -3070,6 +3075,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.obj \\r
        $(OBJS)\monolib_textcmn.obj \\r
        $(OBJS)\monolib_textentrycmn.obj \\r
+       $(OBJS)\monolib_textmeasurecmn.obj \
        $(OBJS)\monolib_toplvcmn.obj \\r
        $(OBJS)\monolib_treebase.obj \\r
        $(OBJS)\monolib_uiactioncmn.obj \\r
@@ -3160,6 +3166,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_region.obj \\r
        $(OBJS)\monolib_renderer.obj \\r
        $(OBJS)\monolib_settings.obj \\r
+       $(OBJS)\monolib_textmeasure.obj \
        $(OBJS)\monolib_tooltip.obj \\r
        $(OBJS)\monolib_toplevel.obj \\r
        $(OBJS)\monolib_uiaction.obj \\r
@@ -3339,6 +3346,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_tbarbase.obj \\r
        $(OBJS)\monolib_textcmn.obj \\r
        $(OBJS)\monolib_textentrycmn.obj \\r
+       $(OBJS)\monolib_textmeasurecmn.obj \
        $(OBJS)\monolib_toplvcmn.obj \\r
        $(OBJS)\monolib_treebase.obj \\r
        $(OBJS)\monolib_uiactioncmn.obj \\r
@@ -3623,6 +3631,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.obj \\r
        $(OBJS)\coredll_renderer.obj \\r
        $(OBJS)\coredll_settings.obj \\r
+       $(OBJS)\coredll_textmeasure.obj \
        $(OBJS)\coredll_tooltip.obj \\r
        $(OBJS)\coredll_toplevel.obj \\r
        $(OBJS)\coredll_uiaction.obj \\r
@@ -3808,6 +3817,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.obj \\r
        $(OBJS)\coredll_textcmn.obj \\r
        $(OBJS)\coredll_textentrycmn.obj \\r
+       $(OBJS)\coredll_textmeasurecmn.obj \
        $(OBJS)\coredll_toplvcmn.obj \\r
        $(OBJS)\coredll_treebase.obj \\r
        $(OBJS)\coredll_uiactioncmn.obj \\r
@@ -3898,6 +3908,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_region.obj \\r
        $(OBJS)\coredll_renderer.obj \\r
        $(OBJS)\coredll_settings.obj \\r
+       $(OBJS)\coredll_textmeasure.obj \
        $(OBJS)\coredll_tooltip.obj \\r
        $(OBJS)\coredll_toplevel.obj \\r
        $(OBJS)\coredll_uiaction.obj \\r
@@ -4077,6 +4088,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_tbarbase.obj \\r
        $(OBJS)\coredll_textcmn.obj \\r
        $(OBJS)\coredll_textentrycmn.obj \\r
+       $(OBJS)\coredll_textmeasurecmn.obj \
        $(OBJS)\coredll_toplvcmn.obj \\r
        $(OBJS)\coredll_treebase.obj \\r
        $(OBJS)\coredll_uiactioncmn.obj \\r
@@ -4177,6 +4189,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.obj \\r
        $(OBJS)\corelib_renderer.obj \\r
        $(OBJS)\corelib_settings.obj \\r
+       $(OBJS)\corelib_textmeasure.obj \
        $(OBJS)\corelib_tooltip.obj \\r
        $(OBJS)\corelib_toplevel.obj \\r
        $(OBJS)\corelib_uiaction.obj \\r
@@ -4362,6 +4375,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.obj \\r
        $(OBJS)\corelib_textcmn.obj \\r
        $(OBJS)\corelib_textentrycmn.obj \\r
+       $(OBJS)\corelib_textmeasurecmn.obj \
        $(OBJS)\corelib_toplvcmn.obj \\r
        $(OBJS)\corelib_treebase.obj \\r
        $(OBJS)\corelib_uiactioncmn.obj \\r
@@ -4452,6 +4466,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_region.obj \\r
        $(OBJS)\corelib_renderer.obj \\r
        $(OBJS)\corelib_settings.obj \\r
+       $(OBJS)\corelib_textmeasure.obj \
        $(OBJS)\corelib_tooltip.obj \\r
        $(OBJS)\corelib_toplevel.obj \\r
        $(OBJS)\corelib_uiaction.obj \\r
@@ -4631,6 +4646,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_tbarbase.obj \\r
        $(OBJS)\corelib_textcmn.obj \\r
        $(OBJS)\corelib_textentrycmn.obj \\r
+       $(OBJS)\corelib_textmeasurecmn.obj \
        $(OBJS)\corelib_toplvcmn.obj \\r
        $(OBJS)\corelib_treebase.obj \\r
        $(OBJS)\corelib_uiactioncmn.obj \\r
@@ -8180,6 +8196,11 @@ $(OBJS)\monodll_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -8835,6 +8856,11 @@ $(OBJS)\monodll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -10606,6 +10632,11 @@ $(OBJS)\monolib_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -11261,6 +11292,11 @@ $(OBJS)\monolib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -12996,6 +13032,11 @@ $(OBJS)\coredll_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -13651,6 +13692,11 @@ $(OBJS)\coredll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
@@ -14416,6 +14462,11 @@ $(OBJS)\corelib_settings.obj: ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_textmeasure.obj: ..\..\src\msw\textmeasure.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\textmeasure.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_tooltip.obj: ..\..\src\msw\tooltip.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\tooltip.cpp\r
 !endif\r
@@ -15071,6 +15122,11 @@ $(OBJS)\corelib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_textmeasurecmn.obj: ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\textmeasurecmn.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\toplvcmn.cpp\r
 !endif\r
index 248328c26c1877043fc70e93e5f25aedb8e86551..be05670d88d1b788a2cc75ae8e57bea338437753 100644 (file)
@@ -302,6 +302,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_region.obj &\r
        $(OBJS)\monodll_renderer.obj &\r
        $(OBJS)\monodll_settings.obj &\r
+       $(OBJS)\monodll_textmeasure.obj &
        $(OBJS)\monodll_tooltip.obj &\r
        $(OBJS)\monodll_toplevel.obj &\r
        $(OBJS)\monodll_uiaction.obj &\r
@@ -487,6 +488,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_tbarbase.obj &\r
        $(OBJS)\monodll_textcmn.obj &\r
        $(OBJS)\monodll_textentrycmn.obj &\r
+       $(OBJS)\monodll_textmeasurecmn.obj &
        $(OBJS)\monodll_toplvcmn.obj &\r
        $(OBJS)\monodll_treebase.obj &\r
        $(OBJS)\monodll_uiactioncmn.obj &\r
@@ -579,6 +581,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_region.obj &\r
        $(OBJS)\monodll_renderer.obj &\r
        $(OBJS)\monodll_settings.obj &\r
+       $(OBJS)\monodll_textmeasure.obj &
        $(OBJS)\monodll_tooltip.obj &\r
        $(OBJS)\monodll_toplevel.obj &\r
        $(OBJS)\monodll_uiaction.obj &\r
@@ -758,6 +761,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_tbarbase.obj &\r
        $(OBJS)\monodll_textcmn.obj &\r
        $(OBJS)\monodll_textentrycmn.obj &\r
+       $(OBJS)\monodll_textmeasurecmn.obj &
        $(OBJS)\monodll_toplvcmn.obj &\r
        $(OBJS)\monodll_treebase.obj &\r
        $(OBJS)\monodll_uiactioncmn.obj &\r
@@ -1104,6 +1108,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_region.obj &\r
        $(OBJS)\monolib_renderer.obj &\r
        $(OBJS)\monolib_settings.obj &\r
+       $(OBJS)\monolib_textmeasure.obj &
        $(OBJS)\monolib_tooltip.obj &\r
        $(OBJS)\monolib_toplevel.obj &\r
        $(OBJS)\monolib_uiaction.obj &\r
@@ -1289,6 +1294,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_tbarbase.obj &\r
        $(OBJS)\monolib_textcmn.obj &\r
        $(OBJS)\monolib_textentrycmn.obj &\r
+       $(OBJS)\monolib_textmeasurecmn.obj &
        $(OBJS)\monolib_toplvcmn.obj &\r
        $(OBJS)\monolib_treebase.obj &\r
        $(OBJS)\monolib_uiactioncmn.obj &\r
@@ -1381,6 +1387,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_region.obj &\r
        $(OBJS)\monolib_renderer.obj &\r
        $(OBJS)\monolib_settings.obj &\r
+       $(OBJS)\monolib_textmeasure.obj &
        $(OBJS)\monolib_tooltip.obj &\r
        $(OBJS)\monolib_toplevel.obj &\r
        $(OBJS)\monolib_uiaction.obj &\r
@@ -1560,6 +1567,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_tbarbase.obj &\r
        $(OBJS)\monolib_textcmn.obj &\r
        $(OBJS)\monolib_textentrycmn.obj &\r
+       $(OBJS)\monolib_textmeasurecmn.obj &
        $(OBJS)\monolib_toplvcmn.obj &\r
        $(OBJS)\monolib_treebase.obj &\r
        $(OBJS)\monolib_uiactioncmn.obj &\r
@@ -1803,6 +1811,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_region.obj &\r
        $(OBJS)\coredll_renderer.obj &\r
        $(OBJS)\coredll_settings.obj &\r
+       $(OBJS)\coredll_textmeasure.obj &
        $(OBJS)\coredll_tooltip.obj &\r
        $(OBJS)\coredll_toplevel.obj &\r
        $(OBJS)\coredll_uiaction.obj &\r
@@ -1988,6 +1997,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_tbarbase.obj &\r
        $(OBJS)\coredll_textcmn.obj &\r
        $(OBJS)\coredll_textentrycmn.obj &\r
+       $(OBJS)\coredll_textmeasurecmn.obj &
        $(OBJS)\coredll_toplvcmn.obj &\r
        $(OBJS)\coredll_treebase.obj &\r
        $(OBJS)\coredll_uiactioncmn.obj &\r
@@ -2080,6 +2090,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_region.obj &\r
        $(OBJS)\coredll_renderer.obj &\r
        $(OBJS)\coredll_settings.obj &\r
+       $(OBJS)\coredll_textmeasure.obj &
        $(OBJS)\coredll_tooltip.obj &\r
        $(OBJS)\coredll_toplevel.obj &\r
        $(OBJS)\coredll_uiaction.obj &\r
@@ -2259,6 +2270,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_tbarbase.obj &\r
        $(OBJS)\coredll_textcmn.obj &\r
        $(OBJS)\coredll_textentrycmn.obj &\r
+       $(OBJS)\coredll_textmeasurecmn.obj &
        $(OBJS)\coredll_toplvcmn.obj &\r
        $(OBJS)\coredll_treebase.obj &\r
        $(OBJS)\coredll_uiactioncmn.obj &\r
@@ -2361,6 +2373,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_region.obj &\r
        $(OBJS)\corelib_renderer.obj &\r
        $(OBJS)\corelib_settings.obj &\r
+       $(OBJS)\corelib_textmeasure.obj &
        $(OBJS)\corelib_tooltip.obj &\r
        $(OBJS)\corelib_toplevel.obj &\r
        $(OBJS)\corelib_uiaction.obj &\r
@@ -2546,6 +2559,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_tbarbase.obj &\r
        $(OBJS)\corelib_textcmn.obj &\r
        $(OBJS)\corelib_textentrycmn.obj &\r
+       $(OBJS)\corelib_textmeasurecmn.obj &
        $(OBJS)\corelib_toplvcmn.obj &\r
        $(OBJS)\corelib_treebase.obj &\r
        $(OBJS)\corelib_uiactioncmn.obj &\r
@@ -2638,6 +2652,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_region.obj &\r
        $(OBJS)\corelib_renderer.obj &\r
        $(OBJS)\corelib_settings.obj &\r
+       $(OBJS)\corelib_textmeasure.obj &
        $(OBJS)\corelib_tooltip.obj &\r
        $(OBJS)\corelib_toplevel.obj &\r
        $(OBJS)\corelib_uiaction.obj &\r
@@ -2817,6 +2832,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_tbarbase.obj &\r
        $(OBJS)\corelib_textcmn.obj &\r
        $(OBJS)\corelib_textentrycmn.obj &\r
+       $(OBJS)\corelib_textmeasurecmn.obj &
        $(OBJS)\corelib_toplvcmn.obj &\r
        $(OBJS)\corelib_treebase.obj &\r
        $(OBJS)\corelib_uiactioncmn.obj &\r
@@ -7938,6 +7954,11 @@ $(OBJS)\monodll_settings.obj :  .AUTODEPEND ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monodll_textmeasure.obj :  .AUTODEPEND ..\..\src\msw\textmeasure.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monodll_tooltip.obj :  .AUTODEPEND ..\..\src\msw\tooltip.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 !endif\r
@@ -8593,6 +8614,11 @@ $(OBJS)\monodll_textentrycmn.obj :  .AUTODEPEND ..\..\src\common\textentrycmn.cp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monodll_textmeasurecmn.obj :  .AUTODEPEND ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monodll_toplvcmn.obj :  .AUTODEPEND ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 !endif\r
@@ -10364,6 +10390,11 @@ $(OBJS)\monolib_settings.obj :  .AUTODEPEND ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monolib_textmeasure.obj :  .AUTODEPEND ..\..\src\msw\textmeasure.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monolib_tooltip.obj :  .AUTODEPEND ..\..\src\msw\tooltip.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 !endif\r
@@ -11019,6 +11050,11 @@ $(OBJS)\monolib_textentrycmn.obj :  .AUTODEPEND ..\..\src\common\textentrycmn.cp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monolib_textmeasurecmn.obj :  .AUTODEPEND ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monolib_toplvcmn.obj :  .AUTODEPEND ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 !endif\r
@@ -12754,6 +12790,11 @@ $(OBJS)\coredll_settings.obj :  .AUTODEPEND ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\coredll_textmeasure.obj :  .AUTODEPEND ..\..\src\msw\textmeasure.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\coredll_tooltip.obj :  .AUTODEPEND ..\..\src\msw\tooltip.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
 !endif\r
@@ -13409,6 +13450,11 @@ $(OBJS)\coredll_textentrycmn.obj :  .AUTODEPEND ..\..\src\common\textentrycmn.cp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\coredll_textmeasurecmn.obj :  .AUTODEPEND ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\coredll_toplvcmn.obj :  .AUTODEPEND ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
 !endif\r
@@ -14174,6 +14220,11 @@ $(OBJS)\corelib_settings.obj :  .AUTODEPEND ..\..\src\msw\settings.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\corelib_textmeasure.obj :  .AUTODEPEND ..\..\src\msw\textmeasure.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\corelib_tooltip.obj :  .AUTODEPEND ..\..\src\msw\tooltip.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
 !endif\r
@@ -14829,6 +14880,11 @@ $(OBJS)\corelib_textentrycmn.obj :  .AUTODEPEND ..\..\src\common\textentrycmn.cp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\corelib_textmeasurecmn.obj :  .AUTODEPEND ..\..\src\common\textmeasurecmn.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\corelib_toplvcmn.obj :  .AUTODEPEND ..\..\src\common\toplvcmn.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
 !endif\r
index dab6894f7ea423036dbd28cbabf401bfef65bb7b..8de65235b6dbc6d234f7ffc5bbb3d15f9cb7cdf9 100644 (file)
@@ -714,6 +714,10 @@ SOURCE=..\..\src\common\textentrycmn.cpp
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\src\common\textmeasurecmn.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\common\toplvcmn.cpp\r
 # End Source File\r
 # Begin Source File\r
@@ -2708,6 +2712,10 @@ SOURCE=..\..\src\msw\textentry.cpp
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\src\msw\textmeasure.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\msw\tglbtn.cpp\r
 \r
 !IF  "$(CFG)" == "core - Win32 DLL Universal Release"\r
index 6c6888b9c3ba4bc8617277454a54475c18bf97ba..9766ef2d0300b9a421e304f0ef7c8847907d6d06 100644 (file)
                        <File\r
                                RelativePath="..\..\src\common\textentrycmn.cpp">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\textmeasurecmn.cpp">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\toplvcmn.cpp">\r
                        </File>\r
                                        Name="DLL Universal Release|Win32"\r
                                        ExcludedFromBuild="TRUE"/>\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\msw\textmeasure.cpp">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\msw\tglbtn.cpp">\r
                                <FileConfiguration\r
index 178f1159b497252e6684aded03605e8397b5711c..2cf20954ae697c0629fdde09c2b1eac3a03f4848 100644 (file)
                                RelativePath="..\..\src\common\textentrycmn.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\textmeasurecmn.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\toplvcmn.cpp"\r
                                >\r
                                        ExcludedFromBuild="true"\r
                                />\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\msw\textmeasure.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\msw\tglbtn.cpp"\r
                                >\r
index 68d8e74f06ffb6d91ee5ce858f1470b770ba8156..5f2577882324aa7e1d83d7d0ab1498f4e792b1a9 100644 (file)
                                RelativePath="..\..\src\common\textentrycmn.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\textmeasurecmn.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\toplvcmn.cpp"\r
                                >\r
                                        ExcludedFromBuild="true"\r
                                />\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\msw\textmeasure.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\msw\tglbtn.cpp"\r
                                >\r
diff --git a/include/wx/generic/private/textmeasure.h b/include/wx/generic/private/textmeasure.h
new file mode 100644 (file)
index 0000000..5d44f35
--- /dev/null
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/generic/private/textmeasure.h
+// Purpose:     Generic wxTextMeasure declaration.
+// Author:      Vadim Zeitlin
+// Created:     2012-10-17
+// RCS-ID:      $Id$
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
+#define _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
+
+// ----------------------------------------------------------------------------
+// wxTextMeasure for the platforms without native support.
+// ----------------------------------------------------------------------------
+
+class wxTextMeasure : public wxTextMeasureBase
+{
+public:
+    wxTextMeasure(const wxDC *dc, const wxFont *font)
+        : wxTextMeasureBase(dc, font) {}
+    wxTextMeasure(const wxWindow *win, const wxFont *font)
+        : wxTextMeasureBase(win, font) {}
+
+protected:
+    virtual void DoGetTextExtent(const wxString& string,
+                               wxCoord *width,
+                               wxCoord *height,
+                               wxCoord *descent = NULL,
+                               wxCoord *externalLeading = NULL);
+
+    virtual bool DoGetPartialTextExtents(const wxString& text,
+                                         wxArrayInt& widths,
+                                         double scaleX);
+
+    wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
+};
+
+#endif // _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
diff --git a/include/wx/gtk/private/textmeasure.h b/include/wx/gtk/private/textmeasure.h
new file mode 100644 (file)
index 0000000..ad9a43c
--- /dev/null
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/gtk/private/textmeasure.h
+// Purpose:     wxGTK-specific declaration of wxTextMeasure class
+// Author:      Manuel Martin
+// Created:     2012-19-05
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_GTK_PRIVATE_TEXTMEASURE_H_
+#define _WX_GTK_PRIVATE_TEXTMEASURE_H_
+
+// ----------------------------------------------------------------------------
+// wxTextMeasure
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl;
+
+class wxTextMeasure : public wxTextMeasureBase
+{
+public:
+    wxTextMeasure(const wxDC *dc, const wxFont *font)
+        : wxTextMeasureBase(dc, font)
+    {
+        Init();
+    }
+
+    wxTextMeasure(const wxWindow *win, const wxFont *font)
+        : wxTextMeasureBase(win, font)
+    {
+        Init();
+    }
+
+protected:
+    // Common part of both ctors.
+    void Init();
+
+    virtual void BeginMeasuring();
+    virtual void EndMeasuring();
+
+    virtual void DoGetTextExtent(const wxString& string,
+                                 wxCoord *width,
+                                 wxCoord *height,
+                                 wxCoord *descent = NULL,
+                                 wxCoord *externalLeading = NULL);
+
+    virtual bool DoGetPartialTextExtents(const wxString& text,
+                                         wxArrayInt& widths,
+                                         double scaleX);
+
+
+    // This class is only used for DC text measuring with GTK+ 2 as GTK+ 3 uses
+    // Cairo and not Pango for this. However it's still used even with GTK+ 3
+    // for window text measuring, so the context and the layout are still
+    // needed.
+#ifndef __WXGTK3__
+    wxWindowDCImpl *m_wdc;
+#endif // GTK+ < 3
+    PangoContext *m_context;
+    PangoLayout *m_layout;
+
+    wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
+};
+
+#endif // _WX_GTK_PRIVATE_TEXTMEASURE_H_
diff --git a/include/wx/msw/private/textmeasure.h b/include/wx/msw/private/textmeasure.h
new file mode 100644 (file)
index 0000000..2651a60
--- /dev/null
@@ -0,0 +1,62 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/msw/private/textmeasure.h
+// Purpose:     wxMSW-specific declaration of wxTextMeasure class
+// Author:      Manuel Martin
+// Created:     2012-10-05
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_PRIVATE_TEXTMEASURE_H_
+#define _WX_MSW_PRIVATE_TEXTMEASURE_H_
+
+#include "wx/msw/wrapwin.h"
+
+// ----------------------------------------------------------------------------
+// wxTextMeasure for MSW.
+// ----------------------------------------------------------------------------
+
+class wxTextMeasure : public wxTextMeasureBase
+{
+public:
+    wxTextMeasure(const wxDC *dc, const wxFont *font)
+        : wxTextMeasureBase(dc, font)
+    {
+        Init();
+    }
+    wxTextMeasure(const wxWindow *win, const wxFont *font)
+        : wxTextMeasureBase(win, font)
+    {
+        Init();
+    }
+
+protected:
+    void Init();
+
+    virtual void BeginMeasuring();
+    virtual void EndMeasuring();
+
+    virtual void DoGetTextExtent(const wxString& string,
+                               wxCoord *width,
+                               wxCoord *height,
+                               wxCoord *descent = NULL,
+                               wxCoord *externalLeading = NULL);
+
+    virtual bool DoGetPartialTextExtents(const wxString& text,
+                                         wxArrayInt& widths,
+                                         double scaleX);
+
+
+
+    // We use either the HDC of the provided wxDC or an HDC created for our
+    // window.
+    HDC m_hdc;
+
+    // If we change the font in BeginMeasuring(), we restore it to the old one
+    // in EndMeasuring().
+    HFONT m_hfontOld;
+
+    wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
+};
+
+#endif // _WX_MSW_PRIVATE_TEXTMEASURE_H_
diff --git a/include/wx/private/textmeasure.h b/include/wx/private/textmeasure.h
new file mode 100644 (file)
index 0000000..0e853c5
--- /dev/null
@@ -0,0 +1,138 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/private/textmeasure.h
+// Purpose:     declaration of wxTextMeasure class
+// Author:      Manuel Martin
+// Created:     2012-10-05
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_PRIVATE_TEXTMEASURE_H_
+#define _WX_PRIVATE_TEXTMEASURE_H_
+
+#include "wx/vector.h"
+
+class WXDLLIMPEXP_FWD_CORE wxDC;
+class WXDLLIMPEXP_FWD_CORE wxFont;
+class WXDLLIMPEXP_FWD_CORE wxWindow;
+
+// ----------------------------------------------------------------------------
+// wxTextMeasure: class used to measure text extent.
+// ----------------------------------------------------------------------------
+
+class wxTextMeasureBase
+{
+public:
+    // The first ctor argument must be non-NULL, i.e. each object of this class
+    // is associated with either a valid wxDC or a valid wxWindow.
+    wxTextMeasureBase(const wxDC *dc, const wxFont *theFont);
+    wxTextMeasureBase(const wxWindow *win, const wxFont *theFont);
+
+    // Even though this class is not supposed to be used polymorphically, give
+    // it a virtual dtor to avoid compiler warnings.
+    virtual ~wxTextMeasureBase() { }
+
+
+    // Return the extent of a single line string.
+    void GetTextExtent(const wxString& string,
+                       wxCoord *width,
+                       wxCoord *height,
+                       wxCoord *descent = NULL,
+                       wxCoord *externalLeading = NULL);
+
+    // The same for a multiline (with '\n') string.
+    void GetMultiLineTextExtent(const wxString& text,
+                                wxCoord *width,
+                                wxCoord *height,
+                                wxCoord *heightOneLine = NULL);
+
+    // Find the dimensions of the largest string.
+    void GetLargestStringExtent(const wxVector<wxString>& strings,
+                                wxCoord *width,
+                                wxCoord *height);
+
+    // Fill the array with the widths for each "0..N" substrings for N from 1
+    // to text.length().
+    //
+    // The scaleX argument is the horizontal scale used by wxDC and is only
+    // used in the generic implementation.
+    bool GetPartialTextExtents(const wxString& text,
+                               wxArrayInt& widths,
+                               double scaleX);
+
+protected:
+    // These functions are called by our public methods before and after each
+    // call to DoGetTextExtent(). Derived classes may override them to prepare
+    // for -- possibly several -- subsequent calls to DoGetTextExtent().
+    //
+    // As these calls must be always paired, they're never called directly but
+    // only by our friend MeasuringGuard class.
+    virtual void BeginMeasuring() { }
+    virtual void EndMeasuring() { }
+
+    // RAII wrapper for the two methods above.
+    class MeasuringGuard
+    {
+    public:
+        MeasuringGuard(wxTextMeasureBase& tm) : m_tm(tm)
+        {
+            m_tm.BeginMeasuring();
+        }
+
+        ~MeasuringGuard()
+        {
+            m_tm.EndMeasuring();
+        }
+
+    private:
+        wxTextMeasureBase& m_tm;
+    };
+
+
+    // The main function of this class, to be implemented in platform-specific
+    // way used by all our public methods except GetLargestStringExtents().
+    //
+    // The width and height pointers here are never NULL and the input string
+    // is not empty.
+    virtual void DoGetTextExtent(const wxString& string,
+                                 wxCoord *width,
+                                 wxCoord *height,
+                                 wxCoord *descent = NULL,
+                                 wxCoord *externalLeading = NULL) = 0;
+
+    // The real implementation of GetPartialTextExtents().
+    //
+    // On input, widths array contains text.length() zero elements and the text
+    // is guaranteed to be non-empty.
+    virtual bool DoGetPartialTextExtents(const wxString& text,
+                                         wxArrayInt& widths,
+                                         double scaleX) = 0;
+
+
+    // Exactly one of m_dc and m_win is non-NULL for any given object of this
+    // class.
+    const wxDC* const m_dc;
+    const wxWindow* const m_win;
+
+    // This one can be NULL or not.
+    const wxFont* const m_font;
+
+    wxDECLARE_NO_COPY_CLASS(wxTextMeasureBase);
+};
+
+// Include the platform dependant class declaration, if any.
+#if defined(__WXGTK20__)
+    #include "wx/gtk/private/textmeasure.h"
+#elif defined(__WXMSW__)
+    #include "wx/msw/private/textmeasure.h"
+#else // no platform-specific implementation of wxTextMeasure yet
+    #include "wx/generic/private/textmeasure.h"
+
+    #define wxUSE_GENERIC_TEXTMEASURE 1
+#endif
+
+#ifndef wxUSE_GENERIC_TEXTMEASURE
+    #define wxUSE_GENERIC_TEXTMEASURE 0
+#endif
+
+#endif // _WX_PRIVATE_TEXTMEASURE_H_
index 49fdb5f3620593c89548963be6a2be6d07f65d6e..46a163129c954a791742e0b8c405cc057be9e196 100644 (file)
@@ -38,6 +38,8 @@
     #include "wx/window.h"
 #endif
 
+#include "wx/private/textmeasure.h"
+
 #ifdef __WXMSW__
     #include "wx/msw/dcclient.h"
     #include "wx/msw/dcmemory.h"
@@ -511,78 +513,10 @@ void wxDCImpl::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
     ComputeScaleAndOrigin();
 }
 
-
-// Each element of the widths array will be the width of the string up to and
-// including the corresponding character in text.  This is the generic
-// implementation, the port-specific classes should do this with native APIs
-// if available and if faster.  Note: pango_layout_index_to_pos is much slower
-// than calling GetTextExtent!!
-
-#define FWC_SIZE 256
-
-class FontWidthCache
-{
-public:
-    FontWidthCache() : m_scaleX(1), m_widths(NULL) { }
-    ~FontWidthCache() { delete []m_widths; }
-
-    void Reset()
-    {
-        if (!m_widths)
-            m_widths = new int[FWC_SIZE];
-
-        memset(m_widths, 0, sizeof(int)*FWC_SIZE);
-    }
-
-    wxFont m_font;
-    double m_scaleX;
-    int *m_widths;
-};
-
-static FontWidthCache s_fontWidthCache;
-
 bool wxDCImpl::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
 {
-    int totalWidth = 0;
-
-    const size_t len = text.length();
-    widths.Empty();
-    widths.Add(0, len);
-
-    // reset the cache if font or horizontal scale have changed
-    if ( !s_fontWidthCache.m_widths ||
-         !wxIsSameDouble(s_fontWidthCache.m_scaleX, m_scaleX) ||
-         (s_fontWidthCache.m_font != GetFont()) )
-    {
-        s_fontWidthCache.Reset();
-        s_fontWidthCache.m_font = GetFont();
-        s_fontWidthCache.m_scaleX = m_scaleX;
-    }
-
-    // Calculate the position of each character based on the widths of
-    // the previous characters
-    int w, h;
-    for ( size_t i = 0; i < len; i++ )
-    {
-        const wxChar c = text[i];
-        unsigned int c_int = (unsigned int)c;
-
-        if ((c_int < FWC_SIZE) && (s_fontWidthCache.m_widths[c_int] != 0))
-        {
-            w = s_fontWidthCache.m_widths[c_int];
-        }
-        else
-        {
-            DoGetTextExtent(c, &w, &h);
-            if (c_int < FWC_SIZE)
-                s_fontWidthCache.m_widths[c_int] = w;
-        }
-
-        totalWidth += w;
-        widths[i] = totalWidth;
-    }
-
-    return true;
+    wxTextMeasure tm(GetOwner(), &m_font);
+    return tm.GetPartialTextExtents(text, widths, m_scaleX);
 }
 
 void wxDCImpl::GetMultiLineTextExtent(const wxString& text,
@@ -591,64 +525,8 @@ void wxDCImpl::GetMultiLineTextExtent(const wxString& text,
                                       wxCoord *h,
                                       const wxFont *font) const
 {
-    wxCoord widthTextMax = 0, widthLine,
-            heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
-
-    wxString curLine;
-    for ( wxString::const_iterator pc = text.begin(); ; ++pc )
-    {
-        if ( pc == text.end() || *pc == wxT('\n') )
-        {
-            if ( curLine.empty() )
-            {
-                // we can't use GetTextExtent - it will return 0 for both width
-                // and height and an empty line should count in height
-                // calculation
-
-                // assume that this line has the same height as the previous
-                // one
-                if ( !heightLineDefault )
-                    heightLineDefault = heightLine;
-
-                if ( !heightLineDefault )
-                {
-                    // but we don't know it yet - choose something reasonable
-                    DoGetTextExtent(wxT("W"), NULL, &heightLineDefault,
-                                  NULL, NULL, font);
-                }
-
-                heightTextTotal += heightLineDefault;
-            }
-            else
-            {
-                DoGetTextExtent(curLine, &widthLine, &heightLine,
-                              NULL, NULL, font);
-                if ( widthLine > widthTextMax )
-                    widthTextMax = widthLine;
-                heightTextTotal += heightLine;
-            }
-
-            if ( pc == text.end() )
-            {
-               break;
-            }
-            else // '\n'
-            {
-               curLine.clear();
-            }
-        }
-        else
-        {
-            curLine += *pc;
-        }
-    }
-
-    if ( x )
-        *x = widthTextMax;
-    if ( y )
-        *y = heightTextTotal;
-    if ( h )
-        *h = heightLine;
+    wxTextMeasure tm(GetOwner(), font && font->IsOk() ? font : &m_font);
+    tm.GetMultiLineTextExtent(text, x, y, h);
 }
 
 void wxDCImpl::DoDrawCheckMark(wxCoord x1, wxCoord y1,
diff --git a/src/common/textmeasurecmn.cpp b/src/common/textmeasurecmn.cpp
new file mode 100644 (file)
index 0000000..bb16ac0
--- /dev/null
@@ -0,0 +1,178 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/common/textmeasurecmn.cpp
+// Purpose:     wxTextMeasureBase implementation
+// Author:      Manuel Martin
+// Created:     2012-10-05
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/dc.h"
+    #include "wx/window.h"
+#endif //WX_PRECOMP
+
+#include "wx/private/textmeasure.h"
+
+// ============================================================================
+// wxTextMeasureBase implementation
+// ============================================================================
+
+wxTextMeasureBase::wxTextMeasureBase(const wxDC *dc, const wxFont *theFont)
+    : m_dc(dc),
+      m_win(NULL),
+      m_font(theFont)
+{
+    wxASSERT_MSG( dc, wxS("wxTextMeasure needs a valid wxDC") );
+}
+
+wxTextMeasureBase::wxTextMeasureBase(const wxWindow *win, const wxFont *theFont)
+    : m_dc(NULL),
+      m_win(win),
+      m_font(theFont)
+{
+    wxASSERT_MSG( win, wxS("wxTextMeasure needs a valid wxWindow") );
+}
+
+void wxTextMeasureBase::GetTextExtent(const wxString& string,
+                                      wxCoord *width,
+                                      wxCoord *height,
+                                      wxCoord *descent,
+                                      wxCoord *externalLeading)
+{
+    // To make the code simpler, make sure that the width and height pointers
+    // are always valid, even if they point to dummy variables.
+    int unusedWidth, unusedHeight;
+    if ( !width )
+        width = &unusedWidth;
+    if ( !height )
+        height = &unusedHeight;
+
+    if ( string.empty() )
+    {
+        *width =
+        *height = 0;
+
+        return;
+    }
+
+    MeasuringGuard guard(*this);
+
+    DoGetTextExtent(string, width, height, descent, externalLeading);
+}
+
+void wxTextMeasureBase::GetMultiLineTextExtent(const wxString& text,
+                                               wxCoord *width,
+                                               wxCoord *height,
+                                               wxCoord *heightOneLine)
+{
+    MeasuringGuard guard(*this);
+
+    wxCoord widthTextMax = 0, widthLine,
+            heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
+
+    wxString curLine;
+    for ( wxString::const_iterator pc = text.begin(); ; ++pc )
+    {
+        if ( pc == text.end() || *pc == wxS('\n') )
+        {
+            if ( curLine.empty() )
+            {
+                // we can't use GetTextExtent - it will return 0 for both width
+                // and height and an empty line should count in height
+                // calculation
+
+                // assume that this line has the same height as the previous
+                // one
+                if ( !heightLineDefault )
+                    heightLineDefault = heightLine;
+
+                if ( !heightLineDefault )
+                {
+                    // but we don't know it yet - choose something reasonable
+                    DoGetTextExtent(wxS("W"), NULL, &heightLineDefault);
+                }
+
+                heightTextTotal += heightLineDefault;
+            }
+            else
+            {
+                DoGetTextExtent(curLine, &widthLine, &heightLine);
+                if ( widthLine > widthTextMax )
+                    widthTextMax = widthLine;
+                heightTextTotal += heightLine;
+            }
+
+            if ( pc == text.end() )
+            {
+               break;
+            }
+            else // '\n'
+            {
+               curLine.clear();
+            }
+        }
+        else
+        {
+            curLine += *pc;
+        }
+    }
+
+    if ( width )
+        *width = widthTextMax;
+    if ( height )
+        *height = heightTextTotal;
+    if ( heightOneLine )
+        *heightOneLine = heightLine;
+}
+
+void wxTextMeasureBase::GetLargestStringExtent(const wxVector<wxString>& strings,
+                                               wxCoord *width,
+                                               wxCoord *height)
+{
+    MeasuringGuard guard(*this);
+
+    wxCoord w, h, widthMax = 0, heightMax = 0;
+    for ( wxVector<wxString>::const_iterator i = strings.begin();
+          i != strings.end();
+          ++i )
+    {
+        DoGetTextExtent(*i, &w, &h);
+
+        if ( w > widthMax )
+            widthMax = w;
+        if ( h > heightMax )
+            heightMax = h;
+    }
+
+    if ( width )
+        *width = widthMax;
+    if ( height )
+        *height = heightMax;
+}
+
+bool wxTextMeasureBase::GetPartialTextExtents(const wxString& text,
+                                              wxArrayInt& widths,
+                                              double scaleX)
+{
+    widths.Empty();
+    if ( text.empty() )
+        return true;
+
+    MeasuringGuard guard(*this);
+
+    widths.Add(0, text.length());
+
+    return DoGetPartialTextExtents(text, widths, scaleX);
+}
diff --git a/src/generic/textmeasure.cpp b/src/generic/textmeasure.cpp
new file mode 100644 (file)
index 0000000..788e1f6
--- /dev/null
@@ -0,0 +1,131 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/generic/textmeasure.cpp
+// Purpose:
+// Author:      Vadim Zeitlin
+// Created:     2012-10-17
+// RCS-ID:      $Id$
+// Copyright:   (c) 2012 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
+
+#include "wx/private/textmeasure.h"
+
+#if wxUSE_GENERIC_TEXTMEASURE
+
+// ============================================================================
+// wxTextMeasure generic implementation
+// ============================================================================
+
+// We assume that the ports not providing platform-specific wxTextMeasure
+// implementation implement the corresponding functions in their wxDC and
+// wxWindow classes, so forward back to them instead of using wxTextMeasure
+// from there, as usual.
+void wxTextMeasure::DoGetTextExtent(const wxString& string,
+                                    wxCoord *width,
+                                    wxCoord *height,
+                                    wxCoord *descent,
+                                    wxCoord *externalLeading)
+{
+    if ( m_dc )
+    {
+        m_dc->GetTextExtent(string, width, height,
+                            descent, externalLeading, m_font);
+    }
+    else if ( m_win )
+    {
+        m_win->GetTextExtent(string, width, height,
+                             descent, externalLeading, m_font);
+    }
+    //else: we already asserted in the ctor, don't do it any more
+}
+
+// Each element of the widths array will be the width of the string up to and
+// including the corresponding character in text.  This is the generic
+// implementation, the port-specific classes should do this with native APIs
+// if available and if faster.  Note: pango_layout_index_to_pos is much slower
+// than calling GetTextExtent!!
+
+#define FWC_SIZE 256
+
+class FontWidthCache
+{
+public:
+    FontWidthCache() : m_scaleX(1), m_widths(NULL) { }
+    ~FontWidthCache() { delete []m_widths; }
+
+    void Reset()
+    {
+        if ( !m_widths )
+            m_widths = new int[FWC_SIZE];
+
+        memset(m_widths, 0, sizeof(int)*FWC_SIZE);
+    }
+
+    wxFont m_font;
+    double m_scaleX;
+    int *m_widths;
+};
+
+static FontWidthCache s_fontWidthCache;
+
+bool wxTextMeasure::DoGetPartialTextExtents(const wxString& text,
+                                            wxArrayInt& widths,
+                                            double scaleX)
+{
+    int totalWidth = 0;
+
+    // reset the cache if font or horizontal scale have changed
+    if ( !s_fontWidthCache.m_widths ||
+         !wxIsSameDouble(s_fontWidthCache.m_scaleX, scaleX) ||
+         (s_fontWidthCache.m_font != *m_font) )
+    {
+        s_fontWidthCache.Reset();
+        s_fontWidthCache.m_font = *m_font;
+        s_fontWidthCache.m_scaleX = scaleX;
+    }
+
+    // Calculate the position of each character based on the widths of
+    // the previous characters. This is inexact for not fixed fonts.
+    int n = 0;
+    for ( wxString::const_iterator it = text.begin();
+          it != text.end();
+          ++it )
+    {
+        const wxChar c = *it;
+        unsigned int c_int = (unsigned int)c;
+
+        int w;
+        if ((c_int < FWC_SIZE) && (s_fontWidthCache.m_widths[c_int] != 0))
+        {
+            w = s_fontWidthCache.m_widths[c_int];
+        }
+        else
+        {
+            DoGetTextExtent(c, &w, NULL);
+            if (c_int < FWC_SIZE)
+                s_fontWidthCache.m_widths[c_int] = w;
+        }
+
+        totalWidth += w;
+        widths[n++] = totalWidth;
+    }
+
+    return true;
+}
+
+#endif // wxUSE_GENERIC_TEXTMEASURE
index 680ab2c6cdd21e6610c84bbbf466878d74323f9c..0ad9159ef58344153a28117c32e59e980ade8102 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "wx/gtk/private.h"
 #include "wx/gtk/private/object.h"
+#include "wx/private/textmeasure.h"
 
 //-----------------------------------------------------------------------------
 // local defines
@@ -1532,100 +1533,27 @@ void wxWindowDCImpl::DoGetTextExtent(const wxString &string,
                                  wxCoord *descent, wxCoord *externalLeading,
                                  const wxFont *theFont) const
 {
-    if ( width )
-        *width = 0;
-    if ( height )
-        *height = 0;
-    if ( descent )
-        *descent = 0;
-    if ( externalLeading )
-        *externalLeading = 0;
-
-    if (string.empty())
-        return;
-
-    // ensure that theFont is always non-NULL
+    // ensure we work with a valid font
+    const wxFont *fontToUse;
     if ( !theFont || !theFont->IsOk() )
-        theFont = &m_font;
-
-    // and use it if it's valid
-    if ( theFont->IsOk() )
-    {
-        pango_layout_set_font_description
-        (
-            m_layout,
-            theFont->GetNativeFontInfo()->description
-        );
-    }
-
-    // Set layout's text
-    const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(string, *theFont);
-    if ( !dataUTF8 )
-    {
-        // hardly ideal, but what else can we do if conversion failed?
-        return;
-    }
-
-    pango_layout_set_text(m_layout, dataUTF8, -1);
+        fontToUse = &m_font;
+    else
+        fontToUse = theFont;
 
-    int h;
-    pango_layout_get_pixel_size(m_layout, width, &h);
-    if (descent)
-    {
-        PangoLayoutIter *iter = pango_layout_get_iter(m_layout);
-        int baseline = pango_layout_iter_get_baseline(iter);
-        pango_layout_iter_free(iter);
-        *descent = h - PANGO_PIXELS(baseline);
-    }
-    if (height)
-        *height = h;
+    wxCHECK_RET( fontToUse->IsOk(), wxT("invalid font") );
 
-    // Reset old font description
-    if (theFont->IsOk())
-        pango_layout_set_font_description( m_layout, m_fontdesc );
+    wxTextMeasure txm(GetOwner(), fontToUse);
+    txm.GetTextExtent(string, width, height, descent, externalLeading);
 }
 
 
 bool wxWindowDCImpl::DoGetPartialTextExtents(const wxString& text,
                                          wxArrayInt& widths) const
 {
-    const size_t len = text.length();
-    widths.Empty();
-    widths.Add(0, len);
-
-    if (text.empty())
-        return true;
-
-    // Set layout's text
-    const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(text, m_font);
-    if ( !dataUTF8 )
-    {
-        // hardly ideal, but what else can we do if conversion failed?
-        wxLogLastError(wxT("DoGetPartialTextExtents"));
-        return false;
-    }
+    wxCHECK_MSG( m_font.IsOk(), false, wxT("Invalid font") );
 
-    pango_layout_set_text(m_layout, dataUTF8, -1);
-
-    // Calculate the position of each character based on the widths of
-    // the previous characters
-
-    // Code borrowed from Scintilla's PlatGTK
-    PangoLayoutIter *iter = pango_layout_get_iter(m_layout);
-    PangoRectangle pos;
-    pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
-    size_t i = 0;
-    while (pango_layout_iter_next_cluster(iter))
-    {
-        pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
-        int position = PANGO_PIXELS(pos.x);
-        widths[i++] = position;
-    }
-    while (i < len)
-        widths[i++] = PANGO_PIXELS(pos.x + pos.width);
-    pango_layout_iter_free(iter);
-
-    return true;
+    wxTextMeasure txm(GetOwner(), &m_font);
+    return txm.GetPartialTextExtents(text, widths, m_scaleX);
 }
 
 
diff --git a/src/gtk/textmeasure.cpp b/src/gtk/textmeasure.cpp
new file mode 100644 (file)
index 0000000..f32df4a
--- /dev/null
@@ -0,0 +1,185 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/gtk/textmeasure.cpp
+// Purpose:     wxTextMeasure implementation for wxGTK
+// Author:      Manuel Martin
+// Created:     2012-10-05
+// Copyright:   (c) 1997-2012 wxWidgets team
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/window.h"
+#endif //WX_PRECOMP
+
+#include "wx/private/textmeasure.h"
+
+#include "wx/fontutil.h"
+#include "wx/gtk/private.h"
+
+#ifndef __WXGTK3__
+    #include "wx/gtk/dcclient.h"
+#endif
+
+// ============================================================================
+// wxTextMeasure implementation
+// ============================================================================
+
+void wxTextMeasure::Init()
+{
+    wxASSERT_MSG( m_font, wxT("wxTextMeasure needs a valid wxFont") );
+
+#ifndef __WXGTK3__
+    m_wdc = NULL;
+#endif // GTK+ < 3
+    m_context = NULL;
+    m_layout = NULL;
+}
+
+// Get Gtk needed elements, if we have not them yet.
+void wxTextMeasure::BeginMeasuring()
+{
+    if ( m_dc )
+    {
+#ifndef __WXGTK3__
+        m_wdc = wxDynamicCast(m_dc->GetImpl(), wxWindowDCImpl);
+        if ( m_wdc )
+        {
+            m_context = m_wdc->m_context;
+            m_layout = m_wdc->m_layout;
+        }
+#endif // GTK+ < 3
+    }
+    else if ( m_win )
+    {
+        m_context = gtk_widget_get_pango_context( m_win->GetHandle() );
+        if ( m_context )
+            m_layout = pango_layout_new(m_context);
+    }
+
+    // set the font to use
+    if ( m_layout )
+    {
+        pango_layout_set_font_description(m_layout,
+                                          m_font->GetNativeFontInfo()->description);
+    }
+}
+
+void wxTextMeasure::EndMeasuring()
+{
+    if ( !m_layout )
+        return;
+
+#ifndef __WXGTK3__
+    if ( m_wdc )
+    {
+        // Reset dc own font description
+        pango_layout_set_font_description( m_wdc->m_layout, m_wdc->m_fontdesc );
+    }
+    else
+#endif // GTK+ < 3
+    {
+        g_object_unref (m_layout);
+    }
+}
+
+// Notice we don't check here the font. It is supposed to be OK before the call.
+void wxTextMeasure::DoGetTextExtent(const wxString& string,
+                                    wxCoord *width,
+                                    wxCoord *height,
+                                    wxCoord *descent,
+                                    wxCoord *externalLeading)
+{
+    if ( !m_context )
+    {
+        *width =
+        *height = 0;
+        return;
+    }
+
+    // Set layout's text
+    const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(string, *m_font);
+    if ( !dataUTF8 )
+    {
+        // hardly ideal, but what else can we do if conversion failed?
+        wxLogLastError(wxT("GetTextExtent"));
+        return;
+    }
+    pango_layout_set_text(m_layout, dataUTF8, -1);
+
+    if ( m_dc )
+    {
+        // in device units
+        pango_layout_get_pixel_size(m_layout, width, height);
+    }
+    else // win
+    {
+        // the logical rect bounds the ink rect
+        PangoRectangle rect;
+        pango_layout_get_extents(m_layout, NULL, &rect);
+        *width = PANGO_PIXELS(rect.width);
+        *height = PANGO_PIXELS(rect.height);
+    }
+
+    if (descent)
+    {
+        PangoLayoutIter *iter = pango_layout_get_iter(m_layout);
+        int baseline = pango_layout_iter_get_baseline(iter);
+        pango_layout_iter_free(iter);
+        *descent = *height - PANGO_PIXELS(baseline);
+    }
+
+    if (externalLeading)
+    {
+        // No support for MSW-like "external leading" in Pango.
+        *externalLeading = 0;
+    }
+}
+
+bool wxTextMeasure::DoGetPartialTextExtents(const wxString& text,
+                                            wxArrayInt& widths,
+                                            double WXUNUSED(scaleX))
+{
+    // Set layout's text
+    const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(text, *m_font);
+    if ( !dataUTF8 )
+    {
+        // hardly ideal, but what else can we do if conversion failed?
+        wxLogLastError(wxT("GetPartialTextExtents"));
+        return false;
+    }
+
+    pango_layout_set_text(m_layout, dataUTF8, -1);
+
+    // Calculate the position of each character based on the widths of
+    // the previous characters
+
+    // Code borrowed from Scintilla's PlatGTK
+    PangoLayoutIter *iter = pango_layout_get_iter(m_layout);
+    PangoRectangle pos;
+    pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
+    size_t i = 0;
+    while (pango_layout_iter_next_cluster(iter))
+    {
+        pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
+        int position = PANGO_PIXELS(pos.x);
+        widths[i++] = position;
+    }
+
+    const size_t len = text.length();
+    while (i < len)
+        widths[i++] = PANGO_PIXELS(pos.x + pos.width);
+    pango_layout_iter_free(iter);
+
+    return true;
+}
index 25429853798311ab146dcfabca28fb3413a2b374..978f556ca75953261c85405458f5ccdaa05ae061 100644 (file)
@@ -43,6 +43,7 @@
 #include "wx/gtk/private/gtk2-compat.h"
 #include "wx/gtk/private/event.h"
 #include "wx/gtk/private/win_gtk.h"
+#include "wx/private/textmeasure.h"
 using namespace wxGTKImpl;
 
 #ifdef GDK_WINDOWING_X11
@@ -3080,52 +3081,18 @@ void wxWindowGTK::DoGetTextExtent( const wxString& string,
                                    int *externalLeading,
                                    const wxFont *theFont ) const
 {
-    wxFont fontToUse = theFont ? *theFont : GetFont();
+    // ensure we work with a valid font
+    wxFont fontToUse;
+    if ( !theFont || !theFont->IsOk() )
+        fontToUse = GetFont();
+    else
+        fontToUse = *theFont;
 
     wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") );
 
-    if (string.empty())
-    {
-        if (x) (*x) = 0;
-        if (y) (*y) = 0;
-        return;
-    }
-
-    PangoContext *context = NULL;
-    if (m_widget)
-        context = gtk_widget_get_pango_context( m_widget );
-
-    if (!context)
-    {
-        if (x) (*x) = 0;
-        if (y) (*y) = 0;
-        return;
-    }
-
-    PangoFontDescription *desc = fontToUse.GetNativeFontInfo()->description;
-    PangoLayout *layout = pango_layout_new(context);
-    pango_layout_set_font_description(layout, desc);
-    {
-        const wxCharBuffer data = wxGTK_CONV( string );
-        if ( data )
-            pango_layout_set_text(layout, data, strlen(data));
-    }
-
-    PangoRectangle rect;
-    pango_layout_get_extents(layout, NULL, &rect);
-
-    if (x) (*x) = (wxCoord) PANGO_PIXELS(rect.width);
-    if (y) (*y) = (wxCoord) PANGO_PIXELS(rect.height);
-    if (descent)
-    {
-        PangoLayoutIter *iter = pango_layout_get_iter(layout);
-        int baseline = pango_layout_iter_get_baseline(iter);
-        pango_layout_iter_free(iter);
-        *descent = *y - PANGO_PIXELS(baseline);
-    }
-    if (externalLeading) (*externalLeading) = 0;  // ??
-
-    g_object_unref (layout);
+    const wxWindow* win = static_cast<const wxWindow*>(this);
+    wxTextMeasure txm(win, &fontToUse);
+    txm.GetTextExtent(string, x, y, descent, externalLeading);
 }
 
 void wxWindowGTK::GTKDisableFocusOutEvent()
index 077d9594cee4adbf2846b077db0c216f3964aa21..fc47bd9a5a4ab674c091c678b1200a3867877248 100644 (file)
@@ -51,6 +51,7 @@
 #include <string.h>
 
 #include "wx/msw/private/dc.h"
+#include "wx/private/textmeasure.h"
 
 using namespace wxMSWImpl;
 
@@ -1857,109 +1858,19 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
     }
 #endif // __WXMICROWIN__
 
-    HFONT hfontOld;
-    if ( font )
-    {
-        wxASSERT_MSG( font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") );
-
-        hfontOld = (HFONT)::SelectObject(GetHdc(), GetHfontOf(*font));
-    }
-    else // don't change the font
-    {
-        hfontOld = 0;
-    }
-
-    SIZE sizeRect;
-    const size_t len = string.length();
-    if ( !::GetTextExtentPoint32(GetHdc(), string.t_str(), len, &sizeRect) )
-    {
-        wxLogLastError(wxT("GetTextExtentPoint32()"));
-    }
-
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
-    // the result computed by GetTextExtentPoint32() may be too small as it
-    // accounts for under/overhang of the first/last character while we want
-    // just the bounding rect for this string so adjust the width as needed
-    // (using API not available in 2002 SDKs of WinCE)
-    if ( len > 0 )
-    {
-        ABC width;
-        const wxChar chFirst = *string.begin();
-        if ( ::GetCharABCWidths(GetHdc(), chFirst, chFirst, &width) )
-        {
-            if ( width.abcA < 0 )
-                sizeRect.cx -= width.abcA;
-
-            if ( len > 1 )
-            {
-                const wxChar chLast = *string.rbegin();
-                ::GetCharABCWidths(GetHdc(), chLast, chLast, &width);
-            }
-            //else: we already have the width of the last character
-
-            if ( width.abcC < 0 )
-                sizeRect.cx -= width.abcC;
-        }
-        //else: GetCharABCWidths() failed, not a TrueType font?
-    }
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
+    wxASSERT_MSG( !font || font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") );
 
-    if (x)
-        *x = sizeRect.cx;
-    if (y)
-        *y = sizeRect.cy;
-
-    if ( descent || externalLeading )
-    {
-        DoGetFontMetrics(NULL, NULL, descent, NULL, externalLeading, NULL);
-    }
-
-    if ( hfontOld )
-    {
-        ::SelectObject(GetHdc(), hfontOld);
-    }
+    wxTextMeasure txm(GetOwner(), font);
+    txm.GetTextExtent(string, x, y, descent, externalLeading);
 }
 
 
-// Each element of the array will be the width of the string up to and
-// including the coresoponding character in text.
-
 bool wxMSWDCImpl::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
 {
-    static int maxLenText = -1;
-    static int maxWidth = -1;
-    int fit = 0;
-    SIZE sz = {0,0};
-    int stlen = text.length();
-
-    if (maxLenText == -1)
-    {
-        // Win9x and WinNT+ have different limits
-        int version = wxGetOsVersion();
-        maxLenText = version == wxOS_WINDOWS_NT ? 65535 : 8192;
-        maxWidth =   version == wxOS_WINDOWS_NT ? INT_MAX : 32767;
-    }
-
-    widths.Empty();
-    widths.Add(0, stlen);  // fill the array with zeros
-    if (stlen == 0)
-        return true;
+    wxCHECK_MSG( GetFont().IsOk(), false, wxT("Invalid font") );
 
-    if (!::GetTextExtentExPoint(GetHdc(),
-                                text.c_str(),           // string to check
-                                wxMin(stlen, maxLenText),
-                                maxWidth,
-                                &fit,                   // [out] count of chars
-                                                        // that will fit
-                                &widths[0],             // array to fill
-                                &sz))
-    {
-        // API failed
-        wxLogLastError(wxT("GetTextExtentExPoint"));
-        return false;
-    }
-
-    return true;
+    wxTextMeasure txm(GetOwner(), NULL); // don't change the font
+    return txm.GetPartialTextExtents(text, widths, 1.0);
 }
 
 namespace
diff --git a/src/msw/textmeasure.cpp b/src/msw/textmeasure.cpp
new file mode 100644 (file)
index 0000000..c2b364a
--- /dev/null
@@ -0,0 +1,172 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/msw/textmeasure.cpp
+// Purpose:     wxTextMeasure implementation for wxMSW
+// Author:      Manuel Martin
+// Created:     2012-19-05
+// RCS-ID:
+// Copyright:
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/msw/private.h"
+#include "wx/msw/dc.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/window.h"
+    #include "wx/font.h"
+#endif //WX_PRECOMP
+
+#include "wx/private/textmeasure.h"
+
+// ============================================================================
+// wxTextMeasure implementation
+// ============================================================================
+
+void wxTextMeasure::Init()
+{
+    m_hdc = NULL;
+    m_hfontOld = NULL;
+}
+
+void wxTextMeasure::BeginMeasuring()
+{
+    if ( m_dc )
+    {
+        m_hdc = m_dc->GetHDC();
+
+        // Non-native wxDC subclasses should override their DoGetTextExtent()
+        // and other methods.
+        wxASSERT_MSG( m_hdc, wxS("Must not be used with non-native wxDCs") );
+    }
+    else if ( m_win )
+    {
+        m_hdc = ::GetDC(GetHwndOf(m_win));
+    }
+
+    if ( m_font )
+        m_hfontOld = (HFONT)::SelectObject(m_hdc, GetHfontOf(*m_font));
+}
+
+void wxTextMeasure::EndMeasuring()
+{
+    if ( m_hfontOld )
+    {
+        ::SelectObject(m_hdc, m_hfontOld);
+        m_hfontOld = NULL;
+    }
+
+    if ( m_win )
+        ::ReleaseDC(GetHwndOf(m_win), m_hdc);
+    //else: our HDC belongs to m_dc, don't touch it
+
+    m_hdc = NULL;
+}
+
+// Notice we don't check here the font. It is supposed to be OK before the call.
+void wxTextMeasure::DoGetTextExtent(const wxString& string,
+                                       wxCoord *width,
+                                       wxCoord *height,
+                                       wxCoord *descent,
+                                       wxCoord *externalLeading)
+{
+    SIZE sizeRect;
+    const size_t len = string.length();
+    if ( !::GetTextExtentPoint32(m_hdc, string.t_str(), len, &sizeRect) )
+    {
+        wxLogLastError(wxT("GetTextExtentPoint32()"));
+    }
+
+#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
+    // the result computed by GetTextExtentPoint32() may be too small as it
+    // accounts for under/overhang of the first/last character while we want
+    // just the bounding rect for this string so adjust the width as needed
+    // (using API not available in 2002 SDKs of WinCE)
+    if ( len > 0 )
+    {
+        ABC widthABC;
+        const wxChar chFirst = *string.begin();
+        if ( ::GetCharABCWidths(m_hdc, chFirst, chFirst, &widthABC) )
+        {
+            if ( widthABC.abcA < 0 )
+                sizeRect.cx -= widthABC.abcA;
+
+            if ( len > 1 )
+            {
+                const wxChar chLast = *string.rbegin();
+                ::GetCharABCWidths(m_hdc, chLast, chLast, &widthABC);
+            }
+            //else: we already have the width of the last character
+
+            if ( widthABC.abcC < 0 )
+                sizeRect.cx -= widthABC.abcC;
+        }
+        //else: GetCharABCWidths() failed, not a TrueType font?
+    }
+#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
+
+    *width = sizeRect.cx;
+    *height = sizeRect.cy;
+
+    if ( descent || externalLeading )
+    {
+        TEXTMETRIC tm;
+        ::GetTextMetrics(m_hdc, &tm);
+        if ( descent )
+            *descent = tm.tmDescent;
+        if ( externalLeading )
+            *externalLeading = tm.tmExternalLeading;
+    }
+}
+
+bool wxTextMeasure::DoGetPartialTextExtents(const wxString& text,
+                                            wxArrayInt& widths,
+                                            double WXUNUSED(scaleX))
+{
+    static int maxLenText = -1;
+    static int maxWidth = -1;
+
+    if (maxLenText == -1)
+    {
+        // Win9x and WinNT+ have different limits
+        int version = wxGetOsVersion();
+        maxLenText = version == wxOS_WINDOWS_NT ? 65535 : 8192;
+        maxWidth =   version == wxOS_WINDOWS_NT ? INT_MAX : 32767;
+    }
+
+    int len = text.length();
+    if ( len > maxLenText )
+        len = maxLenText;
+
+    int fit = 0;
+    SIZE sz = {0,0};
+    if ( !::GetTextExtentExPoint(m_hdc,
+                                 text.t_str(), // string to check
+                                 len,
+                                 maxWidth,
+                                 &fit,         // [out] count of chars
+                                               // that will fit
+                                 &widths[0],   // array to fill
+                                 &sz) )
+    {
+        wxLogLastError(wxT("GetTextExtentExPoint"));
+
+        return false;
+    }
+
+    return true;
+}
index 67ee3d37f7859317867ac953cf5a3e61630597b2..782d8c442e183891dd76096e86b7f50a59fd4917 100644 (file)
@@ -81,6 +81,7 @@
 #include "wx/msw/private.h"
 #include "wx/msw/private/keyboard.h"
 #include "wx/msw/dcclient.h"
+#include "wx/private/textmeasure.h"
 
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
@@ -2164,31 +2165,18 @@ void wxWindowMSW::DoGetTextExtent(const wxString& string,
                                   int *externalLeading,
                                   const wxFont *fontToUse) const
 {
-    wxASSERT_MSG( !fontToUse || fontToUse->IsOk(),
-                    wxT("invalid font in GetTextExtent()") );
-
-    HFONT hfontToUse;
-    if ( fontToUse )
-        hfontToUse = GetHfontOf(*fontToUse);
+    // ensure we work with a valid font
+    wxFont font;
+    if ( !fontToUse || !fontToUse->IsOk() )
+        font = GetFont();
     else
-        hfontToUse = GetHfontOf(GetFont());
-
-    WindowHDC hdc(GetHwnd());
-    SelectInHDC selectFont(hdc, hfontToUse);
+        font = *fontToUse;
 
-    SIZE sizeRect;
-    TEXTMETRIC tm;
-    ::GetTextExtentPoint32(hdc, string.t_str(), string.length(), &sizeRect);
-    GetTextMetrics(hdc, &tm);
+    wxCHECK_RET( font.IsOk(), wxT("invalid font in GetTextExtent()") );
 
-    if ( x )
-        *x = sizeRect.cx;
-    if ( y )
-        *y = sizeRect.cy;
-    if ( descent )
-        *descent = tm.tmDescent;
-    if ( externalLeading )
-        *externalLeading = tm.tmExternalLeading;
+    const wxWindow* win = static_cast<const wxWindow*>(this);
+    wxTextMeasure txm(win, &font);
+    txm.GetTextExtent(string, x, y, descent, externalLeading);
 }
 
 // ---------------------------------------------------------------------------
index 1a2f5e16e8a6fe8918d8cee014b152154f6e31b4..dbf032bee0498d9d0da2be4834958ea8e92bcda9 100644 (file)
@@ -1,10 +1,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Name:        tests/graphics/measuring.cpp
 // Purpose:     Tests for wxGraphicsRenderer::CreateMeasuringContext
-// Author:      Kevin Ollivier
+// Author:      Kevin Ollivier, Vadim Zeitlin (non wxGC parts)
 // Created:     2008-02-12
 // RCS-ID:      $Id$
 // Copyright:   (c) 2008 Kevin Ollivier <kevino@theolliviers.com>
+//              (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org>
 ///////////////////////////////////////////////////////////////////////////////
 
 // ----------------------------------------------------------------------------
@@ -13,9 +14,6 @@
 
 #include "testprec.h"
 
-// wxCairoRenderer::CreateMeasuringContext() is not implement for wxX11
-#if wxUSE_GRAPHICS_CONTEXT && !defined(__WXX11__)
-
 #ifdef __BORLANDC__
     #pragma hdrstop
 #endif
     #include "wx/window.h"
 #endif // WX_PRECOMP
 
-#include "wx/graphics.h"
+// wxCairoRenderer::CreateMeasuringContext() is not implement for wxX11
+#if wxUSE_GRAPHICS_CONTEXT && !defined(__WXX11__)
+    #include "wx/graphics.h"
+    #define TEST_GC
+#endif
+
+#include "wx/dcclient.h"
+
 // ----------------------------------------------------------------------------
 // test class
 // ----------------------------------------------------------------------------
 
-class MeasuringContextTestCase : public CppUnit::TestCase
+class MeasuringTextTestCase : public CppUnit::TestCase
 {
 public:
-    MeasuringContextTestCase() { }
+    MeasuringTextTestCase() { }
 
 private:
-    CPPUNIT_TEST_SUITE( MeasuringContextTestCase );
-        CPPUNIT_TEST( GetTextExtent );
+    CPPUNIT_TEST_SUITE( MeasuringTextTestCase );
+        CPPUNIT_TEST( DCGetTextExtent );
+        CPPUNIT_TEST( WindowGetTextExtent );
+        CPPUNIT_TEST( GetPartialTextExtent );
+#ifdef TEST_GC
+        CPPUNIT_TEST( GraphicsGetTextExtent );
+#endif // TEST_GC
     CPPUNIT_TEST_SUITE_END();
 
-    void GetTextExtent();
+    template <typename T>
+    void DoTestGetTextExtent(const T& obj);
 
-    DECLARE_NO_COPY_CLASS(MeasuringContextTestCase)
+    void DCGetTextExtent();
+    void WindowGetTextExtent();
+
+    void GetPartialTextExtent();
+
+#ifdef TEST_GC
+    void GraphicsGetTextExtent();
+#endif // TEST_GC
+
+    DECLARE_NO_COPY_CLASS(MeasuringTextTestCase)
 };
 
 // register in the unnamed registry so that these tests are run by default
-CPPUNIT_TEST_SUITE_REGISTRATION( MeasuringContextTestCase );
+CPPUNIT_TEST_SUITE_REGISTRATION( MeasuringTextTestCase );
 
 // also include in its own registry so that these tests can be run alone
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MeasuringContextTestCase, "MeasuringContextTestCase" );
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MeasuringTextTestCase, "MeasuringTextTestCase" );
 
 // ----------------------------------------------------------------------------
 // tests themselves
 // ----------------------------------------------------------------------------
 
-void MeasuringContextTestCase::GetTextExtent()
+template <typename T>
+void MeasuringTextTestCase::DoTestGetTextExtent(const T& obj)
+{
+    // Test that getting the height only doesn't crash.
+    int y;
+    obj.GetTextExtent("H", NULL, &y);
+
+    CPPUNIT_ASSERT( y > 1 );
+
+    wxSize size = obj.GetTextExtent("Hello");
+    CPPUNIT_ASSERT( size.x > 1 );
+    CPPUNIT_ASSERT_EQUAL( y, size.y );
+}
+
+void MeasuringTextTestCase::DCGetTextExtent()
+{
+    wxClientDC dc(wxTheApp->GetTopWindow());
+
+    DoTestGetTextExtent(dc);
+}
+
+void MeasuringTextTestCase::WindowGetTextExtent()
+{
+    wxWindow* const win = wxTheApp->GetTopWindow();
+
+    DoTestGetTextExtent(*win);
+}
+
+void MeasuringTextTestCase::GetPartialTextExtent()
+{
+    wxClientDC dc(wxTheApp->GetTopWindow());
+
+    wxArrayInt widths;
+    CPPUNIT_ASSERT( dc.GetPartialTextExtents("Hello", widths) );
+    CPPUNIT_ASSERT_EQUAL( 5, widths.size() );
+    CPPUNIT_ASSERT_EQUAL( widths[0], dc.GetTextExtent("H").x );
+    CPPUNIT_ASSERT_EQUAL( widths[4], dc.GetTextExtent("Hello").x );
+}
+
+#ifdef TEST_GC
+
+void MeasuringTextTestCase::GraphicsGetTextExtent()
 {
     wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetDefaultRenderer();
     CPPUNIT_ASSERT(renderer);
@@ -74,4 +135,4 @@ void MeasuringContextTestCase::GetTextExtent()
 
 }
 
-#endif
+#endif // TEST_GC