add function pointer to call qp module function 93/100693/5
authorMinsu Seo <minsu15.seo@samsung.com>
Tue, 29 Nov 2016 03:03:51 +0000 (12:03 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 2 Dec 2016 07:12:28 +0000 (23:12 -0800)
Change-Id: Ie019123331272df13dfaff94efe07e49da052f50

src/bin/e_config.c [changed mode: 0644->0755]
src/bin/e_config.h [changed mode: 0644->0755]
src/bin/e_policy.h [changed mode: 0644->0755]
src/bin/e_policy_wl.c [changed mode: 0644->0755]
src/bin/e_policy_wl.h [changed mode: 0644->0755]
src/bin/services/e_service_quickpanel.c [changed mode: 0644->0755]
src/bin/services/e_service_quickpanel.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 24392b7..e684c12
@@ -265,6 +265,7 @@ _e_config_edd_init(Eina_Bool old)
    E_CONFIG_VAL(D, T, use_buffer_flush, UCHAR);
    E_CONFIG_LIST(D, T, sock_accesses, _e_config_socket_access_edd);
    E_CONFIG_LIST(D, T, aux_hint_supported, _e_config_aux_hint_supported_edd);
+   E_CONFIG_VAL(D, T, use_module_srv.qp, UCHAR);
 }
 
 /* externally accessible functions */
@@ -452,6 +453,7 @@ e_config_load(void)
    E_CONFIG_LIMIT(e_config->comp_canvas_bg.opmode, 0, 11);
    E_CONFIG_LIMIT(e_config->delayed_load_idle_count, 0, 100);
    E_CONFIG_LIMIT(e_config->use_buffer_flush, 0, 1);
+   E_CONFIG_LIMIT(e_config->use_module_srv.qp, 0, 1);
 }
 
 E_API int
old mode 100644 (file)
new mode 100755 (executable)
index d2bccdd..52c49f4
@@ -159,6 +159,10 @@ struct _E_Config
    Eina_Bool use_buffer_flush;
    Eina_List *sock_accesses;
    Eina_List *aux_hint_supported;
+   struct
+   {
+      Eina_Bool qp; /* quickpanel */
+   } use_module_srv;
 };
 
 struct _E_Config_Desklock_Background
old mode 100644 (file)
new mode 100755 (executable)
index b337b3c..2ebf5a4
@@ -118,7 +118,7 @@ EINTERN Eina_Bool        e_policy_client_is_volume(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_volume_tv(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_noti(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_floating(E_Client *ec);
-EINTERN Eina_Bool        e_policy_client_is_cursor(E_Client *ec);
+E_API   Eina_Bool        e_policy_client_is_cursor(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_subsurface(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_cbhm(E_Client *ec);
 EINTERN Eina_Bool        e_policy_client_is_splited(E_Client *ec);
old mode 100644 (file)
new mode 100755 (executable)
index 7ec4608..17918f5
@@ -3837,7 +3837,7 @@ _e_tzsh_qp_state_change_send(struct wl_resource *res_tzsh_client, int type, int
    wl_array_release(&states);
 }
 
-EINTERN void
+E_API void
 e_tzsh_qp_state_visible_update(E_Client *ec, Eina_Bool vis)
 {
    E_Policy_Wl_Tzsh_Client *tzsh_client;
@@ -3873,7 +3873,7 @@ e_tzsh_qp_state_visible_update(E_Client *ec, Eina_Bool vis)
      }
 }
 
-EINTERN void
+E_API void
 e_tzsh_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable)
 {
    E_Policy_Wl_Tzsh_Client *tzsh_client;
@@ -3909,7 +3909,7 @@ e_tzsh_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable)
      }
 }
 
-EINTERN void
+E_API void
 e_tzsh_qp_state_orientation_update(E_Client *ec, int ridx)
 {
    E_Policy_Wl_Tzsh_Client *tzsh_client;
old mode 100644 (file)
new mode 100755 (executable)
index 74bfc40..9e7b2b7
@@ -36,9 +36,9 @@ void      e_policy_wl_eval_pre_post_fetch(E_Client *ec);
 Eina_Bool e_policy_wl_win_brightness_apply(E_Client *ec);
 
 /* tzsh quickpanel */
-EINTERN void e_tzsh_qp_state_visible_update(E_Client *ec, Eina_Bool vis);
-EINTERN void e_tzsh_qp_state_orientation_update(E_Client *ec, int ridx);
-EINTERN void e_tzsh_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable);
+E_API void e_tzsh_qp_state_visible_update(E_Client *ec, Eina_Bool vis);
+E_API void e_tzsh_qp_state_orientation_update(E_Client *ec, int ridx);
+E_API void e_tzsh_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable);
 
 /* tzsh indicator */
 EINTERN void e_tzsh_indicator_srv_property_update(E_Client *ec);
old mode 100644 (file)
new mode 100755 (executable)
index 93ae106..d51065e
@@ -117,6 +117,7 @@ struct _E_QP_Client
 static E_Policy_Quickpanel *_pol_quickpanel = NULL;
 static Evas_Smart *_mover_smart = NULL;
 static Eina_Bool _changed = EINA_FALSE;
