Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] C++ Toolkit for SWT

>> 1) We have already written a fair amount of code in SWT Java.
>> Can it be converted into C++ code by some Pure-Native tool?
 
Yes, the tool is called NewJ Equals C++. The Preview Edition is freely available, but it is intentionally limited to only translating classes from the org.eclipse.swt package and it sub-packages or the default package. A less-limited Trial Edition as well as a Professional Edition will be available soon.
 
>> 2) After we have converted SWT Java code to C++ (by tool or manually), we should need only a C++ lib of SWT C++ to link with along with some headers. Is that correct? Please confirm.
 
As designed and implemented, SWT depends on the Java API. SWT C++ has the same dependency, but the Java API it uses is implemented in 100% native C++ and no JRE, VM or JNI is used or required. So the answer to your question is yes, you "need only a C++ lib of SWT C++ to link with along with some headers" and a C++ lib that implements the Java API and its headers. The latter C++ library is called NewJ for C++.
 
var
 
----- Original Message -----
From: Tech Id
Sent: Thursday, April 15, 2010 3:19 AM
Subject: Re: [platform-swt-dev] C++ Toolkit for SWT

Wow!
That sounds great, Grant Gayed!
Thanks a lot for the link.

Just a few more doubts which I think you being an expert may be able to shed light upon :)
(I am also saving myself going through lengthy docs as well ;)  )
Please do help if you know.

1) We have already written a fair amount of code in SWT Java.
Can it be converted into C++ code by some Pure-Native tool?

2) After we have converted SWT Java code to C++ (by tool or manually), we should need only a C++ lib of SWT C++ to link with along with some headers. Is that correct? Please confirm.

Thanks again for the reply.
It really helped me.

Thanks
Techieeeeeeeee



On Thu, Apr 15, 2010 at 8:30 AM, <var@xxxxxxxxxxxxxxx> wrote:
As mentioned below, the answer is Yes. It's called SWT C++ and it's a 100% native C++ implementation of SWT. It's produced entirely from the SWT Java implementation. Basically, it is SWT Java source code compiled to C++ source code instead of compiled to Java bytecode. It is like another platform target for SWT: native C++, requiring no JRE and no JNI. It is feature-for-feature, bug-for-bug, and pixel-accurate to SWT Java. Presently, it is at SWT version 3.4.1 and only supported for Win32 desktop and Win CE (Pocket PC and Windows Mobile), and Visual C++ 8.0 (Visual Studio 2005) and 7.1 (Visual Studio 2003). Visual C++ 9.0 (Visual Studio 2008) support is working but not released. Other target OS platforms are being considered.
 
Regarding the use case "such that even the GUI elements could be coded in C++ only," this is not supported out-of-the-box, and we have not pursued this ourselves. That being said, by nature of SWT's design, it should be entirely possible to re-host an SWT C++ control in a SWT Java control or an Eclipse Workbench part (either a view or an editor) along with a JNI wrapper for the SWT C++ control. It may even be possible to do this without changing SWT C++ at all but no guarantees. There's a good explanation of how to wrap a native Win32 or Motif control as an SWT Java control along with JNI DLL on the Eclipse Web site. See the headings "Wrapping a Native Widget", "Windows Native Code", and "Motif Native Code" in the following article:
 
----- Original Message -----
Sent: Wednesday, April 14, 2010 12:44 PM
Subject: Re: [platform-swt-dev] C++ Toolkit for SWT


First to answer your question, there is a project at http://www.pure-native.com/ that takes an SWT release and converts it to C++ for use in C++ apps (note: win32 only).

However, if I understand your question correctly, you'll be writing/re-writing your UI in SWT from scratch, and you want your app to run as an eclipse plug-in, right?  If so, I would suggest writing your UI using SWT's java implementation.  This will make the integration of your UI into eclipse straight-forward, and will be cross-platform.  You would then use JNI to interact with the application logic that you want to preserve from your existing C++ app.

Grant


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

Back to the top