Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
kda (or X) api porting from win32

I am moving a non-C app (smalltalk) from windows to linux.

Windows has win32 api functions for a lot of things - in particular, window management.

For example, if I have a window's handle, I can SetWindowPos, FlashWindow, GetWindowText, etc.

To get all window handles: EnumWindows


Currently I am trying to figure out how to move windows (programatically) to a specific desktop, and to determine the available desktop size (window size when maximized: the screen size - kicker panels).


In smalltalk, accessing the win32 api's is done by loading a dll ('user32.dll' 'kernel32.dll' 'winmm.dll' 'gdi32.dll' 'psapi.dll' 'advapi32.dll' 'ole32.dll'), then calling the exported function.


Smalltalk provides similar for linux - the 'oracle connect' use ''.


What is the general way to do these types of things in KDE/X

Any web sites you can recommend? didn't really help, but then again, I don't really know what to look for :(

I think maybe may have what I am looking for, but I didn't see any libkdeui.h - wth?



I'm not a smalltalk programmer.. but..


STIX - Native GNU SmallTalk bindings to X Link to TOC


I also see talk of "Xm++" for use with Motif/Athena apps but cannot find any valid link to source.


Finally Squeak turns up everywhere.. so I'm guessing it might be good?


Any of these useful?


Interesting, but not what I needed.

I guess I figure that .so (shared object?) are the unix equivalent of windows' .dll (dynamic link library).


most (or all) windows .dll files have an corresponding .h (header) file detailing what is exported (functions that can be called), and how to use them (what it returns, what the arguments are).


Where is that info for unix .so files? slocate doesn't turn up .h files for - and yet my running smalltalk (Visualworks 7.4) uses one of ('' '' 'libc.a(shr.o)') - so it does work.

For example:

void openlog(char * ident, int option, int facility)

I can call this and add to the system log using it and a few other functions.



I am looking for a list of useful system/gui functions and what .so they can be found in.

A website would be great - I used all the time when writing the win32 api calls.


the info for openlog:

misc/sys/syslog.h:extern void openlog (__const char *__ident, int __option, int __facility);


for chdir:

posix/unistd.h:extern int chdir (__const char *__path) __THROW __nonnull ((1));


Well, I got a little further:

/usr/lib/X11/include has a pile of .h files, which I guess get built into - maybe, but there is no libX11.h.

/usr/kde/3.4/lib has kde .so files, and /usr/kde/3.4/include has the .h files


How about XLib Programming Manual?


Specifical about the headers maybe?


And this is a monster amount of X related utilities.


I think the functions I need are in, but they are C++ mangled, so a that does extern "C" is needed.

This works, there is some voodoo I don't understand (QApplication a(n,c) must initialize a global, because I get a seg fault without it)


this is vwkde.c
make sure the next line's vars are set correctly, then execute to create
KDEDIR=/usr/kde/3.5; QTDIR=/usr/qt/3
g++ -c -I$KDEDIR/include -I$QTDIR/include  -Wall -fPIC vwkde.c && gcc -shared -Wl,-soname, -o vwkde.o

#include <kwin.h>
#include <qapplication.h>
char **c;
int n =0;
QApplication a( n, c);

extern "C" int setCurrentDesktop(int i)
   return i;

extern "C" int setOnDesktop(int w, int d)
   return w;

extern "C" int setOnAllDesktops(int w, int d)
   return w;

extern "C" int numberOfDesktops()
   return KWin::numberOfDesktops();

extern "C" int currentDesktop()
   return KWin::currentDesktop();

These links were helpful:




Quick Reply
Type your reply to this message here.

Forum Jump:

Users browsing this thread: 1 Guest(s)