[client,sdl] split sdl_freerdp.hpp

This commit is contained in:
akallabeth 2023-04-14 09:16:50 +02:00 committed by akallabeth
parent 26ee0590d6
commit 05a2291861
12 changed files with 45 additions and 11 deletions

View File

@ -73,6 +73,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
set(SRCS
sdl_types.hpp
sdl_utils.cpp
sdl_utils.hpp
sdl_kbd.cpp

View File

@ -28,6 +28,7 @@
#include "sdl_disp.hpp"
#include "sdl_kbd.hpp"
#include "sdl_utils.hpp"
#include "sdl_freerdp.hpp"
#include <freerdp/log.h>
#define TAG CLIENT_TAG("sdl.disp")

View File

@ -21,7 +21,9 @@
#include <freerdp/types.h>
#include <freerdp/client/disp.h>
#include "sdl_freerdp.hpp"
#include "sdl_types.hpp"
typedef struct s_sdlDispContext sdlDispContext;
BOOL sdl_disp_init(sdlDispContext* xfDisp, DispClientContext* disp);
BOOL sdl_disp_uninit(sdlDispContext* xfDisp, DispClientContext* disp);

View File

@ -28,7 +28,9 @@
#include <SDL.h>
#include <SDL_video.h>
typedef struct s_sdlDispContext sdlDispContext;
#include "sdl_types.hpp"
#include "sdl_disp.hpp"
typedef struct
{
SDL_Window* window;
@ -36,7 +38,7 @@ typedef struct
int offset_y;
} sdl_window_t;
typedef struct
struct sdl_context
{
rdpClientContext common;
@ -64,4 +66,4 @@ typedef struct
Uint32 sdl_pixel_format;
wLog* log;
} sdlContext;
};

View File

@ -23,7 +23,7 @@
#include <freerdp/freerdp.h>
#include <SDL.h>
#include "sdl_freerdp.hpp"
#include "sdl_types.hpp"
BOOL sdl_sync_kbd_state(rdpContext* context);
BOOL sdl_keyboard_focus_in(rdpContext* context);

View File

@ -35,6 +35,7 @@
#define TAG CLIENT_TAG("sdl")
#include "sdl_monitor.hpp"
#include "sdl_freerdp.hpp"
typedef struct
{
@ -62,7 +63,7 @@ int sdl_list_monitors(sdlContext* sdl)
printf("listing %d monitors:\n", nmonitors);
for (int i = 0; i < nmonitors; i++)
{
SDL_Rect rect = { 0 };
SDL_Rect rect = {};
const int brc = SDL_GetDisplayBounds(i, &rect);
const char* name = SDL_GetDisplayName(i);

View File

@ -22,7 +22,7 @@
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
#include "sdl_freerdp.hpp"
#include "sdl_types.hpp"
int sdl_list_monitors(sdlContext* sdl);
BOOL sdl_detect_monitors(sdlContext* sdl, UINT32* pWidth, UINT32* pHeight);

View File

@ -19,8 +19,9 @@
#pragma once
#include <SDL.h>
#include <freerdp/graphics.h>
#include "sdl_freerdp.hpp"
#include "sdl_types.hpp"
BOOL sdl_register_pointer(rdpGraphics* graphics);

View File

@ -19,7 +19,10 @@
#pragma once
#include "sdl_freerdp.hpp"
#include <winpr/wtypes.h>
#include <SDL.h>
#include "sdl_types.hpp"
BOOL sdl_scale_coordinates(sdlContext* sdl, Uint32 windowId, INT32* px, INT32* py,
BOOL fromLocalToRDP, BOOL applyOffset);

22
client/SDL/sdl_types.hpp Normal file
View File

@ -0,0 +1,22 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* SDL Client
*
* Copyright 2022 Armin Novak <armin.novak@thincast.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
typedef struct sdl_context sdlContext;

View File

@ -161,7 +161,7 @@ BOOL sdl_push_user_event(Uint32 type, ...)
case SDL_USEREVENT_WINDOW_FULLSCREEN:
case SDL_USEREVENT_WINDOW_RESIZEABLE:
event->data1 = va_arg(ap, void*);
event->code = (va_arg(ap, BOOL) == TRUE) ? 1 : 0;
event->code = va_arg(ap, int);
break;
case SDL_USEREVENT_POINTER_NULL:
case SDL_USEREVENT_POINTER_DEFAULT:

View File

@ -19,12 +19,13 @@
#pragma once
#include <winpr/synch.h>
#include <winpr/wlog.h>
#include <stdbool.h>
#include <SDL.h>
#include "sdl_freerdp.hpp"
#include "sdl_types.hpp"
class CriticalSectionLock
{