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) As seen on pure-native.com, I don't think its free to use. Please confirm.
 
Yes, SWT C++ is free to use.
 
>> 2) Its fairly young. Only 2 years old. Can we trust its stability.
 
SWT C++ is an alpha product. It is presently aimed at early adopters. It's for developers that have SWT Java apps they need to port to native C++ or need to deploy without requiring a JRE.
 
>> 3) Who owns the responsibility of maintaining SWT C++ in the long term. Before this discussion, I never heard of pure-native. I mean, what are the chances it will become an orphaned toolkit/software and so will the projects using it?
 
Probably, the best answer is a vendor-neutral not-for-profit organization or a consortium. That avenue is being considered. For the time being, SWT C++ is open source. By it core principles, open source is insurance for worst-case scenarios. In the case of SWT C++, there is very little to maintain because it is produced from the SWT Java source code itself. In addition, for non-open-source projects, the terms of the EPL may be more attractive than LGPL. EPL may give you more capability and leeway than LGPL if you need to modify the source code yourself.
 
>> 4) Has it been ported to Linux and Solaris too?
 
No. Linux is being considered.
 
>> 5) How about Qt in comparison to SWT? Is it too heavy weight? Are there any benchmarks to differentiate between the two?
 
The big difference is native widgets (SWT) vs. emulated widgets (Qt). You don't have to pay for native widgets in terms of weight and overhead. SWT C++ Hello World is in a few hundred K. SWT C++ Examples with everything and the kitchen sink comes in at several MBs. Both are single .EXE files. No extra DLLs or runtimes to distribute.
 
>> 6) Can GUIs built with Qt also be invoked as eclipse plug-ins?
 
As previously answered, SWT design should allow SWT C++ and other C++ GUI toolkits to do some of this, namely wrapping a C++ control abstraction as an SWT control. You can definitely do it with MFC. The requirement is that the C++ GUI toolkit allow you to obtain the underlying native control handle (ex., HWND on Win32) from its own control abstractions and APIs.
 
>> Actually all the non-GUI code we have is in C++ and we want the GUI as an eclipse plug-in.
>> Also, performance has to be very good.
>> So, I was wondering exactly what to use?

>> Options:
>> 1) Use SWT in Java along with  JNI
>> (I have no clue about JNI. Need to read about it.)
>> 2) Use SWT C++ (but I am afraid because of above reasons).
>> 3) Use Qt
 
Actually, all three options will require you to use some JNI. JNI will be necessary to glue the C++ to the Eclipse plug-in in Java.
 
Further, what kind of plug-in are you writing? A UI plug-in for the Eclipse workbench, such as a view part or an editor part? If so, SWT C++ only provides the SWT API; it does not provide the Eclipse workbench API. And Qt does not do either of these. Probably you'll need to do something like:
 
4) Use SWT and Eclipse Workbench in Java along JNI
 
----- Original Message -----
From: Tech Id
Sent: Tuesday, April 20, 2010 11:02 AM
Subject: Re: [platform-swt-dev] C++ Toolkit for SWT

I have a couple of doubts on SWT C++

1) As seen on pure-native.com, I don't think its free to use. Please confirm.
2) Its fairly young. Only 2 years old. Can we trust its stability.
3) Who owns the responsibility of maintaining SWT C++ in the long term. Before this discussion, I never heard of pure-native. I mean, what are the chances it will become an orphaned toolkit/software and so will the projects using it?

4) Has it been ported to Linux and Solaris too?

5) How about Qt in comparison to SWT? Is it too heavy weight? Are there any benchmarks to differentiate between the two?
6) Can GUIs built with Qt also be invoked as eclipse plug-ins?

Actually all the non-GUI code we have is in C++ and we want the GUI as an eclipse plug-in.
Also, performance has to be very good.
So, I was wondering exactly what to use?

Options:
1) Use SWT in Java along with  JNI
(I have no clue about JNI. Need to read about it.)
2) Use SWT C++ (but I am afraid because of above reasons).
3) Use Qt

Best Regards
Techieeeee


On Tue, Apr 20, 2010 at 6:25 PM, Philipp Hübner <philipp.huebner@xxxxxxxxxxx> wrote:
Am 19.04.2010 05:30, schrieb var@xxxxxxxxxxxxxxx:
>> Why do you want to this? This pure native thing doesn't really sound production ready and Java/Native hybrids have a lot of disadvatages. For a native >> application its more natural to use a native GUI like qt or wxWindows, and I'm sure these frameworks (especially QT) offer more than this native swt!
 
SWT C++ is not a Java/Native hybrid. It is 100% native C++; it is not a C++ layer on top of the Java runtime. Unlike certain other C++ toolkits, it is not a C++ layer on top of a C foundation. It is C++ all the way through. In fact, it could be considered more native than Qt because SWT C++ (and SWT Java) use the Win32 platform's native widgets whereas Qt uses emulated widgets. In addition, SWT C++ is built on standard C++ and does not depend on C++ compiler extensions or non-standard preprocessors. It is a natural experience for C++ developers. For example, on Windows, you can do everything in Visual C++; there are no special build steps or extra tools to run. Lastly, unlike much older C++ GUI toolkits, SWT C++ is designed and implemented on modern C++ and standards-compliant C++ compilers. From the ground up, SWT C++ is designed to use "smart pointers," templates, exception handling, and other C++ features that were not chosen or not available when the older C++ GUI toolkits were designed.
 
SWT C++ is a indeed new toolkit. This new toolkit is also in its third major release.
----- Original Message -----
Sent: Thursday, April 15, 2010 3:35 AM
Subject: Re: [platform-swt-dev] C++ Toolkit for SWT

Am 15.04.2010 09:19, schrieb Tech Id:
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



Why do you want to this? This pure native thing doesn't really sound production ready and Java/Native hybrids have a lot of disadvatages. For a native application its more natural to use a native GUI like qt or wxWindows, and I'm sure these frameworks (especially QT) offer more than this native swt!


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Sorry you misunderstood me. I think using Java-SWT is not a good idea cause the result will be a hybrid and C++-SWT because, on the one hand, it looks too young and on on the other, there are much better UI-Frameworks in C++. Sorry but I think SWT is a API-Design Anti-Pattern. In QT, I have to write 10 lines; for the same thing I write 100 lines in SWT. But yes, C++-SWT seems to be lighttweight....


_______________________________________________
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