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 = GtkFontButton.html
27 * outFile = FontButton
28 * strct = GtkFontButton
51 module gtk
.FontButton
;
57 import tango
.io
.Stdout
; // use the tango loging?
61 private import gtkc
.gtktypes
;
63 private import gtkc
.gtk
;
66 private import glib
.Str
;
73 * The GtkFontButton is a button which displays the currently selected font an allows to open a font selection
74 * dialog to change the font. It is suitable widget for selecting a font in a preference dialog.
76 private import gtk
.Button
;
77 public class FontButton
: Button
80 /** the main Gtk struct */
81 protected GtkFontButton
* gtkFontButton
;
84 public GtkFontButton
* getFontButtonStruct()
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gtkFontButton
;
97 * Sets our main struct and passes it to the parent class
99 public this (GtkFontButton
* gtkFontButton
)
103 if ( gtkFontButton
is null )
108 Stdout("struct gtkFontButton is null on constructor").newline
;
112 printf("struct gtkFontButton is null on constructor");
119 assert(gtkFontButton
!is null, "struct gtkFontButton is null on constructor");
121 super(cast(GtkButton
*)gtkFontButton
);
122 this.gtkFontButton
= gtkFontButton
;
128 // imports for the signal processing
129 private import gobject
.Signals
;
130 private import gtkc
.gdktypes
;
131 int[char[]] connectedSignals
;
133 void delegate(FontButton
)[] onFontSetListeners
;
134 void addOnFontSet(void delegate(FontButton
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
136 if ( !("font-set" in connectedSignals
) )
141 cast(GCallback
)&callBackFontSet
,
145 connectedSignals
["font-set"] = 1;
147 onFontSetListeners
~= dlg
;
149 extern(C
) static void callBackFontSet(GtkFontButton
* widgetStruct
, FontButton fontButton
)
151 bool consumed
= false;
153 foreach ( void delegate(FontButton
) dlg
; fontButton
.onFontSetListeners
)
164 * Creates a new font picker widget.
166 * a new font picker widget.
171 // GtkWidget* gtk_font_button_new (void);
172 this(cast(GtkFontButton
*)gtk_font_button_new() );
176 * Creates a new font picker widget.
178 * Name of font to display in font selection dialog
180 * a new font picker widget.
183 public this (char[] fontname
)
185 // GtkWidget* gtk_font_button_new_with_font (const gchar *fontname);
186 this(cast(GtkFontButton
*)gtk_font_button_new_with_font(Str
.toStringz(fontname
)) );
190 * Sets or updates the currently-displayed font in font picker dialog.
194 * Name of font to display in font selection dialog
196 * Return value of gtk_font_selection_dialog_set_font_name() if the
197 * font selection dialog exists, otherwise FALSE.
200 public int setFontName(char[] fontname
)
202 // gboolean gtk_font_button_set_font_name (GtkFontButton *font_button, const gchar *fontname);
203 return gtk_font_button_set_font_name(gtkFontButton
, Str
.toStringz(fontname
));
207 * Retrieves the name of the currently selected font.
211 * an internal copy of the font name which must not be freed.
214 public char[] getFontName()
216 // const gchar* gtk_font_button_get_font_name (GtkFontButton *font_button);
217 return Str
.toString(gtk_font_button_get_font_name(gtkFontButton
) );
221 * If show_style is TRUE, the font style will be displayed along with name of the selected font.
225 * TRUE if font style should be displayed in label.
228 public void setShowStyle(int showStyle
)
230 // void gtk_font_button_set_show_style (GtkFontButton *font_button, gboolean show_style);
231 gtk_font_button_set_show_style(gtkFontButton
, showStyle
);
235 * Returns whether the name of the font style will be shown in the label.
239 * whether the font style will be shown in the label.
242 public int getShowStyle()
244 // gboolean gtk_font_button_get_show_style (GtkFontButton *font_button);
245 return gtk_font_button_get_show_style(gtkFontButton
);
249 * If show_size is TRUE, the font size will be displayed along with the name of the selected font.
253 * TRUE if font size should be displayed in dialog.
256 public void setShowSize(int showSize
)
258 // void gtk_font_button_set_show_size (GtkFontButton *font_button, gboolean show_size);
259 gtk_font_button_set_show_size(gtkFontButton
, showSize
);
263 * Returns whether the font size will be shown in the label.
267 * whether the font size will be shown in the label.
270 public int getShowSize()
272 // gboolean gtk_font_button_get_show_size (GtkFontButton *font_button);
273 return gtk_font_button_get_show_size(gtkFontButton
);
277 * If use_font is TRUE, the font name will be written using the selected font.
281 * If TRUE, font name will be written using font chosen.
284 public void setUseFont(int useFont
)
286 // void gtk_font_button_set_use_font (GtkFontButton *font_button, gboolean use_font);
287 gtk_font_button_set_use_font(gtkFontButton
, useFont
);
291 * Returns whether the selected font is used in the label.
295 * whether the selected font is used in the label.
298 public int getUseFont()
300 // gboolean gtk_font_button_get_use_font (GtkFontButton *font_button);
301 return gtk_font_button_get_use_font(gtkFontButton
);
305 * If use_size is TRUE, the font name will be written using the selected size.
309 * If TRUE, font name will be written using the selected size.
312 public void setUseSize(int useSize
)
314 // void gtk_font_button_set_use_size (GtkFontButton *font_button, gboolean use_size);
315 gtk_font_button_set_use_size(gtkFontButton
, useSize
);
319 * Returns whether the selected size is used in the label.
323 * whether the selected size is used in the label.
326 public int getUseSize()
328 // gboolean gtk_font_button_get_use_size (GtkFontButton *font_button);
329 return gtk_font_button_get_use_size(gtkFontButton
);
333 * Sets the title for the font selection dialog.
337 * a string containing the font selection dialog title
340 public void setTitle(char[] title
)
342 // void gtk_font_button_set_title (GtkFontButton *font_button, const gchar *title);
343 gtk_font_button_set_title(gtkFontButton
, Str
.toStringz(title
));
347 * Retrieves the title of the font selection dialog.
351 * an internal copy of the title string which must not be freed.
354 * The "font-name" property
355 * "font-name" gchararray : Read / Write
356 * The name of the currently selected font.
357 * Default value: "Sans 12"
360 public char[] getTitle()
362 // const gchar* gtk_font_button_get_title (GtkFontButton *font_button);
363 return Str
.toString(gtk_font_button_get_title(gtkFontButton
) );