
@c %start of fragment

@deftp Class <gtk-icon-theme>
This @code{<gobject>} class defines no properties, other than those defined by
its superclasses.

@end deftp

@defop Signal <gtk-icon-theme> 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.

@end defop

@deffn Function gtk-icon-theme-new  @result{}@tie{} (ret@tie{}@code{<gtk-icon-theme>})
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
@code{gtk-icon-theme-get-default} or @code{gtk-icon-theme-get-for-screen} rather
than creating a new icon theme object for scratch.

@table @var
@item ret
the newly created @code{<gtk-icon-theme>} object.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-get-default  @result{}@tie{} (ret@tie{}@code{<gtk-icon-theme>})
Gets the icon theme for the default screen. See
@code{gtk-icon-theme-get-for-screen}.

@table @var
@item ret
A unique @code{<gtk-icon-theme>} associated with the default screen. This icon
theme is associated with the screen and can be used as long as the screen is
open. Do not ref or unref it.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-get-for-screen  (screen@tie{}@code{<gdk-screen>}) @result{}@tie{} (ret@tie{}@code{<gtk-icon-theme>})
Gets the icon theme object associated with @var{screen}; if this function has
not previously been called for the given screen, a new icon theme object will be
created and associated with the screen. Icon theme objects are fairly expensive
to create, so using this function is usually a better choice than calling than
@code{gtk-icon-theme-new} and setting the screen yourself; by using this
function a single icon theme object will be shared between users.

@table @var
@item screen
a @code{<gdk-screen>}

