### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/IconTheme.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
nome::Gdk3::Window.get-scale-factor()>. Instead, you should use C<.lookup-icon-for-scale()>, as the assets loaded for a given scaling factor may be different.

Returns: a native B<Gnome::Gtk3::IconInfo> object containing information about the icon, or C<undefined> if the icon wasn’t found.

  method lookup-icon (
    Str $icon-name, Int() $size, UInt $flags --> N-GObject
  )

=item $icon_name; the name of the icon to lookup
=item $size; desired icon size
=item $flags; flags from GtkIconLookupFlags modifying the behavior of the icon lookup
=end pod

method lookup-icon (
  Str $icon_name, Int() $size, GFlag $flags
  --> N-GObject
) {
  gtk_icon_theme_lookup_icon(
    self._get-native-object-no-reffing, $icon_name, $size, $flags
  )
}

sub gtk_icon_theme_lookup_icon (
  N-GObject $icon_theme, gchar-ptr $icon_name, gint $size, GFlag $flags
  --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:lookup-icon-for-scale:
=begin pod
=head2 lookup-icon-for-scale

Looks up a named icon for a particular window scale and returns a native B<Gnome::Gtk3::IconInfo> containing information such as the filename of the icon. The icon can then be rendered into a pixbuf using C<Gnome::Gtk3::IconInfo.load-icon()>. (C<Gnome::Gtk3::IconInfo.load-icon()> combines these two steps if all you need is the pixbuf.)

Returns: a native  B<Gnome::Gtk3::IconInfo> object containing information about the icon, or C<undefined> if the icon wasn’t found.

  method lookup-icon-for-scale (
    Str $icon_name, Int() $size, Int() $scale, UInt $flags
    --> N-GObject
  )

=item $icon_name; the name of the icon to lookup
=item $size; desired icon size
=item $scale; the desired scale
=item $flags; flags from GtkIconLookupFlags modifying the behavior of the icon lookup
=end pod

method lookup-icon-for-scale (
  Str $icon_name, Int() $size, Int() $scale, GFlag $flags --> N-GObject
) {
  gtk_icon_theme_lookup_icon_for_scale(
    self._get-native-object-no-reffing, $icon_name, $size, $scale, $flags
  )
}

sub gtk_icon_theme_lookup_icon_for_scale (
  N-GObject $icon_theme, gchar-ptr $icon_name, gint $size,
  gint $scale, GFlag $flags
  --> N-GObject
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:prepend-search-path:
=begin pod
=head2 prepend-search-path

Prepends a directory to the search path. See C<set-search-path()>.

  method prepend-search-path ( Str $path )

=item $path; (type filename): directory name to prepend to the icon path
=end pod

method prepend-search-path ( Str $path ) {
  gtk_icon_theme_prepend_search_path(
    self._get-native-object-no-reffing, $path
  );
}

sub gtk_icon_theme_prepend_search_path (
  N-GObject $icon_theme, gchar-ptr $path 
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:rescan-if-needed:
=begin pod
=head2 rescan-if-needed

Checks to see if the icon theme has changed; if it has, any currently cached information is discarded and will be reloaded next time I<icon_theme> is accessed.

Returns: C<True> if the icon theme has changed and needed to be reloaded.

  method rescan-if-needed ( --> Bool )

=end pod

method rescan-if-needed ( --> Bool ) {
  gtk_icon_theme_rescan_if_needed( self._get-native-object-no-reffing).Bool
}

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

#-------------------------------------------------------------------------------
#TM:0:set-custom-theme:
=begin pod
=head2 set-custom-theme

Sets the name of the icon theme that the B<Gnome::Gtk3::IconTheme> object uses overriding system configuration. This function cannot be called on the icon theme objects returned from C<get-default()> and C<get-for-screen()>.

  method set-custom-theme ( Str $theme_name )

=item $theme_name; name of icon theme to use instead of configured theme, or C<undefined> to unset a previously set custom theme
=end pod

method set-custom-theme ( Str $theme_name ) {
  gtk_icon_theme_set_custom_theme( self._get-native-object-no-reffing, $theme_name);
}

sub gtk_icon_theme_set_custom_theme (
  N-GObject $icon_theme, gchar-ptr $theme_name 
) is native(&gtk-lib)
  { * }

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

Sets the screen for an icon theme; the screen is used to track the user’s currently configured icon theme, which might be different for different screens.

  method set-screen ( N-GObject() $screen )

=item $screen; a B<Gnome::Gdk3::Screen>
=end pod

method set-screen ( N-GObject() $screen ) {
  gtk_icon_theme_set_screen( self._get-native-object-no-reffing, $screen);
}

sub gtk_icon_theme_set_screen (
  N-GObject $icon_theme, N-GObject $screen 
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-search-path:
=begin pod
=head2 set-search-path

Sets the search path for the icon theme object. When looking for an icon theme, GTK+ will search for a subdirectory of one or more of the directories in I<path> with the same name as the icon theme containing an index.theme file. (Themes from multiple of the path elements are combined to allow themes to be extended by adding icons in the user’s home directory.)

In addition if an icon found isn’t found either in the current icon theme or the default icon theme, and an image file with the right name is found directly in one of the elements of I<path>, then that image will be used for the icon name. (This is legacy feature, and new icons should be put into the fallback icon theme, which is called hicolor, rather than directly on the icon path.)

  method set-search-path (  $const gchar *path[], Int() $n_elements )

=item $const gchar *path[]; (array length=n_elements) (element-type filename): array of directories that are searched for icon themes
=item $n_elements; number of elements in I<path>.
=end pod

method set-search-path ( Str $path, Int() $n_elements ) {
  gtk_icon_theme_set_search_path(
    self._get-native-object-no-reffing, $path, $n_elements
  );
}

sub gtk_icon_theme_set_search_path (
  N-GObject $icon_theme, Str $path, gint $n_elements 
) is native(&gtk-lib)
  { * }

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

Creates a new icon theme object. Icon theme objects are used to lookup up an icon by name in a particular icon theme. Usually, you’ll want to use C<get-default()> or C<get-for-screen()> rather than creating a new icon theme object for scratch.

Returns: the newly created B<Gnome::Gtk3::IconTheme> object.

  method _gtk_icon_theme_new ( --> N-GObject )

=end pod
}}

sub _gtk_icon_theme_new (  --> N-GObject )
  is native(&gtk-lib)
  is symbol('gtk_icon_theme_new')
  { * }

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


=comment -----------------------------------------------------------------------
=comment #TS:0:changed:
=head2 changed

Emitted when the current icon theme is switched or GTK+ detects
that a change has occurred in the contents of the current
icon theme.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=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 which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=end pod


