X11 API code available
We’ve just released X11 API demo code [here](https://developer.skype.com/Download/SampleCode) (get skype-x11-testclient-20060728.tar.bz2 from that page).
One word of caution tho: the session termination code was not polished and robust in released open beta; one serious consequence of this is that if you terminate your API client application and launch it again, chances are high that X11 server will assign the same window ID to your handler and it will start receiving messages from the old session. This behaviour is fixed in latest closed beta and correct code will be released with next Open Beta update.
Please post your experience with the code here. I’m eager to hear your feedback.
Hey me having trouble to compile the skype-x11-testclient-20060728.tar.bz2
just showing lots of errors
vint@vint-desktop:~/Desktop/test pgm/Skype in linux/skype-x11-testclient$ make
/usr/bin/uic-qt4 testapp_ui.ui -o .ui/ui_testapp_ui.h
make: /usr/bin/uic-qt4: Command not found
make: *** [.ui/ui_testapp_ui.h] Error 127
I think its qt related eroor!!!
I have made my own programming ,i am not so familiar with x11 but managed
o/p expected is ::skype asking permission box atleast
program:::
//#include // preceede most other headers!
#include
#include
#include
#include
/* include some silly stuff */
#include
#include
int main(){
//Display *dsp = XOpenDisplay( NULL );
Display *dsp=XOpenDisplay(NULL);
if( !dsp ){ return 1; }
int screenNumber = DefaultScreen(dsp);
unsigned long white = WhitePixel(dsp,screenNumber);
unsigned long black = BlackPixel(dsp,screenNumber);
Window win = XCreateSimpleWindow(dsp,
DefaultRootWindow(dsp),
50, 50, // origin
200, 200, // size
0, black, // border
white ); // backgd
XMapWindow( dsp, win );
///////////////////////////////////////for skype!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Atom accept_atom2,accept_atom1,a1,a2,skype_win;
static const char *skypemsg = “SKYPECONTROLAPI_MESSAGE”;
accept_atom2 = XInternAtom( dsp, “call runikovoor”, false );
accept_atom1 = XInternAtom( dsp, “_BEGIN”, false );
Atom skype_inst = XInternAtom(dsp, “_SKYPE_INSTANCE”, True);
XEvent e;
/*
e.xclient.type = ClientMessage;
e.xclient.message_type = atom1_P; // leading message
e.xclient.display = disp;
e.xclient.window = handle_P;
e.xclient.format = 8;
XSendEvent( disp, win, False, mask_P, &e );*/
const char* a1val=”SKYPECONTROLAPI_MESSAGE”;
const char* a2val=”SKYPECONTROLAPI_MESSAGE_BEGIN”;
const char* a3val=”_SKYPE_INSTANCE”;
dsp = XOpenDisplay(getenv(“DISPLAY”));
Window dummy_window = XCreateSimpleWindow(dsp,DefaultRootWindow(dsp),100,100,301,301,0,black, // border
white ); // backgd//0,1);
a2 = XInternAtom(dsp,a1val,False);
a1 = XInternAtom(dsp,a2val,False);
skype_inst = XInternAtom(dsp,a3val,True);
XMapWindow( dsp, dummy_window );
if ( (Window)-1 == skype_win )
{
Atom type_ret;
int format_ret;
unsigned long nitems_ret;
unsigned long bytes_after_ret;
unsigned char* prop;
int status = XGetWindowProperty(dsp, DefaultRootWindow(dsp), skype_inst,0,1,False,XA_WINDOW,&type_ret,&format_ret,&nitems_ret,&bytes_after_ret,&prop);
if ( ( status != Success) || (format_ret != 32) || (nitems_ret != 1 ) )
{
}
else
{
skype_win = * (const unsigned long *) prop & 0xffffffff;
free(prop);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
long eventMask = StructureNotifyMask;
XSelectInput( dsp, win, eventMask );
XEvent evt;
do{
XNextEvent( dsp, &evt ); // calls XFlush
}while( evt.type != MapNotify );
GC gc = XCreateGC( dsp, win,
0, // mask of values
NULL ); // array of values
XSetForeground( dsp, gc, black );
XDrawLine(dsp, win, gc, 10, 10,190,190); //from-to
XDrawLine(dsp, win, gc, 10,190,190, 10); //from-to
eventMask = ButtonPressMask|ButtonReleaseMask;
XSelectInput(dsp,win,eventMask); // override prev
do{
XNextEvent( dsp, &evt ); // calls XFlush()
}while( evt.type != ButtonRelease );
XDestroyWindow( dsp, win );
XCloseDisplay( dsp );
return 0;
}
Actual o/p obtained::no errors or box!!!!!!
> I think its qt related eroor!!!
Just re-run qmake to regenerate makefiles for your local environment.