mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
ui: generalize clipboard notifier
Use a QemuClipboardNotify union type for extendable clipboard events. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
@@ -20,8 +20,10 @@
|
||||
*/
|
||||
|
||||
typedef enum QemuClipboardType QemuClipboardType;
|
||||
typedef enum QemuClipboardNotifyType QemuClipboardNotifyType;
|
||||
typedef enum QemuClipboardSelection QemuClipboardSelection;
|
||||
typedef struct QemuClipboardPeer QemuClipboardPeer;
|
||||
typedef struct QemuClipboardNotify QemuClipboardNotify;
|
||||
typedef struct QemuClipboardInfo QemuClipboardInfo;
|
||||
|
||||
/**
|
||||
@@ -55,18 +57,44 @@ enum QemuClipboardSelection {
|
||||
* struct QemuClipboardPeer
|
||||
*
|
||||
* @name: peer name.
|
||||
* @update: notifier for clipboard updates.
|
||||
* @notifier: notifier for clipboard updates.
|
||||
* @request: callback for clipboard data requests.
|
||||
*
|
||||
* Clipboard peer description.
|
||||
*/
|
||||
struct QemuClipboardPeer {
|
||||
const char *name;
|
||||
Notifier update;
|
||||
Notifier notifier;
|
||||
void (*request)(QemuClipboardInfo *info,
|
||||
QemuClipboardType type);
|
||||
};
|
||||
|
||||
/**
|
||||
* enum QemuClipboardNotifyType
|
||||
*
|
||||
* @QEMU_CLIPBOARD_UPDATE_INFO: clipboard info update
|
||||
*
|
||||
* Clipboard notify type.
|
||||
*/
|
||||
enum QemuClipboardNotifyType {
|
||||
QEMU_CLIPBOARD_UPDATE_INFO,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct QemuClipboardNotify
|
||||
*
|
||||
* @type: the type of event.
|
||||
* @info: a QemuClipboardInfo event.
|
||||
*
|
||||
* Clipboard notify data.
|
||||
*/
|
||||
struct QemuClipboardNotify {
|
||||
QemuClipboardNotifyType type;
|
||||
union {
|
||||
QemuClipboardInfo *info;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* struct QemuClipboardInfo
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user