summaryrefslogtreecommitdiff
path: root/dev-python/python-poppler/files/python-poppler-0.12.1-76_75.diff
blob: 94f4543e87ec5f672321d30e5208a1260570049b (plain)
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
--- poppler.override
+++ poppler.override
@@ -600,3 +600,62 @@
     return PycairoSurface_FromSurface(surface, NULL, NULL);
 #endif
 }
+%%
+override poppler_page_render_to_pixbuf kwargs
+static PyObject *
+_wrap_poppler_page_render_to_pixbuf(PyGObject *self,
+                                    PyObject *args,
+                                    PyObject *kwargs)
+{
+    static char *kwlist[] = { "src_x", "src_y", "src_width",
+                              "src_height", "scale", "rotation", NULL };
+    int src_x, src_y, src_width, src_height, rotation;
+    double scale;
+    GdkPixbuf *pixbuf = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "iiiidi:Poppler.Page.render_to_pixbuf",
+                                     kwlist, &src_x, &src_y, &src_width,
+                                     &src_height, &scale, &rotation))
+        return NULL;
+
+    pyg_begin_allow_threads;
+
+    poppler_page_render_to_pixbuf(POPPLER_PAGE(self->obj), src_x, src_y,
+                                  src_width, src_height, scale,
+                                  rotation, pixbuf);
+
+    pyg_end_allow_threads;
+
+    return pygobject_new((GObject *)pixbuf);
+}
+%%
+override poppler_page_render_to_pixbuf_for_printing kwargs
+static PyObject *
+_wrap_poppler_page_render_to_pixbuf_for_printing(PyGObject *self,
+                                                 PyObject *args,
+                                                 PyObject *kwargs)
+{
+    static char *kwlist[] = { "src_x", "src_y", "src_width",
+                              "src_height", "scale", "rotation", NULL };
+    int src_x, src_y, src_width, src_height, rotation;
+    double scale;
+    GdkPixbuf *pixbuf = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "iiiidi:Poppler.Page.render_to_pixbuf_for_printing",
+                                     kwlist, &src_x, &src_y, &src_width,
+                                     &src_height, &scale, &rotation))
+        return NULL;
+
+    pyg_begin_allow_threads;
+
+    poppler_page_render_to_pixbuf_for_printing(POPPLER_PAGE(self->obj),
+                                               src_x, src_y, src_width,
+                                               src_height, scale,
+                                               rotation, pixbuf);
+
+    pyg_end_allow_threads;
+
+    return pygobject_new((GObject *)pixbuf);
+}