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 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'module/vcomponent/base.scm') 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))) -- cgit v1.2.3