Skype Logo
Buy Skype Credit · Help ·
  • Download
  • Use Skype
  • Business
  • Shop
  • Account
Berkus

X11 API code available

By My status Berkus on July 28, 2006 in Development.

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.

Bookmark and Share

View blog reactions

Comments

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!!!

vintjoseph87 | Saturday, Nov 21

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!!!!!!

vintjoseph87 | Saturday, Nov 21

Comment on this post

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please read our comment guidelines before posting your comment.

Skype Blogs
  • Share Skype Blog
  • Heartbeat
  • Developer Zone
  • Business
  • Skype Gear
  • Security
  • Garage
  • Mac
  • Linux
  • Eesti keeles
  • 日本語
  • Česky
  • Deutsch
  • Français
  • Italiano
  • Brasil
  • United Kingdom
  • Polski
  • United States
  • 한국어

Recent posts

  • Skype open source
  • Some explanations
  • Skype for Linux 2.1 Beta out now
  • Skype for Linux: a status update
  • Skype for Linux updates
  • Skype for Linux Team Updates
  • Skype 2.0 for Linux - Seeing is believing
  • Skype 2.0 beta Update: X Marks the Spot
  • Skype 2.0 beta for Linux: the Great Revolution
  • Skype 1.4 for Linux is here!

Archives

  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • January 2009
  • September 2008
  • March 2008
  • February 2008
  • November 2007
  • October 2007
  • August 2007
  • June 2007
  • May 2007
  • March 2007
  • February 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006

Subscribe to this blog
What? Tell me more…

using RSS Subscribe
via Bloglines Subscribe in Bloglines
using Newsgator Subscribe in NewsGator Online
with MyYahoo
with Google Add to Google
with My AOL Add to My AOL
with netvibes Add to Netvibes
About us · Partners · Jobs · Prices · Security
Privacy policy · Legal · © 2009 Skype Limited