root/trunk/src/gtk/cairo-utils.h

Revision 918, 2.6 kB (checked in by takkaria, 6 months ago)

Use consistent newlines everywhere, and also set the svn:eol-style property to native on all text files.

  • Property svn:eol-style set to native
Line 
1 /*
2  * File: main-cairo.h
3  * Purpose: Cairo calls header for use in Angband ports
4  * (Currently for the Gtk port, but should be reusable.)
5  *
6  * Copyright (c) 2000-2007 Robert Ruehlmann, Shanoah Alkire
7  *
8  * This work is free software; you can redistribute it and/or modify it
9  * under the terms of either:
10  *
11  * a) the GNU General Public License as published by the Free Software
12  *    Foundation, version 2, or
13  *
14  * b) the "Angband licence":
15  *    This software may be copied and distributed for educational, research,
16  *    and not for profit purposes provided that this copyright and statement
17  *    are included in all such copies.  Other copyrights may also apply.
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 /* Set the current color */
51 extern void set_foreground_color(cairo_t *cr, byte a);
52
53 /* Set up a cairo rectangle easily */
54 extern void init_cairo_rect(cairo_rectangle_t *r, int x, int y, int w, int h);
55
56 /* Use it as a cairo rectangle */
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 /* INCLUDED_CAIRO_UTILS_H*/
Note: See TracBrowser for help on using the browser.