All translations

Jump to navigation Jump to search

Enter a message name below to show all available translations.

Message

Found 2 translations.

NameCurrent message text
 h English (en)== Store the state for different input contexts ==
Fcitx allows different input context to held a different state. The state usually refers to the partially typed text and all other associated data structures. In Quwei case, the state is the digits that user already typed. To represent this, Fcitx provides a convenient class [https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1InputBuffer.html InputBuffer] to allow engine to use this class conveniently to edit the internal state. In order to automatically construct the state when an input context getting constructed, Fcitx provides a framework called InputContextProperty. In order to use this, you first need to register a factory class to [https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1InputContextManager.html InputContextManager], via registerProperty. Each property need to have a global unique name. The name can be something human-understandable. In Quwei case, I just use "quweiState". The benefit of using a nicer name is just in case you're developing something cross addon (Another addon need to access certain internal state of this addon), you can use this common name to load it in a different addon. If you do not need access from outside, the name does not really matter.
 h Chinese (China) (zh-cn)== 存储不同输入上下文的状态 ==
Fcitx 允许不同的输入上下文保持不同的状态。状态通常是指部分类型化的文本和所有其他关联的数据结构。在这个区位码的例子里面,状态是用户已经输入的数字。为了表示这一点,Fcitx 提供了一个方便的类 [https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1InputBuffer.html InputBuffer] 让输入法引擎可以便捷地使用这个类来编辑内部状态。为了在构造输入上下文时自动构造状态,Fcitx 提供了一个名为 InputContextProperty 的框架。为了使用它,您首先需要通过 registerProperty 向 [https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1InputContextManager.html InputContextManager] 注册一个工厂类。每个属性都需要有一个全局唯一的名称。  名称可以是人类可以理解的东西。在这个区位码的例子里面,我使用的是“quweiState”。使用更好的名称的好处是,以防万一您正在开发一些交叉插件(另一个插件需要访问该插件的某些内部状态),您可以使用这个通用名称将其加载到不同的插件中。如果您不需要从外部访问,那么名称并不重要。