/
b_main.h
75 lines (59 loc) · 2.29 KB
/
b_main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/** @file b_main.h Event and device state bindings system.
*
* @authors Copyright © 2009-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>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, see:
* http://www.gnu.org/licenses</small>
*/
#ifndef DENG_CLIENT_BIND_MAIN_H
#define DENG_CLIENT_BIND_MAIN_H
#ifndef __CLIENT__
# error "Bindings only exist in the Client"
#endif
#include <de/types.h>
#include "dd_input.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DEFAULT_BINDING_CONTEXT_NAME "game"
#define CONSOLE_BINDING_CONTEXT_NAME "console"
#define UI_BINDING_CONTEXT_NAME "deui"
#define GLOBAL_BINDING_CONTEXT_NAME "global"
extern int symbolicEchoMode;
void B_Register(void);
void B_Init(void);
void B_Shutdown(void);
dd_bool B_Delete(int bid);
dd_bool B_Responder(ddevent_t* ev);
void B_WriteToFile(FILE* file);
/**
* Enable the contexts for the initial state.
*/
void B_InitialContextActivations(void);
void B_BindDefaults(void);
void B_BindGameDefaults(void);
struct evbinding_s* B_BindCommand(const char* eventDesc, const char* command);
struct dbinding_s* B_BindControl(const char* controlDesc, const char* device);
struct dbinding_s* B_GetControlDeviceBindings(int localNum, int control, struct bcontext_s** bContext);
bool B_UnbindCommand(char const *command);
// Utils
/// @todo: move to b_util.h
int B_NewIdentifier(void);
const char* B_ShortNameForKey2(int ddKey, dd_bool forceLowercase);
const char* B_ShortNameForKey(int ddkey);
int B_KeyForShortName(const char* key);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // DENG_CLIENT_BIND_MAIN_H