f



Dolphin Smalltalk Unicode UI - Proof of Concept

Every few years I seem to encounter a reason to want Unicode UI support in =
a Dolphin Smalltalk application.  I=E2=80=99ve decided to try to make it ha=
ppen now.

I have prepared a Proof of Concept package that adds Unicode support to She=
llView, TextEdit and StaticText subclasses.  It took a bit of digging to di=
scover which API calls were most critical to success.  Now that I understan=
d this it seems relatively straightforward.

More information, a screen capture and a package can be found here:
Dolphin Smalltalk Unicode UI Proof of Concept
http://cjd77.com/smalltalk/osds/unicode-ui/

Here are some key concepts:
1. Windows UI class registration determines if a window uses ANSI or Unicod=
e text.
2. Control subclassing determines if a control uses ANSI or Unicode text.
3. Relevant Windows API calls with functions that end in an =E2=80=9CA=E2=
=80=9D need to be transformed to use functions that end in a =E2=80=9CW=E2=
=80=9D for Unicode support.
4. Structures used by Unicode API calls need to use Unicode strings.
5. Unicode API calls obviously need to use Unicode strings.
6. Some functions actually trigger messages that do the work, so that needs=
 to handle Unicode.

Observations:
1. There are 201 external function calls that use functions ending with =E2=
=80=9CA=E2=80=9D.
2. There are possibly 23 external structures used by those function calls.
3. API function calls happen directly from methods in view classes.
4. I=E2=80=99ve only just scratched the surface of this, and I don=E2=80=99=
t yet know where the hardest challenges will be.

Approach:
1. I think that most of the external function calls can be programmatically=
 transformed using a few rules.
2. The structures could probably also be programmatically transformed, even=
 if they required a little more manual review.
3. Changing the UI
  a. I don=E2=80=99t like the idea of subclassing all views to ad Unicode s=
upport (as I have done in my PoC). =20
  b. There may be a need for some window/dialogs to be Unicode and some to =
remain ANSI. The code may need to support both.
    i. IsWindowUnicode could be used to provide dual functionality if there=
 isn=E2=80=99t too much of a performance penalty.
  c. My priority would be to focus on allowing developer created applicatio=
ns to support Unicode rather than adding full Unicode support to the entire=
 Dolphin IDE and virtual machine.  That may be a longer term goal.
4. The US Unicode package by Udo Schneider expands upon the limited Unicode=
String implementation in Dolphin.  This will be helpful for applications th=
at actually want to use and process UnicodeStrings.

Does anyone have any thoughts on this?  Is there community interest in maki=
ng this happen in Open Source Dolphin?  Anyone else willing to help?

I think Dolphin Next Generation (a commercial Dolphin fork by Lesser Softwa=
re) may have had Unicode UI support added.  Does anyone know more about thi=
s?  I can=E2=80=99t seem to find any recent information on DNG.  If there i=
s an interest in maintaining compatibility between OSDS and DNG we may be a=
ble to do this in a way conducive to that.

Chris Demers
0
cdemers
10/19/2016 3:03:28 AM
comp.lang.smalltalk.dolphin 3769 articles. 0 followers. Post Follow

4 Replies
262 Views

Similar Articles

[PageSpeed] 56

I have continued to explore and experiment with adding Unicode UI support to Dolphin Smalltalk.

I am releasing an experimental package that applies some code transforms and other system changes to add Unicode support for existing views.

A description of my approach as well as the package can be found here:
http://cjd77.com/smalltalk/osds/unicode-ui/exp1/

Hopefully someone will find this interesting.  I would love to see robust Unicode UI support added to Open Source Dolphin Smalltalk.  For now, this is just an experimental start in that direction.
0
cdemers
10/22/2016 1:35:12 AM
On Friday, October 21, 2016 at 6:35:13 PM UTC-7, cde...@mitchellscientific.=
com wrote:
> I have continued to explore and experiment with adding Unicode UI support=
 to Dolphin Smalltalk.
>=20
> I am releasing an experimental package that applies some code transforms =
and other system changes to add Unicode support for existing views.
>=20
> A description of my approach as well as the package can be found here:
> http://cjd77.com/smalltalk/osds/unicode-ui/exp1/
>=20
> Hopefully someone will find this interesting.  I would love to see robust=
 Unicode UI support added to Open Source Dolphin Smalltalk.  For now, this =
is just an experimental start in that direction.

This is very cool; thanks for posting what you've done! This is very neat.=
=20
Can I ask, when you observe this:
"There are 201 external function calls that use functions ending with =E2=
=80=9CA=E2=80=9D."

Did you grep for that, or did you use something like SciTools Understand? I=
'm curious because Dolphin is really beautiful but it is tied to Windows, a=
nd it would be interesting to see how many Win32 specific calls existed and=
 if they could be abstracted so as to make Dolphin cross-platform.=20

Thanks!
-Travis
0
Travis
10/28/2016 5:39:29 AM
On Friday, October 28, 2016 at 1:39:30 AM UTC-4, Travis Ayres wrote:
....
> Can I ask, when you observe this:
> "There are 201 external function calls that use functions ending with =E2=
=80=9CA=E2=80=9D."
>=20
> Did you grep for that, or did you use something like SciTools Understand?=
 I'm curious because Dolphin is really beautiful but it is tied to Windows,=
 and it would be interesting to see how many Win32 specific calls existed a=
nd if they could be abstracted so as to make Dolphin cross-platform.=20


I just used Smaltalk code to interrogate the external libraries in the imag=
e. Here is the code I used:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ansiAPIFunctionMethods :=3D OrderedCollection new.
	ExternalLibrary allSubclasses do: [:eachClass |=20
		ansiAPIFunctionMethods addAll: (eachClass methodDictionary select: [:each=
Method |
		eachMethod isExternalCall and: [eachMethod functionName last =3D $A]])].
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

I presume that the UI and the VM would be the major impediments to Dolphin =
running natively on other operating systems. Squeak Smalltalk may worth exp=
loring. =20

I did not care for the entirely emulated UI that Squeak used.  There seem t=
o have been a number of starts on projects aimed to support standard multi-=
OS capable UI frameworks for Squeak.  Every time I explored that nothing se=
emed finished and well supported. =20

Dolphin views can be migrated to other UI frameworks so long as there is a =
reasonably way to map it.  I actually had a good start on a Dolphin UI to W=
inForm and WPF migration tool for use with C#.  It isn't complete, but I ha=
d very good looking preliminary results.

Chris Demers
0
cdemers
10/28/2016 8:14:40 PM
I have released another Dolphin Smalltalk Unicode UI experiment.

This experiment builds upon the first.  It adds:

    Using the lastWindow of the InputState for Unicode Menu support.
    Unicode or ANSI function call determination based on String argument.
    Support for Unicode ListView column names and contents.
    Improved generalization of making views loaded from resources support U=
nicode.
    Example Shell has been enhanced to show more kinds of controls.

Learn more, see a screen capture, and download the free open source package=
 here:
http://mitchellscientific.com/smalltalk/osds/unicode-ui/

I would really appreciate getting some feedback on this.  My eventual goal =
is for optional Unicode UI support to become a part of the main Open Source=
 Dolphin image.  For that to happen we will need a robust implementation th=
at has enjoyed the benefit of community feedback.

Chris Demers
0
cdemers
11/11/2016 9:33:30 PM
Reply: