FreeRDP
Loading...
Searching...
No Matches
SDL2/sdl_utils.hpp
1
20#pragma once
21
22#include <winpr/synch.h>
23#include <winpr/wlog.h>
24
25#include <SDL.h>
26#include <string>
27#include <vector>
28
29#include <sdl_common_utils.hpp>
30
31enum
32{
33 SDL_USEREVENT_UPDATE = SDL_USEREVENT + 1,
34 SDL_USEREVENT_CREATE_WINDOWS,
35 SDL_USEREVENT_WINDOW_RESIZEABLE,
36 SDL_USEREVENT_WINDOW_FULLSCREEN,
37 SDL_USEREVENT_WINDOW_MINIMIZE,
38 SDL_USEREVENT_POINTER_NULL,
39 SDL_USEREVENT_POINTER_DEFAULT,
40 SDL_USEREVENT_POINTER_POSITION,
41 SDL_USEREVENT_POINTER_SET,
42 SDL_USEREVENT_QUIT,
43 SDL_USEREVENT_CERT_DIALOG,
44 SDL_USEREVENT_SHOW_DIALOG,
45 SDL_USEREVENT_AUTH_DIALOG,
46 SDL_USEREVENT_SCARD_DIALOG,
47 SDL_USEREVENT_RETRY_DIALOG,
48
49 SDL_USEREVENT_CERT_RESULT,
50 SDL_USEREVENT_SHOW_RESULT,
51 SDL_USEREVENT_AUTH_RESULT,
52 SDL_USEREVENT_SCARD_RESULT
53};
54
55typedef struct
56{
57 Uint32 type;
58 Uint32 timestamp;
59 char* title;
60 char* user;
61 char* domain;
62 char* password;
63 Sint32 result;
65
66BOOL sdl_push_user_event(Uint32 type, ...);
67
68bool sdl_push_quit();
69
70std::string sdl_window_event_str(Uint8 ev);
71const char* sdl_event_type_str(Uint32 type);
72const char* sdl_error_string(Sint32 res);
73
74#define sdl_log_error(res, log, what) sdl_log_error_ex(res, log, what, __FILE__, __LINE__, __func__)
75BOOL sdl_log_error_ex(Sint32 res, wLog* log, const char* what, const char* file, size_t line,
76 const char* fkt);