cscg24-guacamole

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

pointer.h (3037B)


      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_RDP_POINTER_H
     21#define GUAC_RDP_POINTER_H
     22
     23#include "common/display.h"
     24
     25#include <freerdp/freerdp.h>
     26#include <freerdp/graphics.h>
     27#include <winpr/wtypes.h>
     28
     29/**
     30 * Guacamole-specific rdpPointer data.
     31 */
     32typedef struct guac_rdp_pointer {
     33
     34    /**
     35     * FreeRDP pointer data - MUST GO FIRST.
     36     */
     37    rdpPointer pointer;
     38
     39    /**
     40     * The display layer containing cached image data.
     41     */
     42    guac_common_display_layer* layer;
     43
     44} guac_rdp_pointer;
     45
     46/**
     47 * Caches a new pointer, which can later be set via guac_rdp_pointer_set() as
     48 * the current mouse pointer.
     49 *
     50 * @param context
     51 *     The rdpContext associated with the current RDP session.
     52 *
     53 * @param pointer
     54 *     The pointer to cache.
     55 *
     56 * @return
     57 *     TRUE if successful, FALSE otherwise.
     58 */
     59BOOL guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer);
     60
     61/**
     62 * Sets the given cached pointer as the current pointer. The given pointer must
     63 * have already been initialized through a call to guac_rdp_pointer_new().
     64 *
     65 * @param context
     66 *     The rdpContext associated with the current RDP session.
     67 *
     68 * @param pointer
     69 *     The pointer to set as the current mouse pointer.
     70 *
     71 * @return
     72 *     TRUE if successful, FALSE otherwise.
     73 */
     74BOOL guac_rdp_pointer_set(rdpContext* context, const rdpPointer* pointer);
     75
     76/**
     77 * Frees all Guacamole-related data associated with the given pointer, allowing
     78 * FreeRDP to free the rest safely.
     79 *
     80 * @param context
     81 *     The rdpContext associated with the current RDP session.
     82 *
     83 * @param pointer
     84 *     The pointer to free.
     85 */
     86void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer);
     87
     88/**
     89 * Hides the current mouse pointer.
     90 *
     91 * @param context
     92 *     The rdpContext associated with the current RDP session.
     93 *
     94 * @return
     95 *     TRUE if successful, FALSE otherwise.
     96 */
     97BOOL guac_rdp_pointer_set_null(rdpContext* context);
     98
     99/**
    100 * Sets the system-dependent (as in dependent on the client system) default
    101 * pointer as the current pointer, rather than a cached pointer.
    102 *
    103 * @param context
    104 *     The rdpContext associated with the current RDP session.
    105 *
    106 * @return
    107 *     TRUE if successful, FALSE otherwise.
    108 */
    109BOOL guac_rdp_pointer_set_default(rdpContext* context);
    110
    111#endif