Move the indicator impelementation to this e_tizen_ws_shell_indicator.c file.
Change-Id: I8e074437a1e96d26e4ad0b8466964ab89ad05d81
src/bin/server/e_tizen_display_policy.c \
src/bin/server/e_tizen_ws_shell_manager.c \
src/bin/server/e_tizen_ws_shell_srv_cbhm.c \
+src/bin/server/e_tizen_ws_shell_srv_indicator.c \
src/bin/server/e_tizen_indicator.c \
src/bin/server/e_tizen_clipboard.c \
src/bin/server/e_surface_view.c \
'server/e_tizen_display_policy.c',
'server/e_tizen_ws_shell_manager.c',
'server/e_tizen_ws_shell_srv_cbhm.c',
+ 'server/e_tizen_ws_shell_srv_indicator.c',
'server/e_tizen_indicator.c',
'server/e_tizen_clipboard.c',
'server/e_surface_view.c',
#include "e_tizen_indicator_intern.h"
#include "e_client_intern.h"
#include "e_policy_intern.h"
-#include "e_tizen_ws_shell_manager_intern.h"
+#include "e_tizen_ws_shell_srv_indicator_intern.h"
#include "e_comp_wl_intern.h"
#include <tizen-extension-server-protocol.h>
if (ec->indicator.opacity_mode == op_mode) return;
ec->indicator.opacity_mode = op_mode;
- e_tizen_ws_shell_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
+ e_tizen_ws_shell_srv_indicator_property_change_send(ec, ec->e.state.rot.ang.curr);
}
static void
#include "e_tizen_ws_shell_manager_intern.h"
#include "services/e_service_quickpanel_intern.h"
#include "services/e_service_volume_intern.h"
-#include "services/e_service_indicator_intern.h"
#include "services/e_service_scrsaver_intern.h"
#include "services/e_service_launcher_intern.h"
#include "services/e_service_taskbar_intern.h"
#include "e_privilege_intern.h"
#include "e_magnifier_intern.h"
#include "e_screensaver_intern.h"
-#include "e_comp_wl_subsurface_intern.h"
#include "e_config_intern.h"
#include "e_tizen_ws_shell_srv_cbhm_intern.h"
+#include "e_tizen_ws_shell_srv_indicator_intern.h"
#include <tzsh_server.h>
static E_Tizen_Ws_Shell_Manager *g_tizen_ws_shell_mgr = NULL;
static struct wl_resource *_scrsaver_mng_res = NULL; // TODO
-static struct wl_resource *_indicator_srv_res = NULL;
static Eina_List *handlers = NULL;
}
}
-static void
-_tzsh_srv_indicator_cb_resource_destroy(struct wl_resource *resource)
-{
- if (_indicator_srv_res == resource)
- _indicator_srv_res = NULL;
-}
-
-static void
-_tzsh_srv_indicator_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
-{
- _indicator_srv_res = NULL;
- wl_resource_destroy(resource);
-}
-
-static const struct tws_service_indicator_interface _tzsh_srv_indicator_iface =
-{
- _tzsh_srv_indicator_cb_destroy,
-};
-
static void
_tzsh_srv_iface_cb_indicator_get(struct wl_client *client, struct wl_resource *res_tzsh_srv, uint32_t id)
{
E_Tizen_Ws_Shell_Srv *tzsh_srv;
- struct wl_resource *res;
tzsh_srv = wl_resource_get_user_data(res_tzsh_srv);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
if (!eina_list_data_find(g_tizen_ws_shell_mgr->tzsh_srvs, tzsh_srv))
return;
- res = wl_resource_create(client, &tws_service_indicator_interface, 1, id);
- if (!res)
+ if (tzsh_srv->role != TZSH_SRV_ROLE_INDICATOR)
{
- wl_client_post_no_memory(client);
+ ERR("Could not find indicator service");
+ tizen_ws_shell_send_error(res_tzsh_srv,
+ TIZEN_WS_SHELL_ERROR_NO_SERVICE);
return;
}
- _indicator_srv_res = res;
- wl_resource_set_implementation(res, &_tzsh_srv_indicator_iface, tzsh_srv,
- _tzsh_srv_indicator_cb_resource_destroy);
+ tzsh_srv->client = client;
+ tzsh_srv->id = id;
+
+ if (!e_tizen_ws_shell_srv_indicator_init(tzsh_srv))
+ {
+ ERR("e_tizen_ws_shell_srv_indicator_init() failed.");
+ tizen_ws_shell_send_error(res_tzsh_srv,
+ TIZEN_WS_SHELL_ERROR_NOT_SUPPORTED);
+ return;
+ }
}
static void
E_FREE(tzsh_reg);
}
-// --------------------------------------------------------
-// tizen_ws_shell_interface::indicator
-// --------------------------------------------------------
-static E_Client *
-_e_tizen_ws_shell_indicator_find_topvisible_client(E_Zone *zone)
-{
- E_Client *ec;
- Evas_Object *o;
- int ex, ey, ew, eh;
-
- o = evas_object_top_get(e_comp_evas_get());
- for (; o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
-
- /* check e_client and skip e_clients not intersects with zone */
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (!e_zone_has_ec(zone, ec)) continue;
- if (!e_client_view_get(ec)) continue;
-
- if (!ec->visible) continue;
- if (ec->visibility.skip) continue;
- if ((e_client_visibility_get(ec) != E_VISIBILITY_UNOBSCURED) &&
- (e_client_visibility_get(ec) != E_VISIBILITY_PARTIALLY_OBSCURED) &&
- (!eina_list_data_find(e_comp_launchscrn_list_get(), ec)))
- continue;
-
- if (e_comp_wl_subsurface_check(ec)) continue;
-
- e_client_geometry_get(ec, &ex, &ey, &ew, &eh);
- if (!E_CONTAINS(ex, ey, ew, eh, zone->x, zone->y, zone->w, zone->h))
- continue;
-
- return ec;
-
- }
-
- return NULL;
-}
-
-EINTERN void
-e_tizen_ws_shell_indicator_srv_property_change_send(E_Client *ec, int angle)
-{
- int opacity;
-
- if (!ec) return;
- if (!_indicator_srv_res)
- {
- ELOGF("TZ_IND", "NO indicator service", NULL);
- return;
- }
-
- opacity = ec->indicator.opacity_mode;
-
- ELOGF("TZ_IND", "SEND indicator info. angle:%d, opacity:%d", ec, angle, opacity);
- tws_service_indicator_send_property_change(_indicator_srv_res, angle, opacity);
-}
-
-EINTERN void
-e_tizen_ws_shell_indicator_srv_property_update(E_Client *ec)
-{
- E_Client *ec_ind_owner;
- if (!_indicator_srv_res) return;
-
- ec_ind_owner = e_mod_indicator_owner_get();
- if (ec != ec_ind_owner) return;
-
- if (ec->e.state.rot.ang.next != -1)
- e_tizen_ws_shell_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next);
- else
- e_tizen_ws_shell_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
-}
-
-EINTERN void
-e_tizen_ws_shell_indicator_srv_ower_win_update(E_Zone *zone)
-{
- E_Client *ec = NULL;
- E_Client *ec_cur_owner = NULL;
-
- if (!zone) return;
- if (!_indicator_srv_res) return;
-
- ec_cur_owner = e_mod_indicator_owner_get();
- ec = _e_tizen_ws_shell_indicator_find_topvisible_client(zone);
-
- if (ec != ec_cur_owner)
- {
- ELOGF("TZ_IND", "Changed OWNER. win:%zx, state:%d, opacity:%d, vtype:%d", NULL, e_client_util_win_get(ec),
- ec ? ec->indicator.state:-1, ec ? ec->indicator.opacity_mode:-1, ec ? ec->indicator.visible_type:-1);
- e_mod_indicator_owner_set(ec);
-
- if (ec && !ec->e.state.rot.pending_show)
- {
- ELOGF("TZ_IND", "Property Update. name:%s curr:%d, next:%d", NULL, ec->icccm.name?:"NULL",
- ec->e.state.rot.ang.curr, ec->e.state.rot.ang.next);
- e_tizen_ws_shell_indicator_srv_property_update(ec);
- }
- }
-}
-
// --------------------------------------------------------
// tizen_ws_shell_interface::quickpanel
// --------------------------------------------------------
EINTERN void e_tizen_ws_shell_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable, E_Quickpanel_Type type);
-EINTERN void e_tizen_ws_shell_indicator_srv_property_change_send(E_Client *ec, int angle);
-EINTERN void e_tizen_ws_shell_indicator_srv_property_update(E_Client *ec);
-EINTERN void e_tizen_ws_shell_indicator_srv_ower_win_update(E_Zone *zone);
-
EINTERN Eina_Bool e_tizen_ws_shell_shared_widget_launch_prepare_send(E_Client *callee_ec, uint32_t state, uint32_t serial);
#endif
--- /dev/null
+#include "e_tizen_ws_shell_srv_indicator_intern.h"
+#include "services/e_service_indicator_intern.h"
+#include "e_comp_wl_subsurface_intern.h"
+
+#include <tzsh_server.h>
+
+static struct wl_resource *_indicator_srv_res = NULL;
+
+static void
+_tzsh_srv_indicator_cb_resource_destroy(struct wl_resource *resource)
+{
+ if (_indicator_srv_res == resource)
+ _indicator_srv_res = NULL;
+}
+
+static void
+_tzsh_srv_indicator_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+ _indicator_srv_res = NULL;
+ wl_resource_destroy(resource);
+}
+
+static const struct tws_service_indicator_interface _tzsh_srv_indicator_iface =
+{
+ _tzsh_srv_indicator_cb_destroy,
+};
+
+EINTERN Eina_Bool
+e_tizen_ws_shell_srv_indicator_init(E_Tizen_Ws_Shell_Srv *tzsh_srv)
+{
+ struct wl_client *client;
+ struct wl_resource *res;
+ uint32_t id;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tzsh_srv, EINA_FALSE);
+
+ client = tzsh_srv->client;
+ id = tzsh_srv->id;
+
+ res = wl_resource_create(client, &tws_service_indicator_interface, 1, id);
+ if (!res)
+ {
+ wl_client_post_no_memory(client);
+ return EINA_FALSE;
+ }
+
+ _indicator_srv_res = res;
+
+ wl_resource_set_implementation(res, &_tzsh_srv_indicator_iface, tzsh_srv,
+ _tzsh_srv_indicator_cb_resource_destroy);
+
+ return EINA_TRUE;
+}
+
+EINTERN void
+e_tizen_ws_shell_srv_indicator_property_change_send(E_Client *ec, int angle)
+{
+ int opacity;
+
+ if (!ec) return;
+ if (!_indicator_srv_res)
+ {
+ ELOGF("TZ_IND", "NO indicator service", NULL);
+ return;
+ }
+
+ opacity = ec->indicator.opacity_mode;
+
+ ELOGF("TZ_IND", "SEND indicator info. angle:%d, opacity:%d", ec, angle, opacity);
+ tws_service_indicator_send_property_change(_indicator_srv_res, angle, opacity);
+}
+
+EINTERN void
+e_tizen_ws_shell_srv_indicator_property_update(E_Client *ec)
+{
+ E_Client *ec_ind_owner;
+ if (!_indicator_srv_res) return;
+
+ ec_ind_owner = e_mod_indicator_owner_get();
+ if (ec != ec_ind_owner) return;
+
+ if (ec->e.state.rot.ang.next != -1)
+ e_tizen_ws_shell_srv_indicator_property_change_send(ec, ec->e.state.rot.ang.next);
+ else
+ e_tizen_ws_shell_srv_indicator_property_change_send(ec, ec->e.state.rot.ang.curr);
+}
+
+static E_Client *
+_e_tizen_ws_shell_srv_indicator_find_topvisible_client(E_Zone *zone)
+{
+ E_Client *ec;
+ Evas_Object *o;
+ int ex, ey, ew, eh;
+
+ o = evas_object_top_get(e_comp_evas_get());
+ for (; o; o = evas_object_below_get(o))
+ {
+ ec = evas_object_data_get(o, "E_Client");
+
+ /* check e_client and skip e_clients not intersects with zone */
+ if (!ec) continue;
+ if (e_object_is_del(E_OBJECT(ec))) continue;
+ if (e_client_util_ignored_get(ec)) continue;
+ if (!e_zone_has_ec(zone, ec)) continue;
+ if (!e_client_view_get(ec)) continue;
+
+ if (!ec->visible) continue;
+ if (ec->visibility.skip) continue;
+ if ((e_client_visibility_get(ec) != E_VISIBILITY_UNOBSCURED) &&
+ (e_client_visibility_get(ec) != E_VISIBILITY_PARTIALLY_OBSCURED) &&
+ (!eina_list_data_find(e_comp_launchscrn_list_get(), ec)))
+ continue;
+
+ if (e_comp_wl_subsurface_check(ec)) continue;
+
+ e_client_geometry_get(ec, &ex, &ey, &ew, &eh);
+ if (!E_CONTAINS(ex, ey, ew, eh, zone->x, zone->y, zone->w, zone->h))
+ continue;
+
+ return ec;
+
+ }
+
+ return NULL;
+}
+
+EINTERN void
+e_tizen_ws_shell_srv_indicator_ower_win_update(E_Zone *zone)
+{
+ E_Client *ec = NULL;
+ E_Client *ec_cur_owner = NULL;
+
+ if (!zone) return;
+ if (!_indicator_srv_res) return;
+
+ ec_cur_owner = e_mod_indicator_owner_get();
+ ec = _e_tizen_ws_shell_srv_indicator_find_topvisible_client(zone);
+
+ if (ec != ec_cur_owner)
+ {
+ ELOGF("TZ_IND", "Changed OWNER. win:%zx, state:%d, opacity:%d, vtype:%d", NULL, e_client_util_win_get(ec),
+ ec ? ec->indicator.state:-1, ec ? ec->indicator.opacity_mode:-1, ec ? ec->indicator.visible_type:-1);
+ e_mod_indicator_owner_set(ec);
+
+ if (ec && !ec->e.state.rot.pending_show)
+ {
+ ELOGF("TZ_IND", "Property Update. name:%s curr:%d, next:%d", NULL, ec->icccm.name?:"NULL",
+ ec->e.state.rot.ang.curr, ec->e.state.rot.ang.next);
+ e_tizen_ws_shell_srv_indicator_property_update(ec);
+ }
+ }
+}
--- /dev/null
+#ifndef E_TIZEN_WS_SHELL_INDICATOR_SRV_INTERN_H
+#define E_TIZEN_WS_SHELL_INDICATOR_SRV_INTERN_H
+
+#include "e_intern.h"
+#include "e_tizen_ws_shell_manager_intern.h"
+
+EINTERN Eina_Bool e_tizen_ws_shell_srv_indicator_init(E_Tizen_Ws_Shell_Srv *tzsh_srv);
+
+EINTERN void e_tizen_ws_shell_srv_indicator_property_change_send(E_Client *ec, int angle);
+EINTERN void e_tizen_ws_shell_srv_indicator_property_update(E_Client *ec);
+EINTERN void e_tizen_ws_shell_srv_indicator_ower_win_update(E_Zone *zone);
+
+#endif
#include "e_policy_desk_intern.h"
#include "e_canvas_intern.h"
#include "e_tizen_ws_shell_manager_intern.h"
+#include "e_tizen_ws_shell_srv_indicator_intern.h"
#include "e_policy_wl_display_intern.h"
E_Policy *e_policy = NULL;
pc = eina_hash_find(hash_policy_clients, &ec);
if (!pc) return ECORE_CALLBACK_PASS_ON;
- e_tizen_ws_shell_indicator_srv_ower_win_update(pc->zone);
+ e_tizen_ws_shell_srv_indicator_ower_win_update(pc->zone);
return ECORE_CALLBACK_PASS_ON;
}
{
EINA_LIST_FREE(_e_pol_changed_zone, zone)
{
- e_tizen_ws_shell_indicator_srv_ower_win_update(zone);
+ e_tizen_ws_shell_srv_indicator_ower_win_update(zone);
}
_e_pol_changed_zone = NULL;
}
ec = policy_client->ec;
if (policy_client->zone)
- e_tizen_ws_shell_indicator_srv_ower_win_update(policy_client->zone);
+ e_tizen_ws_shell_srv_indicator_ower_win_update(policy_client->zone);
e_policy_wl_client_del(ec);
#include "services/e_service_indicator_intern.h"
#include "e_client_intern.h"
#include "e_policy_wl_intern.h"
-#include "e_tizen_ws_shell_manager_intern.h"
+#include "e_tizen_ws_shell_srv_indicator_intern.h"
static E_Client *_ind_server = NULL;
static E_Client *_ind_owner = NULL;
{
ELOGF("TZ_IND", "Rotation begins.(ec:%s) Set indicator's angle to next angle:%d", ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.next);
_ind_angle = ec->e.state.rot.ang.next;
- e_tizen_ws_shell_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next);
+ e_tizen_ws_shell_srv_indicator_property_change_send(ec, ec->e.state.rot.ang.next);
}
}
{
ELOGF("TZ_IND", "Rotation is done.(ec:%s) Set indicator's angle to curr angle:%d", ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.curr);
_ind_angle = ec->e.state.rot.ang.curr;
- e_tizen_ws_shell_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
+ e_tizen_ws_shell_srv_indicator_property_change_send(ec, ec->e.state.rot.ang.curr);
}
}