It seems wrong to have this function in wxGraphicsContext only and not
in wxGraphicsRenderer, as this makes it impossible to create a context
associated with a non-default renderer while it doesn't cost us anything
to allow doing this.
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.
This method allows to retrieve the window this context is associated
with, if any.
Add "wxWindow*" argument to wxGraphicsContext ctor and provide the
window pointer to it when available, i.e. when creating the context from
a wxWindow directly or from wxWindowDC, which is also associated with a
window, in platform-specific code.
No real changes yet.
This is a helper method used only in wxWidgets itself and only once, so
just inline it at the point of use to avoid exporting an unnecessary
function in the public API.
It doesn't make much sense to require all the graphics backends to
create wxGraphicsPen from either wxPen or wxGraphicsPenInfo when the
former can be handled just once in the common code.
So do just this, leaving CreatePen() overload taking wxGraphicsPenInfo
where the real pen construction takes place and implementing
wxGraphicsPen creation from wxPen in the common wxGraphicsContext code.
This is not 100% backwards-compatible as any code inheriting from
wxGraphicsRenderer and overriding its CreatePen() will now be broken,
however this should be extremely rare (there is no good reason to
inherit from this class in the user code) and result in compile errors
if it does happen.
Add wxGraphicsContext::CreateFromNativeHDC() and wxGraphicsRenderer::
CreateContextFromNativeHDC() to allow creation not only from native
renderer object, but also from HDC, which is something universally
supported by win32 implementations.
A convenience helper for writing generic code that may operate on
different kinds of DCs, all supported by wxGraphicsContext, but without
knowing its specific type.
Allow the code to determine which underlying technology is used for
implementing wxGraphics API. This is needed by the unit tests to account for
the known differences between platforms and may be useful in other cases.
Closes#16154.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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
This is mostly important to allow using wxImage-based wxGraphicsContext
without requiring X server connection under Unix: as wxFont can't be used
without X server, we needed another way to create wxGraphicsFont in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Provide a way to use wxGraphicsContext to draw on wxImage.
This is implemented internally by drawing on wxGraphicsBitmap which can be now
also created from wxImage.
Add a test of the new functionality to the image sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCompositionMode enum had a trailing comma not allowed by C++ 98 (and which
would result in warnings or errors with g++ pedantic switch).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Having an invalid element in wxCompositionMode enum allows to directly return
it from TranslateRasterOp() function instead of needing a separate bool
parameter to indicate that a ROP couldn't be translated.
This also incidentally fixes warnings about possibly uninitialized variables
in optimized g++ builds.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As the implementation of this method is basically the same for all ports move
it to the base class itself instead of requiring the derived classes to
implement it. Now the derived classes need to fill in m_width and m_height
members instead.
Do fill them when creating wxGraphicsContext in Cairo version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It may be convenient to create wxGraphicsGradientStop first and initialize it
later so allow doing this by providing the default argument for constructor
parameters and thus allowing to use it as the default constructor.
See #11897.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow specifying a set of gradient stops instead of just the beginning and
ending colours. Add the new wxGraphicsGradientStop(s) classes and new
wxGraphicsContext::Create{Linear,Radial}GradientBrush() overloads. Also change
the same methods of wxGraphicsRenderer to take wxGraphicsGradientStops instead
of a pair of colours.
Implement the new API for MSW and Cairo. OS X still uses just the two colours
for now.
Closes#11897.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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