Module: Cups
- Extended by:
- FFI::Library
- Defined in:
- lib/ffi-cups/ffi/cups.rb,
lib/ffi-cups.rb,
lib/ffi-cups/job.rb,
lib/ffi-cups/printer.rb,
lib/ffi-cups/version.rb,
lib/ffi-cups/ffi/http.rb,
lib/ffi-cups/constants.rb,
lib/ffi-cups/ffi/array.rb,
lib/ffi-cups/connection.rb
Overview
cups.h Programming Manual cups.h source
Defined Under Namespace
Modules: Array, Enum, Http, Struct Classes: Connection, Job, Printer
Constant Summary collapse
- VERSION =
"0.3.2"
- FORMAT_JPEG =
cups.h
"image/jpeg"
- FORMAT_PDF =
"application/pdf"
- FORMAT_TEXT =
"text/plain"
- JOBID_ALL =
-1
- WHICHJOBS_ALL =
-1
- WHICHJOBS_ACTIVE =
0
- WHICHJOBS_COMPLETED =
1
- HTTP_DEFAULT =
nil
- COPIES =
Options and Values
"copies"
- COPIES_SUPPORTED =
"copies-supported"
- FINISHINGS =
"CUPS_FINISHINGS"
- FINISHINGS_SUPPORTED =
"finishings-supported"
- FINISHINGS_BIND =
"7"
- FINISHINGS_COVER =
"6"
- FINISHINGS_FOLD =
"10"
- FINISHINGS_NONE =
"3"
- FINISHINGS_PUNCH =
"5"
- FINISHINGS_STAPLE =
"4"
- FINISHINGS_TRIM =
"11"
- MEDIA =
MEDIA
"media"
- MEDIA_READY =
"media-ready"
- MEDIA_SUPPORTED =
"media-supported"
- MEDIA_3X5 =
"na_index-3x5_3x5in"
- MEDIA_4X6 =
"na_index-4x6_4x6in"
- MEDIA_5X7 =
"na_5x7_5x7in"
- MEDIA_8X10 =
"na_govt-letter_8x10in"
- MEDIA_A3 =
"iso_a3_297x420mm"
- MEDIA_A4 =
"iso_a4_210x297mm"
- MEDIA_A5 =
"iso_a5_148x210mm"
- MEDIA_A6 =
"iso_a6_105x148mm"
- MEDIA_ENV10 =
"na_number-10_4.125x9.5in"
- MEDIA_ENVDL =
"iso_dl_110x220mm"
- MEDIA_LEGAL =
"na_legal_8.5x14in"
- MEDIA_LETTER =
"na_letter_8.5x11in"
- MEDIA_PHOTO_L =
"oe_photo-l_3.5x5in"
- MEDIA_SUPERBA3 =
"na_super-b_13x19in"
- MEDIA_TABLOID =
"na_ledger_11x17in"
- MEDIA_SOURCE =
"media-source"
- MEDIA_SOURCE_SUPPORTED =
"media-source-supported"
- MEDIA_SOURCE_AUTO =
"auto"
- MEDIA_SOURCE_MANUAL =
"manual"
- MEDIA_TYPE =
"media-type"
- MEDIA_TYPE_SUPPORTED =
"media-type-supported"
- MEDIA_TYPE_AUTO =
"auto"
- MEDIA_TYPE_ENVELOPE =
"envelope"
- MEDIA_TYPE_LABELS =
"labels"
- MEDIA_TYPE_LETTERHEAD =
"stationery-letterhead"
- MEDIA_TYPE_PHOTO =
"photographic"
- MEDIA_TYPE_PHOTO_GLOSSY =
"photographic-glossy"
- MEDIA_TYPE_PHOTO_MATTE =
"photographic-matte"
- MEDIA_TYPE_PLAIN =
"stationery"
- MEDIA_TYPE_TRANSPARENCY =
"transparency"
- NUMBER_UP =
"number-up"
- NUMBER_UP_SUPPORTED =
"number-up-supported"
- ORIENTATION =
"orientation-requested"
- ORIENTATION_SUPPORTED =
"orientation-requested-supported"
- ORIENTATION_PORTRAIT =
"3"
- ORIENTATION_LANDSCAPE =
"4"
- PRINT_COLOR_MODE =
"print-color-mode"
- PRINT_COLOR_MODE_SUPPORTED =
"print-color-mode-supported"
- PRINT_COLOR_MODE_AUTO =
"auto"
- PRINT_COLOR_MODE_MONOCHROME =
"monochrome"
- PRINT_COLOR_MODE_COLOR =
"color"
- PRINT_QUALITY =
"print-quality"
- PRINT_QUALITY_SUPPORTED =
"print-quality-supported"
- PRINT_QUALITY_DRAFT =
"3"
- PRINT_QUALITY_NORMAL =
"4"
- PRINT_QUALITY_HIGH =
"5"
- SIDES =
"sides"
- SIDES_SUPPORTED =
"sides-supported"
- SIDES_ONE_SIDED =
"one-sided"
- SIDES_TWO_SIDED_PORTRAIT =
"two-sided-long-edge"
- SIDES_TWO_SIDED_LANDSCAPE =
"two-sided-short-edge"
Class Method Summary collapse
-
.libcups ⇒ Object
Custom or default path for libcups.so.
Instance Method Summary collapse
-
#cupsAddOption(string, string, int, pointer) ⇒ Integer
Add an option to an option array.
-
#cupsCancelDestJob(string, int) ⇒ Integer
Cancel a job on a destination.
-
#cupsCancelJob(string, int) ⇒ Integer
Cancel a job on a destination name.
-
#cupsCancelJob2(pointer, string, int) ⇒ Enum
Cancel a job on a destination.
-
#cupsCheckDestSupported(pointer, pointer, pointer, string, string) ⇒ Integer
Check that the option and value are supported by the destination.
-
#cupsCopyDestInfo(pointer, pointer) ⇒ Pointer
Get the supported values/capabilities for the destination.
-
#cupsCreateJob(pointer, string, string, int, pointer) ⇒ Integer
Create a job on a destination.
-
#cupsEncryption ⇒ Integer
Get the current encryption settings.
- #cupsFinishDocument(pointer, string) ⇒ Cups::Enum::IPP::Status
-
#cupsFreeDests(int, pointer) ⇒ Object
Free the memory used by the list of destinations.
-
#cupsFreeJobs(int, pointer) ⇒ Object
Free memory used by job data.
-
#cupsFreeOptions(int, pointer) ⇒ Object
Free all memory used by options.
-
#cupsGetDest(string, string, int, pointer) ⇒ Pointer, NULL
Get the named destination from the list.
-
#cupsGetDests2(pointer, pointer) ⇒ Integer
Get the list of destinations from the specified server.
-
#cupsGetJobs(pointer, string, int, int) ⇒ Integer
Get the jobs.
-
#cupsGetJobs2(pointer, pointer, string, int, int) ⇒ Integer
Get the jobs from a connection https://www.cups.org/doc/cupspm.html#cupsGetJobs2.
-
#cupsLastErrorString ⇒ String
Returns the last error in string format.
-
#cupsPrintFile(string, string, string, int, pointer) ⇒ Integer
Prints a File.
-
#cupsPrintFile2(pointer, string, string, string, int, pointer) ⇒ Integer
Prints a file from a specific connection.
-
#cupsStartDocument(pointer, string, int, string, string, int) ⇒ Cups::Enum::HTTP::Status
Start a document https://www.cups.org/doc/cupspm.html#submitting-a-print-job.
- #cupsWriteRequestData(pointer, pointer, bytesize) ⇒ Cups::Enum::HTTP::Status
Class Method Details
.libcups ⇒ Object
Custom or default path for libcups.so
6 7 8 9 10 11 12 |
# File 'lib/ffi-cups.rb', line 6 def self.libcups if ENV['CUPS_LIB'] ENV['CUPS_LIB'] else 'cups' end end |
Instance Method Details
#cupsAddOption(string, string, int, pointer) ⇒ Integer
Add an option to an option array. https://www.cups.org/doc/cupspm.html#cupsAddOption
179 |
# File 'lib/ffi-cups/ffi/cups.rb', line 179 attach_function 'cupsAddOption', [:string, :string, :int, :pointer], :int, blocking: true |
#cupsCancelDestJob(string, int) ⇒ Integer
Cancel a job on a destination. https://www.cups.org/doc/cupspm.html#cupsCancelDestJob
91 |
# File 'lib/ffi-cups/ffi/cups.rb', line 91 attach_function 'cupsCancelDestJob', [:string, :int], :void, blocking: true |
#cupsCancelJob(string, int) ⇒ Integer
Cancel a job on a destination name
98 |
# File 'lib/ffi-cups/ffi/cups.rb', line 98 attach_function 'cupsCancelJob', [:string, :int], :int, blocking: true |
#cupsCancelJob2(pointer, string, int) ⇒ Enum
Cancel a job on a destination
107 |
# File 'lib/ffi-cups/ffi/cups.rb', line 107 attach_function 'cupsCancelJob2', [:pointer, :string, :int, :int], Cups::Enum::IPP::Status, blocking: true |
#cupsCheckDestSupported(pointer, pointer, pointer, string, string) ⇒ Integer
Check that the option and value are supported by the destination. https://www.cups.org/doc/cupspm.html#cupsCheckDestSupported
24 |
# File 'lib/ffi-cups/ffi/cups.rb', line 24 attach_function 'cupsCheckDestSupported', [:pointer, :pointer, :pointer, :string, :string], :int, blocking: true |
#cupsCopyDestInfo(pointer, pointer) ⇒ Pointer
Get the supported values/capabilities for the destination. https://www.cups.org/doc/cupspm.html#cupsCopyDestInfo
32 |
# File 'lib/ffi-cups/ffi/cups.rb', line 32 attach_function 'cupsCopyDestInfo', [:pointer, :pointer], :pointer, blocking: true |
#cupsCreateJob(pointer, string, string, int, pointer) ⇒ Integer
Create a job on a destination.
144 |
# File 'lib/ffi-cups/ffi/cups.rb', line 144 attach_function 'cupsCreateJob', [:pointer, :string, :string, :int, :pointer], :int, blocking: true |
#cupsEncryption ⇒ Integer
Get the current encryption settings. https://www.cups.org/doc/cupspm.html#cupsEncryption
13 |
# File 'lib/ffi-cups/ffi/cups.rb', line 13 attach_function 'cupsEncryption', [], :int, blocking: true |
#cupsFinishDocument(pointer, string) ⇒ Cups::Enum::IPP::Status
169 |
# File 'lib/ffi-cups/ffi/cups.rb', line 169 attach_function 'cupsFinishDocument', [:pointer, :string], Cups::Enum::IPP::Status, blocking: true |
#cupsFreeDests(int, pointer) ⇒ Object
Free the memory used by the list of destinations. https://www.cups.org/doc/cupspm.html#cupsFreeDests
57 |
# File 'lib/ffi-cups/ffi/cups.rb', line 57 attach_function 'cupsFreeDests', [:int, :pointer], :void, blocking: true |
#cupsFreeJobs(int, pointer) ⇒ Object
Free memory used by job data. https://www.cups.org/doc/cupspm.html#cupsFreeJobs
134 |
# File 'lib/ffi-cups/ffi/cups.rb', line 134 attach_function 'cupsFreeJobs', [:int, :pointer ], :void, blocking: true |
#cupsFreeOptions(int, pointer) ⇒ Object
Free all memory used by options. https://www.cups.org/doc/cupspm.html#cupsFreeOptions
186 |
# File 'lib/ffi-cups/ffi/cups.rb', line 186 attach_function 'cupsFreeOptions', [:int, :pointer], :void, blocking: true |
#cupsGetDest(string, string, int, pointer) ⇒ Pointer, NULL
Get the named destination from the list. https://www.cups.org/doc/cupspm.html#cupsGetDest
42 |
# File 'lib/ffi-cups/ffi/cups.rb', line 42 attach_function 'cupsGetDest', [:string, :string, :int, :pointer], :pointer, blocking: true |
#cupsGetDests2(pointer, pointer) ⇒ Integer
Get the list of destinations from the specified server. https://www.cups.org/doc/cupspm.html#cupsGetDests2
50 |
# File 'lib/ffi-cups/ffi/cups.rb', line 50 attach_function 'cupsGetDests2', [:pointer, :pointer], :int, blocking: true |
#cupsGetJobs(pointer, string, int, int) ⇒ Integer
Get the jobs
127 |
# File 'lib/ffi-cups/ffi/cups.rb', line 127 attach_function 'cupsGetJobs', [:pointer, :string, :int, :int], :int, blocking: true |
#cupsGetJobs2(pointer, pointer, string, int, int) ⇒ Integer
Get the jobs from a connection https://www.cups.org/doc/cupspm.html#cupsGetJobs2
118 |
# File 'lib/ffi-cups/ffi/cups.rb', line 118 attach_function 'cupsGetJobs2', [:pointer, :pointer, :string, :int, :int], :int, blocking: true |
#cupsLastErrorString ⇒ String
Returns the last error in string format
82 |
# File 'lib/ffi-cups/ffi/cups.rb', line 82 attach_function 'cupsLastErrorString', [], :string, blocking: true |
#cupsPrintFile(string, string, string, int, pointer) ⇒ Integer
Prints a File
67 |
# File 'lib/ffi-cups/ffi/cups.rb', line 67 attach_function 'cupsPrintFile', [ :string, :string, :string, :int, :pointer ], :int, blocking: true |
#cupsPrintFile2(pointer, string, string, string, int, pointer) ⇒ Integer
Prints a file from a specific connection
78 |
# File 'lib/ffi-cups/ffi/cups.rb', line 78 attach_function 'cupsPrintFile2', [ :pointer, :string, :string, :string, :int, :pointer ], :int, blocking: true |
#cupsStartDocument(pointer, string, int, string, string, int) ⇒ Cups::Enum::HTTP::Status
Start a document https://www.cups.org/doc/cupspm.html#submitting-a-print-job
156 |
# File 'lib/ffi-cups/ffi/cups.rb', line 156 attach_function 'cupsStartDocument', [:pointer, :string, :int, :string, :string, :int], Cups::Enum::HTTP::Status, blocking: true |
#cupsWriteRequestData(pointer, pointer, bytesize) ⇒ Cups::Enum::HTTP::Status
163 |
# File 'lib/ffi-cups/ffi/cups.rb', line 163 attach_function 'cupsWriteRequestData', [:pointer, :pointer, :size_t], Cups::Enum::HTTP::Status, blocking: true |