World(3I)
π World(3I) π
okay bestie, buckle up, we're reading the InterViews Reference Manual page for World and honestly? it's giving vintage. let's get into it π«Ά
β¨ NAME β¨
World β control a display π
π SYNOPSIS π
#include <InterViews/world.h>
π¦ DESCRIPTION π¦
so like, a world was an application's connection to one specific display. that's it, that's the whole vibe. π
lowkey important: it is currently provided for backward compatibility. it's the OG, it's iconic, but it's a legacy situation, no cap.
π PUBLIC OPERATIONS π
World(
World(
const char* classname, int& argc, char** argv
OptionDesc* = nil, PropertyData* = nil
)
Construct the world object for a display, slay. here's how the instance name gets picked, in order:
- the
-nameoption, if it was given β main character gets first dibs β¨ - otherwise the environment variable
RESOURCE_NAME, if it is nonnil - and if the name still hasn't been defined? then
argv[0]is used, with all leading directories stripped. bye path, we only want the name π
these arguments get interpreted automatically and are removed from argv:
-backgroundβ next argument sets the background color-bgβ same as-background-displayβ next argument specifies the target workstation display-foregroundβ next argument sets the foreground color-fgβ same as-foreground-fnβ same as-font-fontβ next argument sets the text font-geometryβ next argument sets the first top-level interactor's position and size-iconicβ starts up the first top-level interactor in iconic form-nameβ next argument sets the instance name of all top-level interactors that don't have their own instance names-reverseβ swaps default foreground and background colors-rvβ same as-reverse-synchronousβ force synchronous operation with the window system-titleβ next argument sets the first top-level interactor's title bar name-xrmβ next argument sets an ``attribute: value'' property
the geometry specification has the form ``=WxH+XOFF+YOFF''. and this part is important bestie: a negative XOFF (YOFF) specifies the offset of the interactor's right (bottom) edge from the right (bottom) side of the screen. not left/top. right/bottom. don't get it twisted π
the constructor sets argc to the number of uninterpreted arguments that remain.
if it's non-nil, the OptionDesc* parameter is an array of option descriptors used to parse application-specific attributes. and OptionDesc contains four fields:
- a name used on the command line
- a path specifying the attribute
- a style specifying where the value is
- a default value
valid styles are:
OptionPropertyNextβ use next argument as an attribute:value pair, not just the valueOptionValueNextβ use next argument as valueOptionValueImplicitβ use default valueOptionValueIsArgβ use argument as valueOptionValueAfterβ use remainder of argument as value
if it's non-nil, the PropertyData* parameter is an array of structures that each contain three string fields:
- a path specifying the attribute
- a value specifying the value
- a type specifying the type name
and here's the β¨ precedence lore β¨ β attributes are entered in the following order:
- first any application defaults (specified by the
PropertyDataarray) - then application defaults from
/usr/lib/X11/app-defaults/classname - then user defaults (usually in
$HOME/.Xdefaults) - and finally command-line arguments
so like, command-line arguments override user defaults, and both override application defaults. the command line is the final boss, periodt π
const char* name()
Return the instance name associated with the world.
const char* classname()
Return the class name associated with the world.
int argc()
Return the number of arguments passed to the world β and no, we're not counting the ones that were interpreted by the constructor, they already left the group chat π
char** argv()
Return the argument vector passed to the world.
Font* font()
Return the default font associated with the display. if a value for ``font'' is defined at the top-level of the property sheet, then it is used. otherwise, a system default is used.
Color* foreground()
Return the default foreground color associated with the display. if a value for ``foreground'' is defined at the top-level of the property sheet, then it is used. otherwise, a system default is used.
Color* background()
Return the default background color associated with the display. if a value for ``background'' is defined at the top-level of the property sheet, then it is used. otherwise, a system default is used.
boolean shaped_windows()
Return whether the display supports non-rectangular windows. (yes, weird little windows, we love them π¦)
boolean double_buffered()
Return whether windows on the display should by default be double-buffered.
virtual void flush()
Repair all damaged windows on the display and then send any pending requests to the window system.
virtual void sync()
Repair all damaged windows on the display, send any pending requests to the window system, and wait for an acknowledgement from the window system. it's flush but with commitment issues resolved π«Ά
Coord width()
Return the width in coordinates of the current screen associated with the display.
Coord height()
Return the height in coordinates of the current screen associated with the display.
virtual void run()
Read events from the display, handling them as they arrive, and stopping when quit is called.
virtual void quit()
Terminate the run loop. bye bestie π
virtual boolean pending()
Return whether any events are waiting to be read.
virtual void read(Event&)
Read the next event from the world associated with the event.
virtual boolean read(long sec, long usec, Event&)
Read the next event from the world associated with the event, but do not wait more than sec seconds and usec microseconds. return whether an event was found in the given time. patience has a limit and it's measured in microseconds π
virtual void unread(Event&)
Put the event back on the input queue for the world associated with the event. (yes, we're un-sending it, iconic behaviour)
virtual void poll(Event&)
Set the event to an artificial motion event based on the current pointer position and the state of the buttons and meta-keys.
virtual void SetScreen(int s)
Set the current screen to s.
static World* current()
Return the current world. the current world is set when a world is created or an event is received for the display associated with a world.
heads up: the original page jamsSetScreenright onto the end of thepolldescription with no line break β i've split them apart here so you can actually read them, but they're both public operations, fr fr.
πΈ SEE ALSO πΈ
nothing else listed on this page, bestie. it's a solo act. π
and that's the whole thing! this page is from InterViews, dated 7 Mar 1989 β yes, 1989, ancient, vintage, a historical artifact, and we respect her π go forth and control a display, you've got this β¨ππ
π¦ 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