E_CONFIG_DD_FREE(mod->conf_edd);
}
-EINTERN Eina_Bool
-e_mod_pol_conf_rot_enable_get(int angle)
+EINTERN Eina_List *
+e_mod_pol_conf_rot_enable_angles_get(void)
{
- Config_Rot *rot;
- Eina_List *rots, *l;
+ Eina_List *rots = NULL;
if (EINA_UNLIKELY(!_pol_mod))
- return EINA_FALSE;
+ return NULL;
if (EINA_UNLIKELY(!_pol_mod->conf))
- return EINA_FALSE;
+ return NULL;
rots = _pol_mod->conf->rotations;
- if (!rots)
- return EINA_FALSE;
-
- EINA_LIST_FOREACH(rots, l, rot)
- {
- if (rot->angle == angle)
- return !!rot->enable;
- }
-
- return EINA_FALSE;
+ return rots;
}
EINTERN Eina_Bool
return p;
}
+static void
+_e_mod_pol_rotation_init(void)
+{
+ Eina_List *angle_list = NULL;
+
+ angle_list = e_mod_pol_conf_rot_enable_angles_get();
+ e_mod_pol_rotation_init(angle_list);
+}
E_API void *
e_modapi_init(E_Module *m)
ERR("No policy system!");
e_mod_pol_conf_init(mod);
- e_mod_pol_rotation_init();
+ _e_mod_pol_rotation_init();
e_mod_pol_pingpong_init();
e_mod_configured_resolution_init();
if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
EINTERN void e_mod_pol_conf_init(Mod *mod);
EINTERN void e_mod_pol_conf_shutdown(Mod *mod);
-EINTERN Eina_Bool e_mod_pol_conf_rot_enable_get(int angle);
+EINTERN Eina_List * e_mod_pol_conf_rot_enable_angles_get(void);
EINTERN Eina_Bool e_mod_pol_conf_use_pingpoing_policy_get(void);
#endif
const static char *_wr_log_dom_name = "e-rot";
+typedef struct _Rot_Info Rot_Info;
+struct _Rot_Info
+{
+ unsigned char enable;
+ int angle;
+};
+
int _wr_log_dom = -1;
static Eina_List *_event_handlers = NULL;
+static Eina_List *_config_enable_angles = NULL;
-/* externally accessible functions */
-/**
- * @describe
- * Get current rotation angle.
- * @param ec e_client
- * @return int current angle
- */
-EINTERN int
-e_client_rotation_curr_angle_get(const E_Client *ec)
+EINTERN Eina_Bool
+e_mod_pol_rotation_is_conf_enable_angle(int angle)
{
- E_OBJECT_CHECK_RETURN(ec, -1);
- E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, -1);
+ Eina_List *l;
+ Rot_Info *rot;
+
+ if (!_config_enable_angles)
+ return EINA_FALSE;
- return ec->e.state.rot.ang.curr;
+ EINA_LIST_FOREACH(_config_enable_angles, l, rot)
+ {
+ if (rot->angle == angle)
+ return !!rot->enable;
+ }
+
+ return EINA_FALSE;
}
static Eina_Bool
}
EINTERN void
-e_mod_pol_rotation_init(void)
+e_mod_pol_rotation_init(Eina_List *angle_list)
{
E_Zone *zone;
Eina_List *l;
eina_log_domain_level_set(_wr_log_dom_name, EINA_LOG_LEVEL_INFO);
+ _config_enable_angles = eina_list_clone(angle_list);
+
e_mod_rot_settings_init();
#ifdef HAVE_AUTO_ROTATION
e_mod_sensord_init();
EINTERN void
e_mod_pol_rotation_shutdown(void)
{
+ if (_config_enable_angles)
+ eina_list_free(_config_enable_angles);
+
e_mod_rot_settings_shutdown();
#ifdef HAVE_AUTO_ROTATION
e_mod_sensord_deinit();
#include "e_mod_rotation_wl.h"
-EINTERN int e_client_rotation_curr_angle_get(const E_Client *ec);
-EINTERN void e_mod_pol_rotation_init(void);
+EINTERN Eina_Bool e_mod_pol_rotation_is_conf_enable_angle(int angle);
+EINTERN void e_mod_pol_rotation_init(Eina_List *angle_list);
EINTERN void e_mod_pol_rotation_shutdown(void);
EINTERN void e_mod_pol_rotation_force_update_add(E_Zone *zone, E_Client *ec);
EINTERN void e_mod_pol_rotation_force_update_del(E_Zone *zone, E_Client *ec);
* license.
*/
#include "e_mod_main.h"
+#include "e_mod_rotation.h"
#include "e_mod_rotation_wl.h"
#include "e_mod_rotation_private.h"
#include <wayland-server.h>
ELOGF("ROTATION", "Request to set Preferred angle:%d", ec, TIZEN_ROTATION_ANGLE_TO_INT(angle));
if ((angle != TIZEN_ROTATION_ANGLE_NONE) &&
- (!e_mod_pol_conf_rot_enable_get(TIZEN_ROTATION_ANGLE_TO_INT(angle))))
+ (!e_mod_pol_rotation_is_conf_enable_angle(TIZEN_ROTATION_ANGLE_TO_INT(angle))))
{
ELOGF("ROTATION", "Preferred angle(%d) is not allowed. CONF disabled",
ec, TIZEN_ROTATION_ANGLE_TO_INT(angle));
_e_client_rotation_angle_is_allowed(E_Client *ec, int angle)
{
if ((!_camera_check(ec)) &&
- (!e_mod_pol_conf_rot_enable_get(angle)))
+ (!e_mod_pol_rotation_is_conf_enable_angle(angle)))
{
EDBG(ec, "CHECK dependent '%s'(%p) ang:%d rot.type:%d dependent:%d",
ec->icccm.name, ec, angle,
* rotation list.
*/
if ((!zone->rot.block.sys_auto_rot) &&
- (e_mod_pol_conf_rot_enable_get(cur_angle)) &&
+ (e_mod_pol_rotation_is_conf_enable_angle(cur_angle)) &&
(ec->visibility.obscured != E_VISIBILITY_FULLY_OBSCURED))
{
ELOGF("ROTATION", "Do rotation of below ec under bg_ec %s(%p)",
(zone->rot.block.mod_count > 0))
{
if ((!zone->rot.unblock.app_hint) &&
- (!e_mod_pol_conf_rot_enable_get(rotation)))
+ (!e_mod_pol_rotation_is_conf_enable_angle(rotation)))
{
ELOGF("ROTATION", "ZONE_ROT |SKIP|zone:%d curr:%d rotation:%d config is not allowed",
NULL, zone->num, zone->rot.curr, rotation);
}
/* 2. not supported angle in wm-policy configuration */
- if (!e_mod_pol_conf_rot_enable_get(rot))
+ if (!e_mod_pol_rotation_is_conf_enable_angle(rot))
{
ELOGF("ROTATION", "BLOCK Get. CONF disabled", NULL);
return EINA_TRUE;