Changeset 2368


Ignore:
Timestamp:
06/13/08 14:52:48 (5 years ago)
Author:
jylam
Message:
  • Added bell handling
Location:
neercs/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/main.c

    r2367 r2368  
    9191    screen_list->height = cucul_get_canvas_height(cv) - ((mini*6) + (status)); 
    9292    screen_list->wm_type = WM_CARD; 
     93    screen_list->in_bell = 0; 
    9394 
    9495    for(i = 0; i < nt; i++) 
     
    189190            unsigned long int bytes; 
    190191 
    191             bytes = import_term(screen_list->screen[i], screen_list->screen[i]->buf, screen_list->screen[i]->total); 
     192            bytes = import_term(screen_list, screen_list->screen[i], screen_list->screen[i]->buf, screen_list->screen[i]->total); 
    192193 
    193194            if(bytes > 0) 
     
    286287 
    287288        /* Refresh screen */ 
    288         if(refresh) 
     289        if(refresh || screen_list->in_bell) 
    289290        { 
    290291            refresh = 0; 
     
    302303            for(i = screen_list->count - 1; i >=0; i--) 
    303304            { 
    304  
    305305                if(i!=pty) 
    306306                { 
     
    314314                                         screen_list->screen[i]->w + 2, 
    315315                                         screen_list->screen[i]->h + 2); 
    316  
    317316                } 
    318317 
     
    324323                       screen_list->screen[pty]->y, 
    325324                   screen_list->screen[pty]->cv, NULL); 
     325            if(screen_list->screen[pty]->bell) 
     326            { 
     327                cucul_set_color_ansi(cv, CUCUL_RED, CUCUL_BLACK); 
     328                screen_list->screen[pty]->bell = 0; 
     329                screen_list->in_bell--; 
     330            } 
     331            else 
     332            { 
     333                cucul_set_color_ansi(cv, CUCUL_LIGHTGREEN, CUCUL_BLACK); 
     334            } 
    326335            cucul_draw_cp437_box(cv, 
    327336                                 screen_list->screen[pty]->x - 1, 
     
    436445    s->h = h+1; 
    437446    s->fd = create_pty(command, w, h); 
     447    s->bell = 0; 
     448 
    438449    if(s->fd < 0) 
    439450    { 
  • neercs/trunk/src/neercs.h

    r2367 r2368  
    4242    unsigned char *buf; 
    4343    long int total; 
     44    int bell; 
    4445 
    4546    int x, y; 
     
    5051{ 
    5152    int wm_type; 
     53    int in_bell; 
    5254    int count; 
    5355    int width, height; 
     
    5759 
    5860 
    59 long int import_term(struct screen *sc, void const *data, unsigned int size); 
     61long int import_term(struct screen_list *screen_list, struct screen *sc, void const *data, unsigned int size); 
    6062int set_tty_size(int fd, unsigned int w, unsigned int h); 
    6163 
  • neercs/trunk/src/term.c

    r1834 r2368  
    2626                            unsigned int, unsigned int const *); 
    2727 
    28 long int import_term(struct screen *sc, void const *data, unsigned int size) 
     28long int import_term(struct screen_list *screen_list, struct screen *sc, void const *data, unsigned int size) 
    2929{ 
    3030    unsigned char const *buffer = (unsigned char const*)data; 
     
    6868            x = 0; 
    6969            y++; 
     70        } 
     71        else if(buffer[i] == '\a') 
     72        { 
     73            screen_list->in_bell = 10; 
     74            sc->bell = 10; 
    7075        } 
    7176 
Note: See TracChangeset for help on using the changeset viewer.