2019-03-28 12:23:15 +00:00
|
|
|
/*
|
|
|
|
Looking Glass - KVM FrameRelay (KVMFR) Client
|
|
|
|
Copyright (C) 2017-2019 Geoffrey McRae <geoff@hostfission.com>
|
|
|
|
https://looking-glass.hostfission.com
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 2 of the License, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
|
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
2021-01-19 10:12:20 +00:00
|
|
|
#include <linux/input.h>
|
2019-03-28 12:23:15 +00:00
|
|
|
|
2019-03-30 01:26:06 +00:00
|
|
|
typedef enum LG_MsgAlert
|
|
|
|
{
|
|
|
|
LG_ALERT_INFO ,
|
|
|
|
LG_ALERT_SUCCESS,
|
|
|
|
LG_ALERT_WARNING,
|
|
|
|
LG_ALERT_ERROR
|
|
|
|
}
|
|
|
|
LG_MsgAlert;
|
|
|
|
|
2019-03-28 12:23:15 +00:00
|
|
|
typedef struct KeybindHandle * KeybindHandle;
|
2021-01-19 10:12:20 +00:00
|
|
|
typedef void (*SuperEventFn)(uint32_t sc, void * opaque);
|
2019-03-28 12:23:15 +00:00
|
|
|
|
2019-03-30 01:26:06 +00:00
|
|
|
/**
|
|
|
|
* Show an alert on screen
|
|
|
|
* @param type The alert type
|
|
|
|
* param fmt The alert message format
|
|
|
|
@ param ... formatted message values
|
|
|
|
*/
|
|
|
|
void app_alert(LG_MsgAlert type, const char * fmt, ...);
|
|
|
|
|
2019-03-28 12:23:15 +00:00
|
|
|
/**
|
|
|
|
* Register a handler for the <super>+<key> combination
|
2021-01-19 10:12:20 +00:00
|
|
|
* @param sc The scancode to register
|
2019-03-28 12:23:15 +00:00
|
|
|
* @param callback The function to be called when the combination is pressed
|
|
|
|
* @param opaque A pointer to be passed to the callback, may be NULL
|
|
|
|
* @retval A handle for the binding or NULL on failure.
|
|
|
|
* The caller is required to release the handle via `app_release_keybind` when it is no longer required
|
|
|
|
*/
|
2021-01-19 10:12:20 +00:00
|
|
|
KeybindHandle app_register_keybind(uint32_t sc, SuperEventFn callback, void * opaque);
|
2019-03-28 12:23:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Release an existing key binding
|
|
|
|
* @param handle A pointer to the keybind handle to release, may be NULL
|
|
|
|
*/
|
2021-01-19 10:12:20 +00:00
|
|
|
void app_release_keybind(KeybindHandle * handle);
|