OberonCore
https://forum.oberoncore.ru/

Linux and Windows version in Dialog
https://forum.oberoncore.ru/viewtopic.php?f=130&t=4480
Страница 1 из 1

Автор:  Zinn [ Четверг, 05 Сентябрь, 2013 21:35 ]
Заголовок сообщения:  Linux and Windows version in Dialog

In Module Dialog there are the definition about OS version. Some of them are obsolete and some are missing. Another problem is that are not enough number free between 10 and 19 to define Windows 7 and Windows 8. Should we delete the obsolete numbers? Should we renumber the windows definition? Which number should we assign? Note: BlackBox 1.6 does not run on Windows 32s, Windows 95 & 98.

windows32s = 11; -- obsolete
windows95 = 12; -- obsolete
windowsNT3 = 13; -- obsolete
windowsNT4 = 14; -- obsolete
windows2000 = 15; -- obsolete
windows98 = 16; -- obsolete
windowsXP = 17;
windowsVista = 18;
windows7 = ???; -- missing
windows8 = ???; -- missing
macOS = 21;
macOSX = 22;
linux = 30;
tru64 = 40;
wine = ???; -- missing

Автор:  Евгений Темиргалеев [ Пятница, 06 Сентябрь, 2013 01:10 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Just an example of the possible solution.
Код:
MODULE i21sysInfo;
(* 2010-10-18 Е.Э.Темиргалеев -- выделено из i21sysCalls для корректной работы под wine+linux *)

  IMPORT Dialog, WinApi, HostDialog;

  CONST  (* из Dialog *)
    windows32s* = 11;
    windows95* = 12;
    windowsNT3* = 13;
    windowsNT4* = 14;
    windows2000* = 15;
    windows98* = 16;
    windowsXP* = 17;
    windowsVista* = 18;
    macOS* = 21;
    macOSX* = 22;
    linux* = 30;
    tru64* = 40;
 
  CONST
    wine* = 17.5;

  VAR
    platform*: REAL;  (* REAL, because there are not enough number free between 10 and 19 *)

  PROCEDURE Init;
    VAR  h: WinApi.HMODULE; adr: WinApi.FARPROC; res: WinApi.BOOL;
  BEGIN
    (* Dialog.platform is initalized by HostDialog *)
    platform := Dialog.platform; ASSERT(platform # 0, 100);
    (* http://habrahabr.ru/blogs/development/76131/ *)
    h := WinApi.LoadLibrary("ntdll.dll");
    IF h # WinApi.NULL THEN
      adr := WinApi.GetProcAddress(h, "wine_get_version");
      IF adr # NIL THEN platform := wine END;
      res := WinApi.FreeLibrary(h)
    END
  END Init;

BEGIN
  Init
END i21sysInfo.

Автор:  Zinn [ Понедельник, 04 Ноябрь, 2013 19:20 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

In the CPC Edition I changed the definition to:

CONST
windows98* = 11;
windowsNT3* = 12;
windowsNT4* = 13;
windows2000* = 14;
windowsXP* = 15;
windowsVista* = 16;
windows7* = 17;
windows8* = 18;
wine* = 19;
macOS* = 21;
macOSX* = 22;
linux* = 30;
tru64* = 40;

Автор:  Иван Денисов [ Вторник, 05 Ноябрь, 2013 15:26 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Zinn писал(а):
In the CPC Edition I changed the definition to:

CONST
windows98* = 11;
windowsNT3* = 12;
windowsNT4* = 13;
windows2000* = 14;
windowsXP* = 15;
windowsVista* = 16;
windows7* = 17;
windows8* = 18;
wine* = 19;
macOS* = 21;
macOSX* = 22;
linux* = 30;
tru64* = 40;


Bad idea because windows is determined in BlackBox by operation DIV 10 and 19 become Windows, however Wine is not windows!

For example StdLinks sources:
Код:
IF Dialog.platform DIV 10 = 1 THEN (* Windows *)

Автор:  Zinn [ Вторник, 05 Ноябрь, 2013 22:26 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Sorry, I'm not agree. Wine is a Windows emulator. So it should work like Windows.

Автор:  Иван Денисов [ Вторник, 05 Ноябрь, 2013 22:43 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Zinn писал(а):
Sorry, I'm not agree. Wine is a Windows emulator. So it should work like Windows.

There are no some fonts in Wine... however in much more cases you are right.

Автор:  Zinn [ Вторник, 05 Ноябрь, 2013 23:12 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

The statement is used in

(1)
DevRBrowser
IF (Dialog.platform DIV 10 = 1) OR (Dialog.platform = Dialog.linux) THEN (* some Windows variant or Linux *)

Here works Wine like Windows.

(2)
StdFolds & StdLinks
IF Dialog.platform DIV 10 = 1 THEN (* Windows *)
iconFont := "Wingdings";

If the font Wingdings does not exist then the program uses the DefaultAppearance.

Автор:  Роман М. [ Среда, 06 Ноябрь, 2013 21:33 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Иван Денисов писал(а):
Zinn писал(а):
In the CPC Edition I changed the definition to:

CONST
windows98* = 11;
windowsNT3* = 12;
windowsNT4* = 13;
windows2000* = 14;
windowsXP* = 15;
windowsVista* = 16;
windows7* = 17;
windows8* = 18;
wine* = 19;
macOS* = 21;
macOSX* = 22;
linux* = 30;
tru64* = 40;


Bad idea because windows is determined in BlackBox by operation DIV 10 and 19 become Windows, however Wine is not windows!

For example StdLinks sources:
Код:
IF Dialog.platform DIV 10 = 1 THEN (* Windows *)

IMO, GNU/Wine can be treated as a special version of Windows, i.e. minor version of Windows® in same manner as WindowsXP.
About several months ago ago I succeed to run BlackBox on ReactOS without any issues. This OS mimic Windows NT® architecture, so it can be safely treated as Windows OS in this list.

Автор:  Иван Денисов [ Пятница, 08 Ноябрь, 2013 16:15 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Ok, I agree. I think that it can be used any case, but in a little different manner.

Example for Wine StdFolds fix.
viewtopic.php?f=130&t=4612

Автор:  Zinn [ Суббота, 09 Ноябрь, 2013 16:10 ]
Заголовок сообщения:  Re: Linux and Windows version in Dialog

Have StdLink the same problem?
Are this problem also exist on the original BB 1.6?

Страница 1 из 1 Часовой пояс: UTC + 3 часа
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/