Merge branch 'simplify-display'

Centralize all display-related code in wxDisplay class and avoid
duplicating or reimplementing it in wxDisplaySize() and
wxClientDisplayRect() functions.

See https://github.com/wxWidgets/wxWidgets/pull/955
This commit is contained in:
Vadim Zeitlin
2018-10-01 13:52:07 +02:00
44 changed files with 545 additions and 507 deletions

View File

@@ -3787,7 +3787,6 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \
wx/dialup.h \ wx/dialup.h \
wx/dirctrl.h \ wx/dirctrl.h \
wx/display.h \ wx/display.h \
wx/display_impl.h \
wx/dnd.h \ wx/dnd.h \
wx/docmdi.h \ wx/docmdi.h \
wx/docview.h \ wx/docview.h \
@@ -5610,7 +5609,8 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS = \
monodll_timectrl_osx.o \ monodll_timectrl_osx.o \
monodll_taskbarcmn.o \ monodll_taskbarcmn.o \
monodll_cocoa_activityindicator.o \ monodll_cocoa_activityindicator.o \
monodll_cocoa_statbmp.o monodll_cocoa_statbmp.o \
monodll_core_display.o
@COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS) @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS)
COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS = \ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS = \
$(__OSX_COMMON_SRC_OBJECTS) \ $(__OSX_COMMON_SRC_OBJECTS) \
@@ -7587,7 +7587,8 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1 = \
monolib_timectrl_osx.o \ monolib_timectrl_osx.o \
monolib_taskbarcmn.o \ monolib_taskbarcmn.o \
monolib_cocoa_activityindicator.o \ monolib_cocoa_activityindicator.o \
monolib_cocoa_statbmp.o monolib_cocoa_statbmp.o \
monolib_core_display.o
@COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1) @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1)
COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1 = \ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1 = \
$(__OSX_COMMON_SRC_OBJECTS_0) \ $(__OSX_COMMON_SRC_OBJECTS_0) \
@@ -9711,7 +9712,8 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2 = \
coredll_timectrl_osx.o \ coredll_timectrl_osx.o \
coredll_taskbarcmn.o \ coredll_taskbarcmn.o \
coredll_cocoa_activityindicator.o \ coredll_cocoa_activityindicator.o \
coredll_cocoa_statbmp.o coredll_cocoa_statbmp.o \
coredll_core_display.o
@COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2) @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2)
COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2 = \ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2 = \
$(__OSX_COMMON_SRC_OBJECTS_8) \ $(__OSX_COMMON_SRC_OBJECTS_8) \
@@ -11430,7 +11432,8 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3 = \
corelib_timectrl_osx.o \ corelib_timectrl_osx.o \
corelib_taskbarcmn.o \ corelib_taskbarcmn.o \
corelib_cocoa_activityindicator.o \ corelib_cocoa_activityindicator.o \
corelib_cocoa_statbmp.o corelib_cocoa_statbmp.o \
corelib_core_display.o
@COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3) @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3)
COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3 = \ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3 = \
$(__OSX_COMMON_SRC_OBJECTS_9) \ $(__OSX_COMMON_SRC_OBJECTS_9) \
@@ -13245,7 +13248,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS = \
monodll_core_bitmap.o \ monodll_core_bitmap.o \
monodll_core_colour.o \ monodll_core_colour.o \
monodll_core_dcmemory.o \ monodll_core_dcmemory.o \
monodll_core_display.o \
monodll_core_fontenum.o \ monodll_core_fontenum.o \
monodll_hid.o \ monodll_hid.o \
monodll_printmac.o \ monodll_printmac.o \
@@ -13389,7 +13391,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17 = \
monolib_core_bitmap.o \ monolib_core_bitmap.o \
monolib_core_colour.o \ monolib_core_colour.o \
monolib_core_dcmemory.o \ monolib_core_dcmemory.o \
monolib_core_display.o \
monolib_core_fontenum.o \ monolib_core_fontenum.o \
monolib_hid.o \ monolib_hid.o \
monolib_printmac.o \ monolib_printmac.o \
@@ -13533,7 +13534,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_1 = \
coredll_core_bitmap.o \ coredll_core_bitmap.o \
coredll_core_colour.o \ coredll_core_colour.o \
coredll_core_dcmemory.o \ coredll_core_dcmemory.o \
coredll_core_display.o \
coredll_core_fontenum.o \ coredll_core_fontenum.o \
coredll_hid.o \ coredll_hid.o \
coredll_printmac.o \ coredll_printmac.o \
@@ -13674,7 +13674,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \
corelib_core_bitmap.o \ corelib_core_bitmap.o \
corelib_core_colour.o \ corelib_core_colour.o \
corelib_core_dcmemory.o \ corelib_core_dcmemory.o \
corelib_core_display.o \
corelib_core_fontenum.o \ corelib_core_fontenum.o \
corelib_hid.o \ corelib_hid.o \
corelib_printmac.o \ corelib_printmac.o \
@@ -16523,6 +16522,9 @@ monodll_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm
monodll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONODLL_ODEP) monodll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm
monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
monodll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONODLL_ODEP) monodll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp
@@ -18827,12 +18829,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp
@@ -21800,6 +21796,9 @@ monolib_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm
monolib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONOLIB_ODEP) monolib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm
monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
monolib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONOLIB_ODEP) monolib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp
@@ -24104,12 +24103,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp
@@ -27740,6 +27733,9 @@ coredll_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm
coredll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(COREDLL_ODEP) coredll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm
coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
coredll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(COREDLL_ODEP) coredll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp
@@ -29474,12 +29470,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp
@@ -32012,6 +32002,9 @@ corelib_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm
corelib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(CORELIB_ODEP) corelib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm
corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
corelib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(CORELIB_ODEP) corelib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp
@@ -33746,12 +33739,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp

View File

@@ -1150,7 +1150,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/dialup.h wx/dialup.h
wx/dirctrl.h wx/dirctrl.h
wx/display.h wx/display.h
wx/display_impl.h
wx/dnd.h wx/dnd.h
wx/docmdi.h wx/docmdi.h
wx/docview.h wx/docview.h
@@ -2408,7 +2407,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/osx/core/bitmap.cpp src/osx/core/bitmap.cpp
src/osx/core/colour.cpp src/osx/core/colour.cpp
src/osx/core/dcmemory.cpp src/osx/core/dcmemory.cpp
src/osx/core/display.cpp
src/osx/core/fontenum.cpp src/osx/core/fontenum.cpp
src/osx/core/hid.cpp src/osx/core/hid.cpp
src/osx/core/printmac.cpp src/osx/core/printmac.cpp
@@ -2655,6 +2653,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/common/taskbarcmn.cpp src/common/taskbarcmn.cpp
src/osx/cocoa/activityindicator.mm src/osx/cocoa/activityindicator.mm
src/osx/cocoa/statbmp.mm src/osx/cocoa/statbmp.mm
src/osx/core/display.cpp
</set> </set>
<set var="OSX_COCOA_HDR" hints="files"> <set var="OSX_COCOA_HDR" hints="files">
wx/osx/cocoa/chkconf.h wx/osx/cocoa/chkconf.h

View File

