[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: KDE and GNOME interfaces

Scott Stanchfield wrote:

> If you haven't read the SWT architecture papers at www.eclipse.org, you
> may be interested in them.
> 
> The basic idea of SWT is to write Java implementations of each widget
> using native lib calls. These basically replace the native peers that
> AWT uses.
> 
> (In AWT, native code ("peer") calls the native libs to realize widgets.
> In SWT, Java code (kinda like the "peer") calls the native libs to
> realize widgets.)
> 
> This means that on each platform, you'll see Java "wrappers" to the
> native API implementation.
> 
> If you use these directly, you're coding to that specific platform. If
> you use the SWT widgets, you're coding platform independent (which is
> really the intent).
> 
> Personally I think this is really the right way to do native widgets
> with Java. Makes debugging a lot easier, and if you really want to do
> native lib stuff, you can pretty easily...
> 
> As for porting, I think it should be about as easy to port as AWT
> (instead of creating native peers, you create Java "peers")
> 
> (Anyone: If I misunderstood something here, please poke me with a sharp
> stick to wake me up...)
> 
> -- Scott
> ==============================================================
> Scott Stanchfield         FGM, Inc.            thetick@xxxxxxx
> 
> Home Page: http://javadude.com            thetick@xxxxxxxxxxxx
> 
> Lead author of "Effective VisualAge for Java, Version 3"
>                                       http://javadude.com/evaj
> 
> VisualAge for Java Tips and Tricks     http://javadude.com/vaj
> 
> AWT & Swing FAQ Manager, jGuru.com
> Visit for Java Enlightenment!             http://www.jguru.com
> ==============================================================
> 
> "David Goodenough" <david.goodenough@xxxxxxxxxxxxx> wrote in message
> news:9lg7p2$968$1@xxxxxxxxxxxxxxxx
>> I notice that Eclipse provides its own Java API to KDE (and I think
>> GNOME).  Why?  In the kdebindings project of KDE there is a fully
>> functional KDE Java Binding, shipping as a full part of the now
>> current KDE 2.2.  It also BTW provides a binding to QT which would
>> provide a much fuller interface than the current Motif interface.
>>
>> Using this API would allow integration with more than just things
>> like MIME types.  It would also allow integration with the KParts
>> and DCOP systems, which would allow the integration of things like
>> Konqueror as the Help browser and the use of DCOP where you use COM
>> on a Windows system which would achieve a similar binding to the
>> platform as you have with Windows.
>>
>> Now I do not know what the Java API into GNOME looks like but I did
>> notice just yesterday that there is a new release of the API on
>> linuxapps.com.
>>
>> I know that not everyone runs KDE (or GNOME for that matter), but it
>> would certainly be preferable to use the APIs they provide for the
>> bits you need than to invent your own.

Scott,

I think you misunderstood me, at least in part.

There are two issues here.  The first, and perhaps the simplest, somes
in areas where Eclipse wants to know things like MIME application 
bindings.  It has some code for specific to GNOME and KDE to go find
out the associations, and I was suggesting that writing their own
is the wrong way to go about it when both GNOME and KDE seem to have
JAVA bindings of their own.  Its a duplication of effort, and if the
API were to change is the future the ones that come with GNOME/KDE
will presumably be kept up to date without IBM having to do anything.

The second issue was to consider using the Java Qt (and related KDE)
bindings, rather than the Motif binding.  This allows much the same
kind of integration (and I presume the GNOME Gtk bindings do the same
for GNOME) under KDE as the Windows bindings allow.  By using DCOP
(under the covers) things like dropping Konqueror into the child window
becomes trivial to provide help.  Qt/KDE also fill in a lot of the
blanks that Motif leaves and SWT has to fill in for, and also provides
things like inter application Drag and Drop which currently do not 
work with SWT/Motif if I have read the manual right.

Now I know that IBM are hardly going to write KDE specific code, and 
then write the same for GNOME, and maintain both.  Binding to Qt
was something I was thinking of doing for myself, just to see how 
well the integration actually worked.  If it works well I will release
it to the world and someone who is interested could no doubt do the
same for GNOME.

Regards

David