<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Stuvart,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">thank you for your question. At the moment it is not possible to use xdg shell protocol applications within ivi-shell. Some time ago I published patches to
 enable xdg shell protocol support to ivi shell. Please find my presentation from the AGL AMM last year covering that topic.  These patches are already used by AGL. Unfortunately they are not mainline in weston and wayland-ivi-extension yet, but I can provide
 you the patch set on my github.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoPlainText"><a href="https://github.com/mtey/wayland-ivi-extension/tree/xdg_support_ivi_id_agent">https://github.com/mtey/wayland-ivi-extension/tree/xdg_support_ivi_id_agent</a><o:p></o:p></p>
<p class="MsoPlainText"><a href="https://github.com/mtey/weston/tree/xdg_support_ivi_id_agent">https://github.com/mtey/weston/tree/xdg_support_ivi_id_agent</a><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">With these patches and by configuring the reference ivi-id-agent implementation correctly (see commit message), you can natively run your xdg protocol application.
 Have fun!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Btw are you aware of this ML:
<a href="mailto:genivi-ivi-layer-management@lists.genivi.org">genivi-ivi-layer-management@lists.genivi.org</a> ? It is the community maintaining the ivi-shell and its features within Genivi.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michael<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Best regards</span><span style="font-size:8.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Michael Teyfel</span></b><span style="font-size:8.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:5.0pt;text-autospace:none"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:blue">A</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">dvanced
</span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:blue">D</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">river
</span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:blue">I</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">nformation
</span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:blue">T</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">echnology GmbH</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Engineering Software Base (ADITG/ESB)</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D">
<br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Robert-Bosch-Str. 200</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">31139 Hildesheim</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Germany</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Tel. +49 5121 49 6932<br>
Fax +49 5121 49 6999<br>
mteyfel@de.adit-jv.com</span><span style="font-size:8.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#1F497D">ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car Multimedia GmbH and DENSO Corporation<br>
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438  <br>
Geschäftsführung: Wilhelm Grabow, Ken Yaguchi</span><o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> wayland-devel [mailto:wayland-devel-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>Stuvart S<br>
<b>Sent:</b> Mittwoch, 21. Februar 2018 05:31<br>
<b>To:</b> wayland-devel@lists.freedesktop.org<br>
<b>Subject:</b> Wrap xdg in IVI shell<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi team,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I wrote a user app which is capable of displaying a surface. It works perfectly on xdg shell ,but when switching to ivi shell it doesn,t. I could know that there are differences in protocols,thats why it happens and there is one way that
 we can wrap xdg in ivi shell.But I am not aware of doing that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Following are the code snipet that works for me in xdg..(tested in raspberry pi )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Does anybody have any clue ? Any help is appreciated.. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks in advance.<o:p></o:p></p>
<div>
<div>
<div style="border:none #EAEAEA 1.0pt;border-bottom:solid #EAEAEA 1.5pt;padding:0cm 0cm 0cm 0cm;margin-left:11.25pt;margin-right:11.25pt;min-width:230px">
<div>
<div>
<div>
<div>
<div>
<p style="margin:0cm;margin-bottom:.0001pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">#include <stdio.h><br>
#include <string.h><br>
<br>
#include <syscall.h><br>
#include <unistd.h><br>
#include <sys/mman.h><br>
<br>
#include <wayland-client.h><br>
#include <wayland-client-core.h><br>
<br>
<br>
struct wl_compositor *compositor;<br>
struct wl_shm *shm;<br>
struct wl_shell *shell;<br>
<br>
void registry_global_handler<br>
(<br>
    void *data,<br>
    struct wl_registry *registry,<br>
    uint32_t name,<br>
    const char *interface,<br>
    uint32_t version<br>
) {<br>
    if (strcmp(interface, "wl_compositor") == 0) {<br>
        compositor = wl_registry_bind(registry, name,<br>
            &wl_compositor_interface, 3);<br>
    } else if (strcmp(interface, "wl_shm") == 0) {<br>
        shm = wl_registry_bind(registry, name,<br>
            &wl_shm_interface, 1);<br>
    } else if (strcmp(interface, "wl_shell") == 0) {<br>
        shell = wl_registry_bind(registry, name,<br>
            &wl_shell_interface, 1);<br>
    }<br>
}<br>
<br>
void registry_global_remove_handler<br>
(<br>
    void *data,<br>
    struct wl_registry *registry,<br>
    uint32_t name<br>
) {}<br>
<br>
const struct wl_registry_listener registry_listener = {<br>
    .global = registry_global_handler,<br>
    .global_remove = registry_global_remove_handler<br>
};<br>
<br>
int main(void)<br>
{<br>
    struct wl_display *display = wl_display_connect(NULL);<br>
    struct wl_registry *registry = wl_display_get_registry(display);<br>
    wl_registry_add_listener(registry, &registry_listener, NULL);<br>
<br>
    // wait for the "initial" set of globals to appear<br>
    wl_display_roundtrip(display);<br>
<br>
    struct wl_surface *surface = wl_compositor_create_surface(compositor);<br>
    struct wl_shell_surface *shell_surface = wl_shell_get_shell_surface(shell, surface);<br>
    wl_shell_surface_set_toplevel(shell_surface);<br>
<br>
    int width = 108;<br>
    int height = 192;<br>
    int stride = width * 4;<br>
    int size = stride * height;  // bytes<br>
<br>
    // open an anonymous file and write some zero bytes to it<br>
    int fd = syscall(SYS_memfd_create, "buffer", 0);<br>
    ftruncate(fd, size);<br>
<br>
    // map it to the memory<br>
    unsigned char *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);<br>
   int temp=0;<br>
   <br>
struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, size);<br>
<br>
    // allocate the buffer in that pool<br>
    struct wl_buffer *buffer = wl_shm_pool_create_buffer(pool,<br>
        0, width, height, stride, WL_SHM_FORMAT_ARGB8888);<br>
<br>
    wl_surface_attach(surface, buffer, 0, 0);<br>
    <br>
  <br>
<br>
while(1){<br>
printf("%d\n",temp);<br>
temp++;<br>
for (int x = 0; x < width; x++) {<br>
    for (int y = 0; y < height; y++) {<br>
<br>
        struct pixel {<br>
            // little-endian ARGB<br>
            unsigned char blue;<br>
            unsigned char green;<br>
            unsigned char red;<br>
            unsigned char alpha;<br>
        } *px = (struct pixel *) (data + y * stride + x * 4);<br>
<br>
        // yellow<br>
        px->alpha = 255;<br>
                  if(temp >100)<br>
    {<br>
     px->red = 100;<br>
        px->green = 0;<br>
         px->blue = 0;<br>
    <br>
    }<br>
    else <br>
    {<br>
        <br>
        px->red = 0;<br>
        px->green = 100;<br>
        px->blue = 0;<br>
        //if(y==(height/2))<br>
        //break;<br>
        }<br>
    }<br>
}<br>
<br>
      <br>
usleep(50*1000);<br>
    // turn it into a shared memory pool<br>
 wl_surface_commit(surface);    <br>
     wl_display_flush(display);<br>
/* wl_display_destroy(display);*/<br>
  <br>
<br>
<br>
    }<br>
}<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Cheers,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Stuvart<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>