@@ -1058,7 +1058,6 @@ set(GUI_CMN_HDR
wx/dialup.h wx/dialup.h
wx/dirctrl.h wx/dirctrl.h
wx/display.h wx/display.h
wx/display_impl.h
wx/dnd.h wx/dnd.h
wx/docmdi.h wx/docmdi.h
wx/docview.h wx/docview.h
@@ -2285,7 +2284,6 @@ set(OSX_LOWLEVEL_SRC
src/osx/core/bitmap.cpp src/osx/core/bitmap.cpp
src/osx/core/colour.cpp src/osx/core/colour.cpp
src/osx/core/dcmemory.cpp src/osx/core/dcmemory.cpp
src/osx/core/display.cpp
src/osx/core/fontenum.cpp src/osx/core/fontenum.cpp
src/osx/core/hid.cpp src/osx/core/hid.cpp
src/osx/core/printmac.cpp src/osx/core/printmac.cpp
@@ -2527,6 +2525,7 @@ set(OSX_COCOA_SRC
src/osx/datectrl_osx.cpp src/osx/datectrl_osx.cpp
src/osx/core/sound.cpp src/osx/core/sound.cpp
src/osx/cocoa/statbmp.mm src/osx/cocoa/statbmp.mm
src/osx/core/display.cpp
) )
set(OSX_COCOA_HDR set(OSX_COCOA_HDR

View File

@@ -988,7 +988,6 @@ GUI_CMN_HDR =
wx/dirctrl.h wx/dirctrl.h
wx/dirdlg.h wx/dirdlg.h
wx/display.h wx/display.h
wx/display_impl.h
wx/dnd.h wx/dnd.h
wx/docmdi.h wx/docmdi.h
wx/docview.h wx/docview.h
@@ -2268,7 +2267,6 @@ OSX_LOWLEVEL_SRC =
src/osx/core/bitmap.cpp src/osx/core/bitmap.cpp
src/osx/core/colour.cpp src/osx/core/colour.cpp
src/osx/core/dcmemory.cpp src/osx/core/dcmemory.cpp
src/osx/core/display.cpp
src/osx/core/fontenum.cpp src/osx/core/fontenum.cpp
src/osx/core/hid.cpp src/osx/core/hid.cpp
src/osx/core/printmac.cpp src/osx/core/printmac.cpp
@@ -2499,6 +2497,7 @@ OSX_COCOA_SRC =
src/osx/cocoa/toolbar.mm src/osx/cocoa/toolbar.mm
src/osx/cocoa/tooltip.mm src/osx/cocoa/tooltip.mm
src/osx/cocoa/window.mm src/osx/cocoa/window.mm
src/osx/core/display.cpp
src/osx/core/hidjoystick.cpp src/osx/core/hidjoystick.cpp
src/osx/core/sound.cpp src/osx/core/sound.cpp
src/osx/dataview_osx.cpp src/osx/dataview_osx.cpp

View File

@@ -1280,7 +1280,6 @@
<ClInclude Include="..\..\include\wx\dirctrl.h" /> <ClInclude Include="..\..\include\wx\dirctrl.h" />
<ClInclude Include="..\..\include\wx\dirdlg.h" /> <ClInclude Include="..\..\include\wx\dirdlg.h" />
<ClInclude Include="..\..\include\wx\display.h" /> <ClInclude Include="..\..\include\wx\display.h" />
<ClInclude Include="..\..\include\wx\display_impl.h" />
<ClInclude Include="..\..\include\wx\dnd.h" /> <ClInclude Include="..\..\include\wx\dnd.h" />
<ClInclude Include="..\..\include\wx\docmdi.h" /> <ClInclude Include="..\..\include\wx\docmdi.h" />
<ClInclude Include="..\..\include\wx\docview.h" /> <ClInclude Include="..\..\include\wx\docview.h" />

View File

@@ -1267,9 +1267,6 @@
<ClInclude Include="..\..\include\wx\display.h"> <ClInclude Include="..\..\include\wx\display.h">
<Filter>Common Headers</Filter> <Filter>Common Headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\wx\display_impl.h">
<Filter>Common Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\wx\dnd.h"> <ClInclude Include="..\..\include\wx\dnd.h">
<Filter>Common Headers</Filter> <Filter>Common Headers</Filter>
</ClInclude> </ClInclude>

View File

@@ -2270,9 +2270,6 @@
<File <File
RelativePath="..\..\include\wx\display.h"> RelativePath="..\..\include\wx\display.h">
</File> </File>
<File
RelativePath="..\..\include\wx\display_impl.h">
</File>
<File <File
RelativePath="..\..\include\wx\dnd.h"> RelativePath="..\..\include\wx\dnd.h">
</File> </File>

View File

@@ -3528,10 +3528,6 @@
RelativePath="..\..\include\wx\display.h" RelativePath="..\..\include\wx\display.h"
> >
</File> </File>
<File
RelativePath="..\..\include\wx\display_impl.h"
>
</File>
<File <File
RelativePath="..\..\include\wx\dnd.h" RelativePath="..\..\include\wx\dnd.h"
> >

View File

@@ -3524,10 +3524,6 @@
RelativePath="..\..\include\wx\display.h" RelativePath="..\..\include\wx\display.h"
> >
</File> </File>
<File
RelativePath="..\..\include\wx\display_impl.h"
>
</File>
<File <File
RelativePath="..\..\include\wx\dnd.h" RelativePath="..\..\include\wx\dnd.h"
> >

View File

@@ -803,7 +803,6 @@
F0B3F484C38C3BA0B9927CD9 /* docmdi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECC9F5C21ACB31A0B24AEE35 /* docmdi.cpp */; }; F0B3F484C38C3BA0B9927CD9 /* docmdi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECC9F5C21ACB31A0B24AEE35 /* docmdi.cpp */; };
F0D892C2618130FEAD46BB86 /* panel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00969CBE3B8F32C78C195619 /* panel.cpp */; }; F0D892C2618130FEAD46BB86 /* panel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00969CBE3B8F32C78C195619 /* panel.cpp */; };
F1E4D7CA634E33808AE3B522 /* fontenumcmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 373242CD08F330208A7CF438 /* fontenumcmn.cpp */; }; F1E4D7CA634E33808AE3B522 /* fontenumcmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 373242CD08F330208A7CF438 /* fontenumcmn.cpp */; };
F1F484DD591337399FCD0463 /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5617D10CB7136EC9A4194EF /* display.cpp */; };
F22C401903993639AE05A295 /* xh_stbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 147800BBCB80346798B35D75 /* xh_stbox.cpp */; }; F22C401903993639AE05A295 /* xh_stbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 147800BBCB80346798B35D75 /* xh_stbox.cpp */; };
F24F637D59F637CA9A7E23C9 /* xh_filectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60EE4448A28D38F5ADE17B5A /* xh_filectrl.cpp */; }; F24F637D59F637CA9A7E23C9 /* xh_filectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60EE4448A28D38F5ADE17B5A /* xh_filectrl.cpp */; };
F2813BF297C73A3ABD02EC98 /* glcanvas_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA59091E3ED83FB781FB9659 /* glcanvas_osx.cpp */; }; F2813BF297C73A3ABD02EC98 /* glcanvas_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA59091E3ED83FB781FB9659 /* glcanvas_osx.cpp */; };
@@ -1402,7 +1401,6 @@
A46D50BEBF523B3F88831086 /* LexAsn1.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsn1.cxx; path = ../../src/stc/scintilla/lexers/LexAsn1.cxx; sourceTree = "<group>"; }; A46D50BEBF523B3F88831086 /* LexAsn1.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsn1.cxx; path = ../../src/stc/scintilla/lexers/LexAsn1.cxx; sourceTree = "<group>"; };
A4A745D1821A32D591D76650 /* imagiff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = imagiff.cpp; path = ../../src/common/imagiff.cpp; sourceTree = "<group>"; }; A4A745D1821A32D591D76650 /* imagiff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = imagiff.cpp; path = ../../src/common/imagiff.cpp; sourceTree = "<group>"; };
A54B80C17F823CB5900AD2E8 /* framecmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = framecmn.cpp; path = ../../src/common/framecmn.cpp; sourceTree = "<group>"; }; A54B80C17F823CB5900AD2E8 /* framecmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = framecmn.cpp; path = ../../src/common/framecmn.cpp; sourceTree = "<group>"; };
A5617D10CB7136EC9A4194EF /* display.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = display.cpp; path = ../../src/osx/core/display.cpp; sourceTree = "<group>"; };
A5794CD687013AF8A20A691A /* headerctrlcmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = headerctrlcmn.cpp; path = ../../src/common/headerctrlcmn.cpp; sourceTree = "<group>"; }; A5794CD687013AF8A20A691A /* headerctrlcmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = headerctrlcmn.cpp; path = ../../src/common/headerctrlcmn.cpp; sourceTree = "<group>"; };
A57CF60203F53459A03951A9 /* arrstr.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arrstr.cpp; path = ../../src/common/arrstr.cpp; sourceTree = "<group>"; }; A57CF60203F53459A03951A9 /* arrstr.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arrstr.cpp; path = ../../src/common/arrstr.cpp; sourceTree = "<group>"; };
A5BBC1E494D33D028CA547FF /* jddctmgr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jddctmgr.c; path = ../../src/jpeg/jddctmgr.c; sourceTree = "<group>"; }; A5BBC1E494D33D028CA547FF /* jddctmgr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jddctmgr.c; path = ../../src/jpeg/jddctmgr.c; sourceTree = "<group>"; };
@@ -1953,7 +1951,6 @@
A1A53EC3A3463EFDB7614E93 /* bitmap.cpp */, A1A53EC3A3463EFDB7614E93 /* bitmap.cpp */,
9D1F14339D1C331087650931 /* colour.cpp */, 9D1F14339D1C331087650931 /* colour.cpp */,
343D4FDD5CC030618EF24729 /* dcmemory.cpp */, 343D4FDD5CC030618EF24729 /* dcmemory.cpp */,
A5617D10CB7136EC9A4194EF /* display.cpp */,
36E1DBA275AD325DB759C180 /* fontenum.cpp */, 36E1DBA275AD325DB759C180 /* fontenum.cpp */,
160EB9744CB63A0B81DC651F /* hid.cpp */, 160EB9744CB63A0B81DC651F /* hid.cpp */,
5CC5C13F8AA1387BADB7E60C /* printmac.cpp */, 5CC5C13F8AA1387BADB7E60C /* printmac.cpp */,
@@ -3008,7 +3005,6 @@
03BF1610E2FC3BD5ACB754F0 /* bitmap.cpp in Sources */, 03BF1610E2FC3BD5ACB754F0 /* bitmap.cpp in Sources */,
FF50EC0EC5F23DF890C6E95F /* colour.cpp in Sources */, FF50EC0EC5F23DF890C6E95F /* colour.cpp in Sources */,
BD2B17EB72E73A6EB6E0B26F /* dcmemory.cpp in Sources */, BD2B17EB72E73A6EB6E0B26F /* dcmemory.cpp in Sources */,
F1F484DD591337399FCD0463 /* display.cpp in Sources */,
371809DA4AD1382F8B532878 /* fontenum.cpp in Sources */, 371809DA4AD1382F8B532878 /* fontenum.cpp in Sources */,
86BE5213D3F131D8A6862679 /* hid.cpp in Sources */, 86BE5213D3F131D8A6862679 /* hid.cpp in Sources */,
AB58406CEBA13BC4A2A83B66 /* printmac.cpp in Sources */, AB58406CEBA13BC4A2A83B66 /* printmac.cpp in Sources */,

