### ----------------------------------------------------
### -- Gnome::Gio
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gio/Application.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
:
=begin pod
=head2 open

Opens the given files.
In essence, this results in the I<open> signal being emitted in the primary instance. I<$hint> is simply passed through to the I<open> signal. It is intended to be used by applications that have multiple modes for opening files (eg: "view" vs "edit", etc). Unless you have a need for this functionality, you should use "". The application must be registered before calling this function and it must have the C<G_APPLICATION_HANDLES_OPEN> flag set.

  method open ( Array[Str] $files, Str $hint )

=item Array[Str] $files; an array of filenames to open
=item Str $hint; a hint (or ""), but never C<undefined>.

=end pod

method open ( Array $files, Str $hint ) {
  my Int $n_files = $files.elems;
  return unless $n_files;

  my $fa = CArray[N-GFile].new();
  my Int $i = 0;
  for @$files -> $file {
    if $file ~~ m/ '://' / {
      $fa[$i++] =
        Gnome::Gio::File.new(:uri($file))._get-native-object-no-reffing;
    }

    else {
      $fa[$i++] =
        Gnome::Gio::File.new(:path($file))._get-native-object-no-reffing;
    }
  }

  g_application_open(
    self._get-native-object-no-reffing, $fa, $n_files, $hint
  );
}

