#ifndef TEXT_H
#define TEXT_H

typedef struct text_s {
  char*(*source)(struct text_s* text, void* data) ;
  void* sourcedata ;
  void(**behaviours)(struct text_s* text, void* data) ;
  void** behaviourdata ;
  int n_behaviours ;
  void* opaquedata ;
} text_t ;

void behaviour_gl_color_white (text_t*,void*) ;
void behaviour_gl_color (text_t*,void*) ;
void behaviour_gl_position (text_t*,void*) ;
void behaviour_gl_display (text_t*,void*) ;
void behaviour_gl_font (text_t*, void*) ;
void behaviour_gl_fadeinout (text_t*, void*) ;

#define TEXT_GL_TOPLEFT      ((void*)1)
#define TEXT_GL_TOPCENTER    ((void*)2)
#define TEXT_GL_TOPRIGHT     ((void*)3)
#define TEXT_GL_BOTTOMLEFT   ((void*)4)
#define TEXT_GL_BOTTOMCENTER ((void*)5)
#define TEXT_GL_BOTTOMRIGHT  ((void*)6)
#define TEXT_GL_CENTER       ((void*)7)

void text_display (text_t* text) ;

#endif
