Ignore:
Timestamp:
Nov 25, 2007, 12:11:54 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Made the caca_event_t structure opaque and created a whole bunch of functions to access its real data. This is a big API change that will break your software, sorry :(
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca_internals.h

    r2043 r2049  
    2121
    2222typedef struct caca_timer caca_timer_t;
     23typedef struct caca_privevent caca_privevent_t;
    2324
    2425#if !defined(_DOXYGEN_SKIP_ME)
     
    9091};
    9192
     93/* Private event structure */
     94struct caca_privevent
     95{
     96    enum caca_event_type type;
     97
     98    union
     99    {
     100        struct { unsigned int x, y, button; } mouse;
     101        struct { unsigned int w, h; } resize;
     102        struct { unsigned int ch; unsigned long int utf32; char utf8[8]; } key;
     103    } data;
     104};
     105
    92106/* Internal caca display context */
    93107struct caca_display
     
    113127        void (* display) (caca_display_t *);
    114128        void (* handle_resize) (caca_display_t *);
    115         int (* get_event) (caca_display_t *, caca_event_t *);
     129        int (* get_event) (caca_display_t *, caca_privevent_t *);
    116130        void (* set_mouse) (caca_display_t *, int);
    117131        void (* set_cursor) (caca_display_t *, int);
     
    139153    {
    140154#if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL)
    141         caca_event_t buf[EVENTBUF_LEN];
     155        caca_privevent_t buf[EVENTBUF_LEN];
    142156        int queue;
    143157#endif
     
    146160        unsigned int last_key_ticks;
    147161        unsigned int autorepeat_ticks;
    148         caca_event_t last_key_event;
     162        caca_privevent_t last_key_event;
    149163#endif
    150164#if defined(USE_WIN32)
     
    161175extern void _caca_handle_resize(caca_display_t *);
    162176#if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL)
    163 extern void _push_event(caca_display_t *, caca_event_t *);
    164 extern int _pop_event(caca_display_t *, caca_event_t *);
     177extern void _push_event(caca_display_t *, caca_privevent_t *);
     178extern int _pop_event(caca_display_t *, caca_privevent_t *);
    165179#endif
    166180
Note: See TracChangeset for help on using the changeset viewer.