poppler 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/poppler/rbpoppler-action.c +27 -23
- data/ext/poppler/rbpoppler-annotation.c +38 -271
- data/ext/poppler/rbpoppler-annotationcalloutline.c +130 -0
- data/ext/poppler/rbpoppler-annotationfreetext.c +47 -0
- data/ext/poppler/rbpoppler-annotationmapping.c +75 -0
- data/ext/poppler/rbpoppler-annotationmarkup.c +97 -0
- data/ext/poppler/rbpoppler-annotationtext.c +58 -0
- data/ext/poppler/rbpoppler-attachment.c +41 -31
- data/ext/poppler/rbpoppler-buttonfield.c +58 -0
- data/ext/poppler/rbpoppler-choicefield.c +133 -0
- data/ext/poppler/rbpoppler-color.c +122 -0
- data/ext/poppler/rbpoppler-document.c +74 -340
- data/ext/poppler/rbpoppler-fontinfo.c +66 -0
- data/ext/poppler/rbpoppler-fontsiter.c +130 -0
- data/ext/poppler/rbpoppler-form-field.c +43 -234
- data/ext/poppler/rbpoppler-formfieldmapping.c +47 -0
- data/ext/poppler/rbpoppler-imagemapping.c +55 -0
- data/ext/poppler/rbpoppler-indexiter.c +130 -0
- data/ext/poppler/rbpoppler-linkmapping.c +50 -0
- data/ext/poppler/rbpoppler-page.c +106 -454
- data/ext/poppler/rbpoppler-pagetransition.c +62 -0
- data/ext/poppler/rbpoppler-private.h +31 -6
- data/ext/poppler/rbpoppler-psfile.c +69 -0
- data/ext/poppler/rbpoppler-rectangle.c +94 -0
- data/ext/poppler/rbpoppler-textfield.c +93 -0
- data/ext/poppler/rbpoppler.c +74 -45
- data/ext/poppler/rbpoppler.h +22 -15
- data/ext/poppler/rbpopplerconversions.h +105 -0
- data/lib/1.8/poppler.so +0 -0
- data/lib/1.9/poppler.so +0 -0
- metadata +28 -10
- data/ChangeLog +0 -424
@@ -0,0 +1,62 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2006-2008 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbpoppler-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cPageTransition
|
25
|
+
|
26
|
+
DEF_ACCESSOR(page_trans, type, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONTYPE, POPPLERPAGETRANSITIONTYPE2RVAL)
|
27
|
+
DEF_ACCESSOR(page_trans, alignment, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONALIGNMENT, POPPLERPAGETRANSITIONALIGNMENT2RVAL)
|
28
|
+
DEF_ACCESSOR(page_trans, direction, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONDIRECTION, POPPLERPAGETRANSITIONDIRECTION2RVAL)
|
29
|
+
DEF_ACCESSOR(page_trans, duration, RVAL2POPPLERPAGETRANSITION, NUM2INT, INT2NUM)
|
30
|
+
DEF_ACCESSOR(page_trans, angle, RVAL2POPPLERPAGETRANSITION, NUM2INT, INT2NUM)
|
31
|
+
DEF_ACCESSOR(page_trans, scale, RVAL2POPPLERPAGETRANSITION, NUM2DBL, rb_float_new)
|
32
|
+
DEF_ACCESSOR(page_trans, rectangular, RVAL2POPPLERPAGETRANSITION, RVAL2CBOOL, CBOOL2RVAL)
|
33
|
+
|
34
|
+
void
|
35
|
+
Init_poppler_pagetransition(VALUE mPoppler)
|
36
|
+
{
|
37
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION,
|
38
|
+
"PageTransition", mPoppler);
|
39
|
+
|
40
|
+
rb_define_method(RG_TARGET_NAMESPACE, "type", page_trans_get_type, 0);
|
41
|
+
rb_define_method(RG_TARGET_NAMESPACE, "alignment", page_trans_get_alignment, 0);
|
42
|
+
rb_define_method(RG_TARGET_NAMESPACE, "direction", page_trans_get_direction, 0);
|
43
|
+
rb_define_method(RG_TARGET_NAMESPACE, "duration", page_trans_get_duration, 0);
|
44
|
+
rb_define_method(RG_TARGET_NAMESPACE, "angle", page_trans_get_angle, 0);
|
45
|
+
rb_define_method(RG_TARGET_NAMESPACE, "scale", page_trans_get_scale, 0);
|
46
|
+
rb_define_method(RG_TARGET_NAMESPACE, "rectangular",
|
47
|
+
page_trans_get_rectangular, 0);
|
48
|
+
|
49
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_type", page_trans_set_type, 1);
|
50
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_alignment",
|
51
|
+
page_trans_set_alignment, 1);
|
52
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_direction",
|
53
|
+
page_trans_set_direction, 1);
|
54
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_duration",
|
55
|
+
page_trans_set_duration, 1);
|
56
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_angle", page_trans_set_angle, 1);
|
57
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_scale", page_trans_set_scale, 1);
|
58
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_rectangular",
|
59
|
+
page_trans_set_rectangular, 1);
|
60
|
+
|
61
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
62
|
+
}
|
@@ -7,12 +7,37 @@
|
|
7
7
|
# include <rbgdk.h>
|
8
8
|
#endif
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
#define RVAL2GDKPIXBUF(o) (GDK_PIXBUF(RVAL2GOBJ(o)))
|
11
|
+
|
12
|
+
G_GNUC_INTERNAL void Init_poppler_indexiter(VALUE mPoppler);
|
13
|
+
G_GNUC_INTERNAL void Init_poppler_fontinfo(VALUE mPoppler);
|
14
|
+
G_GNUC_INTERNAL void Init_poppler_document(VALUE mPoppler);
|
15
|
+
G_GNUC_INTERNAL void Init_poppler_fontsiter(VALUE mPoppler);
|
16
|
+
G_GNUC_INTERNAL void Init_poppler_psfile(VALUE mPoppler);
|
17
|
+
G_GNUC_INTERNAL void Init_poppler_rectangle(VALUE mPoppler);
|
18
|
+
G_GNUC_INTERNAL void Init_poppler_page(VALUE mPoppler);
|
19
|
+
G_GNUC_INTERNAL void Init_poppler_color(VALUE mPoppler);
|
20
|
+
G_GNUC_INTERNAL void Init_poppler_linkmapping(VALUE mPoppler);
|
21
|
+
G_GNUC_INTERNAL void Init_poppler_pagetransition(VALUE mPoppler);
|
22
|
+
G_GNUC_INTERNAL void Init_poppler_imagemapping(VALUE mPoppler);
|
23
|
+
G_GNUC_INTERNAL void Init_poppler_formfieldmapping(VALUE mPoppler);
|
24
|
+
G_GNUC_INTERNAL void Init_poppler_annotationmapping(VALUE mPoppler);
|
25
|
+
G_GNUC_INTERNAL void Init_poppler_attachment(VALUE mPoppler);
|
26
|
+
G_GNUC_INTERNAL void Init_poppler_action(VALUE mPoppler);
|
27
|
+
G_GNUC_INTERNAL void Init_poppler_annotation(VALUE mPoppler);
|
28
|
+
G_GNUC_INTERNAL void Init_poppler_annotationmarkup(VALUE mPoppler);
|
29
|
+
G_GNUC_INTERNAL void Init_poppler_annotationtext(VALUE mPoppler);
|
30
|
+
G_GNUC_INTERNAL void Init_poppler_annotationfreetext(VALUE mPoppler);
|
31
|
+
G_GNUC_INTERNAL void Init_poppler_annotationcalloutline(VALUE mPoppler);
|
32
|
+
G_GNUC_INTERNAL void Init_poppler_form_field(VALUE mPoppler);
|
33
|
+
G_GNUC_INTERNAL void Init_poppler_button_field(VALUE mPoppler, VALUE cFormField);
|
34
|
+
G_GNUC_INTERNAL void Init_poppler_text_field(VALUE mPoppler, VALUE cFormField);
|
35
|
+
G_GNUC_INTERNAL void Init_poppler_choice_field(VALUE mPoppler, VALUE cFormField);
|
36
|
+
|
37
|
+
G_GNUC_INTERNAL void rectangle_set(PopplerRectangle *rect, VALUE rb_rect);
|
38
|
+
|
39
|
+
#define RECT_ENTITY2RVAL(rect) POPPLERRECTANGLE2RVAL(&(rect))
|
40
|
+
#define RECT_ENTITY_SET(rect, rb_rect) rectangle_set(&(rect), rb_rect)
|
16
41
|
|
17
42
|
#define DEF_READER(prefix, name, member, self_to_c, member_to_rb) \
|
18
43
|
static VALUE \
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2006 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbpoppler-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cPSFile
|
25
|
+
|
26
|
+
/* Export to ps */
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self, VALUE document, VALUE filename,
|
29
|
+
VALUE first_page, VALUE n_pages)
|
30
|
+
{
|
31
|
+
PopplerPSFile *ps_file;
|
32
|
+
|
33
|
+
ps_file = poppler_ps_file_new(RVAL2POPPLERDOCUMENT(document), RVAL2CSTR(filename),
|
34
|
+
NUM2INT(first_page), NUM2INT(n_pages));
|
35
|
+
|
36
|
+
if (!ps_file)
|
37
|
+
rb_raise(rb_eRuntimeError, "can't create Poppler::PSFile");
|
38
|
+
|
39
|
+
G_INITIALIZE(self, ps_file);
|
40
|
+
return Qnil;
|
41
|
+
}
|
42
|
+
|
43
|
+
static VALUE
|
44
|
+
rg_set_paper_size(VALUE self, VALUE width, VALUE height)
|
45
|
+
{
|
46
|
+
poppler_ps_file_set_paper_size(RVAL2POPPLERPSFILE(self),
|
47
|
+
NUM2DBL(width), NUM2DBL(height));
|
48
|
+
return Qnil;
|
49
|
+
}
|
50
|
+
|
51
|
+
static VALUE
|
52
|
+
rg_set_duplex(VALUE self, VALUE duplex)
|
53
|
+
{
|
54
|
+
poppler_ps_file_set_duplex(RVAL2POPPLERPSFILE(self), RVAL2CBOOL(duplex));
|
55
|
+
return Qnil;
|
56
|
+
}
|
57
|
+
|
58
|
+
void
|
59
|
+
Init_poppler_psfile(VALUE mPoppler)
|
60
|
+
{
|
61
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_PS_FILE, "PSFile", mPoppler);
|
62
|
+
|
63
|
+
/* Export to ps */
|
64
|
+
RG_DEF_METHOD(initialize, 4);
|
65
|
+
RG_DEF_METHOD(set_paper_size, 2);
|
66
|
+
RG_DEF_METHOD(set_duplex, 1);
|
67
|
+
|
68
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
69
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2006-2008 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbpoppler-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cRectangle
|
25
|
+
|
26
|
+
static VALUE RG_TARGET_NAMESPACE;
|
27
|
+
|
28
|
+
static VALUE
|
29
|
+
rg_initialize(VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2)
|
30
|
+
{
|
31
|
+
PopplerRectangle rectangle;
|
32
|
+
|
33
|
+
rectangle.x1 = NUM2DBL(x1);
|
34
|
+
rectangle.y1 = NUM2DBL(y1);
|
35
|
+
rectangle.x2 = NUM2DBL(x2);
|
36
|
+
rectangle.y2 = NUM2DBL(y2);
|
37
|
+
|
38
|
+
G_INITIALIZE(self, &rectangle);
|
39
|
+
return Qnil;
|
40
|
+
}
|
41
|
+
|
42
|
+
DEF_ACCESSOR(rectangle, x1, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL)
|
43
|
+
DEF_ACCESSOR(rectangle, y1, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL)
|
44
|
+
DEF_ACCESSOR(rectangle, x2, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL)
|
45
|
+
DEF_ACCESSOR(rectangle, y2, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL)
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_to_a(VALUE self)
|
49
|
+
{
|
50
|
+
PopplerRectangle *rectangle = RVAL2POPPLERRECTANGLE(self);
|
51
|
+
return rb_ary_new3(4,
|
52
|
+
rb_float_new(rectangle->x1),
|
53
|
+
rb_float_new(rectangle->y1),
|
54
|
+
rb_float_new(rectangle->x2),
|
55
|
+
rb_float_new(rectangle->y2));
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rg_inspect(VALUE self)
|
60
|
+
{
|
61
|
+
VALUE inspected;
|
62
|
+
gchar *points;
|
63
|
+
PopplerRectangle *rectangle;
|
64
|
+
|
65
|
+
rectangle = RVAL2POPPLERRECTANGLE(self);
|
66
|
+
inspected = rb_call_super(0, NULL);
|
67
|
+
rb_str_resize(inspected, RSTRING_LEN(inspected) - 1);
|
68
|
+
points = g_strdup_printf(": [%g, %g, %g, %g]>",
|
69
|
+
rectangle->x1, rectangle->y1,
|
70
|
+
rectangle->x2, rectangle->y2);
|
71
|
+
rb_str_cat2(inspected, points);
|
72
|
+
g_free(points);
|
73
|
+
return inspected;
|
74
|
+
}
|
75
|
+
|
76
|
+
void
|
77
|
+
Init_poppler_rectangle(VALUE mPoppler)
|
78
|
+
{
|
79
|
+
RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_RECTANGLE, "Rectangle", mPoppler);
|
80
|
+
|
81
|
+
RG_DEF_METHOD(initialize, 4);
|
82
|
+
rb_define_method(RG_TARGET_NAMESPACE, "x1", rectangle_get_x1, 0);
|
83
|
+
rb_define_method(RG_TARGET_NAMESPACE, "y1", rectangle_get_y1, 0);
|
84
|
+
rb_define_method(RG_TARGET_NAMESPACE, "x2", rectangle_get_x2, 0);
|
85
|
+
rb_define_method(RG_TARGET_NAMESPACE, "y2", rectangle_get_y2, 0);
|
86
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_x1", rectangle_set_x1, 1);
|
87
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_y1", rectangle_set_y1, 1);
|
88
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_x2", rectangle_set_x2, 1);
|
89
|
+
rb_define_method(RG_TARGET_NAMESPACE, "set_y2", rectangle_set_y2, 1);
|
90
|
+
RG_DEF_METHOD(to_a, 0);
|
91
|
+
RG_DEF_METHOD(inspect, 0);
|
92
|
+
|
93
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
94
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbpoppler-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cTextField
|
25
|
+
#define _SELF(obj) RVAL2POPPLERFORMFIELD(obj)
|
26
|
+
|
27
|
+
static VALUE RG_TARGET_NAMESPACE;
|
28
|
+
|
29
|
+
static VALUE
|
30
|
+
rg_type(VALUE self)
|
31
|
+
{
|
32
|
+
return POPPLERFORMTEXTTYPE2RVAL(poppler_form_field_text_get_text_type(_SELF(self)));
|
33
|
+
}
|
34
|
+
|
35
|
+
static VALUE
|
36
|
+
rg_text(VALUE self)
|
37
|
+
{
|
38
|
+
return CSTR2RVAL(poppler_form_field_text_get_text(_SELF(self)));
|
39
|
+
}
|
40
|
+
|
41
|
+
static VALUE
|
42
|
+
rg_set_text(VALUE self, VALUE text)
|
43
|
+
{
|
44
|
+
poppler_form_field_text_set_text(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text));
|
45
|
+
return Qnil;
|
46
|
+
}
|
47
|
+
|
48
|
+
static VALUE
|
49
|
+
rg_max_length(VALUE self)
|
50
|
+
{
|
51
|
+
return INT2NUM(poppler_form_field_text_get_max_len(_SELF(self)));
|
52
|
+
}
|
53
|
+
|
54
|
+
static VALUE
|
55
|
+
rg_spell_check_p(VALUE self)
|
56
|
+
{
|
57
|
+
return CBOOL2RVAL(poppler_form_field_text_do_spell_check(_SELF(self)));
|
58
|
+
}
|
59
|
+
|
60
|
+
static VALUE
|
61
|
+
rg_scroll_p(VALUE self)
|
62
|
+
{
|
63
|
+
return CBOOL2RVAL(poppler_form_field_text_do_scroll(_SELF(self)));
|
64
|
+
}
|
65
|
+
|
66
|
+
static VALUE
|
67
|
+
rg_rich_text_p(VALUE self)
|
68
|
+
{
|
69
|
+
return CBOOL2RVAL(poppler_form_field_text_is_rich_text(_SELF(self)));
|
70
|
+
}
|
71
|
+
|
72
|
+
static VALUE
|
73
|
+
rg_password_p(VALUE self)
|
74
|
+
{
|
75
|
+
return CBOOL2RVAL(poppler_form_field_text_is_password(_SELF(self)));
|
76
|
+
}
|
77
|
+
|
78
|
+
void
|
79
|
+
Init_poppler_text_field(VALUE mPoppler, VALUE cFormField)
|
80
|
+
{
|
81
|
+
RG_TARGET_NAMESPACE = rb_define_class_under(mPoppler, "TextField", cFormField);
|
82
|
+
|
83
|
+
RG_DEF_METHOD(type, 0);
|
84
|
+
RG_DEF_METHOD(text, 0);
|
85
|
+
RG_DEF_METHOD(set_text, 1);
|
86
|
+
RG_DEF_METHOD(max_length, 0);
|
87
|
+
RG_DEF_METHOD_P(spell_check, 0);
|
88
|
+
RG_DEF_METHOD_P(scroll, 0);
|
89
|
+
RG_DEF_METHOD_P(rich_text, 0);
|
90
|
+
RG_DEF_METHOD_P(password, 0);
|
91
|
+
|
92
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
93
|
+
}
|
data/ext/poppler/rbpoppler.c
CHANGED
@@ -1,28 +1,44 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2006-2008 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
3
21
|
|
4
|
-
|
5
|
-
|
6
|
-
Copyright (C) 2006-2008 Ruby-GNOME2 Project Team
|
22
|
+
#include "rbpoppler-private.h"
|
7
23
|
|
8
|
-
|
24
|
+
extern void Init_poppler(void);
|
9
25
|
|
10
|
-
#
|
26
|
+
#define RG_TARGET_NAMESPACE mPoppler
|
11
27
|
|
12
28
|
static VALUE
|
13
|
-
|
29
|
+
rg_m_backend(VALUE self)
|
14
30
|
{
|
15
|
-
return
|
31
|
+
return POPPLERBACKEND2RVAL(poppler_get_backend());
|
16
32
|
}
|
17
33
|
|
18
34
|
static VALUE
|
19
|
-
|
35
|
+
rg_m_version(VALUE self)
|
20
36
|
{
|
21
37
|
return CSTR2RVAL(poppler_get_version());
|
22
38
|
}
|
23
39
|
|
24
40
|
static VALUE
|
25
|
-
|
41
|
+
rg_m_cairo_available_p(VALUE self)
|
26
42
|
{
|
27
43
|
#ifdef RB_POPPLER_CAIRO_AVAILABLE
|
28
44
|
return Qtrue;
|
@@ -31,60 +47,73 @@ cairo_available(VALUE self)
|
|
31
47
|
#endif
|
32
48
|
}
|
33
49
|
|
34
|
-
|
35
50
|
void
|
36
51
|
Init_poppler(void)
|
37
52
|
{
|
38
|
-
VALUE
|
53
|
+
VALUE RG_TARGET_NAMESPACE;
|
39
54
|
|
40
|
-
|
55
|
+
RG_TARGET_NAMESPACE = rb_define_module("Poppler");
|
41
56
|
|
42
|
-
rb_define_const(
|
57
|
+
rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
|
43
58
|
rb_ary_new3(3,
|
44
59
|
INT2FIX(POPPLER_MAJOR_VERSION),
|
45
60
|
INT2FIX(POPPLER_MINOR_VERSION),
|
46
61
|
INT2FIX(POPPLER_MICRO_VERSION)));
|
47
62
|
|
48
|
-
G_DEF_CLASS(POPPLER_TYPE_ERROR, "Error",
|
49
|
-
G_DEF_CLASS(POPPLER_TYPE_ORIENTATION, "Orientation",
|
63
|
+
G_DEF_CLASS(POPPLER_TYPE_ERROR, "Error", RG_TARGET_NAMESPACE);
|
64
|
+
G_DEF_CLASS(POPPLER_TYPE_ORIENTATION, "Orientation", RG_TARGET_NAMESPACE);
|
50
65
|
|
51
66
|
G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_TYPE,
|
52
|
-
"PageTransitionType",
|
67
|
+
"PageTransitionType", RG_TARGET_NAMESPACE);
|
53
68
|
G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_ALIGNMENT,
|
54
|
-
"PageTransitionAlignment",
|
69
|
+
"PageTransitionAlignment", RG_TARGET_NAMESPACE);
|
55
70
|
G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_DIRECTION,
|
56
|
-
"PageTransitionDirection",
|
57
|
-
G_DEF_CLASS(POPPLER_TYPE_SELECTION_STYLE, "SelectionStyle",
|
58
|
-
G_DEF_CLASS(POPPLER_TYPE_FORM_BUTTON_TYPE, "FormButtonType",
|
59
|
-
G_DEF_CLASS(POPPLER_TYPE_FORM_TEXT_TYPE, "FormTextType",
|
60
|
-
G_DEF_CLASS(POPPLER_TYPE_FORM_CHOICE_TYPE, "FormChoiceType",
|
71
|
+
"PageTransitionDirection", RG_TARGET_NAMESPACE);
|
72
|
+
G_DEF_CLASS(POPPLER_TYPE_SELECTION_STYLE, "SelectionStyle", RG_TARGET_NAMESPACE);
|
73
|
+
G_DEF_CLASS(POPPLER_TYPE_FORM_BUTTON_TYPE, "FormButtonType", RG_TARGET_NAMESPACE);
|
74
|
+
G_DEF_CLASS(POPPLER_TYPE_FORM_TEXT_TYPE, "FormTextType", RG_TARGET_NAMESPACE);
|
75
|
+
G_DEF_CLASS(POPPLER_TYPE_FORM_CHOICE_TYPE, "FormChoiceType", RG_TARGET_NAMESPACE);
|
61
76
|
|
62
77
|
G_RENAME_NICK("3D", "TYPE_3D");
|
63
|
-
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TYPE, "AnnotationType",
|
64
|
-
G_DEF_CLASS(POPPLER_TYPE_ANNOT_FLAG, "AnnotationFlag",
|
78
|
+
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TYPE, "AnnotationType", RG_TARGET_NAMESPACE);
|
79
|
+
G_DEF_CLASS(POPPLER_TYPE_ANNOT_FLAG, "AnnotationFlag", RG_TARGET_NAMESPACE);
|
65
80
|
G_DEF_CLASS(POPPLER_TYPE_ANNOT_MARKUP_REPLY_TYPE,
|
66
|
-
|
81
|
+
"AnnotationMarkupReplyType", RG_TARGET_NAMESPACE);
|
67
82
|
G_RENAME_NICK("3D", "TYPE_3D");
|
68
83
|
G_DEF_CLASS(POPPLER_TYPE_ANNOT_EXTERNAL_DATA_TYPE,
|
69
|
-
|
84
|
+
"AnnotationExternalDataType", RG_TARGET_NAMESPACE);
|
70
85
|
# if !POPPLER_CHECK_VERSION(0, 9, 0)
|
71
|
-
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT_ICON, "AnnotationTextIcon",
|
86
|
+
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT_ICON, "AnnotationTextIcon", RG_TARGET_NAMESPACE);
|
72
87
|
# endif
|
73
|
-
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT_STATE, "AnnotationTextState",
|
88
|
+
G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT_STATE, "AnnotationTextState", RG_TARGET_NAMESPACE);
|
74
89
|
G_DEF_CLASS(POPPLER_TYPE_ANNOT_FREE_TEXT_QUADDING,
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
+
"AnnotationFreeTextQuadding", RG_TARGET_NAMESPACE);
|
91
|
+
|
92
|
+
G_DEF_CLASS(POPPLER_TYPE_BACKEND, "Backend", RG_TARGET_NAMESPACE);
|
93
|
+
|
94
|
+
RG_DEF_MODFUNC(backend, 0);
|
95
|
+
RG_DEF_MODFUNC(version, 0);
|
96
|
+
RG_DEF_MODFUNC_P(cairo_available, 0);
|
97
|
+
|
98
|
+
Init_poppler_indexiter(RG_TARGET_NAMESPACE);
|
99
|
+
Init_poppler_fontinfo(RG_TARGET_NAMESPACE);
|
100
|
+
Init_poppler_document(RG_TARGET_NAMESPACE);
|
101
|
+
Init_poppler_fontsiter(RG_TARGET_NAMESPACE);
|
102
|
+
Init_poppler_psfile(RG_TARGET_NAMESPACE);
|
103
|
+
Init_poppler_rectangle(RG_TARGET_NAMESPACE);
|
104
|
+
Init_poppler_page(RG_TARGET_NAMESPACE);
|
105
|
+
Init_poppler_color(RG_TARGET_NAMESPACE);
|
106
|
+
Init_poppler_linkmapping(RG_TARGET_NAMESPACE);
|
107
|
+
Init_poppler_pagetransition(RG_TARGET_NAMESPACE);
|
108
|
+
Init_poppler_imagemapping(RG_TARGET_NAMESPACE);
|
109
|
+
Init_poppler_formfieldmapping(RG_TARGET_NAMESPACE);
|
110
|
+
Init_poppler_annotationmapping(RG_TARGET_NAMESPACE);
|
111
|
+
Init_poppler_attachment(RG_TARGET_NAMESPACE);
|
112
|
+
Init_poppler_action(RG_TARGET_NAMESPACE);
|
113
|
+
Init_poppler_annotation(RG_TARGET_NAMESPACE);
|
114
|
+
Init_poppler_annotationmarkup(RG_TARGET_NAMESPACE);
|
115
|
+
Init_poppler_annotationtext(RG_TARGET_NAMESPACE);
|
116
|
+
Init_poppler_annotationfreetext(RG_TARGET_NAMESPACE);
|
117
|
+
Init_poppler_annotationcalloutline(RG_TARGET_NAMESPACE);
|
118
|
+
Init_poppler_form_field(RG_TARGET_NAMESPACE);
|
90
119
|
}
|