Scene(3I)
πΈ NAME πΈ
Scene, MonoScene β composite interactors π«Ά
okay so real talk, this is the page for Scene(3I) out of the InterViews Reference Manual, and it's genuinely iconic. Scene and MonoScene are your composite interactors β the ones that are built out of other interactors. no cap, it's giving "interactors all the way down" π
π¦ SYNOPSIS π¦
#include <InterViews/scene.h>
π« DESCRIPTION π«
so bestie, Scene is the base class for every single interactor that's defined in terms of one or more instances of other interactors. that's the whole vibe. β¨
MonoScene is a subclass for scenes that contain exactly one instance. a monoscene's shape is copied from its component, and the component's canvas is given the same size and location as the monoscene's canvas. like, they match, periodt. πͺ
β οΈ important cleanup rule: when a scene is deleted, it should delete all its component interactors. and a monoscene deletes its existing component if a new component is inserted. so don't come for the memory leaks, bestie π
π₯ PUBLIC OPERATIONS π₯
void Insert(Interactor*)β add an interactor to the scene. simple. clean. no alignment drama.void Insert(Interactor*, Coord x, Coord y, Alignment = BottomLeft)β add an interactor to the scene, optionally aligned with respect to a specific position relative to the lower-left corner of the scene.virtual Interactor* Wrap(Interactor*)β the wrapping hook. the base scene class always callsWrapandDoInsertfromInsert, so subclasses only implementDoInsert(plusWrapif they want to wrap additional interactors around the inserted interactor) and users only ever callInsert. πvirtual void DoInsert(Interactor*, boolean, Coord& x, Coord& y, Shape*)β the real one, the one subclasses implement. adds an interactor to the scene, optionally aligned with respect to a specific position relative to the lower-left corner of the scene. valid alignment types areTopLeft,TopCenter,TopRight,CenterLeft,Center,CenterRight,BottomLeft,BottomCenter,BottomRight,Left,Right,Top,Bottom,HorizCenter, andVertCenterβ yes, all fifteen, memorize them iykyk π. the scene uses the interactor's desired shape, if it has non-zero width, to size the interactor. and remember: the base scene class always callsWrapandDoInsertfromInsert, so subclasses only implementDoInsert(andWrapif they want to wrap additional interactors around the inserted interactor) while users only callInsert. in the case of a monoscene, the current interior interactor, if not nil, is deleted and replaced by the given interactor. and if an interactor is inserted into a scene that is already mapped, the interactor and its descendants will be configured beforeDoInsertis called. βvoid Propagate(boolean)β sets the propagate flag, which istrueby default.void Change(Interactor*)β the user-facing "hey, something changed its desired shape" call.virtual void DoChange(Interactor*, Shape*)βChangenotifies a scene that a given interactor has changed its desired shape. if the propagate flag associated with the scene istrue,Changewill callDoChangeand thenChange(this)on the scene's parent. if the propagate flag isfalse,Resizewill be called instead. the propagate flag istrueby default and can be set with thePropagateoperation. πvoid Move(Interactor*, Coord x, Coord y, Alignment = BottomLeft),virtual void DoMove(Interactor*, Coord& x, Coord& y)β request that an interactor be moved to the given coordinates using the given alignment. as withInsertandChange, users callMoveand subclasses implementDoMove. π¦void Remove(Interactor*),virtual void DoRemove(Interactor*)β remove an interactor from a scene. users callRemoveand subclasses implementDoRemove. bye bestie πvoid Lower(Interactor*),virtual void DoLower(Interactor*)β put the interactor's canvas below all others in the scene, potentially obscuring it. users callLowerand subclasses implementDoLower. πvoid Raise(Interactor*),virtual void DoRaise(Interactor*)β put the interactor's canvas above all others in the scene, making it fully visible. main character energy, honestly. users callRaiseand subclasses implementDoRaise. π
π§ PROTECTED OPERATIONS π§
Scene(),MonoScene()β construct a new scene or monoscene. β οΈ but listen: scenes and monoscenes are abstract classes, so the constructors should only be called implicitly by subclass constructors. don't call them yourself, that's not the move πvoid Place(Interactor*, Coord x1, Coord y1, Coord x2, Coord y2, boolean = true)β assign an interactor's canvas to be a given region of the scene's canvas. unless the optional sixth parameter isfalse, the interactor will be mapped. and here's the cute part: if the interactor is already assigned the given position and size, then this operation will have no effect. that optimization means a scene can place all of its elements in response to aChangeand be assured that only those elements that have really changed will be redrawn. slay β¨void Map(Interactor*, boolean = true)β make the interactor visible on the display if and when the scene is visible. unless the optional second parameter isfalse, the interactor will be raised to the top of the scene. πvoid Unmap(Interactor*)β make the interactor not be visible on the display if and when the scene is visible. ghost mode π»void UserPlace(Interactor*, int w, int h)β let the user interact with the window manager to specify the size and location of the interactor's canvas, whose default width and height must also be supplied by the program. π
π SEE ALSO π
Canvas(3I)π¨Interactor(3I)π«ΆShape(3I)π
okay that's the whole page bestie, go build something gorgeous with it π
this was InterViews Β· 7 Mar 1989 Β· Scene(3I) β and yes, she's been iconic since '89. periodt. π
β¨
π¦ 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