cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

display.h (4006B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef GUAC_VNC_DISPLAY_H
     21#define GUAC_VNC_DISPLAY_H
     22
     23#include "config.h"
     24
     25#include <rfb/rfbclient.h>
     26#include <rfb/rfbproto.h>
     27
     28/**
     29 * Callback invoked by libVNCServer when it receives a new binary image data.
     30 * the VNC server. The image itself will be stored in the designated sub-
     31 * rectangle of client->framebuffer.
     32 *
     33 * @param client
     34 *     The VNC client associated with the VNC session in which the new image
     35 *     was received.
     36 *
     37 * @param x
     38 *     The X coordinate of the upper-left corner of the destination rectangle
     39 *     in which the image should be drawn, in pixels.
     40 *
     41 * @param y
     42 *     The Y coordinate of the upper-left corner of the destination rectangle
     43 *     in which the image should be drawn, in pixels.
     44 *
     45 * @param w
     46 *     The width of the image, in pixels.
     47 *
     48 * @param h
     49 *     The height of the image, in pixels.
     50 */
     51void guac_vnc_update(rfbClient* client, int x, int y, int w, int h);
     52
     53/**
     54 * Callback invoked by libVNCServer when it receives a CopyRect message.
     55 * CopyRect specified a rectangle of source data within the display and a
     56 * set of X/Y coordinates to which that rectangle should be copied.
     57 *
     58 * @param client
     59 *     The VNC client associated with the VNC session in which the CopyRect
     60 *     was received.
     61 *
     62 * @param src_x
     63 *     The X coordinate of the upper-left corner of the source rectangle
     64 *     from which the image data should be copied, in pixels.
     65 *
     66 * @param src_y
     67 *     The Y coordinate of the upper-left corner of the source rectangle
     68 *     from which the image data should be copied, in pixels.
     69 *
     70 * @param w
     71 *     The width of the source and destination rectangles, in pixels.
     72 *
     73 * @param h
     74 *     The height of the source and destination rectangles, in pixels.
     75 *
     76 * @param dest_x
     77 *     The X coordinate of the upper-left corner of the destination rectangle
     78 *     in which the copied image data should be drawn, in pixels.
     79 *
     80 * @param dest_y
     81 *     The Y coordinate of the upper-left corner of the destination rectangle
     82 *     in which the copied image data should be drawn, in pixels.
     83 */
     84void guac_vnc_copyrect(rfbClient* client, int src_x, int src_y, int w, int h,
     85        int dest_x, int dest_y);
     86
     87/**
     88 * Sets the pixel format to request of the VNC server. The request will be made
     89 * during the connection handshake with the VNC server using the values
     90 * specified by this function. Note that the VNC server is not required to
     91 * honor this request.
     92 *
     93 * @param client
     94 *     The VNC client associated with the VNC session whose desired pixel
     95 *     format should be set.
     96 *
     97 * @param color_depth
     98 *     The desired new color depth, in bits per pixel. Valid values are 8, 16,
     99 *     24, and 32.
    100 */
    101void guac_vnc_set_pixel_format(rfbClient* client, int color_depth);
    102
    103/**
    104 * Overridden implementation of the rfb_MallocFrameBuffer function invoked by
    105 * libVNCServer when the display is being resized (or initially allocated).
    106 *
    107 * @param client
    108 *     The VNC client associated with the VNC session whose display needs to be
    109 *     allocated or reallocated.
    110 *
    111 * @return
    112 *     The original value returned by rfb_MallocFrameBuffer().
    113 */
    114rfbBool guac_vnc_malloc_framebuffer(rfbClient* rfb_client);
    115
    116#endif
    117