Skip to main content



      Home
Home » Archived » Visual Editor (VE) » VE and C/C++
VE and C/C++ [message #60283] Mon, 20 September 2004 06:32 Go to next message
Eclipse UserFriend
Originally posted by: dkelsey.nospamhotmail.com

Could VE be easily extended to generate C/C++ code when using SWT as the
palette ?
This would seem to be a great way to be able to develop cross platform GUI
applications
using CDT.

I don't suppose this facility is part of your project plans is it ?

Dave Kelsey
Re: VE and C/C++ [message #60667 is a reply to message #60283] Tue, 21 September 2004 11:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.gmail.com

Dave Kelsey wrote:
> Could VE be easily extended to generate C/C++ code when using SWT as the
> palette ?
> This would seem to be a great way to be able to develop cross platform GUI
> applications
> using CDT.
>
> I don't suppose this facility is part of your project plans is it ?
>
> Dave Kelsey
>
>
To answer your question... no, it would be rather difficult. First off,
I don't know of a way to directly use SWT from C++. Even though SWT
uses C++ for its underlying native controls, there are aspects of SWT
that are only implemented in Java, and even some of the widgets are done
in Java when the native system does not provide the control.

As far as I know, the VE team does not have any plans to implement an
editor for C/C++ in the near future. It is an open challenge to others
to join the project and propose developing tooling for a specific C++
widget set.

Sorry I don't have better news,

- Jeff
Re: VE and C/C++ [message #60668 is a reply to message #60667] Tue, 21 September 2004 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dkel50.nospan.hotmail.com

Jeff, thanks for the info. I was considering looking at trying to
provide a simple GUI editor for C/C++ using some cross platform library.
I wasn't that familiar with SWT so naively thought it could form the
basis of a cross platform library and thus look to extend VE.

There are other cross platform libraries about, so maybe it's time to
look at those and GEF.

Thanks again for the help
Dave
Re: VE and C/C++ [message #60671 is a reply to message #60667] Tue, 21 September 2004 13:34 Go to previous message
Eclipse UserFriend
Jeff Myers wrote:
> Dave Kelsey wrote:
>
>> Could VE be easily extended to generate C/C++ code when using SWT as the
>> palette ?
>> This would seem to be a great way to be able to develop cross platform
>> GUI
>> applications
>> using CDT.
>>
>> I don't suppose this facility is part of your project plans is it ?
>>
>> Dave Kelsey
>>
>>
> To answer your question... no, it would be rather difficult. First off,
> I don't know of a way to directly use SWT from C++. Even though SWT
> uses C++ for its underlying native controls, there are aspects of SWT
> that are only implemented in Java, and even some of the widgets are done
> in Java when the native system does not provide the control.

In GCJ, you can call Java code directly from C++ (the compiler
deliberately uses the same object layout in memory for both Java and C++
objects), so his idea isn't that far-fetched.

The difference would be that you'd be codegenning into a CDT editor
rather than a JDT editor and you would be generating C++ syntax rather
than Java syntax.

How hard that would be is an open question. That approach would
probably be pretty hard--even harder than codegenning Java. For
example, I'm pretty sure that CDT doesn't keep parse tree metadata
around cross-referencing between the C++ source code and the internal
parse tree like the JDT does.

Another approach that would probably be pretty straightforward might be
to make VE edit XSWT XML files, which are an XML representation of SWT
UI layouts. Then you would always codegen XML, which is much easier.
Then your C++ code could link with the XSWT engine which would load your
visual layouts.

The second approach seems easiest, and would benefit both the C++ and
Java worlds since some Java folks prefer to use XML to describe UIs
rather than Java. Consequently, it would be easier to get interest and
participation in an XSWT integration project since it would benefit both
languages.

Due to the complexities of roundtripping C++ code and the limited
community support you are likely to find, I strongly recommend taking
the XSWT approach.


Regards,

Dave Orme

--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com http://essentialdata.sf.net
Re: VE and C/C++ [message #598708 is a reply to message #60283] Tue, 21 September 2004 11:32 Go to previous message
Eclipse UserFriend
Dave Kelsey wrote:
> Could VE be easily extended to generate C/C++ code when using SWT as the
> palette ?
> This would seem to be a great way to be able to develop cross platform GUI
> applications
> using CDT.
>
> I don't suppose this facility is part of your project plans is it ?
>
> Dave Kelsey
>
>
To answer your question... no, it would be rather difficult. First off,
I don't know of a way to directly use SWT from C++. Even though SWT
uses C++ for its underlying native controls, there are aspects of SWT
that are only implemented in Java, and even some of the widgets are done
in Java when the native system does not provide the control.

As far as I know, the VE team does not have any plans to implement an
editor for C/C++ in the near future. It is an open challenge to others
to join the project and propose developing tooling for a specific C++
widget set.

Sorry I don't have better news,

- Jeff
Re: VE and C/C++ [message #598716 is a reply to message #60667] Tue, 21 September 2004 12:38 Go to previous message
Eclipse UserFriend
Jeff, thanks for the info. I was considering looking at trying to
provide a simple GUI editor for C/C++ using some cross platform library.
I wasn't that familiar with SWT so naively thought it could form the
basis of a cross platform library and thus look to extend VE.

There are other cross platform libraries about, so maybe it's time to
look at those and GEF.

Thanks again for the help
Dave
Re: VE and C/C++ [message #598732 is a reply to message #60667] Tue, 21 September 2004 13:34 Go to previous message
Eclipse UserFriend
Jeff Myers wrote:
> Dave Kelsey wrote:
>
>> Could VE be easily extended to generate C/C++ code when using SWT as the
>> palette ?
>> This would seem to be a great way to be able to develop cross platform
>> GUI
>> applications
>> using CDT.
>>
>> I don't suppose this facility is part of your project plans is it ?
>>
>> Dave Kelsey
>>
>>
> To answer your question... no, it would be rather difficult. First off,
> I don't know of a way to directly use SWT from C++. Even though SWT
> uses C++ for its underlying native controls, there are aspects of SWT
> that are only implemented in Java, and even some of the widgets are done
> in Java when the native system does not provide the control.

In GCJ, you can call Java code directly from C++ (the compiler
deliberately uses the same object layout in memory for both Java and C++
objects), so his idea isn't that far-fetched.

The difference would be that you'd be codegenning into a CDT editor
rather than a JDT editor and you would be generating C++ syntax rather
than Java syntax.

How hard that would be is an open question. That approach would
probably be pretty hard--even harder than codegenning Java. For
example, I'm pretty sure that CDT doesn't keep parse tree metadata
around cross-referencing between the C++ source code and the internal
parse tree like the JDT does.

Another approach that would probably be pretty straightforward might be
to make VE edit XSWT XML files, which are an XML representation of SWT
UI layouts. Then you would always codegen XML, which is much easier.
Then your C++ code could link with the XSWT engine which would load your
visual layouts.

The second approach seems easiest, and would benefit both the C++ and
Java worlds since some Java folks prefer to use XML to describe UIs
rather than Java. Consequently, it would be easier to get interest and
participation in an XSWT integration project since it would benefit both
languages.

Due to the complexities of roundtripping C++ code and the limited
community support you are likely to find, I strongly recommend taking
the XSWT approach.


Regards,

Dave Orme

--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com http://essentialdata.sf.net
Previous Topic:SWT and "internal frames"
Next Topic:HTML/JSP WYSIWYG editor
Goto Forum:
  


Current Time: Mon Jun 02 17:54:45 EDT 2025

Powered by FUDForum. Page generated in 0.02880 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top