8
configure vendored
View File

@@ -27521,14 +27521,6 @@ fi
$as_echo "$as_me: WARNING: Xinerama not found; disabling wxDisplay" >&2;} $as_echo "$as_me: WARNING: Xinerama not found; disabling wxDisplay" >&2;}
wxUSE_DISPLAY="no" wxUSE_DISPLAY="no"
fi fi
elif test "$wxUSE_MSW" = 1; then
ac_fn_c_check_header_compile "$LINENO" "ddraw.h" "ac_cv_header_ddraw_h" "#include <windows.h>
"
if test "x$ac_cv_header_ddraw_h" = xyes; then :
fi
fi fi
fi fi

View File

@@ -3472,9 +3472,6 @@ if test "$wxUSE_DISPLAY" = "yes"; then
AC_MSG_WARN([Xinerama not found; disabling wxDisplay]) AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
wxUSE_DISPLAY="no" wxUSE_DISPLAY="no"
fi fi
elif test "$wxUSE_MSW" = 1; then
dnl DirectDraw for MSW - optionally used by WxDisplay.
AC_CHECK_HEADER([ddraw.h], [], [], [#include <windows.h>])
fi fi
fi fi

View File

@@ -10,6 +10,8 @@
#ifndef _WX_DISPLAY_H_BASE_ #ifndef _WX_DISPLAY_H_BASE_
#define _WX_DISPLAY_H_BASE_ #define _WX_DISPLAY_H_BASE_
#include "wx/defs.h"
// NB: no #if wxUSE_DISPLAY here, the display geometry part of this class (but // NB: no #if wxUSE_DISPLAY here, the display geometry part of this class (but
// not the video mode stuff) is always available but if wxUSE_DISPLAY == 0 // not the video mode stuff) is always available but if wxUSE_DISPLAY == 0
// it becomes just a trivial wrapper around the old wxDisplayXXX() functions // it becomes just a trivial wrapper around the old wxDisplayXXX() functions
@@ -48,7 +50,6 @@ public:
// dtor is not virtual as this is a concrete class not meant to be derived // dtor is not virtual as this is a concrete class not meant to be derived
// from // from
~wxDisplay();
// return the number of available displays, valid parameters to // return the number of available displays, valid parameters to

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wx/display_impl.h // Name: wx/private/display.h
// Purpose: wxDisplayImpl class declaration // Purpose: wxDisplayImpl class declaration
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Created: 2006-03-15 // Created: 2006-03-15
@@ -7,25 +7,35 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DISPLAY_IMPL_H_BASE_ #ifndef _WX_PRIVATE_DISPLAY_H_
#define _WX_DISPLAY_IMPL_H_BASE_ #define _WX_PRIVATE_DISPLAY_H_
#include "wx/display.h"
#include "wx/gdicmn.h" // for wxRect #include "wx/gdicmn.h" // for wxRect
#include "wx/vector.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxDisplayFactory: allows to create wxDisplay objects // wxDisplayFactory: allows to create wxDisplay objects
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDisplayFactory class wxDisplayFactory
{ {
public: public:
wxDisplayFactory() { } wxDisplayFactory() { }
virtual ~wxDisplayFactory() { } virtual ~wxDisplayFactory();
// create a new display object // Create the display if necessary using CreateDisplay(), otherwise just
// // get it from cache.
// it can return a NULL pointer if the display creation failed wxDisplayImpl* GetDisplay(unsigned n)
virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0; {
if ( m_impls.empty() )
m_impls.resize(GetCount());
else if ( m_impls[n] )
return m_impls[n];
m_impls[n] = CreateDisplay(n);
return m_impls[n];
}
// get the total number of displays // get the total number of displays
virtual unsigned GetCount() = 0; virtual unsigned GetCount() = 0;
@@ -37,13 +47,25 @@ public:
// //
// the window pointer must not be NULL (i.e. caller should check it) // the window pointer must not be NULL (i.e. caller should check it)
virtual int GetFromWindow(const wxWindow *window); virtual int GetFromWindow(const wxWindow *window);
protected:
// create a new display object
//
// it can return a NULL pointer if the display creation failed
virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0;
private:
// On-demand populated vector of wxDisplayImpl objects.
wxVector<wxDisplayImpl*> m_impls;
wxDECLARE_NO_COPY_CLASS(wxDisplayFactory);
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxDisplayImpl: base class for all wxDisplay implementations // wxDisplayImpl: base class for all wxDisplay implementations
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDisplayImpl class wxDisplayImpl
{ {
public: public:
// virtual dtor for this base class // virtual dtor for this base class
@@ -91,19 +113,63 @@ protected:
wxDECLARE_NO_COPY_CLASS(wxDisplayImpl); wxDECLARE_NO_COPY_CLASS(wxDisplayImpl);
}; };
// ----------------------------------------------------------------------------
// wxDisplayImplSingle: the simplest possible impl for the main display only
// ----------------------------------------------------------------------------
// Note that this is still an ABC and GetGeometry() and GetClientArea() methods
// must be implemented in the derived classes.
class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl
{
public:
wxDisplayImplSingle() : wxDisplayImpl(0) { }
virtual wxString GetName() const wxOVERRIDE { return wxString(); }
#if wxUSE_DISPLAY
// no video modes support for us, provide just the stubs
virtual wxArrayVideoModes
GetModes(const wxVideoMode& WXUNUSED(mode)) const wxOVERRIDE
{
return wxArrayVideoModes();
}
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE
{
return wxVideoMode();
}
virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) wxOVERRIDE
{
return false;
}
#endif // wxUSE_DISPLAY
wxDECLARE_NO_COPY_CLASS(wxDisplayImplSingle);
};
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxDisplayFactorySingle // wxDisplayFactorySingle
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// this is a stub implementation using single/main display only, it is // This is the simplest implementation of wxDisplayFactory using single/main
// available even if wxUSE_DISPLAY == 0 // display only. It is used when wxUSE_DISPLAY == 0 because getting the size of
class WXDLLIMPEXP_CORE wxDisplayFactorySingle : public wxDisplayFactory // the main display is always needed.
//
// Note that this is still an ABC and derived classes must implement
// CreateSingleDisplay().
class wxDisplayFactorySingle : public wxDisplayFactory
{ {
public: public:
virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE;
virtual unsigned GetCount() wxOVERRIDE { return 1; } virtual unsigned GetCount() wxOVERRIDE { return 1; }
virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE; virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE;
protected:
virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE;
virtual wxDisplayImpl *CreateSingleDisplay() = 0;
}; };
#endif // _WX_DISPLAY_IMPL_H_BASE_ #endif // _WX_PRIVATE_DISPLAY_H_

View File

@@ -66,9 +66,6 @@
Setting this to 0 causes more flicker, but allows applications to paint Setting this to 0 causes more flicker, but allows applications to paint
graphics on the parent of a static box (the optimized refresh causes any graphics on the parent of a static box (the optimized refresh causes any
such drawing to disappear). such drawing to disappear).
@flag{msw.display.directdraw}
If set to 1, use DirectDraw-based implementation of wxDisplay.
By default the standard Win32 functions are used.
@flag{msw.font.no-proof-quality} @flag{msw.font.no-proof-quality}
If set to 1, use default fonts quality instead of proof quality when If set to 1, use default fonts quality instead of proof quality when
creating fonts. With proof quality the fonts have slightly better creating fonts. With proof quality the fonts have slightly better

View File

@@ -170,13 +170,6 @@ bool MyApp::OnInit()
if ( !wxApp::OnInit() ) if ( !wxApp::OnInit() )
return false; return false;
#ifdef __WXMSW__
if ( argc == 2 && !wxStricmp(argv[1], "/dx") )
{
wxSystemOptions::SetOption("msw.display.directdraw", 1);
}
#endif // __WXMSW__
// create the main application window // create the main application window
MyFrame *frame = new MyFrame(_("Display wxWidgets Sample"), MyFrame *frame = new MyFrame(_("Display wxWidgets Sample"),
wxDefaultPosition, wxDefaultSize); wxDefaultPosition, wxDefaultSize);
@@ -242,8 +235,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
wxPanel *panel = new wxPanel(this, wxID_ANY); wxPanel *panel = new wxPanel(this, wxID_ANY);
m_book = new wxBookCtrl(panel, wxID_ANY); m_book = new wxBookCtrl(panel, wxID_ANY);
const size_t count = wxDisplay::GetCount(); const size_t countDpy = wxDisplay::GetCount();
for ( size_t nDpy = 0; nDpy < count; nDpy++ ) for ( size_t nDpy = 0; nDpy < countDpy; nDpy++ )
{ {
wxDisplay display(nDpy); wxDisplay display(nDpy);
@@ -285,14 +278,18 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
sizer->Add(new wxStaticText(page, wxID_ANY, "Name: ")); sizer->Add(new wxStaticText(page, wxID_ANY, "Name: "));
sizer->Add(new wxStaticText(page, wxID_ANY, display.GetName())); sizer->Add(new wxStaticText(page, wxID_ANY, display.GetName()));
sizer->Add(new wxStaticText(page, wxID_ANY, "Primary: "));
sizer->Add(new wxStaticText(page, wxID_ANY,
display.IsPrimary() ? "yes" : "no"));
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(sizer, 1, wxALL | wxEXPAND, 10); sizerTop->Add(sizer, 1, wxALL | wxEXPAND, 10);
#if wxUSE_DISPLAY #if wxUSE_DISPLAY
wxChoice *choiceModes = new wxChoice(page, Display_ChangeMode); wxChoice *choiceModes = new wxChoice(page, Display_ChangeMode);
const wxArrayVideoModes modes = display.GetModes(); const wxArrayVideoModes modes = display.GetModes();
const size_t count = modes.GetCount(); const size_t countModes = modes.GetCount();
for ( size_t nMode = 0; nMode < count; nMode++ ) for ( size_t nMode = 0; nMode < countModes; nMode++ )
{ {
const wxVideoMode& mode = modes[nMode]; const wxVideoMode& mode = modes[nMode];

View File

@@ -44,9 +44,7 @@
#include "wx/textwrapper.h" #include "wx/textwrapper.h"
#include "wx/modalhook.h" #include "wx/modalhook.h"
#if wxUSE_DISPLAY
#include "wx/display.h" #include "wx/display.h"
#endif
extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog"; extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog";
@@ -873,11 +871,7 @@ int wxStandardDialogLayoutAdapter::DoMustScroll(wxDialog* dialog, wxSize& window
wxSize minWindowSize = dialog->GetSizer()->GetMinSize(); wxSize minWindowSize = dialog->GetSizer()->GetMinSize();
windowSize = dialog->GetSize(); windowSize = dialog->GetSize();
windowSize = wxSize(wxMax(windowSize.x, minWindowSize.x), wxMax(windowSize.y, minWindowSize.y)); windowSize = wxSize(wxMax(windowSize.x, minWindowSize.x), wxMax(windowSize.y, minWindowSize.y));
#if wxUSE_DISPLAY
displaySize = wxDisplay(wxDisplay::GetFromWindow(dialog)).GetClientArea().GetSize(); displaySize = wxDisplay(wxDisplay::GetFromWindow(dialog)).GetClientArea().GetSize();
#else
displaySize = wxGetClientDisplayRect().GetSize();
#endif
int flags = 0; int flags = 0;

View File

@@ -29,8 +29,7 @@
#include "wx/module.h" #include "wx/module.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
#include "wx/display.h" #include "wx/private/display.h"
#include "wx/display_impl.h"
#if wxUSE_DISPLAY #if wxUSE_DISPLAY
@@ -50,43 +49,6 @@ const wxVideoMode wxDefaultVideoMode;
// created on demand and destroyed by wxDisplayModule // created on demand and destroyed by wxDisplayModule
static wxDisplayFactory *gs_factory = NULL; static wxDisplayFactory *gs_factory = NULL;
// ----------------------------------------------------------------------------
// wxDisplayImplSingle: trivial implementation working for main display only
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl
{
public:
wxDisplayImplSingle() : wxDisplayImpl(0) { }
virtual wxRect GetGeometry() const wxOVERRIDE
{
wxRect r;
wxDisplaySize(&r.width, &r.height);
return r;
}
virtual wxRect GetClientArea() const wxOVERRIDE { return wxGetClientDisplayRect(); }
virtual wxString GetName() const wxOVERRIDE { return wxString(); }
#if wxUSE_DISPLAY
// no video modes support for us, provide just the stubs
virtual wxArrayVideoModes GetModes(const wxVideoMode& WXUNUSED(mode)) const wxOVERRIDE
{
return wxArrayVideoModes();
}
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE { return wxVideoMode(); }
virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) wxOVERRIDE { return false; }
#endif // wxUSE_DISPLAY
wxDECLARE_NO_COPY_CLASS(wxDisplayImplSingle);
};
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxDisplayModule is used to cleanup gs_factory // wxDisplayModule is used to cleanup gs_factory
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -115,15 +77,10 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule);
wxDisplay::wxDisplay(unsigned n) wxDisplay::wxDisplay(unsigned n)
{ {
wxASSERT_MSG( n < GetCount(), wxASSERT_MSG( n == 0 || n < GetCount(),
wxT("An invalid index was passed to wxDisplay") ); wxT("An invalid index was passed to wxDisplay") );
m_impl = Factory().CreateDisplay(n); m_impl = Factory().GetDisplay(n);
}
wxDisplay::~wxDisplay()
{
delete m_impl;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -206,16 +163,6 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode)
// static functions implementation // static functions implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// if wxUSE_DISPLAY == 1 this is implemented in port-specific code
#if !wxUSE_DISPLAY
/* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{
return new wxDisplayFactorySingle;
}
#endif // !wxUSE_DISPLAY
/* static */ wxDisplayFactory& wxDisplay::Factory() /* static */ wxDisplayFactory& wxDisplay::Factory()
{ {
if ( !gs_factory ) if ( !gs_factory )
@@ -230,6 +177,15 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode)
// wxDisplayFactory implementation // wxDisplayFactory implementation
// ============================================================================ // ============================================================================
wxDisplayFactory::~wxDisplayFactory()
{
for ( size_t n = 0; n < m_impls.size(); ++n )
{
// It can be null, that's ok.
delete m_impls[n];
}
}
int wxDisplayFactory::GetFromWindow(const wxWindow *window) int wxDisplayFactory::GetFromWindow(const wxWindow *window)
{ {
// consider that the window belongs to the display containing its centre // consider that the window belongs to the display containing its centre
@@ -241,24 +197,13 @@ int wxDisplayFactory::GetFromWindow(const wxWindow *window)
// wxDisplayFactorySingle implementation // wxDisplayFactorySingle implementation
// ============================================================================ // ============================================================================
/* static */
wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(unsigned n) wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(unsigned n)
{ {
// we recognize the main display only // we recognize the main display only
return n != 0 ? NULL : new wxDisplayImplSingle; return n != 0 ? NULL : CreateSingleDisplay();
} }
int wxDisplayFactorySingle::GetFromPoint(const wxPoint& pt) int wxDisplayFactorySingle::GetFromPoint(const wxPoint& pt)
{ {
if ( pt.x >= 0 && pt.y >= 0 ) return wxDisplay().GetGeometry().Contains(pt) ? 0 : wxNOT_FOUND;
{
int w, h;
wxDisplaySize(&w, &h);
if ( pt.x < w && pt.y < h )
return 0;
}
// the point is outside of the screen
return wxNOT_FOUND;
} }

View File

@@ -16,6 +16,8 @@
#endif #endif
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/display.h"
#include "wx/gdiobj.h" #include "wx/gdiobj.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -843,18 +845,36 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
return font; return font;
} }
void wxDisplaySize(int *width, int *height)
{
const wxSize size = wxGetDisplaySize();
if ( width )
*width = size.x;
if ( height )
*height = size.y;
}
wxSize wxGetDisplaySize() wxSize wxGetDisplaySize()
{ {
int x, y; return wxDisplay().GetGeometry().GetSize();
wxDisplaySize(& x, & y); }
return wxSize(x, y);
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
const wxRect rect = wxGetClientDisplayRect();
if ( x )
*x = rect.x;
if ( y )
*y = rect.y;
if ( width )
*width = rect.width;
if ( height )
*height = rect.height;
} }
wxRect wxGetClientDisplayRect() wxRect wxGetClientDisplayRect()
{ {
int x, y, width, height; return wxDisplay().GetClientArea();
wxClientDisplayRect(&x, &y, &width, &height); // call plat-specific version
return wxRect(x, y, width, height);
} }
wxSize wxGetDisplaySizeMM() wxSize wxGetDisplaySizeMM()

View File

@@ -17,6 +17,7 @@
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/evtloop.h" #include "wx/evtloop.h"
#include "wx/apptrait.h" #include "wx/apptrait.h"
#include "wx/private/display.h"
#include "wx/unix/private/timer.h" #include "wx/unix/private/timer.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -56,6 +57,33 @@ wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)
// display characteristics // display characteristics
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// TODO: move into a separate src/dfb/display.cpp
class wxDisplayImplSingleDFB : public wxDisplayImplSingle
{
public:
virtual wxRect GetGeometry() const wxOVERRIDE
{
const wxVideoMode mode(wxTheApp->GetDisplayMode());
return wxRect(0, 0, mode.w, mode.h);
}
};
class wxDisplayFactorySingleDFB : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay()
{
return new wxDisplayImplSingleDFB;
}
};
wxDisplayFactory* wxDisplay::CreateFactory()
{
return new wxDisplayFactorySingleDFB;
}
bool wxColourDisplay() bool wxColourDisplay()
{ {
#warning "FIXME: wxColourDisplay" #warning "FIXME: wxColourDisplay"
@@ -67,13 +95,6 @@ int wxDisplayDepth()
return wxTheApp->GetDisplayMode().bpp; return wxTheApp->GetDisplayMode().bpp;
} }
void wxDisplaySize(int *width, int *height)
{
wxVideoMode mode(wxTheApp->GetDisplayMode());
if ( width ) *width = mode.w;
if ( height ) *height = mode.h;
}
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
// FIXME: there's no way to get physical resolution using the DirectDB // FIXME: there's no way to get physical resolution using the DirectDB
@@ -89,15 +110,6 @@ void wxDisplaySizeMM(int *width, int *height)
#undef PX_TO_MM #undef PX_TO_MM
} }
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
// return desktop dimensions minus any panels, menus, trays:
if (x) *x = 0;
if (y) *y = 0;
wxDisplaySize(width, height);
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// mouse // mouse
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -8,11 +8,7 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#if wxUSE_DISPLAY #include "wx/private/display.h"
#include "wx/display.h"
#include "wx/display_impl.h"
#endif
#include "wx/utils.h" // wxClientDisplayRect
#include "wx/gtk/private/wrapgtk.h" #include "wx/gtk/private/wrapgtk.h"
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
@@ -75,61 +71,6 @@ wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle*
#endif // !__WXGTK4__ #endif // !__WXGTK4__
void wxClientDisplayRect(int* x, int* y, int* width, int* height)
{
GdkRectangle rect;
GdkWindow* window = wxGetTopLevelGDK();
#ifdef __WXGTK4__
GdkMonitor* monitor =
gdk_display_get_monitor_at_window(gdk_window_get_display(window), window);
gdk_monitor_get_workarea(monitor, &rect);
#else
GdkScreen* screen = gdk_window_get_screen(window);
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
int monitor = gdk_screen_get_monitor_at_window(screen, window);
gdk_screen_get_monitor_workarea(screen, monitor, &rect);
wxGCC_WARNING_RESTORE()
#endif
if (x)
*x = rect.x;
if (y)
*y = rect.y;
if (width)
*width = rect.width;
if (height)
*height = rect.height;
}
//-----------------------------------------------------------------------------
#if wxUSE_DISPLAY
class wxDisplayFactoryGTK: public wxDisplayFactory
{
public:
virtual wxDisplayImpl* CreateDisplay(unsigned n) wxOVERRIDE;
virtual unsigned GetCount() wxOVERRIDE;
virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE;
};
class wxDisplayImplGTK: public wxDisplayImpl
{
typedef wxDisplayImpl base_type;
public:
wxDisplayImplGTK(unsigned i);
virtual wxRect GetGeometry() const wxOVERRIDE;
virtual wxRect GetClientArea() const wxOVERRIDE;
virtual wxString GetName() const wxOVERRIDE;
virtual bool IsPrimary() const wxOVERRIDE;
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE;
#ifdef __WXGTK4__
GdkMonitor* const m_monitor;
#else
GdkScreen* const m_screen;
#endif
};
//-----------------------------------------------------------------------------
#ifdef __WXGTK4__ #ifdef __WXGTK4__
static inline GdkDisplay* GetDisplay() static inline GdkDisplay* GetDisplay()
{ {
@@ -142,6 +83,45 @@ static inline GdkScreen* GetScreen()
} }
#endif #endif
//-----------------------------------------------------------------------------
// This class is always defined as it's used for the main display even when
// wxUSE_DISPLAY == 0.
class wxDisplayImplGTK : public wxDisplayImpl
{
typedef wxDisplayImpl base_type;
public:
wxDisplayImplGTK(unsigned i);
virtual wxRect GetGeometry() const wxOVERRIDE;
virtual wxRect GetClientArea() const wxOVERRIDE;
#if wxUSE_DISPLAY
virtual wxString GetName() const wxOVERRIDE;
virtual bool IsPrimary() const wxOVERRIDE;
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE;
#endif // wxUSE_DISPLAY
#ifdef __WXGTK4__
GdkMonitor* const m_monitor;
#else
GdkScreen* const m_screen;
#endif
};
//-----------------------------------------------------------------------------
// This class is only defined when we're built with full display support.
#if wxUSE_DISPLAY
class wxDisplayFactoryGTK: public wxDisplayFactory
{
public:
virtual wxDisplayImpl* CreateDisplay(unsigned n) wxOVERRIDE;
virtual unsigned GetCount() wxOVERRIDE;
virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE;
};
wxDisplayImpl* wxDisplayFactoryGTK::CreateDisplay(unsigned n) wxDisplayImpl* wxDisplayFactoryGTK::CreateDisplay(unsigned n)
{ {
return new wxDisplayImplGTK(n); return new wxDisplayImplGTK(n);
@@ -185,6 +165,8 @@ int wxDisplayFactoryGTK::GetFromPoint(const wxPoint& pt)
return monitor; return monitor;
#endif #endif
} }
#endif // wxUSE_DISPLAY
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
wxDisplayImplGTK::wxDisplayImplGTK(unsigned i) wxDisplayImplGTK::wxDisplayImplGTK(unsigned i)
@@ -223,6 +205,7 @@ wxRect wxDisplayImplGTK::GetClientArea() const
return wxRect(rect.x, rect.y, rect.width, rect.height); return wxRect(rect.x, rect.y, rect.width, rect.height);
} }
#if wxUSE_DISPLAY
wxString wxDisplayImplGTK::GetName() const wxString wxDisplayImplGTK::GetName() const
{ {
return wxString(); return wxString();
@@ -307,6 +290,23 @@ wxDisplayFactory* wxDisplay::CreateFactory()
{ {
return new wxDisplayFactoryGTK; return new wxDisplayFactoryGTK;
} }
#endif // wxUSE_DISPLAY
#else // !wxUSE_DISPLAY
class wxDisplayFactorySingleGTK : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay()
{
return new wxDisplayImplGTK(0);
}
};
wxDisplayFactory* wxDisplay::CreateFactory()
{
return wxDisplayFactorySingleGTK;
}
#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY
#endif // !defined(GDK_WINDOWING_WIN32) #endif // !defined(GDK_WINDOWING_WIN32)

View File

@@ -76,22 +76,6 @@ void *wxGetDisplay()
} }
#endif #endif
void wxDisplaySize( int *width, int *height )
{
#ifdef __WXGTK4__
GdkMonitor* monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
GdkRectangle rect;
gdk_monitor_get_geometry(monitor, &rect);
if (width) *width = rect.width;
if (height) *height = rect.height;
#else
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
if (width) *width = gdk_screen_width();
if (height) *height = gdk_screen_height();
wxGCC_WARNING_RESTORE()
#endif
}
void wxDisplaySizeMM( int *width, int *height ) void wxDisplaySizeMM( int *width, int *height )
{ {
#ifdef __WXGTK4__ #ifdef __WXGTK4__

View File

@@ -239,17 +239,6 @@ int wxDisplayDepth()
return DefaultDepth (dpy, DefaultScreen (dpy)); return DefaultDepth (dpy, DefaultScreen (dpy));
} }
// Get size of display
void wxDisplaySize(int *width, int *height)
{
Display *dpy = wxGlobalDisplay();
if ( width )
*width = DisplayWidth (dpy, DefaultScreen (dpy));
if ( height )
*height = DisplayHeight (dpy, DefaultScreen (dpy));
}
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
Display *dpy = wxGlobalDisplay(); Display *dpy = wxGlobalDisplay();

View File

@@ -24,11 +24,46 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#include "wx/private/display.h"
#include "wx/msw/private.h"
#include "wx/msw/wrapwin.h" #include "wx/msw/wrapwin.h"
#if wxUSE_DISPLAY // This implementation is always available, whether wxUSE_DISPLAY is 1 or not,
// as we fall back to it in case of error.
class wxDisplayImplSingleMSW : public wxDisplayImplSingle
{
public:
virtual wxRect GetGeometry() const wxOVERRIDE
{
ScreenHDC dc;
#include "wx/display.h" return wxRect(0, 0,
::GetDeviceCaps(dc, HORZRES),
::GetDeviceCaps(dc, VERTRES));
}
virtual wxRect GetClientArea() const wxOVERRIDE
{
RECT rc;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
wxRect rectClient;
wxCopyRECTToRect(rc, rectClient);
return rectClient;
}
};
class wxDisplayFactorySingleMSW : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE
{
return new wxDisplayImplSingleMSW;
}
};
#if wxUSE_DISPLAY
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/dynarray.h" #include "wx/dynarray.h"
@@ -39,9 +74,7 @@
#include "wx/dynlib.h" #include "wx/dynlib.h"
#include "wx/sysopt.h" #include "wx/sysopt.h"
#include "wx/display_impl.h"
#include "wx/msw/missing.h" #include "wx/msw/missing.h"
#include "wx/msw/private.h"
#include "wx/msw/private/hiddenwin.h" #include "wx/msw/private/hiddenwin.h"
static const wxChar displayDllName[] = wxT("user32.dll"); static const wxChar displayDllName[] = wxT("user32.dll");
@@ -170,7 +203,7 @@ wxDisplayFactoryMSW* wxDisplayFactoryMSW::ms_factory = NULL;
delete factoryMM; delete factoryMM;
// fall back to a stub implementation if no multimon support (Win95?) // fall back to a stub implementation if no multimon support (Win95?)
return new wxDisplayFactorySingle; return new wxDisplayFactorySingleMSW;
} }
@@ -507,17 +540,12 @@ int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window)
#endif #endif
} }
#endif // wxUSE_DISPLAY #else // !wxUSE_DISPLAY
void wxClientDisplayRect(int *x, int *y, int *width, int *height) // In this case, wxDisplayFactorySingleMSW is the only implementation.
wxDisplayFactory* wxDisplay::CreateFactory()
{ {
// Determine the desktop dimensions minus the taskbar and any other return new wxDisplayFactorySingleMSW;
// special decorations...
RECT r;
SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
if (x) *x = r.left;
if (y) *y = r.top;
if (width) *width = r.right - r.left;
if (height) *height = r.bottom - r.top;
} }
#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY

