src/util/gui.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef GUI_H
7#define GUI_H
8
9#include "util/common.h"
10
11struct GUIFont;
12
13enum GUIInput {
14 GUI_INPUT_NONE = -1,
15 GUI_INPUT_SELECT = 0,
16 GUI_INPUT_BACK,
17 GUI_INPUT_CANCEL,
18
19 GUI_INPUT_UP,
20 GUI_INPUT_DOWN,
21 GUI_INPUT_LEFT,
22 GUI_INPUT_RIGHT,
23
24 GUI_INPUT_MAX
25};
26
27struct GUIParams {
28 unsigned width;
29 unsigned height;
30 const struct GUIFont* font;
31
32 void (*drawStart)(void);
33 void (*drawEnd)(void);
34 int (*pollInput)(void);
35
36 // State
37 int inputHistory[GUI_INPUT_MAX];
38};
39
40void GUIPollInput(struct GUIParams* params, int* newInput, int* heldInput);
41
42#endif