ivi-controller: add argument 'pid' and 'title' to surface event 02/26102/2
authorJanos Kovacs <jankovac503@gmail.com>
Sun, 24 Aug 2014 18:27:36 +0000 (21:27 +0300)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 25 Aug 2014 07:45:17 +0000 (16:45 +0900)
Change-Id: I3400c102f69f2974f483170ca982f21f7c7bd11e
Signed-off-by: Janos Kovacs <jankovac503@gmail.com>
ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
protocol/ivi-application.xml
protocol/ivi-controller.xml
weston-ivi-shell/src/ivi-controller.c

index 41f2555..daeeaf3 100644 (file)
@@ -822,10 +822,16 @@ controller_listener_layer(void *data,
 static void
 controller_listener_surface(void *data,
                             struct ivi_controller *controller,
-                            uint32_t id_surface)
+                            uint32_t id_surface,
+                            int32_t pid,
+                            const char *title)
 {
     struct wayland_context *ctx = data;
     struct surface_context *ctx_surf = NULL;
+    int32_t is_inside = 0;
+
+    (void)pid;
+    (void)title;
 
     ctx_surf = get_surface_context(ctx, id_surface);
     if (ctx_surf != NULL) {
@@ -2434,7 +2440,7 @@ ilm_surfaceAddNotification(t_ilm_surface surface,
     if (ctx_surf == NULL) {
         if (callback != NULL) {
             callback((uint32_t)surface, NULL, ILM_NOTIFICATION_CONTENT_REMOVED);
-            controller_listener_surface(ctx, ctx->wl.controller, (uint32_t)surface);
+            controller_listener_surface(ctx, ctx->wl.controller, (uint32_t)surface, 0, NULL);
             ctx_surf = (struct surface_context*)get_surface_context(
                         &ctx->wl, (uint32_t)surface);
             ctx_surf->is_surface_creation_noticed = false;
index ef9a898..0fd1cc1 100644 (file)
@@ -99,8 +99,8 @@
         <event name="wl_shell_info">
             <arg name="pid" type="int"/>
             <arg name="title" type="string" allow-null="true"/>
+            <arg name="id_surface" type="uint"/>
         </event>
-
     </interface>
 
 </protocol>
index 8e5cb76..630e52b 100644 (file)
                 A new surface is announced to the controller.
             </description>
             <arg name="id_surface" type="uint"/>
+            <arg name="pid" type="int"/>
+            <arg name="title" type="string" allow-null="true"/>
         </event>
 
         <enum name="object_type">
     </interface>
 
 </protocol>
-
index 911e4bd..6898229 100755 (executable)
 #include <cairo.h>
 #include <GLES2/gl2.h>
 
+#include <wayland-server.h>
+
 #include "weston/compositor.h"
+#include "weston/ivi-shell.h"
+#include "weston/ivi-shell-ext.h"
 #include "ivi-controller-server-protocol.h"
 #include "ivi-layout-export.h"
 #include "bitmap.h"
@@ -1620,6 +1624,9 @@ add_client_to_resources(struct ivishell *shell,
     struct wl_resource *resource_output = NULL;
     uint32_t id_layout_surface = 0;
     uint32_t id_layout_layer = 0;
+    struct ivi_layout_surface *layout_surface;
+    int32_t pid;
+    const char *window_title;
 
     wl_list_for_each(iviscrn, &shell->list_screen, link) {
         resource_output = wl_resource_find_for_client(
@@ -1645,11 +1652,14 @@ add_client_to_resources(struct ivishell *shell,
                                   id_layout_layer);
     }
     wl_list_for_each_reverse(ivisurf, &shell->list_surface, link) {
-        id_layout_surface =
-            ivi_layout_getIdOfSurface(ivisurf->layout_surface);
+        layout_surface = ivisurf->layout_surface;
+        id_layout_surface = ivi_layout_getIdOfSurface(layout_surface);
+
+        get_wl_shell_info(layout_surface, id_layout_surface,
+                          &pid, &window_title);
 
         ivi_controller_send_surface(controller->resource,
-                                    id_layout_surface);
+                                    id_layout_surface, pid, window_title);
     }
 }
 
@@ -1746,6 +1756,8 @@ create_surface(struct ivishell *shell,
 {
     struct ivisurface *ivisurf = NULL;
     struct ivicontroller *controller = NULL;
+    int32_t pid;
+    const char *window_title;
 
     ivisurf = get_surface(&shell->list_surface, id_surface);
     if (ivisurf != NULL) {
@@ -1765,9 +1777,11 @@ create_surface(struct ivishell *shell,
     wl_list_init(&ivisurf->link);
     wl_list_insert(&shell->list_surface, &ivisurf->link);
 
+    get_wl_shell_info(layout_surface, id_surface, &pid, &window_title);
+
     wl_list_for_each(controller, &shell->list_controller, link) {
         ivi_controller_send_surface(controller->resource,
-                                    id_surface);
+                                    id_surface, pid, window_title);
     }
 
     ivi_layout_surfaceAddNotification(layout_surface,