Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has a graphical mode ever been considered ? #167

Open
thradams opened this issue Nov 12, 2024 · 8 comments
Open

Has a graphical mode ever been considered ? #167

thradams opened this issue Nov 12, 2024 · 8 comments

Comments

@thradams
Copy link

thradams commented Nov 12, 2024

By graphical mode, I mean, for instance, on Windows a render that uses GDI.
(No changes in the concept)

The I way I think it could be done is cloning the console functions used by Turbo Vision implementing these functions using Windows GDI.

I personally would prefer to use Turbo Vision in that way, as normal app I think it could bring some advantages.

@ziotom78
Copy link

I am just a user and not the leading developer. Still, I want to share my two cents: This would make Turbo Vision no longer portable on Linux and Mac and barely usable over an SSH connection, making the project much less appealing to me.

If you are interested in graphical applications, have you tried Lazarus?

@okbob
Copy link

okbob commented Nov 12, 2024 via email

@thradams
Copy link
Author

thradams commented Nov 12, 2024

I don't think the execution of Turbo Vision in GUI makes any sense. It is
designed for DOS text interface - it expects regulat char width, so there
are a lot of issues to redesign it as a framework for GUI.

My suggestion was to keep the font size and keep it monospaced etc. 1-to-1 initially.
(A way to change the font size in runtime could be useful, but this is optional)

@okbob
Copy link

okbob commented Nov 12, 2024 via email

@magiblot
Copy link
Owner

Hi @thradams!

If I understand you correctly, you are talking about the same which SET's port of Turbo Vision does by default on Unix: to have a graphical window where the application gets rendered using a monospace font. Thus, the application is still text-based but it interacts directly with the native windowing system.

Although since I started this project my focus has always been on making Turbo Vision work as a regular terminal application, I took care not to make any assumptions in the source code that would prevent such an approach from being implemented as well. It is technically possible and it is not exclusive of the current behaviour.

However, I see some important disadvantages to it. Unless you put a lot of work into it, you miss the ability to customize the font, the font size and the color palette which is already provided by terminal emulators (including Windows' built-in console, which since Windows 10 has become far more usable than it used to be). Because of this, I never intended to implement such a thing myself.

@thradams
Copy link
Author

thradams commented Nov 12, 2024

Thanks for the reply.

Thus, the application is still text-based but it interacts directly with the native windowing system.

Exactly.

I took care not to make any assumptions in the source code that would prevent such an approach from being implemented as well

I was wondering how much work. I have the knowledge to implement this kind of stuff on windows but I don't know the details about what interface I need to implement. and also don't know how many hours I need.
But I wanted to know opinions about it.

I can see several advantages.
It opens the door for many other implementations. It could run in browser for instance.
It could have animations, shadows (everything keeping the concept of text based as I said before).
This kind of stuff can be optional if someone wants "retro effect".
Zero screen flickering. (at least on windows where I tested)
It also would remove the "Tab" I can see on windows, leaving just the app name (like normal app)

I like Turbo Vision, I think it should have a modern version of it but keeping the "retro" felling.
For instance, for a text editor we could have font squirrels in a modern version of it.

@magiblot
Copy link
Owner

Hi,

There is not a public API for this, so if you want to give it a try I suggest you start by adding your code to the library's internals. If the results are good, we'll later find a way to integrate it properly.

You have two options:

  1. Rewrite the Platform class from the ground up and implement just your use case.
  2. Keep the current Platform class and just add another implementation of the ConsoleAdapter class.
    • On Windows, the current implementation of Platform relies on WaitForMutipleObjects in order to wait for input events.
    • Currently, the Platform destroys the ConsoleAdapter when the application gets suspended (when going into the shell). This behavior is likely not fit for your use case, but you can ignore it for now.
    • You would have to change the Platform::createConsole function so that your ConsoleAdapter is used.

In either case, you will have to provide an implementation for Platform::charWidth, which returns 0 for combining characters, 1 for normal characters or 2 for double-width characters. See the Platform::initEncodingStuff function.

Do not hesitate to ask for help if you need it.

Cheers.

@thradams
Copy link
Author

Thanks for the details.
(I think this issue can be closed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@ziotom78 @okbob @thradams @magiblot and others