1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gui.h Mon Oct 14 13:02:19 2013 +0000
1.3 @@ -0,0 +1,68 @@
1.4 +/*
1.5 + * Ben NanoNote graphical user interface utilities.
1.6 + *
1.7 + * Copyright (C) 2013 Paul Boddie
1.8 + *
1.9 + * This program is free software; you can redistribute it and/or modify
1.10 + * it under the terms of the GNU General Public License as published by
1.11 + * the Free Software Foundation; either version 2 of the License, or
1.12 + * (at your option) any later version.
1.13 + */
1.14 +
1.15 +#ifndef __GUI_H__
1.16 +#define __GUI_H__
1.17 +
1.18 +#include "SDL.h"
1.19 +#include "SDL_gfxPrimitives.h"
1.20 +#include "ui.h"
1.21 +#include "geo.h"
1.22 +
1.23 +typedef struct
1.24 +{
1.25 + uint16_t x, y;
1.26 + uint8_t r, g, b, a;
1.27 +} gui_printer;
1.28 +
1.29 +/* Device properties. */
1.30 +
1.31 +#define SCREEN_WIDTH 320
1.32 +#define SCREEN_HEIGHT 240
1.33 +
1.34 +#define SCREEN_COLUMN_WIDTH 8
1.35 +#define SCREEN_ROW_HEIGHT 8
1.36 +
1.37 +#define GUI_BUFSIZE 256
1.38 +
1.39 +#define PROJECTION_FACTOR 320
1.40 +#define SKY_GRID_STEP 15
1.41 +
1.42 +/* Colours in RGBA format. */
1.43 +
1.44 +#define SKY_UPPER_COLOUR 0xff0000ff
1.45 +#define SKY_LOWER_COLOUR 0x0000ffff
1.46 +#define MOTION_REVERSE_COLOUR 0xff00ffff
1.47 +#define MOTION_FORWARD_COLOUR 0x00ff00ff
1.48 +
1.49 +/* Access functions. */
1.50 +
1.51 +void gui_init();
1.52 +void gui_display_init();
1.53 +void gui_shutdown(int signum);
1.54 +void gui_shutdown_threaded(int signum);
1.55 +void gui_quit();
1.56 +void gui_clear();
1.57 +void gui_fill(uint8_t r, uint8_t g, uint8_t b);
1.58 +void gui_next_row(gui_printer *printer, uint16_t rows);
1.59 +void gui_next_column(gui_printer *printer, uint16_t columns);
1.60 +int gui_printf(const char *format, ...);
1.61 +void gui_sky(vectorf *viewx, vectorf *viewy, vectorf *viewz);
1.62 +void gui_sky_vertical(vectorf *viewx, vectorf *viewy, vectorf *viewz, int direction, int elevation, int16_t x, int16_t y, uint32_t colour);
1.63 +void gui_motion(vectorf *viewx, vectorf *viewy, vectorf *viewz, vectorf *accelerationD);
1.64 +void gui_point(vectorf *viewx, vectorf *viewy, vectorf *viewz, vectorf *point, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
1.65 +void gui_origin(vectorf *viewx, vectorf *viewy, vectorf *viewz, vectorf *point);
1.66 +void gui_bar(vectorf *value);
1.67 +void gui_plot(uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
1.68 +void gui_flush();
1.69 +imu_ui_op gui_handle_events();
1.70 +
1.71 +#endif /* __GUI_H__ */