Wayland 源码解析之代码结构

 来源:http://blog.csdn.net/basilc/article/details/8074895

 

获取、编译 Wayland 及其依赖库可参考 Wayland 官方网站的 Build 指南:http://wayland.freedesktop.org/building.html。

Wayland 实现的代码组成可以分成以下四部分:

1.  Wayland 库

Wayland 中最核心的部分,Wayland 协议的大部分实现位于这里。

1)   工具程序(wayland-scanner)

分析 Wayland 协议文件,并生成相应的头文件及代码文件。

源码文件列表:

wayland/src/scanner.c

 

2)   工具库

供其他库、程序使用的工具函数、接口、结构等。

源码文件列表:

wayland/src/connection.c                           

wayland/src/wayland-util.c                         

wayland/src/wayland-util.h                         

wayland/src/wayland-os.c                           

wayland/src/wayland-os.h                           

wayland/src/wayland-private.h

 

3)   Client 库

供 Client 使用的桩接口(stub interfaces)及 event listener 结构定义。

源码文件列表:

wayland/src/wayland-protocol.c                     

wayland/src/wayland-client.c

 

4)   Server 库

Wayland 核心协议的实现。

源码文件列表:

wayland/src/wayland-protocol.c                     

wayland/src/wayland-server.c                       

wayland/src/wayland-shm.c                          

wayland/src/data-device.c                          

wayland/src/event-loop.c

 

5)   Cursor 库

Cursor 相关功能的实现。不作为重点分析部分。

源码文件列表:

wayland/cursor/wayland-cursor.h

wayland/cursor/wayland-cursor.c                       

wayland/cursor/os-compatibility.c                     

wayland/cursor/os-compatibility.h                     

wayland/cursor/xcursor.c                              

wayland/cursor/xcursor.h

 

6)   公用头文件

wayland/src/wayland-util.h

wayland/src/wayland-server-protocol.h

wayland/src/wayland-server.h  

wayland/src/wayland-client-protocol.h             

wayland/src/wayland-client.h         

wayland/src/wayland-version.h

wayland/src/wayland-egl.h

 

2.      EGL 相关实现

EGL surface 与 Waylandsurface 之间的互相转换,代码位于 mesa 中。

1)   libEGL 中的代码

mesa/src/egl/drivers/dri2/platform_wayland.c

mesa/src/egl/wayland/wayland-drm/wayland-drm.c

mesa/src/egl/wayland/wayland-drm/wayland-drm-protocol.c

mesa/src/egl/wayland/wayland-drm/wayland-drm-client-protocol.h

mesa/src/egl/wayland/wayland-drm/wayland-drm-server-protocol.h

 

2)   libwayland-egl

mesa/src/egl/wayland/wayland-egl/wayland-egl-priv.h

mesa/src/egl/wayland/wayland-egl/wayland-egl.c

 

3.      Weston (WaylandCompositor 的参考实现)

1)  Compositor

合成器的一个参考实现,代码较多,选取几个关键部分进行分析,如事件处理、图形输出等。

重点分析的源码列表:

weston/src/compositor.c

weston/src/compositor-drm.c

weston/src/evdev.c

 

2)  Shell (作为Compositor的插件实现)

可以认为是一个窗口管理器或桌面管理插件。

重点分析的源码列表:

weston/src/shell.c

 

3)  Clients

客户端程序,如 Terminal 等。不作为重点分析,仅在分析交互流程时,选取关键代码段进行分析。

 

4.      协议

一系列的 XML 文件,定义 Wayland的核心协议及扩展协议。

核心协议:

wayland/protocol/wayland.xml

mesa/src/egl/wayland/wayland-drm/wayland-drm.xml(很重要,可以认为是核心协议)

 

扩展协议(不作为重点分析对象):

weston/protocol/desktop-shell.xml

weston/protocol/tablet-shell.xml

 

另外还有一些单元测试代码,位于 wayland 和weston 的tests 目录,主要用来测试通用的 utility 函数,查看这些代码对理解 utility 函数的用途是很有帮助的。

转载于:https://www.cnblogs.com/cnland/archive/2013/01/15/2861319.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274387.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

中文排版规则_非设计师的5条排版规则

中文排版规则01仅以一种字体开始 (01 Start with only one font) The first tip for non-designers dealing with typography is simple and will make your life much easier: Stop combining different fonts you like individually and try using only one font in your fut…

基本响应性的Web设计测试工具

在重新设计页面的过程中。要使页面完全响应的设计(这意味着它会重新调整大小根据浏览器的尺寸和方向)。如iPhone和iPad的移动电话和平板电脑我碰到了一些非常方便的响应设计工具,帮我测试网站在不同的屏幕响应。下面的这些响应的网页设计工具…

ux设计_声音建议:设计UX声音的快速指南

ux设计Mating calls, warning grunts, and supportive coos are some of the sounds heard throughout the animal kingdom. All species use finely-tuned noises to communicate to one another and inform others of an action or behavior. We humans aren’t all that dif…

css3高级和低级样式属性先后顺序

写css hack 时,由于hack主要针对的是个别浏览器,hack的书写顺序应当是从一般到特殊的写法。 如: .box { width:200px; height:200px; position:fixed; left:0; top:0; _position:absolute; } 如果颠倒顺序,从特殊到一般&#xff0…