+static E_QP_Mgr_Funcs *qp_mgr_funcs = NULL;
 
 static void          _e_qp_srv_effect_update(E_Policy_Quickpanel *qp, int x, int y);
 static E_QP_Client * _e_qp_client_ec_get(E_Client *ec);
@@ -1422,6 +1423,12 @@ _e_qp_client_scrollable_update(void)
 EINTERN void
 e_service_quickpanel_client_set(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_client_set)
+     {
+        qp_mgr_funcs->quickpanel_client_set(ec);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
 
    if (EINA_UNLIKELY(!ec))
@@ -1502,6 +1509,12 @@ e_service_quickpanel_client_set(E_Client *ec)
 EINTERN void
 e_service_quickpanel_effect_type_set(E_Client *ec, E_Service_Quickpanel_Effect_Type type)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_effect_type_set)
+     {
+        qp_mgr_funcs->quickpanel_effect_type_set(ec, type);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
 
    qp = _quickpanel_get();
@@ -1547,6 +1560,9 @@ e_service_quickpanel_effect_type_set(E_Client *ec, E_Service_Quickpanel_Effect_T
 EINTERN E_Client *
 e_service_quickpanel_client_get(void)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_client_get)
+      return qp_mgr_funcs->quickpanel_client_get();
+
    EINA_SAFETY_ON_NULL_RETURN_VAL(_pol_quickpanel, NULL);
 
    return _pol_quickpanel->ec;
@@ -1555,6 +1571,9 @@ e_service_quickpanel_client_get(void)
 EINTERN Eina_Bool
 e_service_quickpanel_region_set(int type, int angle, Eina_Tiler *tiler)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_region_set)
+      return qp_mgr_funcs->quickpanel_region_set(type, angle, tiler);
+
    E_Policy_Quickpanel *qp;
    E_Policy_Angle_Map ridx;
 
@@ -1581,6 +1600,12 @@ e_service_quickpanel_region_set(int type, int angle, Eina_Tiler *tiler)
 EINTERN void
 e_service_quickpanel_show(void)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_show)
+     {
+        qp_mgr_funcs->quickpanel_show();
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
 
    qp = _quickpanel_get();
@@ -1594,6 +1619,12 @@ e_service_quickpanel_show(void)
 EINTERN void
 e_service_quickpanel_hide(void)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_hide)
+     {
+        qp_mgr_funcs->quickpanel_hide();
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
 
    qp = _quickpanel_get();
@@ -1607,6 +1638,9 @@ e_service_quickpanel_hide(void)
 EINTERN Eina_Bool
 e_qp_visible_get(void)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_visible_get)
+      return qp_mgr_funcs->qp_visible_get();
+
    E_Policy_Quickpanel *qp;
    E_Client *ec;
    Eina_Bool vis = EINA_FALSE;
@@ -1629,6 +1663,9 @@ e_qp_visible_get(void)
 EINTERN int
 e_qp_orientation_get(void)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_orientation_get)
+      return qp_mgr_funcs->qp_orientation_get();
+
    E_Policy_Quickpanel *qp;
 
    qp = _quickpanel_get();
@@ -1642,6 +1679,12 @@ e_qp_orientation_get(void)
 EINTERN void
 e_qp_client_add(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_add)
