From 7539f8c8804849294e100c5442e0397f4f4d2c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 1 Oct 2019 23:39:00 +0200 Subject: Disabled bunch of old stuff, new stuff kinda builds. --- module/vcomponent/base.scm | 24 ++++++++++++++++-------- module/vcomponent/primitive.scm | 30 +++++++++++++++++------------- 2 files changed, 33 insertions(+), 21 deletions(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index fd8628f9..4b49ba66 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -6,11 +6,16 @@ :use-module ((ice-9 optargs) :select (define*-public))) (define (get-attr component attr) + (hash-ref (struct-ref component 3) + (as-string attr)) + #; (%vcomponent-get-attribute component (as-string attr))) (define (set-attr! component attr value) + 'noop + #; (set! (car (get-attr component (as-string attr))) value)) @@ -49,21 +54,24 @@ (hash-map->list cons (cdar attrptr))) (define-public type (make-procedure-with-setter - %vcomponent-get-type - %vcomponent-set-type!)) -(define-public parent %vcomponent-parent) -(define-public push-child! %vcomponent-push-child!) -(define-public (attributes component) (map string->symbol (%vcomponent-attribute-list component))) + (lambda (c) (struct-ref c 0)) + (lambda (c v) struct-set! c 0 v) + )) +(define-public (parent c) (struct-ref c 2)) +(define-public push-child! add-child!) +(define-public (attributes component) '("noop") + #; (map string->symbol (%vcomponent-attribute-list component)) + ) (define*-public (children component #:optional only-type) - (let ((childs (%vcomponent-children component))) + (let ((childs (slot-ref component 1))) (if only-type (filter (lambda (e) (eq? only-type (type e))) childs) childs))) -(define-public copy-vcomponent %vcomponent-shallow-copy) +;; (define-public copy-vcomponent %vcomponent-shallow-copy) -(define-public filter-children! %vcomponent-filter-children!) +;; (define-public filter-children! %vcomponent-filter-children!) (define-public (extract field) (lambda (e) (attr e field))) diff --git a/module/vcomponent/primitive.scm b/module/vcomponent/primitive.scm index ad33a3be..e103feae 100644 --- a/module/vcomponent/primitive.scm +++ b/module/vcomponent/primitive.scm @@ -1,19 +1,23 @@ ;;; Primitive export of symbols linked from C binary. (define-module (vcomponent primitive) - #:export (%vcomponent-children - %vcomponent-push-child! - %vcomponent-filter-children! + #:export #; + (%vcomponent-children ; + %vcomponent-push-child! ; + %vcomponent-filter-children! ; + ; + %vcomponent-parent ; + ; + %vcomponent-make ; + %vcomponent-get-type ; + %vcomponent-set-type! ; + ; + %vcomponent-get-attribute ; + %vcomponent-attribute-list ; + ; + %vcomponent-shallow-copy) - %vcomponent-parent - - %vcomponent-make - %vcomponent-get-type - %vcomponent-set-type! - - %vcomponent-get-attribute - %vcomponent-attribute-list - - %vcomponent-shallow-copy)) + (make-vcomponent add-line! add-child! make-vline add-attribute! parse-path) + ) (load-extension "libguile-calendar" "init_lib") -- cgit v1.2.3