.
This commit is contained in:
parent
a297a0f56d
commit
ea6f464ad6
12
README.md
12
README.md
@ -73,6 +73,18 @@ Just run:
|
|||||||
make
|
make
|
||||||
This will yield the executable "scope", which you are free to do whatever with.
|
This will yield the executable "scope", which you are free to do whatever with.
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
## Readline
|
||||||
|
The readline integratoin should be complete -please let us know if not-, except for your prompt being used, which could easily break the TUIs display.
|
||||||
|
|
||||||
|
The rl_readline_name variable will be set to "Csope", so you may have conditional configurations in your .inputrc with the following format:
|
||||||
|
$if Csope
|
||||||
|
# <whatever>
|
||||||
|
$endif
|
||||||
|
## Colors
|
||||||
|
All can be configured sucklessly under "config/colors.h". Hopefully the comments are self evident.
|
||||||
|
|
||||||
|
|
||||||
# Control flow
|
# Control flow
|
||||||
...
|
...
|
||||||
|
|
||||||
|
117
config/colors.h
117
config/colors.h
@ -14,14 +14,70 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* --- Valid presets --- */
|
/* --- Valid presets --- */
|
||||||
#define STD_PRESET 1
|
#define MONOCHROME_PRESET 1
|
||||||
#define COLORFUL_PRESET 2
|
#define COLORFUL_PRESET 2
|
||||||
|
// Your own preset.
|
||||||
|
// NOTE: you have to assign a color
|
||||||
|
// to each end every macro
|
||||||
|
#define COLORFUL_CUSTOM 3
|
||||||
|
|
||||||
/* --- Preset selection --- */
|
/* --- Preset selection --- */
|
||||||
|
// Set to one of the numerical values above
|
||||||
#define COLOR_PRESET 2
|
#define COLOR_PRESET 2
|
||||||
|
|
||||||
#if COLOR_PRESET == 1
|
#if COLOR_PRESET == 1
|
||||||
|
# define COLOR_STD_FG COLOR_WHITE
|
||||||
|
# define COLOR_STD_BG COLOR_BLACK
|
||||||
|
# define COLOR_FRAME_FG COLOR_WHITE
|
||||||
|
# define COLOR_FRAME_BG COLOR_BLACK
|
||||||
|
# define COLOR_PROMPT_FG COLOR_WHITE
|
||||||
|
# define COLOR_PROMPT_BG COLOR_BLACK
|
||||||
|
# define COLOR_CURSOR COLOR_WHITE
|
||||||
|
# define COLOR_FIELD_FG COLOR_WHITE
|
||||||
|
# define COLOR_FIELD_BG COLOR_BLACK
|
||||||
|
# define COLOR_FIELD_SELECTED_FG COLOR_WHITE
|
||||||
|
# define COLOR_FIELD_SELECTED_BG COLOR_BLACK
|
||||||
|
# define COLOR_HELP_FG COLOR_WHITE
|
||||||
|
# define COLOR_HELP_BG COLOR_BLACK
|
||||||
|
# define COLOR_TOOLTIP_FG COLOR_WHITE
|
||||||
|
# define COLOR_TOOLTIP_BG COLOR_BLACK
|
||||||
|
# define COLOR_CASE_FG COLOR_WHITE
|
||||||
|
# define COLOR_CASE_BG COLOR_BLACK
|
||||||
|
# define COLOR_MESSAGE_FG COLOR_WHITE
|
||||||
|
# define COLOR_MESSAGE_BG COLOR_BLACK
|
||||||
|
# define COLOR_PATTERN_FG COLOR_WHITE
|
||||||
|
# define COLOR_PATTERN_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_HEADER_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_HEADER_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_ID_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_ID_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_MARK_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_MARK_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_FILE_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_FILE_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_FUNCTION_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_FUNCTION_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_LINE_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_LINE_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_TEXT_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_TEXT_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_SELECTED_ID_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_SELECTED_ID_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_SELECTED_MARK_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_SELECTED_MARK_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FILE_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FILE_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FUNCTION_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FUNCTION_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_LINE_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_LINE_BG COLOR_BLACK
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_TEXT_FG COLOR_WHITE
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_TEXT_BG COLOR_BLACK
|
||||||
|
# define COLOR_PAGER_MSG_FG COLOR_WHITE
|
||||||
|
# define COLOR_PAGER_MSG_BG COLOR_BLACK
|
||||||
#elif COLOR_PRESET == 2
|
#elif COLOR_PRESET == 2
|
||||||
|
# define COLOR_STD_FG COLOR_WHITE
|
||||||
|
# define COLOR_STD_BG -1
|
||||||
# define COLOR_FRAME_FG COLOR_GREEN
|
# define COLOR_FRAME_FG COLOR_GREEN
|
||||||
# define COLOR_FRAME_BG -1
|
# define COLOR_FRAME_BG -1
|
||||||
# define COLOR_PROMPT_FG COLOR_BLUE
|
# define COLOR_PROMPT_FG COLOR_BLUE
|
||||||
@ -69,12 +125,67 @@
|
|||||||
# define COLOR_TABLE_COL_SELECTED_TEXT_BG COLOR_WHITE
|
# define COLOR_TABLE_COL_SELECTED_TEXT_BG COLOR_WHITE
|
||||||
# define COLOR_PAGER_MSG_FG COLOR_YELLOW
|
# define COLOR_PAGER_MSG_FG COLOR_YELLOW
|
||||||
# define COLOR_PAGER_MSG_BG COLOR_WHITE
|
# define COLOR_PAGER_MSG_BG COLOR_WHITE
|
||||||
|
#elif COLOR_PRESET == 3
|
||||||
|
# define COLOR_STD_FG
|
||||||
|
# define COLOR_STD_BG
|
||||||
|
# define COLOR_FRAME_FG
|
||||||
|
# define COLOR_FRAME_BG
|
||||||
|
# define COLOR_PROMPT_FG
|
||||||
|
# define COLOR_PROMPT_BG
|
||||||
|
# define COLOR_CURSOR
|
||||||
|
# define COLOR_FIELD_FG
|
||||||
|
# define COLOR_FIELD_BG
|
||||||
|
# define COLOR_FIELD_SELECTED_FG
|
||||||
|
# define COLOR_FIELD_SELECTED_BG
|
||||||
|
# define COLOR_HELP_FG
|
||||||
|
# define COLOR_HELP_BG
|
||||||
|
# define COLOR_TOOLTIP_FG
|
||||||
|
# define COLOR_TOOLTIP_BG
|
||||||
|
# define COLOR_CASE_FG
|
||||||
|
# define COLOR_CASE_BG
|
||||||
|
# define COLOR_MESSAGE_FG
|
||||||
|
# define COLOR_MESSAGE_BG
|
||||||
|
# define COLOR_PATTERN_FG
|
||||||
|
# define COLOR_PATTERN_BG
|
||||||
|
# define COLOR_TABLE_HEADER_FG
|
||||||
|
# define COLOR_TABLE_HEADER_BG
|
||||||
|
# define COLOR_TABLE_ID_FG
|
||||||
|
# define COLOR_TABLE_ID_BG
|
||||||
|
# define COLOR_TABLE_MARK_FG
|
||||||
|
# define COLOR_TABLE_MARK_BG
|
||||||
|
# define COLOR_TABLE_COL_FILE_FG
|
||||||
|
# define COLOR_TABLE_COL_FILE_BG
|
||||||
|
# define COLOR_TABLE_COL_FUNCTION_FG
|
||||||
|
# define COLOR_TABLE_COL_FUNCTION_BG
|
||||||
|
# define COLOR_TABLE_COL_LINE_FG
|
||||||
|
# define COLOR_TABLE_COL_LINE_BG
|
||||||
|
# define COLOR_TABLE_COL_TEXT_FG
|
||||||
|
# define COLOR_TABLE_COL_TEXT_BG
|
||||||
|
# define COLOR_TABLE_SELECTED_ID_FG
|
||||||
|
# define COLOR_TABLE_SELECTED_ID_BG
|
||||||
|
# define COLOR_TABLE_SELECTED_MARK_FG
|
||||||
|
# define COLOR_TABLE_SELECTED_MARK_BG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FILE_FG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FILE_BG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FUNCTION_FG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_FUNCTION_BG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_LINE_FG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_LINE_BG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_TEXT_FG
|
||||||
|
# define COLOR_TABLE_COL_SELECTED_TEXT_BG
|
||||||
|
# define COLOR_PAGER_MSG_FG
|
||||||
|
# define COLOR_PAGER_MSG_BG
|
||||||
#else
|
#else
|
||||||
# error "Color profile not valid"
|
# error "Color profile not valid"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ############################################### */
|
||||||
|
/* ### Don't touch if you are just configuring ### */
|
||||||
enum color_pairs{
|
enum color_pairs{
|
||||||
COLOR_PAIR_FRAME = 1,
|
COLOR_PAIR_STD = 1,
|
||||||
|
COLOR_PAIR_FRAME,
|
||||||
COLOR_PAIR_PROMPT,
|
COLOR_PAIR_PROMPT,
|
||||||
COLOR_PAIR_FIELD,
|
COLOR_PAIR_FIELD,
|
||||||
COLOR_PAIR_FIELD_SELECTED,
|
COLOR_PAIR_FIELD_SELECTED,
|
||||||
|
@ -157,6 +157,7 @@ void dispinit(void) {
|
|||||||
initscr(); /* initialize the screen */
|
initscr(); /* initialize the screen */
|
||||||
start_color();
|
start_color();
|
||||||
use_default_colors();
|
use_default_colors();
|
||||||
|
easy_init_pair(STD);
|
||||||
easy_init_pair(FRAME);
|
easy_init_pair(FRAME);
|
||||||
easy_init_pair(PROMPT);
|
easy_init_pair(PROMPT);
|
||||||
easy_init_pair(FIELD);
|
easy_init_pair(FIELD);
|
||||||
@ -213,6 +214,14 @@ void dispinit(void) {
|
|||||||
whelp = newwin(LINES - 2, COLS - 2, 1, 1);
|
whelp = newwin(LINES - 2, COLS - 2, 1, 1);
|
||||||
wtooltip = newwin(1, tooltip_width, LINES - 1, COLS - (tooltip_width + 4));
|
wtooltip = newwin(1, tooltip_width, LINES - 1, COLS - (tooltip_width + 4));
|
||||||
wcase = newwin(1, case_width, 0, COLS - case_width - 4);
|
wcase = newwin(1, case_width, 0, COLS - case_width - 4);
|
||||||
|
/* Set background */
|
||||||
|
wbkgdset(winput, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
wbkgdset(wmode, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
wbkgdset(wresult, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
wbkgdset(whelp, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
wbkgdset(wtooltip, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
wbkgdset(wcase, COLOR_PAIR(COLOR_PAIR_STD));
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
current_window = &winput;
|
current_window = &winput;
|
||||||
|
@ -754,7 +754,6 @@ int findinit(const char *pattern_) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
free(pattern);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
static int input_available = 0;
|
static int input_available = 0;
|
||||||
static int input_char;
|
static int input_char;
|
||||||
char input_line[PATLEN + 1];
|
char input_line[PATLEN + 1];
|
||||||
|
|
||||||
/* used for saving a line not [Enter]-ed yet,
|
/* used for saving a line not [Enter]-ed yet,
|
||||||
* so its not lost if the user scrolls the history
|
* so its not lost if the user scrolls the history
|
||||||
*/
|
*/
|
||||||
@ -164,6 +165,8 @@ static inline void next_history_proxy(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rlinit() {
|
void rlinit() {
|
||||||
|
rl_readline_name = PROGRAM_NAME;
|
||||||
|
|
||||||
using_history();
|
using_history();
|
||||||
|
|
||||||
rl_catch_signals = 0;
|
rl_catch_signals = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user