--- /dev/null
+module Ym4r\r
+ module GmPlugin\r
+ #A point in pixel coordinates\r
+ class GPoint < Struct.new(:x,:y)\r
+ include MappingObject\r
+ def create\r
+ "new GPoint(#{x},#{y})"\r
+ end\r
+ end\r
+ #A rectangular that contains all the pixel points passed as arguments\r
+ class GBounds\r
+ include MappingObject\r
+ attr_accessor :points\r
+ #Accepts both an array of GPoint and an array of 2-element arrays\r
+ def initialize(points)\r
+ if !points.empty? and points[0].is_a?(Array)\r
+ @points = points.collect { |pt| GPoint.new(pt[0],pt[1]) }\r
+ else\r
+ @points = points\r
+ end\r
+ end\r
+ def create\r
+ "new GBounds([#{@points.map { |pt| pt.to_javascript}.join(",")}])"\r
+ end\r
+ end\r
+ #A size object, in pixel space\r
+ class GSize < Struct.new(:width,:height)\r
+ include MappingObject\r
+ def create\r
+ "new GSize(#{width},#{height})"\r
+ end\r
+ end\r
+ end\r
+end\r