Explorar el Código

* Added a tiny Unicode test program. Of course it does not work yet, but

good to have something to start with.
tags/v0.99.beta14
Sam Hocevar sam hace 18 años
padre
commit
ce16433e89
Se han modificado 2 ficheros con 54 adiciones y 1 borrados
  1. +5
    -1
      test/Makefile.am
  2. +49
    -0
      test/unicode.c

+ 5
- 1
test/Makefile.am Ver fichero

@@ -1,6 +1,6 @@
# $Id$

noinst_PROGRAMS = colors demo dithering event hsv optipal spritedit
noinst_PROGRAMS = colors demo dithering event hsv optipal spritedit unicode

colors_SOURCES = colors.c
colors_LDADD = ../caca/libcaca.la ../cucul/libcucul.la @CACA_LIBS@
@@ -30,3 +30,7 @@ spritedit_SOURCES = spritedit.c
spritedit_LDADD = ../caca/libcaca.la ../cucul/libcucul.la @CACA_LIBS@
spritedit_CPPFLAGS = -I$(top_srcdir)/cucul -I$(top_srcdir)/caca

unicode_SOURCES = unicode.c
unicode_LDADD = ../caca/libcaca.la ../cucul/libcucul.la @CACA_LIBS@
unicode_CPPFLAGS = -I$(top_srcdir)/cucul -I$(top_srcdir)/caca


+ 49
- 0
test/unicode.c Ver fichero

@@ -0,0 +1,49 @@
/*
* unicode libcaca Unicode rendering test program
* Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
* All Rights Reserved
*
* $Id$
*
* This program is free software; you can redistribute it 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
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/

#include "config.h"

#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#else
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#endif

#include "cucul.h"
#include "caca.h"

int main(void)
{
cucul_t *qq;
caca_t *kk;

qq = cucul_init();
kk = caca_attach(qq);

cucul_putstr(qq, 1, 1, "This is ASCII: [ abc DEF 123 !@# ]");
cucul_putstr(qq, 1, 2, "This is Unicode: [ äβç ΔЗҒ ░▒▓ ♩♔✈ ]");

cucul_putstr(qq, 1, 4, "If the two lines do not have the same length, there is a bug somewhere.");

caca_display(kk);

while(!caca_get_event(kk, CACA_EVENT_KEY_PRESS));

caca_detach(kk);
cucul_end(qq);

return 0;
}


Cargando…
Cancelar
Guardar