SlideShare una empresa de Scribd logo
1 de 80
Descargar para leer sin conexión
EFL
           Enlightenment Foundation Libraries
              http://www.enlightenment.org

Tizen native display layer – Architecture & Usage
                       Carsten Haitzler
            Enlightenment project lead & founder
                      Principal Engineer
                    raster@rasterman.com
                   c.haitzler@samsung.com
What is EFL?
●   A collection of libraries
    ●   Built by the same team working on Enlightenment
    ●   Built for the purpose of making E17 (Enlightenment 0.17)
    ●   Always focused on staying lean and still providing fanciness
    ●   Almost all development focus sunk into EFL vs E17
    ●   Cover a wide range of functionality due to broad needs
●   26% of code for E17 is E, rest is EFL.
    ●   E17+EFL make up only 50% of code in SVN though
EFL's Origins                       Enlightenment
                                                      (0.17)



  Enlightenment
   (0.1 – 0.16.x)




1996                       2001           2012


             Imlib/Fnlib   Imlib2   EFL
Historical Details
●   1996 – Enlightenment development started
●   1997 – Imaging layer split off into Imlib and Fnlib
●   1997 – Imlib adds GTK+/GDK support
●   1999 – Imlib2 combines images, fonts, alpha channels etc.
●   2001 – Evas (using Imlib2 and OpenGL) first appears
●   And then EFL really began as more libs were added:
    ●   Ecore, Ebits (later replaced by Edje), Edb (deprecated in favor
        of Eet), Eina, Embryo, Efreet, EDbus, Ethumb, Emotion,
        Elementary, Epdf, Eeze.
What's inside
●   Canvas scene-graph (Evas)
    ●   OpenGL, OpenGL-ES2.0, Software renderer and more
●   Core mainloop, connection, input and glue libraries (Ecore)
●   Data codec and storage (Eet)
●   Bytecode VM (Embryo)
●   Pre-made data objects with scripting, animation etc. (Edje)
●   Freedesktop.org standards support (Efreet)
What's inside
●   Data structure, modules and base (Eina)
●   Dbus integration and wrapping (Edbus)
●   Asynchronous I/O (Eio)   (Currently not in Tizen)


●   Video playback glue (Emotion)
●   Udev hardware detection (Eeze)                      (Currently not in Tizen)


●   Thumbnailer & cacher (Ethumb)
●   Widgets & convenience (Elementary)
On its way
●   Javascript runtime environment (Elev8)                              (Currently not in Tizen)


    ●   Still in alpha, not complete
    ●   Like Node.js, but for UI.
         –   Both Node.js and Elev8 highly similar structures & design
         –   Reaching out to Node.js developers (positive response)
         –   Harmonizing Elev8 vs Node.js libvu
●   Object model enhancements                (Currently not in Tizen)


●   Expanding performance, threading                         (Currently not in Tizen)


●   Decreasing memory footprint & more                                  (Currently not in Tizen)
So why does this matter?
●   EFL is the core toolkit being used in Tizen
●   EFL is built for performance and low footprint
    ●   Still heavy focus on customization and power
●   Tizen is open, just like EFL
●   Native apps can use EFL as opposed to shipping their own toolkits
    ●   Smaller footprint for shipping devices
    ●   Continued support
●   Provides much of what you need
    ●   It's an open source project, so contributions always welcomed
●   API's all in C, thus easily usable from both C and C++
Where does it lurk?
            HTML5 Apps




                                                                     Native Applications
             Browser                                                   and Services
            And HTML5                Enlightenment
             Runtime             (Window Manager & Compositor)

                                                                                    EFL


                                               EFL



libc etc.            libpng/jpeg etc.                     X1 OpenGL, etc.
                                                           1,                        D-Bus, Services


                                             KERNEL
Duplo time!
                                                    Application, Library, Service


                                                             Elementary
(Currently not in Tizen)

                     Eio             Eeze         Efreet       EDbus        Ethumb       Emotion        Edje


                                                               Ecore


                                                                Evas


                                        Embryo                                           Eet


                                                                Eina


                           Core OS (Kernel, libc, other system libraries, OpenGL, D-Bus, X1 services etc.)
                                                                                          1,
Why EFL?
●   Why is EFL being used as opposed to GTK+ or Qt or
    something else?
    ●   Speed
        –   Samsung used GTK+, X1 and DirectFB (in combinations) and once
                                     1
            EFL was tried, it soundly beat these hands-down in performance
        –   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
Why EFL?
●   Why is EFL being used as opposed to GTK+ or Qt or
    something else?
    ●   Memory (Ubuntu 1
                       1.04) beyond base X1 “failsafe” session
                                          1
         –   Unity – 168Mb
         –   Enlightenment 0.17 – 65Mb
              ●   Numbers based on “free” minus disk cache and buffers – Base 199Mb
    ●   Both Unity and Enlightenment have roughly similar features
        and setup
         –   Compositor (OpenGL), fullscreen wallpaper, launcher, icons,
             filemanager, etc.
How is this relevant?
●   Mobile devices ship with limited memory
    ●   128Mb, 256Mb, maybe 512Mb
●   These devices almost never use swap
    ●   Flash has limited writes, so swap can hurt device lifespan
●   Lower end devices may not have GPU's
    ●   Require decent software rendering to make up for it
●   OpenGL has overhead that may not be worth it for all
    situations
    ●   Texture atlases to keep speed, but lose memory & more
Where do I start?
●   On Tizen itself, or packages for several distros
●   Some distros EFL based
●   Source fetch methods
    ●   http://www.enlightenment.org/p.php?p=download
         –   Build order and package info etc.
              ●   (Build Elementary and E17 last)
    ●   svn co http://svn.enlightenment.org/svn/e/trunk
         –   Get everything yourself directly
    ●   http://omicron.homeip.net/projects/easy_17/easy_17.sh
                                               e       e
         –   Fetch from svn and build, install dependencies
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).
    ●   More on threading
         –   http://docs.enlightenment.org/auto/elementary/threading.html
The Mainloop (Ecore)
                                                CALLBACK

                       WAKE UP                    IDLE EXITER



                   PROCESS TIMEOUTS           TIMER/ANIMATOR
               Z
               Z
SPIN IN   OR   Z    PROCESS EVENTS             EVENT HANDLER
IDLERS

                    PROCESS JOBS                     JOB



                     GO TO SLEEP                 IDLE ENTERER


                                 EVAS RENDERS UPDATES
To keep a smooth UI
●   Put I/O work or heavy computation into threads
●   Use the constructs provided to make this easy
●   Keep state in Mainloop consistent
●   Only deliver changes as a whole (UI tracks state)
    ●   (automatic within mainloop)
●   Use Animators, not Timers for animation
●   Remember that mainloop is for keeping application state
    ●   Blocking it blocks state (and UI) updates
Threading the Mainloop (Ecore Thread)
        Thread   Thread   Thread
        Worker   Worker   Worker


                                      Results returned to Mainloop
                                        (result functions run inside Mainloop)
        Thread
          Job


        Thread                             Mainloop
          Job
Queue

        Thread
          Job                      Mainloop adds thread job



        Thread
          Job
Hello EFL
                  (in C)
#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

