2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief header file of Window control for HomeScreen
23 #include "ico_uxf_private.h"
24 #include "ico_window_mgr-client-protocol.h"
26 extern Ico_Uxf_Api_Mng gIco_Uxf_Api_Mng;
28 /*--------------------------------------------------------------------------*/
30 * @brief ico_uxf_window_visible_control: window visible control(internal function)
32 * @param[in] winmng process management table
33 * @param[in] show show(1)/hide(0)/nochange(9)
34 * @param[in] raise raise(1)/lower(0)/nochange(9)
37 /*--------------------------------------------------------------------------*/
39 ico_uxf_window_visible_control(Ico_Uxf_Mng_Window *winmng, const int show, const int raise)
41 uifw_trace("ico_uxf_window_visible_control: send visible to weston(%s,%08x,%d,%d)",
42 (winmng->mng_process)->attr.process, winmng->attr.window, show, raise);
43 if ((show == 1) && ((winmng->mng_process)->attr.invisiblecpu == 0) &&
44 ((winmng->mng_process)->attr.suspend != 0)) {
45 /* change to show, application resume */
46 (winmng->mng_process)->attr.suspend = 0;
47 (winmng->mng_process)->susptimer = 0;
48 if ((winmng->mng_process)->susp) {
49 (winmng->mng_process)->susp = 0;
50 uifw_trace("ico_uxf_window_visible_control: CPU resume(%s)",
51 (winmng->mng_process)->attr.process);
52 kill((winmng->mng_process)->attr.internalid, SIGCONT);
56 /* send visible control to Weston(Multi Window Manager) */
57 ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
58 winmng->attr.window, show, raise);
59 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
61 if ((show == 0) && ((winmng->mng_process)->attr.invisiblecpu == 0) &&
62 ((winmng->mng_process)->attr.suspend == 0)) {
63 /* change to hide, application suspend */
64 (winmng->mng_process)->attr.suspend = 1;
65 (winmng->mng_process)->susptimer = ICO_UXF_SUSP_DELAY;
66 gIco_Uxf_Api_Mng.NeedTimer = 1;
67 uifw_trace("ico_uxf_window_visible_control: set CPU suspend(%s)",
68 (winmng->mng_process)->attr.process);
72 /*--------------------------------------------------------------------------*/
74 * @brief ico_uxf_window_layer: Set window layer
76 * @param[in] window window Id
77 * @param[in] layer layer Id
79 * @retval ICO_UXF_EOK success
80 * @retval ICO_UXF_ESRCH error(not initialized)
81 * @retval ICO_UXF_ENOENT error(window or layer dose not exist)
83 /*--------------------------------------------------------------------------*/
85 ico_uxf_window_layer(const int window, const int layer)
87 Ico_Uxf_Mng_Window *winmng;
88 Ico_Uxf_Mng_Layer *layermng;
90 uifw_trace("ico_uxf_window_layer: Enter(%08x,%d)", window, layer);
92 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
93 uifw_warn("ico_uxf_window_layer: Leave(ESRCH)");
97 winmng = ico_uxf_mng_window(window, 0);
98 if ((! winmng) || (! winmng->mng_display)) {
99 uifw_warn("ico_uxf_window_layer: Leave(ENOENT)");
100 return ICO_UXF_ENOENT;
103 layermng = ico_uxf_mng_layer(winmng->attr.display, layer, 0);
104 if ((! layermng) || (! layermng->mng_display)) {
105 uifw_warn("ico_uxf_window_layer: Leave(ENOENT)");
106 return ICO_UXF_ENOENT;
109 uifw_trace("ico_uxf_window_layer: ico_window_mgr_set_window_layer(%08x,%d)",
111 winmng->mng_layer = layermng;
112 ico_window_mgr_set_window_layer(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, layer);
113 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
115 uifw_trace("ico_uxf_window_layer: Leave(EOK)");
119 /*--------------------------------------------------------------------------*/
121 * @brief ico_uxf_layer_visible: Control layer visibility
123 * @param[in] display display Id
124 * @param[in] layer layer Id
125 * @param[in] visible layer show(1)/hide(0)
127 * @retval ICO_UXF_EOK success
128 * @retval ICO_UXF_ESRCH error(not initialized)
129 * @retval ICO_UXF_ENOENT error(layer dose not exist)
131 /*--------------------------------------------------------------------------*/
133 ico_uxf_layer_visible(const int display, const int layer, const int visible)
135 Ico_Uxf_Mng_Layer *layermng;
137 uifw_trace("ico_uxf_layer_visible: Enter(%d,%d,%d)", display, layer, visible);
139 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
140 uifw_warn("ico_uxf_layer_visible: Leave(ESRCH)");
141 return ICO_UXF_ESRCH;
144 layermng = ico_uxf_mng_layer(display, layer, 0);
145 if ((! layermng) || (! layermng->mng_display)) {
146 uifw_warn("ico_uxf_layer_visible: Leave(ENOENT)");
147 return ICO_UXF_ENOENT;
150 uifw_trace("ico_uxf_layer_visible: ico_window_mgr_set_layer_visible(%d,%d)",
152 ico_window_mgr_set_layer_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, layer, visible);
153 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
155 uifw_trace("ico_uxf_layer_visible: Leave(EOK)");
159 /*--------------------------------------------------------------------------*/
161 * @brief ico_uxf_window_resize: resize window(surface) size
163 * @param[in] window window Id(same as ico_window_mgr surface Id)
164 * @param[in] w window width
165 * @param[in] h window height
167 * @retval ICO_UXF_EOK success
168 * @retval ICO_UXF_ESRCH error(not initialized)
169 * @retval ICO_UXF_ENOENT error(layer dose not exist)
171 /*--------------------------------------------------------------------------*/
173 ico_uxf_window_resize(const int window, const int w, const int h)
175 Ico_Uxf_Mng_Window *winmng;
177 uifw_trace("ico_uxf_window_resize: Enter(%08x,%d,%d)", window, w, h);
179 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
180 uifw_warn("ico_uxf_window_resize: Leave(ESRCH)");
181 return ICO_UXF_ESRCH;
184 winmng = ico_uxf_mng_window(window, 0);
185 if ((! winmng) || (! winmng->mng_layer)) {
186 uifw_warn("ico_uxf_window_resize: Leave(ENOENT)");
187 return ICO_UXF_ENOENT;
190 if ((w <= 0) || (w > winmng->mng_layer->attr.w) ||
191 (h <= 0) || (h > winmng->mng_layer->attr.h)) {
192 uifw_warn("ico_uxf_window_resize: Leave(EINVAL)");
193 return ICO_UXF_EINVAL;
199 ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window,
200 winmng->attr.x, winmng->attr.y,
201 winmng->attr.w, winmng->attr.h);
202 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
204 uifw_trace("ico_uxf_window_resize: Leave(EOK)");
208 /*--------------------------------------------------------------------------*/
210 * @brief ico_uxf_window_move: move window(surface) geometry
212 * @param[in] window window Id(same as ico_window_mgr surface Id)
213 * @param[in] x window upper-left X coodinate of display
214 * @param[in] y window upper-left Y coodinate of display
216 * @retval ICO_UXF_EOK success
217 * @retval ICO_UXF_ESRCH error(not initialized)
218 * @retval ICO_UXF_ENOENT error(layer dose not exist)
220 /*--------------------------------------------------------------------------*/
222 ico_uxf_window_move(const int window, const int x, const int y)
224 Ico_Uxf_Mng_Window *winmng;
226 uifw_trace("ico_uxf_window_move: Enter(%08x,%d,%d)", window, x, y);
228 if(gIco_Uxf_Api_Mng.Initialized <= 0) {
229 uifw_warn("ico_uxf_window_move: Leave(ESRCH)");
230 return ICO_UXF_ESRCH;
233 winmng = ico_uxf_mng_window(window, 0);
234 if ((! winmng) || (! winmng->mng_layer)) {
235 uifw_warn("ico_uxf_window_move: Leave(ENOENT)");
236 return ICO_UXF_ENOENT;
242 ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window,
243 winmng->attr.x, winmng->attr.y,
244 winmng->attr.w, winmng->attr.h);
245 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
247 uifw_trace("ico_uxf_window_move: Leave(EOK)");
251 /*--------------------------------------------------------------------------*/
253 * @brief ico_uxf_window_raise: raise window(surface)
255 * @param[in] window window Id(same as ico_window_mgr surface Id)
257 * @retval ICO_UXF_EOK success
258 * @retval ICO_UXF_ESRCH error(not initialized)
259 * @retval ICO_UXF_ENOENT error(layer dose not exist)
261 /*--------------------------------------------------------------------------*/
263 ico_uxf_window_raise(const int window)
265 Ico_Uxf_Mng_Window *winmng;
267 uifw_trace("ico_uxf_window_raise: Enter(%08x)", window);
269 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
270 uifw_warn("ico_uxf_window_raise: Leave(ESRCH)");
271 return ICO_UXF_ESRCH;
274 winmng = ico_uxf_mng_window(window, 0);
275 if ((! winmng) || (! winmng->mng_display)) {
276 uifw_warn("ico_uxf_window_raise: Leave(ENOENT)");
277 return ICO_UXF_ENOENT;
280 ico_uxf_window_visible_control(winmng, 9, 1);
282 uifw_trace("ico_uxf_window_raise: Leave(EOK)");
286 /*--------------------------------------------------------------------------*/
288 * @brief ico_uxf_window_lower: lower window(surface)
290 * @param[in] window window Id(same as ico_window_mgr surface Id)
292 * @retval ICO_UXF_EOK success
293 * @retval ICO_UXF_ESRCH error(not initialized)
294 * @retval ICO_UXF_ENOENT error(layer dose not exist)
296 /*--------------------------------------------------------------------------*/
298 ico_uxf_window_lower(const int window)
300 Ico_Uxf_Mng_Window *winmng;
302 uifw_trace("ico_uxf_window_lower: Enter(%08x)", window);
304 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
305 uifw_warn("ico_uxf_window_lower: Leave(ESRCH)");
306 return ICO_UXF_ESRCH;
309 winmng = ico_uxf_mng_window(window, 0);
310 if ((! winmng) || (! winmng->mng_display)) {
311 uifw_warn("ico_uxf_window_lower: Leave(ENOENT)");
312 return ICO_UXF_ENOENT;
315 ico_uxf_window_visible_control(winmng, 9, 0);
317 uifw_trace("ico_uxf_window_lower: Leave(EOK)");
321 /*--------------------------------------------------------------------------*/
323 * @brief ico_uxf_window_active: active window(surface)
325 * @param[in] window window Id(same as ico_window_mgr surface Id)
326 * @param[in] target target(pointer and/or keyboard)
328 * @retval ICO_UXF_EOK success
329 * @retval ICO_UXF_ESRCH error(not initialized)
330 * @retval ICO_UXF_ENOENT error(layer dose not exist)
332 /*--------------------------------------------------------------------------*/
334 ico_uxf_window_active(const int window, const int target)
336 Ico_Uxf_Mng_Window *winmng;
337 Ico_Uxf_Mng_Process *proc;
338 Ico_Uxf_Mng_Process *aproc;
341 uifw_trace("ico_uxf_window_active: Enter(%08x,%x)", window, target);
343 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
344 uifw_warn("ico_uxf_window_active: Leave(ESRCH)");
345 return ICO_UXF_ESRCH;
348 winmng = ico_uxf_mng_window(window, 0);
349 if ((! winmng) || (! winmng->mng_display)) {
350 uifw_warn("ico_uxf_window_active: Leave(ENOENT)");
351 return ICO_UXF_ENOENT;
354 uifw_trace("ico_uxf_window_active: ico_window_mgr_set_active(%08x)", window);
355 ico_window_mgr_set_active(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, target);
356 wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
358 /* reset all active window widthout target window */
359 for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) {
360 winmng = gIco_Uxf_Api_Mng.Hash_WindowId[hash];
362 if (winmng->attr.window == window) {
363 winmng->attr.active = target;
367 winmng->attr.active = 0;
370 winmng->attr.active &= ~target;
373 winmng = winmng->nextidhash;
377 /* reset all active application without this application */
379 for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) {
380 proc = gIco_Uxf_Api_Mng.Hash_ProcessId[hash];
382 if (proc->attr.mainwin.window == window) {
387 proc->attr.active = 0;
390 proc->attr.active &= ~target;
393 proc = proc->nextidhash;
396 aproc->attr.active = target;
398 uifw_trace("ico_uxf_window_active: Leave(EOK)");
402 /*--------------------------------------------------------------------------*/
404 * @brief ico_uxf_window_event_mask: set window(surface) event mask
406 * @param[in] window window Id(same as ico_window_mgr surface Id)
407 * @param[in] mask event mask
409 * @retval ICO_UXF_EOK success
410 * @retval ICO_UXF_ESRCH error(not initialized)
411 * @retval ICO_UXF_ENOENT error(layer dose not exist)
413 /*--------------------------------------------------------------------------*/
415 ico_uxf_window_event_mask(const int window, const unsigned int mask)
417 Ico_Uxf_Mng_Window *winmng;
419 uifw_trace("ico_uxf_window_event_mask: Enter(%08x,%08x)", window, mask);
421 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
422 uifw_warn("ico_uxf_window_event_mask: Leave(ESRCH)");
423 return ICO_UXF_ESRCH;
426 winmng = ico_uxf_mng_window(window, 0);
428 uifw_warn("ico_uxf_window_event_mask: Leave(ENOENT)");
429 return ICO_UXF_ENOENT;
432 winmng->attr.eventmask = mask;
434 uifw_trace("ico_uxf_window_event_mask: Leave(EOK)");
438 /*--------------------------------------------------------------------------*/
440 * @brief ico_uxf_window_attribute_get: get window(surface) attribute
442 * @param[in] window window Id(same as ico_window_mgr surface Id)
443 * @param[out] attr window attribute
445 * @retval ICO_UXF_EOK success
446 * @retval ICO_UXF_ESRCH error(not initialized)
447 * @retval ICO_UXF_ENOENT error(layer dose not exist)
449 /*--------------------------------------------------------------------------*/
451 ico_uxf_window_attribute_get(const int window, Ico_Uxf_WindowAttr *attr)
453 Ico_Uxf_Mng_Window *winmng;
455 uifw_trace("ico_uxf_window_attribute_get: Enter(%08x)", window);
457 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
458 uifw_warn("ico_uxf_window_attribute_get: Leave(ESRCH)");
459 return ICO_UXF_ESRCH;
462 winmng = ico_uxf_mng_window(window, 0);
464 uifw_warn("ico_uxf_window_attribute_get: Leave(ENOENT)");
465 return ICO_UXF_ENOENT;
468 memcpy((char *)attr, (char *)&(winmng->attr), sizeof(Ico_Uxf_WindowAttr));
470 uifw_trace("ico_uxf_window_attribute_get: Leave(EOK)");
474 /*--------------------------------------------------------------------------*/
476 * @brief ico_uxf_window_query_windows: get all windows attribute
478 * @param[in] display target display Id
479 * @param[out] attr window attribute array
480 * @param[in] num number of window attribute area
482 * @retval >= 0 success(number of windows)
483 * @retval ICO_UXF_ESRCH error(not initialized)
484 * @retval ICO_UXF_EINVAL error(illegal parameter 'num')
485 * @retval ICO_UXF_E2BIG error(number of windows over 'num')
487 /*--------------------------------------------------------------------------*/
489 ico_uxf_window_query_windows(const int display, Ico_Uxf_WindowAttr attr[], const int num)
492 Ico_Uxf_Mng_Window *winmng;
495 uifw_trace("ico_uxf_window_query_windows: Enter(%d,,%d)", display, num);
497 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
498 uifw_warn("ico_uxf_window_query_windows: Leave(ESRCH)");
499 return ICO_UXF_ESRCH;
503 uifw_warn("ico_uxf_window_query_windows: Leave(EINVAL)");
504 return ICO_UXF_EINVAL;
508 for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) {
509 winmng = gIco_Uxf_Api_Mng.Hash_WindowId[hash];
512 memcpy((char *)(&attr[n]), (char *)&(winmng->attr), sizeof(Ico_Uxf_WindowAttr));
514 winmng = winmng->nextidhash;
520 uifw_trace("ico_uxf_window_query_windows: Leave(E2BIG)");
523 uifw_trace("ico_uxf_window_query_windows: Leave(%d)", n);
528 /*--------------------------------------------------------------------------*/
530 * @brief ico_uxf_window_control: target window control from AppsController
532 * @param[in] appid Application Id
533 * @param[in] winidx Window index
534 * @param[in] control Window control
535 * ICO_UXF_APPSCTL_INVISIBLE: Invisible by low priority
536 * ICO_UXF_APPSCTL_REGULATION: Invisible by regulation
537 * ICO_UXF_APPSCTL_TEMPVISIBLE: Visible as HomeScreen menu
538 * @param[in] onoff Flag On(1)/Off(0)
539 * ICO_UXF_APPSCTL_INVISIBLE: On(1) is invisible
540 * ICO_UXF_APPSCTL_REGULATION: On(1) is invisible
541 * ICO_UXF_APPSCTL_TEMPVISIBLE: On(1) is visible(menu)
543 * @retval ICO_UXF_EOK success
544 * @retval ICO_UXF_ESRCH error(not initialized)
545 * @retval ICO_UXF_ENOENT error(not exist)
547 /*--------------------------------------------------------------------------*/
549 ico_uxf_window_control(const char *appid, const int winidx,
550 const int control, const int onoff)
552 #define MAX_APP_WINDOWS 20
553 Ico_Uxf_ProcessWin procattr[MAX_APP_WINDOWS];
555 Ico_Uxf_Mng_Window *winmng; /* window management table */
560 uifw_trace("ico_uxf_window_control: Enter(%s,%d,%x,%d)",
561 appid, winidx, control, onoff);
563 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
564 uifw_warn("ico_uxf_window_control: Leave(ESRCH)");
565 return ICO_UXF_ESRCH;
568 if (control == ICO_UXF_APPSCTL_TEMPVISIBLE) {
569 if (onoff != gIco_Uxf_Api_Mng.AppsCtlVisible) {
570 if (onoff > 0) gIco_Uxf_Api_Mng.AppsCtlVisible = 1;
571 else gIco_Uxf_Api_Mng.AppsCtlVisible = 0;
573 /* control all windows */
574 for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) {
575 winmng = gIco_Uxf_Api_Mng.Hash_WindowId[hash];
577 if ((winmng->attr.window > 0) && (winmng->attr.visible)) {
578 if ((winmng->mng_process)->attr.noicon == 0) {
579 if ((gIco_Uxf_Api_Mng.AppsCtlVisible != 0) ||
580 (winmng->attr.control == 0)) {
588 if ((gIco_Uxf_Api_Mng.AppsCtlVisible == 0) &&
589 (winmng->attr.control == 0)) {
596 ico_uxf_window_visible_control(winmng, i, 9);
598 winmng = winmng->nextidhash;
602 uifw_trace("ico_uxf_window_control: Leave(EOK)");
605 /* get current application status */
607 nwin = ico_uxf_process_window_get_one(appid, procattr, winidx);
608 if (nwin == 0) nwin = 1;
612 nwin = ico_uxf_process_window_get(appid, procattr, MAX_APP_WINDOWS);
614 if (nwin == ICO_UXF_E2BIG) nwin = MAX_APP_WINDOWS;
616 uifw_trace("ico_uxf_window_control: Leave(Unknown appid(%s))", appid);
617 return ICO_UXF_ENOENT;
619 for (i = 0; i < nwin; i++) {
620 if (procattr[i].window == 0) continue;
621 winmng = ico_uxf_mng_window(procattr[i].window, 0);
623 uifw_trace("ico_uxf_window_control: winid=%08x not exist",
627 newcontrol = winmng->attr.control;
628 if (onoff) newcontrol |= control;
629 else newcontrol &= (~control);
631 uifw_trace("ico_uxf_window_control: control %08x(%s) %02x=>%02x vis=%d icon=%d",
632 procattr[i].window, (winmng->mng_process)->attr.process,
633 winmng->attr.control, newcontrol, winmng->attr.visible,
634 (winmng->mng_process)->attr.noicon);
635 if (winmng->attr.control != newcontrol) {
636 winmng->attr.control = newcontrol;
637 if (winmng->attr.visible != 0) {
638 if (gIco_Uxf_Api_Mng.AppsCtlVisible != 0) {
639 if ((winmng->mng_process)->attr.noicon == 0) newcontrol = 0;
642 /* request to Weston(Multi Window Manager) */
643 ico_uxf_window_visible_control(winmng,
644 (newcontrol != 0) ? 0 : 1, 9);
647 uifw_trace("ico_uxf_window_control: Leave(EOK) control=%x(%d) visible=%d",
648 winmng->attr.control, gIco_Uxf_Api_Mng.AppsCtlVisible,
649 winmng->attr.visible);
655 /*--------------------------------------------------------------------------*/
657 * @brief ico_uxf_window_show: show a target window
658 * if target window's state is visible, do nothing and return success
660 * @param[in] window Window identity
662 * @retval ICO_UXF_EOK success
663 * @retval ICO_UXF_ESRCH error(not initialized)
664 * @retval ICO_UXF_ENOENT error(not exist)
666 /*--------------------------------------------------------------------------*/
668 ico_uxf_window_show(const int window)
670 Ico_Uxf_Mng_Window *winmng; /* window management table */
672 uifw_trace("ico_uxf_window_show: Enter(%08x)", window);
674 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
675 uifw_warn("ico_uxf_window_show: Leave(ESRCH)");
676 return ICO_UXF_ESRCH;
679 winmng = ico_uxf_mng_window(window, 0);
680 if ((! winmng) || (! winmng->mng_display)) {
681 uifw_warn("ico_uxf_window_show: Leave(ENOENT)");
682 return ICO_UXF_ENOENT;
684 winmng->attr.visible = 1;
686 if (winmng->attr.control == 0) {
687 /* request to display to Weston(Multi Window Manager) */
688 ico_uxf_window_visible_control(winmng, 1, 9);
690 uifw_trace("ico_uxf_window_show: Leave(EOK) control=%x", winmng->attr.control);
694 /*--------------------------------------------------------------------------*/
696 * @brief ico_uxf_window_hide: hide a target window
697 * if target window's state is unvisible, do nothing and return success
699 * @param[in] window target window identity
701 * @retval ICO_UXF_EOK success
702 * @retval ICO_UXF_ESRCH error(not initialized)
703 * @retval ICO_UXF_ENOENT error(not exist)
705 /*--------------------------------------------------------------------------*/
707 ico_uxf_window_hide(const int window)
709 Ico_Uxf_Mng_Window *winmng; /* window management table */
711 uifw_trace("ico_uxf_window_hide: Enter(%08x)", window);
713 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
714 uifw_warn("ico_uxf_window_hide: Leave(ESRCH)");
715 return ICO_UXF_ESRCH;
718 winmng = ico_uxf_mng_window(window, 0);
719 if ((! winmng) || (! winmng->mng_display)) {
720 uifw_warn("ico_uxf_window_hide: Leave(ENOENT)");
721 return ICO_UXF_ENOENT;
723 winmng->attr.visible = 0;
725 /* request to hide to Weston(Multi Window Manager) */
726 ico_uxf_window_visible_control(winmng, 0, 9);
728 uifw_trace("ico_uxf_window_hide: Leave(EOK)");
732 /*--------------------------------------------------------------------------*/
734 * @brief ico_uxf_window_visible_raise: control status of visible(show/hide)
735 * and order(raise/lower)
737 * @param[in] window target window identity
738 * @param[in] visible visible(1)/unvisible(0)
739 * @param[in] raise forefront(1)/maximum back(0)
741 * @retval ICO_UXF_EOK success
742 * @retval ICO_UXF_ESRCH error(not initialized)
743 * @retval ICO_UXF_ENOENT error(not exist)
745 /*--------------------------------------------------------------------------*/
747 ico_uxf_window_visible_raise(const int window, const int visible, const int raise)
749 Ico_Uxf_Mng_Window *winmng; /* window management table */
752 uifw_trace("ico_uxf_window_visible_raise: Enter(%08x,%d,%d)", window, visible, raise);
754 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
755 uifw_warn("ico_uxf_window_visible_raise: Leave(ESRCH)");
756 return ICO_UXF_ESRCH;
759 winmng = ico_uxf_mng_window(window, 0);
760 if ((! winmng) || (! winmng->mng_display)) {
761 uifw_warn("ico_uxf_window_visible_raise: Leave(ENOENT)");
762 return ICO_UXF_ENOENT;
766 winmng->attr.visible = 0;
769 winmng->attr.visible = 1;
770 if (gIco_Uxf_Api_Mng.AppsCtlVisible == 0) {
771 /* application screen */
772 if (winmng->attr.control != 0) {
773 uifw_trace("ico_uxf_window_visible_raise: change to hide(ctrl=%x menu=0)",
774 winmng->attr.control);
779 /* HomeScreen menu screen */
780 if ((winmng->mng_process)->attr.noicon != 0) {
781 uifw_trace("ico_uxf_window_visible_raise: change to hide(ctrl=%x menu=1)",
782 winmng->attr.control);
788 if ((vis != 9) || (raise != 9)) {
789 /* request to visible status and order status to Weston(Multi Window Manager) */
790 ico_uxf_window_visible_control(winmng, vis, raise);
792 uifw_trace("ico_uxf_window_visible_raise: Leave(EOK)");
796 /*--------------------------------------------------------------------------*/
798 * @brief ico_uxf_window_animation: set window animation
800 * @param[in] window Window identity
801 * @param[in] animation Animation name
803 * @retval ICO_UXF_EOK success
804 * @retval ICO_UXF_ESRCH error(not initialized)
805 * @retval ICO_UXF_ENOENT error(not exist)
807 /*--------------------------------------------------------------------------*/
809 ico_uxf_window_animation(const int window, const char *animation)
811 Ico_Uxf_Mng_Window *winmng; /* window management table */
814 uifw_trace("ico_uxf_window_animation: Enter(%08x, %s)",
815 window, animation ? animation : "NULL");
817 if (gIco_Uxf_Api_Mng.Initialized <= 0) {
818 uifw_warn("ico_uxf_window_animation: Leave(ESRCH)");
819 return ICO_UXF_ESRCH;
822 winmng = ico_uxf_mng_window(window, 0);
823 if ((! winmng) || (! winmng->mng_display)) {
824 uifw_warn("ico_uxf_window_animation: Leave(ENOENT)");
825 return ICO_UXF_ENOENT;
829 ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
830 winmng->attr.window, animation);
835 ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
836 winmng->attr.window, nullname);
838 uifw_trace("ico_uxf_window_animation: Leave(EOK)");