Concurrent Clean + 日本語

何語か分からないコメントがあるよー(↓)

// DvA: netter om hier delayed WindowInitialise voor te genereren?
// PA: nu is het conform andere initialisatie functies. Nog eens over nadenken.

さて、いろいろソースを追いかけていったのですが、はたと気づいて、WindowsAPIでは、コントロールのフォントを変更するにはどうすればよいのだろうと思って、調査したら、意外なことが分かりました。
http://ww1.enjoy.ne.jp/~turikiti/knowledge/program/backcolor.htm
← 経由)http://still-ai.net/cgi-bin/diary/?200502a&to=200502082#200502082

エディットコントロールのフォント変更
・SendMessage(hEditWnd,WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));

SendMessageを使うのか〜。ちょっと意外な感じ。
ということは、IdからHandleを取って、メッセージを送ってやれば、Windows環境なら動作するのかな?でも、マルチプラットフォームということだとどうなんだろう?

      • -

ObjectIO/OS Windows/Windows_C_12 の下に、Cのコードがあって、この中でWindowsAPIをコールしている部分があるのですが、この中の「cCrossCall_121.c」に、下のようなコードがありました。

/*	InitGlobals is used by WinStartOSThread only. */
static void InitGlobals (void)
{
	LOGFONT lf;
	
	//	Globally, we create a logical font that is used in all controls. 
	SetLogFontData (&lf, "MS Sans Serif", 0, 8);
	gControlFont = CreateFontIndirect (&lf);

	//	The cross call procedure table is set to the empty table.
	gCrossCallProcedureTable = EmptyCrossCallProcedureTable ();
}	/* InitGlobals */

ここ以外で、gControlFontに代入している箇所はなく、このフォントを使って、コントロールを生成しているようなので、おそらくこれが元凶です。
あとは、応急措置としては、このCのソースを変更して、日本語版を作ることで、恒久的措置としては、呼出方法を変更(または追加)することで、Cleanのソースからフォントを変更可能にすることです。
ところで、Cleanに対応したCのコンパイラって何だろう?

      • -

付属のマニュアルに「CallingCFromClean.html」があった。これを読めば、いけるかも。

      • -

以下のように書いてありました。VCはテスト済みだということです。他には、CodeWarriorgnu compilerが使えるようです。gccならあるぞ。borland c compilerは駄目か?

3.1 COMPILING THE C PROGRAM / SUPPORTED C COMPILERS
On unix systems a c program (in this case example_int1_c.c) is compiled with cc, for example:
cc -O -c example_int1_c.c
The C compiler generates an object file: example_int1_c.o.
On windows system a C compiler has to be used that generates ECOFF object files, for example Visual C++ and Metrowerks CodeWarrior. The Watcom C compiler can not be used. The gnu compiler might work. We have tested Visual C versions 4 and 5. The example_int1_c.obj object file can be generated by compiling the .c file using the developer studio, or by invoking the C compiler from the MSDOS prompt with:
cl /c /O2 /Gy example_int1_c.c
On the PowerMacintosh Metrowerks CodeWarrior or MrC can be used. Because CodeWarrior does not generate separate object files, a library has to be build instead. This library should contain only object files, no libraries.

      • -

成功しました。