Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/brst/binding/ruby/asian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def self.safe_attach(name, args, ret)
MISSING_SYMBOLS << [name, e.message]
end

safe_attach :BRST_UseJPFonts, [:Doc], :uint32
safe_attach :BRST_UseKRFonts, [:Doc], :uint32
safe_attach :BRST_UseCNSFonts, [:Doc], :uint32
safe_attach :BRST_UseCNTFonts, [:Doc], :uint32
safe_attach :BRST_UseJPEncodings, [:Doc], :uint32
safe_attach :BRST_UseKREncodings, [:Doc], :uint32
safe_attach :BRST_UseCNSEncodings, [:Doc], :uint32
safe_attach :BRST_UseCNTEncodings, [:Doc], :uint32
safe_attach :BRST_Doc_UseJPFonts, [:Doc], :uint32
safe_attach :BRST_Doc_UseKRFonts, [:Doc], :uint32
safe_attach :BRST_Doc_UseCNSFonts, [:Doc], :uint32
safe_attach :BRST_Doc_UseCNTFonts, [:Doc], :uint32
safe_attach :BRST_Doc_UseJPEncodings, [:Doc], :uint32
safe_attach :BRST_Doc_UseKREncodings, [:Doc], :uint32
safe_attach :BRST_Doc_UseCNSEncodings, [:Doc], :uint32
safe_attach :BRST_Doc_UseCNTEncodings, [:Doc], :uint32
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/brst/binding/ruby/doc_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def self.safe_attach(name, args, ret)
safe_attach :BRST_Doc_Page_Current, [:Doc], :Page
safe_attach :BRST_Doc_Page_Add, [:Doc], :Page
safe_attach :BRST_Doc_Page_Insert, [:Doc, :Page], :Page
safe_attach :BRST_Doc_Page_AddLabel, [:Doc, :uint32, :PageNumStyle, :uint32, :string], :uint32
safe_attach :BRST_Doc_Page_AddLabel, [:Doc, :uint32, :PageNum, :uint32, :string], :uint32
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions lib/brst/binding/ruby/doc_xobject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def self.safe_attach(name, args, ret)
MISSING_SYMBOLS << [name, e.message]
end

safe_attach :BRST_Doc_XObject_CreateFromImage, [:Doc, :Rect, :Image, :int32], :XObject
safe_attach :BRST_Doc_XObject_CreateAsWhiteRect, [:Doc, :Rect], :XObject
safe_attach :BRST_Doc_XObject_Create, [:Doc, :float, :float, :float, :float], :XObject
end
end
Expand Down
45 changes: 45 additions & 0 deletions lib/brst/binding/ruby/image.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: true
#
# AUTO-GENERATED by brst-binding-ruby's generator (generator/bin/brst-binding-ruby-gen).
# Source of truth: libBeresta gen/data/*.lsp (S-expression definitions).
# DO NOT EDIT BY HAND. Re-generate with `rake generate`.

require "ffi"
require_relative "library"
require_relative "types"

module Brst
module Binding
module Ruby
module Image
extend FFI::Library
ffi_lib Brst::Binding::Ruby::Library.lib_path

Brst::Binding::Ruby::Types.apply(self)

MISSING_SYMBOLS = []

# Wraps `attach_function` so that captions whose actual C symbol
# is missing from the loaded libBeresta build (e.g. caption /
# symbol drift in upstream .lsp data, or features compiled
# out) — or whose declared parameter types reference a struct
# / enum the .lsp data never declared — don't break the entire
# gem load. Each miss is recorded in MISSING_SYMBOLS for
# diagnostic surfaces.
def self.safe_attach(name, args, ret)
attach_function(name, args, ret)
rescue FFI::NotFoundError, TypeError => e
MISSING_SYMBOLS << [name, e.message]
end

safe_attach :BRST_Image_AddSMask, [:Image, :Image], :uint32
safe_attach :BRST_Image_Width, [:Image], :uint32
safe_attach :BRST_Image_Height, [:Image], :uint32
safe_attach :BRST_Image_BitsPerComponent, [:Image], :uint32
safe_attach :BRST_Image_ColorSpace, [:Image], :string
safe_attach :BRST_Image_SetColorMask, [:Image, :uint32, :uint32, :uint32, :uint32, :uint32, :uint32], :uint32
safe_attach :BRST_Image_SetMaskImage, [:Image, :Image], :uint32
end
end
end
end
4 changes: 4 additions & 0 deletions lib/brst/binding/ruby/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def apply_pointers(mod)
mod.typedef :pointer, :Date
mod.typedef :pointer, :Dict
mod.typedef :pointer, :Doc
mod.typedef :pointer, :Encoder
mod.typedef :pointer, :Error
mod.typedef :pointer, :FontDef
mod.typedef :pointer, :Matrix
Expand Down Expand Up @@ -168,10 +169,13 @@ def apply_structs(mod)
def apply_definitions(mod)
mod.typedef :Dict, :Annotation
mod.typedef :Array, :Destination
mod.typedef :Dict, :EmbeddedFile
mod.typedef :Dict, :OutputIntent
mod.typedef :Dict, :PDFAType
mod.typedef :Dict, :ExData
mod.typedef :Dict, :ExtGState
mod.typedef :Dict, :Font
mod.typedef :Dict, :Image
mod.typedef :Dict, :JavaScript
mod.typedef :Dict, :Page
mod.typedef :Dict, :Pattern
Expand Down
Loading