-
-
Notifications
You must be signed in to change notification settings - Fork 623
/
Copy pathrsvg.pkg
153 lines (122 loc) · 6.31 KB
/
rsvg.pkg
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
rsvg.h: SAX-based renderer for SVG files into a GdkPixbuf.
Copyright (C) 2000 Eazel, Inc.
This program 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 of the
License, or (at your option) any later version.
This program 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 program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Raph Levien <[email protected]>
rsvg-cairo.h: SAX-based renderer for SVG files using cairo
Copyright (C) 2005 Red Hat, Inc.
This program 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 of the
License, or (at your option) any later version.
This program 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 program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Carl Worth <[email protected]>
*/
$#include <glib.h>
$#include <librsvg/rsvg.h>
$#include "librsvg-helper.h"
typedef struct _RsvgHandle RsvgHandle;
typedef struct _RsvgHandleClass RsvgHandleClass;
/**
* RsvgDimensionData:
* @width: SVG's width, in pixels
* @height: SVG's height, in pixels
* @em: em
* @ex: ex
*/
typedef struct _RsvgDimensionData {
int width;
int height;
double em;
double ex;
static tolua_outside RsvgDimensionData* rsvg_dimension_data_create @ create();
static tolua_outside void rsvg_dimension_data_destroy @ destroy(RsvgDimensionData *);
tolua_outside void rsvg_dimension_data_get @ get(int * width, int * height,
double * em, double * ex);
tolua_outside void rsvg_dimension_data_set @ get(int width, int height,
double em, double ex);
} RsvgDimensionData;
/**
* RsvgRectangle:
* @x: X coordinate of the left side of the rectangle
* @y: Y coordinate of the the top side of the rectangle
* @width: width of the rectangle
* @height: height of the rectangle
*
* A data structure for holding a rectangle.
*
* Since: 2.46
*/
typedef struct _RsvgRectangle {
double x;
double y;
double width;
double height;
static tolua_outside RsvgRectangle* rsvg_rectangle_create @ create();
static tolua_outside void rsvg_rectangle_destroy @ destroy(RsvgRectangle *pointer);
tolua_outside void rsvg_rectangle_set @ set(double x, double y, double width, double height);
tolua_outside void rsvg_rectangle_get @ get(double *x, double *y, double *width, double *height);
} RsvgRectangle;
const char *rsvg_handle_get_base_uri (RsvgHandle * handle);
void rsvg_handle_set_base_uri (RsvgHandle * handle, const char *base_uri);
gboolean rsvg_handle_get_intrinsic_size_in_pixels (RsvgHandle *handle,
gdouble *out_width,
gdouble *out_height);
gboolean rsvg_handle_get_geometry_for_layer(RsvgHandle *handle,
const char *id,
const RsvgRectangle *viewport,
RsvgRectangle *out_ink_rect,
RsvgRectangle *out_logical_rect,
GError **error);
int rsvg_handle_has_sub (RsvgHandle * handle, const char *id);
RsvgHandle *rsvg_handle_new_with_flags (RsvgHandleFlags flags);
RsvgHandle *rsvg_handle_new_from_data (const unsigned char * data, unsigned long data_len, GError ** error);
RsvgHandle *rsvg_handle_new_from_file (const char * file_name, GError ** error);
gboolean rsvg_handle_render_document(RsvgHandle *handle,
cairo_t *cr,
const RsvgRectangle *viewport,
GError **error);
gboolean rsvg_handle_render_layer (RsvgHandle *handle,
cairo_t *cr,
const char *id,
const RsvgRectangle *viewport,
GError **error);
void g_object_unref(gpointer object);
RsvgHandle * rsvg_create_handle_from_file(const char *);
int rsvg_destroy_handle(RsvgHandle *);
RsvgHandle *rsvg_handle_new_with_flags (RsvgHandleFlags flags);
void rsvg_handle_set_base_gfile (RsvgHandle *handle,
GFile *base_file);
gboolean rsvg_handle_read_stream_sync (RsvgHandle *handle,
GInputStream *stream,
GCancellable *cancellable,
GError **error);
RsvgHandle *rsvg_handle_new_from_gfile_sync (GFile *file,
RsvgHandleFlags flags,
GCancellable *cancellable,
GError **error);
RsvgHandle *rsvg_handle_new_from_stream_sync (GInputStream *input_stream,
GFile *base_file,
RsvgHandleFlags flags,
GCancellable *cancellable,
GError **error);
RsvgHandle *rsvg_handle_new_from_data (const guint8 *data, gsize data_len, GError **error);
RsvgHandle *rsvg_handle_new_from_file (const gchar *filename, GError **error);