Files
lcdproc/server/input.h
T
mmdolze a151ee0fc4 Mega change to the LCDd's header files:
1. Use <stdbool.h> if it is available but keep a compatibility shim in
   shared/defines.h in case it is not.
2. Unbreak the circular header dependencies (mostly):
   2a. client.c and client.h may NOT depend on 'struct Menu'. Use a void pointer
       and casts instead.
   2b. Separate the data type definitions in client.h and screen.h from
       function prototypes which may require other data structures. This makes
       header dependencies much more easy to maintain. Usually the data types
       should have been moved to their own files but I (mmdolze) chose to
       separate them using different header guards.
   2c. Remove many now unused header includes.
Apply (old BSD-) style on menuscreens.c.
2012-02-22 22:25:32 +00:00

57 lines
1.4 KiB
C

/** \file server/input.h
*/
/* This file is part of LCDd, the lcdproc server.
*
* This file is released under the GNU General Public License.
* Refer to the COPYING file distributed with this package.
*
* Copyright (c) 1999, William Ferrell, Selene Scriven
* 2003, Joris Robijn
*/
#ifndef INPUT_H
#define INPUT_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#include "shared/defines.h"
/* Accepts and uses keypad input while displaying screens... */
int handle_input(void);
typedef struct KeyReservation {
char *key;
bool exclusive;
Client *client; /* NULL for internal clients */
} KeyReservation;
int input_init(void);
/* Init the input handling system */
int input_shutdown(void);
/* Shut it down */
int input_reserve_key(const char *key, bool exclusive, Client *client);
/* Reserves a key for a client */
/* Return -1 if reservation of key is not possible */
void input_release_key(const char *key, Client *client);
/* Releases a key reservation */
void input_release_client_keys(Client *client);
/* Releases all key reservations for a given client */
KeyReservation *input_find_key(const char *key, Client *client);
/* Finds if a key reservation causes a 'hit'.
* If the key was reserved exclusively, the client will be ignored.
* If the key was reserved shared, the client must match.
*/
#endif