mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
dix: rpcbuf: add x_rpcbuf_write_rect() for writing RECTANGLE PDU
The `RECTANGLE` PDU is pretty common, so it's good to have a helper for writing this, so it doesn't need to be open-coded everywhere. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -315,4 +315,22 @@ static inline void x_rpcbuf_write_rpcbuf_pad(
|
||||
x_rpcbuf_clear(source);
|
||||
}
|
||||
|
||||
/*
|
||||
* write an X11 RECTANGLE protocol structure into the buffer
|
||||
*
|
||||
* @param rpcbuf pointer to the x_rpcbuf_t to operate on
|
||||
* @param x X value of the rectangle
|
||||
* @param y Y value of the rectangle
|
||||
* @param width WIDTH value of the rectangle
|
||||
* @param height HEIGHT value of the rectangle
|
||||
*/
|
||||
static inline void x_rpcbuf_write_rect(
|
||||
x_rpcbuf_t *rpcbuf, INT16 x, INT16 y, CARD16 width, CARD16 height)
|
||||
{
|
||||
x_rpcbuf_write_INT16(rpcbuf, x);
|
||||
x_rpcbuf_write_INT16(rpcbuf, y);
|
||||
x_rpcbuf_write_CARD16(rpcbuf, width);
|
||||
x_rpcbuf_write_CARD16(rpcbuf, height);
|
||||
}
|
||||
|
||||
#endif /* _XSERVER_DIX_RPCBUF_PRIV_H */
|
||||
|
||||
Reference in New Issue
Block a user