Add wx{Pen,Brush}::Is[Non]Transparent() methods and use them.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 15 Oct 2010 23:46:46 +0000 (23:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 15 Oct 2010 23:46:46 +0000 (23:46 +0000)
commite6777e6575eaf7bf47b72c5910e5a4b31efd97a1
treebe776efd440058d28b1a0351ae1ef70a47ca7026
parentf8ce98ded08fd7e5960f4aadfcf7e923df79222b
Add wx{Pen,Brush}::Is[Non]Transparent() methods and use them.

Using GetStyle() == wx{PEN,BRUSH}STYLE_TRANSPARENT doesn't work for
uninitialized pen or brush objects so add convenient helpers which do work for
them.

Use the new helper functions everywhere instead of explicitly checking for
style. This makes the code shorter and more clear and also fixes some bugs (at
least those in GTK printing code).

Notice that this patch removes the main reason for explicitly initializing
m_pen and m_brush in wxGTKDCImpl ctor but this initialization still can't be
removed, at least for the latter, as doing this somehow breaks GetPixel(). It
would be nice to understand why and do remove this initialization so that a
newly created DC doesn't have any non-default pen nor brush.

Closes #12522.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/brush.h
include/wx/pen.h
interface/wx/brush.h
interface/wx/pen.h
src/common/imagfill.cpp
src/generic/dcpsg.cpp
src/gtk/dcclient.cpp
src/gtk/gnome/gprint.cpp
src/gtk/print.cpp
src/msw/dc.cpp