[494:14] static extends: object
Generated metadata helpers for IconTheme class surfaces.
properties ()
Returns property metadata for
IconTheme.
A list.signals ()
Returns signal metadata for
IconTheme.
A list.[30:7] extends: object
Loads themed icons. The main reason for using a name rather than simply
providing a filename is to allow different icons to be used depending on what
“icon theme” is selected by the user. The operation of icon themes on Linux
and Unix follows the Icon Theme
Specification There is
a fallback icon theme, named hicolor, where applications should install
their icons, but additional icon themes can be installed as operating system
vendors and users choose. In many cases, named themes are used indirectly,
via [class@Gtk.Image] rather than directly, but looking up icons directly is
also simple. The GtkIconTheme object acts as a database of all the icons in
the current theme. You can create new GtkIconTheme objects, but it’s much
more efficient to use the standard icon theme of the GtkWidget so that the
icon information is shared with other people looking up icons. c GtkIconTheme *icon_theme; GtkIconPaintable *icon; GdkPaintable *paintable; icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (my_widget)); icon = gtk_icon_theme_lookup_icon (icon_theme, "my-icon-name", // icon name 48, // icon size 1, // scale 0, // flags); paintable = GDK_PAINTABLE (icon); // Use the paintable g_object_unref (icon);
IconTheme ()
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 [func@Gtk.IconTheme.get_for_display] rather than creating a new icon theme object for scratch.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnChanged (callback Fn, UserData = null)
Emitted when the icon theme changes. This can happen because current icon theme is switched or because GTK detects that a change has occurred in the contents of the current icon theme.
Fn is the Aussom callback.Fn is called with (IconTheme Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setDisplay (object Value)
The display that this icon theme object is attached to.
Value is the new property value.None.setThemename (string Value)
The name of the icon theme that is being used. Unless set to a different value, this will be the value of the
GtkSettings:gtk-icon-theme-nameproperty of theGtkSettingsobject associated to the display of the icontheme object.
Value is the new property value.None.add_resource_path (string path)
Adds a resource path that will be looked at when looking for icons, similar to search paths. See [method@Gtk.IconTheme.set_resource_path]. This function should be used to make application-specific icons available as part of the icon theme.
path is a resource path.None.add_search_path (string path)
Appends a directory to the search path. See [method@Gtk.IconTheme.set_search_path].
path is directory name to append to the icon path.None.get_display ()
Returns the display that the
GtkIconThemeobject was created for.
get_icon_names ()
Lists the names of icons in the current icon theme.
get_icon_sizes (string icon_name)
Returns an array of integers describing the sizes at which the icon is available without scaling. A size of -1 means that the icon is available in a scalable format. The array is zero-terminated.
icon_name is the name of an icon.get_resource_path ()
Gets the current resource path. See [method@Gtk.IconTheme.set_resource_path].
get_search_path ()
Gets the current search path. See [method@Gtk.IconTheme.set_search_path].
get_theme_name ()
Gets the current icon theme name.
has_gicon (object gicon)
Checks whether an icon theme includes an icon for a particular
GIcon.
gicon is a GIcon.has_icon (string icon_name)
Checks whether an icon theme includes an icon for a particular name.
icon_name is the name of an icon.lookup_by_gicon (object icon, int size, int scale, string direction, string flags)
Looks up a icon for a desired size and window scale. The icon can then be rendered by using it as a
GdkPaintable, or you can get information such as the filename and size.
icon is the GIcon to look up.size is desired icon size, in application pixels.scale is the desired scale.direction is text direction the icon will be displayed in.flags is flags modifying the behavior of the icon lookup.lookup_icon (string icon_name, list fallbacks, int size, int scale, string direction, string flags)
Looks up a named icon for a desired size and window scale, returning a
GtkIconPaintable. The icon can then be rendered by using it as aGdkPaintable, or you can get information such as the filename and size. If the available @icon_name is not available and @fallbacks are provided, they will be tried in order. If no matching icon is found, then a paintable that renders the "missing icon" icon is returned. If you need to do something else for missing icons you need to use [method@Gtk.IconTheme.has_icon]. Note that you probably want to listen for icon theme changes and update the icon. This is usually done by overriding the GtkWidgetClass.css-changed() function.
icon_name is the name of the icon to lookup.fallbacks is fallback names.size is desired icon size, in application pixels.scale is the window scale this will be displayed on.direction is text direction the icon will be displayed in.flags is flags modifying the behavior of the icon lookup.set_resource_path (list path)
Sets the resource paths that will be looked at when looking for icons, similar to search paths. The resources are considered as part of the hicolor icon theme and must be located in subdirectories that are defined in the hicolor icon theme, such as
@path/16x16/actions/run.pngor@path/scalable/actions/run.svg. Icons that are directly placed in the resource path instead of a subdirectory are also considered as ultimate fallback, but they are treated like unthemed icons.
path is NULL-terminated array of resource paths that are searched for icons.None.set_search_path (list 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 @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 @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.)
path is NULL-terminated array of directories that are searched for icon themes.None.set_theme_name (string theme_name)
Sets the name of the icon theme that the
GtkIconThemeobject uses overriding system configuration. This function cannot be called on the icon theme objects returned from [func@Gtk.IconTheme.get_for_display].
theme_name is name of icon theme to use instead of configured theme, or %NULL to unset a previously set custom theme.None.[424:7] extends: object
Generated low-level callback wrapper for GIR callback changed.
IconThemeChangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.