Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cskk: 新しいpreeditのインタフェースとして、漢字変換部分、送り仮名部分、アノテーションを分けて取得できるものを作る #211

Closed
naokiri opened this issue Oct 21, 2022 · 1 comment · Fixed by #213

Comments

@naokiri
Copy link
Owner

naokiri commented Oct 21, 2022

fcitxでTextFormatを使うことでアノテーション等をうまく表示できるのでそれぞれ分離して渡すことで良いフォーマットを作れる。

libskkから継承してマーカーの類もcskkで扱っているが、これらは漢字変換ライブラリとしては本筋の機能ではないのでIMEの装飾で扱うように変えていくための準備としても。

@naokiri
Copy link
Owner Author

naokiri commented Oct 22, 2022

  • 例: ▼候補;アノテーション
    モードを渡し、それに応じてfcitx側でマーカーを付ける
    候補を下線等のフォーマットで書く
    ;アノテーションをNocommitで書く

Registerモードがあるのでスタック全体を返さざるをえない。

Compositionモードに応じて表示に使いたい要素や要素数が違う。
PrecompositionOkuriganaの "▽おく*r"のように、 かな変換部分とかな変換前の文字列表記が必要になる場合
CompositionSelectionのように候補とおくりがなとアノテーションが必要になる場合
Registerのように変換前のCompositeKeyが漢字部分とおくり仮名部分で欲しい場合
Rustとしてはenumで各々別のstructを保持、Cインタフェースでは共用体のようなものが望ましいか。

要素入りenumのrepr(C)は定義されており、このRFC内の例とは異なるがcbindgenも対応しているので文字列の変換だけでできそう。 repr(C,Int)はcbindgenが未対応の様子。
https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md

@naokiri naokiri linked a pull request Oct 26, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant