Source
The GSource
struct is an opaque data type representing an event source.
Skipped during bindings generation
parameter
events
: C Type GIOCondition is ignoredparameter
tag
: gpointerparameter
tag
: gpointerparameter
tag
: gpointerparameter
callback_data
: gpointerparameter
user_data
: gpointerparameter
user_data
: gpointerfield
callback_data
: Record field callback_data is privatefield
callback_funcs
: Record field callback_funcs is privatefield
source_funcs
: Record field source_funcs is privatefield
ref_count
: Record field ref_count is privatefield
context
: Record field context is privatefield
priority
: Record field priority is privatefield
flags
: Record field flags is privatefield
source_id
: Record field source_id is privatefield
poll_fds
: Record field poll_fds is privatefield
prev
: Record field prev is privatefield
next
: Record field next is privatefield
name
: Record field name is privatefield
priv
: Record field priv is private
Constructors
Functions
Adds @child_source to @source as a "polled" source; when @source is added to a struct@GLib.MainContext, @child_source will be automatically added with the same priority, when @child_source is triggered, it will cause @source to dispatch (in addition to calling its own callback), and when @source is destroyed, it will destroy
Adds a file descriptor to the set of file descriptors polled for this source. This is usually combined with ctor@GLib.Source.new to add an event source. The event source's check function will typically test the @revents field in the #GPollFD struct and return true if events need to be processed.
Adds a struct@GLib.Source to a @context so that it will be executed within that context. Remove it by calling method@GLib.Source.destroy.
Checks whether a source is allowed to be called recursively. see method@GLib.Source.set_can_recurse.
Gets the struct@GLib.MainContext with which the source is associated.
This function ignores @source and is otherwise the same as func@GLib.get_current_time.
Returns the numeric ID for a particular source. The ID of a source is a positive integer which is unique within a particular main loop context. The reverse mapping from ID to source is done by method@GLib.MainContext.find_source_by_id.
Gets the priority of a source.
Gets the "ready time" of @source, as set by method@GLib.Source.set_ready_time.
Returns whether @source has been destroyed.
Detaches @child_source from @source and destroys it.
Removes a file descriptor from the set of file descriptors polled for this source.
Sets the callback function for a source. The callback for a source is called from the source's dispatch function.
Sets whether a source can be called recursively. If @can_recurse is true, then while the source is being dispatched then this source will be processed normally. Otherwise, all processing of this source is blocked until the dispatch function returns.
Sets the source functions (can be used to override default implementations) of an unattached source.
Sets the priority of a source. While the main loop is being run, a source will be dispatched if it is ready to be dispatched and no sources at a higher (numerically smaller) priority are ready to be dispatched.
Sets a #GSource to be dispatched when the given monotonic time is reached (or passed). If the monotonic time is in the past (as it always will be if @ready_time is 0) then the source will be dispatched immediately.
A variant of method@GLib.Source.set_name that does not duplicate the @name, and can only be used with string literals.