GetVisual.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1994 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: GetVisual.3,v 1.3 2002/08/05 04:30:38 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetVisual - translate from string to visual
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- Visual *
- fBTk_GetVisual(fIinterp, tkwin, string, depthPtr, colormapPtrfB)fR
- .SH ARGUMENTS
- .AS "Tcl_Interp" *colormapPtr
- .AP Tcl_Interp *interp in
- Interpreter to use for error reporting.
- .AP Tk_Window tkwin in
- Token for window in which the visual will be used.
- .AP "CONST char" *string in
- String that identifies the desired visual. See below for
- valid formats.
- .AP int *depthPtr out
- Depth of returned visual gets stored here.
- .AP Colormap *colormapPtr out
- If non-NULL then a suitable colormap for visual is found and its
- identifier is stored here.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_GetVisualfR takes a string description of a visual and
- finds a suitable X Visual for use in fItkwinfR, if there is one.
- It returns a pointer to the X Visual structure for the visual
- and stores the number of bits per pixel for it at fI*depthPtrfR.
- If fIstringfR is unrecognizable or if no suitable visual could
- be found, then NULL is returned and fBTk_GetVisualfR leaves
- an error message in fIinterp->resultfR.
- If fIcolormapfR is non-NULL then fBTk_GetVisualfR
- also locates an appropriate colormap for use with the result visual
- and stores its X identifier at fI*colormapPtrfR.
- .PP
- The fIstringfR argument specifies the desired visual in one
- of the following ways:
- .TP 15
- fIclass depthfR
- The string consists of a class name followed by an integer depth,
- with any amount of white space (including none) in between.
- fIclassfR selects what sort of visual is desired and must be one of
- fBdirectcolorfR, fBgrayscalefR, fBgreyscalefR, fBpseudocolorfR,
- fBstaticcolorfR, fBstaticgrayfR, fBstaticgreyfR, or
- fBtruecolorfR, or a unique abbreviation.
- fIdepthfR specifies how many bits per pixel are needed for the
- visual.
- If possible, fBTk_GetVisualfR will return a visual with this depth;
- if there is no visual of the desired depth then fBTk_GetVisualfR
- looks first for a visual with greater depth, then one with less
- depth.
- .TP 15
- fBdefaultfR
- Use the default visual for fItkwinfR's screen.
- .TP 15
- fIpathNamefR
- Use the visual for the window given by fIpathNamefR.
- fIpathNamefR must be the name of a window on the same screen
- as fItkwinfR.
- .TP 15
- fInumberfR
- Use the visual whose X identifier is fInumberfR.
- .TP 15
- fBbestfR ?fIdepthfR?
- Choose the ``best possible'' visual, using the following rules, in
- decreasing order of priority:
- (a) a visual that has exactly the desired depth is best, followed
- by a visual with greater depth than requested (but as little extra
- as possible), followed by a visual with less depth than requested
- (but as great a depth as possible);
- (b) if no fIdepthfR is specified, then the deepest available visual
- is chosen;
- (c) fBpseudocolorfR is better than fBtruecolorfR or fBdirectcolorfR,
- which are better than fBstaticcolorfR, which is better than
- fBstaticgrayfR or fBgrayscalefR;
- (d) the default visual for the screen is better than any other visual.
- .SH CREDITS
- .PP
- The idea for fBTk_GetVisualfR, and the first implementation, came
- from Paul Mackerras.
- .SH KEYWORDS
- colormap, screen, visual