View File

@@ -905,20 +905,13 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
// change our window style to be compatible with full-screen mode // change our window style to be compatible with full-screen mode
updateStyle.Apply(); updateStyle.Apply();
wxRect rect; // resize to the size of the display containing us, falling back to the
#if wxUSE_DISPLAY // primary one
// resize to the size of the display containing us
int dpy = wxDisplay::GetFromWindow(this); int dpy = wxDisplay::GetFromWindow(this);
if ( dpy != wxNOT_FOUND ) if ( dpy == wxNOT_FOUND )
{ dpy = 0;
rect = wxDisplay(dpy).GetGeometry();
} const wxRect rect = wxDisplay(dpy).GetGeometry();
else // fall back to the main desktop
#endif // wxUSE_DISPLAY
{
// resize to the size of the desktop
wxCopyRECTToRect(wxGetWindowRect(::GetDesktopWindow()), rect);
}
SetSize(rect); SetSize(rect);

View File

@@ -145,17 +145,6 @@ int wxDisplayDepth()
return GetDeviceCaps(dc, PLANES) * GetDeviceCaps(dc, BITSPIXEL); return GetDeviceCaps(dc, PLANES) * GetDeviceCaps(dc, BITSPIXEL);
} }
// Get size of display
void wxDisplaySize(int *width, int *height)
{
ScreenHDC dc;
if ( width )
*width = ::GetDeviceCaps(dc, HORZRES);
if ( height )
*height = ::GetDeviceCaps(dc, VERTRES);
}
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
ScreenHDC dc; ScreenHDC dc;

