World(constchar*classname,int&argc,char**argvOptionDesc*=nil,PropertyData*=nil)
Construct the world object for a display. The world's instance name comes from the -name option
if it was given; otherwise the instance name comes from the environment variable RESOURCE_NAME if
it is nonnil. If the name has still not been defined, then argv[0] with all leading directories
stripped is used. The following arguments are 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''. A negative XOFF (YOFF) specifies the offset
of the interactor's right (bottom) edge from the right (bottom) side of the screen. The constructor sets
argc to the number of uninterpreted arguments that remain.
If non-nil, the OptionDesc* parameter is an array of option descriptors used to parse application-
specific attributes. OptionDesc contains four fields: a name used on the command line, a path specifying
the attribute, a style specifying where the value is, and a default value. Valid styles are
OptionPropertyNext (use next argument as an attribute:value pair, not just the value), OptionValueNext
(use next argument as value), OptionValueImplicit (use default value), OptionValueIsArg (use argument as
value), and OptionValueAfter (use remainder of argument as value). If 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, and a type specifying the type name. Attributes are entered in
the following order: first any application defaults (specified by the PropertyData array), then
application defaults from /usr/lib/X11/app-defaults/classname, then user defaults (usually in
$HOME/.Xdefaults), and finally command-line arguments. Thus, command-line arguments override user
defaults, and both override application defaults.
constchar*name()
Return the instance name associated with the world.
constchar*classname()
Return the class name associated with the world.
intargc()
Return the number of arguments passed to the world (not counting those that were interpreted by
the constructor).
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.
booleanshaped_windows()
Return whether the display supports non-rectangular windows.
booleandouble_buffered()
Return whether windows on the display should by default be double-buffered.
virtualvoidflush()
Repair all damaged windows on the display and then send any pending requests to the window system.
virtualvoidsync()
Repair all damaged windows on the display, send any pending requests to the window system, and
wait for an acknowledgement from the window system.
Coordwidth()
Return the width in coordinates of the current screen associated with the display.
Coordheight()
Return the height in coordinates of the current screen associated with the display.
virtualvoidrun()
Read events from the display, handling them as they arrive, and stopping when quit is called.
virtualvoidquit()
Terminate the run loop.
virtualbooleanpending()
Return whether any events are waiting to be read.
virtualvoidread(Event&)
Read the next event from the world associated with the event.
virtualbooleanread(longsec,longusec,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.
virtualvoidunread(Event&)
Put the event back on the input queue for the world associated with the event.
virtualvoidpoll(Event&)
Set the event to an artificial motion event based on the current pointer position and the state of
the buttons and meta-keys. virtualvoidSetScreen(ints) Set the current screen to s.
staticWorld*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.
InterViews 7 Mar 1989 World(3I)