diff --git a/.gitignore b/.gitignore
index f71f333..3db8edf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@ libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_debug
.libs/
*.lo
*.o
+osx/c3-v*
test/facts_test_dump_file.facts
test/facts_test_log_add.facts
test/facts_test_log_remove.facts
diff --git a/lib/c3/0.1/map.facts b/lib/c3/0.1/map.facts
new file mode 100644
index 0000000..de43112
--- /dev/null
+++ b/lib/c3/0.1/map.facts
@@ -0,0 +1,11 @@
+%{module: C3.Facts.Dump,
+ version: 1}
+add {Map, :is_a, :module}
+add {Map, :symbol, Map.cast}
+add {Map, :symbol, Map.map}
+add {Map, :symbol, Map.to_list}
+replace {Map.cast, :cfn, cfn Map "map_cast" (Tag, Result)}
+replace {Map.map, :cfn, cfn List "map_map" (Map, Fn, Result)}
+replace {Map.to_list, :fn, fn (%{} = map) {
+ Map.map(map, fn (k, v) { {k, v} })
+}}
diff --git a/libc3/c3.h b/libc3/c3.h
index b5f798d..9e66e49 100644
--- a/libc3/c3.h
+++ b/libc3/c3.h
@@ -51,6 +51,8 @@
#include "env.h"
#include "error.h"
#include "eval.h"
+#include "f32.h"
+#include "f64.h"
#include "fact.h"
#include "facts.h"
#include "facts_cursor.h"
diff --git a/libc3/f64.c b/libc3/f64.c
index 09fc4b5..1e45af7 100644
--- a/libc3/f64.c
+++ b/libc3/f64.c
@@ -12,6 +12,7 @@
*/
#include <assert.h>
#include <err.h>
+#include <stdlib.h>
#include "integer.h"
#include "tag.h"
#include "f64.h"
@@ -88,3 +89,9 @@ f64 * f64_copy (const f64 *src, f64 *dest)
*dest = *src;
return dest;
}
+
+f64 * f64_random (f64 *dest)
+{
+ *dest = (f64) random() / (((u32) 1 << 31) - 1);
+ return dest;
+}
diff --git a/libc3/f64.h b/libc3/f64.h
index 4febe84..6feefac 100644
--- a/libc3/f64.h
+++ b/libc3/f64.h
@@ -15,7 +15,8 @@
#include "types.h"
-f64 f64_cast (s_tag *tag);
+f64 f64_cast (s_tag *tag);
f64 * f64_copy (const f64 *src, f64 *dest);
+f64 * f64_random (f64 *dest);
#endif /* LIBC3_F64_H */
diff --git a/libc3/list.h b/libc3/list.h
index c0b3b0b..1bef506 100644
--- a/libc3/list.h
+++ b/libc3/list.h
@@ -37,7 +37,8 @@ s_list * list_delete (s_list *list);
void list_delete_all (s_list *list);
/* Observers */
-s_list ** list_copy (const s_list **src, s_list **dest);
+s_list ** list_cast (const s_tag *tag, s_list **list);
+s_list ** list_copy (const s_list **src, s_list **dest);
sw list_length (const s_list *list);
s_list * list_next (const s_list *list);
s_array * list_to_array (s_list *list, const s_sym *type,
diff --git a/libc3/map.c b/libc3/map.c
index d993f3e..b28f7e8 100644
--- a/libc3/map.c
+++ b/libc3/map.c
@@ -33,6 +33,16 @@ s_tag * map_access (const s_map *map, const s_tag *key, s_tag *value)
return map_get(map, key, value);
}
+s_map * map_cast (const s_tag *tag, s_map *map)
+{
+ assert(tag);
+ if (tag->type == TAG_MAP) {
+ map_copy(&tag->data.map, map);
+ return map;
+ }
+ return NULL;
+}
+
void map_clean (s_map *map)
{
uw i = 0;
@@ -135,6 +145,19 @@ s_map * map_init_from_lists (s_map *map, const s_list *keys,
return NULL;
}
+s_list ** map_map (const s_map *map, const s_fn *fn, s_list **result)
+{
+ assert(map);
+ assert(fn);
+ assert(result);
+ (void) map;
+ (void) fn;
+ (void) result;
+ assert(! "not implemented");
+ errx(1, "not implemented");
+ return NULL;
+}
+
s_map * map_new (uw count)
{
s_map *map;
diff --git a/libc3/map.h b/libc3/map.h
index 9025dcc..31ebd1f 100644
--- a/libc3/map.h
+++ b/libc3/map.h
@@ -37,6 +37,7 @@ s_map * map_copy (const s_map *src, s_map *dest);
/* Operators */
s_tag * map_access (const s_map *map, const s_tag *key, s_tag *value);
+s_map * map_cast (const s_tag *tag, s_map *map);
s_tag * map_get (const s_map *map, const s_tag *key, s_tag *dest);
s_map * map_update (const s_map *map, const s_tag *key,
const s_tag *value, s_map *dest);
diff --git a/libc3/sequence.c b/libc3/sequence.c
index 60f22c1..aab9017 100644
--- a/libc3/sequence.c
+++ b/libc3/sequence.c
@@ -14,13 +14,14 @@
#include "sequence.h"
s_sequence * sequence_init (s_sequence *sequence, f64 duration,
- const s8 *title,
+ const s8 *title, f_sequence_load load,
f_sequence_render render)
{
assert(sequence);
sequence->t = 0.0;
sequence->duration = duration;
sequence->title = title;
+ sequence->load = load;
sequence->render = render;
return sequence;
}
diff --git a/libc3/sequence.h b/libc3/sequence.h
index dbccd4b..d4a2c53 100644
--- a/libc3/sequence.h
+++ b/libc3/sequence.h
@@ -16,7 +16,7 @@
#include "types.h"
s_sequence * sequence_init (s_sequence *sequence, f64 duration,
- const s8 *title,
+ const s8 *title, f_sequence_load load,
f_sequence_render render);
#endif /* LIBC3_SEQUENCE_H */
diff --git a/libc3/types.h b/libc3/types.h
index c9e31f4..fe101db 100644
--- a/libc3/types.h
+++ b/libc3/types.h
@@ -181,7 +181,9 @@ typedef sw (* f_buf_inspect) (s_buf *buf, const void *x);
typedef sw (* f_buf_inspect_size) (const void *x);
typedef sw (* f_buf_parse) (s_buf *buf, void *dest);
typedef void * (* f_copy) (const void *a, void *b);
-typedef void (* f_sequence_render) (void *window, void *render_context,
+typedef bool (* f_sequence_load) (s_sequence *seq);
+typedef void (* f_sequence_render) (void *window,
+ void *render_context,
s_sequence *seq);
#define CHARACTER_MAX S32_MAX
@@ -454,9 +456,10 @@ struct list {
};
struct sequence {
- s_tag data;
+ s_tag tag;
f64 dt;
f64 duration;
+ f_sequence_load load;
f_sequence_render render;
f64 t;
s_time t0;
diff --git a/libc3/window/cairo/Makefile b/libc3/window/cairo/Makefile
index 8b586d4..6e1f3c7 100644
--- a/libc3/window/cairo/Makefile
+++ b/libc3/window/cairo/Makefile
@@ -12,6 +12,7 @@
build:
${MAKE} ${LIB}
+ ${MAKE} -C demo build
if ${HAVE_COCOA}; then ${MAKE} -C quartz build; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 build; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb build; fi
@@ -24,39 +25,47 @@ all:
asan:
${MAKE} ${LIB_ASAN}
+ ${MAKE} -C demo asan
if ${HAVE_COCOA}; then ${MAKE} -C quartz asan; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 asan; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb asan; fi
clean:
+ ${MAKE} -C demo clean
if ${HAVE_COCOA}; then ${MAKE} -C quartz clean; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 clean; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb clean; fi
clean_cov:
+ ${MAKE} -C demo clean_cov
if ${HAVE_COCOA}; then ${MAKE} -C quartz clean_cov; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 clean_cov; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb clean_cov; fi
cov:
${MAKE} ${LIB_COV}
+ ${MAKE} -C demo cov
if ${HAVE_COCOA}; then ${MAKE} -C quartz cov; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 cov; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb cov; fi
debug:
${MAKE} ${LIB_DEBUG}
+ ${MAKE} -C demo debug
if ${HAVE_COCOA}; then ${MAKE} -C quartz debug; else if ${HAVE_WIN32}; then ${MAKE} -C win32 debug; else if ${HAVE_XCB}; then ${MAKE} -C xcb debug; fi; fi; fi
demo: build
if ${HAVE_COCOA}; then ${MAKE} -C quartz demo; else if ${HAVE_WIN32}; then ${MAKE} -C win32 demo; else if ${HAVE_XCB}; then ${MAKE} -C xcb demo; fi; fi; fi
distclean:
+ rm -rf ${DISTCLEANFILES}
+ ${MAKE} -C demo distclean
if ${HAVE_COCOA}; then ${MAKE} -C quartz distclean; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 distclean; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb distclean; fi
gcovr:
+ ${MAKE} -C demo gcovr
if ${HAVE_COCOA}; then ${MAKE} -C quartz gcovr; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 gcovr; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb gcovr; fi
@@ -78,6 +87,7 @@ lldb_demo: debug
if ${HAVE_COCOA}; then ${MAKE} -C quartz lldb_demo; else if ${HAVE_WIN32}; then ${MAKE} -C win32 lldb_demo; else if ${HAVE_XCB}; then ${MAKE} -C xcb lldb_demo; fi; fi
test:
+ ${MAKE} -C demo test
if ${HAVE_COCOA}; then ${MAKE} -C quartz test; fi
if ${HAVE_WIN32}; then ${MAKE} -C win32 test; fi
if ${HAVE_XCB}; then ${MAKE} -C xcb test; fi
diff --git a/libc3/window/cairo/c3_window_cairo_demo.c b/libc3/window/cairo/c3_window_cairo_demo.c
deleted file mode 100644
index 26fa7f3..0000000
--- a/libc3/window/cairo/c3_window_cairo_demo.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* 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 <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <libc3/c3.h>
-#include <cairo/cairo.h>
-#include <xkbcommon/xkbcommon.h>
-#include "../window.h"
-#include "window_cairo.h"
-#include "c3_window_cairo_demo.h"
-#include "types.h"
-
-bool c3_window_cairo_demo_button (s_window_cairo *window, u8 button,
- sw x, sw y)
-{
- assert(window);
- (void) window;
- printf("c3_window_cairo_demo_button: %lu (%ld, %ld)\n", (uw) button, x, y);
- return true;
-}
-
-bool c3_window_cairo_demo_key (s_window_cairo *window, uw keysym)
-{
- char keysym_name[64];
- assert(window);
- (void) window;
- switch (keysym) {
- case XKB_KEY_Escape:
- case XKB_KEY_q:
- g_c3_exit_code = 0;
- return false;
- case XKB_KEY_Left:
- if (! window_set_sequence_pos((s_window *) window,
- (window->sequence_pos +
- window->sequence_count - 1) %
- window->sequence_count))
- return false;
- break;
- case XKB_KEY_Right:
- if (! window_set_sequence_pos((s_window *) window,
- (window->sequence_pos + 1) %
- window->sequence_count))
- return false;
- break;
- default:
- xkb_keysym_get_name(keysym, keysym_name, sizeof(keysym_name));
- printf("c3_window_cairo_demo_key: %lu %s\n", keysym, keysym_name);
- }
- return true;
-}
-
-bool c3_window_cairo_demo_load (s_window_cairo *window)
-{
- assert(window->sequence_count == C3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
- window_cairo_sequence_init(window->sequence, 8.0,
- "01. Background rectangles",
- c3_window_cairo_demo_render_bg_rect);
- window_cairo_sequence_init(window->sequence + 1, 30.0,
- "02. Lightspeed",
- c3_window_cairo_demo_render_lightspeed);
- 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;
- cairo_text_extents_t te;
- assert(window);
- assert(cr);
- if (! window_animate((s_window *) window))
- return false;
- seq = window->sequence + window->sequence_pos;
- seq->render(window, cr, seq);
- /* text */
- cairo_set_font_size(cr, 20);
- cairo_select_font_face(cr, "Courier New",
- CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
- cairo_text_extents(cr, seq->title, &te);
- /* text bg */
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
- cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 21);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 20);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 19);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 21);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 19);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 19);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 20);
- cairo_show_text(cr, seq->title);
- cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 21);
- cairo_show_text(cr, seq->title);
- /* text */
- cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
- cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 20);
- cairo_show_text(cr, seq->title);
- /* progress bar */
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
- cairo_rectangle(cr, 19, window->h - 12,
- (window->w - 40.0) * seq->t / seq->duration + 2,
- 4);
- cairo_fill(cr);
- cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
- cairo_rectangle(cr, 20, window->h - 11,
- (window->w - 40.0) * seq->t / seq->duration,
- 2);
- cairo_fill(cr);
- return true;
-}
-
-void c3_window_cairo_demo_render_bg_rect (s_window_cairo *window,
- cairo_t *cr,
- s_sequence *seq)
-{
-#define C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX 8
- const s_rgb color[C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX] = {
- {1, 1, 1},
- {1, 0, 0},
- {1, 1, 0},
- {0, 1, 0},
- {0, 1, 1},
- {0, 0, 1},
- {1, 0, 1},
- {0, 0, 0}
- };
- u8 c1;
- u8 c2;
- double p;
- double q;
- s_rgb rgb;
- c1 = (u8) trunc(seq->t) % C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX;
- c2 = (u8) trunc(seq->t + 1.0) % C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX;
- p = fmod(seq->t, 1.0);
- q = 1.0 - p;
- rgb.r = color[c1].r * q + color[c2].r * p;
- rgb.g = color[c1].g * q + color[c2].g * p;
- rgb.b = color[c1].b * q + color[c2].b * p;
- cairo_set_source_rgb(cr, rgb.r, rgb.g, rgb.b);
- cairo_rectangle(cr, 0, 0, window->w, window->h);
- cairo_fill(cr);
-}
-
-f64 frandom (void)
-{
- return (double) random() / (((sw) 1 << 31) - 1);
-}
-
-static void star_init (s_tag *star)
-{
- tag_init_map(star, 3);
- tag_init_sym(star->data.map.keys, sym_1("speed"));
- tag_init_f64(star->data.map.values, 0.0);
- tag_init_sym(star->data.map.keys + 1, sym_1("x"));
- tag_init_f64(star->data.map.values + 1, 2.0 * frandom() - 1.0);
- tag_init_sym(star->data.map.keys + 2, sym_1("y"));
- tag_init_f64(star->data.map.values + 2, 2.0 * frandom() - 1.0);
-}
-
-static void star_render (s_tag *star, s_window_cairo *window,
- cairo_t *cr, s_sequence *seq)
-{
- f64 q;
- f64 *speed;
- f64 *x;
- f64 *y;
- (void) window;
- speed = &star->data.map.values[0].data.f64;
- x = &star->data.map.values[1].data.f64;
- y = &star->data.map.values[2].data.f64;
- cairo_set_line_width(cr, 0.01);
- cairo_set_source_rgb(cr, 1, 1, 1);
- cairo_move_to(cr, *x, *y);
- q = (1 + *speed / 10);
- cairo_line_to(cr, *x * q, *y * q);
- cairo_stroke(cr);
- q = (1 + *speed / 100);
- *x = *x * q;
- *y = *y * q;
- *speed += seq->dt;
- if (*x < -1.0 || *x > 1.0 || *y < -1.0 || *y > 1.0)
- star_init(star);
-}
-
-void c3_window_cairo_demo_render_lightspeed (s_window_cairo *window,
- cairo_t *cr,
- s_sequence *seq)
-{
- uw i;
- cairo_matrix_t matrix;
- cairo_get_matrix(cr, &matrix);
- cairo_scale(cr, window->w / 2.0, window->h / 2.0);
- cairo_translate(cr, 1.0, 1.0);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_rectangle(cr, -1, -1, 2, 2);
- cairo_fill(cr);
- if (seq->data.type == TAG_VOID) {
- tag_init_tuple(&seq->data, C3_WINDOW_CAIRO_DEMO_LIGHTSPEED_STARS);
- i = 0;
- while (i < C3_WINDOW_CAIRO_DEMO_LIGHTSPEED_STARS) {
- star_init(seq->data.data.tuple.tag + i);
- i++;
- }
- }
- i = 0;
- while (i < C3_WINDOW_CAIRO_DEMO_LIGHTSPEED_STARS) {
- star_render(seq->data.data.tuple.tag + i, window, cr, seq);
- i++;
- }
- cairo_set_matrix(cr, &matrix);
-}
-
-bool c3_window_cairo_demo_resize (s_window_cairo *window,
- uw w, uw h)
-{
- assert(window);
- (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
deleted file mode 100644
index 121546d..0000000
--- a/libc3/window/cairo/c3_window_cairo_demo.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_CAIRO_DEMO_H
-#define LIBC3_WINDOW_CAIRO_DEMO_H
-
-#include <libc3/types.h>
-#include "types.h"
-
-#define C3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT 2
-#define C3_WINDOW_CAIRO_DEMO_LIGHTSPEED_STARS 100
-
-bool c3_window_cairo_demo_button (s_window_cairo *window, u8 button,
- sw x, sw y);
-bool c3_window_cairo_demo_key (s_window_cairo *window, uw keysym);
-bool c3_window_cairo_demo_load (s_window_cairo *window);
-bool c3_window_cairo_demo_render (s_window_cairo *window, cairo_t *cr);
-void c3_window_cairo_demo_render_bg_rect (s_window_cairo *window,
- cairo_t *cr,
- s_sequence *seq);
-void c3_window_cairo_demo_render_lightspeed (s_window_cairo *window,
- cairo_t *cr,
- s_sequence *seq);
-bool c3_window_cairo_demo_resize (s_window_cairo *window, uw w, uw h);
-
-#endif /* LIBC3_WINDOW_CAIRO_DEMO_H */
diff --git a/libc3/window/cairo/configure b/libc3/window/cairo/configure
index 076523b..1014bfb 100755
--- a/libc3/window/cairo/configure
+++ b/libc3/window/cairo/configure
@@ -152,6 +152,8 @@ echo "HAVE_WIN32 = $HAVE_WIN32" >> ${CONFIG_MK}
update_config_mk
env_reset
+( cd demo && ./configure; )
+
if ${HAVE_COCOA}; then
( cd quartz && ./configure; )
fi
diff --git a/libc3/window/cairo/demo/Makefile b/libc3/window/cairo/demo/Makefile
new file mode 100644
index 0000000..10f0658
--- /dev/null
+++ b/libc3/window/cairo/demo/Makefile
@@ -0,0 +1,65 @@
+## 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.
+
+CLEANFILES = *.a *.gcno *.la .libs *.lo *.o
+
+CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
+
+CLEANFILES += ${CLEANFILES_COV}
+
+DISTCLEANFILES = ${CLEANFILES} config.h config.mk
+
+build:
+ ${MAKE} ${LIB}
+
+all:
+ ${MAKE} build
+ if ${HAVE_GCOV}; then ${MAKE} cov; fi
+ ${MAKE} debug
+ if ${HAVE_ASAN}; then ${MAKE} asan; fi
+
+asan:
+ ${MAKE} ${LIB_ASAN}
+
+clean:
+ rm -rf ${CLEANFILES}
+
+clean_cov:
+ rm -rf ${CLEANFILES_COV}
+
+cov:
+ ${MAKE} ${LIB_COV}
+
+debug:
+ ${MAKE} ${LIB_DEBUG}
+
+distclean:
+ rm -rf ${DISTCLEANFILES}
+
+gcovr:
+ gcovr --gcov-executable ${GCOV} --html-details demo.html
+
+update_sources:
+ ./update_sources
+
+.PHONY: \
+ all \
+ asan \
+ build \
+ clean \
+ cov \
+ debug \
+ distclean \
+ update_sources
+
+include config.mk
+include sources.mk
diff --git a/libc3/window/cairo/demo/bg_rect.c b/libc3/window/cairo/demo/bg_rect.c
new file mode 100644
index 0000000..6f7d5ee
--- /dev/null
+++ b/libc3/window/cairo/demo/bg_rect.c
@@ -0,0 +1,55 @@
+/* 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 <math.h>
+#include <libc3/c3.h>
+#include "../types.h"
+#include "bg_rect.h"
+
+bool bg_rect_load (s_sequence *seq)
+{
+ (void) seq;
+ return true;
+}
+
+void bg_rect_render (s_window_cairo *window,
+ cairo_t *cr,
+ s_sequence *seq)
+{
+#define C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX 8
+ const s_rgb color[C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX] = {
+ {1, 1, 1},
+ {1, 0, 0},
+ {1, 1, 0},
+ {0, 1, 0},
+ {0, 1, 1},
+ {0, 0, 1},
+ {1, 0, 1},
+ {0, 0, 0}
+ };
+ u8 c1;
+ u8 c2;
+ double p;
+ double q;
+ s_rgb rgb;
+ c1 = (u8) trunc(seq->t) % C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX;
+ c2 = (u8) trunc(seq->t + 1.0) % C3_WINDOW_CAIRO_DEMO_BG_RECT_COLOR_MAX;
+ p = fmod(seq->t, 1.0);
+ q = 1.0 - p;
+ rgb.r = color[c1].r * q + color[c2].r * p;
+ rgb.g = color[c1].g * q + color[c2].g * p;
+ rgb.b = color[c1].b * q + color[c2].b * p;
+ cairo_set_source_rgb(cr, rgb.r, rgb.g, rgb.b);
+ cairo_rectangle(cr, 0, 0, window->w, window->h);
+ cairo_fill(cr);
+}
diff --git a/libc3/window/cairo/demo/bg_rect.h b/libc3/window/cairo/demo/bg_rect.h
new file mode 100644
index 0000000..96f2d3e
--- /dev/null
+++ b/libc3/window/cairo/demo/bg_rect.h
@@ -0,0 +1,23 @@
+/* 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 BG_RECT_H
+#define BG_RECT_H
+
+#include "../types.h"
+
+bool bg_rect_load (s_sequence *seq);
+void bg_rect_render (s_window_cairo *window,
+ cairo_t *cr,
+ s_sequence *seq);
+
+#endif /* BG_RECT_H */
diff --git a/libc3/window/cairo/demo/configure b/libc3/window/cairo/demo/configure
new file mode 100755
index 0000000..feb9fd9
--- /dev/null
+++ b/libc3/window/cairo/demo/configure
@@ -0,0 +1,137 @@
+#!/bin/sh
+## 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.
+
+set -e
+
+export SRC_TOP="$(dirname "$PWD")"
+
+. ../../../../config.subr
+
+LIB=libc3_window_cairo_demo.la
+LIB_ASAN=libc3_window_cairo_demo_asan.la
+LIB_COV=libc3_window_cairo_demo_cov.la
+LIB_DEBUG=libc3_window_cairo_demo_debug.la
+
+echo "LIB = $LIB" >> ${CONFIG_MK}
+echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
+echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
+echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
+
+. ./sources.sh
+
+OBJECTS="$(c2ext .main.lo "$SOURCES")"
+echo "OBJECTS = $OBJECTS" >> ${CONFIG_MK}
+OBJECTS_ASAN="$(c2ext .asan.lo "$SOURCES")"
+OBJECTS_COV="$(c2ext .cov.lo "$SOURCES")"
+OBJECTS_DEBUG="$(c2ext .debug.lo "$SOURCES")"
+
+# Common config for all targets
+CPPFLAGS="-I../../../../libffi/include -I../../../.. $CPPFLAGS"
+CFLAGS="$CFLAGS -W -Wall -Werror -std=c99 -pedantic"
+LDFLAGS="--shared -no-undefined ${LDFLAGS}"
+LIBS="$LIBS -rpath ${PREFIX}/lib"
+config_asan
+config_gnu
+pkg_config cairo
+pkg_config libbsd-overlay
+pkg_config xkbcommon
+config_define PREFIX "\"${PREFIX}\""
+
+# Address Sanitizer config
+CFLAGS_ASAN="$CFLAGS -O1 -fsanitize=address -fno-omit-frame-pointer -g"
+LDFLAGS_ASAN="$LDFLAGS"
+LIBS_LOCAL_ASAN="../libc3_window_cairo_asan.la"
+LIBS_ASAN="$LIBS_LOCAL_ASAN $LIBS"
+
+# Coverage config
+CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs -fprofile-generate"
+LDFLAGS_COV="$LDFLAGS --coverage"
+LIBS_LOCAL_COV="../libc3_window_cairo_cov.la"
+LIBS_COV="$LIBS_LOCAL_COV $LIBS"
+
+# Debug config
+CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
+LDFLAGS_DEBUG="$LDFLAGS"
+LIBS_LOCAL_DEBUG="../libc3_window_cairo_debug.la"
+LIBS_DEBUG="$LIBS_LOCAL_DEBUG $LIBS"
+
+# Main config
+DEFAULT_CFLAGS="-O2 -pipe"
+if [ "x$ENV_CFLAGS" = "x" ]; then
+ CFLAGS="$CFLAGS $DEFAULT_CFLAGS"
+fi
+CFLAGS="$CFLAGS -DNDEBUG"
+LIBS_LOCAL="../libc3_window_cairo.la"
+LIBS="$LIBS_LOCAL $LIBS"
+
+echo "LIB = $LIB" >> ${CONFIG_MK}
+echo "HAVE_ASAN = $HAVE_ASAN" >> ${CONFIG_MK}
+echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
+echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
+echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
+echo "LIBS = $LIBS" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
+echo "CFLAGS_ASAN = $CFLAGS_ASAN" >> ${CONFIG_MK}
+echo "LDFLAGS_ASAN = $LDFLAGS_ASAN" >> ${CONFIG_MK}
+echo "LIBS_ASAN = $LIBS_ASAN" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
+echo "CFLAGS_COV = $CFLAGS_COV" >> ${CONFIG_MK}
+echo "LDFLAGS_COV = $LDFLAGS_COV" >> ${CONFIG_MK}
+echo "LIBS_COV = $LIBS_COV" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
+echo "CFLAGS_DEBUG = $CFLAGS_DEBUG" >> ${CONFIG_MK}
+echo "LDFLAGS_DEBUG = $LDFLAGS_DEBUG" >> ${CONFIG_MK}
+echo "LIBS_DEBUG = $LIBS_DEBUG" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "$LIB: $LIBS_LOCAL $OBJECTS" >> ${CONFIG_MK}
+echo " ${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS} ${OBJECTS} \${LIBS} -rpath ${LIBDIR} -o ${LIB}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "$LIB_ASAN: $LIBS_LOCAL_ASAN $OBJECTS_ASAN" >> ${CONFIG_MK}
+echo " ${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS_ASAN} ${OBJECTS_ASAN} \${LIBS_ASAN} -rpath ${LIBDIR} -o ${LIB_ASAN}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "$LIB_COV: $LIBS_LOCAL_COV $OBJECTS_COV" >> ${CONFIG_MK}
+echo " ${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS_COV} ${OBJECTS_COV} \${LIBS_COV} -rpath ${LIBDIR} -o ${LIB_COV}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "$LIB_DEBUG: $LIBS_LOCAL_DEBUG $OBJECTS_DEBUG" >> ${CONFIG_MK}
+echo " ${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS_DEBUG} ${OBJECTS_DEBUG} \${LIBS_DEBUG} -rpath ${LIBDIR} -o ${LIB_DEBUG}" >> ${CONFIG_MK}
+
+for SRC in $SOURCES; do
+ echo >> ${CONFIG_MK}
+ SRC_LO="$(c2ext .main.lo "$SRC")"
+ c_ext_rule .main.lo "$SRC" >> ${CONFIG_MK}
+ echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
+
+ echo >> ${CONFIG_MK}
+ SRC_ASAN_LO="$(c2ext .asan.lo "$SRC")"
+ c_ext_rule .asan.lo "$SRC" >> ${CONFIG_MK}
+ echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_ASAN} -c $SRC -o $SRC_ASAN_LO" >> ${CONFIG_MK}
+
+ echo >> ${CONFIG_MK}
+ SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
+ c_ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
+ echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_COV_LO" >> ${CONFIG_MK}
+
+ echo >> ${CONFIG_MK}
+ SRC_DEBUG_LO="$(c2ext .debug.lo "$SRC")"
+ c_ext_rule .debug.lo "$SRC" >> ${CONFIG_MK}
+ echo " ${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_DEBUG} -c $SRC -o $SRC_DEBUG_LO" >> ${CONFIG_MK}
+done
+
+update_config_mk
diff --git a/libc3/window/cairo/demo/lightspeed.c b/libc3/window/cairo/demo/lightspeed.c
new file mode 100644
index 0000000..51067d5
--- /dev/null
+++ b/libc3/window/cairo/demo/lightspeed.c
@@ -0,0 +1,87 @@
+/* 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 <libc3/c3.h>
+#include "lightspeed.h"
+
+static void star_init (s_tag *star)
+{
+ f64 x;
+ f64 y;
+ f64_random(&x);
+ f64_random(&y);
+ tag_init_map(star, 3);
+ tag_init_sym(star->data.map.keys, sym_1("speed"));
+ tag_init_f64(star->data.map.values, 0.0);
+ tag_init_sym(star->data.map.keys + 1, sym_1("x"));
+ tag_init_f64(star->data.map.values + 1, 2.0 * x - 1.0);
+ tag_init_sym(star->data.map.keys + 2, sym_1("y"));
+ tag_init_f64(star->data.map.values + 2, 2.0 * y - 1.0);
+}
+
+static void star_render (s_tag *star, s_window_cairo *window,
+ cairo_t *cr, s_sequence *seq)
+{
+ f64 q;
+ f64 *speed;
+ f64 *x;
+ f64 *y;
+ (void) window;
+ speed = &star->data.map.values[0].data.f64;
+ x = &star->data.map.values[1].data.f64;
+ y = &star->data.map.values[2].data.f64;
+ cairo_set_line_width(cr, 0.004);
+ cairo_set_source_rgb(cr, 1, 1, 1);
+ cairo_move_to(cr, *x, *y);
+ q = (1 + *speed / 20);
+ cairo_line_to(cr, *x * q, *y * q);
+ cairo_stroke(cr);
+ q = (1 + *speed / 100);
+ *x = *x * q;
+ *y = *y * q;
+ *speed += seq->dt;
+ if (*x < -1.0 || *x > 1.0 || *y < -1.0 || *y > 1.0)
+ star_init(star);
+}
+
+bool lightspeed_load (s_sequence *seq)
+{
+ uw i;
+ tag_clean(&seq->tag);
+ tag_init_tuple(&seq->tag, LIGHTSPEED_STARS);
+ i = 0;
+ while (i < LIGHTSPEED_STARS) {
+ star_init(seq->tag.data.tuple.tag + i);
+ i++;
+ }
+ return true;
+}
+
+void lightspeed_render (s_window_cairo *window,
+ cairo_t *cr,
+ s_sequence *seq)
+{
+ uw i;
+ cairo_matrix_t matrix;
+ cairo_get_matrix(cr, &matrix);
+ cairo_scale(cr, window->w / 2.0, window->h / 2.0);
+ cairo_translate(cr, 1.0, 1.0);
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ cairo_rectangle(cr, -1, -1, 2, 2);
+ cairo_fill(cr);
+ i = 0;
+ while (i < LIGHTSPEED_STARS) {
+ star_render(seq->tag.data.tuple.tag + i, window, cr, seq);
+ i++;
+ }
+ cairo_set_matrix(cr, &matrix);
+}
diff --git a/libc3/window/cairo/demo/lightspeed.h b/libc3/window/cairo/demo/lightspeed.h
new file mode 100644
index 0000000..72d973c
--- /dev/null
+++ b/libc3/window/cairo/demo/lightspeed.h
@@ -0,0 +1,25 @@
+/* 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 LIGHTSPEED_H
+#define LIGHTSPEED_H
+
+#include "../types.h"
+
+#define LIGHTSPEED_STARS 1000
+
+bool lightspeed_load (s_sequence *seq);
+void lightspeed_render (s_window_cairo *window,
+ cairo_t *cr,
+ s_sequence *seq);
+
+#endif /* LIGHTSPEED_H */
diff --git a/libc3/window/cairo/demo/sources.mk b/libc3/window/cairo/demo/sources.mk
new file mode 100644
index 0000000..80ba532
--- /dev/null
+++ b/libc3/window/cairo/demo/sources.mk
@@ -0,0 +1,11 @@
+# sources.mk generated by update_sources
+HEADERS = \
+ bg_rect.h \
+ lightspeed.h \
+ window_cairo_demo.h \
+
+SOURCES = \
+ bg_rect.c \
+ lightspeed.c \
+ window_cairo_demo.c \
+
diff --git a/libc3/window/cairo/demo/sources.sh b/libc3/window/cairo/demo/sources.sh
new file mode 100644
index 0000000..3effa5f
--- /dev/null
+++ b/libc3/window/cairo/demo/sources.sh
@@ -0,0 +1,3 @@
+# sources.sh generated by update_sources
+HEADERS='bg_rect.h lightspeed.h window_cairo_demo.h '
+SOURCES='bg_rect.c lightspeed.c window_cairo_demo.c '
diff --git a/libc3/window/cairo/demo/update_sources b/libc3/window/cairo/demo/update_sources
new file mode 100755
index 0000000..0afdc30
--- /dev/null
+++ b/libc3/window/cairo/demo/update_sources
@@ -0,0 +1,26 @@
+#!/bin/sh
+## 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.
+
+. ../../../../config.subr
+
+echo "# sources.mk generated by update_sources" > ${SOURCES_MK}
+echo "# sources.sh generated by update_sources" > ${SOURCES_SH}
+
+HEADERS="$(ls *.h | sort)"
+sources HEADERS "$HEADERS"
+
+SOURCES="$(ls *.c | sort)"
+sources SOURCES "$SOURCES"
+
+update_sources_mk
+update_sources_sh
diff --git a/libc3/window/cairo/demo/window_cairo_demo.c b/libc3/window/cairo/demo/window_cairo_demo.c
new file mode 100644
index 0000000..b63cd81
--- /dev/null
+++ b/libc3/window/cairo/demo/window_cairo_demo.c
@@ -0,0 +1,138 @@
+/* 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 <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <libc3/c3.h>
+#include <xkbcommon/xkbcommon.h>
+#include "../../window.h"
+#include "../window_cairo.h"
+#include "window_cairo_demo.h"
+#include "../types.h"
+#include "bg_rect.h"
+#include "lightspeed.h"
+
+bool window_cairo_demo_button (s_window_cairo *window, u8 button,
+ sw x, sw y)
+{
+ assert(window);
+ (void) window;
+ printf("c3_window_cairo_demo_button: %lu (%ld, %ld)\n", (uw) button, x, y);
+ return true;
+}
+
+bool window_cairo_demo_key (s_window_cairo *window, uw keysym)
+{
+ char keysym_name[64];
+ assert(window);
+ (void) window;
+ switch (keysym) {
+ case XKB_KEY_Escape:
+ case XKB_KEY_q:
+ g_c3_exit_code = 0;
+ return false;
+ case XKB_KEY_Left:
+ if (! window_set_sequence_pos((s_window *) window,
+ (window->sequence_pos +
+ window->sequence_count - 1) %
+ window->sequence_count))
+ return false;
+ break;
+ case XKB_KEY_Right:
+ if (! window_set_sequence_pos((s_window *) window,
+ (window->sequence_pos + 1) %
+ window->sequence_count))
+ return false;
+ break;
+ default:
+ xkb_keysym_get_name(keysym, keysym_name, sizeof(keysym_name));
+ printf("c3_window_cairo_demo_key: %lu %s\n", keysym, keysym_name);
+ }
+ return true;
+}
+
+bool window_cairo_demo_load (s_window_cairo *window)
+{
+ assert(window->sequence_count == C3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ window_cairo_sequence_init(window->sequence, 8.0,
+ "01. Background rectangles",
+ bg_rect_load, bg_rect_render);
+ window_cairo_sequence_init(window->sequence + 1, 30.0,
+ "02. Lightspeed",
+ lightspeed_load, lightspeed_render);
+ window_set_sequence_pos((s_window *) window, 0);
+ return true;
+}
+
+bool window_cairo_demo_render (s_window_cairo *window,
+ cairo_t *cr)
+{
+ s_sequence *seq;
+ cairo_text_extents_t te;
+ assert(window);
+ assert(cr);
+ if (! window_animate((s_window *) window))
+ return false;
+ seq = window->sequence + window->sequence_pos;
+ seq->render(window, cr, seq);
+ /* text */
+ cairo_set_font_size(cr, 20);
+ cairo_select_font_face(cr, "Courier New",
+ CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+ cairo_text_extents(cr, seq->title, &te);
+ /* text bg */
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+ cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 21);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 20);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 19, window->h - te.height - te.y_bearing - 19);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 21);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 19);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 19);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 20);
+ cairo_show_text(cr, seq->title);
+ cairo_move_to(cr, 21, window->h - te.height - te.y_bearing - 21);
+ cairo_show_text(cr, seq->title);
+ /* text */
+ cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+ cairo_move_to(cr, 20, window->h - te.height - te.y_bearing - 20);
+ cairo_show_text(cr, seq->title);
+ /* progress bar */
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+ cairo_rectangle(cr, 19, window->h - 12,
+ (window->w - 40.0) * seq->t / seq->duration + 2,
+ 4);
+ cairo_fill(cr);
+ cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+ cairo_rectangle(cr, 20, window->h - 11,
+ (window->w - 40.0) * seq->t / seq->duration,
+ 2);
+ cairo_fill(cr);
+ return true;
+}
+
+bool window_cairo_demo_resize (s_window_cairo *window,
+ uw w, uw h)
+{
+ assert(window);
+ (void) window;
+ (void) w;
+ (void) h;
+ return true;
+}
diff --git a/libc3/window/cairo/demo/window_cairo_demo.h b/libc3/window/cairo/demo/window_cairo_demo.h
new file mode 100644
index 0000000..3348ea7
--- /dev/null
+++ b/libc3/window/cairo/demo/window_cairo_demo.h
@@ -0,0 +1,27 @@
+/* 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_CAIRO_DEMO_H
+#define LIBC3_WINDOW_CAIRO_DEMO_H
+
+#include "../types.h"
+
+#define WINDOW_CAIRO_DEMO_SEQUENCE_COUNT 2
+
+bool window_cairo_demo_button (s_window_cairo *window, u8 button,
+ sw x, sw y);
+bool window_cairo_demo_key (s_window_cairo *window, uw keysym);
+bool window_cairo_demo_load (s_window_cairo *window);
+bool window_cairo_demo_render (s_window_cairo *window, cairo_t *cr);
+bool window_cairo_demo_resize (s_window_cairo *window, uw w, uw h);
+
+#endif /* LIBC3_WINDOW_CAIRO_DEMO_H */
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.c b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.c
deleted file mode 100644
index 26ee3ee..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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 <stdio.h>
-#include <stdlib.h>
-#include <cairo/cairo.h>
-#include <libc3/c3.h>
-#include "../../../window.h"
-#include "../../c3_window_cairo_demo.h"
-#include "../window_cairo_quartz.h"
-
-int main (void)
-{
- s_window_cairo window;
- window_cairo_init(&window, 0, 0, 800, 600,
- "C3.Window.Cairo.Quartz demo",
- C3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
- window.button = c3_window_cairo_demo_button;
- window.key = c3_window_cairo_demo_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_quartz_run(&window))
- return g_c3_exit_code;
- return 0;
-}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_bridging_header.h b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_bridging_header.h
deleted file mode 100644
index d268bbc..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_bridging_header.h
+++ /dev/null
@@ -1,5 +0,0 @@
-//
-// Use this file to import your target's public headers that you would like to expose to Swift.
-//
-
-#import "../custom_cairo_view.h"
diff --git a/libc3/window/cairo/quartz/demo/configure b/libc3/window/cairo/quartz/demo/configure
index d687539..c6dd7de 100755
--- a/libc3/window/cairo/quartz/demo/configure
+++ b/libc3/window/cairo/quartz/demo/configure
@@ -84,19 +84,19 @@ pkg_config xkbcommon
# Asan config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"
-LOCAL_LIBS_ASAN="../libc3_window_cairo_quartz_asan.la"
+LOCAL_LIBS_ASAN="../../demo/libc3_window_cairo_demo_asan.la ../libc3_window_cairo_quartz_asan.la"
LIBS_ASAN="$LOCAL_LIBS_ASAN $LIBS"
# Coverage config
CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs -fprofile-generate"
LDFLAGS_COV="$LDFLAGS --coverage"
-LOCAL_LIBS_COV="../libc3_window_cairo_quartz_cov.la"
+LOCAL_LIBS_COV="../../demo/libc3_window_cairo_demo_cov.la ../libc3_window_cairo_quartz_cov.la"
LIBS_COV="$LOCAL_LIBS_COV $LIBS"
# Debug config
CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
LDFLAGS_DEBUG="$LDFLAGS"
-LOCAL_LIBS_DEBUG="../libc3_window_cairo_quartz_debug.la"
+LOCAL_LIBS_DEBUG="../../demo/libc3_window_cairo_demo_debug.la ../libc3_window_cairo_quartz_debug.la"
LIBS_DEBUG="$LOCAL_LIBS_DEBUG $LIBS"
# Main config
@@ -106,7 +106,7 @@ if [ "x$ENV_CFLAGS" = "x" ]; then
fi
CFLAGS="$CFLAGS -DNDEBUG"
LIBC3=../libc3/libc3.la
-LOCAL_LIBS="../libc3_window_cairo_quartz.la"
+LOCAL_LIBS="../../demo/libc3_window_cairo_demo.la ../libc3_window_cairo_quartz.la"
LIBS="$LOCAL_LIBS $LIBS"
echo "HAVE_ASAN = $HAVE_ASAN" >> ${CONFIG_MK}
@@ -203,7 +203,7 @@ echo "${APP_PROG_DEBUG}: ${PROG_DEBUG}" >> ${CONFIG_MK}
echo " mkdir -p $(dirname $APP_PROG_DEBUG)" >> ${CONFIG_MK}
echo " cp .libs/${PROG_DEBUG} ${APP_PROG_DEBUG}" >> ${CONFIG_MK}
-BUNDLE_LIBS="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3.0.dylib ../../../.libs/libc3_window.0.dylib ../../.libs/libc3_window_cairo.0.dylib ../.libs/libc3_window_cairo_quartz.0.dylib"
+BUNDLE_LIBS="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3.0.dylib ../../../.libs/libc3_window.0.dylib ../../.libs/libc3_window_cairo.0.dylib ../../demo/.libs/libc3_window_cairo_demo.0.dylib ../.libs/libc3_window_cairo_quartz.0.dylib"
echo >> ${CONFIG_MK}
echo "${APP}/Contents/Frameworks: ${BUNDLE_LIBS}" >> ${CONFIG_MK}
echo " mkdir -p ${APP}/Contents/Frameworks" >> ${CONFIG_MK}
@@ -219,7 +219,7 @@ echo ".PHONY: \\" >> ${CONFIG_MK}
echo " ${APP}/Contents/Frameworks \\" >> ${CONFIG_MK}
echo " ${APP_PROG}" >> ${CONFIG_MK}
-BUNDLE_LIBS_ASAN="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_asan.0.dylib ../../../.libs/libc3_window_asan.0.dylib ../../.libs/libc3_window_cairo_asan.0.dylib ../.libs/libc3_window_cairo_quartz_asan.0.dylib"
+BUNDLE_LIBS_ASAN="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_asan.0.dylib ../../../.libs/libc3_window_asan.0.dylib ../../.libs/libc3_window_cairo_asan.0.dylib ../../demo/.libs/libc3_window_cairo_demo_asan.0.dylib ../.libs/libc3_window_cairo_quartz_asan.0.dylib"
echo >> ${CONFIG_MK}
echo "${APP_ASAN}/Contents/Frameworks: ${BUNDLE_LIBS_ASAN}" >> ${CONFIG_MK}
echo " mkdir -p ${APP_ASAN}/Contents/Frameworks" >> ${CONFIG_MK}
@@ -235,7 +235,7 @@ echo ".PHONY: \\" >> ${CONFIG_MK}
echo " ${APP_ASAN}/Contents/Frameworks \\" >> ${CONFIG_MK}
echo " ${APP_PROG_ASAN}" >> ${CONFIG_MK}
-BUNDLE_LIBS_COV="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_cov.0.dylib ../../../.libs/libc3_window_cov.0.dylib ../../.libs/libc3_window_cairo_cov.0.dylib ../.libs/libc3_window_cairo_quartz_cov.0.dylib"
+BUNDLE_LIBS_COV="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_cov.0.dylib ../../../.libs/libc3_window_cov.0.dylib ../../.libs/libc3_window_cairo_cov.0.dylib ../../demo/.libs/libc3_window_cairo_demo_cov.0.dylib ../.libs/libc3_window_cairo_quartz_cov.0.dylib"
echo >> ${CONFIG_MK}
echo "${APP_COV}/Contents/Frameworks: ${BUNDLE_LIBS_COV}" >> ${CONFIG_MK}
echo " mkdir -p ${APP_COV}/Contents/Frameworks" >> ${CONFIG_MK}
@@ -251,7 +251,7 @@ echo ".PHONY: \\" >> ${CONFIG_MK}
echo " ${APP_COV}/Contents/Frameworks \\" >> ${CONFIG_MK}
echo " ${APP_PROG}" >> ${CONFIG_MK}
-BUNDLE_LIBS_DEBUG="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_debug.0.dylib ../../../.libs/libc3_window_debug.0.dylib ../../.libs/libc3_window_cairo_debug.0.dylib ../.libs/libc3_window_cairo_quartz_debug.0.dylib"
+BUNDLE_LIBS_DEBUG="../../../../../libffi/.libs/libffi.8.dylib ../../../../.libs/libc3_debug.0.dylib ../../../.libs/libc3_window_debug.0.dylib ../../.libs/libc3_window_cairo_debug.0.dylib ../../demo/.libs/libc3_window_cairo_demo_debug.0.dylib ../.libs/libc3_window_cairo_quartz_debug.0.dylib"
echo >> ${CONFIG_MK}
echo "${APP_DEBUG}/Contents/Frameworks: ${BUNDLE_LIBS_DEBUG}" >> ${CONFIG_MK}
echo " mkdir -p ${APP_DEBUG}/Contents/Frameworks" >> ${CONFIG_MK}
diff --git a/libc3/window/cairo/quartz/demo/sources.mk b/libc3/window/cairo/quartz/demo/sources.mk
index 2bcd1c7..2b2c4c0 100644
--- a/libc3/window/cairo/quartz/demo/sources.mk
+++ b/libc3/window/cairo/quartz/demo/sources.mk
@@ -1,9 +1,9 @@
# sources.mk generated by update_sources
HEADERS = \
- c3_window_cairo_quartz_demo_bridging_header.h \
+ \
SOURCES = \
- c3_window_cairo_quartz_demo.c \
+ window_cairo_quartz_demo.c \
OBJC_SOURCES = \
\
diff --git a/libc3/window/cairo/quartz/demo/sources.sh b/libc3/window/cairo/quartz/demo/sources.sh
index fa67117..3e6ad82 100644
--- a/libc3/window/cairo/quartz/demo/sources.sh
+++ b/libc3/window/cairo/quartz/demo/sources.sh
@@ -1,4 +1,4 @@
# sources.sh generated by update_sources
-HEADERS='c3_window_cairo_quartz_demo_bridging_header.h '
-SOURCES='c3_window_cairo_quartz_demo.c '
+HEADERS=' '
+SOURCES='window_cairo_quartz_demo.c '
OBJC_SOURCES=' '
diff --git a/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c b/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c
new file mode 100644
index 0000000..5b2895f
--- /dev/null
+++ b/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c
@@ -0,0 +1,35 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <cairo/cairo.h>
+#include <libc3/c3.h>
+#include "../../../window.h"
+#include "../../demo/window_cairo_demo.h"
+#include "../window_cairo_quartz.h"
+
+int main (void)
+{
+ s_window_cairo window;
+ window_cairo_init(&window, 0, 0, 800, 600,
+ "C3.Window.Cairo.Quartz demo",
+ WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ window.button = window_cairo_demo_button;
+ window.key = window_cairo_demo_key;
+ window.load = window_cairo_demo_load;
+ window.render = window_cairo_demo_render;
+ window.resize = window_cairo_demo_resize;
+ if (! window_cairo_quartz_run(&window))
+ return g_c3_exit_code;
+ return 0;
+}
diff --git a/libc3/window/cairo/sources.mk b/libc3/window/cairo/sources.mk
index de2d094..c3c9eb1 100644
--- a/libc3/window/cairo/sources.mk
+++ b/libc3/window/cairo/sources.mk
@@ -1,10 +1,8 @@
# sources.mk generated by update_sources
HEADERS = \
- c3_window_cairo_demo.h \
types.h \
window_cairo.h \
SOURCES = \
- c3_window_cairo_demo.c \
window_cairo.c \
diff --git a/libc3/window/cairo/sources.sh b/libc3/window/cairo/sources.sh
index 1f2c35a..3bb9595 100644
--- a/libc3/window/cairo/sources.sh
+++ b/libc3/window/cairo/sources.sh
@@ -1,3 +1,3 @@
# sources.sh generated by update_sources
-HEADERS='c3_window_cairo_demo.h types.h window_cairo.h '
-SOURCES='c3_window_cairo_demo.c window_cairo.c '
+HEADERS='types.h window_cairo.h '
+SOURCES='window_cairo.c '
diff --git a/libc3/window/cairo/types.h b/libc3/window/cairo/types.h
index 4fbd360..9d35c68 100644
--- a/libc3/window/cairo/types.h
+++ b/libc3/window/cairo/types.h
@@ -44,14 +44,14 @@ typedef bool (*f_window_cairo_motion) (s_window_cairo *window, sw x,
typedef bool (*f_window_cairo_render) (s_window_cairo *window,
cairo_t *cr);
-typedef void (*f_window_cairo_render_sequence) (s_window_cairo *window,
- cairo_t *cr,
- s_sequence *seq);
-
/* return false to break event loop */
typedef bool (*f_window_cairo_resize) (s_window_cairo *window,
uw w, uw h);
+typedef void (*f_window_cairo_sequence_render) (s_window_cairo *window,
+ cairo_t *cr,
+ s_sequence *seq);
+
struct rgb {
double r;
double g;
diff --git a/libc3/window/cairo/update_sources b/libc3/window/cairo/update_sources
index ddcbb2f..76260cb 100755
--- a/libc3/window/cairo/update_sources
+++ b/libc3/window/cairo/update_sources
@@ -25,6 +25,7 @@ sources SOURCES "$SOURCES"
update_sources_mk
update_sources_sh
+( cd demo && ./update_sources; )
( cd quartz && ./update_sources; )
( cd win32 && ./update_sources; )
( cd xcb && ./update_sources; )
diff --git a/libc3/window/cairo/win32/demo/c3_window_cairo_win32_demo.c b/libc3/window/cairo/win32/demo/c3_window_cairo_win32_demo.c
deleted file mode 100644
index 192a49e..0000000
--- a/libc3/window/cairo/win32/demo/c3_window_cairo_win32_demo.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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 <stdio.h>
-#include <stdlib.h>
-#include <cairo/cairo.h>
-#include <libc3/c3.h>
-#include "../../../window.h"
-#include "../../c3_window_cairo_demo.h"
-#include "../window_cairo_win32.h"
-
-int main (void)
-{
- s_window_cairo window;
- window_cairo_init(&window, 0, 0, 800, 600,
- "C3.Window.Cairo.Win32 demo",
- LIBC3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
- window.button = c3_window_cairo_demo_button;
- window.key = c3_window_cairo_demo_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_win32_run(&window))
- return g_c3_exit_code;
- return 0;
-}
diff --git a/libc3/window/cairo/win32/demo/sources.mk b/libc3/window/cairo/win32/demo/sources.mk
index caf267e..89e999e 100644
--- a/libc3/window/cairo/win32/demo/sources.mk
+++ b/libc3/window/cairo/win32/demo/sources.mk
@@ -3,6 +3,5 @@ HEADERS = \
\
SOURCES = \
- c3_window_cairo_win32_demo.c \
- window.c \
+ window_cairo_win32_demo.c \
diff --git a/libc3/window/cairo/win32/demo/sources.sh b/libc3/window/cairo/win32/demo/sources.sh
index 8543912..9df3998 100644
--- a/libc3/window/cairo/win32/demo/sources.sh
+++ b/libc3/window/cairo/win32/demo/sources.sh
@@ -1,3 +1,3 @@
# sources.sh generated by update_sources
HEADERS=' '
-SOURCES='c3_window_cairo_win32_demo.c window.c '
+SOURCES='window_cairo_win32_demo.c '
diff --git a/libc3/window/cairo/win32/demo/update_sources b/libc3/window/cairo/win32/demo/update_sources
old mode 100644
new mode 100755
diff --git a/libc3/window/cairo/win32/demo/window.c b/libc3/window/cairo/win32/demo/window.c
deleted file mode 100644
index 2a00f81..0000000
--- a/libc3/window/cairo/win32/demo/window.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* 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/win32/demo/window_cairo_win32_demo.c b/libc3/window/cairo/win32/demo/window_cairo_win32_demo.c
new file mode 100644
index 0000000..192a49e
--- /dev/null
+++ b/libc3/window/cairo/win32/demo/window_cairo_win32_demo.c
@@ -0,0 +1,35 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <cairo/cairo.h>
+#include <libc3/c3.h>
+#include "../../../window.h"
+#include "../../c3_window_cairo_demo.h"
+#include "../window_cairo_win32.h"
+
+int main (void)
+{
+ s_window_cairo window;
+ window_cairo_init(&window, 0, 0, 800, 600,
+ "C3.Window.Cairo.Win32 demo",
+ LIBC3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ window.button = c3_window_cairo_demo_button;
+ window.key = c3_window_cairo_demo_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_win32_run(&window))
+ return g_c3_exit_code;
+ return 0;
+}
diff --git a/libc3/window/cairo/win32/sources.mk b/libc3/window/cairo/win32/sources.mk
index 7f53a9f..02fb680 100644
--- a/libc3/window/cairo/win32/sources.mk
+++ b/libc3/window/cairo/win32/sources.mk
@@ -1,6 +1,5 @@
# sources.mk generated by update_sources
HEADERS = \
- config.h \
vk_to_xkbcommon.h \
window_cairo_win32.h \
diff --git a/libc3/window/cairo/win32/sources.sh b/libc3/window/cairo/win32/sources.sh
index 59ef06c..7492652 100644
--- a/libc3/window/cairo/win32/sources.sh
+++ b/libc3/window/cairo/win32/sources.sh
@@ -1,3 +1,3 @@
# sources.sh generated by update_sources
-HEADERS='config.h vk_to_xkbcommon.h window_cairo_win32.h '
+HEADERS='vk_to_xkbcommon.h window_cairo_win32.h '
SOURCES='vk_to_xkbcommon.c window_cairo_win32.c '
diff --git a/libc3/window/cairo/win32/update_sources b/libc3/window/cairo/win32/update_sources
old mode 100644
new mode 100755
diff --git a/libc3/window/cairo/window_cairo.c b/libc3/window/cairo/window_cairo.c
index 4e7a3a0..31da8d3 100644
--- a/libc3/window/cairo/window_cairo.c
+++ b/libc3/window/cairo/window_cairo.c
@@ -105,12 +105,13 @@ bool window_cairo_resize_default (s_window_cairo *window, uw w, uw h)
s_sequence * window_cairo_sequence_init
(s_sequence *sequence, f64 duration, const s8 *title,
- f_window_cairo_render_sequence render)
+ f_sequence_load load, f_window_cairo_sequence_render render)
{
assert(sequence);
sequence->t = 0.0;
sequence->duration = duration;
sequence->title = title;
+ sequence->load = load;
sequence->render = (f_sequence_render) render;
return sequence;
}
diff --git a/libc3/window/cairo/window_cairo.h b/libc3/window/cairo/window_cairo.h
index 70b0b34..ebf65e8 100644
--- a/libc3/window/cairo/window_cairo.h
+++ b/libc3/window/cairo/window_cairo.h
@@ -23,7 +23,7 @@ bool window_cairo_run (s_window_cairo *window);
s_sequence * window_cairo_sequence_init
(s_sequence *sequence, f64 duration, const s8 *title,
- f_window_cairo_render_sequence render);
+ f_sequence_load load, f_window_cairo_sequence_render render);
/* callbacks */
bool window_cairo_button_default (s_window_cairo *window, u8 button,
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
deleted file mode 100644
index ec4e6db..0000000
--- a/libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 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 <stdio.h>
-#include <stdlib.h>
-#include <libc3/c3.h>
-#include "../../../window.h"
-#include "../../c3_window_cairo_demo.h"
-#include "../window_cairo_xcb.h"
-
-int main (void)
-{
- s_window_cairo window;
- window_cairo_init(&window, 0, 0, 800, 600,
- "C3.Window.Cairo.XCB demo",
- C3_WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
- window.button = c3_window_cairo_demo_button;
- window.key = c3_window_cairo_demo_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 g_c3_exit_code;
- return 0;
-}
diff --git a/libc3/window/cairo/xcb/demo/configure b/libc3/window/cairo/xcb/demo/configure
index 3fd8000..27003bf 100755
--- a/libc3/window/cairo/xcb/demo/configure
+++ b/libc3/window/cairo/xcb/demo/configure
@@ -55,19 +55,19 @@ LIBS="$LIBS"
# Asan config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"
-LOCAL_LIBS_ASAN="../libc3_window_cairo_xcb_asan.la ../../libc3_window_cairo_asan.la ../../../libc3_window_asan.la ../../../../libc3_asan.la"
+LOCAL_LIBS_ASAN="../../demo/libc3_window_cairo_demo_asan.la ../libc3_window_cairo_xcb_asan.la"
LIBS_ASAN="$LOCAL_LIBS_ASAN $LIBS"
# Coverage config
CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs -fprofile-generate"
LDFLAGS_COV="$LDFLAGS --coverage"
-LOCAL_LIBS_COV="../libc3_window_cairo_xcb_cov.la ../../libc3_window_cairo_cov.la ../../../libc3_window_cov.la ../../../../libc3_cov.la"
+LOCAL_LIBS_COV="../../demo/libc3_window_cairo_demo_cov.la ../libc3_window_cairo_xcb_cov.la"
LIBS_COV="$LOCAL_LIBS_COV $LIBS"
# Debug config
CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
LDFLAGS_DEBUG="$LDFLAGS"
-LOCAL_LIBS_DEBUG="../libc3_window_cairo_xcb_debug.la ../../libc3_window_cairo_debug.la ../../../libc3_window_debug.la ../../../../libc3_debug.la"
+LOCAL_LIBS_DEBUG="../../demo/libc3_window_cairo_demo_debug.la ../libc3_window_cairo_xcb_debug.la"
LIBS_DEBUG="$LOCAL_LIBS_DEBUG $LIBS"
# Main config
@@ -76,7 +76,7 @@ if [ "x$ENV_CFLAGS" = "x" ]; then
CFLAGS="$CFLAGS $DEFAULT_CFLAGS"
fi
CFLAGS="$CFLAGS -DNDEBUG"
-LOCAL_LIBS="../libc3_window_cairo_xcb.la ../../libc3_window_cairo.la ../../../libc3_window.la ../../../../libc3.la"
+LOCAL_LIBS="../../demo/libc3_window_cairo_demo.la ../libc3_window_cairo_xcb.la"
LIBS="$LOCAL_LIBS $LIBS"
echo "HAVE_ASAN = $HAVE_ASAN" >> ${CONFIG_MK}
diff --git a/libc3/window/cairo/xcb/demo/sources.mk b/libc3/window/cairo/xcb/demo/sources.mk
index e6bb6b2..7b3cf49 100644
--- a/libc3/window/cairo/xcb/demo/sources.mk
+++ b/libc3/window/cairo/xcb/demo/sources.mk
@@ -3,6 +3,6 @@ HEADERS = \
\
SOURCES = \
- c3_window_cairo_xcb_demo.c \
window.c \
+ window_cairo_xcb_demo.c \
diff --git a/libc3/window/cairo/xcb/demo/sources.sh b/libc3/window/cairo/xcb/demo/sources.sh
index f734d9a..2a5d8d4 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_xcb_demo.c window.c '
+SOURCES='window.c window_cairo_xcb_demo.c '
diff --git a/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c b/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c
new file mode 100644
index 0000000..90d1a10
--- /dev/null
+++ b/libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c
@@ -0,0 +1,34 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <libc3/c3.h>
+#include "../../../window.h"
+#include "../../demo/window_cairo_demo.h"
+#include "../window_cairo_xcb.h"
+
+int main (void)
+{
+ s_window_cairo window;
+ window_cairo_init(&window, 0, 0, 800, 600,
+ "C3.Window.Cairo.XCB demo",
+ WINDOW_CAIRO_DEMO_SEQUENCE_COUNT);
+ window.button = window_cairo_demo_button;
+ window.key = window_cairo_demo_key;
+ window.load = window_cairo_demo_load;
+ window.render = window_cairo_demo_render;
+ window.resize = window_cairo_demo_resize;
+ if (! window_cairo_xcb_run(&window))
+ return g_c3_exit_code;
+ return 0;
+}
diff --git a/libc3/window/window.c b/libc3/window/window.c
index 10102c1..c2805d1 100644
--- a/libc3/window/window.c
+++ b/libc3/window/window.c
@@ -58,5 +58,7 @@ bool window_set_sequence_pos (s_window *window, uw sequence_pos)
}
window->sequence_pos = sequence_pos;
printf("%s\n", seq->title);
+ if (! seq->load(seq))
+ return false;
return true;
}
diff --git a/osx/Makefile b/osx/Makefile
new file mode 100644
index 0000000..1e854a6
--- /dev/null
+++ b/osx/Makefile
@@ -0,0 +1,36 @@
+## 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.
+
+all: dmg
+
+DMG_FILES = \
+ ../libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app \
+ ../libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app
+
+DESTDIR = c3-v${C3_VERSION}
+DMG = ${DESTDIR}.dmg
+
+CLEANFILES = ${DMG} ${DESTDIR} ${DESTDIR}.old
+
+clean:
+ rm -rf ${CLEANFILES}
+
+dmg:
+ rm -rf ${DESTDIR}.old
+ if [ -d ${DESTDIR} ]; then mv ${DESTDIR} ${DESTDIR}.old; fi
+ mkdir ${DESTDIR}
+ cp -r ${DMG_FILES} ${DESTDIR}
+ hdiutil create -volname "C3 v${C3_VERSION}" -srcfolder ${DESTDIR} -ov -format UDZO ${DESTDIR}.dmg
+
+.PHONY: all clean dmg
+
+include ../config.mk
diff --git a/sources.mk b/sources.mk
index df2c3ab..fb94167 100644
--- a/sources.mk
+++ b/sources.mk
@@ -9,6 +9,8 @@ C3_CONFIGURES = \
libc3/update_sources \
libc3/window/configure \
libc3/window/update_sources \
+ libc3/window/cairo/demo/configure \
+ libc3/window/cairo/demo/update_sources \
libc3/window/cairo/xcb/demo/configure \
libc3/window/cairo/xcb/demo/update_sources \
libc3/window/cairo/xcb/configure \
@@ -19,6 +21,10 @@ C3_CONFIGURES = \
libc3/window/cairo/quartz/demo/update_sources \
libc3/window/cairo/quartz/configure \
libc3/window/cairo/quartz/update_sources \
+ libc3/window/cairo/win32/demo/configure \
+ libc3/window/cairo/win32/demo/update_sources \
+ libc3/window/cairo/win32/configure \
+ libc3/window/cairo/win32/update_sources \
libtommath/configure \
libtommath/update_sources \
test/configure \
@@ -32,11 +38,14 @@ C3_MAKEFILES = \
libc3/Makefile \
libc3/gen.mk \
libc3/window/Makefile \
+ libc3/window/cairo/demo/Makefile \
libc3/window/cairo/xcb/demo/Makefile \
libc3/window/cairo/xcb/Makefile \
libc3/window/cairo/Makefile \
libc3/window/cairo/quartz/demo/Makefile \
libc3/window/cairo/quartz/Makefile \
+ libc3/window/cairo/win32/demo/Makefile \
+ libc3/window/cairo/win32/Makefile \
libtommath/Makefile \
test/Makefile \
ucd2c/Makefile \
@@ -248,16 +257,20 @@ C3_C_SOURCES = \
libc3/buf_inspect_s64_hexadecimal.h \
libc3/window/types.h \
libc3/window/window.h \
- libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c \
+ libc3/window/cairo/demo/window_cairo_demo.c \
+ libc3/window/cairo/demo/lightspeed.h \
+ libc3/window/cairo/demo/bg_rect.h \
+ libc3/window/cairo/demo/window_cairo_demo.h \
+ libc3/window/cairo/demo/lightspeed.c \
+ libc3/window/cairo/demo/bg_rect.c \
+ libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c \
libc3/window/cairo/xcb/demo/window.c \
libc3/window/cairo/xcb/window_cairo_xcb.h \
libc3/window/cairo/xcb/config.h \
libc3/window/cairo/xcb/window_cairo_xcb.c \
libc3/window/cairo/types.h \
libc3/window/cairo/window_cairo.c \
- libc3/window/cairo/c3_window_cairo_demo.h \
- libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_bridging_header.h \
- libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.c \
+ libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c \
libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h \
libc3/window/cairo/quartz/quartz_to_xkbcommon.c \
libc3/window/cairo/quartz/window_cairo_quartz.h \
@@ -266,7 +279,11 @@ C3_C_SOURCES = \
libc3/window/cairo/quartz/xkbquartz.h \
libc3/window/cairo/quartz/window_cairo_quartz_view.h \
libc3/window/cairo/window_cairo.h \
- libc3/window/cairo/c3_window_cairo_demo.c \
+ libc3/window/cairo/win32/demo/window_cairo_win32_demo.c \
+ libc3/window/cairo/win32/vk_to_xkbcommon.c \
+ libc3/window/cairo/win32/window_cairo_win32.h \
+ libc3/window/cairo/win32/vk_to_xkbcommon.h \
+ libc3/window/cairo/win32/window_cairo_win32.c \
libc3/window/window.c \
libc3/ident.h \
libc3/buf_inspect_s64_decimal.c \
diff --git a/sources.sh b/sources.sh
index a40af98..5e44f2c 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/configure libc3/update_sources libc3/window/configure libc3/window/update_sources libc3/window/cairo/xcb/demo/configure libc3/window/cairo/xcb/demo/update_sources libc3/window/cairo/xcb/configure libc3/window/cairo/xcb/update_sources libc3/window/cairo/configure libc3/window/cairo/update_sources libc3/window/cairo/quartz/demo/configure libc3/window/cairo/quartz/demo/update_sources libc3/window/cairo/quartz/configure libc3/window/cairo/quartz/update_sources 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/Makefile libc3/window/cairo/xcb/demo/Makefile libc3/window/cairo/xcb/Makefile libc3/window/cairo/Makefile libc3/window/cairo/quartz/demo/Makefile libc3/window/cairo/quartz/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.h ic3/ic3.c ic3/linenoise.c ic3/buf_linenoise.c libc3/buf_inspect_s_base.c.in libc3/type.h libc3/fact.c libc3/time.h libc3/fn.h libc3/s16.h libc3/buf_inspect_s8_octal.h libc3/log.c libc3/error.h libc3/buf_inspect_u64_octal.h libc3/set_item.h.in libc3/compare.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_uw_hexadecimal.h libc3/uw.c libc3/eval.c libc3/set__fact.c libc3/sym.h libc3/env.h libc3/cfn.c libc3/buf_inspect_u16_octal.h libc3/u.h.in libc3/buf_parse_s16.c libc3/s8.h libc3/quote.h libc3/buf_inspect_s32.h libc3/buf_inspect.c libc3/buf_parse_u.h.in libc3/skiplist_node__fact.h libc3/skiplist__fact.c libc3/buf_inspect_s32_hexadecimal.h libc3/ceiling.h libc3/list.c libc3/buf_inspect_u64.c libc3/facts.h libc3/buf_inspect_u16_decimal.c libc3/facts_with_cursor.c libc3/buf_inspect_sw_decimal.c libc3/facts_cursor.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_sw_hexadecimal.h libc3/buf_inspect_s32_decimal.h libc3/u16.h libc3/buf_inspect_s64_octal.h libc3/buf_inspect_u8_binary.h libc3/buf_inspect_s8.h libc3/buf_inspect_s16_octal.h libc3/ucd.c libc3/buf_inspect_s16_binary.h libc3/tuple.c libc3/buf_inspect_uw_octal.h libc3/buf_parse_u8.c libc3/tag.h libc3/float.h libc3/buf_inspect_u_base.c.in libc3/buf_parse_u16.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_u32.h libc3/array.c libc3/buf_parse_sw.h libc3/set.h.in libc3/s.c.in libc3/buf_parse_s.c.in libc3/map.h libc3/skiplist.h.in libc3/set__tag.h libc3/buf_inspect_s64.c libc3/io.c libc3/set_item__tag.c libc3/sequence.c libc3/types.h libc3/buf_inspect_uw.c libc3/buf_inspect_u32_binary.c libc3/buf_inspect_s64_decimal.h libc3/set_cursor.c.in libc3/ident.c libc3/buf_inspect_s64_hexadecimal.c libc3/bool.h libc3/s.h.in libc3/set.c.in libc3/skiplist.c.in libc3/operator.h libc3/fn_clause.h libc3/buf_parse_s.h.in libc3/buf_inspect_s16.c libc3/binding.c libc3/ptag.h libc3/buf_parse_s32.h libc3/var.h libc3/set_item__fact.h libc3/u8.c libc3/set_cursor.h.in libc3/f32.c libc3/buf_inspect_sw_octal.h libc3/c3.h libc3/arg.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_parse_u64.c libc3/module.c libc3/frame.h libc3/buf_inspect_s16_decimal.c libc3/file.h libc3/sw.h libc3/s32.c libc3/error_handler.c libc3/str.c libc3/buf_parse.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_decimal.h libc3/facts_spec_cursor.c libc3/u64.h libc3/buf_inspect_u_base.h.in libc3/buf_inspect_s32_octal.h libc3/f64.h libc3/buf_inspect_u8_octal.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u16_binary.c libc3/buf_save.h libc3/buf_inspect_u16.c libc3/buf_inspect_s8_hexadecimal.c libc3/u.c.in libc3/buf_inspect_sw.h libc3/facts_with.c libc3/buf_parse_u.c.in libc3/buf_parse_u32.h libc3/set_cursor__fact.c libc3/buf.h libc3/set_cursor__tag.h libc3/buf_inspect_s16_hexadecimal.h libc3/buf_inspect_u32_decimal.h libc3/buf_parse_uw.c libc3/buf_parse_s64.c libc3/abs.h libc3/buf_inspect_sw_binary.c libc3/buf_parse_s8.h libc3/call.h libc3/sign.c libc3/buf_inspect_u8_decimal.h libc3/character.h libc3/buf_inspect_u64_decimal.h libc3/buf_inspect_s_base.h.in libc3/buf_inspect_u32_octal.h libc3/u32.c libc3/hash.c libc3/buf_file.h libc3/integer.c libc3/buf_inspect_u8.c libc3/facts_spec.c libc3/buf_inspect_s32_binary.h libc3/set_item.c.in libc3/s64.h libc3/buf_inspect_u16_decimal.h libc3/facts.c libc3/buf_inspect_u64.h libc3/buf_inspect_sw_decimal.h libc3/facts_with_cursor.h libc3/skiplist_node__fact.c libc3/buf_inspect.h libc3/quote.c libc3/buf_inspect_s32.c libc3/skiplist_node.h.in libc3/s8.c libc3/buf_parse_s16.h libc3/list.h libc3/ceiling.c libc3/buf_inspect_s.h.in libc3/buf_inspect_s32_hexadecimal.c libc3/skiplist__fact.h libc3/uw.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_s8_binary.c libc3/compare.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u16_octal.c libc3/cfn.h libc3/env.c libc3/set__fact.h libc3/sym.c libc3/eval.h libc3/c3_main.h libc3/buf_inspect_s8_octal.c libc3/s16.c libc3/fn.c libc3/time.c libc3/fact.h libc3/type.c libc3/error.c libc3/log.h libc3/sequence.h libc3/set_item__tag.h libc3/io.h libc3/buf_inspect_s64.h libc3/buf_inspect_s64_hexadecimal.h libc3/window/types.h libc3/window/window.h libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo.c libc3/window/cairo/xcb/demo/window.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/types.h libc3/window/cairo/window_cairo.c libc3/window/cairo/c3_window_cairo_demo.h libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_bridging_header.h libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.c libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/window_cairo.h libc3/window/cairo/c3_window_cairo_demo.c libc3/window/window.c libc3/ident.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_uw.h libc3/buf_inspect_u.c.in libc3/buf_parse_sw.c libc3/array.h libc3/buf_inspect_u32.c libc3/buf_inspect_s8_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_parse_u16.h libc3/set__tag.c libc3/map.c libc3/tag.c libc3/buf_parse_u8.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_u8_binary.c libc3/buf_inspect_s64_octal.c libc3/u16.c libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_u64_binary.c libc3/facts_cursor.h libc3/tuple.h libc3/buf_inspect_s16_binary.c libc3/ucd.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s8.c libc3/sha1.h libc3/buf_inspect_uw_binary.h libc3/buf_parse.c libc3/str.h libc3/error_handler.h libc3/u64.c libc3/buf_inspect_s32_octal.c libc3/facts_spec_cursor.h libc3/buf_inspect_uw_decimal.c libc3/sw.c libc3/file.c libc3/buf_inspect_s16_decimal.h libc3/frame.c libc3/s32.h libc3/c3.c libc3/f32.h libc3/buf_inspect_sw_octal.c libc3/u8.h libc3/set_item__fact.c libc3/var.c libc3/module.h libc3/license.c libc3/buf_inspect_u32_hexadecimal.c libc3/buf_parse_u64.h libc3/buf_inspect_u8_hexadecimal.h libc3/arg.c libc3/fn_clause.c libc3/operator.c libc3/bool.c libc3/buf_parse_s32.c libc3/ptag.c libc3/binding.h libc3/buf_inspect_u.h.in libc3/buf_inspect_s16.h libc3/integer.h libc3/buf_file.c libc3/s64.c libc3/buf_inspect_s32_binary.c libc3/buf_inspect_u8.h libc3/facts_spec.h libc3/buf_inspect_u8_decimal.c libc3/sign.h libc3/call.c libc3/buf_parse_s8.c libc3/buf_inspect_sw_binary.h libc3/hash.h libc3/u32.h libc3/buf_inspect_u32_octal.c libc3/character.c libc3/buf_inspect_u64_decimal.c libc3/buf_parse_uw.h libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_s16_hexadecimal.c libc3/set_cursor__tag.c libc3/set_cursor__fact.h libc3/buf.c libc3/abs.c libc3/buf_parse_s64.h libc3/buf_inspect_s.c.in libc3/buf_inspect_s64_binary.h libc3/buf_inspect_u8_octal.c libc3/f64.c libc3/skiplist_node.c.in libc3/buf_parse_u32.c libc3/facts_with.h libc3/buf_inspect_sw.c libc3/buf_inspect_u16.h libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u64_hexadecimal.h libc3/buf_save.c test/ident_test.c test/buf_parse_test_s16.c test/buf_inspect_test.c test/libc3_test.c test/fn_test.c test/buf_parse_test_u16.c test/str_test.c test/cfn_test.c test/character_test.c test/buf_parse_test_s8.c test/skiplist__fact_test.c test/sym_test.c test/tag_test.h test/buf_file_test.c test/bool_test.c test/fact_test.h test/buf_parse_test_u64.c test/compare_test.c test/facts_with_test.c test/array_test.c test/buf_parse_test.h test/test.h test/buf_parse_test_su.h test/env_test.c test/buf_parse_test_s64.c test/types_test.c test/hash_test.c test/call_test.c test/set__tag_test.c test/facts_test.c test/facts_cursor_test.c test/compare_test.h test/buf_parse_test_s32.c test/test.c test/buf_parse_test.c test/fact_test.c test/tag_test.c test/set__fact_test.c test/buf_parse_test_u32.c test/buf_test.c test/list_test.c test/buf_parse_test_u8.c test/tuple_test.c ucd2c/ucd.h ucd2c/ucd2c.c '
+C3_CONFIGURES='c3c/configure c3s/configure c3s/update_sources ic3/configure ic3/update_sources libc3/configure libc3/update_sources libc3/window/configure libc3/window/update_sources libc3/window/cairo/demo/configure libc3/window/cairo/demo/update_sources libc3/window/cairo/xcb/demo/configure libc3/window/cairo/xcb/demo/update_sources libc3/window/cairo/xcb/configure libc3/window/cairo/xcb/update_sources libc3/window/cairo/configure libc3/window/cairo/update_sources libc3/window/cairo/quartz/demo/configure libc3/window/cairo/quartz/demo/update_sources libc3/window/cairo/quartz/configure libc3/window/cairo/quartz/update_sources libc3/window/cairo/win32/demo/configure libc3/window/cairo/win32/demo/update_sources libc3/window/cairo/win32/configure libc3/window/cairo/win32/update_sources 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/Makefile libc3/window/cairo/demo/Makefile libc3/window/cairo/xcb/demo/Makefile libc3/window/cairo/xcb/Makefile libc3/window/cairo/Makefile libc3/window/cairo/quartz/demo/Makefile libc3/window/cairo/quartz/Makefile libc3/window/cairo/win32/demo/Makefile libc3/window/cairo/win32/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.h ic3/ic3.c ic3/linenoise.c ic3/buf_linenoise.c libc3/buf_inspect_s_base.c.in libc3/type.h libc3/fact.c libc3/time.h libc3/fn.h libc3/s16.h libc3/buf_inspect_s8_octal.h libc3/log.c libc3/error.h libc3/buf_inspect_u64_octal.h libc3/set_item.h.in libc3/compare.c libc3/buf_inspect_s8_binary.h libc3/buf_inspect_uw_hexadecimal.h libc3/uw.c libc3/eval.c libc3/set__fact.c libc3/sym.h libc3/env.h libc3/cfn.c libc3/buf_inspect_u16_octal.h libc3/u.h.in libc3/buf_parse_s16.c libc3/s8.h libc3/quote.h libc3/buf_inspect_s32.h libc3/buf_inspect.c libc3/buf_parse_u.h.in libc3/skiplist_node__fact.h libc3/skiplist__fact.c libc3/buf_inspect_s32_hexadecimal.h libc3/ceiling.h libc3/list.c libc3/buf_inspect_u64.c libc3/facts.h libc3/buf_inspect_u16_decimal.c libc3/facts_with_cursor.c libc3/buf_inspect_sw_decimal.c libc3/facts_cursor.c libc3/buf_inspect_u64_binary.h libc3/buf_inspect_sw_hexadecimal.h libc3/buf_inspect_s32_decimal.h libc3/u16.h libc3/buf_inspect_s64_octal.h libc3/buf_inspect_u8_binary.h libc3/buf_inspect_s8.h libc3/buf_inspect_s16_octal.h libc3/ucd.c libc3/buf_inspect_s16_binary.h libc3/tuple.c libc3/buf_inspect_uw_octal.h libc3/buf_parse_u8.c libc3/tag.h libc3/float.h libc3/buf_inspect_u_base.c.in libc3/buf_parse_u16.c libc3/buf_inspect_u16_hexadecimal.h libc3/buf_inspect_s8_decimal.c libc3/buf_inspect_u32.h libc3/array.c libc3/buf_parse_sw.h libc3/set.h.in libc3/s.c.in libc3/buf_parse_s.c.in libc3/map.h libc3/skiplist.h.in libc3/set__tag.h libc3/buf_inspect_s64.c libc3/io.c libc3/set_item__tag.c libc3/sequence.c libc3/types.h libc3/buf_inspect_uw.c libc3/buf_inspect_u32_binary.c libc3/buf_inspect_s64_decimal.h libc3/set_cursor.c.in libc3/ident.c libc3/buf_inspect_s64_hexadecimal.c libc3/bool.h libc3/s.h.in libc3/set.c.in libc3/skiplist.c.in libc3/operator.h libc3/fn_clause.h libc3/buf_parse_s.h.in libc3/buf_inspect_s16.c libc3/binding.c libc3/ptag.h libc3/buf_parse_s32.h libc3/var.h libc3/set_item__fact.h libc3/u8.c libc3/set_cursor.h.in libc3/f32.c libc3/buf_inspect_sw_octal.h libc3/c3.h libc3/arg.h libc3/buf_inspect_u8_hexadecimal.c libc3/buf_inspect_u32_hexadecimal.h libc3/buf_parse_u64.c libc3/module.c libc3/frame.h libc3/buf_inspect_s16_decimal.c libc3/file.h libc3/sw.h libc3/s32.c libc3/error_handler.c libc3/str.c libc3/buf_parse.h libc3/buf_inspect_uw_binary.c libc3/buf_inspect_uw_decimal.h libc3/facts_spec_cursor.c libc3/u64.h libc3/buf_inspect_u_base.h.in libc3/buf_inspect_s32_octal.h libc3/f64.h libc3/buf_inspect_u8_octal.h libc3/buf_inspect_s64_binary.c libc3/buf_inspect_u64_hexadecimal.c libc3/buf_inspect_u16_binary.c libc3/buf_save.h libc3/buf_inspect_u16.c libc3/buf_inspect_s8_hexadecimal.c libc3/u.c.in libc3/buf_inspect_sw.h libc3/facts_with.c libc3/buf_parse_u.c.in libc3/buf_parse_u32.h libc3/set_cursor__fact.c libc3/buf.h libc3/set_cursor__tag.h libc3/buf_inspect_s16_hexadecimal.h libc3/buf_inspect_u32_decimal.h libc3/buf_parse_uw.c libc3/buf_parse_s64.c libc3/abs.h libc3/buf_inspect_sw_binary.c libc3/buf_parse_s8.h libc3/call.h libc3/sign.c libc3/buf_inspect_u8_decimal.h libc3/character.h libc3/buf_inspect_u64_decimal.h libc3/buf_inspect_s_base.h.in libc3/buf_inspect_u32_octal.h libc3/u32.c libc3/hash.c libc3/buf_file.h libc3/integer.c libc3/buf_inspect_u8.c libc3/facts_spec.c libc3/buf_inspect_s32_binary.h libc3/set_item.c.in libc3/s64.h libc3/buf_inspect_u16_decimal.h libc3/facts.c libc3/buf_inspect_u64.h libc3/buf_inspect_sw_decimal.h libc3/facts_with_cursor.h libc3/skiplist_node__fact.c libc3/buf_inspect.h libc3/quote.c libc3/buf_inspect_s32.c libc3/skiplist_node.h.in libc3/s8.c libc3/buf_parse_s16.h libc3/list.h libc3/ceiling.c libc3/buf_inspect_s.h.in libc3/buf_inspect_s32_hexadecimal.c libc3/skiplist__fact.h libc3/uw.h libc3/buf_inspect_uw_hexadecimal.c libc3/buf_inspect_s8_binary.c libc3/compare.h libc3/buf_inspect_u64_octal.c libc3/buf_inspect_u16_octal.c libc3/cfn.h libc3/env.c libc3/set__fact.h libc3/sym.c libc3/eval.h libc3/c3_main.h libc3/buf_inspect_s8_octal.c libc3/s16.c libc3/fn.c libc3/time.c libc3/fact.h libc3/type.c libc3/error.c libc3/log.h libc3/sequence.h libc3/set_item__tag.h libc3/io.h libc3/buf_inspect_s64.h libc3/buf_inspect_s64_hexadecimal.h libc3/window/types.h libc3/window/window.h libc3/window/cairo/demo/window_cairo_demo.c libc3/window/cairo/demo/lightspeed.h libc3/window/cairo/demo/bg_rect.h libc3/window/cairo/demo/window_cairo_demo.h libc3/window/cairo/demo/lightspeed.c libc3/window/cairo/demo/bg_rect.c libc3/window/cairo/xcb/demo/window_cairo_xcb_demo.c libc3/window/cairo/xcb/demo/window.c libc3/window/cairo/xcb/window_cairo_xcb.h libc3/window/cairo/xcb/config.h libc3/window/cairo/xcb/window_cairo_xcb.c libc3/window/cairo/types.h libc3/window/cairo/window_cairo.c libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c libc3/window/cairo/quartz/window_cairo_quartz_view_controller.h libc3/window/cairo/quartz/quartz_to_xkbcommon.c libc3/window/cairo/quartz/window_cairo_quartz.h libc3/window/cairo/quartz/window_cairo_quartz_app_delegate.h libc3/window/cairo/quartz/quartz_to_xkbcommon.h libc3/window/cairo/quartz/xkbquartz.h libc3/window/cairo/quartz/window_cairo_quartz_view.h libc3/window/cairo/window_cairo.h libc3/window/cairo/win32/demo/window_cairo_win32_demo.c libc3/window/cairo/win32/vk_to_xkbcommon.c libc3/window/cairo/win32/window_cairo_win32.h libc3/window/cairo/win32/vk_to_xkbcommon.h libc3/window/cairo/win32/window_cairo_win32.c libc3/window/window.c libc3/ident.h libc3/buf_inspect_s64_decimal.c libc3/buf_inspect_u32_binary.h libc3/buf_inspect_uw.h libc3/buf_inspect_u.c.in libc3/buf_parse_sw.c libc3/array.h libc3/buf_inspect_u32.c libc3/buf_inspect_s8_decimal.h libc3/buf_inspect_u16_hexadecimal.c libc3/buf_parse_u16.h libc3/set__tag.c libc3/map.c libc3/tag.c libc3/buf_parse_u8.h libc3/buf_inspect_uw_octal.c libc3/buf_inspect_u8_binary.c libc3/buf_inspect_s64_octal.c libc3/u16.c libc3/buf_inspect_sw_hexadecimal.c libc3/buf_inspect_s32_decimal.c libc3/buf_inspect_u64_binary.c libc3/facts_cursor.h libc3/tuple.h libc3/buf_inspect_s16_binary.c libc3/ucd.h libc3/buf_inspect_s16_octal.c libc3/buf_inspect_s8.c libc3/sha1.h libc3/buf_inspect_uw_binary.h libc3/buf_parse.c libc3/str.h libc3/error_handler.h libc3/u64.c libc3/buf_inspect_s32_octal.c libc3/facts_spec_cursor.h libc3/buf_inspect_uw_decimal.c libc3/sw.c libc3/file.c libc3/buf_inspect_s16_decimal.h libc3/frame.c libc3/s32.h libc3/c3.c libc3/f32.h libc3/buf_inspect_sw_octal.c libc3/u8.h libc3/set_item__fact.c libc3/var.c libc3/module.h libc3/license.c libc3/buf_inspect_u32_hexadecimal.c libc3/buf_parse_u64.h libc3/buf_inspect_u8_hexadecimal.h libc3/arg.c libc3/fn_clause.c libc3/operator.c libc3/bool.c libc3/buf_parse_s32.c libc3/ptag.c libc3/binding.h libc3/buf_inspect_u.h.in libc3/buf_inspect_s16.h libc3/integer.h libc3/buf_file.c libc3/s64.c libc3/buf_inspect_s32_binary.c libc3/buf_inspect_u8.h libc3/facts_spec.h libc3/buf_inspect_u8_decimal.c libc3/sign.h libc3/call.c libc3/buf_parse_s8.c libc3/buf_inspect_sw_binary.h libc3/hash.h libc3/u32.h libc3/buf_inspect_u32_octal.c libc3/character.c libc3/buf_inspect_u64_decimal.c libc3/buf_parse_uw.h libc3/buf_inspect_u32_decimal.c libc3/buf_inspect_s16_hexadecimal.c libc3/set_cursor__tag.c libc3/set_cursor__fact.h libc3/buf.c libc3/abs.c libc3/buf_parse_s64.h libc3/buf_inspect_s.c.in libc3/buf_inspect_s64_binary.h libc3/buf_inspect_u8_octal.c libc3/f64.c libc3/skiplist_node.c.in libc3/buf_parse_u32.c libc3/facts_with.h libc3/buf_inspect_sw.c libc3/buf_inspect_u16.h libc3/buf_inspect_s8_hexadecimal.h libc3/buf_inspect_u16_binary.h libc3/buf_inspect_u64_hexadecimal.h libc3/buf_save.c test/ident_test.c test/buf_parse_test_s16.c test/buf_inspect_test.c test/libc3_test.c test/fn_test.c test/buf_parse_test_u16.c test/str_test.c test/cfn_test.c test/character_test.c test/buf_parse_test_s8.c test/skiplist__fact_test.c test/sym_test.c test/tag_test.h test/buf_file_test.c test/bool_test.c test/fact_test.h test/buf_parse_test_u64.c test/compare_test.c test/facts_with_test.c test/array_test.c test/buf_parse_test.h test/test.h test/buf_parse_test_su.h test/env_test.c test/buf_parse_test_s64.c test/types_test.c test/hash_test.c test/call_test.c test/set__tag_test.c test/facts_test.c test/facts_cursor_test.c test/compare_test.h test/buf_parse_test_s32.c test/test.c test/buf_parse_test.c test/fact_test.c test/tag_test.c test/set__fact_test.c test/buf_parse_test_u32.c test/buf_test.c test/list_test.c test/buf_parse_test_u8.c test/tuple_test.c ucd2c/ucd.h ucd2c/ucd2c.c '