sans serif_Sans和Serif相遇可爱

sans serifI first noticed it in this tweet. Exciting upcoming product and snazzy motion work aside, “What a fascinating logotype!”, I exclaimed!我在此推文中首先注意到了它。 我惊呼即将推出的激动人心的产品和令人眼花,乱的动作,“多么迷人…

[ckeditor系列]ckeditor 自己写的一个简单的image上传js 运用iframe的ajax上传

ckeditor最近修改一个上传的,原来的Image的上传插件功能很多,但是自己用,没有必要,就进行了修改,后来就改成了目前的样子,根据_samples/api_dialog.html 进行了修改,把页面里面的调用都进行了修…

sql 避免除0错误_设计简历时避免这3个常见的UX错误

sql 避免除0错误重点 (Top highlight)Having a great looking resume on hand is very important when you’re looking for a job. It is your ticket to land the interview that will get you one step closer to that one job you’ve been dreaming of.在找工作时&#xf…

一个网站自动化测试程序的设计与实现

CSDN博客不再经常更新,更多优质文章请来 粉丝联盟网 FansUnion.cn! (FansUnion) 代码 下载地址:http://download.csdn.net/detail/fansunion/5018357(免积分) 代码亮点:可读性很好,注释详尽 背景 工作中,在维护一…

如何编写数据库可视化界面_编写用于数据可视化的替代文本

如何编写数据库可视化界面什么是替代文字 (What is Alt Text) Alt text (sometimes called Alt tags or alternative text) are written descriptions added to images that convey the meaning of the visual. Good alt text helps more people understand the content. Assis…

(转)swc与swf的区别

在Flash Builder中用Actionscript写的类可以打包成swc或swf, 在Flash CS中制作的元件也可以打包成swc或swf文件, 一个swc或swf文件中可以包含多个类或元件, 每个元件会映射成一个类, 因此,在Flash Builder中的类和在Fl…

js 验证各种格式类型的正则表达式

<script src"scripts/jquery-1.4.1.js" type"text/javascript"></script> <script language"javascript" type"text/javascript"> /** * 定义验证各种格式类型的正则表达式对象 */ var Regexs { email: …

reloaddata 跳动_纸跳动像素

reloaddata 跳动I would like to open with a problem.我想开一个问题。 Why are so many designer going straight to pixels?为什么这么多设计师直接使用像素&#xff1f; Over the past few years i’ve witnessed this in my team, my clients and others throughout th…

使用自定义RadioButton和ViewPager实现TabHost效果和带滑动的页卡效果。

参考自http://www.apkbus.com/android-86125-1-1.html 这篇文章技术含量一般&#xff0c;大家别见笑。源码我以测试&#xff0c;在底部可下载。 好了先上效果图&#xff1a; 以下是实现步骤&#xff1a; 1、准备自定义RadioButton控件的样式图片等&#xff0c;就是准…

利益相关者软件工程_改善开发人员团队与非技术利益相关者之间交流的方法

利益相关者软件工程Whether you’re working on a startup or a big company, keeping your stakeholders and non-technical partners engaged and up to date on what the tech team has been building can be hard.无论您是在初创公司还是大公司中工作&#xff0c;都要让您的…

Hibernate的检索策略

Hibernate的Session在加载一个Java对象时&#xff0c;可以将与这个对象相关联的其他Java对象都加载到缓存中&#xff0c;以便程序及时调用。但有些情况下&#xff0c;我们不需要加载太多无用的对象到缓存中&#xff0c;一来这样会撑爆内存&#xff0c;二来增加了访问数据库的次…

响应式网格项目动画布局_响应式网格及其实际使用方式:常见的UI布局

响应式网格项目动画布局重点 (Top highlight)第二部分 (Part II) Now that you have a basic understanding of how to use grids, you might be wondering how to apply them to layouts you see on the web. Responsive grids are a method to systematically align your des…

SQL函数大全

SQL函数大全 --聚合函数use pubsgoselect avg(distinct price) --算平均数from titleswhere typebusinessgo use pubsgoselect max(ytd_sales) --最大数from titlesgo use pubsgoselect min(ytd_sales) --最小数from titlesgo use pubsgoselect type,sum(price),sum(advanc…

时间轴ui设计_我应该在UI设计上花更多时间吗?

时间轴ui设计Let’s start with an example of communication skills: they are important for any profession, and you expect any professional to have a decent level. However, excellent communication skills won’t make up for the lack of core expertise. Imagine …

一、Oracle介绍

Oracle学习笔记 一、 Oracle介绍 选择数据库的标准 项目的规模 负载量多大&#xff0c;用户量多少 成本 安全性 Oracle 认证 初级&#xff1a;OCA&#xff1a;Oracle Certificated Associate 中级&#xff1a;OCP&#xff1a;Oracle Certificated Professional 高级&#xff…

移动端分步注册_移动应用程序的可用性测试:分步指南

移动端分步注册Written by Justin Mifsud由贾斯汀米夫苏德 ( Justin Mifsud)撰写 The mobile market is huge and growing at a very fast rate. With an estimated 4.5 billion subscribers worldwide, it is forecasted that the number of mobile phones will surpass the …