Class: Glimmer::LibUI::ControlProxy::MatrixProxy

Inherits:
Glimmer::LibUI::ControlProxy show all
Defined in:
lib/glimmer/libui/control_proxy/matrix_proxy.rb

Overview

Proxy for LibUI matrix objects

Follows the Proxy Design Pattern

Constant Summary

Constants inherited from Glimmer::LibUI::ControlProxy

BOOLEAN_PROPERTIES, KEYWORD_ALIASES, STRING_PROPERTIES, TransformProxy

Instance Attribute Summary

Attributes inherited from Glimmer::LibUI::ControlProxy

#args, #block, #content_added, #custom_control, #keyword, #libui, #options, #parent_custom_control, #parent_proxy, #slot

Instance Method Summary collapse

Methods inherited from Glimmer::LibUI::ControlProxy

#append_properties, #append_property, #bind_content, #can_handle_listener?, constant_symbol, #content, control_proxies, control_proxy_class, create, #custom_listener_name_aliases, #custom_listener_names, #default_destroy, #deregister_all_custom_listeners, #deregister_custom_listeners, descendant_keyword_constant_map, #destroy, #destroy_child, #enabled, exists?, #handle_custom_listener, #handle_listener, #has_custom_listener?, image_proxies, #initialize, keyword, #listeners, #listeners_for, main_window_proxy, map_descendant_keyword_constants_for, menu_proxies, #method_missing, new_control, #notify_custom_listeners, #post_add_content, #post_initialize_child, reset_descendant_keyword_constant_map, #respond_to?, #respond_to_libui?, #send_to_libui, #visible, #window_proxy

Methods included from DataBindable

#data_bind, #data_bind_read, #data_bind_write, #data_binding_model_attribute_observer_registrations

Methods included from Parent

#children, #post_initialize_child

Constructor Details

This class inherits a constructor from Glimmer::LibUI::ControlProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::LibUI::ControlProxy

Instance Method Details

#cloneObject



35
36
37
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 35

def clone
  MatrixProxy.new('matrix', nil, [@libui.M11, @libui.M12, @libui.M21, @libui.M22, @libui.M31, @libui.M32])
end

#dupObject



39
40
41
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 39

def dup
  clone
end

#identityObject



103
104
105
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 103

def identity
  set_identity
end

#invertibleObject Also known as: invertible?



123
124
125
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 123

def invertible
  Glimmer::LibUI.integer_to_boolean(super, allow_nil: false)
end

#libui_api_keywordObject



31
32
33
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 31

def libui_api_keyword
  'draw_matrix'
end

#m11(value = nil) ⇒ Object Also known as: m11=, set_m11



43
44
45
46
47
48
49
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 43

def m11(value = nil)
  if value.nil?
    @libui.M11
  else
    @libui.M11 = value.to_f
  end
end

#m12(value = nil) ⇒ Object Also known as: m12=, set_m12



53
54
55
56
57
58
59
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 53

def m12(value = nil)
  if value.nil?
    @libui.M12
  else
    @libui.M12 = value.to_f
  end
end

#m21(value = nil) ⇒ Object Also known as: m21=, set_m21



63
64
65
66
67
68
69
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 63

def m21(value = nil)
  if value.nil?
    @libui.M21
  else
    @libui.M21 = value.to_f
  end
end

#m22(value = nil) ⇒ Object Also known as: m22=, set_m22



73
74
75
76
77
78
79
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 73

def m22(value = nil)
  if value.nil?
    @libui.M22
  else
    @libui.M22 = value.to_f
  end
end

#m31(value = nil) ⇒ Object Also known as: m31=, set_m31



83
84
85
86
87
88
89
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 83

def m31(value = nil)
  if value.nil?
    @libui.M31
  else
    @libui.M31 = value.to_f
  end
end

#m32(value = nil) ⇒ Object Also known as: m32=, set_m32



93
94
95
96
97
98
99
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 93

def m32(value = nil)
  if value.nil?
    @libui.M32
  else
    @libui.M32 = value.to_f
  end
end

#multiply(matrix) ⇒ Object



119
120
121
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 119

def multiply(matrix)
  super(matrix.respond_to?(:libui) ? matrix.libui : matrix)
end

#rotate(x = 0, y = 0, degrees) ⇒ Object



107
108
109
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 107

def rotate(x = 0, y = 0, degrees)
  super(x, y, (Math::PI*2.0/360.0)*degrees)
end

#scale(x_center = 0, y_center = 0, x, y) ⇒ Object



111
112
113
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 111

def scale(x_center = 0, y_center = 0, x, y)
  super
end

#skew(x = 0, y = 0, x_amount, y_amount) ⇒ Object



115
116
117
# File 'lib/glimmer/libui/control_proxy/matrix_proxy.rb', line 115

def skew(x = 0, y = 0, x_amount, y_amount)
  super
end