shell: add interface for get app_id 21/56721/1 accepted/tizen/common/20160302.193415 accepted/tizen/ivi/20160218.024442 accepted/tizen/ivi/20160302.003354 accepted/tizen/mobile/20160112.224507 accepted/tizen/mobile/20160302.003303 accepted/tizen/tv/20160112.224520 accepted/tizen/tv/20160302.003320 accepted/tizen/wearable/20160112.224538 accepted/tizen/wearable/20160302.003333 submit/tizen/20160112.104930 submit/tizen/20160229.101954 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000004
authorSangjin Lee <lsj119@samsung.com>
Tue, 12 Jan 2016 09:03:11 +0000 (18:03 +0900)
committerSangjin Lee <lsj119@samsung.com>
Tue, 12 Jan 2016 09:03:11 +0000 (18:03 +0900)
Change-Id: Ifea7b39f6fc7737edf3854855b88973d17b5f666

src/lib/Pepper_Efl.h
src/lib/object.c
src/lib/shell.c
src/lib/shell.h

index feca9edb6e4ea3350af699f50a64df348dc8552b..51ccb360eee4cc54ae77d8dcb8708c2f056afb7a 100644 (file)
@@ -53,4 +53,13 @@ pid_t       pepper_efl_object_pid_get(Evas_Object *obj);
  */
 const char *pepper_efl_object_title_get(Evas_Object *obj);
 
+/**
+ * @brief Get app_id of the client
+ * @since_tizen 3.0
+ * @param[in] obj Evas object which is returned from libpepper-efl
+ * @return app_id on success, @c NULL otherwise
+ *             title should NOT be freed after use.
+ */
+const char *pepper_efl_object_app_id_get(Evas_Object *obj);
+
 #endif
index e01b57b80e31e1d8c9e05b90d60c6558b399d226..afd3f7c810e009f8b84454f9d8d76cbb2eec5508 100644 (file)
@@ -597,3 +597,29 @@ pepper_efl_object_title_get(Evas_Object *obj)
    return title;
 }
 
+const char *
+pepper_efl_object_app_id_get(Evas_Object *obj)
+{
+   OBJ_DATA_GET NULL;
+
+   pepper_efl_shell_surface_t *shsurf = NULL;
+   pepper_surface_t *surface = NULL;
+   const char *app_id = NULL;
+
+   surface = po->surface;
+
+   if (surface)
+     {
+        shsurf = pepper_object_get_user_data((pepper_object_t *)surface,
+                                             pepper_surface_get_role(surface));
+
+        if (shsurf)
+          app_id = shsurf->app_id;
+     }
+
+   if (app_id)
+     DBG("[OBJECT] App_id Get : %s", app_id);
+
+   return app_id;
+}
+
index b28301a1d6eead59ea330fe76b78f17bbefcade9..ed520471e49a4742660162492faeb7094182e428 100644 (file)
@@ -113,7 +113,12 @@ xdg_surface_set_title(struct wl_client *client, struct wl_resource *resource, co
 static void
 xdg_surface_set_app_id(struct wl_client *client, struct wl_resource *resource, const char *app_id)
 {
+   pepper_efl_shell_surface_t *shsurf = wl_resource_get_user_data(resource);
    DBG("client %p", client);
+
+   if (shsurf->app_id)
+     eina_stringshare_del(shsurf->app_id);
+   shsurf->app_id = eina_stringshare_add(app_id);
 }
 
 static void
index 255c9164ceacd59a421f7460aad53672d549485a..3ca2fa077e54bbc7e8a480519c5433bf479fd669 100644 (file)
@@ -37,6 +37,7 @@ struct pepper_efl_shell_surface
    Eina_Bool ack_configure;
 
    const char *title;
+   const char *app_id;
 };
 
 Eina_Bool   pepper_efl_shell_init(pepper_efl_comp_t *comp);