cursor.h (2329B)
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 GUACENC_CURSOR_H 21#define GUACENC_CURSOR_H 22 23#include "config.h" 24#include "buffer.h" 25 26#include <guacamole/protocol.h> 27#include <guacamole/timestamp.h> 28 29/** 30 * A mouse cursor, having a current location, hostspot, and associated cursor 31 * image. 32 */ 33typedef struct guacenc_cursor { 34 35 /** 36 * The current X coordinate of the mouse cursor, in pixels. Valid values 37 * are non-negative. Negative values indicate that the cursor should not 38 * be rendered. 39 */ 40 int x; 41 42 /** 43 * The current Y coordinate of the mouse cursor, in pixels. Valid values 44 * are non-negative. Negative values indicate that the cursor should not 45 * be rendered. 46 */ 47 int y; 48 49 /** 50 * The X coordinate of the mouse cursor hotspot within the cursor image, 51 * in pixels. 52 */ 53 int hotspot_x; 54 55 /** 56 * The Y coordinate of the mouse cursor hotspot within the cursor image, 57 * in pixels. 58 */ 59 int hotspot_y; 60 61 /** 62 * The current mouse cursor image. 63 */ 64 guacenc_buffer* buffer; 65 66} guacenc_cursor; 67 68/** 69 * Allocates and initializes a new cursor object. 70 * 71 * @return 72 * A newly-allocated and initialized guacenc_cursor, or NULL if allocation 73 * fails. 74 */ 75guacenc_cursor* guacenc_cursor_alloc(); 76 77/** 78 * Frees all memory associated with the given cursor object. If the cursor 79 * provided is NULL, this function has no effect. 80 * 81 * @param cursor 82 * The cursor to free, which may be NULL. 83 */ 84void guacenc_cursor_free(guacenc_cursor* cursor); 85 86#endif 87