slang.c (libcaca-0.99.beta19) | : | slang.c (libcaca-0.99.beta20.tar.bz2) | ||
---|---|---|---|---|
/* | /* | |||
* libcaca Colour ASCII-Art library | * libcaca Colour ASCII-Art library | |||
* Copyright (c) 2002-2012 Sam Hocevar <sam@hocevar.net> | * Copyright © 2002—2021 Sam Hocevar <sam@hocevar.net> | |||
* All Rights Reserved | * All Rights Reserved | |||
* | * | |||
* This library is free software. It comes without any warranty, to | * This library is free software. It comes without any warranty, to | |||
* the extent permitted by applicable law. You can redistribute it | * the extent permitted by applicable law. You can redistribute it | |||
* and/or modify it under the terms of the Do What the Fuck You Want | * and/or modify it under the terms of the Do What the Fuck You Want | |||
* to Public License, Version 2, as published by Sam Hocevar. See | * to Public License, Version 2, as published by Sam Hocevar. See | |||
* http://www.wtfpl.net/ for more details. | * http://www.wtfpl.net/ for more details. | |||
*/ | */ | |||
/* | /* | |||
* This file contains the libcaca SLang input and output driver | * This file contains the libcaca SLang input and output driver | |||
skipping to change at line 105 | skipping to change at line 105 | |||
123, 149, 158, 167, 176, 185, 194, 19, 125, 21, 30, 39, 48, 57, 66, 255, | 123, 149, 158, 167, 176, 185, 194, 19, 125, 21, 30, 39, 48, 57, 66, 255, | |||
}; | }; | |||
/* | /* | |||
* Local functions | * Local functions | |||
*/ | */ | |||
static void slang_init_palette(void); | static void slang_init_palette(void); | |||
static void slang_write_utf32(uint32_t); | static void slang_write_utf32(uint32_t); | |||
#if defined(HAVE_SIGNAL) | #if defined(HAVE_SIGNAL) | |||
static RETSIGTYPE sigwinch_handler(int); | static void sigwinch_handler(int); | |||
static caca_display_t *sigwinch_d; /* FIXME: we ought to get rid of this */ | static caca_display_t *sigwinch_d; /* FIXME: we ought to get rid of this */ | |||
#endif | #endif | |||
#if defined(HAVE_GETENV) && defined(HAVE_PUTENV) | #if defined(HAVE_GETENV) && defined(HAVE_PUTENV) | |||
static void slang_install_terminal(caca_display_t *); | static void slang_install_terminal(caca_display_t *); | |||
static void slang_uninstall_terminal(caca_display_t *); | static void slang_uninstall_terminal(caca_display_t *); | |||
#endif | #endif | |||
struct driver_private | struct driver_private | |||
{ | { | |||
char *term; | char *term; | |||
skipping to change at line 181 | skipping to change at line 181 | |||
slang_init_palette(); | slang_init_palette(); | |||
#if defined(VMS) || defined(REAL_UNIX_SYSTEM) | #if defined(VMS) || defined(REAL_UNIX_SYSTEM) | |||
/* Disable alt charset support so that we get a chance to have all | /* Disable alt charset support so that we get a chance to have all | |||
* 256 colour pairs */ | * 256 colour pairs */ | |||
SLtt_Has_Alt_Charset = 0; | SLtt_Has_Alt_Charset = 0; | |||
#endif | #endif | |||
#ifdef HAVE_SLSMG_UTF8_ENABLE | #ifdef HAVE_SLSMG_UTF8_ENABLE | |||
SLutf8_enable(-1); /* execute utf8 autodetection */ | ||||
SLsmg_utf8_enable(1); /* 1 == force, 0 == disable, -1 == autodetect */ | SLsmg_utf8_enable(1); /* 1 == force, 0 == disable, -1 == autodetect */ | |||
SLtt_utf8_enable(-1); | SLtt_utf8_enable(-1); | |||
#endif | #endif | |||
caca_add_dirty_rect(dp->cv, 0, 0, dp->cv->width, dp->cv->height); | caca_add_dirty_rect(dp->cv, 0, 0, dp->cv->width, dp->cv->height); | |||
dp->resize.allow = 1; | dp->resize.allow = 1; | |||
caca_set_canvas_size(dp->cv, SLtt_Screen_Cols, SLtt_Screen_Rows); | caca_set_canvas_size(dp->cv, SLtt_Screen_Cols, SLtt_Screen_Rows); | |||
dp->resize.allow = 0; | dp->resize.allow = 0; | |||
SLsig_unblock_signals(); | SLsig_unblock_signals(); | |||
skipping to change at line 538 | skipping to change at line 539 | |||
SLsmg_write_string(buf); | SLsmg_write_string(buf); | |||
#else | #else | |||
ascii = caca_utf32_to_ascii(ch); | ascii = caca_utf32_to_ascii(ch); | |||
SLsmg_write_char(ascii); | SLsmg_write_char(ascii); | |||
if(caca_utf32_is_fullwidth(ch)) | if(caca_utf32_is_fullwidth(ch)) | |||
SLsmg_write_char(ascii); | SLsmg_write_char(ascii); | |||
#endif | #endif | |||
} | } | |||
#if defined(HAVE_SIGNAL) | #if defined(HAVE_SIGNAL) | |||
static RETSIGTYPE sigwinch_handler(int sig) | static void sigwinch_handler(int sig) | |||
{ | { | |||
sigwinch_d->resize.resized = 1; | sigwinch_d->resize.resized = 1; | |||
signal(SIGWINCH, sigwinch_handler); | signal(SIGWINCH, sigwinch_handler); | |||
} | } | |||
#endif | #endif | |||
#if defined(HAVE_GETENV) && defined(HAVE_PUTENV) | #if defined(HAVE_GETENV) && defined(HAVE_PUTENV) | |||
static void slang_install_terminal(caca_display_t *dp) | static void slang_install_terminal(caca_display_t *dp) | |||
{ | { | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added |