Minsoo Ryu Real-Time Computing and Communications Lab ...Tizen_2.3).pdf · • 60fps+ on common...

Post on 12-Oct-2020

6 views 0 download

Transcript of Minsoo Ryu Real-Time Computing and Communications Lab ...Tizen_2.3).pdf · • 60fps+ on common...

Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Tizen EFL

Minsoo Ryu

Real-Time Computing and Communications Lab.Hanyang University

msryu@hanyang.ac.kr

2Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 2Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Outline

What is EFL? EFL Components Example

3Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 3Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL(ENLIGHTENMENT FOUNDATION LIBRARIES)

4Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 4Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

What is Enlightenment? Enlightenment is not just a window manager for Linux/X11

and others, but also a whole suite of libraries to help you create beautiful user interfaces with much less work than doing it the old fashioned way and fighting with traditional toolkits

It covers uses from small mobile devices like phones all the way to powerful multi-core desktops (which are the primary development environment)

5Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 5Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

What is EFL? Enlightenment Foundation Libraries A set of free and open source graphics libraries that grew out

of the development of the Enlightenment window manager and Wayland compositor

GUI Application development toolkit Window System based on X11 3D (OpenGL ES), Font (freetype2, fontconfig) Input Service (SCIM), Voice FW (STT, TTS)

6Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 6Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

EFL provides GUI Theme Animation Widget Event of User Input Covers Mobile, Desktop IPC/Socket communication 3D Graphics Video/Sound Output etc

7Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 7Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

EFL in Tizen Graphics and UI consist of the system graphic and UI stacks,

which includes the EFL (Enlightenment Foundation libraries), an X11-based window management system, input methods, and OpenGL® ES*

The heart of the Graphics component, the EFL, is a suite of libraries

• It is for creating rich graphics with ease, for all UI resolutions

8Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 8Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

Advantages of EFL Speed

• Very fast software rendering (for all occasions)• Solid Accelerated OpenGL and OpenGL-ES2.0 support for many

years• 60fps+ on common smartphones equaling android with higher quality

Memory • Memory(Ubuntu 11.04) beyond base X11 “failsafe” session

Unity – 168MB Enlightment 0.17 – 65MB

• Both Unity and Enlightment have roughly similar features and setup• Mobile devices ship with limited memory

9Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 9Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Introduction to EFL

Advantages of EFL Support various backend engines

Divide GUI logic and program logic

Changeable theme

Compatibility of screen size

10Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 10Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL COMPONENTS

11Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 11Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL Components

EFL block diagram

12Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 12Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Overview of EFL Components

13Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 13Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

Evas in EFL block diagram

14Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 14Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

Evas Evas is a clean display canvas API for several target display

systems that can draw anti-aliased text, smooth super and sub-sampled scaled images, alpha-blend objects and much more

It abstracts any need to know much about what the characteristics of your display system are or what graphics calls are used to draw them and how

• It deals on an object level where all you do is create and manipulate objects in a canvas, set their properties, and the rest is done for you

15Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 15Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

Evas Evas is not a widget set or widget toolkit, however it is their

base It is not dependent or aware of main loops, input or output

systems Input should be polled from various sources and fed to Evas

16Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 16Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

Why Evas? Very fast software rendering Solid accelerated OpenGL/OpenGL-ES2.0 support for years 60fps+ on common phones with high quality (32bpp) Easier app development Makes for easy prototyping without target devices

17Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 17Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

Evas -> Canvas Events Functions relating to canvas events, which are mainly reports on

its internal states changing (an object got focused, the rendering is updated, etc)

18Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 18Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas

19Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 19Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas CALLBACKS

20Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 20Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas Object

Concept of Evas object All Evas displaying units are Evas object Evas threats their objects equally Evas object has types which define their specific behavior. A set of built-in object types

• Rectangle• Line• Polygon• Text• Text block• Image

21Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 21Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas_Object

22Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 22Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas_Object

23Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 23Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Evas_Object

24Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 24Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

Edje in EFL block diagram

25Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 25Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

Edje library that attempts to separate the user interface from the

application It allows applications to be skinnable, so that it is possible to

change the GUI of an application without changing the application itself

Edje-based applications use files which contain the specifications for the GUI layout that is to be used

26Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 26Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

Concept of Edje EDC

• EDC is a script file that describe about GUI Layout Edje_cc

• is a compiler that makes EDC file to EDJ file• EDJ file is loaded during run-time.

27Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 27Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

