Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_win32.c

    r2305 r2821  
    2626#include <stdio.h>
    2727
    28 #include "cucul.h"
    2928#include "caca.h"
    3029#include "caca_internals.h"
     
    8382static int win32_init_graphics(caca_display_t *dp)
    8483{
    85     int width = cucul_get_canvas_width(dp->cv);
    86     int height = cucul_get_canvas_height(dp->cv);
     84    int width = caca_get_canvas_width(dp->cv);
     85    int height = caca_get_canvas_height(dp->cv);
    8786    CONSOLE_SCREEN_BUFFER_INFO csbi;
    8887    SMALL_RECT rect;
     
    123122    SetConsoleWindowInfo(dp->drv.p->screen, TRUE, &rect);
    124123
    125     /* Report our new size to libcucul */
     124    /* Report our new size to libcaca */
    126125    if(!GetConsoleScreenBufferInfo(dp->drv.p->screen, &csbi))
    127126        return -1;
    128127
    129128    dp->resize.allow = 1;
    130     cucul_set_canvas_size(dp->cv,
     129    caca_set_canvas_size(dp->cv,
    131130                          csbi.srWindow.Right - csbi.srWindow.Left + 1,
    132131                          csbi.srWindow.Bottom - csbi.srWindow.Top + 1);
    133     width = cucul_get_canvas_width(dp->cv);
    134     height = cucul_get_canvas_height(dp->cv);
     132    width = caca_get_canvas_width(dp->cv);
     133    height = caca_get_canvas_height(dp->cv);
    135134    dp->resize.allow = 0;
    136135
     
    181180
    182181    /* Fallback to a 6x10 font */
    183     return cucul_get_canvas_width(dp->cv) * 6;
     182    return caca_get_canvas_width(dp->cv) * 6;
    184183}
    185184
     
    189188
    190189    /* Fallback to a 6x10 font */
    191     return cucul_get_canvas_height(dp->cv) * 10;
     190    return caca_get_canvas_height(dp->cv) * 10;
    192191}
    193192
     
    197196    SMALL_RECT rect;
    198197    CHAR_INFO *buffer = dp->drv.p->buffer;
    199     uint32_t const *cvchars = (uint32_t const *)cucul_get_canvas_chars(dp->cv);
    200     uint32_t const *cvattrs = (uint32_t const *)cucul_get_canvas_attrs(dp->cv);
    201     int width = cucul_get_canvas_width(dp->cv);
    202     int height = cucul_get_canvas_height(dp->cv);
     198    uint32_t const *cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv);
     199    uint32_t const *cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv);
     200    int width = caca_get_canvas_width(dp->cv);
     201    int height = caca_get_canvas_height(dp->cv);
    203202    int n;
    204203
     
    207206    {
    208207        uint32_t ch = *cvchars++;
    209         uint8_t fg = cucul_attr_to_ansi_fg(*cvattrs);
    210         uint8_t bg = cucul_attr_to_ansi_bg(*cvattrs);
     208        uint8_t fg = caca_attr_to_ansi_fg(*cvattrs);
     209        uint8_t bg = caca_attr_to_ansi_bg(*cvattrs);
    211210
    212211#if 0
     
    216215            dp->drv.p->buffer[i].Char.AsciiChar = ' ';
    217216#else
    218         if(n && *cvchars == CUCUL_MAGIC_FULLWIDTH)
     217        if(n && *cvchars == CACA_MAGIC_FULLWIDTH)
    219218            ;
    220219        else if(ch > 0x00000020 && ch < 0x00010000)
     
    224223#endif
    225224
    226         buffer->Attributes = win32_fg_palette[fg < 0x10 ? fg : CUCUL_LIGHTGRAY]
    227                               | win32_bg_palette[bg < 0x10 ? bg : CUCUL_BLACK];
     225        buffer->Attributes = win32_fg_palette[fg < 0x10 ? fg : CACA_LIGHTGRAY]
     226                              | win32_bg_palette[bg < 0x10 ? bg : CACA_BLACK];
    228227        cvattrs++;
    229228        buffer++;
     
    247246{
    248247    /* FIXME: I don't know what to do here. */
    249     dp->resize.w = cucul_get_canvas_width(dp->cv);
    250     dp->resize.h = cucul_get_canvas_height(dp->cv);
     248    dp->resize.w = caca_get_canvas_width(dp->cv);
     249    dp->resize.h = caca_get_canvas_height(dp->cv);
    251250}
    252251
Note: See TracChangeset for help on using the changeset viewer.