Replace auto-cut toggle with --cut bit flags (default 011), wire flags through C/Ruby APIs, and document the new cut/debug-dump behavior in both READMEs. Made-with: Cursor
41 lines
905 B
Ruby
41 lines
905 B
Ruby
# 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
|
||
USB_PID_PTP750W = 0x2062
|
||
USB_PID_PTP710BT = 0x20af
|
||
|
||
STATUS_LENGTH = 32
|
||
PNG_DEFAULT_THRESHOLD = 128
|
||
|
||
# libptouch_printer_family_t(C API と同じ値)
|
||
FAMILY_UNKNOWN = 0
|
||
FAMILY_P700 = 1
|
||
FAMILY_P900 = 2
|
||
|
||
RASTER_FLAG_AUTO_CUT = 0x01
|
||
RASTER_FLAG_HALF_CUT = 0x02
|
||
RASTER_FLAG_CHAIN_PRINT = 0x04
|
||
RASTER_FLAGS_DEFAULT = RASTER_FLAG_HALF_CUT | RASTER_FLAG_CHAIN_PRINT
|
||
end
|