Commit Graph

51 Commits

Author SHA1 Message Date
Vadim Zeitlin
8926928a8f Fix regression in wxGCDC initialization from wxGraphicsContext
The changes of ae2cb7d347 resulted in
transformation matrix not being initialized correctly any more.

Fix this by adding yet another helper, DoInitContext(), called both when
initializing wxGCDC using an existing wxGraphicsContext in the
corresponding ctor and the just created one in the other ones.

Closes #18429.
2019-07-07 03:14:21 +02:00
Vadim Zeitlin
0338ad5124 Factor out wxGCDCImpl::CommonInit()
No real changes, just a small refactoring that will allow reusing the
new CommonInit() method in the next commit.
2019-06-30 19:19:31 +02:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Vadim Zeitlin
507e331eb1 Improve creating wxGCDC from an existing wxGraphicsContext
Avoid creating a default wxGraphicsContext unnecessarily, only to
immediately delete it and replace it with the provided one.

This was at best unnecessary and at worst resulted in a crash if the
default context couldn't be created, as happened on a headless system
(where wxImage-based wxGraphicsContext can still be created
successfully).
2018-12-06 03:40:49 +01:00
Vadim Zeitlin
c5530b1abf Switch to using DoGetClippingRect() instead of DoGetClippingBox()
The new method returns a boolean flag which indicates whether there is
any clipping region or not and so is preferable to using the old one and
checking its return value to determine this, which can't be done
reliably.
2018-06-19 00:20:47 +02:00
Jeff Bland
8b18bbb9c7 Fix uses of wxPalette without check for wxUSE_PALETTE 2018-05-18 18:49:05 -06:00
Maarten
977a826639 use more wxOVERRIDE (#329) 2016-09-25 13:21:28 -07:00
Artur Wieczorek
b5a740a85f Remove unused member variables from wxGCDCImpl 2016-09-20 21:32:09 +02:00
Artur Wieczorek
41a2b3e371 Fix applying affine transformation matrix in wxGCDC
In wxGCDCImpl::ComputeScaleAndOrigin() current affine transformation matrix (applied with SetTransformMatrix, ResetTransformMatrix) has to be concatenated with current basic transformations (applied with SetDeviceOrigin, SetLogicalScale, etc.).

Closes #17674.
2016-09-20 21:31:56 +02:00
Artur Wieczorek
49000defcf Add support for affine transformation matrix in wxGCDC
Graphics renderers (exposed through wxGraphicsContext) support arbitrary affine transformations so it is possible to add support for affine transformations in wxGCDC by implementing all wxGCDC::*TransformMatrix() functions with calls to respective wxGraphicsContext functions.
Additionally, this implementation adds support for affine transformations in wxDC under wxGTK3 because in this port wxDC is equivalent to wxGCDC.
2016-09-08 19:34:43 +02:00
Artur Wieczorek
98714ea452 Fix retrieving clipping box after changing wxGCDC coordinates (MSW, GTK)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().

See #17646.
2016-09-01 21:41:18 +02:00
Paul Cornett
ace212a311 Remove redundant wxGCDC::{Get,Set}GraphicsContext() overrides 2016-02-22 10:34:30 -08:00
Paul Cornett
27a8d28029 more use of wxOVERRIDE 2015-09-06 17:20:42 -07:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Paul Cornett
4787c92d39 use const arrays for wxDC array parameters, closes #10712
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-18 17:27:51 +00:00
Robin Dunn
9eefb5c14a Adding wxDC::GetHandle for wxOSX-cocoa and wxOSX-carbon
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-28 19:31:03 +00:00
Paul Cornett
f30b9eed38 avoid creating and immediately destroying a wxGraphicsContext when creating a wxDC with wxGTK3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-13 16:58:37 +00:00
Paul Cornett
e7042ce73b Avoid creating and immediately destroying a wxGraphicsContext for most uses of wxGCDC.
This also causes the dummy "measuring context" to be properly initialized with a default font


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-11 06:36:38 +00:00
Robin Dunn
34c92eeeb7 Don't hide the m_mm_to_pix_x and m_mm_to_pix_y in the base class by redefining them in a derived class. Fixes #14399.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-26 18:25:29 +00:00
Stefan Csomor
a9946c4e6b removing unnecessary - and incorrect - override, fixes #14319
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-19 14:24:13 +00:00
Robin Dunn
932d0768aa * Implement dynamic loading of the Cairo DLL on Windows similar to how it was
done for GDI+.

* Enable the use of the wxCairoContext on MSW.

* Enable creating a wxGCDC from an exisiting wxGraphicsContext.

* Since it's possible for a DLL that is using wx to not be on the PATH nor in
  the same location as the .exe, change the wxDynamicLibrary::RawLoad method to
  explicitly look first in the same place as the main wx-using binary.  This way
  it will find DLLs that are in the same folder as the wx-using binary even if
  that would not be in the normal DLL search path.  

* Change wxDCImpl and wxDC::GetLogicalScale to be const methods.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 23:26:53 +00:00
Vadim Zeitlin
2d770c4f82 Added wxGCDC(wxEnhMetaFileDC) ctor too.
Make it possible to create wxGCDC associated with a metafile DC in wxMSW too.

Closes #13326.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-19 22:35:41 +00:00
Vadim Zeitlin
53d4bdbc15 Add wxDCImpl::MSWApplyGDIPlusTransform() to formalize wxRendererMSW hack.
Replace the dynamic_cast<> used in wxMSW wxRenderer implementation code with a
virtual function call.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-07 13:05:22 +00:00
Vadim Zeitlin
6c0e710f00 Make wxGCDC::GetGraphicsContext() const.
There is no reason for this accessor to not be const and it prevents other
methods using it from being const too, so change this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-07 13:05:16 +00:00
Dimitri Schoolwerth
80fdcdb90e No changes, synchronised source names that appear commented at the top of files with the actual path to the files.
Fixed commented names (path, filename, and extension) of files in include/ and src/. Prepended the names in src/ with "src/" everywhere, while starting those in include/wx/ with "wx/".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-20 00:14:35 +00:00
Vadim Zeitlin
942d5e2d72 Replaced GraphicsHDC from src/msw/renderer.cpp with wxDC::GetTempHDC().
wxDC::GetTempHDC() method provides a convenient and safe way to retrieve HDC
from a wxDC object, whether it is using GDI or GDI+. It is implemented using
(MSW-specific) virtual functions in wxDC and so doesn't need ugly hacks like
wxDynamicCast which were used in src/msw/renderer.cpp to achieve the same
effect.

Also, we now use GetTempHDC() consistently in all wxMSW rendering methods as
the old GraphicsHDC was only used in some of them meaning that many methods
didn't work at all with wxGCDC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-05 22:56:58 +00:00
Vadim Zeitlin
03647350fc No changes, just removed hard tabs and trailing white space.
This commit is huge but there are no non-white-space changes in it.

Some files containing third-party sources (src/msw/wince/time.cpp,
src/x11/pango*.cpp) were left unchanged.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-21 10:41:26 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Francesco Montorsi
89efaf2b65 change generic ints to enums in wxDC (closes #9959)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-08 14:21:53 +00:00
Stefan Csomor
220d37c864 better guarding when no printing architecture exists (patch from Joel Low)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-07-31 05:57:56 +00:00
Vadim Zeitlin
fdaad94e75 deprecate wxDC::SetClippingRegion(wxRegion) overload and replace it with SetDeviceClippingRegion() to avoid confusion due to use of different kind of coordinates in this and other overloads of the same function; also rename wxDCImpl::DoSetClippingRegionAsRegion() to DoSetDeviceClippingRegion(); finally use bounding box of the region passed to wxDCClipper ctor to avoid interpreting coordinates differently for different ctors of the same class (see #8970)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-08 01:45:56 +00:00
Robert Roebling
b25c34aae4 Added constructor to wxGCDC from wxPrinterDC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-30 09:26:02 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Paul Cornett
512cfcc341 make access for virtuals match base
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-06 16:22:00 +00:00
Stefan Csomor
4dd36d1d69 fixing warning about missing virt destructor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-03 16:34:29 +00:00
Paul Cornett
11a0827d14 non-pch build fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-03 02:15:43 +00:00
Stefan Csomor
ac43092b9d using common code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 20:51:32 +00:00
Robert Roebling
888dde65f4 DC reorganization
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 13:48:22 +00:00
Stefan Csomor
cc18b1c7af forward port from 2.8
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-09 20:25:57 +00:00
Robert Roebling
b0d7707bc4 Use wxPointList instead of wxList in wxDC code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-19 14:53:55 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Václav Slavík
d45127a543 removed executable bit on files that aren't executables
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-25 14:04:34 +00:00
Vadim Zeitlin
c94f845b16 changed wxDC::GetTextExtent() and related methods to take const wxFont pointer, for consistency with wxWindow::GetTextExtent() and because it generally doesn't need a non-const font
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-25 01:49:47 +00:00
Vadim Zeitlin
e3b81044ee wxDC::StretchBlit() for wxMac and wxMSW (patch 1611973)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-18 15:32:27 +00:00
Stefan Csomor
4280b8797f adding raster op hook to graphics context
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-03 15:23:42 +00:00
Stefan Csomor
773ccc318e adapting to new inheritance of wxMemoryDC (under MSW only at the moment)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-06 09:47:20 +00:00
Stefan Csomor
2b73854d7a forgotten commit for having native affine matrix ops
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-29 10:41:13 +00:00
Paul Cornett
b687dd2fc1 wxGraphicContext --> wxGraphicsContext
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-21 18:00:11 +00:00
Robert Roebling
ddb0ed69a9 Fix warning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-21 17:22:07 +00:00