[comp.windows.x] Getting the Terminal Type In X

simon@shiva.trl.oz (Simon Michnowicz - A Free Spirit) (08/08/90)

I am writing an application in X, and would like to
know how to get the terminal type (i.e. colour or B/W)
so I can set the colours in my program accordingly.
Thanks in advance,
		Simon Michnowicz


***************************************************************************
Simon Michnowicz                |
Integrated Customer Services    |
Telecom Australia               |
Research Laboratories           |    "We Do It To Bits In Packets"
Phone:  Wk (03) 541 6769        |
	Hm No Fixed Abode       |
ACSNET simon@shiva.trl.oz       |
***************************************************************************

mouse@LARRY.MCRCIM.MCGILL.EDU (08/14/90)

> I am writing an application in X, and would like to know how to get
> the terminal type (i.e. colour or B/W) so I can set the colours in my
> program accordingly.

It's not quite as simple as color-or-b&w.  There are six possible
visuals, and while you can to a certain extent ignore some differences,
there are still more than two possibilities.

What you probably want to do is look at the available visuals (see
XGetVisualInfo) and pick the best one for your application (where what
"best" means is application-specific).  If your color requirements are
simple you can use XMatchVisualInfo to do this; if color is more or
less a sideline (eg, xterm's use of color) you can just use the default
visual and adapt to its restrictions.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu