gui.h (1951B)
1/* 2 * Gearboy - Nintendo Game Boy Emulator 3 * Copyright (C) 2012 Ignacio Sanchez 4 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * any later version. 9 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see http://www.gnu.org/licenses/ 17 * 18 */ 19 20#ifndef GUI_H 21#define GUI_H 22 23#include "imgui/imgui.h" 24 25#ifdef GUI_IMPORT 26 #define EXTERN 27#else 28 #define EXTERN extern 29#endif 30 31#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" 32#define BYTE_TO_BINARY_PATTERN_SPACED "%c%c%c%c %c%c%c%c" 33#define BYTE_TO_BINARY(byte) \ 34 (byte & 0x80 ? '1' : '0'), \ 35 (byte & 0x40 ? '1' : '0'), \ 36 (byte & 0x20 ? '1' : '0'), \ 37 (byte & 0x10 ? '1' : '0'), \ 38 (byte & 0x08 ? '1' : '0'), \ 39 (byte & 0x04 ? '1' : '0'), \ 40 (byte & 0x02 ? '1' : '0'), \ 41 (byte & 0x01 ? '1' : '0') 42 43enum gui_ShortCutEvent 44{ 45 gui_ShortcutOpenROM = 0, 46 gui_ShortcutReset, 47 gui_ShortcutPause, 48 gui_ShortcutFFWD, 49 gui_ShortcutSaveState, 50 gui_ShortcutLoadState, 51 gui_ShortcutDebugStep, 52 gui_ShortcutDebugContinue, 53 gui_ShortcutDebugNextFrame, 54 gui_ShortcutDebugBreakpoint, 55 gui_ShortcutDebugRuntocursor, 56 gui_ShortcutDebugGoBack, 57 gui_ShortcutShowMainMenu 58}; 59 60EXTERN bool gui_in_use; 61EXTERN ImFont* gui_default_font; 62EXTERN ImFont* gui_roboto_font; 63 64EXTERN void gui_init(void); 65EXTERN void gui_destroy(void); 66EXTERN void gui_render(void); 67EXTERN void gui_shortcut(gui_ShortCutEvent event); 68EXTERN void gui_load_rom(const char* path); 69 70#undef GUI_IMPORT 71#undef EXTERN 72#endif /* GUI_H */