*** empty log message ***
[m17n/m17n-lib-cs.git] / input.cs
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.Xml;
5 using System.Xml.Expression;
6 using M17N;
7 using M17N.Core;
8 using M17N.Input;
9 using Xex = System.Xml.Expression.Xexpression;
10
11 public class Test
12 {
13   public static void Main()
14   {
15     //M17n.debug = true;
16     MDatabase.ApplicationDir = "/usr/local/share/m17n";
17     MText desc, title;
18     Xex.Variable[] vars;
19     MInputMethod.Command[] cmds;
20
21 #if false
22     MDatabase.Tag tag = new MDatabase.Tag ("input-method",
23                                            "t", "nil", "vi-base");
24     MDatabase mdb = MDatabase.Find (tag);
25     XmlNode node = mdb.Load ("map-alnum", "input-method", "map-list", "map");
26
27     Console.WriteLine (node.OuterXml);
28
29 #elif true
30     MInputMethod im = MInputMethod.Find ("vi", "telex");
31
32     im.Open ();
33     Console.WriteLine (im);
34 #else
35     MInputMethod[] ims = MInputMethod.List ();
36     foreach (MInputMethod im in ims)
37       {
38
39         Console.Write ("(<{0}, {1}, {2}>", im.Language, im.Name, im.SubName);
40         if (im.Info (out desc, out title, out vars, out cmds))
41           Console.Write (" {0}, {1}, {2}, {3}", desc, title, vars, cmds);
42         if (! im.Open ())
43           Console.Write (" open fail");
44         Console.WriteLine (")");
45       }
46 #endif
47   }
48 }