sub g_application_open (
  N-GObject $application, CArray[N-GFile] $files, gint $n_files, gchar-ptr $hint
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:quit:ex-application.raku
=begin pod
=head2 quit

Immediately quits the application.
Upon return to the mainloop, C<run()> will return, calling only the 'shutdown' function before doing so. The hold count is ignored. Take care if your code has called C<hold()> on the application and is therefore still expecting it to exist. (Note that you may have called C<hold()> indirectly, for example through C<add-window()>.) The result of calling C<run()> again after it returns is unspecified.

  method quit ( )

=end pod

method quit ( ) {
  g_application_quit(
    self._get-native-object-no-reffing,
  );
}

sub g_application_quit ( N-GObject $application  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:register:
=begin pod
=head2 register

Attempts registration of the application. This is the point at which the application discovers if it is the primary instance or merely acting as a remote for an already-existing primary instance.

This is implemented by attempting to acquire the application identifier as a unique bus name on the session bus using GDBus. If there is no application ID or if C<G_APPLICATION_NON_UNIQUE> was given, then this process will always become the primary instance.  Due to the internal architecture of GDBus, method calls can be dispatched at any time (even if a main loop is not running).
For this reason, you must ensure that any object paths that you wish to register are registered before calling this function.  If the application has already been registered then an invalid error object is returned with no work performed.

The I<startup> signal is emitted if registration succeeds and the application is the primary instance (including the non-unique case).  In the event of an error (such as I<cancellable> being cancelled, or a failure to connect to the session bus), then the error object is set appropriately.  Note: the return value of this function is not an indicator that this instance is or is not the primary instance of the application.  See C<get-is-remote()> for that.

Returns: Gnome::Glib::Error. if registration succeeded the error object is invalid.

  method register ( N-GObject $cancellable --> Gnome::Glib::Error )

=item N-GObject $cancellable; a B<N-GObject>, or C<undefined>

=end pod

method register ( N-GObject $cancellable = N-GObject --> Gnome::Glib::Error ) {

  my CArray[N-GError] $e .= new(N-GError);
  my $r = g_application_register(
    self._get-native-object-no-reffing, $cancellable, $e
  );

  my Gnome::Glib::Error $error;
  if $r {
    $error .= new(:native-object($e[0]));
  }

  else {
    $error .= new(:native-object(N-GError));
  }

  $error
}

sub g_application_register (
  N-GObject $application, N-GObject $cancellable,
  CArray[N-GError] $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:release:ex-application.raku
=begin pod
=head2 release

Decrease the use count of the application.  When the use count reaches zero, the application will stop running.  Never call this function except to cancel the effect of a previous call to C<hold()>.

  method release ( )


=end pod

method release ( ) {

  g_application_release(
    self._get-native-object-no-reffing,
  );
}

sub g_application_release ( N-GObject $application  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:run:ex-application.pl6
=begin pod
=head2 run

Runs the application.

This function is intended to be run from C<main()> and its return value is intended to be returned by your main program.

B<Gnome::Gio::Application> will attempt to parse the commandline arguments read from `@*ARGS`. You can add commandline flags to the list of recognized options by way of C<add-main-option-entries()>. After this, the I<handle-local-options> signal is emitted, from which the application can inspect the values of its B<N-GOptionEntrys>.

I<handle-local-options> is a good place to handle options such as `--version`, where an immediate reply from the local process is desired (instead of communicating with an already-running instance). A  I<handle-local-options> handler can stop further processing by returning a non-negative value, which then becomes the exit status of the process.

What happens next depends on the flags: if C<G_APPLICATION_HANDLES_COMMAND_LINE> was specified then the remaining commandline arguments are sent to the primary instance, where a I<command-line> signal is emitted.  Otherwise, the remaining commandline arguments are assumed to be a list of files. If there are no files listed, the application is activated via the I<activate> signal. If there are one or more files, and C<G_APPLICATION_HANDLES_OPEN> was specified then the files are opened via the  I<open> signal.

=begin comment
If you are interested in doing more complicated local handling of the commandline then you should implement your own B<Gnome::Gio::Application> subclass and override C<local_command_line()>. In this case, you most likely want to return C<1> from your C<local_command_line()> implementation to suppress the default handling. See Gnome::Gio::Application-example-cmdline2.c for an example.
=end comment

If, after the above is done, the use count of the application is zero then the exit status is returned immediately.  If the use count is non-zero then the default main context is iterated until the use count falls to zero, at which point 0 is returned.

If the C<G_APPLICATION_IS_SERVICE> flag is set, then the service will run for as much as 10 seconds with a use count of zero while waiting for the message that caused the activation to arrive. When a message arrives, the use count is increased. After that, if the use count falls back to zero or stays zero, the application will exit immediately, except in the case that C<g_application_set_inactivity_timeout()> is in use.

=comment This function sets the program name (C<g_set_prgname()>), if not already set, to the basename of argv[0] which is set when C<run()> is called.

Much like C<run()> from B<Gnome::Glib::MainLoop>, this function will acquire the main context for the duration that the application is running.

=comment Applications that are not explicitly flagged as services or launchers (ie: neither C<G_APPLICATION_IS_SERVICE> or C<G_APPLICATION_IS_LAUNCHER> are given as flags) will check (from the default handler for local_command_line)

Applications that are not explicitly flagged as services or launchers will check if "--gapplication-service" was given in the command line.  If this flag is present then normal commandline processing is interrupted and the C<G_APPLICATION_IS_SERVICE> flag is set.  This provides a "compromise" solution whereby running an application directly from the commandline will invoke it in the normal way (which can be useful for debugging) while still allowing applications to be D-Bus activated in service mode.  The D-Bus service file should invoke the executable with "--gapplication-service" as the sole commandline argument.  This approach is suitable for use by most graphical applications but should not be used from applications like editors that need precise control over when processes invoked via the commandline will exit and what their exit status will be.

Returns: the exit status

  method run ( --> Int )

=end pod

method run ( --> Int ) {

  my Int $argc = 1 + @*ARGS.elems;

  my $argv = CArray[Str].new;
  my Int $arg-count = 0;
  $argv[$arg-count++] = $*PROGRAM.Str;
  for @*ARGS -> $arg {
    $argv[$arg-count++] = $arg;
  }

  g_application_run(
    self._get-native-object-no-reffing, $argc, $argv
  );
}

sub g_application_run (
  N-GObject $application, gint $argc, gchar-pptr $argv --> gint
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:send-notification:ex-application.pl6
=begin pod
=head2 send-notification

Sends a notification on behalf of the application to the desktop shell. There is no guarantee that the notification is displayed immediately, or even at all.  Notifications may persist after the application exits. It will be D-Bus-activated when the notification or one of its actions is activated.  Modifying I<notification> after this call has no effect. However, the object can be reused for a later call to this function.  I<id> may be any string that uniquely identifies the event for the application. It does not need to be in any special format. For example, "new-message" might be appropriate for a notification about new messages.  If a previous notification was sent with the same I<id>, it will be replaced with I<notification> and shown again as if it was a new notification. This works even for notifications sent from a previous execution of the application, as long as I<id> is the same string.  I<id> may be C<undefined>, but it is impossible to replace or withdraw notifications without an id.  If I<notification> is no longer relevant, it can be withdrawn with C<g_application_withdraw_notification()>.

  method send-notification ( Str $id, N-GObject $notification )

=item Str $id; id of the notification, or C<undefined>
=item N-GObject $notification; the B<GNotification> to send

=end pod

method send-notification ( Str $id, $notification is copy ) {
  $notification .= _get-native-object-no-reffing
    unless $notification ~~ N-GObject;

  g_application_send_notification(
    self._get-native-object-no-reffing, $id, $notification
  );
}

sub g_application_send_notification ( N-GObject $application, gchar-ptr $id, N-GObject $notification  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-application-id:
=begin pod
=head2 set-application-id

Sets the unique identifier for the application.  The application id can only be modified if the application has not yet been registered. If defined, the application id must be valid.  See C<id-is-valid()>.

  method set-application-id (Str$application_id )

=item Str $application_id; the identifier for the application

=end pod

method set-application-id ( Str $application_id ) {

  g_application_set_application_id(
    self._get-native-object-no-reffing, $application_id
  );
}

sub g_application_set_application_id ( N-GObject $application, gchar-ptr $application_id  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-default:
=begin pod
=head2 set-default

Sets or unsets the default application for the process, as returned by C<g_application_get_default()>.  This function does not take its own reference on the application.  If the application is destroyed then the default application will revert back to C<undefined>.

  method set-default ( )


=end pod

method set-default ( ) {

  g_application_set_default(
    self._get-native-object-no-reffing,
  );
}

sub g_application_set_default ( N-GObject $application  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-flags:
=begin pod
=head2 set-flags

Sets the flags for the application.  The flags can only be modified if the application has not yet been registered.  See B<GApplicationFlags>.

  method set-flags ( Int $flags )

=item Int $flags; an ored mask of GApplicationFlags for the application

=end pod

method set-flags ( Int $flags ) {
  g_application_set_flags(
    self._get-native-object-no-reffing, $flags.Int
  );
}

sub g_application_set_flags ( N-GObject $application, GEnum $flags  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-inactivity-timeout:
=begin pod
=head2 set-inactivity-timeout

Sets the current inactivity timeout for the application.  This is the amount of time (in milliseconds) after the last call to C<g_application_release()> before the application stops running.  This call has no side effects of its own.  The value set here is only used for next time C<g_application_release()> drops the use count to zero.  Any timeouts currently in progress are not impacted.

  method set-inactivity-timeout ( UInt $inactivity_timeout )

=item UInt $inactivity_timeout; the timeout, in milliseconds

=end pod

method set-inactivity-timeout ( UInt $inactivity_timeout ) {

  g_application_set_inactivity_timeout(
    self._get-native-object-no-reffing, $inactivity_timeout
  );
}

sub g_application_set_inactivity_timeout ( N-GObject $application, guint $inactivity_timeout  )
  is native(&gio-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:set-option-context-description:
=begin pod
=head2 set-option-context-description

Adds a description to the the application option context.  See C<g_option_context_set_description()> for more information.

  method set-option-context-description ( Str $description )

=item Str $description; (nullable): a string to be shown in `--help` output after the list of options, or C<undefined>

=end pod

method set-option-context-description ( Str $description ) {

  g_application_set_option_context_description(
    self._get-native-object-no-reffing, $description
  );
}

sub g_application_set_option_context_description ( N-GObject $application, gchar-ptr $description  )
  is native(&gio-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:set-option-context-parameter-string:
=begin pod
=head2 set-option-context-parameter-string

Sets the parameter string to be used by the commandline handling of the application.  This function registers the argument to be passed to C<g_option_context_new()> when the internal B<GOptionContext> of the application is created.  See C<g_option_context_new()> for more information about I<parameter_string>.

  method set-option-context-parameter-string ( Str $parameter_string )

=item Str $parameter_string; (nullable): a string which is displayed in the first line of `--help` output, after the usage summary `programname [OPTION...]`.

=end pod

method set-option-context-parameter-string ( Str $parameter_string ) {

  g_application_set_option_context_parameter_string(
    self._get-native-object-no-reffing, $parameter_string
  );
}

sub g_application_set_option_context_parameter_string ( N-GObject $application, gchar-ptr $parameter_string  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-option-context-summary:
=begin pod
=head2 set-option-context-summary

Adds a summary to the the application option context.  See C<g_option_context_set_summary()> for more information.

  method set-option-context-summary ( Str $summary )

=item Str $summary; (nullable): a string to be shown in `--help` output before the list of options, or C<undefined>

=end pod

method set-option-context-summary ( Str $summary ) {

  g_application_set_option_context_summary(
    self._get-native-object-no-reffing, $summary
  );
}

sub g_application_set_option_context_summary ( N-GObject $application, gchar-ptr $summary  )
  is native(&gio-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:set-resource-base-path:
=begin pod
=head2 set-resource-base-path

Sets (or unsets) the base resource path of the application.  The path is used to automatically load various [application resources][gresource] such as menu layouts and action descriptions. The various types of resources will be found at fixed names relative to the given base path.  By default, the resource base path is determined from the application ID by prefixing '/' and replacing each '.' with '/'.  This is done at the time that the B<GApplication> object is constructed.  Changes to the application ID after that point will not have an impact on the resource base path.  As an example, if the application has an ID of "org.example.app" then the default resource base path will be "/org/example/app".  If this is a B<Gnome::Gtk3::Application> (and you have not manually changed the path) then B<Gnome::Gtk3:: will> then search for the menus of the application at "/org/example/app/gtk/menus.ui".  See B<GResource> for more information about adding resources to your application.  You can disable automatic resource loading functionality by setting the path to C<undefined>.  Changing the resource base path once the application is running is not recommended.  The point at which the resource path is consulted for forming paths for various purposes is unspecified.  When writing a sub-class of B<GApplication> you should either set the  I<resource-base-path> property at construction time, or call this function during the instance initialization. Alternatively, you can call this function in the B<GApplicationClass>.startup virtual function, before chaining up to the parent implementation.

  method set-resource-base-path ( Str $resource_path )

=item Str $resource_path; (nullable): the resource path to use

=end pod

method set-resource-base-path ( Str $resource_path ) {

  g_application_set_resource_base_path(
    self._get-native-object-no-reffing, $resource_path
  );
}

sub g_application_set_resource_base_path ( N-GObject $application, gchar-ptr $resource_path  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unbind-busy-property:
=begin pod
=head2 unbind-busy-property

Destroys a binding between I<property> and the busy state of the application that was previously created with C<g_application_bind_busy_property()>.

  method unbind-busy-property ( Pointer $object, Str $property )

=item Pointer $object; (type GObject.Object): a B<GObject>
=item Str $property; the name of a boolean property of I<object>

=end pod

method unbind-busy-property ( Pointer $object, Str $property ) {

  g_application_unbind_busy_property(
    self._get-native-object-no-reffing, $object, $property
  );
}

sub g_application_unbind_busy_property ( N-GObject $application, gpointer $object, gchar-ptr $property  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unmark-busy:
=begin pod
=head2 unmark-busy

Decreases the busy count of the application.  When the busy count reaches zero, the new state will be propagated to other processes.  This function must only be called to cancel the effect of a previous call to C<g_application_mark_busy()>.

  method unmark-busy ( )


=end pod

method unmark-busy ( ) {

  g_application_unmark_busy(
    self._get-native-object-no-reffing,
  );
}

sub g_application_unmark_busy ( N-GObject $application  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:4:withdraw-notification:ex-application.pl6
=begin pod
=head2 withdraw-notification

Withdraws a notification that was sent with C<g_application_send_notification()>.  This call does nothing if a notification with I<id> doesn't exist or the notification was never sent.  This function works even for notifications sent in previous executions of this application, as long I<id> is the same as it was for the sent notification.  Note that notifications are dismissed when the user clicks on one of the buttons in a notification or triggers its default action, so there is no need to explicitly withdraw the notification in that case.

  method withdraw-notification ( Str $id )

=item Str $id; id of a previously sent notification

=end pod

method withdraw-notification ( Str $id ) {

  g_application_withdraw_notification(
    self._get-native-object-no-reffing, $id
  );
}

sub g_application_withdraw_notification ( N-GObject $application, gchar-ptr $id  )
  is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:_g_application_new:
#`{{
=begin pod
=head2 _g_application_new

Creates a new B<GApplication> instance.  If non-C<undefined>, the application id must be valid.  See C<g_application_id_is_valid()>.  If no application ID is given then some features of B<GApplication> (most notably application uniqueness) will be disabled.

Returns: a new B<GApplication> instance

  method _g_application_new ( Str $application_id, GApplicationFlags $flags --> GApplication )

=item Str $application_id; (nullable): the application id
=item GApplicationFlags $flags; the application flags

=end pod
}}

sub _g_application_new ( gchar-ptr $application_id, GEnum $flags --> N-GObject )
  is native(&gio-lib)
  is symbol('g_application_new')
  { * }


#-------------------------------------------------------------------------------
=begin pod
=head1 Signals

There are two ways to connect to a signal. The first option you have is to use C<register-signal()> from B<Gnome::GObject::Object>. The second option is to use C<connect-object()> directly from B<Gnome::GObject::Signal>.

=head2 First method

The positional arguments of the signal handler are all obligatory as well as their types. The named attributes C<:$widget> and user data are optional.

  # handler method
  method mouse-event ( GdkEvent $event, :$widget ) { ... }

  # connect a signal on window object
  my Gnome::Gtk3::Window $w .= new( ... );
  $w.register-signal( self, 'mouse-event', 'button-press-event');

=head2 Second method

  my Gnome::Gtk3::Window $w .= new( ... );
  my Callable $handler = sub (
    N-GObject $native, GdkEvent $event, OpaquePointer $data
  ) {
    ...
  }

  $w.connect-object( 'button-press-event', $handler);

Also here, the types of positional arguments in the signal handler are important. This is because both methods C<register-signal()> and C<connect-object()> are using the signatures of the handler routines to setup the native call interface.

=head2 Supported signals


=comment -----------------------------------------------------------------------
=comment #TS:1:activate:
=head3 activate

The I<activate> signal is emitted on the primary instance when an
activation occurs. See C<activate()>.

  method handler (
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
  );

=item $application; the application


=comment -----------------------------------------------------------------------
=comment #TS:4:command-line:ex-application.raku
=head3 command-line

The I<command-line> signal is emitted on the primary instance when
a commandline is not handled locally. See C<run()> and
the B<GApplicationCommandLine> documentation for more information.

Returns: An integer that is set as the exit status for the calling
process. See C<g_application_command_line_set_exit_status()>.

  method handler (
    N-GObject $command_line,
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
    --> Int
  );

=item $application; the application, a B<Gnome::Gio::Application> object.

=item N-GObject $command_line; A native B<Gnome::Gio::ApplicationCommandLine> representing the
# A native Gnome::Gio::ApplicationCommandLine object
passed commandline

=comment -----------------------------------------------------------------------
=comment #TS:4:handle-local-options:ex-application.raku
=head3 handle-local-options

The I<handle-local-options> signal is emitted on the local instance
after the parsing of the commandline options has occurred.

You can add options to be recognised during commandline option
parsing using C<g_application_add_main_option_entries()> and
C<g_application_add_option_group()>.

Signal handlers can inspect I<options> (along with values pointed to
from the I<arg_data> of an installed B<GOptionEntrys>) in order to
decide to perform certain actions, including direct local handling
(which may be useful for options like --version).

In the event that the application is marked
C<G_APPLICATION_HANDLES_COMMAND_LINE> the "normal processing" will
send the I<options> dictionary to the primary instance where it can be
read with C<g_application_command_line_get_options_dict()>.  The signal
handler can modify the dictionary before returning, and the
modified dictionary will be sent.

In the event that C<G_APPLICATION_HANDLES_COMMAND_LINE> is not set,
"normal processing" will treat the remaining uncollected command
line arguments as filenames or URIs.  If there are no arguments,
the application is activated by C<g_application_activate()>.  One or
more arguments results in a call to C<g_application_open()>.

If you want to handle the local commandline arguments for yourself
by converting them to calls to C<g_application_open()> or
C<g_action_group_activate_action()> then you must be sure to register
the application first.  You should probably not call
C<g_application_activate()> for yourself, however: just return -1 and
allow the default handler to do it for you.  This will ensure that
the `--gapplication-service` switch works properly (i.e. no activation
in that case).

Note that this signal is emitted from the default implementation of
C<local_command_line()>.  If you override that function and don't
chain up then this signal will never be emitted.

You can override C<local_command_line()> if you need more powerful
capabilities than what is provided here, but this should not
normally be required.

Returns: an exit code. If you have handled your options and want
to exit the process, return a non-negative option, 0 for success,
and a positive value for failure. To continue, return -1 to let
the default option processing continue.


  method handler (
    N-GObject $options,
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
    --> Int
  );

=item $application; the application

=item $options; the options dictionary


=comment -----------------------------------------------------------------------
=comment #TS:0:name-lost:
=head3 name-lost

The I<name-lost> signal is emitted only on the registered primary instance
when a new instance has taken over. This can only happen if the application
is using the C<G_APPLICATION_ALLOW_REPLACEMENT> flag.

The default handler for this signal calls C<g_application_quit()>.

Returns: C<True> if the signal has been handled


  method handler (
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
    --> Int
  );

=item $application; the application


=comment -----------------------------------------------------------------------
=comment #TS:0:open:
=head3 open

The I<open> signal is emitted on the primary instance when there are
files to open. See C<open()> for more information.

  method handler (
    CArray[N-GFile] $files, Int $n_files, Str $hint,
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
  );

=item $application; the application
=item $files; (array length=n_files) an array of B<N-GFiles>
=item $n_files; the length of I<files>
=item $hint; a hint provided by the calling instance


=comment -----------------------------------------------------------------------
=comment #TS:4:shutdown:ex-application.raku
=head3 shutdown

The I<shutdown> signal is emitted only on the registered primary instance
immediately after the main loop terminates.

  method handler (
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
  );

=item $application; the application


=comment -----------------------------------------------------------------------
=comment #TS:4:startup:ex-application.raku
=head3 startup

The I<startup> signal is emitted on the primary instance immediately
after registration. See C<g_application_register()>.

  method handler (
    Int :$_handle_id,
    Gnome::GObject::Object :_widget($application),
    *%user-options
  );

=item $application; the application


=end pod

#-------------------------------------------------------------------------------
=begin pod
=head1 Properties

An example of using a string type property of a B<Gnome::Gtk3::Label> object. This is just showing how to set/read a property, not that it is the best way to do it. This is because a) The class initialization often provides some options to set some of the properties and b) the classes provide many methods to modify just those properties. In the case below one can use B<new(:label('my text label'))> or B<gtk_label_set_text('my text label')>.

  my Gnome::Gtk3::Label $label .= new;
  my Gnome::GObject::Value $gv .= new(:init(G_TYPE_STRING));
  $label.g-object-get-property( 'label', $gv);
  $gv.g-value-set-string('my text label');

=head2 Supported properties

=comment -----------------------------------------------------------------------
=comment #TP:0:action-group:
=head3 Action group: action-group

The group of actions that the application exports
Widget type: G-TYPE-ACTION-GROUP

The B<Gnome::GObject::Value> type of property I<action-group> is C<G_TYPE_OBJECT>.

=comment -----------------------------------------------------------------------
=comment #TP:1:application-id:
=head3 Application identifier: application-id

The unique identifier for the application
Default value: Any

The B<Gnome::GObject::Value> type of property I<application-id> is C<G_TYPE_STRING>.

=comment -----------------------------------------------------------------------
=comment #TP:0:flags:
=head3 Application flags: flags


The B<Gnome::GObject::Value> type of property I<flags> is C<G_TYPE_FLAGS>.

=comment -----------------------------------------------------------------------
=comment #TP:1:inactivity-timeout:
=head3 Inactivity timeout: inactivity-timeout


The B<Gnome::GObject::Value> type of property I<inactivity-timeout> is C<G_TYPE_UINT>.

=comment -----------------------------------------------------------------------
=comment #TP:1:is-busy:
=head3 Is busy: is-busy


Whether the application is currently marked as busy
=comment through [[mark-busy]] or [[g-application-bind-busy-property]].

The B<Gnome::GObject::Value> type of property I<is-busy> is C<G_TYPE_BOOLEAN>.

=comment -----------------------------------------------------------------------
=comment #TP:1:is-registered:
=head3 Is registered: is-registered

If register( has been called)
Default value: False

The B<Gnome::GObject::Value> type of property I<is-registered> is C<G_TYPE_BOOLEAN>.

=comment -----------------------------------------------------------------------
=comment #TP:1:is-remote:
=head3 Is remote: is-remote

If this application instance is remote
Default value: False

The B<Gnome::GObject::Value> type of property I<is-remote> is C<G_TYPE_BOOLEAN>.

=comment -----------------------------------------------------------------------
=comment #TP:0:resource-base-path:
=head3 Resource base path: resource-base-path

The base resource path for the application
Default value: Any

The B<Gnome::GObject::Value> type of property I<resource-base-path> is C<G_TYPE_STRING>.
=end pod


