Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Events/Event.h

Committer:
duncanFrance
Date:
2016-03-25
Revision:
0:0a590815d51c
Child:
12:63db16fea709

File content as of revision 0:0a590815d51c:

#ifndef SIMPLEGUI_EVENT_H
#define SIMPLEGUI_EVENT_H

#include "mbed.h"


typedef struct Event {

    // It would be nice to use e.g. classes to represent events. But getting class information
    // out of a C++ class at runtime takes gymnastics which I can't be bothered with
    // Instead it's up to YOU the user of this library to ensure that your event types
    // are drawn from a central list so that they can be properly distinguished. Sorry.
    uint8_t type;
    // This should probably be some kind of union to cope with the different kinds of event we expect to handle
    // For now I'm going to explicitly assume events relate to something on-screen
    int screenX;
    int screenY;
    
} Event;

#endif