+     {
+        qp_mgr_funcs->qp_client_add(ec);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1671,6 +1714,12 @@ e_qp_client_add(E_Client *ec)
 EINTERN void
 e_qp_client_del(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_del)
+     {
+        qp_mgr_funcs->qp_client_del(ec);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1692,6 +1741,12 @@ e_qp_client_del(E_Client *ec)
 EINTERN void
 e_qp_client_show(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_show)
+     {
+        qp_mgr_funcs->qp_client_show(ec);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1710,6 +1765,12 @@ e_qp_client_show(E_Client *ec)
 EINTERN void
 e_qp_client_hide(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_hide)
+     {
+        qp_mgr_funcs->qp_client_hide(ec);
+        return;
+     }
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1728,6 +1789,9 @@ e_qp_client_hide(E_Client *ec)
 EINTERN Eina_Bool
 e_qp_client_scrollable_set(E_Client *ec, Eina_Bool set)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_scrollable_set)
+      return qp_mgr_funcs->qp_client_scrollable_set(ec, set);
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1750,6 +1814,9 @@ e_qp_client_scrollable_set(E_Client *ec, Eina_Bool set)
 EINTERN Eina_Bool
 e_qp_client_scrollable_get(E_Client *ec)
 {
+   if (qp_mgr_funcs && qp_mgr_funcs->qp_client_scrollable_get)
+      return qp_mgr_funcs->qp_client_scrollable_get(ec);
+
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
 
@@ -1763,3 +1830,51 @@ e_qp_client_scrollable_get(E_Client *ec)
 
    return qp_client->hint.scrollable;
 }
+
+E_API Eina_Bool
+e_service_quickpanel_module_func_set(void *qp_fp)
+{
+   E_QP_Mgr_Funcs* qp_mgr_fp = qp_fp;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(!e_config->use_module_srv.qp, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(!qp_mgr_funcs, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(qp_mgr_fp, EINA_FALSE);
+
+   qp_mgr_funcs = E_NEW(E_QP_Mgr_Funcs, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(qp_mgr_funcs, EINA_FALSE);
+
+   qp_mgr_funcs->quickpanel_client_set = qp_mgr_fp->quickpanel_client_set;
+   qp_mgr_funcs->quickpanel_client_get = qp_mgr_fp->quickpanel_client_get;
+   qp_mgr_funcs->quickpanel_show = qp_mgr_fp->quickpanel_show;
+   qp_mgr_funcs->quickpanel_hide = qp_mgr_fp->quickpanel_hide;
+   qp_mgr_funcs->quickpanel_region_set = qp_mgr_fp->quickpanel_region_set;
+   qp_mgr_funcs->quickpanel_handler_object_add = qp_mgr_fp->quickpanel_handler_object_add;
+   qp_mgr_funcs->quickpanel_handler_object_del = qp_mgr_fp->quickpanel_handler_object_del;
+   qp_mgr_funcs->quickpanel_effect_type_set = qp_mgr_fp->quickpanel_effect_type_set;
+
+   qp_mgr_funcs->qp_visible_get = qp_mgr_fp->qp_visible_get;
+   qp_mgr_funcs->qp_orientation_get = qp_mgr_fp->qp_orientation_get;
+
+   qp_mgr_funcs->qp_client_add = qp_mgr_fp->qp_client_add;
+   qp_mgr_funcs->qp_client_del = qp_mgr_fp->qp_client_del;
+   qp_mgr_funcs->qp_client_show = qp_mgr_fp->qp_client_show;
+   qp_mgr_funcs->qp_client_hide = qp_mgr_fp->qp_client_hide;
+   qp_mgr_funcs->qp_client_scrollable_set = qp_mgr_fp->qp_client_scrollable_set;
+   qp_mgr_funcs->qp_client_scrollable_get = qp_mgr_fp->qp_client_scrollable_get;
+
+   return EINA_TRUE;
+}
+
+E_API Eina_Bool
+e_service_quickpanel_module_func_unset(void *qp_fp)
+{
+   E_QP_Mgr_Funcs* qp_mgr_fp = qp_fp;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(!e_config->use_module_srv.qp, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(!qp_mgr_fp, EINA_FALSE);
+
+   if (qp_mgr_fp != qp_mgr_funcs) return EINA_FALSE;
+   free (qp_mgr_funcs);
+   qp_mgr_funcs = NULL;
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index a5e403f..1954aee
@@ -4,6 +4,8 @@
 #include "e_policy_private_data.h"
 #include <tzsh_server.h>
 
+typedef struct _E_QP_Mgr_Funcs       E_QP_Mgr_Funcs;
+
 typedef enum
 {
    E_SERVICE_QUICKPANEL_EFFECT_TYPE_SWIPE = TZSH_QUICKPANEL_SERVICE_EFFECT_TYPE_SWIPE,
@@ -11,6 +13,31 @@ typedef enum
    E_SERVICE_QUICKPANEL_EFFECT_TYPE_APP_CUSTOM = TZSH_QUICKPANEL_SERVICE_EFFECT_TYPE_APP_CUSTOM,
 } E_Service_Quickpanel_Effect_Type;
 
+struct _E_QP_Mgr_Funcs
+{
+   void          (*quickpanel_client_set)(E_Client *ec);
+   E_Client*     (*quickpanel_client_get)(void);
+   void          (*quickpanel_show)(void);
+   void          (*quickpanel_hide)(void);
+   Eina_Bool     (*quickpanel_region_set)(int type, int angle, Eina_Tiler *tiler);
+   Evas_Object*  (*quickpanel_handler_object_add)(E_Client *ec, int x, int y, int w, int h);
+   void          (*quickpanel_handler_object_del)(Evas_Object *handler);
+   void          (*quickpanel_effect_type_set)(E_Client *ec, E_Service_Quickpanel_Effect_Type type);
+
+   Eina_Bool    (*qp_visible_get)(void);
+   int          (*qp_orientation_get)(void);
+
+   void         (*qp_client_add)(E_Client *ec);
+   void         (*qp_client_del)(E_Client *ec);
+   void         (*qp_client_show)(E_Client *ec);
+   void         (*qp_client_hide)(E_Client *ec);
+   Eina_Bool    (*qp_client_scrollable_set)(E_Client *ec, Eina_Bool set);
+   Eina_Bool    (*qp_client_scrollable_get)(E_Client *ec);
+};
+
+E_API Eina_Bool       e_service_quickpanel_module_func_set(void *qp_fp);
+E_API Eina_Bool       e_service_quickpanel_module_func_unset(void *qp_fp);
+
 EINTERN void          e_service_quickpanel_client_set(E_Client *ec);
 EINTERN E_Client     *e_service_quickpanel_client_get(void);
 EINTERN void          e_service_quickpanel_show(void);