### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Application.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
-object,
    *%user-options
  )

=item $application; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:window-added:
=head2 window-added

Emitted when a B<Gnome::Gtk3::Window> is added to I<application> through
C<add_window()>.

  method handler (
    Unknown type: GTK_TYPE_WINDOW $window,
    Gnome::Gtk3::Application :_widget($application),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $window; the newly-added B<Gnome::Gtk3::Window>
=item $application; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:window-removed:
=head2 window-removed

Emitted when a B<Gnome::Gtk3::Window> is removed from I<application>,
either as a side-effect of being destroyed or explicitly
through C<remove_window()>.

  method handler (
    Unknown type: GTK_TYPE_WINDOW $window,
    Gnome::Gtk3::Application :_widget($application),
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $window; the B<Gnome::Gtk3::Window> that is being removed
=item $application; The instance which registered the signal
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=end pod

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

=comment -----------------------------------------------------------------------
=comment #TP:0:active-window:
=head2 active-window

The window which most recently had focus

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

=item Parameter is readable.


=comment -----------------------------------------------------------------------
=comment #TP:0:app-menu:
=head2 app-menu

The GMenuModel for the application menu

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

=item Parameter is readable and writable.


=comment -----------------------------------------------------------------------
=comment #TP:0:menubar:
=head2 menubar

The GMenuModel for the menubar

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

=item Parameter is readable and writable.


=comment -----------------------------------------------------------------------
=comment #TP:0:register-session:
=head2 register-session

Register with the session manager

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

=item Parameter is readable and writable.
=item Default value is FALSE.


=comment -----------------------------------------------------------------------
=comment #TP:0:screensaver-active:
=head2 screensaver-active

Whether the screensaver is active

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

=item Parameter is readable.
=item Default value is FALSE.

=end pod




=finish

#-------------------------------------------------------------------------------
=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:0:query-end:
=head3 query-end

Emitted when the session manager is about to end the session, only
if  I<register-session> is C<True>. Applications can
connect to this signal and call C<inhibit()> with
C<GTK-APPLICATION-INHIBIT-LOGOUT> to delay the end of the session
until state has been saved.


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

=item $application; the B<Gnome::Gtk3::Application> which emitted the signal

=item $_handle_id; the registered event handler id

=comment -----------------------------------------------------------------------
=comment #TS:0:window-added:
=head3 window-added

Emitted when a B<Gnome::Gtk3::Window> is added to I<application> through
C<add-window()>.


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

=item $application; the B<Gnome::Gtk3::Application> which emitted the signal

=item $window; the newly-added B<Gnome::Gtk3::Window>

=item $_handle_id; the registered event handler id

=comment -----------------------------------------------------------------------
=comment #TS:0:window-removed:
=head3 window-removed

Emitted when a B<Gnome::Gtk3::Window> is removed from I<application>,
either as a side-effect of being destroyed or explicitly
through C<remove-window()>.


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

=item $application; the B<Gnome::Gtk3::Application> which emitted the signal

=item $window; the B<Gnome::Gtk3::Window> that is being removed

=item $_handle_id; the registered event handler id

=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<.set-text('my text label')>.

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

=head2 Supported properties

=comment -----------------------------------------------------------------------
=comment #TP:0:active-window:
=head3 Active window: active-window

The window which most recently had focus
Widget type: GTK-TYPE-WINDOW

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

=comment -----------------------------------------------------------------------
=comment #TP:0:app-menu:
=head3 Application menu: app-menu

The N-GObject for the application menu
Widget type: G-TYPE-MENU-MODEL

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

=comment -----------------------------------------------------------------------
=comment #TP:0:menubar:
=head3 Menubar: menubar

The N-GObject for the menubar
Widget type: G-TYPE-MENU-MODEL

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

=comment -----------------------------------------------------------------------
=comment #TP:0:register-session:
=head3 Register session: register-session


Set this property to C<True> to register with the session manager.


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

=comment -----------------------------------------------------------------------
=comment #TP:0:screensaver-active:
=head3 Screensaver Active: screensaver-active


This property is C<True> if GTK+ believes that the screensaver is
currently active. GTK+ only tracks session state (including this)
when  I<register-session> is set to C<True>.

Tracking the screensaver state is supported on Linux.


The B<Gnome::GObject::Value> type of property I<screensaver-active> is C<G_TYPE_BOOLEAN>.
=end pod


