Ignore:
Timestamp:
Oct 18, 2008, 11:47:35 PM (14 years ago)
Author:
Sam Hocevar
Message:

Port neercs to the unified libcaca 0.99.beta15 API.

File:
1 edited

Legend:

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

    r2627 r2995  
    1919#include <stdlib.h>
    2020#include <string.h>
    21 #include <cucul.h>
     21#include <caca.h>
    2222#include <caca.h>
    2323#include <time.h>
     
    9393    unsigned int i;
    9494    char buffer[1024];
    95     cucul_canvas_t *cv = screen_list->cv;
     95    caca_canvas_t *cv = screen_list->cv;
    9696
    9797    gethostname(buffer, sizeof(buffer)-1);
    9898
    9999    int w = 65, h = 20;
    100     int x = (cucul_get_canvas_width(cv) - w) / 2;
    101     int y = (cucul_get_canvas_height(cv) - h) / 2;
    102 
    103 
    104     cucul_set_color_ansi(cv, CUCUL_BLUE, CUCUL_BLUE);
    105     cucul_fill_box(cv,
     100    int x = (caca_get_canvas_width(cv) - w) / 2;
     101    int y = (caca_get_canvas_height(cv) - h) / 2;
     102
     103
     104    caca_set_color_ansi(cv, CACA_BLUE, CACA_BLUE);
     105    caca_fill_box(cv,
    106106                   x, y,
    107107                   w, h, '#');
    108     cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_BLUE);
    109     cucul_draw_cp437_box(cv,
     108    caca_set_color_ansi(cv, CACA_DEFAULT, CACA_BLUE);
     109    caca_draw_cp437_box(cv,
    110110                         x, y,
    111111                         w, h);
     
    113113    x+=2;
    114114    y++;
    115     cucul_printf(cv,
    116                  (cucul_get_canvas_width(cv) - strlen(PACKAGE_STRING " locked")) / 2,
     115    caca_printf(cv,
     116                 (caca_get_canvas_width(cv) - strlen(PACKAGE_STRING " locked")) / 2,
    117117                 y-1,
    118118                 PACKAGE_STRING " locked");
    119119
    120     cucul_printf(cv, x, y++, "Please type in your password for %s@%s :", getenv("USER"), buffer);
     120    caca_printf(cv, x, y++, "Please type in your password for %s@%s :", getenv("USER"), buffer);
    121121    y+=2;
    122122
    123     x = (cucul_get_canvas_width(cv)/2) - ((strlen(screen_list->lockpass) / 2) + strlen("Password : "));
    124     cucul_printf(cv, x, y, "Password : ");
     123    x = (caca_get_canvas_width(cv)/2) - ((strlen(screen_list->lockpass) / 2) + strlen("Password : "));
     124    caca_printf(cv, x, y, "Password : ");
    125125    x+=strlen("Password : ");
    126126    for(i=0; i<strlen(screen_list->lockpass); i++)
    127127    {
    128         cucul_put_str(cv, x, y, "*");
     128        caca_put_str(cv, x, y, "*");
    129129        x++;
    130130    }
     
    133133    if(strlen(screen_list->lockmsg))
    134134    {
    135         x = ((cucul_get_canvas_width(cv) - w) / 2) + (strlen(screen_list->lockmsg));
     135        x = ((caca_get_canvas_width(cv) - w) / 2) + (strlen(screen_list->lockmsg));
    136136        y+=2;
    137         cucul_set_color_ansi(cv, CUCUL_RED, CUCUL_BLUE);
    138         cucul_printf(cv, x, y, "Error : %s", screen_list->lockmsg);
     137        caca_set_color_ansi(cv, CACA_RED, CACA_BLUE);
     138        caca_printf(cv, x, y, "Error : %s", screen_list->lockmsg);
    139139    }
    140140#endif
Note: See TracChangeset for help on using the changeset viewer.