Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332872 - Consistently resolve XOR-mode-painting related issues on MacOSX Carbon and Cocoa
Summary: Consistently resolve XOR-mode-painting related issues on MacOSX Carbon and Cocoa
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7.1 (Indigo) M5   Edit
Assignee: Alexander Nyßen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 135345 153583 153585 279319 303659
  Show dependency tree
 
Reported: 2010-12-17 14:14 EST by Alexander Nyßen CLA
Modified: 2011-01-26 03:55 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2010-12-17 14:14:11 EST
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.
Comment 1 Alexander Nyßen CLA 2010-12-17 14:16:37 EST
Adding dependencies to marquee selection feedback related bugs: bug #303659 (Carbon), bug #153583 (Cocoa).
Comment 2 Alexander Nyßen CLA 2010-12-17 14:18:26 EST
Adding dependencies to drag source feedback related bugs: bug #153585 (Carbon), bug #279319 (Cocoa)
Comment 3 Alexander Nyßen CLA 2010-12-17 14:22:11 EST
Adding dependency to text selection feedback related bug #135345
Comment 4 Alexander Nyßen CLA 2010-12-17 14:34:39 EST
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.
Comment 5 Scott Kovatch CLA 2010-12-17 19:04:40 EST
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.
Comment 6 Alexander Nyßen CLA 2010-12-18 03:26:41 EST
(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.
Comment 7 Alexander Nyßen CLA 2011-01-03 02:46:28 EST
(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).
Comment 8 Alexander Nyßen CLA 2011-01-06 14:38:26 EST
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.