(define-boxed LayoutLine
  (in-module "Pango")
  (c-name "PangoLayoutLine")
)
;; manually remove fields; we have to an override to make sense of these
;;(fields
;;  '("gint" "start_index")
;;  '("gint" "length")
;;  '("guint" "is_paragraph_start")
;;  '("GSList*" "runs")
;;  '("guint" "resolved_dir")
;;)

;; manually hacked to return void avoid creating lookup loops
(define-method ref
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_ref")
  (return-type "none")
)

(define-method unref
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_unref")
  (return-type "none")
)

(define-method x_to_index
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_x_to_index")
  (return-type "gboolean")
  (parameters
    '("int" "x_pos")
    '("int*" "index")
    '("int*" "trailing")
  )
)

(define-method index_to_x
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_index_to_x")
  (return-type "none")
  (parameters
    '("int" "index")
    '("gboolean" "trailing")
    '("int*" "x_pos")
  )
)

(define-method get_x_ranges
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_get_x_ranges")
  (return-type "none")
  (parameters
    '("int" "start_index")
    '("int" "end_index")
    '("int**" "ranges")
    '("int*" "n_ranges")
  )
)

(define-method get_extents
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_get_extents")
  (return-type "none")
  (parameters
    '("PangoRectangle*" "ink_rect" (null-ok))
    '("PangoRectangle*" "logical_rect" (null-ok))
  )
)

(define-method get_pixel_extents
  (of-object "PangoLayoutLine")
  (c-name "pango_layout_line_get_pixel_extents")
  (return-type "none")
  (parameters
    '("PangoRectangle*" "ink_rect" (null-ok))
    '("PangoRectangle*" "logical_rect" (null-ok))
  )
)

