Changeset 4058 for neercs


Ignore:
Timestamp:
Nov 29, 2009, 12:17:45 PM (10 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Moved screensaver property to clean struct screensaver
Location:
neercs/trunk/src
Files:
6 edited

Legend:

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

    r4046 r4058  
    422422int set_screensaver_timeout(const char *argv, struct screen_list *screen_list)
    423423{
    424     screen_list->screensaver_timeout = atoi(argv) * 1000000;
     424    screen_list->screensaver.timeout = atoi(argv) * 1000000;
    425425    /* if timeout is 0, set it to 0xFFFFFFFFFFFFFFFF */
    426     if (!screen_list->screensaver_timeout)
    427         screen_list->screensaver_timeout -= 1;
     426    if (!screen_list->screensaver.timeout)
     427        screen_list->screensaver.timeout -= 1;
    428428    return 0;
    429429}
     
    539539{
    540540    char *r = malloc(100);
    541     sprintf(r, "%f", (float)screen_list->screensaver_timeout / 1000000.0f);
     541    sprintf(r, "%f", (float)screen_list->screensaver.timeout / 1000000.0f);
    542542    return r;
    543543}
  • neercs/trunk/src/neercs.h

    r4057 r4058  
    157157};
    158158
     159struct screensaver
     160{
     161    /* ScreenSaver stuff */
     162    long long unsigned int timeout;     /* Screensaver timeout in us */
     163    int in_screensaver;
     164    void *data; 
     165};
     166
    159167struct screen_list
    160168{
     
    202210    struct interpreter_props interpreter_props;
    203211
    204     /* ScreenSaver stuff */
    205     long long unsigned int screensaver_timeout;     /* Screensaver timeout in us */
    206     int in_screensaver;
    207     void *screensaver_data;
     212        struct screensaver screensaver;
    208213
    209214    int pty, prevpty;            /* Current and previous window */
  • neercs/trunk/src/screen_list.c

    r4055 r4058  
    7171    screen_list->pty = screen_list->prevpty = 0;
    7272    screen_list->dont_update_coords = 0;
    73     screen_list->screensaver_timeout = (60*5) * 1000000;
    74     screen_list->screensaver_data = NULL;
    75     screen_list->in_screensaver = 0;
     73    screen_list->screensaver.timeout = (60*5) * 1000000;
     74    screen_list->screensaver.data = NULL;
     75    screen_list->screensaver.in_screensaver = 0;
    7676    screen_list->locked = 0;
    7777    screen_list->lock_offset = 0;
  • neercs/trunk/src/screensaver.c

    r4052 r4058  
    142142
    143143
    144     screen_list->screensaver_data = flying_toaster;
     144    screen_list->screensaver.data = flying_toaster;
    145145}
    146146
    147147void screensaver_flying_toasters_kill(struct screen_list *screen_list)
    148148{
    149     struct flying_toaster *flying_toaster = screen_list->screensaver_data;
     149    struct flying_toaster *flying_toaster = screen_list->screensaver.data;
    150150
    151151    caca_free_canvas(flying_toaster->toaster[0]);
     
    154154    free(flying_toaster->toaster);
    155155    free(flying_toaster);
    156     screen_list->screensaver_data = NULL;
     156    screen_list->screensaver.data = NULL;
    157157}
    158158
    159159void screensaver_flying_toasters(struct screen_list *screen_list)
    160160{
    161     struct flying_toaster *d = screen_list->screensaver_data;
     161    struct flying_toaster *d = screen_list->screensaver.data;
    162162    int i, w, h, x, y, s;
    163163    if (!d)
  • neercs/trunk/src/server.c

    r4057 r4058  
    256256                int y = atoi(buf + 18);
    257257                int b = atoi(buf + 28);
    258                 debug("mouse %d %d button %d\n", x, y, b);
    259258                sprintf(buf, "\x1b[M%c%c%c", '@'+(b-1), x+32, y+32);
    260                 debug("mouse sending CSI '%s' to term.\n", &buf[1]);
    261259                send_ansi_sequence(screen_list, buf);
    262260            }
     
    363361#endif
    364362        else if ((current_time - screen_list->last_key_time >=
    365                   screen_list->screensaver_timeout))
    366         {
    367             if (!screen_list->in_screensaver)
     363                  screen_list->screensaver.timeout))
     364        {
     365            if (!screen_list->screensaver.in_screensaver)
    368366            {
    369367                screensaver_init(screen_list);
    370                 screen_list->in_screensaver = 1;
     368                screen_list->screensaver.in_screensaver = 1;
    371369                set_cursor(0, screen_list);
    372370            }
     
    504502
    505503        /* Kill screensaver */
    506         if (screen_list->in_screensaver)
     504        if (screen_list->screensaver.in_screensaver)
    507505        {
    508506            screensaver_kill(screen_list);
    509             screen_list->in_screensaver = 0;
     507            screen_list->screensaver.in_screensaver = 0;
    510508            screen_list->changed = 1;
    511509            refresh = 1;
  • neercs/trunk/src/term.c

    r4057 r4058  
    229229        skip = 1;
    230230
    231 #define ASCCHAR(c) (c>31&&c<127)?c:'?'
    232         if (buffer[i] == '\033')
    233         {
    234             debug("ansi ESC : '%c%c%c%c%c'\n",
    235                   ASCCHAR(buffer[i + 1]),
    236                   ASCCHAR(buffer[i + 2]),
    237                   ASCCHAR(buffer[i + 3]),
    238                   ASCCHAR(buffer[i + 4]), ASCCHAR(buffer[i + 5]));
    239         }
    240 
    241231        /* Control codes (ASCII < \x20) */
    242232        if (!handle_single_char(buffer[i], &x, &y, screen_list, sc))
Note: See TracChangeset for help on using the changeset viewer.