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.pswp.cn/news/274387.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274387.shtml
英文地址,請注明出處:http://en.pswp.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 …