Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341250 - New Snippet Contribution: fix a missing include for WebKit (>= 1.3) JNI.
Summary: New Snippet Contribution: fix a missing include for WebKit (>= 1.3) JNI.
Status: CLOSED DUPLICATE of bug 343454
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 341825 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-29 11:40 EDT by أحمد المحمودي CLA
Modified: 2011-05-09 13:38 EDT (History)
3 users (show)

See Also:


Attachments
executable test jar (1.60 MB, application/x-download)
2011-04-14 15:04 EDT, Grant Gayed CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description أحمد المحمودي CLA 2011-03-29 11:40:50 EDT
Eclipse build id or SWT version: 3.6.2

Platform(s) tested on: Debian sid (wheezy)

Snippet title: fix a missing include for WebKit (>= 1.3) JNI

Snippet code: 

+#if WEBKIT_MINOR_VERSION > 2
+# include <webkit/webkitglobals.h>
+#endif
Comment 1 Grant Gayed CLA 2011-04-05 13:31:01 EDT
*** Bug 341825 has been marked as a duplicate of this bug. ***
Comment 2 Grant Gayed CLA 2011-04-14 15:04:17 EDT
Created attachment 193284 [details]
executable test jar
Comment 3 Grant Gayed CLA 2011-04-14 15:05:33 EDT
I don't have access to a FC15 build or the latest Debian.  I assume that you (and Sami) are compiling SWT's libraries from source.  If so, can you try the test jar attached in the last comment?  I'd like to first verify that our libraries compiled against 1.2 work with 1.4 at runtime.

The executable jar is specific to x86_64.  To launch it just run at the command line: java -jar testWebkit.jar , and it should print a couple of things to stdout.  Can you update here whether this works for you?
Comment 4 Grant Gayed CLA 2011-04-14 15:07:34 EDT
In case you're wondering, the test jar just runs the snippet below.

public class Snippet148 {
    public static void main(String[] args) {
        Device.DEBUG = true;
        final Display display = new Display();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
        Browser browser = null;
        try {
            browser = new Browser(shell, SWT.WEBKIT);
        } catch (SWTError e) {
            e.printStackTrace();
            return;
        }
        System.out.println("successfully created Browser type: " + browser.getBrowserType());
        display.dispose();
    }
}
Comment 5 Grant Gayed CLA 2011-04-14 15:08:56 EDT
I should also point out that the code in comment 4 uses style SWT.WEBKIT, which is new to 3.7.  To run the snippet with 3.6.2 it should be fine to change this style to SWT.NONE.
Comment 6 Sami Wagiaalla CLA 2011-04-18 13:40:25 EDT
Here is what I get:

$ java -jar testWebkit.jar 
org.eclipse.swt.SWTError: No more handles
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
	at Snippet148.main(Snippet148.java:35)

I just ran the jar. Is there any kind of setup that I need to do ?
Comment 7 Grant Gayed CLA 2011-04-18 13:48:27 EDT
Assuming that the WebKitGTK libs are on the library path there shouldn't be additional setup required.  I'm guessing that it failed to load the swt library.  I'll have to investigate this.
Comment 8 Grant Gayed CLA 2011-05-09 13:38:02 EDT
This change is included in the fix for bug 343454, marking as a duplicate.

*** This bug has been marked as a duplicate of bug 343454 ***