Code structure of Wayland source code parsing

Source: Internet
Author: User
Tags cursor library

Source: http://blog.csdn.net/basilc/article/details/8074895

 

For more information about how to obtain and compile Wayland and its dependent libraries, see build guide on the official website of Wayland: http://wayland.free?top.org/building.html.

Implemented by WaylandCodeComponents can be divided into the following four parts:

1. Wayland Database

Most of Wayland's core implementations are here.

1) ToolsProgram(Wayland-pilot)

Analyze the Wayland protocol file and generate the corresponding header file and code file.

Source code file list:

Wayland/src/Alibaba. c

 

2) tool Library

Tool functions, interfaces, and structures used by other libraries and programs.

Source code file list:

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 library

Description of the structure of the pile interface (stub interfaces) and event listener for the client.

Source code file list:

Wayland/src/wayland-protocol.c

Wayland/src/wayland-client.c

 

4) Server Database

The implementation of the Wayland core protocol.

Source code file list:

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 library

The implementation of cursor-related functions. Not as the key analysis part.

Source code file list:

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) Public header files

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 implementation

The code is located in Mesa.

1) code in libegl

Mesa/src/EGL/Drivers/dri2/platform_wayland.c

Mesa/src/EGL/Wayland-DRM/wayland-drm.c

Mesa/src/EGL/Wayland-DRM/wayland-drm-protocol.c

Mesa/src/EGL/Wayland-DRM/wayland-drm-client-protocol.h

Mesa/src/EGL/Wayland-DRM/wayland-drm-server-protocol.h

 

2) libwayland-EGL

Mesa/src/EGL/Wayland-EGL/wayland-egl-priv.h

Mesa/src/EGL/Wayland-EGL/wayland-egl.c

 

3. Weston (reference implementation of waylandcompositor)

1) compositor

A reference implementation of synthesizer, with a lot of code. select several key parts for analysis, such as event processing and graphic output.

Source code list for key analysis:

Weston/src/compositor. c

Weston/src/compositor-drm.c

Weston/src/evdev. c

 

2) Shell (implemented as a compositor plug-in)

It can be considered as a window manager or desktop management plug-in.

Source code list for key analysis:

Weston/src/shell. c

 

3) clients

Client programs, such as terminal. If the analysis is not focused, key code segments are selected for analysis only when the interaction process is analyzed.

 

4. Protocol

A series of XML files that define the core and extension protocols of Wayland.

Core protocols:

Wayland/protocol/Wayland. xml

Mesa/src/EGL/Wayland-DRM/wayland-drm.xml(It is very important and can be considered as the core protocol)

 

Extended protocol (not as the key analysis object ):

Weston/protocol/desktop-shell.xml

Weston/protocol/tablet-shell.xml

 

There are also some unit test code, located in Wayland and WestonTestsDirectory, which is mainly used to test general utility functions. It is helpful to understand the usage of utility functions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.