| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
#include "angband.h" |
|---|
| 21 |
|
|---|
| 22 |
#ifndef INCLUDED_CAIRO_UTILS_H |
|---|
| 23 |
#define INCLUDED_CAIRO_UTILS_H |
|---|
| 24 |
|
|---|
| 25 |
#include "cairo.h" |
|---|
| 26 |
#include <gtk/gtk.h> |
|---|
| 27 |
|
|---|
| 28 |
typedef struct font_info font_info; |
|---|
| 29 |
typedef struct point point; |
|---|
| 30 |
typedef struct measurements measurements; |
|---|
| 31 |
struct font_info |
|---|
| 32 |
{ |
|---|
| 33 |
char name[256], family[256]; |
|---|
| 34 |
int w,h, descent, size; |
|---|
| 35 |
}; |
|---|
| 36 |
|
|---|
| 37 |
struct point |
|---|
| 38 |
{ |
|---|
| 39 |
int x,y; |
|---|
| 40 |
}; |
|---|
| 41 |
|
|---|
| 42 |
struct measurements |
|---|
| 43 |
{ |
|---|
| 44 |
int w,h; |
|---|
| 45 |
}; |
|---|
| 46 |
cairo_surface_t* graphical_tiles; |
|---|
| 47 |
cairo_pattern_t *tile_pattern; |
|---|
| 48 |
cairo_matrix_t matrix; |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
extern void set_foreground_color(cairo_t *cr, byte a); |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
extern void init_cairo_rect(cairo_rectangle_t *r, int x, int y, int w, int h); |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
extern void c_rect(cairo_t *cr, cairo_rectangle_t r); |
|---|
| 58 |
|
|---|
| 59 |
extern cairo_matrix_t cairo_font_scaling(cairo_surface_t *surface, double tile_w, double tile_h, double font_w, double font_h); |
|---|
| 60 |
extern void cairo_clear(cairo_surface_t *surface, cairo_rectangle_t r, byte c); |
|---|
| 61 |
extern void cairo_cursor(cairo_surface_t *surface, cairo_rectangle_t r, byte c); |
|---|
| 62 |
extern void draw_tile(cairo_t *cr, cairo_matrix_t m, cairo_rectangle_t r, int tx, int ty); |
|---|
| 63 |
extern void draw_tiles( |
|---|
| 64 |
cairo_surface_t *surface, int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp, |
|---|
| 65 |
font_info *font, measurements *actual, measurements *tile); |
|---|
| 66 |
extern void cairo_draw_from_surface(cairo_t *cr, cairo_surface_t *surface, cairo_rectangle_t r); |
|---|
| 67 |
extern void init_cairo(cairo_t *cr, cairo_surface_t *surface, measurements size); |
|---|
| 68 |
extern void get_font_size(font_info *font); |
|---|
| 69 |
extern void draw_text(cairo_surface_t *surface, font_info *font, measurements *actual, int x, int y, int n, byte a, cptr s); |
|---|
| 70 |
extern void drawn_progress_bar(cairo_surface_t *surface, font_info *font, int x, int y, float curr, float max, byte color, int size); |
|---|
| 71 |
|
|---|
| 72 |
extern void get_toy_font_size(font_info *font); |
|---|
| 73 |
extern void draw_toy_text(cairo_t *cr, font_info *font, measurements *actual, int x, int y, int n, byte a, cptr s); |
|---|
| 74 |
#endif |
|---|