12,21c12,21
<                                                                = assert, pairs, ipairs, setmetatable, table, rawget, type
< local lgi                                                      = require 'lgi'
< local cairo                                                    = lgi.cairo
< 
< local core                                                     = require 'lgi.core'
< local ffi                                                      = require 'lgi.ffi'
< local component                                                = require 'lgi.component'
< local record                                                   = require 'lgi.record'
< local enum                                                     = require 'lgi.enum'
< local ti                                                       = ffi.types
---
>    = assert, pairs, ipairs, setmetatable, table, rawget, type
> local lgi = require 'lgi'
> local cairo = lgi.cairo
> 
> local core = require 'lgi.core'
> local ffi = require 'lgi.ffi'
> local component = require 'lgi.component'
> local record = require 'lgi.record'
> local enum = require 'lgi.enum'
> local ti = ffi.types
23,34c23
< cairo._module                                                  = core.module('cairo', 2)
< local module_gobject                                           = core.gi.cairo.resolve
< 
< -- Versioning support.
< function cairo.version_encode(major, minor, micro)
<    return 10000 * major + 100 * minor + micro
< end
< 
< cairo.version = core.callable.new {
<    addr = cairo._module.cairo_version, ret = ti.int } ()
< cairo.version_string = core.callable.new {
<    addr = cairo._module.cairo_version_string, ret = ti.utf8 } ()
---
> local module_gobject = core.gi.cairo.resolve
41a31,34
>    -- The following three were added in cairo 1.14
>    MIME_TYPE_JBIG2 = 'application/x-cairo.jbig2',
>    MIME_TYPE_JBIG2_GLOBAL = 'application/x-cairo.jbig2-global',
>    MIME_TYPE_JBIG2_GLOBAL_ID = 'application/x-cairo.jbig2-global-id',
61a55,66
> -- Load libcairo.so directly; this has to happen after the typelib was used
> cairo._module = core.module('cairo', 2)
> 
> -- Versioning support.
> function cairo.version_encode(major, minor, micro)
>    return 10000 * major + 100 * minor + micro
> end
> cairo.version = core.callable.new {
>    addr = cairo._module.cairo_version, ret = ti.int } ()
> cairo.version_string = core.callable.new {
>    addr = cairo._module.cairo_version_string, ret = ti.utf8 } ()
> 
80,81c85,86
<          module_gobject,
<          'cairo_gobject_' .. core.uncamel(struct) .. '_get_type')
---
> 	 module_gobject,
> 	 'cairo_gobject_' .. core.uncamel(struct) .. '_get_type')
89c94
<    { 'length', ti.int } })
---
> 				    { 'length', ti.int } })
97c102
<    { 'Status',
---
>    {  'Status',
99c104
<          to_string = { static = true, ret = ti.utf8, cairo.Status }
---
> 	 to_string = { static = true, ret = ti.utf8, cairo.Status }
103c108
<    { 'Rectangle',
---
>    {  'Rectangle',
105,106c110,111
<          { 'x',     ti.double }, { 'y', ti.double },
<          { 'width', ti.double }, { 'height', ti.double },
---
> 	 { 'x', ti.double }, { 'y', ti.double },
> 	 { 'width', ti.double }, { 'height', ti.double },
110c115
<    { 'RectangleList',
---
>    {  'RectangleList',
112,114c117,119
<          { 'status',         cairo.Status },
<          { 'rectangles',     cairo.Rectangle, ptr = true },
<          { 'num_rectangles', ti.int },
---
> 	 { 'status', cairo.Status },
> 	 { 'rectangles', cairo.Rectangle, ptr = true },
> 	 { 'num_rectangles', ti.int },
118c123
<    { 'RectangleInt',
---
>    {  'RectangleInt',
120,121c125,126
<          { 'x',     ti.int }, { 'y', ti.int },
<          { 'width', ti.int }, { 'height', ti.int },
---
> 	 { 'x', ti.int }, { 'y', ti.int },
> 	 { 'width', ti.int }, { 'height', ti.int },
125c130
<    { 'Matrix',
---
>    {  'Matrix',
127,146c132,151
<          { 'xx', ti.double }, { 'yx', ti.double },
<          { 'xy', ti.double }, { 'yy', ti.double },
<          { 'x0', ti.double }, { 'y0', ti.double },
<       },
<       methods = {
<          init = { ti.double, ti.double, ti.double,
<             ti.double, ti.double, ti.double },
<          init_identity = {},
<          init_translate = { ti.double, ti.double },
<          init_scale = { ti.double, ti.double },
<          init_rotate = { ti.double },
<          translate = { ti.double, ti.double },
<          scale = { ti.double, ti.double },
<          rotate = { ti.double },
<          invert = { ret = cairo.Status },
<          multiply = { cairo.Matrix, cairo.Matrix },
<          transform_distance = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
<          transform_point = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
---
> 	 { 'xx', ti.double }, { 'yx', ti.double },
> 	 { 'xy', ti.double }, { 'yy', ti.double },
> 	 { 'x0', ti.double }, { 'y0', ti.double },
>       },
>       methods = {
> 	 init = { ti.double, ti.double, ti.double,
> 		  ti.double, ti.double, ti.double },
> 	 init_identity = {},
> 	 init_translate = { ti.double, ti.double },
> 	 init_scale = { ti.double, ti.double },
> 	 init_rotate = { ti.double },
> 	 translate = { ti.double, ti.double },
> 	 scale = { ti.double, ti.double },
> 	 rotate = { ti.double },
> 	 invert = { ret = cairo.Status },
> 	 multiply = { cairo.Matrix, cairo.Matrix },
> 	 transform_distance = { { ti.double, dir = 'inout' },
> 				{ ti.double, dir = 'inout' } },
> 	 transform_point = { { ti.double, dir = 'inout' },
> 			     { ti.double, dir = 'inout' } },
150c155
<    { 'PathData',
---
>    {  'PathData',
152,153c157,158
<          { 'header', path_data_header },
<          { 'point',  path_data_point },
---
> 	 { 'header', path_data_header },
> 	 { 'point', path_data_point },
157c162
<    { 'Path',
---
>    {  'Path',
159,161c164,166
<          { 'status',   cairo.Status },
<          { 'data',     cairo.PathData, ptr = true },
<          { 'num_data', ti.int },
---
> 	 { 'status', cairo.Status },
> 	 { 'data', cairo.PathData, ptr = true },
> 	 { 'num_data', ti.int },
165c170
<    { 'FontExtents',
---
>    {  'FontExtents',
167,171c172,176
<          { 'ascent',        ti.double },
<          { 'descent',       ti.double },
<          { 'height',        ti.double },
<          { 'max_x_advance', ti.double },
<          { 'max_y_advance', ti.double },
---
> 	 { 'ascent', ti.double },
> 	 { 'descent', ti.double },
> 	 { 'height', ti.double },
> 	 { 'max_x_advance', ti.double },
> 	 { 'max_y_advance', ti.double },
175c180
<    { 'TextExtents',
---
>    {  'TextExtents',
177,182c182,187
<          { 'x_bearing', ti.double },
<          { 'y_bearing', ti.double },
<          { 'width',     ti.double },
<          { 'height',    ti.double },
<          { 'x_advance', ti.double },
<          { 'y_advance', ti.double },
---
> 	 { 'x_bearing', ti.double },
> 	 { 'y_bearing', ti.double },
> 	 { 'width', ti.double },
> 	 { 'height', ti.double },
> 	 { 'x_advance', ti.double },
> 	 { 'y_advance', ti.double },
186c191
<    { 'Context',
---
>    {  'Context',
189,311c194,316
<          -- create = { static = true, ret = { cairo.Context, xfer = true },
<          --     cairo.Surface },
<          status = { ret = cairo.Status },
<          save = {},
<          restore = {},
<          get_target = { ret = cairo.Surface },
<          push_group = {},
<          push_group_with_content = { cairo.Content },
<          pop_group = { ret = { cairo.Pattern, xfer = true } },
<          pop_group_to_source = {},
<          get_group_target = { ret = cairo.Surface },
<          set_source_rgb = { ti.double, ti.double, ti.double },
<          set_source_rgba = { ti.double, ti.double, ti.double, ti.double },
<          set_source = { cairo.Pattern },
<          set_source_surface = { cairo.Surface, ti.double, ti.double },
<          get_source = { ret = cairo.Pattern },
<          set_antialias = { cairo.Antialias },
<          get_antialias = { ret = cairo.Antialias },
<          get_dash_count = { ret = ti.int },
<          set_fill_rule = { cairo.FillRule },
<          get_fill_rule = { ret = cairo.FillRule },
<          set_line_cap = { cairo.LineCap },
<          get_line_cap = { ret = cairo.LineCap },
<          set_line_join = { cairo.LineJoin },
<          get_line_join = { ret = cairo.LineJoin },
<          set_line_width = { ti.double },
<          get_line_width = { ret = ti.double },
<          set_miter_limit = { ti.double },
<          get_miter_limit = { ret = ti.double },
<          set_operator = { cairo.Operator },
<          get_operator = { ret = cairo.Operator },
<          set_tolerance = { ti.double },
<          get_tolerance = { ret = ti.double },
<          clip = {},
<          clip_preserve = {},
<          clip_extents = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          in_clip = { ret = ti.boolean, ti.double, ti.double },
<          reset_clip = {},
<          copy_clip_rectangle_list = {
<             ret = { cairo.RectangleList, xfer = true } },
<          fill = {},
<          fill_preserve = {},
<          fill_extents = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          in_fill = { ret = ti.boolean, ti.double, ti.double },
<          mask = { cairo.Pattern },
<          mask_surface = { cairo.Surface, ti.double, ti.double },
<          paint = {},
<          paint_with_alpha = { ti.double },
<          stroke = {},
<          stroke_preserve = {},
<          stroke_extents = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          in_stroke = { ret = ti.boolean, ti.double, ti.double },
<          copy_page = {},
<          show_page = {},
< 
<          copy_path = { ret = { cairo.Path, xfer = true } },
<          copy_path_flat = { ret = { cairo.Path, xfer = true } },
<          append_path = { cairo.Path },
<          has_current_point = { ret = ti.boolean },
<          get_current_point = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          new_path = {},
<          new_sub_path = {},
<          close_path = {},
<          arc = { ti.double, ti.double, ti.double, ti.double, ti.double },
<          arc_negative = { ti.double, ti.double, ti.double,
<             ti.double, ti.double },
<          curve_to = { ti.double, ti.double, ti.double,
<             ti.double, ti.double, ti.double },
<          line_to = { ti.double, ti.double },
<          move_to = { ti.double, ti.double },
<          rectangle = { ti.double, ti.double, ti.double, ti.double },
<          -- glyph_path,
<          text_path = { ti.utf8 },
<          rel_curve_to = { ti.double, ti.double, ti.double,
<             ti.double, ti.double, ti.double },
<          rel_line_to = { ti.double, ti.double },
<          rel_move_to = { ti.double, ti.double },
<          path_extents = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
< 
<          translate = { ti.double, ti.double },
<          scale = { ti.double, ti.double },
<          rotate = { ti.double },
<          transform = { cairo.Matrix },
<          set_matrix = { cairo.Matrix },
<          get_matrix = { cairo.Matrix },
<          identity_matrix = {},
<          user_to_device = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
<          user_to_device_distance = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
<          device_to_user = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
<          device_to_user_distance = { { ti.double, dir = 'inout' },
<             { ti.double, dir = 'inout' } },
< 
<          select_font_face = { ti.utf8, cairo.FontSlant, cairo.FontWeight },
<          set_font_size = { ti.double },
<          set_font_matrix = { cairo.Matrix },
<          get_font_matrix = { cairo.Matrix },
<          set_font_options = { cairo.FontOptions },
<          get_font_options = { cairo.FontOptions },
<          set_font_face = { cairo.FontFace },
<          get_font_face = { ret = cairo.FontFace },
<          set_scaled_font = { cairo.ScaledFont },
<          get_scaled_font = { ret = cairo.ScaledFont },
<          show_text = { ti.utf8 },
<          -- show_glyphs, show_text_glyphs
<          font_extents = { cairo.FontExtents },
<          text_extents = { ti.utf8, cairo.TextExtents },
<          -- glyph extents
---
> 	 create = { static = true, ret = { cairo.Context, xfer = true },
> 		    cairo.Surface },
> 	 status = { ret = cairo.Status },
> 	 save = {},
> 	 restore = {},
> 	 get_target = { ret = cairo.Surface},
> 	 push_group = {},
> 	 push_group_with_content = { cairo.Content },
> 	 pop_group = { ret = { cairo.Pattern, xfer = true } },
> 	 pop_group_to_source = {},
> 	 get_group_target = { ret = cairo.Surface },
> 	 set_source_rgb = { ti.double, ti.double, ti.double },
> 	 set_source_rgba = { ti.double, ti.double, ti.double, ti.double },
> 	 set_source = { cairo.Pattern },
> 	 set_source_surface = { cairo.Surface, ti.double, ti.double },
> 	 get_source = { ret = cairo.Pattern },
> 	 set_antialias = { cairo.Antialias },
> 	 get_antialias = { ret = cairo.Antialias },
> 	 get_dash_count = { ret = ti.int },
> 	 set_fill_rule = { cairo.FillRule },
> 	 get_fill_rule = { ret = cairo.FillRule },
> 	 set_line_cap = { cairo.LineCap },
> 	 get_line_cap = { ret = cairo.LineCap },
> 	 set_line_join = { cairo.LineJoin },
> 	 get_line_join = { ret = cairo.LineJoin },
> 	 set_line_width = { ti.double },
> 	 get_line_width = { ret = ti.double },
> 	 set_miter_limit = { ti.double },
> 	 get_miter_limit = { ret = ti.double },
> 	 set_operator = { cairo.Operator },
> 	 get_operator = { ret = cairo.Operator },
> 	 set_tolerance = { ti.double },
> 	 get_tolerance = { ret = ti.double },
> 	 clip = {},
> 	 clip_preserve = {},
> 	 clip_extents = { { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' } },
> 	 in_clip = { ret = ti.boolean, ti.double, ti.double },
> 	 reset_clip = {},
> 	 copy_clip_rectangle_list = {
> 	    ret = { cairo.RectangleList, xfer = true } },
> 	 fill = {},
> 	 fill_preserve = {},
> 	 fill_extents = { { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' } },
> 	 in_fill = { ret = ti.boolean, ti.double, ti.double },
> 	 mask = { cairo.Pattern },
> 	 mask_surface = { cairo.Surface, ti.double, ti.double },
> 	 paint = {},
> 	 paint_with_alpha = { ti.double },
> 	 stroke = {},
> 	 stroke_preserve = {},
> 	 stroke_extents = { { ti.double, dir = 'out' },
> 			    { ti.double, dir = 'out' },
> 			    { ti.double, dir = 'out' },
> 			    { ti.double, dir = 'out' } },
> 	 in_stroke = { ret = ti.boolean, ti.double, ti.double },
> 	 copy_page = {},
> 	 show_page = {},
> 
> 	 copy_path = { ret = { cairo.Path, xfer = true } },
> 	 copy_path_flat = { ret = { cairo.Path, xfer = true } },
> 	 append_path = { cairo.Path },
> 	 has_current_point = { ret = ti.boolean },
> 	 get_current_point = { { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' } },
> 	 new_path = {},
> 	 new_sub_path = {},
> 	 close_path = {},
> 	 arc = { ti.double, ti.double, ti.double, ti.double, ti.double },
> 	 arc_negative = { ti.double, ti.double, ti.double,
> 			  ti.double, ti.double },
> 	 curve_to = { ti.double, ti.double, ti.double,
> 		      ti.double, ti.double, ti.double },
> 	 line_to = { ti.double, ti.double },
> 	 move_to = { ti.double, ti.double },
> 	 rectangle = { ti.double, ti.double, ti.double, ti.double },
> 	 -- glyph_path,
> 	 text_path = { ti.utf8 },
> 	 rel_curve_to = { ti.double, ti.double, ti.double,
> 			  ti.double, ti.double, ti.double },
> 	 rel_line_to = { ti.double, ti.double },
> 	 rel_move_to = { ti.double, ti.double },
> 	 path_extents = { { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' },
> 			  { ti.double, dir = 'out' } },
> 
> 	 translate = { ti.double, ti.double },
> 	 scale = { ti.double, ti.double },
> 	 rotate = { ti.double },
> 	 transform = { cairo.Matrix },
> 	 set_matrix = { cairo.Matrix },
> 	 get_matrix = { cairo.Matrix },
> 	 identity_matrix = {},
> 	 user_to_device = { { ti.double, dir = 'inout' },
> 			    { ti.double, dir = 'inout' } },
> 	 user_to_device_distance = { { ti.double, dir = 'inout' },
> 				     { ti.double, dir = 'inout' } },
> 	 device_to_user = { { ti.double, dir = 'inout' },
> 			    { ti.double, dir = 'inout' } },
> 	 device_to_user_distance = { { ti.double, dir = 'inout' },
> 				     { ti.double, dir = 'inout' } },
> 
> 	 select_font_face = { ti.utf8, cairo.FontSlant, cairo.FontWeight },
> 	 set_font_size = { ti.double },
> 	 set_font_matrix = { cairo.Matrix },
> 	 get_font_matrix = { cairo.Matrix },
> 	 set_font_options = { cairo.FontOptions },
> 	 get_font_options = { cairo.FontOptions },
> 	 set_font_face = { cairo.FontFace },
> 	 get_font_face = { ret = cairo.FontFace },
> 	 set_scaled_font = { cairo.ScaledFont },
> 	 get_scaled_font = { ret = cairo.ScaledFont },
> 	 show_text = { ti.utf8 },
> 	 -- show_glyphs, show_text_glyphs
> 	 font_extents = { cairo.FontExtents },
> 	 text_extents = { ti.utf8, cairo.TextExtents },
> 	 -- glyph extents
315,318c320,323
<          'status', 'target', 'group_target', 'source', 'antialias', 'fill_rule',
<          'line_cap', 'line_join', 'line_width', 'miter_limit', 'operator',
<          'tolerance', 'font_size', 'font_face', 'font_matrix', 'scaled_font',
<          'matrix',
---
> 	 'status', 'target', 'group_target', 'source', 'antialias', 'fill_rule',
> 	 'line_cap', 'line_join', 'line_width', 'miter_limit', 'operator',
> 	 'tolerance', 'font_size', 'font_face', 'font_matrix', 'scaled_font',
> 	 'matrix',
322,331c327,336
<    { 'Pattern',
<       methods = {
<          status = { ret = cairo.Status },
<          set_extend = { cairo.Extend },
<          get_extend = { ret = cairo.Extend },
<          set_filter = { cairo.Filter },
<          get_filter = { ret = cairo.Filter },
<          set_matrix = { cairo.Matrix },
<          get_matrix = { cairo.Matrix },
<          get_type = { ret = cairo.PatternType },
---
>    {  'Pattern',
>       methods = {
> 	 status = { ret = cairo.Status },
> 	 set_extend = { cairo.Extend },
> 	 get_extend = { ret = cairo.Extend },
> 	 set_filter = { cairo.Filter },
> 	 get_filter = { ret = cairo.Filter },
> 	 set_matrix = { cairo.Matrix },
> 	 get_matrix = { cairo.Matrix },
> 	 get_type = { ret = cairo.PatternType },
336c341
<    { 'SolidPattern', parent = cairo.Pattern,
---
>    {  'SolidPattern', parent = cairo.Pattern,
339,347c344,352
<          create_rgb = { static = true, ret = { cairo.Pattern, xfer = true },
<             ti.double, ti.double, ti.double },
<          create_rgba = { static = true, ret = { cairo.Pattern, xfer = true },
<             ti.double, ti.double, ti.double, ti.double },
<          get_rgba = { ret = cairo.Status,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
---
> 	 create_rgb = { static = true, ret = { cairo.Pattern, xfer = true },
> 			ti.double, ti.double, ti.double },
> 	 create_rgba = { static = true, ret = { cairo.Pattern, xfer = true },
> 			 ti.double, ti.double, ti.double, ti.double },
> 	 get_rgba = { ret = cairo.Status,
> 		      { ti.double, dir = 'out' },
> 		      { ti.double, dir = 'out' },
> 		      { ti.double, dir = 'out' },
> 		      { ti.double, dir = 'out' } },
351c356
<    { 'SurfacePattern', parent = cairo.Pattern,
---
>    {  'SurfacePattern', parent = cairo.Pattern,
354,358c359,363
<          create = {
<             cname = 'cairo_pattern_create_for_surface', static = true,
<             ret = { cairo.Pattern, xfer = true },
<             cairo.Surface },
<          get_surface = { ret = cairo.Status, { cairo.Surface, dir = 'out' } },
---
> 	 create = {
> 	    cname = 'cairo_pattern_create_for_surface', static = true,
> 	    ret = { cairo.Pattern, xfer = true },
> 	    cairo.Surface },
> 	 get_surface = { ret = cairo.Status, { cairo.Surface, dir = 'out' } },
362c367
<    { 'GradientPattern', parent = cairo.Pattern,
---
>    {  'GradientPattern', parent = cairo.Pattern,
365,374c370,379
<          add_color_stop_rgb = { ti.double, ti.double, ti.double, ti.double },
<          add_color_stop_rgba = { ti.double, ti.double, ti.double,
<             ti.double, ti.double },
<          get_color_stop_count = { ret = cairo.Status, { ti.int, dir = 'out' } },
<          get_color_stop_rgba = { ret = cairo.Status, ti.int,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
---
> 	 add_color_stop_rgb = { ti.double, ti.double, ti.double, ti.double },
> 	 add_color_stop_rgba = { ti.double, ti.double, ti.double,
> 				 ti.double, ti.double },
> 	 get_color_stop_count = { ret = cairo.Status, { ti.int, dir = 'out' } },
> 	 get_color_stop_rgba = { ret = cairo.Status, ti.int,
> 				 { ti.double, dir = 'out' },
> 				 { ti.double, dir = 'out' },
> 				 { ti.double, dir = 'out' },
> 				 { ti.double, dir = 'out' },
> 				 { ti.double, dir = 'out' } },
378c383
<    { 'LinearPattern', parent = cairo.GradientPattern,
---
>    {  'LinearPattern', parent = cairo.GradientPattern,
381,388c386,393
<          create = { cname = 'cairo_pattern_create_linear', static = true,
<             ret = { cairo.Pattern, xfer = true },
<             ti.double, ti.double, ti.double, ti.double },
<          get_linear_points = { ret = cairo.Status,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
---
> 	 create = { cname = 'cairo_pattern_create_linear', static = true,
> 		    ret = { cairo.Pattern, xfer = true },
> 		    ti.double, ti.double, ti.double, ti.double },
> 	 get_linear_points = { ret = cairo.Status,
> 			       { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' } },
392c397
<    { 'RadialPattern', parent = cairo.GradientPattern,
---
>    {  'RadialPattern', parent = cairo.GradientPattern,
395,405c400,410
<          create = { cname = 'cairo_pattern_create_radial', static = true,
<             ret = { cairo.Pattern, xfer = true },
<             ti.double, ti.double, ti.double, ti.double,
<             ti.double, ti.double },
<          get_radial_circles = { ret = cairo.Status,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
---
> 	 create = { cname = 'cairo_pattern_create_radial', static = true,
> 		    ret = { cairo.Pattern, xfer = true },
> 		    ti.double, ti.double, ti.double, ti.double,
> 		    ti.double, ti.double },
> 	 get_radial_circles = { ret = cairo.Status,
> 				{ ti.double, dir = 'out' },
> 				{ ti.double, dir = 'out' },
> 				{ ti.double, dir = 'out' },
> 				{ ti.double, dir = 'out' },
> 				{ ti.double, dir = 'out' },
> 				{ ti.double, dir = 'out' } },
409c414
<    { 'MeshPattern', parent = cairo.Pattern,
---
>    {  'MeshPattern', parent = cairo.Pattern,
412,434c417,439
<          create = { cname = 'cairo_pattern_create_mesh', static = true,
<             ret = { cairo.Pattern, xfer = true } },
<          begin_patch = {},
<          end_patch = {},
<          move_to = { ti.double, ti.double },
<          line_to = { ti.double, ti.double },
<          curve_to = { ti.double, ti.double, ti.double, ti.double,
<             ti.double, ti.double },
<          set_control_point = { ti.int, ti.double, ti.double },
<          set_corner_color_rgb = { ti.int, ti.double, ti.double, ti.double },
<          set_corner_color_rgba = { ti.int, ti.double, ti.double, ti.double,
<             ti.double },
<          get_patch_count = { ret = cairo.Status, { ti.int, dir = 'out' } },
<          get_path = { ret = { cairo.Path, xfer = true }, ti.int },
<          get_control_point = { ret = cairo.Status, ti.int, ti.int,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          get_corner_color_rgba = { ret = cairo.Status, ti.int, ti.int,
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
---
> 	 create = { cname = 'cairo_pattern_create_mesh', static = true,
> 		    ret = { cairo.Pattern, xfer = true } },
> 	 begin_patch = {},
> 	 end_patch = {},
> 	 move_to = { ti.double, ti.double },
> 	 line_to = { ti.double, ti.double },
> 	 curve_to = { ti.double, ti.double, ti.double, ti.double,
> 		      ti.double, ti.double },
> 	 set_control_point = { ti.int, ti.double, ti.double },
> 	 set_corner_color_rgb = { ti.int, ti.double, ti.double, ti.double },
> 	 set_corner_color_rgba = { ti.int, ti.double, ti.double, ti.double,
> 				   ti.double },
> 	 get_patch_count = { ret = cairo.Status, { ti.int, dir = 'out' } },
> 	 get_path = { ret = { cairo.Path, xfer = true }, ti.int },
> 	 get_control_point = { ret = cairo.Status, ti.int, ti.int,
> 			       { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' } },
> 	 get_corner_color_rgba = { ret = cairo.Status, ti.int, ti.int,
> 				   { ti.double, dir = 'out' },
> 				   { ti.double, dir = 'out' },
> 				   { ti.double, dir = 'out' },
> 				   { ti.double, dir = 'out' } },
438,445c443,450
<    { 'Device',
<       methods = {
<          status = { ret = cairo.Status },
<          finish = {},
<          flush = {},
<          get_type = { ret = cairo.DeviceType },
<          acquire = { ret = cairo.Status },
<          release = {},
---
>    {  'Device',
>       methods = {
> 	 status = { ret = cairo.Status },
> 	 finish = {},
> 	 flush = {},
> 	 get_type = { ret = cairo.DeviceType },
> 	 acquire = { ret = cairo.Status },
> 	 release = {},
450c455
<    { 'Format',
---
>    {  'Format',
452c457
<          stride_for_width = { ret = ti.int, ti.int },
---
> 	 stride_for_width = { ret = ti.int, ti.int },
456c461
<    { 'Surface',
---
>    {  'Surface',
458,481c463,494
<          create_similar = { ret = { cairo.Surface, xfer = true },
<             cairo.Content, ti.int, ti.int },
<          create_for_rectangle = { ret = { cairo.Surface, xfer = true },
<             ti.double, ti.double, ti.double, ti.double },
<          status = { ret = cairo.Status },
<          finish = {},
<          flush = {},
<          get_device = { ret = cairo.Device },
<          get_font_options = { cairo.FontOptions },
<          get_content = { ret = cairo.Content },
<          mark_dirty = {},
<          mark_dirty_rectangle = { ti.int, ti.int, ti.int, ti.int },
<          set_device_offset = { ti.double, ti.double },
<          get_device_offset = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          set_fallback_resolution = { ti.double, ti.double },
<          get_fallback_resolution = { { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' } },
<          get_type = { ret = cairo.SurfaceType },
<          copy_page = {},
<          show_page = {},
<          has_show_text_glyphs = { ret = ti.boolean },
<          -- set_mime_data, get_mime_data
<          write_to_png = { ret = cairo.Status, ti.filename },
---
> 	 create_similar = { ret = { cairo.Surface, xfer = true },
> 			    cairo.Content, ti.int, ti.int },
> 	 create_similar_image = { since = cairo.version_encode(1, 12, 0),
> 			    ret = { cairo.Surface, xfer = true },
> 			    cairo.Format, ti.int, ti.int },
> 	 create_for_rectangle = { ret = { cairo.Surface, xfer = true },
> 				  ti.double, ti.double, ti.double, ti.double },
> 	 status = { ret = cairo.Status },
> 	 finish = {},
> 	 flush = {},
> 	 get_device = { ret = cairo.Device },
> 	 get_font_options = { cairo.FontOptions },
> 	 get_content = { ret = cairo.Content },
> 	 mark_dirty = {},
> 	 mark_dirty_rectangle = { ti.int, ti.int, ti.int, ti.int },
> 	 set_device_offset = { ti.double, ti.double },
> 	 get_device_offset = { { ti.double, dir = 'out' },
> 			       { ti.double, dir = 'out' } },
> 	 set_device_scale = { since = cairo.version_encode(1, 14, 0),
> 	     ti.double, ti.double },
> 	 get_device_scale = { since = cairo.version_encode(1, 14, 0),
> 			      { ti.double, dir = 'out' },
> 			      { ti.double, dir = 'out' } },
> 	 set_fallback_resolution = { ti.double, ti.double },
> 	 get_fallback_resolution = { { ti.double, dir = 'out' },
> 				     { ti.double, dir = 'out' } },
> 	 get_type = { ret = cairo.SurfaceType },
> 	 copy_page = {},
> 	 show_page = {},
> 	 has_show_text_glyphs = { ret = ti.boolean },
> 	 -- set_mime_data, get_mime_data
> 	 write_to_png = { ret = cairo.Status, ti.filename },
487c500
<    { 'ImageSurface', parent = cairo.Surface,
---
>    {  'ImageSurface', parent = cairo.Surface,
489,501c502,514
<          create = { static = true, ret = { cairo.Surface, xfer = true },
<             cairo.Format, ti.int, ti.int },
<          create_for_data = { static = true,
<             ret = { cairo.Surface, xfer = true },
<             ti.ptr, cairo.Format, ti.int, ti.int, ti.int },
<          create_from_png = { static = true,
<             ret = { cairo.Surface, xfer = true },
<             ti.filename },
<          get_data = { ret = ti.ptr },
<          get_format = { ret = cairo.Format },
<          get_width = { ret = ti.int },
<          get_height = { ret = ti.int },
<          get_stride = { ret = ti.int },
---
> 	 create = { static = true, ret = { cairo.Surface, xfer = true },
> 		    cairo.Format, ti.int, ti.int },
> 	 create_for_data = { static = true,
> 			     ret = { cairo.Surface, xfer = true },
> 			     ti.ptr, cairo.Format, ti.int, ti.int, ti.int },
> 	 create_from_png = { static = true,
> 			     ret = { cairo.Surface, xfer = true },
> 			     ti.filename },
> 	 get_data = { ret = ti.ptr },
> 	 get_format = { ret = cairo.Format },
> 	 get_width = { ret = ti.int },
> 	 get_height = { ret = ti.int },
> 	 get_stride = { ret = ti.int },
506c519
<    { 'PdfVersion',
---
>    {  'PdfVersion',
508,509c521,522
<          ['1_4'] = 0,
<          ['1_5'] = 1,
---
> 	 ['1_4'] = 0,
> 	 ['1_5'] = 1,
513c526
<    { 'PdfSurface', parent = cairo.Surface,
---
>    {  'PdfSurface', parent = cairo.Surface,
515,518c528,531
<          create = { static = true, ret = { cairo.Surface, xfer = true },
<             ti.filename, ti.double, ti.double },
<          restrict_to_version = { cairo.PdfVersion },
<          set_size = { ti.double, ti.double },
---
> 	 create = { static = true, ret = { cairo.Surface, xfer = true },
> 		    ti.filename, ti.double, ti.double },
> 	 restrict_to_version = { cairo.PdfVersion },
> 	 set_size = { ti.double, ti.double },
522c535
<    { 'PsLevel',
---
>    {  'PsLevel',
524,525c537,538
<          ['2'] = 0,
<          ['3'] = 1,
---
> 	 ['2'] = 0,
> 	 ['3'] = 1,
529c542
<    { 'PsSurface', parent = cairo.Surface,
---
>    {  'PsSurface', parent = cairo.Surface,
531,539c544,552
<          create = { static = true, ret = { cairo.Surface, xfer = true },
<             ti.filename, ti.double, ti.double },
<          restrict_to_level = { cairo.PsLevel },
<          set_eps = { ti.boolean },
<          get_eps = { ret = ti.boolean },
<          set_size = { ti.double, ti.double },
<          dsc_begin_setup = {},
<          dsc_begin_page_setup = {},
<          dsc_comment = { ti.utf8 },
---
> 	 create = { static = true, ret = { cairo.Surface, xfer = true },
> 		    ti.filename, ti.double, ti.double },
> 	 restrict_to_level = { cairo.PsLevel },
> 	 set_eps = { ti.boolean },
> 	 get_eps = { ret = ti.boolean },
> 	 set_size = { ti.double, ti.double },
> 	 dsc_begin_setup = {},
> 	 dsc_begin_page_setup = {},
> 	 dsc_comment = { ti.utf8 },
544c557
<    { 'RecordingSurface', parent = cairo.Surface,
---
>    {  'RecordingSurface', parent = cairo.Surface,
546,552c559,565
<          create = { static = true, ret = { cairo.Surface, xfer = true },
<             cairo.Content, cairo.Rectangle },
<          ink_extents = {
<             { ti.double, dir = 'out' }, { ti.double, dir = 'out' },
<             { ti.double, dir = 'out' }, { ti.double, dir = 'out' } },
<          get_extents = { since = cairo.version_encode(1, 12, 0),
<             ret = ti.boolean, cairo.Rectangle },
---
> 	 create = { static = true, ret = { cairo.Surface, xfer = true },
> 		    cairo.Content, cairo.Rectangle },
> 	 ink_extents = {
> 	    { ti.double, dir = 'out' }, { ti.double, dir = 'out' },
> 	    { ti.double, dir = 'out' }, { ti.double, dir = 'out' } },
> 	 get_extents = { since = cairo.version_encode(1, 12, 0),
> 			 ret = ti.boolean, cairo.Rectangle },
556c569
<    { 'SvgVersion',
---
>    {  'SvgVersion',
558,559c571,572
<          ['1_1'] = 0,
<          ['1_2'] = 1,
---
> 	 ['1_1'] = 0,
> 	 ['1_2'] = 1,
563c576
<    { 'SvgSurface', parent = cairo.Surface,
---
>    {  'SvgSurface', parent = cairo.Surface,
565,567c578,580
<          create = { static = true, ret = { cairo.Surface, xfer = true },
<             ti.filename, ti.double, ti.double },
<          restrict_to_version = { cairo.SvgVersion },
---
> 	 create = { static = true, ret = { cairo.Surface, xfer = true },
> 		    ti.filename, ti.double, ti.double },
> 	 restrict_to_version = { cairo.SvgVersion },
571c584
<    { 'FontFace',
---
>    {  'FontFace',
573,574c586,587
<          status = { ret = cairo.Status },
<          get_type = { ret = cairo.FontType },
---
> 	 status = { ret = cairo.Status },
> 	 get_type = { ret = cairo.FontType },
579c592
<    { 'ToyFontFace', parent = cairo.FontFace,
---
>    {  'ToyFontFace', parent = cairo.FontFace,
581,585c594,598
<          create = { static = true, ret = { cairo.ToyFontFace, xfer = true },
<             ti.utf8, cairo.FontSlant, cairo.FontWeight },
<          get_family = { ret = ti.utf8 },
<          get_slant = { ret = cairo.Slant },
<          get_weight = { ret = cairo.Weight },
---
> 	 create = { static = true, ret = { cairo.ToyFontFace, xfer = true },
> 		    ti.utf8, cairo.FontSlant, cairo.FontWeight },
> 	 get_family = { ret = ti.utf8 },
> 	 get_slant = { ret = cairo.Slant },
> 	 get_weight = { ret = cairo.Weight },
590c603
<    { 'FontOptions',
---
>    {  'FontOptions',
592,605c605,618
<          create = { static = true, ret = { cairo.FontOptions, xfer = true } },
<          copy = { ret = { cairo.FontOptions, xfer = true } },
<          status = { ret = cairo.Status },
<          merge = { cairo.FontOptions },
<          hash = { ret = ti.ulong },
<          equal = { ret = ti.boolean, cairo.FontOptions },
<          set_antialias = { cairo.Antialias },
<          get_antialias = { ret = cairo.Antialias },
<          set_subpixel_order = { cairo.SubpixelOrder },
<          get_subpixel_order = { ret = cairo.SubpixelOrder },
<          set_hint_style = { cairo.HintStyle },
<          get_hint_style = { ret = cairo.HintStyle },
<          set_hint_metrics = { cairo.HintMetrics },
<          get_hint_metrics = { ret = cairo.HintMetrics },
---
> 	 create = { static = true, ret = { cairo.FontOptions, xfer = true } },
> 	 copy = { ret = { cairo.FontOptions, xfer = true } },
> 	 status = { ret = cairo.Status },
> 	 merge = { cairo.FontOptions },
> 	 hash = { ret = ti.ulong },
> 	 equal = { ret = ti.boolean, cairo.FontOptions },
> 	 set_antialias = { cairo.Antialias },
> 	 get_antialias = { ret = cairo.Antialias },
> 	 set_subpixel_order = { cairo.SubpixelOrder },
> 	 get_subpixel_order = { ret = cairo.SubpixelOrder },
> 	 set_hint_style = { cairo.HintStyle },
> 	 get_hint_style = { ret = cairo.HintStyle },
> 	 set_hint_metrics = { cairo.HintMetrics },
> 	 get_hint_metrics = { ret = cairo.HintMetrics },
608c621
<          'hint_style', 'hint_metrics' },
---
> 		     'hint_style', 'hint_metrics' },
611c624
<    { 'ScaledFont',
---
>    {  'ScaledFont',
613,625c626,638
<          create = { static = true, ret = { cairo.ScaledFont, xfer = true },
<             cairo.FontFace, cairo.Matrix, cairo.Matrix,
<             cairo.FontOptions },
<          status = { ret = cairo.Status },
<          extents = { cairo.FontExtents },
<          text_extents = { ti.utf8, cairo.TextExtents },
<          -- glyph_extents, text_to_glyphs
<          get_font_face = { ret = cairo.FontFace },
<          get_font_options = { cairo.FontOptions },
<          get_font_matrix = { cairo.Matrix },
<          get_ctm = { cairo.Matrix },
<          get_scale_matrix = { cairo.Matrix },
<          get_type = { ret = cairo.FontType },
---
> 	 create = { static = true, ret = { cairo.ScaledFont, xfer = true },
> 		    cairo.FontFace, cairo.Matrix, cairo.Matrix,
> 		    cairo.FontOptions },
> 	 status = { ret = cairo.Status },
> 	 extents = { cairo.FontExtents },
> 	 text_extents = { ti.utf8, cairo.TextExtents },
> 	 -- glyph_extents, text_to_glyphs
> 	 get_font_face = { ret = cairo.FontFace },
> 	 get_font_options = { cairo.FontOptions },
> 	 get_font_matrix = { cairo.Matrix },
> 	 get_ctm = { cairo.Matrix },
> 	 get_scale_matrix = { cairo.Matrix },
> 	 get_type = { ret = cairo.FontType },
630c643
<    { 'Region',
---
>    {  'Region',
632,653c645,666
<          create = { static = true, ret = { cairo.Region, xfer = true } },
<          create_rectangle = { static = true,
<             ret = { cairo.Region, xfer = true },
<             cairo.RectangleInt },
<          copy = { ret = cairo.Region },
<          status = { ret = cairo.Status },
<          get_extents = { cairo.RectangleInt },
<          num_rectangles = { ret = ti.int },
<          get_rectangle = { ti.int, cairo.RectangleInt },
<          is_empty = { ret = ti.boolean },
<          contains_point = { ret = ti.boolean, ti.int, ti.int },
<          contains_rectangle = { ret = cairo.RegionOverlap, cairo.RectangleInt },
<          equal = { ret = ti.boolean, cairo.Region },
<          translate = { ti.int, ti.int },
<          intersect = { ret = cairo.Status, cairo.Region },
<          intersect_rectangle = { ret = cairo.Status, cairo.RectangleInt },
<          subtract = { ret = cairo.Status, cairo.Region },
<          subtract_rectangle = { ret = cairo.Status, cairo.RectangleInt },
<          union = { ret = cairo.Status, cairo.Region },
<          union_rectangle = { ret = cairo.Status, cairo.RectangleInt },
<          xor = { ret = cairo.Status, cairo.Region },
<          xor_rectangle = { ret = cairo.Status, cairo.RectangleInt },
---
> 	 create = { static = true, ret = { cairo.Region, xfer = true } },
> 	 create_rectangle = { static = true,
> 			      ret = { cairo.Region, xfer = true },
> 			      cairo.RectangleInt },
> 	 copy = { ret = cairo.Region },
> 	 status = { ret = cairo.Status },
> 	 get_extents = { cairo.RectangleInt },
> 	 num_rectangles = { ret = ti.int },
> 	 get_rectangle = { ti.int, cairo.RectangleInt },
> 	 is_empty = { ret = ti.boolean },
> 	 contains_point = { ret = ti.boolean, ti.int, ti.int },
> 	 contains_rectangle = { ret = cairo.RegionOverlap, cairo.RectangleInt },
> 	 equal = { ret = ti.boolean, cairo.Region },
> 	 translate = { ti.int, ti.int },
> 	 intersect = { ret = cairo.Status, cairo.Region },
> 	 intersect_rectangle = { ret = cairo.Status, cairo.RectangleInt },
> 	 subtract = { ret = cairo.Status, cairo.Region },
> 	 subtract_rectangle = { ret = cairo.Status, cairo.RectangleInt },
> 	 union = { ret = cairo.Status, cairo.Region },
> 	 union_rectangle = { ret = cairo.Status, cairo.RectangleInt },
> 	 xor = { ret = cairo.Status, cairo.Region },
> 	 xor_rectangle = { ret = cairo.Status, cairo.RectangleInt },
661a675,678
>       local cprefix = 'cairo_' .. (info.cprefix or core.uncamel(name) .. '_')
>       if not obj._parent then
> 	 obj._refsink = cairo._module[cprefix .. 'reference']
>       end
663,680c680,696
<          -- Go through description of the methods and create functions
<          -- from them.
<          obj._method = {}
<          local cprefix = 'cairo_' .. (info.cprefix or core.uncamel(name) .. '_')
<          local self_arg = { obj }
<          for method_name, method_info in pairs(info.methods) do
<             if cairo.version >= (method_info.since or 0) then
<                method_info.name = 'cairo.' .. name .. '.' .. method_name
<                method_info.addr = assert(
<                   cairo._module[
<                   method_info.cname or (cprefix .. method_name)])
<                if not method_info.static then
<                   table.insert(method_info, 1, self_arg)
<                end
<                method_info.ret = method_info.ret or ti.void
<                obj._method[method_name] = core.callable.new(method_info)
<             end
<          end
---
> 	 -- Go through description of the methods and create functions
> 	 -- from them.
> 	 obj._method = {}
> 	 local self_arg = { obj }
> 	 for method_name, method_info in pairs(info.methods) do
> 	    if cairo.version >= (method_info.since or 0) then
> 	       method_info.name = 'cairo.' .. name .. '.' .. method_name
> 	       method_info.addr = assert(
> 		  cairo._module[
> 		     method_info.cname or (cprefix .. method_name)])
> 	       if not method_info.static then
> 		  table.insert(method_info, 1, self_arg)
> 	       end
> 	       method_info.ret = method_info.ret or ti.void
> 	       obj._method[method_name] = core.callable.new(method_info)
> 	    end
> 	 end
683,686c699,702
<          -- Fill in addition enum/bitflag values.
<          for n, v in pairs(info.values) do
<             obj[n] = v
<          end
---
> 	 -- Fill in addition enum/bitflag values.
> 	 for n, v in pairs(info.values) do
> 	    obj[n] = v
> 	 end
689,697c705,713
<          -- Aggregate getters/setters into pseudoproperties
<          -- implemented as attributes.
<          obj._attribute = {}
<          for _, attr in pairs(info.properties) do
<             obj._attribute[attr] = {
<                get = obj._method['get_' .. attr] or obj._method[attr],
<                set = obj._method['set_' .. attr],
<             }
<          end
---
> 	 -- Aggregate getters/setters into pseudoproperties
> 	 -- implemented as attributes.
> 	 obj._attribute = {}
> 	 for _, attr in pairs(info.properties) do
> 	    obj._attribute[attr] = {
> 	       get = obj._method['get_' .. attr] or obj._method[attr],
> 	       set = obj._method['set_' .. attr],
> 	    }
> 	 end
700,701c716,717
<          -- Load record fields definition
<          ffi.load_fields(obj, info.fields)
---
> 	 -- Load record fields definition
> 	 ffi.load_fields(obj, info.fields)
734,749c750,765
<    { cairo.Context,          'matrix',        cairo.Matrix },
<    { cairo.Context,          'font_matrix',   cairo.Matrix },
<    { cairo.Context,          'font_options',  cairo.FontOptions },
<    { cairo.Context,          'font_extents',  cairo.FontExtents },
<    { cairo.Context,          'text_extents',  cairo.TextExtents,  args = 1 },
<    { cairo.Pattern,          'matrix',        cairo.Matrix },
<    { cairo.Surface,          'font_options',  cairo.FontOptions },
<    { cairo.ScaledFont,       'font_matrix',   cairo.Matrix },
<    { cairo.ScaledFont,       'ctm',           cairo.Matrix },
<    { cairo.ScaledFont,       'scale_matrix',  cairo.Matrix },
<    { cairo.ScaledFont,       'font_options',  cairo.FontOptions },
<    { cairo.ScaledFont,       'extents',       cairo.FontExtents },
<    { cairo.ScaledFont,       'text_extents',  cairo.TextExtents,  args = 1 },
<    { cairo.RecordingSurface, 'extents',       cairo.Rectangle },
<    { cairo.Region,           'extents',       cairo.RectangleInt },
<    { cairo.Region,           'get_rectangle', cairo.RectangleInt, args = 1 },
---
>    { cairo.Context, 'matrix', cairo.Matrix },
>    { cairo.Context, 'font_matrix', cairo.Matrix },
>    { cairo.Context, 'font_options', cairo.FontOptions },
>    { cairo.Context, 'font_extents', cairo.FontExtents },
>    { cairo.Context, 'text_extents', cairo.TextExtents, args = 1 },
>    { cairo.Pattern, 'matrix', cairo.Matrix },
>    { cairo.Surface, 'font_options', cairo.FontOptions },
>    { cairo.ScaledFont, 'font_matrix', cairo.Matrix },
>    { cairo.ScaledFont, 'ctm', cairo.Matrix },
>    { cairo.ScaledFont, 'scale_matrix', cairo.Matrix },
>    { cairo.ScaledFont, 'font_options', cairo.FontOptions },
>    { cairo.ScaledFont, 'extents', cairo.FontExtents },
>    { cairo.ScaledFont, 'text_extents', cairo.TextExtents, args = 1 },
>    { cairo.RecordingSurface, 'extents', cairo.Rectangle },
>    { cairo.Region, 'extents', cairo.RectangleInt },
>    { cairo.Region, 'get_rectangle', cairo.RectangleInt, args = 1 },
751c767
<    local getter_name = 'get_' .. info[2]
---
>    local getter_name = 'get_' ..info[2]
759,763c775,779
<          info[1]._method[getter_name] = function(self, arg1)
<             local ret = info[3]()
<             local res = raw_getter(self, arg1, ret)
<             return (res == nil or res) and ret or nil
<          end
---
> 	 info[1]._method[getter_name] = function(self, arg1)
> 	    local ret = info[3]()
> 	    local res = raw_getter(self, arg1, ret)
> 	    return (res == nil or res) and ret or nil
> 	 end
765,773c781,789
<          info[1]._method[getter_name] = function(self)
<             local ret = info[3]()
<             local res = raw_getter(self, ret)
<             return (res == nil or res) and ret or nil
<          end
<          info[1]._attribute[info[2]] = {
<             get = info[1][getter_name],
<             set = info[1]['set_' .. info[2]],
<          }
---
> 	 info[1]._method[getter_name] = function(self)
> 	    local ret = info[3]()
> 	    local res = raw_getter(self, ret)
> 	    return (res == nil or res) and ret or nil
> 	 end
> 	 info[1]._attribute[info[2]] = {
> 	    get = info[1][getter_name],
> 	    set = info[1]['set_' .. info[2]],
> 	 }
836c852
<          return create(...)
---
> 	 return create(...)
860c876
<          core.record.fromarray(array, i - 1).v = dashes[i]
---
> 	 core.record.fromarray(array, i - 1).v = dashes[i]
878c894
<          dashes[i] = core.record.fromarray(array, i - 1).v
---
> 	 dashes[i] = core.record.fromarray(array, i - 1).v
896,900c912,916
<          points[1] = core.record.fromarray(self.data, index + 1).point
<          if type == 'CURVE_TO' then
<             points[2] = core.record.fromarray(self.data, index + 2).point
<             points[3] = core.record.fromarray(self.data, index + 3).point
<          end
---
> 	 points[1] = core.record.fromarray(self.data, index + 1).point
> 	 if type == 'CURVE_TO' then
> 	    points[2] = core.record.fromarray(self.data, index + 2).point
> 	    points[3] = core.record.fromarray(self.data, index + 3).point
> 	 end
