Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv16659/src/cbits/GTK
Added Files:
FontDialog.c
Log Message:
add implementation for FontDialog
--- NEW FILE: FontDialog.c ---
#include "FontDialog.h"
BOOL osRunFontDialog(char **fname, int *fsize, int *fweight, int *fstyle, BOOL *funderline, BOOL *fstrikeout)
{
GtkWidget *font_dialog;
font_dialog = gtk_font_selection_dialog_new("Font");
if (gtk_dialog_run(GTK_DIALOG(font_dialog)) == GTK_RESPONSE_OK)
{
gchar font_name;
PangoFontDescription *font_descr;
font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog));
font_descr = pango_font_description_from_string(font_name);
*fname = strdup(pango_font_description_get_family(font_descr));
*fsize = pango_font_description_get_size(font_descr)/PANGO_SCALE;
*fweight = pango_font_description_get_weight(desc);
switch (pango_font_description_get_style(desc))
{
case PANGO_STYLE_NORMAL: *fstyle = 0; break;
case PANGO_STYLE_OBLIQUE: *fstyle = 1; break;
case PANGO_STYLE_ITALIC: *fstyle = 2; break;
default: *fstyle = -1; break;
}
*funderline = FALSE;
*fstrikeout = FALSE;
pango_font_description_free(font_descr);
return TRUE;
}
gtk_widget_destroy (color_dialog);
return FALSE;
}
|