View File

@@ -484,19 +484,11 @@ void wxApp::DoCleanUp()
} }
} }
void wxClientDisplayRect(int *x, int *y, int *width, int *height) extern // used from src/osx/core/display.cpp
wxRect wxOSXGetMainDisplayClientArea()
{ {
NSRect displayRect = [wxOSXGetMenuScreen() visibleFrame]; NSRect displayRect = [wxOSXGetMenuScreen() visibleFrame];
wxRect r = wxFromNSRect( NULL, displayRect ); return wxFromNSRect( NULL, displayRect );
if ( x )
*x = r.x;
if ( y )
*y = r.y;
if ( width )
*width = r.GetWidth();
if ( height )
*height = r.GetHeight();
} }
void wxGetMousePosition( int* x, int* y ) void wxGetMousePosition( int* x, int* y )

View File

@@ -22,9 +22,7 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_DISPLAY #include "wx/private/display.h"
#include "wx/display.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/dynarray.h" #include "wx/dynarray.h"
@@ -33,11 +31,32 @@
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#endif #endif
#include "wx/display_impl.h"
#include "wx/scopedarray.h"
#include "wx/osx/private.h" #include "wx/osx/private.h"
#if wxOSX_USE_COCOA_OR_CARBON // ----------------------------------------------------------------------------
// common helpers compiled even in wxUSE_DISPLAY==0 case
// ----------------------------------------------------------------------------
// This one is defined in Objective C++ code.
extern wxRect wxOSXGetMainDisplayClientArea();
namespace
{
wxRect wxGetDisplayGeometry(CGDirectDisplayID id)
{
CGRect theRect = CGDisplayBounds(id);
return wxRect( (int)theRect.origin.x,
(int)theRect.origin.y,
(int)theRect.size.width,
(int)theRect.size.height ); //floats
}
} // anonymous namespace
#if wxUSE_DISPLAY
#include "wx/scopedarray.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// display classes implementation // display classes implementation
@@ -197,11 +216,7 @@ bool wxDisplayImplMacOSX::IsPrimary() const
wxRect wxDisplayImplMacOSX::GetGeometry() const wxRect wxDisplayImplMacOSX::GetGeometry() const
{ {
CGRect theRect = CGDisplayBounds(m_id); return wxGetDisplayGeometry(m_id);
return wxRect( (int)theRect.origin.x,
(int)theRect.origin.y,
(int)theRect.size.width,
(int)theRect.size.height ); //floats
} }
wxRect wxDisplayImplMacOSX::GetClientArea() const wxRect wxDisplayImplMacOSX::GetClientArea() const
@@ -210,7 +225,7 @@ wxRect wxDisplayImplMacOSX::GetClientArea() const
// wxGetClientDisplayRect() does work correctly for at least the main // wxGetClientDisplayRect() does work correctly for at least the main
// one (TODO: do it correctly for the other displays too) // one (TODO: do it correctly for the other displays too)
if ( IsPrimary() ) if ( IsPrimary() )
return wxGetClientDisplayRect(); return wxOSXGetMainDisplayClientArea();
return wxDisplayImpl::GetClientArea(); return wxDisplayImpl::GetClientArea();
} }
@@ -311,13 +326,34 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode )
return new wxDisplayFactoryMacOSX; return new wxDisplayFactoryMacOSX;
} }
#else #else // !wxUSE_DISPLAY
class wxDisplayImplSingleMacOSX : public wxDisplayImplSingle
{
public:
virtual wxRect GetGeometry() const wxOVERRIDE
{
return wxGetDisplayGeometry(CGMainDisplayID());
}
virtual wxRect GetClientArea() const wxOVERRIDE
{
return wxOSXGetMainDisplayClientArea();
}
};
class wxDisplayFactorySingleMacOSX : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE
{
return new wxDisplayImplSingleMacOSX;
}
};
/* static */ wxDisplayFactory *wxDisplay::CreateFactory() /* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{ {
return new wxDisplayFactorySingle; return new wxDisplayFactorySingleMacOSX;
} }
#endif
#endif // wxUSE_DISPLAY #endif // wxUSE_DISPLAY

View File

@@ -10,8 +10,6 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#include "wx/wxprec.h"
#include "wx/utils.h" #include "wx/utils.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -25,6 +23,8 @@
#include "wx/apptrait.h" #include "wx/apptrait.h"
#include "wx/private/display.h"
#include "wx/osx/private.h" #include "wx/osx/private.h"
#if wxUSE_GUI #if wxUSE_GUI
@@ -116,46 +116,6 @@ CFArrayRef CopyAvailableFontFamilyNames()
return (CFArrayRef) [[UIFont familyNames] retain]; return (CFArrayRef) [[UIFont familyNames] retain];
} }
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
#if 0
CGRect r = [[UIScreen mainScreen] applicationFrame];
CGRect bounds = [[UIScreen mainScreen] bounds];
if ( bounds.size.height > r.size.height )
{
// portrait
if ( x )
*x = r.origin.x;
if ( y )
*y = r.origin.y;
if ( width )
*width = r.size.width;
if ( height )
*height = r.size.height;
}
else
{
// landscape
if ( x )
*x = r.origin.y;
if ( y )
*y = r.origin.x;
if ( width )
*width = r.size.height;
if ( height )
*height = r.size.width;
}
#else
// it's easier to treat the status bar as an element of the toplevel window
// instead of the desktop in order to support easy rotation
if ( x )
*x = 0;
if ( y )
*y = 0;
wxDisplaySize(width, height);
#endif
}
void wxGetMousePosition( int* x, int* y ) void wxGetMousePosition( int* x, int* y )
{ {
if ( x ) if ( x )
@@ -177,26 +137,44 @@ int wxDisplayDepth()
} }
// Get size of display // Get size of display
void wxDisplaySize(int *width, int *height)
class wxDisplayImplSingleiOS : public wxDisplayImplSingle
{ {
public:
virtual wxRect GetGeometry() const wxOVERRIDE
{
CGRect bounds = [[UIScreen mainScreen] bounds]; CGRect bounds = [[UIScreen mainScreen] bounds];
int width, height;
if ( UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ) if ( UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) )
{ {
// portrait // portrait
if ( width ) width = (int)bounds.size.width ;
*width = (int)bounds.size.width ; height = (int)bounds.size.height;
if ( height )
*height = (int)bounds.size.height;
} }
else else
{ {
// landscape // landscape
if ( width ) width = (int)bounds.size.height ;
*width = (int)bounds.size.height ; height = (int)bounds.size.width;
if ( height )
*height = (int)bounds.size.width;
} }
return wxRect(0, 0, width, height);
}
};
class wxDisplayFactorySingleiOS : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE
{
return new wxDisplayImplSingleiOS;
}
};
/* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{
return new wxDisplayFactorySingleiOS;
} }
wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)

View File

@@ -87,17 +87,6 @@ int wxDisplayDepth()
return theDepth; return theDepth;
} }
// Get size of display
void wxDisplaySize(int *width, int *height)
{
// TODO adapt for multi-displays
CGRect bounds = CGDisplayBounds(CGMainDisplayID());
if ( width )
*width = (int)bounds.size.width ;
if ( height )
*height = (int)bounds.size.height;
}
#if wxUSE_GUI #if wxUSE_GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -9,7 +9,7 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#include "wx/display.h" #include "wx/display.h"
#include "wx/display_impl.h" #include "wx/private/display.h"
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget> #include <QtWidgets/QDesktopWidget>
#include "wx/qt/private/converter.h" #include "wx/qt/private/converter.h"
@@ -19,12 +19,16 @@ class wxDisplayImplQt : public wxDisplayImpl
public: public:
wxDisplayImplQt( unsigned n ); wxDisplayImplQt( unsigned n );
virtual wxRect GetGeometry() const; virtual wxRect GetGeometry() const wxOVERRIDE;
virtual wxString GetName() const; virtual wxRect GetClientArea() const wxOVERRIDE;
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const; virtual wxString GetName() const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const;
virtual bool ChangeMode(const wxVideoMode& mode); #if wxUSE_DISPLAY
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE;
#endif // wxUSE_DISPLAY
}; };
wxDisplayImplQt::wxDisplayImplQt( unsigned n ) wxDisplayImplQt::wxDisplayImplQt( unsigned n )
@@ -37,11 +41,17 @@ wxRect wxDisplayImplQt::GetGeometry() const
return wxQtConvertRect( QApplication::desktop()->screenGeometry( GetIndex() )); return wxQtConvertRect( QApplication::desktop()->screenGeometry( GetIndex() ));
} }
wxRect wxDisplayImplQt::GetClientArea() const
{
return wxQtConvertRect( QApplication::desktop()->availableGeometry( GetIndex() ));
}
wxString wxDisplayImplQt::GetName() const wxString wxDisplayImplQt::GetName() const
{ {
return wxString(); return wxString();
} }
#if wxUSE_DISPLAY
wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const
{ {
return wxArrayVideoModes(); return wxArrayVideoModes();
@@ -60,25 +70,21 @@ bool wxDisplayImplQt::ChangeMode(const wxVideoMode& WXUNUSED(mode))
{ {
return false; return false;
} }
#endif // wxUSE_DISPLAY
//############################################################################## //##############################################################################
#if wxUSE_DISPLAY
class wxDisplayFactoryQt : public wxDisplayFactory class wxDisplayFactoryQt : public wxDisplayFactory
{ {
public: public:
wxDisplayFactoryQt(); virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE;
virtual unsigned GetCount() wxOVERRIDE;
virtual wxDisplayImpl *CreateDisplay(unsigned n); virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE;
virtual unsigned GetCount();
virtual int GetFromPoint(const wxPoint& pt);
}; };
wxDisplayFactoryQt::wxDisplayFactoryQt()
{
}
wxDisplayImpl *wxDisplayFactoryQt::CreateDisplay(unsigned n) wxDisplayImpl *wxDisplayFactoryQt::CreateDisplay(unsigned n)
{ {
return new wxDisplayImplQt( n ); return new wxDisplayImplQt( n );
@@ -100,3 +106,21 @@ int wxDisplayFactoryQt::GetFromPoint(const wxPoint& pt)
{ {
return new wxDisplayFactoryQt; return new wxDisplayFactoryQt;
} }
#else // wxUSE_DISPLAY
class wxDisplayFactorySingleQt : public wxDisplayFactorySingleQt
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE
{
return new wxDisplayImplQt(0);
}
};
/* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{
return new wxDisplayFactorySingleQt;
}
#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY

View File

@@ -115,14 +115,6 @@ int wxDisplayDepth()
return QApplication::desktop()->depth(); return QApplication::desktop()->depth();
} }
void wxDisplaySize(int *width, int *height)
{
if ( width != NULL )
*width = QApplication::desktop()->width();
if ( height != NULL )
*height = QApplication::desktop()->height();
}
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
if ( width != NULL ) if ( width != NULL )
@@ -136,16 +128,6 @@ void wxBell()
QApplication::beep(); QApplication::beep();
} }
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
QRect r = QApplication::desktop()->availableGeometry();
*x = r.x();
*y = r.y();
*width = r.width();
*height = r.height();
}
wxWindow *wxGetActiveWindow() wxWindow *wxGetActiveWindow()
{ {
QWidget *w = QApplication::activeWindow(); QWidget *w = QApplication::activeWindow();

View File

@@ -1957,17 +1957,11 @@ void Window::SetTitle(const char *s) {
// Returns rectangle of monitor pt is on // Returns rectangle of monitor pt is on
PRectangle Window::GetMonitorRect(Point pt) { PRectangle Window::GetMonitorRect(Point pt) {
wxRect rect;
if (! wid) return PRectangle(); if (! wid) return PRectangle();
#if wxUSE_DISPLAY
// Get the display the point is found on // Get the display the point is found on
int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y))); int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y)));
wxDisplay dpy(n == wxNOT_FOUND ? 0 : n); wxDisplay dpy(n == wxNOT_FOUND ? 0 : n);
rect = dpy.GetGeometry(); return PRectangleFromwxRect(dpy.GetGeometry());
#else
wxUnusedVar(pt);
#endif
return PRectangleFromwxRect(rect);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@@ -37,16 +37,48 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#endif #endif
#if wxUSE_DISPLAY #include "wx/private/display.h"
#include "wx/display.h"
#include "wx/display_impl.h"
#ifndef __WXGTK20__ #ifndef __WXGTK20__
#include <X11/extensions/Xinerama.h> static wxRect wxGetMainScreenWorkArea();
typedef XineramaScreenInfo ScreenInfo; class wxDisplayImplSingleX11 : public wxDisplayImplSingle
{
public:
virtual wxRect GetGeometry() const wxOVERRIDE
{
Display* const dpy = wxGetX11Display();
return wxRect(0, 0,
DisplayWidth(dpy, DefaultScreen (dpy)),
DisplayHeight(dpy, DefaultScreen (dpy)));
}
virtual wxRect GetClientArea() const wxOVERRIDE
{
return wxGetMainScreenWorkArea();
}
};
class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle
{
protected:
virtual wxDisplayImpl *CreateSingleDisplay()
{
return new wxDisplayImplSingleX11;
}
};
#endif // !__WXGTK20__
#if wxUSE_DISPLAY
#ifndef __WXGTK20__
#include <X11/extensions/Xinerama.h>
typedef XineramaScreenInfo ScreenInfo;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// helper class storing information about all screens // helper class storing information about all screens
@@ -97,7 +129,7 @@ public:
// we intentionally don't cache the result here because the client // we intentionally don't cache the result here because the client
// display area may change (e.g. the user resized or hid a panel) and // display area may change (e.g. the user resized or hid a panel) and
// we don't currently react to its changes // we don't currently react to its changes
return IsPrimary() ? wxGetClientDisplayRect() : m_rect; return IsPrimary() ? wxGetMainScreenWorkArea() : m_rect;
} }
virtual wxString GetName() const wxOVERRIDE { return wxString(); } virtual wxString GetName() const wxOVERRIDE { return wxString(); }
@@ -347,13 +379,20 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode))
/* static */ wxDisplayFactory *wxDisplay::CreateFactory() /* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{ {
if ( !XineramaIsActive((Display*)wxGetDisplay()) ) if ( !XineramaIsActive((Display*)wxGetDisplay()) )
return new wxDisplayFactorySingle; return new wxDisplayFactorySingleX11;
return new wxDisplayFactoryX11; return new wxDisplayFactoryX11;
} }
#endif #endif
#endif /* wxUSE_DISPLAY */ #else // !wxUSE_DISPLAY
/* static */ wxDisplayFactory *wxDisplay::CreateFactory()
{
return new wxDisplayFactorySingleX11;
}
#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY
#if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) #if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11)
void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height) void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height)
@@ -388,45 +427,33 @@ void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height)
#ifndef __WXGTK20__ #ifndef __WXGTK20__
void wxClientDisplayRect(int *x, int *y, int *width, int *height) wxRect wxGetMainScreenWorkArea()
{ {
wxRect rect;
Display * const dpy = wxGetX11Display(); Display * const dpy = wxGetX11Display();
wxCHECK_RET( dpy, wxT("can't be called before initializing the GUI") ); wxCHECK_MSG( dpy, rect, "can't be called before initializing the GUI" );
wxRect rectClient;
wxGetWorkAreaX11(DefaultScreenOfDisplay(dpy), wxGetWorkAreaX11(DefaultScreenOfDisplay(dpy),
rectClient.x, rectClient.y, rectClient.width, rectClient.height); rect.x, rect.y, rect.width, rect.height);
// Although _NET_WORKAREA is supposed to return the client size of the const wxRect rectFull = wxDisplay().GetGeometry();
// screen, not all implementations are conforming, apparently, see #14419,
// so make sure we return a subset of the primary display.
wxRect rectFull;
#if wxUSE_DISPLAY
ScreensInfo screens;
const ScreenInfo& info = screens[0];
rectFull = wxRect(info.x_org, info.y_org, info.width, info.height);
#else
wxDisplaySize(&rectFull.width, &rectFull.height);
#endif
if ( !rectClient.width || !rectClient.height ) if ( !rect.width || !rect.height )
{ {
// _NET_WORKAREA not available or didn't work, fall back to the total // _NET_WORKAREA not available or didn't work, fall back to the total
// display size. // display size.
rectClient = rectFull; rect = rectFull;
} }
else else
{ {
rectClient = rectClient.Intersect(rectFull); // Although _NET_WORKAREA is supposed to return the client size of the
// screen, not all implementations are conforming, apparently, see
// #14419, so make sure we return a subset of the primary display.
rect = rect.Intersect(rectFull);
} }
if ( x ) return rect;
*x = rectClient.x;
if ( y )
*y = rectClient.y;
if ( width )
*width = rectClient.width;
if ( height )
*height = rectClient.height;
} }
#endif // !__WXGTK20__ #endif // !__WXGTK20__

