brst-binding-ruby 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +23 -0
  3. data/CMakeLists.txt +95 -0
  4. data/LICENSE +31 -0
  5. data/README.md +173 -0
  6. data/lib/brst/binding/ruby/asian.rb +46 -0
  7. data/lib/brst/binding/ruby/base.rb +50 -0
  8. data/lib/brst/binding/ruby/date.rb +42 -0
  9. data/lib/brst/binding/ruby/destination.rb +46 -0
  10. data/lib/brst/binding/ruby/doc_compression.rb +39 -0
  11. data/lib/brst/binding/ruby/doc_embedded_file.rb +39 -0
  12. data/lib/brst/binding/ruby/doc_encoder.rb +41 -0
  13. data/lib/brst/binding/ruby/doc_encoding_utf.rb +39 -0
  14. data/lib/brst/binding/ruby/doc_ext_gstate.rb +39 -0
  15. data/lib/brst/binding/ruby/doc_font.rb +43 -0
  16. data/lib/brst/binding/ruby/doc_image_jpeg.rb +40 -0
  17. data/lib/brst/binding/ruby/doc_image_png.rb +41 -0
  18. data/lib/brst/binding/ruby/doc_image_tiff.rb +41 -0
  19. data/lib/brst/binding/ruby/doc_info.rb +40 -0
  20. data/lib/brst/binding/ruby/doc_matrix.rb +46 -0
  21. data/lib/brst/binding/ruby/doc_output_intent.rb +40 -0
  22. data/lib/brst/binding/ruby/doc_page.rb +48 -0
  23. data/lib/brst/binding/ruby/doc_page_pattern.rb +46 -0
  24. data/lib/brst/binding/ruby/doc_pattern.rb +40 -0
  25. data/lib/brst/binding/ruby/doc_pdfa.rb +41 -0
  26. data/lib/brst/binding/ruby/doc_save.rb +40 -0
  27. data/lib/brst/binding/ruby/doc_security.rb +41 -0
  28. data/lib/brst/binding/ruby/doc_viewer.rb +41 -0
  29. data/lib/brst/binding/ruby/doc_xobject.rb +39 -0
  30. data/lib/brst/binding/ruby/error.rb +43 -0
  31. data/lib/brst/binding/ruby/ext_gstate.rb +41 -0
  32. data/lib/brst/binding/ruby/font.rb +40 -0
  33. data/lib/brst/binding/ruby/geometry.rb +93 -0
  34. data/lib/brst/binding/ruby/image.rb +45 -0
  35. data/lib/brst/binding/ruby/library.rb +46 -0
  36. data/lib/brst/binding/ruby/page_routines.rb +56 -0
  37. data/lib/brst/binding/ruby/page_sizes.rb +38 -0
  38. data/lib/brst/binding/ruby/page_xobject.rb +40 -0
  39. data/lib/brst/binding/ruby/stream_geometry.rb +81 -0
  40. data/lib/brst/binding/ruby/stream_text.rb +48 -0
  41. data/lib/brst/binding/ruby/text.rb +67 -0
  42. data/lib/brst/binding/ruby/types.rb +622 -0
  43. data/lib/brst/binding/ruby/unicode_glyph.rb +40 -0
  44. data/lib/brst/binding/ruby/version.rb +7 -0
  45. data/lib/brst/binding/ruby/xobject.rb +39 -0
  46. data/lib/brst/binding/ruby.rb +30 -0
  47. data/lib/brst-binding-ruby.rb +5 -0
  48. metadata +139 -0
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # AUTO-GENERATED by brst-binding-ruby's generator (generator/bin/brst-binding-ruby-gen).
4
+ # Source of truth: libBeresta gen/data/*.lsp (S-expression definitions).
5
+ # DO NOT EDIT BY HAND. Re-generate with `rake generate`.
6
+
7
+ require "ffi"
8
+ require_relative "library"
9
+ require_relative "types"
10
+
11
+ module Brst
12
+ module Binding
13
+ module Ruby
14
+ module UnicodeGlyph
15
+ extend FFI::Library
16
+ ffi_lib Brst::Binding::Ruby::Library.lib_path
17
+
18
+ Brst::Binding::Ruby::Types.apply(self)
19
+
20
+ MISSING_SYMBOLS = []
21
+
22
+ # Wraps `attach_function` so that captions whose actual C symbol
23
+ # is missing from the loaded libBeresta build (e.g. caption /
24
+ # symbol drift in upstream .lsp data, or features compiled
25
+ # out) — or whose declared parameter types reference a struct
26
+ # / enum the .lsp data never declared — don't break the entire
27
+ # gem load. Each miss is recorded in MISSING_SYMBOLS for
28
+ # diagnostic surfaces.
29
+ def self.safe_attach(name, args, ret)
30
+ attach_function(name, args, ret)
31
+ rescue FFI::NotFoundError, TypeError => e
32
+ MISSING_SYMBOLS << [name, e.message]
33
+ end
34
+
35
+ safe_attach :BRST_UnicodeToGlyphName, [:uint16], :string
36
+ safe_attach :BRST_GlyphNameToUnicode, [:string], :uint16
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,7 @@
1
+ module Brst
2
+ module Binding
3
+ module Ruby
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # AUTO-GENERATED by brst-binding-ruby's generator (generator/bin/brst-binding-ruby-gen).
4
+ # Source of truth: libBeresta gen/data/*.lsp (S-expression definitions).
5
+ # DO NOT EDIT BY HAND. Re-generate with `rake generate`.
6
+
7
+ require "ffi"
8
+ require_relative "library"
9
+ require_relative "types"
10
+
11
+ module Brst
12
+ module Binding
13
+ module Ruby
14
+ module Xobject
15
+ extend FFI::Library
16
+ ffi_lib Brst::Binding::Ruby::Library.lib_path
17
+
18
+ Brst::Binding::Ruby::Types.apply(self)
19
+
20
+ MISSING_SYMBOLS = []
21
+
22
+ # Wraps `attach_function` so that captions whose actual C symbol
23
+ # is missing from the loaded libBeresta build (e.g. caption /
24
+ # symbol drift in upstream .lsp data, or features compiled
25
+ # out) — or whose declared parameter types reference a struct
26
+ # / enum the .lsp data never declared — don't break the entire
27
+ # gem load. Each miss is recorded in MISSING_SYMBOLS for
28
+ # diagnostic surfaces.
29
+ def self.safe_attach(name, args, ret)
30
+ attach_function(name, args, ret)
31
+ rescue FFI::NotFoundError, TypeError => e
32
+ MISSING_SYMBOLS << [name, e.message]
33
+ end
34
+
35
+ safe_attach :BRST_XObject_Stream, [:XObject], :Stream
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ruby/version"
4
+ require_relative "ruby/library"
5
+ require_relative "ruby/types"
6
+
7
+ module Brst
8
+ module Binding
9
+ # Top-level entrypoint for brst-binding-ruby.
10
+ #
11
+ # Generated FFI modules live under Brst::Binding::Ruby::<File>, e.g.
12
+ # Brst::Binding::Ruby::Base.BRST_Doc_New(...)
13
+ # Brst::Binding::Ruby::DocSave.BRST_Doc_SaveToFile(pdf, "out.pdf")
14
+ #
15
+ # The naming follows libBeresta's gen/data/*.lsp file boundaries; this is a
16
+ # faithful low-level surface, not an idiomatic Ruby API. A higher-level
17
+ # wrapper gem is planned separately.
18
+ module Ruby
19
+ end
20
+ end
21
+ end
22
+
23
+ # Auto-load every generated FFI module. Order is irrelevant because every type
24
+ # (pointer/enum/struct/definition) is centralized in `types.rb`, which has
25
+ # already been loaded above.
26
+ Dir[File.expand_path("ruby/*.rb", __dir__)].sort.each do |f|
27
+ base = File.basename(f, ".rb")
28
+ next if %w[version library types].include?(base)
29
+ require f
30
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Convenience entrypoint that mirrors the gem name (brst-binding-ruby).
4
+ # The canonical require path is "brst/binding/ruby".
5
+ require "brst/binding/ruby"
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brst-binding-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kenta Ishizaki
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: ffi
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.16'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.16'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rspec
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.13'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.13'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rake
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '13.2'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '13.2'
54
+ description: |
55
+ Experimental Ruby FFI bindings for libBeresta, a free, cross-platform PDF
56
+ generation C library forked from libHaru. Bindings are auto-generated from
57
+ libBeresta's canonical S-expression definitions (gen/data/*.lsp). v0.1.0
58
+ exposes a faithful low-level surface; an idiomatic high-level API is planned
59
+ as a separate gem. Tested on macOS and Linux. libBeresta itself is not
60
+ bundled and must be installed separately. Part of the libBeresta org's
61
+ brst-binding-<lang> family.
62
+ email:
63
+ - kentaishizaki@55728.jp
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - CHANGELOG.md
69
+ - CMakeLists.txt
70
+ - LICENSE
71
+ - README.md
72
+ - lib/brst-binding-ruby.rb
73
+ - lib/brst/binding/ruby.rb
74
+ - lib/brst/binding/ruby/asian.rb
75
+ - lib/brst/binding/ruby/base.rb
76
+ - lib/brst/binding/ruby/date.rb
77
+ - lib/brst/binding/ruby/destination.rb
78
+ - lib/brst/binding/ruby/doc_compression.rb
79
+ - lib/brst/binding/ruby/doc_embedded_file.rb
80
+ - lib/brst/binding/ruby/doc_encoder.rb
81
+ - lib/brst/binding/ruby/doc_encoding_utf.rb
82
+ - lib/brst/binding/ruby/doc_ext_gstate.rb
83
+ - lib/brst/binding/ruby/doc_font.rb
84
+ - lib/brst/binding/ruby/doc_image_jpeg.rb
85
+ - lib/brst/binding/ruby/doc_image_png.rb
86
+ - lib/brst/binding/ruby/doc_image_tiff.rb
87
+ - lib/brst/binding/ruby/doc_info.rb
88
+ - lib/brst/binding/ruby/doc_matrix.rb
89
+ - lib/brst/binding/ruby/doc_output_intent.rb
90
+ - lib/brst/binding/ruby/doc_page.rb
91
+ - lib/brst/binding/ruby/doc_page_pattern.rb
92
+ - lib/brst/binding/ruby/doc_pattern.rb
93
+ - lib/brst/binding/ruby/doc_pdfa.rb
94
+ - lib/brst/binding/ruby/doc_save.rb
95
+ - lib/brst/binding/ruby/doc_security.rb
96
+ - lib/brst/binding/ruby/doc_viewer.rb
97
+ - lib/brst/binding/ruby/doc_xobject.rb
98
+ - lib/brst/binding/ruby/error.rb
99
+ - lib/brst/binding/ruby/ext_gstate.rb
100
+ - lib/brst/binding/ruby/font.rb
101
+ - lib/brst/binding/ruby/geometry.rb
102
+ - lib/brst/binding/ruby/image.rb
103
+ - lib/brst/binding/ruby/library.rb
104
+ - lib/brst/binding/ruby/page_routines.rb
105
+ - lib/brst/binding/ruby/page_sizes.rb
106
+ - lib/brst/binding/ruby/page_xobject.rb
107
+ - lib/brst/binding/ruby/stream_geometry.rb
108
+ - lib/brst/binding/ruby/stream_text.rb
109
+ - lib/brst/binding/ruby/text.rb
110
+ - lib/brst/binding/ruby/types.rb
111
+ - lib/brst/binding/ruby/unicode_glyph.rb
112
+ - lib/brst/binding/ruby/version.rb
113
+ - lib/brst/binding/ruby/xobject.rb
114
+ homepage: https://github.com/libBeresta/brst-binding-ruby
115
+ licenses:
116
+ - Zlib
117
+ metadata:
118
+ source_code_uri: https://github.com/libBeresta/brst-binding-ruby
119
+ bug_tracker_uri: https://github.com/libBeresta/brst-binding-ruby/issues
120
+ changelog_uri: https://github.com/libBeresta/brst-binding-ruby/blob/main/CHANGELOG.md
121
+ rubygems_mfa_required: 'true'
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: 3.1.0
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubygems_version: 4.0.6
137
+ specification_version: 4
138
+ summary: Low-level Ruby FFI bindings for libBeresta (PDF generation)
139
+ test_files: []