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 = GtkFontSelectionDialog.html
27 * outFile = FontSelectionDialog
28 * strct = GtkFontSelectionDialog
31 * clss = FontSelectionDialog
39 * - gtk_font_selection_dialog_
53 module gtk
.FontSelectionDialog
;
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gtktypes
;
65 private import gtkc
.gtk
;
68 private import glib
.Str
;
69 private import gdk
.Font
;
76 * The GtkFontSelectionDialog widget is a dialog box for selecting a font.
77 * To set the font which is initially selected, use
78 * gtk_font_selection_dialog_set_font_name().
79 * To get the selected font use gtk_font_selection_dialog_get_font_name().
80 * To change the text which is shown in the preview area, use
81 * gtk_font_selection_dialog_set_preview_text().
83 private import gtk
.Dialog
;
84 public class FontSelectionDialog
: Dialog
87 /** the main Gtk struct */
88 protected GtkFontSelectionDialog
* gtkFontSelectionDialog
;
91 public GtkFontSelectionDialog
* getFontSelectionDialogStruct()
93 return gtkFontSelectionDialog
;
97 /** the main Gtk struct as a void* */
98 protected void* getStruct()
100 return cast(void*)gtkFontSelectionDialog
;
104 * Sets our main struct and passes it to the parent class
106 public this (GtkFontSelectionDialog
* gtkFontSelectionDialog
)
110 if ( gtkFontSelectionDialog
is null )
115 Stdout("struct gtkFontSelectionDialog is null on constructor").newline
;
119 printf("struct gtkFontSelectionDialog is null on constructor");
126 assert(gtkFontSelectionDialog
!is null, "struct gtkFontSelectionDialog is null on constructor");
128 super(cast(GtkDialog
*)gtkFontSelectionDialog
);
129 this.gtkFontSelectionDialog
= gtkFontSelectionDialog
;
137 * Creates a new GtkFontSelectionDialog.
139 * the title of the dialog box.
141 * a new GtkFontSelectionDialog.
143 public this (char[] title
)
145 // GtkWidget* gtk_font_selection_dialog_new (const gchar *title);
146 this(cast(GtkFontSelectionDialog
*)gtk_font_selection_dialog_new(Str
.toStringz(title
)) );
151 * gtk_font_selection_dialog_get_font is deprecated and should not be used in newly-written code.
152 * Gets the currently-selected font.
154 * a GtkFontSelectionDialog.
156 * the currently-selected font, or NULL if no font is selected.
158 public Font
getFont()
160 // GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd);
161 return new Font( gtk_font_selection_dialog_get_font(gtkFontSelectionDialog
) );
165 * Gets the currently-selected font name. Note that this can be a different
166 * string than what you set with gtk_font_selection_dialog_set_font_name(), as
167 * the font selection widget may normalize font names and thus return a string
168 * with a different structure. For example, "Helvetica Italic Bold 12" could be
169 * normalized to "Helvetica Bold Italic 12". Use pango_font_description_equal()
170 * if you want to compare two font descriptions.
172 * a GtkFontSelectionDialog
174 * A string with the name of the current font, or NULL if no font
175 * is selected. You must free this string with g_free().
177 public char[] getFontName()
179 // gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
180 return Str
.toString(gtk_font_selection_dialog_get_font_name(gtkFontSelectionDialog
) );
184 * Sets the currently-selected font.
186 * a GtkFontSelectionDialog.
190 * TRUE if the font was found.
192 public int setFontName(char[] fontname
)
194 // gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd, const gchar *fontname);
195 return gtk_font_selection_dialog_set_font_name(gtkFontSelectionDialog
, Str
.toStringz(fontname
));
199 * Gets the text displayed in the preview area.
201 * a GtkFontSelectionDialog.
203 * the text displayed in the preview area. This string is owned
204 * by the widget and should not be modified or freed.
206 public char[] getPreviewText()
208 // const gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
209 return Str
.toString(gtk_font_selection_dialog_get_preview_text(gtkFontSelectionDialog
) );
213 * Sets the text displayed in the preview area.
215 * a GtkFontSelectionDialog.
217 * the text to display in the preview area.
219 * GtkFontSelection, GtkDialog
220 * the underlying widget for selecting
222 * the parent class of GtkFontSelectionDialog
224 public void setPreviewText(char[] text
)
226 // void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd, const gchar *text);
227 gtk_font_selection_dialog_set_preview_text(gtkFontSelectionDialog
, Str
.toStringz(text
));