Class Object

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
Animation, AnimationTarget, AppInfoMonitor, AppLaunchContext, Application, ApplicationCommandLine, AssistantPage, ATContext, Binding, BindingGroup, BookmarkList, Builder, BuilderCScope, BytesIcon, Cancellable, CellAreaContext, CharsetConverter, Clipboard, ColumnViewColumn, Constraint, ConstraintGuide, ContentDeserializer, ContentProvider, ContentSerializer, Context, Coverage, Credentials, CssProvider, Cursor, DBusActionGroup, DBusAuthObserver, DBusConnection, DBusInterfaceSkeleton, DBusMessage, DBusMethodInvocation, DBusObjectManagerClient, DBusObjectManagerServer, DBusObjectProxy, DBusObjectSkeleton, DBusProxy, DBusServer, DebugControllerDBus, DesktopAppInfo, Device, DeviceTool, DirectoryList, Display, DisplayManager, Drag, DrawContext, Drop, Emblem, EmblemedIcon, EntryBuffer, EntryCompletion, EnumListItem, EnumListModel, EventController, FileEnumerator, FileIcon, FileInfo, FileMonitor, FilenameCompleter, Filter, FilterListModel, FlattenListModel, Font, FontFace, FontFamily, FontMap, Fontset, FrameClock, GLShader, IconPaintable, IconTheme, IMContext, InetAddress, InetAddressMask, InitiallyUnowned, InputStream, Interface, IOStream, Layout, LayoutChild, LayoutManager, LeafletPage, ListIndex, ListItem, ListItemFactory, ListStore, ListStore, MapListModel, MediaStream, MenuAttributeIter, MenuItem, MenuLinkIter, MenuModel, Monitor, MountOperation, MultiSelection, NativeDialog, NetworkAddress, NetworkService, NoSelection, NotebookPage, Notification, OutputStream, PageSetup, Permission, Pixbuf, PixbufAnimation, PixbufAnimationIter, PixbufLoader, PrintContext, Printer, PrintJob, PrintOperation, PrintSettings, PropertyAction, RecentManager, Renderer, Renderer, Resolver, Seat, SelectionFilterModel, Settings, Settings, SettingsBackend, Shortcut, ShortcutAction, ShortcutTrigger, SignalGroup, Simple, SimpleAction, SimpleActionGroup, SimpleAsyncResult, SimpleProxyResolver, SingleSelection, SizeGroup, SliceListModel, Snapshot, Socket, SocketAddress, SocketAddressEnumerator, SocketClient, SocketControlMessage, SocketListener, Sorter, SortListModel, SqueezerPage, StackPage, StringList, StringObject, StyleContext, StyleManager, Subprocess, SubprocessLauncher, Surface, SwipeTracker, TabPage, Task, TestDBus, TextBuffer, TextChildAnchor, TextMark, TextTag, TextTagTable, Texture, ThemedIcon, TlsCertificate, TlsDatabase, TlsInteraction, TlsPassword, Toast, Tooltip, TreeListModel, TreeListRow, TreeModelFilter, TreeModelSort, TreeSelection, TreeStore, TypeModule, UnixFDList, UnixMountMonitor, Vfs, ViewStackPage, VolumeMonitor, WidgetPaintable, WindowGroup, ZlibCompressor, ZlibDecompressor

public class Object extends Pointer
The base object type.

