### ----------------------------------------------------
### -- Gnome::Glib
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Glib/MainContext.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
-GObject $context; (nullable): a I<MainContext> (if C<undefined>, the default context will be used)
=item UInt $source_id; the source ID, as returned by C<g-source-get-id()>.

=end pod

method find-source-by-id ( N-GObject $context, UInt $source_id --> GSource ) {

  g_main_context_find_source_by_id(
    self._get-native-object-no-reffing, $context, $source_id
  );
}

sub g_main_context_find_source_by_id ( N-GObject $context, guint $source_id --> GSource )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:find-source-by-user-data:
=begin pod
=head2 find-source-by-user-data

Finds a source with the given user data for the callback.  If multiple sources exist with the same user data, the first one found will be returned.

Returns: (transfer none): the source, if one was found, otherwise C<undefined>

  method find-source-by-user-data ( N-GObject $context, Pointer $user_data --> GSource )

=item N-GObject $context; a I<MainContext>
=item Pointer $user_data; the user-data for the callback.

=end pod

method find-source-by-user-data ( N-GObject $context, Pointer $user_data --> GSource ) {

  g_main_context_find_source_by_user_data(
    self._get-native-object-no-reffing, $context, $user_data
  );
}

sub g_main_context_find_source_by_user_data ( N-GObject $context, gpointer $user_data --> GSource )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-poll-func:
=begin pod
=head2 get-poll-func

Gets the poll function set by C<set-poll-func()>.

Returns: the poll function

  method get-poll-func ( N-GObject $context --> GPollFunc )

=item N-GObject $context; a I<MainContext>

=end pod

method get-poll-func ( N-GObject $context --> GPollFunc ) {

  g_main_context_get_poll_func(
    self._get-native-object-no-reffing, $context
  );
}

sub g_main_context_get_poll_func ( N-GObject $context --> GPollFunc )
  is native(&glib-lib)
  { * }


