Index: NOTES
==================================================================
--- NOTES
+++ NOTES
@@ -158,5 +158,9 @@
INFO: (0) Server shutdown complete. Exiting
Start: 0 at Sun Apr 28 22:18:25 MST 2013
Max: 52 at Sun Apr 28 23:06:59 MST 2013
End: 6 at Sun Apr 28 23:47:51 MST 2013
+
+
+## Binary size, Dec 6, 2019
+v1.65-try3 11744824 Dec 6 10:08 bin/.11/mtest
ADDED attic/tree.scm
Index: attic/tree.scm
==================================================================
--- /dev/null
+++ attic/tree.scm
@@ -0,0 +1,43 @@
+;;======================================================================
+;; Copyright 2006-2013, Matthew Welland.
+;;
+;; This file is part of Megatest.
+;;
+;; Megatest is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Megatest is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Megatest. If not, see .
+;;
+;;======================================================================
+
+(use format)
+(require-library iup)
+(import (prefix iup iup:))
+(use canvas-draw)
+
+(use sqlite3 srfi-1 posix regex regex-case srfi-69)
+(import (prefix sqlite3 sqlite3:))
+
+(declare (unit tree))
+(declare (uses margs))
+(declare (uses launch))
+(declare (uses megatest-version))
+(declare (uses gutils))
+(declare (uses db))
+(declare (uses server))
+;; (declare (uses synchash))
+(declare (uses dcommon))
+
+(include "common_records.scm")
+(include "db_records.scm")
+(include "key_records.scm")
+
+
ADDED attic/vg-test.scm
Index: attic/vg-test.scm
==================================================================
--- /dev/null
+++ attic/vg-test.scm
@@ -0,0 +1,119 @@
+;; Copyright 2006-2017, Matthew Welland.
+;;
+;; This file is part of Megatest.
+;;
+;; Megatest is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Megatest is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Megatest. If not, see .
+;;
+(use canvas-draw iup foof-loop)
+(import canvas-draw-iup)
+
+(load "vg.scm")
+
+(define numtorun 1000)
+;; (if (> (length (argv)) 1)
+;; (string->number (cadr (argv)))
+;; 1000))
+
+ (use trace)
+ ;; (trace
+ ;; ;; vg:draw-rect
+ ;; ;; vg:grow-rect
+ ;; vg:get-extents-for-objs
+ ;; vg:components-get-extents
+ ;; vg:instances-get-extents
+ ;; vg:get-extents-for-two-rects
+ ;; canvas-line!)
+
+(define d1 (vg:drawing-new))
+(define l1 (vg:lib-new))
+(define c1 (vg:comp-new))
+(define c2 (vg:comp-new))
+(define bt1 (vg:make-rect-obj 10 40 20 50 text: "A long piece of text" font: "Helvetica, -10"))
+
+(let ((r1 (vg:make-rect-obj 20 20 30 30 text: "r1" font: "Helvetica, -20"))
+ (r2 (vg:make-rect-obj 30 30 60 60 text: "r2" font: "Helvetica, -10"))
+ (t1 (vg:make-text-obj 60 60 "The middle" font: "Helvetica, -10")))
+ (vg:add-objs-to-comp c1 r1 r2 t1 bt1))
+
+(loop ((for x (up-from 0 (to 20))))
+ (loop ((for y (up-from 0 (to 20))))
+ (vg:add-objs-to-comp c1 (vg:make-rect-obj x y (+ x 5)(+ y 5)))))
+
+(let ((start (current-seconds)))
+ (let loop ((i 0))
+ (vg:add-obj-to-comp c1 (vg:make-rect-obj 0 0 100 100))
+ (if (< i numtorun)(loop (+ i 1))))
+ (print "Run time: " (- (current-seconds) start)))
+
+(vg:add-obj-to-comp c1 (vg:make-line-obj 0 0 100 100))
+
+;; add the c1 component to lib l1 with name firstcomp
+(vg:add-comp-to-lib l1 "firstcomp" c1)
+(vg:add-comp-to-lib l1 "secondcomp" c2)
+
+;; add the l1 lib to drawing with name firstlib
+(vg:add-lib d1 "firstlib" l1)
+
+;; instantiate firstlib/firstcomp as inst1 in drawing d1 at 0,0
+(vg:instantiate d1 "firstlib" "firstcomp" "inst1" 0 0)
+(vg:instantiate d1 "firstlib" "firstcomp" "inst2" 200 200)
+
+
+;; (vg:drawing-scalex-set! d1 1.1)
+;; (vg:drawing-scaley-set! d1 0.5)
+
+;; (define xtnts (vg:scale-offset-xy
+;; (vg:component-get-extents c1)
+;; 1.1 1.1 -2 -2))
+
+;; get extents of c1 and put a rectange around it
+;;
+(define xtnts (apply vg:grow-rect 10 10 (vg:components-get-extents d1 c1)))
+(vg:add-objs-to-comp c1 (apply vg:make-rect-obj xtnts))
+
+(define bt1xt (vg:obj-get-extents d1 bt1))
+(print "bt1xt: " bt1xt)
+(vg:add-objs-to-comp c1 (apply vg:make-rect-obj bt1xt))
+
+;; get extents of all objects and put rectangle around it
+;;
+(define big-xtnts (vg:instances-get-extents d1))
+(vg:add-objs-to-comp c2 (apply vg:make-rect-obj big-xtnts))
+(vg:instantiate d1 "firstlib" "secondcomp" "inst3" 0 0)
+
+(vg:drawing-scalex-set! d1 1.5)
+(vg:drawing-scaley-set! d1 1.5)
+
+(define cnv #f)
+(define the-cnv (canvas
+ #:size "500x400"
+ #:expand "YES"
+ #:scrollbar "YES"
+ #:posx "0.5"
+ #:posy "0.5"
+ #:action (make-canvas-action
+ (lambda (c xadj yadj)
+ (set! cnv c)))))
+
+(show
+ (dialog
+ (vbox
+ the-cnv)))
+
+(vg:drawing-cnv-set! d1 cnv)
+(vg:draw d1 #t)
+
+;; (canvas-rectangle! cnv 10 100 10 80)
+
+(main-loop)
ADDED attic/widgets.scm
Index: attic/widgets.scm
==================================================================
--- /dev/null
+++ attic/widgets.scm
@@ -0,0 +1,206 @@
+;; Copyright 2006-2017, Matthew Welland.
+;;
+;; This file is part of Megatest.
+;;
+;; Megatest is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Megatest is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Megatest. If not, see .
+
+(require-library srfi-4 iup)
+(import srfi-4 iup iup-pplot iup-glcanvas) ;; iup-web
+
+(define (popup dlg . args)
+ (apply show dlg #:modal? 'yes args)
+ (destroy! dlg))
+
+(define (properties ih)
+ (popup (element-properties-dialog ih))
+ 'default)
+
+(define dlg
+ (dialog
+ (vbox
+ (hbox ; headline
+ (fill)
+ (frame (label " Inspect control and dialog classes "
+ fontsize: 15))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Dialogs" fontsize: 12)
+ (hbox
+ (button "dialog"
+ action: (lambda (self) (properties (dialog (vbox)))))
+ (button "color-dialog"
+ action: (lambda (self) (properties (color-dialog))))
+ (button "file-dialog"
+ action: (lambda (self) (properties (file-dialog))))
+ (button "font-dialog"
+ action: (lambda (self) (properties (font-dialog))))
+ (button "message-dialog"
+ action: (lambda (self) (properties (message-dialog))))
+ (fill)
+ margin: '0x0)
+ (hbox
+ (button "layout-dialog"
+ action: (lambda (self) (properties (layout-dialog))))
+ (button "element-properties-dialog"
+ action: (lambda (self)
+ (properties
+ (element-properties-dialog (create 'user)))))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Composition widgets" fontsize: 12)
+ (hbox
+ (button "fill"
+ action: (lambda (self) (properties (fill))))
+ (button "hbox"
+ action: (lambda (self) (properties (hbox))))
+ (button "vbox"
+ action: (lambda (self) (properties (vbox))))
+ (button "zbox"
+ action: (lambda (self) (properties (zbox))))
+ (button "radio"
+ action: (lambda (self) (properties (radio (vbox)))))
+ (button "normalizer"
+ action: (lambda (self) (properties (normalizer))))
+ (button "cbox"
+ action: (lambda (self) (properties (cbox))))
+ (button "sbox"
+ action: (lambda (self) (properties (sbox (vbox)))))
+ (button "split"
+ action: (lambda (self) (properties (split (vbox) (vbox)))))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Standard widgets" fontsize: 12)
+ (hbox
+ (button "button"
+ action: (lambda (self) (properties (button))))
+ (button "canvas"
+ action: (lambda (self) (properties (canvas))))
+ (button "frame"
+ action: (lambda (self) (properties (frame))))
+ (button "label"
+ action: (lambda (self) (properties (label))))
+ (button "listbox"
+ action: (lambda (self) (properties (listbox))))
+ (button "progress-bar"
+ action: (lambda (self) (properties (progress-bar))))
+ (button "spin"
+ action: (lambda (self) (properties (spin))))
+ (fill)
+ margin: '0x0)
+ (hbox
+ (button "tabs"
+ action: (lambda (self) (properties (tabs))))
+ (button "textbox"
+ action: (lambda (self) (properties (textbox))))
+ (button "toggle"
+ action: (lambda (self) (properties (toggle))))
+ (button "treebox"
+ action: (lambda (self) (properties (treebox))))
+ (button "valuator"
+ action: (lambda (self) (properties (valuator ""))))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Additional widgets" fontsize: 12)
+ (hbox
+ (button "cells"
+ action: (lambda (self) (properties (cells))))
+ (button "color-bar"
+ action: (lambda (self) (properties (color-bar))))
+ (button "color-browser"
+ action: (lambda (self) (properties (color-browser))))
+ (button "dial"
+ action: (lambda (self) (properties (dial ""))))
+ (button "matrix"
+ action: (lambda (self) (properties (matrix))))
+ (fill)
+ margin: '0x0)
+ (hbox
+ (button "pplot"
+ action: (lambda (self) (properties (pplot))))
+ (button "glcanvas"
+ action: (lambda (self) (properties (glcanvas))))
+ ;; (button "web-browser"
+ ;; action: (lambda (self) (properties (web-browser))))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Menu widgets" fontsize: 12)
+ (hbox
+ (button "menu"
+ action: (lambda (self) (properties (menu))))
+ (button "menu-item"
+ action: (lambda (self) (properties (menu-item))))
+ (button "menu-separator"
+ action: (lambda (self) (properties (menu-separator))))
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Images" fontsize: 12)
+ (hbox
+ (button "image/palette"
+ action: (lambda (self)
+ (properties
+ (image/palette 1 1 (u8vector->blob (u8vector 0))))))
+ (button "image/rgb"
+ action: (lambda (self)
+ (properties
+ (image/rgb 1 1 (u8vector->blob (u8vector 0))))))
+ (button "image/rgba"
+ action: (lambda (self)
+ (properties
+ (image/rgba 1 1 (u8vector->blob (u8vector 0))))))
+ (button "image/file"
+ action: (lambda (self)
+ (properties
+ ;; same attributes as image/palette
+ (image/palette 1 1 (u8vector->blob (u8vector 0))))))
+ ;; needs a file in current directory
+ ;(image/file "chicken.ico")))) ; ok
+ ;(image/file "chicken.png")))) ; doesn't work
+ (fill)
+ margin: '0x0)
+
+ (label "")
+ (label "Other widgets" fontsize: 12)
+ (hbox
+ (button "clipboard"
+ action: (lambda (self) (properties (clipboard))))
+ (button "timer"
+ action: (lambda (self) (properties (timer))))
+ (button "spinbox"
+ action: (lambda (self) (properties (spinbox (vbox)))))
+ (fill)
+ margin: '0x0)
+
+ (fill)
+ (button "E&xit"
+ expand: 'horizontal
+ action: (lambda (self) 'close))
+ )
+ margin: '15x15
+ title: "Iup inspector"))
+
+(show dlg)
+(main-loop)
+(exit 0)
Index: common_records.scm
==================================================================
--- common_records.scm
+++ common_records.scm
@@ -20,12 +20,10 @@
;; (use trace)
(use typed-records)
;; globals - modules that include this need these here
-(define *verbosity-cache* (make-hash-table))
-(define *verbosity* 0)
(define *default-log-port* (current-error-port))
(define *logging* #f)
(define *functions* (make-hash-table)) ;; symbol => fn ### TEMPORARY!!!
;; (define *toppath* #f)
(define *transport-type* 'http)
@@ -286,77 +284,10 @@
(mutex-lock! mtx)
(let ((res (apply accessor record val)))
(mutex-unlock! mtx)
res))
-;; this was cached based on results from profiling but it turned out the profiling
-;; somehow went wrong - perhaps too many processes writing to it. Leaving the caching
-;; in for now but can probably take it out later.
-;;
-(define (debug:calc-verbosity vstr verbose quiet) ;; verbose and quiet are #f or enabled
- (or (hash-table-ref/default *verbosity-cache* vstr #f)
- (let ((res (cond
- ((number? vstr) vstr)
- ((not (string? vstr)) 1)
- ;; ((string-match "^\\s*$" vstr) 1)
- (vstr (let ((debugvals (filter number? (map string->number (string-split vstr ",")))))
- (cond
- ((> (length debugvals) 1) debugvals)
- ((> (length debugvals) 0)(car debugvals))
- (else 1))))
- (verbose 2) ;; ((args:get-arg "-v") 2)
- (quiet 0) ;; ((args:get-arg "-q") 0)
- (else 1))))
- (hash-table-set! *verbosity-cache* vstr res)
- res)))
-
-;; check verbosity, #t is ok
-(define (debug:check-verbosity verbosity vstr)
- (if (not (or (number? verbosity)
- (list? verbosity)))
- (begin
- (print "ERROR: Invalid debug value \"" vstr "\"")
- #f)
- #t))
-
-(define (debug:debug-mode n)
- (cond
- ((and (number? *verbosity*) ;; number number
- (number? n))
- (<= n *verbosity*))
- ((and (list? *verbosity*) ;; list number
- (number? n))
- (member n *verbosity*))
- ((and (list? *verbosity*) ;; list list
- (list? n))
- (not (null? (lset-intersection! eq? *verbosity* n))))
- ((and (number? *verbosity*)
- (list? n))
- (member *verbosity* n))))
-
-(define (debug:setup dmode verbose quiet)
- (let ((debugstr (or dmode ;; (args:get-arg "-debug")
- (get-environment-variable "MT_DEBUG_MODE"))))
- (set! *verbosity* (debug:calc-verbosity debugstr verbose quiet))
- (debug:check-verbosity *verbosity* debugstr)
- ;; if we were handed a bad verbosity rule then we will override it with 1 and continue
- (if (not *verbosity*)(set! *verbosity* 1))
- (if (or dmode ;; (args:get-arg "-debug")
- (not (get-environment-variable "MT_DEBUG_MODE")))
- (setenv "MT_DEBUG_MODE" (if (list? *verbosity*)
- (string-intersperse (map conc *verbosity*) ",")
- (conc *verbosity*))))))
-
-(define (debug:print n e . params)
- (if (debug:debug-mode n)
- (with-output-to-port (or e (current-error-port))
- (lambda ()
- ;; (if *logging*
- ;; (exec-fn 'db:log-event (apply conc params))
- (apply print params)
- )))) ;; )
-
;; Brandon's debug printer shortcut (indulge me :)
;; (define *BB-process-starttime* (current-milliseconds))
#;(define (BB> . in-args)
(let* ((stack (get-call-chain))
(location "??"))
@@ -421,41 +352,12 @@
;; (with-output-to-port (current-error-port)
(printf "~a is: ~a\n" 'x (with-output-to-string (lambda () (BBpp x))))
;; )
]
[(_ x y ...) (begin (inspect x) (inspect y ...))]))
-
-(define (debug:print-error n e . params)
- ;; normal print
- (if (debug:debug-mode n)
- (with-output-to-port (if (port? e) e (current-error-port))
- (lambda ()
- ;; (if *logging*
- ;; (exec-fn 'db:log-event (apply conc params))
- ;; (apply print "pid:" (current-process-id) " " params)
- (apply print "ERROR: " params)
- ))) ;; )
- ;; pass important messages to stderr
- (if (and (eq? n 0)(not (eq? e (current-error-port))))
- (with-output-to-port (current-error-port)
- (lambda ()
- (apply print "ERROR: " params)
- ))))
-
-(define (debug:print-info n e . params)
- (if (debug:debug-mode n)
- (with-output-to-port (if (port? e) e (current-error-port))
- (lambda ()
- ;; (if *logging*
- ;; (let ((res (format#format #f "INFO: (~a) ~a" n (apply conc params))))
- ;; (exec-fn 'db:log-event res))
- ;; (apply print "pid:" (current-process-id) " " "INFO: (" n ") " params) ;; res)
- (apply print "INFO: (" n ") " params) ;; res)
- )))) ;; )
-
;; if a value is printable (i.e. string or number) return the value
;; else return an empty string
(define-inline (printable val)
(if (or (number? val)(string? val)) val ""))
Index: commonmod.scm
==================================================================
--- commonmod.scm
+++ commonmod.scm
@@ -17,11 +17,11 @@
;; along with Megatest. If not, see .
;;======================================================================
(declare (unit commonmod))
-(declare (uses processmod))
+;; (declare (uses processmod))
(module commonmod
*
(import scheme chicken data-structures extras)
@@ -30,16 +30,117 @@
srfi-69 ports
regex-case regex hostinfo srfi-4
pkts (prefix dbi dbi:)
stack)
-(import processmod)
+;; (import processmod)
(import stml2)
(include "common_records.scm")
(include "megatest-fossil-hash.scm")
(include "megatest-version.scm")
+
+ ;; no need to export this
+(define *verbosity-cache* (make-hash-table))
+(define *verbosity* 0)
+
+;; this was cached based on results from profiling but it turned out the profiling
+;; somehow went wrong - perhaps too many processes writing to it. Leaving the caching
+;; in for now but can probably take it out later.
+;;
+(define (debug:calc-verbosity vstr verbose quiet) ;; verbose and quiet are #f or enabled
+ (or (hash-table-ref/default *verbosity-cache* vstr #f)
+ (let ((res (cond
+ ((number? vstr) vstr)
+ ((not (string? vstr)) 1)
+ ;; ((string-match "^\\s*$" vstr) 1)
+ (vstr (let ((debugvals (filter number? (map string->number (string-split vstr ",")))))
+ (cond
+ ((> (length debugvals) 1) debugvals)
+ ((> (length debugvals) 0)(car debugvals))
+ (else 1))))
+ (verbose 2) ;; ((args:get-arg "-v") 2)
+ (quiet 0) ;; ((args:get-arg "-q") 0)
+ (else 1))))
+ (hash-table-set! *verbosity-cache* vstr res)
+ res)))
+
+;; check verbosity, #t is ok
+(define (debug:check-verbosity verbosity vstr)
+ (if (not (or (number? verbosity)
+ (list? verbosity)))
+ (begin
+ (print "ERROR: Invalid debug value \"" vstr "\"")
+ #f)
+ #t))
+
+(define (debug:debug-mode n)
+ (cond
+ ((and (number? *verbosity*) ;; number number
+ (number? n))
+ (<= n *verbosity*))
+ ((and (list? *verbosity*) ;; list number
+ (number? n))
+ (member n *verbosity*))
+ ((and (list? *verbosity*) ;; list list
+ (list? n))
+ (not (null? (lset-intersection! eq? *verbosity* n))))
+ ((and (number? *verbosity*)
+ (list? n))
+ (member *verbosity* n))))
+
+(define (debug:setup dmode verbose quiet)
+ (let ((debugstr (or dmode ;; (args:get-arg "-debug")
+ (get-environment-variable "MT_DEBUG_MODE"))))
+ (set! *verbosity* (debug:calc-verbosity debugstr verbose quiet))
+ (debug:check-verbosity *verbosity* debugstr)
+ ;; if we were handed a bad verbosity rule then we will override it with 1 and continue
+ (if (not *verbosity*)(set! *verbosity* 1))
+ (if (or dmode ;; (args:get-arg "-debug")
+ (not (get-environment-variable "MT_DEBUG_MODE")))
+ (setenv "MT_DEBUG_MODE" (if (list? *verbosity*)
+ (string-intersperse (map conc *verbosity*) ",")
+ (conc *verbosity*))))))
+
+(define (debug:print n e . params)
+ (if (debug:debug-mode n)
+ (with-output-to-port (or e (current-error-port))
+ (lambda ()
+ ;; (if *logging*
+ ;; (exec-fn 'db:log-event (apply conc params))
+ (apply print params)
+ )))) ;; )
+
+(define (debug:print-error n e . params)
+ ;; normal print
+ (if (debug:debug-mode n)
+ (with-output-to-port (if (port? e) e (current-error-port))
+ (lambda ()
+ ;; (if *logging*
+ ;; (exec-fn 'db:log-event (apply conc params))
+ ;; (apply print "pid:" (current-process-id) " " params)
+ (apply print "ERROR: " params)
+ ))) ;; )
+ ;; pass important messages to stderr
+ (if (and (eq? n 0)(not (eq? e (current-error-port))))
+ (with-output-to-port (current-error-port)
+ (lambda ()
+ (apply print "ERROR: " params)
+ ))))
+
+(define (debug:print-info n e . params)
+ (if (debug:debug-mode n)
+ (with-output-to-port (if (port? e) e (current-error-port))
+ (lambda ()
+ ;; (if *logging*
+ ;; (let ((res (format#format #f "INFO: (~a) ~a" n (apply conc params))))
+ ;; (exec-fn 'db:log-event res))
+ ;; (apply print "pid:" (current-process-id) " " "INFO: (" n ") " params) ;; res)
+ (apply print "INFO: (" n ") " params) ;; res)
+ )))) ;; )
+
+
;; (define (common:low-noise-print alldat waitval . keys)
;; (let* ((key (string-intersperse (map conc keys) "-" ))
;; (lasttime (hash-table-ref/default (alldat-denoise alldat) key 0))
;; (currtime (current-seconds)))
Index: dashboard.scm
==================================================================
--- dashboard.scm
+++ dashboard.scm
@@ -69,10 +69,11 @@
(include "task_records.scm")
(include "megatest-fossil-hash.scm")
(include "vg_records.scm")
;; invoke the imports
+(declare (uses commonmod.import))
(declare (uses megamod.import))
(declare (uses dcommonmod.import))
(configf:set-debug-printers debug:print debug:print-info debug:print-error *default-log-port*)
(configf:add-eval-string "(import megamod)")
Index: dcommonmod.scm
==================================================================
--- dcommonmod.scm
+++ dcommonmod.scm
@@ -17,11 +17,11 @@
;; along with Megatest. If not, see .
;;======================================================================
(declare (unit dcommonmod))
-;; (declare (uses commonmod))
+(declare (uses commonmod))
(declare (uses megamod))
(module dcommonmod
*
@@ -79,11 +79,11 @@
z3
)
(use (prefix mtconfigf configf:))
-;; (import commonmod)
+(import commonmod)
(import megamod)
(import canvas-draw)
(import canvas-draw-iup)
(use (prefix iup iup:))
Index: keysmod.scm
==================================================================
--- keysmod.scm
+++ keysmod.scm
@@ -17,20 +17,20 @@
;; along with Megatest. If not, see .
;;======================================================================
(declare (unit keysmod))
-(declare (uses commonmod))
+;; (declare (uses commonmod))
(module keysmod
*
(import scheme chicken data-structures extras)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69 format ports srfi-1 matchable)
-(import commonmod)
+;; (import commonmod)
;; (use (prefix ulex ulex:))
(import srfi-13)
-(include "common_records.scm")
+;; (include "common_records.scm")
)
Index: megamod.scm
==================================================================
--- megamod.scm
+++ megamod.scm
@@ -22,11 +22,13 @@
;; (declare (uses commonmod))
;; (declare (uses dbmod))
;; ;;(declare (uses apimod))
;; (declare (uses ftail))
;; ;; (declare (uses rmtmod))
-;; (declare (uses commonmod))
+
+(declare (uses commonmod))
+
;; (declare (uses apimod))
;; (declare (uses archivemod))
;; (declare (uses clientmod))
;; (declare (uses dbmod))
;; (declare (uses dcommonmod))
@@ -102,10 +104,11 @@
(define read-config configf:read-config)
(define find-and-read-config configf:find-and-read-config)
(define config:eval-string-in-environment configf:eval-string-in-environment)
(import spiffy)
+(import commonmod)
;; (import apimod)
;; (import archivemod)
;; (import clientmod)
;; (import commonmod)
Index: megatest.scm
==================================================================
--- megatest.scm
+++ megatest.scm
@@ -56,10 +56,11 @@
(import dbmod)
(declare (uses megamod))
(import megamod)
;; invoke the imports
+(declare (uses commonmod.import))
(declare (uses megamod.import))
(configf:set-debug-printers debug:print debug:print-info debug:print-error *default-log-port*)
;; (declare (uses tdb))
Index: processmod.scm
==================================================================
--- processmod.scm
+++ processmod.scm
@@ -28,11 +28,11 @@
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69
format ports srfi-1 matchable regex directory-utils)
;; (import commonmod)
;; (use (prefix ulex ulex:))
-(include "common_records.scm")
+;; (include "common_records.scm")
;;
;;
;; ;; accept an alist or hash table containing envvar/env value pairs (value of #f causes unset)
;; ;; execute thunk in context of environment modified as per this list
Index: rmtmod.scm
==================================================================
--- rmtmod.scm
+++ rmtmod.scm
@@ -18,21 +18,21 @@
;;======================================================================
(declare (unit rmtmod))
;; (declare (uses commonmod))
-(declare (uses dbmod))
-(declare (uses megamod))
+;; (declare (uses dbmod))
+;; (declare (uses megamod))
(module rmtmod
*
(import scheme chicken data-structures extras)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69 format ports srfi-1 matchable)
;; (import commonmod) ;;; DO NOT ALLOW rmt*scm TO DEPEND ON common*scm!!!!
-(import dbmod)
-(import megamod)
+;; (import dbmod)
+;; (import megamod)
(use (prefix ulex ulex:))
-(include "common_records.scm")
+;; (include "common_records.scm")
)
DELETED tree.scm
Index: tree.scm
==================================================================
--- tree.scm
+++ /dev/null
@@ -1,43 +0,0 @@
-;;======================================================================
-;; Copyright 2006-2013, Matthew Welland.
-;;
-;; This file is part of Megatest.
-;;
-;; Megatest is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-;;
-;; Megatest is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with Megatest. If not, see .
-;;
-;;======================================================================
-
-(use format)
-(require-library iup)
-(import (prefix iup iup:))
-(use canvas-draw)
-
-(use sqlite3 srfi-1 posix regex regex-case srfi-69)
-(import (prefix sqlite3 sqlite3:))
-
-(declare (unit tree))
-(declare (uses margs))
-(declare (uses launch))
-(declare (uses megatest-version))
-(declare (uses gutils))
-(declare (uses db))
-(declare (uses server))
-;; (declare (uses synchash))
-(declare (uses dcommon))
-
-(include "common_records.scm")
-(include "db_records.scm")
-(include "key_records.scm")
-
-
Index: treemod.scm
==================================================================
--- treemod.scm
+++ treemod.scm
@@ -24,9 +24,8 @@
*
(import scheme chicken data-structures extras)
(import (prefix iup iup:)) ;; (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69 format ports srfi-1 matchable)
;; (import commonmod) ;;; DO NOT ALLOW rmt*scm TO DEPEND ON common*scm!!!!
-
-
;; (include "common_records.scm")
+
)
DELETED vg-test.scm
Index: vg-test.scm
==================================================================
--- vg-test.scm
+++ /dev/null
@@ -1,119 +0,0 @@
-;; Copyright 2006-2017, Matthew Welland.
-;;
-;; This file is part of Megatest.
-;;
-;; Megatest is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-;;
-;; Megatest is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with Megatest. If not, see .
-;;
-(use canvas-draw iup foof-loop)
-(import canvas-draw-iup)
-
-(load "vg.scm")
-
-(define numtorun 1000)
-;; (if (> (length (argv)) 1)
-;; (string->number (cadr (argv)))
-;; 1000))
-
- (use trace)
- ;; (trace
- ;; ;; vg:draw-rect
- ;; ;; vg:grow-rect
- ;; vg:get-extents-for-objs
- ;; vg:components-get-extents
- ;; vg:instances-get-extents
- ;; vg:get-extents-for-two-rects
- ;; canvas-line!)
-
-(define d1 (vg:drawing-new))
-(define l1 (vg:lib-new))
-(define c1 (vg:comp-new))
-(define c2 (vg:comp-new))
-(define bt1 (vg:make-rect-obj 10 40 20 50 text: "A long piece of text" font: "Helvetica, -10"))
-
-(let ((r1 (vg:make-rect-obj 20 20 30 30 text: "r1" font: "Helvetica, -20"))
- (r2 (vg:make-rect-obj 30 30 60 60 text: "r2" font: "Helvetica, -10"))
- (t1 (vg:make-text-obj 60 60 "The middle" font: "Helvetica, -10")))
- (vg:add-objs-to-comp c1 r1 r2 t1 bt1))
-
-(loop ((for x (up-from 0 (to 20))))
- (loop ((for y (up-from 0 (to 20))))
- (vg:add-objs-to-comp c1 (vg:make-rect-obj x y (+ x 5)(+ y 5)))))
-
-(let ((start (current-seconds)))
- (let loop ((i 0))
- (vg:add-obj-to-comp c1 (vg:make-rect-obj 0 0 100 100))
- (if (< i numtorun)(loop (+ i 1))))
- (print "Run time: " (- (current-seconds) start)))
-
-(vg:add-obj-to-comp c1 (vg:make-line-obj 0 0 100 100))
-
-;; add the c1 component to lib l1 with name firstcomp
-(vg:add-comp-to-lib l1 "firstcomp" c1)
-(vg:add-comp-to-lib l1 "secondcomp" c2)
-
-;; add the l1 lib to drawing with name firstlib
-(vg:add-lib d1 "firstlib" l1)
-
-;; instantiate firstlib/firstcomp as inst1 in drawing d1 at 0,0
-(vg:instantiate d1 "firstlib" "firstcomp" "inst1" 0 0)
-(vg:instantiate d1 "firstlib" "firstcomp" "inst2" 200 200)
-
-
-;; (vg:drawing-scalex-set! d1 1.1)
-;; (vg:drawing-scaley-set! d1 0.5)
-
-;; (define xtnts (vg:scale-offset-xy
-;; (vg:component-get-extents c1)
-;; 1.1 1.1 -2 -2))
-
-;; get extents of c1 and put a rectange around it
-;;
-(define xtnts (apply vg:grow-rect 10 10 (vg:components-get-extents d1 c1)))
-(vg:add-objs-to-comp c1 (apply vg:make-rect-obj xtnts))
-
-(define bt1xt (vg:obj-get-extents d1 bt1))
-(print "bt1xt: " bt1xt)
-(vg:add-objs-to-comp c1 (apply vg:make-rect-obj bt1xt))
-
-;; get extents of all objects and put rectangle around it
-;;
-(define big-xtnts (vg:instances-get-extents d1))
-(vg:add-objs-to-comp c2 (apply vg:make-rect-obj big-xtnts))
-(vg:instantiate d1 "firstlib" "secondcomp" "inst3" 0 0)
-
-(vg:drawing-scalex-set! d1 1.5)
-(vg:drawing-scaley-set! d1 1.5)
-
-(define cnv #f)
-(define the-cnv (canvas
- #:size "500x400"
- #:expand "YES"
- #:scrollbar "YES"
- #:posx "0.5"
- #:posy "0.5"
- #:action (make-canvas-action
- (lambda (c xadj yadj)
- (set! cnv c)))))
-
-(show
- (dialog
- (vbox
- the-cnv)))
-
-(vg:drawing-cnv-set! d1 cnv)
-(vg:draw d1 #t)
-
-;; (canvas-rectangle! cnv 10 100 10 80)
-
-(main-loop)
Index: vgmod.scm
==================================================================
--- vgmod.scm
+++ vgmod.scm
@@ -18,20 +18,15 @@
;;======================================================================
(declare (unit vgmod))
;; (declare (uses commonmod))
-;; (import commonmod)
(module vgmod
*
(import scheme chicken data-structures extras)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69 format ports srfi-1 matchable)
;; (import commonmod)
;; (use (prefix ulex ulex:))
-;; (include "common_records.scm")
-;; (include "vg_records.scm")
-;; (include "vg-inc.scm")
-
)
DELETED widgets.scm
Index: widgets.scm
==================================================================
--- widgets.scm
+++ /dev/null
@@ -1,206 +0,0 @@
-;; Copyright 2006-2017, Matthew Welland.
-;;
-;; This file is part of Megatest.
-;;
-;; Megatest is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-;;
-;; Megatest is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with Megatest. If not, see .
-
-(require-library srfi-4 iup)
-(import srfi-4 iup iup-pplot iup-glcanvas) ;; iup-web
-
-(define (popup dlg . args)
- (apply show dlg #:modal? 'yes args)
- (destroy! dlg))
-
-(define (properties ih)
- (popup (element-properties-dialog ih))
- 'default)
-
-(define dlg
- (dialog
- (vbox
- (hbox ; headline
- (fill)
- (frame (label " Inspect control and dialog classes "
- fontsize: 15))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Dialogs" fontsize: 12)
- (hbox
- (button "dialog"
- action: (lambda (self) (properties (dialog (vbox)))))
- (button "color-dialog"
- action: (lambda (self) (properties (color-dialog))))
- (button "file-dialog"
- action: (lambda (self) (properties (file-dialog))))
- (button "font-dialog"
- action: (lambda (self) (properties (font-dialog))))
- (button "message-dialog"
- action: (lambda (self) (properties (message-dialog))))
- (fill)
- margin: '0x0)
- (hbox
- (button "layout-dialog"
- action: (lambda (self) (properties (layout-dialog))))
- (button "element-properties-dialog"
- action: (lambda (self)
- (properties
- (element-properties-dialog (create 'user)))))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Composition widgets" fontsize: 12)
- (hbox
- (button "fill"
- action: (lambda (self) (properties (fill))))
- (button "hbox"
- action: (lambda (self) (properties (hbox))))
- (button "vbox"
- action: (lambda (self) (properties (vbox))))
- (button "zbox"
- action: (lambda (self) (properties (zbox))))
- (button "radio"
- action: (lambda (self) (properties (radio (vbox)))))
- (button "normalizer"
- action: (lambda (self) (properties (normalizer))))
- (button "cbox"
- action: (lambda (self) (properties (cbox))))
- (button "sbox"
- action: (lambda (self) (properties (sbox (vbox)))))
- (button "split"
- action: (lambda (self) (properties (split (vbox) (vbox)))))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Standard widgets" fontsize: 12)
- (hbox
- (button "button"
- action: (lambda (self) (properties (button))))
- (button "canvas"
- action: (lambda (self) (properties (canvas))))
- (button "frame"
- action: (lambda (self) (properties (frame))))
- (button "label"
- action: (lambda (self) (properties (label))))
- (button "listbox"
- action: (lambda (self) (properties (listbox))))
- (button "progress-bar"
- action: (lambda (self) (properties (progress-bar))))
- (button "spin"
- action: (lambda (self) (properties (spin))))
- (fill)
- margin: '0x0)
- (hbox
- (button "tabs"
- action: (lambda (self) (properties (tabs))))
- (button "textbox"
- action: (lambda (self) (properties (textbox))))
- (button "toggle"
- action: (lambda (self) (properties (toggle))))
- (button "treebox"
- action: (lambda (self) (properties (treebox))))
- (button "valuator"
- action: (lambda (self) (properties (valuator ""))))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Additional widgets" fontsize: 12)
- (hbox
- (button "cells"
- action: (lambda (self) (properties (cells))))
- (button "color-bar"
- action: (lambda (self) (properties (color-bar))))
- (button "color-browser"
- action: (lambda (self) (properties (color-browser))))
- (button "dial"
- action: (lambda (self) (properties (dial ""))))
- (button "matrix"
- action: (lambda (self) (properties (matrix))))
- (fill)
- margin: '0x0)
- (hbox
- (button "pplot"
- action: (lambda (self) (properties (pplot))))
- (button "glcanvas"
- action: (lambda (self) (properties (glcanvas))))
- ;; (button "web-browser"
- ;; action: (lambda (self) (properties (web-browser))))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Menu widgets" fontsize: 12)
- (hbox
- (button "menu"
- action: (lambda (self) (properties (menu))))
- (button "menu-item"
- action: (lambda (self) (properties (menu-item))))
- (button "menu-separator"
- action: (lambda (self) (properties (menu-separator))))
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Images" fontsize: 12)
- (hbox
- (button "image/palette"
- action: (lambda (self)
- (properties
- (image/palette 1 1 (u8vector->blob (u8vector 0))))))
- (button "image/rgb"
- action: (lambda (self)
- (properties
- (image/rgb 1 1 (u8vector->blob (u8vector 0))))))
- (button "image/rgba"
- action: (lambda (self)
- (properties
- (image/rgba 1 1 (u8vector->blob (u8vector 0))))))
- (button "image/file"
- action: (lambda (self)
- (properties
- ;; same attributes as image/palette
- (image/palette 1 1 (u8vector->blob (u8vector 0))))))
- ;; needs a file in current directory
- ;(image/file "chicken.ico")))) ; ok
- ;(image/file "chicken.png")))) ; doesn't work
- (fill)
- margin: '0x0)
-
- (label "")
- (label "Other widgets" fontsize: 12)
- (hbox
- (button "clipboard"
- action: (lambda (self) (properties (clipboard))))
- (button "timer"
- action: (lambda (self) (properties (timer))))
- (button "spinbox"
- action: (lambda (self) (properties (spinbox (vbox)))))
- (fill)
- margin: '0x0)
-
- (fill)
- (button "E&xit"
- expand: 'horizontal
- action: (lambda (self) 'close))
- )
- margin: '15x15
- title: "Iup inspector"))
-
-(show dlg)
-(main-loop)
-(exit 0)