libguac  1.6.0
display.h
Go to the documentation of this file.
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_DISPLAY_H
21 #define GUAC_DISPLAY_H
22 
45 #include "client.h"
46 #include "display-constants.h"
47 #include "display-types.h"
48 #include "rect.h"
49 #include "socket.h"
50 
51 #include <cairo/cairo.h>
52 #include <unistd.h>
53 
74 #define GUAC_DISPLAY_LAYER_RAW_BUFFER(context, rect) \
75  GUAC_RECT_MUTABLE_BUFFER(rect, context->buffer, context->stride, GUAC_DISPLAY_LAYER_RAW_BPP)
76 
78 
84  cairo_t* cairo;
85 
90  cairo_surface_t* surface;
91 
96 
104 
114 
115 };
116 
118 
140  unsigned char* buffer;
141 
152  size_t stride;
153 
171 
179 
189 
190 };
191 
214 
239 void guac_display_stop(guac_display* display);
240 
247 void guac_display_free(guac_display* display);
248 
261 void guac_display_dup(guac_display* display, guac_socket* socket);
262 
276 
315 void guac_display_notify_user_moved_mouse(guac_display* display, guac_user* user, int x, int y, int mask);
316 
326 void guac_display_end_frame(guac_display* display);
327 
339 
353 void guac_display_end_multiple_frames(guac_display* display, int frames);
354 
370 
390 
409 
418 void guac_display_free_layer(guac_display_layer* display_layer);
419 
438 
455  guac_display_cursor_type cursor_type);
456 
477 void guac_display_set_cursor_hotspot(guac_display* display, int x, int y);
478 
492 
507 void guac_display_layer_move(guac_display_layer* layer, int x, int y);
508 
521 void guac_display_layer_stack(guac_display_layer* layer, int z);
522 
536 
550 void guac_display_layer_set_opacity(guac_display_layer* layer, int opacity);
551 
567 void guac_display_layer_set_lossless(guac_display_layer* layer, int lossless);
568 
583 void guac_display_layer_set_multitouch(guac_display_layer* layer, int touches);
584 
614 void guac_display_layer_resize(guac_display_layer* layer, int width, int height);
615 
636 
655 
673  const guac_rect* dst, uint32_t color);
674 
701  const guac_rect* dst, const void* restrict buffer, size_t stride);
702 
724 
743 
774 
787 
797 
832  guac_user* user, int x, int y, int mask);
833 
844 
849 #endif
void guac_display_layer_set_opacity(guac_display_layer *layer, int opacity)
Sets the opacity of the given layer.
void guac_display_end_multiple_frames(guac_display *display, int frames)
Ends the current frame, where that frame may combine or otherwise represent the changes of an arbitra...
struct guac_display_layer guac_display_layer
Opaque representation of a layer within a guac_display.
Definition: display-types.h:52
Provides type definitions related to the abstract display implementation (guac_display).
void guac_display_stop(guac_display *display)
Stops all background processes that may be running beneath the given guac_display, ensuring nothing within guac_display will continue to access any memory unless explicitly and externally requested.
void guac_display_render_thread_notify_frame(guac_display_render_thread *render_thread)
Notifies the given render thread that a frame boundary has been reached.
struct guac_display_render_thread guac_display_render_thread
Opaque representation of a thread that continuously renders updated graphical data to the remote disp...
Definition: display-types.h:45
guac_display_layer_raw_context * guac_display_layer_open_raw(guac_display_layer *layer)
Begins a drawing operation for the given layer, returning a context that can be used to draw directly...
guac_rect bounds
A rectangle covering the current bounds of the graphical surface.
Definition: display.h:95
The core I/O object of Guacamole.
Definition: socket.h:39
guac_display_cursor_type
Pre-defined mouse cursor graphics.
Definition: display-types.h:75
void guac_display_set_cursor_hotspot(guac_display *display, int x, int y)
Sets the hotspot location of the remote mouse cursor.
guac_rect bounds
A rectangle covering the current bounds of the graphical surface.
Definition: display.h:170
void guac_display_layer_stack(guac_display_layer *layer, int z)
Sets the stacking position of the given layer relative to all other sibling layers (direct children o...
void guac_display_free(guac_display *display)
Frees all resources associated with the given guac_display.
void guac_display_notify_user_left(guac_display *display, guac_user *user)
Notifies the given guac_display that a specific user has left the connection and need no longer be co...
size_t stride
The number of bytes in each row of image data.
Definition: display.h:152
void guac_display_layer_raw_context_put(guac_display_layer_raw_context *context, const guac_rect *dst, const void *restrict buffer, size_t stride)
Copies a rectangle of image data from the given buffer to the given raw context, replacing all pixel ...
void guac_display_layer_move(guac_display_layer *layer, int x, int y)
Moves the given layer to the given coordinates.
guac_display_layer * guac_display_default_layer(guac_display *display)
Returns the default layer for the given display.
guac_rect dirty
A rectangle covering the region of the guac_display_layer that has changed since the last frame...
Definition: display.h:103
cairo_surface_t * surface
A Cairo image surface wrapping the image buffer of this guac_display_layer.
Definition: display.h:90
struct guac_display guac_display
Opaque representation of the remote (client-side) display of a Guacamole connection (guac_client)...
Definition: display-types.h:39
Representation of a physical connection within a larger logical connection which may be shared...
Definition: user.h:115
guac_display_layer * guac_display_alloc_layer(guac_display *display, int opaque)
Allocates a new layer for the given display.
void guac_display_layer_set_multitouch(guac_display_layer *layer, int touches)
Sets the level of multitouch support available for the given layer.
A rectangle defined by its upper-left and lower-right corners.
Definition: rect.h:94
void guac_display_layer_get_bounds(guac_display_layer *layer, guac_rect *bounds)
Stores the current bounding rectangle of the given layer in the given guac_rect.
void guac_display_layer_set_parent(guac_display_layer *layer, const guac_display_layer *parent)
Reparents the given layer such that it is a direct child of the given parent layer.
guac_display_layer * guac_display_alloc_buffer(guac_display *display, int opaque)
Allocates a new buffer (offscreen layer) for the given display.
void guac_display_free_layer(guac_display_layer *display_layer)
Frees the given layer, releasing any underlying memory.
void guac_display_render_thread_notify_modified(guac_display_render_thread *render_thread)
Notifies the given render thread that the graphical state of the display has been modified in some vi...
cairo_t * cairo
A Cairo context created for the Cairo surface.
Definition: display.h:84
void guac_display_layer_resize(guac_display_layer *layer, int width, int height)
Resizes the given layer to the given dimensions.
void guac_display_end_mouse_frame(guac_display *display)
Ends the current frame only if the user-visible changes consist purely of updates to the mouse cursor...
The current raw drawing context of a guac_display_layer, including the underlying drawing buffer of t...
Definition: display.h:117
Guacamole proxy client.
Definition: client.h:48
void guac_display_notify_user_moved_mouse(guac_display *display, guac_user *user, int x, int y, int mask)
Notifies the given guac_display that a specific user has changed the state of the mouse...
void guac_display_set_cursor(guac_display *display, guac_display_cursor_type cursor_type)
Sets the remote mouse cursor to the given built-in cursor icon.
unsigned char * buffer
The raw, underlying image buffer of the guac_display_layer.
Definition: display.h:140
Provides constants related to the abstract display implementation (guac_display). ...
guac_display_layer * hint_from
The layer that should be searched for possible scroll/copy operations related to the changes being ma...
Definition: display.h:188
guac_display_layer * guac_display_cursor(guac_display *display)
Returns a layer representing the current mouse cursor icon.
guac_display * guac_display_alloc(guac_client *client)
Allocates a new guac_display representing the remote display shared by all connected users of the giv...
void guac_display_end_frame(guac_display *display)
Ends the current frame, where the number of input frames that were considered in creating this frame ...
void guac_display_dup(guac_display *display, guac_socket *socket)
Replicates the current remote display state across the given socket.
void guac_display_layer_close_cairo(guac_display_layer *layer, guac_display_layer_cairo_context *context)
Ends a drawing operation that was started with a call to guac_display_layer_open_cairo() and relinqui...
Functions and structure contents for the Guacamole proxy client.
void guac_display_render_thread_destroy(guac_display_render_thread *render_thread)
Safely stops and frees all resources associated with the given render thread.
void guac_display_render_thread_notify_user_moved_mouse(guac_display_render_thread *render_thread, guac_user *user, int x, int y, int mask)
Notifies the given render thread that a specific user has changed the state of the mouse...
The current Cairo drawing context of a guac_display_layer, including a Cairo image surface wrapping t...
Definition: display.h:77
Defines the guac_socket object and functions for using and manipulating it.
guac_display_layer * hint_from
The layer that should be searched for possible scroll/copy operations related to the changes being ma...
Definition: display.h:113
void guac_display_layer_raw_context_set(guac_display_layer_raw_context *context, const guac_rect *dst, uint32_t color)
Fills a rectangle of image data within the given raw context with a single color. ...
void guac_display_layer_close_raw(guac_display_layer *layer, guac_display_layer_raw_context *context)
Ends a drawing operation that was started with a call to guac_display_layer_open_raw() and relinquish...
guac_rect dirty
A rectangle covering the region of the guac_display_layer that has changed since the last frame...
Definition: display.h:178
void guac_display_layer_set_lossless(guac_display_layer *layer, int lossless)
Sets whether graphical changes to the given layer are allowed to be represented, updated, or sent using methods that can cause some loss of information, such as JPEG or WebP compression.
guac_display_render_thread * guac_display_render_thread_create(guac_display *display)
Creates and starts a rendering thread for the given guac_display.
guac_display_layer_cairo_context * guac_display_layer_open_cairo(guac_display_layer *layer)
Begins a drawing operation for the given layer, returning a context that can be used to draw to a Cai...