Megatest

Check-in [b6ea6cc3d4]
Login
Overview
Comment:compilation clean up
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.6584-nanomsg
Files: files | file ages | folders
SHA1: b6ea6cc3d4bb99c0940a5e55921528196d7a6a73
User & Date: matt on 2021-11-10 21:17:31
Other Links: branch diff | manifest | tags
Context
2021-11-13
05:15
misc check-in: cf42e4ea4d user: matt tags: v1.6584-nanomsg
2021-11-10
21:17
compilation clean up check-in: b6ea6cc3d4 user: matt tags: v1.6584-nanomsg
20:32
Added export lists to some modules check-in: 6f94e8e6e3 user: matt tags: v1.6584-nanomsg
Changes

Name change from vg.scm to attic/vg.scm.

Modified configfmod.scm from [20428fe9a2] to [be968f04c6].

49
50
51
52
53
54
55

56
57
58
59
60
61
62
	 configf:write-config
	 find-config
	 nice-path
	 process:cmd-run->list
	 runconfig:read
	 runconfigs-get
	 safe-setenv

	 configf:eval-string-in-environment
	)
	
(import scheme

	chicken.base
	chicken.condition







>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
	 configf:write-config
	 find-config
	 nice-path
	 process:cmd-run->list
	 runconfig:read
	 runconfigs-get
	 safe-setenv
	 setenv
	 configf:eval-string-in-environment
	)
	
