I've no idea here...
[gtkD.git] / src / gtk / IconSource.d
blobb60bf6635c62b6e63bd6cea78be1921cd4f44b9e
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gtk-Themeable-Stock-Images.html
26 * outPack = gtk
27 * outFile = IconSource
28 * strct = GtkIconSource
29 * realStrct=
30 * ctorStrct=
31 * clss = IconSource
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_icon_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gdk.Pixbuf
47 * - gtk.Style
48 * - gtk.Widget
49 * - gtk.Settings
50 * structWrap:
51 * - GdkPixbuf* -> Pixbuf
52 * - GtkSettings* -> Settings
53 * - GtkStyle* -> Style
54 * - GtkWidget* -> Widget
55 * local aliases:
58 module gtk.IconSource;
60 private import gtk.gtktypes;
62 private import lib.gtk;
64 private import glib.Str;
65 private import gdk.Pixbuf;
66 private import gtk.Style;
67 private import gtk.Widget;
68 private import gtk.Settings;
70 /**
71 * Description
72 * Browse the available stock icons in the list of stock IDs found here. You can also use
73 * the gtk-demo application for this purpose.
74 * An icon factory manages a collection of GtkIconSet; a GtkIconSet manages a
75 * set of variants of a particular icon (i.e. a GtkIconSet contains variants for
76 * different sizes and widget states). Icons in an icon factory are named by a
77 * stock ID, which is a simple string identifying the icon. Each GtkStyle has a
78 * list of GtkIconFactory derived from the current theme; those icon factories
79 * are consulted first when searching for an icon. If the theme doesn't set a
80 * particular icon, GTK+ looks for the icon in a list of default icon factories,
81 * maintained by gtk_icon_factory_add_default() and
82 * gtk_icon_factory_remove_default(). Applications with icons should add a default
83 * icon factory with their icons, which will allow themes to override the icons
84 * for the application.
85 * To display an icon, always use gtk_style_lookup_icon_set() on the widget that
86 * will display the icon, or the convenience function
87 * gtk_widget_render_icon(). These functions take the theme into account when
88 * looking up the icon to use for a given stock ID.
90 public class IconSource
93 /** the main Gtk struct */
94 protected GtkIconSource* gtkIconSource;
97 public GtkIconSource* getIconSourceStruct()
99 return gtkIconSource;
103 /** the main Gtk struct as a void* */
104 protected void* getStruct()
106 return cast(void*)gtkIconSource;
110 * Sets our main struct and passes it to the parent class
112 public this (GtkIconSource* gtkIconSource)
114 this.gtkIconSource = gtkIconSource;
125 * Creates a copy of source; mostly useful for language bindings.
126 * source:
127 * a GtkIconSource
128 * Returns:
129 * a new GtkIconSource
131 public GtkIconSource* sourceCopy()
133 // GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
134 return gtk_icon_source_copy(gtkIconSource);
138 * Frees a dynamically-allocated icon source, along with its
139 * filename, size, and pixbuf fields if those are not NULL.
140 * source:
141 * a GtkIconSource
143 public void sourceFree()
145 // void gtk_icon_source_free (GtkIconSource *source);
146 gtk_icon_source_free(gtkIconSource);
150 * Adds the given icon_set to the icon factory, under the name
151 * stock_id. stock_id should be namespaced for your application,
152 * e.g. "myapp-whatever-icon". Normally applications create a
153 * GtkIconFactory, then add it to the list of default factories with
154 * gtk_icon_factory_add_default(). Then they pass the stock_id to
155 * widgets such as GtkImage to display the icon. Themes can provide
156 * an icon with the same name (such as "myapp-whatever-icon") to
157 * override your application's default icons. If an icon already
158 * existed in factory for stock_id, it is unreferenced and replaced
159 * with the new icon_set.
160 * factory:
161 * a GtkIconFactory
162 * stock_id:
163 * icon name
164 * icon_set:
165 * icon set
167 public static void factoryAdd(GtkIconFactory* factory, char[] stockId, GtkIconSet* iconSet)
169 // void gtk_icon_factory_add (GtkIconFactory *factory, const gchar *stock_id, GtkIconSet *icon_set);
170 gtk_icon_factory_add(factory, Str.toStringz(stockId), iconSet);
174 * Adds an icon factory to the list of icon factories searched by
175 * gtk_style_lookup_icon_set(). This means that, for example,
176 * gtk_image_new_from_stock() will be able to find icons in factory.
177 * There will normally be an icon factory added for each library or
178 * application that comes with icons. The default icon factories
179 * can be overridden by themes.
180 * factory:
181 * a GtkIconFactory
183 public static void factoryAddDefault(GtkIconFactory* factory)
185 // void gtk_icon_factory_add_default (GtkIconFactory *factory);
186 gtk_icon_factory_add_default(factory);
190 * Looks up stock_id in the icon factory, returning an icon set
191 * if found, otherwise NULL. For display to the user, you should
192 * use gtk_style_lookup_icon_set() on the GtkStyle for the
193 * widget that will display the icon, instead of using this
194 * function directly, so that themes are taken into account.
195 * factory:
196 * a GtkIconFactory
197 * stock_id:
198 * an icon name
199 * Returns:
200 * icon set of stock_id.
202 public static GtkIconSet* factoryLookup(GtkIconFactory* factory, char[] stockId)
204 // GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory, const gchar *stock_id);
205 return gtk_icon_factory_lookup(factory, Str.toStringz(stockId));
209 * Looks for an icon in the list of default icon factories. For
210 * display to the user, you should use gtk_style_lookup_icon_set() on
211 * the GtkStyle for the widget that will display the icon, instead of
212 * using this function directly, so that themes are taken into
213 * account.
214 * stock_id:
215 * an icon name
216 * Returns:
217 * a GtkIconSet, or NULL
219 public static GtkIconSet* factoryLookupDefault(char[] stockId)
221 // GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id);
222 return gtk_icon_factory_lookup_default(Str.toStringz(stockId));
226 * Creates a new GtkIconFactory. An icon factory manages a collection
227 * of GtkIconSets; a GtkIconSet manages a set of variants of a
228 * particular icon (i.e. a GtkIconSet contains variants for different
229 * sizes and widget states). Icons in an icon factory are named by a
230 * stock ID, which is a simple string identifying the icon. Each
231 * GtkStyle has a list of GtkIconFactorys derived from the current
232 * theme; those icon factories are consulted first when searching for
233 * an icon. If the theme doesn't set a particular icon, GTK+ looks for
234 * the icon in a list of default icon factories, maintained by
235 * gtk_icon_factory_add_default() and
236 * gtk_icon_factory_remove_default(). Applications with icons should
237 * add a default icon factory with their icons, which will allow
238 * themes to override the icons for the application.
239 * Returns:
240 * a new GtkIconFactory
242 public static GtkIconFactory* factoryNew()
244 // GtkIconFactory* gtk_icon_factory_new (void);
245 return gtk_icon_factory_new();
249 * Removes an icon factory from the list of default icon
250 * factories. Not normally used; you might use it for a library that
251 * can be unloaded or shut down.
252 * factory:
253 * a GtkIconFactory previously added with gtk_icon_factory_add_default()
255 public static void factoryRemoveDefault(GtkIconFactory* factory)
257 // void gtk_icon_factory_remove_default (GtkIconFactory *factory);
258 gtk_icon_factory_remove_default(factory);
262 * Icon sets have a list of GtkIconSource, which they use as base
263 * icons for rendering icons in different states and sizes. Icons are
264 * scaled, made to look insensitive, etc. in
265 * gtk_icon_set_render_icon(), but GtkIconSet needs base images to
266 * work with. The base images and when to use them are described by
267 * a GtkIconSource.
268 * This function copies source, so you can reuse the same source immediately
269 * without affecting the icon set.
270 * An example of when you'd use this function: a web browser's "Back
271 * to Previous Page" icon might point in a different direction in
272 * Hebrew and in English; it might look different when insensitive;
273 * and it might change size depending on toolbar mode (small/large
274 * icons). So a single icon set would contain all those variants of
275 * the icon, and you might add a separate source for each one.
276 * You should nearly always add a "default" icon source with all
277 * fields wildcarded, which will be used as a fallback if no more
278 * specific source matches. GtkIconSet always prefers more specific
279 * icon sources to more generic icon sources. The order in which you
280 * add the sources to the icon set does not matter.
281 * gtk_icon_set_new_from_pixbuf() creates a new icon set with a
282 * default icon source based on the given pixbuf.
283 * icon_set:
284 * a GtkIconSet
285 * source:
286 * a GtkIconSource
288 public static void setAddSource(GtkIconSet* iconSet, GtkIconSource* source)
290 // void gtk_icon_set_add_source (GtkIconSet *icon_set, const GtkIconSource *source);
291 gtk_icon_set_add_source(iconSet, source);
295 * Copies icon_set by value.
296 * icon_set:
297 * a GtkIconSet
298 * Returns:
299 * a new GtkIconSet identical to the first.
301 public static GtkIconSet* setCopy(GtkIconSet* iconSet)
303 // GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
304 return gtk_icon_set_copy(iconSet);
308 * Creates a new GtkIconSet. A GtkIconSet represents a single icon
309 * in various sizes and widget states. It can provide a GdkPixbuf
310 * for a given size and state on request, and automatically caches
311 * some of the rendered GdkPixbuf objects.
312 * Normally you would use gtk_widget_render_icon() instead of
313 * using GtkIconSet directly. The one case where you'd use
314 * GtkIconSet is to create application-specific icon sets to place in
315 * a GtkIconFactory.
316 * Returns:
317 * a new GtkIconSet
319 public static GtkIconSet* setNew()
321 // GtkIconSet* gtk_icon_set_new (void);
322 return gtk_icon_set_new();
326 * Creates a new GtkIconSet with pixbuf as the default/fallback
327 * source image. If you don't add any additional GtkIconSource to the
328 * icon set, all variants of the icon will be created from pixbuf,
329 * using scaling, pixelation, etc. as required to adjust the icon size
330 * or make the icon look insensitive/prelighted.
331 * pixbuf:
332 * a GdkPixbuf
333 * Returns:
334 * a new GtkIconSet
336 public static GtkIconSet* setNewFromPixbuf(Pixbuf pixbuf)
338 // GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf);
339 return gtk_icon_set_new_from_pixbuf((pixbuf is null) ? null : pixbuf.getPixbufStruct());
343 * Increments the reference count on icon_set.
344 * icon_set:
345 * a GtkIconSet.
346 * Returns:
347 * icon_set.
349 public static GtkIconSet* setRef(GtkIconSet* iconSet)
351 // GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set);
352 return gtk_icon_set_ref(iconSet);
356 * Renders an icon using gtk_style_render_icon(). In most cases,
357 * gtk_widget_render_icon() is better, since it automatically provides
358 * most of the arguments from the current widget settings. This
359 * function never returns NULL; if the icon can't be rendered
360 * (perhaps because an image file fails to load), a default "missing
361 * image" icon will be returned instead.
362 * icon_set:
363 * a GtkIconSet
364 * style:
365 * a GtkStyle associated with widget, or NULL
366 * direction:
367 * text direction
368 * state:
369 * widget state
370 * size:
371 * icon size. A size of (GtkIconSize)-1
372 * means render at the size of the source and don't scale.
373 * widget:
374 * widget that will display the icon, or NULL.
375 * The only use that is typically made of this
376 * is to determine the appropriate GdkScreen.
377 * detail:
378 * detail to pass to the theme engine, or NULL.
379 * Note that passing a detail of anything but NULL
380 * will disable caching.
381 * Returns:
382 * a GdkPixbuf to be displayed
384 public static Pixbuf setRenderIcon(GtkIconSet* iconSet, Style style, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, char[] detail)
386 // GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set, GtkStyle *style, GtkTextDirection direction, GtkStateType state, GtkIconSize size, GtkWidget *widget, const char *detail);
387 return new Pixbuf( gtk_icon_set_render_icon(iconSet, (style is null) ? null : style.getStyleStruct(), direction, state, size, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(detail)) );
391 * Decrements the reference count on icon_set, and frees memory
392 * if the reference count reaches 0.
393 * icon_set:
394 * a GtkIconSet
396 public static void setUnref(GtkIconSet* iconSet)
398 // void gtk_icon_set_unref (GtkIconSet *icon_set);
399 gtk_icon_set_unref(iconSet);
403 * Obtains the pixel size of a semantic icon size, possibly
404 * modified by user preferences for the default GtkSettings.
405 * (See gtk_icon_size_lookup_for_settings().)
406 * Normally size would be
407 * GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_BUTTON, etc. This function
408 * isn't normally needed, gtk_widget_render_icon() is the usual
409 * way to get an icon for rendering, then just look at the size of
410 * the rendered pixbuf. The rendered pixbuf may not even correspond to
411 * the width/height returned by gtk_icon_size_lookup(), because themes
412 * are free to render the pixbuf however they like, including changing
413 * the usual size.
414 * size:
415 * an icon size
416 * width:
417 * location to store icon width
418 * height:
419 * location to store icon height
420 * Returns:
421 * TRUE if size was a valid size
423 public static int sizeLookup(GtkIconSize size, int* width, int* height)
425 // gboolean gtk_icon_size_lookup (GtkIconSize size, gint *width, gint *height);
426 return gtk_icon_size_lookup(size, width, height);
430 * Obtains the pixel size of a semantic icon size, possibly
431 * modified by user preferences for a particular
432 * GtkSettings. Normally size would be
433 * GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_BUTTON, etc. This function
434 * isn't normally needed, gtk_widget_render_icon() is the usual
435 * way to get an icon for rendering, then just look at the size of
436 * the rendered pixbuf. The rendered pixbuf may not even correspond to
437 * the width/height returned by gtk_icon_size_lookup(), because themes
438 * are free to render the pixbuf however they like, including changing
439 * the usual size.
440 * settings:
441 * a GtkSettings object, used to determine
442 * which set of user preferences to used.
443 * size:
444 * an icon size
445 * width:
446 * location to store icon width
447 * height:
448 * location to store icon height
449 * Returns:
450 * TRUE if size was a valid size
451 * Since 2.2
453 public static int sizeLookupForSettings(Settings settings, GtkIconSize size, int* width, int* height)
455 // gboolean gtk_icon_size_lookup_for_settings (GtkSettings *settings, GtkIconSize size, gint *width, gint *height);
456 return gtk_icon_size_lookup_for_settings((settings is null) ? null : settings.getSettingsStruct(), size, width, height);
460 * Registers a new icon size, along the same lines as GTK_ICON_SIZE_MENU,
461 * etc. Returns the integer value for the size.
462 * name:
463 * name of the icon size
464 * width:
465 * the icon width
466 * height:
467 * the icon height
468 * Returns:
469 * integer value representing the size
471 public static GtkIconSize sizeRegister(char[] name, int width, int height)
473 // GtkIconSize gtk_icon_size_register (const gchar *name, gint width, gint height);
474 return gtk_icon_size_register(Str.toStringz(name), width, height);
478 * Registers alias as another name for target.
479 * So calling gtk_icon_size_from_name() with alias as argument
480 * will return target.
481 * alias:
482 * an alias for target
483 * target:
484 * an existing icon size
486 public static void sizeRegisterAlias(char[] alia, GtkIconSize target)
488 // void gtk_icon_size_register_alias (const gchar *alias, GtkIconSize target);
489 gtk_icon_size_register_alias(Str.toStringz(alia), target);
493 * Looks up the icon size associated with name.
494 * name:
495 * the name to look up.
496 * Returns:
497 * the icon size with the given name.
499 public static GtkIconSize sizeFromName(char[] name)
501 // GtkIconSize gtk_icon_size_from_name (const gchar *name);
502 return gtk_icon_size_from_name(Str.toStringz(name));
506 * Gets the canonical name of the given icon size. The returned string
507 * is statically allocated and should not be freed.
508 * size:
509 * a GtkIconSize.
510 * Returns:
511 * the name of the given icon size.
513 public static char[] sizeGetName(GtkIconSize size)
515 // const gchar* gtk_icon_size_get_name (GtkIconSize size);
516 return Str.toString(gtk_icon_size_get_name(size) );
520 * Obtains a list of icon sizes this icon set can render. The returned
521 * array must be freed with g_free().
522 * icon_set:
523 * a GtkIconSet
524 * sizes:
525 * return location for array of sizes
526 * n_sizes:
527 * location to store number of elements in returned array
529 public static void setGetSizes(GtkIconSet* iconSet, GtkIconSize** sizes, int* nSizes)
531 // void gtk_icon_set_get_sizes (GtkIconSet *icon_set, GtkIconSize **sizes, gint *n_sizes);
532 gtk_icon_set_get_sizes(iconSet, sizes, nSizes);
536 * Obtains the text direction this icon source applies to. The return
537 * value is only useful/meaningful if the text direction is not
538 * wildcarded.
539 * source:
540 * a GtkIconSource
541 * Returns:
542 * text direction this source matches
544 public GtkTextDirection sourceGetDirection()
546 // GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
547 return gtk_icon_source_get_direction(gtkIconSource);
551 * Gets the value set by gtk_icon_source_set_direction_wildcarded().
552 * source:
553 * a GtkIconSource
554 * Returns:
555 * TRUE if this icon source is a base for any text direction variant
557 public int sourceGetDirectionWildcarded()
559 // gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
560 return gtk_icon_source_get_direction_wildcarded(gtkIconSource);
564 * Retrieves the source filename, or NULL if none is set. The
565 * filename is not a copy, and should not be modified or expected to
566 * persist beyond the lifetime of the icon source.
567 * source:
568 * a GtkIconSource
569 * Returns:
570 * image filename. This string must not be modified
571 * or freed.
573 public char[] sourceGetFilename()
575 // const gchar* gtk_icon_source_get_filename (const GtkIconSource *source);
576 return Str.toString(gtk_icon_source_get_filename(gtkIconSource) );
580 * Retrieves the source pixbuf, or NULL if none is set.
581 * In addition, if a filename source is in use, this
582 * function in some cases will return the pixbuf from
583 * loaded from the filename. This is, for example, true
584 * for the GtkIconSource passed to the GtkStyle::render_icon()
585 * virtual function. The reference count on the pixbuf is
586 * not incremented.
587 * source:
588 * a GtkIconSource
589 * Returns:
590 * source pixbuf
592 public Pixbuf sourceGetPixbuf()
594 // GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
595 return new Pixbuf( gtk_icon_source_get_pixbuf(gtkIconSource) );
599 * Retrieves the source icon name, or NULL if none is set. The
600 * icon_name is not a copy, and should not be modified or expected to
601 * persist beyond the lifetime of the icon source.
602 * source:
603 * a GtkIconSource
604 * Returns:
605 * icon name. This string must not be modified or freed.
607 public char[] sourceGetIconName()
609 // const gchar* gtk_icon_source_get_icon_name (const GtkIconSource *source);
610 return Str.toString(gtk_icon_source_get_icon_name(gtkIconSource) );
614 * Obtains the icon size this source applies to. The return value
615 * is only useful/meaningful if the icon size is not wildcarded.
616 * source:
617 * a GtkIconSource
618 * Returns:
619 * icon size this source matches.
621 public GtkIconSize sourceGetSize()
623 // GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
624 return gtk_icon_source_get_size(gtkIconSource);
628 * Gets the value set by gtk_icon_source_set_size_wildcarded().
629 * source:
630 * a GtkIconSource
631 * Returns:
632 * TRUE if this icon source is a base for any icon size variant
634 public int sourceGetSizeWildcarded()
636 // gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
637 return gtk_icon_source_get_size_wildcarded(gtkIconSource);
641 * Obtains the widget state this icon source applies to. The return
642 * value is only useful/meaningful if the widget state is not
643 * wildcarded.
644 * source:
645 * a GtkIconSource
646 * Returns:
647 * widget state this source matches
649 public GtkStateType sourceGetState()
651 // GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
652 return gtk_icon_source_get_state(gtkIconSource);
656 * Gets the value set by gtk_icon_source_set_state_wildcarded().
657 * source:
658 * a GtkIconSource
659 * Returns:
660 * TRUE if this icon source is a base for any widget state variant
662 public int sourceGetStateWildcarded()
664 // gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
665 return gtk_icon_source_get_state_wildcarded(gtkIconSource);
669 * Creates a new GtkIconSource. A GtkIconSource contains a GdkPixbuf (or
670 * image filename) that serves as the base image for one or more of the
671 * icons in a GtkIconSet, along with a specification for which icons in the
672 * icon set will be based on that pixbuf or image file. An icon set contains
673 * a set of icons that represent "the same" logical concept in different states,
674 * different global text directions, and different sizes.
675 * So for example a web browser's "Back to Previous Page" icon might
676 * point in a different direction in Hebrew and in English; it might
677 * look different when insensitive; and it might change size depending
678 * on toolbar mode (small/large icons). So a single icon set would
679 * contain all those variants of the icon. GtkIconSet contains a list
680 * of GtkIconSource from which it can derive specific icon variants in
681 * the set.
682 * In the simplest case, GtkIconSet contains one source pixbuf from
683 * which it derives all variants. The convenience function
684 * gtk_icon_set_new_from_pixbuf() handles this case; if you only have
685 * one source pixbuf, just use that function.
686 * If you want to use a different base pixbuf for different icon
687 * variants, you create multiple icon sources, mark which variants
688 * they'll be used to create, and add them to the icon set with
689 * gtk_icon_set_add_source().
690 * By default, the icon source has all parameters wildcarded. That is,
691 * the icon source will be used as the base icon for any desired text
692 * direction, widget state, or icon size.
693 * Returns:
694 * a new GtkIconSource
696 public static GtkIconSource* sourceNew()
698 // GtkIconSource* gtk_icon_source_new (void);
699 return gtk_icon_source_new();
703 * Sets the text direction this icon source is intended to be used
704 * with.
705 * Setting the text direction on an icon source makes no difference
706 * if the text direction is wildcarded. Therefore, you should usually
707 * call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
708 * in addition to calling this function.
709 * source:
710 * a GtkIconSource
711 * direction:
712 * text direction this source applies to
714 public void sourceSetDirection(GtkTextDirection direction)
716 // void gtk_icon_source_set_direction (GtkIconSource *source, GtkTextDirection direction);
717 gtk_icon_source_set_direction(gtkIconSource, direction);
721 * If the text direction is wildcarded, this source can be used
722 * as the base image for an icon in any GtkTextDirection.
723 * If the text direction is not wildcarded, then the
724 * text direction the icon source applies to should be set
725 * with gtk_icon_source_set_direction(), and the icon source
726 * will only be used with that text direction.
727 * GtkIconSet prefers non-wildcarded sources (exact matches) over
728 * wildcarded sources, and will use an exact match when possible.
729 * source:
730 * a GtkIconSource
731 * setting:
732 * TRUE to wildcard the text direction
734 public void sourceSetDirectionWildcarded(int setting)
736 // void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source, gboolean setting);
737 gtk_icon_source_set_direction_wildcarded(gtkIconSource, setting);
741 * Sets the name of an image file to use as a base image when creating
742 * icon variants for GtkIconSet. The filename must be absolute.
743 * source:
744 * a GtkIconSource
745 * filename:
746 * image file to use
748 public void sourceSetFilename(char[] filename)
750 // void gtk_icon_source_set_filename (GtkIconSource *source, const gchar *filename);
751 gtk_icon_source_set_filename(gtkIconSource, Str.toStringz(filename));
755 * Sets a pixbuf to use as a base image when creating icon variants
756 * for GtkIconSet.
757 * source:
758 * a GtkIconSource
759 * pixbuf:
760 * pixbuf to use as a source
762 public void sourceSetPixbuf(Pixbuf pixbuf)
764 // void gtk_icon_source_set_pixbuf (GtkIconSource *source, GdkPixbuf *pixbuf);
765 gtk_icon_source_set_pixbuf(gtkIconSource, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
769 * Sets the name of an icon to look up in the current icon theme
770 * to use as a base image when creating icon variants for GtkIconSet.
771 * source:
772 * a GtkIconSource
773 * icon_name:
774 * name of icon to use
776 public void sourceSetIconName(char[] iconName)
778 // void gtk_icon_source_set_icon_name (GtkIconSource *source, const gchar *icon_name);
779 gtk_icon_source_set_icon_name(gtkIconSource, Str.toStringz(iconName));
783 * Sets the icon size this icon source is intended to be used
784 * with.
785 * Setting the icon size on an icon source makes no difference
786 * if the size is wildcarded. Therefore, you should usually
787 * call gtk_icon_source_set_size_wildcarded() to un-wildcard it
788 * in addition to calling this function.
789 * source:
790 * a GtkIconSource
791 * size:
792 * icon size this source applies to
794 public void sourceSetSize(GtkIconSize size)
796 // void gtk_icon_source_set_size (GtkIconSource *source, GtkIconSize size);
797 gtk_icon_source_set_size(gtkIconSource, size);
801 * If the icon size is wildcarded, this source can be used as the base
802 * image for an icon of any size. If the size is not wildcarded, then
803 * the size the source applies to should be set with
804 * gtk_icon_source_set_size() and the icon source will only be used
805 * with that specific size.
806 * GtkIconSet prefers non-wildcarded sources (exact matches) over
807 * wildcarded sources, and will use an exact match when possible.
808 * GtkIconSet will normally scale wildcarded source images to produce
809 * an appropriate icon at a given size, but will not change the size
810 * of source images that match exactly.
811 * source:
812 * a GtkIconSource
813 * setting:
814 * TRUE to wildcard the widget state
816 public void sourceSetSizeWildcarded(int setting)
818 // void gtk_icon_source_set_size_wildcarded (GtkIconSource *source, gboolean setting);
819 gtk_icon_source_set_size_wildcarded(gtkIconSource, setting);
823 * Sets the widget state this icon source is intended to be used
824 * with.
825 * Setting the widget state on an icon source makes no difference
826 * if the state is wildcarded. Therefore, you should usually
827 * call gtk_icon_source_set_state_wildcarded() to un-wildcard it
828 * in addition to calling this function.
829 * source:
830 * a GtkIconSource
831 * state:
832 * widget state this source applies to
834 public void sourceSetState(GtkStateType state)
836 // void gtk_icon_source_set_state (GtkIconSource *source, GtkStateType state);
837 gtk_icon_source_set_state(gtkIconSource, state);
841 * If the widget state is wildcarded, this source can be used as the
842 * base image for an icon in any GtkStateType. If the widget state
843 * is not wildcarded, then the state the source applies to should be
844 * set with gtk_icon_source_set_state() and the icon source will
845 * only be used with that specific state.
846 * GtkIconSet prefers non-wildcarded sources (exact matches) over
847 * wildcarded sources, and will use an exact match when possible.
848 * GtkIconSet will normally transform wildcarded source images to
849 * produce an appropriate icon for a given state, for example
850 * lightening an image on prelight, but will not modify source images
851 * that match exactly.
852 * source:
853 * a GtkIconSource
854 * setting:
855 * TRUE to wildcard the widget state
857 public void sourceSetStateWildcarded(int setting)
859 // void gtk_icon_source_set_state_wildcarded (GtkIconSource *source, gboolean setting);
860 gtk_icon_source_set_state_wildcarded(gtkIconSource, setting);