Ignore:
Timestamp:
Oct 18, 2008, 11:47:35 PM (12 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/screens.c

    r2641 r2995  
    2525#include <unistd.h>
    2626
    27 #include <cucul.h>
    2827#include <caca.h>
     28#include <caca.h>
    2929
    3030#include "neercs.h"
     
    3434    struct screen *s = (struct screen*) malloc(sizeof(struct screen));
    3535
    36     s->cv = cucul_create_canvas(w, h);
    37     cucul_set_color_ansi(s->cv, CUCUL_BLACK, CUCUL_BLACK);
    38     cucul_clear_canvas(s->cv);
     36    s->cv = caca_create_canvas(w, h);
     37    caca_set_color_ansi(s->cv, CACA_BLACK, CACA_BLACK);
     38    caca_clear_canvas(s->cv);
    3939    s->init = 0;
    4040
     
    5151    if(s->fd < 0)
    5252    {
    53         cucul_free_canvas(s->cv);
     53        caca_free_canvas(s->cv);
    5454        free(s);
    5555        return NULL;
     
    6262    struct screen *s = (struct screen*) malloc(sizeof(struct screen));
    6363
    64     s->cv = cucul_create_canvas(w, h);
    65     cucul_set_color_ansi(s->cv, CUCUL_BLACK, CUCUL_BLACK);
    66     cucul_clear_canvas(s->cv);
     64    s->cv = caca_create_canvas(w, h);
     65    caca_set_color_ansi(s->cv, CACA_BLACK, CACA_BLACK);
     66    caca_clear_canvas(s->cv);
    6767    s->init = 0;
    6868
     
    8585    if(s->fd < 0)
    8686    {
    87         cucul_free_canvas(s->cv);
     87        caca_free_canvas(s->cv);
    8888        free(s);
    8989        return NULL;
     
    102102    s->buf = NULL;
    103103    if(s->cv)
    104         cucul_free_canvas(s->cv);
     104        caca_free_canvas(s->cv);
    105105    s->cv = NULL;
    106106    free(s);
     
    182182    debug("Current pty is %d\n", screen_list->pty);
    183183
    184     screen_list->width  = cucul_get_canvas_width(screen_list->cv);
    185     screen_list->height = cucul_get_canvas_height(screen_list->cv) - (screen_list->mini*6);
     184    screen_list->width  = caca_get_canvas_width(screen_list->cv);
     185    screen_list->height = caca_get_canvas_height(screen_list->cv) - (screen_list->mini*6);
    186186
    187187    if(!screen_list->dont_update_coords)
    188188        update_windows_props(screen_list);
    189189
    190     cucul_set_color_ansi(screen_list->cv, CUCUL_DEFAULT, CUCUL_DEFAULT);
    191     cucul_clear_canvas(screen_list->cv);
    192     cucul_set_color_ansi(screen_list->cv, CUCUL_LIGHTRED, CUCUL_BLACK);
     190    caca_set_color_ansi(screen_list->cv, CACA_DEFAULT, CACA_DEFAULT);
     191    caca_clear_canvas(screen_list->cv);
     192    caca_set_color_ansi(screen_list->cv, CACA_LIGHTRED, CACA_BLACK);
    193193
    194194    for(i = screen_list->count - 1; i >=0; i--)
     
    196196        if(i!=screen_list->pty && screen_list->screen[i]->visible)
    197197        {
    198             cucul_blit(screen_list->cv,
     198            caca_blit(screen_list->cv,
    199199                       screen_list->screen[i]->x,
    200200                       screen_list->screen[i]->y,
    201201                       screen_list->screen[i]->cv, NULL);
    202202
    203             cucul_draw_cp437_box(screen_list->cv,
     203            caca_draw_cp437_box(screen_list->cv,
    204204                                 screen_list->screen[i]->x - 1,
    205205                                 screen_list->screen[i]->y - 1,
     
    207207                                 screen_list->screen[i]->h + 2);
    208208            if(screen_list->screen[i]->title)
    209                 cucul_printf(screen_list->cv,
     209                caca_printf(screen_list->cv,
    210210                             screen_list->screen[i]->x,
    211211                             screen_list->screen[i]->y - 1,
     
    216216    }
    217217
    218     cucul_blit(screen_list->cv,
     218    caca_blit(screen_list->cv,
    219219               screen_list->screen[screen_list->pty]->x,
    220220               screen_list->screen[screen_list->pty]->y,
     
    223223    if(screen_list->screen[screen_list->pty]->bell)
    224224    {
    225         cucul_set_color_ansi(screen_list->cv, CUCUL_RED, CUCUL_BLACK);
     225        caca_set_color_ansi(screen_list->cv, CACA_RED, CACA_BLACK);
    226226        screen_list->screen[screen_list->pty]->bell = 0;
    227227        screen_list->in_bell--;
     
    229229    else
    230230    {
    231         cucul_set_color_ansi(screen_list->cv, CUCUL_LIGHTGREEN, CUCUL_BLACK);
    232     }
    233 
    234     cucul_draw_cp437_box(screen_list->cv,
     231        caca_set_color_ansi(screen_list->cv, CACA_LIGHTGREEN, CACA_BLACK);
     232    }
     233
     234    caca_draw_cp437_box(screen_list->cv,
    235235                         screen_list->screen[screen_list->pty]->x - 1,
    236236                         screen_list->screen[screen_list->pty]->y - 1,
     
    240240    if(screen_list->screen[screen_list->pty]->title)
    241241    {
    242         cucul_printf(screen_list->cv,
     242        caca_printf(screen_list->cv,
    243243                     screen_list->screen[screen_list->pty]->x,
    244244                     screen_list->screen[screen_list->pty]->y - 1,
     
    248248    }
    249249
    250     cucul_gotoxy(screen_list->cv,
     250    caca_gotoxy(screen_list->cv,
    251251                 screen_list->screen[screen_list->pty]->x +
    252                  cucul_get_cursor_x(screen_list->screen[screen_list->pty]->cv),
     252                 caca_get_cursor_x(screen_list->screen[screen_list->pty]->cv),
    253253                 screen_list->screen[screen_list->pty]->y +
    254                  cucul_get_cursor_y(screen_list->screen[screen_list->pty]->cv));
     254                 caca_get_cursor_y(screen_list->screen[screen_list->pty]->cv));
    255255
    256256
Note: See TracChangeset for help on using the changeset viewer.