View File

@@ -162,17 +162,6 @@ int wxDisplayDepth()
return DefaultDepth (dpy, DefaultScreen (dpy)); return DefaultDepth (dpy, DefaultScreen (dpy));
} }
// Get size of display
void wxDisplaySize(int *width, int *height)
{
Display *dpy = (Display*) wxGetDisplay();
if ( width )
*width = DisplayWidth (dpy, DefaultScreen (dpy));
if ( height )
*height = DisplayHeight (dpy, DefaultScreen (dpy));
}
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
Display *dpy = (Display*) wxGetDisplay(); Display *dpy = (Display*) wxGetDisplay();

View File

@@ -64,6 +64,7 @@ BENCH_GUI_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
BENCH_GUI_OBJECTS = \ BENCH_GUI_OBJECTS = \
$(__bench_gui___win32rc) \ $(__bench_gui___win32rc) \
bench_gui_bench.o \ bench_gui_bench.o \
bench_gui_display.o \
bench_gui_image.o bench_gui_image.o
BENCH_GRAPHICS_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ BENCH_GRAPHICS_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
$(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
@@ -306,6 +307,9 @@ bench_gui_sample_rc.o: $(srcdir)/../../samples/sample.rc
bench_gui_bench.o: $(srcdir)/bench.cpp bench_gui_bench.o: $(srcdir)/bench.cpp
$(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/bench.cpp $(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/bench.cpp
bench_gui_display.o: $(srcdir)/display.cpp
$(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/display.cpp
bench_gui_image.o: $(srcdir)/image.cpp bench_gui_image.o: $(srcdir)/image.cpp
$(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/image.cpp $(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/image.cpp

View File

@@ -36,6 +36,7 @@
<sources> <sources>
bench.cpp bench.cpp
display.cpp
image.cpp image.cpp
</sources> </sources>
<wx-lib>core</wx-lib> <wx-lib>core</wx-lib>

View File

@@ -286,6 +286,9 @@
<File <File
RelativePath=".\bench.cpp"> RelativePath=".\bench.cpp">
</File> </File>
<File
RelativePath=".\display.cpp">
</File>
<File <File
RelativePath=".\image.cpp"> RelativePath=".\image.cpp">
</File> </File>

View File

@@ -810,6 +810,10 @@
RelativePath=".\bench.cpp" RelativePath=".\bench.cpp"
> >
</File> </File>
<File
RelativePath=".\display.cpp"
>
</File>
<File <File
RelativePath=".\image.cpp" RelativePath=".\image.cpp"
> >

View File

@@ -782,6 +782,10 @@
RelativePath=".\bench.cpp" RelativePath=".\bench.cpp"
> >
</File> </File>
<File
RelativePath=".\display.cpp"
>
</File>
<File <File
RelativePath=".\image.cpp" RelativePath=".\image.cpp"
> >

View File

@@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tests/benchmarks/display.cpp
// Purpose: wxDisplay benchmarks
// Author: Vadim Zeitlin
// Created: 2018-09-30
// Copyright: (c) 2018 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/display.h"
#include "wx/gdicmn.h"
#include "bench.h"
BENCHMARK_FUNC(DisplaySize)
{
int w, h;
wxDisplaySize(&w, &h);
return w > 0;
}
BENCHMARK_FUNC(GetDisplaySize)
{
return wxGetDisplaySize().x > 0;
}
BENCHMARK_FUNC(DisplayGetGeometry)
{
return wxDisplay().GetGeometry().GetSize().x > 0;
}

View File

@@ -54,6 +54,7 @@ BENCH_GUI_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \
$(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(CPPFLAGS) $(CXXFLAGS) $(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(CPPFLAGS) $(CXXFLAGS)
BENCH_GUI_OBJECTS = \ BENCH_GUI_OBJECTS = \
$(OBJS)\bench_gui_bench.obj \ $(OBJS)\bench_gui_bench.obj \
$(OBJS)\bench_gui_display.obj \
$(OBJS)\bench_gui_image.obj $(OBJS)\bench_gui_image.obj
BENCH_GRAPHICS_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ BENCH_GRAPHICS_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \
$(__OPTIMIZEFLAG) $(__THREADSFLAG_1) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__OPTIMIZEFLAG) $(__THREADSFLAG_1) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
@@ -340,6 +341,9 @@ $(OBJS)\bench_gui_sample.res: .\..\..\samples\sample.rc
$(OBJS)\bench_gui_bench.obj: .\bench.cpp $(OBJS)\bench_gui_bench.obj: .\bench.cpp
$(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp $(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp
$(OBJS)\bench_gui_display.obj: .\display.cpp
$(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\display.cpp
$(OBJS)\bench_gui_image.obj: .\image.cpp $(OBJS)\bench_gui_image.obj: .\image.cpp
$(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp $(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp

View File

@@ -49,6 +49,7 @@ BENCH_GUI_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \
BENCH_GUI_OBJECTS = \ BENCH_GUI_OBJECTS = \
$(OBJS)\bench_gui_sample_rc.o \ $(OBJS)\bench_gui_sample_rc.o \
$(OBJS)\bench_gui_bench.o \ $(OBJS)\bench_gui_bench.o \
$(OBJS)\bench_gui_display.o \
$(OBJS)\bench_gui_image.o $(OBJS)\bench_gui_image.o
BENCH_GRAPHICS_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ BENCH_GRAPHICS_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \
$(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
@@ -318,6 +319,9 @@ $(OBJS)\bench_gui_sample_rc.o: ./../../samples/sample.rc
$(OBJS)\bench_gui_bench.o: ./bench.cpp $(OBJS)\bench_gui_bench.o: ./bench.cpp
$(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\bench_gui_display.o: ./display.cpp
$(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\bench_gui_image.o: ./image.cpp $(OBJS)\bench_gui_image.o: ./image.cpp
$(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $<

View File

@@ -51,6 +51,7 @@ BENCH_GUI_CXXFLAGS = /M$(__RUNTIME_LIBS_26)$(__DEBUGRUNTIME) /DWIN32 \
/DNOPCH /D_CONSOLE $(__RTTIFLAG) $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS) /DNOPCH /D_CONSOLE $(__RTTIFLAG) $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS)
BENCH_GUI_OBJECTS = \ BENCH_GUI_OBJECTS = \
$(OBJS)\bench_gui_bench.obj \ $(OBJS)\bench_gui_bench.obj \
$(OBJS)\bench_gui_display.obj \
$(OBJS)\bench_gui_image.obj $(OBJS)\bench_gui_image.obj
BENCH_GUI_RESOURCES = \ BENCH_GUI_RESOURCES = \
$(OBJS)\bench_gui_sample.res $(OBJS)\bench_gui_sample.res
@@ -512,6 +513,9 @@ $(OBJS)\bench_gui_sample.res: .\..\..\samples\sample.rc
$(OBJS)\bench_gui_bench.obj: .\bench.cpp $(OBJS)\bench_gui_bench.obj: .\bench.cpp
$(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp $(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp
$(OBJS)\bench_gui_display.obj: .\display.cpp
$(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\display.cpp
$(OBJS)\bench_gui_image.obj: .\image.cpp $(OBJS)\bench_gui_image.obj: .\image.cpp
$(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp $(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp