Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 382384 - Use Cairo Instead of gdk deprecated methods in ToolTip Widget's gtk_button_press_event() method
Summary: Use Cairo Instead of gdk deprecated methods in ToolTip Widget's gtk_button_pr...
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 M1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067 382391 382407
  Show dependency tree
 
Reported: 2012-06-12 10:39 EDT by Anatoly Spektor CLA
Modified: 2012-08-10 08:15 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-06-12 10:39:36 EDT
Build Identifier:  R3_7_1

When building SWT with GTK+ 3.x It gives warnings on deprecated methods
such as gdk_gc_set_foreground, gdk_draw_layout, gdk_draw_polygon. These deprecated methods are used in ToolTip Widget's gtk_button_press_event().


This patch avoids use of deprecated methods and uses Cairo Graphics library instead:

http://fedorapeople.org/gitweb?p=aspektor/public_git/eclipse.platform.swt.git;a=commit;h=f0e0e2f64935b5fe3cda600c1457e533ca45e176


Reproducible: Always

Steps to Reproduce:
1. Uncomment GDK_DISABLE_DEPRECATED in org.eclipse.swt/Eclipse SWT
PI/gtk/library/os.h
2. Build SWT
Comment 1 Silenio Quarti CLA 2012-06-18 16:45:38 EDT
We need a couple of changes before this patch can be release:

1) Remove line#484. Instead of turning off anti-aliasing, it is better to add 0.5 to the polygon coordinates so that vertical and horizontal lines are crisp when stroking a path.

2) Do not 1 to the polygon coordinates in line#487, add 0.5 (see above)

3) please try to keep the same formatting of the surround code. It is not a big deal, but it helps by keeping the code easy to read by other members of the team. We should have formatting settings for the SWT projects, but that never got done.

For example:

if(OS.USE_CAIRO) {

should be

if (OS.USE_CAIRO) {
Comment 2 Anatoly Spektor CLA 2012-06-19 10:54:43 EDT
Thank for your comments.

I have applied changes you asked and  new patch can be found here:

http://fedorapeople.org/gitweb?p=aspektor/public_git/eclipse.platform.swt.git;a=commit;h=ba16592ebf0e6643eb458c41e5432c8aee15374a

If you have any other concerns, please let me know,

Regards,

Anatoly