* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <config.h>
+#include "config.h"
#include "gtkfontbutton.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#include "gtkintl.h"
-#include "gtkalias.h"
#include <string.h>
#include <stdio.h>
-#define GTK_FONT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_FONT_BUTTON, GtkFontButtonPrivate))
struct _GtkFontButtonPrivate
{
static void
gtk_font_button_init (GtkFontButton *font_button)
{
- font_button->priv = GTK_FONT_BUTTON_GET_PRIVATE (font_button);
+ font_button->priv = G_TYPE_INSTANCE_GET_PRIVATE (font_button,
+ GTK_TYPE_FONT_BUTTON,
+ GtkFontButtonPrivate);
/* Initialize fields */
font_button->priv->fontname = g_strdup (_("Sans 12"));
* gtk_font_button_get_font_name:
* @font_button: a #GtkFontButton
*
- * Retrieves the name of the currently selected font.
+ * Retrieves the name of the currently selected font. This name includes
+ * style and size information as well. If you want to render something
+ * with the font, use this string with pango_font_description_from_string() .
+ * If you're interested in peeking certain values (family name,
+ * style, size, weight) just query these properties from the
+ * #PangoFontDescription object.
*
* Returns: an internal copy of the font name which must not be freed.
*
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
- if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent))
+ if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
{
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (font_dialog)))
gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
gtk_window_get_modal (GTK_WINDOW (parent)));
}
- g_signal_connect (font_dialog->ok_button, "clicked",
+ g_signal_connect (gtk_font_selection_dialog_get_ok_button (font_dialog), "clicked",
G_CALLBACK (dialog_ok_clicked), font_button);
- g_signal_connect (font_dialog->cancel_button, "clicked",
+ g_signal_connect (gtk_font_selection_dialog_get_cancel_button (font_dialog), "clicked",
G_CALLBACK (dialog_cancel_clicked), font_button);
g_signal_connect (font_dialog, "destroy",
G_CALLBACK (dialog_destroy), font_button);
}
- if (!GTK_WIDGET_VISIBLE (font_button->priv->font_dialog))
+ if (!gtk_widget_get_visible (font_button->priv->font_dialog))
{
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
gtk_widget_push_composite_child ();
- widget = gtk_hbox_new (FALSE, 0);
+ widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
font_button->priv->font_label = gtk_label_new (_("Font"));
if (font_button->priv->show_size)
{
- gtk_box_pack_start (GTK_BOX (widget), gtk_vseparator_new (), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (widget), gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
font_button->priv->size_label = gtk_label_new ("14");
gtk_box_pack_start (GTK_BOX (widget), font_button->priv->size_label, FALSE, FALSE, 5);
}
pango_font_description_free (desc);
}
-
-#define __GTK_FONT_BUTTON_C__
-#include "gtkaliasdef.c"