@item ret
A unique @code{<gtk-icon-theme>} associated with the given screen. This icon
theme is associated with the screen and can be used as long as the screen is
open. Do not ref or unref it.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-set-screen  (self@tie{}@code{<gtk-icon-theme>}) (screen@tie{}@code{<gdk-screen>})
@deffnx Method 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.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item screen
a @code{<gdk-screen>}

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-append-search-path  (self@tie{}@code{<gtk-icon-theme>}) (path@tie{}@code{mchars})
@deffnx Method append-search-path
Appends a directory to the search path. See
@code{gtk-icon-theme-set-search-path}.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item path
directory name to append to the icon path

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-prepend-search-path  (self@tie{}@code{<gtk-icon-theme>}) (path@tie{}@code{mchars})
@deffnx Method prepend-search-path
Prepends a directory to the search path. See
@code{gtk-icon-theme-set-search-path}.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item path
directory name to prepend to the icon path

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-set-custom-theme  (self@tie{}@code{<gtk-icon-theme>}) (theme_name@tie{}@code{mchars})
@deffnx Method set-custom-theme
Sets the name of the icon theme that the @code{<gtk-icon-theme>} object uses
overriding system configuration. This function cannot be called on the icon
theme objects returned from @code{gtk-icon-theme-get-default} and
@code{gtk-icon-theme-get-for-screen}.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item theme-name
name of icon theme to use instead of configured theme, or @samp{@code{#f}} to
unset a previously set custom theme

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-has-icon  (self@tie{}@code{<gtk-icon-theme>}) (icon_name@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{bool})
@deffnx Method has-icon
Checks whether an icon theme includes an icon for a particular name.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item icon-name
the name of an icon

@item ret
@samp{@code{#t}} if @var{icon-theme} includes an icon for @var{icon-name}.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-lookup-icon  (self@tie{}@code{<gtk-icon-theme>}) (icon_name@tie{}@code{mchars}) (size@tie{}@code{int}) (flags@tie{}@code{<gtk-icon-lookup-flags>}) @result{}@tie{} (ret@tie{}@code{<gtk-icon-info*>})
@deffnx Method lookup-icon
Looks up a named icon and returns a structure containing information such as the
filename of the icon. The icon can then be rendered into a pixbuf using
@code{gtk-icon-info-load-icon}. (@code{gtk-icon-theme-load-icon} combines these
two steps if all you need is the pixbuf.)

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item icon-name
the name of the icon to lookup

@item size
desired icon size

@item flags
flags modifying the behavior of the icon lookup

@item ret
a @code{<gtk-icon-info>} structure containing information about the icon, or
@samp{@code{#f}} if the icon wasn't found. Free with @code{gtk-icon-info-free}

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-load-icon  (self@tie{}@code{<gtk-icon-theme>}) (icon_name@tie{}@code{mchars}) (size@tie{}@code{int}) (flags@tie{}@code{<gtk-icon-lookup-flags>}) @result{}@tie{} (ret@tie{}@code{<gdk-pixbuf>})
@deffnx Method load-icon
Looks up an icon in an icon theme, scales it to the given size and renders it
into a pixbuf. This is a convenience function; if more details about the icon
are needed, use @code{gtk-icon-theme-lookup-icon} followed by
@code{gtk-icon-info-load-icon}.

Note that you probably want to listen for icon theme changes and update the
icon. This is usually done by connecting to the GtkWidget::style-set signal. If
for some reason you do not want to update the icon when the icon theme changes,
you should consider using @code{gdk-pixbuf-copy} to make a private copy of the
pixbuf returned by this function. Otherwise GTK+ may need to keep the old icon
theme loaded, which would be a waste of memory.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item icon-name
the name of the icon to lookup

@item size
the desired icon size. The resulting icon may not be exactly this size; see
@code{gtk-icon-info-load-icon}.

@item flags
flags modifying the behavior of the icon lookup

@item error
Location to store error information on failure, or @samp{@code{#f}}.

@item ret
the rendered icon; this may be a newly created icon or a new reference to an
internal icon, so you must not modify the icon. Use @code{g-object-unref} to
release your reference to the icon. @samp{@code{#f}} if the icon isn't found.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-list-icons  (self@tie{}@code{<gtk-icon-theme>}) (context@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{glist-of})
@deffnx Method list-icons
Lists the icons in the current icon theme. Only a subset of the icons can be
listed by providing a context string. The set of values for the context string
is system dependent, but will typically include such values as "Applications"
and "MimeTypes".

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item context
a string identifying a particular type of icon, or @samp{@code{#f}} to list all
icons.

@item ret
a @code{<g-list>} list holding the names of all the icons in the theme. You must
first free each element in the list with @code{g-free}, then free the list
itself with @code{g-list-free}.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-rescan-if-needed  (self@tie{}@code{<gtk-icon-theme>}) @result{}@tie{} (ret@tie{}@code{bool})
@deffnx Method 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 @var{icon-theme} is
accessed.

@table @var
@item icon-theme
a @code{<gtk-icon-theme>}

@item ret
@samp{@code{#t}} if the icon theme has changed and needed to be reloaded.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-theme-add-builtin-icon  (icon_name@tie{}@code{mchars}) (size@tie{}@code{int}) (pixbuf@tie{}@code{<gdk-pixbuf>})
Registers a built-in icon for icon theme lookups. The idea of built-in icons is
to allow an application or library that uses themed icons to function requiring
files to be present in the file system. For instance, the default images for all
of GTK+'s stock icons are registered as built-icons.

In general, if you use @code{gtk-icon-theme-add-builtin-icon} you should also
install the icon in the icon theme, so that the icon is generally available.

This function will generally be used with pixbufs loaded via
@code{gdk-pixbuf-new-from-inline}.

@table @var
@item icon-name
the name of the icon to register

@item size
the size at which to register the icon (different images can be registered for
the same icon name at different sizes.)

@item pixbuf
@code{<gdk-pixbuf>} that contains the image to use for @var{icon-name}.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-base-size  (self@tie{}@code{<gtk-icon-info*>}) @result{}@tie{} (ret@tie{}@code{int})
Gets the base size for the icon. The base size is a size for the icon that was
specified by the icon theme creator. This may be different than the actual size
of image; an example of this is small emblem icons that can be attached to a
larger icon. These icons will be given the same base size as the larger icons to
which they are attached.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item ret
the base size, or 0, if no base size is known for the icon.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-filename  (self@tie{}@code{<gtk-icon-info*>}) @result{}@tie{} (ret@tie{}@code{mchars})
Gets the filename for the icon. If the @samp{GTK_ICON_LOOKUP_USE_BUILTIN} flag
was passed to @code{gtk-icon-theme-lookup-icon}, there may be no filename if a
builtin icon is returned; in this case, you should use
@code{gtk-icon-info-get-builtin-pixbuf}.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item ret
the filename for the icon, or @samp{@code{#f}} if
@code{gtk-icon-info-get-builtin-pixbuf} should be used instead. The return value
is owned by GTK+ and should not be modified or freed.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-builtin-pixbuf  (self@tie{}@code{<gtk-icon-info*>}) @result{}@tie{} (ret@tie{}@code{<gdk-pixbuf>})
Gets the built-in image for this icon, if any. To allow GTK+ to use built in
icon images, you must pass the @samp{GTK_ICON_LOOKUP_USE_BUILTIN} to
@code{gtk-icon-theme-lookup-icon}.

@table @var
@item icon-info
a @code{<gtk-icon-info>} structure

@item ret
the built-in image pixbuf, or @samp{@code{#f}}. No extra reference is added to
the returned pixbuf, so if you want to keep it around, you must use
@code{g-object-ref}. The returned image must not be modified.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-load-icon  (self@tie{}@code{<gtk-icon-info*>}) @result{}@tie{} (ret@tie{}@code{<gdk-pixbuf>})
Renders an icon previously looked up in an icon theme using
@code{gtk-icon-theme-lookup-icon}; the size will be based on the size passed to
@code{gtk-icon-theme-lookup-icon}. Note that the resulting pixbuf may not be
exactly this size; an icon theme may have icons that differ slightly from their
nominal sizes, and in addition GTK+ will avoid scaling icons that it considers
sufficiently close to the requested size or for which the source image would
have to be scaled up too far. (This maintains sharpness.)

@table @var
@item icon-info
a @code{<gtk-icon-info>} structure from @code{gtk-icon-theme-lookup-icon}

@item error
location to store error information on failure, or @samp{@code{#f}}.

@item ret
the rendered icon; this may be a newly created icon or a new reference to an
internal icon, so you must not modify the icon. Use @code{g-object-unref} to
release your reference to the icon.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-set-raw-coordinates  (self@tie{}@code{<gtk-icon-info*>}) (raw_coordinates@tie{}@code{bool})
Sets whether the coordinates returned by @code{gtk-icon-info-get-embedded-rect}
and @code{gtk-icon-info-get-attach-points} should be returned in their original
form as specified in the icon theme, instead of scaled appropriately for the
pixbuf returned by @code{gtk-icon-info-load-icon}.

Raw coordinates are somewhat strange; they are specified to be with respect to
the unscaled pixmap for PNG and XPM icons, but for SVG icons, they are in a
1000x1000 coordinate space that is scaled to the final size of the icon. You can
determine if the icon is an SVG icon by using @code{gtk-icon-info-get-filename},
and seeing if it is non-@samp{@code{#f}} and ends in '.svg'.

This function is provided primarily to allow compatibility wrappers for older
API's, and is not expected to be useful for applications.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item raw-coordinates
whether the coordinates of embedded rectangles and attached points should be
returned in their original (unscaled) form.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-embedded-rect  (self@tie{}@code{<gtk-icon-info*>}) (rectangle@tie{}@code{<gdk-rectangle>}) @result{}@tie{} (ret@tie{}@code{bool})
Gets the coordinates of a rectangle within the icon that can be used for display
of information such as a preview of the contents of a text file. See
@code{gtk-icon-info-set-raw-coordinates} for further information about the
coordinate system.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item rectangle
@code{<gdk-rectangle>} in which to store embedded rectangle coordinates;
coordinates are only stored when this function returns @samp{@code{#t}}.

@item ret
@samp{@code{#t}} if the icon has an embedded rectangle

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-attach-points  (self@tie{}@code{<gtk-icon-info*>}) (points@tie{}@code{<gdk-point**>}) @result{}@tie{} (ret@tie{}@code{bool}) (n_points@tie{}@code{int})
Fetches the set of attach points for an icon. An attach point is a location in
the icon that can be used as anchor points for attaching emblems or overlays to
the icon.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item points
location to store pointer to an array of points, or @samp{@code{#f}} free the
array of points with @code{g-free}.

@item n-points
location to store the number of points in @var{points}, or @samp{@code{#f}}

@item ret
@samp{@code{#t}} if there are any attach points for the icon.

@end table

Since 2.4

@end deffn

@deffn Function gtk-icon-info-get-display-name  (self@tie{}@code{<gtk-icon-info*>}) @result{}@tie{} (ret@tie{}@code{mchars})
Gets the display name for an icon. A display name is a string to be used in
place of the icon name in a user visible context like a list of icons.

@table @var
@item icon-info
a @code{<gtk-icon-info>}

@item ret
the display name for the icon or @samp{@code{#f}}, if the icon doesn't have a
specified display name. This value is owned @var{icon-info} and must not be
modified or free.

@end table

Since 2.4

@end deffn


@c %end of fragment
