[client] core: added initial clipboard interface and x11 stubs

This commit is contained in:
Geoffrey McRae
2019-02-22 22:38:52 +11:00
parent 08bf01b649
commit 54e8cce33c
5 changed files with 131 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "kb.h"
#include "lg-renderers.h"
#include "lg-clipboards.h"
struct AppState
{
@@ -58,10 +59,12 @@ struct AppState
float scaleX, scaleY;
float accX, accY;
const LG_Renderer * lgr ;
const LG_Renderer * lgr;
void * lgrData;
bool lgrResize;
const LG_Clipboard * lgc;
SDL_Window * window;
int shmFD;
struct KVMFRHeader * shm;
@@ -857,7 +860,6 @@ int run()
if (try_renderer(i, lgrParams, &sdlFlags))
{
state.lgr = LG_Renderers[i];
DEBUG_INFO("Using: %s", state.lgr->get_name());
break;
}
}
@@ -890,6 +892,18 @@ int run()
return 1;
}
// choose a clipboard api
for(unsigned int i = 0; i < LG_CLIPBOARD_COUNT; ++i)
{
const LG_Clipboard * cb = LG_Clipboards[i];
if (cb->init())
{
state.lgc = cb;
DEBUG_INFO("Using Clipboard: %s", cb->getName());
break;
}
}
if (params.fullscreen)
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
@@ -1104,6 +1118,9 @@ int run()
if (state.lgr)
state.lgr->deinitialize(state.lgrData);
if (state.lgc)
state.lgc->free();
if (state.window)
SDL_DestroyWindow(state.window);