[PATCH RFC] text: Add language and text-direction to protocol

Jan Arne Petersen jpetersen at openismus.com
Wed Feb 6 04:29:42 PST 2013


On 02.02.2013 12:06, Pekka Vuorela wrote:
> I think this generally looks good. Few notes below.
> 
> 
> On 31.01.2013 18:44, Jan Arne Petersen wrote:
> 
>> diff --git a/protocol/text.xml b/protocol/text.xml
>> index 28d12ed..640f4eb 100644
>> --- a/protocol/text.xml
>> +++ b/protocol/text.xml
>> @@ -150,6 +150,14 @@
>>           Requests input panels (virtual keyboard) to hide.
>>         </description>
>>       </request>
>> +    <request name="set_language">
>> +      <description summary="sets language">
>> +        Sets a specific language. This allows for example a virtual
>> keyboard to
>> +        show a language specific layout. The "language" argument is a
>> RFC-3066
>> +        format language tag.
>> +      </description>
>> +      <arg name="language" type="string"/>
>> +    </request>
> 
> Some specific use case in mind for requesting input language from editor
> side?

It should indicate a preferred language for text input. I think I should
change the name to set_preferred_language (in Qt it is also
Qt::ImPreferredLanguage). It could be used for example in a word
processor to indicate language of currently edited document or in an
instant message application which tracks languages of contacts.

>>       <event name="commit_string">
>>         <description summary="commit">
>>           Notify when text should be inserted into the editor widget.
>> The text
>> @@ -272,6 +280,26 @@
>>         </description>
>>         <arg name="state" type="uint"/>
>>       </event>
>> +    <event name="language">
>> +      <description summary="language">
>> +        Sets the language of the commited text. The "language"
>> argument is a RFC-3066
>> +        format language tag.
>> +      </description>
>> +      <arg name="serial" type="uint"/>
>> +      <arg name="language" type="string"/>
>> +    </event>
>> +    <enum name="text_direction">
>> +      <entry name="auto" value="0" summary="automatic text direction
>> based on text and language"/>
>> +      <entry name="ltr" value="1" summary="left-to-right"/>
>> +      <entry name="rtl" value="2" summary="right-to-left"/>
>> +    </enum>
>> +    <event name="text_direction">
>> +      <description summary="text direction">
>> +        Sets the text direction of commited text.
>> +      </description>
>> +      <arg name="serial" type="uint"/>
>> +      <arg name="direction" type="uint"/>
>> +    </event>
>>     </interface>
> 
> These seem to be easily misunderstood. Could adjust the comments a bit.
> 
> Maybe "commited text" -> "text input", this should apply as well for
> preedit and especially on situations when nothing is yet committed.
> 
> Could also mention that it's mainly needed for showing input cursor on
> correct side of the editor when there is no input yet done and making
> sure neutral direction text is laid out properly.

Yes, I will do.

Thanks
Jan Arne

-- 
Jan Arne Petersen
Openismus GmbH
http://www.openismus.com


More information about the wayland-devel mailing list