#include <m17n-gui.h>
#include <m17n-misc.h>
-#define FONT_PT_SIZE 60
+#define FONT_PT_SIZE 40
gint
delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
MSymbol utf8;
char *family_names = NULL;
+ gtk_init (&argc, &argv);
+
if (argc < 2)
{
fprintf (stderr, "Usage: gdkdraw LANGUAGE\n");
PangoAttrList *attr_list;
PangoAttribute *attr_size;
- gtk_init (&argc, &argv);
-
attr_list = pango_attr_list_new ();
attr_size = pango_attr_size_new (FONT_PT_SIZE * PANGO_SCALE);
attr_size->start_index = 0, attr_size->end_index = title_len;
box = gtk_vbox_new (FALSE, 0);
text = gtk_image_new_from_pixbuf (pixbuf);
label = gtk_label_new ((gchar *) title);
- gtk_label_set_attributes (GTK_LABEL (label), attr_list);
gtk_box_pack_start (GTK_BOX (box), text, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 0);
GTK_SIGNAL_FUNC (destroy), NULL);
gtk_widget_show (text);
gtk_widget_show (label);
+ gtk_label_set_attributes (GTK_LABEL (label), attr_list);
gtk_widget_show (box);
gtk_widget_show (window);
gtk_main ();
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
#include <m17n.h>
#include <m17n-misc.h>
}
MPlist *
+eval_get_description (MPlist *arg)
+{
+ MSymbol lang, name;
+ MText *mt;
+ MPlist *plist;
+
+ if (! SYMBOLP (arg))
+ ERROR (error_invalid_arg);
+ lang = mplist_value (arg);
+ arg = mplist_next (arg);
+ if (! SYMBOLP (arg))
+ ERROR (error_invalid_arg);
+ name = mplist_value (arg);
+ mt = minput_get_description (lang, name);
+ if (! mt)
+ ERROR (error_command_fail);
+ plist = mplist ();
+ mplist_add (plist, Mtext, mt);
+ m17n_object_unref (mt);
+ return plist;
+}
+
+
+MPlist *
parse_arg_common (MPlist *arg, MSymbol *lang, MSymbol *name, MSymbol *target)
{
if (TAILP (arg))
{eval_set, "set SYMBOL FORM"},
{eval_open, "open LANG NAME"},
{eval_close, "close SYMBOL"},
+ {eval_get_description, "get-description LANG NAME"},
{eval_get_command, "get-command [LANG NAME [COMMAND]]"},
{eval_config_command, "config-command LANG NAME [COMMAND [(KEY ...) ...]]"},
{eval_get_variable, "get-variable [LANG NAME [VARIABLE]]"},
void
init (void)
{
+ int n;
+
M17N_INIT ();
Merror = msymbol ("error");
Mvalue = msymbol ("value");
Meval_function = msymbol ("eval-function");
- msymbol_put (msymbol ("help"), Meval_function, eval_functions + 0);
- msymbol_put (msymbol ("set"), Meval_function, eval_functions + 1);
- msymbol_put (msymbol ("open"), Meval_function, eval_functions + 2);
- msymbol_put (msymbol ("close"), Meval_function, eval_functions + 3);
- msymbol_put (msymbol ("get-command"), Meval_function, eval_functions + 4);
- msymbol_put (msymbol ("config-command"), Meval_function, eval_functions + 5);
- msymbol_put (msymbol ("get-variable"), Meval_function, eval_functions + 6);
- msymbol_put (msymbol ("config-variable"), Meval_function, eval_functions + 7);
- msymbol_put (msymbol ("save-config"), Meval_function, eval_functions + 8);
+ n = 0;
+ msymbol_put (msymbol ("help"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("set"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("open"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("close"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("get-description"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("get-command"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("config-command"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("get-variable"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("config-variable"), Meval_function, eval_functions + n), n++;
+ msymbol_put (msymbol ("save-config"), Meval_function, eval_functions + n);
error_invalid_format = mplist ();
mplist_add (error_invalid_format, Msymbol, Merror);
{
char line[256];
+ setlocale (LC_ALL, "");
+
init ();
while (printf ("> ") && fgets (line, 256, stdin) != NULL)