### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Window.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
_resizable (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-role:
=begin pod
=head2 get-role

Returns the role of the window. See C<set-role()> for further explanation.

Returns: the role of the window if set, or C<undefined>. The returned is owned by the widget and must not be modified or freed.

  method get-role ( --> Str )

=end pod

method get-role ( --> Str ) {

  gtk_window_get_role(
    self._f('GtkWindow'),
  )
}

sub gtk_window_get_role (
  N-GObject $window --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-screen:
=begin pod
=head2 get-screen

Returns the B<Gnome::Gdk3::Screen> associated with I<window>.

Returns: a B<Gnome::Gdk3::Screen>.

  method get-screen ( --> N-GObject )

=end pod

method get-screen ( --> N-GObject ) {

  gtk_window_get_screen(
    self._f('GtkWindow'),
  )
}

sub gtk_window_get_screen (
  N-GObject $window --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-size:
=begin pod
=head2 get-size

Obtains the current size of I<window>.

If I<window> is not visible on screen, this function return the size GTK+ will suggest to the [window manager][gtk-X11-arch] for the initial window size (but this is not reliably the same as the size the window manager will actually select). See: C<set-default-size()>.

Depending on the windowing system and the window manager constraints, the size returned by this function may not match the size set using C<resize()>; additionally, since C<resize()> may be implemented as an asynchronous operation, GTK+ cannot guarantee in any way that this code:

  # Width and height are set elsewhere with
  $window.resize( $width, $height);

  # And will result in `$new-width` and `$new-height` matching
  #`$width` and `$height`, respectively.
  my Int ( $new-width, $new-height) = $window.get-size;


This function will return the logical size of the B<Gnome::Gtk3::Window>, excluding the widgets used in client side decorations; there is, however, no guarantee that the result will be completely accurate because client side decoration may include widgets that depend on the user preferences and that may not be visibile at the time you call this function.

The dimensions returned by this function are suitable for being stored across sessions; use C<set-default-size()> to restore them when before showing the window.

To avoid potential race conditions, you should only call this function in response to a size change notification, for instance inside a handler for the C<size-allocate> signal, or inside a handler for the C<configure-event> signal (both defined in B<Gnome::Gtk3::Widget>):

=begin comment
  static void on-size-allocate( GtkWidget *widget, GtkAllocation *allocation) { int new-width, new-height;

    gtk-window-get-size( GTK-WINDOW (widget), &new-width, &new-height);
    …
  }
=end comment

Note that, if you connect to the B<Gnome::Gtk3::Widget>::size-allocate signal, you should not use the dimensions of the B<Gnome::Gtk3::Allocation> passed to the signal handler, as the allocation may contain client side decorations added by GTK+, depending on the windowing system in use.

If you are getting a window size in order to position the window on the screen, you should, instead, simply set the window’s semantic type with C<set-type-hint()>, which allows the window manager to e.g. center dialogs. Also, if you set the transient parent of dialogs with C<set-transient-for()> window managers will often center the dialog over its parent window. It's much preferred to let the window manager handle these cases rather than doing it yourself, because all apps will behave consistently and according to user or system preferences, if the window manager handles it. Also, the window manager can take into account the size of the window decorations and border that it may add, and of which GTK+ has no knowledge. Additionally, positioning windows in global screen coordinates may not be allowed by the windowing system. For more information, see: C<set-position()>.

  method get-size ( --> List )

=item Int $width; return location for width, or C<undefined>
=item Int $height; return location for height, or C<undefined>
=end pod

method get-size ( --> List ) {

  gtk_window_get_size(
    self._f('GtkWindow'), my gint $width, my gint $height
  );

  ( $width, $height)
}

sub gtk_window_get_size (
  N-GObject $window, gint $width is rw, gint $height is rw
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-skip-pager-hint:
=begin pod
=head2 get-skip-pager-hint

Gets the value set by C<set-skip-pager-hint()>.

Returns: C<True> if window shouldn’t be in pager

  method get-skip-pager-hint ( --> Bool )

=end pod

method get-skip-pager-hint ( --> Bool ) {

  gtk_window_get_skip_pager_hint(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_get_skip_pager_hint (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-skip-taskbar-hint:
=begin pod
=head2 get-skip-taskbar-hint

Gets the value set by C<set-skip-taskbar-hint()>

Returns: C<True> if window shouldn’t be in taskbar

  method get-skip-taskbar-hint ( --> Bool )

=end pod

method get-skip-taskbar-hint ( --> Bool ) {

  gtk_window_get_skip_taskbar_hint(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_get_skip_taskbar_hint (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-title:
=begin pod
=head2 get-title

Retrieves the title of the window. See C<set-title()>.

Returns: the title of the window, or C<undefined> if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.

  method get-title ( --> Str )

=end pod

method get-title ( --> Str ) {

  gtk_window_get_title(
    self._f('GtkWindow'),
  )
}

sub gtk_window_get_title (
  N-GObject $window --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-titlebar:
=begin pod
=head2 get-titlebar

Returns the custom titlebar that has been set with C<set-titlebar()>.

Returns: the custom titlebar, or C<undefined>

  method get-titlebar ( --> N-GObject )

=end pod

method get-titlebar ( --> N-GObject ) {

  gtk_window_get_titlebar(
    self._f('GtkWindow'),
  )
}

sub gtk_window_get_titlebar (
  N-GObject $window --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-transient-for:
=begin pod
=head2 get-transient-for

Fetches the transient parent for this window. See C<set-transient-for()>.

Returns: the transient parent for this window, or C<undefined> if no transient parent has been set.

  method get-transient-for ( --> N-GObject )

=end pod

method get-transient-for ( --> N-GObject ) {

  gtk_window_get_transient_for(
    self._f('GtkWindow'),
  )
}

sub gtk_window_get_transient_for (
  N-GObject $window --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-type-hint:
=begin pod
=head2 get-type-hint

Gets the type hint for this window. See C<set-type-hint()>.

Returns: the type hint for I<window>.

  method get-type-hint ( --> GdkWindowTypeHint )

=end pod

method get-type-hint ( --> GdkWindowTypeHint ) {

  GdkWindowTypeHint(
    gtk_window_get_type_hint(self._f('GtkWindow'))
  )
}

sub gtk_window_get_type_hint (
  N-GObject $window --> GEnum
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:get-urgency-hint:
=begin pod
=head2 get-urgency-hint

Gets the value set by C<set-urgency-hint()>

Returns: C<True> if window is urgent

  method get-urgency-hint ( --> Bool )

=end pod

method get-urgency-hint ( --> Bool ) {

  gtk_window_get_urgency_hint(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_get_urgency_hint (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-window-type:
=begin pod
=head2 get-window-type

Gets the type of the window.

Returns: the type of the window

  method get-window-type ( --> GtkWindowType )

=end pod

method get-window-type ( --> GtkWindowType ) {
  GtkWindowType(gtk_window_get_window_type(self._f('GtkWindow')))
}

sub gtk_window_get_window_type (
  N-GObject $window --> GEnum
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:has-group:
=begin pod
=head2 has-group

Returns whether I<window> has an explicit window group.

Returns: C<True> if I<window> has an explicit window group.

Since 2.22

  method has-group ( --> Bool )

=end pod

method has-group ( --> Bool ) {

  gtk_window_has_group(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_has_group (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:has-toplevel-focus:
=begin pod
=head2 has-toplevel-focus

Returns whether the input focus is within this GtkWindow. For real toplevel windows, this is identical to C<is-active()>, but for embedded windows, like B<Gnome::Gtk3::Plug>, the results will differ.

Returns: C<True> if the input focus is within this GtkWindow

  method has-toplevel-focus ( --> Bool )

=end pod

method has-toplevel-focus ( --> Bool ) {

  gtk_window_has_toplevel_focus(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_has_toplevel_focus (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:iconify:
=begin pod
=head2 iconify

Asks to iconify (i.e. minimize) the specified I<window>. Note that you shouldn’t assume the window is definitely iconified afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could deiconify it again, or there may not be a window manager in which case iconification isn’t possible, etc. But normally the window will end up iconified. Just don’t write code that crashes if not.

It’s permitted to call this function before showing a window, in which case the window will be iconified before it ever appears onscreen.

You can track iconification via the “window-state-event” signal on B<Gnome::Gtk3::Widget>.

  method iconify ( )

=end pod

method iconify ( ) {

  gtk_window_iconify(
    self._f('GtkWindow'),
  );
}

sub gtk_window_iconify (
  N-GObject $window
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:is-active:
=begin pod
=head2 is-active

Returns whether the window is part of the current active toplevel. (That is, the toplevel window receiving keystrokes.) The return value is C<True> if the window is active toplevel itself, but also if it is, say, a B<Gnome::Gtk3::Plug> embedded in the active toplevel. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window. See C<has-toplevel-focus()>

Returns: C<True> if the window part of the current active window.

  method is-active ( --> Bool )

=end pod

method is-active ( --> Bool ) {

  gtk_window_is_active(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_is_active (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:is-maximized:
=begin pod
=head2 is-maximized

Retrieves the current maximized state of I<window>.

Note that since maximization is ultimately handled by the window manager and happens asynchronously to an application request, you shouldn’t assume the return value of this function changing immediately (or at all), as an effect of calling C<maximize()> or C<unmaximize()>.

Returns: whether the window has a maximized state.

  method is-maximized ( --> Bool )

=end pod

method is-maximized ( --> Bool ) {

  gtk_window_is_maximized(
    self._f('GtkWindow'),
  ).Bool
}

sub gtk_window_is_maximized (
  N-GObject $window --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:list-toplevels:
=begin pod
=head2 list-toplevels

Returns a list of all existing toplevel windows. The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call `g-list-foreach (result, (GFunc)g-object-ref, NULL)` first, and then unref all the widgets afterwards.

Returns: (element-type GtkWidget) (transfer container): list of toplevel widgets

  method list-toplevels ( --> N-GList )

=end pod

method list-toplevels ( --> N-GList ) {

  gtk_window_list_toplevels(
    self._f('GtkWindow'),
  )
}

sub gtk_window_list_toplevels (
   --> N-GList
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:maximize:
=begin pod
=head2 maximize

Asks to maximize I<window>, so that it becomes full-screen. Note that you shouldn’t assume the window is definitely maximized afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could unmaximize it again, and not all window managers support maximization. But normally the window will end up maximized. Just don’t write code that crashes if not.

It’s permitted to call this function before showing a window, in which case the window will be maximized when it appears onscreen initially.

You can track maximization via the “window-state-event” signal on B<Gnome::Gtk3::Widget>, or by listening to notifications on the  I<is-maximized> property.

  method maximize ( )

=end pod

method maximize ( ) {

  gtk_window_maximize(
    self._f('GtkWindow'),
  );
}

sub gtk_window_maximize (
  N-GObject $window
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:mnemonic-activate:
=begin pod
=head2 mnemonic-activate

Activates the targets associated with the mnemonic.

Returns: C<True> if the activation is done.

  method mnemonic-activate ( UInt $keyval, GdkModifierType $modifier --> Bool )

=item UInt $keyval; the mnemonic
=item GdkModifierType $modifier; the modifiers
=end pod

method mnemonic-activate ( UInt $keyval, GdkModifierType $modifier --> Bool ) {

  gtk_window_mnemonic_activate(
    self._f('GtkWindow'), $keyval, $modifier
  ).Bool
}

sub gtk_window_mnemonic_activate (
  N-GObject $window, guint $keyval, GEnum $modifier --> gboolean
) is native(&gtk-lib)
  { * }

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

Asks the [window manager][gtk-X11-arch] to move I<window> to the given position. Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.

Note: the position is the position of the gravity-determined reference point for the window. The gravity determines two things: first, the location of the reference point in root window coordinates; and second, which point on the window is positioned at the reference point.

By default the gravity is C<GDK_GRAVITY_NORTH_WEST>, so the reference point is simply the I<x>, I<y> supplied to C<move()>. The top-left corner of the window decorations (aka window frame or border) will be placed at I<x>, I<y>. Therefore, to position a window at the top left of the screen, you want to use the default gravity (which is C<GDK_GRAVITY_NORTH_WEST>) and move the window to 0,0.

To position a window at the bottom right corner of the screen, you would set C<GDK_GRAVITY_SOUTH_EAST>, which means that the reference point is at I<x> + the window width and I<y> + the window height, and the bottom-right corner of the window border will be placed at that reference point. So, to place a window in the bottom right corner you would first set gravity to south east, then write: `gtk-window-move (window, C<gdk-screen-width()> - window-width, C<gdk-screen-height()> - window-height)` (note that this example does not take multi-head scenarios into account).

The [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec) has a nice table of gravities in the “implementation notes” section.

The C<get-position()> documentation may also be relevant.

  method move ( Int $x, Int $y )

=item Int $x; X coordinate to move window to
=item Int $y; Y coordinate to move window to
=end pod

method move ( Int $x, Int $y ) {

  gtk_window_move(
    self._f('GtkWindow'), $x, $y
  );
}

sub gtk_window_move (
  N-GObject $window, gint $x, gint $y
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:present:
=begin pod
=head2 present

Presents a window to the user. This function should not be used as when it is called, it is too late to gather a valid timestamp to allow focus stealing prevention to work correctly.

  method present ( )

=end pod

method present ( ) {

  gtk_window_present(
    self._f('GtkWindow'),
  );
}

sub gtk_window_present (
  N-GObject $window
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:present-with-time:
=begin pod
=head2 present-with-time

Presents a window to the user. This may mean raising the window in the stacking order, deiconifying it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user’s platform, window manager, and preferences.

If I<window> is hidden, this function calls C<Gnome::Gtk3::Widget.show()> as well.

This function should be used when the user tries to open a window that’s already open. Say for example the preferences dialog is currently open, and the user chooses Preferences from the menu a second time; use C<present()> to move the already-open dialog where the user can see it.

Presents a window to the user in response to a user interaction. The timestamp should be gathered when the window was requested to be shown (when clicking a link for example), rather than once the window is ready to be shown.

  method present-with-time ( UInt $timestamp )

=item UInt $timestamp; the timestamp of the user interaction (typically a  button or key press event) which triggered this call
=end pod

method present-with-time ( UInt $timestamp ) {

  gtk_window_present_with_time(
    self._f('GtkWindow'), $timestamp
  );
}

sub gtk_window_present_with_time (
  N-GObject $window, guint32 $timestamp
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:propagate-key-event:
=begin pod
=head2 propagate-key-event

Propagate a key press or release event to the focus widget and up the focus container chain until a widget handles I<event>. This is normally called by the default ::key-press-event and ::key-release-event handlers for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window.

Returns: C<True> if a widget in the focus chain handled the event.

  method propagate-key-event ( N-GdkEventKey $event --> Bool )

=item N-GdkEventKey $event; an EventKey structure
=end pod

method propagate-key-event ( N-GdkEventKey $event --> Bool ) {
  gtk_window_propagate_key_event( self._f('GtkWindow'), $event).Bool
}

sub gtk_window_propagate_key_event (
  N-GObject $window, N-GdkEventKey $event --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-accel-group:
=begin pod
=head2 remove-accel-group

Reverses the effects of C<add-accel-group()>.

  method remove-accel-group ( N-GObject $accel_group )

=item N-GObject $accel_group; a B<Gnome::Gtk3::AccelGroup>
=end pod

method remove-accel-group ( $accel_group is copy ) {
  $accel_group .= _get-native-object-no-reffing unless $accel_group ~~ N-GObject;

  gtk_window_remove_accel_group(
    self._f('GtkWindow'),
  );
}

sub gtk_window_remove_accel_group (
  N-GObject $window, N-GObject $accel_group
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-mnemonic:
=begin pod
=head2 remove-mnemonic

Removes a mnemonic from this window.

  method remove-mnemonic ( UInt $keyval, N-GObject $target )

=item UInt $keyval; the mnemonic
=item N-GObject $target; the widget that gets activated by the mnemonic
=end pod

method remove-mnemonic ( UInt $keyval, $target is copy ) {
  $target .= _get-native-object-no-reffing unless $target ~~ N-GObject;

  gtk_window_remove_mnemonic(
    self._f('GtkWindow'), $keyval
  );
}

sub gtk_window_remove_mnemonic (
  N-GObject $window, guint $keyval, N-GObject $target
) is native(&gtk-lib)
  { * }

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

Resizes the window as if the user had done so, obeying geometry constraints. The default geometry constraint is that windows may not be smaller than their size request; to override this constraint, call C<Gnome::Gtk3::Widget.set-size-request()> to set the window's request to a smaller value.

If C<resize()> is called before showing a window for the first time, it overrides any default size set with C<set-default-size()>.

Windows may not be resized smaller than 1 by 1 pixels.

When using client side decorations, GTK+ will do its best to adjust the given size so that the resulting window size matches the requested size without the title bar, borders and shadows added for the client side decorations, but there is no guarantee that the result will be totally accurate because these widgets added for client side decorations depend on the theme and may not be realized or visible at the time C<resize()> is issued.

If the GtkWindow has a titlebar widget (see C<set-titlebar()>), then typically, C<resize()> will compensate for the height of the titlebar widget only if the height is known when the resulting GtkWindow configuration is issued. For example, if new widgets are added after the GtkWindow configuration and cause the titlebar widget to grow in height, this will result in a window content smaller that specified by C<resize()> and not a larger window.

  method resize ( Int $width, Int $height )

=item Int $width; width in pixels to resize the window to
=item Int $height; height in pixels to resize the window to
=end pod

method resize ( Int $width, Int $height ) {

  gtk_window_resize(
    self._f('GtkWindow'), $width, $height
  );
}

sub gtk_window_resize (
  N-GObject $window, gint $width, gint $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-accept-focus:
=begin pod
=head2 set-accept-focus

Windows may set a hint asking the desktop environment not to receive the input focus. This function sets this hint.

  method set-accept-focus ( Bool $setting )

=item Bool $setting; C<True> to let this window receive input focus
=end pod

method set-accept-focus ( Bool $setting ) {

  gtk_window_set_accept_focus(
    self._f('GtkWindow'), $setting
  );
}

sub gtk_window_set_accept_focus (
  N-GObject $window, gboolean $setting
) is native(&gtk-lib)
  { * }

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

Sets or unsets the B<Gnome::Gtk3::Application> associated with the window.

The application will be kept alive for at least as long as it has any windows associated with it (see C<g-application-hold()> for a way to keep it alive without windows).

Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the I<application> to C<undefined>.

This is equivalent to calling C<gtk-application-remove-window()> and/or C<gtk-application-add-window()> on the old/new applications as relevant.

  method set-application ( N-GObject $application )

=item N-GObject $application; a B<Gnome::Gtk3::Application>, or C<undefined> to unset
=end pod

method set-application ( $application is copy ) {
  $application .= _get-native-object-no-reffing unless $application ~~ N-GObject;

  gtk_window_set_application(
    self._f('GtkWindow'),
  );
}

sub gtk_window_set_application (
  N-GObject $window, N-GObject $application
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-attached-to:
=begin pod
=head2 set-attached-to

Marks I<window> as attached to I<attach-widget>. This creates a logical binding between the window and the widget it belongs to, which is used by GTK+ to propagate information such as styling or accessibility to I<window> as if it was a children of I<attach-widget>.

Examples of places where specifying this relation is useful are for instance a B<Gnome::Gtk3::Menu> created by a B<Gnome::Gtk3::ComboBox>, a completion popup window created by B<Gnome::Gtk3::Entry> or a typeahead search entry created by B<Gnome::Gtk3::TreeView>.

Note that this function should not be confused with C<set-transient-for()>, which specifies a window manager relation between two toplevels instead.

Passing C<undefined> for I<attach-widget> detaches the window.

  method set-attached-to ( N-GObject $attach_widget )

=item N-GObject $attach_widget; a B<Gnome::Gtk3::Widget>, or C<undefined>
=end pod

method set-attached-to ( $attach_widget is copy ) {
  $attach_widget .= _get-native-object-no-reffing unless $attach_widget ~~ N-GObject;

  gtk_window_set_attached_to(
    self._f('GtkWindow'),
  );
}

sub gtk_window_set_attached_to (
  N-GObject $window, N-GObject $attach_widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-auto-startup-notification:
=begin pod
=head2 set-auto-startup-notification

By default, after showing the first B<Gnome::Gtk3::Window>, GTK+ calls C<gdk-notify-startup-complete()>. Call this function to disable the automatic startup notification. You might do this if your first window is a splash screen, and you want to delay notification until after your real main window has been shown, for example.

In that example, you would disable startup notification temporarily, show your splash screen, then re-enable it so that showing the main window would automatically result in notification.

  method set-auto-startup-notification ( Bool $setting )

=item Bool $setting; C<True> to automatically do startup notification
=end pod

method set-auto-startup-notification ( Bool $setting ) {

  gtk_window_set_auto_startup_notification(
    self._f('GtkWindow'), $setting
  );
}

sub gtk_window_set_auto_startup_notification (
  gboolean $setting
) is native(&gtk-lib)
  { * }

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

By default, windows are decorated with a title bar, resize controls, etc. Some [window managers][gtk-X11-arch] allow GTK+ to disable these decorations, creating a borderless window. If you set the decorated property to C<False> using this function, GTK+ will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling C<Gnome::Gtk3::Widget.show()>.

On Windows, this function always works, since there’s no window manager policy involved.

  method set-decorated ( Bool $setting )

=item Bool $setting; C<True> to decorate the window
=end pod

method set-decorated ( Bool $setting ) {

  gtk_window_set_decorated(
    self._f('GtkWindow'), $setting
  );
}

sub gtk_window_set_decorated (
  N-GObject $window, gboolean $setting
) is native(&gtk-lib)
  { * }

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

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a B<Gnome::Gtk3::Window>. When setting (rather than unsetting) the default widget it’s generally easier to call C<Gnome::Gtk3::Widget.grab-default()> on the widget. Before making a widget the default widget, you must call C<Gnome::Gtk3::Widget.set-can-default()> on the widget you’d like to make the default.

  method set-default ( N-GObject $default_widget )

=item N-GObject $default_widget; widget to be the default, or C<undefined> to unset the default widget for the toplevel
=end pod

method set-default ( $default_widget is copy ) {
  $default_widget .= _get-native-object-no-reffing
    unless $default_widget ~~ N-GObject;

  gtk_window_set_default(
    self._f('GtkWindow'),
  );
}

sub gtk_window_set_default (
  N-GObject $window, N-GObject $default_widget
) is native(&gtk-lib)
  { * }

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

Sets an icon to be used as fallback for windows that haven't had C<set-icon()> called on them from a pixbuf.

  method set-default-icon ( N-GObject $icon )

=item N-GObject $icon; the icon
=end pod

method set-default-icon ( $icon is copy ) {
  $icon .= _get-native-object-no-reffing unless $icon ~~ N-GObject;

  gtk_window_set_default_icon(
    self._f('GtkWindow'),
  );
}

sub gtk_window_set_default_icon (
  N-GObject $icon
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-default-icon-from-file:
=begin pod
=head2 set-default-icon-from-file

Sets an icon to be used as fallback for windows that haven't had C<set-icon-list()> called on them from a file on disk.
=comment Warns on failure if I<err> is C<undefined>.

Returns: a invalid error object if setting the icon succeeded. If it fails, the error must be checked for the reason.

  method set-default-icon-from-file ( Str $filename --> Gnome::Glib::Error )

=item Str $filename; location of icon file.
=end pod

method set-default-icon-from-file ( Str $filename --> Gnome::Glib::Error ) {
  my CArray[N-GError] $e .= new(N-GError);

  my Int $r = gtk_window_set_default_icon_from_file(
    self._f('GtkWindow'), $filename, $e
  );

  if $r {
    Gnome::Glib::Error.new(:native-object(N-GError))
  }

  else {
    Gnome::Glib::Error.new(:native-object($e[0]))
  }
}

sub gtk_window_set_default_icon_from_file (
  gchar-ptr $filename, CArray[N-GError] $err --> gboolean
) is native(&gtk-lib)
  { * }

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

Sets an icon list to be used as fallback for windows that haven't had C<set-icon-list()> called on them to set up a window-specific icon list. This function allows you to set up the icon for all windows in your app at once.

See C<set-icon-list()> for more details.

  method set-default-icon-list ( N-GList $list )

=item N-GList $list; a list of native B<Gnome::Gdk3::Pixbuf> objects
=end pod

method set-default-icon-list ( $list is copy ) {
  $list .= _get-native-object-no-reffing unless $list ~~ N-GList;

  gtk_window_set_default_icon_list(
    self._f('GtkWindow'),
  );
}

sub gtk_window_set_default_icon_list (
  N-GList $list
) is native(&gtk-lib)
  { * }

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

Sets an icon to be used as fallback for windows that haven't had C<set-icon-list()> called on them from a named themed icon, see C<set-icon-name()>.

  method set-default-icon-name ( Str $name )

=item Str $name; the name of the themed icon
=end pod

method set-default-icon-name ( Str $name ) {

  gtk_window_set_default_icon_name(
    self._f('GtkWindow'), $name
  );
}

sub gtk_window_set_default_icon_name (
  gchar-ptr $name
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-default-size:
=begin pod
=head2 set-default-size

Sets the default size of a window. If the window’s “natural” size (its size request) is larger than the default, the default will be ignored. More generally, if the default size does not obey the geometry hints for the window (C<set-geometry-hints()> can be used to set these explicitly), the default size will be clamped to the nearest permitted size.

Unlike C<Gnome::Gtk3::Widget.set-size-request()>, which sets a size request for a widget and thus would keep users from shrinking the window, this function only sets the initial size, just as if the user had resized the window themselves. Users can still shrink the window again as they normally would. Setting a default size of -1 means to use the “natural” default size (the size request of the window).

For more control over a window’s initial size and how resizing works, investigate C<set-geometry-hints()>.

For some uses, C<resize()> is a more appropriate function. C<resize()> changes the current size of the window, rather than the size to be used on initial display. C<resize()> always affects the window itself, not the geometry widget.

The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.

Windows can’t actually be 0x0 in size, they must be at least 1x1, but passing 0 for I<width> and I<height> is OK, resulting in a 1x1 default size.

If you use this function to reestablish a previously saved window size, note that the appropriate size to save is the one returned by C<get-size()>. Using the window allocation directly will not work in all circumstances and can lead to growing or shrinking windows.

  method set-default-size ( Int $width, Int $height )

=item Int $width; width in pixels, or -1 to unset the default width
=item Int $height; height in pixels, or -1 to unset the default height
=end pod

method set-default-size ( Int $width, Int $height ) {

  gtk_window_set_default_size(
    self._f('GtkWindow'), $width, $height
  );
}

sub gtk_window_set_default_size (
  N-GObject $window, gint $