alternative to assert
[gtkD.git] / src / gtk / FontSelectionDialog.d
blob5acae980071ad9b7947cfb9f02e2dffde0e4cd00
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 = GtkFontSelectionDialog.html
26 * outPack = gtk
27 * outFile = FontSelectionDialog
28 * strct = GtkFontSelectionDialog
29 * realStrct=
30 * ctorStrct=
31 * clss = FontSelectionDialog
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_font_selection_dialog_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gdk.Font
47 * structWrap:
48 * - GdkFont* -> Font
49 * local aliases:
52 module gtk.FontSelectionDialog;
54 private import gtk.gtktypes;
56 private import lib.gtk;
58 private import glib.Str;
59 private import gdk.Font;
61 /**
62 * Description
63 * The GtkFontSelectionDialog widget is a dialog box for selecting a font.
64 * To set the font which is initially selected, use
65 * gtk_font_selection_dialog_set_font_name().
66 * To get the selected font use gtk_font_selection_dialog_get_font_name().
67 * To change the text which is shown in the preview area, use
68 * gtk_font_selection_dialog_set_preview_text().
70 private import gtk.Dialog;
71 public class FontSelectionDialog : Dialog
74 /** the main Gtk struct */
75 protected GtkFontSelectionDialog* gtkFontSelectionDialog;
78 public GtkFontSelectionDialog* getFontSelectionDialogStruct()
80 return gtkFontSelectionDialog;
84 /** the main Gtk struct as a void* */
85 protected void* getStruct()
87 return cast(void*)gtkFontSelectionDialog;
90 /**
91 * Sets our main struct and passes it to the parent class
93 public this (GtkFontSelectionDialog* gtkFontSelectionDialog)
95 super(cast(GtkDialog*)gtkFontSelectionDialog);
96 this.gtkFontSelectionDialog = gtkFontSelectionDialog;
99 /**
104 * Creates a new GtkFontSelectionDialog.
105 * title:
106 * the title of the dialog box.
107 * Returns:
108 * a new GtkFontSelectionDialog.
110 public this (char[] title)
112 // GtkWidget* gtk_font_selection_dialog_new (const gchar *title);
113 this(cast(GtkFontSelectionDialog*)gtk_font_selection_dialog_new(Str.toStringz(title)) );
117 * Warning
118 * gtk_font_selection_dialog_get_font is deprecated and should not be used in newly-written code.
119 * Gets the currently-selected font.
120 * fsd:
121 * a GtkFontSelectionDialog.
122 * Returns:
123 * the currently-selected font, or NULL if no font is selected.
125 public Font getFont()
127 // GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd);
128 return new Font( gtk_font_selection_dialog_get_font(gtkFontSelectionDialog) );
132 * Gets the currently-selected font name. Note that this can be a different
133 * string than what you set with gtk_font_selection_dialog_set_font_name(), as
134 * the font selection widget may normalize font names and thus return a string
135 * with a different structure. For example, "Helvetica Italic Bold 12" could be
136 * normalized to "Helvetica Bold Italic 12". Use pango_font_description_equal()
137 * if you want to compare two font descriptions.
138 * fsd:
139 * a GtkFontSelectionDialog
140 * Returns:
141 * A string with the name of the current font, or NULL if no font
142 * is selected. You must free this string with g_free().
144 public char[] getFontName()
146 // gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
147 return Str.toString(gtk_font_selection_dialog_get_font_name(gtkFontSelectionDialog) );
151 * Sets the currently-selected font.
152 * fsd:
153 * a GtkFontSelectionDialog.
154 * fontname:
155 * a fontname.
156 * Returns:
157 * TRUE if the font was found.
159 public int setFontName(char[] fontname)
161 // gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd, const gchar *fontname);
162 return gtk_font_selection_dialog_set_font_name(gtkFontSelectionDialog, Str.toStringz(fontname));
166 * Gets the text displayed in the preview area.
167 * fsd:
168 * a GtkFontSelectionDialog.
169 * Returns:
170 * the text displayed in the preview area. This string is owned
171 * by the widget and should not be modified or freed.
173 public char[] getPreviewText()
175 // const gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
176 return Str.toString(gtk_font_selection_dialog_get_preview_text(gtkFontSelectionDialog) );
180 * Sets the text displayed in the preview area.
181 * fsd:
182 * a GtkFontSelectionDialog.
183 * text:
184 * the text to display in the preview area.
185 * See Also
186 * GtkFontSelection, GtkDialog
187 * the underlying widget for selecting
188 * fonts.
189 * the parent class of GtkFontSelectionDialog
191 public void setPreviewText(char[] text)
193 // void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd, const gchar *text);
194 gtk_font_selection_dialog_set_preview_text(gtkFontSelectionDialog, Str.toStringz(text));