mgba/src/util/gui.h

43 lines
797 B
C
Raw Normal View History

2015-08-23 06:20:21 +00:00
/* Copyright (c) 2013-2015 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GUI_H
#define GUI_H
#include "util/common.h"
struct GUIFont;
enum GUIInput {
GUI_INPUT_NONE = -1,
GUI_INPUT_SELECT = 0,
GUI_INPUT_BACK,
GUI_INPUT_CANCEL,
GUI_INPUT_UP,
GUI_INPUT_DOWN,
GUI_INPUT_LEFT,
GUI_INPUT_RIGHT,
2015-08-25 05:11:12 +00:00
GUI_INPUT_MAX
2015-08-23 06:20:21 +00:00
};
struct GUIParams {
2015-08-27 03:11:51 +00:00
unsigned width;
unsigned height;
2015-08-23 06:20:21 +00:00
const struct GUIFont* font;
void (*drawStart)(void);
void (*drawEnd)(void);
int (*pollInput)(void);
2015-08-30 06:21:41 +00:00
// State
int inputHistory[GUI_INPUT_MAX];
2015-08-23 06:20:21 +00:00
};
2015-08-30 06:21:41 +00:00
void GUIPollInput(struct GUIParams* params, int* newInput, int* heldInput);
2015-08-23 06:20:21 +00:00
#endif