X Window研究笔记(20)

<iframe align="top" marginwidth="0" marginheight="0" src="http://www.zealware.com/46860.html" frameborder="0" width="468" scrolling="no" height="60"></iframe>
X Window研究笔记(20)

转载时请注明出处和作者联系方式
作者联系方式:李先静 <xianjimli at hotmail dot com><br><br><font size="4" style="font-weight: bold;">20.X Window资源管理</font><br><br>在X Window中,资源是一个广泛使用的概念。它包括图片、光标和窗口等对象,可以是内置的,也可以是注册的。每个资源都有一个ID,这个ID是唯一的,在各个客户端之间相同的ID引用相同的资源。这不但提高了传输性能,也是解决了在不同进程,甚至不同机器之间资源共享的问题。<br><br>对资源管理的主要函数有:<br><br><div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 95%;"><div><font><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">RegisterResourceName(RESTYPEtype,</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">name)<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPE<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">CreateNewResourceType(deleteFunc)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">DeleteTypedeleteFunc;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPE<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">CreateNewResourceClass()<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">Bool<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">InitClientResources(client)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">ClientPtrclient;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">GetXIDRange(client,server,minp,maxp)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">client;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">Boolserver;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">XID</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">minp,</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">maxp;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">Bool<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">AddResource(id,type,value)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">XIDid;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPEtype;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">pointervalue;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">FreeResource(id,skipDeleteFuncType)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">XIDid;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPEskipDeleteFuncType;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> <br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">FreeResourceByType(id,type,skipFree)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">XIDid;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPEtype;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">BoolskipFree;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">Bool<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">ChangeResourceValue(id,rtype,value)<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">XIDid;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPErtype;<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">pointervalue;<br><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif"></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"><br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">FindClientResourcesByType(<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">ClientPtrclient,<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">RESTYPEtype,<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">FindResTypefunc,<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">pointercdata<br><img align="top" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif">)</span></font></div></div> <br><br>(待续)<br></xianjimli>

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1809679


你可能感兴趣的:(.net,Blog)