Newtrodit-LCL
This is the channel for the ongoing development of Newtrodit-LCL, a compatibility layer for Newtrodit made by @earth's bird and @earth's god
63 Replies
@earth's god I'm going to make a new branch for LCL called NCurses. I'll be reworking everything to use NCurses, this (if done correctly) will fix many bugs and issues we've faced on the Linux side
:blobhappy:
Glad to hear this
Hope we can make it a decent editor
Me too!
Also with NCurses setting color at a specific position is possible
Nice
That will help a LOT in performance
I've been also thinking of adding 24-bit support if the terminal supports it
Pretty much every major bug we've come across can be fixed by using NCurses
That would be nice. NCurses wraps around terminfo we can detect if the terminal supports 24-bit color
Same for Windows, detecting if 24-bit color is available is simple
Added some really basic NCurses support
Had my machine crash way to much though
Sounds good
That doesn't sound good tho xd
NCurses gives many helpful things to the table though
Lol
I'm not even sure why it crashes my computer, trying to find the issue now
Can NCurses getch detect shift?
Yes I think so
Like, differentiate Ctrl-S from Ctrl-Shift-S
Yes
NCurses should be able to detect modifier keys separately
🙂
NCurses also have functions for detecting numpad buttons
like it can detect the difference between pressing 1 on a keyboard and 1 on the numpad
That is also very good
Ok stopped the crashing of my computer part. Now nothing gets displayed, which I also think I know the reason for.
The only thing I don't like is that we'll have to replace all printf statements to printw
I don't think we need to, do we? It seems printf works
What about fputs and fwrite
Not sure about them
What is that depricated message
Something I implemented for debuging
To find what parts of the project use old functions that get replaced by NCurses
Ah ok
Nvm I thought it was from curses
Sorry lol
No worries
I can see the confusion
Ah we do have to use printw
How would that translate to Windows? Maybe we write a custom print function that checks if you're on Windows or Linux?
yeah
Same arguments as printf, with an #ifdef inside
Yep that's what I was thinking
With a va_list
What should we call it?
nprint
, Newtrodit printSimply
print
Ah maybeis there no print function called
print
?Or
printn
yeah
print newtrodit makes sense
Because anything sent to that function gets sent to the actual Newtrodit display
Oh for the record I'm practically shredding the Windows version of newtrodit. I shouldn't need to change how the functions work, but rather their names to be compatible with NCurses naming scheme
like
gotoxy(x, y)
to move(y, x)
Uh
Better keep names as they are
And make wrappers for the names
Because if a lot of names are changed it will be a lot harder to remember which function does which thing
Ok fixed, sorry bout that.
It might be easier for you too
@earth's god How do you suppose that I pass the
...
to the functions With va_list
Let me check something
That's how I'm declaring PrintBottomString
So it would be something like
Or even differently, what about implementing
printn
as a macro?
@earth's bird
Maybe it's a bit hacky but it worksActually I'll just define printn in the core files so I don't actually need to check if _WIN32 is defined
Using macros code would be substantially reduced
Yes I am going to use marcos
marcos
I'm trying to type fast
btw feel free to push any changes to the repo when done
I'm going to push it all to a separate branch for now (once basic support and simple bugs have been patched)
Alright
Yeah later we can compare and merge
see ya I'm going dinner
Cya
i'll come back in ~45 mins
Lets hope I don't blow up my computer while your gone
I'm back
You can do the same with
gotoxy()
and move
y and x ?
move(y, x)
?
messages aren't sending
nvmYes
just read the docs
move takes in y first
ncurses being weird part 1
lol
To reduce repeated code, I'm considering to create a new file calledI'm probably going to go through with this idea. I'll most likely call the filenewtrodit_shared.c
ornewtrodit_func_shared.c
which will have functions that exactly the same on linux and win32
newtrodit_func_shared
Go ahead
Less like of code is a better codebase because it's more maintainable
@earth's bird just to know, are you doing changes to
newtrodit.c
?Some but not many
Like I have to initiate NCurses in the main function but that’s about all
@earth's god
Alright just making sure as I modified the main file quite a bit lately
Can't work much on LCL until the weekend rolls 'round
Same
I'm quite busy these days bc exams and homework
I tried fixing a bug yesterday related to horizontal scrolling but no luck
I don't get the algorithm right
Already tried thinking the algorithm with paper and pencil and still didn't work as expected