juegos

Juegos de terminal de Pancho: Catan (TUI, GUI, web, servidor, PicoCalc), ajedrez, calculadora y minijuegos
git clone https://git.lu3dhn.xyz/juegos.git
Log | Files | Refs

frontend.h (781B)


      1 /* frontend.h - interfaz comun de la TUI (ncurses) y la GUI (SDL). */
      2 #ifndef FRONTEND_H
      3 #define FRONTEND_H
      4 
      5 #include "form.h"
      6 #include "../gfx/chess_gfx.h"
      7 
      8 typedef struct Frontend Frontend;
      9 struct Frontend {
     10     void (*draw_game)(Frontend *f, const View *v);
     11     void (*draw_form)(Frontend *f, const Form *form);
     12     /* Espera input o actividad en fds. 1 = hay evento en ev. */
     13     int  (*wait)(Frontend *f, int timeout_ms, const int *fds, int nfds, InEvent *ev);
     14     void (*close)(Frontend *f);
     15     /* texto pegado por el usuario (PGN, FEN); malloc o NULL */
     16     char *(*paste)(Frontend *f);
     17     bool     is_gui;
     18     HitList  hits;          /* zonas clickeables del ultimo dibujo (px o celdas) */
     19 };
     20 
     21 Frontend *tui_open(void);
     22 Frontend *gui_open(int layout, int scale);
     23 
     24 #endif