Package org.gnome.glib
Class MainLoop
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.glib.MainLoop
- All Implemented Interfaces:
Proxy
The
GMainLoop
struct is an opaque data type
representing the main event loop of a GLib or GTK application.-
Constructor Summary
ConstructorDescriptionMainLoop
(MemorySegment address) Create a MainLoop proxy instance for the provided memory address.MainLoop
(@Nullable MainContext context, boolean isRunning) Creates a newGLib.MainLoop
structure. -
Method Summary
Modifier and TypeMethodDescriptionReturns theGLib.MainContext
of this MainLoop.static Type
getType()
Get the GType of the MainLoop classboolean
Checks to see if the main loop is currently being run viarun()
.void
quit()
Stops aGLib.MainLoop
from running.ref()
Increases the reference count on aGLib.MainLoop
object by one.void
run()
Runs a main loop untilquit()
is called on the loop.void
unref()
Decreases the reference count on aGLib.MainLoop
object by one.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
MainLoop
Create a MainLoop proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
MainLoop
Creates a newGLib.MainLoop
structure.- Parameters:
context
- aGMainContext
(ifnull
, the global-default main context will be used).isRunning
- set totrue
to indicate that the loop is running. This is not very important since callingrun()
will set this totrue
anyway.
-
-
Method Details
-
getType
-
getContext
Returns theGLib.MainContext
of this MainLoop.- Returns:
- the
GLib.MainContext
of this MainLoop
-
isRunning
public boolean isRunning()Checks to see if the main loop is currently being run viarun()
.- Returns:
true
if the mainloop is currently being run.
-
quit
-
ref
Increases the reference count on aGLib.MainLoop
object by one.- Returns:
- this MainLoop
-
run
public void run()Runs a main loop untilquit()
is called on the loop. If this is called for the thread of the loop'sGMainContext
, it will process events from the loop, otherwise it will simply wait. -
unref
public void unref()Decreases the reference count on aGLib.MainLoop
object by one. If the result is zero, free the loop and free all associated memory.
-