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

📄 index.html

📁 linux图形界面x liberary手册
💻 HTML
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: Appendix D: Compatibility Functions</TITLE></HEAD><BODY><H1 ALIGN=center>Appendix D: Compatibility Functions</H1>The X Version 11 and X Version 10 functions discussed in this appendix are obsolete, have been superseded by newer X Version 11 functions,and are maintained for compatibility reasons only.<H2>X Version 11 Compatibility Functions</H2><P>You can use the X Version 11 compatibility functions to:<UL><P><LI><A HREF="#set-standard-properties">Set standard properties</A><P><LI><A HREF="#window-sizing-hints">Set and get window sizing hints</A><P><LI><A HREF="#xstandard-colormap">Set and get an<B>XStandardColormap</B>structure</A><P><LI><A HREF="#parse-geometry">Parse window geometry</A><P><LI><A HREF="#get-x-defaults">Get X environment defaults</A></UL><A NAME="set-standard-properties"></A><H2>Setting Standard Properties</H2>To specify a minimum set of properties describing the simplest application,use<B><A HREF="XSetStandardProperties.html">XSetStandardProperties()</A></B>.<H2>Setting and Getting Window Sizing Hints</H2>Xlib provides functions that you can use to set or get window sizing hints.The functions discussed in this section use the flags and the<B>XSizeHints</B>structure, as defined in the<B>X11/Xutil.h</B>header file, and use the <A HREF="/gui/x/icccm/sec-4.html#WM_NORMAL_HINTS">WM_NORMAL_HINTS</A> property.<P>To set the size hints for a given window in its normal state, use<B><A HREF="XSetNormalHints.html">XSetNormalHints()</A></B>.<P>To return the size hints for a window in its normal state, use<B><A HREF="XGetNormalHints.html">XGetNormalHints()</A></B>.<P>The next two functions set and read the WM_ZOOM_HINTS property.<P>To set the zoom hints for a window, use<B><A HREF="XSetZoomHints.html">XSetZoomHints()</A></B><P>To read the zoom hints for a window, use<B><A HREF="XGetZoomHints.html">XGetZoomHints()</A></B>.<P>To set the value of any property of type WM_SIZE_HINTS, use<B><A HREF="XSetSizeHints.html">XSetSizeHints()</A></B>.<P>To read the value of any property of type WM_SIZE_HINTS, use<B><A HREF="XGetSizeHints.html">XGetSizeHints()</A></B>.<H2>Getting and Setting an XStandardColormap Structure</H2><P>To get the <B><A HREF="../../ICC/standard-colormaps/#XStandardColormap">XStandardColormap</A></B> structure associated with one of the described atoms, use<B><A HREF="XGetStandardColormap.html">XGetStandardColormap()</A></B>.<P>To set a standard colormap, use<B><A HREF="XSetStandardColormap.html">XSetStandardColormap()</A></B>.<H2>Parsing Window Geometry</H2><P>To parse window geometry given a user-specified position and a default position, use<B><A HREF="XGeometry.html">XGeometry()</A></B>.<H2>Obtaining the X Environment Defaults</H2><P>The<B><A HREF="XGetDefault.html">XGetDefault()</A></B>function provides a primitive interface to the resource manager facilities discussed in chapter "<A HREF="../../resource-manager/">Resource Manager Functions</A>".It is only useful in very simple applications.<P><H2>X Version 10 Compatibility Functions</H2><P>You can use the X Version 10 compatibility functions to:<UL><P><LI>Draw and fill polygons and curves<P><LI>Associate user data with a value</UL><H2>Drawing and Filling Polygons and Curves</H2><P>Xlib provides functions that you can use to draw or fillarbitrary polygons or curves.  These functions are provided mainly for compatibility with X Version 10 and have no server support.  That is, they call other Xlib functions, not the server directly.  Thus, if you just have straight lines to draw, using <B><A HREF="../../graphics/drawing/XDrawLines.html">XDrawLines()</A></B><!.IN "XDrawLines">or<B><A HREF="../../graphics/drawing/XDrawSegments.html">XDrawSegments()</A></B><!.IN "XDrawSegments" >is much faster.<P>The functions discussed here provide all the functionality of the X Version 10 functions <B><A HREF="XDraw.html">XDraw()</A></B>, <!.IN "X10 compatibility" "XDraw" ><B><A HREF="XDrawFilled.html">XDrawFilled()</A></B>, <!.IN "X10 compatibility" "XDrawFilled"><B><A HREF="XDrawPatterned.html">XDrawPatterned()</A></B>, <!.IN "X10 compatibility" "XDrawPatterned" ><B><A HREF="XDrawDashed.html">XDrawDashed()</A></B>, <!.IN "X10 compatibility" "XDrawDashed">and<B><A HREF="XDrawTiled.html">XDrawTiled()</A></B>.  <!.IN "X10 compatibility" "XDrawTiled">They are as compatible as possible given X Version 11's new line drawing functions.  One thing to note, however, is that<B><A HREF="VertexDrawLastPoint.html">VertexDrawLastPoint()</A></B>is no longer supported. Also, the error status returned is the opposite of what it was under X Version 10 (this is the X Version 11 standard error status).  <B><A HREF="XAppendVertex.html">XAppendVertex()</A></B>and <B><A HREF="XClearVertexFlag.html">XClearVertexFlag()</A></B>from X Version 10 also are not supported.<P>Just how the graphics context you use is set up actuallydetermines whether you get dashes or not, and so on.  Lines are properly joined if they connect and includethe closing of a closed figure  (see <B><A HREF="../../graphics/drawing/XDrawLines.html">XDrawLines()</A></B>).The functions discussed here fail (return zero) only if they run out of memoryor are passed a <B>Vertex</B> list that has a <B>Vertex</B> with <B>VertexStartClosed</B>set that is not followed by a <B>Vertex</B> with <B>VertexEndClosed</B> set.<P>To achieve the effects of the X Version 10<B><A HREF="XDraw.html">XDraw()</A></B>, <!.IN "X10 compatibility" "XDraw" ><B><A HREF="XDrawDashed.html">XDrawDashed()</A></B>, <!.IN "X10 compatibility" "XDrawDashed">and <B><A HREF="XDrawPatterned.html">XDrawPatterned()</A></B>, <!.IN "X10 compatibility" "XDrawPatterned" >use<B><A HREF="XDraw.html">XDraw()</A></B>.  <P>To achieve the effects of the X Version 10<B>XDrawTiled()</B><!.IN "X10 compatibility" "XDrawTiled">and <B>XDrawFilled()</B>, <!.IN "X10 compatibility" "XDrawFilled">use<B><A HREF="XDrawFilled.html">XDrawFilled()</A></B><H2>Associating User Data with a Value</H2><P>These functions have been superseded by the context management functions(see "<A HREF="../../utilities/context-manager.html">Using the Context Manager</A>"). It is often necessary to associate arbitrary information with resource IDs.Xlib provides the <B>XAssocTable</B>functions that you can use to make such an association.<!.IN "Hash Lookup"><!.IN "Window" "IDs"><!.IN "Resource IDs">Application programs often need to be able to easily refer totheir own data structures when an event arrives.The <B>XAssocTable</B>system provides users of the X library with a methodfor associating their own data structures with X resources( <B>Pixmaps</B>, <B>Fonts</B>, <B>Windows</B>, and so on).<P>An <B>XAssocTable</B>can be used to type X resources.  For example, the usermay want to have three or four types of windows,each with different properties. This can be accomplished by associating each X window IDwith a pointer to a window property data structure  defined  by  theuser.A generic type has been defined in the X library for resource IDs.It is called an XID.<P>There are a few  guidelines  that  should be observed when using an<B>XAssocTable</B>:<UL><P><LI>All  XIDs  are  relative  to  the  specified display.<P><LI>Because  of  the  hashing  scheme  used  by  the  association mechanism,the following rules for determining the size of a<B>XAssocTable</B>should be followed.  Associations will be  made  and  looked  up  moreefficiently  if  the  table  size  (number  of  buckets in the hashingsystem) is a power of two and if there are not more than 8 XIDs  perbucket.</UL><P>To return a pointer to a new<B>XAssocTable</B> , use <B><A HREF="XCreateAssocTable.html">XCreateAssocTable()</A></B>.<P>To create an entry in a given <B>XAssocTable</B>,use <B><A HREF="XMakeAssoc.html">XMakeAssoc()</A></B>.<P>To obtain data from a given <B>XAssocTable</B>,use <B><A HREF="XLookUpAssoc.html">XLookUpAssoc()</A></B>.<P>To delete an entry from a given <B>XAssocTable</B>,use <B><A HREF="XDeleteAssoc.html">XDeleteAssoc()</A></B>.<P>To free the memory associated with a given <B>XAssocTable</B>,use <B><A HREF="XDestroyAssocTable.html">XDestroyAssocTable()</A></B>.<H5 ALIGN=right><I>Next: <A HREF="../../glossary/">Glossary</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 + -