Bug 387641 - Use Cairo instead of Gdk deprecated methods in Sash widget drawBand()
Summary: Use Cairo instead of Gdk deprecated methods in Sash widget drawBand()
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-08-20 15:52 EDT by Anatoly Spektor CLA
Modified: 2012-10-24 14:38 EDT (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 Anatoly Spektor CLA 2012-08-20 15:52:05 EDT
Sash widget's drawBand() method needs Cairo implementation instead of existing Gdk methods, as most of them are deprecated.
Comment 1 Anatoly Spektor CLA 2012-08-20 15:58:32 EDT
I have started working on implementing Cairo in Sash widget, however I am having problem with GTK.INCLUDE_INFERIORS.

I have tried finding way around INCLUDE_INFERIORS by making one surface reference another like this:

 int /*long*/ cairo_new = OS.gdk_cairo_create(window);
 int /*long*/ srcSurface = Cairo.cairo_get_target(cairo_new);
 int /*long*/ cairo = Cairo.cairo_create(srcSurface);

 Advantage of this is way is that it does draw on top of handle.

 Disadvantage is that when I try to change color of Sash, it changes color of handle itself. At this point, I am not sure how else, to avoid it.

  If you would like to take a look at my working progress please take a look here:

  http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=cairo_sash


Any help is highly appreciated,

 Regards,

Anatoly
Comment 2 Silenio Quarti CLA 2012-09-24 16:31:43 EDT
Non SWT.SMOOTH Sash is a thing from the past. Added a check to make all sashes SWT.SMOOTH when USE_CAIRO is true.  This also happens on cocoa.

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b544cc1a498de3fd0b2af24bb1c30ba1978244fd
Comment 3 Anatoly Spektor CLA 2012-09-24 16:48:31 EDT
(In reply to comment #2)
> Non SWT.SMOOTH Sash is a thing from the past. Added a check to make all
> sashes SWT.SMOOTH when USE_CAIRO is true.  This also happens on cocoa.
> 
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=b544cc1a498de3fd0b2af24bb1c30ba1978244fd

Is drawBand() still in use ?

 If it is so, this patch does not solve the problem, problem is that GTK deprecated methods are used in drawBand.

or am I missing something here?
Comment 4 Silenio Quarti CLA 2012-09-24 16:52:08 EDT
Sash.drawBand() returns in first line if GTK_VERSION>=2.24, since SWT.SMOOTH is set in style.
Comment 5 Anatoly Spektor CLA 2012-09-24 16:55:44 EDT
(In reply to comment #4)
> Sash.drawBand() returns in first line if GTK_VERSION>=2.24, since SWT.SMOOTH
> is set in styl

True, now I see this line, my bad!