Class: CGPoint

Inherits:
Struct
  • Object
show all
Defined in:
lib/accessibility/bridge/mri.rb,
lib/accessibility/bridge/common.rb

Overview

A structure that contains a point in a two-dimensional coordinate system

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x = 0.0, y = 0.0) ⇒ CGPoint

Returns a new instance of CGPoint.

Parameters:

  • x (Number) (defaults to: 0.0)
  • y (Number) (defaults to: 0.0)


7
8
9
# File 'lib/accessibility/bridge/mri.rb', line 7

def initialize x = 0.0, y = 0.0
  super
end

Instance Attribute Details

#xNumber

The x co-ordinate of the screen point

Returns:

  • (Number)


3
4
5
# File 'lib/accessibility/bridge/mri.rb', line 3

def x
  @x
end

#yNumber

The y co-ordinate of the screen point

Returns:

  • (Number)


3
4
5
# File 'lib/accessibility/bridge/mri.rb', line 3

def y
  @y
end

Class Method Details

.ax_valueNumber

Returns the number that AXAPI uses in order to know how to wrap a struct.

Returns:

  • (Number)


130
# File 'lib/accessibility/bridge/macruby.rb', line 130

def ax_value; KAXValueCGPointType end

Instance Method Details

#inspectString

Return a nice string representation of the point

Overrides Object#inspect to more closely mimic MacRuby Boxed#inspect.

Returns:



25
26
27
# File 'lib/accessibility/bridge/mri.rb', line 25

def inspect
  "#<CGPoint x=#{self.x.to_f} y=#{self.y.to_f}>"
end

#to_pointCGPoint

Returns the receiver, since the receiver is already a CGPoint

Returns:



6
7
8
# File 'lib/accessibility/bridge/common.rb', line 6

def to_point
  self
end