X Window研究笔记(20)

news/2024/7/6 0:26:10
X Window研究笔记(20)

转载时请注明出处和作者联系方式
作者联系方式:李先静

20.X Window资源管理

在X Window中,资源是一个广泛使用的概念。它包括图片、光标和窗口等对象,可以是内置的,也可以是注册的。每个资源都有一个ID,这个ID是唯一的,在各个客户端之间相同的ID引用相同的资源。这不但提高了传输性能,也是解决了在不同进程,甚至不同机器之间资源共享的问题。

对资源管理的主要函数有:

void RegisterResourceName (RESTYPE type, char *name)

RESTYPE
CreateNewResourceType(deleteFunc)
DeleteType deleteFunc;

RESTYPE
CreateNewResourceClass()

Bool  
InitClientResources(client)
ClientPtr client;

void
GetXIDRange(client, server, minp, maxp)
    
int client;
    Bool server;
    XID 
*minp, *maxp;

Bool   
AddResource(id, type, value)
    XID id;
    RESTYPE type;
pointer value;

void
FreeResource(id, skipDeleteFuncType)
    XID id;
    RESTYPE skipDeleteFuncType;
void  

FreeResourceByType(id, type, skipFree)
    XID id;
    RESTYPE type;
Bool    skipFree;

Bool
ChangeResourceValue (id, rtype, value)
    XID id;
    RESTYPE rtype;
pointer value;

void
FindClientResourcesByType(
    ClientPtr client,
    RESTYPE type,
    FindResType func,
    pointer cdata
)


(待续)
 




http://www.niftyadmin.cn/n/3648132.html

相关文章

SVN项目更新失败被锁定的解决方案

相关网址: 标题:svn更新项目提示该项目已锁定,svn“清理”解决问题 网址:https://blog.csdn.net/strwangfan/article/details/78748393 标题:SVN被锁定解决办法 网址:https://blog.csdn.net/strwangfan…

通过DigitalOcean Kubernetes扩展应用程序以实现增长

视频 (Video) 介绍 (Introduction) Effectively scaling your SaaS is imperative to business growth. Once you have built your application, it’s time to prepare for growth in usage. When to scale up? When to scale down? What metric to track for scaling? How…

X Window研究笔记(21)

X Window研究笔记(21)转载时请注明出处和作者联系方式作者联系方式:李先静 21.X Window 字符串与AtomAtom是X Window中的一大特色,不把它弄清楚,可能会对阅读其它代码形成障碍。X Window把常用的字串用一个hash表来管理,并给这些字…

react 实现滚动加载_如何在React中实现平滑滚动

react 实现滚动加载介绍 (Introduction) Smooth scrolling is when instead of clicking on a button and being instantly taken to a different part of the same page, the user is navigated there via a scroll animation. It’s one of those subtle UI features on a si…

jsp、freemarker、velocity、thymeleaf模板引擎优缺点

1、概述 在java领域,表现层技术主要有三种, (1)jsp; (2)freemarker; (3)velocity; (4)thymeleaf; 2、jsp 优点: 1、功能强大,可…

X Window研究笔记(22)

X Window研究笔记(22)转载时请注明出处和作者联系方式作者联系方式:李先静 22.X Window 简单示例对大多数linux程序员来说,很少有机会直接用Xlib去开发应用程序,那样开发效率太低,一般都是使用基于像GTK+和QT这样的too…

discord china_如何在Ubuntu 18.04上使用Discord Webhooks获取有关您的网站状态的通知

discord chinaThe author selected the Apache Software Foundation to receive a donation as part of the Write for DOnations program. 作者选择了Apache Software Foundation作为Write for DOnations计划的一部分来接受捐赠。 介绍 (Introduction) When you have critica…

Java中transient关键字

Java中transient关键字1.只要这个类实现了Serilizable接口,这个类的所有属性和方法都会自动序列化。 2.如果在实现了Serilizable接口的类中,对该类的某属性添加transient关键字,那么在序列化对象的时候,这个属性就不会被序列化。…