static void on_ok(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

int elm_main(int argc, char **argv) {
   Evas_Object *win, *box, *label, *button;

   win = elm_win_util_standard_add("main", "Hello");
   evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

   box = elm_box_add(win);

   label = elm_label_add(win);
   elm_object_text_set(label, "Hello out there world");
   elm_box_pack_end(box, label);
   evas_object_show(label);

   button = elm_button_add(win);
   elm_object_text_set(button, "OK");
   elm_box_pack_end(box, button);
   evas_object_show(button);
   evas_object_smart_callback_add(button, "clicked", on_ok, NULL);

   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   evas_object_show(win);
   elm_run();
}
ELM_MAIN();
Hello EFL
                  (in C)
#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

static void on_ok(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

int elm_main(int argc, char **argv) {
   Evas_Object *win, *box, *label, *button;

   win = elm_win_util_standard_add("main", "Hello");
   evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

   box = elm_box_add(win);

   label = elm_label_add(win);
   elm_object_text_set(label, "Hello out there world");
   elm_box_pack_end(box, label);
   evas_object_show(label);

   button = elm_button_add(win);
   elm_object_text_set(button, "OK");
   elm_box_pack_end(box, button);
   evas_object_show(button);
   evas_object_smart_callback_add(button, "clicked", on_ok, NULL);

   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   evas_object_show(win);
   elm_run();
}
ELM_MAIN();
Hello EFL
                  (in C)
#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

static void on_ok(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

int elm_main(int argc, char **argv) {
   Evas_Object *win, *box, *label, *button;

   win = elm_win_util_standard_add("main", "Hello");
   evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

   box = elm_box_add(win);

   label = elm_label_add(win);
   elm_object_text_set(label, "Hello out there world");
   elm_box_pack_end(box, label);
   evas_object_show(label);

   button = elm_button_add(win);
   elm_object_text_set(button, "OK");
   elm_box_pack_end(box, button);
   evas_object_show(button);
   evas_object_smart_callback_add(button, "clicked", on_ok, NULL);

   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   evas_object_show(win);
   elm_run();
}
ELM_MAIN();
Hello EFL
                  (in C)
#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

static void on_ok(void *data, Evas_Object *obj, void *event_info) {
   elm_exit();
}

int elm_main(int argc, char **argv) {
   Evas_Object *win, *box, *label, *button;

   win = elm_win_util_standard_add("main", "Hello");
   evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

   box = elm_box_add(win);

   label = elm_label_add(win);
   elm_object_text_set(label, "Hello out there world");
   elm_box_pack_end(box, label);
   evas_object_show(label);

   button = elm_button_add(win);
   elm_object_text_set(button, "OK");
   elm_box_pack_end(box, button);
   evas_object_show(button);
   evas_object_smart_callback_add(button, "clicked", on_ok, NULL);

   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   evas_object_show(win);
   elm_run();
}
ELM_MAIN();
Hello EFL
             (in C)




$ gcc hello.c -o hello `pkg-config --cflags --libs elementary`
$ ./hello
Hello EFL
             (in Elev8 / Javascript)




var my_window = new elm.window({
    label: "Hello",
    elements: {
       bg: { type: "background", resize: true },
       box: { type: "box",
          resize: true,
          elements: {
            label: { type: "label",
                label: "Hello out there world"
            },
            button: { type: "button",
                label: "OK",
                on_clicked: function(arg) {
                   elm.exit();
                }
            }
          }
       }
    }
});
Hello EFL
             (in Elev8 / Javascript)




$ elev8 hello.js
Getting fancy
              (in C)




#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
    elm_exit();
}

int elm_main(int argc, char **argv) {
    Evas_Object *win;

    win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
    elm_win_title_set(win, "Hello Flip");
    evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

    evas_object_show(win);
    elm_run();
}
ELM_MAIN();
Getting fancy
                                   (in C)




#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
          elm_exit();
}

int elm_main(int argc, char **argv) {
          Evas_Object *win, *bg;

          win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          elm_win_title_set(win, "Hello Flip");
          evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);


          bg = elm_bg_add(win);
          elm_bg_file_set(bg, "plant.jpg", NULL);
          elm_win_resize_object_add(win, bg);
          evas_object_show(bg);
          evas_object_show(win);
          elm_run();
}
ELM_MAIN();
Getting fancy
                                   (in C)


#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
          elm_exit();
}

int elm_main(int argc, char **argv) {
          Evas_Object *win, *bg, *box, *flip, *button;

          win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          elm_win_title_set(win, "Hello Flip");
          evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

          bg = elm_bg_add(win);
          elm_bg_file_set(bg, "plant.jpg", NULL);
          elm_win_resize_object_add(win, bg);
          evas_object_show(bg);


          box = elm_box_add(win);

          flip = elm_flip_add(win);
          elm_box_pack_end(box, flip);
          evas_object_show(flip);

          button = elm_button_add(win);
          elm_object_text_set(button, "Flip");
          elm_box_pack_end(box, button);
          evas_object_show(button);
          evas_object_smart_callback_add(button, "clicked", on_flip, flip);

          elm_win_resize_object_add(win, box);
          evas_object_show(box);
          evas_object_show(win);
          elm_run();
}
ELM_MAIN();
#include <Elementary.h>



}
          elm_exit();
                                    Getting fancy
