Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / src / gtk / IconSource.d
blob1ee7b1d59167cb17c84fef7b394ee24c70c28ca3
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 * module aliases:
56 * local aliases:
59 module gtk.IconSource;
61 version(noAssert)
63 version(Tango)
65 import tango.io.Stdout; // use the tango loging?
69 private import gtkc.gtktypes;
71 private import gtkc.gtk;
74 private import glib.Str;
75 private import gdk.Pixbuf;
76 private import gtk.Style;
77 private import gtk.Widget;
78 private import gtk.Settings;
83 /**
84 * Description
85 * Browse the available stock icons in the list of stock IDs found here. You can also use
86 * the gtk-demo application for this purpose.
87 * An icon factory manages a collection of GtkIconSet; a GtkIconSet manages a
88 * set of variants of a particular icon (i.e. a GtkIconSet contains variants for
89 * different sizes and widget states). Icons in an icon factory are named by a
90 * stock ID, which is a simple string identifying the icon. Each GtkStyle has a
91 * list of GtkIconFactory derived from the current theme; those icon factories
92 * are consulted first when searching for an icon. If the theme doesn't set a
93 * particular icon, GTK+ looks for the icon in a list of default icon factories,
94 * maintained by gtk_icon_factory_add_default() and
95 * gtk_icon_factory_remove_default(). Applications with icons should add a default
96 * icon factory with their icons, which will allow themes to override the icons
97 * for the application.
98 * To display an icon, always use gtk_style_lookup_icon_set() on the widget that
99 * will display the icon, or the convenience function
100 * gtk_widget_render_icon(). These functions take the theme into account when
101 * looking up the icon to use for a given stock ID.
103 public class IconSource
106 /** the main Gtk struct */
107 protected GtkIconSource* gtkIconSource;
110 public GtkIconSource* getIconSourceStruct()
112 return gtkIconSource;
116 /** the main Gtk struct as a void* */
117 protected void* getStruct()
119 return cast(void*)gtkIconSource;
123 * Sets our main struct and passes it to the parent class
125 public this (GtkIconSource* gtkIconSource)
127 version(noAssert)
129 if ( gtkIconSource is null )
131 int zero = 0;
132 version(Tango)
134 Stdout("struct gtkIconSource is null on constructor").newline;
136 else
138 printf("struct gtkIconSource is null on constructor");
140 zero = zero / zero;
143 else
145 assert(gtkIconSource !is null, "struct gtkIconSource is null on constructor");
147 this.gtkIconSource = gtkIconSource;
158 * Creates a copy of source; mostly useful for language bindings.
159 * source:
160 * a GtkIconSource
161 * Returns:
162 * a new GtkIconSource
164 public GtkIconSource* sourceCopy()
166 // GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
167 return gtk_icon_source_copy(gtkIconSource);
171 * Frees a dynamically-allocated icon source, along with its
172 * filename, size, and pixbuf fields if those are not NULL.
173 * source:
174 * a GtkIconSource
176 public void sourceFree()
178 // void gtk_icon_source_free (GtkIconSource *source);
179 gtk_icon_source_free(gtkIconSource);
183 * Adds the given icon_set to the icon factory, under the name
184 * stock_id. stock_id should be namespaced for your application,
185 * e.g. "myapp-whatever-icon". Normally applications create a
186 * GtkIconFactory, then add it to the list of default factories with
187 * gtk_icon_factory_add_default(). Then they pass the stock_id to
188 * widgets such as GtkImage to display the icon. Themes can provide
189 * an icon with the same name (such as "myapp-whatever-icon") to
190 * override your application's default icons. If an icon already
191 * existed in factory for stock_id, it is unreferenced and replaced
192 * with the new icon_set.
193 * factory:
194 * a GtkIconFactory
195 * stock_id:
196 * icon name
197 * icon_set:
198 * icon set
200 public static void factoryAdd(GtkIconFactory* factory, char[] stockId, GtkIconSet* iconSet)
202 // void gtk_icon_factory_add (GtkIconFactory *factory, const gchar *stock_id, GtkIconSet *icon_set);
203 gtk_icon_factory_add(factory, Str.toStringz(stockId), iconSet);
207 * Adds an icon factory to the list of icon factories searched by
208 * gtk_style_lookup_icon_set(). This means that, for example,
209 * gtk_image_new_from_stock() will be able to find icons in factory.
210 * There will normally be an icon factory added for each library or
211 * application that comes with icons. The default icon factories
212 * can be overridden by themes.
213 * factory:
214 * a GtkIconFactory
216 public static void factoryAddDefault(GtkIconFactory* factory)
218 // void gtk_icon_factory_add_default (GtkIconFactory *factory);
219 gtk_icon_factory_add_default(factory);
223 * Looks up stock_id in the icon factory, returning an icon set
224 * if found, otherwise NULL. For display to the user, you should
225 * use gtk_style_lookup_icon_set() on the GtkStyle for the
226 * widget that will display the icon, instead of using this
227 * function directly, so that themes are taken into account.
228 * factory:
229 * a GtkIconFactory
230 * stock_id:
231 * an icon name
232 * Returns:
233 * icon set of stock_id.
235 public static GtkIconSet* factoryLookup(GtkIconFactory* factory, char[] stockId)
237 // GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory, const gchar *stock_id);
238 return gtk_icon_factory_lookup(factory, Str.toStringz(stockId));
242 * Looks for an icon in the list of default icon factories. For
243 * display to the user, you should use gtk_style_lookup_icon_set() on
244 * the GtkStyle for the widget that will display the icon, instead of
245 * using this function directly, so that themes are taken into
246 * account.
247 * stock_id:
248 * an icon name
249 * Returns:
250 * a GtkIconSet, or NULL
252 public static GtkIconSet* factoryLookupDefault(char[] stockId)
254 // GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id);
255 return gtk_icon_factory_lookup_default(Str.toStringz(stockId));
259 * Creates a new GtkIconFactory. An icon factory manages a collection
260 * of GtkIconSets; a GtkIconSet manages a set of variants of a
261 * particular icon (i.e. a GtkIconSet contains variants for different
262 * sizes and widget states). Icons in an icon factory are named by a
263 * stock ID, which is a simple string identifying the icon. Each
264 * GtkStyle has a list of GtkIconFactorys derived from the current
265 * theme; those icon factories are consulted first when searching for
266 * an icon. If the theme doesn't set a particular icon, GTK+ looks for
267 * the icon in a list of default icon factories, maintained by
268 * gtk_icon_factory_add_default() and
269 * gtk_icon_factory_remove_default(). Applications with icons should
270 * add a default icon factory with their icons, which will allow
271 * themes to override the icons for the application.
272 * Returns:
273 * a new GtkIconFactory
275 public static GtkIconFactory* factoryNew()
277 // GtkIconFactory* gtk_icon_factory_new (void);
278 return gtk_icon_factory_new();
282 * Removes an icon factory from the list of default icon
283 * factories. Not normally used; you might use it for a library that
284 * can be unloaded or shut down.
285 * factory:
286 * a GtkIconFactory previously added with gtk_icon_factory_add_default()
288 public static void factoryRemoveDefault(GtkIconFactory* factory)
290 // void gtk_icon_factory_remove_default (GtkIconFactory *factory);
291 gtk_icon_factory_remove_default(factory);
295 * Icon sets have a list of GtkIconSource, which they use as base
296 * icons for rendering icons in different states and sizes. Icons are
297 * scaled, made to look insensitive, etc. in
298 * gtk_icon_set_render_icon(), but GtkIconSet needs base images to
299 * work with. The base images and when to use them are described by
300 * a GtkIconSource.
301 * This function copies source, so you can reuse the same source immediately
302 * without affecting the icon set.
303 * An example of when you'd use this function: a web browser's "Back
304 * to Previous Page" icon might point in a different direction in
305 * Hebrew and in English; it might look different when insensitive;
306 * and it might change size depending on toolbar mode (small/large
307 * icons). So a single icon set would contain all those variants of
308 * the icon, and you might add a separate source for each one.
309 * You should nearly always add a "default" icon source with all
310 * fields wildcarded, which will be used as a fallback if no more
311 * specific source matches. GtkIconSet always prefers more specific
312 * icon sources to more generic icon sources. The order in which you
313 * add the sources to the icon set does not matter.
314 * gtk_icon_set_new_from_pixbuf() creates a new icon set with a
315 * default icon source based on the given pixbuf.
316 * icon_set:
317 * a GtkIconSet
318 * source:
319 * a GtkIconSource
321 public static void setAddSource(GtkIconSet* iconSet, GtkIconSource* source)
323 // void gtk_icon_set_add_source (GtkIconSet *icon_set, const GtkIconSource *source);
324 gtk_icon_set_add_source(iconSet, source);
328 * Copies icon_set by value.
329 * icon_set:
330 * a GtkIconSet
331 * Returns:
332 * a new GtkIconSet identical to the first.
334 public static GtkIconSet* setCopy(GtkIconSet* iconSet)
336 // GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
337 return gtk_icon_set_copy(iconSet);
341 * Creates a new GtkIconSet. A GtkIconSet represents a single icon
342 * in various sizes and widget states. It can provide a GdkPixbuf
343 * for a given size and state on request, and automatically caches
344 * some of the rendered GdkPixbuf objects.
345 * Normally you would use gtk_widget_render_icon() instead of
346 * using GtkIconSet directly. The one case where you'd use
347 * GtkIconSet is to create application-specific icon sets to place in
348 * a GtkIconFactory.
349 * Returns:
350 * a new GtkIconSet
352 public static GtkIconSet* setNew()
354 // GtkIconSet* gtk_icon_set_new (void);
355 return gtk_icon_set_new();
359 * Creates a new GtkIconSet with pixbuf as the default/fallback
360 * source image. If you don't add any additional GtkIconSource to the
361 * icon set, all variants of the icon will be created from pixbuf,
362 * using scaling, pixelation, etc. as required to adjust the icon size
363 * or make the icon look insensitive/prelighted.
364 * pixbuf:
365 * a GdkPixbuf
366 * Returns:
367 * a new GtkIconSet
369 public static GtkIconSet* setNewFromPixbuf(Pixbuf pixbuf)
371 // GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf);
372 return gtk_icon_set_new_from_pixbuf((pixbuf is null) ? null : pixbuf.getPixbufStruct());
376 * Increments the reference count on icon_set.
377 * icon_set:
378 * a GtkIconSet.
379 * Returns:
380 * icon_set.
382 public static GtkIconSet* setRef(GtkIconSet* iconSet)
384 // GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set);
385 return gtk_icon_set_ref(iconSet);
389 * Renders an icon using gtk_style_render_icon(). In most cases,
390 * gtk_widget_render_icon() is better, since it automatically provides
391 * most of the arguments from the current widget settings. This
392 * function never returns NULL; if the icon can't be rendered
393 * (perhaps because an image file fails to load), a default "missing
394 * image" icon will be returned instead.
395 * icon_set:
396 * a GtkIconSet
397 * style:
398 * a GtkStyle associated with widget, or NULL
399 * direction:
400 * text direction
401 * state:
402 * widget state
403 * size:
404 * icon size. A size of (GtkIconSize)-1
405 * means render at the size of the source and don't scale.
406 * widget:
407 * widget that will display the icon, or NULL.
408 * The only use that is typically made of this
409 * is to determine the appropriate GdkScreen.
410 * detail:
411 * detail to pass to the theme engine, or NULL.
412 * Note that passing a detail of anything but NULL
413 * will disable caching.
414 * Returns:
415 * a GdkPixbuf to be displayed
417 public static Pixbuf setRenderIcon(GtkIconSet* iconSet, Style style, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, char[] detail)
419 // GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set, GtkStyle *style, GtkTextDirection direction, GtkStateType state, GtkIconSize size, GtkWidget *widget, const char *detail);
420 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)) );
424 * Decrements the reference count on icon_set, and frees memory
425 * if the reference count reaches 0.
426 * icon_set:
427 * a GtkIconSet
429 public static void setUnref(GtkIconSet* iconSet)
431 // void gtk_icon_set_unref (GtkIconSet *icon_set);
432 gtk_icon_set_unref(iconSet);
436 * Obtains the pixel size of a semantic icon size, possibly
437 * modified by user preferences for the default GtkSettings.
438 * (See gtk_icon_size_lookup_for_settings().)
439 * Normally size would be
440 * GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_BUTTON, etc. This function
441 * isn't normally needed, gtk_widget_render_icon() is the usual
442 * way to get an icon for rendering, then just look at the size of
443 * the rendered pixbuf. The rendered pixbuf may not even correspond to
444 * the width/height returned by gtk_icon_size_lookup(), because themes
445 * are free to render the pixbuf however they like, including changing
446 * the usual size.
447 * size:
448 * an icon size
449 * width:
450 * location to store icon width
451 * height:
452 * location to store icon height
453 * Returns:
454 * TRUE if size was a valid size
456 public static int sizeLookup(GtkIconSize size, int* width, int* height)
458 // gboolean gtk_icon_size_lookup (GtkIconSize size, gint *width, gint *height);
459 return gtk_icon_size_lookup(size, width, height);
463 * Obtains the pixel size of a semantic icon size, possibly
464 * modified by user preferences for a particular
465 * GtkSettings. Normally size would be
466 * GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_BUTTON, etc. This function
467 * isn't normally needed, gtk_widget_render_icon() is the usual
468 * way to get an icon for rendering, then just look at the size of
469 * the rendered pixbuf. The rendered pixbuf may not even correspond to
470 * the width/height returned by gtk_icon_size_lookup(), because themes
471 * are free to render the pixbuf however they like, including changing
472 * the usual size.
473 * settings:
474 * a GtkSettings object, used to determine
475 * which set of user preferences to used.
476 * size:
477 * an icon size
478 * width:
479 * location to store icon width
480 * height:
481 * location to store icon height
482 * Returns:
483 * TRUE if size was a valid size
484 * Since 2.2
486 public static int sizeLookupForSettings(Settings settings, GtkIconSize size, int* width, int* height)
488 // gboolean gtk_icon_size_lookup_for_settings (GtkSettings *settings, GtkIconSize size, gint *width, gint *height);
489 return gtk_icon_size_lookup_for_settings((settings is null) ? null : settings.getSettingsStruct(), size, width, height);
493 * Registers a new icon size, along the same lines as GTK_ICON_SIZE_MENU,
494 * etc. Returns the integer value for the size.
495 * name:
496 * name of the icon size
497 * width:
498 * the icon width
499 * height:
500 * the icon height
501 * Returns:
502 * integer value representing the size
504 public static GtkIconSize sizeRegister(char[] name, int width, int height)
506 // GtkIconSize gtk_icon_size_register (const gchar *name, gint width, gint height);
507 return gtk_icon_size_register(Str.toStringz(name), width, height);
511 * Registers alias as another name for target.
512 * So calling gtk_icon_size_from_name() with alias as argument
513 * will return target.
514 * alias:
515 * an alias for target
516 * target:
517 * an existing icon size
519 public static void sizeRegisterAlias(char[] alia, GtkIconSize target)
521 // void gtk_icon_size_register_alias (const gchar *alias, GtkIconSize target);
522 gtk_icon_size_register_alias(Str.toStringz(alia), target);
526 * Looks up the icon size associated with name.
527 * name:
528 * the name to look up.
529 * Returns:
530 * the icon size with the given name.
532 public static GtkIconSize sizeFromName(char[] name)
534 // GtkIconSize gtk_icon_size_from_name (const gchar *name);
535 return gtk_icon_size_from_name(Str.toStringz(name));
539 * Gets the canonical name of the given icon size. The returned string
540 * is statically allocated and should not be freed.
541 * size:
542 * a GtkIconSize.
543 * Returns:
544 * the name of the given icon size.
546 public static char[] sizeGetName(GtkIconSize size)
548 // const gchar* gtk_icon_size_get_name (GtkIconSize size);
549 return Str.toString(gtk_icon_size_get_name(size) );
553 * Obtains a list of icon sizes this icon set can render. The returned
554 * array must be freed with g_free().
555 * icon_set:
556 * a GtkIconSet
557 * sizes:
558 * return location for array of sizes
559 * n_sizes:
560 * location to store number of elements in returned array
562 public static void setGetSizes(GtkIconSet* iconSet, GtkIconSize** sizes, int* nSizes)
564 // void gtk_icon_set_get_sizes (GtkIconSet *icon_set, GtkIconSize **sizes, gint *n_sizes);
565 gtk_icon_set_get_sizes(iconSet, sizes, nSizes);
569 * Obtains the text direction this icon source applies to. The return
570 * value is only useful/meaningful if the text direction is not
571 * wildcarded.
572 * source:
573 * a GtkIconSource
574 * Returns:
575 * text direction this source matches
577 public GtkTextDirection sourceGetDirection()
579 // GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
580 return gtk_icon_source_get_direction(gtkIconSource);
584 * Gets the value set by gtk_icon_source_set_direction_wildcarded().
585 * source:
586 * a GtkIconSource
587 * Returns:
588 * TRUE if this icon source is a base for any text direction variant
590 public int sourceGetDirectionWildcarded()
592 // gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
593 return gtk_icon_source_get_direction_wildcarded(gtkIconSource);
597 * Retrieves the source filename, or NULL if none is set. The
598 * filename is not a copy, and should not be modified or expected to
599 * persist beyond the lifetime of the icon source.
600 * source:
601 * a GtkIconSource
602 * Returns:
603 * image filename. This string must not be modified
604 * or freed.
606 public char[] sourceGetFilename()
608 // const gchar* gtk_icon_source_get_filename (const GtkIconSource *source);
609 return Str.toString(gtk_icon_source_get_filename(gtkIconSource) );
613 * Retrieves the source pixbuf, or NULL if none is set.
614 * In addition, if a filename source is in use, this
615 * function in some cases will return the pixbuf from
616 * loaded from the filename. This is, for example, true
617 * for the GtkIconSource passed to the GtkStyle::render_icon()
618 * virtual function. The reference count on the pixbuf is
619 * not incremented.
620 * source:
621 * a GtkIconSource
622 * Returns:
623 * source pixbuf
625 public Pixbuf sourceGetPixbuf()
627 // GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
628 return new Pixbuf( gtk_icon_source_get_pixbuf(gtkIconSource) );
632 * Retrieves the source icon name, or NULL if none is set. The
633 * icon_name is not a copy, and should not be modified or expected to
634 * persist beyond the lifetime of the icon source.
635 * source:
636 * a GtkIconSource
637 * Returns:
638 * icon name. This string must not be modified or freed.
640 public char[] sourceGetIconName()
642 // const gchar* gtk_icon_source_get_icon_name (const GtkIconSource *source);
643 return Str.toString(gtk_icon_source_get_icon_name(gtkIconSource) );
647 * Obtains the icon size this source applies to. The return value
648 * is only useful/meaningful if the icon size is not wildcarded.
649 * source:
650 * a GtkIconSource
651 * Returns:
652 * icon size this source matches.
654 public GtkIconSize sourceGetSize()
656 // GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
657 return gtk_icon_source_get_size(gtkIconSource);
661 * Gets the value set by gtk_icon_source_set_size_wildcarded().
662 * source:
663 * a GtkIconSource
664 * Returns:
665 * TRUE if this icon source is a base for any icon size variant
667 public int sourceGetSizeWildcarded()
669 // gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
670 return gtk_icon_source_get_size_wildcarded(gtkIconSource);
674 * Obtains the widget state this icon source applies to. The return
675 * value is only useful/meaningful if the widget state is not
676 * wildcarded.
677 * source:
678 * a GtkIconSource
679 * Returns:
680 * widget state this source matches
682 public GtkStateType sourceGetState()
684 // GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
685 return gtk_icon_source_get_state(gtkIconSource);
689 * Gets the value set by gtk_icon_source_set_state_wildcarded().
690 * source:
691 * a GtkIconSource
692 * Returns:
693 * TRUE if this icon source is a base for any widget state variant
695 public int sourceGetStateWildcarded()
697 // gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
698 return gtk_icon_source_get_state_wildcarded(gtkIconSource);
702 * Creates a new GtkIconSource. A GtkIconSource contains a GdkPixbuf (or
703 * image filename) that serves as the base image for one or more of the
704 * icons in a GtkIconSet, along with a specification for which icons in the
705 * icon set will be based on that pixbuf or image file. An icon set contains
706 * a set of icons that represent "the same" logical concept in different states,
707 * different global text directions, and different sizes.
708 * So for example a web browser's "Back to Previous Page" icon might
709 * point in a different direction in Hebrew and in English; it might
710 * look different when insensitive; and it might change size depending
711 * on toolbar mode (small/large icons). So a single icon set would
712 * contain all those variants of the icon. GtkIconSet contains a list
713 * of GtkIconSource from which it can derive specific icon variants in
714 * the set.
715 * In the simplest case, GtkIconSet contains one source pixbuf from
716 * which it derives all variants. The convenience function
717 * gtk_icon_set_new_from_pixbuf() handles this case; if you only have
718 * one source pixbuf, just use that function.
719 * If you want to use a different base pixbuf for different icon
720 * variants, you create multiple icon sources, mark which variants
721 * they'll be used to create, and add them to the icon set with
722 * gtk_icon_set_add_source().
723 * By default, the icon source has all parameters wildcarded. That is,
724 * the icon source will be used as the base icon for any desired text
725 * direction, widget state, or icon size.
726 * Returns:
727 * a new GtkIconSource
729 public static GtkIconSource* sourceNew()
731 // GtkIconSource* gtk_icon_source_new (void);
732 return gtk_icon_source_new();
736 * Sets the text direction this icon source is intended to be used
737 * with.
738 * Setting the text direction on an icon source makes no difference
739 * if the text direction is wildcarded. Therefore, you should usually
740 * call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
741 * in addition to calling this function.
742 * source:
743 * a GtkIconSource
744 * direction:
745 * text direction this source applies to
747 public void sourceSetDirection(GtkTextDirection direction)
749 // void gtk_icon_source_set_direction (GtkIconSource *source, GtkTextDirection direction);
750 gtk_icon_source_set_direction(gtkIconSource, direction);
754 * If the text direction is wildcarded, this source can be used
755 * as the base image for an icon in any GtkTextDirection.
756 * If the text direction is not wildcarded, then the
757 * text direction the icon source applies to should be set
758 * with gtk_icon_source_set_direction(), and the icon source
759 * will only be used with that text direction.
760 * GtkIconSet prefers non-wildcarded sources (exact matches) over
761 * wildcarded sources, and will use an exact match when possible.
762 * source:
763 * a GtkIconSource
764 * setting:
765 * TRUE to wildcard the text direction
767 public void sourceSetDirectionWildcarded(int setting)
769 // void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source, gboolean setting);
770 gtk_icon_source_set_direction_wildcarded(gtkIconSource, setting);
774 * Sets the name of an image file to use as a base image when creating
775 * icon variants for GtkIconSet. The filename must be absolute.
776 * source:
777 * a GtkIconSource
778 * filename:
779 * image file to use
781 public void sourceSetFilename(char[] filename)
783 // void gtk_icon_source_set_filename (GtkIconSource *source, const gchar *filename);
784 gtk_icon_source_set_filename(gtkIconSource, Str.toStringz(filename));
788 * Sets a pixbuf to use as a base image when creating icon variants
789 * for GtkIconSet.
790 * source:
791 * a GtkIconSource
792 * pixbuf:
793 * pixbuf to use as a source
795 public void sourceSetPixbuf(Pixbuf pixbuf)
797 // void gtk_icon_source_set_pixbuf (GtkIconSource *source, GdkPixbuf *pixbuf);
798 gtk_icon_source_set_pixbuf(gtkIconSource, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
802 * Sets the name of an icon to look up in the current icon theme
803 * to use as a base image when creating icon variants for GtkIconSet.
804 * source:
805 * a GtkIconSource
806 * icon_name:
807 * name of icon to use
809 public void sourceSetIconName(char[] iconName)
811 // void gtk_icon_source_set_icon_name (GtkIconSource *source, const gchar *icon_name);
812 gtk_icon_source_set_icon_name(gtkIconSource, Str.toStringz(iconName));
816 * Sets the icon size this icon source is intended to be used
817 * with.
818 * Setting the icon size on an icon source makes no difference
819 * if the size is wildcarded. Therefore, you should usually
820 * call gtk_icon_source_set_size_wildcarded() to un-wildcard it
821 * in addition to calling this function.
822 * source:
823 * a GtkIconSource
824 * size:
825 * icon size this source applies to
827 public void sourceSetSize(GtkIconSize size)
829 // void gtk_icon_source_set_size (GtkIconSource *source, GtkIconSize size);
830 gtk_icon_source_set_size(gtkIconSource, size);
834 * If the icon size is wildcarded, this source can be used as the base
835 * image for an icon of any size. If the size is not wildcarded, then
836 * the size the source applies to should be set with
837 * gtk_icon_source_set_size() and the icon source will only be used
838 * with that specific size.
839 * GtkIconSet prefers non-wildcarded sources (exact matches) over
840 * wildcarded sources, and will use an exact match when possible.
841 * GtkIconSet will normally scale wildcarded source images to produce
842 * an appropriate icon at a given size, but will not change the size
843 * of source images that match exactly.
844 * source:
845 * a GtkIconSource
846 * setting:
847 * TRUE to wildcard the widget state
849 public void sourceSetSizeWildcarded(int setting)
851 // void gtk_icon_source_set_size_wildcarded (GtkIconSource *source, gboolean setting);
852 gtk_icon_source_set_size_wildcarded(gtkIconSource, setting);
856 * Sets the widget state this icon source is intended to be used
857 * with.
858 * Setting the widget state on an icon source makes no difference
859 * if the state is wildcarded. Therefore, you should usually
860 * call gtk_icon_source_set_state_wildcarded() to un-wildcard it
861 * in addition to calling this function.
862 * source:
863 * a GtkIconSource
864 * state:
865 * widget state this source applies to
867 public void sourceSetState(GtkStateType state)
869 // void gtk_icon_source_set_state (GtkIconSource *source, GtkStateType state);
870 gtk_icon_source_set_state(gtkIconSource, state);
874 * If the widget state is wildcarded, this source can be used as the
875 * base image for an icon in any GtkStateType. If the widget state
876 * is not wildcarded, then the state the source applies to should be
877 * set with gtk_icon_source_set_state() and the icon source will
878 * only be used with that specific state.
879 * GtkIconSet prefers non-wildcarded sources (exact matches) over
880 * wildcarded sources, and will use an exact match when possible.
881 * GtkIconSet will normally transform wildcarded source images to
882 * produce an appropriate icon for a given state, for example
883 * lightening an image on prelight, but will not modify source images
884 * that match exactly.
885 * source:
886 * a GtkIconSource
887 * setting:
888 * TRUE to wildcard the widget state
890 public void sourceSetStateWildcarded(int setting)
892 // void gtk_icon_source_set_state_wildcarded (GtkIconSource *source, gboolean setting);
893 gtk_icon_source_set_state_wildcarded(gtkIconSource, setting);