Reworked signal system...

This commit is contained in:
Ognjen Milan Robovic 2023-10-29 11:21:16 -04:00
parent 2a1a6e4644
commit 30c7b6987c

View File

@ -1,9 +1,9 @@
/* /*
* Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic
*
* Xource is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation. Xource is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation.
* And when you do redistribute it or modify it, it will use either version 3 of the License, or (at yours truly opinion) any later version. And when you do redistribute it or modify it, it will use either version 3 of the License, or (at yours truly opinion) any later version.
* It is distributed in the hope that it will be useful or harmful, it really depends... But no warranty what so ever, seriously. See GNU/GPLv3. It is distributed in the hope that it will be useful or harmful, it really depends... But no warranty what so ever, seriously. See GNU/GPLv3.
*/ */
#include <xolatile/xtandard.c> #include <xolatile/xtandard.c>
@ -31,16 +31,10 @@ static void render_status_bar (int colour) {
} }
static void render_source_code (void) { static void render_source_code (void) {
int offset; int offset, select, length;
int select = 0; cursor_x = curses_realign_x = 5;
int length = 0; cursor_y = curses_realign_y = 1;
cursor_x = 5;
cursor_y = 1;
curses_realign_x = 5;
curses_realign_y = 0;
for (offset = 0; file_list_data [file_list_active] [offset] != '\0'; offset += length) { for (offset = 0; file_list_data [file_list_active] [offset] != '\0'; offset += length) {
if (cursor_y > curses_screen_height - 2) { if (cursor_y > curses_screen_height - 2) {
@ -137,13 +131,19 @@ int main (int argc, char * * argv) {
curses_configure (); curses_configure ();
curses_bind (SIGNAL_Q, curses_exit);
curses_bind (SIGNAL_W | SIGNAL_SHIFT, curses_exit);
do { do {
curses_render_background (' ', COLOUR_WHITE, EFFECT_NORMAL); curses_render_background (' ', COLOUR_WHITE, EFFECT_NORMAL);
render_status_bar (COLOUR_WHITE); render_status_bar (COLOUR_WHITE);
render_source_code (); render_source_code ();
curses_render_cursor (5, 3); cursor_x = 8;
cursor_y = 4;
curses_render_cursor (cursor_x, cursor_y);
curses_synchronize (); curses_synchronize ();