Community
Participate
Working Groups
XOR-painting mode is used in various places within GEF to show feedback (drag feedback, marquee selection feedback, guide snap feedback, etc.). As this functionality is not supported on MacOSX Carbon (GC#setXORMode() has been deprecated because of this) and as it does not seem to work "as expected" on MacOSX Cocoa (while I could not find any official information that it is not supported there), there are (and have been) quite a few bugzillas related to this. While for some of these workarounds have already been committed, there does not seem to be a consistent policy on how to deal with these issues in general.
Adding dependencies to marquee selection feedback related bugs: bug #303659 (Carbon), bug #153583 (Cocoa).
Adding dependencies to drag source feedback related bugs: bug #153585 (Carbon), bug #279319 (Cocoa)
Adding dependency to text selection feedback related bug #135345
Currently, XOR mode is used in the following places of the framework: -org.eclipse.draw2d.SchemeBorder#paint -org.eclipse.draw2d.FigureUtilities#paintEdgedBorder -org.eclipse.draw2d.Shape#paintFill -org.eclipse.draw2d.Shape#paintOutline -org.eclipse.draw2d.text.BlockFlow#paintBorder -org.eclipse.draw2d.text.InlineFlow#paintSelection -org.eclipse.draw2d.text.TextFlow#paintSelection -org.eclipse.gef.tools.MarqueeSelectionTool.MarqueeRectangleFigure#paintFigure -org.eclipse.gef.internal.ui.rulers.GuideEditPart.GuideLineFigure#paintFigure It is also used in Flow (SimpleActivityLabel), Logic (feedback figures), and EDiagram (SelectableLabel) examples.
In Carbon, setXORMode should be working correctly on Mac OS X 10.4 and later. CoreGraphics uses anti-aliased drawing by default, so things like curved lines won't look perfect with XOR mode, but it's not awful, either. In Cocoa, setXORMode was just not implemented. The code is essentially identical, so I assume it was an oversight. Anyway, I have checked in a fix for this, so it will be in a build > 20101217.
(In reply to comment #5) > In Carbon, setXORMode should be working correctly on Mac OS X 10.4 and later. > CoreGraphics uses anti-aliased drawing by default, so things like curved lines > won't look perfect with XOR mode, but it's not awful, either. > > In Cocoa, setXORMode was just not implemented. The code is essentially > identical, so I assume it was an oversight. > > Anyway, I have checked in a fix for this, so it will be in a build > 20101217. Thanks very much Scott! As xor painting on Carbon seems to be working from MacOSX 10.4 onwards (due to Scott's comment), and as Carbon does no longer seem to be an officially supported platform for SWT 3.7 either (see http://www.eclipse.org/projects/project-plan.php?projectid=eclipse#target_environments), I think with the now implemented xor mode in Cocoa, we may revert the already applied workarounds (I have reopened bug #303659 for this) in GEF 3.7 and may thereby re-gain consistent cross-platform behavior w.r.t. xor painting from 3.7 onwards. I will take care of verifying whether all issues related to this are actually resolved in SWT > 20101217.
(In reply to comment #1) > Adding dependencies to marquee selection feedback related bugs: bug #303659 > (Carbon), bug #153583 (Cocoa). I mixed this up, it has to be: bug #153583 (Carbon), bug #303659 (Cocoa).
As all related issues have been fixed (on Carbon, all issues indeed seem to have been resolved somewhat earlier, on Cocoa with the added xor implementation in 3.7), closing this as resolved in 3.7.