gdi.h (6140B)
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_GDI_H 21#define GUAC_RDP_GDI_H 22 23#include "config.h" 24 25#include <freerdp/freerdp.h> 26#include <guacamole/protocol.h> 27 28/** 29 * Translates a standard RDP ROP3 value into a guac_composite_mode. Valid 30 * ROP3 operations indexes are listed in the RDP protocol specifications: 31 * 32 * http://msdn.microsoft.com/en-us/library/cc241583.aspx 33 * 34 * @param client 35 * The guac_client associated with the current RDP session. 36 * 37 * @param rop3 38 * The ROP3 operation index to translate. 39 * 40 * @return 41 * The guac_composite_mode that equates to, or most closely approximates, 42 * the given ROP3 operation. 43 */ 44guac_composite_mode guac_rdp_rop3_transfer_function(guac_client* client, 45 int rop3); 46 47/** 48 * Handler for the DstBlt Primary Drawing Order. A DstBlt Primary Drawing Order 49 * paints a rectangle of image data using a raster operation which considers 50 * the destination only. See: 51 * 52 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegdi/87ea30df-59d6-438e-a735-83f0225fbf91 53 * 54 * @param context 55 * The rdpContext associated with the current RDP session. 56 * 57 * @param dstblt 58 * The DSTBLT update to handle. 59 * 60 * @return 61 * TRUE if successful, FALSE otherwise. 62 */ 63BOOL guac_rdp_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt); 64 65/** 66 * Handler for the PatBlt Primary Drawing Order. A PatBlt Primary Drawing Order 67 * paints a rectangle of image data, a brush pattern, and a three-way raster 68 * operation which considers the source data, the destination, AND the brush 69 * pattern. See: 70 * 71 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegdi/bd4bf5e7-b988-45f9-8201-3b22cc9aeeb8 72 * 73 * @param context 74 * The rdpContext associated with the current RDP session. 75 * 76 * @param patblt 77 * The PATBLT update to handle. 78 * 79 * @return 80 * TRUE if successful, FALSE otherwise. 81 */ 82BOOL guac_rdp_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt); 83 84/** 85 * Handler for the ScrBlt Primary Drawing Order. A ScrBlt Primary Drawing Order 86 * paints a rectangle of image data using a raster operation which considers 87 * the source and destination. See: 88 * 89 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegdi/a4e322b0-cd64-4dfc-8e1a-f24dc0edc99d 90 * 91 * @param context 92 * The rdpContext associated with the current RDP session. 93 * 94 * @param scrblt 95 * The SCRBLT update to handle. 96 * 97 * @return 98 * TRUE if successful, FALSE otherwise. 99 */ 100BOOL guac_rdp_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt); 101 102/** 103 * Handler for the MemBlt Primary Drawing Order. A MemBlt Primary Drawing Order 104 * paints a rectangle of cached image data from a cached surface to the screen 105 * using a raster operation which considers the source and destination. See: 106 * 107 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegdi/84c2ec2f-f776-405b-9b48-6894a28b1b14 108 * 109 * @param context 110 * The rdpContext associated with the current RDP session. 111 * 112 * @param memblt 113 * The MEMBLT update to handle. 114 * 115 * @return 116 * TRUE if successful, FALSE otherwise. 117 */ 118BOOL guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt); 119 120/** 121 * Handler for the OpaqueRect Primary Drawing Order. An OpaqueRect Primary 122 * Drawing Order draws an opaque rectangle of a single solid color. Note that 123 * support for OpaqueRect cannot be claimed without also supporting PatBlt, as 124 * both use the same negotiation order number. See: 125 * 126 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegdi/1eead7aa-ac63-411a-9f8c-b1b227526877 127 * 128 * @param context 129 * The rdpContext associated with the current RDP session. 130 * 131 * @param opaque_rect 132 * The OPAQUE RECT update to handle. 133 * 134 * @return 135 * TRUE if successful, FALSE otherwise. 136 */ 137BOOL guac_rdp_gdi_opaquerect(rdpContext* context, 138 const OPAQUE_RECT_ORDER* opaque_rect); 139 140/** 141 * Handler called prior to calling the handlers for specific updates when 142 * those updates are clipped by a bounding rectangle. This is not a true RDP 143 * update, but is called by FreeRDP before and after any update involving 144 * clipping. 145 * 146 * @param context 147 * The rdpContext associated with the current RDP session. 148 * 149 * @param bounds 150 * The clipping rectangle to set, or NULL to remove any applied clipping 151 * rectangle. 152 * 153 * @return 154 * TRUE if successful, FALSE otherwise. 155 */ 156BOOL guac_rdp_gdi_set_bounds(rdpContext* context, const rdpBounds* bounds); 157 158/** 159 * Handler called when a paint operation is complete. We don't actually 160 * use this, but FreeRDP requires it. Calling this function has no effect. 161 * 162 * @param context 163 * The rdpContext associated with the current RDP session. 164 * 165 * @return 166 * TRUE if successful, FALSE otherwise. 167 */ 168BOOL guac_rdp_gdi_end_paint(rdpContext* context); 169 170/** 171 * Handler called when the desktop dimensions change, either from a 172 * true desktop resize event received by the RDP client, or due to 173 * a revised size given by the server during initial connection 174 * negotiation. 175 * 176 * The new screen size will be made available within the settings associated 177 * with the given context. 178 * 179 * @param context 180 * The rdpContext associated with the current RDP session. 181 * 182 * @return 183 * TRUE if successful, FALSE otherwise. 184 */ 185BOOL guac_rdp_gdi_desktop_resize(rdpContext* context); 186 187#endif