diff --git a/xource.c b/xource.c index eeca30f..18fad23 100644 --- a/xource.c +++ b/xource.c @@ -1,10 +1,10 @@ /* - * 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. - * 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. - */ +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. +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. +*/ #include #include @@ -31,16 +31,10 @@ static void render_status_bar (int colour) { } static void render_source_code (void) { - int offset; + int offset, select, length; - int select = 0; - int length = 0; - - cursor_x = 5; - cursor_y = 1; - - curses_realign_x = 5; - curses_realign_y = 0; + cursor_x = curses_realign_x = 5; + cursor_y = curses_realign_y = 1; for (offset = 0; file_list_data [file_list_active] [offset] != '\0'; offset += length) { if (cursor_y > curses_screen_height - 2) { @@ -137,13 +131,19 @@ int main (int argc, char * * argv) { curses_configure (); + curses_bind (SIGNAL_Q, curses_exit); + curses_bind (SIGNAL_W | SIGNAL_SHIFT, curses_exit); + do { curses_render_background (' ', COLOUR_WHITE, EFFECT_NORMAL); render_status_bar (COLOUR_WHITE); render_source_code (); - curses_render_cursor (5, 3); + cursor_x = 8; + cursor_y = 4; + + curses_render_cursor (cursor_x, cursor_y); curses_synchronize ();