Changeset 2303


Ignore:
Timestamp:
Apr 19, 2008, 9:25:41 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Changed most of the long ints in the API into C99 types. WARNING: this completely breaks compatibility with previous versions of libcaca on 64-bit systems.
Location:
libcaca/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r2300 r2303  
    8282        struct { unsigned int x, y, button; } mouse;
    8383        struct { unsigned int w, h; } resize;
    84         struct { unsigned int ch; unsigned long int utf32; char utf8[8]; } key;
     84        struct { unsigned int ch; uint32_t utf32; char utf8[8]; } key;
    8585    } data;
    8686    uint8_t padding[16];
     
    193193__extern enum caca_event_type caca_get_event_type(caca_event_t const *);
    194194__extern unsigned int caca_get_event_key_ch(caca_event_t const *);
    195 __extern unsigned long int caca_get_event_key_utf32(caca_event_t const *);
     195__extern uint32_t caca_get_event_key_utf32(caca_event_t const *);
    196196__extern int caca_get_event_key_utf8(caca_event_t const *, char *);
    197197__extern unsigned int caca_get_event_mouse_button(caca_event_t const *);
  • libcaca/trunk/caca/driver_gl.c

    r2300 r2303  
    6969    float font_width, font_height;
    7070    float incx, incy;
    71     unsigned long int const *blocks;
     71    uint32_t const *blocks;
    7272    int *txid;
    7373    uint8_t close;
  • libcaca/trunk/caca/event.c

    r2299 r2303  
    216216 *  \return The key's Unicode value.
    217217 */
    218 unsigned long int caca_get_event_key_utf32(caca_event_t const *ev)
     218uint32_t caca_get_event_key_utf32(caca_event_t const *ev)
    219219{
    220220    return ((caca_privevent_t const *)ev)->data.key.utf32;
  • libcaca/trunk/cucul/attr.c

    r2300 r2303  
    6666 *  \return The requested attribute.
    6767 */
    68 unsigned long int cucul_get_attr(cucul_canvas_t const *cv, int x, int y)
     68uint32_t cucul_get_attr(cucul_canvas_t const *cv, int x, int y)
    6969{
    7070    if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height)
    71         return (unsigned long int)cv->curattr;
    72 
    73     return (unsigned long int)cv->attrs[x + y * cv->width];
     71        return cv->curattr;
     72
     73    return cv->attrs[x + y * cv->width];
    7474}
    7575
     
    9191 *  To retrieve the current attribute value, use cucul_get_attr(-1,-1).
    9292 *
    93  *  If an error occurs, -1 is returned and \b errno is set accordingly:
    94  *  - \c EINVAL The attribute value is out of the 32-bit range.
     93 *  This function never fails.
    9594 *
    9695 *  \param cv A handle to the libcucul canvas.
    9796 *  \param attr The requested attribute value.
    98  *  \return 0 in case of success, -1 if an error occurred.
    99  */
    100 int cucul_set_attr(cucul_canvas_t *cv, unsigned long int attr)
    101 {
    102     if(sizeof(unsigned long int) > sizeof(uint32_t) && attr > 0xffffffff)
    103     {
    104         seterrno(EINVAL);
    105         return -1;
    106     }
    107 
     97 *  \return This function always returns 0.
     98 */
     99int cucul_set_attr(cucul_canvas_t *cv, uint32_t attr)
     100{
    108101    if(attr < 0x00000010)
    109102        attr = (cv->curattr & 0xfffffff0) | attr;
     
    127120 *    setting the attribute does not modify the current colour information.
    128121 *
    129  *  If an error occurs, -1 is returned and \b errno is set accordingly:
    130  *  - \c EINVAL The attribute value is out of the 32-bit range.
     122 *  This function never fails.
    131123 *
    132124 *  \param cv A handle to the libcucul canvas.
     
    134126 *  \param y Y coordinate.
    135127 *  \param attr The requested attribute value.
    136  *  \return 0 in case of success, -1 if an error occurred.
    137  */
    138 int cucul_put_attr(cucul_canvas_t *cv, int x, int y, unsigned long int attr)
     128 *  \return This function always returns 0.
     129 */
     130int cucul_put_attr(cucul_canvas_t *cv, int x, int y, uint32_t attr)
    139131{
    140132    uint32_t *curattr, *curchar;
    141 
    142     if(sizeof(unsigned long int) > sizeof(uint32_t) && attr > 0xffffffff)
    143     {
    144         seterrno(EINVAL);
    145         return -1;
    146     }
    147133
    148134    if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height)
     
    208194 *  white with 50% alpha (A=8 R=15 G=15 B=15).
    209195 *
    210  *  If an error occurs, 0 is returned and \b errno is set accordingly:
    211  *  - \c EINVAL At least one of the colour values is invalid.
     196 *  This function never fails.
    212197 *
    213198 *  \param cv A handle to the libcucul canvas.
    214199 *  \param fg The requested ARGB foreground colour.
    215200 *  \param bg The requested ARGB background colour.
    216  *  \return 0 in case of success, -1 if an error occurred.
    217  */
    218 int cucul_set_color_argb(cucul_canvas_t *cv, unsigned int fg, unsigned int bg)
     201 *  \return This function always returns 0.
     202 */
     203int cucul_set_color_argb(cucul_canvas_t *cv, uint16_t fg, uint16_t bg)
    219204{
    220205    uint32_t attr;
    221 
    222     if(fg > 0xffff || bg > 0xffff)
    223     {
    224         seterrno(EINVAL);
    225         return -1;
    226     }
    227206
    228207    if(fg < 0x100)
     
    258237 *  \return The corresponding DOS ANSI value.
    259238 */
    260 uint8_t cucul_attr_to_ansi(unsigned long int attr)
     239uint8_t cucul_attr_to_ansi(uint32_t attr)
    261240{
    262241    uint8_t fg = nearest_ansi((attr >> 4) & 0x3fff);
     
    282261 *  \return The corresponding ANSI foreground value.
    283262 */
    284 uint8_t cucul_attr_to_ansi_fg(unsigned long int attr)
     263uint8_t cucul_attr_to_ansi_fg(uint32_t attr)
    285264{
    286265    return nearest_ansi(((uint16_t)attr >> 4) & 0x3fff);
     
    302281 *  \return The corresponding ANSI background value.
    303282 */
    304 uint8_t cucul_attr_to_ansi_bg(unsigned long int attr)
     283uint8_t cucul_attr_to_ansi_bg(uint32_t attr)
    305284{
    306285    return nearest_ansi(attr >> 18);
     
    322301 *  \return The corresponding 12-bit RGB foreground value.
    323302 */
    324 unsigned int cucul_attr_to_rgb12_fg(unsigned long int attr)
     303uint16_t cucul_attr_to_rgb12_fg(uint32_t attr)
    325304{
    326305    uint16_t fg = (attr >> 4) & 0x3fff;
     
    353332 *  \return The corresponding 12-bit RGB background value.
    354333 */
    355 unsigned int cucul_attr_to_rgb12_bg(unsigned long int attr)
     334uint16_t cucul_attr_to_rgb12_bg(uint32_t attr)
    356335{
    357336    uint16_t bg = attr >> 18;
     
    388367 *  \param argb An array of 8-bit integers.
    389368 */
    390 void cucul_attr_to_argb64(unsigned long int attr, uint8_t argb[8])
     369void cucul_attr_to_argb64(uint32_t attr, uint8_t argb[8])
    391370{
    392371    uint16_t fg = (attr >> 4) & 0x3fff;
  • libcaca/trunk/cucul/box.c

    r2299 r2303  
    3939 */
    4040int cucul_draw_box(cucul_canvas_t *cv, int x1, int y1, int w, int h,
    41                    unsigned long int ch)
     41                   uint32_t ch)
    4242{
    4343    int x2 = x1 + w - 1;
     
    189189 */
    190190int cucul_fill_box(cucul_canvas_t *cv, int x1, int y1, int w, int h,
    191                    unsigned long int ch)
     191                   uint32_t ch)
    192192{
    193193    int x, y, xmax, ymax;
  • libcaca/trunk/cucul/canvas.c

    r2299 r2303  
    110110 *  \return This function always returns 0.
    111111 */
    112 int cucul_put_char(cucul_canvas_t *cv, int x, int y, unsigned long int ch)
     112int cucul_put_char(cucul_canvas_t *cv, int x, int y, uint32_t ch)
    113113{
    114114    uint32_t *curchar, *curattr, attr;
     
    192192 *  \return This function always returns 0.
    193193 */
    194 unsigned long int cucul_get_char(cucul_canvas_t const *cv, int x, int y)
     194uint32_t cucul_get_char(cucul_canvas_t const *cv, int x, int y)
    195195{
    196196    if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height)
    197197        return ' ';
    198198
    199     return (unsigned long int)cv->chars[x + y * cv->width];
     199    return cv->chars[x + y * cv->width];
    200200}
    201201
  • libcaca/trunk/cucul/charset.c

    r2300 r2303  
    112112 *  is incomplete.
    113113 */
    114 unsigned long int cucul_utf8_to_utf32(char const *s, unsigned int *read)
     114uint32_t cucul_utf8_to_utf32(char const *s, unsigned int *read)
    115115{
    116116    unsigned int bytes = trailing[(int)(unsigned char)*s];
     
    151151 *  \return The number of bytes written.
    152152 */
    153 unsigned int cucul_utf32_to_utf8(char *buf, unsigned long int ch)
     153unsigned int cucul_utf32_to_utf8(char *buf, uint32_t ch)
    154154{
    155155    static const uint8_t mark[7] =
     
    191191 *  \return The corresponding CP437 character, or "?" if not representable.
    192192 */
    193 uint8_t cucul_utf32_to_cp437(unsigned long int ch)
     193uint8_t cucul_utf32_to_cp437(uint32_t ch)
    194194{
    195195    unsigned int i;
     
    223223 *  \return The corresponding UTF-32 character, or zero if not representable.
    224224 */
    225 unsigned long int cucul_cp437_to_utf32(uint8_t ch)
     225uint32_t cucul_cp437_to_utf32(uint8_t ch)
    226226{
    227227    if(ch > 0x7f)
     
    249249 *  equivalent if found, or "?" if not representable.
    250250 */
    251 char cucul_utf32_to_ascii(unsigned long int ch)
     251char cucul_utf32_to_ascii(uint32_t ch)
    252252{
    253253    /* Standard ASCII */
     
    388388 *  \return 1 if the character is fullwidth, 0 otherwise.
    389389 */
    390 int cucul_utf32_is_fullwidth(unsigned long int ch)
     390int cucul_utf32_is_fullwidth(uint32_t ch)
    391391{
    392392    if(ch < 0x2e80) /* Standard stuff */
  • libcaca/trunk/cucul/conic.c

    r2299 r2303  
    4040 *  \return This function always returns 0.
    4141 */
    42 int cucul_draw_circle(cucul_canvas_t *cv, int x, int y, int r,
    43                       unsigned long int ch)
     42int cucul_draw_circle(cucul_canvas_t *cv, int x, int y, int r, uint32_t ch)
    4443{
    4544    int test, dx, dy;
     
    7069 */
    7170int cucul_fill_ellipse(cucul_canvas_t *cv, int xo, int yo, int a, int b,
    72                        unsigned long int ch)
     71                       uint32_t ch)
    7372{
    7473    int d2;
     
    130129 */
    131130int cucul_draw_ellipse(cucul_canvas_t *cv, int xo, int yo, int a, int b,
    132                        unsigned long int ch)
     131                       uint32_t ch)
    133132{
    134133    int d2;
  • libcaca/trunk/cucul/cucul.h

    r2300 r2303  
    111111__extern int cucul_get_cursor_x(cucul_canvas_t const *);
    112112__extern int cucul_get_cursor_y(cucul_canvas_t const *);
    113 __extern int cucul_put_char(cucul_canvas_t *, int, int, unsigned long int);
    114 __extern unsigned long int cucul_get_char(cucul_canvas_t const *, int, int);
     113__extern int cucul_put_char(cucul_canvas_t *, int, int, uint32_t);
     114__extern uint32_t cucul_get_char(cucul_canvas_t const *, int, int);
    115115__extern int cucul_put_str(cucul_canvas_t *, int, int, char const *);
    116 __extern unsigned long int cucul_get_attr(cucul_canvas_t const *, int, int);
    117 __extern int cucul_set_attr(cucul_canvas_t *, unsigned long int);
    118 __extern int cucul_put_attr(cucul_canvas_t *, int, int, unsigned long int);
     116__extern uint32_t cucul_get_attr(cucul_canvas_t const *, int, int);
     117__extern int cucul_set_attr(cucul_canvas_t *, uint32_t);
     118__extern int cucul_put_attr(cucul_canvas_t *, int, int, uint32_t);
    119119__extern int cucul_set_color_ansi(cucul_canvas_t *, uint8_t, uint8_t);
    120 __extern int cucul_set_color_argb(cucul_canvas_t *, unsigned int,
    121                                   unsigned int);
     120__extern int cucul_set_color_argb(cucul_canvas_t *, uint16_t, uint16_t);
    122121__extern int cucul_printf(cucul_canvas_t *, int, int, char const *, ...);
    123122__extern int cucul_clear_canvas(cucul_canvas_t *);
     
    151150 *
    152151 *  @{ */
    153 __extern uint8_t cucul_attr_to_ansi(unsigned long int);
    154 __extern uint8_t cucul_attr_to_ansi_fg(unsigned long int);
    155 __extern uint8_t cucul_attr_to_ansi_bg(unsigned long int);
    156 __extern unsigned int cucul_attr_to_rgb12_fg(unsigned long int);
    157 __extern unsigned int cucul_attr_to_rgb12_bg(unsigned long int);
    158 __extern void cucul_attr_to_argb64(unsigned long int, uint8_t[8]);
     152__extern uint8_t cucul_attr_to_ansi(uint32_t);
     153__extern uint8_t cucul_attr_to_ansi_fg(uint32_t);
     154__extern uint8_t cucul_attr_to_ansi_bg(uint32_t);
     155__extern uint16_t cucul_attr_to_rgb12_fg(uint32_t);
     156__extern uint16_t cucul_attr_to_rgb12_bg(uint32_t);
     157__extern void cucul_attr_to_argb64(uint32_t, uint8_t[8]);
    159158/*  @} */
    160159
     
    164163 *
    165164 *  @{ */
    166 __extern unsigned long int cucul_utf8_to_utf32(char const *, unsigned int *);
    167 __extern unsigned int cucul_utf32_to_utf8(char *, unsigned long int);
    168 __extern uint8_t cucul_utf32_to_cp437(unsigned long int);
    169 __extern unsigned long int cucul_cp437_to_utf32(uint8_t);
    170 __extern char cucul_utf32_to_ascii(unsigned long int);
    171 __extern int cucul_utf32_is_fullwidth(unsigned long int);
     165__extern uint32_t cucul_utf8_to_utf32(char const *, unsigned int *);
     166__extern unsigned int cucul_utf32_to_utf8(char *, uint32_t);
     167__extern uint8_t cucul_utf32_to_cp437(uint32_t);
     168__extern uint32_t cucul_cp437_to_utf32(uint8_t);
     169__extern char cucul_utf32_to_ascii(uint32_t);
     170__extern int cucul_utf32_is_fullwidth(uint32_t);
    172171/*  @} */
    173172
     
    178177 *
    179178 *  @{ */
    180 __extern int cucul_draw_line(cucul_canvas_t *, int, int, int, int,
    181                              unsigned long int);
     179__extern int cucul_draw_line(cucul_canvas_t *, int, int, int, int, uint32_t);
    182180__extern int cucul_draw_polyline(cucul_canvas_t *, int const x[],
    183                                  int const y[], int, unsigned long int);
     181                                 int const y[], int, uint32_t);
    184182__extern int cucul_draw_thin_line(cucul_canvas_t *, int, int, int, int);
    185183__extern int cucul_draw_thin_polyline(cucul_canvas_t *, int const x[],
    186184                                      int const y[], int);
    187185
    188 __extern int cucul_draw_circle(cucul_canvas_t *, int, int, int,
    189                                unsigned long int);
    190 __extern int cucul_draw_ellipse(cucul_canvas_t *, int, int, int, int,
    191                                 unsigned long int);
     186__extern int cucul_draw_circle(cucul_canvas_t *, int, int, int, uint32_t);
     187__extern int cucul_draw_ellipse(cucul_canvas_t *, int, int, int, int, uint32_t);
    192188__extern int cucul_draw_thin_ellipse(cucul_canvas_t *, int, int, int, int);
    193 __extern int cucul_fill_ellipse(cucul_canvas_t *, int, int, int, int,
    194                                 unsigned long int);
    195 
    196 __extern int cucul_draw_box(cucul_canvas_t *, int, int, int, int,
    197                             unsigned long int);
     189__extern int cucul_fill_ellipse(cucul_canvas_t *, int, int, int, int, uint32_t);
     190
     191__extern int cucul_draw_box(cucul_canvas_t *, int, int, int, int, uint32_t);
    198192__extern int cucul_draw_thin_box(cucul_canvas_t *, int, int, int, int);
    199193__extern int cucul_draw_cp437_box(cucul_canvas_t *, int, int, int, int);
    200 __extern int cucul_fill_box(cucul_canvas_t *, int, int, int, int,
    201                             unsigned long int);
     194__extern int cucul_fill_box(cucul_canvas_t *, int, int, int, int, uint32_t);
    202195
    203196__extern int cucul_draw_triangle(cucul_canvas_t *, int, int, int, int, int,
    204                                  int, unsigned long int);
     197                                 int, uint32_t);
    205198__extern int cucul_draw_thin_triangle(cucul_canvas_t *, int, int, int, int,
    206199                                      int, int);
    207200__extern int cucul_fill_triangle(cucul_canvas_t *, int, int, int, int, int,
    208                                  int, unsigned long int);
     201                                 int, uint32_t);
    209202/*  @} */
    210203
     
    231224__extern cucul_dither_t *cucul_create_dither(unsigned int, unsigned int,
    232225                                             unsigned int, unsigned int,
    233                                              unsigned long int,
    234                                              unsigned long int,
    235                                              unsigned long int,
    236                                              unsigned long int);
     226                                             uint32_t, uint32_t,
     227                                             uint32_t, uint32_t);
    237228__extern int cucul_set_dither_palette(cucul_dither_t *,
    238229                                      unsigned int r[], unsigned int g[],
     
    275266__extern unsigned int cucul_get_font_width(cucul_font_t const *);
    276267__extern unsigned int cucul_get_font_height(cucul_font_t const *);
    277 __extern unsigned long int const *cucul_get_font_blocks(cucul_font_t const *);
     268__extern unsigned int const *cucul_get_font_blocks(cucul_font_t const *);
    278269__extern int cucul_render_canvas(cucul_canvas_t const *, cucul_font_t const *,
    279270                                 void *, unsigned int, unsigned int,
     
    288279 *  @{ */
    289280__extern int cucul_canvas_set_figfont(cucul_canvas_t *, char const *);
    290 __extern int cucul_put_figchar(cucul_canvas_t *, unsigned long int);
     281__extern int cucul_put_figchar(cucul_canvas_t *, uint32_t);
    291282/*  @} */
    292283
  • libcaca/trunk/cucul/dither.c

    r2300 r2303  
    170170 * Local prototypes
    171171 */
    172 static void mask2shift(unsigned long int, int *, int *);
     172static void mask2shift(uint32_t, int *, int *);
    173173static float gammapow(float x, float y);
    174174
     
    263263cucul_dither_t *cucul_create_dither(unsigned int bpp, unsigned int w,
    264264                                    unsigned int h, unsigned int pitch,
    265                                     unsigned long int rmask,
    266                                     unsigned long int gmask,
    267                                     unsigned long int bmask,
    268                                     unsigned long int amask)
     265                                    uint32_t rmask, uint32_t gmask,
     266                                    uint32_t bmask, uint32_t amask)
    269267{
    270268    cucul_dither_t *d;
     
    12141212
    12151213/* Convert a mask, eg. 0x0000ff00, to shift values, eg. 8 and -4. */
    1216 static void mask2shift(unsigned long int mask, int *right, int *left)
     1214static void mask2shift(uint32_t mask, int *right, int *left)
    12171215{
    12181216    int rshift = 0, lshift = 0;
  • libcaca/trunk/cucul/figfont.c

    r2299 r2303  
    3939    enum { H_DEFAULT, H_KERN, H_SMUSH, H_NONE, H_OVERLAP } hmode;
    4040    unsigned int hsmushrule;
    41     unsigned long int hardblank;
     41    uint32_t hardblank;
    4242    unsigned int height, baseline, max_length;
    4343    int old_layout;
     
    128128}
    129129
    130 int cucul_put_figchar(cucul_canvas_t *cv, unsigned long int ch)
     130int cucul_put_figchar(cucul_canvas_t *cv, uint32_t ch)
    131131{
    132132    cucul_figfont_t *ff = cv->ff;
     
    451451    for(j = 0; j < ff->height * ff->glyphs; j++)
    452452    {
    453         unsigned long int ch, oldch = 0;
     453        uint32_t ch, oldch = 0;
    454454
    455455        for(i = ff->max_length; i--;)
  • libcaca/trunk/cucul/font.c

    r2299 r2303  
    6161
    6262    struct block_info *block_list;
    63     unsigned long int *user_block_list;
     63    uint32_t *user_block_list;
    6464    struct glyph_info *glyph_list;
    6565    uint8_t *font_data;
     
    187187
    188188    f->user_block_list = malloc((f->header.blocks + 1)
    189                                   * 2 * sizeof(unsigned long int));
     189                                  * 2 * sizeof(uint32_t));
    190190    if(!f->user_block_list)
    191191    {
     
    365365 *  \return The list of Unicode blocks supported by the font.
    366366 */
    367 unsigned long int const *cucul_get_font_blocks(cucul_font_t const *f)
    368 {
    369     return (unsigned long int const *)f->user_block_list;
     367uint32_t const *cucul_get_font_blocks(cucul_font_t const *f)
     368{
     369    return (uint32_t const *)f->user_block_list;
    370370}
    371371
  • libcaca/trunk/cucul/line.c

    r2299 r2303  
    5555 */
    5656int cucul_draw_line(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    57                     unsigned long int ch)
     57                    uint32_t ch)
    5858{
    5959    struct line s;
     
    8686 */
    8787int cucul_draw_polyline(cucul_canvas_t *cv, int const x[], int const y[],
    88                         int n, unsigned long int ch)
     88                        int n, uint32_t ch)
    8989{
    9090    int i;
  • libcaca/trunk/cucul/triangle.c

    r2299 r2303  
    4141 */
    4242int cucul_draw_triangle(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    43                         int x3, int y3, unsigned long int ch)
     43                        int x3, int y3, uint32_t ch)
    4444{
    4545    cucul_draw_line(cv, x1, y1, x2, y2, ch);
     
    8888 */
    8989int cucul_fill_triangle(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    90                         int x3, int y3, unsigned long int ch)
     90                        int x3, int y3, uint32_t ch)
    9191{
    9292    int x, y, xmin, xmax, ymin, ymax;
  • libcaca/trunk/cxx/cucul++.cpp

    r2074 r2303  
    2626
    2727
    28 unsigned long int Charset::utf8ToUtf32(char const *s, unsigned int *read)
     28uint32_t Charset::utf8ToUtf32(char const *s, unsigned int *read)
    2929{
    3030    return cucul_utf8_to_utf32(s, read);
    3131}
    32 unsigned int Charset::utf32ToUtf8(char *buf, unsigned long int ch)
     32unsigned int Charset::utf32ToUtf8(char *buf, uint32_t ch)
    3333{
    3434    return cucul_utf32_to_utf8(buf, ch);
    3535}
    36 unsigned char Charset::utf32ToCp437(unsigned long int ch)
     36uint8_t Charset::utf32ToCp437(uint32_t ch)
    3737{
    3838    return cucul_utf32_to_cp437(ch);
    3939}
    40 unsigned long int Charset::cp437ToUtf32(unsigned char ch)
     40uint32_t Charset::cp437ToUtf32(uint8_t ch)
    4141{
    4242    return cucul_cp437_to_utf32(ch);
     
    8383}
    8484
    85 int Cucul::setColorANSI(unsigned char f, unsigned char b)
     85int Cucul::setColorANSI(uint8_t f, uint8_t b)
    8686{
    8787    return cucul_set_color_ansi(cv, f, b);
     
    9393}
    9494
    95 void Cucul::putChar(int x, int y, unsigned long int ch)
     95void Cucul::putChar(int x, int y, uint32_t ch)
    9696{
    9797    cucul_put_char(cv, x, y, ch);
    9898}
    9999
    100 unsigned long int Cucul::getChar(int x, int y)
     100uint32_t Cucul::getChar(int x, int y)
    101101{
    102102    return cucul_get_char(cv, x, y);
     
    157157}
    158158
    159 void Cucul::drawLine(int x1, int y1, int x2, int y2, unsigned long int ch)
     159void Cucul::drawLine(int x1, int y1, int x2, int y2, uint32_t ch)
    160160{
    161161    cucul_draw_line(cv, x1, y1, x2, y2, ch);
    162162}
    163163
    164 void Cucul::drawPolyline(int const x[], int const y[], int f, unsigned long int ch)
     164void Cucul::drawPolyline(int const x[], int const y[], int f, uint32_t ch)
    165165{
    166166    cucul_draw_polyline(cv, x, y, f, ch);
     
    177177}
    178178
    179 void Cucul::drawCircle(int x, int y, int d, unsigned long int ch)
     179void Cucul::drawCircle(int x, int y, int d, uint32_t ch)
    180180{
    181181    cucul_draw_circle(cv, x, y, d, ch);
    182182}
    183183
    184 void Cucul::drawEllipse(int x, int y, int d1, int d2, unsigned long int ch)
     184void Cucul::drawEllipse(int x, int y, int d1, int d2, uint32_t ch)
    185185{
    186186    cucul_draw_ellipse(cv, x, y, d1, d2, ch);
     
    192192}
    193193
    194 void Cucul::fillEllipse(int x, int y, int d1, int d2, unsigned long int ch)
     194void Cucul::fillEllipse(int x, int y, int d1, int d2, uint32_t ch)
    195195{
    196196    cucul_fill_ellipse(cv, x, y, d1, d2, ch);
    197197}
    198198
    199 void Cucul::drawBox(int x, int y, int w, int h, unsigned long int ch)
     199void Cucul::drawBox(int x, int y, int w, int h, uint32_t ch)
    200200{
    201201    cucul_draw_box(cv, x, y, w, h, ch);
     
    212212}
    213213
    214 void Cucul::fillBox(int x, int y, int w, int h, unsigned long int ch)
     214void Cucul::fillBox(int x, int y, int w, int h, uint32_t ch)
    215215{
    216216    cucul_fill_box(cv, x, y, w, h, ch);
    217217}
    218218
    219 void Cucul::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, unsigned long int ch)
     219void Cucul::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)
    220220{
    221221    cucul_draw_triangle(cv, x1, y1, x2, y2, x3, y3, ch);
     
    227227}
    228228
    229 void Cucul::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, unsigned long int ch)
     229void Cucul::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)
    230230{
    231231    cucul_fill_triangle(cv, x1, y1, x2, y2, x3, y3, ch);
     
    242242}
    243243
    244 int Cucul::setAttr(unsigned long int attr)
     244int Cucul::setAttr(uint32_t attr)
    245245{
    246246    return cucul_set_attr(cv, attr);
    247247}
    248248
    249 unsigned long int Cucul::getAttr(int x, int y)
     249uint32_t Cucul::getAttr(int x, int y)
    250250{
    251251    return cucul_get_attr(cv, x, y);
     
    395395}
    396396
    397 void Font::renderCanvas(Cucul *cv, unsigned char *buf, unsigned int x, unsigned int y, unsigned int w)
     397void Font::renderCanvas(Cucul *cv, uint8_t *buf, unsigned int x, unsigned int y, unsigned int w)
    398398{
    399399    cucul_render_canvas(cv->get_cucul_canvas_t(), font, buf, x, y, w);
    400400}
    401401
    402 unsigned long int const *Font::getBlocks()
     402uint32_t const *Font::getBlocks()
    403403{
    404404    return cucul_get_font_blocks(font);
  • libcaca/trunk/cxx/cucul++.h

    r2074 r2303  
    3939{
    4040 public:
    41     unsigned long int utf8ToUtf32(char const *, unsigned int *);
    42     unsigned int utf32ToUtf8(char *, unsigned long int);
    43     unsigned char utf32ToCp437(unsigned long int);
    44     unsigned long int cp437ToUtf32(unsigned char);
     41    uint32_t utf8ToUtf32(char const *, unsigned int *);
     42    unsigned int utf32ToUtf8(char *, uint32_t);
     43    uint8_t utf32ToCp437(uint32_t);
     44    uint32_t cp437ToUtf32(uint8_t);
    4545};
    4646
     
    5454    unsigned int getWidth();
    5555    unsigned int getHeight();
    56     void renderCanvas(Cucul *, unsigned char *, unsigned int,
     56    void renderCanvas(Cucul *, uint8_t *, unsigned int,
    5757                               unsigned int, unsigned int);
    58     unsigned long int const *getBlocks();
     58    uint32_t const *getBlocks();
    5959
    6060 private:
     
    101101    unsigned int getWidth(void);
    102102    unsigned int getHeight(void);
    103     unsigned long int getAttr(int, int);
    104     int setAttr(unsigned long int);
    105     int setColorANSI(unsigned char f, unsigned char b);
     103    uint32_t getAttr(int, int);
     104    int setAttr(uint32_t);
     105    int setColorANSI(uint8_t f, uint8_t b);
    106106    int setColorARGB(unsigned int f, unsigned int b);
    107107    void Printf(int x, int y , char const * format, ...);
    108     void putChar(int x, int y, unsigned long int ch);
    109     unsigned long int getChar(int, int);
     108    void putChar(int x, int y, uint32_t ch);
     109    uint32_t getChar(int, int);
    110110    void putStr(int x, int y, char *str);
    111111    void Clear(void);
     
    115115    void Flop();
    116116    void Rotate();
    117     void drawLine(int, int, int, int, unsigned long int);
    118     void drawPolyline(int const x[], int const y[], int, unsigned long int);
     117    void drawLine(int, int, int, int, uint32_t);
     118    void drawPolyline(int const x[], int const y[], int, uint32_t);
    119119    void drawThinLine(int, int, int, int);
    120120    void drawThinPolyline(int const x[], int const y[], int);
    121     void drawCircle(int, int, int, unsigned long int);
    122     void drawEllipse(int, int, int, int, unsigned long int);
     121    void drawCircle(int, int, int, uint32_t);
     122    void drawEllipse(int, int, int, int, uint32_t);
    123123    void drawThinEllipse(int, int, int, int);
    124     void fillEllipse(int, int, int, int, unsigned long int);
    125     void drawBox(int, int, int, int, unsigned long int);
     124    void fillEllipse(int, int, int, int, uint32_t);
     125    void drawBox(int, int, int, int, uint32_t);
    126126    void drawThinBox(int, int, int, int);
    127127    void drawCP437Box(int, int, int, int);
    128     void fillBox(int, int, int, int, unsigned long int);
    129     void drawTriangle(int, int, int, int, int, int, unsigned long int);
     128    void fillBox(int, int, int, int, uint32_t);
     129    void drawTriangle(int, int, int, int, int, int, uint32_t);
    130130    void drawThinTriangle(int, int, int, int, int, int);
    131     void fillTriangle(int, int, int, int, int, int, unsigned long int);
     131    void fillTriangle(int, int, int, int, int, int, uint32_t);
    132132    int setBoundaries(cucul_canvas_t *, int, int, unsigned int, unsigned int);
    133133    unsigned int getFrameCount();
  • libcaca/trunk/ruby/cucul-font.c

    r1995 r2303  
    7272{
    7373    VALUE ary;
    74     unsigned long int const *list;
     74    uint32_t const *list;
    7575   
    7676    list = cucul_get_font_blocks(_SELF);
Note: See TracChangeset for help on using the changeset viewer.