Viewport(3I)
β¨ Viewport(3I) β¨
okay so bestie, we're in the InterViews Reference Manual today and the vibe is: scrolling. buckle up π
π NAME π
Viewport β a scrollable view, aka the little window that lets you peek at a bigger thing and slide it around π
πΈ SYNOPSIS πΈ
#include <InterViews/viewport.h>
π¦ DESCRIPTION π¦
okay so Viewport is a subclass of MonoScene, and its whole thing is that it gives its component exactly as much space as the component wants β and it figures out how much that is from the component's shape. no negotiation, no shrinking, the component gets what it asks for, periodt.
that space then gets clipped down to the viewport's own size (because we can't just be showing everything, that's not the assignment), and the viewport keeps a perspective around to control which portion of the component is actually visible on screen. it's giving "camera operator for a widget" fr fr π₯
and here's a cute lil detail: if the component is smaller than the viewport's canvas, the leftover background of the viewport gets filled in with a light gray pattern. so it's never just empty, it's got texture β¨
π PUBLIC OPERATIONS π
Viewport(Interactor* = nil, Alignment = Center)β construct a brand new viewport, slay. if the interactor isn'tnil, it gets inserted as the viewport's component. the second parameter decides where the component sits relative to the viewport. alignment matters, bestie πInsert(Interactor*)β set the component interactor. that's it, that's the move.void Change(Interactor*)β okay so important lore: a viewport does not propagate changes. so if the component's shape changes, the viewport just resizes the component according to the new shape. no drama, no cascade, just a resize π«Άvoid Remove(Interactor*)β take the component interactor out. bye bestie πvirtual void Adjust(Perspective&)β change the viewport's perspective to the one you hand it. this will cause the desired area of the component to actually get drawn, so like, stuff happens on screen πvoid AdjustTo(float px, float py, float zx, float zy)β short-hand for explicitly manipulating the viewport's perspective.void AdjustBy(float dpx, float dpy, float dzx, float dzy)β short-hand for explicitly manipulating the viewport's perspective.void ScrollTo(float px, float py)β short-hand for explicitly manipulating the viewport's perspective.void ScrollXTo(float px)β short-hand for explicitly manipulating the viewport's perspective.void ScrollYTo(float py)β short-hand for explicitly manipulating the viewport's perspective.void ScrollBy(float dpx, float dpy)β short-hand for explicitly manipulating the viewport's perspective.void ScrollXBy(float dpx)β short-hand for explicitly manipulating the viewport's perspective.void ScrollYBy(float dpy)β short-hand for explicitly manipulating the viewport's perspective.void ZoomTo(float zx, float zy)β short-hand for explicitly manipulating the viewport's perspective.void ZoomXTo(float zx)β short-hand for explicitly manipulating the viewport's perspective.void ZoomYTo(float zy)β short-hand for explicitly manipulating the viewport's perspective.void ZoomBy(float dzx, float dzy)β short-hand for explicitly manipulating the viewport's perspective.void ZoomXBy(float dzx)β short-hand for explicitly manipulating the viewport's perspective.void ZoomYBy(float dzy)β short-hand for explicitly manipulating the viewport's perspective.float XPos()β short-hand for retrieving info about the current perspective.float YPos()β short-hand for retrieving info about the current perspective.float XMag()β short-hand for retrieving info about the current perspective.float YMag()β short-hand for retrieving info about the current perspective.
π SEE ALSO π
Perspective(3I)Scene(3I)Shape(3I)
go read those next, iykyk π
this whole page came to you from the InterViews era, dated 10 February 1988 β and yeah, Viewport(3I) is the one and only. iconic behavior from a 1988 manpage ngl πβ¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms