2 Copyright (C) 2011 Samsung Electronics
3 Copyright (C) 2012 Intel Corporation. All rights reserved.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 #include "InputMethodContextEfl.h"
24 #include "EwkViewImpl.h"
25 #include "WebPageProxy.h"
26 #include <Ecore_Evas.h>
27 #include <Ecore_IMF_Evas.h>
29 using namespace WebCore;
33 InputMethodContextEfl::InputMethodContextEfl(EwkViewImpl* viewImpl, PassOwnPtr<Ecore_IMF_Context> context)
34 : m_viewImpl(viewImpl)
37 #if ENABLE(TIZEN_ISF_PORT)
38 , m_useInputMethod(false)
39 , m_state(ECORE_IMF_INPUT_PANEL_STATE_HIDE)
40 , m_inputPickerType(-1)
44 #if ENABLE(TIZEN_ISF_PORT)
45 initializeIMFContext(m_context.get(), ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL);
47 ecore_imf_context_event_callback_add(m_context.get(), ECORE_IMF_CALLBACK_PREEDIT_CHANGED, onIMFPreeditSequenceChanged, this);
48 ecore_imf_context_event_callback_add(m_context.get(), ECORE_IMF_CALLBACK_COMMIT, onIMFInputSequenceComplete, this);
52 InputMethodContextEfl::~InputMethodContextEfl()
56 #if ENABLE(TIZEN_ISF_PORT)
57 void InputMethodContextEfl::onIMFInputPanelStateChanged(void* data, Ecore_IMF_Context*, int state)
59 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
61 inputMethodContext->setState(state);
63 if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
64 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
65 if (inputMethodContext->m_viewImpl->pageClient->isClipboardWindowOpened())
66 inputMethodContext->m_viewImpl->pageClient->closeClipboardWindow();
68 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,ime,closed", 0);
69 } else if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW)
70 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,ime,opened", 0);
73 void InputMethodContextEfl::onIMFInputPanelGeometryChanged(void* data, Ecore_IMF_Context*, int value)
75 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
78 ecore_imf_context_input_panel_geometry_get(inputMethodContext->m_context.get(), &rect.x, &rect.y, &rect.w, &rect.h);
79 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "inputmethod,changed", &rect);
81 inputMethodContext->setIMERect(IntRect(rect.x, rect.y, rect.w, rect.h));
84 void InputMethodContextEfl::onIMFCandidatePanelStateChanged(void* data, Ecore_IMF_Context*, int state)
86 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
88 if (state == ECORE_IMF_CANDIDATE_PANEL_SHOW)
89 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,candidate,opened", 0);
91 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,candidate,closed", 0);
94 void InputMethodContextEfl::onIMFCandidatePanelGeometryChanged(void* data, Ecore_IMF_Context*, int)
96 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
99 ecore_imf_context_candidate_panel_geometry_get(inputMethodContext->m_context.get(), &rect.x, &rect.y, &rect.w, &rect.h);
100 evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,candidate,changed", &rect);
103 Eina_Bool InputMethodContextEfl::onIMFRetrieveSurrounding(void* data, Ecore_IMF_Context*, char** text, int* offset)
105 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
106 if (!inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused || (!text && !offset))
109 String surroundingText;
111 inputMethodContext->m_viewImpl->page()->getSurroundingTextAndCursorOffset(surroundingText, cursorOffset);
114 CString utf8Text(surroundingText.utf8());
115 size_t length = utf8Text.length();
117 *text = static_cast<char*>(malloc((length + 1) * sizeof(char)));
122 strncpy(*text, utf8Text.data(), length);
127 *offset = cursorOffset;
132 void InputMethodContextEfl::onIMFDeleteSurrounding(void* data, Ecore_IMF_Context*, void* eventInfo)
134 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
135 if (!eventInfo || !inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused)
138 Ecore_IMF_Event_Delete_Surrounding* event = static_cast<Ecore_IMF_Event_Delete_Surrounding*>(eventInfo);
139 inputMethodContext->m_viewImpl->page()->deleteSurroundingText(event->offset, event->n_chars);
142 void InputMethodContextEfl::onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo)
144 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
145 if (!eventInfo || !inputMethodContext->m_focused)
148 inputMethodContext->m_viewImpl->page()->confirmComposition(String::fromUTF8(static_cast<char*>(eventInfo)));
151 #if ENABLE(TIZEN_WEBKIT2_SUPPORT_JAPANESE_IME)
152 unsigned getUTF8CharacterIndex(const char* string, unsigned byteIndex)
155 const char* end = string + byteIndex;
157 while (*string && string < end) {
160 if ((*string & 0x80) == 0x00)
162 else if ((*string & 0xe0) == 0xc0)
164 else if ((*string & 0xf0) == 0xe0)
166 else if ((*string & 0xf8) == 0xf0)
168 else if ((*string & 0xfc) == 0xf8)
170 else if ((*string & 0xfe) == 0xfc)
176 while (*string && offset--)
184 void InputMethodContextEfl::onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context* context, void*)
186 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
188 if (!inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused)
191 WebPageProxy* page = inputMethodContext->m_viewImpl->page();
192 if (!page->focusedFrame())
195 PageClientImpl* pageClient = inputMethodContext->m_viewImpl->pageClient.get();
197 page->getCaretPosition(caretRect);
198 caretRect.scale(pageClient->scaleFactor());
201 evas_object_geometry_get(inputMethodContext->m_viewImpl->view(), &viewX, &viewY, 0, 0);
203 int x = caretRect.x() - pageClient->scrollPosition().x() + viewX;
204 int y = caretRect.y() - pageClient->scrollPosition().y() + viewY;
205 int w = caretRect.width();
206 int h = caretRect.height();
207 ecore_imf_context_cursor_location_set(context, x, y, w, h);
210 Eina_List* preeditAttrs = 0;
211 int cursorPosition = 0;
213 ecore_imf_context_preedit_string_with_attributes_get(context, &buffer, &preeditAttrs, &cursorPosition);
215 String preeditString = String::fromUTF8(buffer);
216 Vector<CompositionUnderline> underlines;
220 #if ENABLE(TIZEN_WEBKIT2_SUPPORT_JAPANESE_IME)
221 Eina_List* listIterator = 0;
222 EINA_LIST_FOREACH(preeditAttrs, listIterator, item) {
223 Ecore_IMF_Preedit_Attr* preeditAttr = static_cast<Ecore_IMF_Preedit_Attr*>(item);
225 unsigned startIndex = getUTF8CharacterIndex(buffer, preeditAttr->start_index);
226 unsigned endIndex = getUTF8CharacterIndex(buffer, preeditAttr->end_index);
227 switch (preeditAttr->preedit_type) {
228 case ECORE_IMF_PREEDIT_TYPE_SUB1:
229 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), false));
231 case ECORE_IMF_PREEDIT_TYPE_SUB2:
232 case ECORE_IMF_PREEDIT_TYPE_SUB3:
233 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), Color(255, 255, 255), false));
235 case ECORE_IMF_PREEDIT_TYPE_SUB4:
236 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), Color(46, 168, 255), false));
238 case ECORE_IMF_PREEDIT_TYPE_SUB5:
239 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), Color(153, 98, 195), false));
241 case ECORE_IMF_PREEDIT_TYPE_SUB6:
242 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), Color(118, 222, 55), false));
244 case ECORE_IMF_PREEDIT_TYPE_SUB7:
245 underlines.append(CompositionUnderline(startIndex, endIndex, Color(0, 0, 0), Color(153, 153, 153), false));
252 EINA_LIST_FREE(preeditAttrs, item)
256 if (underlines.isEmpty())
257 underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
259 page->setComposition(preeditString, underlines, cursorPosition);
265 void InputMethodContextEfl::onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo)
267 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
268 if (!eventInfo || !inputMethodContext->m_focused)
271 inputMethodContext->m_viewImpl->page()->confirmComposition(String::fromUTF8(static_cast<char*>(eventInfo)));
274 void InputMethodContextEfl::onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context* context, void*)
276 InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
278 if (!inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused)
282 ecore_imf_context_preedit_string_get(context, &buffer, 0);
286 String preeditString = String::fromUTF8(buffer);
288 Vector<CompositionUnderline> underlines;
289 underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
290 inputMethodContext->m_viewImpl->page()->setComposition(preeditString, underlines, 0);
294 PassOwnPtr<Ecore_IMF_Context> InputMethodContextEfl::createIMFContext(Evas* canvas)
296 const char* defaultContextID = ecore_imf_context_default_id_get();
297 if (!defaultContextID)
300 OwnPtr<Ecore_IMF_Context> imfContext = adoptPtr(ecore_imf_context_add(defaultContextID));
304 Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(canvas);
305 ecore_imf_context_client_window_set(imfContext.get(), reinterpret_cast<void*>(ecore_evas_window_get(ecoreEvas)));
306 ecore_imf_context_client_canvas_set(imfContext.get(), canvas);
308 return imfContext.release();
311 void InputMethodContextEfl::handleMouseUpEvent(const Evas_Event_Mouse_Up*)
313 ecore_imf_context_reset(m_context.get());
316 void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEvent, bool* isFiltered)
318 Ecore_IMF_Event inputMethodEvent;
319 ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(downEvent), &inputMethodEvent.key_down);
321 *isFiltered = ecore_imf_context_filter_event(m_context.get(), ECORE_IMF_EVENT_KEY_DOWN, &inputMethodEvent);
324 #if ENABLE(TIZEN_ISF_PORT)
325 void InputMethodContextEfl::updateTextInputState()
327 const EditorState& editor = m_viewImpl->page()->editorState();
328 if (editor.shouldIgnoreCompositionSelectionChange)
331 if (editor.isContentEditable && m_useInputMethod) {
332 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
333 if (m_viewImpl->pageClient->isClipboardWindowOpened())
334 m_viewImpl->pageClient->closeClipboardWindow();
336 showIMFContext(editor);
341 ecore_imf_context_cursor_position_set(m_context.get(), editor.cursorPosition);
344 void InputMethodContextEfl::updateTextInputState()
349 const EditorState& editor = m_viewImpl->page()->editorState();
351 if (editor.isContentEditable) {
355 ecore_imf_context_reset(m_context.get());
356 ecore_imf_context_focus_in(m_context.get());
362 if (editor.hasComposition)
363 m_viewImpl->page()->cancelComposition();
366 ecore_imf_context_reset(m_context.get());
367 ecore_imf_context_focus_out(m_context.get());
372 #if ENABLE(TIZEN_ISF_PORT)
373 void InputMethodContextEfl::initializeIMFContext(Ecore_IMF_Context* context, Ecore_IMF_Input_Panel_Layout layout)
375 ecore_imf_context_input_panel_enabled_set(context, false);
376 ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, onIMFInputPanelStateChanged, this);
377 ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, onIMFInputPanelGeometryChanged, this);
378 ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, onIMFCandidatePanelStateChanged, this);
379 ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT, onIMFCandidatePanelGeometryChanged, this);
380 ecore_imf_context_retrieve_surrounding_callback_set(context, onIMFRetrieveSurrounding, this);
381 ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, onIMFDeleteSurrounding, this);
382 ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, onIMFPreeditSequenceChanged, this);
383 ecore_imf_context_event_callback_add(context, ECORE_IMF_CALLBACK_COMMIT, onIMFInputSequenceComplete, this);
384 ecore_imf_context_input_panel_layout_set(m_context.get(), layout);
387 void InputMethodContextEfl::setUseInputMethod(bool use)
389 m_useInputMethod = use;
390 updateTextInputState();
393 Ecore_IMF_Input_Panel_Layout InputMethodContextEfl::layoutType(const String& type)
395 if (type == "number")
396 return ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER;
397 else if (type == "email")
398 return ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL;
399 else if (type == "url")
400 return ECORE_IMF_INPUT_PANEL_LAYOUT_URL;
401 else if (type == "tel")
402 return ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER;
403 else if (type == "password")
404 return ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD;
406 return ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
409 void InputMethodContextEfl::setIMFContext(Ecore_IMF_Input_Panel_Layout layout, const String& type)
411 if (m_contextList.contains(layout)) {
413 m_context = m_contextList.take(layout);
414 } else if (!m_context || ecore_imf_context_input_panel_layout_get(m_context.get()) != layout) {
415 OwnPtr<Ecore_IMF_Context> context = createIMFContext(evas_object_evas_get(m_viewImpl->view()));
418 m_context = context.release();
419 initializeIMFContext(m_context.get(), layout);
422 if (type == "password" || type == "plugin")
423 ecore_imf_context_prediction_allow_set(m_context.get(), false);
425 ecore_imf_context_prediction_allow_set(m_context.get(), true);
427 if (type.isEmpty() || type == "textarea")
428 ecore_imf_context_autocapital_type_set(m_context.get(), ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
430 ecore_imf_context_autocapital_type_set(m_context.get(), ECORE_IMF_AUTOCAPITAL_TYPE_NONE);
433 bool InputMethodContextEfl::isShow()
435 return (m_context && m_focused && ecore_imf_context_input_panel_state_get(m_context.get()) != ECORE_IMF_INPUT_PANEL_STATE_HIDE);
438 Ecore_IMF_Autocapital_Type InputMethodContextEfl::autoCapitalType()
440 return (m_context ? ecore_imf_context_autocapital_type_get(m_context.get()) : ECORE_IMF_AUTOCAPITAL_TYPE_NONE);
443 void InputMethodContextEfl::onFocusIn()
445 if (m_inputPickerType >= 0) {
446 showInputPicker(m_viewImpl->page()->editorState());
450 if (!m_context || !m_focused)
453 ecore_imf_context_focus_in(m_context.get());
454 ecore_imf_context_input_panel_show(m_context.get());
457 void InputMethodContextEfl::onFocusOut()
459 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
460 if (m_state != ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
461 if (m_viewImpl->pageClient->isClipboardWindowOpened())
462 m_viewImpl->pageClient->closeClipboardWindow();
466 if (!m_context || !m_focused)
469 ecore_imf_context_input_panel_hide(m_context.get());
470 ecore_imf_context_focus_out(m_context.get());
473 void InputMethodContextEfl::revertIMFContext()
478 PassOwnPtr<Ecore_IMF_Context> imfContext = m_context.release();
479 int layout = ecore_imf_context_input_panel_layout_get(imfContext.get());
480 m_contextList.add(layout, imfContext);
483 void InputMethodContextEfl::resetIMFContext()
488 ecore_imf_context_reset(m_context.get());
491 void InputMethodContextEfl::showIMFContext(const EditorState& editor)
493 Ecore_IMF_Input_Panel_Layout layout = layoutType(editor.inputMethodHints);
495 if (m_context && m_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE && layout == ecore_imf_context_input_panel_layout_get(m_context.get()))
498 Ewk_Settings* settings = ewk_view_settings_get(m_viewImpl->view());
499 bool defaultKeypadEnabled = ewk_settings_default_keypad_enabled_get(settings);
501 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
502 if (editor.inputMethodHints == "date")
503 m_inputPickerType = EWK_INPUT_TYPE_DATE;
504 else if (editor.inputMethodHints == "datetime")
505 m_inputPickerType = EWK_INPUT_TYPE_DATETIME;
506 else if (editor.inputMethodHints == "datetime-local")
507 m_inputPickerType = EWK_INPUT_TYPE_DATETIMELOCAL;
508 else if (editor.inputMethodHints == "month")
509 m_inputPickerType = EWK_INPUT_TYPE_MONTH;
510 else if (editor.inputMethodHints == "time")
511 m_inputPickerType = EWK_INPUT_TYPE_TIME;
512 else if (editor.inputMethodHints == "week")
513 m_inputPickerType = EWK_INPUT_TYPE_WEEK;
515 m_inputPickerType = -1;
517 if (m_inputPickerType >= 0) {
518 showInputPicker(editor);
522 #if ENABLE(TIZEN_DATALIST_ELEMENT)
523 Vector<String> optionList = m_viewImpl->page()->getFocusedInputElementDataList();
524 if (optionList.size() > 0) {
525 if (editor.selectionIsRange || !evas_object_focus_get(m_viewImpl->view()))
528 if (editor.inputMethodHints == "tel")
529 ewkViewDataListShowRequest(m_viewImpl->view(), EWK_INPUT_TYPE_TELEPHONE, optionList);
530 else if (editor.inputMethodHints == "number")
531 ewkViewDataListShowRequest(m_viewImpl->view(), EWK_INPUT_TYPE_NUMBER, optionList);
532 else if (editor.inputMethodHints == "email")
533 ewkViewDataListShowRequest(m_viewImpl->view(), EWK_INPUT_TYPE_EMAIL, optionList);
534 else if (editor.inputMethodHints == "url")
535 ewkViewDataListShowRequest(m_viewImpl->view(), EWK_INPUT_TYPE_URL, optionList);
537 ewkViewDataListShowRequest(m_viewImpl->view(), EWK_INPUT_TYPE_TEXT, optionList);
542 #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
544 bool hasFocus = evas_object_focus_get(m_viewImpl->view());
546 if (!defaultKeypadEnabled) {
548 Eina_Rectangle dummyRectForCustomKeypadCallback;
549 memset(&dummyRectForCustomKeypadCallback, 0, sizeof(Eina_Rectangle));
550 evas_object_smart_callback_call(m_viewImpl->view(), "inputmethod,changed", &dummyRectForCustomKeypadCallback);
555 setIMFContext(layout, editor.inputMethodHints);
562 ecore_imf_context_reset(m_context.get());
563 ecore_imf_context_focus_in(m_context.get());
564 ecore_imf_context_input_panel_show(m_context.get());
566 // input field zoom for external keyboard
567 ewk_view_focused_node_adjust(m_viewImpl->view(), EINA_TRUE);
570 m_state = ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW;
573 void InputMethodContextEfl::hideIMFContext()
575 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
576 if (m_state != ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
577 if (m_viewImpl->pageClient->isClipboardWindowOpened())
578 m_viewImpl->pageClient->closeClipboardWindow();
582 m_inputPickerType = -1;
584 if (!m_context || !m_focused)
587 if (m_viewImpl->page()->editorState().hasComposition)
588 m_viewImpl->page()->cancelComposition();
592 if (ecore_imf_context_input_panel_state_get(m_context.get()) != ECORE_IMF_INPUT_PANEL_STATE_HIDE
593 && evas_object_focus_get(m_viewImpl->view())) {
594 ecore_imf_context_reset(m_context.get());
595 ecore_imf_context_input_panel_hide(m_context.get());
596 ecore_imf_context_focus_out(m_context.get());
602 void InputMethodContextEfl::destroyIMFContextList()
604 m_contextList.clear();
607 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
608 void InputMethodContextEfl::showInputPicker(const EditorState& editorState)
610 if (editorState.selectionIsRange || !evas_object_focus_get(m_viewImpl->view()))
613 ewkViewInputPickerRequest(m_viewImpl->view(), static_cast<Ewk_Input_Type>(m_inputPickerType), editorState.surroundingText);
614 m_inputPickerType = -1;
618 bool InputMethodContextEfl::isIMEPostion(int x, int y)
620 if (m_state == ECORE_IMF_INPUT_PANEL_STATE_SHOW)
621 return m_imeRect.contains(x, y);