Ver código fonte

proper resizing

dev
anon 8 meses atrás
pai
commit
faec45bcfa
6 arquivos alterados com 84 adições e 15 exclusões
  1. +52
    -0
      .gdb_history
  2. +2
    -3
      README.md
  3. +17
    -0
      src/display.c
  4. +1
    -0
      src/global.h
  5. +11
    -3
      src/input.c
  6. +1
    -9
      src/main.c

+ 52
- 0
.gdb_history Ver arquivo

@@ -135,3 +135,55 @@ frame 1
p wtooltip
r
p tooltip_width
b redisplay
where
l
s
where
s
n
c
c
b redisplay
c
n
where
l
c
b redisplay
c
n
n
where
finish
finish
finish
s
p c
n
b redisplay
c
n
finish
finish
finish
s
n
s
n
p EOF
c
where
frame 11
until
where
frame 9
n
frame 9
finish
where
n
s
n
s
n

+ 2
- 3
README.md Ver arquivo

@@ -106,12 +106,11 @@ All can be configured sucklessly under "config/colors.h". Hopefully the comments
| int window_change | Bit mask type of the CH_\* macros. Keeps track of the windows to be refresed on the next run of display(). Could be better utalized.

# TODO /*move soon*/
1. create a step in the mean loop where the cursor us forced into the right window based on mode
+ sort out the global hell
+ sort out constants.h
+ scrollbar() uses magic int literals?
+ lineflagafterfile is stupid
+ library.h...; "private library", in a program using 90 globals; ffs
+ sort out the global hell
+ scrollbar() uses magic int literals?
+ was there really ever a scrollbar?
+ handle resizing
+ a search struct could be great for caching and could ease the global situation


+ 17
- 0
src/display.c Ver arquivo

@@ -854,3 +854,20 @@ void display(void) {

window_change = CH_NONE;
}

void redisplay(void) {
delwin(winput);
delwin(wmode);
delwin(wresult);
delwin(whelp );
delwin(wtooltip);
delwin(wcase);

endwin();

dispinit();

window_change = CH_ALL;

display();
}

+ 1
- 0
src/global.h Ver arquivo

@@ -265,6 +265,7 @@ void countrefs(void);
void crossref(char *srcfile);
void dispinit(void);
void display(void);
void redisplay(void);
void drawscrollbar(int top, int bot);
void edit(char *file, const char *const linenum);
void editall(void);


+ 11
- 3
src/input.c Ver arquivo

@@ -328,9 +328,6 @@ static int global_input(const int c) {
execute(shell, shell, NULL);
current_page = 0;
break;
case KEY_RESIZE:
/* XXX: fill in*/
break;
case ctrl('U'): /* redraw screen */
case KEY_CLEAR:
window_change = CH_ALL;
@@ -505,6 +502,17 @@ int handle_input(const int c) {
do_press_any_key = false;
return 0;
}
/* - Resize - */
/* it's treated specially because curses treat it specially.
as far as i can tell this is the only key that does not
flush after itself.
*/
if(c == KEY_RESIZE) {
redisplay();
flushinp();
return 0;
}

/* --- global --- */
const int r = global_input(c);
if(r) { return 0; }


+ 1
- 9
src/main.c Ver arquivo

@@ -105,15 +105,7 @@ static inline void readenv(void);
static inline void linemode_event_loop(void);
static inline void screenmode_event_loop(void);

#if defined(KEY_RESIZE) && !defined(__DJGPP__)
void sigwinch_handler(int sig, siginfo_t *info, void *unused) {
UNUSED(sig);
UNUSED(info);
UNUSED(unused);

if(incurses == true) { ungetch(KEY_RESIZE); }
}
#endif

static inline void siginit(void) {
/* if running in the foreground */
@@ -134,7 +126,7 @@ static inline void siginit(void) {
*/
signal(SIGPIPE, SIG_IGN);

if(linemode == false) { signal(SIGWINCH, sigwinch_handler); }
//if(linemode == false) { signal(SIGWINCH, redisplay); }
}

void cannotopen(const char *const file) {


Carregando…
Cancelar
Salvar