All the fields in the `GObject` structure are private to the implementation
and should never be accessed directly.

Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the
alignment of the largest basic GLib type (typically this is #guint64 or
#gdouble). If you need larger alignment for an element in a #GObject, you
should allocate it on the heap (aligned), or arrange for your #GObject to be
appropriately padded. This guarantee applies to the #GObject (or derived)
struct, the #GObjectClass (or derived) struct, and any private data allocated
by G_ADD_PRIVATE().

https://docs.gtk.org/gobject/class.Object.html

  • Field Details

  • Constructor Details

    • Object

      public Object(PointerContainer pointer)
    • Object

      public Object(long object_type, @Nonnull Str first_property_name, Object... _elipse)
      Creates a new instance of a #GObject subtype and sets its properties.

      Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
      which are not explicitly specified are set to their default values. Any
      private data for the object is guaranteed to be initialized with zeros, as
      per g_type_create_instance().

      Note that in C, small integer types in variable argument lists are promoted
      up to #gint or #guint as appropriate, and read back accordingly. #gint is 32
      bits on every platform on which GLib is currently supported. This means that
      you can use C expressions of type #gint with g_object_new() and properties of
      type #gint or #guint or smaller. Specifically, you can use integer literals
      with these property types.

      When using property types of #gint64 or #guint64, you must ensure that the
      value that you provide is 64 bit. This means that you should use a cast or
      make use of the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.

      Similarly, #gfloat is promoted to #gdouble, so you must ensure that the value
      you provide is a #gdouble, even for a property of type #gfloat.

      Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the
      alignment of the largest basic GLib type (typically this is #guint64 or
      #gdouble). If you need larger alignment for an element in a #GObject, you
      should allocate it on the heap (aligned), or arrange for your #GObject to be
      appropriately padded.
      Parameters:
      object_type - the type id of the #GObject subtype to instantiate
      first_property_name - the name of the first property
      _elipse - the value of the first property, followed optionally by more name/value pairs, followed by %NULL
    • Object

      public Object(long object_type, String first_property_name, Object... _elipse)
      Creates a new instance of a #GObject subtype and sets its properties.

      Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY)
      which are not explicitly specified are set to their default values. Any
      private data for the object is guaranteed to be initialized with zeros, as
      per g_type_create_instance().

      Note that in C, small integer types in variable argument lists are promoted
      up to #gint or #guint as appropriate, and read back accordingly. #gint is 32
      bits on every platform on which GLib is currently supported. This means that
      you can use C expressions of type #gint with g_object_new() and properties of
      type #gint or #guint or smaller. Specifically, you can use integer literals
      with these property types.

      When using property types of #gint64 or #guint64, you must ensure that the
      value that you provide is 64 bit. This means that you should use a cast or
      make use of the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.

      Similarly, #gfloat is promoted to #gdouble, so you must ensure that the value
      you provide is a #gdouble, even for a property of type #gfloat.

      Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the
      alignment of the largest basic GLib type (typically this is #guint64 or
      #gdouble). If you need larger alignment for an element in a #GObject, you
      should allocate it on the heap (aligned), or arrange for your #GObject to be
      appropriately padded.
      Parameters:
      object_type - the type id of the #GObject subtype to instantiate
      first_property_name - the name of the first property
      _elipse - the value of the first property, followed optionally by more name/value pairs, followed by %NULL
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addToggleRef

      public void addToggleRef(Object.OnToggleNotify notify, @Nullable Pointer data)
      Increases the reference count of the object by one and sets a
      callback to be called when all other references to the object are
      dropped, or when this is already the last reference to the object
      and another reference is established.

      This functionality is intended for binding @object to a proxy
      object managed by another memory manager. This is done with two
      paired references: the strong reference added by
      g_object_add_toggle_ref() and a reverse reference to the proxy
      object which is either a strong reference or weak reference.

      The setup is that when there are no other references to @object,
      only a weak reference is held in the reverse direction from @object
      to the proxy object, but when there are other references held to
      @object, a strong reference is held. The @notify callback is called
      when the reference from @object to the proxy object should be
      "toggled" from strong to weak (@is_last_ref true) or weak to strong
      (@is_last_ref false).

      Since a (normal) reference must be held to the object before
      calling g_object_add_toggle_ref(), the initial state of the reverse
      link is always strong.

      Multiple toggle references may be added to the same gobject,
      however if there are multiple toggle references to an object, none
      of them will ever be notified until all but one are removed. For
      this reason, you should only ever use a toggle reference if there
      is important state in the proxy object.
      Parameters:
      notify - a function to call when this reference is the last reference to the object, or is no longer the last reference.
      data - data to pass to @notify
    • bindProperty

      public Binding bindProperty(@Nonnull Str source_property, @Nonnull Pointer target, @Nonnull Str target_property, int flags)
      Creates a binding between @source_property on @source and @target_property
      on @target.

      Whenever the @source_property is changed the @target_property is
      updated using the same value. For instance:
      <!-- language="C" -->
         g_object_bind_property (action, "active", widget, "sensitive", 0);
       


      Will result in the "sensitive" property of the widget #GObject instance to be
      updated with the same value of the "active" property of the action #GObject
      instance.

      If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
      if @target_property on @target changes then the @source_property on @source
      will be updated as well.

      The binding will automatically be removed when either the @source or the
      @target instances are finalized. To remove the binding without affecting the
      @source and the @target you can just call g_object_unref() on the returned
      #GBinding instance.

      Removing the binding by calling g_object_unref() on it must only be done if
      the binding, @source and @target are only used from a single thread and it
      is clear that both @source and @target outlive the binding. Especially it
      is not safe to rely on this if the binding, @source or @target can be
      finalized from different threads. Keep another reference to the binding and
      use g_binding_unbind() instead to be on the safe side.

      A #GObject can have multiple bindings.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • bindProperty

      public Binding bindProperty(String source_property, @Nonnull Pointer target, String target_property, int flags)
      Creates a binding between @source_property on @source and @target_property
      on @target.

      Whenever the @source_property is changed the @target_property is
      updated using the same value. For instance:
      <!-- language="C" -->
         g_object_bind_property (action, "active", widget, "sensitive", 0);
       


      Will result in the "sensitive" property of the widget #GObject instance to be
      updated with the same value of the "active" property of the action #GObject
      instance.

      If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
      if @target_property on @target changes then the @source_property on @source
      will be updated as well.

      The binding will automatically be removed when either the @source or the
      @target instances are finalized. To remove the binding without affecting the
      @source and the @target you can just call g_object_unref() on the returned
      #GBinding instance.

      Removing the binding by calling g_object_unref() on it must only be done if
      the binding, @source and @target are only used from a single thread and it
      is clear that both @source and @target outlive the binding. Especially it
      is not safe to rely on this if the binding, @source or @target can be
      finalized from different threads. Keep another reference to the binding and
      use g_binding_unbind() instead to be on the safe side.

      A #GObject can have multiple bindings.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • bindPropertyFull

      public Binding bindPropertyFull(@Nonnull Str source_property, @Nonnull Pointer target, @Nonnull Str target_property, int flags, Object.OnBindingTransformFunc transform_to, Object.OnBindingTransformFunc transform_from, @Nullable Pointer user_data, Object.OnDestroyNotify notify)
      Complete version of g_object_bind_property().

      Creates a binding between @source_property on @source and @target_property
      on @target, allowing you to set the transformation functions to be used by
      the binding.

      If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
      if @target_property on @target changes then the @source_property on @source
      will be updated as well. The @transform_from function is only used in case
      of bidirectional bindings, otherwise it will be ignored

      The binding will automatically be removed when either the @source or the
      @target instances are finalized. This will release the reference that is
      being held on the #GBinding instance; if you want to hold on to the
      #GBinding instance, you will need to hold a reference to it.

      To remove the binding, call g_binding_unbind().

      A #GObject can have multiple bindings.

      The same @user_data parameter will be used for both @transform_to
      and @transform_from transformation functions; the @notify function will
      be called once, when the binding is removed. If you need different data
      for each transformation function, please use
      g_object_bind_property_with_closures() instead.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      transform_to - the transformation function from the @source to the @target, or %NULL to use the default
      transform_from - the transformation function from the @target to the @source, or %NULL to use the default
      user_data - custom data to be passed to the transformation functions, or %NULL
      notify - a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • bindPropertyFull

      public Binding bindPropertyFull(String source_property, @Nonnull Pointer target, String target_property, int flags, Object.OnBindingTransformFunc transform_to, Object.OnBindingTransformFunc transform_from, @Nullable Pointer user_data, Object.OnDestroyNotify notify)
      Complete version of g_object_bind_property().

      Creates a binding between @source_property on @source and @target_property
      on @target, allowing you to set the transformation functions to be used by
      the binding.

      If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
      if @target_property on @target changes then the @source_property on @source
      will be updated as well. The @transform_from function is only used in case
      of bidirectional bindings, otherwise it will be ignored

      The binding will automatically be removed when either the @source or the
      @target instances are finalized. This will release the reference that is
      being held on the #GBinding instance; if you want to hold on to the
      #GBinding instance, you will need to hold a reference to it.

      To remove the binding, call g_binding_unbind().

      A #GObject can have multiple bindings.

      The same @user_data parameter will be used for both @transform_to
      and @transform_from transformation functions; the @notify function will
      be called once, when the binding is removed. If you need different data
      for each transformation function, please use
      g_object_bind_property_with_closures() instead.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      transform_to - the transformation function from the @source to the @target, or %NULL to use the default
      transform_from - the transformation function from the @target to the @source, or %NULL to use the default
      user_data - custom data to be passed to the transformation functions, or %NULL
      notify - a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • bindPropertyWithClosures

      public Binding bindPropertyWithClosures(@Nonnull Str source_property, @Nonnull Pointer target, @Nonnull Str target_property, int flags, @Nonnull Closure transform_to, @Nonnull Closure transform_from)
      Creates a binding between @source_property on @source and @target_property
      on @target, allowing you to set the transformation functions to be used by
      the binding.

      This function is the language bindings friendly version of
      g_object_bind_property_full(), using #GClosures instead of
      function pointers.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      transform_to - a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
      transform_from - a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • bindPropertyWithClosures

      public Binding bindPropertyWithClosures(String source_property, @Nonnull Pointer target, String target_property, int flags, @Nonnull Closure transform_to, @Nonnull Closure transform_from)
      Creates a binding between @source_property on @source and @target_property
      on @target, allowing you to set the transformation functions to be used by
      the binding.

      This function is the language bindings friendly version of
      g_object_bind_property_full(), using #GClosures instead of
      function pointers.
      Parameters:
      source_property - the property on @source to bind
      target - the target #GObject
      target_property - the property on @target to bind
      flags - flags to pass to #GBinding
      transform_to - a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
      transform_from - a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
      Returns:
      the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
    • connect

      public Pointer connect(@Nonnull Str signal_spec, Object... _elipse)
      A convenience function to connect multiple signals at once.

      The signal specs expected by this function have the form
      "modifier::signal_name", where modifier can be one of the following:
      - signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_DEFAULT)
      - object-signal, object_signal: equivalent to g_signal_connect_object (..., G_CONNECT_DEFAULT)
      - swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
      - swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED)
      - signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
      - object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER)
      - swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
      - swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)
      <!-- language="C" -->
         menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
                                                         "type", GTK_WINDOW_POPUP,
                                                         "child", menu,
                                                         NULL),
                                           "signal::event", gtk_menu_window_event, menu,
                                           "signal::size_request", gtk_menu_window_size_request, menu,
                                           "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
                                           NULL);
       
      Parameters:
      signal_spec - the spec for the first signal
      _elipse - #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
      Returns:
      @object
    • connect

      public Pointer connect(String signal_spec, Object... _elipse)
      A convenience function to connect multiple signals at once.

      The signal specs expected by this function have the form
      "modifier::signal_name", where modifier can be one of the following:
      - signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_DEFAULT)
      - object-signal, object_signal: equivalent to g_signal_connect_object (..., G_CONNECT_DEFAULT)
      - swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
      - swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED)
      - signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
      - object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER)
      - swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
      - swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)
      <!-- language="C" -->
         menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
                                                         "type", GTK_WINDOW_POPUP,
                                                         "child", menu,
                                                         NULL),
                                           "signal::event", gtk_menu_window_event, menu,
                                           "signal::size_request", gtk_menu_window_size_request, menu,
                                           "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
                                           NULL);
       
      Parameters:
      signal_spec - the spec for the first signal
      _elipse - #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
      Returns:
      @object
    • disconnect

      public void disconnect(@Nonnull Str signal_spec, Object... _elipse)
      A convenience function to disconnect multiple signals at once.

      The signal specs expected by this function have the form
      "any_signal", which means to disconnect any signal with matching
      callback and data, or "any_signal::signal_name", which only
      disconnects the signal named "signal_name".
      Parameters:
      signal_spec - the spec for the first signal
      _elipse - #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
    • disconnect

      public void disconnect(String signal_spec, Object... _elipse)
      A convenience function to disconnect multiple signals at once.

      The signal specs expected by this function have the form
      "any_signal", which means to disconnect any signal with matching
      callback and data, or "any_signal::signal_name", which only
      disconnects the signal named "signal_name".
      Parameters:
      signal_spec - the spec for the first signal
      _elipse - #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
    • dupData

      public Pointer dupData(@Nonnull Str key, Object.OnDuplicateFunc dup_func, @Nullable Pointer user_data)
      This is a variant of g_object_get_data() which returns
      a 'duplicate' of the value. @dup_func defines the
      meaning of 'duplicate' in this context, it could e.g.
      take a reference on a ref-counted object.

      If the @key is not set on the object then @dup_func
      will be called with a %NULL argument.

      Note that @dup_func is called while user data of @object
      is locked.

      This function can be useful to avoid races when multiple
      threads are using object data on the same key on the same
      object.
      Parameters:
      key - a string, naming the user data pointer
      dup_func - function to dup the value
      user_data - passed as user_data to @dup_func
      Returns:
      the result of calling @dup_func on the value associated with @key on @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified.
    • dupData

      public Pointer dupData(String key, Object.OnDuplicateFunc dup_func, @Nullable Pointer user_data)
      This is a variant of g_object_get_data() which returns
      a 'duplicate' of the value. @dup_func defines the
      meaning of 'duplicate' in this context, it could e.g.
      take a reference on a ref-counted object.

      If the @key is not set on the object then @dup_func
      will be called with a %NULL argument.

      Note that @dup_func is called while user data of @object
      is locked.

      This function can be useful to avoid races when multiple
      threads are using object data on the same key on the same
      object.
      Parameters:
      key - a string, naming the user data pointer
      dup_func - function to dup the value
      user_data - passed as user_data to @dup_func
      Returns:
      the result of calling @dup_func on the value associated with @key on @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified.
    • dupQdata

      public Pointer dupQdata(int quark, Object.OnDuplicateFunc dup_func, @Nullable Pointer user_data)
      This is a variant of g_object_get_qdata() which returns
      a 'duplicate' of the value. @dup_func defines the
      meaning of 'duplicate' in this context, it could e.g.
      take a reference on a ref-counted object.

      If the @quark is not set on the object then @dup_func
      will be called with a %NULL argument.

      Note that @dup_func is called while user data of @object
      is locked.

      This function can be useful to avoid races when multiple
      threads are using object data on the same key on the same
      object.
      Parameters:
      quark - a #GQuark, naming the user data pointer
      dup_func - function to dup the value
      user_data - passed as user_data to @dup_func
      Returns:
      the result of calling @dup_func on the value associated with @quark on @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified.
    • forceFloating

      public void forceFloating()
      This function is intended for #GObject implementations to re-enforce
      a [floating][floating-ref] object reference. Doing this is seldom
      required: all #GInitiallyUnowneds are created with a floating reference
      which usually just needs to be sunken by calling g_object_ref_sink().
    • freezeNotify

      public void freezeNotify()
      Increases the freeze count on @object. If the freeze count is
      non-zero, the emission of "notify" signals on @object is
      stopped. The signals are queued until the freeze count is decreased
      to zero. Duplicate notifications are squashed so that at most one
      #GObject::notify signal is emitted for each property modified while the
      object is frozen.

      This is necessary for accessors that modify multiple properties to prevent
      premature notification while the object is still being modified.
    • get

      public void get(@Nonnull Str first_property_name, Object... _elipse)
      Gets properties of an object.

      In general, a copy is made of the property contents and the caller
      is responsible for freeing the memory in the appropriate manner for
      the type, for instance by calling g_free() or g_object_unref().

      Here is an example of using g_object_get() to get the contents
      of three properties: an integer, a string and an object:
      <!-- language="C" -->
        gint intval;
        guint64 uint64val;
        gchar *strval;
        GObject *objval;
       
        g_object_get (my_object,
                      "int-property", &intval,
                      "uint64-property", &uint64val,
                      "str-property", &strval,
                      "obj-property", &objval,
                      NULL);
       
        // Do something with intval, uint64val, strval, objval
       
        g_free (strval);
        g_object_unref (objval);
       
      Parameters:
      first_property_name - name of the first property to get
      _elipse - return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
    • get

      public void get(String first_property_name, Object... _elipse)
      Gets properties of an object.

      In general, a copy is made of the property contents and the caller
      is responsible for freeing the memory in the appropriate manner for
      the type, for instance by calling g_free() or g_object_unref().

      Here is an example of using g_object_get() to get the contents
      of three properties: an integer, a string and an object:
      <!-- language="C" -->
        gint intval;
        guint64 uint64val;
        gchar *strval;
        GObject *objval;
       
        g_object_get (my_object,
                      "int-property", &intval,
                      "uint64-property", &uint64val,
                      "str-property", &strval,
                      "obj-property", &objval,
                      NULL);
       
        // Do something with intval, uint64val, strval, objval
       
        g_free (strval);
        g_object_unref (objval);
       
      Parameters:
      first_property_name - name of the first property to get
      _elipse - return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
    • getData

      public Pointer getData(@Nonnull Str key)
      Gets a named field from the objects table of associations (see g_object_set_data()).
      Parameters:
      key - name of the key for that association
      Returns:
      the data if found, or %NULL if no such data exists.
    • getData

      public Pointer getData(String key)
      Gets a named field from the objects table of associations (see g_object_set_data()).
      Parameters:
      key - name of the key for that association
      Returns:
      the data if found, or %NULL if no such data exists.
    • getProperty

      public void getProperty(@Nonnull Str property_name, @Nonnull Value value)
      Gets a property of an object.

      The @value can be:

      - an empty #GValue initialized by %G_VALUE_INIT, which will be
      automatically initialized with the expected type of the property
      (since GLib 2.60)
      - a #GValue initialized with the expected type of the property
      - a #GValue initialized with a type to which the expected type
      of the property can be transformed

      In general, a copy is made of the property contents and the caller is
      responsible for freeing the memory by calling g_value_unset().

      Note that g_object_get_property() is really intended for language
      bindings, g_object_get() is much more convenient for C programming.
      Parameters:
      property_name - the name of the property to get
      value - return location for the property value
    • getProperty

      public void getProperty(String property_name, @Nonnull Value value)
      Gets a property of an object.

      The @value can be:

      - an empty #GValue initialized by %G_VALUE_INIT, which will be
      automatically initialized with the expected type of the property
      (since GLib 2.60)
      - a #GValue initialized with the expected type of the property
      - a #GValue initialized with a type to which the expected type
      of the property can be transformed

      In general, a copy is made of the property contents and the caller is
      responsible for freeing the memory by calling g_value_unset().

      Note that g_object_get_property() is really intended for language
      bindings, g_object_get() is much more convenient for C programming.
      Parameters:
      property_name - the name of the property to get
      value - return location for the property value
    • getQdata

      public Pointer getQdata(int quark)
      This function gets back user data pointers stored via
      g_object_set_qdata().
      Parameters:
      quark - A #GQuark, naming the user data pointer
      Returns:
      The user data pointer set, or %NULL
    • isFloating

      public boolean isFloating()
      Checks whether @object has a [floating][floating-ref] reference.
      Returns:
      %TRUE if @object has a floating reference
    • notify

      public void notify(@Nonnull Str property_name)
      Emits a "notify" signal for the property @property_name on @object.

      When possible, eg. when signaling a property change from within the class
      that registered the property, you should use g_object_notify_by_pspec()
      instead.

      Note that emission of the notify signal may be blocked with
      g_object_freeze_notify(). In this case, the signal emissions are queued
      and will be emitted (in reverse order) when g_object_thaw_notify() is
      called.
      Parameters:
      property_name - the name of a property installed on the class of @object.
    • notify

      public void notify(String property_name)
      Emits a "notify" signal for the property @property_name on @object.

      When possible, eg. when signaling a property change from within the class
      that registered the property, you should use g_object_notify_by_pspec()
      instead.

      Note that emission of the notify signal may be blocked with
      g_object_freeze_notify(). In this case, the signal emissions are queued
      and will be emitted (in reverse order) when g_object_thaw_notify() is
      called.
      Parameters:
      property_name - the name of a property installed on the class of @object.
    • notifyByPspec

      public void notifyByPspec(@Nonnull ParamSpec pspec)
      Emits a "notify" signal for the property specified by @pspec on @object.

      This function omits the property name lookup, hence it is faster than
      g_object_notify().

      One way to avoid using g_object_notify() from within the
      class that registered the properties, and using g_object_notify_by_pspec()
      instead, is to store the GParamSpec used with
      g_object_class_install_property() inside a static array, e.g.:
      <!-- language="C" -->
         typedef enum
         {
           PROP_FOO = 1,
           PROP_LAST
         } MyObjectProperty;
       
         static GParamSpec *properties[PROP_LAST];
       
         static void
         my_object_class_init (MyObjectClass *klass)
         {
           properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
                                                    0, 100,
                                                    50,
                                                    G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
           g_object_class_install_property (gobject_class,
                                            PROP_FOO,
                                            properties[PROP_FOO]);
         }
       


      and then notify a change on the "foo" property with:
      <!-- language="C" -->
         g_object_notify_by_pspec (self, properties[PROP_FOO]);
       
      Parameters:
      pspec - the #GParamSpec of a property installed on the class of @object.
    • ref

      public Pointer ref()
      Increases the reference count of @object.

      Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
      of @object will be propagated to the return type (using the GCC typeof()
      extension), so any casting the caller needs to do on the return type must be
      explicit.
      Returns:
      the same @object
    • refSink

      public Pointer refSink()
      Increase the reference count of @object, and possibly remove the
      [floating][floating-ref] reference, if @object has a floating reference.

      In other words, if the object is floating, then this call "assumes
      ownership" of the floating reference, converting it to a normal
      reference by clearing the floating flag while leaving the reference
      count unchanged. If the object is not floating, then this call
      adds a new normal reference increasing the reference count by one.

      Since GLib 2.56, the type of @object will be propagated to the return type
      under the same conditions as for g_object_ref().
      Returns:
      @object
    • removeToggleRef

      public void removeToggleRef(Object.OnToggleNotify notify, @Nullable Pointer data)
      Removes a reference added with g_object_add_toggle_ref(). The
      reference count of the object is decreased by one.
      Parameters:
      notify - a function to call when this reference is the last reference to the object, or is no longer the last reference.
      data - data to pass to @notify, or %NULL to match any toggle refs with the @notify argument.
    • replaceData

      public boolean replaceData(@Nonnull Str key, @Nullable Pointer oldval, @Nullable Pointer newval, Object.OnDestroyNotify destroy, Object.OnDestroyNotify old_destroy)
      Compares the user data for the key @key on @object with
      @oldval, and if they are the same, replaces @oldval with
      @newval.

      This is like a typical atomic compare-and-exchange
      operation, for user data on an object.

      If the previous value was replaced then ownership of the
      old value (@oldval) is passed to the caller, including
      the registered destroy notify for it (passed out in @old_destroy).
      It’s up to the caller to free this as needed, which may
      or may not include using @old_destroy as sometimes replacement
      should not destroy the object in the normal way.

      See g_object_set_data() for guidance on using a small, bounded set of values
      for @key.
      Parameters:
      key - a string, naming the user data pointer
      oldval - the old value to compare against
      newval - the new value
      destroy - a destroy notify for the new value
      old_destroy - destroy notify for the existing value
      Returns:
      %TRUE if the existing value for @key was replaced by @newval, %FALSE otherwise.
    • replaceData

      public boolean replaceData(String key, @Nullable Pointer oldval, @Nullable Pointer newval, Object.OnDestroyNotify destroy, Object.OnDestroyNotify old_destroy)
      Compares the user data for the key @key on @object with
      @oldval, and if they are the same, replaces @oldval with
      @newval.

      This is like a typical atomic compare-and-exchange
      operation, for user data on an object.

      If the previous value was replaced then ownership of the
      old value (@oldval) is passed to the caller, including
      the registered destroy notify for it (passed out in @old_destroy).
      It’s up to the caller to free this as needed, which may
      or may not include using @old_destroy as sometimes replacement
      should not destroy the object in the normal way.

      See g_object_set_data() for guidance on using a small, bounded set of values
      for @key.
      Parameters:
      key - a string, naming the user data pointer
      oldval - the old value to compare against
      newval - the new value
      destroy - a destroy notify for the new value
      old_destroy - destroy notify for the existing value
      Returns:
      %TRUE if the existing value for @key was replaced by @newval, %FALSE otherwise.
    • replaceQdata

      public boolean replaceQdata(int quark, @Nullable Pointer oldval, @Nullable Pointer newval, Object.OnDestroyNotify destroy, Object.OnDestroyNotify old_destroy)
      Compares the user data for the key @quark on @object with
      @oldval, and if they are the same, replaces @oldval with
      @newval.

      This is like a typical atomic compare-and-exchange
      operation, for user data on an object.

      If the previous value was replaced then ownership of the
      old value (@oldval) is passed to the caller, including
      the registered destroy notify for it (passed out in @old_destroy).
      It’s up to the caller to free this as needed, which may
      or may not include using @old_destroy as sometimes replacement
      should not destroy the object in the normal way.
      Parameters:
      quark - a #GQuark, naming the user data pointer
      oldval - the old value to compare against
      newval - the new value
      destroy - a destroy notify for the new value
      old_destroy - destroy notify for the existing value
      Returns:
      %TRUE if the existing value for @quark was replaced by @newval, %FALSE otherwise.
    • runDispose

      public void runDispose()
      Releases all references to other objects. This can be used to break
      reference cycles.

      This function should only be called from object system implementations.
    • set

      public void set(@Nonnull Str first_property_name, Object... _elipse)
      Sets properties on an object.

      The same caveats about passing integer literals as varargs apply as with
      g_object_new(). In particular, any integer literals set as the values for
      properties of type #gint64 or #guint64 must be 64 bits wide, using the
      %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.

      Note that the "notify" signals are queued and only emitted (in
      reverse order) after all properties have been set. See
      g_object_freeze_notify().
      Parameters:
      first_property_name - name of the first property to set
      _elipse - value for the first property, followed optionally by more name/value pairs, followed by %NULL
    • set

      public void set(String first_property_name, Object... _elipse)
      Sets properties on an object.

      The same caveats about passing integer literals as varargs apply as with
      g_object_new(). In particular, any integer literals set as the values for
      properties of type #gint64 or #guint64 must be 64 bits wide, using the
      %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros.

      Note that the "notify" signals are queued and only emitted (in
      reverse order) after all properties have been set. See
      g_object_freeze_notify().
      Parameters:
      first_property_name - name of the first property to set
      _elipse - value for the first property, followed optionally by more name/value pairs, followed by %NULL
    • setData

      public void setData(@Nonnull Str key, @Nullable Pointer data)
      Each object carries around a table of associations from
      strings to pointers. This function lets you set an association.

      If the object already had an association with that name,
      the old association will be destroyed.

      Internally, the @key is converted to a #GQuark using g_quark_from_string().
      This means a copy of @key is kept permanently (even after @object has been
      finalized) — so it is recommended to only use a small, bounded set of values
      for @key in your program, to avoid the #GQuark storage growing unbounded.
      Parameters:
      key - name of the key
      data - data to associate with that key
    • setData

      public void setData(String key, @Nullable Pointer data)
      Each object carries around a table of associations from
      strings to pointers. This function lets you set an association.

      If the object already had an association with that name,
      the old association will be destroyed.

      Internally, the @key is converted to a #GQuark using g_quark_from_string().
      This means a copy of @key is kept permanently (even after @object has been
      finalized) — so it is recommended to only use a small, bounded set of values
      for @key in your program, to avoid the #GQuark storage growing unbounded.
      Parameters:
      key - name of the key
      data - data to associate with that key
    • setDataFull

      public void setDataFull(@Nonnull Str key, @Nullable Pointer data, Object.OnDestroyNotify destroy)
      Like g_object_set_data() except it adds notification
      for when the association is destroyed, either by setting it
      to a different value or when the object is destroyed.

      Note that the @destroy callback is not called if @data is %NULL.
      Parameters:
      key - name of the key
      data - data to associate with that key
      destroy - function to call when the association is destroyed
    • setDataFull

      public void setDataFull(String key, @Nullable Pointer data, Object.OnDestroyNotify destroy)
      Like g_object_set_data() except it adds notification
      for when the association is destroyed, either by setting it
      to a different value or when the object is destroyed.

      Note that the @destroy callback is not called if @data is %NULL.
      Parameters:
      key - name of the key
      data - data to associate with that key
      destroy - function to call when the association is destroyed
    • setProperty

      public void setProperty(@Nonnull Str property_name, @Nonnull Value value)
      Sets a property on an object.
      Parameters:
      property_name - the name of the property to set
      value - the value
    • setProperty

      public void setProperty(String property_name, @Nonnull Value value)
      Sets a property on an object.
      Parameters:
      property_name - the name of the property to set
      value - the value
    • setQdata

      public void setQdata(int quark, @Nullable Pointer data)
      This sets an opaque, named pointer on an object.
      The name is specified through a #GQuark (retrieved e.g. via
      g_quark_from_static_string()), and the pointer
      can be gotten back from the @object with g_object_get_qdata()
      until the @object is finalized.
      Setting a previously set user data pointer, overrides (frees)
      the old pointer set, using #NULL as pointer essentially
      removes the data stored.
      Parameters:
      quark - A #GQuark, naming the user data pointer
      data - An opaque user data pointer
    • setQdataFull

      public void setQdataFull(int quark, @Nullable Pointer data, Object.OnDestroyNotify destroy)
      This function works like g_object_set_qdata(), but in addition,
      a void (*destroy) (gpointer) function may be specified which is
      called with @data as argument when the @object is finalized, or
      the data is being overwritten by a call to g_object_set_qdata()
      with the same @quark.
      Parameters:
      quark - A #GQuark, naming the user data pointer
      data - An opaque user data pointer
      destroy - Function to invoke with @data as argument, when @data needs to be freed
    • stealData

      public Pointer stealData(@Nonnull Str key)
      Remove a specified datum from the object's data associations,
      without invoking the association's destroy handler.
      Parameters:
      key - name of the key
      Returns:
      the data if found, or %NULL if no such data exists.
    • stealData

      public Pointer stealData(String key)
      Remove a specified datum from the object's data associations,
      without invoking the association's destroy handler.
      Parameters:
      key - name of the key
      Returns:
      the data if found, or %NULL if no such data exists.
    • stealQdata

      public Pointer stealQdata(int quark)
      This function gets back user data pointers stored via
      g_object_set_qdata() and removes the @data from object
      without invoking its destroy() function (if any was
      set).
      Usually, calling this function is only required to update
      user data pointers with a destroy notifier, for example:
      <!-- language="C" -->
       void
       object_add_to_user_list (GObject     *object,
                                const gchar *new_string)
       {
         // the quark, naming the object data
         GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
         // retrieve the old string list
         GList *list = g_object_steal_qdata (object, quark_string_list);
       
         // prepend new string
         list = g_list_prepend (list, g_strdup (new_string));
         // this changed 'list', so we need to set it again
         g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
       }
       static void
       free_string_list (gpointer data)
       {
         GList *node, *list = data;
       
         for (node = list; node; node = node->next)
           g_free (node->data);
         g_list_free (list);
       }
       

      Using g_object_get_qdata() in the above example, instead of
      g_object_steal_qdata() would have left the destroy function set,
      and thus the partial string list would have been freed upon
      g_object_set_qdata_full().
      Parameters:
      quark - A #GQuark, naming the user data pointer
      Returns:
      The user data pointer set, or %NULL
    • takeRef

      public Pointer takeRef()
      If @object is floating, sink it. Otherwise, do nothing.

      In other words, this function will convert a floating reference (if
      present) into a full reference.

      Typically you want to use g_object_ref_sink() in order to
      automatically do the correct thing with respect to floating or
      non-floating references, but there is one specific scenario where
      this function is helpful.

      The situation where this function is helpful is when creating an API
      that allows the user to provide a callback function that returns a
      GObject. We certainly want to allow the user the flexibility to
      return a non-floating reference from this callback (for the case
      where the object that is being returned already exists).

      At the same time, the API style of some popular GObject-based
      libraries (such as Gtk) make it likely that for newly-created GObject
      instances, the user can be saved some typing if they are allowed to
      return a floating reference.

      Using this function on the return value of the user's callback allows
      the user to do whichever is more convenient for them. The caller will
      alway receives exactly one full reference to the value: either the
      one that was returned in the first place, or a floating reference
      that has been converted to a full reference.

      This function has an odd interaction when combined with
      g_object_ref_sink() running at the same time in another thread on
      the same #GObject instance. If g_object_ref_sink() runs first then
      the result will be that the floating reference is converted to a hard
      reference. If g_object_take_ref() runs first then the result will be
      that the floating reference is converted to a hard reference and an
      additional reference on top of that one is added. It is best to avoid
      this situation.
      Returns:
      @object
    • thawNotify

      public void thawNotify()
      Reverts the effect of a previous call to
      g_object_freeze_notify(). The freeze count is decreased on @object
      and when it reaches zero, queued "notify" signals are emitted.

      Duplicate notifications for each property are squashed so that at most one
      #GObject::notify signal is emitted for each property, in the reverse order
      in which they have been queued.

      It is an error to call this function when the freeze count is zero.
    • unref

      public void unref()
      Decreases the reference count of @object. When its reference count
      drops to 0, the object is finalized (i.e. its memory is freed).

      If the pointer to the #GObject may be reused in future (for example, if it is
      an instance variable of another object), it is recommended to clear the
      pointer to %NULL rather than retain a dangling pointer to a potentially
      invalid #GObject instance. Use g_clear_object() for this.
    • watchClosure

      public void watchClosure(@Nonnull Closure closure)
      This function essentially limits the life time of the @closure to
      the life time of the object. That is, when the object is finalized,
      the @closure is invalidated by calling g_closure_invalidate() on
      it, in order to prevent invocations of the closure with a finalized
      (nonexisting) object. Also, g_object_ref() and g_object_unref() are
      added as marshal guards to the @closure, to ensure that an extra
      reference count is held on @object during invocation of the
      @closure. Usually, this function will be called on closures that
      use this @object as closure data.
      Parameters:
      closure - #GClosure to watch
    • weakRef

      public void weakRef(Object.OnWeakNotify notify, @Nullable Pointer data)
      Adds a weak reference callback to an object. Weak references are
      used for notification when an object is disposed. They are called
      "weak references" because they allow you to safely hold a pointer
      to an object without calling g_object_ref() (g_object_ref() adds a
      strong reference, that is, forces the object to stay alive).

      Note that the weak references created by this method are not
      thread-safe: they cannot safely be used in one thread if the
      object's last g_object_unref() might happen in another thread.
      Use #GWeakRef if thread-safety is required.
      Parameters:
      notify - callback to invoke before the object is freed
      data - extra data to pass to notify
    • weakUnref

      public void weakUnref(Object.OnWeakNotify notify, @Nullable Pointer data)
      Removes a weak reference callback to an object.
      Parameters:
      notify - callback to search for
      data - data to search for
    • onNotify

      public SignalHandler onNotify(Object.OnNotify signal)
      Connect to signal "notify".
      See Object.OnNotify.onNotify(ch.bailu.gtk.gobject.ParamSpec) for signal description.
      Field SIGNAL_ON_NOTIFY contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • compatControl

      public static long compatControl(long what, @Nullable Pointer data)
      Parameters:
      what -
      data -
      Returns:
    • interfaceFindProperty

      public static ParamSpec interfaceFindProperty(@Nonnull Pointer g_iface, @Nonnull Str property_name)
      Find the #GParamSpec with the given name for an
      interface. Generally, the interface vtable passed in as @g_iface
      will be the default vtable from g_type_default_interface_ref(), or,
      if you know the interface has already been loaded,
      g_type_default_interface_peek().
      Parameters:
      g_iface - any interface vtable for the interface, or the default vtable for the interface
      property_name - name of a property to look up.
      Returns:
      the #GParamSpec for the property of the interface with the name @property_name, or %NULL if no such property exists.
    • interfaceInstallProperty

      public static void interfaceInstallProperty(@Nonnull Pointer g_iface, @Nonnull ParamSpec pspec)
      Add a property to an interface; this is only useful for interfaces
      that are added to GObject-derived types. Adding a property to an
      interface forces all objects classes with that interface to have a
      compatible property. The compatible property could be a newly
      created #GParamSpec, but normally
      g_object_class_override_property() will be used so that the object
      class only needs to provide an implementation and inherits the
      property description, default value, bounds, and so forth from the
      interface property.

      This function is meant to be called from the interface's default
      vtable initialization function (the @class_init member of
      #GTypeInfo.) It must not be called after after @class_init has
      been called for any object types implementing this interface.

      If @pspec is a floating reference, it will be consumed.
      Parameters:
      g_iface - any interface vtable for the interface, or the default vtable for the interface.
      pspec - the #GParamSpec for the new property
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()