diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..1c2fda5 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..be0f224 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9661ac7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/etc/man.c b/etc/man.c index 86410d0..d5d28e8 100644 --- a/etc/man.c +++ b/etc/man.c @@ -1,78 +1,78 @@ -#include -#include -#include - -#include "man.h" - -// Color Codes: -// Reset: \033[0m -// Red: \033[0;31m -// Green: \033[0;32m -// Yellow: \033[0;33m -// Blue: \033[0;34m -// Magenta: \033[0;35m -// Cyan: \033[0;36m -// BoldRed: \033[1;31m -// BoldGreen: \033[1;32m -// BoldYellow: \033[1;33m -// BoldBlue: \033[1;34m -// BoldMagenta: \033[1;35m -// BoldCyan: \033[1;36m - -//Main function to start man is at the bottom - -//MAN ENTRIES - -//LS -void manEntry_ls(){ - printf("\033[0;33m##################\033[0m\n"); - printf("\033[0;33m# Manual of \033[0;36m'ls' \033[0;33m#\033[0m\n"); - printf("\033[0;33m##################\033[0m\n\n"); - printf("\033[0;33mNAME\033[0m\n"); - printf("\t\033[0;36mls - list directory contents\033[0m\n\n"); - printf("\033[0;33mUSAGE\033[0m\n"); - printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n"); - printf("\033[0;33mDESCRIPTION\033[0m\n"); - printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n"); -} - -//CD -void manEntry_cd(){ - printf("\033[0;33m##################\033[0m\n"); - printf("\033[0;33m# Manual of \033[0;36m'cd' \033[0;33m#\033[0m\n"); - printf("\033[0;33m##################\033[0m\n"); - printf("\033[0;33mNAME\033[0m\n"); - printf("\t\033[0;36mcd - change directory\033[0m\n\n"); - printf("\033[0;33mUSAGE\033[0m\n"); - printf("\t\033[0;36mcd \033[0;35m[DIRECTORY]\033[0m\n\n"); - printf("\033[0;33mDESCRIPTION\033[0m\n"); - printf("\t\033[0;36mChanged the currently selected directory.\033[0m\n\n"); -} - -//MAN -void manEntry_man(){ - printf("\033[0;33m###################\033[0m\n"); - printf("\033[0;33m# Manual of \033[0;36m'man' \033[0;33m#\033[0m\n"); - printf("\033[0;33m###################\033[0m\n\n"); - printf("\033[0;33mNAME\033[0m\n"); - printf("\t\033[0;36mman - manual\033[0m\n\n"); - printf("\033[0;33mUSAGE\033[0m\n"); - printf("\t\033[0;36mman \033[0;35m[COMMAND]\033[0m\n\n"); - printf("\033[0;33mDESCRIPTION\033[0m\n"); - printf("\t\033[0;36mShows the manual of given command.\033[0m\n\n"); -} - - - -//MAIN FUNCTION -void showManEntry(char *arg[]){ - if(!strcmp(arg[1], "man")){ - manEntry_man(); - } else if(!strcmp(arg[1], "ls")){ - manEntry_ls(); - } else if(!strcmp(arg[1], "cd")){ - manEntry_cd(); - } else { - printf("Entry not found.\n"); - } +#include +#include +#include + +#include "man.h" + +// Color Codes: +// Reset: \033[0m +// Red: \033[0;31m +// Green: \033[0;32m +// Yellow: \033[0;33m +// Blue: \033[0;34m +// Magenta: \033[0;35m +// Cyan: \033[0;36m +// BoldRed: \033[1;31m +// BoldGreen: \033[1;32m +// BoldYellow: \033[1;33m +// BoldBlue: \033[1;34m +// BoldMagenta: \033[1;35m +// BoldCyan: \033[1;36m + +//Main function to start man is at the bottom + +//MAN ENTRIES + +//LS +void manEntry_ls(){ + printf("\033[0;33m##################\033[0m\n"); + printf("\033[0;33m# Manual of \033[0;36m'ls' \033[0;33m#\033[0m\n"); + printf("\033[0;33m##################\033[0m\n\n"); + printf("\033[0;33mNAME\033[0m\n"); + printf("\t\033[0;36mls - list directory contents\033[0m\n\n"); + printf("\033[0;33mUSAGE\033[0m\n"); + printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n"); + printf("\033[0;33mDESCRIPTION\033[0m\n"); + printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n"); +} + +//CD +void manEntry_cd(){ + printf("\033[0;33m##################\033[0m\n"); + printf("\033[0;33m# Manual of \033[0;36m'cd' \033[0;33m#\033[0m\n"); + printf("\033[0;33m##################\033[0m\n"); + printf("\033[0;33mNAME\033[0m\n"); + printf("\t\033[0;36mcd - change directory\033[0m\n\n"); + printf("\033[0;33mUSAGE\033[0m\n"); + printf("\t\033[0;36mcd \033[0;35m[DIRECTORY]\033[0m\n\n"); + printf("\033[0;33mDESCRIPTION\033[0m\n"); + printf("\t\033[0;36mChanged the currently selected directory.\033[0m\n\n"); +} + +//MAN +void manEntry_man(){ + printf("\033[0;33m###################\033[0m\n"); + printf("\033[0;33m# Manual of \033[0;36m'man' \033[0;33m#\033[0m\n"); + printf("\033[0;33m###################\033[0m\n\n"); + printf("\033[0;33mNAME\033[0m\n"); + printf("\t\033[0;36mman - manual\033[0m\n\n"); + printf("\033[0;33mUSAGE\033[0m\n"); + printf("\t\033[0;36mman \033[0;35m[COMMAND]\033[0m\n\n"); + printf("\033[0;33mDESCRIPTION\033[0m\n"); + printf("\t\033[0;36mShows the manual of given command.\033[0m\n\n"); +} + + + +//MAIN FUNCTION +void showManEntry(char *arg[]){ + if(!strcmp(arg[1], "man")){ + manEntry_man(); + } else if(!strcmp(arg[1], "ls")){ + manEntry_ls(); + } else if(!strcmp(arg[1], "cd")){ + manEntry_cd(); + } else { + printf("Entry not found.\n"); + } } \ No newline at end of file diff --git a/etc/your-reality.c b/etc/your-reality.c index e64d55f..127046f 100644 --- a/etc/your-reality.c +++ b/etc/your-reality.c @@ -1,38 +1,38 @@ -#include -#include - -#include "your-reality.h" - -//Lyrics from "Your Reality" by Dan Salvato - -//fs -> flush & sleep -void fs(int milliseconds){ - fflush(stdout); - usleep(milliseconds*1000); -} - -//p -> printf -void p(char* txt){ - printf(txt); -} - -void yourReality(){ - - printf("\e[?25l"); - p("Loading "); - for(int i = 0; i < 2; i++){ - //\033[XC => X columns right - //\033[XD => X columns left - printf("\033[3D "); printf("\033[3D"); - fs(500); printf("."); fs(500); printf("."); fs(500); printf("."); fs(500); - - } - printf("\n"); - printf("\033[0;33mEvery "); fs(350); printf("day, "); - fs(700); - p("I "); fs(450); p("imagine "); fs(350); p("a "); fs(350); p("future "); fs(350); p("where "); fs(750); - p("i "); fs(300); p("can "); fs(300); p("be "); fs(300); p("with "); fs(300); p("you."); - - p("\033[0m"); - printf("\e[?25h"); -} +#include +#include + +#include "your-reality.h" + +//Lyrics from "Your Reality" by Dan Salvato + +//fs -> flush & sleep +void fs(int milliseconds){ + fflush(stdout); + usleep(milliseconds*1000); +} + +//p -> printf +void p(char* txt){ + printf(txt); +} + +void yourReality(){ + + printf("\e[?25l"); + p("Loading "); + for(int i = 0; i < 2; i++){ + //\033[XC => X columns right + //\033[XD => X columns left + printf("\033[3D "); printf("\033[3D"); + fs(500); printf("."); fs(500); printf("."); fs(500); printf("."); fs(500); + + } + printf("\n"); + printf("\033[0;33mEvery "); fs(350); printf("day, "); + fs(700); + p("I "); fs(450); p("imagine "); fs(350); p("a "); fs(350); p("future "); fs(350); p("where "); fs(750); + p("i "); fs(300); p("can "); fs(300); p("be "); fs(300); p("with "); fs(300); p("you."); + + p("\033[0m"); + printf("\e[?25h"); +} diff --git a/etc/your-reality.h b/etc/your-reality.h index 06363f3..7dae4ca 100644 --- a/etc/your-reality.h +++ b/etc/your-reality.h @@ -1,6 +1,6 @@ -#ifndef _YOUR_REALITY_H -#define _YOUR_REALITY_H - -void yourReality(); - +#ifndef _YOUR_REALITY_H +#define _YOUR_REALITY_H + +void yourReality(); + #endif \ No newline at end of file diff --git a/glade/test_window.glade b/glade/test_window.glade index a365958..6ff1c8d 100644 --- a/glade/test_window.glade +++ b/glade/test_window.glade @@ -1,101 +1,101 @@ - - - - - - 300 - 230 - False - False - center - 300 - 230 - ../logo.png - center - - - - - True - False - - - Ok - 100 - 31 - True - True - True - Pink Fluffy Unicorns - - - - 135 - 183 - - - - - 369 - 20 - True - False - center - center - center - 50 - - - - - - - 57 - - - - - Toggle - 107 - 24 - True - True - False - True - - - - 140 - 153 - - - - - 40 - 40 - True - False - True - - - 324 - 179 - - - - - 100 - 20 - True - False - 100 - - - 8 - 201 - - - - - - + + + + + + 300 + 230 + False + False + center + 300 + 230 + ../logo.png + center + + + + + True + False + + + Ok + 100 + 31 + True + True + True + Pink Fluffy Unicorns + + + + 135 + 183 + + + + + 369 + 20 + True + False + center + center + center + 50 + + + + + + + 57 + + + + + Toggle + 107 + 24 + True + True + False + True + + + + 140 + 153 + + + + + 40 + 40 + True + False + True + + + 324 + 179 + + + + + 100 + 20 + True + False + 100 + + + 8 + 201 + + + + + + diff --git a/utils/clear_screen.c b/utils/clear_screen.c index a3d16c9..4a315dc 100644 --- a/utils/clear_screen.c +++ b/utils/clear_screen.c @@ -1,28 +1,28 @@ -#include -#if defined(_WIN32) -#include -#elif defined(__linux__) -#include -#include -#endif - -#include "clear_screen.h" - - -void clearScreen(){ - #if defined(_WIN32) - CONSOLE_SCREEN_BUFFER_INFO csbi; - int rows; - GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); - rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; - for(int i = 0; i < rows; i++){ - printf("\n"); - } - #elif defined(__linux__) - struct winsize w; - ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); - for(int i = 0; i < w.ws_row; i++){ - printf("\n"); - } - #endif +#include +#if defined(_WIN32) +#include +#elif defined(__linux__) +#include +#include +#endif + +#include "clear_screen.h" + + +void clearScreen(){ + #if defined(_WIN32) + CONSOLE_SCREEN_BUFFER_INFO csbi; + int rows; + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); + rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; + for(int i = 0; i < rows; i++){ + printf("\n"); + } + #elif defined(__linux__) + struct winsize w; + ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); + for(int i = 0; i < w.ws_row; i++){ + printf("\n"); + } + #endif } \ No newline at end of file diff --git a/utils/clear_screen.h b/utils/clear_screen.h index b7bc8c7..41c86c9 100644 --- a/utils/clear_screen.h +++ b/utils/clear_screen.h @@ -1,6 +1,6 @@ -#ifndef _CLEAR_SCREEN_H_ -#define _CLEAR_SCREEN_H_ - -void clearScreen(); - +#ifndef _CLEAR_SCREEN_H_ +#define _CLEAR_SCREEN_H_ + +void clearScreen(); + #endif \ No newline at end of file