#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
+#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
#define ELM_WIN_PROTECTED
#include <Elementary.h>
Ecore_Job *deferred_resize_job;
Ecore_Job *deferred_child_eval_job;
+ Ecore_Event_Handler *mouse_up_handler;//TIZEN_ONLY(20161121) tizen don't have canvas mouse up event like opensource now.
Elm_Win_Type type;
Elm_Win_Keyboard_Mode kbdmode;
struct
{
Evas_Object *target;
+ //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen
+ int x;
+ int y;
+ int w;
+ int h;
+ Eina_Bool need_moved;
+ //
} cur, prev;
} accessibility_highlight;
//
+ //TIZEN_ONLY(20170919): Handle default label object
+ Eina_List *default_label_objs;
+ //
Evas_Object *icon;
const char *title;
const char *icon_name;
unsigned int count; /* number of elements in available rotations */
Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
Eina_Bool use : 1; /* set ture when application use window manager rotation. */
+// TIZEN_ONLY(20170212): pend rotation until app set rotation
+ Eina_Bool rotation_pending : 1; /* set true when application will manage the rotation */
+//
} wm_rot;
Eo *socket_proxy; /* reference object to atspi object in separate process @since 1.15 */
static const char SIG_EFFECT_STARTED[] = "effect,started";
static const char SIG_EFFECT_DONE[] = "effect,done";
static const char SIG_LAUNCH_DONE[] = "launch,done";
+//TIZEN_ONLY(20161028): add smart signal 'atspi,screen,reader,changed'
+static const char SIG_ATSPI_SCREEN_READER_CHANGED[] = "atspi,screen,reader,changed";
+//
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DELETE_REQUEST, ""},
{SIG_EFFECT_STARTED, ""},
{SIG_EFFECT_DONE, ""},
{SIG_LAUNCH_DONE, ""},
+ //TIZEN_ONLY(20161028): add smart signal 'atspi,screen,reader,changed'
+ {SIG_ATSPI_SCREEN_READER_CHANGED, ""},
+ //
{NULL, NULL}
};
static void
_win_noblank_eval(void)
{
+#ifdef HAVE_ELEMENTARY_X
Eina_List *l;
Evas_Object *obj;
int noblanks = 0;
Eina_Bool change = EINA_FALSE;
-#ifdef HAVE_ELEMENTARY_X
EINA_LIST_FOREACH(_elm_win_list, l, obj)
{
ELM_WIN_DATA_GET(obj, sd);
}
static void
-_elm_win_apply_alpha(Eo *obj, Elm_Win_Data *sd)
+_elm_win_apply_alpha(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
Eina_Bool enabled;
}
}
-static Eina_Bool
+static void
_elm_win_state_eval(void *data EINA_UNUSED)
{
Eina_List *l;
}
}
_win_noblank_eval();
- return EINA_FALSE;
+ return;
}
static Eina_Bool
{
size_t size = sizeof(char) * (strlen(tmp) + 16);
repname = malloc(size);
- strncpy(repname, tmp, dotptr - tmp);
- snprintf(repname + (dotptr - tmp), size -
- (dotptr - tmp), "%03i",
- sd->shot.shot_counter + 1);
- strcat(repname, dotptr);
+ if (repname)
+ {
+ strncpy(repname, tmp, dotptr - tmp);
+ snprintf(repname + (dotptr - tmp), size -
+ (dotptr - tmp), "%03i",
+ sd->shot.shot_counter + 1);
+ strcat(repname, dotptr);
+ }
free(tmp);
return repname;
}
if (!sd->shot.repeat_count) return strdup("out.png");
repname = malloc(sizeof(char) * 24);
+ if (!repname) return NULL;
snprintf(repname, sizeof(char) * 24, "out%03i.png",
sd->shot.shot_counter + 1);
}
else
{
+ evas_object_smart_member_del(fobj);
evas_object_hide(fobj);
evas_object_del(fobj);
}
_elm_win_accessibility_highlight_simple_setup(Elm_Win_Data *sd,
Evas_Object *obj)
{
- Evas_Object *clip, *target = sd->accessibility_highlight.cur.target;
+ Evas_Object *target = sd->accessibility_highlight.cur.target;
Evas_Coord x, y, w, h;
+ //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen
+ Evas_Coord ox, oy;
+ Elm_Atspi_Role role;
+ //
+
+ _elm_widget_showing_geometry_get(target, &x, &y, &w, &h);
- evas_object_geometry_get(target, &x, &y, &w, &h);
+ //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen
+ evas_object_geometry_get(target, &ox, &oy, NULL, NULL);
+
+ //TIZEN_ONLY(20171011) : atspi : During the highlight grab, out signal is not sent.
+ if (!_elm_widget_accessibility_highlight_grabbing_get(target))
+ //
+ {
+ if (((w < 0 && ox > sd->accessibility_highlight.cur.x) || (h < 0 && oy < sd->accessibility_highlight.cur.y))
+ && sd->accessibility_highlight.cur.need_moved
+ && eo_isa(target, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
+ {
+ eo_do(target, role = elm_interface_atspi_accessible_role_get());
+ if (role && role != ELM_ATSPI_ROLE_MENU_ITEM && role != ELM_ATSPI_ROLE_LIST_ITEM)
+ {
+ elm_interface_atspi_accessible_move_outed_signal_emit(target, ELM_ATSPI_MOVE_OUTED_TOP_LEFT);
+ sd->accessibility_highlight.cur.need_moved = EINA_FALSE;
+ return ;
+ }
+ }
+ else if (((w < 0 && ox < sd->accessibility_highlight.cur.x) || (h < 0 && oy > sd->accessibility_highlight.cur.y))
+ && sd->accessibility_highlight.cur.need_moved
+ && eo_isa(target, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
+ {
+ eo_do(target, role = elm_interface_atspi_accessible_role_get());
+ if (role && role != ELM_ATSPI_ROLE_MENU_ITEM && role != ELM_ATSPI_ROLE_LIST_ITEM)
+ {
+ elm_interface_atspi_accessible_move_outed_signal_emit(target, ELM_ATSPI_MOVE_OUTED_BOTTOM_RIGHT);
+ sd->accessibility_highlight.cur.need_moved = EINA_FALSE;
+ return ;
+ }
+ }
+ }
+ //
evas_object_move(obj, x, y);
evas_object_resize(obj, w, h);
- clip = evas_object_clip_get(target);
- if (clip) evas_object_clip_set(obj, clip);
+ //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen
+ sd->accessibility_highlight.cur.x = ox;
+ sd->accessibility_highlight.cur.y = oy;
+ //
}
static void
{
ELM_WIN_DATA_GET(data, sd);
Evas_Object *fobj = sd->accessibility_highlight.fobj;
- elm_widget_theme_object_set (sd->obj, fobj, "accessibility_highlight", "top", "default");
- evas_object_raise(fobj);
_elm_win_accessibility_highlight_simple_setup(sd, fobj);
_elm_win_accessibility_highlight_visible_set(sd, EINA_TRUE);
}
newest = elm_widget_newest_focus_order_get
(obj, &newest_focus_order, EINA_TRUE);
+ // TIZEN_ONLY(20161118): onscreen_is should not be checked
+ // to keep compatibility with Tizen 2.4
+ /*
if ((newest) &&
(_elm_widget_onscreen_is(newest) || (newest == obj)))
elm_widget_focus_restore(obj);
+ */
+ if (newest) elm_widget_focus_restore(obj);
+ /////////////////////////////////////////////////////////
else
evas_object_focus_set(obj, EINA_TRUE);
}
// FIXME: the event is deprecated but still in use.
// Has to be removed in EFL2.0
evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
- eo_do(obj, eo_event_callback_call(ELM_WIDGET_EVENT_FOCUSED, NULL));
sd->focus_highlight.cur.visible = EINA_TRUE;
_elm_win_focus_highlight_reconfigure_job_start(sd);
if (sd->frame_obj)
edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
}
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
elm_interface_atspi_window_activated_signal_emit(obj);
elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
// FIXME: the event is deprecated but still in use.
// Has to be removed in EFL2.0
evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
- eo_do(obj, eo_event_callback_call(ELM_WIDGET_EVENT_UNFOCUSED, NULL));
sd->focus_highlight.cur.visible = EINA_FALSE;
_elm_win_focus_highlight_reconfigure_job_start(sd);
if (sd->frame_obj)
/* access */
_elm_access_object_highlight_disable(evas_object_evas_get(obj));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
elm_interface_atspi_window_deactivated_signal_emit(obj);
elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_FALSE);
static void
_elm_win_opaque_update(Elm_Win_Data *sd)
{
- int ox, oy, ow, oh;
+ int ox = 0, oy = 0, ow = 0, oh = 0;
if (sd->fullscreen)
{
return;
}
- edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
- &ox, &oy, &ow, &oh);
+ if (sd->frame_obj)
+ edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
+ &ox, &oy, &ow, &oh);
ecore_wl_window_opaque_region_set(sd->wl.win, ox, oy, ow, oh);
ecore_wl_window_update_location(sd->wl.win, sd->screen.x + ox, sd->screen.y + oy);
}
static void
_elm_win_frame_obj_update(Elm_Win_Data *sd)
{
- int fx, fy, fw, fh;
- int ox, oy, ow, oh;
+ int fx = 0, fy = 0, fw = 0, fh = 0;
+ int ox = 0, oy = 0, ow = 0, oh = 0;
#ifdef HAVE_ELEMENTARY_WAYLAND
sd->wl.opaque_dirty = 1;
#endif
- if (sd->fullscreen)
+ if (sd->fullscreen || !sd->frame_obj)
{
evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
return;
{
Elm_Win_Data *sd = _elm_win_associate_get(ee);
Evas_Object *obj;
+ int w, h;
Eina_Bool ch_withdrawn = EINA_FALSE;
Eina_Bool ch_sticky = EINA_FALSE;
Eina_Bool ch_iconified = EINA_FALSE;
}
#ifdef HAVE_ELEMENTARY_WAYLAND
- int x = 0, y = 0, w = 0, h = 0;
+ int x = 0, y = 0;
if (sd->indmode != (Elm_Win_Indicator_Mode)ecore_wl_window_indicator_state_get(sd->wl.win))
{
sd->indmode = (Elm_Win_Indicator_Mode)ecore_wl_window_indicator_state_get(sd->wl.win);
else if (sd->iconified)
{
eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_ICONIFIED, NULL));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_minimized_signal_emit(obj);
}
else
{
eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_NORMAL, NULL));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_restored_signal_emit(obj);
}
}
_elm_win_frame_obj_update(sd);
if (sd->fullscreen)
{
- int w, h;
-
eo_do(obj, eo_event_callback_call
(ELM_WIN_EVENT_FULLSCREEN, NULL));
if (sd->frame_obj)
if (sd->maximized)
{
eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_MAXIMIZED, NULL));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_maximized_signal_emit(obj);
}
else
{
eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_UNMAXIMIZED, NULL));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_restored_signal_emit(obj);
}
}
_elm_win_xwin_update(sd);
#endif
elm_widget_orientation_set(obj, sd->rot);
+
+ /* if there are deferred resize job, do the job immediately
+ before calling rotation change callback */
+ if (sd->deferred_resize_job)
+ {
+ ecore_job_del(sd->deferred_resize_job);
+ sd->deferred_resize_job = NULL;
+ _elm_win_resize_job(obj);
+ }
+
eo_do(obj, eo_event_callback_call
(ELM_WIN_EVENT_ROTATION_CHANGED, NULL));
eo_do(obj, eo_event_callback_call
(ELM_WIN_EVENT_WM_ROTATION_CHANGED, NULL));
//TIZEN_ONLY(20160915): send information to screen reader on window rotation
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
Evas_Coord width = 0, height = 0;
elm_win_screen_size_get(obj, NULL, NULL, &width, &height);
{
evas_object_smart_callback_call(obj, SIG_VISIBILITY_CHANGED, (void*)!sd->obscured);
//TIZEN_ONLY(20160701): add atspi window state visible change signal
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_VISIBLE, !sd->obscured);
//
}
_elm_win_deferred_free--;
}
+//TIZEN_ONLY(20170613) -listen if atspi is enabled
+static void
+_atspi_socket_proxy_listen(Eo * obj)
+{
+ ELM_WIN_DATA_GET(obj, sd);
+
+ const char *plug_id;
+ plug_id = evas_object_data_get(obj, "___PLUGID");
+ if ((plug_id) != NULL)
+ {
+ char *svcname, *svcnum;
+ if (!sd->socket_proxy && _elm_atspi_bridge_plug_id_split(plug_id, &svcname, &svcnum))
+ {
+ sd->socket_proxy = _elm_atspi_bridge_utils_proxy_create(obj, svcname, atoi(svcnum), ELM_ATSPI_PROXY_TYPE_SOCKET);
+ elm_atspi_bridge_utils_proxy_listen(sd->socket_proxy);
+ free(svcname);
+ free(svcnum);
+ }
+ }
+}
+//
+
EOLIAN static void
_elm_win_evas_object_smart_show(Eo *obj, Elm_Win_Data *sd)
{
TRAP(sd, show);
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
Eo *bridge = _elm_atspi_bridge_get();
elm_interface_atspi_window_created_signal_emit(obj);
if (bridge)
elm_interface_atspi_accessible_children_changed_added_signal_emit(elm_atspi_bridge_root_get(bridge), obj);
+ }
- // TIZEN_ONLY(20160705) - enable atspi_proxy to work
- const char *plug_id_2;
- if ((plug_id_2 = evas_object_data_get(obj, "___PLUGID")) != NULL)
- {
- char *svcname, *svcnum;
- if (!sd->socket_proxy && _elm_atspi_bridge_plug_id_split(plug_id_2, &svcname, &svcnum))
- {
- sd->socket_proxy = _elm_atspi_bridge_utils_proxy_create(obj, svcname, atoi(svcnum), ELM_ATSPI_PROXY_TYPE_SOCKET);
- elm_atspi_bridge_utils_proxy_listen(sd->socket_proxy);
- free(svcname);
- free(svcnum);
- }
- }
+ // TIZEN_ONLY(20160705) - enable atspi_proxy to work
+ if (_elm_atspi_enabled())
+ {
+ //TIZEN_ONLY(20170613) -listen if atspi is enabled
+ _atspi_socket_proxy_listen(obj);
//
}
+ //
if (do_eval)
{
ecore_evas_hide(sd->pointer.ee);
#endif
}
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
Eo *bridge = _elm_atspi_bridge_get();
elm_interface_atspi_window_destroyed_signal_emit(obj);
if (sd->autodel_clear) *(sd->autodel_clear) = -1;
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_destroyed_signal_emit(obj);
_elm_win_list = eina_list_remove(_elm_win_list, obj);
ecore_event_handler_del(sd->wl.indicator_flick_handler); // TIZEN_ONLY(20160801): indicator implementation
ecore_event_handler_del(sd->wl.aux_msg_handler);
#endif
+ ecore_event_handler_del(sd->mouse_up_handler);//TIZEN_ONLY(20161121) tizen don't have canvas mouse up event like opensource now.
if (sd->img_obj)
{
evas_object_show(obj);
#ifdef HAVE_ELEMENTARY_WAYLAND
int x, y, w, h;
+ Eina_Rectangle input_rect = { -1, -1, 1, 1 };
evas_object_geometry_get(obj, &x, &y, &w, &h);
ecore_wl_window_opaque_region_set(sd->wl.win, x, y, w, h);
+
+ /* TIZEN_ONLY: ecore_evas_input_rect_set api is exist only in tizen */
+ if (sd->type == ELM_WIN_TOOLTIP)
+ ecore_evas_input_rect_set(sd->ee, &input_rect);
#endif
+
#ifdef ELEMENTARY_X
if (sd->type == ELM_WIN_TOOLTIP)
ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);
if (sd->autohide)
evas_object_hide(obj);
// FIXME: if above callback deletes - then the below will be invalid
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_destroyed_signal_emit(obj);
if (autodel) evas_object_del(obj);
else sd->autodel_clear = NULL;
}
#endif
+static Eina_Bool
+_elm_win_mouse_up(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
+{
+ ELM_WIN_DATA_GET(data, sd);
+
+ if (sd->resizing) sd->resizing = EINA_FALSE;
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
Ecore_Cocoa_Window *
_elm_ee_cocoa_win_get(const Ecore_Evas *ee)
{
case ELM_WIN_UTILITY:
ecore_evas_wayland_type_set(sd->ee, ECORE_WL_WINDOW_TYPE_UTILITY);
break;
+ case ELM_WIN_DIALOG_BASIC:
+ ecore_evas_wayland_type_set(sd->ee, ECORE_WL_WINDOW_TYPE_DIALOG);
+ break;
+ case ELM_WIN_DOCK:
+ ecore_evas_wayland_type_set(sd->ee, ECORE_WL_WINDOW_TYPE_DOCK);
+ break;
+ case ELM_WIN_SPLASH:
+ ecore_evas_wayland_type_set(sd->ee, ECORE_WL_WINDOW_TYPE_SPLASH);
+ break;
default:
break;
}
//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
//register/unregister access objects accordingly.
+// TIZEN_ONLY(20170516): connect to at-spi dbus based on org.a11y.Status.IsEnabled property
void
-_elm_win_atspi(Eina_Bool is_atspi)
+_elm_win_screen_reader(Eina_Bool is_screen_reader)
{
- Evas *evas;
const Eina_List *l;
Evas_Object *obj;
Evas_Object *fobj;
- Eina_Bool highlight = EINA_FALSE;
EINA_LIST_FOREACH(_elm_win_list, l, obj)
{
- elm_widget_atspi(obj, is_atspi);
+ elm_widget_screen_reader(obj, is_screen_reader);
+ evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader);
/* floating orphan object. if there are A, B, C objects and user does
as below, then there would be floating orphan objects.
if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
{
- elm_widget_atspi(fobj, is_atspi);
+ elm_widget_screen_reader(fobj, is_screen_reader);
}
}
+ }
+ if (!is_screen_reader)
+ {
+ Evas_Object *highlighted_obj;
+ highlighted_obj = _elm_object_accessibility_currently_highlighted_get();
+ elm_object_accessibility_highlight_set(highlighted_obj, EINA_FALSE);
+ }
+}
+
+//TIZEN_ONLY(20170621) handle atspi proxy connection at runtime
+void
+_elm_win_atspi(Eina_Bool is_atspi)
+{
+ const Eina_List *l;
+ Evas_Object *obj;
+ Elm_Atspi_State_Set ss;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ {
if (!is_atspi)
{
- eo_do(obj, highlight = elm_interface_atspi_component_highlight_clear());
+ ELM_WIN_DATA_GET(obj, sd);
+ if (sd->socket_proxy)
+ {
+ eo_unref(sd->socket_proxy);
+ sd->socket_proxy = NULL;
+ }
+ }
+ else
+ {
+ _atspi_socket_proxy_listen(obj);
+ eo_do(obj, ss = elm_interface_atspi_accessible_state_set_get());
+ if (STATE_TYPE_GET(ss, ELM_ATSPI_STATE_ACTIVE))
+ {
+ elm_interface_atspi_window_activated_signal_emit(obj);
+ elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
+ }
+ else
+ {
+ Elm_Atspi_Role role;
+ eo_do(obj, role = elm_interface_atspi_accessible_role_get());
+ if (role == ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW)
+ {
+ elm_interface_atspi_window_activated_signal_emit(obj);
+ elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
+ }
+ }
}
+
+ elm_widget_atspi(obj, is_atspi);
}
}
//
+//
+//
void
_elm_win_translate(void)
EINA_LIST_FOREACH(_elm_win_list, l, obj)
{
if (!strcmp(E_("default:LTR"), "default:RTL"))
- evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_RTL);
+ evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_ANY_RTL);
else
evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_LTR);
elm_widget_translate(obj);
}
/* END */
+
+ //TIZEN_ONLY(20161202): Temporary code - Apply mirroring in _elm_win_translate()
+ if (_elm_config && _elm_config->language_auto_mirrored)
+ {
+ if (!strcmp(E_("default:LTR"), "default:RTL"))
+ elm_config_mirrored_set(EINA_TRUE);
+ else
+ elm_config_mirrored_set(EINA_FALSE);
+ }
+ //
}
void
{
sd->accessibility_highlight.cur.target = atarget;
- sd->accessibility_highlight.prev.target = NULL;
- sd->accessibility_highlight.fobj = edje_object_add(sd->evas);
+ Evas_Object *fobj = edje_object_add(sd->evas);
+ sd->accessibility_highlight.fobj = fobj;
+ elm_widget_theme_object_set (sd->obj, fobj, "accessibility_highlight", "top", "default");
if (atarget)
- _elm_win_accessibility_highlight_callbacks_add(sd);
+ {
+ evas_object_smart_member_add(fobj, atarget);
+ evas_object_smart_changed(atarget);
+ _elm_win_accessibility_highlight_callbacks_add(sd);
+ }
}
static void
{
const char *emission;
+ if (!sd->frame_obj) return;
+
if (maximized)
emission = "elm,state,maximized";
else
// TIZEN_ONLY(20160728): Indicator Implementation
#ifdef HAVE_ELEMENTARY_WAYLAND
static Eina_Bool
-_elm_win_wl_indicator_flick(void *data, int type EINA_UNUSED, void *event)
+_elm_win_wl_indicator_flick(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
{
ELM_WIN_DATA_GET(data, sd);
evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_FLICK_DONE, NULL);
#endif
//
+//TIZEN_ONLY(20161202): Temporary code - Apply mirroring in elm_win_add()
+ if (_elm_config && _elm_config->language_auto_mirrored)
+ {
+ if (!strcmp(E_("default:LTR"), "default:RTL"))
+ elm_config_mirrored_set(EINA_TRUE);
+ else
+ elm_config_mirrored_set(EINA_FALSE);
+ }
+//
+
// TIZEN_ONLY(20160218): Improve launching performance.
if (_precreated_win_obj)
{
ELM_WIN_DATA_GET(_precreated_win_obj, sd);
- if (sd)
+ if ((type != ELM_WIN_SOCKET_IMAGE) &&
+ (type != ELM_WIN_INLINED_IMAGE))
{
- if ((sd->type == type) && (sd->parent == parent))
+ if (sd)
{
- Evas_Object *tmp = _precreated_win_obj;
- TRAP(sd, name_class_set, name, _elm_appname);
- TRAP(sd, title_set, sd->title ? sd->title : name);
- _precreated_win_obj = NULL;
- INF("Return precreated obj(%p).", tmp);
-
-//TIZEN_ONLY(20160628): Add Performance log for cold booting
+ if (sd->parent == parent)
+ {
+ Evas_Object *tmp = _precreated_win_obj;
+ TRAP(sd, name_class_set, name, _elm_appname);
+ TRAP(sd, title_set, sd->title ? sd->title : name);
+ _precreated_win_obj = NULL;
+ if (sd->type != type)
+ elm_win_type_set(tmp, type);
+ INF("Return precreated obj(%p).", tmp);
+
+ //TIZEN_ONLY(20160628): Add Performance log for cold booting
#ifdef ENABLE_TTRACE
- traceEnd(TTRACE_TAG_EFL);
+ traceEnd(TTRACE_TAG_EFL);
#endif
-//
- return tmp;
+ //
+
+ // TIZEN_ONLY(20161202): Apply paragraph direction
+ if (!strcmp(E_("default:LTR"), "default:RTL"))
+ evas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_ANY_RTL);
+ else
+ evas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_LTR);
+ //
+
+ return tmp;
+ }
}
}
+ Evas_Object *bg = elm_bg_precreated_object_get();
+ if (bg)
+ {
+ evas_object_del(bg);
+ elm_bg_precreated_object_set(NULL);
+ }
+ Evas_Object *conform = elm_conformant_precreated_object_get();
+ if (conform)
+ {
+ evas_object_del(conform);
+ elm_conformant_precreated_object_set(NULL);
+ }
+ evas_object_del(_precreated_win_obj);
+ _precreated_win_obj = NULL;
}
//
#endif
else if ((engine) && (!strncmp(engine, "shot:", 5)))
_shot_init(sd);
+ //TIZEN_ONLY(20161121) tizen don't have canvas mouse up event like opensource now.
+ //window should deal with mouse up event related with move resize.
+ sd->mouse_up_handler = ecore_event_handler_add
+ (ECORE_EVENT_MOUSE_BUTTON_UP, _elm_win_mouse_up, obj);
sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
(sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
}
+// TIZEN_ONLY(20161114): Sync the state of indicator with window manager
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ if (sd->wl.win)
+ ecore_wl_indicator_visible_type_set(sd->wl.win, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
+#endif
+// END
+
sd->evas = ecore_evas_get(sd->ee);
evas_object_color_set(obj, 0, 0, 0, 0);
sd->edje = edje_object_add(sd->evas);
_elm_win_theme_internal(obj, sd);
+ //TIZEN_ONLY(20161208): supported floating window
+ if (type != ELM_WIN_BASIC)
+ edje_object_signal_emit(sd->edje, "elm,state,floating,on", "elm");
+ //
sd->box = evas_object_box_add(sd->evas);
evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box);
}
eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
elm_interface_atspi_window_created_signal_emit(obj);
if(_elm_config->win_no_border)
/* TIZEN_ONLY(20160622): Apply paragraph direction when language is changed */
if (!strcmp(E_("default:LTR"), "default:RTL"))
- evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_RTL);
+ evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_ANY_RTL);
else
evas_object_paragraph_direction_set(obj, EVAS_BIDI_DIRECTION_LTR);
/* END */
#ifdef HAVE_ELEMENTARY_WAYLAND
sd->type = type;
_elm_win_wlwin_update(sd);
+ //TIZEN_ONLY(20161208): supported floating window
+ if (type != ELM_WIN_BASIC)
+ edje_object_signal_emit(sd->edje, "elm,state,floating,on", "elm");
+ else
+ edje_object_signal_emit(sd->edje, "elm,state,floating,off", "elm");
+ //
#endif
//
ERR("This function is only allowed during construction.");
evas_object_box_remove(sd->box, subobj);
}
+// TIZEN_ONLY(20170212): pend rotation until app set rotation
+
+/* Efl don't have any plan to open new API to support the client rotation.(ex: elm_win_rotation_set)
+ * But it is need that apps deal with rotation
+ * For example, if the app want to do the object rotation effect during the rotation,
+ * canvas should not be rotated until app's rotation effect ends.
+ * so until to decide app's rotaion policy,
+ * just use the "wm.policy.win.rot.render.nopending" aux_hint.
+ * Using this hint, elm- ecore_evas - engine -tizen display server will manage the pending rotation.
+*/
+
+static int
+_elm_win_wm_pending_rotation_set(Evas_Object *obj EINA_UNUSED, const char *hint EINA_UNUSED, const char *val)
+{
+ ELM_WIN_CHECK(obj) -1;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+
+ int id = -1;
+
+ //TODO: aux_hint_del, aux_hint_val_set.
+ //Currently only 1 is available.
+
+ if (!val || (strncmp(val, "1", 1))) return -1;
+ id = ecore_evas_aux_hint_add(sd->ee, "wm.policy.win.rot.render.nopending", val);
+
+ if (id == -1)
+ {
+ ERR("PendingRotation: elm_win pending_rotation_set aux id failed");
+ //return id;
+ }
+ sd->wm_rot.rotation_pending = EINA_TRUE;
+ DBG("PendingRotation: elm_win rotation_pending_set sucess");
+ return id;
+}
+//
+
EOLIAN static void
_elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
{
EOLIAN static Evas_Object *
_elm_win_main_menu_get(Eo *obj, Elm_Win_Data *sd)
{
- Eina_Bool use_dbus = EINA_FALSE;
-
if (sd->main_menu) goto end;
sd->main_menu = elm_menu_add(obj);
_elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
#ifdef HAVE_ELEMENTARY_X
+ Eina_Bool use_dbus = EINA_FALSE;
+
if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
-#endif
-#ifdef HAVE_ELEMENTARY_X
if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
{
_elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
return rotation;
}
+// TIZEN_ONLY(20170212): pend rotation until app set rotation
+/*
+ * This API rotates the window by app side.
+ */
+
+static void
+_win_pending_rotate(Evas_Object *obj EINA_UNUSED, Elm_Win_Data *sd, int rotation, Eina_Bool resize)
+{
+ rotation = _win_rotation_degree_check(rotation);
+ DBG("PendingRotation: elm_win pending rotation set rot=%d", rotation);
+ if (sd->rot == rotation) return;
+
+ //TODO: We need time to set up the role of pending rotation between the server and client.
+ //and also need time to discuss this concept with opensource.
+ //so until that time, we add ecore evas data instead of opening the new ecore_evas_XXX api.
+ ecore_evas_data_set(sd->ee, "pending_rotation", (void *)1);
+
+ // Currently only support rotation_with_resize
+ if (resize) TRAP(sd, rotation_with_resize_set, rotation);
+ else return;
+}
+//
+
/*
* This API resizes the internal window(ex: X window) and evas_output.
* But this does not resize the elm window object and its contents.
eo_do(obj, eo_event_callback_call
(ELM_WIN_EVENT_ROTATION_CHANGED, NULL));
//TIZEN_ONLY(20160915): send information to screen reader on window rotation.
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
Evas_Coord width = 0, height = 0;
elm_win_screen_size_get(obj, NULL, NULL, &width, &height);
EOLIAN static void
_elm_win_rotation_with_resize_set(Eo *obj, Elm_Win_Data *sd, int rotation)
{
- _win_rotate(obj, sd, rotation, EINA_TRUE);
+// TIZEN_ONLY(20170212): pend rotation until app set rotation
+ if (sd->wm_rot.rotation_pending)
+ {
+ _win_pending_rotate(obj, sd, rotation, EINA_TRUE);
+ }
+ else
+//
+ _win_rotate(obj, sd, rotation, EINA_TRUE);
}
EOLIAN static int
ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
#else
(void)is_keyboard;
+ (void)sd;
#endif
}
#ifdef HAVE_ELEMENTARY_X
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin) return ecore_x_e_virtual_keyboard_get(sd->x.xwin);
+#else
+ (void)sd;
#endif
return EINA_FALSE;
}
ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
}
}
+#else
+ (void)quickpanel;
#endif
#ifdef HAVE_ELEMENTARY_WAYLAND
_elm_win_focus_skip_set(sd, EINA_TRUE);
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
return ecore_x_e_illume_quickpanel_get(sd->x.xwin);
+#else
+ (void)sd;
#endif
return EINA_FALSE;
ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
#else
(void)priority;
+ (void)sd;
#endif
}
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
+#else
+ (void)sd;
#endif
return -1;
ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
#else
(void)priority;
+ (void)sd;
#endif
}
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
+#else
+ (void)sd;
#endif
return -1;
ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
#else
(void)zone;
+ (void)sd;
#endif
}
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
+#else
+ (void)sd;
#endif
return 0;
}
#else
(void)command;
+ (void)sd;
#endif
}
_elm_win_socket_listen(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *svcname, int svcnum, Eina_Bool svcsys)
{
if (!sd->ee) return EINA_FALSE;
+ if (sd->type != ELM_WIN_SOCKET_IMAGE) return EINA_FALSE;
if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
return EINA_FALSE;
- if (_elm_config->atspi_mode)
+ if (_elm_atspi_enabled())
{
if (sd->socket_proxy)
eo_unref(sd->socket_proxy);
return EINA_TRUE;
}
+EOLIAN static Eina_Bool
+_elm_win_move_resize_start(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Move_Resize_Mode mode)
+{
+ Eina_Bool res = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ int i;
+ //1. move_resize can be start after mouse down event
+ i = evas_event_down_count_get(sd->evas);
+ if (i <= 0) return res;
+
+ //2. check move_resize start already .
+ if (sd->resizing) return res;
+
+ i = sd->rot / 90;
+ if (mode == ELM_WIN_MOVE_RESIZE_MOVE)
+ {
+ if (sd->wl.win)
+ {
+ sd->resizing = EINA_TRUE;
+ ecore_wl_window_pointer_set(sd->wl.win, NULL,
+ sd->pointer.hot_x, sd->pointer.hot_y);
+
+ /* Note: Not passing any X,Y position as those don't make sense, only
+ * the compositor can really handle the window & pointer position. */
+ ecore_evas_wayland_move(sd->ee, 0, 0);
+ res = EINA_TRUE;
+ }
+ }
+ else
+ {
+ if(mode == ELM_WIN_MOVE_RESIZE_TOP)
+ sd->resize_location = _border_side[(0 + i) % 4].location;
+ else if (mode == ELM_WIN_MOVE_RESIZE_BOTTOM)
+ sd->resize_location = _border_side[(2 + i) % 4].location;
+ else if (mode == ELM_WIN_MOVE_RESIZE_LEFT)
+ sd->resize_location = _border_side[(1 + i) % 4].location;
+ else if (mode == ELM_WIN_MOVE_RESIZE_RIGHT)
+ sd->resize_location = _border_side[(3 + i) % 4].location;
+ else if (mode == (ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_LEFT))
+ sd->resize_location = _border_corner[(0 + i) % 4].location;
+ else if (mode == (ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_RIGHT))
+ sd->resize_location = _border_corner[(3 + i) % 4].location;
+ else if (mode == (ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_LEFT))
+ sd->resize_location = _border_corner[(1 + i) % 4].location;
+ else if (mode == (ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_RIGHT))
+ sd->resize_location = _border_corner[(2 + i) % 4].location;
+ else
+ sd->resize_location = 0;
+
+ if (sd->resize_location > 0)
+ {
+ sd->resizing = EINA_TRUE;
+ ecore_evas_wayland_resize(sd->ee, sd->resize_location);
+ res = EINA_TRUE;
+ }
+ }
+#endif
+ return res;
+}
+
/* windowing specific calls - shall we do this differently? */
EOLIAN static Ecore_X_Window
#ifdef HAVE_ELEMENTARY_X
if (sd->x.xwin) return sd->x.xwin;
if (sd->parent) return elm_win_xwindow_get(sd->parent);
+#else
+ (void)sd;
#endif
return 0;
}
{
if (floating)
{
- const char *engine_name = ecore_evas_engine_name_get(sd->ee);
- Eina_Bool need_frame = engine_name &&
- ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
- (!strcmp(engine_name, ELM_WAYLAND_EGL)));
+ if (!sd->borderless)
+ {
+ const char *engine_name = ecore_evas_engine_name_get(sd->ee);
+ Eina_Bool need_frame = engine_name &&
+ ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
+ (!strcmp(engine_name, ELM_WAYLAND_EGL)));
- if (need_frame)
- need_frame = !sd->fullscreen;
+ if (need_frame)
+ need_frame = !sd->fullscreen;
- if (need_frame)
- {
- _elm_win_frame_del(sd);
- _elm_win_frame_add(sd, "floating");
+ if (need_frame)
+ {
+ _elm_win_frame_del(sd);
+ _elm_win_frame_add(sd, "floating");
+ }
+
+ if (sd->frame_obj)
+ evas_object_show(sd->frame_obj);
}
- if (sd->frame_obj)
- evas_object_show(sd->frame_obj);
+ //TIZEN_ONLY(20161208): supported floating window
+ edje_object_signal_emit(sd->edje, "elm,state,floating,on", "elm");
+ //
}
else
{
elm_win_borderless_set(obj, sd->borderless);
+ //TIZEN_ONLY(20161208): supported floating window
+ edje_object_signal_emit(sd->edje, "elm,state,floating,off", "elm");
+ //
}
ecore_wl_window_floating_mode_set(sd->wl.win, floating);
}
}
void
-_elm_win_object_set_accessibility_highlight(Evas_Object *win, Evas_Object *obj)
+_elm_win_object_set_accessibility_highlight(Evas_Object *win, Evas_Object *obj, Eina_Bool visible)
{
if (!win) return;
ELM_WIN_DATA_GET(win, sd);
- _elm_win_accessibility_highlight_hide(win);
- _elm_win_accessibility_highlight_callbacks_del(sd);
- if (obj)
+ if (visible || sd->accessibility_highlight.cur.target == obj)
+ {
+ _elm_win_accessibility_highlight_hide(win);
+ _elm_win_accessibility_highlight_callbacks_del(sd);
+ }
+
+ if (visible)
{
_elm_win_accessibility_highlight_init(sd, obj);
_elm_win_accessibility_highlight_show(win);
+ //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen
+ sd->accessibility_highlight.cur.need_moved = EINA_TRUE;
+ //
}
- else
+}
+
+//TIZEN_ONLY(20170919): Handle default label object
+static void
+_default_label_obj_del_cb (void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ ELM_WIN_DATA_GET(data, sd);
+ if (!sd) return;
+
+ sd->default_label_objs = eina_list_remove(sd->default_label_objs, obj);
+}
+
+static int _sort_parent_child_order(const void *data1, const void *data2)
+{
+ if (data1)
{
- _elm_win_accessibility_highlight_hide(win);
+ Eo *parent;
+ eo_do(data1, parent = elm_interface_atspi_accessible_parent_get());
+ while (parent)
+ {
+ if (parent == data2) return 1;
+ eo_do(parent, parent = elm_interface_atspi_accessible_parent_get());
+ }
}
+ return -1;
}
+void
+_elm_win_default_label_obj_append(Evas_Object *default_label_obj)
+{
+ if (!default_label_obj) return;
+
+ Evas_Object *win = elm_widget_top_get(default_label_obj);
+ if (!win || !eo_isa(win, ELM_WIN_CLASS))
+ {
+ WRN("The top object of %s is not a window.",
+ eo_class_name_get(eo_class_get(default_label_obj)));
+ return;
+ }
+
+ ELM_WIN_DATA_GET(win, sd);
+ if (!sd) return;
+
+ if (eina_list_data_find(sd->default_label_objs, default_label_obj))
+ {
+ sd->default_label_objs =
+ eina_list_remove(sd->default_label_objs, default_label_obj);
+ evas_object_event_callback_del_full(default_label_obj, EVAS_CALLBACK_DEL,
+ _default_label_obj_del_cb, win);
+ }
+
+ evas_object_event_callback_add(default_label_obj, EVAS_CALLBACK_DEL,
+ _default_label_obj_del_cb, win);
+ sd->default_label_objs =
+ eina_list_append(sd->default_label_objs, default_label_obj);
+
+ sd->default_label_objs =
+ eina_list_sort(sd->default_label_objs, -1, _sort_parent_child_order);
+}
+
+void
+_elm_win_default_label_obj_remove(Evas_Object *default_label_obj)
+{
+ if (!default_label_obj) return;
+
+ Evas_Object *win = elm_widget_top_get(default_label_obj);
+ if (!win || !eo_isa(win, ELM_WIN_CLASS))
+ {
+ WRN("The top object of %s is not a window.",
+ eo_class_name_get(eo_class_get(default_label_obj)));
+ return;
+ }
+
+ ELM_WIN_DATA_GET(win, sd);
+ if (!sd) return;
+
+ if (eina_list_data_find(sd->default_label_objs, default_label_obj))
+ {
+ sd->default_label_objs =
+ eina_list_remove(sd->default_label_objs, default_label_obj);
+ evas_object_event_callback_del_full(default_label_obj, EVAS_CALLBACK_DEL,
+ _default_label_obj_del_cb, win);
+ }
+}
+
+Evas_Object *
+_elm_win_default_label_obj_get(Evas_Object *obj)
+{
+ if (!obj) return NULL;
+ ELM_WIN_DATA_GET(obj, sd);
+ if (!sd) return NULL;
+
+ return eina_list_last_data_get(sd->default_label_objs);
+}
+//
+
EAPI Ecore_Window
elm_win_window_id_get(const Evas_Object *obj)
{
return ret;
}
-EOLIAN static char*
+EOLIAN static const char*
_elm_win_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Win_Data *sd EINA_UNUSED)
{
- const char *ret = elm_win_title_get(obj);
- return ret ? strdup(ret) : strdup("");
+ const char *ret = NULL;
+ eo_do_super(obj, ELM_WIN_CLASS, ret = elm_interface_atspi_accessible_name_get());
+ if (ret) return ret;
+
+ return _elm_widget_accessible_plain_name_get(obj, elm_win_title_get(obj));
+}
+
+EOLIAN static void
+_elm_win_elm_interface_atspi_component_extents_get(Eo *obj, Elm_Win_Data *sd EINA_UNUSED, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
+{
+ int ee_x, ee_y;
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+ evas_object_geometry_get(obj, NULL, NULL, w, h);
+ if (screen_coords)
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return;
+ ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+ if (x) *x += ee_x;
+ if (y) *y += ee_y;
+ }
}
#include "elm_win.eo.c"
{
ELM_WIN_CHECK(obj) -1;
ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+
+// TIZEN_ONLY(20170212): pend rotation until app set rotation
+ if ((hint) && (!strncmp(hint, "wm.policy.win.rot.render.nopending", strlen(hint))))
+ {
+ return _elm_win_wm_pending_rotation_set(obj, hint, val);
+ }
+//
return ecore_evas_aux_hint_add(sd->ee, hint, val);
}