Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. (declare (hide swig-initialize))
  2. (define (swig-initialize obj initargs create)
  3. (slot-set! obj 'swig-this
  4. (if (memq 'swig-this initargs)
  5. (cadr initargs)
  6. (let ((ret (apply create initargs)))
  7. (if (instance? ret)
  8. (slot-ref ret 'swig-this)
  9. ret)))))
  10. (define-class <swig-metaclass-$module> (<class>) (void))
  11. (define-method (compute-getter-and-setter (class <swig-metaclass-$module>) slot allocator)
  12. (if (not (memq ':swig-virtual slot))
  13. (call-next-method)
  14. (let ((getter (let search-get ((lst slot))
  15. (if (null? lst)
  16. #f
  17. (if (eq? (car lst) ':swig-get)
  18. (cadr lst)
  19. (search-get (cdr lst))))))
  20. (setter (let search-set ((lst slot))
  21. (if (null? lst)
  22. #f
  23. (if (eq? (car lst) ':swig-set)
  24. (cadr lst)
  25. (search-set (cdr lst)))))))
  26. (values
  27. (lambda (o) (getter (slot-ref o 'swig-this)))
  28. (lambda (o new) (setter (slot-ref o 'swig-this) new) new)))))