Version 1 (modified by 7 years ago) (diff) | ,
---|
Client Porting Guide
The best way to port xpra to new language or toolkit is to look at the existing clients and use one of them as a template.
Basics
At the very least you will need:
- a network layer capable of sending and receiving packets in the xpra protocol format. The network level packet is very simple: an 8 byte header which includes the packet size is followed by the packet data itself, the data is encoded using a bencoder-like format (the only notable difference is that unlike most other implementations, the dictionary keys are not in a specific order). Or optionally using rencode.
- a window implementation representing a server-side window, usually supporting controls like minimize/maximize/close
- the ability to update the content of this window with
RGB
pixel data - the code should send a
hello
packet to the server and wait for thehello
it sends back - you must respond to
ping
packets to prevent automatic disconnection
Interactive
These are the things you will need to implement in order to be able to interact with your new client beyond just showing the windows:
- providing a keymap to the server so keyboard input works
- sending mouse events: mouse movements and clicks
- sending window focus changes
- window position changes, etc