Ignore:
Timestamp:
Mar 7, 2006, 10:17:35 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Polished the driver split a bit (still no events, except resize events), properly credited authors and documented a few things.
File:
1 edited

Legend:

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

    r539 r540  
    1010 */
    1111
    12 /** \file graphics.c
     12/** \file driver_slang.c
    1313 *  \version \$Id$
    1414 *  \author Sam Hocevar <sam@zoy.org>
    15  *  \brief Character drawing
     15 *  \brief SLang driver
    1616 *
    17  *  This file contains character and string drawing functions.
     17 *  This file contains the libcaca SLang input and output driver
    1818 */
    1919
    2020#include "config.h"
    21 
    22 #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
    23 #   include <inttypes.h>
    24 #else
    25 typedef unsigned int uint32_t;
    26 typedef unsigned char uint8_t;
    27 #endif
    2821
    2922#if defined(USE_SLANG)
     
    113106};
    114107
    115 int slang_init_graphics(caca_t *);
    116 int slang_end_graphics(caca_t *);
    117 int slang_set_window_title(caca_t *, char const *);
    118 unsigned int slang_get_window_width(caca_t *);
    119 unsigned int slang_get_window_height(caca_t *);
    120 void slang_display(caca_t *);
    121 void slang_handle_resize(caca_t *);
    122 
    123108/*
    124109 * Local functions
     
    131116#endif
    132117
    133 #if !defined(_DOXYGEN_SKIP_ME)
    134 int slang_init_graphics(caca_t *kk)
     118static int slang_init_graphics(caca_t *kk)
    135119{
    136120#if defined(HAVE_SIGNAL)
     
    146130    {
    147131        SLsig_unblock_signals();
    148         return NULL;
     132        return -1;
    149133    }
    150134
     
    154138    {
    155139        SLsig_unblock_signals();
    156         return NULL;
     140        return -1;
    157141    }
    158142
     
    180164}
    181165
    182 int slang_end_graphics(caca_t *kk)
     166static int slang_end_graphics(caca_t *kk)
    183167{
    184168    SLtt_set_mouse_mode(0, 0);
     
    189173    return 0;
    190174}
    191 #endif /* _DOXYGEN_SKIP_ME */
    192 
    193 int slang_set_window_title(caca_t *kk, char const *title)
    194 {
     175
     176static int slang_set_window_title(caca_t *kk, char const *title)
     177{
     178    /* FIXME */
    195179    return 0;
    196180}
    197181
    198 unsigned int slang_get_window_width(caca_t *kk)
     182static unsigned int slang_get_window_width(caca_t *kk)
    199183{
    200184    /* Fallback to a 6x10 font */
     
    202186}
    203187
    204 unsigned int slang_get_window_height(caca_t *kk)
     188static unsigned int slang_get_window_height(caca_t *kk)
    205189{
    206190    /* Fallback to a 6x10 font */
     
    208192}
    209193
    210 void slang_display(caca_t *kk)
     194static void slang_display(caca_t *kk)
    211195{
    212196    int x, y;
     
    251235}
    252236
     237static void slang_handle_resize(caca_t *kk, unsigned int *new_width,
     238                                            unsigned int *new_height)
     239{
     240    SLtt_get_screen_size();
     241    *new_width = SLtt_Screen_Cols;
     242    *new_height = SLtt_Screen_Rows;
     243
     244    if(*new_width != kk->qq->width || *new_height != kk->qq->height)
     245        SLsmg_reinit_smg();
     246}
     247
    253248/*
    254249 * XXX: following functions are local
    255250 */
    256 
    257 void slang_handle_resize(caca_t *kk)
    258 {
    259     unsigned int new_width, new_height;
    260 
    261     new_width = kk->qq->width;
    262     new_height = kk->qq->height;
    263 
    264     SLtt_get_screen_size();
    265     new_width = SLtt_Screen_Cols;
    266     new_height = SLtt_Screen_Rows;
    267 
    268     if(new_width != kk->qq->width || new_height != kk->qq->height)
    269         SLsmg_reinit_smg();
    270 }
    271251
    272252static void slang_init_palette(void)
Note: See TracChangeset for help on using the changeset viewer.