1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.FontChooserWidget; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.Box; 30 private import gtk.FontChooserIF; 31 private import gtk.FontChooserT; 32 private import gtk.Widget; 33 private import gtkc.gtk; 34 public import gtkc.gtktypes; 35 36 37 /** 38 * The #GtkFontChooserWidget widget lists the available fonts, 39 * styles and sizes, allowing the user to select a font. It is 40 * used in the #GtkFontChooserDialog widget to provide a 41 * dialog box for selecting fonts. 42 * 43 * To set the font which is initially selected, use 44 * gtk_font_chooser_set_font() or gtk_font_chooser_set_font_desc(). 45 * 46 * To get the selected font use gtk_font_chooser_get_font() or 47 * gtk_font_chooser_get_font_desc(). 48 * 49 * To change the text which is shown in the preview area, use 50 * gtk_font_chooser_set_preview_text(). 51 */ 52 public class FontChooserWidget : Box, FontChooserIF 53 { 54 /** the main Gtk struct */ 55 protected GtkFontChooserWidget* gtkFontChooserWidget; 56 57 /** Get the main Gtk struct */ 58 public GtkFontChooserWidget* getFontChooserWidgetStruct() 59 { 60 return gtkFontChooserWidget; 61 } 62 63 /** the main Gtk struct as a void* */ 64 protected override void* getStruct() 65 { 66 return cast(void*)gtkFontChooserWidget; 67 } 68 69 protected override void setStruct(GObject* obj) 70 { 71 gtkFontChooserWidget = cast(GtkFontChooserWidget*)obj; 72 super.setStruct(obj); 73 } 74 75 /** 76 * Sets our main struct and passes it to the parent class. 77 */ 78 public this (GtkFontChooserWidget* gtkFontChooserWidget, bool ownedRef = false) 79 { 80 this.gtkFontChooserWidget = gtkFontChooserWidget; 81 super(cast(GtkBox*)gtkFontChooserWidget, ownedRef); 82 } 83 84 // add the FontChooser capabilities 85 mixin FontChooserT!(GtkFontChooserWidget); 86 87 /** 88 */ 89 90 public static GType getType() 91 { 92 return gtk_font_chooser_widget_get_type(); 93 } 94 95 /** 96 * Creates a new #GtkFontChooserWidget. 97 * 98 * Return: a new #GtkFontChooserWidget 99 * 100 * Since: 3.2 101 * 102 * Throws: ConstructionException GTK+ fails to create the object. 103 */ 104 public this() 105 { 106 auto p = gtk_font_chooser_widget_new(); 107 108 if(p is null) 109 { 110 throw new ConstructionException("null returned by new"); 111 } 112 113 this(cast(GtkFontChooserWidget*) p); 114 } 115 }