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 = GtkFontSelection.html
27 * outFile = FontSelection
28 * strct = GtkFontSelection
31 * clss = FontSelection
39 * - gtk_font_selection_
52 module gtk
.FontSelection
;
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import glib
.Str
;
59 private import gdk
.Font
;
63 * The GtkFontSelection widget lists the available fonts, styles and sizes,
64 * allowing the user to select a font.
65 * It is used in the GtkFontSelectionDialog widget to provide a dialog box for
67 * To set the font which is initially selected, use
68 * gtk_font_selection_set_font_name().
69 * To get the selected font use gtk_font_selection_get_font_name().
70 * To change the text which is shown in the preview area, use
71 * gtk_font_selection_set_preview_text().
73 private import gtk
.VBox
;
74 public class FontSelection
: VBox
77 /** the main Gtk struct */
78 protected GtkFontSelection
* gtkFontSelection
;
81 public GtkFontSelection
* getFontSelectionStruct()
83 return gtkFontSelection
;
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gtkFontSelection
;
94 * Sets our main struct and passes it to the parent class
96 public this (GtkFontSelection
* gtkFontSelection
)
98 super(cast(GtkVBox
*)gtkFontSelection
);
99 this.gtkFontSelection
= gtkFontSelection
;
107 * Creates a new GtkFontSelection.
109 * a new GtkFontSelection.
113 // GtkWidget* gtk_font_selection_new (void);
114 this(cast(GtkFontSelection
*)gtk_font_selection_new() );
119 * gtk_font_selection_get_font is deprecated and should not be used in newly-written code.
120 * Gets the currently-selected font.
122 * a GtkFontSelection.
124 * the currently-selected font, or NULL if no font is selected.
126 public Font
getFont()
128 // GdkFont* gtk_font_selection_get_font (GtkFontSelection *fontsel);
129 return new Font( gtk_font_selection_get_font(gtkFontSelection
) );
133 * Gets the currently-selected font name. Note that this can be a different
134 * string than what you set with gtk_font_selection_set_font_name(), as
135 * the font selection widget may normalize font names and thus return a string
136 * with a different structure. For example, "Helvetica Italic Bold 12" could be
137 * normalized to "Helvetica Bold Italic 12". Use pango_font_description_equal()
138 * if you want to compare two font descriptions.
142 * A string with the name of the current font, or NULL if no font
143 * is selected. You must free this string with g_free().
145 public char[] getFontName()
147 // gchar* gtk_font_selection_get_font_name (GtkFontSelection *fontsel);
148 return Str
.toString(gtk_font_selection_get_font_name(gtkFontSelection
) );
152 * Sets the currently-selected font. Note that the fontsel needs to know the
153 * screen in which it will appear for this to work; this can be guaranteed by
154 * simply making sure that the fontsel is inserted in a toplevel window before
155 * you call this function.
159 * a font name like "Helvetica 12" or "Times Bold 18"
161 * TRUE if the font could be set successfully; FALSE if no such
162 * font exists or if the fontsel doesn't belong to a particular screen yet.
164 public int setFontName(char[] fontname
)
166 // gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel, const gchar *fontname);
167 return gtk_font_selection_set_font_name(gtkFontSelection
, Str
.toStringz(fontname
));
171 * Gets the text displayed in the preview area.
173 * a GtkFontSelection.
175 * the text displayed in the preview area. This string is
176 * owned by the widget and should not be modified or freed.
178 public char[] getPreviewText()
180 // const gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
181 return Str
.toString(gtk_font_selection_get_preview_text(gtkFontSelection
) );
185 * Sets the text displayed in the preview area.
187 * a GtkFontSelection.
189 * the text to display in the preview area.
191 * The "font" property
192 * "font" GdkFont : Read
193 * The GdkFont that is currently selected.
195 public void setPreviewText(char[] text
)
197 // void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel, const gchar *text);
198 gtk_font_selection_set_preview_text(gtkFontSelection
, Str
.toStringz(text
));