Unicode Mac Support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unicode Mac Support

Oleg Richards
Hello Guys!

Currently i am making my project in Visual Works (in Parallels),  
because i easily can input russian unicode characters. But i have  
future plans to publish  my application with gemstone/s. So i'm  
trying in my free time to translate code to squeak (i don'tuse VW  
specifics). But i come to problem:

How to enable unicode support in squeak?
1. I need to input russian characters from keyboard into squeak
2. I need working unicode clipboard.
3. I'm working with Mac.

Can anybody give me instructions on how this could be done?

Cheers, Oleg
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Unicode Mac Support

johnmci
The mac carbon vm supports unicode input for keyboard entry. The  
issue then is what does smalltalk code do with it.

I'll note in Sophie we support unicode input via the Mac carbon VM.  
We are working somewhat on the Windows VM, but we not sure that it  
fully supports unicode input.
For the unix VM someone is also working on unicode input, but we've  
not heard much about that for a few weeks now.

Technically unicode characters are passed up to the EventSensor class  
as eventType EventTypeKeyboard  and for the EventKeyChar subtype  
event there is a field that contains the utf32 value.

As for the unicode clipboard support you need to look at Sophie and  
see how we interface to the Extended Clipboard support to move  
UTF8/16/32 data from the macintosh pasteboards in
and out of Squeak using the optional extended clipboard support  
plugin.  For windows this interface uses FFI versus a plugin.

http://www.sophieproject.org
 >Sophie is open-source software licensed under a version of the new  
BSD license.


For background:

SophieApplication>>initOnStartingApplication
we set Preferences enableGently: #unicodeInput
to enable unicode input from the macintosh VM

that uses the
MacUnicodeInputInterpreter to interpreter the raw VM event record to  
turn it into a Tweak keystroke event.

which uses  the utf32Code  field in the VM event record.

/* keyboard input event */
typedef struct sqKeyboardEvent
{
   int type; /* EventTypeKeyboard */
   unsigned int timeStamp; /* time stamp */
   int charCode; /* character code in Mac Roman encoding */
   int pressCode; /* press code; any of EventKeyXXX */
   int modifiers; /* combination of xxxKeyBit */
   int utf32Code; /* UTF-32 unicode value */
   int reserved1; /* reserved for future use */
   int windowIndex; /* host window structure */
} sqKeyboardEvent;

key down
charCode:   a magic number mapping to a key on the keyboard,  
different between mac/windows
utf32Code: 0
pressCode: EventKeyDown

key char
charCode the macroman value of the key pressed
utf32Code: the utf-32 value of the key pressed
pressCode EventKeyChar

key up
charCode:   a magic number mapping to a key on the keyboard,  
different between mac/windows
utf32Code: 0
pressCode : EventKeyUp


On Oct 21, 2007, at 2:42 AM, Oleg Richards wrote:

> Hello Guys!
>
> Currently i am making my project in Visual Works (in Parallels),  
> because i easily can input russian unicode characters. But i have  
> future plans to publish  my application with gemstone/s. So i'm  
> trying in my free time to translate code to squeak (i don'tuse VW  
> specifics). But i come to problem:
>
> How to enable unicode support in squeak?
> 1. I need to input russian characters from keyboard into squeak
> 2. I need working unicode clipboard.
> 3. I'm working with Mac.
>
> Can anybody give me instructions on how this could be done?
>
> Cheers, Oleg_______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




--
========================================================================
===
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Unicode Mac Support

Bert Freudenberg

On Oct 21, 2007, at 16:06 , John M McIntosh wrote:

> The mac carbon vm supports unicode input for keyboard entry. The  
> issue then is what does smalltalk code do with it.
>
> I'll note in Sophie we support unicode input via the Mac carbon VM.  
> We are working somewhat on the Windows VM, but we not sure that it  
> fully supports unicode input.
> For the unix VM someone is also working on unicode input, but we've  
> not heard much about that for a few weeks now.

Yoshiki did this last week, it is in the Unix subversion trunk.

IIRC the problem on the Mac is not in the VM, but that the truetype  
fonts in the image do only cover the latin1 range whereas cyrillic  
and other characters are discarded on input. There is a hack to fix  
this:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-June/ 
105184.html

Not sure if later images have a similar fix. The Freetype support  
would solve the problem too.

- Bert -


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Unicode Mac Support

Philippe Marschall
In reply to this post by Oleg Richards
2007/10/21, Oleg Richards <[hidden email]>:
> Hello Guys!
>
> Currently i am making my project in Visual Works (in Parallels),

Hehe, not uncommon

> because i easily can input russian unicode characters. But i have
> future plans to publish  my application with gemstone/s. So i'm
> trying in my free time to translate code to squeak (i don'tuse VW
> specifics). But i come to problem:
>
> How to enable unicode support in squeak?
> 1. I need to input russian characters from keyboard into squeak
> 2. I need working unicode clipboard.
> 3. I'm working with Mac.

Am I correct to assume that you want to use russian literal strings?
If so there are some more things that you might want to check as well:
- filing in from VW to Squeak works
- filing in from Sueak to Gemstone works

You might also want to check the state of encoded server adapters on
VW and Gemstone and make sure they deal correctly with non-ascii
literal strings.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Unicode Mac Support

Oleg Richards
In reply to this post by Oleg Richards
Thank you friends!

But please say to me what code should i execute in my squeak  
workspace to enable unicode input?

Cheers, Oleg
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside