2013-01-29 19:59:58 +08:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Android Event System
|
|
|
|
*
|
|
|
|
* Copyright 2010-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 20:01:41 +08:00
|
|
|
#ifndef FREERDP_CLIENT_ANDROID_EVENT_H
|
|
|
|
#define FREERDP_CLIENT_ANDROID_EVENT_H
|
2013-01-29 19:59:58 +08:00
|
|
|
#include <freerdp/freerdp.h>
|
2016-10-17 16:24:30 +08:00
|
|
|
#include <freerdp/api.h>
|
2013-01-29 19:59:58 +08:00
|
|
|
|
|
|
|
#define EVENT_TYPE_KEY 1
|
|
|
|
#define EVENT_TYPE_CURSOR 2
|
|
|
|
#define EVENT_TYPE_DISCONNECT 3
|
|
|
|
#define EVENT_TYPE_KEY_UNICODE 4
|
2013-04-26 20:59:16 +08:00
|
|
|
#define EVENT_TYPE_CLIPBOARD 5
|
2013-01-29 19:59:58 +08:00
|
|
|
|
|
|
|
struct _ANDROID_EVENT
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
};
|
|
|
|
typedef struct _ANDROID_EVENT ANDROID_EVENT;
|
|
|
|
|
|
|
|
struct _ANDROID_EVENT_KEY
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
int flags;
|
|
|
|
UINT16 scancode;
|
|
|
|
};
|
|
|
|
typedef struct _ANDROID_EVENT_KEY ANDROID_EVENT_KEY;
|
|
|
|
|
|
|
|
struct _ANDROID_EVENT_CURSOR
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
UINT16 flags;
|
|
|
|
UINT16 x;
|
|
|
|
UINT16 y;
|
|
|
|
};
|
|
|
|
typedef struct _ANDROID_EVENT_CURSOR ANDROID_EVENT_CURSOR;
|
|
|
|
|
2013-04-26 20:59:16 +08:00
|
|
|
struct _ANDROID_EVENT_CLIPBOARD
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
void* data;
|
|
|
|
int data_length;
|
|
|
|
};
|
|
|
|
typedef struct _ANDROID_EVENT_CLIPBOARD ANDROID_EVENT_CLIPBOARD;
|
|
|
|
|
2013-01-29 19:59:58 +08:00
|
|
|
struct _ANDROID_EVENT_QUEUE
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
int count;
|
2016-02-01 22:25:40 +08:00
|
|
|
HANDLE isSet;
|
2016-10-17 16:24:30 +08:00
|
|
|
ANDROID_EVENT** events;
|
2013-01-29 19:59:58 +08:00
|
|
|
};
|
|
|
|
typedef struct _ANDROID_EVENT_QUEUE ANDROID_EVENT_QUEUE;
|
|
|
|
|
2016-10-17 16:24:30 +08:00
|
|
|
FREERDP_LOCAL BOOL android_push_event(freerdp* inst, ANDROID_EVENT* event);
|
2016-02-01 22:25:40 +08:00
|
|
|
|
2016-10-17 16:24:30 +08:00
|
|
|
FREERDP_LOCAL HANDLE android_get_handle(freerdp* inst);
|
|
|
|
FREERDP_LOCAL BOOL android_check_handle(freerdp* inst);
|
2016-02-01 22:25:40 +08:00
|
|
|
|
2016-10-17 16:24:30 +08:00
|
|
|
FREERDP_LOCAL ANDROID_EVENT_KEY* android_event_key_new(int flags,
|
|
|
|
UINT16 scancode);
|
|
|
|
FREERDP_LOCAL ANDROID_EVENT_KEY* android_event_unicodekey_new(UINT16 key);
|
|
|
|
FREERDP_LOCAL ANDROID_EVENT_CURSOR* android_event_cursor_new(UINT16 flags,
|
|
|
|
UINT16 x, UINT16 y);
|
|
|
|
FREERDP_LOCAL ANDROID_EVENT* android_event_disconnect_new(void);
|
|
|
|
FREERDP_LOCAL ANDROID_EVENT_CLIPBOARD* android_event_clipboard_new(void* data,
|
|
|
|
int data_length);
|
2016-02-01 22:25:40 +08:00
|
|
|
|
2016-10-17 16:24:30 +08:00
|
|
|
FREERDP_LOCAL void android_event_free(ANDROID_EVENT* event);
|
2016-02-01 22:25:40 +08:00
|
|
|
|
2016-10-17 16:24:30 +08:00
|
|
|
FREERDP_LOCAL BOOL android_event_queue_init(freerdp* inst);
|
|
|
|
FREERDP_LOCAL void android_event_queue_uninit(freerdp* inst);
|
2013-01-29 19:59:58 +08:00
|
|
|
|
2017-06-06 20:01:41 +08:00
|
|
|
#endif /* FREERDP_CLIENT_ANDROID_EVENT_H */
|