abstract class GPhoto2::CameraWidget::Base

Overview

Represents a widget.

Included Modules

Direct Known Subclasses

Defined in:

gphoto2/camera_widgets/base.cr
gphoto2/camera_widgets/button.cr
gphoto2/camera_widgets/date.cr
gphoto2/camera_widgets/menu.cr
gphoto2/camera_widgets/radio.cr
gphoto2/camera_widgets/range.cr
gphoto2/camera_widgets/section.cr
gphoto2/camera_widgets/text.cr
gphoto2/camera_widgets/toggle.cr
gphoto2/camera_widgets/window.cr

Constructors

Instance Method Summary

Instance methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraWidget)

ptr : Pointer(T) ptr, ptr? : Pointer(T) | Nil ptr?, to_unsafe : Pointer(T) to_unsafe, wrapped : T wrapped

Constructor methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraWidget)

new(ptr : Pointer(T) | Nil = nil) new

Constructor Detail

def self.new(ptr : Pointer(LibGPhoto2::CameraWidget), parent : GPhoto2::CameraWidget::Base | Nil = nil) #

[View source]

Instance Method Detail

def ==(other : self) #

Compares widget with another, based on #type, #name and #value.


[View source]
def ==(other : Symbol) #

Compares #value with given Symbol.

camera[:whitebalance] == :automatic

[View source]
def ==(other) #

Compares #value with given other using #to_s.

camera[:whitebalance] == "Automatic"
camera[:shutterspeed] == 0.5
camera[:iso] == 400

[View source]

Returns widget as Button, raises otherwise.


[View source]
def as_button? : GPhoto2::CameraWidget::Button | Nil #

Returns widget as Button, nil otherwise.


[View source]

Returns widget as Date, raises otherwise.


[View source]
def as_date? : GPhoto2::CameraWidget::Date | Nil #

Returns widget as Date, nil otherwise.


[View source]

Returns widget as Menu, raises otherwise.


[View source]
def as_menu? : GPhoto2::CameraWidget::Menu | Nil #

Returns widget as Menu, nil otherwise.


[View source]

Returns widget as Radio, raises otherwise.


[View source]
def as_radio? : GPhoto2::CameraWidget::Radio | Nil #

Returns widget as Radio, nil otherwise.


[View source]

Returns widget as Range, raises otherwise.


[View source]
def as_range? : GPhoto2::CameraWidget::Range | Nil #

Returns widget as Range, nil otherwise.


[View source]

Returns widget as Section, raises otherwise.


[View source]
def as_section? : GPhoto2::CameraWidget::Section | Nil #

Returns widget as Section, nil otherwise.


[View source]

Returns widget as Text, raises otherwise.


[View source]
def as_text? : GPhoto2::CameraWidget::Text | Nil #

Returns widget as Text, nil otherwise.


[View source]

Returns widget as Toggle, raises otherwise.


[View source]
def as_toggle? : GPhoto2::CameraWidget::Toggle | Nil #

Returns widget as Toggle, nil otherwise.


[View source]

Returns widget as Window, raises otherwise.


[View source]
def as_window? : GPhoto2::CameraWidget::Window | Nil #

Returns widget as Window, nil otherwise.


[View source]
def children : Array(Base) #

Returns widget children.


[View source]
def close : Nil #

Finalizes object by freeing allocated memory.


[View source]
def flatten(map = {} of String => Base) : Hash(String, Base) #

Returns flat structure of widget #children.


[View source]
def id : Int32 #

Returns widget numerical id.


[View source]
def in?(other : ::Range) #

Returns true if #value is included in the other ::Range.

camera[:exposurecompensation].in? -1.6..0.6
camera[:aperture].in? 4..7.1
camera[:iso].in? 100..400

[View source]
def in?(other : Enumerable) #

Returns true if #value matches at least one element of the collection.

camera[:autoexposuremode].in? %w(Manual Bulb)

[View source]
def info : String #

Returns widget info if set.


[View source]
def label : String #

Returns widget label.


[View source]
def name : String #

Returns widget name.


[View source]
def parent : Base | Nil #

Returns parent widget, nil otherwise.


[View source]
def readonly? : Bool #

Returns true if the widget has readonly flag set.


[View source]
def to_s(io : IO) #

Returns string representation of the widget #value.

puts camera[:whitebalance].to_s # => "Automatic"

[View source]
def type : Type #

Returns type of the widget.


[View source]
def value #

Returns widget value.


[View source]
def value=(value) #

Sets widget value.


[View source]
def value? #

Returns widget #value unless it's empty or is known to be an empty string, like none or raises NotImplementedError.


[View source]