### ----------------------------------------------------
### -- Gnome::Cairo
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Cairo/Pattern.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 3
<Any> for I<data>.  Return value: C<CAIRO_STATUS_SUCCESS> or C<CAIRO_STATUS_NO_MEMORY> if a slot could not be allocated for the user data.

  method set-user-data ( cairo_user_data_key_t $key, void-ptr $user_data, cairo_destroy_func_t $destroy --> cairo_status_t )

=item $key; the address of a B<cairo-user-data-key-t> to attach the user data to
=item $user_data; the user data to attach to the B<t>
=item $destroy; a B<cairo-destroy-func-t> which will be called when the B<cairo-t> is destroyed or when new user data is attached using the same key.
=end pod

method set-user-data ( cairo_user_data_key_t $key, void-ptr $user_data, cairo_destroy_func_t $destroy --> cairo_status_t ) {

  cairo_pattern_set_user_data(
    self._get-native-object-no-reffing, $key, $user_data, $destroy
  )
}

sub cairo_pattern_set_user_data (
  cairo_pattern_t $pattern, cairo_user_data_key_t $key, void-ptr $user_data, cairo_destroy_func_t $destroy --> GEnum
) is native(&cairo-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:status:
=begin pod
=head2 status

Checks whether an error has previously occurred for this pattern.

Possible return value: C<CAIRO_STATUS_SUCCESS>, C<CAIRO_STATUS_NO_MEMORY>, C<CAIRO_STATUS_INVALID_MATRIX>, C<CAIRO_STATUS_PATTERN_TYPE_MISMATCH>, or C<CAIRO_STATUS_INVALID_MESH_CONSTRUCTION>.

  method status ( --> cairo_status_t )

=end pod

method status ( --> cairo_status_t ) {
  cairo_status_t(cairo_pattern_status(self._get-native-object-no-reffing))
}

sub cairo_pattern_status (
  cairo_pattern_t $pattern --> GEnum
) is native(&cairo-lib)
  { * }


