Source
The GSource
struct is an opaque data type representing an event source.
Skipped during bindings generation
parameter
dispose
: SourceDisposeFunc
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.
Monitors @fd for the IO events in @events.
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.
Gets the time to be used when checking this source. The advantage of calling this function over calling func@GLib.get_monotonic_time directly is that when checking multiple sources, GLib can cache a single value instead of having to repeatedly get the system monotonic time.
Returns whether @source has been destroyed.
Updates the event mask to watch for the fd identified by @tag.
Queries the events reported for the fd corresponding to @tag on
Detaches @child_source from @source and destroys it.
Removes a file descriptor from the set of file descriptors polled for this source.
Reverses the effect of a previous call to method@GLib.Source.add_unix_fd.
Sets the callback function for a source. The callback for a source is called from the source's dispatch function.
Sets the callback function storing the data as a refcounted callback "object". This is used internally. Note that calling method@GLib.Source.set_callback_indirect assumes an initial reference count on @callback_data, and thus
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.