/* * Copyright (C) 2013 Glyptodon LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef GUAC_VNC_DISPLAY_H #define GUAC_VNC_DISPLAY_H #include "config.h" #include #include /** * Callback invoked by libVNCServer when it receives a new binary image data. * the VNC server. The image itself will be stored in the designated sub- * rectangle of client->framebuffer. * * @param client * The VNC client associated with the VNC session in which the new image * was received. * * @param x * The X coordinate of the upper-left corner of the destination rectangle * in which the image should be drawn, in pixels. * * @param y * The Y coordinate of the upper-left corner of the destination rectangle * in which the image should be drawn, in pixels. * * @param w * The width of the image, in pixels. * * @param h * The height of the image, in pixels. */ void guac_vnc_update(rfbClient* client, int x, int y, int w, int h); /** * Callback invoked by libVNCServer when it receives a CopyRect message. * CopyRect specified a rectangle of source data within the display and a * set of X/Y coordinates to which that rectangle should be copied. * * @param client * The VNC client associated with the VNC session in which the CopyRect * was received. * * @param src_x * The X coordinate of the upper-left corner of the source rectangle * from which the image data should be copied, in pixels. * * @param src_y * The Y coordinate of the upper-left corner of the source rectangle * from which the image data should be copied, in pixels. * * @param w * The width of the source and destination rectangles, in pixels. * * @param h * The height of the source and destination rectangles, in pixels. * * @param dest_x * The X coordinate of the upper-left corner of the destination rectangle * in which the copied image data should be drawn, in pixels. * * @param dest_y * The Y coordinate of the upper-left corner of the destination rectangle * in which the copied image data should be drawn, in pixels. */ void guac_vnc_copyrect(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y); /** * Callback invoked by libVNCServer when the pixel format of future graphical * updates is changing. * * @param client * The VNC client associated with the VNC session whose pixel format is * changing. * * @param color_depth * The new color depth, in bits per pixel. Valid values are 8, 16, 24, and * 32. */ void guac_vnc_set_pixel_format(rfbClient* client, int color_depth); /** * Overridden implementation of the rfb_MallocFrameBuffer function invoked by * libVNCServer when the display is being resized (or initially allocated). * * @param client * The VNC client associated with the VNC session whose display needs to be * allocated or reallocated. * * @return * The original value returned by rfb_MallocFrameBuffer(). */ rfbBool guac_vnc_malloc_framebuffer(rfbClient* rfb_client); #endif