/// <summary> /// Produce IBus keyboard identifier which is simular to the actual ibus switcher menu. /// </summary> internal string FormatKeyboardIdentifier(IBusEngineDesc engineDesc) { string id = engineDesc.Language; string languageName = string.IsNullOrEmpty(id) ? ResourceHelper.GetResourceString("kstidOtherLanguage") : Icu.GetDisplayName(id); return(String.Format("{0} - {1}", languageName, engineDesc.Name)); }
public IbusKeyboardDescription(IKeyboardSwitchingAdaptor engine, IBusEngineDesc ibusKeyboard, uint systemIndex): base(FormatKeyboardIdentifier(ibusKeyboard), ibusKeyboard.LongName, ibusKeyboard.Language, null, engine, KeyboardType.OtherIm) { IBusKeyboardEngine = ibusKeyboard; SystemIndex = systemIndex; }
/// <summary> /// Produce IBus keyboard identifier which is similar to the actual ibus switcher menu. /// </summary> private static string FormatKeyboardIdentifier(IBusEngineDesc engineDesc) { string id = engineDesc.Language; string languageName = string.IsNullOrEmpty(id) ? OtherLanguage : new Locale(id).GetDisplayName(new Locale(Application.CurrentCulture.TwoLetterISOLanguageName)); if (id != null && id.ToLowerInvariant() == languageName.ToLowerInvariant()) languageName = OtherLanguage; return String.Format("{0} - {1}", languageName, engineDesc.Name); }
/// <summary> /// Produce IBus keyboard identifier which is similar to the actual ibus switcher menu. /// </summary> private static string FormatKeyboardIdentifier(IBusEngineDesc engineDesc) { string id = engineDesc.Language; string languageName = string.IsNullOrEmpty(id) ? OtherLanguage : new Locale(id).GetDisplayName(new Locale(Application.CurrentCulture.TwoLetterISOLanguageName)); if (id != null && id.ToLowerInvariant() == languageName.ToLowerInvariant()) { languageName = OtherLanguage; } return(String.Format("{0} - {1}", languageName, engineDesc.Name)); }
/// <summary>Get Ibus keyboard at given index</summary> public string GetKeyboardName(int index) { if (Connection == null) { return(String.Empty); } var ibusWrapper = new IBusDotNet.InputBusWrapper(Connection); object[] engines = ibusWrapper.InputBus.ListActiveEngines(); IBusEngineDesc engineDesc = IBusEngineDesc.GetEngineDesc(engines[index]); return(FormatKeyboardIdentifier(engineDesc)); }
public void CanGetEngineDesc() { Connection = IBusConnectionFactory.Create(); if (Connection == null) { Assert.Ignore("Can't run this test without ibus running."); return; } var ibusWrapper = new IBusDotNet.InputBusWrapper(Connection); object[] engines = ibusWrapper.InputBus.ListActiveEngines(); if (engines.Length == 0) { Assert.Ignore("Can't run this test without any ibus keyboards installed."); return; } Assert.IsNotNull(IBusEngineDesc.GetEngineDesc(engines[0])); }
public IbusKeyboardDescription(IKeyboardAdaptor engine, IBusEngineDesc ibusKeyboard) : base(FormatKeyboardIdentifier(ibusKeyboard), ibusKeyboard.LongName, ibusKeyboard.Language, null, engine, KeyboardType.OtherIm) { IBusKeyboardEngine = ibusKeyboard; }
public IbusKeyboardDescription(string id, IBusEngineDesc ibusKeyboard, IKeyboardSwitchingAdaptor engine) : base(id, FormatKeyboardIdentifier(ibusKeyboard.Name, ibusKeyboard.Language), ibusKeyboard.LongName, ibusKeyboard.Language, true, engine) { IBusKeyboardEngine = ibusKeyboard; }
internal IbusKeyboardDescription(IbusKeyboardDescription other) : base(other) { IBusKeyboardEngine = other.IBusKeyboardEngine; }
public IbusXkbKeyboardDescription(string id, IBusEngineDesc ibusKeyboard, IKeyboardSwitchingAdaptor engine) : base(id, ibusKeyboard, engine) { }