📄 display-macros.html
字号:
<TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>screen_number</B><TD> Specifies the appropriate screen number on the host server.</TABLE><P><!.IN "DisplayCells" "" "@DEF@"><!.IN "XDisplayCells" "" "@DEF@">Both return the number of entries in the default colormap.<P><A NAME="DisplayPlanes"></A><H2>DisplayPlanes</H2><CODE><PRE>DisplayPlanes(<B>display</B>, <B>screen_number</B>)int XDisplayPlanes(<B>display</B>, <B>screen_number</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>; int <B>screen_number</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>screen_number</B><TD> Specifies the appropriate screen number on the host server.</TABLE><P><!.IN "DisplayPlanes" "" "@DEF@"><!.IN "XDisplayPlanes" "" "@DEF@">Both return the depth of the root window of the specified screen.For an explanation of depth,see the <A HREF="../glossary/">glossary</A>.<P><A NAME="DisplayString"></A><H2>DisplayString</H2><CODE><PRE>DisplayString(<B>display</B>)char *XDisplayString(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "DisplayString" "" "@DEF@"><!.IN "XDisplayString" "" "@DEF@">Both return the string that was passed to <B><A HREF="opening.html">XOpenDisplay()</A></B>when the current display was opened. On POSIX-conformant systems, if the passed string was NULL, these return the value ofthe DISPLAY environment variable when the current display was opened.<!.IN "POSIX System Call" "fork">These are useful to applications that invoke the <B>fork</B>system call and want to open a new connection to the same display from the child process as well as for printing error messages.<P><A NAME="XExtendedMaxRequestSize"></A><H2>XExtendedMaxRequestSize</H2><CODE><PRE>long XExtendedMaxRequestSize(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "XExtendedMaxRequestSize" "" "@DEF@">The<B>XExtendedMaxRequestSize()</B>function returns zero if the specified display does not support anextended-length protocol encoding; otherwise,it returns the maximum request size (in 4-byte units) supportedby the server using the extended-length encoding.The Xlib functions<B><A HREF="../graphics/drawing/XDrawLines.html">XDrawLines()</A></B>,<B><A HREF="../graphics/drawing/XDrawArcs.html">XDrawArcs()</A></B>,<B><A HREF="../graphics/filling-areas/XFillPolygon.html">XFillPolygon()</A></B>,<B><A HREF="../window-information/XChangeProperty.html">XChangeProperty()</A></B>,<B><A HREF="../GC/convenience-functions/XSetClipRectangles.html">XSetClipRectangles()</A></B>,and<B><A HREF="../utilities/regions/XSetRegion.html">XSetRegion()</A></B>will use the extended-length encoding as necessary, if supportedby the server. Use of the extended-length encoding in other Xlibfunctions (for example,<B><A HREF="../graphics/drawing/XDrawPoints.html">XDrawPoints()</A></B>,<B><A HREF="../graphics/drawing/XDrawRectangles.html">XDrawRectangles()</A></B>,<B><A HREF="../graphics/drawing/XDrawSegments.html">XDrawSegments()</A></B>,<B><A HREF="../graphics/filling-areas/XFillArcs.html">XFillArcs()</A></B>,<B><A HREF="../graphics/filling-areas/XFillRectangles.html">XFillRectangles()</A></B>,<B><A HREF="../graphics/XPutImage.html">XPutImage()</A></B>)is permitted but not required; an Xlib implementation may choose tosplit the data across multiple smaller requests instead.<P><A NAME="XMaxRequestSize"></A><H2>XMaxRequestSize</H2><CODE><PRE>long XMaxRequestSize(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "XMaxRequestSize" "" "@DEF@">The<B>XMaxRequestSize()</B>function returns the maximum request size (in 4-byte units) supportedby the server without using an extended-length protocol encoding.Single protocol requests to the server can be no larger than this sizeunless an extended-length protocol encoding is supported by the server.The protocol guarantees the size to be no smaller than 4096 units(16384 bytes).Xlib automatically breaks data up into multiple protocol requestsas necessary for the following functions:<B><A HREF="../graphics/drawing/XDrawPoints.html">XDrawPoints()</A></B>,<B><A HREF="../graphics/drawing/XDrawRectangles.html">XDrawRectangles()</A></B>,<B><A HREF="../graphics/drawing/XDrawSegments.html">XDrawSegments()</A></B>,<B><A HREF="../graphics/filling-areas/XFillArcs.html">XFillArcs()</A></B>,<B><A HREF="../graphics/filling-areas/XFillRectangles.html">XFillRectangles()</A></B>,and <B><A HREF="../graphics/XPutImage.html">XPutImage()</A></B>.<P><A NAME="LastKnownRequestProcessed"></A><H2>LastKnownRequestProcessed</H2><CODE><PRE>LastKnownRequestProcessed(<B>display</B>)unsigned long XLastKnownRequestProcessed(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "LastKnownRequestProcessed" "" "@DEF@"><!.IN "XLastKnownRequestProcessed" "" "@DEF@">Both extract the full serial number of the last request known by Xlibto have been processed by the X server.Xlib automatically sets this number when replies, events, and errorsare received.<P><A NAME="NextRequest"></A><H2>NextRequest</H2><CODE><PRE>NextRequest(<B>display</B>)unsigned long XNextRequest(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "NextRequest" "" "@DEF@"><!.IN "XNextRequest" "" "@DEF@">Both extract the full serial number that is to be used for the nextrequest.Serial numbers are maintained separately for each display connection.<P><A NAME="ProtocolVersion"></A><H2>ProtocolVersion</H2><CODE><PRE>ProtocolVersion(<B>display</B>)int XProtocolVersion(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "ProtocolVersion" "" "@DEF@"><!.IN "XProtocolVersion" "" "@DEF@">Both return the major version number (11) of the X protocol associated with the connected display.<P><A NAME="ProtocolRevision"></A><H2>ProtocolRevision</H2><CODE><PRE>ProtocolRevision(<B>display</B>)int XProtocolRevision(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "ProtocolRevision" "" "@DEF@"><!.IN "XProtocolRevision" "" "@DEF@">Both return the minor protocol revision number of the X server.<P><A NAME="QLength"></A><H2>QLength</H2><CODE><PRE>QLength(<B>display</B>)int XQLength(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "QLength" "" "@DEF@"><!.IN "XQLength" "" "@DEF@">Both return the length of the event queue for the connected display.Note that there may be more events that have not been read intothe queue yet (see<B><A HREF="../event-handling/XEventsQueued.html">XEventsQueued()</A></B>).<P><A NAME="RootWindow"></A><H2>RootWindow</H2><CODE><PRE>RootWindow(<B>display</B>, <B>screen_number</B>)Window XRootWindow(<B>display</B>, <B>screen_number</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>; int <B>screen_number</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>screen_number</B><TD> Specifies the appropriate screen number on the host server.</TABLE><P><!.IN "Window" "RootWindow"><!.IN "RootWindow" "" "@DEF@"><!.IN "Window" "XRootWindow"><!.IN "XRootWindow" "" "@DEF@">Both return the root window.These are useful with functions that need a drawable of a particular screenand for creating top-level windows.<P><A NAME="ScreenCount"></A><H2>ScreenCount</H2><CODE><PRE>ScreenCount(<B>display</B>)int XScreenCount(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "ScreenCount" "" "@DEF@"><!.IN "XScreenCount" "" "@DEF@">Both return the number of available screens.<P><A NAME="ServerVendor"></A><H2>ServerVendor</H2><CODE><PRE>ServerVendor(<B>display</B>)char *XServerVendor(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "ServerVendor" "" "@DEF@"><!.IN "XServerVendor" "" "@DEF@">Both return a pointer to a null-terminated string that providessome identification of the owner of the X server implementation.If the data returned by the server is in the Latin Portable Character Encoding,then the string is in the Host Portable Character Encoding.Otherwise, the contents of the string are implementation dependent.<P><A NAME="VendorRelease"></A><H2>VendorRelease</H2><CODE><PRE>VendorRelease(<B>display</B>)int XVendorRelease(<B>display</B>) <A HREF="opening.html#Display">Display</A> *<B>display</B>;</PRE></CODE><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.</TABLE><P><!.IN "VendorRelease" "" "@DEF@"><!.IN "XVendorRelease" "" "@DEF@">Both return a number related to a vendor's release of the X server.<H5 ALIGN=right><I>Next: <A HREF="image-format-macros.html">Image Format Functions and Macros</A></I></H5><HR><ADDRESS><A HREF="http://tronche.com/">Christophe Tronche</A>, <A HREF="mailto:ch.tronche@computer.org">ch.tronche@computer.org</A></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -