mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vbox: Register IKeyboard with the unified API.
The IKeyboard COM object is needed to implement virDomainSendKey and is available in all supported VBOX versions.
This commit is contained in:
parent
ea576ee543
commit
445733f3a1
@ -3436,6 +3436,12 @@ _consoleGetDisplay(IConsole *console, IDisplay **display)
|
||||
return console->vtbl->GetDisplay(console, display);
|
||||
}
|
||||
|
||||
static nsresult
|
||||
_consoleGetKeyboard(IConsole *console, IKeyboard **keyboard)
|
||||
{
|
||||
return console->vtbl->GetKeyboard(console, keyboard);
|
||||
}
|
||||
|
||||
static nsresult
|
||||
_progressWaitForCompletion(IProgress *progress, PRInt32 timeout)
|
||||
{
|
||||
@ -4599,6 +4605,20 @@ _hardDiskGetFormat(IHardDisk *hardDisk, PRUnichar **format)
|
||||
return hardDisk->vtbl->GetFormat(hardDisk, format);
|
||||
}
|
||||
|
||||
static nsresult
|
||||
_keyboardPutScancode(IKeyboard *keyboard, PRInt32 scancode)
|
||||
{
|
||||
return keyboard->vtbl->PutScancode(keyboard, scancode);
|
||||
}
|
||||
|
||||
static nsresult
|
||||
_keyboardPutScancodes(IKeyboard *keyboard, PRUint32 scancodesSize,
|
||||
PRInt32 *scanCodes, PRUint32 *codesStored)
|
||||
{
|
||||
return keyboard->vtbl->PutScancodes(keyboard, scancodesSize, scanCodes,
|
||||
codesStored);
|
||||
}
|
||||
|
||||
static bool _machineStateOnline(PRUint32 state)
|
||||
{
|
||||
return ((state >= MachineState_FirstOnline) &&
|
||||
@ -4757,6 +4777,7 @@ static vboxUniformedIConsole _UIConsole = {
|
||||
.TakeSnapshot = _consoleTakeSnapshot,
|
||||
.DeleteSnapshot = _consoleDeleteSnapshot,
|
||||
.GetDisplay = _consoleGetDisplay,
|
||||
.GetKeyboard = _consoleGetKeyboard,
|
||||
};
|
||||
|
||||
static vboxUniformedIProgress _UIProgress = {
|
||||
@ -4951,6 +4972,11 @@ static vboxUniformedIHardDisk _UIHardDisk = {
|
||||
.GetFormat = _hardDiskGetFormat,
|
||||
};
|
||||
|
||||
static vboxUniformedIKeyboard _UIKeyboard = {
|
||||
.PutScancode = _keyboardPutScancode,
|
||||
.PutScancodes = _keyboardPutScancodes,
|
||||
};
|
||||
|
||||
static uniformedMachineStateChecker _machineStateChecker = {
|
||||
.Online = _machineStateOnline,
|
||||
.Inactive = _machineStateInactive,
|
||||
@ -5008,6 +5034,7 @@ void NAME(InstallUniformedAPI)(vboxUniformedAPI *pVBoxAPI)
|
||||
pVBoxAPI->UIHNInterface = _UIHNInterface;
|
||||
pVBoxAPI->UIDHCPServer = _UIDHCPServer;
|
||||
pVBoxAPI->UIHardDisk = _UIHardDisk;
|
||||
pVBoxAPI->UIKeyboard = _UIKeyboard;
|
||||
pVBoxAPI->machineStateChecker = _machineStateChecker;
|
||||
|
||||
#if VBOX_API_VERSION <= 2002000 || VBOX_API_VERSION >= 4000000
|
||||
|
@ -286,6 +286,7 @@ typedef struct {
|
||||
PRUnichar *description, IProgress **progress);
|
||||
nsresult (*DeleteSnapshot)(IConsole *console, vboxIIDUnion *iidu, IProgress **progress);
|
||||
nsresult (*GetDisplay)(IConsole *console, IDisplay **display);
|
||||
nsresult (*GetKeyboard)(IConsole *console, IKeyboard **keyboard);
|
||||
} vboxUniformedIConsole;
|
||||
|
||||
/* Functions for IProgress */
|
||||
@ -533,6 +534,12 @@ typedef struct {
|
||||
nsresult (*GetFormat)(IHardDisk *hardDisk, PRUnichar **format);
|
||||
} vboxUniformedIHardDisk;
|
||||
|
||||
typedef struct {
|
||||
nsresult (*PutScancode)(IKeyboard *keyboard, PRInt32 scancode);
|
||||
nsresult (*PutScancodes)(IKeyboard *keyboard, PRUint32 scancodesSize,
|
||||
PRInt32 *scanCodes, PRUint32 *codesStored);
|
||||
} vboxUniformedIKeyboard;
|
||||
|
||||
typedef struct {
|
||||
bool (*Online)(PRUint32 state);
|
||||
bool (*Inactive)(PRUint32 state);
|
||||
@ -591,6 +598,7 @@ typedef struct {
|
||||
vboxUniformedIHNInterface UIHNInterface;
|
||||
vboxUniformedIDHCPServer UIDHCPServer;
|
||||
vboxUniformedIHardDisk UIHardDisk;
|
||||
vboxUniformedIKeyboard UIKeyboard;
|
||||
uniformedMachineStateChecker machineStateChecker;
|
||||
/* vbox API features */
|
||||
bool domainEventCallbacks;
|
||||
|
Loading…
x
Reference in New Issue
Block a user