static void on_win_del(void *data, Evas_Object *obj, void *event_info) {


                                    (in C)
static void on_flip(void *data, Evas_Object *obj, void *event_info) {
          Evas_Object *flip = data;
          elm_flip_go(flip, ELM_FLIP_CUBE_UP);
}

int elm_main(int argc, char **argv) {
          Evas_Object *win, *bg, *box, *flip, *label, *button;

          win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          elm_win_title_set(win, "Hello Flip");
          evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

          bg = elm_bg_add(win);
          elm_bg_file_set(bg, "plant.jpg", NULL);
          elm_win_resize_object_add(win, bg);
          evas_object_show(bg);

          box = elm_box_add(win);

          flip = elm_flip_add(win);
          elm_box_pack_end(box, flip);
          evas_object_show(flip);


          label = elm_label_add(win);
          elm_object_text_set(label,
                              "Hello out there world!<br>"
                              "<br>"
                              "This is a small ditty I wrote,<br>"
                              "On the front of this here note,<br>"
                              "To see what fun there can be,<br>"
                              "Playing with Elementary.<br>"
                              "<br>"
                              "To swoosh, to flip, within this note,<br>"
                              "Is precisely what the programmer wrote,<br>"
                              "For candy of the eye to be seen,<br>"
                              "Compiled to binaries it must have been.");
          evas_object_show(label);
          elm_flip_content_front_set(flip, label);
          button = elm_button_add(win);
          elm_object_text_set(button, "Flip");
          elm_box_pack_end(box, button);
          evas_object_show(button);
          evas_object_smart_callback_add(button, "clicked", on_flip, flip);

          elm_win_resize_object_add(win, box);
          evas_object_show(box);

          evas_object_show(win);
#include <Elementary.h>



}
          elm_exit();               Getting fancy
static void on_win_del(void *data, Evas_Object *obj, void *event_info) {



                                    (in C)
static void on_flip(void *data, Evas_Object *obj, void *event_info) {
          Evas_Object *flip = data;
          elm_flip_go(flip, ELM_FLIP_CUBE_UP);
}

int elm_main(int argc, char **argv) {
          Evas_Object *win, *bg, *box, *flip, *label, *list, *button;

          win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          elm_win_title_set(win, "Hello Flip");
          evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

          bg = elm_bg_add(win);
          elm_bg_file_set(bg, "plant.jpg", NULL);
          elm_win_resize_object_add(win, bg);
          evas_object_show(bg);

          box = elm_box_add(win);

          flip = elm_flip_add(win);
          elm_box_pack_end(box, flip);
          evas_object_show(flip);

          label = elm_label_add(win);
          elm_object_text_set(label,
                              "Hello out there world!<br>"
                              "<br>"
                              "This is a small ditty I wrote,<br>"
                              "On the front of this here note,<br>"
                              "To see what fun there can be,<br>"
                              "Playing with Elementary.<br>"
                              "<br>"
                              "To swoosh, to flip, within this note,<br>"
                              "Is precisely what the programmer wrote,<br>"
                              "For candy of the eye to be seen,<br>"
                              "Compiled to binaries it must have been.");
          evas_object_show(label);
          elm_flip_content_front_set(flip, label);


          list = elm_list_add(win);
          elm_list_item_append(list, "Eye of newt,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "And toe of frog,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "Wool of bat,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "And tongue of dog,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "Adder's fork,", NULL, NULL, NULL, NULL);
          elm_list_go(list);
          evas_object_show(list);
          elm_flip_content_back_set(flip, list);
          button = elm_button_add(win);
          elm_object_text_set(button, "Flip");
          elm_box_pack_end(box, button);
          evas_object_show(button);
          evas_object_smart_callback_add(button, "clicked", on_flip, flip);

          elm_win_resize_object_add(win, box);
          evas_object_show(box);

          evas_object_show(win);
Getting fancy
                                    (in C)
#include <Elementary.h>

static void on_win_del(void *data, Evas_Object *obj, void *event_info) {
          elm_exit();
}

static void on_flip(void *data, Evas_Object *obj, void *event_info) {
          Evas_Object *flip = data;
          elm_flip_go(flip, ELM_FLIP_CUBE_UP);
}

int elm_main(int argc, char **argv) {
          Evas_Object *win, *bg, *box, *flip, *label, *list, *button;

          win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          elm_win_title_set(win, "Hello Flip");
          evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL);

          bg = elm_bg_add(win);
          elm_bg_file_set(bg, "plant.jpg", NULL);
          elm_win_resize_object_add(win, bg);
          evas_object_show(bg);

          box = elm_box_add(win);

          flip = elm_flip_add(win);
          elm_box_pack_end(box, flip);
          evas_object_show(flip);

          label = elm_label_add(win);
          elm_object_text_set(label,
                              "Hello out there world!<br>"
                              "<br>"
                              "This is a small ditty I wrote,<br>"
                              "On the front of this here note,<br>"
                              "To see what fun there can be,<br>"
                              "Playing with Elementary.<br>"
                              "<br>"
                              "To swoosh, to flip, within this note,<br>"
                              "Is precisely what the programmer wrote,<br>"
                              "For candy of the eye to be seen,<br>"
                              "Compiled to binaries it must have been.");
          evas_object_show(label);
          elm_flip_content_front_set(flip, label);

          list = elm_list_add(win);
          elm_list_item_append(list, "Eye of newt,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "And toe of frog,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "Wool of bat,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "And tongue of dog,", NULL, NULL, NULL, NULL);
          elm_list_item_append(list, "Adder's fork,", NULL, NULL, NULL, NULL);
          elm_list_go(list);
          evas_object_show(list);
          elm_flip_content_back_set(flip, list);

          button = elm_button_add(win);
          elm_object_text_set(button, "Flip");
          elm_box_pack_end(box, button);
          evas_object_show(button);
          evas_object_smart_callback_add(button, "clicked", on_flip, flip);

          elm_win_resize_object_add(win, box);
          evas_object_show(box);

          evas_object_show(win);
          elm_run();
}
ELM_MAIN();
EVAS
What is a scene graph? (Evas)
●   Tracks state of all display objects
    ●   Position, size, visibility, color, properties etc.
●   Handles rendering of each object
    ●   Loading fonts, images, rendering glyphs, scaling, fading etc.
●   Handles minimizing of rendering
    ●   Only update areas changed
    ●   If changes obscured, reduce to a NOP
●   Optimize rendering
    ●   Abstract to OpenGL, software, or anything else
What is a scene graph? (Evas)
●   Allows you to build your own composite objects
    ●   Creates parent/child relationship
    ●   Is used throughout EFL to build widgets etc.
●   Handles input direction and event callbacks
●   Text formatting & layout
What is a scene graph? (Evas)

Text Label   Text Label   Text Label   Text Label   Text Label   Text Label




Text Label   Text Label   Text Label




     OK
Complex objects out of simple ones
Complex objects out of simple ones




              O K
Complex objects out of simple ones




              O K
Complex objects out of simple ones




              O K
Complex objects out of simple ones




            OK
Putting together objects
Abstracting rendering

                             Hello out there



  Input device events                                           Canvas state changes

                                    Canvas core
Image data, fonts etc.                                              Rendering command

                                General Rendering

                           Select rendering engine at runtime
Software rendering API                                              OpenGL Rendering API
                                       OUTPUT
                                  (screen/window)
     Software core                                                       OpenGL core
Automated update handling
Start here




                         Hello out there
Automated update handling
Next frame is here




                             Hello out there
Automated update handling
Calculate actual update region deltas (up to each engine to implement)




                                                   Hello out there
Automated update handling
Only draw updated regions (up to each engine to implement)




                                                 Hello out there
Automated update handling
Result




                     Hello out there
Multiple output paths
●   Pure software
    ●   Universal (works everywhere)
    ●   MMX, SSE, SSE3, NEON ASM (runtime detected)
    ●   High quality scaling (super-sampling + linear-interpolation)
    ●   Caching of scaled image data on the fly
    ●   Output rotation and down-convert
Multiple output paths
●   OpenGL/OpenGL-ES2
    ●   Uses texture atlases where possible
    ●   Defers texture upload and removes duplication where it can
    ●   Multi-pipeline out-of-order rendering optimizing
    ●   Batches up as much geometry as it can for best performance
    ●   Specialized shaders for performance
    ●   Pushes all rendering via GL (not just compositing surfaces)
         –   Text, polygons too
    ●   Tries to remove texture uploads with zero-copy (if possible)
Multiple output paths
●   X1 (OpenGL, Xlib & XCB)
      1
●   Wayland (OpenGL & SHM)
●   Raw Framebuffer
●   Memory buffers
●   PS3 Native
●   SDL (OpenGL)
●   Windows (32/64/CE) (GDI & DirectDraw)
●   … others too
Input Data
●   Images
    ●   CMP, EDB, EET, GIF (animated + still), ICO, JPEG,
        PPM/PGM/PBM, PSD, SVG, TGA, TIFF, WBMP, XPM, XCF,
        PS, PDF, RAW, MOV/AVI/MPG/etc.
●   Fonts
    ●   TTF, OpenType (anything Freetype 2 supports)
●   Text
    ●   UTF-8 Unicode
    ●   Complex text formatting (LTR, RTL, Composition)
EDJE
Pre-made objects for designers (Edje)
●   Edje allows a designer to store objects in files
    ●   Pre-made layout with rules and reactions to events
    ●   Stored separately to code in binary files for runtime
        replacement
    ●   Fast & compact random access designed for realtime use
    ●   All layout, image data, etc. etc. all in 1 file (zero-unpacking)
    ●   Intended for designers & developers to work independently
    ●   Supports scalable and resizeable layouts
    ●   Provides the core ability to re-theme and entire UI or OS
How it works
 Application
               Signal emits
                   Messages                          Mainloop
Signal callbacks         Controls
        Messages              Swallows
               Queries             Text etc.
                                                            Edje
        Create & control Objects
 Evas                                  Edje
        Get event callbacks

                                               Layout rules, parameters & states
                                                    Images & fonts
                                                        Event reaction rules


                                                           Edje File
collections {
             An example
   group { name: "hello";
      images {
         image: "plant.jpg" LOSSY 80;
         image: "shadow.png" COMP;
      }
      parts {
         part { name: "bg";
            description { state: "default" 0.0;
               aspect: 1.0 1.0; aspect_preference: NONE;
               image.normal: "plant.jpg";
            }
         }
         part { name: "label"; type: TEXT; scale: true;
            description { state: "default" 0.0;
               text {
                  font: "Sans"; size: 20;
                  text: "Hello World!";
               }
            }
         }
         part { name: "shadow";
            description { state: "default" 0.0;
               image.normal: "shadow.png";
            }
         }
      }
   }
}
Sizing
Scaling
ELEMENTARY
So what is Elementary?
●   A widget set built on top of the lower-level EFL layers
●   Brings 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 the developer
●   Touch friendly design
●   Scaling of UI from the get-go
●   Also adjusts for input resolution (finger vs mouse etc.)
So what is Elementary?
●   It can be seamlessly merged with lower level objects
●   Programmer can use Elementary containers or hand-
    arrange widgets and control them
●   Since all objects can be stacked and layered, so can
    elementary widgets
●   Widgets can be transformed like any object
●   Handles dealing with IME (Virtual keyboard) for you
●   Does many other useful things to save you time
So what is Elementary?
●   All widgets can and will be rendered with Hardware
    (OpenGL) if that is the engine chosen
    ●   This includes all decorations, text etc. not just compositing
●   Elementary helps enforce “finger size” so users can
    always easily use your application
●   Works on both desktop (keyboard & mouse) as well as
    touchscreen and multi-touch
Results with Elementary
Results with Elementary
EMOTION
Video & Sound in your world
●   Gives you a high level API to include video
●   Abstracts to different video decode back-ends
●   Optimizes decode via YUV paths or video overlay
●   Simple to use
Simple Video



Evas_Object *vid = emotion_object_add(canvas);
emotion_object_init(vid, NULL);
emotion_object_file_set(vid, "file.avi");
evas_object_resize(vid, 640, 360);
emotion_object_play_set(vid, EINA_TRUE);
evas_object_show(vid);
How it works
Application
                                        Mainloop



                                                                            Emotion

                                         Media Codec (Gstreamer/Xine/Generic)

Evas                          Emotion                  Thread
                                           Decoder
                               Core         thread
                                                       Thread      Thread


       Media file or stream
EET
Garbage in, garbage out

                    Application                        Text file
                      (RAM)                             Stdout

struct Data {                                                      group “Data” struct {
    const char *name;                                                  value “name” string: “Bob”;
...                                                                ...


                           Eet                           Eet
                        (Library)                      (Cmdline)



          0100011010101
                1     10101

                                         Binary
                                          Data
                                    (File or buffer)
XML/JSON … for C programmers
●   Parsing text is painful
    ●   Parsing correctly without bugs, overflows is harder
    ●   Most programmers hate parsing
●   XML, JSON etc. optimized for editing, not runtime
●   Programs read/write data 1000x more than humans
    ●   So optimize for the common use case, not the uncommon one
●   Make it as easy 1-liners for C code to load or save data
●   Edje, Enlightenment config, Elementary config built on EET
Flexible, portable and robust
●   Allows you to store data in a file (key/value pair)
    ●   Random access read optimized
    ●   Data can be any binary, image, string or struct encoded
    ●   Compresses separate keys (like zip)
●   Allows you to en/decode structs to buffers (for network)
●   Provides a protocol buffer handler for decodes
●   Files and data all platform agnostic (portable)
●   Structs encoded with nested key & types for robustness
Define your data structure

typedef struct {
   const char *name;
   int age;
   const char *address;
   const char *phone;
} Data;

Eet_Data_Descriptor_Class dc;
Eet_Data_Descriptor *d;

EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&dc, Data);
d = eet_data_descriptor_file_new(&dc);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "age", age, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "address", address, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "phone", phone, EET_T_STRING);
Declare and save it


Eet_File *ef;

Data data = {
   .name = "Bob the blob",
   .age = 7,
   .address = "7 Blob ave.",
   .phone = "+82 10 123 4567"
};

ef = eet_open("data.eet", EET_FILE_MODE_WRITE);
eet_data_write(ef, d, "data", &data, EINA_TRUE);
eet_close(ef);
Declare and save it




Data *data2;
ef = eet_open("data.eet", EET_FILE_MODE_READ);
data2 = eet_data_read(ef, d, "data");
eet_close(ef);
For debugging, decode to text



$ eet -d data.eet data
group "Data" struct {
    value "name" string: "Bob the blob";
    value "age" int: 7;
    value "address" string: "7 Blob ave.";
    value "phone" string: "+82 10 123 4567";
}
And encode + compress from text



$ cat data.txt
group "Data" struct {
    value "name" string: "Bob the blob";
    value "age" int: 7;
    value "address" string: "7 Blob ave.";
    value "phone" string: "+82 10 123 4567";
}
$ eet -e data.eet data data.txt 1
EDBUS EFREET EINA
ETHUMB EEZE EMBRYO
        EIO ...
And the saga continues
●   More EFL libraries with no time to mention them
●   Expanding libs and scope on a daily basis
Questions, Answers & Flaming



      Enlightenment Foundation Libraries
         http://www.enlightenment.org

                 Carsten Haitzler
      Enlightenment project lead & founder
                Principal Engineer
              raster@rasterman.com
             c.haitzler@samsung.com

Más contenido relacionado

La actualidad más candente

[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for ArtistsOwen Wu
 
Future of unreal
Future of unreal Future of unreal
Future of unreal Ning Hu
 
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® GraphicsGetting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® GraphicsIntel® Software
 
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...Gerke Max Preussner
 
Core MIDI and Friends
Core MIDI and FriendsCore MIDI and Friends
Core MIDI and FriendsChris Adamson
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engineDaosheng Mu
 
Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015Karman Interactive
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Xamarin
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine ArchitectureAttila Jenei
 
Core Audio Cranks It Up
Core Audio Cranks It UpCore Audio Cranks It Up
Core Audio Cranks It UpChris Adamson
 
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...Umbra Software
 
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...Gerke Max Preussner
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayNick Pruehs
 
Parallelizing Conqueror's Blade
Parallelizing Conqueror's BladeParallelizing Conqueror's Blade
Parallelizing Conqueror's BladeIntel® Software
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...DevGAMM Conference
 
Brewing Your Own Game Engie eng
Brewing Your Own Game Engie engBrewing Your Own Game Engie eng
Brewing Your Own Game Engie engCoconut Island
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud DevelopmentNick Pruehs
 
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Chris Adamson
 
Windows phone 7 xna
Windows phone 7 xnaWindows phone 7 xna
Windows phone 7 xnaGlen Gordon
 

La actualidad más candente (20)

[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
 
Future of unreal
Future of unreal Future of unreal
Future of unreal
 
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® GraphicsGetting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® Graphics
 
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
 
Core MIDI and Friends
Core MIDI and FriendsCore MIDI and Friends
Core MIDI and Friends
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engine
 
Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine Architecture
 
Core Audio Cranks It Up
Core Audio Cranks It UpCore Audio Cranks It Up
Core Audio Cranks It Up
 
Applet intro
Applet introApplet intro
Applet intro
 
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...
Umbra Ignite 2015: Graham Wihlidal – Adapting a technology stream to ever-evo...
 
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
 
Parallelizing Conqueror's Blade
Parallelizing Conqueror's BladeParallelizing Conqueror's Blade
Parallelizing Conqueror's Blade
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
 
Brewing Your Own Game Engie eng
Brewing Your Own Game Engie engBrewing Your Own Game Engie eng
Brewing Your Own Game Engie eng
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
 
Windows phone 7 xna
Windows phone 7 xnaWindows phone 7 xna
Windows phone 7 xna
 

Similar a EFL (Tizen Native Display Layer – Architecture & Usage) - Carsten Haitzler

Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Samsung Open Source Group
 
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...EnlightenmentProject
 
epoll() - The I/O Hero
epoll() - The I/O Heroepoll() - The I/O Hero
epoll() - The I/O HeroMohsin Hijazee
 
[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in action[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in actionMickael Istria
 
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseGEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseYoann Rodiere
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlangMirko Bonadei
 
3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time Pascal Rettig
 
TFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesTFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesKoan-Sin Tan
 
EcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleEcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleCédric Brun
 
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)Daniel Juyung Seo
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview Lars Vogel
 
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian DugganElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian Dugganijcd
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDevJanie Clayton
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsPrabindh Sundareson
 
2015 bsd can-luminade
2015 bsd can-luminade2015 bsd can-luminade
2015 bsd can-luminadeKen Moore
 
What's brewing in the eZ Systems extensions kitchen
What's brewing in the eZ Systems extensions kitchenWhat's brewing in the eZ Systems extensions kitchen
What's brewing in the eZ Systems extensions kitchenPaul Borgermans
 

Similar a EFL (Tizen Native Display Layer – Architecture & Usage) - Carsten Haitzler (20)

Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)
 
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...
[E-Dev-Day 2014][8/16] The Way How EFL is used in the Tizen, previous, curren...
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
epoll() - The I/O Hero
epoll() - The I/O Heroepoll() - The I/O Hero
epoll() - The I/O Hero
 
[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in action[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in action
 
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseGEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
 
3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time
 
TFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesTFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU Delegates
 
EcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleEcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessible
 
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)
The Art of Tizen UI Theme Technology in Various Profiles (OSCON 2014)
 
IN4308 1
IN4308 1IN4308 1
IN4308 1
 
Erlang os
Erlang osErlang os
Erlang os
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview
 
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian DugganElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDev
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specificationsGFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
 
2015 bsd can-luminade
2015 bsd can-luminade2015 bsd can-luminade
2015 bsd can-luminade
 
What's brewing in the eZ Systems extensions kitchen
What's brewing in the eZ Systems extensions kitchenWhat's brewing in the eZ Systems extensions kitchen
What's brewing in the eZ Systems extensions kitchen
 
Elixir
ElixirElixir
Elixir
 

Más de Ryo Jin

Samsung Z4 User Manual
Samsung Z4 User ManualSamsung Z4 User Manual
Samsung Z4 User ManualRyo Jin
 
Samsung ARTIK 050 (ARTIK ZERO) Modules Data Sheet
Samsung ARTIK 050 (ARTIK ZERO) Modules Data SheetSamsung ARTIK 050 (ARTIK ZERO) Modules Data Sheet
Samsung ARTIK 050 (ARTIK ZERO) Modules Data SheetRyo Jin
 
Introduction to Watch Face Development with Tizen Studio
Introduction to Watch Face Development with Tizen StudioIntroduction to Watch Face Development with Tizen Studio
Introduction to Watch Face Development with Tizen StudioRyo Jin
 
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverTizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverRyo Jin
 
Panduan Penggunaan Perangkat Wearable Tizen
Panduan Penggunaan Perangkat Wearable TizenPanduan Penggunaan Perangkat Wearable Tizen
Panduan Penggunaan Perangkat Wearable TizenRyo Jin
 
Cara Menggunakan Smartphone Tizen
Cara Menggunakan Smartphone TizenCara Menggunakan Smartphone Tizen
Cara Menggunakan Smartphone TizenRyo Jin
 
Gear Fit2 Watchface Design Guide
Gear Fit2 Watchface Design GuideGear Fit2 Watchface Design Guide
Gear Fit2 Watchface Design GuideRyo Jin
 
Samsung Indonesia: Tizen Store
Samsung Indonesia: Tizen StoreSamsung Indonesia: Tizen Store
Samsung Indonesia: Tizen StoreRyo Jin
 
Samsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen WearablesSamsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen WearablesRyo Jin
 
Samsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web AppsSamsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web AppsRyo Jin
 
Samsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppSamsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppRyo Jin
 
Samsung Indonesia: Tizen Platform Overview and IoT
Samsung Indonesia: Tizen Platform Overview and IoTSamsung Indonesia: Tizen Platform Overview and IoT
Samsung Indonesia: Tizen Platform Overview and IoTRyo Jin
 
Russian Tizen Project
Russian Tizen ProjectRussian Tizen Project
Russian Tizen ProjectRyo Jin
 
Samsung SM-R360 Tizen User Manual
Samsung SM-R360 Tizen User ManualSamsung SM-R360 Tizen User Manual
Samsung SM-R360 Tizen User ManualRyo Jin
 
Tizen Micro Profile for IoT device
Tizen Micro Profile for IoT deviceTizen Micro Profile for IoT device
Tizen Micro Profile for IoT deviceRyo Jin
 
Panduan Dasar Pemrograman Tizen
Panduan Dasar Pemrograman TizenPanduan Dasar Pemrograman Tizen
Panduan Dasar Pemrograman TizenRyo Jin
 
The Story of Enlightenment, EFL, Tizen and Wayland
The Story of Enlightenment, EFL, Tizen and WaylandThe Story of Enlightenment, EFL, Tizen and Wayland
The Story of Enlightenment, EFL, Tizen and WaylandRyo Jin
 
Tizen PASS
Tizen PASSTizen PASS
Tizen PASSRyo Jin
 
Tizen PASS
Tizen PASSTizen PASS
Tizen PASSRyo Jin
 
Samsung Gear UI Design Guidelines
Samsung Gear UI Design GuidelinesSamsung Gear UI Design Guidelines
Samsung Gear UI Design GuidelinesRyo Jin
 

Más de Ryo Jin (20)

Samsung Z4 User Manual
Samsung Z4 User ManualSamsung Z4 User Manual
Samsung Z4 User Manual
 
Samsung ARTIK 050 (ARTIK ZERO) Modules Data Sheet
Samsung ARTIK 050 (ARTIK ZERO) Modules Data SheetSamsung ARTIK 050 (ARTIK ZERO) Modules Data Sheet
Samsung ARTIK 050 (ARTIK ZERO) Modules Data Sheet
 
Introduction to Watch Face Development with Tizen Studio
Introduction to Watch Face Development with Tizen StudioIntroduction to Watch Face Development with Tizen Studio
Introduction to Watch Face Development with Tizen Studio
 
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverTizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
 
Panduan Penggunaan Perangkat Wearable Tizen
Panduan Penggunaan Perangkat Wearable TizenPanduan Penggunaan Perangkat Wearable Tizen
Panduan Penggunaan Perangkat Wearable Tizen
 
Cara Menggunakan Smartphone Tizen
Cara Menggunakan Smartphone TizenCara Menggunakan Smartphone Tizen
Cara Menggunakan Smartphone Tizen
 
Gear Fit2 Watchface Design Guide
Gear Fit2 Watchface Design GuideGear Fit2 Watchface Design Guide
Gear Fit2 Watchface Design Guide
 
Samsung Indonesia: Tizen Store
Samsung Indonesia: Tizen StoreSamsung Indonesia: Tizen Store
Samsung Indonesia: Tizen Store
 
Samsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen WearablesSamsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen Wearables
 
Samsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web AppsSamsung Indonesia: Tizen Web Apps
Samsung Indonesia: Tizen Web Apps
 
Samsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppSamsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native App
 
Samsung Indonesia: Tizen Platform Overview and IoT
Samsung Indonesia: Tizen Platform Overview and IoTSamsung Indonesia: Tizen Platform Overview and IoT
Samsung Indonesia: Tizen Platform Overview and IoT
 
Russian Tizen Project
Russian Tizen ProjectRussian Tizen Project
Russian Tizen Project
 
Samsung SM-R360 Tizen User Manual
Samsung SM-R360 Tizen User ManualSamsung SM-R360 Tizen User Manual
Samsung SM-R360 Tizen User Manual
 
Tizen Micro Profile for IoT device
Tizen Micro Profile for IoT deviceTizen Micro Profile for IoT device
Tizen Micro Profile for IoT device
 
Panduan Dasar Pemrograman Tizen
Panduan Dasar Pemrograman TizenPanduan Dasar Pemrograman Tizen
Panduan Dasar Pemrograman Tizen
 
The Story of Enlightenment, EFL, Tizen and Wayland
The Story of Enlightenment, EFL, Tizen and WaylandThe Story of Enlightenment, EFL, Tizen and Wayland
The Story of Enlightenment, EFL, Tizen and Wayland
 
Tizen PASS
Tizen PASSTizen PASS
Tizen PASS
 
Tizen PASS
Tizen PASSTizen PASS
Tizen PASS
 
Samsung Gear UI Design Guidelines
Samsung Gear UI Design GuidelinesSamsung Gear UI Design Guidelines
Samsung Gear UI Design Guidelines
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Último (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

EFL (Tizen Native Display Layer – Architecture & Usage) - Carsten Haitzler

  • 1. EFL Enlightenment Foundation Libraries http://www.enlightenment.org Tizen native display layer – Architecture & Usage Carsten Haitzler Enlightenment project lead & founder Principal Engineer raster@rasterman.com c.haitzler@samsung.com
  • 2. What is EFL? ● A collection of libraries ● Built by the same team working on Enlightenment ● Built for the purpose of making E17 (Enlightenment 0.17) ● Always focused on staying lean and still providing fanciness ● Almost all development focus sunk into EFL vs E17 ● Cover a wide range of functionality due to broad needs ● 26% of code for E17 is E, rest is EFL. ● E17+EFL make up only 50% of code in SVN though
  • 3. EFL's Origins Enlightenment (0.17) Enlightenment (0.1 – 0.16.x) 1996 2001 2012 Imlib/Fnlib Imlib2 EFL
  • 4. Historical Details ● 1996 – Enlightenment development started ● 1997 – Imaging layer split off into Imlib and Fnlib ● 1997 – Imlib adds GTK+/GDK support ● 1999 – Imlib2 combines images, fonts, alpha channels etc. ● 2001 – Evas (using Imlib2 and OpenGL) first appears ● And then EFL really began as more libs were added: ● Ecore, Ebits (later replaced by Edje), Edb (deprecated in favor of Eet), Eina, Embryo, Efreet, EDbus, Ethumb, Emotion, Elementary, Epdf, Eeze.
  • 5. What's inside ● Canvas scene-graph (Evas) ● OpenGL, OpenGL-ES2.0, Software renderer and more ● Core mainloop, connection, input and glue libraries (Ecore) ● Data codec and storage (Eet) ● Bytecode VM (Embryo) ● Pre-made data objects with scripting, animation etc. (Edje) ● Freedesktop.org standards support (Efreet)
  • 6. What's inside ● Data structure, modules and base (Eina) ● Dbus integration and wrapping (Edbus) ● Asynchronous I/O (Eio) (Currently not in Tizen) ● Video playback glue (Emotion) ● Udev hardware detection (Eeze) (Currently not in Tizen) ● Thumbnailer & cacher (Ethumb) ● Widgets & convenience (Elementary)
  • 7. On its way ● Javascript runtime environment (Elev8) (Currently not in Tizen) ● Still in alpha, not complete ● Like Node.js, but for UI. – Both Node.js and Elev8 highly similar structures & design – Reaching out to Node.js developers (positive response) – Harmonizing Elev8 vs Node.js libvu ● Object model enhancements (Currently not in Tizen) ● Expanding performance, threading (Currently not in Tizen) ● Decreasing memory footprint & more (Currently not in Tizen)
  • 8. So why does this matter? ● EFL is the core toolkit being used in Tizen ● EFL is built for performance and low footprint ● Still heavy focus on customization and power ● Tizen is open, just like EFL ● Native apps can use EFL as opposed to shipping their own toolkits ● Smaller footprint for shipping devices ● Continued support ● Provides much of what you need ● It's an open source project, so contributions always welcomed ● API's all in C, thus easily usable from both C and C++
  • 9. Where does it lurk? HTML5 Apps Native Applications Browser and Services And HTML5 Enlightenment Runtime (Window Manager & Compositor) EFL EFL libc etc. libpng/jpeg etc. X1 OpenGL, etc. 1, D-Bus, Services KERNEL
  • 10. Duplo time! Application, Library, Service Elementary (Currently not in Tizen) Eio Eeze Efreet EDbus Ethumb Emotion Edje Ecore Evas Embryo Eet Eina Core OS (Kernel, libc, other system libraries, OpenGL, D-Bus, X1 services etc.) 1,
  • 11. Why EFL? ● Why is EFL being used as opposed to GTK+ or Qt or something else? ● Speed – Samsung used GTK+, X1 and DirectFB (in combinations) and once 1 EFL was tried, it soundly beat these hands-down in performance – 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
  • 12. Why EFL? ● Why is EFL being used as opposed to GTK+ or Qt or something else? ● Memory (Ubuntu 1 1.04) beyond base X1 “failsafe” session 1 – Unity – 168Mb – Enlightenment 0.17 – 65Mb ● Numbers based on “free” minus disk cache and buffers – Base 199Mb ● Both Unity and Enlightenment have roughly similar features and setup – Compositor (OpenGL), fullscreen wallpaper, launcher, icons, filemanager, etc.
  • 13. How is this relevant? ● Mobile devices ship with limited memory ● 128Mb, 256Mb, maybe 512Mb ● These devices almost never use swap ● Flash has limited writes, so swap can hurt device lifespan ● Lower end devices may not have GPU's ● Require decent software rendering to make up for it ● OpenGL has overhead that may not be worth it for all situations ● Texture atlases to keep speed, but lose memory & more
  • 14. Where do I start? ● On Tizen itself, or packages for several distros ● Some distros EFL based ● Source fetch methods ● http://www.enlightenment.org/p.php?p=download – Build order and package info etc. ● (Build Elementary and E17 last) ● svn co http://svn.enlightenment.org/svn/e/trunk – Get everything yourself directly ● http://omicron.homeip.net/projects/easy_17/easy_17.sh e e – Fetch from svn and build, install dependencies
  • 15. ECORE
  • 16. 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). ● More on threading – http://docs.enlightenment.org/auto/elementary/threading.html
  • 17. The Mainloop (Ecore) CALLBACK WAKE UP IDLE EXITER PROCESS TIMEOUTS TIMER/ANIMATOR Z Z SPIN IN OR Z PROCESS EVENTS EVENT HANDLER IDLERS PROCESS JOBS JOB GO TO SLEEP IDLE ENTERER EVAS RENDERS UPDATES
  • 18. To keep a smooth UI ● Put I/O work or heavy computation into threads ● Use the constructs provided to make this easy ● Keep state in Mainloop consistent ● Only deliver changes as a whole (UI tracks state) ● (automatic within mainloop) ● Use Animators, not Timers for animation ● Remember that mainloop is for keeping application state ● Blocking it blocks state (and UI) updates
  • 19. Threading the Mainloop (Ecore Thread) Thread Thread Thread Worker Worker Worker Results returned to Mainloop (result functions run inside Mainloop) Thread Job Thread Mainloop Job Queue Thread Job Mainloop adds thread job Thread Job
  • 20. Hello EFL (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } static void on_ok(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *box, *label, *button; win = elm_win_util_standard_add("main", "Hello"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); box = elm_box_add(win); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world"); elm_box_pack_end(box, label); evas_object_show(label); button = elm_button_add(win); elm_object_text_set(button, "OK"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_ok, NULL); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 21. Hello EFL (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } static void on_ok(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *box, *label, *button; win = elm_win_util_standard_add("main", "Hello"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); box = elm_box_add(win); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world"); elm_box_pack_end(box, label); evas_object_show(label); button = elm_button_add(win); elm_object_text_set(button, "OK"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_ok, NULL); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 22. Hello EFL (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } static void on_ok(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *box, *label, *button; win = elm_win_util_standard_add("main", "Hello"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); box = elm_box_add(win); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world"); elm_box_pack_end(box, label); evas_object_show(label); button = elm_button_add(win); elm_object_text_set(button, "OK"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_ok, NULL); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 23. Hello EFL (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } static void on_ok(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *box, *label, *button; win = elm_win_util_standard_add("main", "Hello"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); box = elm_box_add(win); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world"); elm_box_pack_end(box, label); evas_object_show(label); button = elm_button_add(win); elm_object_text_set(button, "OK"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_ok, NULL); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 24. Hello EFL (in C) $ gcc hello.c -o hello `pkg-config --cflags --libs elementary` $ ./hello
  • 25. Hello EFL (in Elev8 / Javascript) var my_window = new elm.window({ label: "Hello", elements: { bg: { type: "background", resize: true }, box: { type: "box", resize: true, elements: { label: { type: "label", label: "Hello out there world" }, button: { type: "button", label: "OK", on_clicked: function(arg) { elm.exit(); } } } } } });
  • 26. Hello EFL (in Elev8 / Javascript) $ elev8 hello.js
  • 27. Getting fancy (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 28. Getting fancy (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *bg; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); bg = elm_bg_add(win); elm_bg_file_set(bg, "plant.jpg", NULL); elm_win_resize_object_add(win, bg); evas_object_show(bg); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 29. Getting fancy (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box, *flip, *button; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); bg = elm_bg_add(win); elm_bg_file_set(bg, "plant.jpg", NULL); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); flip = elm_flip_add(win); elm_box_pack_end(box, flip); evas_object_show(flip); button = elm_button_add(win); elm_object_text_set(button, "Flip"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_flip, flip); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 30. #include <Elementary.h> } elm_exit(); Getting fancy static void on_win_del(void *data, Evas_Object *obj, void *event_info) { (in C) static void on_flip(void *data, Evas_Object *obj, void *event_info) { Evas_Object *flip = data; elm_flip_go(flip, ELM_FLIP_CUBE_UP); } int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box, *flip, *label, *button; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); bg = elm_bg_add(win); elm_bg_file_set(bg, "plant.jpg", NULL); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); flip = elm_flip_add(win); elm_box_pack_end(box, flip); evas_object_show(flip); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world!<br>" "<br>" "This is a small ditty I wrote,<br>" "On the front of this here note,<br>" "To see what fun there can be,<br>" "Playing with Elementary.<br>" "<br>" "To swoosh, to flip, within this note,<br>" "Is precisely what the programmer wrote,<br>" "For candy of the eye to be seen,<br>" "Compiled to binaries it must have been."); evas_object_show(label); elm_flip_content_front_set(flip, label); button = elm_button_add(win); elm_object_text_set(button, "Flip"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_flip, flip); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win);
  • 31. #include <Elementary.h> } elm_exit(); Getting fancy static void on_win_del(void *data, Evas_Object *obj, void *event_info) { (in C) static void on_flip(void *data, Evas_Object *obj, void *event_info) { Evas_Object *flip = data; elm_flip_go(flip, ELM_FLIP_CUBE_UP); } int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box, *flip, *label, *list, *button; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); bg = elm_bg_add(win); elm_bg_file_set(bg, "plant.jpg", NULL); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); flip = elm_flip_add(win); elm_box_pack_end(box, flip); evas_object_show(flip); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world!<br>" "<br>" "This is a small ditty I wrote,<br>" "On the front of this here note,<br>" "To see what fun there can be,<br>" "Playing with Elementary.<br>" "<br>" "To swoosh, to flip, within this note,<br>" "Is precisely what the programmer wrote,<br>" "For candy of the eye to be seen,<br>" "Compiled to binaries it must have been."); evas_object_show(label); elm_flip_content_front_set(flip, label); list = elm_list_add(win); elm_list_item_append(list, "Eye of newt,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "And toe of frog,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "Wool of bat,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "And tongue of dog,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "Adder's fork,", NULL, NULL, NULL, NULL); elm_list_go(list); evas_object_show(list); elm_flip_content_back_set(flip, list); button = elm_button_add(win); elm_object_text_set(button, "Flip"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_flip, flip); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win);
  • 32. Getting fancy (in C) #include <Elementary.h> static void on_win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } static void on_flip(void *data, Evas_Object *obj, void *event_info) { Evas_Object *flip = data; elm_flip_go(flip, ELM_FLIP_CUBE_UP); } int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box, *flip, *label, *list, *button; win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Hello Flip"); evas_object_smart_callback_add(win, "delete,request", on_win_del, NULL); bg = elm_bg_add(win); elm_bg_file_set(bg, "plant.jpg", NULL); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); flip = elm_flip_add(win); elm_box_pack_end(box, flip); evas_object_show(flip); label = elm_label_add(win); elm_object_text_set(label, "Hello out there world!<br>" "<br>" "This is a small ditty I wrote,<br>" "On the front of this here note,<br>" "To see what fun there can be,<br>" "Playing with Elementary.<br>" "<br>" "To swoosh, to flip, within this note,<br>" "Is precisely what the programmer wrote,<br>" "For candy of the eye to be seen,<br>" "Compiled to binaries it must have been."); evas_object_show(label); elm_flip_content_front_set(flip, label); list = elm_list_add(win); elm_list_item_append(list, "Eye of newt,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "And toe of frog,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "Wool of bat,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "And tongue of dog,", NULL, NULL, NULL, NULL); elm_list_item_append(list, "Adder's fork,", NULL, NULL, NULL, NULL); elm_list_go(list); evas_object_show(list); elm_flip_content_back_set(flip, list); button = elm_button_add(win); elm_object_text_set(button, "Flip"); elm_box_pack_end(box, button); evas_object_show(button); evas_object_smart_callback_add(button, "clicked", on_flip, flip); elm_win_resize_object_add(win, box); evas_object_show(box); evas_object_show(win); elm_run(); } ELM_MAIN();
  • 33. EVAS
  • 34. What is a scene graph? (Evas) ● Tracks state of all display objects ● Position, size, visibility, color, properties etc. ● Handles rendering of each object ● Loading fonts, images, rendering glyphs, scaling, fading etc. ● Handles minimizing of rendering ● Only update areas changed ● If changes obscured, reduce to a NOP ● Optimize rendering ● Abstract to OpenGL, software, or anything else
  • 35. What is a scene graph? (Evas) ● Allows you to build your own composite objects ● Creates parent/child relationship ● Is used throughout EFL to build widgets etc. ● Handles input direction and event callbacks ● Text formatting & layout
  • 36. What is a scene graph? (Evas) Text Label Text Label Text Label Text Label Text Label Text Label Text Label Text Label Text Label OK
  • 37. Complex objects out of simple ones
  • 38. Complex objects out of simple ones O K
  • 39. Complex objects out of simple ones O K
  • 40. Complex objects out of simple ones O K
  • 41. Complex objects out of simple ones OK
  • 43. Abstracting rendering Hello out there Input device events Canvas state changes Canvas core Image data, fonts etc. Rendering command General Rendering Select rendering engine at runtime Software rendering API OpenGL Rendering API OUTPUT (screen/window) Software core OpenGL core
  • 44. Automated update handling Start here Hello out there
  • 45. Automated update handling Next frame is here Hello out there
  • 46. Automated update handling Calculate actual update region deltas (up to each engine to implement) Hello out there
  • 47. Automated update handling Only draw updated regions (up to each engine to implement) Hello out there
  • 49. Multiple output paths ● Pure software ● Universal (works everywhere) ● MMX, SSE, SSE3, NEON ASM (runtime detected) ● High quality scaling (super-sampling + linear-interpolation) ● Caching of scaled image data on the fly ● Output rotation and down-convert
  • 50. Multiple output paths ● OpenGL/OpenGL-ES2 ● Uses texture atlases where possible ● Defers texture upload and removes duplication where it can ● Multi-pipeline out-of-order rendering optimizing ● Batches up as much geometry as it can for best performance ● Specialized shaders for performance ● Pushes all rendering via GL (not just compositing surfaces) – Text, polygons too ● Tries to remove texture uploads with zero-copy (if possible)
  • 51. Multiple output paths ● X1 (OpenGL, Xlib & XCB) 1 ● Wayland (OpenGL & SHM) ● Raw Framebuffer ● Memory buffers ● PS3 Native ● SDL (OpenGL) ● Windows (32/64/CE) (GDI & DirectDraw) ● … others too
  • 52. Input Data ● Images ● CMP, EDB, EET, GIF (animated + still), ICO, JPEG, PPM/PGM/PBM, PSD, SVG, TGA, TIFF, WBMP, XPM, XCF, PS, PDF, RAW, MOV/AVI/MPG/etc. ● Fonts ● TTF, OpenType (anything Freetype 2 supports) ● Text ● UTF-8 Unicode ● Complex text formatting (LTR, RTL, Composition)
  • 53. EDJE
  • 54. Pre-made objects for designers (Edje) ● Edje allows a designer to store objects in files ● Pre-made layout with rules and reactions to events ● Stored separately to code in binary files for runtime replacement ● Fast & compact random access designed for realtime use ● All layout, image data, etc. etc. all in 1 file (zero-unpacking) ● Intended for designers & developers to work independently ● Supports scalable and resizeable layouts ● Provides the core ability to re-theme and entire UI or OS
  • 55. How it works Application Signal emits Messages Mainloop Signal callbacks Controls Messages Swallows Queries Text etc. Edje Create & control Objects Evas Edje Get event callbacks Layout rules, parameters & states Images & fonts Event reaction rules Edje File
  • 56. collections { An example group { name: "hello"; images { image: "plant.jpg" LOSSY 80; image: "shadow.png" COMP; } parts { part { name: "bg"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: NONE; image.normal: "plant.jpg"; } } part { name: "label"; type: TEXT; scale: true; description { state: "default" 0.0; text { font: "Sans"; size: 20; text: "Hello World!"; } } } part { name: "shadow"; description { state: "default" 0.0; image.normal: "shadow.png"; } } } } }
  • 60. So what is Elementary? ● A widget set built on top of the lower-level EFL layers ● Brings 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 the developer ● Touch friendly design ● Scaling of UI from the get-go ● Also adjusts for input resolution (finger vs mouse etc.)
  • 61. So what is Elementary? ● It can be seamlessly merged with lower level objects ● Programmer can use Elementary containers or hand- arrange widgets and control them ● Since all objects can be stacked and layered, so can elementary widgets ● Widgets can be transformed like any object ● Handles dealing with IME (Virtual keyboard) for you ● Does many other useful things to save you time
  • 62. So what is Elementary? ● All widgets can and will be rendered with Hardware (OpenGL) if that is the engine chosen ● This includes all decorations, text etc. not just compositing ● Elementary helps enforce “finger size” so users can always easily use your application ● Works on both desktop (keyboard & mouse) as well as touchscreen and multi-touch
  • 66. Video & Sound in your world ● Gives you a high level API to include video ● Abstracts to different video decode back-ends ● Optimizes decode via YUV paths or video overlay ● Simple to use
  • 67. Simple Video Evas_Object *vid = emotion_object_add(canvas); emotion_object_init(vid, NULL); emotion_object_file_set(vid, "file.avi"); evas_object_resize(vid, 640, 360); emotion_object_play_set(vid, EINA_TRUE); evas_object_show(vid);
  • 68. How it works Application Mainloop Emotion Media Codec (Gstreamer/Xine/Generic) Evas Emotion Thread Decoder Core thread Thread Thread Media file or stream
  • 69. EET
  • 70. Garbage in, garbage out Application Text file (RAM) Stdout struct Data { group “Data” struct { const char *name; value “name” string: “Bob”; ... ... Eet Eet (Library) (Cmdline) 0100011010101 1 10101 Binary Data (File or buffer)
  • 71. XML/JSON … for C programmers ● Parsing text is painful ● Parsing correctly without bugs, overflows is harder ● Most programmers hate parsing ● XML, JSON etc. optimized for editing, not runtime ● Programs read/write data 1000x more than humans ● So optimize for the common use case, not the uncommon one ● Make it as easy 1-liners for C code to load or save data ● Edje, Enlightenment config, Elementary config built on EET
  • 72. Flexible, portable and robust ● Allows you to store data in a file (key/value pair) ● Random access read optimized ● Data can be any binary, image, string or struct encoded ● Compresses separate keys (like zip) ● Allows you to en/decode structs to buffers (for network) ● Provides a protocol buffer handler for decodes ● Files and data all platform agnostic (portable) ● Structs encoded with nested key & types for robustness
  • 73. Define your data structure typedef struct { const char *name; int age; const char *address; const char *phone; } Data; Eet_Data_Descriptor_Class dc; Eet_Data_Descriptor *d; EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&dc, Data); d = eet_data_descriptor_file_new(&dc); EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "name", name, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "age", age, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "address", address, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(d, Data, "phone", phone, EET_T_STRING);
  • 74. Declare and save it Eet_File *ef; Data data = { .name = "Bob the blob", .age = 7, .address = "7 Blob ave.", .phone = "+82 10 123 4567" }; ef = eet_open("data.eet", EET_FILE_MODE_WRITE); eet_data_write(ef, d, "data", &data, EINA_TRUE); eet_close(ef);
  • 75. Declare and save it Data *data2; ef = eet_open("data.eet", EET_FILE_MODE_READ); data2 = eet_data_read(ef, d, "data"); eet_close(ef);
  • 76. For debugging, decode to text $ eet -d data.eet data group "Data" struct { value "name" string: "Bob the blob"; value "age" int: 7; value "address" string: "7 Blob ave."; value "phone" string: "+82 10 123 4567"; }
  • 77. And encode + compress from text $ cat data.txt group "Data" struct { value "name" string: "Bob the blob"; value "age" int: 7; value "address" string: "7 Blob ave."; value "phone" string: "+82 10 123 4567"; } $ eet -e data.eet data data.txt 1
  • 78. EDBUS EFREET EINA ETHUMB EEZE EMBRYO EIO ...
  • 79. And the saga continues ● More EFL libraries with no time to mention them ● Expanding libs and scope on a daily basis
  • 80. Questions, Answers & Flaming Enlightenment Foundation Libraries http://www.enlightenment.org Carsten Haitzler Enlightenment project lead & founder Principal Engineer raster@rasterman.com c.haitzler@samsung.com