[Kde-java] NETWinInfo class defined in netwm.h (KDE) --- incomplete implemetation ?

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Aug 19 20:38:52 CEST 2004


On Thursday 19 August 2004 02:08, Heinz Meulke wrote:
> Hi, (don't ask why) I am trying to port a app to Java which I will
> hopefully compile natively with gcj
>
> using kdebindings-3.2.3 on gentoo
>
> I am trying to locate the equivalent class, provided by the NETWinInfo
> as defined in the kde header netwm.h also missing the NET class
>
> I need to replace with equivalent of the C++ code
>
> <C++ Code>
> NETWinInfo *info;
> info = new NETWinInfo(qt_xdisplay(),winId(),qt_xrootwin(),NET::WMState);
> info->setDesktop(NetWinInfo::OnAllDesktops);
> info->setState(NetWinInfo::SkipTaskbar | NetWinInfo::SkipPager,
>  NetWinInfo::SkipTaskbar | NetWinInfo::SkipPager);
> </C++ Code>
>
>
> what I did to get around the missing classes
>
> <Java Code>
>  KWin.setOnAllDesktops(mainWindow.winId(),true);
>  KWin.setState(mainWindow.winId(), ?state?)
> </Java Code>
>       ^^^^^^^^^^
>        problem
>
> according to the documentation it states that these values are valid
> for ?state?
>
> <snip documentation>
>  Possible values are or'ed combinations of NET.Modal,
>    NET.Sticky, NET.MaxVert, NET.MaxHoriz, NET.Shaded,
>    NET.SkipTaskbar, NET.SkipPager, NET.Hidden,
>    NET.FullScreen, NET.KeepAbove, NET.KeepBelow,   NET.StaysOnTop
> </snip documentation>
>
> if only there was a NET class defined, there is currently no NET class
> included with the java-kde bindings
I've added the netwm.h and netwm_def.h headers to the 
kdebindings/smoke/kde/kde_header_list configuration file. That is what drives 
the generation of the Smoke library when you configure kdebindings (for ruby 
and perl bindings). I'd really like to generate the java bindings at 
configuration time too. Anyhow, I don't want to update the bindings in the 
cvs until the 'missing KCommandHistory virtual method callbacks' problem is 
fixed.

But in the meantime this is the way the java bindings are generated:

$ cd kdebindings/smoke/kde

Edit the 'generate.pl' file and change the '-fsmoke' option passed to the 
kalyptus configuration utility to '-fjni'. 
It will then generate .java and .cpp files for the netwm classes.

Copy the .java NET sources to the kdebindings/kdejava/koala/org/kde/koala 
directory, and them to the Makefile.am and then make.

# Generate the jni headers:

for FILE in MyNETClass.class ; do NAME=`echo $FILE | sed 's/.class//'`; 
    echo $NAME; javah  -classpath "../../..:$CLASSPATH" org.kde.koala.$NAME ; 
done

for FILE in org_kde* ; do NAME=`echo $FILE | sed -e 's/org_kde_koala_//'`;
      echo $NAME; mv $FILE $NAME; 
done 

Copy the headers to the kdebindings/kdejava/koala/kdejava directory and add 
them to the Makefile.am file (along with the corresponding .cpp files). Copy 
the new NET cpp files from kdebindings/smoke/kde.

-- Richard


More information about the Kde-java mailing list