⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 display-macros.html

📁 linux图形界面x liberary手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: Display Macros</TITLE></HEAD><BODY><H1 ALIGN=center>2.2.1. Display Macros</H1><P>Applications should not directly modify any part of the<A HREF="opening.html#Display">Display</A>and<A HREF="screen-information.html">Screen</A>structures.The members should be considered read-only,although they may change as the result of other operations on the display.<P> The following lists the C language macros,their corresponding function equivalents that are for other language bindings,and what data they both can return.<H2>AllPlanes</H2><A NAME="AllPlanes"></A><A NAME="XAllPlanes"></A><P><PRE><CODE>AllPlanesunsigned long XAllPlanes() </PRE></CODE><P><!.IN "AllPlanes" "" "@DEF@"><!.IN "XAllPlanes" "" "@DEF@">Both return a value with all bits set to 1 suitable for use in a plane argument toa procedure.<H2>BlackPixel, WhitePixel</H2><A NAME="BlackPixel"></A><A NAME="WhitePixel"></A><P>Both <B>BlackPixel()</B> and <B>WhitePixel()</B>can be used in implementing a monochrome application.These pixel values are for permanently allocated entries in the defaultcolormap.The actual RGB (red, green, and blue) values are settable on some screens and, in any case, may not actually be black or white.The names are intended to convey the expected relative intensity of the colors.<PRE><CODE>BlackPixel(<B>display</B>, <B>screen_number</B>)unsigned long XBlackPixel(<B>display</B>, <B>screen_number</B>)      <A HREF="opening.html#Display">Display</A> *<B>display</B>;      int <B>screen_number</B>;</CODE></PRE><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 "BlackPixel" "" "@DEF@"><!.IN "XBlackPixel" "" "@DEF@">Both return the black pixel value for the specified screen.<P><CODE><PRE>WhitePixel(<B>display</B>, <B>screen_number</B>)unsigned long XWhitePixel(<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 "WhitePixel" "" "@DEF@"><!.IN "XWhitePixel" "" "@DEF@">Both return the white pixel value for the specified screen. <P><A NAME="ConnectionNumber"></A><H2>ConnectionNumber</H2><CODE><PRE>ConnectionNumber(<B>display</B>)int XConnectionNumber(<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><!.IN "ConnectionNumber" "" "@DEF@"><!.IN "XConnectionNumber" "" "@DEF@">Both return a connection number for the specified display.On a POSIX-conformant system,this is the file descriptor of the connection.<A NAME="DefaultColormap"><H2>DefaultColormap</H2><CODE><PRE>DefaultColormap(<B>display</B>, <B>screen_number</B>)Colormap XDefaultColormap(<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 "DefaultColormap" "" "@DEF@"><!.IN "XDefaultColormap" "" "@DEF@">Both return the default colormap ID for allocation on the specified screen.Most routine allocations of color should be made out of this colormap.<A NAME="DefaultDepth"></A><H2>DefaultDepth</H2><CODE><PRE>DefaultDepth(<B>display</B>, <B>screen_number</B>)int XDefaultDepth(<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><!.IN "DefaultDepth" "" "@DEF@"><!.IN "XDefaultDepth" "" "@DEF@">Both return the depth (number of planes) of the default root window for thespecified screen.Other depths may also be supported on this screen (see.PN XMatchVisualInfo ).<P><A NAME="XListDepths"></A><H2>XListDepths</H2><!.IN "XListDepths" "" "@DEF@">To determine the number of depths that are available on a given screen, use<B>XListDepths()</B>.<CODE><PRE>int *XListDepths(<B>display</B>, <B>screen_number</B>, <B>count_return</B>)      <A HREF="opening.html#Display">Display</A> *<B>display</B>;      int <B>screen_number</B>;      int *<B>count_return</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.<TR><TD> <B>count_return</B><TD> Returns the number of depths</TABLE><P>The<B>XListDepths()</B>function returns the array of depths that are available on the specified screen.If the specified <B>screen_number</B> is valid and sufficient memory for the arraycan be allocated,<B>XListDepths()</B>sets <B>count_return</B> to the number of available depths.Otherwise, it does not set count_return and returns NULL.To release the memory allocated for the array of depths, use<B><A HREF="XFree.html">XFree()</A></B>.<P><A NAME="DefaultGC"></A><H2>DefaultGC</H2><CODE><PRE>DefaultGC(<B>display</B>, <B>screen_number</B>)GC XDefaultGC(<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 "DefaultGC" "" "@DEF@"><!.IN "XDefaultGC" "" "@DEF@">Both return the default graphics context for the root window of the specified screen.This GC is created for the convenience of simple applicationsand contains the default GC components with the foreground andbackground pixel values initialized to the black and whitepixels for the screen, respectively.You can modify its contents freely because it is not used in any Xlibfunction.This GC should never be freed.<P><A NAME="DefaultRootWindow"></A><H2>DefaultRootWindow</H2><CODE><PRE>DefaultRootWindow(<B>display</B>)Window XDefaultRootWindow(<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 "DefaultRootWindow" "" "@DEF@"><!.IN "XDefaultRootWindow" "" "@DEF@">Both return the root window for the default screen.<P><A NAME="DefaultScreenOfDisplay"></A><H2>DefaultScreenOfDisplay</H2><CODE><PRE>DefaultScreenOfDisplay(<B>display</B>)Screen *XDefaultScreenOfDisplay(<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 "DefaultScreenOfDisplay" "" "@DEF@"><!.IN "XDefaultScreenOfDisplay" "" "@DEF@">Both return a pointer to the default screen.<P><A NAME="ScreensOfDisplay"></A><H2>ScreensOfDisplay</H2><CODE><PRE>ScreenOfDisplay(<B>display</B>, <B>screen_number</B>)Screen *XScreenOfDisplay(<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 "ScreenOfDisplay" "" "@DEF@"><!.IN "XScreenOfDisplay" "" "@DEF@">Both return a pointer to the indicated screen.<P><A NAME="DefaultScreen"></A><H2>DefaultScreen</H2><CODE><PRE>DefaultScreen(<B>display</B>)int XDefaultScreen(<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 "DefaultScreen" "" "@DEF@"><!.IN "XDefaultScreen" "" "@DEF@">Both return the default screen number referenced by the <B><A HREF="opening.html">XOpenDisplay()</A></B>function. This macro or function should be used to retrieve the screen number in applications that will use only a single screen.<P><A NAME="DefaultVisual"></A><H2>DefaultVisual</H2><CODE><PRE>DefaultVisual(<B>display</B>, <B>screen_number</B>)Visual *XDefaultVisual(<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 "DefaultVisual" "" "@DEF@"><!.IN "XDefaultVisual" "" "@DEF@">Both return the default visual type for the specified screen.For further information about visual types,see section 3.1.<P><A NAME="DisplayCells"></A><H2>DisplayCells</H2><CODE><PRE>DisplayCells(<B>display</B>, <B>screen_number</B>)int XDisplayCells(<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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -