e_qp_client_add(ec, type);
}
+static void
+_tzsh_qp_iface_cb_scroll_state_set(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzsh_qp, int32_t state)
+{
+ E_Policy_Wl_Tzsh_Client *tzsh_client;
+ E_Client *ec;
+
+ ELOGF("TZ_QUICKPANEL", "Request to Set scroll state to %d", NULL, state);
+
+ tzsh_client = wl_resource_get_user_data(res_tzsh_qp);
+ EINA_SAFETY_ON_NULL_RETURN(tzsh_client);
+ EINA_SAFETY_ON_NULL_RETURN(tzsh_client->tzsh);
+ EINA_SAFETY_ON_NULL_RETURN(tzsh_client->tzsh->ec);
+
+ /* unexpected case: this client doesn't have specific quickpanel type */
+ EINA_SAFETY_ON_TRUE_RETURN(tzsh_client->qp_type == E_QUICKPANEL_TYPE_UNKNOWN);
+
+ ec = tzsh_client->tzsh->ec;
+ if (!eina_list_data_find(polwl->tzsh_clients, tzsh_client))
+ return;
+
+ if (state == TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_UNSET)
+ e_qp_client_scroll_state_set(ec, tzsh_client->qp_type, E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET);
+ else if (state == TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_SET)
+ e_qp_client_scroll_state_set(ec, tzsh_client->qp_type, E_QUICKPANEL_CLIENT_SCROLL_STATE_SET);
+ else if (state == TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_FOLLOW)
+ e_qp_client_scroll_state_set(ec, tzsh_client->qp_type, E_QUICKPANEL_CLIENT_SCROLL_STATE_FOLLOW);
+
+}
+
static const struct tws_quickpanel_interface _tzsh_qp_iface =
{
_tzsh_qp_iface_cb_release,
_tzsh_qp_iface_cb_enable,
_tzsh_qp_iface_cb_disable,
_tzsh_qp_iface_cb_state_get,
- _tzsh_qp_iface_cb_type_set
+ _tzsh_qp_iface_cb_type_set,
+ _tzsh_qp_iface_cb_scroll_state_set
};
static void
struct
{
Eina_Bool vis;
- Eina_Bool scrollable;
+ int scrollable;
} hint;
};
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, E_Quickpanel_Type type);
static Eina_Bool _e_qp_client_scrollable_update(E_Policy_Quickpanel *qp);
+static Eina_Bool _e_qp_client_scroll_state_set(E_Client *ec, E_Quickpanel_Type type, int state);
+static int _e_qp_client_scroll_state_get(E_Client *ec, E_Quickpanel_Type type);
static void _quickpanel_client_evas_cb_show(void *data, Evas *evas, Evas_Object *obj, void *event);
static void _quickpanel_client_evas_cb_hide(void *data, Evas *evas, Evas_Object *obj, void *event);
_e_qp_srv_effect_stop(qp);
}
+static Eina_Bool
+_e_qp_check_scrollable(E_Policy_Quickpanel *qp)
+{
+ E_Client *ec = NULL;
+ E_QP_Client *qp_client = NULL;
+ Eina_Bool scrollable = EINA_TRUE;
+ int x, y, w, h;
+ int zx = 0, zy = 0, zw = 0, zh = 0;
+
+ if (!qp) return EINA_FALSE;
+ if (!qp->ec) return EINA_FALSE;
+
+ e_zone_useful_geometry_get(qp->ec->zone, &zx, &zy, &zw, &zh);
+
+ for (ec = e_client_below_get(qp->ec); ec; ec = e_client_below_get(ec))
+ {
+ if (!ec->visible) continue;
+ if (_quickpanel_check_skip_client(ec)) continue;
+ e_client_geometry_get(ec, &x, &y, &w, &h);
+ if (!E_INTERSECTS(x, y, w, h, zx, zy, zw, zh)) continue;
+
+ qp_client = _e_qp_client_ec_get(ec, (E_Quickpanel_Type)qp->type);
+ if (!qp_client) continue;
+ if (qp_client->hint.scrollable == E_QUICKPANEL_CLIENT_SCROLL_STATE_FOLLOW)
+ continue;
+
+ if (qp_client->hint.scrollable == E_QUICKPANEL_CLIENT_SCROLL_STATE_SET)
+ scrollable = EINA_TRUE;
+ else
+ {
+ ELOGF("QUICKPANEL", "Scroll locked by owner client (ec:%p, win:%x)", qp->below, ec, e_client_util_win_get(ec));
+ scrollable = EINA_FALSE;
+ }
+ break;
+ }
+
+ return scrollable;
+}
+
static void
_region_obj_cb_gesture_start(void *data, Evas_Object *handler, int nfingers, int x, int y, unsigned int timestamp)
{
int indi_x, indi_y, indi_w, indi_h;
const int sensitivity = 50;
Eina_Bool res;
+ Eina_Bool scrollable = EINA_TRUE;
ELOGF("QUICKPANEL", "Start gesture for quickpanel", NULL);
* to show and scroll the quickpanel window.
*/
qp_client = _e_qp_client_ec_get(qp->below, (E_Quickpanel_Type)qp->type);
- if ((qp_client) && (!qp_client->hint.scrollable))
+ if (qp_client)
{
- ELOGF("QUICKPANEL", "Scroll locked by current client", qp->below);
- return;
+ if (qp_client->hint.scrollable == E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET)
+ {
+ ELOGF("QUICKPANEL", "Scroll locked by current client", qp->below);
+ return;
+ }
+ else if (qp_client->hint.scrollable == E_QUICKPANEL_CLIENT_SCROLL_STATE_FOLLOW)
+ {
+ ELOGF("QUICKPANEL", "Scroll follow by previous client", qp->below);
+ scrollable = _e_qp_check_scrollable(qp);
+ if (!scrollable) return;
+ }
}
res = _e_qp_srv_is_effect_running(qp);
EINTERN Eina_Bool
e_qp_client_scrollable_set(E_Client *ec, E_Quickpanel_Type type, Eina_Bool set)
{
- E_Policy_Quickpanel *qp;
- E_QP_Client *qp_client;
+ /*
+ USE e_qp_client_scroll_state_set() function instead of this function.
+ This will be DEPRECATED.
+ */
+ Eina_Bool ret;
ELOGF("QUICKPANEL", "Request to Set scrollable state of Quickpanel (type:%d) to %d", ec, type, set);
BACKEND_FUNC_CALL_RET(qp_client_scrollable_set, ec, type, set);
+ if (set)
+ ret = _e_qp_client_scroll_state_set(ec, type, E_QUICKPANEL_CLIENT_SCROLL_STATE_SET);
+ else
+ ret = _e_qp_client_scroll_state_set(ec, type, E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET);
+
+ return ret;
+}
+
+EINTERN Eina_Bool
+e_qp_client_scrollable_get(E_Client *ec, E_Quickpanel_Type type)
+{
+ /*
+ USE e_qp_client_scroll_state_get() function instead of this function.
+ This will be DEPRECATED.
+ */
+ int scroll_state;
+
+ BACKEND_FUNC_CALL_RET(qp_client_scrollable_get, ec, type);
+
+ scroll_state = _e_qp_client_scroll_state_get(ec, type);
+ if (scroll_state == E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET)
+ return EINA_FALSE;
+ else
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_e_qp_client_scroll_state_set(E_Client *ec, E_Quickpanel_Type type, int state)
+{
+ E_Policy_Quickpanel *qp;
+ E_QP_Client *qp_client;
+
qp_client = _e_qp_client_ec_get(ec, type);
EINA_SAFETY_ON_NULL_RETURN_VAL(qp_client, EINA_FALSE);
- if (qp_client->hint.scrollable != set)
- qp_client->hint.scrollable = set;
+ if (qp_client->hint.scrollable != state)
+ qp_client->hint.scrollable = state;
qp = _quickpanel_get_with_client_type(qp_client);
EINA_SAFETY_ON_NULL_RETURN_VAL(qp, EINA_FALSE);
return EINA_TRUE;
}
+static int
+_e_qp_client_scroll_state_get(E_Client *ec, E_Quickpanel_Type type)
+{
+ E_QP_Client *qp_client;
+
+ qp_client = _e_qp_client_ec_get(ec, type);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(qp_client, E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET);
+
+ return qp_client->hint.scrollable;
+}
+
EINTERN Eina_Bool
-e_qp_client_scrollable_get(E_Client *ec, E_Quickpanel_Type type)
+e_qp_client_scroll_state_set(E_Client *ec, E_Quickpanel_Type type, int state)
+{
+ ELOGF("QUICKPANEL", "Request to Set scroll state of Quickpanel(type:%d) to %d", ec, type, state);
+ BACKEND_FUNC_CALL_RET(qp_client_scroll_state_set, ec, type, state);
+
+ return _e_qp_client_scroll_state_set(ec, type, state);
+}
+
+EINTERN int
+e_qp_client_scroll_state_get(E_Client *ec, E_Quickpanel_Type type)
{
E_QP_Client *qp_client;
- BACKEND_FUNC_CALL_RET(qp_client_scrollable_get, ec, type);
+ BACKEND_FUNC_CALL_RET(qp_client_scroll_state_get, ec, type);
qp_client = _e_qp_client_ec_get(ec, type);
EINA_SAFETY_ON_NULL_RETURN_VAL(qp_client, EINA_FALSE);
qp_mgr_funcs->qp_client_hide = fp->qp_client_hide;
qp_mgr_funcs->qp_client_scrollable_set = fp->qp_client_scrollable_set;
qp_mgr_funcs->qp_client_scrollable_get = fp->qp_client_scrollable_get;
-
+ qp_mgr_funcs->qp_client_scroll_state_set = fp->qp_client_scroll_state_set;
+ qp_mgr_funcs->qp_client_scroll_state_get = fp->qp_client_scroll_state_get;
return EINA_TRUE;
}
E_SERVICE_QUICKPANEL_EFFECT_TYPE_APP_CUSTOM = TZSH_QUICKPANEL_SERVICE_EFFECT_TYPE_APP_CUSTOM,
} E_Service_Quickpanel_Effect_Type;
+typedef enum
+{
+ E_QUICKPANEL_CLIENT_SCROLL_STATE_UNSET = 0, /* TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_UNSET */
+ E_QUICKPANEL_CLIENT_SCROLL_STATE_SET = 1, /* TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_SET */
+ E_QUICKPANEL_CLIENT_SCROLL_STATE_FOLLOW = 2, /* TWS_QUICKPANEL_STATE_VALUE_SCROLLABLE_FOLLOW */
+} E_Quickpanel_Client_Scroll_State;
+
struct _E_QP_Mgr_Funcs
{
void (*quickpanel_client_add)(E_Client *ec, E_Service_Quickpanel_Type type);
void (*qp_client_hide)(E_Client *ec, E_Quickpanel_Type type);
Eina_Bool (*qp_client_scrollable_set)(E_Client *ec, E_Quickpanel_Type type, Eina_Bool set);
Eina_Bool (*qp_client_scrollable_get)(E_Client *ec, E_Quickpanel_Type type);
+ Eina_Bool (*qp_client_scroll_state_set)(E_Client *ec, E_Quickpanel_Type type, int state);
+ int (*qp_client_scroll_state_get)(E_Client *ec, E_Quickpanel_Type type);
};
E_API Eina_Bool e_service_quickpanel_module_func_set(E_QP_Mgr_Funcs *fp);
EINTERN void e_qp_client_hide(E_Client *ec, E_Quickpanel_Type type);
EINTERN Eina_Bool e_qp_client_scrollable_set(E_Client *ec, E_Quickpanel_Type type, Eina_Bool set);
EINTERN Eina_Bool e_qp_client_scrollable_get(E_Client *ec, E_Quickpanel_Type type);
+EINTERN Eina_Bool e_qp_client_scroll_state_set(E_Client *ec, E_Quickpanel_Type type, int state);
+EINTERN int e_qp_client_scroll_state_get(E_Client *ec, E_Quickpanel_Type type);
#endif