ruby binding 追加

- FFI gem (libptouch)、exe ptouch-print-png(PNG のみ)
- ステータス 32 バイトを Hash に展開(parse_status / status_hash)
- CMake: libptouch 共有ライブラリ(ptouch_shared)
- RuboCop、gemspec(homepage / source_code_uri)

Made-with: Cursor
This commit is contained in:
knb
2026-04-12 16:06:10 +09:00
parent d649b1b014
commit c5c7c2ba52
16 changed files with 889 additions and 0 deletions

28
ruby/lib/libptouch.rb Normal file
View File

@@ -0,0 +1,28 @@
# frozen_string_literal: true
# Ruby FFI bindings for libptouch (Brother P-touch raster printing).
#
# Author: knb
# Email: knb@artif.org
require_relative "libptouch/version"
require_relative "libptouch/error"
require_relative "libptouch/binding"
require_relative "libptouch/status_hash"
require_relative "libptouch/context"
module Libptouch
ERR_NOMEM = 1
ERR_ARG = 2
ERR_USB = 3
ERR_IO = 4
ERR_UNSUPPORTED = 5
ERR_NOT_FOUND = 6
ERR_IMAGE = 7
USB_VID_BROTHER = 0x04f9
USB_PID_PTP900W = 0x2085
STATUS_LENGTH = 32
PNG_DEFAULT_THRESHOLD = 128
end