bradgrantham-apple2e/interface.h
Brad Grantham 96835e2400 Add drag-and-drop floppies, fix cold-start
On cold-start, force Button0/OpenApple on for a short period
    This is how cold-start (disk boot) is differentiated from plain RESET
Add padding widget that pads another widget on all sides
Add drag-and-drop functionality to widgets and manage through GLFW
Honor current time through all widget methods
Fix character encoding in text_widget (especially for ' ')
Add floppy_icon widget that manages drag-and-drop and drive motor (activity) light
    Later move to vector graphic or bitmap
Add floppy eject and insert notification from APPLE2Einterface
Add activity notification through APPLE2Einterface
Optimize with -O2
2016-12-02 10:42:22 -08:00

58 lines
1.3 KiB
C++

#include <tuple>
namespace APPLE2Einterface
{
enum EventType {NONE, KEYDOWN, KEYUP, RESET, REBOOT, PASTE, SPEED, QUIT, PAUSE, EJECT_FLOPPY, INSERT_FLOPPY};
const int LEFT_SHIFT = 340;
const int LEFT_CONTROL = 341;
const int LEFT_ALT = 342;
const int LEFT_SUPER = 343;
const int RIGHT_SHIFT = 344;
const int RIGHT_CONTROL = 345;
const int RIGHT_ALT = 346;
const int RIGHT_SUPER = 347;
const int ESCAPE = 256;
const int ENTER = 257;
const int TAB = 258;
const int BACKSPACE = 259;
const int INSERT = 260;
const int DELETE = 261;
const int RIGHT = 262;
const int LEFT = 263;
const int DOWN = 264;
const int UP = 265;
const int PAGE_UP = 266;
const int PAGE_DOWN = 267;
const int HOME = 268;
const int END = 269;
const int CAPS_LOCK = 280;
struct event {
EventType type;
int value;
char *str;
event(EventType type_, int value_, char *str_ = NULL) :
type(type_),
value(value_),
str(str_)
{}
};
void start(bool run_fast, bool add_floppies, bool floppy0_inserted, bool floppy1_inserted);
void iterate(); // display
void shutdown();
bool event_waiting();
event dequeue_event();
enum DisplayMode {TEXT, LORES, HIRES};
void set_switches(DisplayMode mode, bool mixed, int page);
bool write(int addr, unsigned char data);
std::tuple<float,bool> get_paddle(int num);
void show_floppy_activity(int number, bool activity);
};