File: games-preimage.h

package info (click to toggle)
five-or-more 1:3.30.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,072 kB
  • sloc: ansic: 2,241; xml: 56; python: 10; sh: 7; makefile: 6
file content (89 lines) | stat: -rw-r--r-- 3,580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
  Copyright © 2004 Richard Hoelscher

  This library is free software; you can redistribute it and'or modify
  it under the terms of the GNU Library General Public License as published
  by the Free Software Foundation; either version 2, or (at your option)
  any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Library General Public License for more details.

  You should have received a copy of the GNU Library General Public License
  along with this library; if not, see <https://www.gnu.org/licenses/>.  */

/* Authors:   Richard Hoelscher <rah@rahga.com> */

/* Cache raster and vector images and render them to a specific size. */

#ifndef GAMES_PREIMAGE_H
#define GAMES_PREIMAGE_H

#include <glib.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

G_BEGIN_DECLS

#define GAMES_TYPE_PREIMAGE             (games_preimage_get_type ())
#define GAMES_PREIMAGE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GAMES_TYPE_PREIMAGE, GamesPreimage))
#define GAMES_PREIMAGE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PREIMAGE, GamesPreimageClass))
#define GAMES_IS_PREIMAGE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PREIMAGE))
#define GAMES_IS_PREIMAGE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PREIMAGE))
#define GAMES_GET_PREIMAGE_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PREIMAGE, GamesPreimageClass))

typedef struct _GamesPreimage GamesPreimage;

typedef struct {
  GObjectClass parent_class;
} GamesPreimageClass;

GType games_preimage_get_type (void);

GamesPreimage *games_preimage_new (void);

GamesPreimage *games_preimage_new_from_file (const gchar * filename,
                                             GError ** error);

void games_preimage_set_font_options (GamesPreimage * preimage,
                                      const cairo_font_options_t *font_options);

GdkPixbuf *games_preimage_render (GamesPreimage * preimage,
                                  gint width,
                                  gint height);
void games_preimage_render_cairo (GamesPreimage * preimage,
                                  cairo_t *cr,
                                  gint width,
                                  gint height);

GdkPixbuf *games_preimage_render_sub (GamesPreimage * preimage,
                                      const char *node,
                                      int width,
                                      int height,
                                      double xoffset,
                                      double yoffset,
                                      double xzoom, double yzoom);

void games_preimage_render_cairo_sub (GamesPreimage * preimage,
                                      cairo_t *cr,
                                      const char *node,
                                      int width,
                                      int height,
                                      double xoffset,
                                      double yoffset,
                                      double xzoom,
                                      double yzoom);

gboolean games_preimage_is_scalable (GamesPreimage * preimage);

gint games_preimage_get_width (GamesPreimage * preimage);

gint games_preimage_get_height (GamesPreimage * preimage);

GdkPixbuf *games_preimage_render_unscaled_pixbuf (GamesPreimage * preimage);

G_END_DECLS

#endif /* GAMES_PREIMAGE_H */