Next: , Previous: Transformational functions, Up: Scheme



6.13 Windows and views

It is even possible to use Scheme to manipulate with VRR windows, namely with Views. For this purpose there is a special data type representing VRR windows. All these functions are not available in the command-line variant of VRR , of course.

General information


(window? x)
any -> boolean
Returns whether the given object is a window.


(active-document)
-> document + false
Returns the active document, i.e. the document of the active page.


(active-page)
-> page + false
Returns the active page, i.e. the page of the active view.


(active-group)
-> group + false
Returns the active group, i.e. the group of the active view.


(active-window)
-> window + false
Returns the active window.


(active-view)
-> view + false
Returns the active view - if the active window is not a view, then it returns false.

View information


(view? x)
any -> boolean
Returns whether the given object is a view.


(view-group vw)
view -> group
Returns the group displayed in the given view.


(view-page vw)
view -> page
Returns the page of the group displayed in the given view.


(view-width vw)
view -> natural
Returns the width of the given view (in pixels).


(view-height vw)
view -> natural
Returns the height of the given view (in pixels).


(view-center-x w)
window -> real
Returns the X coordinate of the image in the center of the view.


(view-center-y w)
window -> real
Returns the Y coordinate of the image in the center of the view.

View manipulation

These functions can be used for changing the transformation between the image and the view (like scrolling and zooming).


(make-view g)
group -> view
Creates a new view displaying the group g.


(view-move vw x y)
view real real -> unspecified
Moves (scrolls) the given view by x and y millimeters in the X and Y axes, respectively.


(view-rotate vw angle)
view real -> unspecified
Rotates the given view around its center by the angle angle.


(view-scale vw scale-x scale-y)
view real real real -> unspecified
Scales the given view around its center by the angle angle.


(view-set-center vw x y)
view real real -> unspecified
Scrolls-in the given view so that the point with the coordinates <x, y> becomes the center of the view.


(view-set-orientation vw center-x center-y scale-x scale-y angle)
view real real real real real -> unspecified
Transforms the given view so that the point with the coordinates <center-x, center-y> becomes the center of the view and the X axis zoom, Y axis zoom and rotation are set to scale-x, scale-y and angle, respectively.