(import scheme

	chicken.base
	chicken.condition

Modified dashboard.scm from [65185c4638] to [cda64317ab].

39
40
41
42
43
44
45

46
47
48
49



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

68
69
70
71
72
73
74
(declare (uses processmod))
(declare (uses runsmod))
(declare (uses rmtmod))
(declare (uses subrunmod))
(declare (uses tree))
(declare (uses vgmod))
(declare (uses testsmod))


;; (declare (uses dashboard-guimonitor))
;; (declare (uses dashboard-main))




(import (prefix iup iup:))
(import canvas-draw)
(import canvas-draw-iup)

(import ducttape-lib
	bigmod)

(import (prefix sqlite3 sqlite3:)
	srfi-1
	chicken.file.posix
	chicken.string
	chicken.process-context
	chicken.process-context.posix
	regex regex-case srfi-69
	typed-records
	sparse-vectors
	format
	srfi-4

	)

;; (include "common_records.scm")
;; (include "db_records.scm")
;; (include "run_records.scm")
;; (include "task_records.scm")
;; (include "megatest-version.scm")







>




>
>
>


















>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(declare (uses processmod))
(declare (uses runsmod))
(declare (uses rmtmod))
(declare (uses subrunmod))
(declare (uses tree))
(declare (uses vgmod))
(declare (uses testsmod))
(declare (uses tasksmod))

;; (declare (uses dashboard-guimonitor))
;; (declare (uses dashboard-main))

(module dashboard
	*
	
(import (prefix iup iup:))
(import canvas-draw)
(import canvas-draw-iup)

(import ducttape-lib
	bigmod)

(import (prefix sqlite3 sqlite3:)
	srfi-1
	chicken.file.posix
	chicken.string
	chicken.process-context
	chicken.process-context.posix
	regex regex-case srfi-69
	typed-records
	sparse-vectors
	format
	srfi-4
	srfi-14
	)

;; (include "common_records.scm")
;; (include "db_records.scm")
;; (include "run_records.scm")
;; (include "task_records.scm")
;; (include "megatest-version.scm")
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
	rmtmod
	subrunmod
	vgmod
	dcommon
	tree
	dashboard-context-menu
	dashboard-tests
	testsmod)



(define help (conc 
	      "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest
  version " megatest-version "
  license GPL, Copyright (C) Matt Welland 2012-2017

Usage: dashboard [options]







|
>
>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	rmtmod
	subrunmod
	vgmod
	dcommon
	tree
	dashboard-context-menu
	dashboard-tests
	testsmod
	tasksmod
	)

(define help (conc 
	      "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest
  version " megatest-version "
  license GPL, Copyright (C) Matt Welland 2012-2017

Usage: dashboard [options]
407
408
409
410
411
412
413

414
415
416
417
418
419
420
421
  
  ;; data from sql db
  (keys       (rmt:get-keys))         ;; to be removed when targets handling is refactored
  (runs       (make-sparse-vector))   ;; id => runrec
  (runsbynum  (make-vector 100 #f))   ;; vector num => runrec 
  (targ-runid (make-hash-table))      ;; area/target/runname => run-id  ;; not sure this will be needed
  (tests      (make-hash-table))      ;; test[/itempath] => list of test rec


  ;; run sql filters 
  (targ-sql-filt        "%")
  (runname-sql-filt     "%")
  (run-state-sql-filt   "%")
  (run-status-sql-filt  "%")

  ;; test sql filter







>
|







414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
  
  ;; data from sql db
  (keys       (rmt:get-keys))         ;; to be removed when targets handling is refactored
  (runs       (make-sparse-vector))   ;; id => runrec
  (runsbynum  (make-vector 100 #f))   ;; vector num => runrec 
  (targ-runid (make-hash-table))      ;; area/target/runname => run-id  ;; not sure this will be needed
  (tests      (make-hash-table))      ;; test[/itempath] => list of test rec
  (path-run-ids (make-hash-table))    ;; path => run-id (this is a guess based on code reference)
  
  ;; run sql filters 
  (targ-sql-filt        "%")
  (runname-sql-filt     "%")
  (run-state-sql-filt   "%")
  (run-status-sql-filt  "%")

  ;; test sql filter
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
  id       ;; testid
  state    ;; test state
  status   ;; test status
  )

;; default is to NOT set the cell if the column and row names are not pre-existing
;;
(define (dboard:runsdat-set-test-cell dat target runname testname itempath test-id state status #!key (force-set #f))
  (let* ((col-num  (dcommon:runsdat-get-col-num dat target runname force-set))
	 (row-num  (dcommon:runsdat-get-row-num dat testname itempath force-set)))
    (if (and row-num col-num)
	(let ((tdat (dboard:testdat 
		     id: test-id
		     state: state
		     status: status)))







|







491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
  id       ;; testid
  state    ;; test state
  status   ;; test status
  )

;; default is to NOT set the cell if the column and row names are not pre-existing
;;
#;(define (dboard:runsdat-set-test-cell dat target runname testname itempath test-id state status #!key (force-set #f))
  (let* ((col-num  (dcommon:runsdat-get-col-num dat target runname force-set))
	 (row-num  (dcommon:runsdat-get-row-num dat testname itempath force-set)))
    (if (and row-num col-num)
	(let ((tdat (dboard:testdat 
		     id: test-id
		     state: state
		     status: status)))
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
(define (tree-path->run-id tabdat path)
  (if (not (null? path))
      (hash-table-ref/default (dboard:tabdat-path-run-ids tabdat) path #f)
      #f))

(define (new-tree-path->run-id rdat path)
  (if (not (null? path))
      (hash-table-ref/default (dboard:rdat-path-run-ids tabdat) path #f)
      #f))

;; (define (dboard:get-tests-dat tabdat run-id last-update)
;;   (let* ((access-mode     (dboard:tabdat-access-mode tabdat))
;;          (tdat (if run-id (db:dispatch-query access-mode rmt:get-tests-for-run db:get-tests-for-run
;;                                              run-id 
;; 					     (hash-table-ref/default (dboard:tabdat-searchpatts tabdat) "test-name" "%/%")







|







1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
(define (tree-path->run-id tabdat path)
  (if (not (null? path))
      (hash-table-ref/default (dboard:tabdat-path-run-ids tabdat) path #f)
      #f))

(define (new-tree-path->run-id rdat path)
  (if (not (null? path))
      (hash-table-ref/default (dboard:rdat-path-run-ids rdat) path #f)
      #f))

;; (define (dboard:get-tests-dat tabdat run-id last-update)
;;   (let* ((access-mode     (dboard:tabdat-access-mode tabdat))
;;          (tdat (if run-id (db:dispatch-query access-mode rmt:get-tests-for-run db:get-tests-for-run
;;                                              run-id 
;; 					     (hash-table-ref/default (dboard:tabdat-searchpatts tabdat) "test-name" "%/%")
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
		    (if (equal? (car parts) "sqlite3")
			(cadr parts)
			(begin
			  (debug:print 0 *default-log-port* "ERROR: I only know sqlite3 databases for now: " dbstr)
			  #f)))))
    (if (and dbpth (file-readable? dbpth))
	(let ((db (sqlite3:open-database dbpth))) ;; (open-database dbpth)))
	  (sqlite3:set-busy-handler! db (make-busy-timeout 10000))
	  db)
	#f)))

;; sqlite3:path tablename timefieldname varfieldname field1 field2 ...
;;
(define (dboard:graph-read-data cmdstring tstart tend)
  (let* ((parts (string-split cmdstring))) ;; spaces not allowed







|







3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
		    (if (equal? (car parts) "sqlite3")
			(cadr parts)
			(begin
			  (debug:print 0 *default-log-port* "ERROR: I only know sqlite3 databases for now: " dbstr)
			  #f)))))
    (if (and dbpth (file-readable? dbpth))
	(let ((db (sqlite3:open-database dbpth))) ;; (open-database dbpth)))
	  (sqlite3:set-busy-handler! db (sqlite3:make-busy-timeout 10000))
	  db)
	#f)))

;; sqlite3:path tablename timefieldname varfieldname field1 field2 ...
;;
(define (dboard:graph-read-data cmdstring tstart tend)
  (let* ((parts (string-split cmdstring))) ;; spaces not allowed
3687
3688
3689
3690
3691
3692
3693



3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
      (let ((th1 (make-thread (lambda ()
				(thread-sleep! 1)
				(dboard:common-run-curr-updaters commondat 0) ;; force update of summary tab 
				) "update buttons once"))
	    (th2 (make-thread iup:main-loop "Main loop")))
	(thread-start! th2)
	(thread-join! th2)))))




;; ease debugging by loading ~/.dashboardrc
(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.dashboardrc")))
  (if (common:file-exists? debugcontrolf)
      (load debugcontrolf)))

(if (args:get-arg "-repl")
    (repl)
    (main))








>
>
>










3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
      (let ((th1 (make-thread (lambda ()
				(thread-sleep! 1)
				(dboard:common-run-curr-updaters commondat 0) ;; force update of summary tab 
				) "update buttons once"))
	    (th2 (make-thread iup:main-loop "Main loop")))
	(thread-start! th2)
	(thread-join! th2)))))
)

(import dashboard)

;; ease debugging by loading ~/.dashboardrc
(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.dashboardrc")))
  (if (common:file-exists? debugcontrolf)
      (load debugcontrolf)))

(if (args:get-arg "-repl")
    (repl)
    (main))

Modified task_records.scm from [ff61a823b3] to [6b67eb70ad].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;     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 <http://www.gnu.org/licenses/>.
;;======================================================================

;; make-vector-record tasks task id action owner state target name test item params creation_time execution_time 
(define (make-tasks:task)(make-vector 11))
(define-inline (tasks:task-get-id               vec)    (vector-ref  vec 0))
(define-inline (tasks:task-get-action           vec)    (vector-ref  vec 1))
(define-inline (tasks:task-get-owner            vec)    (vector-ref  vec 2))
(define-inline (tasks:task-get-state            vec)    (vector-ref  vec 3))
(define-inline (tasks:task-get-target           vec)    (vector-ref  vec 4))
(define-inline (tasks:task-get-name             vec)    (vector-ref  vec 5))
(define-inline (tasks:task-get-testpatt         vec)    (vector-ref  vec 6))
(define-inline (tasks:task-get-keylock          vec)    (vector-ref  vec 7))
(define-inline (tasks:task-get-params           vec)    (vector-ref  vec 8))
(define-inline (tasks:task-get-creation_time    vec)    (vector-ref  vec 9))
(define-inline (tasks:task-get-execution_time   vec)    (vector-ref  vec 10))

(define-inline (tasks:task-set-state!  vec val)(vector-set! vec 3 val))


;; make-vector-record tasks monitor id pid start_time last_update hostname username
(define (make-tasks:monitor)(make-vector 5))
(define-inline (tasks:monitor-get-id            vec)    (vector-ref  vec 0))
(define-inline (tasks:monitor-get-pid           vec)    (vector-ref  vec 1))
(define-inline (tasks:monitor-get-start_time    vec)    (vector-ref  vec 2))
(define-inline (tasks:monitor-get-last_update   vec)    (vector-ref  vec 3))
(define-inline (tasks:monitor-get-hostname      vec)    (vector-ref  vec 4))
(define-inline (tasks:monitor-get-username      vec)    (vector-ref  vec 5))







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
13
14
15
16
17
18
19

























;;     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 <http://www.gnu.org/licenses/>.
;;======================================================================


























Modified tasksmod.scm from [f35137801c] to [a2fcddb156].

88
89
90
91
92
93
94













95











96
97
98
99
100
101
102
;; (declare (uses db))
;; (declare (uses rmt))
;; (declare (uses common))
;; (declare (uses pgdb))

;; (import pgdb) ;; pgdb is a module














(include "task_records.scm")











;; (include "db_records.scm")

;;======================================================================
;; Tasks db
;;======================================================================

;; wait up to aprox n seconds for a journal to go away







>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
;; (declare (uses db))
;; (declare (uses rmt))
;; (declare (uses common))
;; (declare (uses pgdb))

;; (import pgdb) ;; pgdb is a module

;; make-vector-record tasks task id action owner state target name test item params creation_time execution_time 
(define (make-tasks:task)(make-vector 11))
(define (tasks:task-get-id               vec)    (vector-ref  vec 0))
(define (tasks:task-get-action           vec)    (vector-ref  vec 1))
(define (tasks:task-get-owner            vec)    (vector-ref  vec 2))
(define (tasks:task-get-state            vec)    (vector-ref  vec 3))
(define (tasks:task-get-target           vec)    (vector-ref  vec 4))
(define (tasks:task-get-name             vec)    (vector-ref  vec 5))
(define (tasks:task-get-testpatt         vec)    (vector-ref  vec 6))
(define (tasks:task-get-keylock          vec)    (vector-ref  vec 7))
(define (tasks:task-get-params           vec)    (vector-ref  vec 8))
(define (tasks:task-get-creation_time    vec)    (vector-ref  vec 9))
(define (tasks:task-get-execution_time   vec)    (vector-ref  vec 10))

(define (tasks:task-set-state!  vec val)(vector-set! vec 3 val))


;; make-vector-record tasks monitor id pid start_time last_update hostname username
(define (make-tasks:monitor)(make-vector 5))
(define (tasks:monitor-get-id            vec)    (vector-ref  vec 0))
(define (tasks:monitor-get-pid           vec)    (vector-ref  vec 1))
(define (tasks:monitor-get-start_time    vec)    (vector-ref  vec 2))
(define (tasks:monitor-get-last_update   vec)    (vector-ref  vec 3))
(define (tasks:monitor-get-hostname      vec)    (vector-ref  vec 4))
(define (tasks:monitor-get-username      vec)    (vector-ref  vec 5))
;; (include "db_records.scm")

;;======================================================================
;; Tasks db
;;======================================================================

;; wait up to aprox n seconds for a journal to go away

Modified vg_records.scm from [fd7139b2bc] to [63c7c77f61].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
;;     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 <http://www.gnu.org/licenses/>.
;;

(import simple-exceptions)
(define vg:lib-exn (make-exception "wrong record type, expected vg:lib." 'assert))
(define (pmake-vg:lib . params)(let ((v (if (null? params)(make-vector 2)(apply vector 'vg:lib params)))) v))
(define (make-vg:lib #!key 
              (comps #f)
         )
    (vector 'vg:lib comps))

(define-inline (vg:lib-comps       vec)(if (eq? (vector-ref vec 0) 'vg:lib)(vector-ref  vec 1)(raise (vg:lib-exn 'vg:lib-comps 'xpr))))

(define-inline (vg:lib-comps-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:lib)(vector-set! vec 1 val)(raise (vg:lib-exn 'comps))))
;; Generated using make-vector-record -safe vg comp objs name file

(import simple-exceptions)
(define vg:comp-exn (make-exception "wrong record type, expected vg:comp." 'assert))
(define (pmake-vg:comp . params)(let ((v (if (null? params)(make-vector 4)(apply vector 'vg:comp params)))) v))
(define (make-vg:comp #!key 
              (objs #f)
              (name #f)
              (file #f)
         )
    (vector 'vg:comp objs name file))

(define-inline (vg:comp-objs       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 1)(raise (vg:comp-exn 'vg:comp-objs 'xpr))))
(define-inline (vg:comp-name       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 2)(raise (vg:comp-exn 'vg:comp-name 'xpr))))
(define-inline (vg:comp-file       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 3)(raise (vg:comp-exn 'vg:comp-file 'xpr))))

(define-inline (vg:comp-objs-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 1 val)(raise (vg:comp-exn 'objs))))
(define-inline (vg:comp-name-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 2 val)(raise (vg:comp-exn 'name))))
(define-inline (vg:comp-file-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 3 val)(raise (vg:comp-exn 'file))))
;; Generated using make-vector-record -safe vg obj type pts fill-color text line-color call-back angle font attrib extents proc

(import simple-exceptions)
(define vg:obj-exn (make-exception "wrong record type, expected vg:obj." 'assert))
(define (pmake-vg:obj . params)(let ((v (if (null? params)(make-vector 12)(apply vector 'vg:obj params)))) v))
(define (make-vg:obj #!key 
              (type #f)
              (pts #f)
              (fill-color #f)
              (text #f)
              (line-color #f)
              (call-back #f)
              (angle #f)
              (font #f)
              (attrib #f)
              (extents #f)
              (proc #f)
         )
    (vector 'vg:obj type pts fill-color text line-color call-back angle font attrib extents proc))

(define-inline (vg:obj-type             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 1)(raise (vg:obj-exn 'vg:obj-type 'xpr))))
(define-inline (vg:obj-pts              vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 2)(raise (vg:obj-exn 'vg:obj-pts 'xpr))))
(define-inline (vg:obj-fill-color       vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 3)(raise (vg:obj-exn 'vg:obj-fill-color 'xpr))))
(define-inline (vg:obj-text             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 4)(raise (vg:obj-exn 'vg:obj-text 'xpr))))
(define-inline (vg:obj-line-color       vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 5)(raise (vg:obj-exn 'vg:obj-line-color 'xpr))))
(define-inline (vg:obj-call-back        vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 6)(raise (vg:obj-exn 'vg:obj-call-back 'xpr))))
(define-inline (vg:obj-angle            vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 7)(raise (vg:obj-exn 'vg:obj-angle 'xpr))))
(define-inline (vg:obj-font             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 8)(raise (vg:obj-exn 'vg:obj-font 'xpr))))
(define-inline (vg:obj-attrib           vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 9)(raise (vg:obj-exn 'vg:obj-attrib 'xpr))))
(define-inline (vg:obj-extents          vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 10)(raise (vg:obj-exn 'vg:obj-extents 'xpr))))
(define-inline (vg:obj-proc             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 11)(raise (vg:obj-exn 'vg:obj-proc 'xpr))))

(define-inline (vg:obj-type-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 1 val)(raise (vg:obj-exn 'type))))
(define-inline (vg:obj-pts-set!         vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 2 val)(raise (vg:obj-exn 'pts))))
(define-inline (vg:obj-fill-color-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 3 val)(raise (vg:obj-exn 'fill-color))))
(define-inline (vg:obj-text-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 4 val)(raise (vg:obj-exn 'text))))
(define-inline (vg:obj-line-color-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 5 val)(raise (vg:obj-exn 'line-color))))
(define-inline (vg:obj-call-back-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 6 val)(raise (vg:obj-exn 'call-back))))
(define-inline (vg:obj-angle-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 7 val)(raise (vg:obj-exn 'angle))))
(define-inline (vg:obj-font-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 8 val)(raise (vg:obj-exn 'font))))
(define-inline (vg:obj-attrib-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 9 val)(raise (vg:obj-exn 'attrib))))
(define-inline (vg:obj-extents-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 10 val)(raise (vg:obj-exn 'extents))))
(define-inline (vg:obj-proc-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 11 val)(raise (vg:obj-exn 'proc))))
;; Generated using make-vector-record -safe vg inst libname compname theta xoff yoff scalex scaley mirrx mirry call-back cache

(import simple-exceptions)
(define vg:inst-exn (make-exception "wrong record type, expected vg:inst." 'assert))
(define (pmake-vg:inst . params)(let ((v (if (null? params)(make-vector 12)(apply vector 'vg:inst params)))) v))
(define (make-vg:inst #!key 
              (libname #f)
              (compname #f)
              (theta #f)
              (xoff #f)
              (yoff #f)
              (scalex #f)
              (scaley #f)
              (mirrx #f)
              (mirry #f)
              (call-back #f)
              (cache #f)
         )
    (vector 'vg:inst libname compname theta xoff yoff scalex scaley mirrx mirry call-back cache))

(define-inline (vg:inst-libname         vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 1)(raise (vg:inst-exn 'vg:inst-libname 'xpr))))
(define-inline (vg:inst-compname        vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 2)(raise (vg:inst-exn 'vg:inst-compname 'xpr))))
(define-inline (vg:inst-theta           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 3)(raise (vg:inst-exn 'vg:inst-theta 'xpr))))
(define-inline (vg:inst-xoff            vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 4)(raise (vg:inst-exn 'vg:inst-xoff 'xpr))))
(define-inline (vg:inst-yoff            vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 5)(raise (vg:inst-exn 'vg:inst-yoff 'xpr))))
(define-inline (vg:inst-scalex          vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 6)(raise (vg:inst-exn 'vg:inst-scalex 'xpr))))
(define-inline (vg:inst-scaley          vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 7)(raise (vg:inst-exn 'vg:inst-scaley 'xpr))))
(define-inline (vg:inst-mirrx           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 8)(raise (vg:inst-exn 'vg:inst-mirrx 'xpr))))
(define-inline (vg:inst-mirry           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 9)(raise (vg:inst-exn 'vg:inst-mirry 'xpr))))
(define-inline (vg:inst-call-back       vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 10)(raise (vg:inst-exn 'vg:inst-call-back 'xpr))))
(define-inline (vg:inst-cache           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 11)(raise (vg:inst-exn 'vg:inst-cache 'xpr))))

(define-inline (vg:inst-libname-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 1 val)(raise (vg:inst-exn 'libname))))
(define-inline (vg:inst-compname-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 2 val)(raise (vg:inst-exn 'compname))))
(define-inline (vg:inst-theta-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 3 val)(raise (vg:inst-exn 'theta))))
(define-inline (vg:inst-xoff-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 4 val)(raise (vg:inst-exn 'xoff))))
(define-inline (vg:inst-yoff-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 5 val)(raise (vg:inst-exn 'yoff))))
(define-inline (vg:inst-scalex-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 6 val)(raise (vg:inst-exn 'scalex))))
(define-inline (vg:inst-scaley-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 7 val)(raise (vg:inst-exn 'scaley))))
(define-inline (vg:inst-mirrx-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 8 val)(raise (vg:inst-exn 'mirrx))))
(define-inline (vg:inst-mirry-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 9 val)(raise (vg:inst-exn 'mirry))))
(define-inline (vg:inst-call-back-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 10 val)(raise (vg:inst-exn 'call-back))))
(define-inline (vg:inst-cache-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 11 val)(raise (vg:inst-exn 'cache))))
;; Generated using make-vector-record -safe vg drawing libs insts scalex scaley xoff yoff cnv cache

(import simple-exceptions)
(define vg:drawing-exn (make-exception "wrong record type, expected vg:drawing." 'assert))
(define (pmake-vg:drawing . params)(let ((v (if (null? params)(make-vector 9)(apply vector 'vg:drawing params)))) v))
(define (make-vg:drawing #!key 
              (libs #f)
              (insts #f)
              (scalex #f)
              (scaley #f)
              (xoff #f)
              (yoff #f)
              (cnv #f)
              (cache #f)
         )
    (vector 'vg:drawing libs insts scalex scaley xoff yoff cnv cache))

(define-inline (vg:drawing-libs         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 1)(raise (vg:drawing-exn 'vg:drawing-libs 'xpr))))
(define-inline (vg:drawing-insts        vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 2)(raise (vg:drawing-exn 'vg:drawing-insts 'xpr))))
(define-inline (vg:drawing-scalex       vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 3)(raise (vg:drawing-exn 'vg:drawing-scalex 'xpr))))
(define-inline (vg:drawing-scaley       vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 4)(raise (vg:drawing-exn 'vg:drawing-scaley 'xpr))))
(define-inline (vg:drawing-xoff         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 5)(raise (vg:drawing-exn 'vg:drawing-xoff 'xpr))))
(define-inline (vg:drawing-yoff         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 6)(raise (vg:drawing-exn 'vg:drawing-yoff 'xpr))))
(define-inline (vg:drawing-cnv          vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 7)(raise (vg:drawing-exn 'vg:drawing-cnv 'xpr))))
(define-inline (vg:drawing-cache        vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 8)(raise (vg:drawing-exn 'vg:drawing-cache 'xpr))))

(define-inline (vg:drawing-libs-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 1 val)(raise (vg:drawing-exn 'libs))))
(define-inline (vg:drawing-insts-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 2 val)(raise (vg:drawing-exn 'insts))))
(define-inline (vg:drawing-scalex-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 3 val)(raise (vg:drawing-exn 'scalex))))
(define-inline (vg:drawing-scaley-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 4 val)(raise (vg:drawing-exn 'scaley))))
(define-inline (vg:drawing-xoff-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 5 val)(raise (vg:drawing-exn 'xoff))))
(define-inline (vg:drawing-yoff-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 6 val)(raise (vg:drawing-exn 'yoff))))
(define-inline (vg:drawing-cnv-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 7 val)(raise (vg:drawing-exn 'cnv))))
(define-inline (vg:drawing-cache-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 8 val)(raise (vg:drawing-exn 'cache))))







<
<
<
<
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
16
17
18
19
20
21
22




23

24














































































































































;;     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 <http://www.gnu.org/licenses/>.
;;

(import simple-exceptions)






;; moved to vgmod.scm














































































































































Modified vgmod.scm from [13261795fe] to [c094a8610c].

26
27
28
29
30
31
32
33

34



35






36














































































































































37
38
39
40
41
42
43
    (import scheme
	    chicken.base
	    chicken.bitwise
	    chicken.string
	    chicken.random
	    )
    
(import canvas-draw iup)

(import typed-records srfi-1 srfi-69)










(include "vg_records.scm")















































































































































;; ;; structs
;; ;;
;; (defstruct vg:lib     comps)
;; (defstruct vg:comp    objs name file)
;; ;; extents caches extents calculated on draw
;; ;; proc is called on draw and takes the obj itself as a parameter







|
>
|
>
>
>

>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    (import scheme
	    chicken.base
	    chicken.bitwise
	    chicken.string
	    chicken.random
	    )
    
    (import canvas-draw
	    iup
	    typed-records
	    srfi-1
	    srfi-69
	    simple-exceptions)

(define vg:lib-exn (make-exception "wrong record type, expected vg:lib." 'assert))
(define (pmake-vg:lib . params)(let ((v (if (null? params)(make-vector 2)(apply vector 'vg:lib params)))) v))
(define (make-vg:lib #!key 
              (comps #f)
         )
    (vector 'vg:lib comps))

(define (vg:lib-comps       vec)(if (eq? (vector-ref vec 0) 'vg:lib)(vector-ref  vec 1)(raise (vg:lib-exn 'vg:lib-comps 'xpr))))

(define (vg:lib-comps-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:lib)(vector-set! vec 1 val)(raise (vg:lib-exn 'comps))))
;; Generated using make-vector-record -safe vg comp objs name file

(import simple-exceptions)
(define vg:comp-exn (make-exception "wrong record type, expected vg:comp." 'assert))
(define (pmake-vg:comp . params)(let ((v (if (null? params)(make-vector 4)(apply vector 'vg:comp params)))) v))
(define (make-vg:comp #!key 
              (objs #f)
              (name #f)
              (file #f)
         )
    (vector 'vg:comp objs name file))

(define (vg:comp-objs       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 1)(raise (vg:comp-exn 'vg:comp-objs 'xpr))))
(define (vg:comp-name       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 2)(raise (vg:comp-exn 'vg:comp-name 'xpr))))
(define (vg:comp-file       vec)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-ref  vec 3)(raise (vg:comp-exn 'vg:comp-file 'xpr))))

(define (vg:comp-objs-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 1 val)(raise (vg:comp-exn 'objs))))
(define (vg:comp-name-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 2 val)(raise (vg:comp-exn 'name))))
(define (vg:comp-file-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:comp)(vector-set! vec 3 val)(raise (vg:comp-exn 'file))))
;; Generated using make-vector-record -safe vg obj type pts fill-color text line-color call-back angle font attrib extents proc

(import simple-exceptions)
(define vg:obj-exn (make-exception "wrong record type, expected vg:obj." 'assert))
(define (pmake-vg:obj . params)(let ((v (if (null? params)(make-vector 12)(apply vector 'vg:obj params)))) v))
(define (make-vg:obj #!key 
              (type #f)
              (pts #f)
              (fill-color #f)
              (text #f)
              (line-color #f)
              (call-back #f)
              (angle #f)
              (font #f)
              (attrib #f)
              (extents #f)
              (proc #f)
         )
    (vector 'vg:obj type pts fill-color text line-color call-back angle font attrib extents proc))

(define (vg:obj-type             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 1)(raise (vg:obj-exn 'vg:obj-type 'xpr))))
(define (vg:obj-pts              vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 2)(raise (vg:obj-exn 'vg:obj-pts 'xpr))))
(define (vg:obj-fill-color       vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 3)(raise (vg:obj-exn 'vg:obj-fill-color 'xpr))))
(define (vg:obj-text             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 4)(raise (vg:obj-exn 'vg:obj-text 'xpr))))
(define (vg:obj-line-color       vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 5)(raise (vg:obj-exn 'vg:obj-line-color 'xpr))))
(define (vg:obj-call-back        vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 6)(raise (vg:obj-exn 'vg:obj-call-back 'xpr))))
(define (vg:obj-angle            vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 7)(raise (vg:obj-exn 'vg:obj-angle 'xpr))))
(define (vg:obj-font             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 8)(raise (vg:obj-exn 'vg:obj-font 'xpr))))
(define (vg:obj-attrib           vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 9)(raise (vg:obj-exn 'vg:obj-attrib 'xpr))))
(define (vg:obj-extents          vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 10)(raise (vg:obj-exn 'vg:obj-extents 'xpr))))
(define (vg:obj-proc             vec)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-ref  vec 11)(raise (vg:obj-exn 'vg:obj-proc 'xpr))))

(define (vg:obj-type-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 1 val)(raise (vg:obj-exn 'type))))
(define (vg:obj-pts-set!         vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 2 val)(raise (vg:obj-exn 'pts))))
(define (vg:obj-fill-color-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 3 val)(raise (vg:obj-exn 'fill-color))))
(define (vg:obj-text-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 4 val)(raise (vg:obj-exn 'text))))
(define (vg:obj-line-color-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 5 val)(raise (vg:obj-exn 'line-color))))
(define (vg:obj-call-back-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 6 val)(raise (vg:obj-exn 'call-back))))
(define (vg:obj-angle-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 7 val)(raise (vg:obj-exn 'angle))))
(define (vg:obj-font-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 8 val)(raise (vg:obj-exn 'font))))
(define (vg:obj-attrib-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 9 val)(raise (vg:obj-exn 'attrib))))
(define (vg:obj-extents-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 10 val)(raise (vg:obj-exn 'extents))))
(define (vg:obj-proc-set!        vec val)(if (eq? (vector-ref vec 0) 'vg:obj)(vector-set! vec 11 val)(raise (vg:obj-exn 'proc))))
;; Generated using make-vector-record -safe vg inst libname compname theta xoff yoff scalex scaley mirrx mirry call-back cache

(import simple-exceptions)
(define vg:inst-exn (make-exception "wrong record type, expected vg:inst." 'assert))
(define (pmake-vg:inst . params)(let ((v (if (null? params)(make-vector 12)(apply vector 'vg:inst params)))) v))
(define (make-vg:inst #!key 
              (libname #f)
              (compname #f)
              (theta #f)
              (xoff #f)
              (yoff #f)
              (scalex #f)
              (scaley #f)
              (mirrx #f)
              (mirry #f)
              (call-back #f)
              (cache #f)
         )
    (vector 'vg:inst libname compname theta xoff yoff scalex scaley mirrx mirry call-back cache))

(define (vg:inst-libname         vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 1)(raise (vg:inst-exn 'vg:inst-libname 'xpr))))
(define (vg:inst-compname        vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 2)(raise (vg:inst-exn 'vg:inst-compname 'xpr))))
(define (vg:inst-theta           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 3)(raise (vg:inst-exn 'vg:inst-theta 'xpr))))
(define (vg:inst-xoff            vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 4)(raise (vg:inst-exn 'vg:inst-xoff 'xpr))))
(define (vg:inst-yoff            vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 5)(raise (vg:inst-exn 'vg:inst-yoff 'xpr))))
(define (vg:inst-scalex          vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 6)(raise (vg:inst-exn 'vg:inst-scalex 'xpr))))
(define (vg:inst-scaley          vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 7)(raise (vg:inst-exn 'vg:inst-scaley 'xpr))))
(define (vg:inst-mirrx           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 8)(raise (vg:inst-exn 'vg:inst-mirrx 'xpr))))
(define (vg:inst-mirry           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 9)(raise (vg:inst-exn 'vg:inst-mirry 'xpr))))
(define (vg:inst-call-back       vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 10)(raise (vg:inst-exn 'vg:inst-call-back 'xpr))))
(define (vg:inst-cache           vec)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-ref  vec 11)(raise (vg:inst-exn 'vg:inst-cache 'xpr))))

(define (vg:inst-libname-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 1 val)(raise (vg:inst-exn 'libname))))
(define (vg:inst-compname-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 2 val)(raise (vg:inst-exn 'compname))))
(define (vg:inst-theta-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 3 val)(raise (vg:inst-exn 'theta))))
(define (vg:inst-xoff-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 4 val)(raise (vg:inst-exn 'xoff))))
(define (vg:inst-yoff-set!       vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 5 val)(raise (vg:inst-exn 'yoff))))
(define (vg:inst-scalex-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 6 val)(raise (vg:inst-exn 'scalex))))
(define (vg:inst-scaley-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 7 val)(raise (vg:inst-exn 'scaley))))
(define (vg:inst-mirrx-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 8 val)(raise (vg:inst-exn 'mirrx))))
(define (vg:inst-mirry-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 9 val)(raise (vg:inst-exn 'mirry))))
(define (vg:inst-call-back-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 10 val)(raise (vg:inst-exn 'call-back))))
(define (vg:inst-cache-set!      vec val)(if (eq? (vector-ref vec 0) 'vg:inst)(vector-set! vec 11 val)(raise (vg:inst-exn 'cache))))
;; Generated using make-vector-record -safe vg drawing libs insts scalex scaley xoff yoff cnv cache

(import simple-exceptions)
(define vg:drawing-exn (make-exception "wrong record type, expected vg:drawing." 'assert))
(define (pmake-vg:drawing . params)(let ((v (if (null? params)(make-vector 9)(apply vector 'vg:drawing params)))) v))
(define (make-vg:drawing #!key 
              (libs #f)
              (insts #f)
              (scalex #f)
              (scaley #f)
              (xoff #f)
              (yoff #f)
              (cnv #f)
              (cache #f)
         )
    (vector 'vg:drawing libs insts scalex scaley xoff yoff cnv cache))

(define (vg:drawing-libs         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 1)(raise (vg:drawing-exn 'vg:drawing-libs 'xpr))))
(define (vg:drawing-insts        vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 2)(raise (vg:drawing-exn 'vg:drawing-insts 'xpr))))
(define (vg:drawing-scalex       vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 3)(raise (vg:drawing-exn 'vg:drawing-scalex 'xpr))))
(define (vg:drawing-scaley       vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 4)(raise (vg:drawing-exn 'vg:drawing-scaley 'xpr))))
(define (vg:drawing-xoff         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 5)(raise (vg:drawing-exn 'vg:drawing-xoff 'xpr))))
(define (vg:drawing-yoff         vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 6)(raise (vg:drawing-exn 'vg:drawing-yoff 'xpr))))
(define (vg:drawing-cnv          vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 7)(raise (vg:drawing-exn 'vg:drawing-cnv 'xpr))))
(define (vg:drawing-cache        vec)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-ref  vec 8)(raise (vg:drawing-exn 'vg:drawing-cache 'xpr))))

(define (vg:drawing-libs-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 1 val)(raise (vg:drawing-exn 'libs))))
(define (vg:drawing-insts-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 2 val)(raise (vg:drawing-exn 'insts))))
(define (vg:drawing-scalex-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 3 val)(raise (vg:drawing-exn 'scalex))))
(define (vg:drawing-scaley-set!  vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 4 val)(raise (vg:drawing-exn 'scaley))))
(define (vg:drawing-xoff-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 5 val)(raise (vg:drawing-exn 'xoff))))
(define (vg:drawing-yoff-set!    vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 6 val)(raise (vg:drawing-exn 'yoff))))
(define (vg:drawing-cnv-set!     vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 7 val)(raise (vg:drawing-exn 'cnv))))
(define (vg:drawing-cache-set!   vec val)(if (eq? (vector-ref vec 0) 'vg:drawing)(vector-set! vec 8 val)(raise (vg:drawing-exn 'cache))))

;; ;; structs
;; ;;
;; (defstruct vg:lib     comps)
;; (defstruct vg:comp    objs name file)
;; ;; extents caches extents calculated on draw
;; ;; proc is called on draw and takes the obj itself as a parameter