cscg24-guacamole

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

rdpgfx.h (7730B)


      1/**
      2 * FreeRDP: A Remote Desktop Protocol Implementation
      3 * Graphics Pipeline Extension
      4 *
      5 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
      6 * Copyright 2015 Thincast Technologies GmbH
      7 * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
      8 *
      9 * Licensed under the Apache License, Version 2.0 (the "License");
     10 * you may not use this file except in compliance with the License.
     11 * You may obtain a copy of the License at
     12 *
     13 *     http://www.apache.org/licenses/LICENSE-2.0
     14 *
     15 * Unless required by applicable law or agreed to in writing, software
     16 * distributed under the License is distributed on an "AS IS" BASIS,
     17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     18 * See the License for the specific language governing permissions and
     19 * limitations under the License.
     20 */
     21
     22#ifndef FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
     23#define FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
     24
     25#include <freerdp/channels/rdpgfx.h>
     26#include <freerdp/utils/profiler.h>
     27
     28/**
     29 * Client Interface
     30 */
     31
     32typedef struct _rdpgfx_client_context RdpgfxClientContext;
     33
     34typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context,
     35                                      const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics);
     36typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context,
     37                                   const RDPGFX_START_FRAME_PDU* startFrame);
     38typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context,
     39                                 const RDPGFX_END_FRAME_PDU* endFrame);
     40typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context,
     41                                       const RDPGFX_SURFACE_COMMAND* cmd);
     42typedef UINT (*pcRdpgfxDeleteEncodingContext)(
     43    RdpgfxClientContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext);
     44typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context,
     45                                      const RDPGFX_CREATE_SURFACE_PDU* createSurface);
     46typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context,
     47                                      const RDPGFX_DELETE_SURFACE_PDU* deleteSurface);
     48typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context,
     49                                  const RDPGFX_SOLID_FILL_PDU* solidFill);
     50typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context,
     51                                         const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface);
     52typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context,
     53                                       const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache);
     54typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context,
     55                                       const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface);
     56typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context,
     57                                         const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer);
     58typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context,
     59                                         const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply);
     60typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context,
     61                                        const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry);
     62typedef UINT (*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context,
     63                                           const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput);
     64typedef UINT (*pcRdpgfxMapSurfaceToScaledOutput)(
     65    RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput);
     66typedef UINT (*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context,
     67                                           const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow);
     68typedef UINT (*pcRdpgfxMapSurfaceToScaledWindow)(
     69    RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow);
     70typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, void* pData);
     71typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId);
     72typedef UINT (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds,
     73                                      UINT16* count);
     74typedef UINT (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot,
     75                                         void* pData);
     76typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot);
     77
     78typedef UINT (*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context);
     79
     80typedef UINT (*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId,
     81                                          UINT32 nrRects, const RECTANGLE_16* rects);
     82
     83typedef UINT (*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise,
     84                               BOOL* do_frame_acks);
     85typedef UINT (*pcRdpgfxOnClose)(RdpgfxClientContext* context);
     86typedef UINT (*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context,
     87                                      const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise);
     88typedef UINT (*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context,
     89                                    const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm);
     90typedef UINT (*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context,
     91                                         const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge);
     92typedef UINT (*pcRdpgfxQoeFrameAcknowledge)(
     93    RdpgfxClientContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge);
     94
     95typedef UINT (*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID,
     96                                            UINT64 windowID);
     97typedef UINT (*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID);
     98
     99struct _rdpgfx_client_context
    100{
    101	void* handle;
    102	void* custom;
    103
    104	/* Implementations require locking */
    105	pcRdpgfxResetGraphics ResetGraphics;
    106	pcRdpgfxStartFrame StartFrame;
    107	pcRdpgfxEndFrame EndFrame;
    108	pcRdpgfxSurfaceCommand SurfaceCommand;
    109	pcRdpgfxDeleteEncodingContext DeleteEncodingContext;
    110	pcRdpgfxCreateSurface CreateSurface;
    111	pcRdpgfxDeleteSurface DeleteSurface;
    112	pcRdpgfxSolidFill SolidFill;
    113	pcRdpgfxSurfaceToSurface SurfaceToSurface;
    114	pcRdpgfxSurfaceToCache SurfaceToCache;
    115	pcRdpgfxCacheToSurface CacheToSurface;
    116	pcRdpgfxCacheImportOffer CacheImportOffer;
    117	pcRdpgfxCacheImportReply CacheImportReply;
    118	pcRdpgfxEvictCacheEntry EvictCacheEntry;
    119	pcRdpgfxMapSurfaceToOutput MapSurfaceToOutput;
    120	pcRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput;
    121	pcRdpgfxMapSurfaceToWindow MapSurfaceToWindow;
    122	pcRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow;
    123
    124	pcRdpgfxGetSurfaceIds GetSurfaceIds;
    125	pcRdpgfxSetSurfaceData SetSurfaceData;
    126	pcRdpgfxGetSurfaceData GetSurfaceData;
    127	pcRdpgfxSetCacheSlotData SetCacheSlotData;
    128	pcRdpgfxGetCacheSlotData GetCacheSlotData;
    129
    130	/* Proxy callbacks */
    131	pcRdpgfxOnOpen OnOpen;
    132	pcRdpgfxOnClose OnClose;
    133	pcRdpgfxCapsAdvertise CapsAdvertise;
    134	pcRdpgfxCapsConfirm CapsConfirm;
    135	pcRdpgfxFrameAcknowledge FrameAcknowledge;
    136	pcRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge;
    137
    138	/* No locking required */
    139	pcRdpgfxUpdateSurfaces UpdateSurfaces;
    140	pcRdpgfxUpdateSurfaceArea UpdateSurfaceArea;
    141
    142	/* These callbacks allow crating/destroying a window directly
    143	 * mapped to a surface.
    144	 * NOTE: The surface is already locked.
    145	 */
    146	pcRdpgfxMapWindowForSurface MapWindowForSurface;
    147	pcRdpgfxUnmapWindowForSurface UnmapWindowForSurface;
    148
    149	CRITICAL_SECTION mux;
    150	PROFILER_DEFINE(SurfaceProfiler)
    151};
    152
    153FREERDP_API RdpgfxClientContext* rdpgfx_client_context_new(rdpSettings* settings);
    154FREERDP_API void rdpgfx_client_context_free(RdpgfxClientContext* context);
    155
    156#endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H */