Class: GPhoto2::CameraWidget
Abstract
- Inherits:
-
Object
- Object
- GPhoto2::CameraWidget
show all
- Includes:
- FFI::GPhoto2, Struct
- Defined in:
- lib/gphoto2/camera_widgets/camera_widget.rb
Overview
Constant Summary
FFI::GPhoto2::CameraCaptureType, FFI::GPhoto2::CameraDriverStatus, FFI::GPhoto2::CameraEventType, FFI::GPhoto2::CameraFileAccessType, FFI::GPhoto2::CameraFileInfoFields, FFI::GPhoto2::CameraFileOperation, FFI::GPhoto2::CameraFilePermissions, FFI::GPhoto2::CameraFileStatus, FFI::GPhoto2::CameraFileType, FFI::GPhoto2::CameraFolderOperation, FFI::GPhoto2::CameraOperation, FFI::GPhoto2::CameraWidgetType, FFI::GPhoto2::GphotoDeviceType
Instance Attribute Summary
Attributes included from Struct
#ptr
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Struct
#to_ptr
Constructor Details
#initialize(ptr, parent = nil) ⇒ CameraWidget
Returns a new instance of CameraWidget.
18
19
20
21
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 18
def initialize(ptr, parent = nil)
@ptr = ptr
@parent = parent
end
|
Class Method Details
.factory(ptr, parent = nil) ⇒ Object
9
10
11
12
13
14
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 9
def self.factory(ptr, parent = nil)
type = ptr[:type].to_s.split('_').last.capitalize
klass = GPhoto2.const_get("#{type}CameraWidget")
klass.new(ptr, parent)
end
|
Instance Method Details
56
57
58
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 56
def children
count_children.times.map { |i| get_child(i) }
end
|
#finalize ⇒ void
Also known as:
close
This method returns an undefined value.
24
25
26
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 24
def finalize
free
end
|
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 62
def flatten(map = {})
case type
when :window, :section
children.each { |child| child.flatten(map) }
else
map[name] = self
end
map
end
|
#label ⇒ String
30
31
32
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 30
def label
get_label
end
|
#name ⇒ String
35
36
37
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 35
def name
get_name
end
|
#to_s ⇒ String
74
75
76
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 74
def to_s
value.to_s
end
|
51
52
53
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 51
def type
get_type
end
|
#value ⇒ Object
40
41
42
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 40
def value
get_value
end
|
#value=(value) ⇒ Object
45
46
47
48
|
# File 'lib/gphoto2/camera_widgets/camera_widget.rb', line 45
def value=(value)
set_value(value)
value
end
|