Next: , Previous: Scheme kernel data types, Up: Scheme

13.2 Scheme GUI data types

Files: scheme/glt_gui.c, scheme/glt_gui.h

For accessing GUI objects (i.e. windows), there are also proxies, but these proxies are completely independent of kernel proxies. GUI proxies are initialized during GUI initialization, in the function guilelink_gui_init(). These proxies are also implemented using smobs, but the reverse mechanism is simpler. Each window has a slot in its structure for storing a proxy which is initially empty. After a request for the proxy (function window2scm), a newly created proxy is stored in this slot. If the garbage collector finds the proxy as unusable, then this slot is reset to empty. GUI proxies do not increase reference counters of windows (because windows do not have reference counters), so it is possible that window is freed sooner than its proxy. So, the destroying method of each window calls window_proxy_clean() on the stored proxy and this function clears the content (stored pointer) of that proxy so that the cleared proxy is not considered valid (Scheme functions fail on that proxy).