EDC StructureCollections { // Theme

group { // Widget Style that consists of Themeparts { // List of Basic Elements that consist of GUI layout

part { // Basic Elements that consists of GUI layout Basic// (i.e. RECT, TEXT, IMAGE, SWALLOW, TEXTBLOCK, // GROUP, BOX, TABLE, EXTERNAL)

}}programs { // List of Event Actions

program{ // Event Listener & Event Action}

}}

}

28Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 28Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

EDC Program Receive Event from Evas Library (ex. Mouse Click Event) Send/Listen Signal from Application

File

Send Signal

Listen Signal

Receive Event

29Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 29Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

Example of Edje

30Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 30Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

In sample_edc.c

31Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 31Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

In sample_object.edc

32Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 32Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Edje

Result of Sample

33Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 33Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL Components

EFL Core libraries

• Ecore: an event abstraction, and modular convenience library, intended to simplify a number of common tasks. It is modular, so applications need only call the minimal required libraries for a job. Ecore simplifies working with X, Evas, and also a few other things, such as network communications and threads.

• Eina: the base library of all data types used by the EFL. It is designed to reduce CPU-usage as much as possible without using too much memory. It provides list (and inlined list), hash, red-black tree, shared string, rectangle, array, iterator and accessor, memory pool, module, fixed point and magic check helper.

34Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 34Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore

Ecore in EFL block diagram

35Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 35Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore

Core concepts Event driven mainloop

• Rendering (UI)• Application state management• Small miscellaneous tasks (non-blocking)

Support for threaded work• Similar to OSX and iOS with dispatching (Grand Central Dispatch) as

well as manual dispatch and feedback• Added thread models with mainloop begin/end blocks and mainloop

call dispatch (from threads)..

36Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 36Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore

The Mainloop

37Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 37Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore

In sample tizen v2.3 native application

38Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 38Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore - App_main.c

In sample tizen v2.3 native application

39Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 39Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Ecore – ecore-main.c

40Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 40Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina in EFL block diagram

41Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 41Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina Data types and low-level/basic abstractions Eina provides data types and useful tools The Eina library implements an API for data types in an

efficient way It also provides some useful tools, such as opening shared

libraries, error management, type conversion, time accounting, and memory pool

42Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 42Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

The main features of Eina Data types

• The Eina library is a central part of the E리• It implements an API for data types, and allows you to create and

manipulate several data types Eina tools

• Eina provides a number of tools, such as string manipulation, that make your life easier when coding applications

43Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 43Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina List

44Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 44Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina_List Example

45Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 45Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina_List Example

“Tizen” “Example” “Source” “Eina”

46Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 46Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Eina

Eina_List Example

47Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 47Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL Components

EFL libraries

• Elementary : a widget set based on the EFL that makes heavy use of Evas and Edje to provide a fast, stable, and scalable library that can be used to create both rich and fast applications that can be used on anything from every day desktop computers to small PDA's and set-top boxes. It is designed to fully expose the capability of the EFL.

• EIO provide asynchronous file system operation, like listing the content of directory, copying and moving directory and files around. It relies on Ecorethread ability and, if correctly used, prevents any lock in the interface when browsing local file content.

• Emotion is a library providing video-playing capabilities through the use of smart-objects. Emotion provides several video backends.

48Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 48Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

Elementary in EFL block diagram

49Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 49Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

What is Elementary? It can be seamlessly merged with lower level objects Programmer can use Elementary containers or hand-arrage

widgets and control them Since all objects can be stacked and layered, so can

elementary widgets Widgets can be transformed like any object Works on both desktop (keyboard & mouse) as well as touch

screen and multi-touch Elementary helps enforce “finger size” so users can always

easily use your application

50Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 50Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

What is Elementary? A widget set built on top of the lower-level EFL layers Bring coherent policy and consistency to widgets Pre-made common widgets most applications need Central theme setup so applications look consistent Utilities saving extra footwork by developer Touch friendly design Scaling of UI from the get-go Also adjusts for input resolution (finger vs mouse etc.) So Elementary is VERY SIMPLE toolkit.

51Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 51Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

Organization (3-main groups) Infrastructure list

• These are modules that deal with Elementary as a whole Widget list

• These are the widgets you’ll compose your UI out of. Containers List

• These are the containers which hold the widgets.

52Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 52Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

Infrastructure list

53Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 53Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

Widget list

54Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 54Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

Containers List Gengrid Genlist Box Conformant Grid Layout Naviframe Panes Scroller Table Etc

55Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 55Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Elementary

• Box Widget • Conformat • Panes Widget

56Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 56Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

LAB 3: WRITING AN EFL APPLICATION

57Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 57Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

EFL Assignment

Write an EFL application that provides four functions to the user The user can control the brightness of backlight, control

flash light, check battery information and use motion sensor in the EFL sample application

Make use of Edje for this assignment