diff --git a/Makefile b/Makefile
index 7826dce..3083c66 100644
--- a/Makefile
+++ b/Makefile
@@ -75,6 +75,9 @@ debug:
${MAKE} -C c3s debug
${MAKE} -C test debug
+demo: build
+ ${MAKE} -C libc3/window demo
+
dist: c3-${C3_VERSION}.tar.gz
c3-${C3_VERSION}.tar.gz:
@@ -101,6 +104,9 @@ gcovr:
${MAKE} -C test gcovr
if [ -d "$$HOME/Downloads/c3_gcovr" ]; then bin/gcovr-to-downloads; fi
+gdb_demo: debug
+ ${MAKE} -C libc3/window gdb_demo
+
gdb_ic3: debug
${MAKE} -C ic3 gdb_ic3
@@ -181,7 +187,29 @@ test_libc3_cov: cov
test_libc3_debug: debug
${MAKE} -C test test_libc3_debug
-.PHONY: all asan c3s cov clean clean_cov debug gcovr ic3 install libc3 libtommath libffi license test test_asan test_cov test_debug test_gcovr test_ic3
+.PHONY: \
+ all \
+ asan \
+ c3s \
+ cov \
+ clean \
+ clean_cov \
+ debug \
+ demo \
+ dist \
+ gcovr \
+ ic3 \
+ install \
+ libc3 \
+ libtommath \
+ libffi \
+ license \
+ test \
+ test_asan \
+ test_cov \
+ test_debug \
+ test_gcovr \
+ test_ic3
include config.mk
include sources.mk
diff --git a/configure b/configure
index e7eae28..4b24c57 100755
--- a/configure
+++ b/configure
@@ -40,8 +40,6 @@ update_config_mk
( cd ucd2c && ./configure; )
( cd libc3 && ./configure; )
( cd libc3/window && ./configure; )
-( cd libc3/window/cairo/xcb && ./configure; )
-( cd libc3/window/cairo/xcb/demo && ./configure; )
( cd ic3 && ./configure; )
( cd c3s && ./configure; )
( cd test && ./configure; )
diff --git a/libc3/c3.c b/libc3/c3.c
index e8ac271..7f45d23 100644
--- a/libc3/c3.c
+++ b/libc3/c3.c
@@ -25,6 +25,7 @@ const s_str g_c3_base_decimal = {{NULL}, 10, {"0123456789"}};
const s_str g_c3_base_hexadecimal = {{NULL}, 16, {"0123456789abcdef"}};
const s_str g_c3_bases_hexadecimal[2] = {{{NULL}, 16, {"0123456789abcdef"}},
{{NULL}, 16, {"0123456789ABCDEF"}}};
+sw g_c3_exit_code = 1;
void c3_break (void)
{
diff --git a/libc3/c3.h b/libc3/c3.h
index 7aab9cb..00969ff 100644
--- a/libc3/c3.h
+++ b/libc3/c3.h
@@ -66,8 +66,10 @@
#include "module.h"
#include "operator.h"
#include "quote.h"
+#include "sequence.h"
#include "str.h"
#include "tag.h"
+#include "time.h"
#include "tuple.h"
#include "type.h"
#include "ucd.h"
diff --git a/libc3/c3_main.h b/libc3/c3_main.h
index ec33159..a17f609 100644
--- a/libc3/c3_main.h
+++ b/libc3/c3_main.h
@@ -22,7 +22,8 @@ extern const s_str g_c3_base_octal;
extern const s_str g_c3_base_decimal;
extern const s_str g_c3_base_hexadecimal;
extern const s_str g_c3_bases_hexadecimal[2];
-extern const s8 *g_c3_license;
+extern const s8 *g_c3_license;
+extern sw g_c3_exit_code;
/* stack-allocation compatible functions */
void c3_init (s_env *env);
diff --git a/libc3/sequence.c b/libc3/sequence.c
new file mode 100644
index 0000000..6f44e99
--- /dev/null
+++ b/libc3/sequence.c
@@ -0,0 +1,24 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include <assert.h>
+#include "sequence.h"
+
+s_sequence * sequence_init (s_sequence *sequence, f64 duration,
+ const s8 *title)
+{
+ assert(sequence);
+ sequence->t = 0.0;
+ sequence->duration = duration;
+ sequence->title = title;
+ return sequence;
+}
diff --git a/libc3/sequence.h b/libc3/sequence.h
new file mode 100644
index 0000000..df3eaca
--- /dev/null
+++ b/libc3/sequence.h
@@ -0,0 +1,21 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef SEQUENCE_H
+#define SEQUENCE_H
+
+#include "types.h"
+
+s_sequence * sequence_init (s_sequence *sequence, f64 duration,
+ const s8 *title);
+
+#endif /* ndef SEQUENCE_H */
diff --git a/libc3/sources.mk b/libc3/sources.mk
index 5be2f06..cfaf36f 100644
--- a/libc3/sources.mk
+++ b/libc3/sources.mk
@@ -112,6 +112,7 @@ HEADERS = \
s32.h \
s64.h \
s8.h \
+ sequence.h \
set__fact.h \
set__tag.h \
set_cursor__fact.h \
@@ -126,6 +127,7 @@ HEADERS = \
sw.h \
sym.h \
tag.h \
+ time.h \
timespec.h \
tuple.h \
type.h \
@@ -248,6 +250,7 @@ SOURCES = \
s32.c \
s64.c \
s8.c \
+ sequence.c \
set__fact.c \
set__tag.c \
set_cursor__fact.c \
@@ -261,6 +264,7 @@ SOURCES = \
sw.c \
sym.c \
tag.c \
+ time.c \
timespec.c \
tuple.c \
type.c \
@@ -382,6 +386,7 @@ LO_SOURCES = \
s32.c \
s64.c \
s8.c \
+ sequence.c \
set__fact.c \
set__tag.c \
set_cursor__fact.c \
@@ -395,6 +400,7 @@ LO_SOURCES = \
sw.c \
sym.c \
tag.c \
+ time.c \
timespec.c \
tuple.c \
type.c \
diff --git a/libc3/sources.sh b/libc3/sources.sh
index ecc35be..a814dfe 100644
--- a/libc3/sources.sh
+++ b/libc3/sources.sh
@@ -1,4 +1,4 @@
# sources.sh generated by update_sources
-HEADERS='abs.h arg.h array.h binding.h bool.h buf.h buf_file.h buf_inspect.h buf_inspect_s16.h buf_inspect_s16_binary.h buf_inspect_s16_decimal.h buf_inspect_s16_hexadecimal.h buf_inspect_s16_octal.h buf_inspect_s32.h buf_inspect_s32_binary.h buf_inspect_s32_decimal.h buf_inspect_s32_hexadecimal.h buf_inspect_s32_octal.h buf_inspect_s64.h buf_inspect_s64_binary.h buf_inspect_s64_decimal.h buf_inspect_s64_hexadecimal.h buf_inspect_s64_octal.h buf_inspect_s8.h buf_inspect_s8_binary.h buf_inspect_s8_decimal.h buf_inspect_s8_hexadecimal.h buf_inspect_s8_octal.h buf_inspect_sw.h buf_inspect_sw_binary.h buf_inspect_sw_decimal.h buf_inspect_sw_hexadecimal.h buf_inspect_sw_octal.h buf_inspect_u16.h buf_inspect_u16_binary.h buf_inspect_u16_decimal.h buf_inspect_u16_hexadecimal.h buf_inspect_u16_octal.h buf_inspect_u32.h buf_inspect_u32_binary.h buf_inspect_u32_decimal.h buf_inspect_u32_hexadecimal.h buf_inspect_u32_octal.h buf_inspect_u64.h buf_inspect_u64_binary.h buf_inspect_u64_decimal.h buf_inspect_u64_hexadecimal.h buf_inspect_u64_octal.h buf_inspect_u8.h buf_inspect_u8_binary.h buf_inspect_u8_decimal.h buf_inspect_u8_hexadecimal.h buf_inspect_u8_octal.h buf_inspect_uw.h buf_inspect_uw_binary.h buf_inspect_uw_decimal.h buf_inspect_uw_hexadecimal.h buf_inspect_uw_octal.h buf_parse.h buf_parse_c.h buf_parse_s16.h buf_parse_s32.h buf_parse_s64.h buf_parse_s8.h buf_parse_sw.h buf_parse_u16.h buf_parse_u32.h buf_parse_u64.h buf_parse_u8.h buf_parse_uw.h buf_save.h c3.h c3_main.h c_types.h call.h ceiling.h cfn.h character.h compare.h config.h env.h error.h error_handler.h eval.h f32.h f64.h fact.h facts.h facts_cursor.h facts_spec.h facts_spec_cursor.h facts_with.h facts_with_cursor.h file.h float.h fn.h fn_clause.h frame.h hash.h ident.h integer.h io.h list.h log.h module.h operator.h ptag.h quote.h s16.h s32.h s64.h s8.h set__fact.h set__tag.h set_cursor__fact.h set_cursor__tag.h set_item__fact.h set_item__tag.h sha1.h sign.h skiplist__fact.h skiplist_node__fact.h str.h sw.h sym.h tag.h timespec.h tuple.h type.h types.h u16.h u32.h u64.h u8.h ucd.h uw.h var.h '
-SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_c.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c log.c module.c operator.c ptag.c quote.c s16.c s32.c s64.c s8.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c sw.c sym.c tag.c timespec.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c '
-LO_SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_c.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c log.c module.c operator.c ptag.c quote.c s16.c s32.c s64.c s8.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c sw.c sym.c tag.c timespec.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c ../libtommath/bn_cutoffs.c ../libtommath/bn_mp_2expt.c ../libtommath/bn_mp_abs.c ../libtommath/bn_mp_add.c ../libtommath/bn_mp_add_d.c ../libtommath/bn_mp_and.c ../libtommath/bn_mp_clamp.c ../libtommath/bn_mp_clear.c ../libtommath/bn_mp_clear_multi.c ../libtommath/bn_mp_cmp.c ../libtommath/bn_mp_cmp_d.c ../libtommath/bn_mp_cmp_mag.c ../libtommath/bn_mp_cnt_lsb.c ../libtommath/bn_mp_complement.c ../libtommath/bn_mp_copy.c ../libtommath/bn_mp_count_bits.c ../libtommath/bn_mp_div.c ../libtommath/bn_mp_div_2.c ../libtommath/bn_mp_div_2d.c ../libtommath/bn_mp_div_3.c ../libtommath/bn_mp_div_d.c ../libtommath/bn_mp_dr_is_modulus.c ../libtommath/bn_mp_dr_reduce.c ../libtommath/bn_mp_dr_setup.c ../libtommath/bn_mp_error_to_string.c ../libtommath/bn_mp_exch.c ../libtommath/bn_mp_exptmod.c ../libtommath/bn_mp_gcd.c ../libtommath/bn_mp_get_double.c ../libtommath/bn_mp_get_i32.c ../libtommath/bn_mp_get_i64.c ../libtommath/bn_mp_get_mag_u32.c ../libtommath/bn_mp_get_mag_u64.c ../libtommath/bn_mp_grow.c ../libtommath/bn_mp_init.c ../libtommath/bn_mp_init_copy.c ../libtommath/bn_mp_init_multi.c ../libtommath/bn_mp_init_size.c ../libtommath/bn_mp_invmod.c ../libtommath/bn_mp_lcm.c ../libtommath/bn_mp_lshd.c ../libtommath/bn_mp_mod.c ../libtommath/bn_mp_mod_2d.c ../libtommath/bn_mp_montgomery_calc_normalization.c ../libtommath/bn_mp_montgomery_reduce.c ../libtommath/bn_mp_montgomery_setup.c ../libtommath/bn_mp_mul.c ../libtommath/bn_mp_mul_2.c ../libtommath/bn_mp_mul_2d.c ../libtommath/bn_mp_mul_d.c ../libtommath/bn_mp_mulmod.c ../libtommath/bn_mp_neg.c ../libtommath/bn_mp_or.c ../libtommath/bn_mp_radix_size.c ../libtommath/bn_mp_reduce.c ../libtommath/bn_mp_reduce_2k.c ../libtommath/bn_mp_reduce_2k_l.c ../libtommath/bn_mp_reduce_2k_setup.c ../libtommath/bn_mp_reduce_2k_setup_l.c ../libtommath/bn_mp_reduce_is_2k.c ../libtommath/bn_mp_reduce_is_2k_l.c ../libtommath/bn_mp_reduce_setup.c ../libtommath/bn_mp_rshd.c ../libtommath/bn_mp_set.c ../libtommath/bn_mp_set_double.c ../libtommath/bn_mp_set_i32.c ../libtommath/bn_mp_set_i64.c ../libtommath/bn_mp_set_l.c ../libtommath/bn_mp_set_u32.c ../libtommath/bn_mp_set_u64.c ../libtommath/bn_mp_set_ul.c ../libtommath/bn_mp_sqr.c ../libtommath/bn_mp_sqrt.c ../libtommath/bn_mp_sub.c ../libtommath/bn_mp_sub_d.c ../libtommath/bn_mp_xor.c ../libtommath/bn_mp_zero.c ../libtommath/bn_s_mp_add.c ../libtommath/bn_s_mp_balance_mul.c ../libtommath/bn_s_mp_exptmod.c ../libtommath/bn_s_mp_exptmod_fast.c ../libtommath/bn_s_mp_invmod_fast.c ../libtommath/bn_s_mp_invmod_slow.c ../libtommath/bn_s_mp_karatsuba_mul.c ../libtommath/bn_s_mp_karatsuba_sqr.c ../libtommath/bn_s_mp_montgomery_reduce_fast.c ../libtommath/bn_s_mp_mul_digs.c ../libtommath/bn_s_mp_mul_digs_fast.c ../libtommath/bn_s_mp_mul_high_digs.c ../libtommath/bn_s_mp_mul_high_digs_fast.c ../libtommath/bn_s_mp_rand_platform.c ../libtommath/bn_s_mp_sqr.c ../libtommath/bn_s_mp_sqr_fast.c ../libtommath/bn_s_mp_sub.c ../libtommath/bn_s_mp_toom_mul.c ../libtommath/bn_s_mp_toom_sqr.c '
+HEADERS='abs.h arg.h array.h binding.h bool.h buf.h buf_file.h buf_inspect.h buf_inspect_s16.h buf_inspect_s16_binary.h buf_inspect_s16_decimal.h buf_inspect_s16_hexadecimal.h buf_inspect_s16_octal.h buf_inspect_s32.h buf_inspect_s32_binary.h buf_inspect_s32_decimal.h buf_inspect_s32_hexadecimal.h buf_inspect_s32_octal.h buf_inspect_s64.h buf_inspect_s64_binary.h buf_inspect_s64_decimal.h buf_inspect_s64_hexadecimal.h buf_inspect_s64_octal.h buf_inspect_s8.h buf_inspect_s8_binary.h buf_inspect_s8_decimal.h buf_inspect_s8_hexadecimal.h buf_inspect_s8_octal.h buf_inspect_sw.h buf_inspect_sw_binary.h buf_inspect_sw_decimal.h buf_inspect_sw_hexadecimal.h buf_inspect_sw_octal.h buf_inspect_u16.h buf_inspect_u16_binary.h buf_inspect_u16_decimal.h buf_inspect_u16_hexadecimal.h buf_inspect_u16_octal.h buf_inspect_u32.h buf_inspect_u32_binary.h buf_inspect_u32_decimal.h buf_inspect_u32_hexadecimal.h buf_inspect_u32_octal.h buf_inspect_u64.h buf_inspect_u64_binary.h buf_inspect_u64_decimal.h buf_inspect_u64_hexadecimal.h buf_inspect_u64_octal.h buf_inspect_u8.h buf_inspect_u8_binary.h buf_inspect_u8_decimal.h buf_inspect_u8_hexadecimal.h buf_inspect_u8_octal.h buf_inspect_uw.h buf_inspect_uw_binary.h buf_inspect_uw_decimal.h buf_inspect_uw_hexadecimal.h buf_inspect_uw_octal.h buf_parse.h buf_parse_c.h buf_parse_s16.h buf_parse_s32.h buf_parse_s64.h buf_parse_s8.h buf_parse_sw.h buf_parse_u16.h buf_parse_u32.h buf_parse_u64.h buf_parse_u8.h buf_parse_uw.h buf_save.h c3.h c3_main.h c_types.h call.h ceiling.h cfn.h character.h compare.h config.h env.h error.h error_handler.h eval.h f32.h f64.h fact.h facts.h facts_cursor.h facts_spec.h facts_spec_cursor.h facts_with.h facts_with_cursor.h file.h float.h fn.h fn_clause.h frame.h hash.h ident.h integer.h io.h list.h log.h module.h operator.h ptag.h quote.h s16.h s32.h s64.h s8.h sequence.h set__fact.h set__tag.h set_cursor__fact.h set_cursor__tag.h set_item__fact.h set_item__tag.h sha1.h sign.h skiplist__fact.h skiplist_node__fact.h str.h sw.h sym.h tag.h time.h timespec.h tuple.h type.h types.h u16.h u32.h u64.h u8.h ucd.h uw.h var.h '
+SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_c.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c log.c module.c operator.c ptag.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c sw.c sym.c tag.c time.c timespec.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c '
+LO_SOURCES='abs.c arg.c array.c binding.c bool.c buf.c buf_file.c buf_inspect.c buf_inspect_s16.c buf_inspect_s16_binary.c buf_inspect_s16_decimal.c buf_inspect_s16_hexadecimal.c buf_inspect_s16_octal.c buf_inspect_s32.c buf_inspect_s32_binary.c buf_inspect_s32_decimal.c buf_inspect_s32_hexadecimal.c buf_inspect_s32_octal.c buf_inspect_s64.c buf_inspect_s64_binary.c buf_inspect_s64_decimal.c buf_inspect_s64_hexadecimal.c buf_inspect_s64_octal.c buf_inspect_s8.c buf_inspect_s8_binary.c buf_inspect_s8_decimal.c buf_inspect_s8_hexadecimal.c buf_inspect_s8_octal.c buf_inspect_sw.c buf_inspect_sw_binary.c buf_inspect_sw_decimal.c buf_inspect_sw_hexadecimal.c buf_inspect_sw_octal.c buf_inspect_u16.c buf_inspect_u16_binary.c buf_inspect_u16_decimal.c buf_inspect_u16_hexadecimal.c buf_inspect_u16_octal.c buf_inspect_u32.c buf_inspect_u32_binary.c buf_inspect_u32_decimal.c buf_inspect_u32_hexadecimal.c buf_inspect_u32_octal.c buf_inspect_u64.c buf_inspect_u64_binary.c buf_inspect_u64_decimal.c buf_inspect_u64_hexadecimal.c buf_inspect_u64_octal.c buf_inspect_u8.c buf_inspect_u8_binary.c buf_inspect_u8_decimal.c buf_inspect_u8_hexadecimal.c buf_inspect_u8_octal.c buf_inspect_uw.c buf_inspect_uw_binary.c buf_inspect_uw_decimal.c buf_inspect_uw_hexadecimal.c buf_inspect_uw_octal.c buf_parse.c buf_parse_c.c buf_parse_s16.c buf_parse_s32.c buf_parse_s64.c buf_parse_s8.c buf_parse_sw.c buf_parse_u16.c buf_parse_u32.c buf_parse_u64.c buf_parse_u8.c buf_parse_uw.c buf_save.c c3.c call.c ceiling.c cfn.c character.c compare.c env.c error.c error_handler.c eval.c f32.c f64.c fact.c facts.c facts_cursor.c facts_spec.c facts_spec_cursor.c facts_with.c facts_with_cursor.c file.c fn.c fn_clause.c frame.c hash.c ident.c integer.c io.c license.c list.c log.c module.c operator.c ptag.c quote.c s16.c s32.c s64.c s8.c sequence.c set__fact.c set__tag.c set_cursor__fact.c set_cursor__tag.c set_item__fact.c set_item__tag.c sign.c skiplist__fact.c skiplist_node__fact.c str.c sw.c sym.c tag.c time.c timespec.c tuple.c type.c u16.c u32.c u64.c u8.c ucd.c uw.c var.c ../libtommath/bn_cutoffs.c ../libtommath/bn_mp_2expt.c ../libtommath/bn_mp_abs.c ../libtommath/bn_mp_add.c ../libtommath/bn_mp_add_d.c ../libtommath/bn_mp_and.c ../libtommath/bn_mp_clamp.c ../libtommath/bn_mp_clear.c ../libtommath/bn_mp_clear_multi.c ../libtommath/bn_mp_cmp.c ../libtommath/bn_mp_cmp_d.c ../libtommath/bn_mp_cmp_mag.c ../libtommath/bn_mp_cnt_lsb.c ../libtommath/bn_mp_complement.c ../libtommath/bn_mp_copy.c ../libtommath/bn_mp_count_bits.c ../libtommath/bn_mp_div.c ../libtommath/bn_mp_div_2.c ../libtommath/bn_mp_div_2d.c ../libtommath/bn_mp_div_3.c ../libtommath/bn_mp_div_d.c ../libtommath/bn_mp_dr_is_modulus.c ../libtommath/bn_mp_dr_reduce.c ../libtommath/bn_mp_dr_setup.c ../libtommath/bn_mp_error_to_string.c ../libtommath/bn_mp_exch.c ../libtommath/bn_mp_exptmod.c ../libtommath/bn_mp_gcd.c ../libtommath/bn_mp_get_double.c ../libtommath/bn_mp_get_i32.c ../libtommath/bn_mp_get_i64.c ../libtommath/bn_mp_get_mag_u32.c ../libtommath/bn_mp_get_mag_u64.c ../libtommath/bn_mp_grow.c ../libtommath/bn_mp_init.c ../libtommath/bn_mp_init_copy.c ../libtommath/bn_mp_init_multi.c ../libtommath/bn_mp_init_size.c ../libtommath/bn_mp_invmod.c ../libtommath/bn_mp_lcm.c ../libtommath/bn_mp_lshd.c ../libtommath/bn_mp_mod.c ../libtommath/bn_mp_mod_2d.c ../libtommath/bn_mp_montgomery_calc_normalization.c ../libtommath/bn_mp_montgomery_reduce.c ../libtommath/bn_mp_montgomery_setup.c ../libtommath/bn_mp_mul.c ../libtommath/bn_mp_mul_2.c ../libtommath/bn_mp_mul_2d.c ../libtommath/bn_mp_mul_d.c ../libtommath/bn_mp_mulmod.c ../libtommath/bn_mp_neg.c ../libtommath/bn_mp_or.c ../libtommath/bn_mp_radix_size.c ../libtommath/bn_mp_reduce.c ../libtommath/bn_mp_reduce_2k.c ../libtommath/bn_mp_reduce_2k_l.c ../libtommath/bn_mp_reduce_2k_setup.c ../libtommath/bn_mp_reduce_2k_setup_l.c ../libtommath/bn_mp_reduce_is_2k.c ../libtommath/bn_mp_reduce_is_2k_l.c ../libtommath/bn_mp_reduce_setup.c ../libtommath/bn_mp_rshd.c ../libtommath/bn_mp_set.c ../libtommath/bn_mp_set_double.c ../libtommath/bn_mp_set_i32.c ../libtommath/bn_mp_set_i64.c ../libtommath/bn_mp_set_l.c ../libtommath/bn_mp_set_u32.c ../libtommath/bn_mp_set_u64.c ../libtommath/bn_mp_set_ul.c ../libtommath/bn_mp_sqr.c ../libtommath/bn_mp_sqrt.c ../libtommath/bn_mp_sub.c ../libtommath/bn_mp_sub_d.c ../libtommath/bn_mp_xor.c ../libtommath/bn_mp_zero.c ../libtommath/bn_s_mp_add.c ../libtommath/bn_s_mp_balance_mul.c ../libtommath/bn_s_mp_exptmod.c ../libtommath/bn_s_mp_exptmod_fast.c ../libtommath/bn_s_mp_invmod_fast.c ../libtommath/bn_s_mp_invmod_slow.c ../libtommath/bn_s_mp_karatsuba_mul.c ../libtommath/bn_s_mp_karatsuba_sqr.c ../libtommath/bn_s_mp_montgomery_reduce_fast.c ../libtommath/bn_s_mp_mul_digs.c ../libtommath/bn_s_mp_mul_digs_fast.c ../libtommath/bn_s_mp_mul_high_digs.c ../libtommath/bn_s_mp_mul_high_digs_fast.c ../libtommath/bn_s_mp_rand_platform.c ../libtommath/bn_s_mp_sqr.c ../libtommath/bn_s_mp_sqr_fast.c ../libtommath/bn_s_mp_sub.c ../libtommath/bn_s_mp_toom_mul.c ../libtommath/bn_s_mp_toom_sqr.c '
diff --git a/libc3/time.c b/libc3/time.c
new file mode 100644
index 0000000..5b4ae14
--- /dev/null
+++ b/libc3/time.c
@@ -0,0 +1,44 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include <assert.h>
+#include "tag.h"
+#include "time.h"
+
+s_time * time_sub (const s_time *a, const s_time *b, s_time *dest)
+{
+ if ((a->tv_nsec - b->tv_nsec) < 0) {
+ dest->tv_sec = a->tv_sec - b->tv_sec - 1;
+ dest->tv_nsec = 1000000000 + a->tv_nsec - b->tv_nsec;
+ } else {
+ dest->tv_sec = a->tv_sec - b->tv_sec;
+ dest->tv_nsec = a->tv_nsec - b->tv_nsec;
+ }
+ return dest;
+}
+
+f64 * time_to_f64 (const s_time *time, f64 *dest)
+{
+ *dest = (f64) time->tv_sec + (f64) time->tv_nsec * 0.000000001;
+ return dest;
+}
+
+s_tag * time_to_tag (const s_time *time, s_tag *dest)
+{
+ s_tag tmp;
+ assert(time);
+ tag_init_tuple(&tmp, 2);
+ tag_init_s64(&tmp.data.tuple.tag[0], time->tv_sec);
+ tag_init_s64(&tmp.data.tuple.tag[1], time->tv_nsec);
+ *dest = tmp;
+ return dest;
+}
diff --git a/libc3/time.h b/libc3/time.h
new file mode 100644
index 0000000..be54ca0
--- /dev/null
+++ b/libc3/time.h
@@ -0,0 +1,30 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/**
+ * @file time.h
+ * @brief operations on s_time
+ *
+ */
+#ifndef LIBC3_TIME_H
+#define LIBC3_TIME_H
+
+#include "types.h"
+
+/* Observers */
+f64 * time_to_f64 (const s_time *time, f64 *dest);
+s_tag * time_to_tag (const s_time *time, s_tag *dest);
+
+/* Operators */
+s_time * time_sub (const s_time *a, const s_time *b, s_time *dest);
+
+#endif /* LIBC3_TIME_H */
diff --git a/libc3/types.h b/libc3/types.h
index ee17922..f777a15 100644
--- a/libc3/types.h
+++ b/libc3/types.h
@@ -18,6 +18,7 @@
#include <setjmp.h>
#include <stdio.h>
#include <sys/types.h>
+#include <time.h>
#include <pthread.h>
#include "config.h"
#include "sha1.h"
@@ -143,12 +144,14 @@ typedef struct list s_list_map;
typedef struct log s_log;
typedef struct ptr s_ptr;
typedef struct quote s_quote;
+typedef struct sequence s_sequence;
typedef struct str s_str;
typedef struct struct_ s_struct;
typedef struct sym s_sym;
typedef struct sym_list s_sym_list;
typedef struct tag s_tag;
typedef struct tag_type_list s_tag_type_list;
+typedef struct timespec s_time;
typedef struct tuple s_tuple;
typedef struct type s_type;
typedef struct unwind_protect s_unwind_protect;
@@ -235,6 +238,14 @@ struct quote {
s_tag *tag;
};
+struct sequence {
+ f64 t;
+ f64 duration;
+ s_time t0;
+ const s8 *title;
+ void *data;
+};
+
struct struct_ {
void *data;
uw count;
diff --git a/libc3/window/Makefile b/libc3/window/Makefile
index a7bf3b8..d4d8d38 100644
--- a/libc3/window/Makefile
+++ b/libc3/window/Makefile
@@ -40,6 +40,9 @@ debug:
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb debug; fi
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo debug; fi
+demo:
+ if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo demo; fi
+
distclean:
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb distclean; fi
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo distclean; fi
@@ -48,6 +51,9 @@ gcovr:
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb gcovr; fi
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo gcovr; fi
+gdb_demo: debug
+ if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo gdb_demo; fi
+
install:
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb install; fi
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo install; fi
@@ -60,6 +66,17 @@ update_sources:
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb update_sources; fi
if ${HAVE_CAIRO} && ${HAVE_XCB}; then ${MAKE} -C cairo/xcb/demo update_sources; fi
-.PHONY: all asan build clean cov debug distclean install test update_sources
+.PHONY: \
+ all \
+ asan \
+ build \
+ clean \
+ cov \
+ debug \
+ demo \
+ distclean \
+ install \
+ test \
+ update_sources
include config.mk
diff --git a/libc3/window/cairo/c3_window_cairo_demo.c b/libc3/window/cairo/c3_window_cairo_demo.c
index 2966c27..dd1afab 100644
--- a/libc3/window/cairo/c3_window_cairo_demo.c
+++ b/libc3/window/cairo/c3_window_cairo_demo.c
@@ -10,19 +10,55 @@
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
+#include <assert.h>
#include <stdio.h>
+#include <time.h>
#include <libc3/c3.h>
#include <cairo/cairo.h>
+#include "../window.h"
#include "c3_window_cairo_demo.h"
#include "types.h"
+bool c3_window_cairo_demo_load (s_window_cairo *window)
+{
+ assert(window->sequence_count ==
+ LIBC3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ sequence_init(window->sequence, 8.0, "01. Background rectangles");
+ window_set_sequence_pos((s_window *) window, 0);
+ return true;
+}
+
bool c3_window_cairo_demo_render (s_window_cairo *window,
cairo_t *cr)
{
+ s_sequence *seq;
assert(window);
assert(cr);
- (void) window;
- cairo_set_source_rgb(cr, 1, 1, 1);
+ if (! window_animate((s_window *) window))
+ return false;
+ seq = window->sequence + window->sequence_pos;
+ switch (window->sequence_pos) {
+ case 0:
+ if (seq->t < 1.0)
+ cairo_set_source_rgb(cr, 1, 1, 1);
+ else if (seq->t < 2.0)
+ cairo_set_source_rgb(cr, 1, 0, 0);
+ else if (seq->t < 3.0)
+ cairo_set_source_rgb(cr, 1, 1, 0);
+ else if (seq->t < 4.0)
+ cairo_set_source_rgb(cr, 0, 1, 0);
+ else if (seq->t < 5.0)
+ cairo_set_source_rgb(cr, 0, 1, 1);
+ else if (seq->t < 6.0)
+ cairo_set_source_rgb(cr, 0, 0, 1);
+ else if (seq->t < 7.0)
+ cairo_set_source_rgb(cr, 1, 0, 1);
+ else
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ break;
+ default:
+ cairo_set_source_rgb(cr, 1, 1, 1);
+ }
cairo_rectangle(cr, 0, 0, window->w, window->h);
cairo_fill(cr);
return true;
@@ -32,7 +68,8 @@ bool c3_window_cairo_demo_resize (s_window_cairo *window,
uw w, uw h)
{
assert(window);
- window->w = w;
- window->h = h;
+ (void) window;
+ (void) w;
+ (void) h;
return true;
}
diff --git a/libc3/window/cairo/c3_window_cairo_demo.h b/libc3/window/cairo/c3_window_cairo_demo.h
index 358996e..f4708a7 100644
--- a/libc3/window/cairo/c3_window_cairo_demo.h
+++ b/libc3/window/cairo/c3_window_cairo_demo.h
@@ -10,13 +10,16 @@
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
-#ifndef C3_WINDOW_CAIRO_DEMO_H
-#define C3_WINDOW_CAIRO_DEMO_H
+#ifndef LIBC3_WINDOW_CAIRO_DEMO_H
+#define LIBC3_WINDOW_CAIRO_DEMO_H
#include <libc3/types.h>
#include "types.h"
+#define LIBC3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT 1
+
+bool c3_window_cairo_demo_load (s_window_cairo *window);
bool c3_window_cairo_demo_render (s_window_cairo *window, cairo_t *cr);
bool c3_window_cairo_demo_resize (s_window_cairo *window, uw w, uw h);
-#endif /* C3_WINDOW_CAIRO_DEMO_H */
+#endif /* LIBC3_WINDOW_CAIRO_DEMO_H */
diff --git a/libc3/window/cairo/types.h b/libc3/window/cairo/types.h
index c4fc4a3..664766b 100644
--- a/libc3/window/cairo/types.h
+++ b/libc3/window/cairo/types.h
@@ -25,6 +25,16 @@
typedef struct window_cairo s_window_cairo;
/* return false to break event loop */
+typedef bool (*f_window_cairo_button) (s_window_cairo *window,
+ u8 button, sw x, sw y);
+
+/* return false to break event loop */
+typedef bool (*f_window_cairo_key) (s_window_cairo *window, uw key);
+
+/* return false to break event loop */
+typedef bool (*f_window_cairo_load) (s_window_cairo *window);
+
+/* return false to break event loop */
typedef bool (*f_window_cairo_render) (s_window_cairo *window,
cairo_t *cr);
@@ -32,16 +42,22 @@ typedef bool (*f_window_cairo_render) (s_window_cairo *window,
typedef bool (*f_window_cairo_resize) (s_window_cairo *window,
uw w, uw h);
+/* Subtype of s_window. See libc3/window/types.h */
struct window_cairo {
- /* compatible with s_window */
- sw x;
- sw y;
- uw w;
- uw h;
- const s8 *title;
+ sw x;
+ sw y;
+ uw w;
+ uw h;
+ f_window_cairo_button button;
+ f_window_cairo_key key;
+ f_window_cairo_load load;
f_window_cairo_render render;
+ cairo_t *cr;
f_window_cairo_resize resize;
- cairo_t *cr;
+ s_sequence *sequence;
+ uw sequence_count;
+ uw sequence_pos;
+ const s8 *title;
};
#endif /* LIBC3_WINDOW_CAIRO_TYPES_H */
diff --git a/libc3/window/cairo/window_cairo.c b/libc3/window/cairo/window_cairo.c
index 96a6d30..46d3fb4 100644
--- a/libc3/window/cairo/window_cairo.c
+++ b/libc3/window/cairo/window_cairo.c
@@ -11,24 +11,61 @@
* THIS SOFTWARE.
*/
#include <assert.h>
+#include <stdlib.h>
#include "window_cairo.h"
s_window_cairo * window_cairo_init (s_window_cairo *window,
sw x, sw y, uw w, uw h,
- const s8 *title)
+ const s8 *title,
+ uw sequence_count)
{
assert(window);
window->x = x;
window->y = y;
window->w = w;
window->h = h;
- window->title = title ? title : "C3.Window.Cairo";
+ window->button = window_cairo_button_default;
+ window->key = window_cairo_key_default;
+ window->load = window_cairo_load_default;
window->render = window_cairo_render_default;
window->resize = window_cairo_resize_default;
window->cr = NULL;
+ window->sequence = calloc(sequence_count, sizeof(s_sequence));
+ window->sequence_count = sequence_count;
+ window->sequence_pos = 0;
+ window->title = title ? title : "C3.Window.Cairo";
return window;
}
+bool window_cairo_button_default (s_window_cairo *window, u8 button,
+ sw x, sw y)
+{
+ assert(window);
+ (void) window;
+ (void) button;
+ (void) x;
+ (void) y;
+ printf("window_cairo_button_default: %lu (%ld, %ld)\n", (uw) button, x, y);
+ return true;
+}
+
+bool window_cairo_key_default (s_window_cairo *window, uw key)
+{
+ assert(window);
+ (void) window;
+ (void) key;
+ printf("window_cairo_key_default: %lu\n", key);
+ return true;
+}
+
+bool window_cairo_load_default (s_window_cairo *window)
+{
+ assert(window);
+ (void) window;
+ printf("window_cairo_load_default\n");
+ return true;
+}
+
bool window_cairo_render_default (s_window_cairo *window, cairo_t *cr)
{
assert(window);
@@ -36,12 +73,16 @@ bool window_cairo_render_default (s_window_cairo *window, cairo_t *cr)
cairo_set_source_rgb(cr, 1, 1, 1);
cairo_rectangle(cr, 0, 0, window->w, window->h);
cairo_fill(cr);
+ printf("window_cairo_render_default\n");
return true;
}
bool window_cairo_resize_default (s_window_cairo *window, uw w, uw h)
{
- window->w = w;
- window->h = h;
+ assert(window);
+ (void) window;
+ (void) w;
+ (void) h;
+ printf("window_cairo_resize_default: %lu x %lu\n", w, h);
return true;
}
diff --git a/libc3/window/cairo/window_cairo.h b/libc3/window/cairo/window_cairo.h
index 6c91351..85b89b7 100644
--- a/libc3/window/cairo/window_cairo.h
+++ b/libc3/window/cairo/window_cairo.h
@@ -19,10 +19,15 @@
s_window_cairo * window_cairo_init (s_window_cairo *window,
sw x, sw y, uw w, uw h,
- const s8 *title);
+ const s8 *title,
+ uw sequence_count);
bool window_cairo_run (s_window_cairo *window);
/* callbacks */
+bool window_cairo_button_default (s_window_cairo *window, u8 button,
+ sw x, sw y);
+bool window_cairo_key_default (s_window_cairo *window, uw key);
+bool window_cairo_load_default (s_window_cairo *window);
bool window_cairo_render_default (s_window_cairo *window, cairo_t *cr);
bool window_cairo_resize_default (s_window_cairo *window, uw w, uw h);
diff --git a/libc3/window/cairo/xcb/Makefile b/libc3/window/cairo/xcb/Makefile
index 1a7b513..ed9bbc9 100644
--- a/libc3/window/cairo/xcb/Makefile
+++ b/libc3/window/cairo/xcb/Makefile
@@ -46,7 +46,18 @@ test:
update_sources:
./update_sources
-.PHONY: all asan build clean cov debug distclean gen install test update_sources
+.PHONY: \
+ all \
+ asan \
+ build \
+ clean \
+ cov \
+ debug \
+ distclean \
+ gen \
+ install \
+ test \
+ update_sources
include config.mk
include sources.mk
diff --git a/libc3/window/cairo/xcb/demo/Makefile b/libc3/window/cairo/xcb/demo/Makefile
index 36a3aad..34cde24 100644
--- a/libc3/window/cairo/xcb/demo/Makefile
+++ b/libc3/window/cairo/xcb/demo/Makefile
@@ -9,15 +9,18 @@
## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
+include config.mk
+include sources.mk
-CLEANFILES = *.a c3_window_cairo_xcb_demo c3_window_cairo_xcb_demo_asan c3_window_cairo_xcb_demo_cov c3_window_cairo_xcb_demo_debug *.css *.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a ${PROG} ${PROG_ASAN} ${PROG_COV} ${PROG_DEBUG} *.css \
+ *.gcno *.html *.o .libs *.lo
CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
CLEANFILES += ${CLEANFILES_COV}
DISTCLEANFILES = ${CLEANFILES} config.mk
-build: c3_window_cairo_xcb_demo
+build: ${PROG}
all:
${MAKE} build
@@ -25,7 +28,7 @@ all:
${MAKE} debug
if ${HAVE_ASAN}; then ${MAKE} asan; fi
-asan: c3_window_cairo_xcb_demo_asan
+asan: ${PROG_ASAN}
clean:
rm -rf ${CLEANFILES}
@@ -33,24 +36,33 @@ clean:
clean_cov:
rm -rf ${CLEANFILES_COV}
-cov: c3_window_cairo_xcb_demo_cov
+cov: ${PROG_COV}
-debug: c3_window_cairo_xcb_demo_debug
+debug: ${PROG_DEBUG}
+
+demo: ${PROG}
+ time ./${PROG}
distclean:
rm -rf ${DISTCLEANFILES}
gcovr:
- gcovr --gcov-executable ${GCOV} --html-details c3_window_cairo_xcb_demo.html
+ gcovr --gcov-executable ${GCOV} --html-details ${PROG}.html
-gdb_c3_window_cairo_xcb_demo: debug
- if [ -f c3_window_cairo_xcb_demo_debug.core ]; then gdb .libs/c3_window_cairo_xcb_demo_debug c3_window_cairo_xcb_demo_debug.core; else gdb .libs/c3_window_cairo_xcb_demo_debug; fi
+gdb_demo: debug
+ if [ -f ${PROG_DEBUG}.core ]; then gdb .libs/${PROG_DEBUG} ${PROG_DEBUG}.core; else gdb .libs/${PROG_DEBUG}; fi
install:
- mkdir -p ${prefix}/bin
- install -m 755 c3_window_cairo_xcb_demo ${prefix}/bin/c3_window_cairo_xcb_demo
-
-.PHONY: all asan cov debug clean clean_cov distclean
-
-include config.mk
-include sources.mk
+ install -m 755 -d ${prefix}/bin
+ install -m 755 ${PROG} ${prefix}/bin/${PROG}
+
+.PHONY: \
+ all \
+ asan \
+ clean \
+ clean_cov \
+ cov \
+ debug \
+ demo \
+ distclean \
+ gdb_demo
diff --git a/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c b/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c
index e392615..bf7d853 100644
--- a/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c
+++ b/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c
@@ -14,17 +14,65 @@
#include <stdlib.h>
#include <cairo/cairo.h>
#include <libc3/c3.h>
+#include "../../../window.h"
#include "../../c3_window_cairo_demo.h"
#include "../window_cairo_xcb.h"
+static bool on_button (s_window_cairo *window, u8 button,
+ sw x, sw y);
+static bool on_key (s_window_cairo *window, uw key);
+
int main ()
{
s_window_cairo window;
window_cairo_init(&window, 0, 0, 800, 600,
- "C3.Window.Cairo.XCB demo");
+ "C3.Window.Cairo.XCB demo",
+ LIBC3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ window.button = on_button;
+ window.key = on_key;
+ window.load = c3_window_cairo_demo_load;
window.render = c3_window_cairo_demo_render;
window.resize = c3_window_cairo_demo_resize;
if (! window_cairo_xcb_run(&window))
- return 1;
+ return g_c3_exit_code;
return 0;
}
+
+static bool on_button (s_window_cairo *window, u8 button, sw x, sw y)
+{
+ assert(window);
+ (void) window;
+ (void) button;
+ (void) x;
+ (void) y;
+ printf("on_button: %lu (%ld, %ld)\n", (uw) button, x, y);
+ return true;
+}
+
+static bool on_key (s_window_cairo *window, uw key)
+{
+ assert(window);
+ (void) window;
+ switch (key) {
+ case 9:
+ case 38:
+ g_c3_exit_code = 0;
+ return false;
+ case 100:
+ if (! window_set_sequence_pos((s_window *) window,
+ (window->sequence_pos +
+ window->sequence_count - 1) %
+ window->sequence_count))
+ return false;
+ break;
+ case 102:
+ if (! window_set_sequence_pos((s_window *) window,
+ (window->sequence_pos + 1) %
+ window->sequence_count))
+ return false;
+ break;
+ default:
+ printf("on_key: %lu\n", key);
+ }
+ return true;
+}
diff --git a/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_debug b/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_debug
new file mode 100644
index 0000000..4037945
--- /dev/null
+++ b/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_debug
@@ -0,0 +1,210 @@
+#! /bin/sh
+
+# c3_window_cairo_xcb_demo_debug - temporary wrapper script for .libs/c3_window_cairo_xcb_demo_debug
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# The c3_window_cairo_xcb_demo_debug program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=""
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='2.4.2'
+ notinst_deplibs=' ../libc3_window_cairo_xcb_debug.la /home/dx/c/thodg/c3-lang/c3/libc3/libc3_debug.la /home/dx/c/thodg/c3-lang/c3/libffi/libffi.la'
+else
+ # When we are sourced in execute mode, $file and $ECHO are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ file="$0"
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+ ECHO="print -r --"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string --lt-
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's /usr/local/bin/libtool value, followed by no.
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=$0
+ shift
+ for lt_opt
+ do
+ case "$lt_opt" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
+ test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
+ lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'`
+ cat "$lt_dump_D/$lt_dump_F"
+ exit 0
+ ;;
+ --lt-*)
+ $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n "$lt_option_debug"; then
+ echo "c3_window_cairo_xcb_demo_debug:c3_window_cairo_xcb_demo_debug:${LINENO}: libtool wrapper (GNU libtool) 2.4.2" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ $ECHO "c3_window_cairo_xcb_demo_debug:c3_window_cairo_xcb_demo_debug:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
+ lt_dump_args_N=`expr $lt_dump_args_N + 1`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+
+ if test -n "$lt_option_debug"; then
+ $ECHO "c3_window_cairo_xcb_demo_debug:c3_window_cairo_xcb_demo_debug:${LINENO}: newargv[0]: $progdir/$program" 1>&2
+ func_lt_dump_args ${1+"$@"} 1>&2
+ fi
+ exec "$progdir/$program" ${1+"$@"}
+
+ $ECHO "$0: cannot exec $program $*" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from $@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case " $* " in
+ *\ --lt-*)
+ for lt_wr_arg
+ do
+ case $lt_wr_arg in
+ --lt-*) ;;
+ *) set x "$@" "$lt_wr_arg"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core ${1+"$@"}
+}
+
+ # Parse options
+ func_parse_lt_options "$0" ${1+"$@"}
+
+ # Find the directory that this script lives in.
+ thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+ # special case for '.'
+ if test "$thisdir" = "."; then
+ thisdir=`pwd`
+ fi
+ # remove .libs from thisdir
+ case "$thisdir" in
+ *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;;
+ .libs ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program='c3_window_cairo_xcb_demo_debug'
+ progdir="$thisdir/.libs"
+
+
+ if test -f "$progdir/$program"; then
+ # Add our own library path to LD_LIBRARY_PATH
+ LD_LIBRARY_PATH="/home/dx/c/thodg/c3-lang/c3/libc3/window/cairo/xcb/.libs:/home/dx/c/thodg/c3-lang/c3/libc3/.libs:/home/dx/c/thodg/c3-lang/c3/libffi/.libs:$LD_LIBRARY_PATH"
+
+ # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'`
+
+ export LD_LIBRARY_PATH
+
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+ func_exec_program ${1+"$@"}
+ fi
+ else
+ # The program doesn't exist.
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $ECHO "This script is just a wrapper for $program." 1>&2
+ $ECHO "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
diff --git a/libc3/window/cairo/xcb/demo/configure b/libc3/window/cairo/xcb/demo/configure
index bfa00a3..6cf6623 100755
--- a/libc3/window/cairo/xcb/demo/configure
+++ b/libc3/window/cairo/xcb/demo/configure
@@ -22,6 +22,11 @@ PROG_ASAN=c3_window_cairo_xcb_demo_asan
PROG_COV=c3_window_cairo_xcb_demo_cov
PROG_DEBUG=c3_window_cairo_xcb_demo_debug
+echo "PROG = $PROG" >> ${CONFIG_MK}
+echo "PROG_ASAN = $PROG_ASAN" >> ${CONFIG_MK}
+echo "PROG_COV = $PROG_COV" >> ${CONFIG_MK}
+echo "PROG_DEBUG = $PROG_DEBUG" >> ${CONFIG_MK}
+
. ./sources.sh
OBJECTS="$(c2ext .main.lo "$SOURCES")"
diff --git a/libc3/window/cairo/xcb/demo/sources.mk b/libc3/window/cairo/xcb/demo/sources.mk
index 7e42efa..21e3c6b 100644
--- a/libc3/window/cairo/xcb/demo/sources.mk
+++ b/libc3/window/cairo/xcb/demo/sources.mk
@@ -5,4 +5,5 @@ HEADERS = \
SOURCES = \
c3_window_cairo_demo.c \
c3_window_cairo_xcb_demo.c \
+ window.c \
diff --git a/libc3/window/cairo/xcb/demo/sources.sh b/libc3/window/cairo/xcb/demo/sources.sh
index 6f38605..0bdce4a 100644
--- a/libc3/window/cairo/xcb/demo/sources.sh
+++ b/libc3/window/cairo/xcb/demo/sources.sh
@@ -1,3 +1,3 @@
# sources.sh generated by update_sources
HEADERS=' '
-SOURCES='c3_window_cairo_demo.c c3_window_cairo_xcb_demo.c '
+SOURCES='c3_window_cairo_demo.c c3_window_cairo_xcb_demo.c window.c '
diff --git a/libc3/window/cairo/xcb/demo/window.c b/libc3/window/cairo/xcb/demo/window.c
new file mode 100644
index 0000000..2a00f81
--- /dev/null
+++ b/libc3/window/cairo/xcb/demo/window.c
@@ -0,0 +1,13 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include "../../../window.c"
diff --git a/libc3/window/cairo/xcb/window_cairo_xcb.c b/libc3/window/cairo/xcb/window_cairo_xcb.c
index 9e0fb4d..0bdf20f 100644
--- a/libc3/window/cairo/xcb/window_cairo_xcb.c
+++ b/libc3/window/cairo/xcb/window_cairo_xcb.c
@@ -22,28 +22,86 @@ bool window_cairo_run (s_window_cairo *window)
return window_cairo_xcb_run(window);
}
+bool window_cairo_xcb_event (s_window_cairo *window,
+ cairo_t *cr,
+ xcb_connection_t *conn,
+ cairo_surface_t *surface,
+ xcb_generic_event_t *event)
+{
+ xcb_button_press_event_t *event_button;
+ xcb_configure_notify_event_t *event_config;
+ xcb_key_press_event_t *event_key;
+ switch (event->response_type & ~0x80) {
+ case XCB_BUTTON_PRESS:
+ event_button = (xcb_button_press_event_t *) event;
+ if (! window->button(window, event_button->detail,
+ event_button->event_x,
+ event_button->event_y)) {
+ free(event);
+ return false;
+ }
+ break;
+ case XCB_EXPOSE:
+ if (! window->render(window, cr)) {
+ free(event);
+ return false;
+ }
+ cairo_surface_flush(surface);
+ xcb_flush(conn);
+ break;
+ case XCB_CONFIGURE_NOTIFY:
+ event_config = (xcb_configure_notify_event_t *) event;
+ cairo_xcb_surface_set_size(surface, event_config->width,
+ event_config->height);
+ if (! window->resize(window, event_config->width,
+ event_config->height)) {
+ free(event);
+ return false;
+ }
+ window->w = event_config->width;
+ window->h = event_config->height;
+ break;
+ case XCB_KEY_PRESS:
+ event_key = (xcb_key_press_event_t *) event;
+ if (! window->key(window, event_key->detail)) {
+ free(event);
+ return false;
+ }
+ break;
+ default:
+ printf("event type %d\n", event->response_type & ~0x80);
+ }
+ free(event);
+ return true;
+}
+
bool window_cairo_xcb_run (s_window_cairo *window)
{
- xcb_configure_notify_event_t *configure_event;
xcb_connection_t *conn;
cairo_t *cr;
+ xcb_generic_event_t *event;
+ bool r;
xcb_screen_t *screen;
xcb_visualtype_t *screen_visual;
+ s_time sleep;
cairo_surface_t *surface;
xcb_window_t xcb_window;
- xcb_generic_event_t *event;
conn = xcb_connect(NULL, NULL);
if (xcb_connection_has_error(conn)) {
fprintf(stderr, "Error opening display.\n");
- exit(1);
+ return false;
}
screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;
screen_visual = xcb_screen_visual_type(screen);
xcb_window = xcb_generate_id(conn);
uint32_t value_mask = XCB_CW_EVENT_MASK;
- uint32_t value_list[1] = {XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY};
- xcb_create_window(conn, XCB_COPY_FROM_PARENT, xcb_window, screen->root,
- window->x, window->y, window->w, window->h, 0,
+ uint32_t value_list[1] = {XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_KEY_PRESS |
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY};
+ xcb_create_window(conn, XCB_COPY_FROM_PARENT, xcb_window,
+ screen->root, window->x, window->y,
+ window->w, window->h, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT,
screen->root_visual,
value_mask, value_list);
@@ -52,40 +110,36 @@ bool window_cairo_xcb_run (s_window_cairo *window)
window->title);
xcb_map_window(conn, xcb_window);
xcb_flush(conn);
- surface = cairo_xcb_surface_create(conn, xcb_window, screen_visual, 800, 600);
+ surface = cairo_xcb_surface_create(conn, xcb_window, screen_visual,
+ window->w, window->h);
cr = cairo_create(surface);
window->cr = cr;
- if (window->render(window, cr)) {
- cairo_surface_flush(surface);
- xcb_flush(conn);
- while ((event = xcb_wait_for_event(conn))) {
- switch (event->response_type & ~0x80) {
- case XCB_EXPOSE:
- if (! window->render(window, cr)) {
- free(event);
- goto exit_loop;
- }
- cairo_surface_flush(surface);
- break;
- case XCB_CONFIGURE_NOTIFY:
- configure_event = (xcb_configure_notify_event_t *) event;
- cairo_xcb_surface_set_size(surface, configure_event->width, configure_event->height);
- if (! window->resize(window, configure_event->width,
- configure_event->height)) {
- free(event);
- goto exit_loop;
- }
- break;
- }
- free(event);
+ if (! (r = window->load(window)) ||
+ ! (r = window->render(window, cr)))
+ goto clean;
+ cairo_surface_flush(surface);
+ xcb_flush(conn);
+ while (1) {
+ if ((event = xcb_poll_for_event(conn))) {
+ if (! (r = window_cairo_xcb_event(window, cr, conn, surface,
+ event)))
+ goto clean;
+ }
+ else {
+ sleep.tv_sec = 0;
+ sleep.tv_nsec = 1000000000 / 6;
+ nanosleep(&sleep, NULL);
+ if (! (r = window->render(window, cr)))
+ goto clean;
+ cairo_surface_flush(surface);
xcb_flush(conn);
}
}
- exit_loop:
+ clean:
cairo_destroy(cr);
cairo_surface_destroy(surface);
xcb_disconnect(conn);
- return true;
+ return r;
}
xcb_visualtype_t * xcb_screen_visual_type (xcb_screen_t *screen)
diff --git a/libc3/window/types.h b/libc3/window/types.h
index ab0dcaa..8e3e283 100644
--- a/libc3/window/types.h
+++ b/libc3/window/types.h
@@ -23,6 +23,16 @@
typedef struct window s_window;
/* return false to break event loop */
+typedef bool (*f_window_button) (s_window *window, u8 button,
+ uw x, uw y);
+
+/* return false to break event loop */
+typedef bool (*f_window_key) (s_window *window, uw key);
+
+/* return false to break event loop */
+typedef bool (*f_window_load) (s_window *window);
+
+/* return false to break event loop */
typedef bool (*f_window_render) (s_window *window,
void *render_context);
@@ -30,15 +40,25 @@ typedef bool (*f_window_render) (s_window *window,
typedef bool (*f_window_resize) (s_window *window,
uw w, uw h);
+/* To subtype make a copy of this struct while replacing
+ * pointer types (including pointer to function types).
+ * E.g. see libc3/window/cairo/types.h
+ */
struct window {
- sw x;
- sw y;
- uw w;
- uw h;
- const s8 *title;
+ sw x;
+ sw y;
+ uw w;
+ uw h;
+ f_window_button button;
+ f_window_key key;
+ f_window_load load;
f_window_render render;
+ void *render_context;
f_window_resize resize;
- void *render_context;
+ s_sequence *sequence;
+ uw sequence_count;
+ uw sequence_pos;
+ const s8 *title;
};
#endif /* LIBC3_WINDOW_TYPES_H */
diff --git a/libc3/window/window.c b/libc3/window/window.c
new file mode 100644
index 0000000..d71d0a3
--- /dev/null
+++ b/libc3/window/window.c
@@ -0,0 +1,61 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include <assert.h>
+#include <err.h>
+#include <libc3/c3.h>
+#include "window.h"
+
+bool window_animate (s_window *window)
+{
+ s_time clock_monotonic;
+ s_time delta;
+ s_sequence *seq;
+ f64 t;
+ if (clock_gettime(CLOCK_MONOTONIC, &clock_monotonic)) {
+ warn("window_animate");
+ return false;
+ }
+ if (window->sequence_pos >= window->sequence_count) {
+ warnx("window_animate: window->sequence_pos >="
+ " window->sequence_count");
+ return false;
+ }
+ seq = window->sequence + window->sequence_pos;
+ time_sub(&clock_monotonic, &seq->t0, &delta);
+ time_to_f64(&delta, &t);
+ seq->t = t;
+ printf("window_animate: %f\n", t);
+ if (t > seq->duration &&
+ ! window_set_sequence_pos(window, (window->sequence_pos + 1) %
+ window->sequence_count))
+ return false;
+ return true;
+}
+
+bool window_set_sequence_pos (s_window *window, uw sequence_pos)
+{
+ s_sequence *seq;
+ assert(window);
+ printf("window_set_sequence_pos %lu\n", sequence_pos);
+ if (sequence_pos >= window->sequence_count)
+ return false;
+ seq = window->sequence + sequence_pos;
+ seq->t = 0.0;
+ if (clock_gettime(CLOCK_MONOTONIC, &seq->t0)) {
+ warn("window_set_sequence_pos");
+ return false;
+ }
+ window->sequence_pos = sequence_pos;
+ printf("%s\n", seq->title);
+ return true;
+}
diff --git a/libc3/window/window.h b/libc3/window/window.h
new file mode 100644
index 0000000..716498f
--- /dev/null
+++ b/libc3/window/window.h
@@ -0,0 +1,22 @@
+/* c3
+ * Copyright 2022,2023 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef LIBC3_WINDOW_H
+#define LIBC3_WINDOW_H
+
+#include <libc3/types.h>
+#include "types.h"
+
+bool window_animate (s_window *window);
+bool window_set_sequence_pos (s_window *window, uw sequence_pos);
+
+#endif /* LIBC3_WINDOW_H */
diff --git a/sources.mk b/sources.mk
index dd4c6b7..5a3eaea 100644
--- a/sources.mk
+++ b/sources.mk
@@ -297,6 +297,8 @@ C3_C_SOURCES = \
libc3/buf_parse_s.h.in \
libc3/buf_parse_u.h.in \
libc3/cfn.c \
+ libc3/sequence.h \
+ libc3/sequence.c \
libc3/operator.h \
libc3/float.h \
libc3/f64.c \
@@ -323,6 +325,7 @@ C3_C_SOURCES = \
libc3/s.h.in \
libc3/u.c.in \
libc3/u.h.in \
+ libc3/time.h \
libc3/ptag.c \
libc3/ptag.h \
libc3/ident.c \
@@ -335,12 +338,16 @@ C3_C_SOURCES = \
libc3/window/cairo/types.h \
libc3/window/cairo/window_cairo.h \
libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c \
+ libc3/window/cairo/xcb/demo/window.c \
libc3/window/cairo/xcb/demo/c3_window_cairo_demo.c \
libc3/window/cairo/xcb/window_cairo_xcb.c \
libc3/window/cairo/xcb/window_cairo_xcb.h \
libc3/window/cairo/xcb/config.h \
libc3/window/cairo/window_cairo.c \
libc3/window/types.h \
+ libc3/window/window.h \
+ libc3/window/window.c \
+ libc3/time.c \
libc3/var.c \
libc3/f64.h \
libc3/bool.h \
diff --git a/sources.sh b/sources.sh
index 90fc572..0800980 100644
--- a/sources.sh
+++ b/sources.sh
@@ -1,4 +1,4 @@
# sources.sh generated by update_sources
C3_CONFIGURES='c3c/configure c3s/configure c3s/update_sources ic3/configure ic3/update_sources libc3/update_sources libc3/configure libc3/window/cairo/xcb/configure libc3/window/cairo/xcb/demo/configure libc3/window/cairo/xcb/demo/update_sources libc3/window/cairo/xcb/update_sources libc3/window/configure libtommath/configure libtommath/update_sources test/configure test/update_sources ucd2c/configure '
C3_MAKEFILES='c3c/Makefile c3s/Makefile ic3/Makefile libc3/Makefile libc3/gen.mk libc3/window/cairo/xcb/Makefile libc3/window/cairo/xcb/demo/Makefile libc3/window/Makefile libtommath/Makefile test/Makefile ucd2c/Makefile '
-C3_C_SOURCES='c3c/c3c.c c3s/buf_readline.c c3s/c3s.c c3s/buf_readline.h ic3/buf_linenoise.c ic3/ic3.c ic3/buf_linenoise.h ic3/linenoise.c libc3/buf_inspect_s8_decimal.h libc3/fn.h libc3/buf_inspect_s8_hexadecimal.c libc3/sym.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s16.c libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.h libc3/buf_inspect_s16_decimal.c libc3/buf_inspect_s16_decimal.h libc3/buf_inspect_s16_hexadecimal.c libc3/s8.c libc3/binding.c libc3/binding.h libc3/buf_inspect_s8.c libc3/facts_with_cursor.c libc3/array.h libc3/buf.c libc3/buf_parse.c libc3/integer.h libc3/types.h libc3/type.c libc3/buf_inspect_s8.h libc3/buf_inspect_s8_binary.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_s8_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect.c libc3/buf_file.c libc3/buf_file.h libc3/bool.c libc3/buf_inspect_s16_hexadecimal.h libc3/io.h libc3/buf_inspect_s32.c libc3/buf_inspect_s32.h libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.h libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_s32_decimal.h libc3/buf_inspect_s32_hexadecimal.c libc3/buf_inspect_s32_hexadecimal.h libc3/buf_inspect_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/io.c libc3/abs.h libc3/fn_clause.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_s64_decimal.h libc3/buf_inspect_s64_hexadecimal.c libc3/buf_inspect_s64_hexadecimal.h libc3/buf_inspect_sw.c libc3/buf_inspect_sw.h libc3/buf_inspect_sw_binary.c libc3/set__fact.c libc3/file.c libc3/ceiling.c libc3/buf_parse_c.c libc3/buf_parse_c.h libc3/buf_inspect_sw_binary.h libc3/buf_save.c libc3/buf_inspect_sw_octal.c libc3/buf_parse.h libc3/compare.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_sw_decimal.c libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.h libc3/call.h libc3/buf_inspect_u8.c libc3/buf_inspect_u8.h libc3/buf_parse_s8.c libc3/character.c libc3/buf_save.h libc3/fact.h libc3/buf_inspect_u8_binary.c libc3/error.c libc3/buf_inspect_u8_binary.h libc3/buf_inspect_u8_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u16.c libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_octal.c libc3/buf_parse_s8.h libc3/error.h libc3/character.h libc3/compare.h libc3/buf_inspect_u16_octal.h libc3/buf_inspect_u16_decimal.c libc3/tag.h libc3/sign.h libc3/buf.h libc3/buf_inspect_u16_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_u32.c libc3/buf_inspect_u32.h libc3/buf_inspect_u32_binary.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_u32_octal.c libc3/set__fact.h libc3/buf_inspect_u32_octal.h libc3/error_handler.c libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/set_item.c.in libc3/set_item.h.in libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_u32_decimal.h libc3/buf_inspect_u32_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_inspect_u64.c libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.h libc3/s8.h libc3/error_handler.h libc3/buf_inspect_u64_decimal.c libc3/eval.c libc3/eval.h libc3/buf_inspect_u64_decimal.h libc3/fact.c libc3/facts_cursor.c libc3/ceiling.h libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u64_hexadecimal.h libc3/buf_inspect_uw.c libc3/buf_inspect_uw.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.h libc3/buf_inspect_uw_decimal.c libc3/buf_parse_s16.c libc3/facts_cursor.h libc3/facts_spec.c libc3/frame.h libc3/sign.c libc3/skiplist.c.in libc3/buf_inspect_uw_decimal.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_uw_hexadecimal.h libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h libc3/buf_parse_u16.c libc3/timespec.h libc3/buf_parse_u16.h libc3/buf_parse_u32.c libc3/buf_parse_u32.h libc3/facts_spec.h libc3/facts_spec_cursor.c libc3/buf_parse_u64.c libc3/facts_spec_cursor.h libc3/buf_parse_u64.h libc3/buf_parse_uw.c libc3/buf_parse_uw.h libc3/set__tag.c libc3/set__tag.h libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item__fact.c libc3/set_item__fact.h libc3/operator.c libc3/set_item__tag.c libc3/s16.c libc3/c3.c libc3/set_item__tag.h libc3/facts_with.c libc3/facts_with.h libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/buf_parse_u.c.in libc3/fn_clause.h libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/s16.h libc3/s32.c libc3/s32.h libc3/s64.c libc3/s64.h libc3/sw.c libc3/sw.h libc3/u8.c libc3/u8.h libc3/u16.c libc3/u16.h libc3/u32.c libc3/u32.h libc3/u64.c libc3/module.c libc3/abs.c libc3/u64.h libc3/uw.c libc3/facts_with_cursor.h libc3/uw.h libc3/ident.h libc3/str.c libc3/c_types.h libc3/buf_parse_s.c.in libc3/array.c libc3/buf_inspect.h libc3/set.c.in libc3/list.c libc3/log.c libc3/log.h libc3/sym.h libc3/c3.h libc3/module.h libc3/quote.c libc3/quote.h libc3/env.c libc3/fn.c libc3/set.h.in libc3/tag.c libc3/skiplist.h.in libc3/facts.h libc3/sha1.h libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/tuple.c libc3/tuple.h libc3/ucd.c libc3/ucd.h libc3/hash.h libc3/license.c libc3/str.h libc3/type.h libc3/buf_parse_s.h.in libc3/buf_parse_u.h.in libc3/cfn.c libc3/operator.h libc3/float.h libc3/f64.c libc3/hash.c libc3/frame.c libc3/buf_inspect_s_base.c.in libc3/buf_inspect_s.c.in libc3/buf_inspect_s.h.in libc3/buf_inspect_u.c.in libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u.h.in libc3/c3_main.h libc3/call.c libc3/arg.c libc3/f32.c libc3/buf_inspect_u_base.h.in libc3/env.h libc3/integer.c libc3/cfn.h libc3/f32.h libc3/facts.c libc3/file.h libc3/s.c.in libc3/s.h.in libc3/u.c.in libc3/u.h.in libc3/ptag.c libc3/ptag.h libc3/ident.c libc3/list.h libc3/arg.h libc3/timespec.c libc3/buf_inspect_s_base.h.in libc3/window/cairo/c3_window_cairo_demo.c libc3/window/cairo/c3_window_cairo_demo.h libc3/window/cairo/types.h libc3/window/cairo/window_cairo.h libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c libc3/window/cairo/xcb/demo/c3_window_cairo_demo.c libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/xcb/config.h libc3/window/cairo/window_cairo.c libc3/window/types.h libc3/var.c libc3/f64.h libc3/bool.h libc3/var.h test/facts_with_test.c test/set__fact_test.c test/test.c test/fn_test.c test/test.h test/buf_parse_test.c test/array_test.c test/facts_cursor_test.c test/set__tag_test.c test/tag_test.c test/sym_test.c test/tag_test.h test/tuple_test.c test/types_test.c test/call_test.c test/compare_test.c test/skiplist__fact_test.c test/fact_test.c test/compare_test.h test/str_test.c test/facts_test.c test/hash_test.c test/list_test.c test/ident_test.c test/libc3_test.c test/buf_inspect_test.c test/bool_test.c test/cfn_test.c test/buf_parse_test_s8.c test/buf_parse_test_s32.c test/buf_parse_test_s64.c test/buf_parse_test_u16.c test/buf_parse_test_u8.c test/buf_parse_test_u32.c test/buf_parse_test_u64.c test/env_test.c test/buf_parse_test.h test/buf_test.c test/fact_test.h test/buf_file_test.c test/character_test.c test/buf_parse_test_su.h test/buf_parse_test_s16.c ucd2c/ucd.h ucd2c/ucd2c.c '
+C3_C_SOURCES='c3c/c3c.c c3s/buf_readline.c c3s/c3s.c c3s/buf_readline.h ic3/buf_linenoise.c ic3/ic3.c ic3/buf_linenoise.h ic3/linenoise.c libc3/buf_inspect_s8_decimal.h libc3/fn.h libc3/buf_inspect_s8_hexadecimal.c libc3/sym.c libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_s16.c libc3/buf_inspect_s16.h libc3/buf_inspect_s16_binary.c libc3/buf_inspect_s16_binary.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s16_octal.h libc3/buf_inspect_s16_decimal.c libc3/buf_inspect_s16_decimal.h libc3/buf_inspect_s16_hexadecimal.c libc3/s8.c libc3/binding.c libc3/binding.h libc3/buf_inspect_s8.c libc3/facts_with_cursor.c libc3/array.h libc3/buf.c libc3/buf_parse.c libc3/integer.h libc3/types.h libc3/type.c libc3/buf_inspect_s8.h libc3/buf_inspect_s8_binary.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_s8_octal.c libc3/buf_inspect_s8_octal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect.c libc3/buf_file.c libc3/buf_file.h libc3/bool.c libc3/buf_inspect_s16_hexadecimal.h libc3/io.h libc3/buf_inspect_s32.c libc3/buf_inspect_s32.h libc3/buf_inspect_s32_binary.c libc3/buf_inspect_s32_binary.h libc3/buf_inspect_s32_octal.c libc3/buf_inspect_s32_octal.h libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_s32_decimal.h libc3/buf_inspect_s32_hexadecimal.c libc3/buf_inspect_s32_hexadecimal.h libc3/buf_inspect_s64.c libc3/buf_inspect_s64.h libc3/buf_inspect_s64_binary.c libc3/io.c libc3/abs.h libc3/fn_clause.c libc3/buf_inspect_s64_binary.h libc3/buf_inspect_s64_octal.c libc3/buf_inspect_s64_octal.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_s64_decimal.h libc3/buf_inspect_s64_hexadecimal.c libc3/buf_inspect_s64_hexadecimal.h libc3/buf_inspect_sw.c libc3/buf_inspect_sw.h libc3/buf_inspect_sw_binary.c libc3/set__fact.c libc3/file.c libc3/ceiling.c libc3/buf_parse_c.c libc3/buf_parse_c.h libc3/buf_inspect_sw_binary.h libc3/buf_save.c libc3/buf_inspect_sw_octal.c libc3/buf_parse.h libc3/compare.c libc3/buf_inspect_sw_octal.h libc3/buf_inspect_sw_decimal.c libc3/buf_inspect_sw_decimal.h libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_sw_hexadecimal.h libc3/call.h libc3/buf_inspect_u8.c libc3/buf_inspect_u8.h libc3/buf_parse_s8.c libc3/character.c libc3/buf_save.h libc3/fact.h libc3/buf_inspect_u8_binary.c libc3/error.c libc3/buf_inspect_u8_binary.h libc3/buf_inspect_u8_octal.c libc3/buf_inspect_u8_octal.h libc3/buf_inspect_u8_decimal.c libc3/buf_inspect_u8_decimal.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u8_hexadecimal.h libc3/buf_inspect_u16.c libc3/buf_inspect_u16.h libc3/buf_inspect_u16_binary.c libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u16_octal.c libc3/buf_parse_s8.h libc3/error.h libc3/character.h libc3/compare.h libc3/buf_inspect_u16_octal.h libc3/buf_inspect_u16_decimal.c libc3/tag.h libc3/sign.h libc3/buf.h libc3/buf_inspect_u16_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_u32.c libc3/buf_inspect_u32.h libc3/buf_inspect_u32_binary.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_u32_octal.c libc3/set__fact.h libc3/buf_inspect_u32_octal.h libc3/error_handler.c libc3/set_cursor.c.in libc3/set_cursor.h.in libc3/set_item.c.in libc3/set_item.h.in libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_u32_decimal.h libc3/buf_inspect_u32_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_inspect_u64.c libc3/buf_inspect_u64.h libc3/buf_inspect_u64_binary.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u64_octal.h libc3/s8.h libc3/error_handler.h libc3/buf_inspect_u64_decimal.c libc3/eval.c libc3/eval.h libc3/buf_inspect_u64_decimal.h libc3/fact.c libc3/facts_cursor.c libc3/ceiling.h libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u64_hexadecimal.h libc3/buf_inspect_uw.c libc3/buf_inspect_uw.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_binary.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_uw_octal.h libc3/buf_inspect_uw_decimal.c libc3/buf_parse_s16.c libc3/facts_cursor.h libc3/facts_spec.c libc3/frame.h libc3/sign.c libc3/skiplist.c.in libc3/buf_inspect_uw_decimal.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_uw_hexadecimal.h libc3/buf_parse_s16.h libc3/buf_parse_s32.c libc3/buf_parse_s32.h libc3/buf_parse_s64.c libc3/buf_parse_s64.h libc3/buf_parse_sw.c libc3/buf_parse_sw.h libc3/buf_parse_u8.c libc3/buf_parse_u8.h libc3/buf_parse_u16.c libc3/timespec.h libc3/buf_parse_u16.h libc3/buf_parse_u32.c libc3/buf_parse_u32.h libc3/facts_spec.h libc3/facts_spec_cursor.c libc3/buf_parse_u64.c libc3/facts_spec_cursor.h libc3/buf_parse_u64.h libc3/buf_parse_uw.c libc3/buf_parse_uw.h libc3/set__tag.c libc3/set__tag.h libc3/set_cursor__fact.c libc3/set_cursor__fact.h libc3/set_cursor__tag.c libc3/set_cursor__tag.h libc3/set_item__fact.c libc3/set_item__fact.h libc3/operator.c libc3/set_item__tag.c libc3/s16.c libc3/c3.c libc3/set_item__tag.h libc3/facts_with.c libc3/facts_with.h libc3/skiplist__fact.c libc3/skiplist__fact.h libc3/buf_parse_u.c.in libc3/fn_clause.h libc3/skiplist_node__fact.c libc3/skiplist_node__fact.h libc3/s16.h libc3/s32.c libc3/s32.h libc3/s64.c libc3/s64.h libc3/sw.c libc3/sw.h libc3/u8.c libc3/u8.h libc3/u16.c libc3/u16.h libc3/u32.c libc3/u32.h libc3/u64.c libc3/module.c libc3/abs.c libc3/u64.h libc3/uw.c libc3/facts_with_cursor.h libc3/uw.h libc3/ident.h libc3/str.c libc3/c_types.h libc3/buf_parse_s.c.in libc3/array.c libc3/buf_inspect.h libc3/set.c.in libc3/list.c libc3/log.c libc3/log.h libc3/sym.h libc3/c3.h libc3/module.h libc3/quote.c libc3/quote.h libc3/env.c libc3/fn.c libc3/set.h.in libc3/tag.c libc3/skiplist.h.in libc3/facts.h libc3/sha1.h libc3/skiplist_node.c.in libc3/skiplist_node.h.in libc3/tuple.c libc3/tuple.h libc3/ucd.c libc3/ucd.h libc3/hash.h libc3/license.c libc3/str.h libc3/type.h libc3/buf_parse_s.h.in libc3/buf_parse_u.h.in libc3/cfn.c libc3/sequence.h libc3/sequence.c libc3/operator.h libc3/float.h libc3/f64.c libc3/hash.c libc3/frame.c libc3/buf_inspect_s_base.c.in libc3/buf_inspect_s.c.in libc3/buf_inspect_s.h.in libc3/buf_inspect_u.c.in libc3/buf_inspect_u_base.c.in libc3/buf_inspect_u.h.in libc3/c3_main.h libc3/call.c libc3/arg.c libc3/f32.c libc3/buf_inspect_u_base.h.in libc3/env.h libc3/integer.c libc3/cfn.h libc3/f32.h libc3/facts.c libc3/file.h libc3/s.c.in libc3/s.h.in libc3/u.c.in libc3/u.h.in libc3/time.h libc3/ptag.c libc3/ptag.h libc3/ident.c libc3/list.h libc3/arg.h libc3/timespec.c libc3/buf_inspect_s_base.h.in libc3/window/cairo/c3_window_cairo_demo.c libc3/window/cairo/c3_window_cairo_demo.h libc3/window/cairo/types.h libc3/window/cairo/window_cairo.h libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c libc3/window/cairo/xcb/demo/window.c libc3/window/cairo/xcb/demo/c3_window_cairo_demo.c libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/xcb/config.h libc3/window/cairo/window_cairo.c libc3/window/types.h libc3/window/window.h libc3/window/window.c libc3/time.c libc3/var.c libc3/f64.h libc3/bool.h libc3/var.h test/facts_with_test.c test/set__fact_test.c test/test.c test/fn_test.c test/test.h test/buf_parse_test.c test/array_test.c test/facts_cursor_test.c test/set__tag_test.c test/tag_test.c test/sym_test.c test/tag_test.h test/tuple_test.c test/types_test.c test/call_test.c test/compare_test.c test/skiplist__fact_test.c test/fact_test.c test/compare_test.h test/str_test.c test/facts_test.c test/hash_test.c test/list_test.c test/ident_test.c test/libc3_test.c test/buf_inspect_test.c test/bool_test.c test/cfn_test.c test/buf_parse_test_s8.c test/buf_parse_test_s32.c test/buf_parse_test_s64.c test/buf_parse_test_u16.c test/buf_parse_test_u8.c test/buf_parse_test_u32.c test/buf_parse_test_u64.c test/env_test.c test/buf_parse_test.h test/buf_test.c test/fact_test.h test/buf_file_test.c test/character_test.c test/buf_parse_test_su.h test/buf_parse_test_s16.c ucd2c/ucd.h ucd2c/ucd2c.c '