the repository of RSA merge with private repository.
authorShawn Lee <shiin.lee@samsung.com>
Thu, 27 Jun 2013 08:40:00 +0000 (17:40 +0900)
committerShawn Lee <shiin.lee@samsung.com>
Thu, 27 Jun 2013 08:40:00 +0000 (17:40 +0900)
87 files changed:
AUTHORS
comp-tizen/data/group/shadow_fade.edc
comp-tizen/src/e_mod_comp.c
comp-tizen/src/e_mod_comp.h
comp-tizen/src/e_mod_comp_atoms.c
comp-tizen/src/e_mod_comp_atoms.h
comp-tizen/src/e_mod_comp_canvas.c
comp-tizen/src/e_mod_comp_canvas.h
comp-tizen/src/e_mod_comp_debug.c
comp-tizen/src/e_mod_comp_effect.c
comp-tizen/src/e_mod_comp_effect.h
comp-tizen/src/e_mod_comp_effect_win_rotation.c
comp-tizen/src/e_mod_comp_effect_win_rotation.h
comp-tizen/src/e_mod_comp_object.c
comp-tizen/src/e_mod_comp_policy.c
comp-tizen/src/e_mod_comp_shared_types.h
comp-tizen/src/e_mod_comp_util.c
comp-tizen/src/e_mod_comp_util.h
devicemgr/src/e_devicemgr_privates.h
devicemgr/src/e_mod_config.c
devicemgr/src/e_mod_drv.c
devicemgr/src/e_mod_main.c
devicemgr/src/e_mod_scrnconf.c
devicemgr/src/e_mod_scrnconf.h [changed mode: 0644->0755]
devicemgr/src/hib_devicemgr.c [changed mode: 0644->0755]
devicemgr/src/virt_monitor_devicemgr.c [changed mode: 0644->0755]
devmode-tizen/AUTHORS [new file with mode: 0644]
devmode-tizen/Makefile.am [new file with mode: 0644]
devmode-tizen/autogen.sh [new file with mode: 0755]
devmode-tizen/configure.ac [new file with mode: 0644]
devmode-tizen/data/Makefile.am [new file with mode: 0644]
devmode-tizen/data/e_mod_devmode.edc [new file with mode: 0644]
devmode-tizen/data/images/black_white_dot.png [new file with mode: 0644]
devmode-tizen/data/images/icon_settings.png [new file with mode: 0644]
devmode-tizen/images/touch_feedback.png [new file with mode: 0644]
devmode-tizen/include/e_mod_devmode.h [new file with mode: 0644]
devmode-tizen/include/e_mod_devmode_define.h [new file with mode: 0644]
devmode-tizen/include/e_mod_devmode_log.h [new file with mode: 0644]
devmode-tizen/module.desktop.in [new file with mode: 0644]
devmode-tizen/src/Makefile.am [new file with mode: 0644]
devmode-tizen/src/e_mod_config.c [new file with mode: 0644]
devmode-tizen/src/e_mod_config.h [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_color.c [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_color.h [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_cross_widget.c [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_cross_widget.h [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_event.c [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_event.h [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_main.c [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_main.h [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_trace_widget.c [new file with mode: 0644]
devmode-tizen/src/e_mod_devmode_trace_widget.h [new file with mode: 0644]
devmode-tizen/src/e_mod_main.c [new file with mode: 0644]
devmode-tizen/src/e_mod_main.h [new file with mode: 0644]
illume2-tizen/src/e-module-illume2-tizen.edc
illume2-tizen/src/e_illume.c
illume2-tizen/src/e_illume.h
illume2-tizen/src/images/RB0_resize.png [new file with mode: 0755]
illume2-tizen/src/images/RB0_resize_notAvail.png [new file with mode: 0755]
illume2-tizen/src/policies/illume/policy.c
keyrouter/src/e_mod_main.c
keyrouter/src/e_mod_main.h
move-tizen/src/Makefile.am
move-tizen/src/e_mod_move.c
move-tizen/src/e_mod_move_apptray.c
move-tizen/src/e_mod_move_border_type.c
move-tizen/src/e_mod_move_border_type.h
move-tizen/src/e_mod_move_cfdata.c
move-tizen/src/e_mod_move_cfdata.h
move-tizen/src/e_mod_move_control_object.c
move-tizen/src/e_mod_move_debug.c
move-tizen/src/e_mod_move_debug.h
move-tizen/src/e_mod_move_dim_object.c
move-tizen/src/e_mod_move_event.c
move-tizen/src/e_mod_move_indicator.c
move-tizen/src/e_mod_move_indicator_widget.c
move-tizen/src/e_mod_move_mini_apptray.c
move-tizen/src/e_mod_move_mini_apptray_widget.c
move-tizen/src/e_mod_move_object.c
move-tizen/src/e_mod_move_quickpanel.c
move-tizen/src/e_mod_move_setup_wizard.c [new file with mode: 0644]
move-tizen/src/e_mod_move_setup_wizard.h [new file with mode: 0644]
move-tizen/src/e_mod_move_shared_types.h
move-tizen/src/e_mod_move_util.c
move-tizen/src/e_mod_move_util.h
packaging/e17-extra-modules.spec
screen-reader/src/e_mod_main.c

diff --git a/AUTHORS b/AUTHORS
index ed27b4f..a80d208 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -32,3 +32,4 @@ Gwangyeong Mun <kk.moon@samsung.com>
 Duna Oh <duna.oh@samsung.com>
 Sung-Jin Park <sj76.park@samsung.com>
 Sangjin Lee <lsj119@samsung.com>
+ChunEon Park <chuneon.park@samsung.com>
index af7e6b9..421935b 100644 (file)
@@ -20,40 +20,18 @@ group { name: "shadow_fade";
            visible: 1;
            color: 255 255 255 255;
         }
-        description { state: "background" 0.0;
-           inherit: "default" 0.0;
-           visible: 0;
-           color: 0 0 0 0;
-        }
-        description { state: "default" 1.0;
-           inherit: "default" 0.0;
-           visible: 1;
-           color: 255 255 255 255;
-        }
-        description { state: "default" 0.5;
-           inherit: "default" 0.0;
-           visible: 0;
-           color: 0 0 0 0;
-        }
-        description { state: "custom0" 0.0;
-           inherit: "default" 0.0;
-        }
-        description { state: "custom1" 0.0;
-           inherit: "default" 0.0;
-        }
         description { state: "hide" 0.0;
            inherit: "default" 0.0;
         }
      }
-
      part { name: "shower";
         type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            visible: 0;
-           rel1.relative: 0.2 0.2;
-           rel1.offset:   0    0;
-           rel2.relative: 0.8 0.8;
+           rel1.relative: 0.1 0.1;
+           rel1.offset:   0   0;
+           rel2.relative: 0.9 0.9;
         }
         description { state: "visible" 0.0;
            inherit: "default" 0.0;
@@ -61,68 +39,11 @@ group { name: "shadow_fade";
            rel1.offset:   0 0;
            rel2.relative: 1 1;
         }
-        description { state: "background" 0.0;
-           inherit: "default" 0.0;
-           rel1.relative: -0.45 -0.45; // this line indicate background window's size
-           rel2.relative:  1.45  1.45; // this line indicate background window's size
-        }
-        description { state: "indicator_raise_above" 0.0;
-           inherit : "default" 0.0;
-           rel1 {
-              relative : 0.0    0.0;
-              offset:   0   0;
-           }
-           rel2 {
-              relative : 1.0    1.0;
-           }
-        }
-        description { state: "indicator_raise_above" 0.1;
-           inherit : "default" 0.0;
-           rel1 {
-              relative : 0.0    -1.0;
-              offset:   0   0;
-           }
-           rel2 {
-              relative : 1.0    0.0;
-           }
-        }
-        description { state: "custom0" 0.0;
-           inherit: "default" 0.0;
-           rel1.relative: 0 1;
-           rel2.relative: 1 2;
-        }
-        description { state: "custom1" 0.0;
-           inherit: "default" 0.0;
-           rel1.relative: 1 0;
-           rel2.relative: 2 1;
-        }
         description { state: "hide" 0.0;
            inherit: "default" 0.0;
-           rel1.relative: 0.15 0.15;
-           rel1.offset:   0    0;
-           rel2.relative: 0.85 0.85;
-        }
-     }
-     part { name: "persp";
-        type: RECT;
-        description { state: "default" 0.0;
-           min: 1 1;
-           max: 1 1;
-           visible: 0;
-           perspective.zplane: 0;
-           perspective.focal: 1000;
-        }
-        description { state: "visible" 0.0;
-           inherit: "default" 0.0;
-           perspective.zplane: 0;
-        }
-        description { state: "hide" 0.0;
-           inherit: "default" 0.0;
-           perspective.zplane: -1500;
-        }
-        description { state: "hide" 1.0;
-           inherit: "default" 0.0;
-           perspective.zplane: 0;
+           rel1.relative: 0.1 0.1;
+           rel1.offset:   0   0;
+           rel2.relative: 0.9 0.9;
         }
      }
      part { name: "e.swallow.content";
@@ -132,43 +53,10 @@ group { name: "shadow_fade";
         description { state: "default" 0.0;
            rel1.to: "shower";
            rel2.to: "shower";
-           map.on: 0;
-        }
-        description { state: "default" 1.0;
-           inherit: "default" 0.0;
-           rel1.relative: 0 0;
-           rel2.relative: 1 1;
-        }
-        description { state: "default" 0.5;
-           inherit: "default" 0.0;
-           rel1.relative: 0 0;
-           rel2.relative: 1 1;
         }
-        /*-------------------------------------------------------------------*/
-        /*               window roation state for swallow                    */
-        /*               it must be below default state.                     */
-        /*-------------------------------------------------------------------*/
-        #include "../common/comp-part-swallow-rotation-on-effect-for-win.edc"
-        /*-------------------------------------------------------------------*/
         description { state: "visible" 0.0;
            rel1.to: "shower";
            rel2.to: "shower";
-           map.on: 0;
-        }
-        description { state: "background" 0.0;
-           rel1.to: "shower";
-           rel2.to: "shower";
-           map.on: 0;
-        }
-        description { state: "custom0" 0.0;
-           rel1.to: "shower";
-           rel2.to: "shower";
-           map.on: 0;
-        }
-        description { state: "custom1" 0.0;
-           rel1.to: "shower";
-           rel2.to: "shower";
-           map.on: 0;
         }
      }
   }
@@ -182,7 +70,6 @@ group { name: "shadow_fade";
         target: "e.swallow.content";
         after: "show2";
      }
-     // app launching effect
      program { name: "show2";
         action: STATE_SET "visible" 0.0;
         transition: DECELERATE 0.2;
@@ -219,112 +106,6 @@ group { name: "shadow_fade";
      program { name: "hide4";
         action: SIGNAL_EMIT "e,action,hide,done" "e";
      }
-     program { name: "mirror_hide1";
-        signal: "e,state,mirror,visible,off";
-        source: "e";
-        action: STATE_SET "visible" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "mirror_hide2";
-     }
-     program { name: "mirror_hide2";
-        action: STATE_SET "hide" 0.0;
-        transition: DECELERATE 0.3;
-        target: "clipper";
-        target: "shower";
-        after: "mirror_hide3";
-     }
-     program { name: "mirror_hide3";
-        action: STATE_SET "default" 0.0;
-        target: "clipper";
-        target: "shower";
-        after: "mirror_hide4";
-     }
-     program { name: "mirror_hide4";
-        action: SIGNAL_EMIT "e,action,mirror,hide,done" "e";
-     }
-     program { name: "raise_above_show1";
-        signal: "e,state,raise_above,on";;
-        source: "e";
-        action: STATE_SET "default" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "raise_above_show2";
-     }
-     // app launching effect
-     program { name: "raise_above_show2";
-        action: STATE_SET "visible" 0.0;
-        transition: DECELERATE 0.2;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "raise_above_show3";
-     }
-     program { name: "raise_above_show3";
-        action: SIGNAL_EMIT "e,action,raise_above_show,done" "e";
-     }
-     program { name: "raise_above_hide1";
-        signal: "e,state,raise_above,off";
-        source: "e";
-        action: STATE_SET "visible" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "raise_above_hide2";
-     }
-     program { name: "raise_above_hide2";
-        action: STATE_SET "default" 0.0;
-        transition: DECELERATE 0.3;
-        target: "clipper";
-        target: "shower";
-        after: "raise_above_hide4";
-     }
-     program { name: "raise_above_hide4";
-        action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e";
-     }
-     program { name: "raise_above_hide_post_work";
-        signal: "e,state,raise_above_post,on";
-        source: "e";
-        action: STATE_SET "visible" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-     }
-     /*------------------------------------------------------------*/
-     /*              window roation Program                        */
-     /*------------------------------------------------------------*/
-     #include "../common/comp-prog-rotation-on-effect-for-win.edc"
-     /*------------------------------------------------------------*/
-     program { name: "raise_above3";
-        signal: "e,state,raise_above3,on";
-        source: "e";
-        action: STATE_SET "indicator_raise_above" 0.0;
-        target: "shower";
-        after: "raise_above3_2";
-     }
-     program { name: "raise_above3_2";
-        action : STATE_SET "indicator_raise_above" 0.1;
-        transition: SINUSOIDAL 0.166;
-        target: "shower";
-        after : "raise_above3_3";
-     }
-     program { name: "raise_above3_3";
-        action : STATE_SET "indicator_raise_above" 0.1;
-        transition: LINEAR 0.1328;
-        target: "shower";
-        after : "raise_above3_4";
-     }
-     program { name: "raise_above3_4";
-        action : STATE_SET "indicator_raise_above" 0.0;
-        transition: SINUSOIDAL 0.166;
-        target: "shower";
-        after : "raise_above3_done";
-     }
-     program { name: "raise_above3_done";
-        action: SIGNAL_EMIT "e,action,raise_above3,done" "e";
-     }
      program { name: "show1_noeffect";
         signal: "e,state,visible,on,noeffect";
         source: "e";
@@ -349,71 +130,5 @@ group { name: "shadow_fade";
         target: "shower";
         after: "hide3";
      }
-     program { name: "show1_custom0";
-        signal: "e,state,visible,on,custom0";
-        source: "e";
-        action: STATE_SET "custom0" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "show2_custom0";
-     }
-     program { name: "show2_custom0";
-        action: STATE_SET "visible" 0.0;
-        transition: DECELERATE 0.6;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "show3";
-     }
-     program { name: "hide1_custom0";
-        signal: "e,state,visible,off,custom0";
-        source: "e";
-        action: STATE_SET "visible" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "hide2_custom0";
-     }
-     program { name: "hide2_custom0";
-        action: STATE_SET "custom0" 0.0;
-        transition: DECELERATE 0.6;
-        target: "clipper";
-        target: "shower";
-        after: "hide3";
-     }
-     program { name: "show1_custom1";
-        signal: "e,state,visible,on,custom1";
-        source: "e";
-        action: STATE_SET "custom1" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "show2_custom1";
-     }
-     program { name: "show2_custom1";
-        action: STATE_SET "visible" 0.0;
-        transition: DECELERATE 0.5;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "show3";
-     }
-     program { name: "hide1_custom1";
-        signal: "e,state,visible,off,custom1";
-        source: "e";
-        action: STATE_SET "visible" 0.0;
-        target: "clipper";
-        target: "shower";
-        target: "e.swallow.content";
-        after: "hide2_custom1";
-     }
-     program { name: "hide2_custom1";
-        action: STATE_SET "custom1" 0.0;
-        transition: DECELERATE 0.5;
-        target: "clipper";
-        target: "shower";
-        after: "hide3";
-     }
   }
 } /* end of group "shadow_fade" */
index 5730304..604dd5c 100644 (file)
@@ -45,7 +45,6 @@ static void         _e_mod_comp_win_lower(E_Comp_Win *cw);
 static E_Comp_Win  *_e_mod_comp_win_find(Ecore_X_Window win);
 static E_Comp_Win  *_e_mod_comp_border_client_find(Ecore_X_Window win);
 static Eina_Bool    _e_mod_comp_cb_update(E_Comp *c);
-static Evas_Object *_e_mod_comp_mirror_handler_add(E_Comp *c);
 static Eina_Bool    _e_mod_comp_win_is_border(E_Comp_Win *cw);
 static void         _e_mod_comp_cb_pending_after(void *data, E_Manager *man, E_Manager_Comp_Source *src);
 static E_Comp      *_e_mod_comp_find(Ecore_X_Window root);
@@ -55,6 +54,7 @@ static void         _e_mod_comp_cb_win_mirror_del(void *data, Evas *e, Evas_Obje
 static void         _e_mod_comp_src_hidden_set_func(void *data, E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden);
 static Eina_Bool    _e_mod_comp_prop_window_use_dri2_get(Ecore_X_Window win);
 static Eina_Bool    _e_mod_comp_prop_use_dri2(Ecore_X_Event_Window_Property *ev);
+static void         _e_mod_comp_composite_mode_set(void *data, E_Manager *man, E_Zone *zone, Eina_Bool set);
 
 ///////////////////////////////////////////////////////////////////////////////////
 EINTERN Eina_Bool
@@ -119,6 +119,14 @@ e_mod_comp_win_del_damage(E_Comp_Win *cw,
    return eina_hash_del(damages, e_util_winid_str_get(dmg), cw);
 }
 
+EINTERN void
+e_mod_comp_composite_mode_set(E_Zone   *zone,
+                              Eina_Bool set)
+{
+   _e_mod_comp_composite_mode_set(e_mod_comp_util_get(),
+                                  NULL, zone, set);
+}
+
 static void
 _e_mod_comp_cb_pending_after(void *data __UNUSED__,
                              E_Manager *man __UNUSED__,
@@ -431,8 +439,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
         return;
      }
 
-   if (!cw->move_lock)
-     e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y);
+   e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y);
    e_mod_comp_win_comp_objs_resize(cw,
                                    cw->pw + (cw->border * 2),
                                    cw->ph + (cw->border * 2));
@@ -556,7 +563,6 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
      }
 
    e_mod_comp_win_comp_objs_show(cw);
-   e_mod_comp_effect_win_rotation_handler_update(cw);
    e_mod_comp_x_grab_set(cw->c, EINA_FALSE);
 }
 
@@ -895,46 +901,8 @@ EINTERN void
 e_mod_comp_done_defer(E_Comp_Win *cw)
 {
    E_CHECK(cw);
-   e_mod_comp_effect_disable_stage(cw->c, cw);
    e_mod_comp_effect_animating_set(cw->c, cw, EINA_FALSE);
 
-   if (cw->defer_raise)
-     {
-        ELBF(ELBT_COMP, 0,
-             e_mod_comp_util_client_xid_get(cw),
-             "EDJ_DONE Force win to raise bd:%d",
-             cw->bd);
-
-        E_Comp_Win *_cw;
-        EINA_INLIST_FOREACH(cw->c->wins, _cw)
-          {
-             if (!_cw) continue;
-             e_mod_comp_win_comp_objs_raise(_cw);
-             Eina_Bool run = e_mod_comp_effect_win_roation_run_check(_cw->eff_winrot);
-             if (!run) continue;
-
-             Eina_List *l, *ll;
-             E_Comp_Canvas *canvas;
-             E_Comp_Object *co;
-             EINA_LIST_FOREACH(_cw->c->canvases, l, canvas)
-               {
-                  if (!canvas) continue;
-                  if (!canvas->use_bg_img) continue;
-                  EINA_LIST_FOREACH(_cw->objs, ll, co)
-                    {
-                       if (!co) continue;
-                       if (co->canvas == canvas)
-                         {
-                            evas_object_stack_below(canvas->bg_img,
-                                                    co->shadow);
-                         }
-                    }
-               }
-          }
-        cw->defer_raise = EINA_FALSE;
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,raise_above_post,on", "e");
-     }
    cw->force = 1;
    if (cw->defer_hide)
      {
@@ -956,8 +924,6 @@ e_mod_comp_done_defer(E_Comp_Win *cw)
         _e_mod_comp_win_del(cw);
      }
    else cw->force = 0;
-
-   e_mod_comp_effect_signal_flush();
 }
 
 static void
@@ -970,10 +936,9 @@ _e_mod_comp_show_done(void        *data,
    E_CHECK(cw);
 
 #ifdef USE_DLOG
-   LOG(LOG_DEBUG, "LAUNCH",
-       "[e17:Application:Launching:done] win:0x%07x name:%s",
-       cw->bd ? cw->bd->client.win : cw->win,
-       cw->bd ? cw->bd->client.netwm.name : NULL);
+   SECURE_SLOGD("[e17:Application:Launching:done] win:0x%07x name:%s",
+                cw->bd ? cw->bd->client.win : cw->win,
+                cw->bd ? cw->bd->client.netwm.name : NULL);
 #endif
 
    ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
@@ -1005,93 +970,6 @@ _e_mod_comp_hide_done(void        *data,
 }
 
 static void
-_e_mod_comp_raise_above_show_done(void        *data,
-                                  Evas_Object *obj,
-                                  const char  *emission __UNUSED__,
-                                  const char  *source   __UNUSED__)
-{
-   E_Comp_Win *cw = data;
-   E_CHECK(cw);
-
-   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
-        "%15.15s|RAISE_SHOW_DONE", "SIGNAL");
-
-   e_mod_comp_effect_signal_del(cw, obj, "raise,show,done");
-
-   e_mod_comp_done_defer(cw);
-}
-
-static void
-_e_mod_comp_raise_above_hide_done(void        *data,
-                                  Evas_Object *obj,
-                                  const char  *emission __UNUSED__,
-                                  const char  *source   __UNUSED__)
-{
-   E_Comp_Win *cw = data;
-   E_CHECK(cw);
-
-   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
-        "%15.15s|RAISE_HIDE_DONE", "SIGNAL");
-
-   e_mod_comp_effect_signal_del(cw, obj, "raise,hide,done");
-
-   e_mod_comp_done_defer(cw);
-}
-
-static void
-_e_mod_comp_background_show_done(void        *data,
-                                 Evas_Object *obj,
-                                 const char  *emission __UNUSED__,
-                                 const char  *source   __UNUSED__)
-{
-   E_Comp_Win *cw = data;
-   E_CHECK(cw);
-
-   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
-        "%15.15s|BG_SHOW_DONE", "SIGNAL");
-
-   e_mod_comp_effect_signal_del(cw, obj, "bg,show,done");
-
-   e_mod_comp_done_defer(cw);
-}
-
-static void
-_e_mod_comp_background_hide_done(void        *data,
-                                 Evas_Object *obj,
-                                 const char  *emission __UNUSED__,
-                                 const char  *source   __UNUSED__)
-{
-   E_Comp_Win *cw = data;
-   E_CHECK(cw);
-
-   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
-        "%15.15s|BG_HIDE_DONE", "SIGNAL");
-
-   e_mod_comp_effect_signal_del(cw, obj, "bg,hide,done");
-
-   e_mod_comp_done_defer(cw);
-}
-
-
-static void
-_e_mod_comp_mirror_hide_done(void        *data,
-                                  Evas_Object *obj,
-                                  const char  *emission __UNUSED__,
-                                  const char  *source   __UNUSED__)
-{
-   E_Comp *c = data;
-   E_CHECK(c);
-
-   ELBF(ELBT_COMP, 0, 0,
-        "%15.15s|MIRROR_HIDE_DONE", "SIGNAL");
-   edje_object_part_unswallow(c->mirror_handler, c->mirror_obj);
-
-   evas_object_hide(c->mirror_handler);
-   evas_object_hide(c->mirror_obj);
-   evas_object_del(c->mirror_obj);
-}
-
-static void
 _e_mod_comp_win_sync_setup(E_Comp_Win *cw,
                            Ecore_X_Window win)
 {
@@ -1240,19 +1118,6 @@ e_mod_comp_win_shadow_setup(E_Comp_Win    *cw,
 
    e_mod_comp_debug_edje_error_get
      (co->shadow, e_mod_comp_util_client_xid_get(cw));
-
-   e_mod_comp_effect_signal_add
-     (cw, NULL, "e,state,shadow,off", "e");
-
-   if (cw->bd)
-     {
-        if (cw->bd->focused)
-          e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,focus,on", "e");
-        if (cw->bd->client.icccm.urgent)
-          e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,urgent,on", "e");
-     }
 }
 
 static void
@@ -1442,10 +1307,10 @@ _e_mod_comp_win_add(E_Comp        *c,
         cw->objs = e_mod_comp_win_comp_objs_add(cw);
         if (!cw->objs)
           {
-             free(cw);
-             e_mod_comp_x_grab_set(c, EINA_FALSE);
              ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
                   "%15.15s|ERROR", "OBJECT_ADD");
+             free(cw);
+             e_mod_comp_x_grab_set(c, EINA_FALSE);
              return NULL;
           }
              
@@ -1539,14 +1404,6 @@ _e_mod_comp_win_del(E_Comp_Win *cw)
 {
    int pending_count;
 
-   e_mod_comp_effect_jobs_clean(cw, NULL, NULL);
-
-   // while win_hide animation is progressing, at that time win_del is called,
-   // background window effect is may not work fully.
-   // so, explicit call disable effect stage function.
-   if (cw->effect_stage)
-     e_mod_comp_effect_disable_stage(cw->c, cw);
-
    if (cw->animating)
      e_mod_comp_effect_animating_set(cw->c, cw, EINA_FALSE);
 
@@ -1565,7 +1422,6 @@ _e_mod_comp_win_del(E_Comp_Win *cw)
      }
 
    e_mod_comp_update_free(cw->up);
-   e_mod_comp_effect_win_rotation_handler_release(cw);
    e_mod_comp_bg_win_handler_release(cw);
 
    if (cw->rects)
@@ -1804,21 +1660,18 @@ _e_mod_comp_win_hide(E_Comp_Win *cw)
 
    e_mod_comp_win_shape_input_invalid_set(cw->c, 1);
 
-   cw->visible = 0;
    if ((cw->input_only) || (cw->invalid)) return;
 
-   e_mod_comp_effect_win_rotation_handler_release(cw);
-
    if (!cw->force)
      {
         cw->defer_hide = 1;
-        if (STATE_INSET_CHECK(cw))
-          e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,shadow,off", "e");
         e_mod_comp_effect_win_hide(cw);
+        cw->visible = 0;
         return;
      }
 
+   cw->visible = 0;
+
    Eina_List *l;
    E_Comp_Object *co;
    EINA_LIST_FOREACH(cw->objs, l, co)
@@ -1874,47 +1727,19 @@ _e_mod_comp_win_raise_above(E_Comp_Win *cw,
                             E_Comp_Win *cw2)
 {
    Eina_Bool v1, v2;
-   Eina_Bool raise = EINA_FALSE;
-   Eina_Bool lower = EINA_FALSE;
-   E_Comp_Win *below;
 
    v1 = e_mod_comp_util_win_visible_get(cw);
-   below = e_mod_comp_util_win_below_get(cw, 0);
 
    cw->c->wins_invalid = 1;
    cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw));
    cw->c->wins = eina_inlist_append_relative(cw->c->wins,
                                              EINA_INLIST_GET(cw),
                                              EINA_INLIST_GET(cw2));
-   v2 = e_mod_comp_util_win_visible_get(cw);
 
-   if ((cw2) == (cw->c->lower_win))
-     lower = e_mod_comp_policy_win_lower_check(cw, below);
-   else if ((v1) && (!v2))
-     lower = e_mod_comp_policy_win_lower_check(cw, below);
-   else if ((!v1) && (v2))
-     raise = e_mod_comp_policy_win_restack_check(cw, cw2);
-
-   L(LT_EFFECT,
-     "[COMP] %18.18s w:0x%08x w2:0x%08x wb:0x%08x [fs%d sd%d v%d v%d l%d r%d]\n", "EFF",
-     e_mod_comp_util_client_xid_get(cw),
-     e_mod_comp_util_client_xid_get(cw2),
-     e_mod_comp_util_client_xid_get(below),
-     cw->first_show_worked, cw->show_done,
-     v1, v2, lower, raise);
+   v2 = e_mod_comp_util_win_visible_get(cw);
+   e_mod_comp_effect_win_restack(cw, v1, v2);
 
-   if ((raise))
-     {
-        e_mod_comp_effect_win_restack(cw, cw2);
-     }
-   else if ((lower))
-     {
-        e_mod_comp_effect_win_lower(cw, below);
-     }
-   else
-     {
-        e_mod_comp_win_comp_objs_stack_above(cw, cw2);
-     }
+   e_mod_comp_win_comp_objs_stack_above(cw, cw2);
 
    _e_mod_comp_win_render_queue(cw);
    cw->pending_count++;
@@ -1977,7 +1802,7 @@ _e_mod_comp_win_configure(E_Comp_Win *cw,
              cw->x = x;
              cw->y = y;
              geo_changed = EINA_TRUE;
-             if (!cw->needpix && !cw->move_lock)
+             if (!cw->needpix)
                e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y);
           }
         cw->hidden.x = x;
@@ -2220,9 +2045,8 @@ _e_mod_comp_configure(void *data __UNUSED__,
      {
         if (EINA_INLIST_GET(cw)->prev)
           {
-             L(LT_EVENT_X,
-               "COMP|%31s|w:0x%08x\n",
-               "LOWER", ev->win);
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|", "LOWER");
 
              _e_mod_comp_win_lower(cw);
              need_shape_merge = EINA_TRUE;
@@ -2236,10 +2060,9 @@ _e_mod_comp_configure(void *data __UNUSED__,
              E_Comp_Win *cw3 = (E_Comp_Win *)(EINA_INLIST_GET(cw)->prev);
              if (cw3 != cw2)
                {
-                  L(LT_EVENT_X,
-                    "COMP|%31s|bd:%d above_w:0x%08x\n",
-                    "RAISE_ABOVE", _e_mod_comp_win_is_border(cw2),
-                    e_mod_comp_util_client_xid_get(cw2));
+                  ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                       "%15.15s|above:0x%08x", "RAISE_ABOVE",
+                       e_mod_comp_util_client_xid_get(cw2));
 
                   _e_mod_comp_win_raise_above(cw, cw2);
                   need_shape_merge = EINA_TRUE;
@@ -2414,32 +2237,6 @@ _e_mod_comp_prop_opacity(Ecore_X_Event_Window_Property *ev)
 }
 
 static Eina_Bool
-_e_mod_comp_prop_illume_window_state(Ecore_X_Event_Window_Property *ev)
-{
-   E_Comp_Win *cw = NULL;
-   unsigned int state;
-
-   cw = _e_mod_comp_border_client_find(ev->win);
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN((cw->bd), 0);
-
-   state = cw->bd->client.illume.win_state.state;
-   switch (state)
-     {
-      case ECORE_X_ILLUME_WINDOW_STATE_FLOATING:
-         e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,shadow,on", "e");
-         break;
-      case ECORE_X_ILLUME_WINDOW_STATE_NORMAL:
-      default:
-         e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,shadow,off", "e");
-         break;
-     }
-   return EINA_TRUE;
-}
-
-static Eina_Bool
 _e_mod_comp_prop_sync_counter(Ecore_X_Event_Window_Property *ev)
 {
    E_Comp_Win *cw = NULL;
@@ -2528,8 +2325,6 @@ _e_mod_comp_property(void *data __UNUSED__,
    else if (a == ATOM_WINDOW_EFFECT_ENABLE                ) _e_mod_comp_prop_window_effect_state(ev);
    else if (a == ATOM_WINDOW_EFFECT_TYPE                  ) _e_mod_comp_prop_effect_style(ev);
    else if (a == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY       ) _e_mod_comp_prop_opacity(ev);
-   else if (a == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE       ) _e_mod_comp_prop_illume_window_state(ev);
-   else if (a == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE) e_mod_comp_effect_win_rotation_handler_prop(ev);
    else if (a == ECORE_X_ATOM_WM_CLASS                    ) e_mod_comp_win_type_handler_prop(ev);
    else if (a == ATOM_NET_CM_WINDOW_BACKGROUND            ) e_mod_comp_bg_win_handler_prop(ev);
    else if (a == ATOM_CM_LOG                              ) e_mod_comp_debug_prop_handle(ev);
@@ -2838,9 +2633,6 @@ _e_mod_comp_bd_add(void *data __UNUSED__,
    if (ev->border->internal && ev->border->visible)
      _e_mod_comp_win_show(cw);
 
-   if (!ev->border->borderless)
-     e_mod_comp_effect_signal_add(cw, NULL, "e,state,shadow,on", "e");
-
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -2858,9 +2650,6 @@ _e_mod_comp_bd_del(void *data __UNUSED__,
    if (!cw) return ECORE_CALLBACK_PASS_ON;
    if (cw->bd == ev->border)
      {
-        if (!ev->border->borderless)
-          e_mod_comp_effect_signal_add(cw, NULL, "e,state,shadow,off", "e");
-
         if (e_mod_comp_policy_app_close_check(cw))
           e_mod_comp_effect_signal_add(cw, NULL, "e,state,visible,off", "e");
 
@@ -2972,7 +2761,6 @@ _e_mod_comp_bd_iconify(void *data __UNUSED__,
         "%15.15s|bd:0x%08x", "BD_ICONIFY", ev->border->win);
 
    if (!cw) return ECORE_CALLBACK_PASS_ON;
-   // fimxe: special iconfiy anim
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -2988,26 +2776,6 @@ _e_mod_comp_bd_uniconify(void *data __UNUSED__,
         "%15.15s|bd:0x%08x", "BD_UNICONIFY", ev->border->win);
 
    if (!cw) return ECORE_CALLBACK_PASS_ON;
-   // fimxe: special uniconfiy anim
-   return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_e_mod_comp_bd_urgent_change(void *data __UNUSED__,
-                             int type   __UNUSED__,
-                             void      *event)
-{
-   E_Event_Border_Urgent_Change *ev = event;
-   E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
-
-   L(LT_EVENT_X, "COMP|ev:%15.15s|w:0x%08x\n",
-     "URGENT_CHANGE", ev->border ? ev->border->win : 0);
-
-   if (!cw) return ECORE_CALLBACK_PASS_ON;
-   if (cw->bd->client.icccm.urgent)
-     e_mod_comp_effect_signal_add(cw, NULL, "e,state,urgent,on", "e");
-   else
-     e_mod_comp_effect_signal_add(cw, NULL, "e,state,urgent,off", "e");
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -3019,12 +2787,10 @@ _e_mod_comp_bd_focus_in(void *data __UNUSED__,
    E_Event_Border_Focus_In *ev = event;
    E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
 
-   L(LT_EVENT_X,
-     "COMP|ev:%15.15s|w:0x%08x|c:0x%08x\n", "BD_FOCUS_IN",
-     ev->border->win, ev->border->client.win);
+   ELBF(ELBT_COMP, 0, ev->border->client.win,
+        "%15.15s|bd:0x%08x", "BD_FOCUS_IN", ev->border->win);
 
    if (!cw) return ECORE_CALLBACK_PASS_ON;
-   e_mod_comp_effect_signal_add(cw, NULL, "e,state,focus,on", "e");
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -3036,24 +2802,50 @@ _e_mod_comp_bd_focus_out(void *data __UNUSED__,
    E_Event_Border_Focus_Out *ev = event;
    E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
 
-   L(LT_EVENT_X,
-     "COMP|ev:%15.15s|w:0x%08x|c:0x%08x\n", "BD_FOCUS_OUT",
-     ev->border->win, ev->border->client.win);
+   ELBF(ELBT_COMP, 0, ev->border->client.win,
+        "%15.15s|bd:0x%08x", "BD_FOCUS_OUT", ev->border->win);
 
    if (!cw) return ECORE_CALLBACK_PASS_ON;
-   e_mod_comp_effect_signal_add(cw, NULL, "e,state,focus,off", "e");
    return ECORE_CALLBACK_PASS_ON;
 }
 
 static Eina_Bool
-_e_mod_comp_bd_property(void *data __UNUSED__,
-                        int type   __UNUSED__,
-                        void      *event)
+_e_mod_comp_bd_stack(void *data __UNUSED__,
+                     int type   __UNUSED__,
+                     void      *event)
 {
-   E_Event_Border_Property *ev = event;
-   E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
+   E_Event_Border_Stack *ev = event;
+   E_Comp_Win *cw, *cw2 = NULL;
+   if (!ev->border) return ECORE_CALLBACK_PASS_ON;
+
+   cw = _e_mod_comp_win_find(ev->border->win);
    if (!cw) return ECORE_CALLBACK_PASS_ON;
-   // fimxe: other properties?
+
+   if (ev->stack)
+     {
+        cw2 = _e_mod_comp_win_find(ev->stack->win);
+        /* there is no cw yet, thus put off doing it. */
+        if (!cw2) return ECORE_CALLBACK_PASS_ON;
+     }
+
+   if (ev->type == E_STACKING_BELOW)
+     {
+        if (cw2)
+          {
+             /* LOWER BELOW
+              * if user selects back icon of the application, then this event
+              * is occured first. thus we use this event for showing application
+              * hide effect.
+              * visible -> invisible
+              */
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|LOWER_BELOW 0x%08x", "BD_STACK",
+                  e_mod_comp_util_client_xid_get(cw2));
+
+             /* TODO: check previous visibility */
+             e_mod_comp_effect_win_restack(cw, EINA_TRUE, EINA_FALSE);
+          }
+     }
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -3242,11 +3034,8 @@ _e_mod_comp_src_image_mirror_add_func(void *data             __UNUSED__,
         if (canvas->nocomp.mode != E_NOCOMP_MODE_RUN) continue;
         if (cw != canvas->nocomp.cw) continue;
 
-        L(LT_EVENT_X,
-          "COMP|%31s|new_w:0x%08x|nocomp.cw:0x%08x canvas:%d\n",
-          "NOCOMP_END MIRROR_ADD", cw ? e_mod_comp_util_client_xid_get(cw) : 0,
-          e_mod_comp_util_client_xid_get(canvas->nocomp.cw),
-          canvas->num);
+        ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+             "%15.15s| END MIRROR_ADD", "NOCOMP");
 
         e_mod_comp_canvas_nocomp_end(canvas);
      }
@@ -3424,34 +3213,6 @@ _e_mod_comp_input_region_del_func(void *data     __UNUSED__,
    return res;
 }
 
-static Eina_Bool
-_e_mod_comp_src_move_lock_func(void *data             __UNUSED__,
-                               E_Manager *man         __UNUSED__,
-                               E_Manager_Comp_Source *src)
-{
-   E_Comp_Win *cw = (E_Comp_Win *)src;
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->c, 0);
-
-   cw->move_lock = EINA_TRUE;
-
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_mod_comp_src_move_unlock_func(void *data             __UNUSED__,
-                                 E_Manager *man         __UNUSED__,
-                                 E_Manager_Comp_Source *src)
-{
-   E_Comp_Win *cw = (E_Comp_Win *)src;
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->c, 0);
-
-   cw->move_lock = EINA_FALSE;
-   e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y);
-   return EINA_TRUE;
-}
-
 static void
 _e_mod_comp_composite_mode_set(void           *data,
                                E_Manager *man __UNUSED__,
@@ -3574,26 +3335,32 @@ _e_mod_comp_src_shadow_hide_func(void                  *data,
 }
 
 static Evas_Object *
-_e_mod_comp_mirror_handler_add(E_Comp *c)
+_e_mod_comp_layer_get_func(void           *data,
+                           E_Manager *man __UNUSED__,
+                           E_Zone        *zone,
+                           const char    *name)
 {
-   Evas_Object *shobj;
-   int ok = 0;
-   int w, h;
-   E_CHECK_RETURN(c, NULL);
-
-   shobj = edje_object_add(_e_mod_comp_evas_get_func(c, c->man));
-   E_CHECK_RETURN(shobj, NULL);
+   E_Comp *c = (E_Comp *)data;
+   E_Comp_Canvas *canvas = NULL;
+   E_Comp_Layer *ly = NULL;
+   Eina_List *l;
 
-   ok = edje_object_file_set (shobj, _comp_mod->conf->shadow_file, "shadow_fade");
-   E_CHECK_RETURN(ok, NULL);
+   E_CHECK_RETURN(c, NULL);
 
-   edje_object_signal_callback_add(shobj, "e,action,mirror,hide,done","e", _e_mod_comp_mirror_hide_done, c);
-   evas_object_move(shobj, 0, 0);
+   EINA_LIST_FOREACH(c->canvases, l, canvas)
+     {
+        if (!canvas) continue;
+        if (canvas->zone == zone)
+          {
+             ly = e_mod_comp_canvas_layer_get(canvas, name);
+             if (ly) return ly->layout;
+             break;
+          }
+     }
 
-   ecore_x_window_size_get(c->win, &w, &h);
-   evas_object_resize(shobj, w, h);
+   if (!ly) return NULL;
 
-   return shobj;
+   return ly->layout;
 }
 
 static E_Comp *
@@ -3770,12 +3537,13 @@ _e_mod_comp_add(E_Manager *man)
    c->comp.func.input_region_new     = _e_mod_comp_input_region_new_func;
    c->comp.func.input_region_set     = _e_mod_comp_input_region_set_func;
    c->comp.func.input_region_del     = _e_mod_comp_input_region_del_func;
-   c->comp.func.src_move_lock        = _e_mod_comp_src_move_lock_func;
-   c->comp.func.src_move_unlock      = _e_mod_comp_src_move_unlock_func;
+   c->comp.func.src_move_lock        = NULL; /* deprecated */
+   c->comp.func.src_move_unlock      = NULL; /* deprecated */
    c->comp.func.composite_mode_set   = _e_mod_comp_composite_mode_set;
    c->comp.func.composite_mode_get   = _e_mod_comp_composite_mode_get;
    c->comp.func.src_shadow_show      = _e_mod_comp_src_shadow_show_func;
    c->comp.func.src_shadow_hide      = _e_mod_comp_src_shadow_hide_func;
+   c->comp.func.layer_get            = _e_mod_comp_layer_get_func;
 
    e_manager_comp_set(c->man, &(c->comp));
    return c;
@@ -3831,7 +3599,6 @@ _e_mod_comp_del(E_Comp *c)
    if (c->new_up_timer) ecore_timer_del(c->new_up_timer);
    if (c->update_job) ecore_job_del(c->update_job);
    if (c->wins_list) eina_list_free(c->wins_list);
-   if (c->mirror_handler) evas_object_del(c->mirror_handler);
 
    ecore_x_window_free(c->cm_selection);
    ecore_x_e_comp_sync_supported_set(c->man->root, 0);
@@ -4081,6 +3848,102 @@ _e_mod_comp_zone_del(void *data __UNUSED__,
    return ECORE_CALLBACK_PASS_ON;
 }
 
+static Eina_Bool
+_e_mod_comp_zone_rot_begin(void *data __UNUSED__,
+                           int type   __UNUSED__,
+                           void      *event)
+{
+   E_Event_Zone_Rotation_Change_Begin *ev = (E_Event_Zone_Rotation_Change_Begin *)event;
+   Eina_List *l, *ll;
+   E_Comp *c;
+   E_Comp_Canvas *canvas;
+
+   if (!(ev && ev->zone))
+     return ECORE_CALLBACK_PASS_ON;
+
+   ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_BEGIN");
+
+   EINA_LIST_FOREACH(compositors, l, c)
+     {
+        if (!c) continue;
+        EINA_LIST_FOREACH(c->canvases, ll, canvas)
+          {
+             if (!canvas) continue;
+             if (canvas->zone != ev->zone) continue;
+             if (canvas->zr)
+               e_mod_comp_effect_zone_rotation_begin(canvas->zr);
+             break;
+          }
+     }
+   return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_e_mod_comp_zone_rot_cancel(void *data __UNUSED__,
+                            int type   __UNUSED__,
+                            void      *event)
+{
+   E_Event_Zone_Rotation_Change_Cancel *ev = (E_Event_Zone_Rotation_Change_Cancel *)event;
+   Eina_List *l, *ll;
+   E_Comp *c;
+   E_Comp_Canvas *canvas;
+
+   if (!(ev && ev->zone))
+     return ECORE_CALLBACK_PASS_ON;
+
+   ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_CANCEL");
+
+   EINA_LIST_FOREACH(compositors, l, c)
+     {
+        if (!c) continue;
+        EINA_LIST_FOREACH(c->canvases, ll, canvas)
+          {
+             if (!canvas) continue;
+             if (canvas->zone != ev->zone) continue;
+             if (canvas->zr)
+               e_mod_comp_effect_zone_rotation_cancel(canvas->zr);
+             break;
+          }
+     }
+   return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_e_mod_comp_zone_rot_end(void *data __UNUSED__,
+                         int type   __UNUSED__,
+                         void      *event)
+{
+   E_Event_Zone_Rotation_Change_End *ev = (E_Event_Zone_Rotation_Change_End *)event;
+   Eina_List *l, *ll;
+   E_Comp *c;
+   E_Comp_Canvas *canvas;
+
+   if (!(ev && ev->zone))
+     return ECORE_CALLBACK_PASS_ON;
+
+   ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_END");
+
+   EINA_LIST_FOREACH(compositors, l, c)
+     {
+        if (!c) continue;
+        EINA_LIST_FOREACH(c->canvases, ll, canvas)
+          {
+             if (!canvas) continue;
+             if (canvas->zone != ev->zone) continue;
+             if (canvas->zr)
+               {
+                  Eina_Bool res = e_mod_comp_effect_zone_rotation_end(canvas->zr);
+                  if (res)
+                    e_mod_comp_effect_zone_rotation_do(canvas->zr);
+                  else
+                    e_mod_comp_effect_zone_rotation_cancel(canvas->zr);
+               }
+             break;
+          }
+     }
+   return ECORE_CALLBACK_PASS_ON;
+}
+
 //////////////////////////////////////////////////////////////////////////
 
 Eina_Bool
@@ -4095,35 +3958,37 @@ e_mod_comp_init(void)
    borders = eina_hash_string_superfast_new(NULL);
    damages = eina_hash_string_superfast_new(NULL);
 
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE,    _e_mod_comp_create,           NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY,   _e_mod_comp_destroy,          NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW,      _e_mod_comp_show,             NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE,      _e_mod_comp_hide,             NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_REPARENT,  _e_mod_comp_reparent,         NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _e_mod_comp_configure,        NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_STACK,     _e_mod_comp_stack,            NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,  _e_mod_comp_property,         NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,   _e_mod_comp_message,          NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,     _e_mod_comp_shape,            NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY,    _e_mod_comp_damage,           NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE,    _e_mod_comp_damage_win,       NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,           _e_mod_comp_key_down,         NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE,       _e_mod_comp_randr,            NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ADD,             _e_mod_comp_bd_add,           NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_REMOVE,          _e_mod_comp_bd_del,           NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_SHOW,            _e_mod_comp_bd_show,          NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_HIDE,            _e_mod_comp_bd_hide,          NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_MOVE,            _e_mod_comp_bd_move,          NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_RESIZE,          _e_mod_comp_bd_resize,        NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ICONIFY,         _e_mod_comp_bd_iconify,       NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY,       _e_mod_comp_bd_uniconify,     NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_URGENT_CHANGE,   _e_mod_comp_bd_urgent_change, NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN,        _e_mod_comp_bd_focus_in,      NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT,       _e_mod_comp_bd_focus_out,     NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_PROPERTY,        _e_mod_comp_bd_property,      NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,       _e_mod_comp_zone_move_resize, NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ADD,               _e_mod_comp_zone_add,         NULL));
-   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_DEL,               _e_mod_comp_zone_del,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE,         _e_mod_comp_create,           NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY,        _e_mod_comp_destroy,          NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW,           _e_mod_comp_show,             NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE,           _e_mod_comp_hide,             NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_REPARENT,       _e_mod_comp_reparent,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,      _e_mod_comp_configure,        NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_STACK,          _e_mod_comp_stack,            NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,       _e_mod_comp_property,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,        _e_mod_comp_message,          NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,          _e_mod_comp_shape,            NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY,         _e_mod_comp_damage,           NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE,         _e_mod_comp_damage_win,       NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,                _e_mod_comp_key_down,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE,            _e_mod_comp_randr,            NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ADD,                  _e_mod_comp_bd_add,           NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_REMOVE,               _e_mod_comp_bd_del,           NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_SHOW,                 _e_mod_comp_bd_show,          NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_HIDE,                 _e_mod_comp_bd_hide,          NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_MOVE,                 _e_mod_comp_bd_move,          NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_RESIZE,               _e_mod_comp_bd_resize,        NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ICONIFY,              _e_mod_comp_bd_iconify,       NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY,            _e_mod_comp_bd_uniconify,     NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN,             _e_mod_comp_bd_focus_in,      NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT,            _e_mod_comp_bd_focus_out,     NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_STACK,                _e_mod_comp_bd_stack,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,            _e_mod_comp_zone_move_resize, NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ADD,                    _e_mod_comp_zone_add,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_DEL,                    _e_mod_comp_zone_del,         NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_BEGIN,  _e_mod_comp_zone_rot_begin,   NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_CANCEL, _e_mod_comp_zone_rot_cancel,  NULL));
+   handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_END,    _e_mod_comp_zone_rot_end,     NULL));
 
    res = e_mod_comp_atoms_init();
    E_CHECK_RETURN(res, 0);
@@ -4168,8 +4033,6 @@ e_mod_comp_init(void)
                   c->eff_img = e_mod_comp_effect_image_launch_new(c->evas, w, h);
                }
 
-             c->mirror_handler = _e_mod_comp_mirror_handler_add(c);
-
              compositors = eina_list_append(compositors, c);
              e_mod_comp_util_set(c, man);
              ecore_animator_frametime_set(1.0f/60.0f);
@@ -4252,15 +4115,6 @@ e_mod_comp_shadow_set(void)
                e_mod_comp_effect_signal_add
                  (cw, NULL, "e,state,visible,on,noeffect", "e");
 
-             if (_comp_mod->conf->use_shadow)
-               {
-                  if (cw->bd)
-                    {
-                       if (!cw->bd->borderless)
-                         e_mod_comp_effect_signal_add(cw, NULL, "e,state,shadow,on", "e");
-                    }
-               }
-
              e_mod_comp_comp_event_src_visibility_send(cw);
           }
      }
@@ -4270,12 +4124,8 @@ EINTERN void
 e_mod_comp_win_cb_setup(E_Comp_Win    *cw,
                         E_Comp_Object *co)
 {
-   edje_object_signal_callback_add(co->shadow, "e,action,show,done",            "e", _e_mod_comp_show_done,            cw);
-   edje_object_signal_callback_add(co->shadow, "e,action,hide,done",            "e", _e_mod_comp_hide_done,            cw);
-   edje_object_signal_callback_add(co->shadow, "e,action,background,show,done", "e", _e_mod_comp_background_show_done, cw);
-   edje_object_signal_callback_add(co->shadow, "e,action,background,hide,done", "e", _e_mod_comp_background_hide_done, cw);
-   edje_object_signal_callback_add(co->shadow, "e,action,raise_above_show,done","e", _e_mod_comp_raise_above_show_done,cw);
-   edje_object_signal_callback_add(co->shadow, "e,action,raise_above_hide,done","e", _e_mod_comp_raise_above_hide_done,cw);
+   edje_object_signal_callback_add(co->shadow, "e,action,show,done", "e", _e_mod_comp_show_done, cw);
+   edje_object_signal_callback_add(co->shadow, "e,action,hide,done", "e", _e_mod_comp_hide_done, cw);
 }
 
 EINTERN void
@@ -4291,45 +4141,3 @@ e_mod_comp_x_grab_set(E_Comp *c,
      ecore_x_ungrab();
    c->grabbed = grab;
 }
-
-EINTERN void
-e_mod_comp_explicit_show_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_show_done((void*)cw, NULL, NULL, NULL);
-}
-
-EINTERN void
-e_mod_comp_explicit_hide_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_hide_done((void*)cw, NULL, NULL, NULL);
-}
-
-EINTERN void
-e_mod_comp_explicit_raise_above_show_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_raise_above_show_done((void*)cw, NULL, NULL, NULL);
-}
-
-EINTERN void
-e_mod_comp_explicit_raise_above_hide_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_raise_above_hide_done((void*)cw, NULL, NULL, NULL);
-}
-
-EINTERN void
-e_mod_comp_explicit_background_show_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_background_show_done((void*)cw, NULL, NULL, NULL);
-}
-
-EINTERN void
-e_mod_comp_explicit_background_hide_done(E_Comp_Win *cw)
-{
-   E_CHECK(cw);
-   _e_mod_comp_background_hide_done((void*)cw, NULL, NULL, NULL);
-}
index 367878e..aa0a1ff 100644 (file)
@@ -27,12 +27,7 @@ EINTERN Evas_Object *e_mod_comp_win_mirror_add(E_Comp_Win *cw);
 EINTERN void         e_mod_comp_cb_win_mirror_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
 EINTERN void         e_mod_comp_src_hidden_set_func(void *data, E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden);
 EINTERN void         e_mod_comp_x_grab_set(E_Comp *c, Eina_Bool grab);
-EINTERN void         e_mod_comp_explicit_show_done(E_Comp_Win *cw);
-EINTERN void         e_mod_comp_explicit_hide_done(E_Comp_Win *cw);
-EINTERN void         e_mod_comp_explicit_raise_above_show_done(E_Comp_Win *cw);
-EINTERN void         e_mod_comp_explicit_raise_above_hide_done(E_Comp_Win *cw);
-EINTERN void         e_mod_comp_explicit_background_show_done(E_Comp_Win *cw);
-EINTERN void         e_mod_comp_explicit_background_hide_done(E_Comp_Win *cw);
+EINTERN void         e_mod_comp_composite_mode_set(E_Zone *zone, Eina_Bool set);
 
 #endif
 #endif
index 70e9aa5..be5e558 100644 (file)
@@ -38,7 +38,6 @@ EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END_DONE      = 0;
 EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST       = 0;
 EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE  = 0;
 EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP = 0;
-EINTERN Ecore_X_Atom ATOM_CAPTURE_EFFECT                   = 0;
 EINTERN Ecore_X_Atom ATOM_NET_CM_WINDOW_BACKGROUND         = 0;
 
 /* local subsystem globals */
@@ -80,7 +79,6 @@ static const char *atom_names[] = {
   "_E_COMP_PIXMAP_ROTATION_REQUEST",
   "_E_COMP_PIXMAP_ROTATION_REQUEST_DONE",
   "_E_COMP_PIXMAP_ROTATION_RESIZE_PIXMAP",
-  "_E_COMP_CAPTURE_EFFECT",
   "_NET_CM_WINDOW_BACKGROUND"
 };
 
@@ -145,7 +143,6 @@ e_mod_comp_atoms_init(void)
    ATOM_CM_PIXMAP_ROTATION_REQUEST       = atoms[i++];
    ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE  = atoms[i++];
    ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP = atoms[i++];
-   ATOM_CAPTURE_EFFECT                   = atoms[i++];
    ATOM_NET_CM_WINDOW_BACKGROUND         = atoms[i++];
 
    for (i = 0; i < n; i++)
@@ -159,7 +156,6 @@ e_mod_comp_atoms_init(void)
    i = 0;
    eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE),        external_atom_names[i++]);
    eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_COMP_SYNC_COUNTER),          external_atom_names[i++]);
-   eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE), external_atom_names[i++]);
    eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_ILLUME_WINDOW_STATE),        external_atom_names[i++]);
    eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_NET_WM_WINDOW_OPACITY),        external_atom_names[i++]);
    eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_WM_CLASS),                     external_atom_names[i++]);
index 77b54ef..afbee68 100644 (file)
@@ -39,7 +39,6 @@ extern EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END_DONE;
 extern EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST;
 extern EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE;
 extern EINTERN Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP;
-extern EINTERN Ecore_X_Atom ATOM_CAPTURE_EFFECT;
 extern EINTERN Ecore_X_Atom ATOM_NET_CM_WINDOW_BACKGROUND;
 
 EINTERN int         e_mod_comp_atoms_init(void);
index 43e213b..ae75fdb 100644 (file)
@@ -13,11 +13,179 @@ static Eina_Bool _nocomp_prepare_timeout(void *data);
 static Eina_Bool _nocomp_end_timeout(void *data);
 
 /* externally accessible functions */
+EINTERN void
+e_mod_comp_layer_eval(E_Comp_Layer *ly)
+{
+   e_layout_freeze(ly->layout);
+
+   if (!ly->bg)
+     {
+        ly->bg = evas_object_rectangle_add(ly->canvas->evas);
+        /* TODO: make it configurable */
+        if (!strncmp(ly->name, "move", strlen("move")))
+          evas_object_color_set(ly->bg, 0, 0, 0, 0);
+        else
+          evas_object_color_set(ly->bg, 0, 0, 0, 255);
+        evas_object_show(ly->bg);
+        e_layout_pack(ly->layout, ly->bg);
+     }
+   e_layout_child_move(ly->bg, ly->x, ly->y);
+   e_layout_child_resize(ly->bg, ly->w, ly->h);
+   e_layout_child_lower(ly->bg);
+
+   evas_object_move(ly->layout, ly->x, ly->y);
+   evas_object_resize(ly->layout, ly->w, ly->h);
+   e_layout_virtual_size_set(ly->layout, ly->w, ly->h);
+
+   e_layout_thaw(ly->layout);
+}
+
+EINTERN void
+e_mod_comp_layer_populate(E_Comp_Layer *ly,
+                          Evas_Object  *o)
+{
+   e_layout_pack(ly->layout, o);
+}
+
+/* adjust the stack position of the background object to the bottom of layer */
+EINTERN void
+e_mod_comp_layer_bg_adjust(E_Comp_Layer *ly)
+{
+   e_layout_freeze(ly->layout);
+
+   if (!ly->bg)
+     {
+        ly->bg = evas_object_rectangle_add(ly->canvas->evas);
+        evas_object_color_set(ly->bg, 0, 0, 0, 255);
+        evas_object_show(ly->bg);
+        e_layout_pack(ly->layout, ly->bg);
+     }
+
+   e_layout_child_lower(ly->bg);
+
+   e_layout_thaw(ly->layout);
+}
+
+EINTERN void
+e_mod_comp_layer_effect_set(E_Comp_Layer *ly,
+                            Eina_Bool     set)
+{
+   if (strcmp(ly->name, "effect"))
+     return;
+
+   if (set)
+     {
+        ly->count++;
+        ly->canvas->animation.run = 1;
+        ly->canvas->animation.num++;
+
+        if (!evas_object_visible_get(ly->layout))
+          {
+             e_mod_comp_composite_mode_set(ly->canvas->zone, EINA_TRUE);
+             evas_object_show(ly->layout);
+          }
+     }
+   else
+     {
+        /* decrease effect count and hide effect layer if it is 0 */
+        ly->count--;
+        ly->canvas->animation.num--;
+
+        if (ly->count <= 0)
+          {
+             E_FREE_LIST(ly->objs, e_mod_comp_effect_object_free);
+             evas_object_hide(ly->layout);
+
+             ly->canvas->animation.run = 0;
+             ly->canvas->animation.num = 0;
+             ly->count = 0;
+
+             e_mod_comp_composite_mode_set(ly->canvas->zone, EINA_FALSE);
+          }
+     }
+}
+
+EINTERN Eina_Bool
+e_mod_comp_layer_effect_get(E_Comp_Layer *ly)
+{
+   E_CHECK_RETURN(ly, EINA_FALSE);
+
+   if (strcmp(ly->name, "effect"))
+     return EINA_FALSE;
+
+   return ly->canvas->animation.run;
+}
+
+EINTERN E_Comp_Effect_Object *
+e_mod_comp_layer_effect_obj_get(E_Comp_Layer   *ly,
+                                Ecore_X_Window win)
+{
+   E_Comp_Effect_Object *obj = NULL;
+   Eina_List *l;
+   E_CHECK_RETURN(ly, NULL);
+
+   if (strcmp(ly->name, "effect"))
+     return NULL;
+
+   EINA_LIST_FOREACH(ly->objs, l, obj)
+     {
+        if (!obj) continue;
+        if (obj->win == win)
+          {
+             return obj;
+          }
+     }
+
+   return NULL;
+}
+
+static void
+_ly_intercept_show(void        *data,
+                   Evas_Object *obj)
+{
+   E_Comp_Layer *ly = (E_Comp_Layer *)data;
+
+   ELBF(ELBT_COMP, 0, 0,
+        "%15.15s|name:%s layout:%p obj:%p",
+        "LY_PRE_SHOW", ly->name, ly->layout, obj);
+
+   /* TODO: an incontrollable effect layer show problem can occasionally occur. */
+   if (!strcmp(ly->name, "effect"))
+     {
+        if (!ly->canvas->animation.run)
+          {
+             ELBF(ELBT_COMP, 0, 0,
+                  "%15.15s|name:%s layout:%p obj:%p SKIP SHOW run:%d",
+                  "LY_PRE_SHOW", ly->name, ly->layout, obj,
+                  ly->canvas->animation.run);
+
+             return;
+          }
+     }
+
+   evas_object_show(obj);
+}
+
+static void
+_ly_intercept_hide(void        *data,
+                   Evas_Object *obj)
+{
+   E_Comp_Layer *ly = (E_Comp_Layer *)data;
+
+   ELBF(ELBT_COMP, 0, 0,
+        "%15.15s|name:%s layout:%p obj:%p",
+        "LY_PRE_HIDE", ly->name, ly->layout, obj);
+
+   evas_object_hide(obj);
+}
+
+/* externally accessible functions */
 EINTERN E_Comp_Canvas *
 e_mod_comp_canvas_add(E_Comp *c,
                       E_Zone *zone)
 {
    E_Comp_Canvas *canvas;
+   E_Comp_Layer *ly;
    int x, y, w, h;
    E_CHECK_RETURN(c, 0);
 
@@ -108,15 +276,51 @@ e_mod_comp_canvas_add(E_Comp *c,
    canvas->bg_img = evas_object_rectangle_add(canvas->evas);
    evas_object_color_set(canvas->bg_img, 0, 0, 0, 255);
    evas_object_stack_below(canvas->bg_img, evas_object_bottom_get(canvas->evas));
-   evas_object_show(canvas->bg_img);
    evas_object_move(canvas->bg_img, 0, 0);
    evas_object_resize(canvas->bg_img, w, h);
+   evas_object_show(canvas->bg_img);
 
    ecore_evas_show(canvas->ee);
 
    canvas->ee_win = ecore_evas_window_get(canvas->ee);
    canvas->zone = zone;
 
+   /* TODO: make a configurable list */
+   int i;
+   const char *names[] = {"comp", "effect", "move"};
+   for (i = 0; i < 3; i++)
+     {
+        ly = E_NEW(E_Comp_Layer, 1);
+        E_CHECK_GOTO(ly, error_cleanup);
+        ly->name = strdup(names[i]);
+        ly->layout = e_layout_add(canvas->evas);
+        if (!ly->layout)
+          {
+             E_FREE(ly);
+             goto error_cleanup;
+          }
+
+        evas_object_color_set(ly->layout, 255, 255, 255, 255);
+
+        ly->x = 0;
+        ly->y = 0;
+        ly->w = w;
+        ly->h = h;
+        ly->canvas = canvas;
+
+        e_mod_comp_layer_eval(ly);
+
+        if (!strcmp(names[i], "comp"))
+          evas_object_show(ly->layout);
+
+        evas_object_intercept_show_callback_add(ly->layout, _ly_intercept_show, ly);
+        evas_object_intercept_hide_callback_add(ly->layout, _ly_intercept_hide, ly);
+
+        canvas->layers = eina_list_append(canvas->layers, ly);
+
+        ELBF(ELBT_COMP, 0, i, "E_Comp_Layer:%s", names[i]);
+     }
+
    // comp can create only one ecore_evas for H/W overlay window
    // this limit will be removed later
    if ((_comp_mod->conf->use_hw_ov) &&
@@ -131,11 +335,23 @@ e_mod_comp_canvas_add(E_Comp *c,
           }
      }
 
+   canvas->zr = e_mod_comp_effect_zone_rotation_new(canvas);
+   E_CHECK_GOTO(canvas->zr, error_cleanup);
+
    c->canvases = eina_list_append(c->canvases, canvas);
 
    return canvas;
 
 error_cleanup:
+   if (canvas->zr)
+     e_mod_comp_effect_zone_rotation_free(canvas->zr);
+
+   EINA_LIST_FREE(canvas->layers, ly)
+     {
+        free(ly->name);
+        evas_object_del(ly->layout);
+        E_FREE(ly);
+     }
    if (canvas->ee)
      ecore_evas_free(canvas->ee);
 
@@ -148,6 +364,8 @@ error_cleanup:
 EINTERN void
 e_mod_comp_canvas_del(E_Comp_Canvas *canvas)
 {
+   E_Comp_Layer *ly;
+
    if (canvas->fps.fg)
      {
         evas_object_del(canvas->fps.fg);
@@ -163,6 +381,11 @@ e_mod_comp_canvas_del(E_Comp_Canvas *canvas)
         evas_object_del(canvas->bg_img);
         canvas->bg_img = NULL;
      }
+   if (canvas->zr)
+     {
+        e_mod_comp_effect_zone_rotation_free(canvas->zr);
+        canvas->zr = NULL;
+     }
    if (canvas->ov)
      {
         e_mod_comp_hw_ov_win_free(canvas->ov);
@@ -171,11 +394,38 @@ e_mod_comp_canvas_del(E_Comp_Canvas *canvas)
      }
    ecore_evas_gl_x11_pre_post_swap_callback_set(canvas->ee, NULL, NULL, NULL);
    ecore_evas_manual_render(canvas->ee);
+
+   EINA_LIST_FREE(canvas->layers, ly)
+     {
+        free(ly->name);
+        evas_object_del(ly->layout);
+        E_FREE(ly);
+     }
+
    ecore_evas_free(canvas->ee);
    memset(canvas, 0, sizeof(E_Comp_Canvas));
    E_FREE(canvas);
 }
 
+EINTERN E_Comp_Layer *
+e_mod_comp_canvas_layer_get(E_Comp_Canvas *canvas,
+                            const char    *name)
+{
+   E_Comp_Layer *ly;
+   Eina_List *l;
+
+   E_CHECK_RETURN(canvas, NULL);
+   E_CHECK_RETURN(name, NULL);
+
+   EINA_LIST_FOREACH(canvas->layers, l, ly)
+     {
+        if (!strcmp(ly->name, name))
+          return ly;
+     }
+
+   return NULL;
+}
+
 EINTERN E_Comp_Win *
 e_mod_comp_canvas_fullscreen_check(E_Comp_Canvas *canvas)
 {
@@ -193,9 +443,6 @@ e_mod_comp_canvas_fullscreen_check(E_Comp_Canvas *canvas)
 
    EINA_INLIST_REVERSE_FOREACH(c->wins, cw)
      {
-        if (cw->move_lock)
-          return NULL;
-
         if ((!cw->visible)   ||
             (cw->input_only) ||
             (cw->invalid))
@@ -578,9 +825,6 @@ _pre_swap(void *data,
         if (!canvas) continue;
         if (canvas->evas != e) continue;
 
-        L(LT_EVENT_X, "COMP|%31s|canvas:%d\n", "PRE_SWAP",
-          canvas->zone ? canvas->zone->num : -1);
-
         e_mod_comp_hw_ov_win_msg_show
           (E_COMP_LOG_TYPE_SWAP,
           "%d %d SWAP a%d m%d",
index 39228fa..98dbcad 100644 (file)
@@ -4,6 +4,7 @@
 #define E_MOD_COMP_CANVAS_H
 
 typedef struct _E_Comp_Canvas E_Comp_Canvas;
+typedef struct _E_Comp_Layer  E_Comp_Layer;
 
 typedef enum _E_Nocomp_Mode
 {
@@ -15,6 +16,17 @@ typedef enum _E_Nocomp_Mode
    E_NOCOMP_MODE_DISPOSE
 } E_Nocomp_Mode;
 
+struct _E_Comp_Layer
+{
+   char             *name;
+   Evas_Object      *layout;     // e_layout
+   Evas_Object      *bg;         // background rectangle object for e_layout
+   int               x, y, w, h; // geometry
+   E_Comp_Canvas    *canvas;     // parent canvas
+   unsigned int      count;      // indicates number of running effect objects, if 0 then layer will be hidden
+   Eina_List        *objs;       // list of E_Comp_Effect_Object
+};
+
 struct _E_Comp_Canvas
 {
    E_Comp           *comp;
@@ -22,6 +34,7 @@ struct _E_Comp_Canvas
    Ecore_Evas       *ee;
    Ecore_X_Window    ee_win;
    Evas             *evas;
+   Eina_List        *layers; // list of E_Comp_Layer
    int               x, y, w, h; // geometry
    int               num;
    struct {
@@ -52,6 +65,7 @@ struct _E_Comp_Canvas
    Evas_Object      *bg_img;
    Eina_Bool         use_bg_img : 1;
    E_Comp_HW_Ov_Win *ov;
+   E_Comp_Effect_Zone_Rotation *zr;
 };
 
 EINTERN E_Comp_Canvas *e_mod_comp_canvas_add(E_Comp *c, E_Zone *zone);
@@ -61,6 +75,14 @@ EINTERN void           e_mod_comp_canvas_nocomp_prepare(E_Comp_Canvas *canvas, E
 EINTERN Eina_Bool      e_mod_comp_canvas_nocomp_begin(E_Comp_Canvas *canvas);
 EINTERN Eina_Bool      e_mod_comp_canvas_nocomp_end(E_Comp_Canvas *canvas);
 EINTERN Eina_Bool      e_mod_comp_canvas_nocomp_dispose(E_Comp_Canvas *canvas);
+EINTERN E_Comp_Layer  *e_mod_comp_canvas_layer_get(E_Comp_Canvas *canvas, const char *name);
+
+EINTERN void                  e_mod_comp_layer_populate(E_Comp_Layer *ly, Evas_Object *o);
+EINTERN void                  e_mod_comp_layer_eval(E_Comp_Layer *ly);
+EINTERN void                  e_mod_comp_layer_bg_adjust(E_Comp_Layer *ly);
+EINTERN void                  e_mod_comp_layer_effect_set(E_Comp_Layer *ly, Eina_Bool set);
+EINTERN Eina_Bool             e_mod_comp_layer_effect_get(E_Comp_Layer *ly);
+EINTERN E_Comp_Effect_Object *e_mod_comp_layer_effect_obj_get(E_Comp_Layer *ly, Ecore_X_Window win);
 
 #endif
 #endif
index f33d0c5..bf8cc7c 100644 (file)
@@ -83,9 +83,11 @@ _e_mod_comp_debug_canvas_info_dump(E_Comp        *c,
                                    E_Comp_Canvas *canvas,
                                    FILE          *fs)
 {
-   Eina_List *l;
+   Eina_List *l, *ll;
    E_Comp_Object *co, *_co = NULL;
    E_Comp_Win *cw, *_cw = NULL;
+   E_Comp_Layer *ly = NULL;
+   Eina_List *lm = NULL;
    int x, y, w, h, i = 1;
    const char *file = NULL, *group = NULL;
    double val = 0.0;
@@ -105,10 +107,18 @@ _e_mod_comp_debug_canvas_info_dump(E_Comp        *c,
    fprintf(fs, "--------------------------------------------------------------------------------------------------------------------------------------\n");
    fprintf(fs, " NO     WinID      shobj        obj    found_o   ex   ey   ew   eh | W S O | V SYNC  DMG DONE |\n");
    fprintf(fs, "--------------------------------------------------------------------------------------------------------------------------------------\n");
-   Evas_Object *o = evas_object_top_get(canvas->evas);
    Eina_Bool found = 0;
-   while (o)
+
+   ly = e_mod_comp_canvas_layer_get(canvas, "comp");
+   E_CHECK(ly);
+
+   lm = evas_object_smart_members_get(ly->layout);
+   Evas_Object *o = NULL;
+
+   EINA_LIST_REVERSE_FOREACH(lm, ll, o)
      {
+        if (!evas_object_visible_get(o)) continue;
+
         EINA_INLIST_REVERSE_FOREACH(c->wins, cw)
           {
              if (!cw) break;
@@ -126,7 +136,7 @@ _e_mod_comp_debug_canvas_info_dump(E_Comp        *c,
                }
           }
 
-        if (found && _co && _cw && _cw->visible)
+        if (found && _co && _cw)
           {
              edje_object_file_get(_co->shadow, &file, &group);
              evas_object_geometry_get(o, &x, &y, &w, &h);
@@ -142,7 +152,6 @@ _e_mod_comp_debug_canvas_info_dump(E_Comp        *c,
                      edje_object_part_state_get(_co->shadow, "e.swallow.content", &val), val);
           }
 
-        o = evas_object_below_get(o);
         found = 0;
         _co = NULL;
         _cw = NULL;
index c95b37d..1f1f124 100644 (file)
@@ -20,23 +20,117 @@ struct _E_Comp_Effect_Job
    Evas_Object   *o;
    E_Comp_Canvas *canvas;
    Ecore_X_Window win;
+   Ecore_X_Window cwin;
    char           emission[1024];
    char           src[1024];
    Eina_Bool      emitted;
-   Eina_Bool      wait_previous_effect_done;
+   Eina_Bool      effect_obj;
 };
 
-static Eina_List   *effect_jobs = NULL;
+static Eina_List *effect_jobs = NULL;
 
 /* local subsystem functions */
 static E_Comp_Effect_Style _effect_style_get(Ecore_X_Atom a);
-static void                _effect_stage_enable(E_Comp_Win *cw, E_Comp_Win *cw2);
 static Eina_Bool           _state_send(E_Comp_Win *cw, Eina_Bool state);
-static Eina_Bool           _effect_animating_check(const char *emission);
-static Ecore_X_Window      _comp_win_xid_get(E_Comp_Win *cw);
 static Eina_Bool           _effect_signal_del_intern(E_Comp_Win *cw, Evas_Object *obj, const char *name, Eina_Bool clean_all);
 
+static void                _effect_win_set(E_Comp_Win *cw, const char *emission);
+static void                _effect_below_wins_set(E_Comp_Win *cw);
+static void                _effect_above_wins_set(E_Comp_Win *cw, Eina_Bool show);
+static void                _effect_show(E_Comp_Win *cw);
+static void                _effect_hide(E_Comp_Win *cw);
+static Eina_Bool           _effect_obj_win_set(E_Comp_Effect_Object *o, E_Comp_Win *cw);
+static void                _effect_obj_effect_done(void *data, Evas_Object *obj, const char *emission, const char *source);
+static Eina_Bool           _effect_obj_find(E_Comp_Win *cw);
+
 /* externally accessible functions */
+EINTERN E_Comp_Effect_Object *
+e_mod_comp_effect_object_new(E_Comp_Layer *ly,
+                             E_Comp_Win   *cw)
+{
+   E_Comp_Effect_Object *o = NULL;
+   Eina_Bool res;
+   E_CHECK_RETURN(ly, NULL);
+   E_CHECK_RETURN(cw, NULL);
+
+   res = _effect_obj_find(cw);
+   /* TODO: clean up previous effect job */
+   E_CHECK_RETURN(!res, NULL);
+
+   o = E_NEW(E_Comp_Effect_Object, 1);
+   E_CHECK_RETURN(o, NULL);
+
+   o->edje = edje_object_add(ly->canvas->evas);
+   E_CHECK_GOTO(o->edje, fail);
+
+   e_mod_comp_layer_populate(ly, o->edje);
+
+   evas_object_data_set(o->edje, "comp.effect_obj.ly", ly);
+   evas_object_data_set(o->edje, "comp.effect_obj.cwin",
+                        (void *)e_mod_comp_util_client_xid_get(cw));
+
+   res = _effect_obj_win_set(o, cw);
+   E_CHECK_GOTO(res, fail);
+
+   ly->objs = eina_list_append(ly->objs, o);
+
+   ELBF(ELBT_COMP, 0, o->cwin,
+        "%15.15s| OBJ_NEW %p", "EFFECT", o->edje);
+
+   return o;
+
+fail:
+   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+        "%15.15s| OBJ_NEW Failed", "EFFECT");
+   if (o)
+     {
+        if (o->edje)
+          {
+             e_layout_unpack(o->edje);
+             evas_object_del(o->edje);
+          }
+        E_FREE(o);
+     }
+   return NULL;
+}
+
+EINTERN void
+e_mod_comp_effect_object_free(E_Comp_Effect_Object *o)
+{
+   E_CHECK(o);
+
+   if ((o->edje) && (o->img))
+     edje_object_part_unswallow(o->edje, o->img);
+
+   if (o->img)
+     {
+        /* TODO: consider when using an xim */
+        evas_object_image_native_surface_set(o->img, NULL);
+        evas_object_image_size_set(o->img, 1, 1);
+        evas_object_image_data_set(o->img, NULL);
+        evas_object_hide(o->img);
+        evas_object_del(o->img);
+     }
+
+   if (o->pixmap)
+     ecore_x_pixmap_free(o->pixmap);
+
+   if (o->edje)
+     {
+        evas_object_data_del(o->edje, "comp.effect_obj.ly");
+        evas_object_data_del(o->edje, "comp.effect_obj.cwin");
+        evas_object_hide(o->edje);
+        evas_object_del(o->edje);
+     }
+
+   ELBF(ELBT_COMP, 0, o->cwin,
+        "%15.15s| OBJ_FREE", "EFFECT");
+
+   memset(o, 0, sizeof(E_Comp_Effect_Object));
+
+   E_FREE(o);
+}
+
 EINTERN Eina_Bool
 e_mod_comp_effect_signal_del(E_Comp_Win  *cw,
                              Evas_Object *obj,
@@ -59,6 +153,7 @@ e_mod_comp_effect_signal_flush(void)
    E_Comp_Effect_Job *job;
    Eina_List *l;
    E_Comp_Win *cw;
+   E_Comp_Layer *ly;
 
    EINA_LIST_FOREACH(effect_jobs, l, job)
      {
@@ -71,91 +166,51 @@ e_mod_comp_effect_signal_flush(void)
                {
                   if (cw->animating)
                     {
-                       job->wait_previous_effect_done = EINA_TRUE;
+                       ELBF(ELBT_COMP, 0, job->cwin,
+                            "%15.15s|     SIG_PEND:%s", "EFFECT",
+                            job->emission);
                        continue;
                     }
                   else
                     {
-                       if (strncmp(job->emission, "e,state,raise_above_post,on", sizeof("e,state,raise_above_post,on")) == 0)
-                         {
-                            // special contonl this signal
-                            edje_object_signal_emit(job->o, job->emission, job->src);
-
-                            ELBF(ELBT_COMP, 0, job->win,
-                                 "%15.15s|EMIT %s", "SIGNAL",
-                                 job->emission);
-
-                            effect_jobs = eina_list_remove(effect_jobs, job);
-                            E_FREE(job);
-                         }
-                       else
-                         {
-                            e_mod_comp_effect_animating_set(cw->c, cw, EINA_TRUE);
-                            job->canvas->animation.run = 1;
-                            job->canvas->animation.num++;
-                            job->emitted = EINA_TRUE;
-
-                            if (job->wait_previous_effect_done)
-                              {
-                                 // do check effectable & signal emit
-                                 // or send_done and do not send signal emit
-                                 if ((strncmp(job->emission, "e,state,visible,on", sizeof("e,state,visible,on")) == 0) ||
-                                     /* e,state,window,angle is used for keyboard show effect */
-                                     (strncmp(job->emission, "e,state,window,angle", sizeof("e,state,window,angle")) == 0) ||
-                                     (strncmp(job->emission, "e,state,visible,off", sizeof("e,state,visible,off")) == 0))
-                                   {
-                                      // do effect signal emit
-                                      edje_object_signal_emit(job->o, job->emission, job->src);
-
-                                      ELBF(ELBT_COMP, 0, job->win,
-                                           "%15.15s|EMIT %s", "SIGNAL",
-                                           job->emission);
-                                   }
-                                 else if (strncmp(job->emission, "e,state,window,rotation,", sizeof("e,state,window,rotation")) == 0)
-                                   {
-                                      e_mod_comp_explicit_win_rotation_done(cw);
-                                   }
-                                 else if (strncmp(job->emission, "e,state,raise_above,on", sizeof("e,state,raise_above,on")) == 0)
-                                   {
-                                      e_mod_comp_explicit_raise_above_show_done(cw);
-                                   }
-                                 else if (strncmp(job->emission, "e,state,raise_above,off", sizeof("e,state,raise_above,off")) == 0)
-                                   {
-                                      e_mod_comp_explicit_raise_above_hide_done(cw);
-                                   }
-                              }
-                            else
-                              {
-                                 edje_object_signal_emit(job->o, job->emission, job->src);
-
-                                 ELBF(ELBT_COMP, 0, job->win,
-                                      "%15.15s|EMIT %s", "SIGNAL",
-                                      job->emission);
-                              }
-                         }
+                       e_mod_comp_effect_animating_set(cw->c, cw, EINA_TRUE);
+                       job->emitted = EINA_TRUE;
+
+                       edje_object_signal_emit(job->o, job->emission, job->src);
+
+                       ELBF(ELBT_COMP, 0, job->cwin,
+                            "%15.15s|     SIG_EMIT>%s", "EFFECT",
+                            job->emission);
                     }
                }
              else
                {
-                  // if cw is not exist then clear effect job
+                  ELBF(ELBT_COMP, 0, job->cwin,
+                       "%15.15s|     SIG_DEL :%s", "EFFECT",
+                       job->emission);
+
+                  /* remove this job if cw was already removed */
                   effect_jobs = eina_list_remove(effect_jobs, job);
                   E_FREE(job);
                }
           }
         else
-          { // effect for not window ex) capture. etc...
+          {
              edje_object_signal_emit(job->o, job->emission, job->src);
 
-             ELBF(ELBT_COMP, 0, job->win,
-                  "%15.15s|EMIT %s", "SIGNAL",
+             ELBF(ELBT_COMP, 0, job->cwin,
+                  "%15.15s| OBJ SIG_EMIT>%s", "EFFECT",
                   job->emission);
 
+             ly = evas_object_data_get(job->o, "comp.effect_obj.ly");
+             if (ly) e_mod_comp_layer_effect_set(ly, EINA_TRUE);
+
              effect_jobs = eina_list_remove(effect_jobs, job);
              E_FREE(job);
           }
      }
 
-   return 1;
+   return EINA_TRUE;
 }
 
 EINTERN E_Comp_Effect_Type *
@@ -281,22 +336,27 @@ e_mod_comp_effect_style_get(E_Comp_Effect_Type *type,
    return res;
 }
 
+#define _MAKE_EMISSION(f, x...) do { snprintf(emission, sizeof(emission), f, ##x); } while(0)
+
 EINTERN void
-e_mod_comp_effect_win_show(E_Comp_Win *cw)
+e_mod_comp_effect_win_restack(E_Comp_Win *cw,
+                              Eina_Bool   v1,
+                              Eina_Bool   v2)
 {
-   E_Comp_Effect_Style st;
-   Eina_Bool animatable, launch;
-   E_Comp_Win *bg_cw = NULL;
-   char emission[64];
-   E_CHECK(cw);
-   E_CHECK(cw->c);
+   Eina_Bool animatable = e_mod_comp_effect_state_get(cw->eff_type);
+   if (!((cw->c->animatable) && (animatable))) return;
+   if ((v1) == (v2)) return;
 
-   cw->first_show_worked = EINA_TRUE;
+   if ((!v1) && (v2))
+     _effect_show(cw);
+   else
+     _effect_hide(cw);
+}
 
-   animatable = e_mod_comp_effect_state_get(cw->eff_type);
-   st = e_mod_comp_effect_style_get
-          (cw->eff_type,
-          E_COMP_EFFECT_KIND_SHOW);
+EINTERN void
+e_mod_comp_effect_win_show(E_Comp_Win *cw)
+{
+   Eina_Bool animatable = e_mod_comp_effect_state_get(cw->eff_type);
 
    if (cw->c->fake_image_launch)
      {
@@ -306,7 +366,6 @@ e_mod_comp_effect_win_show(E_Comp_Win *cw)
              if (e_mod_comp_effect_image_launch_fake_show_done_check(cw->c->eff_img))
                {
                   e_mod_comp_effect_image_launch_disable(cw->c->eff_img);
-                  e_mod_comp_effect_signal_add(cw, NULL, "e,state,visible,on,noeffect", "e");
                   goto postjob;
                }
              else
@@ -315,377 +374,56 @@ e_mod_comp_effect_win_show(E_Comp_Win *cw)
           }
      }
 
-   if (!cw->c->animatable ||
-       !animatable)
+   if ((cw->c->animatable) && (animatable))
      {
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,on,noeffect", "e");
-        goto postjob;
-     }
-
-   switch (st)
-     {
-      case E_COMP_EFFECT_STYLE_DEFAULT:
-        launch = e_mod_comp_policy_app_launch_check(cw);
-        if (launch)
-          {
-             if (!(cw->launched))
-               {
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on", "e");
-               }
-             else
-               {
-                 e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on,noeffect", "e");
-               }
-             goto postjob;
-          }
-
-        if (TYPE_KEYBOARD_CHECK(cw))
-          {
-             if (cw->c->keyboard_effect)
-               {
-                  if (e_mod_comp_effect_win_angle_get(cw))
-                    {
-                       snprintf(emission, sizeof(emission),
-                                "e,state,window,angle,%d", cw->angle);
-                       e_mod_comp_effect_signal_add(cw, NULL, emission, "e");
-                    }
-                  else
-                     e_mod_comp_effect_signal_add
-                        (cw, NULL, "e,state,window,angle,0", "e");
-               }
-             else
-                e_mod_comp_effect_signal_add
-                   (cw, NULL, "e,state,visible,on,noeffect", "e");
-          }
-        else
-          e_mod_comp_effect_signal_add
-            (cw, NULL, "e,state,visible,on,noeffect", "e");
-        break;
-      case E_COMP_EFFECT_STYLE_NONE:
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,on,noeffect", "e");
-        break;
-      case E_COMP_EFFECT_STYLE_CUSTOM0:
-        if (TYPE_INDICATOR_CHECK(cw))
-          {
-             switch (cw->angle)
-               {
-                case 90:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on,custom0,90", "e");
-                  break;
-                case 180:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on,custom0,180", "e");
-                  break;
-                case 270:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on,custom0,270", "e");
-                  break;
-                case 0:
-                default:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,on,custom0,0", "e");
-                  break;
-               }
-          }
-        else
-          {
-             e_mod_comp_effect_signal_add
-               (cw, NULL, "e,state,visible,on,custom0", "e");
-          }
-        break;
-      case E_COMP_EFFECT_STYLE_CUSTOM1:
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,on,custom1", "e");
-        break;
-      default:
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,on", "e");
-        break;
+        _effect_show(cw);
      }
 
 postjob:
+   /* for the composite window */
+   e_mod_comp_effect_signal_add(cw, NULL, "e,state,visible,on,noeffect", "e");
+
+   /* TODO: message of comp object visibility should be sent after finishing effect */
    e_mod_comp_comp_event_src_visibility_send(cw);
 }
 
 EINTERN Eina_Bool
 e_mod_comp_effect_win_hide(E_Comp_Win *cw)
 {
-   E_Comp_Effect_Style st;
-   Eina_Bool animatable;
-   Eina_Bool close = EINA_FALSE;
-   char emission[64];
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->c, 0);
-   E_CHECK_RETURN((!cw->input_only), 0);
-   E_CHECK_RETURN((!cw->invalid), 0);
+   Eina_Bool animatable, visible;
 
    animatable = e_mod_comp_effect_state_get(cw->eff_type);
-   st = e_mod_comp_effect_style_get
-          (cw->eff_type,
-          E_COMP_EFFECT_KIND_HIDE);
+   visible = e_mod_comp_util_win_visible_get(cw);
 
-   if ((!cw->c->animatable) ||
-       (!animatable))
-     {
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,off,noeffect", "e");
-        goto postjob;
-     }
+   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+        "%15.15s| CHECK visible:%d cw->visible:%d a:%d", "EFFECT",
+        visible, cw->visible, animatable);
 
-   switch (st)
+   if ((cw->c->animatable) && (animatable) &&
+       (visible))
      {
-      case E_COMP_EFFECT_STYLE_DEFAULT:
-        if (TYPE_KEYBOARD_CHECK(cw))
-          {
-             if (cw->c->keyboard_effect)
-               {
-                  if (e_mod_comp_effect_win_angle_get(cw))
-                    {
-                       snprintf(emission, sizeof(emission), "e,state,visible,off,angle,%d", cw->angle);
-                       e_mod_comp_effect_signal_add(cw, NULL, emission, "e");
-                    }
-                  else
-                    e_mod_comp_effect_signal_add
-                       (cw, NULL, "e,state,visible,off,angle,0", "e");
-               }
-             else
-                e_mod_comp_effect_signal_add
-                   (cw, NULL, "e,state,visible,off,noeffect", "e");
-          }
-        else
-          ;
-        break;
-      case E_COMP_EFFECT_STYLE_NONE:
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,off,noeffect", "e");
-        break;
-      case E_COMP_EFFECT_STYLE_CUSTOM0:
-        if (TYPE_INDICATOR_CHECK(cw))
-          {
-             switch (cw->angle)
-               {
-                case 90:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,off,custom0,90", "e");
-                  break;
-                case 180:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,off,custom0,180", "e");
-                  break;
-                case 270:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,off,custom0,270", "e");
-                  break;
-                case 0:
-                default:
-                  e_mod_comp_effect_signal_add
-                    (cw, NULL, "e,state,visible,off,custom0,0", "e");
-                  break;
-               }
-          }
-        else
-          {
-             e_mod_comp_effect_signal_add
-               (cw, NULL, "e,state,visible,off,custom0", "e");
-          }
-        break;
-      case E_COMP_EFFECT_STYLE_CUSTOM1:
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,visible,off,custom1", "e");
-        break;
-      default:
-        e_mod_comp_effect_signal_add
-           (cw, NULL, "e,state,visible,off", "e");
-        break;
+        _effect_hide(cw);
      }
 
-postjob:
+   /* for the composite window */
+   e_mod_comp_effect_signal_add(cw, NULL, "e,state,visible,off,noeffect", "e");
+
+   /* TODO: message of comp object visibility should be sent after finishing effect */
    e_mod_comp_comp_event_src_visibility_send(cw);
    return EINA_TRUE;
 }
 
-EINTERN void
-e_mod_comp_effect_win_restack(E_Comp_Win *cw,
-                              E_Comp_Win *cw2)
-{
-   E_Comp_Win *_cw = cw2;
-   Eina_Inlist *l;
-
-   E_CHECK(cw);
-   E_CHECK(cw2);
-
-   L(LT_EFFECT,
-     "[COMP] %18.18s w:0x%08x %s\n",
-     "EFF", e_mod_comp_util_client_xid_get(cw),
-     "RAISE_ABOVE");
-
-   while (_cw->defer_hide || !(REGION_EQUAL_TO_ROOT(_cw)) ||
-          _cw->input_only || _cw->invalid ||
-          !(TYPE_NORMAL_CHECK(_cw) || TYPE_HOME_CHECK(_cw) ||
-            TYPE_TASKMANAGER_CHECK(_cw)))
-     {
-        l = EINA_INLIST_GET(_cw)->prev;
-        E_CHECK(l);
-        _cw = _EINA_INLIST_CONTAINER(_cw, l);
-        E_CHECK(_cw);
-     }
-   E_CHECK(_cw->visible);
-
-   if (e_mod_comp_policy_app_launch_check(cw))
-     {
-        e_mod_comp_win_comp_objs_stack_above(cw, cw2);
-        if (cw->launched)
-           e_mod_comp_effect_signal_add
-             (cw, NULL, "e,state,raise_above,on", "e");     }
-   else if (e_mod_comp_policy_app_close_check(_cw))
-     {
-        if (cw->c->defer_raise_effect)
-          {
-             cw->defer_raise = EINA_TRUE;
-             _cw->defer_raise = EINA_TRUE;
-          }
-        else
-          e_mod_comp_win_comp_objs_stack_above(cw, cw2);
-
-        e_mod_comp_effect_mirror_handler_hide(cw, _cw);
-     }
-   else
-     {
-        e_mod_comp_win_comp_objs_stack_above(cw, cw2);
-        e_mod_comp_effect_signal_add
-          (cw, NULL, "e,state,raise_above,on", "e");
-     }
-}
-
-EINTERN void
-e_mod_comp_effect_win_lower(E_Comp_Win *cw,
-                            E_Comp_Win *cw2)
-{
-   E_CHECK(cw);
-   E_CHECK(cw2);
-
-   cw->defer_raise = EINA_TRUE;
-
-   if (e_mod_comp_policy_app_close_check(cw))
-     e_mod_comp_effect_signal_add
-       (cw, NULL, "e,state,raise_above,off", "e");
-}
-
-EINTERN void
-e_mod_comp_effect_mirror_handler_hide(E_Comp_Win *cw,
-                            E_Comp_Win *cw2)
-{
-   E_Manager_Comp_Source *src = NULL;
-   E_Comp_Object *co;
-   E_Comp *c;
-   Eina_Bool res;
-   Eina_Inlist *l;
-
-   E_CHECK(cw);
-   E_CHECK(cw2);
-
-   c = cw->c;
-   E_CHECK(c);
-   E_CHECK(c->mirror_handler);
-
-   src = e_manager_comp_src_get(c->man, cw2->win);
-   c->mirror_obj = e_manager_comp_src_image_mirror_add(c->man, src);
-
-   res = edje_object_part_swallow(c->mirror_handler, "e.swallow.content", c->mirror_obj);
-   E_CHECK(res);
-
-   evas_object_show(c->mirror_obj);
-   evas_object_show(c->mirror_handler);
-
-   EINA_LIST_FOREACH(cw->objs, l, co)
-     {
-        if (!co) continue;
-        if (!co->shadow) continue ;
-          evas_object_stack_above(c->mirror_handler, co->shadow);
-     }
-
-   e_mod_comp_effect_signal_add
-     (NULL, c->mirror_handler, "e,state,mirror,visible,off", "e");
-
-}
-
-
-EINTERN void
-e_mod_comp_effect_disable_stage(E_Comp *c,
-                                E_Comp_Win *cw)
-{
-   E_Comp_Win *_cw;
-   E_Comp_Object *co;
-   Eina_List *l;
-   E_CHECK(c);
-
-   if (cw)
-     {
-        if (!cw->effect_stage) return;
-        cw->effect_stage = 0;
-     }
-
-   E_CHECK(c->effect_stage);
-   c->effect_stage = EINA_FALSE;
-
-   EINA_INLIST_FOREACH(c->wins, _cw)
-     {
-        if (!_cw) continue;
-        if ((_cw->invalid) || (_cw->input_only) ||
-            (!_cw->visible))
-          {
-             // Do recovery state of window visibility
-             // when was window animation effect occured,
-             // unrelated window was hided.
-             _cw->animate_hide = EINA_FALSE;
-             continue;
-          }
-
-        EINA_LIST_FOREACH(_cw->objs, l, co)
-          {
-             if (!co) continue;
-             if (!_cw->animate_hide &&
-                 evas_object_visible_get(co->shadow))
-               {
-                  continue;
-               }
-             if (!_cw->first_show_worked &&
-                 !evas_object_visible_get(co->shadow))
-               {
-                  continue;
-               }
-             if (!cw->hidden_override && cw->show_done)
-               evas_object_show(co->shadow);
-          }
-        _cw->animate_hide = 0;
-     }
-}
-
-#define _CHECK(c, s, e) {                       \
-   if (!strncmp(s, e, strlen(s)))               \
-     {                                          \
-        ELBF(ELBT_COMP, 0,                      \
-             e_mod_comp_util_client_xid_get(c), \
-             "%15.15s|%s", "SIGNAL", e);        \
-     }                                          \
-}
-
 EINTERN Eina_Bool
-e_mod_comp_effect_signal_add(E_Comp_Win *cw,
+e_mod_comp_effect_signal_add(E_Comp_Win  *cw,
                              Evas_Object *o,
-                             const char *emission,
-                             const char *src)
+                             const char  *emission,
+                             const char  *src)
 
 {
    Eina_List *l;
    E_Comp *c = NULL;
    E_Comp_Object *co;
-   E_Comp_Effect_Job *job;
+   E_Comp_Effect_Job *job = NULL;
    size_t len;
 
    E_CHECK_RETURN((cw || o), 0);
@@ -696,8 +434,6 @@ e_mod_comp_effect_signal_add(E_Comp_Win *cw,
      {
         c = cw->c;
 
-        E_CHECK_GOTO(_effect_animating_check(emission), finish);
-
         EINA_LIST_FOREACH(cw->objs, l, co)
           {
              if (!co) continue;
@@ -707,7 +443,8 @@ e_mod_comp_effect_signal_add(E_Comp_Win *cw,
              if (!job) continue;
 
              job->o = co->shadow;
-             job->win = _comp_win_xid_get(cw);
+             job->win = cw->win;
+             job->cwin = e_mod_comp_util_client_xid_get(cw);
              job->canvas = co->canvas;
 
              len = sizeof(job->emission);
@@ -723,8 +460,7 @@ e_mod_comp_effect_signal_add(E_Comp_Win *cw,
              e_mod_comp_hw_ov_win_msg_show
                (E_COMP_LOG_TYPE_EFFECT,
                "SIG_ADD 0x%x %s",
-               e_mod_comp_util_client_xid_get(cw),
-               emission);
+               job->cwin, emission);
           }
      }
    else
@@ -732,7 +468,10 @@ e_mod_comp_effect_signal_add(E_Comp_Win *cw,
         job = E_NEW(E_Comp_Effect_Job, 1);
         if (job)
           {
+             job->effect_obj = EINA_TRUE;
              job->o = o;
+             job->win = 0;
+             job->cwin = (Ecore_X_Window)evas_object_data_get(o, "comp.effect_obj.cwin");
 
              len = sizeof(job->emission);
              strncpy(job->emission, emission, len);
@@ -746,53 +485,13 @@ e_mod_comp_effect_signal_add(E_Comp_Win *cw,
           }
      }
 
-   e_mod_comp_effect_signal_flush();
-
-finish:
-
-   if (!(logtype & LT_EFFECT)) return EINA_TRUE;
-
-   _CHECK(cw, "e,state,visible,on",             emission);
-   _CHECK(cw, "e,state,visible,on,noeffect",    emission);
-   _CHECK(cw, "e,state,visible,on,custom0",     emission);
-   _CHECK(cw, "e,state,visible,on,custom0,0",   emission);
-   _CHECK(cw, "e,state,visible,on,custom0,90",  emission);
-   _CHECK(cw, "e,state,visible,on,custom0,180", emission);
-   _CHECK(cw, "e,state,visible,on,custom0,270", emission);
-   _CHECK(cw, "e,state,visible,on,custom1",     emission);
-   _CHECK(cw, "e,state,visible,off",            emission);
-   _CHECK(cw, "e,state,visible,off,noeffect",   emission);
-   _CHECK(cw, "e,state,visible,off,custom0",    emission);
-   _CHECK(cw, "e,state,visible,off,custom0,0",  emission);
-   _CHECK(cw, "e,state,visible,off,custom0,90", emission);
-   _CHECK(cw, "e,state,visible,off,custom0,180",emission);
-   _CHECK(cw, "e,state,visible,off,custom0,270",emission);
-   _CHECK(cw, "e,state,visible,off,custom1",    emission);
-   _CHECK(cw, "e,state,raise_above,off",        emission);
-   _CHECK(cw, "e,state,raise_above_post,on",    emission);
-   _CHECK(cw, "e,state,switcher_top,on",        emission);
-   _CHECK(cw, "e,state,switcher,on",            emission);
-   _CHECK(cw, "e,state,shadow,on",              emission);
-   _CHECK(cw, "e,state,shadow,off",             emission);
-   _CHECK(cw, "e,state,focus,on",               emission);
-   _CHECK(cw, "e,state,focus,off",              emission);
-   _CHECK(cw, "e,state,urgent,on",              emission);
-   _CHECK(cw, "e,state,urgent,off",             emission);
-   _CHECK(cw, "e,state,window,rotation,90",     emission);
-   _CHECK(cw, "e,state,window,rotation,180",    emission);
-   _CHECK(cw, "e,state,window,rotation,0",      emission);
-   _CHECK(cw, "e,state,window,rotation,-180",   emission);
-   _CHECK(cw, "e,state,window,rotation,-90",    emission);
-   _CHECK(cw, "e,state,rotation,on",            emission);
-   _CHECK(cw, "img,state,capture,on",           emission);
-   _CHECK(cw, "e,state,window,angle,0",         emission);
-   _CHECK(cw, "e,state,window,angle,90",        emission);
-   _CHECK(cw, "e,state,window,angle,180",       emission);
-   _CHECK(cw, "e,state,window,angle,270",       emission);
-   _CHECK(cw, "e,state,visible,off,angle,0",    emission);
-   _CHECK(cw, "e,state,visible,off,angle,90",   emission);
-   _CHECK(cw, "e,state,visible,off,angle,180",  emission);
-   _CHECK(cw, "e,state,visible,off,angle,270",  emission);
+   if (job)
+     {
+        ELBF(ELBT_COMP, 0, job->cwin,
+             "%15.15s| %s  SIG_ADD:%s", "EFFECT",
+             job->effect_obj ? "OBJ" : "   ",
+             emission);
+     }
 
    return EINA_TRUE;
 }
@@ -873,39 +572,6 @@ _state_send(E_Comp_Win *cw,
    return EINA_TRUE;
 }
 
-#define _STR_CHECK(s1,s2) (!(strncmp(s1, s2, strlen(s2))))
-
-static Eina_Bool
-_effect_animating_check(const char *emission)
-{
-   Eina_Bool ret = EINA_TRUE;
-   E_CHECK_RETURN(emission, 0);
-
-   if (_STR_CHECK(emission, "e,state,shadow,on"))
-     ret = EINA_FALSE;
-   else if (_STR_CHECK(emission, "e,state,shadow,off"))
-     ret = EINA_FALSE;
-   else if (_STR_CHECK(emission, "e,state,focus,on"))
-     ret = EINA_FALSE;
-   else if (_STR_CHECK(emission, "e,state,focus,off"))
-     ret = EINA_FALSE;
-   else if (_STR_CHECK(emission, "e,state,urgent,on"))
-     ret = EINA_FALSE;
-   else if (_STR_CHECK(emission, "e,state,urgent,off"))
-     ret = EINA_FALSE;
-   else
-     ret = EINA_TRUE;
-
-   return ret;
-}
-
-static Ecore_X_Window
-_comp_win_xid_get(E_Comp_Win *cw)
-{
-   E_CHECK_RETURN(cw, 0);
-   return cw->win;
-}
-
 static Eina_Bool
 _effect_signal_del_intern(E_Comp_Win  *cw,
                           Evas_Object *obj,
@@ -921,7 +587,8 @@ _effect_signal_del_intern(E_Comp_Win  *cw,
         if (!job->win) continue;
         if (!job->canvas) continue;
 
-        if (job->win == _comp_win_xid_get(cw))
+        Ecore_X_Window win = cw ? cw->win : 0;
+        if (job->win == win)
           {
              job->canvas->animation.num--;
 
@@ -931,6 +598,10 @@ _effect_signal_del_intern(E_Comp_Win  *cw,
                   job->canvas->animation.num = 0;
                }
 
+             ELBF(ELBT_COMP, 0, job->cwin,
+                  "%15.15s|     SIG_DEL :%s", "EFFECT",
+                  job->emission);
+
              e_mod_comp_hw_ov_win_msg_show
                (E_COMP_LOG_TYPE_EFFECT,
                "SIG_DEL 0x%x %s",
@@ -945,3 +616,407 @@ _effect_signal_del_intern(E_Comp_Win  *cw,
      }
    return EINA_TRUE;
 }
+
+static Eina_Bool
+_effect_obj_win_set(E_Comp_Effect_Object *o,
+                    E_Comp_Win           *cw)
+{
+   E_Comp_Object *co = NULL;
+   E_Comp_Layer *ly = NULL;
+   const char *file = NULL, *group = NULL;
+   int ok = 0, pw = 0, ph = 0;
+
+   ly = evas_object_data_get(o->edje, "comp.effect_obj.ly");
+   E_CHECK_RETURN(ly, EINA_FALSE);
+   E_CHECK_RETURN(ly->canvas, EINA_FALSE);
+
+   co = eina_list_nth(cw->objs, 0);
+   E_CHECK_RETURN(co, EINA_FALSE);
+
+   edje_object_file_get(co->shadow, &file, &group);
+   E_CHECK_RETURN(file, EINA_FALSE);
+   E_CHECK_RETURN(group, EINA_FALSE);
+
+   ok = edje_object_file_set(o->edje, file, group);
+   E_CHECK_RETURN(ok, EINA_FALSE);
+
+   o->img = evas_object_image_filled_add(ly->canvas->evas);
+   E_CHECK_RETURN(o->img, EINA_FALSE);
+
+   evas_object_image_colorspace_set(o->img, EVAS_COLORSPACE_ARGB8888);
+   evas_object_image_smooth_scale_set(o->img, _comp_mod->conf->smooth_windows);
+   if (cw->argb) evas_object_image_alpha_set(o->img, 1);
+   else evas_object_image_alpha_set(o->img, 0);
+
+   /* set nocomp mode before getting named pixmap */
+   E_Comp_Win *nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, ly->canvas->zone);
+   if (nocomp_cw == cw)
+     e_mod_comp_canvas_nocomp_end(ly->canvas);
+
+   o->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win);
+   E_CHECK_GOTO(o->pixmap, fail);
+
+   ecore_x_pixmap_geometry_get(o->pixmap, NULL, NULL, &pw, &ph);
+   E_CHECK_GOTO((pw > 0), fail);
+   E_CHECK_GOTO((ph > 0), fail);
+
+   Evas_Native_Surface ns;
+   ns.version = EVAS_NATIVE_SURFACE_VERSION;
+   ns.type = EVAS_NATIVE_SURFACE_X11;
+   ns.data.x11.visual = cw->vis;
+   ns.data.x11.pixmap = o->pixmap;
+
+   evas_object_image_size_set(o->img, pw, ph);
+   evas_object_image_native_surface_set(o->img, &ns);
+   evas_object_image_data_update_add(o->img, 0, 0, pw, ph);
+
+   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+        "%15.15s| OBJ_NEW pix:0x%x %dx%d", "EFFECT",
+        o->pixmap, pw, ph);
+
+   edje_object_part_swallow(o->edje, "e.swallow.content", o->img);
+
+   e_layout_child_move(o->edje, cw->x, cw->y);
+   e_layout_child_resize(o->edje, pw, ph);
+
+   edje_object_signal_callback_add(o->edje, "e,action,show,done", "e", _effect_obj_effect_done, o);
+   edje_object_signal_callback_add(o->edje, "e,action,hide,done", "e", _effect_obj_effect_done, o);
+
+   o->win = cw->win;
+   o->cwin = e_mod_comp_util_client_xid_get(cw);
+
+   return EINA_TRUE;
+
+fail:
+   if (o->img)
+     {
+        evas_object_del(o->img);
+        o->img = NULL;
+     }
+   if (o->pixmap)
+     {
+        ecore_x_pixmap_free(o->pixmap);
+        o->pixmap = 0;
+     }
+   return EINA_FALSE;
+}
+
+static void
+_effect_obj_effect_done(void                 *data,
+                        Evas_Object          *obj,
+                        const char  *emission __UNUSED__,
+                        const char  *source   __UNUSED__)
+{
+   E_Comp_Effect_Object *o = data;
+   E_Comp_Layer *ly;
+   E_CHECK(o);
+   E_CHECK(obj);
+
+   ly = evas_object_data_get(obj, "comp.effect_obj.ly");
+   E_CHECK(ly);
+
+   /* decrease effect count and hide effect layer if it is 0 */
+   e_mod_comp_layer_effect_set(ly, EINA_FALSE);
+}
+
+static void
+_effect_win_set(E_Comp_Win *cw,
+                const char *emission)
+{
+   E_Comp_Canvas *canvas;
+   E_Comp_Layer *ly;
+   E_Comp_Effect_Object *o;
+
+   canvas = eina_list_nth(cw->c->canvases, 0);
+   ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   if (ly)
+     {
+        o = e_mod_comp_effect_object_new(ly, cw);
+        if (o)
+          {
+             evas_object_show(o->img);
+             evas_object_show(o->edje);
+             e_mod_comp_effect_signal_add(NULL, o->edje, emission, "e");
+          }
+     }
+}
+
+static void
+_effect_below_wins_set(E_Comp_Win *cw)
+{
+   E_Comp_Canvas *canvas;
+   E_Comp_Layer *ly;
+   E_Comp_Effect_Object *o;
+   Eina_Inlist *l;
+   E_Comp_Win *_cw = cw, *nocomp_cw = NULL;
+   E_Zone *zone;
+   char emission[64];
+   _MAKE_EMISSION("e,state,visible,on,noeffect");
+
+   canvas = eina_list_nth(cw->c->canvases, 0);
+   ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   E_CHECK(ly);
+
+   zone = canvas->zone;
+   E_CHECK(zone);
+
+   nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, zone);
+
+   /* create effect objects until finding a non-alpha full-screen window */
+   while ((l = EINA_INLIST_GET(_cw)->prev))
+     {
+        _cw = _EINA_INLIST_CONTAINER(_cw, l);
+        if (!(_cw->visible)) continue;
+        if (_cw->invalid) continue;
+        if (_cw->input_only) continue;
+        if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h,
+                          _cw->x, _cw->y, _cw->w, _cw->h))
+          continue;
+
+        /* if nocomp exist, change mode to the composite mode */
+        if ((nocomp_cw) && (nocomp_cw == _cw))
+          {
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(_cw),
+                  "%15.15s| END EFFECT_OBJ_NEW", "NOCOMP");
+             e_mod_comp_canvas_nocomp_end(canvas);
+          }
+        else if (!((_cw->pixmap) &&
+                   (_cw->pw > 0) && (_cw->ph > 0) &&
+                   (_cw->dmg_updates >= 1)))
+          {
+             continue;
+          }
+
+        o = e_mod_comp_effect_object_new(ly, _cw);
+        if (o)
+          {
+             evas_object_show(o->img);
+             evas_object_show(o->edje);
+             e_mod_comp_effect_signal_add(NULL, o->edje, emission, "e");
+
+             /* change the stack position of the object to the bottom
+              * of layer and also background object too
+              */
+             e_layout_child_lower(o->edje);
+             e_mod_comp_layer_bg_adjust(ly);
+          }
+
+        /* found a non-alpha full-screen window */
+        if ((REGION_EQUAL_TO_ZONE(_cw, zone)) && !(_cw->argb))
+          break;
+     }
+}
+
+static void
+_effect_above_wins_set(E_Comp_Win *cw,
+                       Eina_Bool   show)
+{
+   E_Comp_Canvas *canvas;
+   E_Comp_Layer *ly;
+   E_Comp_Effect_Object *o;
+   Eina_Inlist *l;
+   E_Comp_Win *_cw = cw;
+   E_Zone *zone;
+   char emission[64];
+
+   canvas = eina_list_nth(cw->c->canvases, 0);
+   ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   E_CHECK(ly);
+
+   zone = canvas->zone;
+   E_CHECK(zone);
+
+   while ((l = EINA_INLIST_GET(_cw)->next))
+     {
+        _cw = _EINA_INLIST_CONTAINER(_cw, l);
+        if (!(_cw->visible)) continue;
+        if (_cw->invalid) continue;
+        if (_cw->input_only) continue;
+        if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h,
+                          _cw->x, _cw->y, _cw->w, _cw->h))
+          continue;
+        if (!((_cw->pixmap) &&
+              (_cw->pw > 0) && (_cw->ph > 0) &&
+              (_cw->dmg_updates >= 1)))
+          continue;
+
+        _MAKE_EMISSION("e,state,visible,on,noeffect");
+
+        if ((TYPE_KEYBOARD_CHECK(_cw)) && (!show))
+          {
+             if (cw->c->keyboard_effect)
+               {
+                  if (e_mod_comp_effect_win_angle_get(_cw))
+                    _MAKE_EMISSION("e,state,visible,off,angle,%d", _cw->angle);
+                  else
+                    _MAKE_EMISSION("e,state,visible,off,angle,0");
+               }
+             else
+               continue;
+          }
+
+        o = e_mod_comp_effect_object_new(ly, _cw);
+        if (o)
+          {
+             evas_object_show(o->img);
+             evas_object_show(o->edje);
+             e_mod_comp_effect_signal_add(NULL, o->edje, emission, "e");
+          }
+     }
+}
+
+static Eina_Bool
+_effect_obj_find(E_Comp_Win *cw)
+{
+   E_Comp_Canvas *canvas = eina_list_nth(cw->c->canvases, 0);
+   E_CHECK_RETURN(canvas, EINA_FALSE);
+
+   E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   E_CHECK_RETURN(ly, EINA_FALSE);
+
+   Eina_List *l;
+   E_Comp_Effect_Object *o = NULL;
+   EINA_LIST_FOREACH(ly->objs, l, o)
+     {
+        if (!o) continue;
+        if (o->win == cw->win)
+          {
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s| OBJ already exists!", "EFFECT");
+             return EINA_TRUE;
+          }
+     }
+
+   return EINA_FALSE;
+}
+
+static void
+_effect_show(E_Comp_Win *cw)
+{
+   E_Comp_Effect_Style st;
+   char emission[64];
+   E_Comp_Win *cw2 = NULL;
+   Eina_Bool launch, visible;
+
+   Eina_Bool res = _effect_obj_find(cw);
+   E_CHECK(!res);
+
+   /* check effect condition and make emission string */
+   st = e_mod_comp_effect_style_get(cw->eff_type, E_COMP_EFFECT_KIND_SHOW);
+   visible = e_mod_comp_util_win_visible_get(cw);
+
+   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+        "%15.15s|SHOW", "EFFECT");
+
+   if (E_COMP_EFFECT_STYLE_DEFAULT == st)
+     {
+        launch = e_mod_comp_policy_app_launch_check(cw);
+        if ((launch) && (visible))
+          {
+             _effect_below_wins_set(cw);
+
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|>FG", "EFFECT");
+
+             _MAKE_EMISSION("e,state,visible,on");
+             _effect_win_set(cw, emission);
+             _effect_above_wins_set(cw, EINA_TRUE);
+          }
+        else if ((TYPE_KEYBOARD_CHECK(cw)) && (visible))
+          {
+             if (cw->c->keyboard_effect)
+               {
+                  _effect_below_wins_set(cw);
+
+                  if (e_mod_comp_effect_win_angle_get(cw))
+                    _MAKE_EMISSION("e,state,window,angle,%d", cw->angle);
+                  else
+                    _MAKE_EMISSION("e,state,window,angle,0");
+
+                  _effect_win_set(cw, emission);
+                  _effect_above_wins_set(cw, EINA_TRUE);
+               }
+          }
+        /* don't need to check visibility for home window by home key */
+        else if (TYPE_HOME_CHECK(cw))
+          {
+             /* app window hide effect by pressing the home key */
+             cw2 = e_mod_comp_util_win_normal_get(NULL);
+             if (cw2)
+               {
+                  ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                       "%15.15s|>BG HOME 0x%08x FG 0x%08x", "EFFECT",
+                       e_mod_comp_util_client_xid_get(cw),
+                       e_mod_comp_util_client_xid_get(cw2));
+
+                  /* background is home */
+                  _MAKE_EMISSION("e,state,visible,on,noeffect");
+                  _effect_win_set(cw, emission);
+
+                  /* app window will hide */
+                  _MAKE_EMISSION("e,state,visible,off");
+                  _effect_win_set(cw2, emission);
+                  _effect_above_wins_set(cw2, EINA_FALSE);
+               }
+          }
+     }
+}
+
+static void
+_effect_hide(E_Comp_Win *cw)
+{
+   E_Comp_Effect_Style st;
+   char emission[64];
+   E_Comp_Win *cw2 = NULL;
+   Eina_Bool close;
+
+   Eina_Bool res = _effect_obj_find(cw);
+   E_CHECK(!res);
+
+   /* check effect condition and make emission string */
+   st = e_mod_comp_effect_style_get(cw->eff_type, E_COMP_EFFECT_KIND_HIDE);
+
+   ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+        "%15.15s|HIDE", "EFFECT");
+
+   if (E_COMP_EFFECT_STYLE_DEFAULT == st)
+     {
+        close = e_mod_comp_policy_app_close_check(cw);
+        if (close)
+          {
+             /* background window */
+             cw2 = e_mod_comp_util_win_normal_get(cw);
+             if (cw2)
+               {
+                  ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                       "%15.15s|>BG 0x%08x", "EFFECT",
+                       e_mod_comp_util_client_xid_get(cw2));
+
+                  _MAKE_EMISSION("e,state,visible,on,noeffect");
+                  _effect_win_set(cw2, emission);
+               }
+
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|>FG", "EFFECT");
+
+             _MAKE_EMISSION("e,state,visible,off");
+             _effect_win_set(cw, emission);
+             _effect_above_wins_set(cw, EINA_FALSE);
+          }
+        else if (TYPE_KEYBOARD_CHECK(cw))
+          {
+             if (cw->c->keyboard_effect)
+               {
+                  _effect_below_wins_set(cw);
+
+                  if (e_mod_comp_effect_win_angle_get(cw))
+                    _MAKE_EMISSION("e,state,visible,off,angle,%d", cw->angle);
+                  else
+                    _MAKE_EMISSION("e,state,visible,off,angle,0");
+
+                  _effect_win_set(cw, emission);
+                  _effect_above_wins_set(cw, EINA_FALSE);
+               }
+          }
+     }
+}
index 9797180..f1024be 100644 (file)
@@ -3,10 +3,10 @@
 #ifndef E_MOD_COMP_EFFECT_H
 #define E_MOD_COMP_EFFECT_H
 
-typedef enum   _E_Comp_Effect_Style E_Comp_Effect_Style;
-typedef enum   _E_Comp_Effect_Kind  E_Comp_Effect_Kind;
-typedef struct _E_Comp_Effect_Type  E_Comp_Effect_Type;
-typedef struct _E_Comp_Effect_Job   E_Comp_Effect_Job;
+typedef enum   _E_Comp_Effect_Style  E_Comp_Effect_Style;
+typedef enum   _E_Comp_Effect_Kind   E_Comp_Effect_Kind;
+typedef struct _E_Comp_Effect_Type   E_Comp_Effect_Type;
+typedef struct _E_Comp_Effect_Job    E_Comp_Effect_Job;
 
 enum _E_Comp_Effect_Style
 {
@@ -34,6 +34,15 @@ enum _E_Comp_Effect_Kind
    E_COMP_EFFECT_KIND_FOCUSOUT
 };
 
+struct _E_Comp_Effect_Object
+{
+   Evas_Object   *edje;
+   Evas_Object   *img;
+   Ecore_X_Window win;
+   Ecore_X_Window cwin;
+   Ecore_X_Pixmap pixmap;
+};
+
 /* window effect type functions */
 EINTERN E_Comp_Effect_Type *e_mod_comp_effect_type_new(void);
 EINTERN void                e_mod_comp_effect_type_free(E_Comp_Effect_Type *type);
@@ -46,15 +55,17 @@ EINTERN E_Comp_Effect_Style e_mod_comp_effect_style_get(E_Comp_Effect_Type *type
 /* window effect functions */
 EINTERN void                e_mod_comp_effect_win_show(E_Comp_Win *cw);
 EINTERN Eina_Bool           e_mod_comp_effect_win_hide(E_Comp_Win *cw);
-EINTERN void                e_mod_comp_effect_win_restack(E_Comp_Win *cw, E_Comp_Win *cw2);
-EINTERN void                e_mod_comp_effect_win_lower(E_Comp_Win *cw, E_Comp_Win *cw2);
-EINTERN void                e_mod_comp_effect_mirror_handler_hide(E_Comp_Win *cw, E_Comp_Win *cw2);
-EINTERN void                e_mod_comp_effect_disable_stage(E_Comp *c, E_Comp_Win *cw);
+EINTERN void                e_mod_comp_effect_win_restack(E_Comp_Win *cw, Eina_Bool v1, Eina_Bool v2);
+
 EINTERN Eina_Bool           e_mod_comp_effect_signal_add(E_Comp_Win *cw, Evas_Object *o, const char *emission, const char *src);
 EINTERN Eina_Bool           e_mod_comp_effect_signal_del(E_Comp_Win *cw, Evas_Object *obj, const char *name);
 EINTERN Eina_Bool           e_mod_comp_effect_jobs_clean(E_Comp_Win *cw, Evas_Object *obj, const char *name);
 EINTERN Eina_Bool           e_mod_comp_effect_signal_flush(void);
 EINTERN Eina_Bool           e_mod_comp_effect_animating_set(E_Comp *c, E_Comp_Win *cw, Eina_Bool set);
 
+/* effect object functions */
+EINTERN E_Comp_Effect_Object *e_mod_comp_effect_object_new(E_Comp_Layer *ly, E_Comp_Win *cw);
+EINTERN void                  e_mod_comp_effect_object_free(E_Comp_Effect_Object *o);
+
 #endif
 #endif
index 28a40b1..ef32686 100644 (file)
 #include "e_mod_comp_atoms.h"
 #include "e_mod_comp_debug.h"
 #include "e_mod_comp_effect_win_rotation.h"
+#include <Elementary.h>
 
-#define _WND_REQUEST_ANGLE_IDX 0
-#define _WND_CURR_ANGLE_IDX    1
+typedef struct _E_Comp_Zone_Rotation_Effect_Begin E_Comp_Zone_Rotation_Effect_Begin;
+typedef struct _E_Comp_Zone_Rotation_Effect_End   E_Comp_Zone_Rotation_Effect_End;
 
-struct _E_Comp_Effect_Win_Rotation
+struct _E_Comp_Effect_Zone_Rotation
 {
-   Eina_Bool    ready : 1;
-   Eina_Bool    run   : 1;
-   struct {
-      int       req;
-      int       cur;
-   } ang;
+   E_Comp_Canvas      *canvas;
+   Eina_Bool           ready;
+   Eina_Bool           run;
+   Elm_Transit        *trans_begin;
+   Elm_Transit        *trans_end;
+   Elm_Transit_Effect *effect_begin;
+   Elm_Transit_Effect *effect_end;
 };
 
-/* local subsystem functions */
-static Eina_Bool _win_rotation_begin(E_Comp_Win *cw, Eina_Bool timeout);
-static void      _win_rotation_done(void *data, Evas_Object *obj, const char *emission, const char *source);
-static Eina_Bool _angle_get(E_Comp_Win *cw, int *req, int *curr);
-
-/* externally accessible functions */
-EINTERN E_Comp_Effect_Win_Rotation *
-e_mod_comp_effect_win_rotation_new(void)
+struct _E_Comp_Zone_Rotation_Effect_Begin
 {
-   E_Comp_Effect_Win_Rotation *r;
-   r = E_NEW(E_Comp_Effect_Win_Rotation, 1);
-   r->ang.req = -1;
-   r->ang.cur = -1;
-   return r;
-}
+   Evas_Object   *o;
+   E_Zone        *zone;
+   double         src;
+   double         target;
+   Ecore_X_Image *xim;
+   Evas_Object   *img;
+   E_Comp_Layer  *ly;
+};
 
-EINTERN void
-e_mod_comp_effect_win_rotation_free(E_Comp_Effect_Win_Rotation *r)
+struct _E_Comp_Zone_Rotation_Effect_End
 {
-   E_CHECK(r);
-   E_FREE(r);
-}
+   Evas_Object *o;
+   E_Zone      *zone;
+   double       src;
+   double       target;
+};
 
-EINTERN Eina_Bool
-e_mod_comp_effect_win_roation_run_check(E_Comp_Effect_Win_Rotation *r)
-{
-   E_CHECK_RETURN(r, 0);
-   return r->run;
-}
+/* local subsystem functions */
+static Eina_Bool            _angle_get(E_Comp_Win *cw, int *req, int *curr);
+static Elm_Transit_Effect *_effect_zone_rot_begin_new(E_Comp_Layer *ly);
+static Elm_Transit_Effect *_effect_zone_rot_end_new(Evas_Object *o, E_Zone *zone);
+static void                _effect_zone_rot_begin_free(Elm_Transit_Effect *effect, Elm_Transit *transit);
+static void                _effect_zone_rot_end_free(Elm_Transit_Effect *effect, Elm_Transit *transit);
+static void                _effect_zone_rot_begin_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress);
+static void                _effect_zone_rot_end_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress);
 
+/* externally accessible functions */
 EINTERN Eina_Bool
-e_mod_comp_effect_win_rotation_handler_prop(Ecore_X_Event_Window_Property *ev)
+e_mod_comp_effect_win_angle_get(E_Comp_Win *cw)
 {
-   E_Comp_Win *cw = NULL;
    E_Comp_Effect_Style st;
    int req_angle = -1;
    int cur_angle = -1;
-   Eina_Bool res, effect;
+   Eina_Bool res;
    Ecore_X_Window win;
-   E_Comp_Effect_Win_Rotation *r;
-   E_Comp_Canvas *canvas = NULL;
-   Eina_List *l;
-
-   E_CHECK_RETURN(ev, 0);
-   E_CHECK_RETURN(ev->win, 0);
-
-   L(LT_EVENT_X,
-     "COMP|%31s\n", "PROP_ILLUME_ROT_WND_ANG");
-
-   cw = e_mod_comp_border_client_find(ev->win);
-   if (!cw)
-     {
-        cw = e_mod_comp_win_find(ev->win);
-        if (!cw) return EINA_FALSE;
-     }
+   E_CHECK_RETURN(cw, 0);
 
    win = e_mod_comp_util_client_xid_get(cw);
    st = e_mod_comp_effect_style_get
-          (cw->eff_type,
-          E_COMP_EFFECT_KIND_ROTATION);
+      (cw->eff_type,
+       E_COMP_EFFECT_KIND_ROTATION);
 
    if (st == E_COMP_EFFECT_STYLE_NONE)
-     {
-        return EINA_FALSE;
-     }
+     return EINA_FALSE;
 
    res = _angle_get(cw, &req_angle, &cur_angle);
-   if (!res) return EINA_FALSE;
+   if (!res)
+     return EINA_FALSE;
 
-   cw->angle = req_angle;
+   cw->angle = cur_angle;
    cw->angle %= 360;
 
-   if (req_angle == cur_angle) return EINA_FALSE;
+   return EINA_TRUE;
+}
 
-   effect = e_mod_comp_policy_win_rotation_effect_check(cw);
-   if (!effect) return EINA_FALSE;
+EINTERN E_Comp_Effect_Zone_Rotation *
+e_mod_comp_effect_zone_rotation_new(E_Comp_Canvas *canvas)
+{
+   E_Comp_Effect_Zone_Rotation *zr = NULL;
+   zr = E_NEW(E_Comp_Effect_Zone_Rotation, 1);
+   E_CHECK_RETURN(zr, NULL);
 
-   if (!cw->eff_winrot)
-     {
-        cw->eff_winrot = e_mod_comp_effect_win_rotation_new();
-        if (!cw->eff_winrot) return EINA_FALSE;
-        Eina_List *l;
-        E_Comp_Object *co;
-        EINA_LIST_FOREACH(cw->objs, l, co)
-          {
-             if (!co) continue;
-             edje_object_signal_callback_add
-               (co->shadow, "e,action,window,rotation,done",
-               "e", _win_rotation_done, cw);
-          }
-     }
+   zr->canvas = canvas;
+
+   return zr;
+}
 
-   r = cw->eff_winrot;
-   r->ready = EINA_TRUE;
-   r->ang.req = req_angle;
-   r->ang.cur = cur_angle;
+EINTERN void
+e_mod_comp_effect_zone_rotation_free(E_Comp_Effect_Zone_Rotation *zr)
+{
+   E_FREE(zr);
+}
 
-   if (_comp_mod->conf->nocomp_fs)
+EINTERN Eina_Bool
+e_mod_comp_effect_zone_rotation_begin(E_Comp_Effect_Zone_Rotation *zr)
+{
+   E_Comp_Layer *ly;
+   E_Comp *c = e_mod_comp_util_get();
+
+   E_CHECK_RETURN(c->animatable, EINA_FALSE);
+
+   /* HACK: disabled xv app rotation and lock screen rotation
+    * look for full-screen window and then check class and name.
+    * if it is an app window which is using xv, rotation effect will be
+    * canceled.
+    */
+   E_Border *bd = e_border_focused_get();
+   E_Border *_bd = NULL;
+   E_Comp_Win *cw = NULL, *cw2 = NULL;
+   if (bd)
      {
-        EINA_LIST_FOREACH(cw->c->canvases, l, canvas)
+        cw = e_mod_comp_win_find(bd->win);
+        if ((cw) && (!cw->invalid) && (!cw->input_only) && (cw->visible))
           {
-             if (canvas->nocomp.mode != E_NOCOMP_MODE_RUN) continue;
-             if ((cw->nocomp) && (cw == canvas->nocomp.cw))
+             /* floating mode window can have focus */
+             if (!REGION_EQUAL_TO_ZONE(cw, bd->zone))
                {
-                  L(LT_EVENT_X,
-                    "COMP|%31s|new_w:0x%08x|nocomp.cw:0x%08x canvas:%d\n",
-                    "ROTATION_HANDLER NOCOMP_END",
-                    cw ? e_mod_comp_util_client_xid_get(cw) : 0,
-                    e_mod_comp_util_client_xid_get(canvas->nocomp.cw),
-                    canvas->num);
-                  e_mod_comp_canvas_nocomp_end(canvas);
+                  cw2 = e_mod_comp_util_win_normal_get(cw);
+                  if ((cw2) && (cw2->bd)) _bd = cw2->bd;
+               }
+             else
+               _bd = bd;
+
+             if (_bd)
+               {
+                  if ((_bd->client.icccm.name) && (_bd->client.icccm.class))
+                    {
+                       if ((!strcmp(_bd->client.icccm.name, "camera")) &&
+                           (!strcmp(_bd->client.icccm.class, "camera")))
+                         {
+                            ELB(ELBT_COMP, "SKIP CAMERA", _bd->client.win);
+                            return EINA_FALSE;
+                         }
+                       else if (!strcmp(_bd->client.icccm.name, "video_play"))
+                         {
+                            ELB(ELBT_COMP, "SKIP VIDEO PLAYER", _bd->client.win);
+                            return EINA_FALSE;
+                         }
+                       if ((!strcmp(_bd->client.icccm.name, "LOCK_SCREEN")) &&
+                           (!strcmp(_bd->client.icccm.class, "LOCK_SCREEN")))
+                         {
+                            ELB(ELBT_COMP, "SKIP LOCK_SCREEN", _bd->client.win);
+                            return EINA_FALSE;
+                         }
+                    }
                }
           }
      }
 
-   L(LT_EVENT_X, "COMP|%31s|%d\n",
-     "ready", r->ready);
+   ly = e_mod_comp_canvas_layer_get(zr->canvas, "effect");
+   if (ly)
+     {
+        /* TODO: check animation is running */
+        if (zr->trans_begin) elm_transit_del(zr->trans_begin);
+        if (zr->trans_end) elm_transit_del(zr->trans_end);
+        zr->trans_begin = NULL;
+        zr->trans_end = NULL;
 
-   return EINA_TRUE;
-}
+        zr->trans_begin = elm_transit_add();
 
-EINTERN Eina_Bool
-e_mod_comp_effect_win_rotation_handler_update(E_Comp_Win *cw)
-{
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->eff_winrot, 0);
-   E_CHECK_RETURN(cw->eff_winrot->ready, 0);
+        zr->effect_begin = _effect_zone_rot_begin_new(ly);
+        if (!zr->effect_begin)
+          {
+             if (zr->trans_begin) elm_transit_del(zr->trans_begin);
+             zr->trans_begin = NULL;
+             zr->ready = EINA_FALSE;
+             return EINA_FALSE;
+          }
+        elm_transit_object_add(zr->trans_begin, ly->layout);
+        elm_transit_smooth_set(zr->trans_begin, EINA_FALSE);
+        elm_transit_duration_set(zr->trans_begin, 0.4f);
+        elm_transit_effect_add(zr->trans_begin, _effect_zone_rot_begin_op, zr->effect_begin, _effect_zone_rot_begin_free);
+        elm_transit_tween_mode_set(zr->trans_begin, ELM_TRANSIT_TWEEN_MODE_DECELERATE);
+        elm_transit_objects_final_state_keep_set(zr->trans_begin, EINA_FALSE);
 
-   return _win_rotation_begin(cw, EINA_FALSE);
-}
+        e_mod_comp_layer_effect_set(ly, EINA_TRUE);
+
+        zr->ready = EINA_TRUE;
+     }
 
-EINTERN Eina_Bool
-e_mod_comp_effect_win_rotation_handler_release(E_Comp_Win *cw)
-{
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->eff_winrot, 0);
-   if (e_mod_comp_effect_win_roation_run_check(cw->eff_winrot))
-     _win_rotation_done(cw, NULL, NULL, NULL);
-   e_mod_comp_effect_win_rotation_free(cw->eff_winrot);
-   cw->eff_winrot = NULL;
    return EINA_TRUE;
 }
 
-/* local subsystem functions */
-static Eina_Bool
-_win_rotation_begin(E_Comp_Win *cw,
-                    Eina_Bool timeout)
+EINTERN Eina_Bool
+e_mod_comp_effect_zone_rotation_end(E_Comp_Effect_Zone_Rotation *zr)
 {
-   E_Comp_Effect_Win_Rotation *r;
-   Eina_List *l, *ll;
-   E_Comp_Canvas *canvas;
-   E_Comp_Object *co;
-   E_CHECK_RETURN(cw, 0);
-   E_CHECK_RETURN(cw->eff_winrot, 0);
+   E_Comp_Layer *ly;
+   E_Comp *c = e_mod_comp_util_get();
 
-   r = cw->eff_winrot;
-   r->ready = EINA_FALSE;
+   E_CHECK_RETURN(c->animatable, EINA_FALSE);
+   E_CHECK_RETURN(zr->ready, EINA_FALSE);
+   E_CHECK_RETURN(zr->trans_begin, EINA_FALSE);
 
-   L(LT_EVENT_X,
-     "COMP|%31s|timeout:%d\n",
-     "win_rot_begin", timeout);
+   zr->ready = EINA_FALSE;
 
-   switch (r->ang.cur - r->ang.req)
+   ly = e_mod_comp_canvas_layer_get(zr->canvas, "comp");
+   if (ly)
      {
-      case -270: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,90",   "e"); break;
-      case -180: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,180",  "e"); break;
-      case  -90: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,-90",  "e"); break;
-      case    0: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,0",    "e"); break;
-      case   90: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,90",   "e"); break;
-      case  180: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,-180", "e"); break;
-      case  270: e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,-90",  "e"); break;
-      default  : e_mod_comp_effect_signal_add(cw, NULL, "e,state,window,rotation,0",    "e"); break;
+        if (zr->trans_end) elm_transit_del(zr->trans_end);
+        zr->trans_end = NULL;
+
+        zr->trans_end = elm_transit_add();
+        zr->effect_end = _effect_zone_rot_end_new(ly->layout, zr->canvas->zone);
+        elm_transit_object_add(zr->trans_end, ly->layout);
+        elm_transit_smooth_set(zr->trans_end, EINA_FALSE);
+        elm_transit_duration_set(zr->trans_end, 0.4f);
+        elm_transit_effect_add(zr->trans_end, _effect_zone_rot_end_op, zr->effect_end, _effect_zone_rot_end_free);
+        elm_transit_tween_mode_set(zr->trans_end, ELM_TRANSIT_TWEEN_MODE_DECELERATE);
+        elm_transit_objects_final_state_keep_set(zr->trans_end, EINA_FALSE);
+
+        e_zone_rotation_block_set(zr->canvas->zone, "comp-tizen", EINA_TRUE);
+
+        return EINA_TRUE;
      }
 
-   r->run = EINA_TRUE;
+   return EINA_FALSE;
+}
 
-   if (timeout)
+EINTERN Eina_Bool
+e_mod_comp_effect_zone_rotation_cancel(E_Comp_Effect_Zone_Rotation *zr)
+{
+   if (zr->trans_begin)
      {
-        if (!cw->update)
-          {
-             if (cw->update_timeout)
-               {
-                  ecore_timer_del(cw->update_timeout);
-                  cw->update_timeout = NULL;
-               }
-             cw->update = 1;
-             cw->c->updates = eina_list_append(cw->c->updates, cw);
-          }
-        cw->drawme = 1;
-        e_mod_comp_win_render_queue(cw);
+        elm_transit_del(zr->trans_begin);
+        zr->trans_begin = NULL;
      }
-
-   if (!cw->argb)
+   if (zr->trans_end)
      {
-        EINA_LIST_FOREACH(cw->c->canvases, l, canvas)
-          {
-             if (!canvas) continue;
-             EINA_LIST_FOREACH(cw->objs, ll, co)
-               {
-                  if (!co) continue;
-                  if (co->canvas == canvas)
-                    {
-                       evas_object_stack_below(canvas->bg_img,
-                                               co->shadow);
-                       canvas->use_bg_img = 1;
-                    }
-               }
-          }
+        elm_transit_del(zr->trans_end);
+        zr->trans_end = NULL;
      }
+   zr->ready = EINA_FALSE;
 
    return EINA_TRUE;
 }
 
-static void
-_win_rotation_done(void        *data,
-                   Evas_Object *obj      __UNUSED__,
-                   const char  *emission __UNUSED__,
-                   const char  *source   __UNUSED__)
+EINTERN Eina_Bool
+e_mod_comp_effect_zone_rotation_do(E_Comp_Effect_Zone_Rotation *zr)
 {
-   E_Comp_Effect_Win_Rotation *r;
-   E_Comp_Win *cw = (E_Comp_Win*)data;
-   Eina_List *l, *ll;
-   E_Comp_Canvas *canvas;
-   E_Comp_Object *co;
-   E_CHECK(cw);
-   E_CHECK(cw->eff_winrot);
-
-   r = cw->eff_winrot;
-
-   if (!cw->show_done) cw->show_done = EINA_TRUE;
-
-   EINA_LIST_FOREACH(cw->c->canvases, l, canvas)
-     {
-        if (!canvas) continue;
-        EINA_LIST_FOREACH(cw->objs, ll, co)
-          {
-             if (!co) continue;
-             if (co->canvas == canvas)
-               {
-                  evas_object_stack_below(canvas->bg_img,
-                                          evas_object_bottom_get(canvas->evas));
-                  canvas->use_bg_img = 0;
-               }
-          }
-     }
-
-   r->run = EINA_FALSE;
+   E_Comp *c = e_mod_comp_util_get();
+   E_CHECK_RETURN(c->animatable, EINA_FALSE);
 
-   e_mod_comp_effect_signal_del(cw, obj, "rotation,done");
+   elm_transit_go(zr->trans_begin);
+   elm_transit_go(zr->trans_end);
 
-   e_mod_comp_done_defer(cw);
+   return EINA_TRUE;
 }
 
+/* local subsystem functions */
 static Eina_Bool
-_angle_get(E_Comp_Win     *cw,
-           int            *req,
-           int            *curr)
+_angle_get(E_Comp_Win *cw,
+           int        *req,
+           int        *curr)
 {
-   E_CHECK_RETURN(cw, 0);
    E_CHECK_RETURN(cw->bd, 0);
    E_CHECK_RETURN(req, 0);
    E_CHECK_RETURN(curr, 0);
@@ -283,47 +262,169 @@ _angle_get(E_Comp_Win     *cw,
    *req  = cw->bd->client.e.state.rot.prev;
    *curr = cw->bd->client.e.state.rot.curr;
 
-   L(LT_EVENT_X,
-     "COMP|%31s|w:0x%08x|%d=>%d\n",
-     "rot_prop_get",
-     e_mod_comp_util_client_xid_get(cw),
-     *req,
-     *curr);
-
    return EINA_TRUE;
 }
 
-EINTERN Eina_Bool
-e_mod_comp_effect_win_angle_get(E_Comp_Win *cw)
+static Elm_Transit_Effect *
+_effect_zone_rot_begin_new(E_Comp_Layer *ly)
 {
-   E_Comp_Effect_Style st;
-   int req_angle = -1;
-   int cur_angle = -1;
-   Eina_Bool res;
-   Ecore_X_Window win;
-   E_CHECK_RETURN(cw, 0);
+   E_Comp_Zone_Rotation_Effect_Begin *ctx= E_NEW(E_Comp_Zone_Rotation_Effect_Begin, 1);
+   E_CHECK_RETURN(ctx, NULL);
 
-   win = e_mod_comp_util_client_xid_get(cw);
-   st = e_mod_comp_effect_style_get
-      (cw->eff_type,
-       E_COMP_EFFECT_KIND_ROTATION);
+   E_Zone *zone = ly->canvas->zone;
 
-   if (st == E_COMP_EFFECT_STYLE_NONE)
-     return EINA_FALSE;
+   /* capture the screen */
+   Ecore_X_Window_Attributes att;
+   Ecore_X_Window root = ecore_x_window_root_first_get();
+   memset((&att), 0, sizeof(Ecore_X_Window_Attributes));
+   if (!ecore_x_window_attributes_get(root, &att))
+     {
+        E_FREE(ctx);
+        return NULL;
+     }
 
-   res = _angle_get(cw, &req_angle, &cur_angle);
-   if (!res)
-     return EINA_FALSE;
+   ctx->xim = ecore_x_image_new(zone->w, zone->h, att.visual, att.depth);
+   if (!ctx->xim)
+     {
+        E_FREE(ctx);
+        return NULL;
+     }
 
-   cw->angle = cur_angle;
-   cw->angle %= 360;
+   unsigned int *pix = ecore_x_image_data_get(ctx->xim, NULL, NULL, NULL);;
+   ELBF(ELBT_COMP, 0, 0, "%15.15s|root:0x%08x vis:%p depth:%d xim:%p pix:%p", "ZONE_ROT_B_NEW",
+        root, att.visual, att.depth, ctx->xim, pix);
 
-   return EINA_TRUE;
+   ctx->img = evas_object_image_filled_add(evas_object_evas_get(ly->layout));
+   evas_object_image_colorspace_set(ctx->img, EVAS_COLORSPACE_ARGB8888);
+   evas_object_image_alpha_set(ctx->img, 0);
+   evas_object_image_size_set(ctx->img, zone->w, zone->h);
+   evas_object_image_smooth_scale_set(ctx->img, EINA_FALSE);
+   evas_object_image_data_set(ctx->img, pix);
+   evas_object_image_data_update_add(ctx->img, 0, 0, zone->w, zone->h);
+
+   // why do we neeed these 2? this smells wrong
+   if (ecore_x_image_get(ctx->xim, root, 0, 0, 0, 0, zone->w, zone->h))
+     {
+        pix = ecore_x_image_data_get(ctx->xim, NULL, NULL, NULL);;
+        evas_object_image_data_set(ctx->img, pix);
+        evas_object_image_data_update_add(ctx->img, 0, 0, zone->w, zone->h);
+     }
+   evas_object_show(ctx->img);
+
+   e_mod_comp_layer_populate(ly, ctx->img);
+   e_layout_child_move(ctx->img, 0, 0);
+   e_layout_child_resize(ctx->img, zone->w, zone->h);
+
+   ctx->o = ly->layout;
+   ctx->zone = ly->canvas->zone;
+   ctx->ly = ly;
+
+   int diff = zone->rot.prev - zone->rot.curr;
+   if (diff == 270) diff = -90;
+   else if (diff == -270) diff = 90;
+   ctx->src = 0.0;
+   ctx->target = diff;
+   ELBF(ELBT_COMP, 0, 0, "%15.15s|%d->%d pix:%p", "ZONE_ROT_B_NEW", zone->rot.prev, zone->rot.curr, pix);
+   return ctx;
 }
 
-EINTERN void
-e_mod_comp_explicit_win_rotation_done(E_Comp_Win *cw)
+static Elm_Transit_Effect *
+_effect_zone_rot_end_new(Evas_Object *o,
+                         E_Zone      *zone)
 {
-   E_CHECK(cw);
-   _win_rotation_done((void*)cw, NULL, NULL, NULL);
+   E_Comp_Zone_Rotation_Effect_End *ctx= E_NEW(E_Comp_Zone_Rotation_Effect_End, 1);
+   E_CHECK_RETURN(ctx, NULL);
+
+   ctx->o = o;
+   ctx->zone = zone;
+   int diff = zone->rot.curr - zone->rot.prev;
+   if (diff == 270) diff = -90;
+   else if (diff == -270) diff = 90;
+   ctx->src = diff;
+   ctx->target = 0.0;
+   ELBF(ELBT_COMP, 0, 0, "%15.15s|%d->%d", "ZONE_ROTATION_EFFECT_END_NEW", zone->rot.prev, zone->rot.curr);
+   return ctx;
+}
+
+static void
+_effect_zone_rot_begin_free(Elm_Transit_Effect *effect,
+                            Elm_Transit        *transit)
+{
+   E_Comp_Zone_Rotation_Effect_Begin *ctx = (E_Comp_Zone_Rotation_Effect_Begin *)effect;
+   if (ctx->xim) ecore_x_image_free(ctx->xim);
+   if (ctx->img)
+     {
+        evas_object_hide(ctx->img);
+        e_layout_unpack(ctx->img);
+        evas_object_del(ctx->img);
+     }
+   //evas_object_color_set(ctx->o, 255, 255, 255, 255);
+
+   e_mod_comp_layer_effect_set(ctx->ly, EINA_FALSE);
+
+   E_FREE(ctx);
+}
+
+static void
+_effect_zone_rot_end_free(Elm_Transit_Effect *effect,
+                          Elm_Transit        *transit)
+{
+   E_Comp_Zone_Rotation_Effect_End *ctx = (E_Comp_Zone_Rotation_Effect_End *)effect;
+   e_zone_rotation_block_set(ctx->zone, "comp-tizen", EINA_FALSE);
+   evas_object_color_set(ctx->o, 255, 255, 255, 255);
+   ELBF(ELBT_COMP, 0, 0, "%15.15s|", "ZONE_ROTATION_EFFECT_END_FREE");
+   E_FREE(ctx);
+}
+
+static void
+_effect_zone_rot_begin_op(Elm_Transit_Effect *effect,
+                          Elm_Transit        *transit,
+                          double              progress)
+{
+   E_Comp_Zone_Rotation_Effect_Begin *ctx = (E_Comp_Zone_Rotation_Effect_Begin *)effect;
+   double curr = (progress * ctx->target);
+   Evas_Coord x, y, w, h;
+
+   double col = 255 - (255 * progress * 1.3);
+   if (col <= 0) col = 0;
+   evas_object_color_set(ctx->o, col, col, col, col);
+
+   int diff = ctx->zone->h - ctx->zone->w;
+   Evas_Coord _x = -1.0 * (diff * progress) / 2;
+   Evas_Coord _y = (diff * progress) / 2;
+   Evas_Coord _w = ctx->zone->w + (diff * progress);
+   Evas_Coord _h = ctx->zone->h - (diff * progress);
+   evas_object_move(ctx->o, _x, _y);
+   evas_object_resize(ctx->o, _w, _h);
+   evas_object_geometry_get(ctx->o, &x, &y, &w, &h);
+
+   Evas_Map *m = evas_map_new(4);
+   evas_map_util_points_populate_from_object(m, ctx->o);
+   evas_map_util_rotate(m, curr, x + (w/2), y + (h/2));
+   evas_object_map_set(ctx->o, m);
+   evas_object_map_enable_set(ctx->o, EINA_TRUE);
+   evas_map_free(m);
+
+}
+
+static void
+_effect_zone_rot_end_op(Elm_Transit_Effect *effect,
+                        Elm_Transit        *transit,
+                        double              progress)
+{
+   E_Comp_Zone_Rotation_Effect_End *ctx = (E_Comp_Zone_Rotation_Effect_End *)effect;
+   double curr = ((-1.0f * progress * ctx->src) + ctx->src);
+   Evas_Coord x, y, w, h;
+
+   double col = 100 + 155 * progress;
+   evas_object_color_set(ctx->o, col, col, col, 255);
+
+   evas_object_geometry_get(ctx->o, &x, &y, &w, &h);
+
+   Evas_Map *m = evas_map_new(4);
+   evas_map_util_points_populate_from_object(m, ctx->o);
+   evas_map_util_rotate(m, curr, x + (w/2), y + (h/2));
+   evas_object_map_set(ctx->o, m);
+   evas_object_map_enable_set(ctx->o, EINA_TRUE);
+   evas_map_free(m);
 }
index c88767b..18e53a6 100644 (file)
@@ -3,17 +3,15 @@
 #ifndef E_MOD_COMP_EFFECT_WIN_ROTATION_H
 #define E_MOD_COMP_EFFECT_WIN_ROTATION_H
 
-typedef struct _E_Comp_Effect_Win_Rotation E_Comp_Effect_Win_Rotation;
-
 /* window rotation effect and handler functions */
-EINTERN E_Comp_Effect_Win_Rotation *e_mod_comp_effect_win_rotation_new(void);
-EINTERN void                        e_mod_comp_effect_win_rotation_free(E_Comp_Effect_Win_Rotation *r);
-EINTERN Eina_Bool                   e_mod_comp_effect_win_roation_run_check(E_Comp_Effect_Win_Rotation *r);
-EINTERN Eina_Bool                   e_mod_comp_effect_win_rotation_handler_prop(Ecore_X_Event_Window_Property *ev);
-EINTERN Eina_Bool                   e_mod_comp_effect_win_rotation_handler_update(E_Comp_Win *cw);
-EINTERN Eina_Bool                   e_mod_comp_effect_win_rotation_handler_release(E_Comp_Win *cw);
-EINTERN Eina_Bool                   e_mod_comp_effect_win_angle_get(E_Comp_Win *cw);
-EINTERN void                        e_mod_comp_explicit_win_rotation_done(E_Comp_Win *cw);
+EINTERN Eina_Bool                    e_mod_comp_effect_win_angle_get(E_Comp_Win *cw);
+
+EINTERN E_Comp_Effect_Zone_Rotation *e_mod_comp_effect_zone_rotation_new(E_Comp_Canvas *canvas);
+EINTERN void                         e_mod_comp_effect_zone_rotation_free(E_Comp_Effect_Zone_Rotation *zr);
+EINTERN Eina_Bool                    e_mod_comp_effect_zone_rotation_begin(E_Comp_Effect_Zone_Rotation *zr);
+EINTERN Eina_Bool                    e_mod_comp_effect_zone_rotation_end(E_Comp_Effect_Zone_Rotation *zr);
+EINTERN Eina_Bool                    e_mod_comp_effect_zone_rotation_cancel(E_Comp_Effect_Zone_Rotation *zr);
+EINTERN Eina_Bool                    e_mod_comp_effect_zone_rotation_do(E_Comp_Effect_Zone_Rotation *zr);
 
 #endif
 #endif
index 47622c6..5b91b85 100644 (file)
@@ -2,7 +2,10 @@
 #include "e_mod_comp_debug.h"
 #include "e_mod_comp.h"
 
-#define _F_BORDER_CLIP_TO_ZONE_ 1
+#ifdef _F_BORDER_CLIP_TO_ZONE_
+#undef _F_BORDER_CLIP_TO_ZONE_
+#endif
+#define _F_BORDER_CLIP_TO_ZONE_ 0
 
 /* externally accessible functions */
 EINTERN E_Comp_Object *
@@ -25,6 +28,24 @@ e_mod_comp_obj_add(E_Comp_Win    *cw,
                   canvas->evas, cw->argb, canvas->num);
           }
 
+        E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "comp");
+        if (ly)
+          {
+             e_mod_comp_layer_populate(ly, co->shadow);
+
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|OK!! layer shadow:%p img:%p evas:%p argb:%d canvas_num:%d ly:%p",
+                  "OBJECT_CREATE", co->shadow, co->img,
+                  canvas->evas, cw->argb, canvas->num, ly);
+          }
+        else
+          {
+             ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                  "%15.15s|ERROR shadow:%p img:%p evas:%p argb:%d canvas_num:%d ly:%p",
+                  "OBJECT_CREATE", co->shadow, co->img,
+                  canvas->evas, cw->argb, canvas->num, ly);
+          }
+
         evas_object_image_colorspace_set(co->img, EVAS_COLORSPACE_ARGB8888);
         if (cw->argb) evas_object_image_alpha_set(co->img, 1);
         else evas_object_image_alpha_set(co->img, 0);
@@ -40,7 +61,12 @@ e_mod_comp_obj_add(E_Comp_Win    *cw,
                   "OBJECT_CREATE", co->shadow, canvas->evas,
                   canvas->num);
           }
-
+        else
+          {
+             E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "comp");
+             if (ly)
+               e_mod_comp_layer_populate(ly, co->shadow);
+          }
         evas_object_color_set(co->shadow, 0, 0, 0, 0);
      }
 
@@ -52,6 +78,9 @@ e_mod_comp_obj_add(E_Comp_Win    *cw,
 EINTERN void
 e_mod_comp_obj_del(E_Comp_Object *co)
 {
+   E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+   if (ly) e_layout_unpack(co->shadow);
+
    if (co->img_mirror)
      {
         Evas_Object *o;
@@ -122,6 +151,21 @@ e_mod_comp_win_comp_objs_move(E_Comp_Win *cw,
 {
    Eina_List *l;
    E_Comp_Object *co;
+   E_Comp_Layer *ly;
+
+   E_Comp_Canvas *canvas, *ly_canvas = NULL;
+   E_Comp_Layer *eff_ly;
+   E_Comp_Effect_Object *eff_obj = NULL;
+   Eina_Bool eff_run = EINA_FALSE;
+   canvas = eina_list_nth(cw->c->canvases, 0);
+   eff_ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   eff_run = e_mod_comp_layer_effect_get(eff_ly);
+   if (eff_run)
+     {
+        eff_obj = e_mod_comp_layer_effect_obj_get(eff_ly, cw->win);
+        if (eff_obj) ly_canvas = eff_ly->canvas;
+     }
+
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         int zx = 0, zy = 0;
@@ -132,9 +176,21 @@ e_mod_comp_win_comp_objs_move(E_Comp_Win *cw,
              zx = co->zone->x;
              zy = co->zone->y;
           }
-        evas_object_move(co->shadow, x - zx, y - zy);
 
-#ifdef _F_BORDER_CLIP_TO_ZONE_
+        ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+        if (ly)
+          e_layout_child_move(co->shadow, x - zx, y - zy);
+        else
+          evas_object_move(co->shadow, x - zx, y - zy);
+
+        /* to show moving window while effect, we should also update effect object */
+        if (eff_obj)
+          {
+             if (ly_canvas == co->canvas)
+               e_layout_child_move(eff_obj->edje, x -zx, y - zy);
+          }
+
+#if _F_BORDER_CLIP_TO_ZONE_
         if ((cw->visible) && (cw->bd) && (co->zone) &&
             (!cw->input_only) && (!cw->invalid) &&
             E_INTERSECTS(co->zone->x, co->zone->y,
@@ -162,8 +218,16 @@ e_mod_comp_win_comp_objs_move(E_Comp_Win *cw,
                        if (cw->bd->zone == co->zone)
                          evas_object_show(co->clipper);
                     }
-                  evas_object_move(co->clipper, _x, _y);
-                  evas_object_resize(co->clipper, _w, _h);
+                  if (ly)
+                    {
+                       e_layout_child_move(co->clipper, _x, _y);
+                       e_layout_child_resize(co->clipper, _w, _h);
+                    }
+                  else
+                    {
+                       evas_object_move(co->clipper, _x, _y);
+                       evas_object_resize(co->clipper, _w, _h);
+                    }
                }
              else
                {
@@ -187,11 +251,17 @@ e_mod_comp_win_comp_objs_resize(E_Comp_Win *cw,
 {
    Eina_List *l;
    E_Comp_Object *co;
+   E_Comp_Layer *ly;
+
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         if (!co) continue;
         if (!co->shadow) continue;
-        evas_object_resize(co->shadow, w, h);
+        ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+        if (ly)
+          e_layout_child_resize(co->shadow, w, h);
+        else
+          evas_object_resize(co->shadow, w, h);
      }
 }
 
@@ -206,7 +276,7 @@ e_mod_comp_win_comp_objs_img_resize(E_Comp_Win *cw,
      {
         if (!co) continue;
         if (!co->img) continue;
-        evas_object_resize(co->img, w, h);
+        evas_object_image_size_set(co->img, w, h);
      }
 }
 
@@ -354,6 +424,20 @@ e_mod_comp_win_comp_objs_img_data_update_add(E_Comp_Win *cw,
    Eina_List *l, *ll;
    E_Comp_Object *co;
    Evas_Object *o;
+
+   E_Comp_Canvas *canvas, *ly_canvas = NULL;
+   E_Comp_Layer *ly;
+   E_Comp_Effect_Object *eff_obj = NULL;
+   Eina_Bool eff_run = EINA_FALSE;
+   canvas = eina_list_nth(cw->c->canvases, 0);
+   ly = e_mod_comp_canvas_layer_get(canvas, "effect");
+   eff_run = e_mod_comp_layer_effect_get(ly);
+   if (eff_run)
+     {
+        eff_obj = e_mod_comp_layer_effect_obj_get(ly, cw->win);
+        if (eff_obj) ly_canvas = ly->canvas;
+     }
+
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         if (!co) continue;
@@ -372,6 +456,13 @@ e_mod_comp_win_comp_objs_img_data_update_add(E_Comp_Win *cw,
                          cw->x, cw->y, cw->w, cw->h))
           {
              evas_object_image_data_update_add(co->img, x, y, w, h);
+
+             /* to show damaged window while effect, we should also update effect object */
+             if (eff_obj)
+               {
+                  if (ly_canvas == co->canvas)
+                    evas_object_image_data_update_add(eff_obj->img, x, y, w, h);
+               }
           }
 
         EINA_LIST_FOREACH(co->img_mirror, ll, o)
@@ -517,10 +608,13 @@ e_mod_comp_win_comp_objs_raise(E_Comp_Win *cw)
 {
    Eina_List *l;
    E_Comp_Object *co;
+   E_Comp_Layer *ly;
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         if (!co) continue;
-        evas_object_raise(co->shadow);
+        e_layout_child_raise(co->shadow);
+        ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+        if (ly) e_mod_comp_layer_bg_adjust(ly);
      }
 }
 
@@ -529,10 +623,13 @@ e_mod_comp_win_comp_objs_lower(E_Comp_Win *cw)
 {
    Eina_List *l;
    E_Comp_Object *co;
+   E_Comp_Layer *ly;
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         if (!co) continue;
-        evas_object_lower(co->shadow);
+        e_layout_child_lower(co->shadow);
+        ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+        if (ly) e_mod_comp_layer_bg_adjust(ly);
      }
 }
 
@@ -542,15 +639,18 @@ e_mod_comp_win_comp_objs_stack_above(E_Comp_Win *cw,
 {
    Eina_List *l, *ll;
    E_Comp_Object *co, *co2;
+   E_Comp_Layer *ly;
    EINA_LIST_FOREACH(cw->objs, l, co)
      {
         EINA_LIST_FOREACH(cw2->objs, ll, co2)
           {
              if (co->zone == co2->zone)
                {
-                  evas_object_stack_above(co->shadow,
-                                          co2->shadow);
+                  e_layout_child_raise_above(co->shadow,
+                                             co2->shadow);
+                  ly = e_mod_comp_canvas_layer_get(co->canvas, "comp");
+                  if (ly) e_mod_comp_layer_bg_adjust(ly);
                }
           }
      }
-}
\ No newline at end of file
+}
index a9d8615..43a8b0d 100644 (file)
@@ -61,7 +61,9 @@ EINTERN Eina_Bool
 e_mod_comp_policy_app_launch_check(E_Comp_Win *cw)
 {
    E_CHECK_RETURN(cw, 0);
-   if (TYPE_NORMAL_CHECK(cw) && SIZE_EQUAL_TO_ROOT(cw))
+   E_CHECK_RETURN(cw->bd, 0);
+   E_CHECK_RETURN(cw->bd->zone, 0);
+   if (TYPE_NORMAL_CHECK(cw) && REGION_EQUAL_TO_ZONE(cw, cw->bd->zone))
      return EINA_TRUE;
    return EINA_FALSE;
 }
@@ -70,7 +72,9 @@ EINTERN Eina_Bool
 e_mod_comp_policy_app_close_check(E_Comp_Win *cw)
 {
    E_CHECK_RETURN(cw, 0);
-   if (TYPE_NORMAL_CHECK(cw) && SIZE_EQUAL_TO_ROOT(cw))
+   E_CHECK_RETURN(cw->bd, 0);
+   E_CHECK_RETURN(cw->bd->zone, 0);
+   if (TYPE_NORMAL_CHECK(cw) && REGION_EQUAL_TO_ZONE(cw, cw->bd->zone))
      return EINA_TRUE;
    return EINA_FALSE;
 }
index 8eb77d5..cd02655 100644 (file)
@@ -3,8 +3,10 @@
 #ifndef E_MOD_COMP_SHARED_TYPES_H
 #define E_MOD_COMP_SHARED_TYPES_H
 
-typedef struct _E_Comp     E_Comp;
-typedef struct _E_Comp_Win E_Comp_Win;
+typedef struct _E_Comp                      E_Comp;
+typedef struct _E_Comp_Win                  E_Comp_Win;
+typedef struct _E_Comp_Effect_Object        E_Comp_Effect_Object;
+typedef struct _E_Comp_Effect_Zone_Rotation E_Comp_Effect_Zone_Rotation;
 
 #include "e.h"
 #include "e_mod_main.h"
@@ -58,10 +60,6 @@ struct _E_Comp
    Eina_Bool                     fake_image_launch : 1; // True : Enable Fake Image Launch feature
    E_Comp_Win                   *lower_win; // For saving window on backkey(lower) event
 
-   // home key effect
-   Evas_Object                  *mirror_obj; // image(mirror) object
-   Evas_Object                  *mirror_handler; // shadow(edj) object
-
    // fake image launch
    E_Comp_Effect_Image_Launch   *eff_img;
    Evas                         *evas;
@@ -139,16 +137,13 @@ struct _E_Comp_Win
 
    Eina_Bool                   animate_hide : 1 ; // if window animation effect is occured, do hide unrelated window. -> use evas_object_hide()
    Eina_Bool                   resize_hide : 1; // if window do resize event received, set this valuse true; and check win_update()
-   Eina_Bool                   first_show_worked : 1 ; // check for first show of shobj
    Eina_Bool                   show_done : 1 ; // check for show is done
    Eina_Bool                   effect_stage: 1; // check for if background window is hided or not.
    Eina_Bool                   defer_raise; // flag to defer to raise
    E_Comp_Effect_Type         *eff_type;
-   E_Comp_Effect_Win_Rotation *eff_winrot; // image launch effect
    E_Comp_Win_Type             win_type;
    E_Comp_Win_Shape_Input     *shape_input;
    E_Comp_BG_Win              *bgwin;
-   Eina_Bool                   move_lock : 1; // lock / unlock evas_object's move. evas_object represents window.
    int                         angle; // window's current angle property
    Eina_Bool                   launched : 1; //flag for checking whether launch or not
 
index 8290aef..3c28ca6 100644 (file)
@@ -88,23 +88,85 @@ e_mod_comp_util_screen_input_region_set(Eina_Bool set)
 }
 
 EINTERN E_Comp_Win *
-e_mod_comp_util_win_normal_get(void)
+e_mod_comp_util_win_nocomp_get(E_Comp *c,
+                               E_Zone *zone)
 {
-   E_Comp *c = e_mod_comp_util_get();
+   Eina_List *l = NULL;
+   E_Comp_Canvas *canvas = NULL;
    E_Comp_Win *cw = NULL;
-   E_CHECK_RETURN(c, 0);
 
-   EINA_INLIST_REVERSE_FOREACH(c->wins, cw)
+   if (_comp_mod->conf->nocomp_fs)
      {
-        if (!cw) continue;
-        if ((cw->visible) &&
-            (REGION_EQUAL_TO_ROOT(cw)) &&
-            (!cw->invalid) && (!cw->input_only) &&
-            TYPE_NORMAL_CHECK(cw))
+        EINA_LIST_FOREACH(c->canvases, l, canvas)
           {
-             return cw;
+             if (!canvas) continue;
+             if (canvas->zone == zone)
+               {
+                  if (canvas->nocomp.mode == E_NOCOMP_MODE_RUN)
+                    {
+                       if (canvas->nocomp.cw)
+                         {
+                            cw = canvas->nocomp.cw;
+
+                            ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+                                 "%15.15s| FOUND NOCOMP WIN", "NOCOMP");
+                         }
+                    }
+                  break;
+               }
           }
      }
+
+   return cw;
+}
+
+EINTERN E_Comp_Win *
+e_mod_comp_util_win_normal_get(E_Comp_Win *cw)
+{
+   E_Comp *c = e_mod_comp_util_get();
+   E_Comp_Win *cw2 = NULL, *nocomp_cw = NULL;
+   E_Zone *zone = NULL;
+   E_CHECK_RETURN(c, 0);
+
+   if ((cw) && (cw->bd))
+     zone = cw->bd->zone;
+
+   if (!zone)
+     zone = e_util_zone_current_get(c->man);
+
+   E_CHECK_RETURN(zone, NULL);
+
+   /* find nocomp window first because nocomp window doesn't have pixmap */
+   nocomp_cw = e_mod_comp_util_win_nocomp_get(c, zone);
+
+   /* look for visible normal window except for given window */
+   EINA_INLIST_REVERSE_FOREACH(c->wins, cw2)
+     {
+        if (!cw2) continue;
+        if ((cw2->invalid) || (cw2->input_only)) continue;
+        if ((cw) && (cw == cw2)) continue; /* except for given window */
+        if (TYPE_MINI_APPTRAY_CHECK(cw2)) continue; /* except for apptray window */
+
+        /* return nocomp window */
+        if ((nocomp_cw) && (nocomp_cw == cw2))
+          return cw2;
+
+        /* check pixmap and compare size with zone */
+        if (!cw2->bd) continue;
+        if (!cw2->bd->zone) continue;
+        if (cw2->bd->zone != zone) continue;
+        if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h,
+                          cw2->x, cw2->y, cw2->w, cw2->h))
+          continue;
+
+        if (!((cw2->pixmap) &&
+              (cw2->pw > 0) && (cw2->ph > 0) &&
+              (cw2->dmg_updates >= 1)))
+          continue;
+
+        if (REGION_EQUAL_TO_ZONE(cw2, zone))
+          return cw2;
+     }
    return NULL;
 }
 
@@ -162,36 +224,65 @@ e_mod_comp_util_win_below_check(E_Comp_Win *cw,
 EINTERN Eina_Bool
 e_mod_comp_util_win_visible_get(E_Comp_Win *cw)
 {
-   Eina_Bool v = EINA_FALSE;
-   E_Comp_Win *_cw = NULL;
+   E_Comp_Win *cw2 = NULL;
+   E_Zone *zone = NULL;
+   int count = 0;
 
    E_CHECK_RETURN(cw, 0);
    E_CHECK_RETURN(cw->visible, 0);
    E_CHECK_RETURN(!(cw->invalid), 0);
    E_CHECK_RETURN(!(cw->input_only), 0);
-   E_CHECK_RETURN(!(cw->defer_hide), 0);
-   E_CHECK_RETURN(cw->c, 0);
-   E_CHECK_RETURN(cw->c->man, 0);
+   E_CHECK_RETURN(cw->bd, 0);
+   E_CHECK_RETURN(cw->bd->zone, 0);
+
+   if (!((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0) && (cw->dmg_updates >= 1)))
+     {
+        return EINA_FALSE;
+     }
+
+   zone = cw->bd->zone;
 
    if (!E_INTERSECTS
-       (0, 0, cw->c->man->w, cw->c->man->h,
+       (zone->x, zone->y, zone->w, zone->h,
         cw->x, cw->y, cw->w, cw->h))
      {
-        return v;
+        return EINA_FALSE;
      }
 
-   EINA_INLIST_REVERSE_FOREACH(cw->c->wins, _cw)
+   EINA_INLIST_REVERSE_FOREACH(cw->c->wins, cw2)
      {
-        if (!_cw) continue;
-        if ((_cw->visible) && REGION_EQUAL_TO_ROOT(_cw) &&
-            !(_cw->input_only) && !(_cw->invalid))
-          {
-             if (_cw == cw) return EINA_TRUE;
-             else if (!TYPE_HOME_CHECK(_cw) && _cw->argb) continue;
-             else return EINA_FALSE;
-          }
+        if (!cw2) continue;
+        if (cw2->invalid) continue;
+        if (cw2->input_only) continue;
+        if (!cw2->bd) continue;
+
+        ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw),
+             "%15.15s| CHECK | %02d| %p %p 0x%08x pixmap:0x%x %dx%d %d", "EFFECT",
+             count++,
+             cw, cw2,
+             e_mod_comp_util_client_xid_get(cw2),
+             cw2->pixmap, cw2->pw, cw2->ph,
+             cw2->dmg_updates);
+
+        if (!cw2->bd->zone) continue;
+        if (!cw2->visible) continue;
+        if (cw2->bd->zone != zone) continue;
+        if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h,
+                          cw2->x, cw2->y, cw2->w, cw2->h))
+          continue;
+
+        if (!((cw2->pixmap) &&
+              (cw2->pw > 0) && (cw2->ph > 0) &&
+              (cw2->dmg_updates >= 1)))
+          continue;
+
+        if (cw2 == cw) return EINA_TRUE;
+
+        if (REGION_EQUAL_TO_ZONE(cw2, zone))
+          return EINA_FALSE;
      }
-   return v;
+
+   return EINA_FALSE;
 }
 
 EINTERN Ecore_X_Window
index ace59e0..629ad4e 100644 (file)
@@ -33,7 +33,8 @@ EINTERN void           e_mod_comp_util_set(E_Comp *c, E_Manager *man);
 EINTERN E_Comp        *e_mod_comp_util_get(void);
 EINTERN Eina_Bool      e_mod_comp_util_grab_key_set(Eina_Bool grab);
 EINTERN Eina_Bool      e_mod_comp_util_screen_input_region_set(Eina_Bool set);
-EINTERN E_Comp_Win    *e_mod_comp_util_win_normal_get(void);
+EINTERN E_Comp_Win    *e_mod_comp_util_win_nocomp_get(E_Comp *c, E_Zone *zone);
+EINTERN E_Comp_Win    *e_mod_comp_util_win_normal_get(E_Comp_Win *cw);
 EINTERN E_Comp_Win    *e_mod_comp_util_win_below_get(E_Comp_Win *cw, Eina_Bool normal_check);
 EINTERN Eina_Bool      e_mod_comp_util_win_below_check(E_Comp_Win *cw, E_Comp_Win *cw2);
 EINTERN Eina_Bool      e_mod_comp_util_win_visible_get(E_Comp_Win *cw);
index 2d1132e..7b2c4b6 100755 (executable)
@@ -4,6 +4,9 @@
 
 #include "e.h"
 
+#define LOG_TAG        "DEVICEMGR"
+#include "dlog.h"
+
 #define E_DEVICEMGR_CFG_PATH  "/opt/share/.e/e/config/samsung/"
 #define E_DEVICEMGR_CFG       "module.devicemgr-tizen"
 
index b2f0b7a..c6b0450 100755 (executable)
@@ -45,11 +45,11 @@ e_mod_devicemgr_config_init(void)
      {\r
         _e_mod_devicemgr_config_new();\r
         e_mod_devicemgr_config_save();\r
-        fprintf(stderr, "[e_devicemgr][config] Config file for e_devicemgr was made/stored !\n");\r
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][config] Config file for e_devicemgr was made/stored !\n");\r
      }\r
    else\r
      {\r
-        fprintf(stderr, "[e_devicemgr][config] Config file for e_devicemgr was loaded successfully !\n");\r
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][config] Config file for e_devicemgr was loaded successfully !\n");\r
      }\r
 \r
    return 1;\r
index cab17c6..6df2070 100755 (executable)
@@ -13,7 +13,7 @@
    do {                                               \
         a = ecore_x_atom_get (s);                      \
         if (!a)                                       \
-          fprintf (stderr,                             \
+          SLOG(LOG_DEBUG, "DEVICEMGR",                              \
                    "[E-devmgr] ##s creation failed.\n"); \
    } while (0)
 
@@ -30,7 +30,7 @@ typedef enum
 void
 e_mod_drv_virt_mon_set (int cmd)
 {
-   printf ("[DeviceMgr]: set the virtual output connect/disconnect\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: set the virtual output connect/disconnect\n");
 
    E_Randr_Output_Info *output_info = NULL;
    Eina_List *l_output;
@@ -53,7 +53,7 @@ e_mod_drv_virt_mon_set (int cmd)
 
    if (!found_output)
      {
-        fprintf (stderr, "[DeviceMgr]: fail to initialize the virtual output\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to initialize the virtual output\n");
         goto set_fail;
      }
 
@@ -81,7 +81,7 @@ set_fail:
 void
 e_mod_drv_hib_set (int cmd)
 {
-   printf ("[DeviceMgr]: set the hibernation on/off\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: set the hibernation on/off\n");
 
    E_Randr_Output_Info *output_info = NULL;
    Eina_List *l_output;
@@ -104,7 +104,7 @@ e_mod_drv_hib_set (int cmd)
 
    if (!found_output)
      {
-        fprintf (stderr, "[DeviceMgr]: fail to initialize the virtual output\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to initialize the virtual output\n");
         goto set_fail;
      }
 
index 7e39250..79a5c0d 100755 (executable)
@@ -5,8 +5,8 @@
 #include "e_mod_config.h"
 #include <string.h>
 
-#define E_MOD_SCRNCONF_CHK_RET(cond, val) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __func__, #cond); return val; }}
-#define E_MOD_SCRNCONF_CHK_GOTO(cond, dst) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __func__, #cond); goto dst; }}
+#define E_MOD_SCRNCONF_CHK_RET(cond, val) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); return val; }}
+#define E_MOD_SCRNCONF_CHK_GOTO(cond, dst) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); goto dst; }}
 
 extern char *strcasestr(const char *s, const char *find);
 DeviceMgr e_devicemgr;
@@ -37,7 +37,7 @@ e_modapi_init(E_Module* m)
 {
    if (!_e_devicemgr_init())
      {
-        printf("[e_devicemgr][%s] Failed @ _e_devicemgr_init()..!\n", __FUNCTION__);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed @ _e_devicemgr_init()..!\n", __FUNCTION__);
         return NULL;
      }
 
@@ -48,10 +48,10 @@ e_modapi_init(E_Module* m)
    e_devicemgr.zone_add_handler = ecore_event_handler_add(E_EVENT_ZONE_ADD, (Ecore_Event_Handler_Cb)_e_devicemgr_cb_zone_add, NULL);
    e_devicemgr.zone_del_handler = ecore_event_handler_add(E_EVENT_ZONE_DEL, (Ecore_Event_Handler_Cb)_e_devicemgr_cb_zone_del, NULL);
 
-   if (!e_devicemgr.window_property_handler) printf("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_WINDOW_PROPERTY handler\n", __FUNCTION__);
-   if (!e_devicemgr.event_generic_handler) printf("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_GENERIC handler\n", __FUNCTION__);
-   if (!e_devicemgr.zone_add_handler) printf("[e_devicemgr][%s] Failed to add E_EVENT_ZONE_ADD handler\n", __FUNCTION__);
-   if (!e_devicemgr.zone_del_handler) printf("[e_devicemgr][%s] Failed to add E_EVENT_ZONE_DEL handler\n", __FUNCTION__);
+   if (!e_devicemgr.window_property_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_WINDOW_PROPERTY handler\n", __FUNCTION__);
+   if (!e_devicemgr.event_generic_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_GENERIC handler\n", __FUNCTION__);
+   if (!e_devicemgr.zone_add_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add E_EVENT_ZONE_ADD handler\n", __FUNCTION__);
+   if (!e_devicemgr.zone_del_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add E_EVENT_ZONE_DEL handler\n", __FUNCTION__);
 
    if (e_devicemgr.scrnconf_enable)
      {
@@ -59,9 +59,9 @@ e_modapi_init(E_Module* m)
         e_devicemgr.randr_output_handler = ecore_event_handler_add (ECORE_X_EVENT_RANDR_OUTPUT_CHANGE, (Ecore_Event_Handler_Cb)_e_devicemgr_cb_output_change, NULL);
         e_devicemgr.randr_output_property_handler = ecore_event_handler_add (ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY, (Ecore_Event_Handler_Cb)_e_devicemgr_cb_output_property, NULL);
 
-        if (!e_devicemgr.randr_crtc_handler) printf ("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_CRTC_CHANGE handler\n", __FUNCTION__);
-        if (!e_devicemgr.randr_output_handler) printf ("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_OUTPUT_CHANGE handler\n", __FUNCTION__);
-        if (!e_devicemgr.randr_output_property_handler) printf ("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY handler\n", __FUNCTION__);
+        if (!e_devicemgr.randr_crtc_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_CRTC_CHANGE handler\n", __FUNCTION__);
+        if (!e_devicemgr.randr_output_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_OUTPUT_CHANGE handler\n", __FUNCTION__);
+        if (!e_devicemgr.randr_output_property_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY handler\n", __FUNCTION__);
      }
 
    return m;
@@ -109,7 +109,7 @@ _e_devicemgr_init(void)
 
    if (!e_devicemgr.disp)
      {
-        fprintf(stderr, "\e[32m[e_devicemgr] Failed to open display..!\e[0m\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "\e[32m[e_devicemgr] Failed to open display..!\e[0m\n");
         ret = 0;
         goto out;
      }
@@ -154,18 +154,18 @@ _e_devicemgr_init(void)
 
    if (!e_devicemgr.input_window)
      {
-        fprintf(stderr, "[e_devicemgr] Failed to create input_window !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to create input_window !\n");
      }
    else
      {
-        fprintf(stderr, "[e_devicemgr] Succeed to create input_window (0x%x)!\n", e_devicemgr.input_window);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Succeed to create input_window (0x%x)!\n", e_devicemgr.input_window);
         ecore_x_window_prop_property_set(e_devicemgr.rootWin, e_devicemgr.atomDeviceMgrInputWindow, ECORE_X_ATOM_WINDOW, 32, &e_devicemgr.input_window, 1);
      }
 
    res = _e_devicemgr_xinput_init();
    if (!res)
      {
-        fprintf(stderr, "[e_devicemgr] Failed to initialize XInput Extension !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to initialize XInput Extension !\n");
         ret =0;
         goto out;
      }
@@ -173,7 +173,7 @@ _e_devicemgr_init(void)
    res = _e_devicemgr_xkb_init();
    if (!res)
      {
-        fprintf(stderr, "[e_devicemgr] Failed to initialize XKB Extension !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to initialize XKB Extension !\n");
         ret = 0;
         goto out;
      }
@@ -187,7 +187,7 @@ _e_devicemgr_init(void)
    res = _e_devicemgr_get_configuration();
    if (!res)
      {
-        fprintf(stderr, "[e_devicemgr] Failed to get configuration from %s.cfg file !\n", E_DEVICEMGR_CFG);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to get configuration from %s.cfg file !\n", E_DEVICEMGR_CFG);
         ret =0;
         goto out;
      }
@@ -195,7 +195,7 @@ _e_devicemgr_init(void)
    e_mod_scrnconf_container_bg_canvas_visible_set(EINA_FALSE);
    if(EINA_FALSE == e_mod_sf_rotation_init())
      {
-        fprintf(stderr, "[e_devicemgr] Failed to init rotation!\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to init rotation!\n");
      }
      
 out:
@@ -207,7 +207,7 @@ _e_devicemgr_fini(void)
 {
    if(EINA_FALSE == e_mod_sf_rotation_deinit())
      {
-        fprintf(stderr, "[e_devicemgr] Failed to deinit rotation!\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr] Failed to deinit rotation!\n");
      }
 
    e_mod_devicemgr_config_shutdown();
@@ -239,7 +239,7 @@ _e_devicemgr_cb_crtc_change (void *data, int type, void *ev)
 {
    if (type == ECORE_X_EVENT_RANDR_CRTC_CHANGE)
      {
-        //fprintf (stderr, "[scrn-conf]: Crtc Change!: \n");
+        //SLOG(LOG_DEBUG, "DEVICEMGR", "[scrn-conf]: Crtc Change!: \n");
         //Ecore_X_Event_Randr_Crtc_Change *event = (Ecore_X_Event_Randr_Crtc_Change *)ev;
         /* available information:
            struct _Ecore_X_Event_Randr_Crtc_Change
@@ -269,7 +269,7 @@ _e_devicemgr_cb_output_change (void *data, int type, void *ev)
 
    if (type == ECORE_X_EVENT_RANDR_OUTPUT_CHANGE)
      {
-       //fprintf (stderr, "[scrn-conf]: Output Change!: \n");
+       //SLOG(LOG_DEBUG, "DEVICEMGR", "[scrn-conf]: Output Change!: \n");
        Ecore_X_Event_Randr_Output_Change *event = (Ecore_X_Event_Randr_Output_Change *)ev;
        /* available information:
           struct _Ecore_X_Event_Randr_Output_Change
@@ -283,7 +283,7 @@ _e_devicemgr_cb_output_change (void *data, int type, void *ev)
              Ecore_X_Render_Subpixel_Order   subpixel_order;
           };
        */
-       fprintf (stderr, "[DeviceMgr]: Output Connection!: %d (connected = %d, disconnected = %d, unknown %d)\n",
+       SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: Output Connection!: %d (connected = %d, disconnected = %d, unknown %d)\n",
                 event->connection, ECORE_X_RANDR_CONNECTION_STATUS_CONNECTED, ECORE_X_RANDR_CONNECTION_STATUS_DISCONNECTED, ECORE_X_RANDR_CONNECTION_STATUS_UNKNOWN);
 
        /* check status of a output */
@@ -303,7 +303,7 @@ _e_devicemgr_cb_output_change (void *data, int type, void *ev)
             if (sc_stat == UTILX_SCRNCONF_STATUS_CONNECT ||
                 sc_stat == UTILX_SCRNCONF_STATUS_ACTIVE)
              {
-                fprintf (stderr, "[DeviceMgr] : external monitor status is already connected \n");
+                SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr] : external monitor status is already connected \n");
                 return 1;
              }
 
@@ -389,7 +389,7 @@ _e_devicemgr_cb_output_property (void *data, int type, void *ev)
 {
    if (type == ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY)
      {
-       //fprintf (stderr, "[scrn-conf]: Output Property Notify!: \n");
+       //SLOG(LOG_DEBUG, "DEVICEMGR", "[scrn-conf]: Output Property Notify!: \n");
        //Ecore_X_Event_Randr_Output_Property_Notify *event = (Ecore_X_Event_Randr_Output_Property_Notify *)ev;
        /* available information:
           struct _Ecore_X_Event_Randr_Output_Property_Notify
@@ -444,35 +444,35 @@ _e_devicemgr_cb_client_message (void* data, int type, void* event)
              e_devicemgr.virtual_touchpad_area_info[1] = ev->data.l[2];
              e_devicemgr.virtual_touchpad_area_info[2] = ev->data.l[3];
              e_devicemgr.virtual_touchpad_area_info[3] = ev->data.l[4];
-             fprintf(stderr, "[e_devicemgr][cb_client_message] virtual_touchpad_area_info=%d %d %d %d\n",
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] virtual_touchpad_area_info=%d %d %d %d\n",
                                e_devicemgr.virtual_touchpad_area_info[0], e_devicemgr.virtual_touchpad_area_info[1],
                                e_devicemgr.virtual_touchpad_area_info[2], e_devicemgr.virtual_touchpad_area_info[3]);
           }
         else if (ev->data.l[0] == E_VIRTUAL_TOUCHPAD_WINDOW)
           {
              e_devicemgr.virtual_touchpad_window = (Ecore_X_Window)ev->data.l[1];
-             fprintf(stderr, "[e_devicemgr][cb_client_message] virtual_touchpad_window=0x%x\n", e_devicemgr.virtual_touchpad_window);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] virtual_touchpad_window=0x%x\n", e_devicemgr.virtual_touchpad_window);
           }
         else if (ev->data.l[0] == E_VIRTUAL_TOUCHPAD_CONFINE_SET)
           {
              _e_devicemgr_set_confine_information(e_devicemgr.virtual_touchpad_id, _e_devicemgr_get_nth_zone(2), EINA_TRUE, NULL, EINA_FALSE, EINA_TRUE);
-             fprintf(stderr, "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_CONFINE_SET\n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_CONFINE_SET\n");
           }
         else if (ev->data.l[0] == E_VIRTUAL_TOUCHPAD_CONFINE_UNSET)
           {
              _e_devicemgr_set_confine_information(e_devicemgr.virtual_touchpad_id, NULL, EINA_FALSE, NULL, EINA_FALSE, EINA_FALSE);
-             fprintf(stderr, "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_CONFINE_UNSET\n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_CONFINE_UNSET\n");
           }
         else if (ev->data.l[0] == E_VIRTUAL_TOUCHPAD_MT_BEGIN)
           {
-             fprintf(stderr, "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_MT_BEGIN !virtual_multitouch_done=%d\n", e_devicemgr.virtual_multitouch_done);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_MT_BEGIN !virtual_multitouch_done=%d\n", e_devicemgr.virtual_multitouch_done);
 
              if (0 != e_devicemgr.virtual_touchpad_pointed_window)
                {
                   XISetClientPointer(e_devicemgr.disp, e_devicemgr.virtual_touchpad_pointed_window, e_devicemgr.virtual_touchpad_id);
                   XSync(e_devicemgr.disp, 0);
                   ecore_x_pointer_xy_get(e_devicemgr.virtual_touchpad_pointed_window, &pos[0], &pos[1]);
-                  fprintf(stderr, "[e_devicemgr][_cb_client_message] cursor pos x=%d, y=%d\n", pos[0], pos[1]);
+                  SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_cb_client_message] cursor pos x=%d, y=%d\n", pos[0], pos[1]);
 
                   if (pos[0] < 0 || pos[1] < 0 ) return 1;
 
@@ -490,43 +490,43 @@ _e_devicemgr_cb_client_message (void* data, int type, void* event)
 
                   if (INSIDE(cx, cy, x1, y1, x1+(w/2), y1+(h/2)))
                     {
-                       printf("[_client_message] 1st box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1, y1, x1+(w/2), y1+(h/2));
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 1st box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1, y1, x1+(w/2), y1+(h/2));
                        pw = pos[0]*2;
                        ph = pos[1]*2;
                        px = x1;
                        py = y1;
-                       printf("[_client_message] 1st box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 1st box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
                     }
                   else if (INSIDE(cx, cy, x1+(w/2), y1, x2, y1+(h/2)))
                     {
-                       printf("[_client_message] 2nd box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1+(w/2), y1, x2, y1+(h/2));
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 2nd box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1+(w/2), y1, x2, y1+(h/2));
                        pw = (w-pos[0])*2;
                        ph = pos[1]*2;
                        px = x2-pw;
                        py = y1;
-                       printf("[_client_message] 2nd box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 2nd box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
                     }
                   else if (INSIDE(cx, cy, x1, y1+(h/2), x1+(w/2), y2))
                     {
-                       printf("[_client_message] 3rd box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1, y1+(h/2), x1+(w/2), y2);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 3rd box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1, y1+(h/2), x1+(w/2), y2);
                        pw = pos[0]*2;
                        ph = (h-pos[1])*2;
                        px = x1;
                        py = y2-ph;
-                       printf("[_client_message] 3rd box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 3rd box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
                     }
                   else if (INSIDE(cx, cy, x1+(w/2), y1+(h/2), x2, y2))
                     {
-                       printf("[_client_message] 4th box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1+(w/2), y1+(h/2), x2, y2);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 4th box (x1=%d, y1=%d, x2=%d, y2=%d)!\n", x1+(w/2), y1+(h/2), x2, y2);
                        pw = (w-pos[0])*2;
                        ph = (h-pos[1])*2;
                        px = x2-pw;
                        py = y2-ph;
-                       printf("[_client_message] 4th box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] 4th box (effective area = %d, %d, %d, %d)!\n", px, py, pw, ph);
                     }
                   else
                     {
-                       printf("[_client_message] !!! pointer is not in 4 boxes !!!\n");
+                       SLOG(LOG_DEBUG, "DEVICEMGR", "[_client_message] !!! pointer is not in 4 boxes !!!\n");
                     }
 
                   vw = e_devicemgr.virtual_touchpad_area_info[2] -e_devicemgr.virtual_touchpad_area_info[0];
@@ -556,7 +556,7 @@ _e_devicemgr_cb_client_message (void* data, int type, void* event)
         else if (ev->data.l[0] == E_VIRTUAL_TOUCHPAD_MT_END)
           {
              e_devicemgr.virtual_multitouch_done = 1;
-             fprintf(stderr, "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_MT_END !virtual_multitouch_done=%d\n", e_devicemgr.virtual_multitouch_done);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_client_message] E_VIRTUAL_TOUCHPAD_MT_END !virtual_multitouch_done=%d\n", e_devicemgr.virtual_multitouch_done);
              if (0 != e_devicemgr.virtual_touchpad_pointed_window)
                {
                   _e_devicemgr_set_confine_information(e_devicemgr.virtual_touchpad_id, NULL, EINA_FALSE, NULL, EINA_FALSE, EINA_FALSE);
@@ -582,13 +582,13 @@ _e_devicemgr_cb_client_message (void* data, int type, void* event)
         sc_stat = e_mod_scrnconf_external_get_status();
         if (sc_stat == UTILX_SCRNCONF_STATUS_NULL)
           {
-             fprintf (stderr, "[DeviceMgr] : external monitor is not connected \n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr] : external monitor is not connected \n");
              return 1;
           }
 
         if (sc_dispmode == e_mod_scrnconf_external_get_dispmode())
           {
-             fprintf (stderr, "[DeviceMgr] : the same dispmode is already set \n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr] : the same dispmode is already set \n");
              return 1;
           }
 
@@ -601,7 +601,7 @@ _e_devicemgr_cb_client_message (void* data, int type, void* event)
 
         if (!e_mod_scrnconf_external_set_dispmode (sc_output, sc_dispmode, sc_res))
           {
-             fprintf (stderr, "[DeviceMgr] : fail to get external output \n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr] : fail to get external output \n");
              return 1;
           }
 
@@ -666,13 +666,13 @@ _e_devicemgr_xinput_init(void)
 
    if (!XQueryExtension(e_devicemgr.disp, "XInputExtension", &e_devicemgr.xi2_opcode, &event, &error))
      {
-        printf("[e_devicemgr][%s] XInput Extension isn't supported.\n", __FUNCTION__);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] XInput Extension isn't supported.\n", __FUNCTION__);
         goto fail;
      }
 
    if (XIQueryVersion(e_devicemgr.disp, &major, &minor) == BadRequest)
      {
-        printf("[e_devicemgr][%s] Failed to query XI version.\n", __FUNCTION__);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to query XI version.\n", __FUNCTION__);
         goto fail;
      }
 
@@ -703,7 +703,7 @@ _e_devicemgr_xkb_init(void)
    if (!(XkbLibraryVersion(&xkb_lmaj, &xkb_lmin)
         && XkbQueryExtension(e_devicemgr.disp, &xkb_opcode, &xkb_event, &xkb_error, &xkb_lmaj, &xkb_lmin)))
      {
-        fprintf(stderr, "[e_devicemgr][xkb_init] Failed to initialize XKB extension !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][xkb_init] Failed to initialize XKB extension !\n");
         e_devicemgr.xkb_available = EINA_FALSE;
         return 0;
      }
@@ -751,13 +751,13 @@ _e_devicemgr_cb_event_generic(void *data, int ev_type, void *event)
 
    if (e->extension != e_devicemgr.xi2_opcode)
      {
-        fprintf(stderr, "[e_devicemgr][%s] Invalid event !(extension:%d, evtype:%d)\n", __FUNCTION__, e->extension, e->evtype);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Invalid event !(extension:%d, evtype:%d)\n", __FUNCTION__, e->extension, e->evtype);
         return 1;
      }
 
    if (!evData || evData->send_event)
    {
-      fprintf(stderr, "[e_devicemgr][%s] Generic event data is not available or the event was sent via XSendEvent (and will be ignored) !\n", __FUNCTION__);
+      SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Generic event data is not available or the event was sent via XSendEvent (and will be ignored) !\n", __FUNCTION__);
       return 1;
    }
 
@@ -789,19 +789,19 @@ _e_devicemgr_cb_zone_add(void *data, int ev_type, void *event)
    l = eina_list_data_find_list(e_devicemgr.zones, zone);
    if (l)
      {
-        fprintf(stderr, "[e_devicemgr][zone_add] zone exists already in zone list !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_add] zone exists already in zone list !\n");
         return 1;
      }
 
-   fprintf(stderr, "[e_devicemgr][zone_add] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_add] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
        zone->name, zone->w, zone->h, zone->x, zone->y);
-   fprintf(stderr, "[e_devicemgr][zone_add] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_add] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
        zone->useful_geometry.w, zone->useful_geometry.h, zone->useful_geometry.x, zone->useful_geometry.y);
 
    e_devicemgr.zones = eina_list_append(e_devicemgr.zones, zone);
    e_devicemgr.num_zones++;
 
-   fprintf(stderr, "[e_devicemgr][zone_add] num_zones=%d\n", e_devicemgr.num_zones);
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_add] num_zones=%d\n", e_devicemgr.num_zones);
 
    return 1;
 }
@@ -817,21 +817,21 @@ _e_devicemgr_cb_zone_del(void *data, int ev_type, void *event)
    zone = ev->zone;
    if (!zone || !zone->name) return 1;
 
-   fprintf(stderr, "[e_devicemgr][zone_del] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_del] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
        zone->name, zone->w, zone->h, zone->x, zone->y);
-   fprintf(stderr, "[e_devicemgr][zone_del] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_del] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
        zone->useful_geometry.w, zone->useful_geometry.h, zone->useful_geometry.x, zone->useful_geometry.y);
 
    if (e_devicemgr.num_zones < 2)//basic zone + additional zone(s)
      {
-        fprintf(stderr, "[e_devicemgr][zone_del] Zone list needs to be checked into !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_del] Zone list needs to be checked into !\n");
         return 1;
      }
 
    l = eina_list_data_find_list(e_devicemgr.zones, zone);
    if (!l)
      {
-        fprintf(stderr, "[e_devicemgr][zone_del] zone doesn't exist in zone list !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_del] zone doesn't exist in zone list !\n");
         return 1;
      }
 
@@ -844,7 +844,7 @@ _e_devicemgr_cb_zone_del(void *data, int ev_type, void *event)
    e_devicemgr.zones = eina_list_remove(e_devicemgr.zones, zone);
    e_devicemgr.num_zones--;
 
-   fprintf(stderr, "[e_devicemgr][zone_del] num_zones=%d\n", e_devicemgr.num_zones);
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][zone_del] num_zones=%d\n", e_devicemgr.num_zones);
 
    return 1;
 }
@@ -860,7 +860,7 @@ _e_devicemgr_hook_border_resize_end(void *data, void *border)
    e_devicemgr.virtual_touchpad_pointed_window_info[2] = bd->client.w;
    e_devicemgr.virtual_touchpad_pointed_window_info[3] = bd->client.h;
 
-   fprintf(stderr, "[e_devicemgr][hook_border_resize_end] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][hook_border_resize_end] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
               e_devicemgr.virtual_touchpad_pointed_window_info[0], e_devicemgr.virtual_touchpad_pointed_window_info[1],
               e_devicemgr.virtual_touchpad_pointed_window_info[2], e_devicemgr.virtual_touchpad_pointed_window_info[3]);
 }
@@ -876,7 +876,7 @@ _e_devicemgr_hook_border_move_end(void *data, void *border)
    e_devicemgr.virtual_touchpad_pointed_window_info[2] = bd->client.w;
    e_devicemgr.virtual_touchpad_pointed_window_info[3] = bd->client.h;
 
-   fprintf(stderr, "[e_devicemgr][hook_border_move_end] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][hook_border_move_end] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
               e_devicemgr.virtual_touchpad_pointed_window_info[0], e_devicemgr.virtual_touchpad_pointed_window_info[1],
               e_devicemgr.virtual_touchpad_pointed_window_info[2], e_devicemgr.virtual_touchpad_pointed_window_info[3]);
 }
@@ -902,7 +902,6 @@ _e_devicemgr_cb_mouse_in(void *data, int type, void *event)
              if (!e_devicemgr.virtual_multitouch_done && e_devicemgr.virtual_touchpad_pointed_window != 0)
                return ECORE_CALLBACK_PASS_ON;
 
-             //fprintf(stderr, "[e_devicemgr][cb_mouse_in] bd is null but enlightenment window ! (ev->event_win=0x%x)\n", ev->event_win);
              e_devicemgr.virtual_touchpad_pointed_window = 0;
              ecore_x_client_message32_send(e_devicemgr.virtual_touchpad_window, e_devicemgr.atomVirtualTouchpadInt,
                                                                      ECORE_X_EVENT_MASK_NONE, E_VIRTUAL_TOUCHPAD_POINTED_WINDOW, 0, 0, 0, 0);
@@ -910,26 +909,21 @@ _e_devicemgr_cb_mouse_in(void *data, int type, void *event)
              return ECORE_CALLBACK_PASS_ON;
           }
 
-        //fprintf(stderr, "[e_devicemgr][cb_mouse_in] bd is null ! (ev->event_win=0x%x)\n", ev->event_win);
         return ECORE_CALLBACK_PASS_ON;
      }
 
    if (bd->zone->id == 0)
      {
-        //fprintf(stderr, "[e_devicemgr][cb_mouse_in] zone->id=%d (ev->event_win=0x%x)\n", bd->zone->id, ev->event_win);
         return ECORE_CALLBACK_PASS_ON;
      }
 
-   //fprintf(stderr, "[e_devicemgr][cb_mouse_in] bd zone->id=%d, win=0x%x, x=%d, y=%d, w=%d, h=%d\n", bd->zone->id, bd->win, bd->x, bd->y, bd->w, bd->h);
-   //fprintf(stderr, "[e_devicemgr][cb_mouse_in] bd->client win=0x%x, x=%d, y=%d, w=%d, h=%d\n", bd->client.win, bd->client.x, bd->client.y, bd->client.w, bd->client.h);
-
    e_devicemgr.virtual_touchpad_pointed_window_info[0] = bd->x + bd->client_inset.l;
    e_devicemgr.virtual_touchpad_pointed_window_info[1] = bd->y + bd->client_inset.t;
    e_devicemgr.virtual_touchpad_pointed_window_info[2] = bd->client.w;
    e_devicemgr.virtual_touchpad_pointed_window_info[3] = bd->client.h;
    e_devicemgr.virtual_touchpad_pointed_window = bd->client.win;
 
-   fprintf(stderr, "[e_devicemgr][cb_mouse_in] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][cb_mouse_in] application win=0x%x, px=%d, py=%d, pw=%d, ph=%d\n", bd->client.win,
               e_devicemgr.virtual_touchpad_pointed_window_info[0], e_devicemgr.virtual_touchpad_pointed_window_info[1],
               e_devicemgr.virtual_touchpad_pointed_window_info[2], e_devicemgr.virtual_touchpad_pointed_window_info[3]);
    ecore_x_client_message32_send(e_devicemgr.virtual_touchpad_window, e_devicemgr.atomVirtualTouchpadInt,
@@ -966,9 +960,9 @@ _e_devicemgr_get_zones(void)
                          {
                             if (z)
                               {
-                                 fprintf(stderr, "[e_devicemgr][_e_devicemgr_get_zones] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
+                                 SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_e_devicemgr_get_zones] z->name=%s, z->w=%d, z->h=%d, z->x=%d, z->y=%d\n",
                                           z->name, z->w, z->h, z->x, z->y);
-                                 fprintf(stderr, "[e_devicemgr][_e_devicemgr_get_zones] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
+                                 SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_e_devicemgr_get_zones] z->useful_geometry.w=%d, z->useful_geometry.h=%d, z->useful_geometry.x=%d, z->useful_geometry.y=%d\n",
                                           z->useful_geometry.w, z->useful_geometry.h, z->useful_geometry.x, z->useful_geometry.y);
                                  e_devicemgr.zones = eina_list_append(e_devicemgr.zones, z);
                                  e_devicemgr.num_zones++;
@@ -1019,14 +1013,14 @@ _e_devicemgr_init_output(void)
              if (output_info && output_info->name && !strncmp(output_info->name, "LVDS1", 5))
                {
                   e_devicemgr.output = res->outputs[i];
-                  fprintf(stderr, "[e_devicemgr][_e_devicemgr_init_output] LVDS1 was found !\n");
+                  SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_e_devicemgr_init_output] LVDS1 was found !\n");
                   XRRFreeOutputInfo(output_info);
                   break;
                }
              else
                {
                   e_devicemgr.output = res->outputs[i];
-                  fprintf(stderr, "[e_devicemgr][_e_devicemgr_init_output] LVDS1 was not found yet !\n");
+                  SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_e_devicemgr_init_output] LVDS1 was not found yet !\n");
                }
 
              if (output_info) XRRFreeOutputInfo(output_info);
@@ -1035,7 +1029,7 @@ _e_devicemgr_init_output(void)
 
    if (!e_devicemgr.output)
      {
-        fprintf(stderr, "[e_devicemgr][_e_devicemgr_init_output] Failed to init output !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][_e_devicemgr_init_output] Failed to init output !\n");
      }
 }
 
@@ -1059,7 +1053,7 @@ _e_devicemgr_init_input(void)
 
    if (e_devicemgr.xi2_opcode < 0)
      {
-        fprintf(stderr, "[e_devicemgr][%s] Failed to initialize input !\n", __FUNCTION__);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to initialize input !\n", __FUNCTION__);
         return;
      }
 
@@ -1067,7 +1061,7 @@ _e_devicemgr_init_input(void)
 
    if (!info)
      {
-        fprintf(stderr, "[e_devicemgr][%s] There is no queried XI device.\n", __FUNCTION__);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] There is no queried XI device.\n", __FUNCTION__);
         return;
      }
 
@@ -1090,7 +1084,7 @@ _e_devicemgr_init_input(void)
 
                 if (!data)
                   {
-                     fprintf(stderr, "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
+                     SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
                      goto out;
                   }
 
@@ -1102,7 +1096,7 @@ _e_devicemgr_init_input(void)
                      data->type = E_DEVICEMGR_TOUCHSCREEN;
                      e_devicemgr.device_list = eina_list_append(e_devicemgr.device_list, data);
                      e_devicemgr.num_touchscreen_devices++;
-                     fprintf(stderr, "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, num_touchscreen_devices=%d) was added/enabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, num_touchscreen_devices=%d) was added/enabled !\n",
                                  __FUNCTION__, dev->deviceid, dev->name, e_devicemgr.num_touchscreen_devices);
                   }
                 else
@@ -1113,7 +1107,7 @@ _e_devicemgr_init_input(void)
                      e_devicemgr.num_pointer_devices++;
 
                      if (1==e_devicemgr.num_pointer_devices) _e_devicemgr_set_mouse_exist(1, 1);
-                     fprintf(stderr, "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, num_pointer_devices=%d) was added/enabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, num_pointer_devices=%d) was added/enabled !\n",
                                  __FUNCTION__, dev->deviceid, dev->name, e_devicemgr.num_pointer_devices);
                   }
                 break;
@@ -1131,7 +1125,7 @@ handle_keyboard:
 
                 if (!data)
                   {
-                     fprintf(stderr, "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
+                     SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
                      goto out;
                   }
 
@@ -1151,7 +1145,7 @@ handle_keyboard:
                           _e_devicemgr_set_keyboard_exist((unsigned int)e_devicemgr.num_keyboard_devices, 1);
                        }
 
-                     fprintf(stderr, "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, num_keyboard_devices=%d) was added/enabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, num_keyboard_devices=%d) was added/enabled !\n",
                                  __FUNCTION__, dev->deviceid, dev->name, e_devicemgr.num_keyboard_devices);
                   }
                 else//HW key
@@ -1169,12 +1163,12 @@ handle_keyboard:
                 break;
 
              case XIMasterPointer:
-                fprintf(stderr, "[e_devicemgr][%s] XIMasterPointer (VCP) (id=%d, name=%s)\n", __FUNCTION__, dev->deviceid, dev->name);
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] XIMasterPointer (VCP) (id=%d, name=%s)\n", __FUNCTION__, dev->deviceid, dev->name);
                 e_devicemgr.vcp_id = dev->deviceid;
                 break;
 
              case XIMasterKeyboard:
-                fprintf(stderr, "[e_devicemgr][%s] XIMasterKeyboard (VCK) (id=%d, name=%s)\n", __FUNCTION__, dev->deviceid, dev->name);
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] XIMasterKeyboard (VCK) (id=%d, name=%s)\n", __FUNCTION__, dev->deviceid, dev->name);
                 e_devicemgr.vck_id = dev->deviceid;
                 break;
           }
@@ -1189,12 +1183,10 @@ _e_devicemgr_xi2_device_changed_handler(XIDeviceChangedEvent *event)
 {
    if (event->reason == XISlaveSwitch)
      {
-        //fprintf(stderr, "[e_devicemgr][device_change_handler] XISlaveSwitch (deviceid:%d, sourceid:%d) !\n", event->deviceid, event->sourceid);
         _e_devicemgr_slave_switched(event->deviceid, event->sourceid);
      }
    else if (event->reason == XIDeviceChange)
      {
-        //fprintf(stderr, "[e_devicemgr][device_change_handler] XIDeviceChange (deviceid:%d, sourceid:%d) !\n", event->deviceid, event->sourceid);
         _e_devicemgr_device_changed(event->deviceid, event->sourceid);
      }
 }
@@ -1206,17 +1198,14 @@ _e_devicemgr_xi2_device_hierarchy_handler(XIHierarchyEvent *event)
 
    if (event->flags & XIMasterAdded || event->flags & XIMasterRemoved)
      {
-        //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIMasterAdded or XIMasterRemoved !\n");
         for( i = 0 ; i < event->num_info ; i++ )
           {
              if (event->info[i].flags & XIMasterAdded)
                {
-                  //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIMasterAdded ! (id=%d, use=%d)\n", event->info[i].deviceid, event->info[i].use);
                   _e_devicemgr_master_pointer_added(event->info[i].deviceid);
                }
              else if (event->info[i].flags & XIMasterRemoved)
                {
-                  //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIMasterRemoved ! (id=%d, use=%d)\n", event->info[i].deviceid, event->info[i].use);
                   _e_devicemgr_master_pointer_removed(event->info[i].deviceid);
                }
           }
@@ -1224,17 +1213,14 @@ _e_devicemgr_xi2_device_hierarchy_handler(XIHierarchyEvent *event)
 
    if (event->flags & XIDeviceEnabled || event->flags & XIDeviceDisabled)
      {
-        //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIDeviceEnabled or XIDeviceDisabled !\n");
         for( i = 0 ; i < event->num_info ; i++ )
           {
              if (event->info[i].flags & XIDeviceEnabled)
                {
-                  //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIDeviceEnabled ! (id=%d, use=%d)\n", event->info[i].deviceid, event->info[i].use);
                   _e_devicemgr_device_enabled(event->info[i].deviceid, event->info[i].use);
                }
              else if (event->info[i].flags & XIDeviceDisabled)
                {
-                  //fprintf(stderr, "[e_devicemgr][hierarchy_handler] XIDeviceDisabled ! (id=%d, use=%d)\n", event->info[i].deviceid, event->info[i].use);
                   _e_devicemgr_device_disabled(event->info[i].deviceid, event->info[i].use);
                }
           }
@@ -1256,7 +1242,7 @@ _e_devicemgr_check_device_type(int deviceid, DeviceMgrDeviceType type, const cha
                               XA_ATOM, &act_type, &act_format,
                               &nitems, &bytes_after, &data) != Success)
      {
-        fprintf(stderr, "[e_devicemgr][check_device_type] Failed to get XI2 device property !(deviceid=%d)\n", deviceid);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][check_device_type] Failed to get XI2 device property !(deviceid=%d)\n", deviceid);
         goto out;
      }
 
@@ -1309,7 +1295,7 @@ _e_devicemgr_device_enabled(int id, int type)
 
    if (!info || ndevices <= 0)
      {
-        fprintf(stderr, "[e_devicemgr][%s] There is no queried XI device. (device id=%d, type=%d)\n", __FUNCTION__, id, type);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] There is no queried XI device. (device id=%d, type=%d)\n", __FUNCTION__, id, type);
         goto out;
      }
 
@@ -1323,7 +1309,7 @@ _e_devicemgr_device_enabled(int id, int type)
 
            if (!data)
              {
-                fprintf(stderr, "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
                 goto out;
              }
 
@@ -1340,7 +1326,7 @@ _e_devicemgr_device_enabled(int id, int type)
                   }
                 e_devicemgr.device_list = eina_list_append(e_devicemgr.device_list, data);
                 e_devicemgr.num_touchscreen_devices++;
-                fprintf(stderr, "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, num_touchscreen_devices=%d) was added/enabled !\n",
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, num_touchscreen_devices=%d) was added/enabled !\n",
                             __FUNCTION__, id, info->name, e_devicemgr.num_touchscreen_devices);
              }
            else
@@ -1350,7 +1336,7 @@ _e_devicemgr_device_enabled(int id, int type)
                 e_devicemgr.device_list = eina_list_append(e_devicemgr.device_list, data);
                 e_devicemgr.num_pointer_devices++;
                 if (1==e_devicemgr.num_pointer_devices) _e_devicemgr_set_mouse_exist(1, 1);
-                fprintf(stderr, "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, num_pointer_devices=%d) was added/enabled !\n",
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, num_pointer_devices=%d) was added/enabled !\n",
                            __FUNCTION__, id, info->name, e_devicemgr.num_pointer_devices);
                 if (strcasestr(info->name, E_VIRTUAL_TOUCHPAD_NAME))
                   {
@@ -1367,7 +1353,7 @@ handle_keyboard:
 
            if (!data)
              {
-                fprintf(stderr, "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
                 goto out;
              }
 
@@ -1384,7 +1370,7 @@ handle_keyboard:
                 if (e_devicemgr.num_keyboard_devices >= 1)
                   _e_devicemgr_set_keyboard_exist((unsigned int)e_devicemgr.num_keyboard_devices, 1);
 
-                fprintf(stderr, "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, num_keyboard_devices=%d) was added/enabled !\n",
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, num_keyboard_devices=%d) was added/enabled !\n",
                            __FUNCTION__, id, info->name, e_devicemgr.num_keyboard_devices);
              }
            else//HW key
@@ -1408,7 +1394,7 @@ handle_keyboard:
                   {
                      _e_devicemgr_virtual_multitouch_helper_init(id);
                   }
-                fprintf(stderr, "[e_devicemgr][%s] FloatingSlave touchscreen device (id=%d, name=%s) was added/enabled !\n",
+                SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] FloatingSlave touchscreen device (id=%d, name=%s) was added/enabled !\n",
                             __FUNCTION__, id, info->name);
              }
            break;
@@ -1426,7 +1412,7 @@ _e_devicemgr_device_disabled(int id, int type)
 
    if (!e_devicemgr.device_list)
      {
-        fprintf(stderr, "[e_devicemgr][%s] device list is empty ! something's wrong ! (id=%d, type=%d)\n", __FUNCTION__, id, type);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] device list is empty ! something's wrong ! (id=%d, type=%d)\n", __FUNCTION__, id, type);
         goto out;
      }
 
@@ -1438,7 +1424,7 @@ _e_devicemgr_device_disabled(int id, int type)
                {
                   case E_DEVICEMGR_HWKEY:
                      e_devicemgr.num_hwkey_devices--;
-                     fprintf(stderr, "[e_devicemgr][%s] Slave H/W key device (id=%d, name=%s, type=%d) was removed/disabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave H/W key device (id=%d, name=%s, type=%d) was removed/disabled !\n",
                                  __FUNCTION__, id, data->name, type);
 
                      e_devicemgr.device_list = eina_list_remove(e_devicemgr.device_list, data);
@@ -1454,7 +1440,7 @@ _e_devicemgr_device_disabled(int id, int type)
                           _e_devicemgr_set_keyboard_exist(0, 0);
                        }
 
-                     fprintf(stderr, "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, type=%d, num_keyboard_devices=%d) was removed/disabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave keyboard device (id=%d, name=%s, type=%d, num_keyboard_devices=%d) was removed/disabled !\n",
                                 __FUNCTION__, id, data->name, type, e_devicemgr.num_keyboard_devices);
 
                      e_devicemgr.device_list = eina_list_remove(e_devicemgr.device_list, data);
@@ -1470,7 +1456,7 @@ _e_devicemgr_device_disabled(int id, int type)
                           _e_devicemgr_set_mouse_exist(0, 1);
                        }
 
-                     fprintf(stderr, "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, type=%d, num_pointer_devices=%d) was removed/disabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave pointer device (id=%d, name=%s, type=%d, num_pointer_devices=%d) was removed/disabled !\n",
                                 __FUNCTION__, id, data->name, type, e_devicemgr.num_pointer_devices);
                      if (e_devicemgr.virtual_touchpad_id == id)
                        {
@@ -1485,7 +1471,7 @@ _e_devicemgr_device_disabled(int id, int type)
                      if (strcasestr(data->name, "virtual") && strcasestr(data->name, "multitouch"))
                        _e_devicemgr_virtual_multitouch_helper_fini();
                      e_devicemgr.num_touchscreen_devices--;
-                     fprintf(stderr, "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, type=%d, num_touchscreen_devices=%d) was removed/disabled !\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Slave touchscreen device (id=%d, name=%s, type=%d, num_touchscreen_devices=%d) was removed/disabled !\n",
                                 __FUNCTION__, id, data->name, type, e_devicemgr.num_touchscreen_devices);
 
                      e_devicemgr.device_list = eina_list_remove(e_devicemgr.device_list, data);
@@ -1493,7 +1479,7 @@ _e_devicemgr_device_disabled(int id, int type)
                      goto out;
 
                   default:
-                     fprintf(stderr, "[e_devicemgr][%s] Unknown type of device ! (id=%d, type=%d, name=%s, device type=%d)\n",
+                     SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Unknown type of device ! (id=%d, type=%d, name=%s, device type=%d)\n",
                                 __FUNCTION__, data->id, type, data->name, data->type);
                      e_devicemgr.device_list = eina_list_remove(e_devicemgr.device_list, data);
                      free(data);
@@ -1516,7 +1502,7 @@ _e_devicemgr_master_pointer_added(int id)
 
    if (!info || ndevices <= 0)
      {
-        fprintf(stderr, "[e_devicemgr][master_pointer_added] There is no queried XI device. (device id=%d)\n", id);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][master_pointer_added] There is no queried XI device. (device id=%d)\n", id);
         goto out;
      }
 
@@ -1525,7 +1511,7 @@ _e_devicemgr_master_pointer_added(int id)
    //Now we have a MasterPointer.
    if (strcasestr(E_NEW_MASTER_NAME" pointer", info->name))
      {
-        //fprintf(stderr, "[e_devicemgr][master_pointer_added] XIMasterPointer is added !(id=%d, name=%s)\n", info->deviceid, info->name);
+        //SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][master_pointer_added] XIMasterPointer is added !(id=%d, name=%s)\n", info->deviceid, info->name);
         e_devicemgr.new_master_pointer_id = info->deviceid;
 
         Eina_List *l;
@@ -1557,7 +1543,7 @@ _e_devicemgr_master_pointer_removed(int id)
 {
    if (e_devicemgr.new_master_pointer_id == id)
      {
-        //fprintf(stderr, "[e_devicemgr][master_pointer_removed] XIMasterPointer was removed ! (id=%d, name=%s)\n",
+        //SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][master_pointer_removed] XIMasterPointer was removed ! (id=%d, name=%s)\n",
         //           id, E_NEW_MASTER_NAME" pointer");
         e_devicemgr.new_master_pointer_id = -1;
 
@@ -1589,13 +1575,6 @@ _e_devicemgr_slave_switched(int deviceid, int sourceid)
    Eina_List *l;
    DeviceMgr_Device_Info *device_info;
 
-   if ((deviceid == e_devicemgr.vck_id) && (sourceid != e_devicemgr.vck_xtest_keyboard_id))
-     {
-        val = 1;
-        ecore_x_window_prop_card32_set(e_devicemgr.rootWin, e_devicemgr.atomHWKbdInputStarted, &val, 1);
-        return;
-     }
-
    EINA_LIST_FOREACH(e_devicemgr.device_list, l, device_info)
      {
         if (!device_info || device_info->id!=sourceid) continue;
@@ -1615,7 +1594,7 @@ _e_devicemgr_slave_switched(int deviceid, int sourceid)
 static void
 _e_devicemgr_device_changed(int deviceid, int sourceid)
 {
-   //fprintf(stderr, "[e_devicemgr][device_change_handler] deviceid:%d, sourceid:%d\n", deviceid, sourceid);
+   //SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][device_change_handler] deviceid:%d, sourceid:%d\n", deviceid, sourceid);
 }
 
 static void _e_devicemgr_enable_mouse_cursor(unsigned int val)
@@ -1643,7 +1622,7 @@ _e_devicemgr_set_confine_information(int deviceid, E_Zone *zone, Eina_Bool isset
 
    if (isset && !zone && !region)
      {
-        fprintf(stderr, "[e_devicemgr][set_confine_information] zone or region is needed for setting confine information !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][set_confine_information] zone or region is needed for setting confine information !\n");
         return;
      }
 
@@ -1655,7 +1634,7 @@ _e_devicemgr_set_confine_information(int deviceid, E_Zone *zone, Eina_Bool isset
              confine_region[1] = zone->y;
              confine_region[2] = zone->x + zone->w;
              confine_region[3] = zone->y + zone->h;
-             //fprintf(stderr, "[e_devicemgr][set_confine_information][zone] x=%d, y=%d, w=%d, h=%d\n", confine_region[0], confine_region[1], confine_region[2], confine_region[3]);
+             //SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][set_confine_information][zone] x=%d, y=%d, w=%d, h=%d\n", confine_region[0], confine_region[1], confine_region[2], confine_region[3]);
           }
         else
           {
@@ -1663,7 +1642,7 @@ _e_devicemgr_set_confine_information(int deviceid, E_Zone *zone, Eina_Bool isset
              confine_region[1] = region[1];
              confine_region[2] = region[2];
              confine_region[3] = region[3];
-             //fprintf(stderr, "[e_devicemgr][set_confine_information][region] x=%d, y=%d, w=%d, h=%d\n", confine_region[0], confine_region[1], confine_region[2], confine_region[3]);
+             //SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][set_confine_information][region] x=%d, y=%d, w=%d, h=%d\n", confine_region[0], confine_region[1], confine_region[2], confine_region[3]);
           }
         if (pointer_warp) confine_region[4] = 1;
         else confine_region[4] = 0;
@@ -1709,7 +1688,7 @@ _e_devicemgr_set_mouse_exist(unsigned int val, int propset)
      }
    else
      {
-        fprintf(stderr, "[e_devicemgr][%s] Invalid value for enabling cursor !(val=%d)\n", __FUNCTION__, val);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][%s] Invalid value for enabling cursor !(val=%d)\n", __FUNCTION__, val);
      }
 }
 
@@ -1749,7 +1728,7 @@ _e_devicemgr_lockmodifier_set(void)
 
    //Get current numlock/capslock status from Xserver
    mask = _e_devicemgr_get_lockmodifier_mask();
-   fprintf(stderr, "[e_devicemgr][lockmodifier_set] NumLock mask=%d, CapsLock mask=%d\n",
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][lockmodifier_set] NumLock mask=%d, CapsLock mask=%d\n",
                NumLockMask & mask, CapsLockMask & mask);
 
    //If one of lockmodiers is set, try to turn it on for all keyboard devices.
@@ -1766,7 +1745,7 @@ _e_devicemgr_create_master_device(char* master_name)
 
    if (!master_name)
      {
-        fprintf(stderr, "[e_devicemgr][create_master_device] name of master device is needed !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][create_master_device] name of master device is needed !\n");
         return EINA_FALSE;
      }
 
@@ -1781,7 +1760,7 @@ _e_devicemgr_create_master_device(char* master_name)
 
    if (ret!=Success) return EINA_FALSE;
 
-   fprintf(stderr, "[e_devicemgr][create_master_device] new master (%s) was created !\n", E_NEW_MASTER_NAME);
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][create_master_device] new master (%s) was created !\n", E_NEW_MASTER_NAME);
 
    return EINA_TRUE;
 }
@@ -1794,7 +1773,7 @@ _e_devicemgr_remove_master_device(int master_id)
 
    if (master_id < 0)
      {
-        fprintf(stderr, "[e_devicemgr][remove_master_device] master_id(%d) is invalid !\n", master_id);
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][remove_master_device] master_id(%d) is invalid !\n", master_id);
         return EINA_FALSE;
      }
 
@@ -1808,7 +1787,7 @@ _e_devicemgr_remove_master_device(int master_id)
 
    if (ret!=Success) return EINA_FALSE;
 
-   fprintf(stderr, "[e_devicemgr][remove_master_device] new master (%s) was removed !\n", E_NEW_MASTER_NAME);
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][remove_master_device] new master (%s) was removed !\n", E_NEW_MASTER_NAME);
 
    return EINA_TRUE;
 }
@@ -1827,7 +1806,7 @@ _e_devicemgr_detach_slave(int slave_id)
 
    if (ret!=Success) return EINA_FALSE;
 
-   fprintf(stderr, "[e_devicemgr][detach_slave] slave (id=%d) was removed !\n", slave_id);
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][detach_slave] slave (id=%d) was removed !\n", slave_id);
 
    return EINA_TRUE;
 }
@@ -1848,7 +1827,7 @@ _e_devicemgr_reattach_slave(int slave_id, int master_id)
 
    if (ret!=Success) return EINA_FALSE;
 
-   fprintf(stderr, "[e_devicemgr][reattach_slave] slave (id=%d) was reattached to master (id:%d) !\n", slave_id, master_id);
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][reattach_slave] slave (id=%d) was reattached to master (id:%d) !\n", slave_id, master_id);
 
    return EINA_TRUE;
 }
@@ -1856,7 +1835,7 @@ _e_devicemgr_reattach_slave(int slave_id, int master_id)
 static void
 _e_devicemgr_show_device_list(unsigned int val)
 {
-   fprintf(stderr, "\n[e_devicemgr] - Device List = Start =====================\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "\n[e_devicemgr] - Device List = Start =====================\n");
 
    if (e_devicemgr.device_list)
      {
@@ -1867,37 +1846,37 @@ _e_devicemgr_show_device_list(unsigned int val)
           {
              if (data)
                {
-                  fprintf(stderr, "Device id : %d Name : %s\n", data->id, data->name);
+                  SLOG(LOG_DEBUG, "DEVICEMGR",  "Device id : %d Name : %s\n", data->id, data->name);
                   switch (data->type)
                     {
                        case E_DEVICEMGR_HWKEY:
-                          fprintf(stderr, " : type : H/W Key\n");
+                          SLOG(LOG_DEBUG, "DEVICEMGR",  " : type : H/W Key\n");
                           break;
 
                        case E_DEVICEMGR_KEYBOARD:
-                          fprintf(stderr, " : type : Keyboard\n");
+                          SLOG(LOG_DEBUG, "DEVICEMGR",  " : type : Keyboard\n");
                           break;
 
                        case E_DEVICEMGR_MOUSE:
-                          fprintf(stderr, " : type : Mouse\n");
+                          SLOG(LOG_DEBUG, "DEVICEMGR",  " : type : Mouse\n");
                           break;
 
                        case E_DEVICEMGR_TOUCHSCREEN:
-                          fprintf(stderr, " : type : Touchscreen\n");
+                          SLOG(LOG_DEBUG, "DEVICEMGR",  " : type : Touchscreen\n");
                           break;
 
                        default:
-                          fprintf(stderr, " : type : Unknown\n");
+                          SLOG(LOG_DEBUG, "DEVICEMGR",  " : type : Unknown\n");
                     }
                }
           }
      }
    else
      {
-        fprintf(stderr, "No input devices...\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "No input devices...\n");
      }
 
-   fprintf(stderr, "\n[e_devicemgr] - Device List = End =====================\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "\n[e_devicemgr] - Device List = End =====================\n");
 }
 
 static Eina_Bool
@@ -1911,7 +1890,7 @@ _e_devicemgr_virtual_touchpad_helper_enable(Eina_Bool is_enable)
         result = _e_devicemgr_create_master_device(E_NEW_MASTER_NAME);
         if (EINA_FALSE==result)
           {
-             fprintf(stderr, "[e_devicemgr][virtual_touchpad_helper_enable] Failed to create master device ! (name=%s)\n",
+             SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][virtual_touchpad_helper_enable] Failed to create master device ! (name=%s)\n",
                         E_NEW_MASTER_NAME);
              return EINA_FALSE;
           }
@@ -1922,7 +1901,7 @@ _e_devicemgr_virtual_touchpad_helper_enable(Eina_Bool is_enable)
         result = _e_devicemgr_remove_master_device(e_devicemgr.new_master_pointer_id);
         if (EINA_FALSE==result)
           {
-             fprintf(stderr, "[e_devicemgr][virtual_touchpad_helper_enable] Failed to remove master device ! (id=%d)\n",
+             SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][virtual_touchpad_helper_enable] Failed to remove master device ! (id=%d)\n",
                         e_devicemgr.new_master_pointer_id);
              return EINA_FALSE;
           }
@@ -1941,7 +1920,7 @@ _e_devicemgr_get_nth_zone(int index)
 
    if (e_devicemgr.num_zones < index)
      {
-        fprintf(stderr, "[e_devicemgr][get_nth_zone] %d th zone doesn't exist ! (num_zones=%d)\n",
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][get_nth_zone] %d th zone doesn't exist ! (num_zones=%d)\n",
                    index, e_devicemgr.num_zones);
         return NULL;
      }
@@ -1963,7 +1942,7 @@ _e_devicemgr_get_configuration (void)
 {
    if (!e_mod_devicemgr_config_init())
      {
-        fprintf(stderr, "[e_devicemgr][get_configuration] Failed @ e_mod_devicemgr_config_init()..!\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][get_configuration] Failed @ e_mod_devicemgr_config_init()..!\n");
         return 0;
      }
 
@@ -1998,21 +1977,21 @@ _e_devicemgr_virtual_multitouch_helper_init(int deviceid)
 
    if (i < MAX_TOUCH-1) return;
 
-   fprintf(stderr, "[e_devicemgr][virtual_multitouch_helper_init] virtual touchscreen device were attached !\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][virtual_multitouch_helper_init] virtual touchscreen device were attached !\n");
 
    e_devicemgr.mouse_in_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, (Ecore_Event_Handler_Cb)_e_devicemgr_cb_mouse_in, NULL);
    e_devicemgr.border_move_end_hook = e_border_hook_add(E_BORDER_HOOK_MOVE_END, _e_devicemgr_hook_border_move_end, NULL);
    e_devicemgr.border_resize_end_hook = e_border_hook_add(E_BORDER_HOOK_RESIZE_END, _e_devicemgr_hook_border_resize_end, NULL);
 
-   if (!e_devicemgr.mouse_in_handler) printf ("[e_devicemgr][%s] Failed to add ECORE_X_EVENT_MOUSE_IN handler\n", __FUNCTION__);
-   if (!e_devicemgr.border_move_end_hook) printf ("[e_devicemgr][%s] Failed to add E_BORDER_HOOK_MOVE_END hook\n", __FUNCTION__);
-   if (!e_devicemgr.border_resize_end_hook) printf ("[e_devicemgr][%s] Failed to add E_BORDER_HOOK_RESIZE_END hook\n", __FUNCTION__);
+   if (!e_devicemgr.mouse_in_handler) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add ECORE_X_EVENT_MOUSE_IN handler\n", __FUNCTION__);
+   if (!e_devicemgr.border_move_end_hook) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add E_BORDER_HOOK_MOVE_END hook\n", __FUNCTION__);
+   if (!e_devicemgr.border_resize_end_hook) SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][%s] Failed to add E_BORDER_HOOK_RESIZE_END hook\n", __FUNCTION__);
 }
 
 static void
 _e_devicemgr_virtual_multitouch_helper_fini(void)
 {
-   fprintf(stderr, "[e_devicemgr][virtual_multitouch_helper_init] virtual touchscreen device(s) were removed !\n");
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][virtual_multitouch_helper_init] virtual touchscreen device(s) were removed !\n");
    memset(&e_devicemgr.virtual_multitouch_id, -1, sizeof(e_devicemgr.virtual_multitouch_id));
 
    if (e_devicemgr.mouse_in_handler) ecore_event_handler_del(e_devicemgr.mouse_in_handler);
@@ -2033,7 +2012,7 @@ _e_devicemgr_update_input_transform_matrix(Eina_Bool reset)
 
    if (0 > e_devicemgr.virtual_multitouch_id[0])
      {
-        fprintf(stderr, "[e_devicemgr][update_input_transform_matrix] e_devicemgr.virtual_multitouch_id is invalid !\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][update_input_transform_matrix] e_devicemgr.virtual_multitouch_id is invalid !\n");
         return;
      }
 
@@ -2050,7 +2029,7 @@ _e_devicemgr_update_input_transform_matrix(Eina_Bool reset)
    XFlush(e_devicemgr.disp);
    XSync(e_devicemgr.disp, False);
 
-   if (reset) fprintf(stderr, "[e_devicemgr][update_input_transform_matrix] transform matrix was reset to identity_matrix !\n");
-   else fprintf(stderr, "[e_devicemgr][update_input_transform_matrix] transform matrix was updated !\n");
+   if (reset) SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][update_input_transform_matrix] transform matrix was reset to identity_matrix !\n");
+   else SLOG(LOG_DEBUG, "DEVICEMGR",  "[e_devicemgr][update_input_transform_matrix] transform matrix was updated !\n");
 }
 
index cd96498..ff36d7a 100755 (executable)
@@ -12,7 +12,7 @@
    do {                                               \
         a = ecore_x_atom_get (s);                      \
         if (!a)                                       \
-          fprintf (stderr,                             \
+          SLOG(LOG_DEBUG, "DEVICEMGR",                              \
                    "[E-devmgr] ##s creation failed.\n"); \
    } while (0)
 
@@ -225,35 +225,35 @@ _debug_possible_crtc (E_Randr_Output_Info *output_info)
         if (crtc_info == NULL)
            continue;
 
-        printf ("[DeviceMgr]: possible crtc = %d\n", crtc_info->xid);
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: possible crtc = %d\n", crtc_info->xid);
 
         EINA_LIST_FOREACH (crtc_info->outputs, t_l, t_o)
         {
-           printf ("    output : %s\n", t_o->name);
+           SLOG(LOG_DEBUG, "DEVICEMGR", "    output : %s\n", t_o->name);
         }
 
         EINA_LIST_FOREACH (crtc_info->possible_outputs, t_l, t_o)
           {
-             printf ("    possible output : %s\n", t_o->name);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    possible output : %s\n", t_o->name);
           }
 
         EINA_LIST_FOREACH (crtc_info->outputs_common_modes, t_l, t_m)
           {
              if (!t_m->name)
                 break;
-             printf ("    outputs common modes : %s\n", t_m->name);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    outputs common modes : %s\n", t_m->name);
           }
 
         if (!crtc_info->current_mode)
           {
-             printf ("    no current mode \n");
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    no current mode \n");
              crtc_xid = crtc_info->xid;
-             printf ("    crtc_id : %d\n", crtc_info->xid);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    crtc_id : %d\n", crtc_info->xid);
           }
         else
           {
-             printf ("    current set mode : %s\n", crtc_info->current_mode->name);
-             printf ("    crtc_id : %d\n", crtc_info->xid);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    current set mode : %s\n", crtc_info->current_mode->name);
+             SLOG(LOG_DEBUG, "DEVICEMGR", "    crtc_id : %d\n", crtc_info->xid);
           }
      }
 }
@@ -323,7 +323,7 @@ _scrnconf_external_set_modes (int sc_output, int num_res, int *resolutions)
    output_info = _scrnconf_external_get_output_info_from_output (sc_output);
    if (!output_info)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to find output_info from sc_output\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to find output_info from sc_output\n");
         return 0;
      }
 
@@ -333,7 +333,7 @@ _scrnconf_external_set_modes (int sc_output, int num_res, int *resolutions)
            continue;
 
 #if 0 //debug
-        printf("%s(%d): mode_info->name, %s, vrefresh, %f\n"
+        SLOG(LOG_DEBUG, "DEVICEMGR", "%s(%d): mode_info->name, %s, vrefresh, %f\n"
                 , __func__, __LINE__, mode_info->name, _cal_vrefresh(mode_info));
 #endif
         res = _get_resolution_str (mode_info->name);
@@ -362,7 +362,7 @@ _scrnconf_external_set_modes (int sc_output, int num_res, int *resolutions)
 #if 0 // debug
    for (i = 0; i < num_res; i++)
      {
-        printf ("[DeviceMgr]: res info:: (%d): %s, %f, %p\n"
+        SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: res info:: (%d): %s, %f, %p\n"
                 , i, _get_str_resolution(sc_ext_mode[i].sc_res), sc_ext_mode[i].refresh, sc_ext_mode[i].mode_info);
 
      }
@@ -386,7 +386,7 @@ _scrnconf_external_get_setting_info (int output, int resolution, Ecore_X_Randr_O
    output_info = _scrnconf_external_get_output_info_from_output (output);
    if (output_info == NULL)
      {
-       fprintf (stderr, "[DeviceMgr]: fail to get output_info from sc_output\n");
+       SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to get output_info from sc_output\n");
        goto finish;
      }
 
@@ -406,7 +406,7 @@ _scrnconf_external_get_setting_info (int output, int resolution, Ecore_X_Randr_O
 
    if (mode_info == NULL)
      {
-        fprintf (stderr, "[DeviceMgr]: fail to get mode_info from sc_output\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to get mode_info from sc_output\n");
         goto finish;
      }
 
@@ -483,18 +483,18 @@ _scrnconf_external_set_extended (int output, int resolution)
 
    ecore_x_grab ();
 
-   printf ("[DeviceMgr]: set screen resize (%d,%d)\n", resize_w, resize_h);
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: set screen resize (%d,%d)\n", resize_w, resize_h);
    if (!ecore_x_randr_screen_current_size_set (e_randr_screen_info.root, resize_w, resize_h, 0, 0))
      {
-        fprintf (stderr, "[DeviceMgr]: fail to resize the screen\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to resize the screen\n");
         goto set_fail;
      }
 
-   printf ("[DeviceMgr]: set crtc_id, %d output_id, %d mode_id, %d)!\n", crtc_xid, output_xid[0], mode_xid);
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: set crtc_id, %d output_id, %d mode_id, %d)!\n", crtc_xid, output_xid[0], mode_xid);
    if (!ecore_x_randr_crtc_settings_set (e_randr_screen_info.root, crtc_xid, output_xid, 1, output_x,
                                        output_y, mode_xid, ECORE_X_RANDR_ORIENTATION_ROT_0))
    {
-        fprintf (stderr, "[DeviceMgr]: fail to set x=%d, y=%d, w=%d, h=%d mode_id=%d, crtc_id=%d\n",
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to set x=%d, y=%d, w=%d, h=%d mode_id=%d, crtc_id=%d\n",
                  output_x, output_y, output_w, output_h, mode_xid, crtc_xid);
         goto set_fail;
    }
@@ -506,7 +506,7 @@ _scrnconf_external_set_extended (int output, int resolution)
    return 1;
 
 set_fail:
-   fprintf (stderr, "[DeviceMgr]: %s fail to set the extended mode\n", _get_str_output(output));
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: %s fail to set the extended mode\n", _get_str_output(output));
    ecore_x_ungrab ();
 
    return 0;
@@ -551,10 +551,10 @@ _scrnconf_external_set_clone (int output, int resolution)
 
    ecore_x_grab ();
 
-   printf ("[DeviceMgr]: set screen resize (%d,%d)\n", resize_w, resize_h);
+   SLOG(LOG_DEBUG, "DEVICEMGR", "[DeviceMgr]: set screen resize (%d,%d)\n", resize_w, resize_h);
    if (!ecore_x_randr_screen_current_size_set (e_randr_screen_info.root, resize_w, resize_h, 0, 0))
      {
-        fprintf (stderr, "[DeviceMgr]: fail to resize the screen\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: fail to resize the screen\n");
         goto set_fail;
      }
 
@@ -576,7 +576,7 @@ _scrnconf_external_set_clone (int output, int resolution)
    return 1;
 
 set_fail:
-   fprintf (stderr, "[DeviceMgr]: %s fail to set the clone mode\n", _get_str_output(output));
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr]: %s fail to set the clone mode\n", _get_str_output(output));
    ecore_x_ungrab ();
 
    return 0;
@@ -594,7 +594,7 @@ _dialog_extended_btn_cb (void *data, E_Dialog *g_dia)
    sc_output = _scrnconf_external_get_output (output_info);
    if (sc_output == SC_EXT_OUTPUT_NULL)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to find sc_output from output_info\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to find sc_output from output_info\n");
         goto set_fail;
      }
 
@@ -603,13 +603,13 @@ _dialog_extended_btn_cb (void *data, E_Dialog *g_dia)
    resolutions = calloc (num_res, sizeof (int));
    if (!resolutions)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to allocate resolutions\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to allocate resolutions\n");
         goto set_fail;
      }
 
    if (!_scrnconf_external_set_modes (sc_output, num_res, resolutions))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to set modes\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set modes\n");
         goto set_fail;
      }
 
@@ -617,7 +617,7 @@ _dialog_extended_btn_cb (void *data, E_Dialog *g_dia)
 
    if (!_scrnconf_external_set_extended (sc_output, sc_res))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to set modes\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set modes\n");
         goto set_fail;
      }
 
@@ -653,7 +653,7 @@ _dialog_clone_btn_cb (void *data, E_Dialog *g_dia)
    sc_output = _scrnconf_external_get_output (output_info);
    if (sc_output == SC_EXT_OUTPUT_NULL)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to find sc_output from output_info\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to find sc_output from output_info\n");
         goto set_fail;
      }
 
@@ -662,13 +662,13 @@ _dialog_clone_btn_cb (void *data, E_Dialog *g_dia)
    resolutions = calloc (num_res, sizeof (int));
    if (!resolutions)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to allocate resolutions\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to allocate resolutions\n");
         goto set_fail;
      }
 
    if (!_scrnconf_external_set_modes (sc_output, num_res, resolutions))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to set modes\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set modes\n");
         goto set_fail;
      }
 
@@ -676,7 +676,7 @@ _dialog_clone_btn_cb (void *data, E_Dialog *g_dia)
 
    if (!_scrnconf_external_set_clone (sc_output, sc_res))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to set clone\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set clone\n");
         goto set_fail;
      }
 
@@ -728,14 +728,14 @@ e_mod_scrnconf_external_dialog_new (int output)
 
    if (output == SC_EXT_OUTPUT_NULL)
      {
-        fprintf (stderr, "[DeviceMgr] : Unknown output is not supported \n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : Unknown output is not supported \n");
         return;
      }
 
    output_info = _scrnconf_external_get_output_info_from_output (output);
    if (!output_info)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to get output from xid\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to get output from xid\n");
         return;
      }
 
@@ -791,14 +791,14 @@ e_mod_scrnconf_external_get_output_from_xid (Ecore_X_Randr_Output output_xid)
    output_info = _scrnconf_external_get_output_info_from_output_xid (output_xid);
    if (!output_info)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to get output from xid\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to get output from xid\n");
         return SC_EXT_OUTPUT_NULL;
      }
 
    output = _scrnconf_external_get_output (output_info);
    if (output == SC_EXT_OUTPUT_NULL)
      {
-        fprintf (stderr, "[DeviceMgr] : Unknown output is not supported \n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : Unknown output is not supported \n");
         return SC_EXT_OUTPUT_NULL;
      }
 
@@ -816,7 +816,7 @@ e_mod_scrnconf_external_get_default_res (int sc_output, int preferred_w, int pre
 
    if (sc_output == SC_EXT_OUTPUT_NULL)
      {
-        fprintf (stderr, "[DeviceMgr] : sc_output is unknown\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : sc_output is unknown\n");
         return 0;
      }
 
@@ -825,13 +825,13 @@ e_mod_scrnconf_external_get_default_res (int sc_output, int preferred_w, int pre
    resolutions = calloc (num_res, sizeof (int));
    if (!resolutions)
      {
-        fprintf (stderr, "[DeviceMgr] : fail to allocate resolutions\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to allocate resolutions\n");
         goto get_fail;
      }
 
    if (!_scrnconf_external_set_modes (sc_output, num_res, resolutions))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to set modes\n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set modes\n");
         goto get_fail;
      }
 
@@ -870,7 +870,7 @@ e_mod_scrnconf_external_get_default_res (int sc_output, int preferred_w, int pre
    free (resolutions);
 
    if (sc_res == SC_EXT_RES_NULL)
-      fprintf (stderr, "[DeviceMgr] : default resolution is NULL\n");
+      SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : default resolution is NULL\n");
 
 
    if (sc_output == SC_EXT_OUTPUT_VIRTUAL)
@@ -950,7 +950,7 @@ e_mod_scrnconf_external_set_dispmode (int sc_output, int sc_dispmode, int sc_res
    return 1;
 
 set_fail:
-   fprintf (stderr, "[DeviceMgr] : fail to set display mode (%d)\n", sc_dispmode);
+   SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to set display mode (%d)\n", sc_dispmode);
    return 0;
 }
 
@@ -970,13 +970,13 @@ e_mod_scrnconf_external_send_current_status (void)
 
    if (!scrnconf_ext_update_get_perperty(ecore_x_display_get (), str_output, str_stat, str_res, str_dispmode))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to update get property \n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to update get property \n");
         return 0;
      }
 
    if (!scrnconf_ext_send_status (ecore_x_display_get (), sc_ext.sc_stat, sc_ext.sc_dispmode))
      {
-        fprintf (stderr, "[DeviceMgr] : fail to send current status \n");
+        SLOG(LOG_DEBUG, "DEVICEMGR",  "[DeviceMgr] : fail to send current status \n");
         return 0;
      }
 
old mode 100644 (file)
new mode 100755 (executable)
index 0f628fe..bb5334a
@@ -2,6 +2,9 @@
 #ifndef E_MOD_SCRNCONF_H
 #define E_MOD_SCRNCONF_H
 
+#define LOG_TAG        "DEVICEMGR"
+#include "dlog.h"
+
 void e_mod_scrnconf_external_init ();
 void e_mod_scrnconf_external_deinit ();
 
old mode 100644 (file)
new mode 100755 (executable)
index 4fd74c5..04319c2
@@ -3,7 +3,7 @@
 #include <X11/Xlib.h>
 #include "hib_set.h"
 
-#define HIB_CHK(cond) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __func__, #cond); return; }}
+#define HIB_CHK(cond) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); return; }}
 
 void
 hibernation_set (Display *dpy)
old mode 100644 (file)
new mode 100755 (executable)
index 0402cfc..0af5a5b
@@ -3,7 +3,7 @@
 #include <X11/Xlib.h>
 #include "virt_mon_set.h"
 
-#define VIRT_MON_CHK(cond) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __func__, #cond); return; }}
+#define VIRT_MON_CHK(cond) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); return; }}
 
 /* set the virtual monitor to connect */
 void
diff --git a/devmode-tizen/AUTHORS b/devmode-tizen/AUTHORS
new file mode 100644 (file)
index 0000000..96de2fb
--- /dev/null
@@ -0,0 +1 @@
+Seongwon Cho<seongwon1.cho@samsung.com>
diff --git a/devmode-tizen/Makefile.am b/devmode-tizen/Makefile.am
new file mode 100644 (file)
index 0000000..8b95b86
--- /dev/null
@@ -0,0 +1,20 @@
+ACLOCAL_AMFLAGS = -I m4
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
+                      config.sub configure depcomp install-sh ltmain.sh \
+                      missing module.desktop config.rpath mkinstalldirs
+
+SUBDIRS = src \
+data
+
+filesdir = $(datadir)
+files_DATA = module.desktop \
+            $(wildcard images/*.png)
+
+EXTRA_DIST = module.desktop.in
+
+clean-local:
+       rm -rf module.desktop *~
+
+uninstall:
+       rm -rf $(DESTDIR)$(datadir)
+
diff --git a/devmode-tizen/autogen.sh b/devmode-tizen/autogen.sh
new file mode 100755 (executable)
index 0000000..5a30991
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+set  -x
+aclocal
+autoconf
+libtoolize --copy --force
+autoheader
+automake --foreign --add-missing --copy
+
diff --git a/devmode-tizen/configure.ac b/devmode-tizen/configure.ac
new file mode 100644 (file)
index 0000000..7adbd3a
--- /dev/null
@@ -0,0 +1,67 @@
+dnl Process this file with autoconf to produce a configaure script.
+
+# get rid of that stupid cache mechanism
+rm -f config.cache
+
+AC_INIT([devmode-tizen], [0.1], [seongwon1.cho@samsung.com])
+AC_PREREQ(2.52)
+AC_CONFIG_SRCDIR(configure.ac)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_ISC_POSIX
+
+AM_INIT_AUTOMAKE(1.8)
+AM_CONFIG_HEADER(config.h)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_PROG_CC
+AM_PROG_CC_STDC
+AM_PROG_CC_C_O
+AC_HEADER_STDC
+AC_C_CONST
+
+define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
+define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
+AC_PROG_LIBTOOL
+
+#AM_GNU_GETTEXT([external])
+#AM_GNU_GETTEXT_VERSION(0.14)
+
+PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, ecore-x, elementary])
+AC_SUBST(ENLIGHTENMENT_CFLAGS)
+AC_SUBST(ENLIGHTENMENT_LIBS)
+
+AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
+AC_SUBST(dlopen_libs)
+
+release=$(pkg-config --variable=release enlightenment)
+MODULE_ARCH="$host_os-$host_cpu-$release"
+AC_SUBST(MODULE_ARCH)
+AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
+
+# Find edje_cc
+PKG_CHECK_MODULES(EDJE, [edje >= 1.0.0])
+AC_ARG_WITH(edje-cc,
+  AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]),
+  [
+    v=$withval;
+    EDJE_CC=$v
+  ],[
+    EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc
+  ]
+)
+AC_SUBST(EDJE_CC)
+AC_MSG_CHECKING([Which edje_cc to use])
+AC_MSG_RESULT(${EDJE_CC})
+
+datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE}
+AC_ARG_ENABLE(homedir-install,
+  AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]),
+  [ datadir="${HOME}/.e/e/modules/${PACKAGE}" ]
+)
+
+AC_CONFIG_FILES([Makefile
+                module.desktop
+                data/Makefile
+                src/Makefile])
+AC_OUTPUT
diff --git a/devmode-tizen/data/Makefile.am b/devmode-tizen/data/Makefile.am
new file mode 100644 (file)
index 0000000..39a8539
--- /dev/null
@@ -0,0 +1,21 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+EDJE_CC = @EDJE_CC@
+EDJE_FLAGS = -v \
+-id $(top_srcdir)/data/images
+
+pkgdatadir = $(datadir)
+filesdir = $(pkgdatadir)/themes
+files_DATA = \
+e_mod_devmode.edj
+
+EXTRA_DIST = \
+e_mod_devmode.edc
+
+e_mod_devmode.edj: Makefile $(EXTRA_DIST)
+       $(EDJE_CC) $(EDJE_FLAGS) \
+       $(top_srcdir)/data/e_mod_devmode.edc \
+       $(top_builddir)/data/e_mod_devmode.edj
+
+clean-local:
+       rm -f *.edj
diff --git a/devmode-tizen/data/e_mod_devmode.edc b/devmode-tizen/data/e_mod_devmode.edc
new file mode 100644 (file)
index 0000000..f8c305d
--- /dev/null
@@ -0,0 +1,288 @@
+#define COLUMN         7
+
+#define TEXT_FONT                      "Tizen:style=Roman"
+#define TEXT_SIZE                      18
+#define TEXT_COLOR_BLACK               0 0 0 255
+#define TEXT_COLOR_WHITE               255 255 255 255
+
+#define BG_COLOR_WHITE                 255 255 255 0
+#define BG_COLOR_BLACK                 0 0 0 255
+#define BG_COLOR_BLUE                  0 0 255 255
+#define BG_IMAGE_BLACK_N_WHITE "black_white_dot.png"
+
+#define ICON_SETTING                   "icon_settings.png"
+
+#define PART_INFO_COLUMN(__num, __to) \
+part { name: "info_"__num"_bg"; \
+       type: RECT; \
+       scale: 1; \
+       description { state: "default" 0.0; \
+               rel1 { relative: ((__num-1)/COLUMN) 0; to: __to; } \
+               rel2 { relative: (__num/COLUMN) 1; to: __to; } \
+               color: 200 200 200 200; \
+               visible: 1; \
+       } \
+       description { state: "red" 0.0; \
+               inherit: "default" 0.0; \
+               color: 255 7 7 200; \
+               visible: 1; \
+       } \
+} \
+part { name: "column_line_"__num; \
+       type: RECT; \
+       description { state: "default" 0.0; \
+                       rel1 { relative: 1 0; to: "info_"__num"_bg"; } \
+                       rel2 { relative: 1 1; to: "info_"__num"_bg"; } \
+                       min: 1 0; \
+                       fixed: 1 0; \
+                       align: 0.0 0.5; \
+                       color: 50 50 50 255; \
+       } \
+       description { state: "white" 0.0; \
+               inherit: "white" 0.0; \
+               color: 255 255 255 255; \
+       } \
+} \
+part { name: "info_"__num; \
+       type: TEXT; \
+       scale: 1; \
+       description { state: "default" 0.0; \
+               rel1 { relative: 0 0; to: "info_"__num"_bg"; } \
+               rel2 { relative: 1 1; to: "info_"__num"_bg"; } \
+               text { \
+                       font: TEXT_FONT; \
+                       size: TEXT_SIZE; \
+                       min: 0 1; \
+                       align: 0.0 0.5; \
+               } \
+               color: TEXT_COLOR_BLACK; \
+       } \
+       description { state: "white" 0.0; \
+               inherit: "default" 0.0; \
+               color: TEXT_COLOR_BLACK; \
+       } \
+}
+
+#define PROGRAM_INFO_BG(__num) \
+program { name: "pgm_show_info_"__num"_bg"; \
+       source: "*"; \
+       signal: "sig_show_info_"__num"_bg"; \
+       action: STATE_SET "red" 0.0; \
+       target: "info_"__num"_bg"; \
+} \
+program { name: "pgm_hide_info_"__num"_bg"; \
+       source: "*"; \
+       signal: "sig_hide_info_"__num"_bg"; \
+       action: STATE_SET "default" 0.0; \
+       target: "info_"__num"_bg"; \
+}
+
+
+collections {
+       group { name: "main_layout";
+               images {
+                       image: BG_IMAGE_BLACK_N_WHITE COMP;
+                       image: ICON_SETTING COMP;
+               }
+
+               parts {
+                       part { name: "bg";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 0 0; }
+                                       rel2 { relative: 1 1; }
+                                       color: BG_COLOR_WHITE;
+                               }
+                               description { state: "black" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: BG_COLOR_BLACK;
+                               }
+                               description { state: "blue" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: BG_COLOR_BLUE;
+                               }
+                       }
+
+                       part { name: "bg_image";
+                               type: IMAGE;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1.to: "bg";
+                                       rel2.to: "bg";
+                                       visible: 0;
+                               }
+                               description { state: "dot" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                                       image.normal: BG_IMAGE_BLACK_N_WHITE;
+                               }
+                       }
+
+                       part { name: "top_area";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1.to: "bg";
+                                       rel2 { relative: 1 0; to: "bg"; }
+                                       min: 0 30;
+                                       fixed: 0 1;
+                                       align: 0.5 0.0;
+                                       visible: 1;
+                                       color: 0 0 255 100;
+                                       visible: 0;
+                               }
+                       }
+                       
+                       part { name: "top_area_bottom_line";
+                               type: RECT;
+                               scale: 0;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 0 1; to: "top_area"; }
+                                       rel2 { relative: 1 0; to: "top_area"; }
+                                       min: 0 1;
+                                       fixed: 0 1;
+                                       align: 0.5 0.0;
+                                       color: 50 50 50 255;
+                               }
+                               description { state: "white" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 255 255 255 255;
+                               }
+                       }
+                       
+                       PART_INFO_COLUMN(1, "top_area");
+                       PART_INFO_COLUMN(2, "top_area");
+                       PART_INFO_COLUMN(3, "top_area");
+                       PART_INFO_COLUMN(4, "top_area");
+                       PART_INFO_COLUMN(5, "top_area");
+                       PART_INFO_COLUMN(6, "top_area");
+                       PART_INFO_COLUMN(7, "top_area");
+
+                       part { name: "setting_btn_bg";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1.to: "info_7_bg";
+                                       rel2.to: "info_7_bg";
+                                       color: 100 100 100 100;
+                               }
+                               description { state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 255 0 0 100;
+                               }
+                       }
+                       part { name: "setting_btn";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 0.5 0.5; to: "setting_btn_bg"; }
+                                       rel2 { relative: 0.5 0.5; to: "setting_btn_bg"; }
+                                       image.normal: ICON_SETTING;
+                                       min: 30 30;
+                                       fixed: 1 1;
+                                       align: 0.5 0.5;
+                               }
+                       }
+
+                       part { name: "swallow_back_button";
+                               type: SWALLOW;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 1 1; to: "bg"; }
+                                       rel2 { relative: 1 1; to: "bg"; }
+                                       min: 50 50;
+                                       fixed: 1 1;
+                                       align: 1.0 1.0;
+                               }
+                       }
+               }
+               
+               programs {
+                       PROGRAM_INFO_BG(1);
+                       PROGRAM_INFO_BG(2);
+                       PROGRAM_INFO_BG(3);
+                       PROGRAM_INFO_BG(4);
+                       PROGRAM_INFO_BG(5);
+                       PROGRAM_INFO_BG(6);
+                       PROGRAM_INFO_BG(7);
+
+                       program { name: "pgm_change_text_black";
+                               action: STATE_SET "default" 0.0;
+                               target: "info_1";
+                               target: "info_2";
+                               target: "info_3";
+                               target: "info_4";
+                               target: "info_5";
+                               target: "info_6";
+                               target: "info_7";
+                       }
+                       program { name: "pgm_change_text_white";
+                               action: STATE_SET "white" 0.0;
+                               target: "info_1";
+                               target: "info_2";
+                               target: "info_3";
+                               target: "info_4";
+                               target: "info_5";
+                               target: "info_6";
+                               target: "info_7";
+                       }
+
+                       program { name: "pgm_setting_btn_down";
+                               signal: "mouse,down,1";
+                               source: "setting_btn_bg";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "setting_btn_bg";
+                       }
+                       program { name: "pgm_setting_btn_up";
+                               signal: "mouse,up,1";
+                               source: "setting_btn_bg";
+                               action: STATE_SET "default" 0.0;
+                               target: "setting_btn_bg";
+                       }
+                       program { name: "pgm_setting_btn_clicked";
+                               signal: "mouse,clicked,1";
+                               source: "setting_btn_bg";
+                               action: SIGNAL_EMIT "sig_setting_btn_clicked" "edje";
+                       }
+
+                       program { name: "pgm_change_bg_white";
+                               signal: "sig_change_bg_white";
+                               source: "*";
+                               script {
+                                       set_state(PART:"bg", "default", 0.0);
+                                       set_state(PART:"bg_image", "default", 0.0);
+                                       run_program(PROGRAM:"pgm_change_text_black");
+                               }
+                       }
+                       program { name: "pgm_change_bg_black";
+                               signal: "sig_change_bg_black";
+                               source: "*";
+                               script {
+                                       set_state(PART:"bg", "black", 0.0);
+                                       set_state(PART:"bg_image", "default", 0.0);
+                                       run_program(PROGRAM:"pgm_change_text_white");
+                               }
+                       }
+                       program { name: "pgm_change_bg_blue";
+                               signal: "sig_change_bg_blue";
+                               source: "*";
+                               script {
+                                       set_state(PART:"bg", "blue", 0.0);
+                                       set_state(PART:"bg_image", "default", 0.0);
+                                       run_program(PROGRAM:"pgm_change_text_white");
+                               }
+                       }
+                       program { name: "pgm_change_dot";
+                               signal: "sig_change_bg_dot";
+                               source: "*";
+                               script {
+                                       set_state(PART:"bg", "default", 0.0);
+                                       set_state(PART:"bg_image", "dot", 0.0);
+                                       run_program(PROGRAM:"pgm_change_text_black");
+                               }
+                       }
+               }
+       }
+}
diff --git a/devmode-tizen/data/images/black_white_dot.png b/devmode-tizen/data/images/black_white_dot.png
new file mode 100644 (file)
index 0000000..9e176e5
Binary files /dev/null and b/devmode-tizen/data/images/black_white_dot.png differ
diff --git a/devmode-tizen/data/images/icon_settings.png b/devmode-tizen/data/images/icon_settings.png
new file mode 100644 (file)
index 0000000..f5969e5
Binary files /dev/null and b/devmode-tizen/data/images/icon_settings.png differ
diff --git a/devmode-tizen/images/touch_feedback.png b/devmode-tizen/images/touch_feedback.png
new file mode 100644 (file)
index 0000000..bc11c03
Binary files /dev/null and b/devmode-tizen/images/touch_feedback.png differ
diff --git a/devmode-tizen/include/e_mod_devmode.h b/devmode-tizen/include/e_mod_devmode.h
new file mode 100644 (file)
index 0000000..aebdf6a
--- /dev/null
@@ -0,0 +1,44 @@
+
+#ifndef __TSP_TRACE_TEST_H__
+#define __TSP_TRACE_TEST_H__
+
+#include <e.h>
+#include <Elementary.h>
+#include "e_mod_devmode_log.h"
+#include "e_mod_devmode_define.h"
+
+typedef enum
+{
+   COLOR_SET_WHITE = 0,
+   COLOR_SET_BLACK,
+   COLOR_SET_BLUE,
+   COLOR_SET_DOT,
+   COLOR_SET_MAX
+} color_set_e;
+
+typedef struct
+{
+   void        *module;
+   Eina_List   *cons;
+   Eina_List   *zones;
+   Evas        *canvas;
+   Evas_Object *base;
+   Evas_Object *layout_main;
+
+   Evas_Object *cross_widget;
+   Evas_Object *trace_widget;
+
+   Evas_Object *popup;
+   int          x;
+   int          y;
+   int          width;
+   int          height;
+   color_set_e  color_set;
+} TouchInfo;
+
+extern E_Module *devmode_mod;
+
+EAPI extern E_Module_Api e_modapi;
+
+#endif /* __TSP_TRACE_TEST_H__ */
+
diff --git a/devmode-tizen/include/e_mod_devmode_define.h b/devmode-tizen/include/e_mod_devmode_define.h
new file mode 100644 (file)
index 0000000..5fc3145
--- /dev/null
@@ -0,0 +1,44 @@
+
+#ifndef __TSP_DEFINE_H__
+#define __TSP_DEFINE_H__
+
+#define EDJ_PATH PREFIX "/res/edje"
+#define EDJ_NAME EDJ_PATH "/"PROJECT_NAME ".edj"
+
+/* Macros */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if 0
+#define _EDJ(x)                     elm_layout_edje_get(x)
+#else
+#define _EDJ(x)                     (x)
+#endif
+#define SAFE_FREE(ptr)              if (ptr) {free(ptr); ptr = NULL; }
+
+#define tsp_ecore_timer_del(timer)  do { \
+       if (timer) {                      \
+            ecore_timer_del(timer);      \
+            timer = NULL;                \
+         }                               \
+  } while (0)
+
+#define tsp_ecore_idler_del(idler)  do { \
+       if (idler) {                      \
+            ecore_idler_del(idler);      \
+            idler = NULL;                \
+         }                               \
+  } while (0)
+
+#define tsp_evas_object_del(object) do { \
+       if (object) {                     \
+            evas_object_del(object);     \
+            object = NULL;               \
+         }                               \
+  } while (0)
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TSP_DEFINE_H__ */
+
diff --git a/devmode-tizen/include/e_mod_devmode_log.h b/devmode-tizen/include/e_mod_devmode_log.h
new file mode 100644 (file)
index 0000000..1fcb636
--- /dev/null
@@ -0,0 +1,105 @@
+
+#ifndef __TSP_LOG_H__
+#define __TSP_LOG_H__
+
+#include <stdio.h>
+#include <dlog.h>
+#include <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG           "devmode"
+#define TSP_DEBUG_MODE    1
+
+/* anci c color type */
+#define FONT_COLOR_RESET  "\033[0m"
+#define FONT_COLOR_RED    "\033[31m"
+#define FONT_COLOR_GREEN  "\033[32m"
+#define FONT_COLOR_YELLOW "\033[33m"
+#define FONT_COLOR_BLUE   "\033[34m"
+#define FONT_COLOR_PURPLE "\033[35m"
+#define FONT_COLOR_CYAN   "\033[36m"
+#define FONT_COLOR_GRAY   "\033[37m"
+
+#define PRINT_FUNC_LINE
+#if TSP_DEBUG_MODE
+#ifdef PRINT_FUNC_LINE
+#define TSP_DEBUG(fmt, args ...) LOGD("[%s : <%05d>] " fmt, __func__, __LINE__, ##args)
+#define TSP_WARN(fmt, args ...)  LOGW(FONT_COLOR_YELLOW "[%s : <%05d>] " fmt FONT_COLOR_RESET, __func__, __LINE__, ##args)
+#define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[%s : <%05d>] ####" fmt "####"FONT_COLOR_RESET, __func__, __LINE__, ##args)
+#define TSP_FUNC_ENTER()         LOGD(FONT_COLOR_BLUE "[%s : <%05d>] <<<< enter!!"FONT_COLOR_RESET, __func__, __LINE__)
+#define TSP_FUNC_LEAVE()         LOGD(FONT_COLOR_BLUE "[%s : <%05d>] >>>> leave!!"FONT_COLOR_RESET, __func__, __LINE__)
+#else
+#define TSP_DEBUG(fmt, args ...) LOGD("[AT] " fmt "\n", ##args)
+#define TSP_WARN(fmt, args ...)  LOGW(FONT_COLOR_YELLOW "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
+#define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
+#define TSP_FUNC_ENTER()         LOGD(FONT_COLOR_BLUE "*********************** [Func: %s] enter!! ********************* \n"FONT_COLOR_RESET, __func__)
+#define TSP_FUNC_LEAVE()         LOGD(FONT_COLOR_BLUE "*********************** [Func: %s] leave!! ********************* \n"FONT_COLOR_RESET, __func__)
+#endif
+#else
+#ifdef TSP_DEBUG
+        #undef TSP_DEBUG
+#endif
+#define TSP_DEBUG(fmt, args ...)
+#ifdef TSP_WARN
+        #undef TSP_WARN
+#endif
+#define TSP_WARN(fmt, args ...)
+#ifdef TSP_FUNC_ENTER
+        #undef TSP_FUNC_ENTER
+#endif
+#define TSP_FUNC_ENTER(fmt, args ...)
+#ifdef TSP_FUNC_LEAVE
+        #undef TSP_FUNC_LEAVE
+#endif
+#define TSP_FUNC_LEAVE(fmt, args ...)
+#ifdef PRINT_FUNC_LINE
+#define TSP_ERROR(fmt, args ...)               LOGE(FONT_COLOR_RED "[%s : <%05d>] ####" fmt "####"FONT_COLOR_RESET, __func__, __LINE__, ##args)
+#else
+#define TSP_ERROR(fmt, args ...)               LOGE(FONT_COLOR_RED "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
+#endif
+#endif
+
+#define TSP_RET_IF(expr)                       do { \
+       if (expr) {                                  \
+            TSP_ERROR("[%s] Return", #expr);        \
+            return;                                 \
+         }                                          \
+  } while (0)
+
+#define TSP_RETV_IF(expr, val)                 do { \
+       if (expr) {                                  \
+            TSP_ERROR("[%s] Return value", #expr);  \
+            return (val);                           \
+         }                                          \
+  } while (0)
+#define TSP_RETM_IF(expr, fmt, args ...)       do {               \
+       if (expr) {                                                \
+            TSP_ERROR("[%s] Return, message "fmt, #expr, ##args); \
+            return;                                               \
+         }                                                        \
+  } while (0)
+#define TSP_RETVM_IF(expr, val, fmt, args ...) do {                     \
+       if (expr) {                                                      \
+            TSP_ERROR("[%s] Return value, message "fmt, #expr, ##args); \
+            return (val);                                               \
+         }                                                              \
+  } while (0)
+
+#define TSP_CHECK(expr)                        TSP_RETM_IF(!(expr), "Invalid param")
+#define TSP_CHECK_NULL(expr)                   TSP_RETVM_IF(!(expr), NULL, "Invalid param")
+#define TSP_CHECK_FALSE(expr)                  TSP_RETVM_IF(!(expr), false, "Invalid param")
+#define TSP_CHECK_VAL(expr, val)               TSP_RETVM_IF(!(expr), val, "Invalid param")
+
+#define TSP_ASSERT(expr)                       do {                                                  \
+       if (!(expr)) {                                                                                \
+            TSP_ERROR("CRITICAL ERROR ########################################## CHECK BELOW ITEM"); \
+            assert(false);                                                                           \
+         }                                                                                           \
+  } while (0)
+
+#endif /* __TSP_LOG_H__ */
+
diff --git a/devmode-tizen/module.desktop.in b/devmode-tizen/module.desktop.in
new file mode 100644 (file)
index 0000000..c0d4a32
--- /dev/null
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Type=Link
+Name=Devmode
+Icon=e-module-devmode
+X-Enlightenment-ModuleType=system
+Comment=
diff --git a/devmode-tizen/src/Makefile.am b/devmode-tizen/src/Makefile.am
new file mode 100644 (file)
index 0000000..a5fe0a6
--- /dev/null
@@ -0,0 +1,38 @@
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = devmode-tizen
+
+# data files for the module
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)
+
+EXTRA_DIST = $(files_DATA)
+
+# the module .so file
+INCLUDES               = -I. \
+                         -I$(top_srcdir) \
+                         -I$(top_srcdir)/include \
+                         -I$(top_srcdir)/src \
+                        @ENLIGHTENMENT_CFLAGS@
+
+pkgdir                 = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
+pkg_LTLIBRARIES        = module.la
+module_la_SOURCES      = e_mod_main.c \
+                         e_mod_main.h \
+                         e_mod_config.c \
+                         e_mod_config.h \
+                         e_mod_devmode_main.c \
+                         e_mod_devmode_main.h \
+                         e_mod_devmode_color.c \
+                         e_mod_devmode_color.h \
+                         e_mod_devmode_event.c \
+                         e_mod_devmode_event.h \
+                         e_mod_devmode_trace_widget.c \
+                         e_mod_devmode_trace_widget.h \
+                         e_mod_devmode_cross_widget.c \
+                         e_mod_devmode_cross_widget.h
+
+module_la_LIBADD       = @ENLIGHTENMENT_LIBS@ @dlopen_libs@
+module_la_LDFLAGS      = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
+
+uninstall:
+       rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
diff --git a/devmode-tizen/src/e_mod_config.c b/devmode-tizen/src/e_mod_config.c
new file mode 100644 (file)
index 0000000..6e77cac
--- /dev/null
@@ -0,0 +1,37 @@
+#include "e_mod_devmode.h"
+#include "e_mod_config.h"
+
+EAPI void
+e_mod_devmode_cfdata_edd_init(E_Config_DD **conf_edd)
+{
+   *conf_edd = E_CONFIG_DD_NEW("Devmode_Config", Config);
+#undef T
+#undef D
+#define T Config
+#define D *conf_edd
+   E_CONFIG_VAL(D, T, drawing_option, INT);
+}
+
+EAPI Config *
+e_mod_devmode_cfdata_config_new(void)
+{
+   Config *cfg;
+
+   cfg = E_NEW(Config, 1);
+
+   cfg->drawing_option = DRAW_ALL;
+
+   return cfg;
+}
+
+EAPI void
+e_mod_devmode_cfdata_config_free(Config *cfg)
+{
+   if (cfg)
+     {
+        memset(cfg, 0, sizeof(Config));
+        free(cfg);
+        cfg = NULL;
+     }
+}
+
diff --git a/devmode-tizen/src/e_mod_config.h b/devmode-tizen/src/e_mod_config.h
new file mode 100644 (file)
index 0000000..fd29486
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef E_MOD_CONFIG_H
+#define E_MOD_CONFIG_H
+
+#include "e_mod_devmode.h"
+
+typedef enum _drawing_option
+{
+   DRAW_ALL,
+} drawing_option;
+
+typedef struct _Config Config;
+
+struct _Config
+{
+   int drawing_option;
+};
+
+EAPI void    e_mod_devmode_cfdata_edd_init(E_Config_DD **conf_edd);
+EAPI Config *e_mod_devmode_cfdata_config_new(void);
+EAPI void    e_mod_devmode_cfdata_config_free(Config *cfg);
+
+#endif
diff --git a/devmode-tizen/src/e_mod_devmode_color.c b/devmode-tizen/src/e_mod_devmode_color.c
new file mode 100644 (file)
index 0000000..810ecfa
--- /dev/null
@@ -0,0 +1,58 @@
+#include "e_mod_devmode.h"
+#include "e_mod_devmode_color.h"
+
+void
+tsp_color_get_trace_color(color_set_e color_set, color_t *normal, color_t *last)
+{
+   TSP_CHECK(normal);
+   TSP_CHECK(last);
+
+   switch (color_set)
+     {
+      case COLOR_SET_BLACK:
+      case COLOR_SET_BLUE:
+        /* WHITE */
+        normal->r = 0xff;
+        normal->g = 0xff;
+        normal->b = 0xff;
+        break;
+
+      default:
+        /* BLUE */
+        normal->r = 0;
+        normal->g = 96;
+        normal->b = 0xff;
+     }
+   normal->a = 0xff;
+
+   /* end = RED */
+   last->r = 0xff;
+   last->g = 0;
+   last->b = 0;
+   last->a = 0xff;
+}
+
+void
+tsp_color_get_cross_color(color_set_e color_set, color_t *color)
+{
+   TSP_CHECK(color);
+
+   switch (color_set)
+     {
+      case COLOR_SET_BLACK:
+      case COLOR_SET_BLUE:
+        /* Yellow */
+        color->r = 0xff;
+        color->g = 0xe4;
+        color->b = 0x0;
+        break;
+
+      default:
+        /* BLUE */
+        color->r = 0;
+        color->g = 0;
+        color->b = 0xff;
+     }
+   color->a = 0xff;
+}
+
diff --git a/devmode-tizen/src/e_mod_devmode_color.h b/devmode-tizen/src/e_mod_devmode_color.h
new file mode 100644 (file)
index 0000000..0dbf904
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __TSP_COLOR_H__
+#define __TSP_COLOR_H__
+
+#include "e_mod_devmode.h"
+
+typedef struct
+{
+   unsigned char r;
+   unsigned char g;
+   unsigned char b;
+   unsigned char a;
+} color_t;
+
+void tsp_color_get_trace_color(color_set_e color_set, color_t *normal, color_t *last);
+void tsp_color_get_cross_color(color_set_e color_set, color_t *color);
+
+#endif /* __TSP_COLOR_H__ */
+
diff --git a/devmode-tizen/src/e_mod_devmode_cross_widget.c b/devmode-tizen/src/e_mod_devmode_cross_widget.c
new file mode 100644 (file)
index 0000000..9ffce6a
--- /dev/null
@@ -0,0 +1,299 @@
+#include <Evas.h>
+#include "e_mod_devmode_cross_widget.h"
+#include "e_mod_devmode_log.h"
+#include "e_mod_devmode_define.h"
+#include "e_mod_devmode_color.h"
+
+typedef struct
+{
+   int          id;
+   Evas_Coord   x;
+   Evas_Coord   y;
+   Evas_Object *h_line;
+   Evas_Object *v_line;
+} cross_info_s;
+
+typedef struct
+{
+   Evas_Object *obj;
+   struct
+   {
+      Evas_Coord x;
+      Evas_Coord y;
+      Evas_Coord w;
+      Evas_Coord h;
+   } geometry;
+
+   color_t      color;
+
+   Eina_List   *cross_list;
+} cross_widget_smart_data_s;
+
+static void
+__tsp_cross_widget_smart_add(Evas_Object *obj)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = calloc(1, sizeof(cross_widget_smart_data_s));
+   TSP_CHECK(sd);
+   evas_object_smart_data_set(obj, sd);
+
+   sd->obj = obj;
+   tsp_color_get_cross_color(0, &sd->color);
+}
+
+static void
+__tsp_cross_widget_smart_del(Evas_Object *obj)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   if (sd->cross_list)
+     {
+        Eina_List *l = NULL;
+        cross_info_s *data = NULL;
+        EINA_LIST_FOREACH (sd->cross_list, l, data)
+          {
+             tsp_evas_object_del(data->h_line);
+             tsp_evas_object_del(data->v_line);
+             free(data);
+          }
+        eina_list_free(sd->cross_list);
+        sd->cross_list = NULL;
+     }
+
+   free(sd);
+}
+
+static void
+__tsp_cross_widget_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   sd->geometry.x = x;
+   sd->geometry.y = y;
+
+   evas_object_smart_changed(obj);
+}
+
+static void
+__tsp_cross_widget_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   sd->geometry.w = w;
+   sd->geometry.h = h;
+
+   evas_object_smart_changed(obj);
+}
+
+static void
+__tsp_cross_widget_smart_show(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->cross_list);
+
+   Eina_List *l = NULL;
+   cross_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->cross_list, l, data)
+     {
+        if (data->h_line)
+          evas_object_show(data->h_line);
+        if (data->v_line)
+          evas_object_show(data->v_line);
+     }
+}
+
+static void
+__tsp_cross_widget_smart_hide(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->cross_list);
+
+   Eina_List *l = NULL;
+   cross_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->cross_list, l, data)
+     {
+        if (data->h_line)
+          evas_object_hide(data->h_line);
+        if (data->v_line)
+          evas_object_hide(data->v_line);
+     }
+}
+
+static void
+__tsp_cross_widget_smart_calculate(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->cross_list);
+
+   Eina_List *l = NULL;
+   cross_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->cross_list, l, data)
+     {
+        tsp_cross_widget_move_cross(obj, data->id, data->x, data->y);
+     }
+}
+
+Evas_Object *
+tsp_cross_widget_add(Evas_Object *parent)
+{
+   TSP_CHECK_NULL(parent);
+   Evas_Object *obj = NULL;
+   static Evas_Smart_Class sc;
+   static Evas_Smart *smart = NULL;
+   if (!smart)
+     {
+        memset(&sc, 0x0, sizeof(Evas_Smart_Class));
+        sc.name = "tsp_cross_widget";
+        sc.version = EVAS_SMART_CLASS_VERSION;
+        sc.add = __tsp_cross_widget_smart_add;
+        sc.del = __tsp_cross_widget_smart_del;
+        sc.move = __tsp_cross_widget_smart_move;
+        sc.resize = __tsp_cross_widget_smart_resize;
+        sc.show = __tsp_cross_widget_smart_show;
+        sc.hide = __tsp_cross_widget_smart_hide;
+        sc.calculate = __tsp_cross_widget_smart_calculate;
+        if (!(smart = evas_smart_class_new(&sc))) return NULL;
+     }
+
+   obj = evas_object_smart_add(evas_object_evas_get(parent), smart);
+
+   return obj;
+}
+
+static cross_info_s *
+_tsp_cross_widget_find_cross(Eina_List *list, int idx)
+{
+   TSP_CHECK_NULL(list);
+
+   Eina_List *l = NULL;
+   cross_info_s *data = NULL;
+   EINA_LIST_FOREACH (list, l, data)
+     {
+        if (data->id == idx)
+          return data;
+     }
+
+   return NULL;
+}
+
+void
+tsp_cross_widget_append_cross(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   if (_tsp_cross_widget_find_cross(sd->cross_list, idx))
+     {
+        TSP_WARN("alret_infoy exist cross [%d]", idx);
+        return;
+     }
+
+   cross_info_s *cross = calloc(1, sizeof(cross_info_s));
+   TSP_ASSERT(cross);
+
+   TSP_DEBUG("append at [%d, %d]", x, y);
+
+   cross->id = idx;
+   cross->h_line = evas_object_line_add(evas_object_evas_get(obj));
+   evas_object_color_set(cross->h_line, sd->color.r, sd->color.g, sd->color.b, sd->color.a);
+   evas_object_smart_member_add(cross->h_line, obj);
+
+   cross->v_line = evas_object_line_add(evas_object_evas_get(obj));
+   evas_object_color_set(cross->v_line, sd->color.r, sd->color.g, sd->color.b, sd->color.a);
+   evas_object_smart_member_add(cross->v_line, obj);
+   evas_object_show(cross->v_line);
+
+   sd->cross_list = eina_list_append(sd->cross_list, cross);
+   tsp_cross_widget_move_cross(obj, idx, x, y);
+
+   evas_object_show(cross->h_line);
+}
+
+void
+tsp_cross_widget_move_cross(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->cross_list);
+
+   cross_info_s *cross = _tsp_cross_widget_find_cross(sd->cross_list, idx);
+   if (!cross)
+     {
+        tsp_cross_widget_append_cross(obj, idx, x, y);
+        return;
+     }
+
+   TSP_CHECK(cross->h_line);
+   TSP_CHECK(cross->v_line);
+
+   Evas_Coord sx = sd->geometry.x;
+   Evas_Coord sy = sd->geometry.y;
+   Evas_Coord ex = sd->geometry.x + sd->geometry.w;
+   Evas_Coord ey = sd->geometry.y + sd->geometry.h;
+
+   evas_object_line_xy_set(cross->h_line, sx, y, ex, y);
+   evas_object_line_xy_set(cross->v_line, x, sy, x, ey);
+
+   cross->x = x;
+   cross->y = y;
+}
+
+void
+tsp_cross_widget_remove_cross(Evas_Object *obj, int idx)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->cross_list);
+
+   cross_info_s *cross = _tsp_cross_widget_find_cross(sd->cross_list, idx);
+   TSP_CHECK(cross);
+
+   tsp_evas_object_del(cross->v_line);
+   tsp_evas_object_del(cross->h_line);
+
+   sd->cross_list = eina_list_remove(sd->cross_list, cross);
+   SAFE_FREE(cross);
+}
+
+void
+tsp_cross_widget_change_color_set(Evas_Object *obj, color_set_e color_set)
+{
+   TSP_CHECK(obj);
+   cross_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   tsp_color_get_cross_color(color_set, &sd->color);
+
+   if (sd->cross_list)
+     {
+        Eina_List *l = NULL;
+        cross_info_s *cross = NULL;
+        EINA_LIST_FOREACH (sd->cross_list, l, cross) {
+             if (cross)
+               {
+                  if (cross->h_line)
+                    evas_object_color_set(cross->h_line, sd->color.r, sd->color.g, sd->color.b, sd->color.a);
+                  if (cross->v_line)
+                    evas_object_color_set(cross->v_line, sd->color.r, sd->color.g, sd->color.b, sd->color.a);
+               }
+          }
+     }
+}
+
diff --git a/devmode-tizen/src/e_mod_devmode_cross_widget.h b/devmode-tizen/src/e_mod_devmode_cross_widget.h
new file mode 100644 (file)
index 0000000..f730352
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __TSP_CROSS_WIDGET_H__
+#define __TSP_CROSS_WIDGET_H__
+
+#include <Elementary.h>
+#include "e_mod_devmode_color.h"
+
+Evas_Object *tsp_cross_widget_add(Evas_Object *parent);
+void         tsp_cross_widget_append_cross(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y);
+void         tsp_cross_widget_move_cross(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y);
+void         tsp_cross_widget_remove_cross(Evas_Object *obj, int idx);
+void         tsp_cross_widget_change_color_set(Evas_Object *obj, color_set_e color_set);
+
+#endif /* __TSP_CROSS_WIDGET_H__ */
+
diff --git a/devmode-tizen/src/e_mod_devmode_event.c b/devmode-tizen/src/e_mod_devmode_event.c
new file mode 100644 (file)
index 0000000..02daa27
--- /dev/null
@@ -0,0 +1,419 @@
+#include <Ecore.h>
+#include <Ecore_Input.h>
+#include "Ecore_X.h"
+#include "e_mod_devmode_event.h"
+#include "e_mod_devmode.h"
+#include "e_mod_devmode_main.h"
+#include <string.h>
+
+typedef struct
+{
+   void                *user_data;
+
+   Ecore_Event_Handler *handler[TSP_EVENT_NUM];
+   Eina_List           *pressed_mouse_list;
+
+   int                  xi_opcode;
+   int                  xi_event;
+   int                  xi_error;
+   int                 *slots;
+   int                  n_slots;
+   unsigned int         device_num;
+   unsigned int        *button_pressed;
+   unsigned int        *button_moved;
+   tsp_mouse_info_s    *last_raw;
+} tsp_event_mgr_s;
+
+static tsp_event_mgr_s g_event_mgr;
+
+#if 0
+static int xi_opcode = -1;
+static int xi_event = -1;
+static int xi_error = -1;
+static int *slots = NULL;
+static int n_slots = 0;
+static unsigned int g_device_num = 0;
+static unsigned int *button_pressed = NULL;
+static unsigned int *button_moved = NULL;
+static tsp_mouse_info_s *last_raw = NULL;
+#endif
+
+static int
+get_finger_index(int deviceid)
+{
+   int i;
+   for (i = 0; i < g_event_mgr.n_slots; i++)
+     {
+        if (g_event_mgr.slots[i] == deviceid)
+          return i;
+     }
+
+   return -1;
+}
+
+static const char *
+type_to_name(int evtype)
+{
+   const char *name;
+
+   switch (evtype)
+     {
+      case XI_RawKeyPress:
+        name = "RawKeyPress";
+        break;
+
+      case XI_RawKeyRelease:
+        name = "RawKeyRelease";
+        break;
+
+      case XI_RawButtonPress:
+        name = "RawButtonPress";
+        break;
+
+      case XI_RawButtonRelease:
+        name = "RawButtonRelease";
+        break;
+
+      case XI_RawMotion:
+        name = "RawMotion";
+        break;
+
+      case XI_RawTouchBegin:
+        name = "RawTouchBegin";
+        break;
+
+      case XI_RawTouchUpdate:
+        name = "RawTouchUpdate";
+        break;
+
+      case XI_RawTouchEnd:
+        name = "RawTouchEnd";
+        break;
+
+      default:
+        name = "unknown event type";
+        break;
+     }
+
+   return name;
+}
+
+static void
+get_rawdata_from_event(XIRawEvent *event, int *x, int *y, int *deviceid, int *pressure)
+{
+   int i;
+   double *val, *raw_val;
+
+   if (!event)
+     {
+        TSP_DEBUG("[devmode-tizen] event is NIL");
+        return;
+     }
+
+   val = event->valuators.values;
+   raw_val = event->raw_values;
+
+   if (!val || !raw_val)
+     {
+        TSP_DEBUG("[devmode-tizen] [%s] : %d, val : %p, raw_val : %p", __FUNCTION__, __LINE__, val, raw_val);
+        return;
+     }
+
+   for (i = 0; (i < event->valuators.mask_len * 8) && (i < 2); i++)
+     {
+        if (event->valuators.mask)
+          {
+             if (XIMaskIsSet(event->valuators.mask, i))
+               {
+                  *deviceid = get_finger_index(event->deviceid);
+                  if (i == 0)
+                    {
+                       *x = (int)(*(val + i));
+                    }
+                  else if (i == 1)
+                    {
+                       *y = (int)(*(val + i));
+                    }
+               }
+             else
+               *deviceid = get_finger_index(event->deviceid);
+          }
+     }
+}
+
+static Eina_Bool
+tsp_event_mgr_event_mouse_generic_handler(void *data, int type, void *event_info)
+{
+   Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)event_info;
+   int x = -1, y = -1, deviceid = -1, pressure = 1;
+   tsp_mouse_info_s info;
+   XIRawEvent *raw = NULL;
+   XGenericEventCookie *cookie = NULL;
+
+   TSP_FUNC_ENTER();
+
+   if ((!e) || (e->extension != g_event_mgr.xi_opcode))
+     return ECORE_CALLBACK_PASS_ON;
+
+   TSP_DEBUG("[devmode-tizen] x generic event's evtype : %d, XI_RawButtonPress : %d, XI_RawButtonRelease : %d, XI_RawMotion : %d", e->evtype, XI_RawButtonPress, XI_RawButtonRelease, XI_RawMotion);
+
+   if (e->evtype != XI_RawButtonPress && e->evtype != XI_RawButtonRelease && e->evtype != XI_RawMotion)
+     return ECORE_CALLBACK_PASS_ON;
+
+   raw = (XIRawEvent *)e->data;
+   cookie = (XGenericEventCookie *)e->cookie;
+
+   if (!raw || !cookie)
+     return ECORE_CALLBACK_PASS_ON;
+
+   if ((raw->deviceid == VIRTUAL_CORE_POINTER) || (raw->deviceid == VCP_XTEST_POINTER))
+     return ECORE_CALLBACK_PASS_ON;
+
+   get_rawdata_from_event(raw, &x, &y, &deviceid, &pressure);
+   if (deviceid == -1)
+     return ECORE_CALLBACK_PASS_ON;
+
+   TSP_DEBUG("[devmode-tizen] x : %d, y : %d, deviceid : %d, preesure : %d", x, y, deviceid, pressure);
+
+   if (e->evtype == XI_RawMotion)
+     {
+        memset(&info, 0, sizeof(tsp_mouse_info_s));
+        info.device = deviceid;
+        info.timestamp = ecore_loop_time_get() * 1000.0;
+        info.x = x;
+        info.y = y;
+        info.pressure = pressure;
+        memcpy(&(g_event_mgr.last_raw[info.device]), &info, sizeof(tsp_mouse_info_s));
+     }
+
+   switch (e->evtype)
+     {
+      case XI_RawButtonPress: /*XI_RawButtonPress*/
+        if ((g_event_mgr.button_pressed[deviceid] == 0) && &(g_event_mgr.last_raw[deviceid]))
+          {
+             tsp_main_view_mouse_down(g_event_mgr.user_data, &(g_event_mgr.last_raw[deviceid]));
+             g_event_mgr.button_pressed[deviceid] = 1;
+          }
+        break;
+
+      case XI_RawButtonRelease: /*XI_RawButtonRelease*/
+        if ((g_event_mgr.button_pressed[deviceid] == 1) && &(g_event_mgr.last_raw[deviceid]))
+          {
+             tsp_main_view_mouse_up(g_event_mgr.user_data, &(g_event_mgr.last_raw[deviceid]));
+             g_event_mgr.button_pressed[deviceid] = 0;
+          }
+        break;
+
+      case XI_RawMotion: /*XI_RawMotion*/
+        if (g_event_mgr.button_pressed[deviceid] == 1)
+          {
+             tsp_main_view_mouse_move(g_event_mgr.user_data, &info);
+          }
+
+        break;
+
+      case XI_RawTouchBegin:
+        break;
+
+      case XI_RawTouchUpdate:
+        break;
+
+      case XI_RawTouchEnd:
+        break;
+     }
+
+   return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+tsp_event_mgr_devmode_init(void *data)
+{
+   XIEventMask *mask = NULL;
+   int num_mask = 0;
+   int rc;
+   Ecore_X_Display *d = NULL;
+
+   TSP_FUNC_ENTER();
+
+   d = ecore_x_display_get();
+   if (!d)
+     {
+        TSP_ERROR("[devmode-tizen] Failed to open display !");
+        return EINA_FALSE;
+     }
+
+   if (!XQueryExtension(d, "XInputExtension", &g_event_mgr.xi_opcode, &g_event_mgr.xi_event, &g_event_mgr.xi_error))
+     {
+        TSP_ERROR("[devmode-tizen] No XInput extension is available.");
+        return EINA_FALSE;
+     }
+
+   Ecore_X_Window xroot = ecore_x_window_root_first_get();
+
+   mask = XIGetSelectedEvents(d, xroot, &num_mask);
+
+   if (mask)
+     {
+        XISetMask(mask->mask, XI_RawButtonPress);
+        XISetMask(mask->mask, XI_RawButtonRelease);
+        XISetMask(mask->mask, XI_RawMotion);
+#if 0
+        XISetMask(mask->mask, XI_RawTouchBegin);
+        XISetMask(mask->mask, XI_RawTouchUpdate);
+        XISetMask(mask->mask, XI_RawTouchEnd);
+#endif
+
+        rc = XISelectEvents(d, xroot, mask, 1);
+        if (Success != rc)
+          {
+             TSP_ERROR("[devmode-tizen] Failed to select XInput extension events !");
+             return EINA_FALSE;
+          }
+     }
+   else
+     {
+        mask = calloc(1, sizeof(XIEventMask));
+        if (!mask)
+          {
+             TSP_ERROR("[devmode-tizen] [%s]:[%d] Failed to allocate memory !", __FUNCTION__, __LINE__);
+             return EINA_FALSE;
+          }
+
+        mask->deviceid = XIAllDevices;
+        mask->mask_len = XIMaskLen(XI_LASTEVENT);
+        mask->mask = calloc(mask->mask_len, sizeof(char));
+        if (!mask->mask)
+          {
+             TSP_ERROR("[devmode-tizen] [%s][%d] Failed to allocate memory !", __FUNCTION__, __LINE__);
+             return EINA_FALSE;
+          }
+
+        XISetMask(mask->mask, XI_RawButtonPress);
+        XISetMask(mask->mask, XI_RawButtonRelease);
+        XISetMask(mask->mask, XI_RawMotion);
+        XISetMask(mask->mask, XI_RawTouchBegin);
+        XISetMask(mask->mask, XI_RawTouchUpdate);
+        XISetMask(mask->mask, XI_RawTouchEnd);
+
+        rc = XISelectEvents(d, xroot, mask, 1);
+        if (Success != rc)
+          {
+             if (mask->mask) free(mask->mask);
+             if (mask) free(mask);
+             TSP_ERROR("[devmode-tizen] Failed to select XInput extension events !");
+             return EINA_FALSE;
+          }
+
+        if (mask->mask) free(mask->mask);
+        if (mask) free(mask);
+     }
+
+   return EINA_TRUE;
+}
+
+static int
+tsp_event_mgr_devmode_get_multi_touch_info()
+{
+   Ecore_X_Display *d = NULL;
+   int i, idx = 0;
+   int ndevices = 0;
+   XIDeviceInfo *dev, *info = NULL;
+
+   TSP_FUNC_ENTER();
+
+   d = ecore_x_display_get();
+   if (!d) return -1;
+
+   if (g_event_mgr.xi_opcode < 0 ) return 0;
+
+   info = XIQueryDevice(d, XIAllDevices, &ndevices);
+
+   if (!info)
+     {
+        TSP_ERROR("[devmode-tizen] There is no queried XI device.");
+        return 0;
+     }
+
+   for ( i = 0; i < ndevices; i++ )
+     {
+        dev = &info[i];
+
+        if ((XISlavePointer == dev->use) || (XIFloatingSlave == dev->use))
+          {
+             //skip XTEST Pointer and non-touch device(s)
+             if ( strcasestr(dev->name, "XTEST") || !strcasestr(dev->name, "touch"))
+               continue;
+             idx++;
+          }
+     }
+
+   g_event_mgr.slots = malloc(idx * sizeof(int));
+   if (!g_event_mgr.slots)
+     {
+        TSP_ERROR("[devmode-tizen] The slot of event mgr is 0.");
+        if (info) free(info);
+        return 0;
+     }
+
+   idx = 0;
+   for ( i = 0; i < ndevices; i++ )
+     {
+        dev = &info[i];
+
+        if ((XISlavePointer == dev->use) || (XIFloatingSlave == dev->use))
+          {
+             //skip XTEST Pointer and non-touch device(s)
+             if ( strcasestr(dev->name, "XTEST") || !strcasestr(dev->name, "touch"))
+               continue;
+
+             g_event_mgr.slots[idx] = dev->deviceid;
+             idx++;
+          }
+     }
+
+   XIFreeDeviceInfo(info);
+
+   g_event_mgr.n_slots = idx;
+   return idx;
+}
+
+void
+tsp_event_mgr_init(void *user_data)
+{
+   TSP_FUNC_ENTER();
+
+   memset(&g_event_mgr, 0x0, sizeof(tsp_event_mgr_s));
+
+   g_event_mgr.user_data = user_data;
+
+   if (tsp_event_mgr_devmode_init(user_data) != EINA_TRUE)
+     TSP_ERROR("[devmode-tizen] [%s] : %d, failed to event manager init", __FUNCTION__, __FUNCTION__);
+
+   g_event_mgr.device_num = tsp_event_mgr_devmode_get_multi_touch_info();
+   g_event_mgr.button_pressed = (unsigned int *)calloc(1, sizeof(unsigned int) * g_event_mgr.device_num);
+   g_event_mgr.button_moved = (unsigned int *)calloc(1, sizeof(unsigned int) * g_event_mgr.device_num);
+   g_event_mgr.last_raw = (tsp_mouse_info_s *)calloc(1, sizeof(tsp_mouse_info_s) * g_event_mgr.device_num);
+
+   g_event_mgr.handler[TSP_EVENT_MOUSE_GENERIC] = ecore_event_handler_add(ECORE_X_EVENT_GENERIC, tsp_event_mgr_event_mouse_generic_handler, NULL);
+}
+
+void
+tsp_event_mgr_deinit(void)
+{
+   TSP_FUNC_ENTER();
+
+   int i = 0;
+   for (; i < TSP_EVENT_NUM; i++) {
+        if (g_event_mgr.handler[i])
+          {
+             ecore_event_handler_del(g_event_mgr.handler[i]);
+             g_event_mgr.handler[i] = NULL;
+          }
+     }
+   free(g_event_mgr.button_pressed);
+   free(g_event_mgr.button_moved);
+   free(g_event_mgr.last_raw);
+
+   memset(&g_event_mgr, 0x0, sizeof(tsp_event_mgr_s));
+}
+
diff --git a/devmode-tizen/src/e_mod_devmode_event.h b/devmode-tizen/src/e_mod_devmode_event.h
new file mode 100644 (file)
index 0000000..9f91c6a
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __TSP_EVENT_H__
+#define __TSP_EVENT_H__
+
+#include <X11/Xlib.h>
+#include <X11/Xos.h>
+#include <X11/Xatom.h>
+#include <X11/extensions/XInput.h>
+#include <X11/extensions/XInput2.h>
+//#include <X11/Xutil.h>
+
+typedef enum
+{
+   TSP_EVENT_MOUSE_DOWN,
+   TSP_EVENT_MOUSE_MOVE,
+   TSP_EVENT_MOUSE_UP,
+   TSP_EVENT_MOUSE_ANY,
+   TSP_EVENT_MOUSE_GENERIC,
+   TSP_EVENT_NUM,
+} tsp_event_type_e;
+
+#define VIRTUAL_CORE_POINTER  2
+#define VIRTUAL_CORE_KEYBOARD 3
+#define VCP_XTEST_POINTER     4
+#define VCP_XTEST_KEYBOARD    5
+
+void tsp_event_mgr_init(void *user_data);
+void tsp_event_mgr_deinit(void);
+
+#endif /* __TSP_EVENT_H__ */
\ No newline at end of file
diff --git a/devmode-tizen/src/e_mod_devmode_main.c b/devmode-tizen/src/e_mod_devmode_main.c
new file mode 100644 (file)
index 0000000..b5018f1
--- /dev/null
@@ -0,0 +1,417 @@
+#include "e_mod_devmode.h"
+#include "e_mod_devmode_main.h"
+#include "e_mod_devmode_trace_widget.h"
+#include "e_mod_devmode_cross_widget.h"
+
+#define MOVING_NOTI_MIN (30)
+
+static int g_input_max = 0;
+static char *g_bg_list_text[COLOR_SET_MAX] = {
+   "White",
+   "Black",
+   "Blue",
+   "One pixel dot",
+};
+
+#if 0
+static void
+__tsp_main_view_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   elm_exit();
+}
+
+static void
+__tsp_main_view_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   TouchInfo *t_info = data;
+   TSP_CHECK(t_info);
+
+   tsp_evas_object_del(t_info->popup);
+}
+
+static char *
+__tsp_main_view_popup_gl_text_get(void *data, Evas_Object *obj, const char *part)
+{
+   int index = (int)data;
+
+   if (index >= COLOR_SET_MAX)
+     {
+        TSP_ERROR("Invaid index.. [%d]", index);
+        return NULL;
+     }
+
+   return g_strdup(g_bg_list_text[index]);
+}
+
+void
+__tsp_main_view_change_color_set(TouchInfo *t_info, color_set_e color_set)
+{
+   TSP_CHECK(t_info);
+
+   if (t_info->trace_widget)
+     tsp_trace_widget_clear_all_trace(t_info->trace_widget);
+
+   if (t_info->color_set == color_set)
+     {
+        TSP_WARN("don't need to change color set [%d]", color_set);
+        return;
+     }
+
+   t_info->color_set = color_set;
+
+   /* change bg & text of edc */
+   const char *signal = NULL;
+   switch (color_set)
+     {
+      case COLOR_SET_BLACK:
+        signal = "sig_change_bg_black";
+        break;
+
+      case COLOR_SET_BLUE:
+        signal = "sig_change_bg_blue";
+        break;
+
+      case COLOR_SET_DOT:
+        signal = "sig_change_bg_dot";
+        break;
+
+      default:
+        signal = "sig_change_bg_white";
+        break;
+     }
+   edje_object_signal_emit(_EDJ(t_info->layout_main), signal, "c_source");
+
+   if (t_info->trace_widget)
+     tsp_trace_widget_change_color_set(t_info->trace_widget, color_set);
+   if (t_info->cross_widget)
+     tsp_cross_widget_change_color_set(t_info->cross_widget, color_set);
+}
+
+static void
+__tsp_main_view_popup_gl_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   TouchInfo *t_info = data;
+   TSP_CHECK(t_info);
+
+   Elm_Object_Item *gl_item = event_info;
+   int index = (int)elm_object_item_data_get(gl_item);
+
+   TSP_WARN("BG color set = [%d]", index);
+
+   tsp_evas_object_del(t_info->popup);
+   __tsp_main_view_change_color_set(t_info, index);
+}
+
+static void
+__tsp_main_view_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   TouchInfo *t_info = data;
+   TSP_CHECK(t_info);
+
+   t_info->popup = NULL;
+}
+
+static void
+__tsp_main_view_bg_selector_show(TouchInfo *t_info)
+{
+   TSP_CHECK(t_info);
+
+   Evas_Object *popup = elm_popup_add(t_info->base);
+   TSP_CHECK(popup);
+   t_info->popup = popup;
+
+   evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __tsp_main_view_popup_del_cb, t_info);
+
+   elm_object_style_set(popup, "min_menustyle");
+   elm_object_part_text_set(popup, "title,text", "Select BG");
+   evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+   Evas_Object *btn = elm_button_add(popup);
+   elm_object_text_set(btn, "Cancel");
+   elm_object_part_content_set(popup, "button1", btn);
+   evas_object_smart_callback_add(btn, "clicked", __tsp_main_view_popup_response_cb, t_info);
+
+   Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
+   itc->item_style = "1text";
+   itc->func.text_get = __tsp_main_view_popup_gl_text_get;
+   itc->func.content_get = NULL;
+   itc->func.state_get = NULL;
+   itc->func.del = NULL;
+
+   Evas_Object *box = elm_box_t_add(popup);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+   Evas_Object *genlist = elm_genlist_add(box);
+   evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   int index;
+   Elm_Object_Item *item;
+   for (index = 0; index < COLOR_SET_MAX; index++) {
+        item = elm_genlist_item_append(genlist, itc, (void *)index, NULL, ELM_GENLIST_ITEM_NONE, __tsp_main_view_popup_gl_sel_cb, t_info);
+     }
+
+   elm_box_pack_end(box, genlist);
+   evas_object_show(genlist);
+
+   /* The height of popup being t_infojusted by application here based on app requirement */
+   double scale = elm_config_scale_get();
+   evas_object_size_hint_min_set(box, 600 * scale, 440 * scale);
+   elm_object_content_set(popup, box);
+   evas_object_show(popup);
+}
+
+static void
+__tsp_main_view_setting_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+   TSP_FUNC_ENTER();
+   TouchInfo *t_info = data;
+   TSP_CHECK(t_info);
+
+   __tsp_main_view_bg_selector_show(t_info);
+}
+
+#endif
+
+void
+tsp_main_view_create(TouchInfo *t_info)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(t_info);
+
+   t_info->color_set = 0;
+
+   t_info->trace_widget = tsp_trace_widget_add(t_info->base);
+
+   evas_object_move(t_info->trace_widget, 0, 0);
+   evas_object_resize(t_info->trace_widget, t_info->width, t_info->height);
+   evas_object_show(t_info->trace_widget);
+
+   t_info->cross_widget = tsp_cross_widget_add(t_info->base);
+
+   evas_object_move(t_info->cross_widget, 0, 0);
+   evas_object_resize(t_info->cross_widget, t_info->width, t_info->height);
+   evas_object_show(t_info->cross_widget);
+
+#if 0
+   Evas_Object *back_btn = tsp_widget_button_t_infod(t_info->layout_main, NULL, "exit", NULL, __tsp_main_view_back_btn_clicked_cb, NULL);
+   elm_object_part_content_set(t_info->layout_main, "swallow_back_button", back_btn);
+   edje_object_signal_callback_t_infod(_EDJ(t_info->layout_main), "sig_setting_btn_clicked", "*", __tsp_main_view_setting_clicked_cb, t_info);
+#endif
+}
+
+void
+tsp_main_view_destroy(TouchInfo *t_info)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(t_info);
+
+   tsp_evas_object_del(t_info->trace_widget);
+   tsp_evas_object_del(t_info->cross_widget);
+   tsp_evas_object_del(t_info->layout_main);
+}
+
+static void
+__tsp_main_view_update_mouse_count_info(TouchInfo *t_info)
+{
+   TSP_CHECK(t_info);
+   TSP_CHECK(t_info->layout_main);
+
+#if 0
+   char *text = g_strdup_printf("P: %d / %d", tsp_trace_widget_get_active_count(t_info->trace_widget), g_input_max);
+   edje_object_part_text_set(t_info->layout_main, "info_1", text);
+   SAFE_FREE(text);
+#else
+   Eina_Stringshare *text = eina_stringshare_printf("P: %d / %d", tsp_trace_widget_get_active_count(t_info->trace_widget), g_input_max);
+   if(!text) return;
+   edje_object_part_text_set(t_info->layout_main, "info_1", text);
+   eina_stringshare_del(text);
+#endif
+}
+
+static void
+__tsp_main_view_update_moving_info(TouchInfo *t_info, tsp_mouse_info_s *info)
+{
+   TSP_CHECK(t_info);
+   TSP_CHECK(t_info->layout_main);
+
+   static tsp_mouse_info_s prev_info = { 0, };
+
+#if 0
+   char *text = g_strdup_printf("X: %d", info->x);
+   edje_object_part_text_set(t_info->layout_main, "info_2", text);
+   SAFE_FREE(text);
+
+   text = g_strdup_printf("Y: %d", info->y);
+   edje_object_part_text_set(t_info->layout_main, "info_3", text);
+   SAFE_FREE(text);
+#else
+   Eina_Stringshare *text = eina_stringshare_printf("X: %d", info->x);
+   if(!text) return;
+   edje_object_part_text_set(t_info->layout_main, "info_2", text);
+   eina_stringshare_del(text);
+
+   Eina_Stringshare *text1 = eina_stringshare_printf("Y: %d", info->y);
+   if(!text1) return;
+   edje_object_part_text_set(t_info->layout_main, "info_3", text1);
+   eina_stringshare_del(text1);
+#endif
+
+   unsigned int t = info->timestamp - prev_info.timestamp;
+   if (prev_info.timestamp && t)
+     {
+        int dx = info->x - prev_info.x;
+        int dy = info->y - prev_info.y;
+
+        if (dx != 0 || dy != 0)
+          {
+#if 0
+             text = g_strdup_printf("Xv: %.3f", (double)dx / t);
+             edje_object_part_text_set(t_info->layout_main, "info_4", text);
+             SAFE_FREE(text);
+
+             text = g_strdup_printf("Yv: %.3f", (double)dy / t);
+             edje_object_part_text_set(t_info->layout_main, "info_5", text);
+             SAFE_FREE(text);
+#else
+             Eina_Stringshare *text2 = eina_stringshare_printf("Xv: %.3f", (double)dx / t);
+             if(!text2) return;
+             edje_object_part_text_set(t_info->layout_main, "info_4", text2);
+             eina_stringshare_del(text2);
+
+             Eina_Stringshare *text3 = eina_stringshare_printf("Xy: %.3f", (double)dy / t);
+             if(!text3) return;
+             edje_object_part_text_set(t_info->layout_main, "info_5", text3);
+             eina_stringshare_del(text3);
+#endif
+          }
+     }
+
+#if 0
+   text = g_strdup_printf("Prs: %.1f", info->pressure);
+   edje_object_part_text_set(t_info->layout_main, "info_6", text);
+   SAFE_FREE(text);
+#else
+   Eina_Stringshare *text4 = eina_stringshare_printf("Prs: %.1f", info->pressure);
+   if(!text4) return;
+   edje_object_part_text_set(t_info->layout_main, "info_6", text4);
+   eina_stringshare_del(text4);
+#endif
+
+   memcpy(&prev_info, info, sizeof(tsp_mouse_info_s));
+}
+
+static void
+__tsp_main_view_update_mouse_up_info(TouchInfo *t_info, int device, int sx, int sy, int ex, int ey)
+{
+   TSP_CHECK(t_info);
+
+   int dx = ex - sx;
+   int dy = ey - sy;
+
+#if 0
+   char *text = g_strdup_printf("dX: %d", dx);
+   edje_object_part_text_set(t_info->layout_main, "info_2", text);
+   SAFE_FREE(text);
+#else
+   Eina_Stringshare *text = eina_stringshare_printf("dX: %d", dx);
+   if(!text) return;
+   edje_object_part_text_set(t_info->layout_main, "info_2", text);
+   eina_stringshare_del(text);
+#endif
+   if (abs(dx) > MOVING_NOTI_MIN)
+     edje_object_signal_emit(_EDJ(t_info->layout_main), "sig_show_info_2_bg", "c_source");
+
+#if 0
+   text = g_strdup_printf("dY: %d", dy);
+   edje_object_part_text_set(t_info->layout_main, "info_3", text);
+   SAFE_FREE(text);
+#else
+   Eina_Stringshare *text2 = eina_stringshare_printf("dY: %d", dy);
+   if(!text2) return;
+   edje_object_part_text_set(t_info->layout_main, "info_3", text2);
+   eina_stringshare_del(text2);
+#endif
+   if (abs(dy) > MOVING_NOTI_MIN)
+     edje_object_signal_emit(_EDJ(t_info->layout_main), "sig_show_info_3_bg", "c_source");
+}
+
+void
+tsp_main_view_mouse_down(TouchInfo *t_info, tsp_mouse_info_s *info)
+{
+   TSP_CHECK(t_info);
+   if (t_info->popup)
+     return;
+
+   edje_object_signal_emit(_EDJ(t_info->layout_main), "sig_hide_info_2_bg", "c_source");
+   edje_object_signal_emit(_EDJ(t_info->layout_main), "sig_hide_info_3_bg", "c_source");
+
+   int active = 0;
+   if (t_info->trace_widget)
+     {
+        active = tsp_trace_widget_get_active_count(t_info->trace_widget);
+        if ( active <= 0)
+          {
+             tsp_trace_widget_clear_all_trace(t_info->trace_widget);
+             g_input_max = 0;
+          }
+
+        tsp_trace_widget_start_trace(t_info->trace_widget, info->device, info->x, info->y);
+     }
+
+   if (t_info->cross_widget)
+     tsp_cross_widget_append_cross(t_info->cross_widget, info->device, info->x, info->y);
+
+   active++;
+   if (active > g_input_max)
+     g_input_max++;
+   __tsp_main_view_update_mouse_count_info(t_info);
+
+   __tsp_main_view_update_moving_info(t_info, info);
+}
+
+void
+tsp_main_view_mouse_up(TouchInfo *t_info, tsp_mouse_info_s *info)
+{
+   TSP_CHECK(t_info);
+   if (t_info->popup)
+     return;
+
+   int sx = 0;
+   int sy = 0;
+   int active = 0;
+
+   if (t_info->trace_widget)
+     {
+        tsp_trace_widget_get_start_point(t_info->trace_widget, info->device, &sx, &sy);
+        //tsp_trace_widget_append_point(t_info->trace_widget, info->device, info->x, info->y);
+        tsp_trace_widget_end_trace(t_info->trace_widget, info->device);
+
+        active = tsp_trace_widget_get_active_count(t_info->trace_widget);
+     }
+
+   if (t_info->cross_widget)
+     tsp_cross_widget_remove_cross(t_info->cross_widget, info->device);
+
+   __tsp_main_view_update_mouse_count_info(t_info);
+
+   if (active == 0)
+     __tsp_main_view_update_mouse_up_info(t_info, info->device, sx, sy, info->x, info->y);
+}
+
+void
+tsp_main_view_mouse_move(TouchInfo *t_info, tsp_mouse_info_s *info)
+{
+   TSP_CHECK(t_info);
+   if (t_info->popup)
+     return;
+
+   if (t_info->trace_widget)
+     tsp_trace_widget_append_point(t_info->trace_widget, info->device, info->x, info->y);
+
+   if (t_info->cross_widget)
+     tsp_cross_widget_move_cross(t_info->cross_widget, info->device, info->x, info->y);
+
+   __tsp_main_view_update_moving_info(t_info, info);
+}
+
diff --git a/devmode-tizen/src/e_mod_devmode_main.h b/devmode-tizen/src/e_mod_devmode_main.h
new file mode 100644 (file)
index 0000000..30469da
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __TSP_MAIN_VIEW_H__
+#define __TSP_MAIN_VIEW_H__
+
+#include "e_mod_devmode.h"
+
+typedef struct
+{
+   int          device;
+   unsigned int timestamp;
+
+   int          x;
+   int          y;
+
+   double       pressure;
+} tsp_mouse_info_s;
+
+void tsp_main_view_create(TouchInfo *t_info);
+void tsp_main_view_destroy(TouchInfo *t_info);
+void tsp_main_view_mouse_down(TouchInfo *t_info, tsp_mouse_info_s *info);
+void tsp_main_view_mouse_up(TouchInfo *t_info, tsp_mouse_info_s *info);
+void tsp_main_view_mouse_move(TouchInfo *t_info, tsp_mouse_info_s *info);
+
+#endif /* __TSP_MAIN_VIEW_H__ */
+
diff --git a/devmode-tizen/src/e_mod_devmode_trace_widget.c b/devmode-tizen/src/e_mod_devmode_trace_widget.c
new file mode 100644 (file)
index 0000000..ef99a92
--- /dev/null
@@ -0,0 +1,454 @@
+#include "e_mod_devmode_trace_widget.h"
+#include "e_mod_devmode_log.h"
+#include "e_mod_devmode_log.h"
+#include "e_mod_devmode_color.h"
+
+typedef struct
+{
+   int          id;
+
+   Evas_Point   start_point;
+   Eina_List   *line_list;
+   Eina_List   *point_list;
+   Evas_Object *touch_feedback;
+} trace_info_s;
+
+typedef struct
+{
+   Evas_Object *obj;
+   struct
+   {
+      Evas_Coord x;
+      Evas_Coord y;
+      Evas_Coord w;
+      Evas_Coord h;
+   } geometry;
+
+   color_t      normal_color;
+   color_t      last_color;
+
+   Eina_List   *trace_list;
+} trace_widget_smart_data_s;
+
+static void
+__tsp_trace_widget_smart_add(Evas_Object *obj)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = calloc(1, sizeof(trace_widget_smart_data_s));
+   TSP_CHECK(sd);
+   evas_object_smart_data_set(obj, sd);
+
+   sd->obj = obj;
+
+   tsp_color_get_trace_color(0, &sd->normal_color, &sd->last_color);
+}
+
+static void
+__tsp_trace_widget_smart_del(Evas_Object *obj)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   tsp_trace_widget_clear_all_trace(obj);
+
+   free(sd);
+}
+
+static void
+__tsp_trace_widget_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   sd->geometry.x = x;
+   sd->geometry.y = y;
+
+   evas_object_smart_changed(obj);
+}
+
+static void
+__tsp_trace_widget_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   sd->geometry.w = w;
+   sd->geometry.h = h;
+
+   evas_object_smart_changed(obj);
+}
+
+static void
+__tsp_trace_widget_smart_show(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->trace_list);
+
+   Eina_List *l = NULL;
+   trace_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->trace_list, l, data) {
+        if (data)
+          {
+             Eina_List *ll = NULL;
+             Evas_Object *line = NULL;
+             EINA_LIST_FOREACH (data->line_list, ll, line) {
+                  if (line)
+                    evas_object_show(line);
+               }
+#if 1
+             Eina_List *pl = NULL;
+             Evas_Object *point = NULL;
+             EINA_LIST_FOREACH (data->point_list, pl, point) {
+                  if (point)
+                    evas_object_show(point);
+               }
+#endif
+          }
+     }
+}
+
+static void
+__tsp_trace_widget_smart_hide(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->trace_list);
+
+   Eina_List *l = NULL;
+   trace_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->trace_list, l, data) {
+        if (data)
+          {
+             Eina_List *ll = NULL;
+             Evas_Object *line = NULL;
+             EINA_LIST_FOREACH (data->line_list, ll, line) {
+                  if (line)
+                    evas_object_hide(line);
+               }
+#if 1
+             Eina_List *pl = NULL;
+             Evas_Object *point = NULL;
+             EINA_LIST_FOREACH (data->point_list, pl, point) {
+                  if (point)
+                    evas_object_hide(point);
+               }
+#endif
+          }
+     }
+}
+
+static void
+__tsp_trace_widget_smart_calculate(Evas_Object *obj)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+}
+
+static trace_info_s *
+_tsp_trace_widget_find_trace(Eina_List *list, int idx)
+{
+   TSP_CHECK_NULL(list);
+
+   Eina_List *l = NULL;
+   trace_info_s *data = NULL;
+   EINA_LIST_FOREACH (list, l, data)
+     {
+        if (data->id == idx)
+          return data;
+     }
+
+   return NULL;
+}
+
+Evas_Object *
+tsp_trace_widget_add(Evas_Object *parent)
+{
+   TSP_CHECK_NULL(parent);
+   Evas_Object *obj = NULL;
+   static Evas_Smart_Class sc;
+   static Evas_Smart *smart = NULL;
+   if (!smart)
+     {
+        memset(&sc, 0x0, sizeof(Evas_Smart_Class));
+        sc.name = "tsp_trace_widget";
+        sc.version = EVAS_SMART_CLASS_VERSION;
+        sc.add = __tsp_trace_widget_smart_add;
+        sc.del = __tsp_trace_widget_smart_del;
+        sc.move = __tsp_trace_widget_smart_move;
+        sc.resize = __tsp_trace_widget_smart_resize;
+        sc.show = __tsp_trace_widget_smart_show;
+        sc.hide = __tsp_trace_widget_smart_hide;
+        sc.calculate = __tsp_trace_widget_smart_calculate;
+        if (!(smart = evas_smart_class_new(&sc))) return NULL;
+     }
+
+   obj = evas_object_smart_add(evas_object_evas_get(parent), smart);
+
+   return obj;
+}
+
+void
+tsp_trace_widget_start_trace(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y)
+{
+   Evas_Load_Error err;
+
+   char icon_path[PATH_MAX];
+   sprintf(icon_path, "%s/%s", e_module_dir_get(devmode_mod), TOUCH_ICON);
+
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   if (_tsp_trace_widget_find_trace(sd->trace_list, idx))
+     {
+        TSP_WARN("[devmode-tizen] already exist trace [%d]", idx);
+        return;
+     }
+
+   trace_info_s *trace = calloc(1, sizeof(trace_info_s));
+   TSP_ASSERT(trace);
+
+   TSP_DEBUG("[devmode-tizen] append at [%d, %d]", x, y);
+
+   trace->id = idx;
+   trace->start_point.x = x;
+   trace->start_point.y = y;
+
+   Evas *e = evas_object_evas_get(obj);
+   TSP_ASSERT(e);
+
+#if 1
+   if (trace->touch_feedback == NULL)
+     {
+        trace->touch_feedback = evas_object_image_add(e);
+        evas_object_image_file_set(trace->touch_feedback, icon_path, NULL);
+        err = evas_object_image_load_error_get(trace->touch_feedback);
+        if (err != EVAS_LOAD_ERROR_NONE)
+          TSP_ERROR("[devmode-tizen] Failed to load image [%s]", icon_path);
+     }
+   else
+     TSP_ERROR("[devmode-tizen] trace->touch feedback should be NULL here");
+#endif
+
+   sd->trace_list = eina_list_append(sd->trace_list, trace);
+}
+
+void
+tsp_trace_widget_append_point(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   trace_info_s *trace = _tsp_trace_widget_find_trace(sd->trace_list, idx);
+   TSP_CHECK(trace);
+
+   Evas_Point start_point = trace->start_point;
+
+   Eina_List *last_list = eina_list_last(trace->line_list);
+   if (last_list)
+     {
+        Evas_Object *line = eina_list_data_get(last_list);
+        if (line)
+          {
+             evas_object_line_xy_get(line, NULL, NULL, &start_point.x, &start_point.y);
+          }
+     }
+
+   if (start_point.x == x && start_point.y == y)
+     {
+        return;
+     }
+
+   Evas_Object *line = evas_object_line_add(evas_object_evas_get(obj));
+   evas_object_render_op_set(line, EVAS_RENDER_COPY);
+   evas_object_line_xy_set(line, start_point.x, start_point.y, x, y);
+   evas_object_color_set(line, sd->normal_color.r, sd->normal_color.g, sd->normal_color.b, sd->normal_color.a);
+   evas_object_smart_member_add(line, obj);
+   trace->line_list = eina_list_append(trace->line_list, line);
+   evas_object_show(line);
+
+#if 1
+   Evas_Object *point = evas_object_rectangle_add(evas_object_evas_get(obj));
+   evas_object_render_op_set(point, EVAS_RENDER_COPY);
+   evas_object_resize(point, 2, 2);
+   evas_object_move(point, x - 1, y - 1);
+   evas_object_color_set(point, 0x00, 0x00, 0x00, 0xFF);
+   evas_object_smart_member_add(point, obj);
+   trace->point_list = eina_list_append(trace->point_list, point);
+   evas_object_show(point);
+#endif
+#if 1
+   if (trace->touch_feedback)
+     {
+        evas_object_move(trace->touch_feedback, x - 23, y - 23);
+        evas_object_image_fill_set(trace->touch_feedback, 0, 0, 46, 46);
+        evas_object_resize(trace->touch_feedback, 46, 46);
+        evas_object_show(trace->touch_feedback);
+     }
+#endif
+}
+
+static void
+__tsp_trace_widget_destroy_trace(trace_info_s *trace)
+{
+   TSP_CHECK(trace);
+
+   Eina_List *l = NULL;
+   Evas_Object *data = NULL;
+   EINA_LIST_FOREACH (trace->line_list, l, data)
+     {
+        tsp_evas_object_del(data);
+     }
+   eina_list_free(trace->line_list);
+
+#if 1
+   EINA_LIST_FOREACH (trace->point_list, l, data)
+     {
+        tsp_evas_object_del(data);
+     }
+   eina_list_free(trace->point_list);
+#endif
+
+   free(trace);
+}
+
+void
+tsp_trace_widget_end_trace(Evas_Object *obj, int idx)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   trace_info_s *trace = _tsp_trace_widget_find_trace(sd->trace_list, idx);
+   TSP_CHECK(trace);
+
+   Eina_List *last_node = eina_list_last(trace->line_list);
+   if (last_node)
+     {
+        Evas_Object *last_line = eina_list_data_get(last_node);
+        if (last_line)
+          {
+             evas_object_color_set(last_line, sd->last_color.r, sd->last_color.g, sd->last_color.b, sd->last_color.a);
+          }
+     }
+
+#if 1
+   if (trace->touch_feedback)
+     {
+        evas_object_del(trace->touch_feedback);
+        trace->touch_feedback = NULL;
+     }
+
+#endif
+
+   trace->id = -1;      // can not draw anymore
+}
+
+void
+tsp_trace_widget_clear_all_trace(Evas_Object *obj)
+{
+   TSP_FUNC_ENTER();
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+   TSP_CHECK(sd->trace_list);
+
+   Eina_List *l = NULL;
+   trace_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->trace_list, l, data)
+     {
+        __tsp_trace_widget_destroy_trace(data);
+     }
+
+   eina_list_free(sd->trace_list);
+   sd->trace_list = NULL;
+}
+
+int
+tsp_trace_widget_get_total_count(Evas_Object *obj)
+{
+   TSP_CHECK_VAL(obj, 0);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK_VAL(sd, 0);
+   TSP_CHECK_VAL(sd->trace_list, 0);
+
+   return eina_list_count(sd->trace_list);
+}
+
+int
+tsp_trace_widget_get_active_count(Evas_Object *obj)
+{
+   TSP_CHECK_VAL(obj, 0);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK_VAL(sd, 0);
+   TSP_CHECK_VAL(sd->trace_list, 0);
+
+   int count = 0;
+
+   Eina_List *l = NULL;
+   trace_info_s *data = NULL;
+   EINA_LIST_FOREACH (sd->trace_list, l, data)
+     {
+        if (data->id >= 0)
+          count++;
+     }
+
+   return count;
+}
+
+bool
+tsp_trace_widget_get_start_point(Evas_Object *obj, int idx, int *x, int *y)
+{
+   TSP_CHECK_FALSE(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK_FALSE(sd);
+   TSP_CHECK_FALSE(sd->trace_list);
+
+   trace_info_s *trace = _tsp_trace_widget_find_trace(sd->trace_list, idx);
+   TSP_CHECK_FALSE(trace);
+
+   *x = trace->start_point.x;
+   *y = trace->start_point.y;
+
+   return true;
+}
+
+void
+tsp_trace_widget_change_color_set(Evas_Object *obj, color_set_e color_set)
+{
+   TSP_CHECK(obj);
+   trace_widget_smart_data_s *sd = evas_object_smart_data_get(obj);
+   TSP_CHECK(sd);
+
+   tsp_color_get_trace_color(color_set, &sd->normal_color, &sd->last_color);
+
+   if (sd->trace_list)
+     {
+        Eina_List *l = NULL;
+        trace_info_s *trace = NULL;
+        EINA_LIST_FOREACH (sd->trace_list, l, trace) {
+             if (trace)
+               {
+                  Eina_List *line_list = NULL;
+                  Evas_Object *line = NULL;
+                  EINA_LIST_FOREACH (trace->line_list, line_list, line) {
+                       if (eina_list_last(trace->line_list) == line_list)
+                         evas_object_color_set(line, sd->last_color.r, sd->last_color.g, sd->last_color.b, sd->last_color.a);
+                       else
+                         evas_object_color_set(line, sd->normal_color.r, sd->normal_color.g, sd->normal_color.b, sd->normal_color.a);
+                    }
+               }
+          }
+     }
+}
+
diff --git a/devmode-tizen/src/e_mod_devmode_trace_widget.h b/devmode-tizen/src/e_mod_devmode_trace_widget.h
new file mode 100644 (file)
index 0000000..ac838b6
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef __TSP_TRACE_WIDGET_H__
+#define __TSP_TRACE_WIDGET_H__
+
+#include <Elementary.h>
+#include <stdbool.h>
+#include "e_mod_devmode.h"
+
+#ifndef TOUCH_ICON
+#define TOUCH_ICON "touch_feedback.png"
+#endif
+
+Evas_Object *tsp_trace_widget_add(Evas_Object *parent);
+void         tsp_trace_widget_start_trace(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y);
+void         tsp_trace_widget_append_point(Evas_Object *obj, int idx, Evas_Coord x, Evas_Coord y);
+void         tsp_trace_widget_end_trace(Evas_Object *obj, int idx);
+void         tsp_trace_widget_clear_all_trace(Evas_Object *obj);
+int          tsp_trace_widget_get_total_count(Evas_Object *obj);
+int          tsp_trace_widget_get_active_count(Evas_Object *obj);
+bool         tsp_trace_widget_get_start_point(Evas_Object *obj, int idx, int *x, int *y);
+void         tsp_trace_widget_change_color_set(Evas_Object *obj, color_set_e color_set);
+
+#endif /* __TSP_TRACE_WIDGET_H__ */
+
diff --git a/devmode-tizen/src/e_mod_main.c b/devmode-tizen/src/e_mod_main.c
new file mode 100644 (file)
index 0000000..482e604
--- /dev/null
@@ -0,0 +1,355 @@
+/**
+ * @addtogroup Optional_Look
+ * @{
+ *
+ * @defgroup Module_Shot TouchInfo
+ *
+ * Get touch information
+ *
+ * @}
+ */
+#include <e.h>
+#include <Ecore_X.h>
+#include <Elementary.h>
+#include <Eina.h>
+#include <Evas.h>
+#include <Edje.h>
+#include <e_manager.h>
+#include <e_config.h>
+
+#include "e_mod_devmode.h"
+#include "e_mod_devmode_main.h"
+#include "e_mod_devmode_event.h"
+#include "e_mod_main.h"
+#include "e_mod_config.h"
+
+#define USE_E_COMP 1
+
+const char *MODULE_NAME = "devmode-tizen";
+EAPI E_Module * devmode_mod = NULL;
+
+EAPI E_Module_Api e_modapi =
+{
+   E_MODULE_API_VERSION,
+   "Devmode"
+};
+
+static Evas_Object *
+__tsp_main_layout_add(Evas_Object *parent)
+{
+   TSP_CHECK_NULL(parent);
+   char edje_path[PATH_MAX];
+   sprintf(edje_path, "%s/themes/e_mod_devmode.edj", e_module_dir_get(devmode_mod));
+
+   Evas_Object *layout = edje_object_add(evas_object_evas_get(parent));
+   TSP_CHECK_NULL(layout);
+   edje_object_file_set(layout, edje_path, "main_layout");
+
+   return layout;
+}
+
+static Eina_Bool
+_tsp_main_init(TouchInfo *t_info)
+{
+   /*
+    * FIXME : Create evas object from canvas
+    */
+   Eina_List *managers, *l, *l2, *l3;
+
+   managers = e_manager_list();
+   for (l = managers; l; l = l->next)
+     {
+        E_Manager *man;
+
+        man = l->data;
+
+        for (l2 = man->containers; l2; l2 = l2->next)
+          {
+             E_Container *con = NULL;
+             con = l2->data;
+             t_info->cons = eina_list_append(t_info->cons, con);
+#if USE_E_CON
+             t_info->canvas = con->bg_evas;
+#elif USE_E_WIN
+             if (con) t_info->win = e_win_new(con);
+             if (t_info->win)
+               {
+                  e_win_move_resize(t_info->win, con->x, con->y, con->w, con->h);
+                  e_win_title_set(t_info->win, "devmode tsp test window");
+                  e_win_layer_set(t_info->win, 450);
+                  e_win_show(t_info->win);
+                  ecore_evas_alpha_set(t_info->win->ecore_evas, EINA_TRUE);
+                  t_info->canvas = t_info->win->evas;
+                  ecore_x_window_shape_rectangle_set(t_info->win->evas_win, 0, 0, 1, 1);
+               }
+#elif USE_E_COMP
+             if (con->zones)
+               {
+                  for (l3 = con->zones; l3; l3 = l3->next)
+                    {
+                       E_Zone *zone;
+                       zone = l3->data;
+                       if (zone)
+                         {
+                            t_info->zones = eina_list_append(t_info->zones, zone);
+
+                            /*Always enable comp module*/
+                            e_manager_comp_composite_mode_set(man, zone, EINA_TRUE);
+                            /*
+                             * TODO
+                             * While release e_manager_comp_composite_mode_set(, , FALSE)
+                             * use list of t_info->zones with EINA_LIST_FOR_EACH
+                             */
+                            /*
+                             * I just worry about if there are many zones, which zone shold be selected???
+                             */
+                            t_info->x = zone->x;
+                            t_info->y = zone->y;
+                            t_info->width = zone->w;
+                            t_info->height = zone->h;
+                         }
+                       else
+                         {
+                            t_info->x = 0;
+                            t_info->y = 0;
+                            t_info->width = man->w;
+                            t_info->height = man->h;
+                         }
+
+                       t_info->canvas = e_manager_comp_evas_get(man);
+                       if (!t_info->canvas)
+                         {
+                            TSP_ERROR("[devmode-tizen] Failed to get canvas from comp module");
+                            return EINA_FALSE;
+                         }
+                    }
+               }
+             else
+               {
+                  TSP_ERROR("[devmode-tizen] Container doesn't have zones :(");
+                  return EINA_FALSE;
+               }
+#endif
+          }
+     }
+
+   TSP_DEBUG("[devmode-tizen] viewport's width : %d, height : %d", t_info->width, t_info->height);
+
+   t_info->base = evas_object_rectangle_add(t_info->canvas);
+   evas_object_move(t_info->base, 0, 0);
+   evas_object_resize(t_info->base, t_info->width, t_info->height);
+   evas_object_color_set(t_info->base, 0, 0, 0, 0);
+   evas_object_layer_set(t_info->base, EVAS_LAYER_MAX);
+   evas_object_pass_events_set(t_info->base, EINA_TRUE);
+   evas_object_show(t_info->base);
+
+   t_info->layout_main = __tsp_main_layout_add(t_info->base);
+   TSP_CHECK_FALSE(t_info->layout_main);
+   evas_object_move(t_info->layout_main, 0, 0);
+   //evas_object_size_hint_weight_set(t_info->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_resize(t_info->layout_main, t_info->width, t_info->height);
+   evas_object_show(t_info->layout_main);
+
+   /* main view */
+   tsp_main_view_create(t_info);
+
+   tsp_event_mgr_init(t_info);
+
+   return EINA_TRUE;
+}
+
+static void
+_tsp_main_config_new(E_Module *m)
+{
+   TouchInfo *t_info = NULL;
+   Mod *mod = NULL;
+   if (m) t_info = m->data;
+   if (t_info) mod = t_info->module;
+
+   if (mod) mod->conf = e_mod_devmode_cfdata_config_new();
+   else
+     {
+        TSP_ERROR("mod->conf is NIL");
+     }
+}
+
+static void
+_tsp_main_config_free(E_Module *m)
+{
+   TouchInfo *t_info = NULL;
+   Mod *mod = NULL;
+   if (m) t_info = m->data;
+   if (t_info) mod = t_info->module;
+
+   if (mod)
+     {
+        e_mod_devmode_cfdata_config_free(mod->conf);
+        mod->conf = NULL;
+     }
+   else
+     {
+        TSP_ERROR("mod is NIL");
+     }
+}
+
+static void
+_tsp_main_set_win_property(Eina_Bool set)
+{
+   Ecore_X_Atom x_atom_devmode = 0;
+   Ecore_X_Window win = 0;
+   unsigned int enable = -1;
+   int ret = -1, count = 0;
+   unsigned char *prop_data = NULL;
+
+   TSP_FUNC_ENTER();
+
+   x_atom_devmode = ecore_x_atom_get("_E_DEVMODE_ENABLE");
+   if (x_atom_devmode == None)
+     {
+        TSP_ERROR("failed to get atom of _E_DEVMODE_ENABLE\n");
+        return;
+     }
+
+   win = ecore_x_window_root_first_get();
+   if (win <= 0)
+     {
+        TSP_ERROR("failed to get root window\n");
+        return;
+     }
+
+   ret = ecore_x_window_prop_property_get(win, x_atom_devmode, ECORE_X_ATOM_CARDINAL, 32, &prop_data, &count);
+   if ( ret && prop_data )
+     {
+        memcpy(&enable, prop_data, sizeof (unsigned int));
+        TSP_DEBUG("devmode-tizen is enabled: %s ", enable ? "true" : "false");
+     }
+
+   if (set == EINA_TRUE)
+     {
+        if (enable == 1) return;
+        else enable = 1;
+     }
+   else
+     {
+        if (enable == 0) return;
+        else enable = 0;
+     }
+
+   ecore_x_window_prop_card32_set(win, x_atom_devmode, &enable, 1);
+
+   return 0;
+}
+
+EAPI void *
+e_modapi_init(E_Module *m)
+{
+   TSP_FUNC_ENTER();
+
+   //int x, y, w, h;
+   TouchInfo *t_info = E_NEW(TouchInfo, 1);
+   TSP_CHECK_FALSE(t_info);
+
+   Mod *module = E_NEW(Mod, 1);
+   if (!module)
+     {
+        if (t_info) free(t_info);
+        TSP_ERROR("[devmode-tizen] failed to alloc Memory");
+        return NULL;
+     }
+
+   module->module = m;
+   m->data = (void *)t_info;
+
+   t_info->module = (void *)module;
+   devmode_mod = m;
+
+   e_mod_devmode_cfdata_edd_init(&(module->conf_edd));
+   module->conf = e_config_domain_load("module.devmode-tizen", module->conf_edd);
+
+   if (!module->conf) _tsp_main_config_new(m);
+
+   if (_tsp_main_init(t_info) != EINA_TRUE)
+     {
+        TSP_ERROR("[devmode-tizen] failed to init main of devmode tizen");
+        return NULL;
+     }
+
+   _tsp_main_set_win_property(EINA_TRUE);
+
+   return t_info;
+}
+
+EAPI int
+e_modapi_shutdown(E_Module *m)
+{
+   TSP_FUNC_ENTER();
+
+   TouchInfo *t_info = (TouchInfo *)m->data;
+   TSP_CHECK_VAL(t_info, 0);
+
+   Mod *mod = t_info->module;
+
+   tsp_event_mgr_deinit();
+
+   tsp_main_view_destroy(t_info);
+
+   tsp_evas_object_del(t_info->base);
+
+   Eina_List *managers, *l, *l2, *l3;
+
+   managers = e_manager_list();
+   for (l = managers; l; l = l->next)
+     {
+        E_Manager *man;
+        man = l->data;
+
+        for (l2 = t_info->cons; l2; l2 = l2->next)
+          {
+             for (l3 = t_info->zones; l3; l3 = l3->next)
+               {
+                  E_Zone *zone;
+                  zone = l3->data;
+                  if (zone)
+                    {
+                       /*Always enable comp module*/
+                       e_manager_comp_composite_mode_set(man, zone, EINA_FALSE);
+                    }
+               }
+          }
+     }
+
+   _tsp_main_config_free(m);
+   E_CONFIG_DD_FREE(mod->conf_edd);
+
+   SAFE_FREE(mod);
+   SAFE_FREE(t_info);
+   _tsp_main_set_win_property(EINA_FALSE);
+
+   /*
+    * FIXME : Free containers and etc...
+    */
+
+   return 1;
+}
+
+EAPI int
+e_modapi_save(E_Module *m)
+{
+#if 1
+   TouchInfo *t_info = NULL;
+   Mod *mod = NULL;
+   if (m) t_info = m->data;
+   if (t_info) mod = t_info->module;
+   if (mod && mod->conf_edd && mod->conf)
+     {
+        e_config_domain_save("module.devmode-tizen", mod->conf_edd, mod->conf);
+     }
+   else
+     {
+        TSP_ERROR("[devmode-tizen] failed to save of conf");
+     }
+#endif
+
+   return 1;
+}
+
diff --git a/devmode-tizen/src/e_mod_main.h b/devmode-tizen/src/e_mod_main.h
new file mode 100644 (file)
index 0000000..de827c3
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef E_MOD_MAIN_H
+#define E_MOD_MAIN_H
+
+#include "e_mod_devmode.h"
+#include "e_mod_config.h"
+
+typedef struct _Mod Mod;
+struct _Mod
+{
+   E_Module        *module;
+
+   E_Config_DD     *conf_edd;
+   E_Config_DD     *conf_match_edd;
+   Config          *conf;
+
+   E_Config_Dialog *config_dialog;
+};
+
+EAPI extern E_Module_Api e_modapi;
+
+EAPI void *e_modapi_init(E_Module *m);
+EAPI int   e_modapi_shutdown(E_Module *m);
+EAPI int   e_modapi_save(E_Module *m);
+
+/**
+ * @t_infodtogroup Optional_Look
+ * @{
+ *
+ * @defgroup Module_Shot TouchInfo
+ *
+ * Get Touch information
+ *
+ * @}
+ */
+
+#endif
index 8b408f9..b4dd0a0 100644 (file)
@@ -1,18 +1,18 @@
-collections 
+collections
 {
-   group 
+   group
      {
         images.image: "module_icon.png" COMP;
         name: "icon";
         max: 128 128;
-        parts 
+        parts
           {
-             part 
+             part
                {
                   name: "icon";
                   type: IMAGE;
                   mouse_events: 0;
-                  description 
+                  description
                     {
                        state: "default" 0.0;
                        aspect: 1.0 1.0;
@@ -20,6 +20,66 @@ collections
                        image.normal: "module_icon.png";
                     }
                }
+        }
+     }
+
+   group
+     {
+        images.image: "RB0_resize.png" COMP;
+        images.image: "RB0_resize_notAvail.png" COMP;
+        name: "new_shadow";
+        max: 720 720;
+        parts
+          {
+             part
+               {
+                  name: "opacity_rect";
+                  type: RECT;
+                  description
+                    {
+                       state: "default" 0.0;
+                       color: 255 255 255 255;
+                    }
+               }
+             part
+               {
+                  name: "resize_border";
+                  type: IMAGE;
+                  clip_to: "opacity_rect";
+                  description
+                    {
+                       state: "default" 0;
+                       image.normal: "RB0_resize.png";
+                       image.border: 5 5 5 5;
+                       image.middle: NONE;
+                    }
+                  description
+                    {
+                       state: "not_avail" 0;
+                       image.normal: "RB0_resize_notAvail.png";
+                       image.border: 5 5 5 5;
+                    }
+               }
           }
+
+          programs
+           {
+               program
+                 {
+                    source: "illume2";
+                    action: STATE_SET "not_avail" 0;
+                    signal: "resize,notavail";
+                    filter: "resize_border" "default";
+                    target: "resize_border";
+                 }
+               program
+                 {
+                    source: "illume2";
+                    action: STATE_SET "default" 0;
+                    signal: "resize,normal";
+                    filter: "resize_border" "not_avail";
+                    target: "resize_border";
+                 }
+           }
      }
 }
index 65ff03b..64fc746 100644 (file)
@@ -826,6 +826,44 @@ e_illume_border_is_miniapp_tray(E_Border *bd)
 }
 
 EAPI Eina_Bool
+e_illume_border_is_syspopup(E_Border *bd)
+{
+   const char *name = NULL;
+   const char *clas = NULL;
+
+   if (!bd) return EINA_FALSE;
+
+   name = bd->client.icccm.name;
+   clas = bd->client.icccm.class;
+
+   if (clas == NULL) return EINA_FALSE;
+   if (strncmp(clas,"SYSTEM_POPUP", strlen("SYSTEM_POPUP"))!= 0) return EINA_FALSE;
+   if (name == NULL) return EINA_FALSE;
+   if (strncmp(name,"SYSTEM_POPUP", strlen("SYSTEM_POPUP"))!= 0) return EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+e_illume_border_is_app_selector(E_Border *bd)
+{
+   const char *name = NULL;
+   const char *clas = NULL;
+
+   if (!bd) return EINA_FALSE;
+
+   name = bd->client.icccm.name;
+   clas = bd->client.icccm.class;
+
+   if (clas == NULL) return EINA_FALSE;
+   if (strncmp(clas,"APP_SELECTOR", strlen("APP_SELECTOR"))!= 0) return EINA_FALSE;
+   if (name == NULL) return EINA_FALSE;
+   if (strncmp(name,"APP_SELECTOR", strlen("APP_SELECTOR"))!= 0) return EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
+EAPI Eina_Bool
 e_illume_border_is_fixed(E_Border *bd)
 {
    int min_w = 0, min_h = 0;
index b3d707e..0586bf4 100644 (file)
@@ -431,4 +431,8 @@ EAPI Eina_Bool e_illume_border_is_quickpanel_popup(E_Border *bd);
 /* app tray functions */
 EAPI Eina_Bool e_illume_border_is_app_tray(E_Border *bd);
 EAPI Eina_Bool e_illume_border_is_miniapp_tray(E_Border *bd);
+
+/* etc */
+EAPI Eina_Bool e_illume_border_is_syspopup(E_Border *bd);
+EAPI Eina_Bool e_illume_border_is_app_selector(E_Border *bd);
 #endif
diff --git a/illume2-tizen/src/images/RB0_resize.png b/illume2-tizen/src/images/RB0_resize.png
new file mode 100755 (executable)
index 0000000..5dc2d2a
Binary files /dev/null and b/illume2-tizen/src/images/RB0_resize.png differ
diff --git a/illume2-tizen/src/images/RB0_resize_notAvail.png b/illume2-tizen/src/images/RB0_resize_notAvail.png
new file mode 100755 (executable)
index 0000000..5dc8588
Binary files /dev/null and b/illume2-tizen/src/images/RB0_resize_notAvail.png differ
index c46b229..cb95531 100644 (file)
@@ -35,6 +35,8 @@ typedef struct _E_Illume_Print_Info
 
 
 #define COMP_MODULE_CONTROL
+#define BACKKEY_MODULE_CONTROL
+#define DEVMODE_MODULE_CONTROL
 
 
 /*****************************/
@@ -113,6 +115,12 @@ void _policy_border_list_print (Ecore_X_Window win);
 #ifdef COMP_MODULE_CONTROL
 static void _policy_property_composite_module_change (Ecore_X_Event_Window_Property *ev);
 #endif
+#ifdef BACKKEY_MODULE_CONTROL
+static void _policy_property_backkey_module_change (Ecore_X_Event_Window_Property *ev);
+#endif
+#ifdef DEVMODE_MODULE_CONTROL
+static void _policy_property_devmode_module_change (Ecore_X_Event_Window_Property *ev);
+#endif
 
 #if 1 // for visibility
 static void _policy_manage_xwins (E_Manager* man);
@@ -206,6 +214,12 @@ static Ecore_X_Window g_indi_control_win;
  #ifdef COMP_MODULE_CONTROL
 static Ecore_X_Atom E_ILLUME_ATOM_COMP_MODULE_ENABLED;
 #endif
+#ifdef BACKKEY_MODULE_CONTROL
+static Ecore_X_Atom E_ILLUME_ATOM_BACKKEY_MODULE_ENABLED;
+#endif
+#ifdef DEVMODE_MODULE_CONTROL
+static Ecore_X_Atom E_ILLUME_ATOM_DEVMODE_MODULE_ENABLED;
+#endif
 
 /* for supporting rotation */
 static Ecore_X_Atom E_INDICATOR_CMD_WIN;
@@ -249,6 +263,16 @@ static E_Policy_Rotation_Dependent dep_rot =
    -1
 };
 
+typedef struct _E_Resizable_Area_Info
+{
+   int x_dist;
+   int y_dist;
+   int min_width;
+   int min_height;
+   int max_width;
+   int max_height;
+} E_Resizable_Area_Info;
+
 /* local functions */
 static void
 _policy_border_set_focus(E_Border *bd)
@@ -920,7 +944,8 @@ _policy_border_del(E_Border *bd)
    // for supporting rotation such as quickpanel
    if (e_illume_border_is_quickpanel(bd) ||
        e_illume_border_is_miniapp_tray(bd) ||
-       (bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING))
+       (bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) ||
+       e_illume_border_is_syspopup(bd))
      dep_rot.list = eina_list_remove(dep_rot.list, bd);
 }
 
@@ -1021,7 +1046,8 @@ _policy_border_post_fetch(E_Border *bd)
    // for supporting rotation such as quickpanel
    if (e_illume_border_is_quickpanel(bd) ||
        e_illume_border_is_miniapp_tray(bd) ||
-       (bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING))
+       (bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) ||
+       e_illume_border_is_syspopup(bd))
      {
         bd->client.e.state.rot.type = E_BORDER_ROTATION_TYPE_DEPENDENT;
         if (!eina_list_data_find(dep_rot.list, bd))
@@ -1081,7 +1107,7 @@ _check_parent_in_transient_for_tree(E_Border *bd, E_Border *parent_bd)
           {
              // This is very bad. bd and parent_bd are transient_for each other
 #ifdef USE_DLOG
-             LOGD("[WM] Transient_for Error!!! Win:0x%07x and Parent:0x%07x are transient_for each other.", bd->client.win, parent_bd->client.win);
+             SECURE_SLOGD("[WM] Transient_for Error!!! Win:0x%07x and Parent:0x%07x are transient_for each other.", bd->client.win, parent_bd->client.win);
 #endif
              ELBF(ELBT_ILLUME, 0, bd->client.win, "BAD. Transient_for Error. Parent:0x%07x is descendant", parent_bd->client.win);
              return EINA_TRUE;
@@ -1116,11 +1142,19 @@ _policy_border_pre_fetch(E_Border *bd)
         E_Border *bd_parent = NULL;
         E_Illume_XWin_Info *xwin_info = NULL;
         Eina_Bool transient_each_other;
+        Ecore_X_Window transient_for_win;
 
         if (_e_illume_cfg->use_force_iconify)
           xwin_info = _policy_xwin_info_find(bd->win);
 
-        bd->client.icccm.transient_for = ecore_x_icccm_transient_for_get(bd->client.win);
+        transient_for_win = ecore_x_icccm_transient_for_get(bd->client.win);
+        if (bd->client.icccm.transient_for == transient_for_win)
+          {
+             ELBF(ELBT_ILLUME, 0, bd->client.win, "Same transient_for:0x%07x. SKIP...", transient_for_win);
+             goto transient_fetch_done;
+          }
+
+        bd->client.icccm.transient_for = transient_for_win;
         if (bd->client.icccm.transient_for)
           {
              bd_parent = e_border_find_by_client_window(bd->client.icccm.transient_for);
@@ -1202,6 +1236,7 @@ _policy_border_pre_fetch(E_Border *bd)
           }
 #endif
 
+transient_fetch_done:
         bd->client.icccm.fetch.transient_for = 0;
      }
 }
@@ -1585,6 +1620,7 @@ _policy_resize_start(E_Illume_Border_Info *bd_info)
    Evas_Object *o;
    E_Border *bd;
    int nx, ny;
+   const char buf[PATH_MAX];
 
    bd = bd_info->border;
 
@@ -1605,8 +1641,15 @@ _policy_resize_start(E_Illume_Border_Info *bd_info)
    canvas = e_manager_comp_evas_get(m);
    if (!canvas) return;
 
-   o = evas_object_rectangle_add(canvas);
-   evas_object_color_set(o, 100, 100, 100, 100);
+   o = edje_object_add(canvas);
+   snprintf(buf, sizeof(buf), "%s/e-module-illume2-tizen.edj", _e_illume_mod_dir);
+   evas_object_image_border_center_fill_set(o, EVAS_BORDER_FILL_NONE);
+   if(!(edje_object_file_set(o, buf, "new_shadow"))
+      || !(bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING))
+     {
+         o = evas_object_rectangle_add(canvas);                                 
+         evas_object_color_set(o, 100, 100, 100, 100);
+     }
 
    nx = bd->x - bd->zone->x;
    ny = bd->y - bd->zone->y;
@@ -1778,6 +1821,113 @@ _policy_property_composite_module_change(Ecore_X_Event_Window_Property *ev)
 }
 #endif
 
+/* enable/disable backkey module - 130610 seongwon1.cho */
+#ifdef BACKKEY_MODULE_CONTROL
+static void
+_policy_property_backkey_module_change(Ecore_X_Event_Window_Property *ev)
+{
+   int ret, count;
+   int enable = 0;
+   int current_enabled = 0;
+   unsigned char* prop_data = NULL;
+   E_Module* backkey = NULL;
+
+   ret = ecore_x_window_prop_property_get (ev->win, E_ILLUME_ATOM_BACKKEY_MODULE_ENABLED, ECORE_X_ATOM_CARDINAL, 32, &prop_data, &count);
+   if( ret && prop_data )
+     {
+        memcpy (&enable, prop_data, sizeof (int));
+        fprintf( stdout, "[E17-illume2-tizen] %s(%d) enable: %s ", __func__, __LINE__, enable ? "true" : "false" );
+
+        backkey = e_module_find ("backkey-tizen");
+        if( backkey )
+          {
+             current_enabled = e_module_enabled_get(backkey);
+             fprintf( stdout, "current: %s ", current_enabled ? "true" : "false" );
+
+             if( current_enabled && !enable )
+               {
+                  fprintf( stdout, "e_module_disable(backkey-tizen) " );
+                  e_module_disable(backkey);
+               }
+             else if( !current_enabled && enable )
+               {
+                  fprintf( stdout, "e_module_enable(backkey-tizen) " );
+                  e_module_enable(backkey);
+               }
+             else
+               {
+                  fprintf( stdout, "skip... " );
+               }
+
+             fprintf( stdout, "\n" );
+          }
+        else
+          {
+             fprintf( stderr, "\n[E17-illume2-tizen] %s(%d) can't find backkey module.\n", __func__, __LINE__ );
+             backkey = e_module_new("backkey-tizen");
+             if (backkey) e_module_enable(backkey);
+          }
+     }
+
+   if (prop_data) free (prop_data);
+
+}
+#endif
+
+
+/* enable/disable devmode module - 130610 seongwon1.cho */
+#ifdef DEVMODE_MODULE_CONTROL
+static void
+_policy_property_devmode_module_change(Ecore_X_Event_Window_Property *ev)
+{
+   int ret, count;
+   int enable = 0;
+   int current_enabled = 0;
+   unsigned char* prop_data = NULL;
+   E_Module* devmode = NULL;
+
+   ret = ecore_x_window_prop_property_get (ev->win, E_ILLUME_ATOM_DEVMODE_MODULE_ENABLED, ECORE_X_ATOM_CARDINAL, 32, &prop_data, &count);
+   if( ret && prop_data )
+     {
+        memcpy (&enable, prop_data, sizeof (int));
+        fprintf( stdout, "[E17-illume2-tizen] %s(%d) enable: %s ", __func__, __LINE__, enable ? "true" : "false" );
+
+        devmode = e_module_find ("devmode-tizen");
+        if( devmode )
+          {
+             current_enabled = e_module_enabled_get(devmode);
+             fprintf( stdout, "current: %s ", current_enabled ? "true" : "false" );
+
+             if( current_enabled && !enable )
+               {
+                  fprintf( stdout, "e_module_disable(devmode-tizen) " );
+                  e_module_disable(devmode);
+               }
+             else if( !current_enabled && enable )
+               {
+                  fprintf( stdout, "e_module_enable(devmode-tizen) " );
+                  e_module_enable(devmode);
+               }
+             else
+               {
+                  fprintf( stdout, "skip... " );
+               }
+
+             fprintf( stdout, "\n" );
+          }
+        else
+          {
+             fprintf( stderr, "\n[E17-illume2-tizen] %s(%d) can't find devmode module.\n", __func__, __LINE__ );
+             devmode = e_module_new("devmode-tizen");
+             if (devmode) e_module_enable(devmode);
+          }
+     }
+
+   if (prop_data) free (prop_data);
+
+}
+#endif
+
 
 static void _policy_property_window_state_change (Ecore_X_Event_Window_Property *event)
 {
@@ -1885,7 +2035,7 @@ static void _policy_property_clipboard_geometry_change (Ecore_X_Event_Window_Pro
         if (e_illume_border_is_quickpanel_popup(bd)) continue;
 
 #ifdef USE_DLOG
-        LOGD("[WM] Clipboard geometry set. win:0x%07x, geo(%d,%d,%d,%d)", bd->client.win, x, y, w, h);
+        SECURE_SLOGD("[WM] Clipboard geometry set. win:0x%07x, geo(%d,%d,%d,%d)", bd->client.win, x, y, w, h);
 #endif
         ecore_x_e_illume_clipboard_geometry_set(bd->client.win, x, y, w, h);
      }
@@ -1915,7 +2065,7 @@ static void _policy_property_clipboard_state_change (Ecore_X_Event_Window_Proper
         if (e_illume_border_is_quickpanel_popup(bd)) continue;
 
 #ifdef USE_DLOG
-        LOGD("[WM] Clipboard state set. win:0x%07x, state:%d", bd->client.win, state);
+        SECURE_SLOGD("[WM] Clipboard state set. win:0x%07x, state:%d", bd->client.win, state);
 #endif
         ecore_x_e_illume_clipboard_state_set(bd->client.win, state);
      }
@@ -2027,12 +2177,10 @@ static void _policy_active_win_change(E_Illume_XWin_Info *xwin_info, Ecore_X_Win
                                       ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, active_win, active_pid, g_active_win, g_active_pid, 0);
 
         // for debug...
-        printf ("\n=========================================================================================\n");
         if (active_bd)
           {
-             printf ("[WM] Active window is changed.  OLD(win:0x%07x,pid:%d) --> NEW(win:0x%07x,pid:%d,name:%s)\n", g_active_win, g_active_pid, active_win, active_pid, active_bd->client.netwm.name);
 #ifdef USE_DLOG
-             LOGD("[WM] Active window is changed. OLD(win:0x%07x,pid:%d) --> NEW(win:0x%07x,pid:%d,name:%s)", g_active_win, g_active_pid, active_win, active_pid, active_bd->client.netwm.name);
+             SECURE_SLOGD("[WM] ACT WIN 0x%07x(%d) -> 0x%07x(%d)", g_active_win, g_active_pid, active_win, active_pid);
 #endif
              if ((E_ILLUME_BORDER_IS_IN_DESKTOP(active_bd)) ||
                  (active_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING))
@@ -2042,12 +2190,10 @@ static void _policy_active_win_change(E_Illume_XWin_Info *xwin_info, Ecore_X_Win
           }
         else
           {
-             printf ("[WM] Active window is changed.  OLD(win:0x%07x,pid:%d) --> NEW(win:0x%07x,pid:%d,name:NULL)\n", g_active_win, g_active_pid, active_win, active_pid);
 #ifdef USE_DLOG
-             LOGD("[WM] Active window is changed. OLD(win:0x%07x,pid:%d) --> NEW(win:0x%07x,pid:%d,name:NULL)", g_active_win, g_active_pid, active_win, active_pid);
+             SECURE_SLOGD("[WM] ACT WIN 0x%07x(%d) -> 0x%07x(%d)", g_active_win, g_active_pid, active_win, active_pid);
 #endif
           }
-        printf ("=========================================================================================\n\n");
         g_active_win = active_win;
         g_active_pid = active_pid;
      }
@@ -2497,17 +2643,22 @@ _resize_rect_geometry_get(E_Illume_Border_Info *bd_info,
                           Evas_Coord_Rectangle *r,
                           int                   ev_x,
                           int                   ev_y,
-                          int                   direction)
+                          int                   direction,
+                          E_Resizable_Area_Info *area)
 {
    E_Border *bd;
    int x = 0, y = 0, w = 0, h = 0;
    int mw = 0, mh = 0;
    int cx = 0, cy = 0;
    int max_size = 0;
+   int min_size = 200;
 
    bd = bd_info->border;
 
    e_illume_border_min_get(bd, &mw, &mh);
+   // min_size is workaround adjustement due to some window's wrong w h after rotation is changed.
+   if(mw < min_size) mw = min_size;
+   if(mh < min_size) mh = min_size;
 
    if (direction == ECORE_X_NETWM_DIRECTION_SIZE_BR)
      {
@@ -2745,6 +2896,16 @@ _resize_rect_geometry_get(E_Illume_Border_Info *bd_info,
    else
      max_size = bd->zone->w;
 
+   if(area)
+     {
+        area->x_dist = w;
+        area->y_dist = h;
+        area->min_width = mw;
+        area->min_height = mh;
+        area->max_width = max_size;
+        area->max_height = max_size;
+    }
+
    if (w < mw) w = mw;
    if (h < mh) h = mh;
    if (w > max_size) w = max_size;
@@ -2795,7 +2956,7 @@ _policy_border_cb_mouse_up(void *data,
      {
         L(LT_AIA, "[ILLUME2][AIA] %s(%d)... \n", __func__, __LINE__);
         Evas_Coord_Rectangle r;
-        _resize_rect_geometry_get(bd_info, &r, ev->root.x, ev->root.y, bd_info->resize_req.direction);
+        _resize_rect_geometry_get(bd_info, &r, ev->root.x, ev->root.y, bd_info->resize_req.direction, NULL);
 
         bd_info->resize_req.direction = ECORE_X_NETWM_DIRECTION_CANCEL;
         bd_info->resize_req.mouse.x = r.x + bd->zone->x;
@@ -2844,6 +3005,7 @@ _policy_border_cb_mouse_move(void *data,
    Ecore_Event_Mouse_Move *ev;
    E_Illume_Border_Info *bd_info;
    E_Border *bd;
+   Evas_Object *rect;
 
    L(LT_AIA, "[ILLUME2][AIA] %s(%d)... \n", __func__, __LINE__);
    ev = event;
@@ -2864,9 +3026,49 @@ _policy_border_cb_mouse_move(void *data,
         if (!o) return ECORE_CALLBACK_PASS_ON;
 
         Evas_Coord_Rectangle r;
-        _resize_rect_geometry_get(bd_info, &r, ev->root.x, ev->root.y, bd_info->resize_req.direction);
+        E_Resizable_Area_Info area;
 
+        _resize_rect_geometry_get(bd_info, &r, ev->root.x, ev->root.y, bd_info->resize_req.direction, &area);
         L(LT_AIA, "[ILLUME2][AIA] %s(%d)... x:%d, y:%d, w:%d, h:%d\n", __func__, __LINE__, r.x, r.y, r.w, r.h);
+
+        rect = edje_object_part_object_get(o, "opacity_rect");
+
+        if((r.w <= area.min_width && r.h <= area.min_height)
+           || (r.w >= area.max_width && r.h >= area.max_height))
+          {
+            edje_object_signal_emit(o, "resize,notavail", "illume2");
+            evas_object_color_set(rect, 64, 64, 64, 64);
+          }
+        else
+          {
+            edje_object_signal_emit(o, "resize,normal", "illume2");
+            evas_object_color_set(rect, 255, 255, 255, 255);
+          }
+        if(area.x_dist < area.min_width && area.y_dist < area.min_height)
+          {
+            int tmp = 0;
+            tmp = ((area.min_width-area.x_dist)>= (area.min_height-area.y_dist))? area.min_width - area.x_dist : area.min_height - area.y_dist;
+            if( tmp >= 200)
+                tmp = 200;
+            tmp /= 20;
+            tmp %= 11;
+            tmp --;
+            tmp = (int)(128*( (double)tmp/10 + 1));
+            evas_object_color_set(rect, tmp, tmp, tmp, tmp);
+          }
+        if (area.x_dist > area.max_width && area.y_dist > area.max_height)
+          {
+            int tmp = 0;
+            tmp = ((area.x_dist - area.max_width) >= (area.y_dist - area.max_height))? area.x_dist - area.max_width : area.y_dist - area.max_height;
+            if( tmp >= 200)
+               tmp = 200;
+            tmp /= 20;
+            tmp %= 11;
+            tmp --;
+            tmp = (int)(128*( (double)tmp/10 + 1));
+            evas_object_color_set(rect, tmp, tmp, tmp, tmp);
+          }
+
         evas_object_move(o, r.x, r.y);
         evas_object_resize(o, r.w, r.h);
      }
@@ -2960,6 +3162,20 @@ _policy_property_change(Ecore_X_Event_Window_Property *event)
         _policy_property_composite_module_change (event);
      }
 #endif
+/* enable/disable backkey module - 130610 seongwon1.cho */
+#ifdef BACKKEY_MODULE_CONTROL
+   else if (event->atom == E_ILLUME_ATOM_BACKKEY_MODULE_ENABLED)
+     {
+        _policy_property_backkey_module_change (event);
+     }
+#endif
+/* enable/disable devmode module - 130610 seongwon1.cho */
+#ifdef DEVMODE_MODULE_CONTROL
+   else if (event->atom == E_ILLUME_ATOM_DEVMODE_MODULE_ENABLED)
+     {
+        _policy_property_devmode_module_change (event);
+     }
+#endif
    else if (event->atom == E_INDICATOR_CMD_WIN)
      {
         _policy_property_indicator_cmd_win_change(event);
@@ -3223,10 +3439,10 @@ static void _policy_layout_quickpanel_rotate (E_Illume_Quickpanel* qp, int angle
 
    int diff, temp;
 
+   // pass 1 - resize window
    // It caused abnormal size of quickpanel window and abnormal rotation state.
    // disable it for now.
 #if 0
-   // pass 1 - resize window
    EINA_LIST_FOREACH(qp->borders, bd_list, panel)
      {
         if (!panel) continue;
@@ -3413,6 +3629,24 @@ int _policy_atom_init (void)
      }
 #endif
 
+#ifdef BACKKEY_MODULE_CONTROL
+   E_ILLUME_ATOM_BACKKEY_MODULE_ENABLED = ecore_x_atom_get ("_E_BACKKEY_ENABLE");
+   if(!E_ILLUME_ATOM_BACKKEY_MODULE_ENABLED)
+     {
+        fprintf (stderr, "[ILLUME2] Critical Error!!! Cannot create _E_BACKKEY_ENABLE Atom...\n");
+        return 0;
+     }
+#endif
+
+#ifdef DEVMODE_MODULE_CONTROL
+   E_ILLUME_ATOM_DEVMODE_MODULE_ENABLED = ecore_x_atom_get ("_E_DEVMODE_ENABLE");
+   if(!E_ILLUME_ATOM_DEVMODE_MODULE_ENABLED)
+     {
+        fprintf (stderr, "[ILLUME2] Critical Error!!! Cannot create _E_DEVMODE_ENABLE Atom...\n");
+        return 0;
+     }
+#endif
+
    E_INDICATOR_CMD_WIN = ecore_x_atom_get("_E_INDICATOR_CMD_WIN");
    if (!E_INDICATOR_CMD_WIN)
      {
@@ -4403,9 +4637,10 @@ _policy_calculate_visibility(void)
    Ecore_X_XRegion *win_region = NULL;
    Ecore_X_Rectangle visible_rect, win_rect;
    Eina_Bool is_fully_obscured = EINA_FALSE;
-   Eina_Bool obscured_by_special_bd = EINA_FALSE;
    Eina_Bool is_opaque_win = EINA_FALSE;
    Eina_Bool do_not_iconify = EINA_FALSE;
+   Eina_Bool alpha_opaque = EINA_FALSE;
+   Eina_Bool obscured_by_alpha_opaque = EINA_FALSE;
    int old_vis = 0;
    int set_root_angle = 0;
    int control_indi = 0;
@@ -4471,21 +4706,28 @@ _policy_calculate_visibility(void)
 
              if (ecore_x_xregion_rect_contain(visible_region, &win_rect))
                {
-                  xwin_info->visibility = obscured_by_special_bd ?
-                     E_ILLUME_VISIBILITY_FULLY_OBSCURED :
-                     E_ILLUME_VISIBILITY_UNOBSCURED;
+                  L(LT_VISIBILITY_DETAIL, "[ILLUME2][VISIBILITY] %s(%d)... win:0x%07x Un-OBSCURED.. \n", __func__, __LINE__, xwin_info->id);
+                  xwin_info->visibility = E_ILLUME_VISIBILITY_UNOBSCURED;
 
                   if (bd)
                     {
-                       if (e_illume_border_is_lock_screen(bd))
+                       if (bd->client.argb)
+                         {
+                            if (bd_info && bd_info->opaque)
+                              {
+                                 alpha_opaque = EINA_TRUE;
+                              }
+                            else
+                              {
+                                 is_opaque_win = EINA_FALSE;
+                              }
+                         }
+
+                       if (bd->client.illume.win_state.state ==
+                           ECORE_X_ILLUME_WINDOW_STATE_FLOATING)
                          {
-                            obscured_by_special_bd = EINA_TRUE;
                             is_opaque_win = EINA_FALSE;
                          }
-                       else if ((bd->client.illume.win_state.state ==
-                                 ECORE_X_ILLUME_WINDOW_STATE_FLOATING) ||
-                                ((bd_info->opaque == 0) && (bd->client.argb)))
-                         is_opaque_win = EINA_FALSE;
                     }
                   else
                     {
@@ -4506,26 +4748,33 @@ _policy_calculate_visibility(void)
                             if (ecore_x_xregion_is_empty(visible_region))
                               {
                                  is_fully_obscured = EINA_TRUE;
+                                 if (alpha_opaque)
+                                   {
+                                      L(LT_VISIBILITY_DETAIL, "[ILLUME2][VISIBILITY] %s(%d)... OBSCURED by alpha opaque win:0x%07x\n", __func__, __LINE__, xwin_info->id);
+                                      obscured_by_alpha_opaque = EINA_TRUE;
+                                      alpha_opaque = EINA_FALSE;
+                                   }
                               }
                          }
                     }
                }
              else
                {
+                  L(LT_VISIBILITY_DETAIL, "[ILLUME2][VISIBILITY] %s(%d)... win:0x%07x Fully OBSCURED.. place on OUTSIDE\n", __func__, __LINE__, xwin_info->id);
                   xwin_info->visibility = E_ILLUME_VISIBILITY_FULLY_OBSCURED;
                }
           }
         else
           {
+             L(LT_VISIBILITY_DETAIL, "[ILLUME2][VISIBILITY] %s(%d)... win:0x%07x Fully OBSCURED.. \n", __func__, __LINE__, xwin_info->id);
              xwin_info->visibility = E_ILLUME_VISIBILITY_FULLY_OBSCURED;
-             obscured_by_special_bd = EINA_FALSE;
           }
 
         if (!bd) continue;
         if (!E_ILLUME_BORDER_IS_IN_MOBILE(bd)) continue;
 
         // decide if it's the border that DO NOT iconify.
-        if (obscured_by_special_bd)
+        if (obscured_by_alpha_opaque)
           {
              do_not_iconify = EINA_TRUE;
           }
@@ -4542,14 +4791,14 @@ _policy_calculate_visibility(void)
         if (old_vis != xwin_info->visibility)
           {
 #ifdef USE_DLOG
-             LOGD("[WM] SEND VISIBILITY. win:0x%07x (old:%d -> new:%d)", xwin_info->bd_info->border->client.win, old_vis, xwin_info->visibility);
+             SECURE_SLOGD("[WM] SEND VISIBILITY. win:0x%07x (old:%d -> new:%d)", xwin_info->bd_info->border->client.win, old_vis, xwin_info->visibility);
 #endif
              L(LT_VISIBILITY, "[ILLUME2][VISIBILITY] SEND VISIBILITY NOTIFY (Line:%d)... win:0x%07x (old:%d -> new:%d)\n", __LINE__, bd->client.win, old_vis, xwin_info->visibility);
              _policy_send_visibility_notify(bd->client.win, xwin_info->visibility);
 
              if (xwin_info->visibility == E_ILLUME_VISIBILITY_UNOBSCURED)
                {
-                  L (LT_ANGLE, "[ILLUME2][ANGLE] %s(%d).. CALL _policy_change_root_angle_b     y_border_angle!!! win:0x%07x\n", __func__, __LINE__, xwin_info->bd_info->border->client.win);
+                  L (LT_ANGLE, "[ILLUME2][ANGLE] %s(%d).. CALL _policy_change_root_angle_by_border_angle!!! win:0x%07x\n", __func__, __LINE__, xwin_info->bd_info->border->client.win);
                   set_root_angle = 1;
 
                   if (_e_illume_cfg->use_force_iconify)
@@ -4596,6 +4845,26 @@ _policy_calculate_visibility(void)
                                  _policy_border_iconify_by_illume(xwin_info);
                               }
                          }
+                       else if (bd->iconic && do_not_iconify)
+                         {
+                            L(LT_ICONIFY, "[ILLUME2][ICONIFY] %s(%d).. Uniconify by illume.. win:0x%07x\n", __func__, __LINE__, xwin_info->bd_info->border->client.win);
+                            _policy_border_force_uniconify(bd);
+                         }
+                    }
+               }
+          }
+
+        // 3. check if opaque window is ocupied the screen.
+        // then we reset the obscured_by_alpha_opaque flag
+        if (xwin_info->visibility == E_ILLUME_VISIBILITY_FULLY_OBSCURED)
+          {
+             if (obscured_by_alpha_opaque && is_opaque_win)
+               {
+                  if (E_CONTAINS(xwin_info->attr.x, xwin_info->attr.y, xwin_info->attr.w, xwin_info->attr.h,
+                                 0, 0, _g_root_width, _g_root_height))
+                    {
+                       L(LT_VISIBILITY_DETAIL, "[ILLUME2][VISIBILITY] %s(%d)... unset obscured_by_alpha_opaque  win:%x\n", __func__, __LINE__, xwin_info->id);
+                       obscured_by_alpha_opaque = EINA_FALSE;
                     }
                }
           }
@@ -5525,7 +5794,10 @@ void _policy_window_move_resize_request(Ecore_X_Event_Window_Move_Resize_Request
 
    _policy_border_illume_handlers_add(bd_info);
    ecore_x_window_raise(bd->event_win);
-   e_grabinput_get(bd->event_win, 0, bd->event_win);
+   if (bd->client.icccm.accepts_focus || bd->client.icccm.take_focus)
+     e_grabinput_get(bd->event_win, 0, bd->event_win);
+   else
+     e_grabinput_get(bd->event_win, 0, 0);
 
    bd_info->resize_req.direction = e->direction;
    _policy_resize_start(bd_info);
@@ -5713,7 +5985,7 @@ void _policy_border_iconify_cb(E_Border *bd)
         xwin_info->visibility = E_ILLUME_VISIBILITY_FULLY_OBSCURED;
         L (LT_VISIBILITY, "[ILLUME2][VISIBILITY] SEND VISIBILITY NOTIFY (Line:%d)... win:0x%07x (old:%d -> new:%d)\n", __LINE__, xwin_info->bd_info->border->client.win, old_vis, xwin_info->visibility);
 #ifdef USE_DLOG
-        LOGD("[WM] SEND VISIBILITY. win:0x%07x (old:%d -> new:%d)", xwin_info->bd_info->border->client.win, old_vis, xwin_info->visibility);
+        SECURE_SLOGD("[WM] SEND VISIBILITY. win:0x%07x (old:%d -> new:%d)", xwin_info->bd_info->border->client.win, old_vis, xwin_info->visibility);
 #endif
         _policy_send_visibility_notify (xwin_info->bd_info->border->client.win, xwin_info->visibility);
      }
@@ -6264,12 +6536,13 @@ _policy_border_dependent_rotation(E_Border *bd)
 {
    Eina_List *l;
    E_Border *dep_bd = NULL;
-   int rotation = bd->client.e.state.rot.curr;
+   int rotation = 0;
 
    if (!bd) return;
    if (!dep_rot.list) return;
    if (dep_rot.refer.active_win != bd->client.win) return;
 
+   rotation = bd->client.e.state.rot.curr;
    EINA_LIST_FOREACH(dep_rot.list, l, dep_bd)
      {
         if (!dep_bd) continue;
index 9f2836d..93006b9 100755 (executable)
@@ -2,6 +2,9 @@
 #include "e_mod_main.h"
 #include <string.h>
 
+#define LOG_TAG        "KEYROUTER"
+#include "dlog.h"
+
 /* this is needed to advertise a label for the module IN the code (not just
  * the .desktop file) but more specifically the api version it was compiled
  * for so E can skip modules that are compiled for an incorrect API version
@@ -19,18 +22,13 @@ e_modapi_init (E_Module* m)
 {
        if( !_e_keyrouter_init() )
        {
-               printf("[keyrouter][%s] Failed @ _e_keyrouter_init()..!\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed @ _e_keyrouter_init()..!\n", __FUNCTION__);
                return NULL;
        }
 
        //Adding Event Handlers
-#ifdef _F_USE_XI_GRABDEVICE_
-       keyrouter.e_event_generic_handler = ecore_event_handler_add(ECORE_X_EVENT_GENERIC, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_event_generic, NULL);
-#else//_F_USE_XI_GRABDEVICE_
        keyrouter.e_event_generic_handler = ecore_event_handler_add(ECORE_X_EVENT_GENERIC, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_event_generic, NULL);
        keyrouter.e_event_any_handler = ecore_event_handler_add(ECORE_X_EVENT_ANY, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_event_any, NULL);
-#endif//_F_USE_XI_GRABDEVICE_
-       //e_border_add_handler = ecore_event_handler_add(E_EVENT_BORDER_ADD, _e_keyrouter_cb_e_border_add, NULL);
        keyrouter.e_window_property_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_window_property, NULL);
        keyrouter.e_border_stack_handler = ecore_event_handler_add(E_EVENT_BORDER_STACK, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_e_border_stack, NULL);
        keyrouter.e_border_remove_handler = ecore_event_handler_add(E_EVENT_BORDER_REMOVE, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_e_border_remove, NULL);
@@ -40,19 +38,15 @@ e_modapi_init (E_Module* m)
        keyrouter.e_window_stack_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_STACK, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_window_stack, NULL);
        keyrouter.e_client_message_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, (Ecore_Event_Handler_Cb)_e_keyrouter_cb_client_message, NULL);
 
-       if( !keyrouter.e_window_stack_handler )                 printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_STACK handler\n", __FUNCTION__);
-       if( !keyrouter.e_window_configure_handler )             printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_CONFIGURE handler\n", __FUNCTION__);
-       if( !keyrouter.e_window_destroy_handler )               printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_DESTROY handler\n", __FUNCTION__);
-       if( !keyrouter.e_window_create_handler )                printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_CREATE handler\n", __FUNCTION__);
-       //if( !e_border_add_handler )                   printf("[keyrouter][%s] Failed to add E_EVENT_BORDER_ADD handler\n", __FUNCTION__);
-       if( !keyrouter.e_window_property_handler )              printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_PROPERTY handler\n", __FUNCTION__);
-       if( !keyrouter.e_border_stack_handler )                 printf("[keyrouter][%s] Failed to add E_EVENT_BORDER_STACK handler\n", __FUNCTION__);
-       if( !keyrouter.e_border_remove_handler )                printf("[keyrouter][%s] Failed to add E_EVENT_BORDER_REMOVE handler\n", __FUNCTION__);
-#ifdef _F_USE_XI_GRABDEVICE_
-       if( !keyrouter.e_event_generic_handler )                        printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_GENERIC handler\n", __FUNCTION__);
-#else//_F_USE_XI_GRABDEVICE_
-       if( !keyrouter.e_event_any_handler )                    printf("[keyrouter][%s] Failed to add ECORE_X_EVENT_ANY handler\n", __FUNCTION__);
-#endif//_F_USE_XI_GRABDEVICE_
+       if( !keyrouter.e_window_stack_handler )                 SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_STACK handler\n", __FUNCTION__);
+       if( !keyrouter.e_window_configure_handler )             SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_CONFIGURE handler\n", __FUNCTION__);
+       if( !keyrouter.e_window_destroy_handler )               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_DESTROY handler\n", __FUNCTION__);
+       if( !keyrouter.e_window_create_handler )                        SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_CREATE handler\n", __FUNCTION__);
+       if( !keyrouter.e_window_property_handler )              SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_WINDOW_PROPERTY handler\n", __FUNCTION__);
+       if( !keyrouter.e_border_stack_handler )                 SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add E_EVENT_BORDER_STACK handler\n", __FUNCTION__);
+       if( !keyrouter.e_border_remove_handler )                SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add E_EVENT_BORDER_REMOVE handler\n", __FUNCTION__);
+       if( !keyrouter.e_event_generic_handler )                        SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_GENERIC handler\n", __FUNCTION__);
+       if( !keyrouter.e_event_any_handler )                    SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to add ECORE_X_EVENT_ANY handler\n", __FUNCTION__);
 
        return m;
 }
@@ -61,13 +55,8 @@ EAPI int
 e_modapi_shutdown (E_Module* m)
 {
        //Removing Event Handlers
-#ifdef _F_USE_XI_GRABDEVICE_
-       ecore_event_handler_del(keyrouter.e_event_generic_handler);
-#else//_F_USE_XI_GRABDEVICE_
        ecore_event_handler_del(keyrouter.e_event_generic_handler);
        ecore_event_handler_del(keyrouter.e_event_any_handler);
-#endif//_F_USE_XI_GRABDEVICE_
-       //ecore_event_handler_del(e_border_add_handler);
        ecore_event_handler_del(keyrouter.e_window_property_handler);
        ecore_event_handler_del(keyrouter.e_border_stack_handler);
        ecore_event_handler_del(keyrouter.e_border_remove_handler);
@@ -80,15 +69,11 @@ e_modapi_shutdown (E_Module* m)
        keyrouter.e_window_configure_handler = NULL;
        keyrouter.e_window_destroy_handler = NULL;
        keyrouter.e_window_create_handler = NULL;
-       //keyrouter.e_border_add_handler = NULL;
        keyrouter.e_window_property_handler = NULL;
        keyrouter.e_border_stack_handler = NULL;
        keyrouter.e_border_remove_handler = NULL;
-#ifdef _F_USE_XI_GRABDEVICE_
        keyrouter.e_event_generic_handler = NULL;
-#else//_F_USE_XI_GRABDEVICE_
        keyrouter.e_event_any_handler = NULL;
-#endif//_F_USE_XI_GRABDEVICE_
 
        _e_keyrouter_fini();
 
@@ -110,14 +95,14 @@ _e_keyrouter_x_input_init(void)
 
        if( !XQueryExtension(keyrouter.disp, "XInputExtension", &keyrouter.xi2_opcode, &event, &error) )
        {
-               printf("[keyrouter][%s] XInput Extension isn't supported.\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] XInput Extension isn't supported.\n", __FUNCTION__);
                keyrouter.xi2_opcode = -1;
                return;
        }
 
        if( XIQueryVersion(keyrouter.disp, &major, &minor) == BadRequest )
        {
-               printf("[keyrouter][%s] Failed to query XI version.\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to query XI version.\n", __FUNCTION__);
                keyrouter.xi2_opcode = -1;
                return;
        }
@@ -131,45 +116,14 @@ _e_keyrouter_x_input_init(void)
 
        /* Events we want to listen for all */
        XISetMask(keyrouter.eventmask_all.mask, XI_HierarchyChanged);
-#ifdef _F_ENABLE_MOUSE_POPUP
-       XISetMask(keyrouter.eventmask_all.mask, XI_ButtonPress);
-       XISetMask(keyrouter.eventmask_all.mask, XI_ButtonRelease);
-#endif//_F_ENABLE_MOUSE_POPUP
 
        /* Events we want to listen for a part */
        XISetMask(keyrouter.eventmask_part.mask, XI_HierarchyChanged);
 
        /* select XI events for a part */
        XISelectEvents(keyrouter.disp, keyrouter.rootWin, &keyrouter.eventmask_part, 1);
-
-#ifdef _F_USE_XI_GRABDEVICE_
-       /* Set up MPX events */
-       memset(&keyrouter.eventmask_0, 0L, sizeof(XIEventMask));
-
-       keyrouter.eventmask.deviceid = XIAllDevices;//or XIAllMasterDevices
-       keyrouter.eventmask.mask_len = sizeof(keyrouter.mask);
-       keyrouter.eventmask.mask = keyrouter.mask;
-
-       /* Events we want to listen for */
-       XISetMask(keyrouter.mask, XI_KeyPress);
-       XISetMask(keyrouter.mask, XI_KeyRelease);
-
-       gev = (XEvent *)malloc(sizeof(XEvent));
-       gcookie = (XGenericEventCookie *)malloc(sizeof(XGenericEventCookie));
-
-       if( !gev || !gcookie )
-       {
-               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for XEvent/XGenericEventCookie !\n", __FUNCTION__);
-               return;
-       }
-
-       gcookie->type = GenericEvent;
-       gcookie->extension = xi2_opcode;
-       gcookie->display = gev->xany.display = keyrouter.disp;
-#endif
 }
 
-#ifndef _F_USE_XI_GRABDEVICE_
 static int
 _e_keyrouter_cb_event_any(void *data, int ev_type, void *event)
 {
@@ -180,36 +134,12 @@ _e_keyrouter_cb_event_any(void *data, int ev_type, void *event)
 
        if( type == keyrouter.DeviceKeyPress )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] DeviceKeyPress (type = %d, keycode = %d)\n", __FUNCTION__, type, xdevkey->keycode);
-#endif
                ev->type = KeyPress;
        }
        else if( type == keyrouter.DeviceKeyRelease )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] DeviceKeyRelease (type = %d, keycode = %d)\n", __FUNCTION__, type, xdevkey->keycode);
-#endif
                ev->type = KeyRelease;
        }
-#ifdef _F_ENABLE_MOUSE_POPUP
-       else if( type == ButtonPress && ev->xbutton.button == 3)
-       {
-#ifdef __DEBUG__
-               fprintf(stderr, "[keyrouter][%s] Mouse Right ButtonPress (type = %d, button=%d, x_root=%d, y_root=%d, x=%d, y=%d)\n", __FUNCTION__, type, ev->xbutton.button,
-                               ev->xbutton.x_root, ev->xbutton.y_root, ev->xbutton.x, ev->xbutton.y);
-#endif
-               if( !keyrouter.popup )
-               {
-                       keyrouter.popup_rootx = ev->xbutton.x_root;
-                       keyrouter.popup_rooty = ev->xbutton.y_root;
-                       keyrouter.rbutton_pressed_on_popup = 0;
-                       popup_show();
-               }
-
-               return 1;
-       }
-#endif//_F_ENABLE_MOUSE_POPUP
        else
                return 1;
 
@@ -217,11 +147,6 @@ _e_keyrouter_cb_event_any(void *data, int ev_type, void *event)
        ev->xkey.keycode = xdevkey->keycode;
        ev->xkey.time = xdevkey->time;
 
-#ifdef __DEBUG__
-       fprintf(stderr, "[keyrouter][%s] called !\n", __FUNCTION__);
-       fprintf(stderr, "[keyrouter][%s] keycode=%d, type=%s\n", __FUNCTION__, ev->xkey.keycode, (ev->type==KeyPress) ? "KeyPress" : "KeyRelease");
-#endif
-
        if(!_e_keyrouter_is_waiting_key_list_empty(ev))
                return 1;
 
@@ -232,79 +157,6 @@ _e_keyrouter_cb_event_any(void *data, int ev_type, void *event)
 
        return 1;
 }
-#else//_F_USE_XI_GRABDEVICE_
-static int
-_e_keyrouter_cb_event_generic(void *data, int ev_type, void *event)
-{
-       Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)event;
-       XIDeviceEvent *evData = (XIDeviceEvent *)(e->data);
-
-       if( e->extension != keyrouter.xi2_opcode || ( e->evtype != XI_KeyPress && e->evtype != XI_KeyRelease ))
-       {
-               fprintf(stderr, "[keyrouter][%s] Invalid event !(extension:%d, evtype:%d)\n", __FUNCTION__, e->extension, e->evtype);
-               return 1;
-       }
-
-       if( !evData )
-       {
-               fprintf(stderr, "[keyrouter][%s] e->data is NULL !\n", __FUNCTION__);
-               return 1;
-       }
-
-       if( evData->send_event )
-       {
-               return 0;
-       }
-
-       keyrouter.gcookie->data = (XIDeviceEvent *)malloc(sizeof(XIDeviceEvent));
-
-       if( !keyrouter.gcookie->data )
-       {
-               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for XIDeviceEvent !\n", __FUNCTION__);
-               return 1;
-       }
-
-#ifdef __DEBUG__
-       fprintf(stderr, "[keyrouter][%s] evData->deviceid=%d, evData->sourceid=%d\n", __FUNCTION__, evData->deviceid, evData->sourceid);
-#endif
-
-       evData->deviceid = 3;//Virtual Core Keyboard
-       evData->child = None;
-
-       //KeyPress or KeyRelease
-       keyrouter.gev->type = e->evtype;
-       keyrouter.gev->xkey.keycode = evData->detail;
-
-       //XI_KeyPress or XI_KeyRelease
-       keyrouter.gcookie->evtype = e->evtype;
-       keyrouter.gcookie->cookie = e->cookie;
-       memcpy(keyrouter.gcookie->data, e->data, sizeof(XIDeviceEvent));
-
-       fprintf(stderr, "[keyrouter][%s] called !\n", __FUNCTION__);
-
-#if 1//def __DEBUG__
-       fprintf(stderr, "[keyrouter][%s] cookie->type=%d, cookie->extension=%d, cookie->evtype=%d, cookie->cookie=%d\n", __FUNCTION__, keyrouter.gcookie->type, keyrouter.gcookie->extension, keyrouter.gcookie->evtype, keyrouter.gcookie->cookie);
-       switch( keyrouter.gcookie->evtype )
-       {
-               case XI_KeyPress:
-                       fprintf(stderr, "[keyrouter][%s] XI_KeyPress!\n", __FUNCTION__);
-                       break;
-
-               case XI_KeyRelease:
-                       fprintf(stderr, "[keyrouter][%s] XI_KeyRelease!\n", __FUNCTION__);
-                       break;
-       }
-#endif
-
-       DeliverKeyEvents(keyrouter.gev, keyrouter.gcookie);
-
-out:
-       if( keyrouter.gcookie->data )
-               free( keyrouter.gcookie->data );
-
-       return 1;
-}
-#endif//_F_USE_XI_GRABDEVICE_
 
 static void
 _e_keyrouter_hwkey_event_handler(XEvent *ev)
@@ -323,9 +175,7 @@ _e_keyrouter_hwkey_event_handler(XEvent *ev)
        }
        else if( ev->type == KeyPress ) //KeyPress handling for key composition
        {
-#if 1//def __DEBUG__
-               fprintf(stderr, "\n\e[31m[keyrouter][%s] KeyPress (keycode:%d)\e[0m\n", __FUNCTION__, ev->xkey.keycode);
-#endif//__DEBUG__
+               SECURE_SLOGD("\n\e[31m[keyrouter][%s] KeyPress (keycode:%d)\e[0m\n", __FUNCTION__, ev->xkey.keycode);
 
                if(!keyrouter.modkey_set)
                {
@@ -338,7 +188,7 @@ _e_keyrouter_hwkey_event_handler(XEvent *ev)
                        
                                        if(keyrouter.modkey[i].idx_mod)
                                        {
-                                               fprintf(stderr, "\n\e[35m[keyrouter][%s][%d] Modifier Key ! (keycode=%d)\e[0m\n", __FUNCTION__, i, ev->xkey.keycode);
+                                               SECURE_SLOGD("\n\e[35m[keyrouter][%s][%d] Modifier Key ! (keycode=%d)\e[0m\n", __FUNCTION__, i, ev->xkey.keycode);
                                                keyrouter.modkey[i].set = 1;
                                                keyrouter.modkey_set = 1;
                                                keyrouter.modkey[i].time = ev->xkey.time;
@@ -358,7 +208,7 @@ _e_keyrouter_hwkey_event_handler(XEvent *ev)
                                
                                if(keyrouter.modkey[i].composited)
                                {
-                                       fprintf(stderr, "\n\e[35m[keyrouter][%s][%d] Composition Key ! (keycode=%d)\e[0m\n", __FUNCTION__, i, ev->xkey.keycode);
+                                       SECURE_SLOGD("\n\e[35m[keyrouter][%s][%d] Composition Key ! (keycode=%d)\e[0m\n", __FUNCTION__, i, ev->xkey.keycode);
                                
                                        //Cancel Press : Send cancel key press to Modifier Key-grabbed window(s)
                                        ev->xkey.keycode = keyrouter.modkey[i].keys[keyrouter.modkey[i].idx_mod-1].keycode;
@@ -382,13 +232,13 @@ _e_keyrouter_hwkey_event_handler(XEvent *ev)
                                                key_data->ev_type = KeyRelease;
                                                key_data->keycode = keyrouter.modkey[i].keys[0].keycode;
                                                keyrouter.ignored_key_list = eina_list_append(keyrouter.ignored_key_list, key_data);
-                                               fprintf(stderr, "[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
+                                               SECURE_SLOGD("[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
                                                
                                                key_data = malloc(sizeof(key_event_info));
                                                key_data->ev_type = KeyRelease;
                                                key_data->keycode = keyrouter.modkey[i].keys[1].keycode;
                                                keyrouter.ignored_key_list = eina_list_append(keyrouter.ignored_key_list, key_data);
-                                               fprintf(stderr, "[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
+                                               SECURE_SLOGD("[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
                                        }
                                        else//need to be waited for keys
                                        {
@@ -398,14 +248,14 @@ _e_keyrouter_hwkey_event_handler(XEvent *ev)
                                                key_data->keycode = keyrouter.modkey[i].keys[0].keycode;
                                                key_data->modkey_index = i;
                                                keyrouter.waiting_key_list = eina_list_append(keyrouter.waiting_key_list, key_data);
-                                               fprintf(stderr, "[keyrouter][%s] waiting key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
+                                               SECURE_SLOGD("[keyrouter][%s] waiting key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
                                                
                                                key_data = malloc(sizeof(key_event_info));
                                                key_data->ev_type = KeyRelease;
                                                key_data->keycode = keyrouter.modkey[i].keys[1].keycode;
                                                key_data->modkey_index = i;
                                                keyrouter.waiting_key_list = eina_list_append(keyrouter.waiting_key_list, key_data);
-                                               fprintf(stderr, "[keyrouter][%s] waiting key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
+                                               SECURE_SLOGD("[keyrouter][%s] waiting key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
                                        }
                                
                                        ResetModKeyInfo();
@@ -431,13 +281,13 @@ _e_keyrouter_cb_event_generic(void *data, int ev_type, void *event)
 
        if( e->extension != keyrouter.xi2_opcode )
        {
-               fprintf(stderr, "[keyrouter][%s] Invalid event !(extension:%d, evtype:%d)\n", __FUNCTION__, e->extension, e->evtype);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Invalid event !(extension:%d, evtype:%d)\n", __FUNCTION__, e->extension, e->evtype);
                return 1;
        }
 
        if( !evData || evData->send_event )
        {
-               fprintf(stderr, "[keyrouter][%s] Generic event data is not available or the event was sent via XSendEvent (and will be ignored) !\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Generic event data is not available or the event was sent via XSendEvent (and will be ignored) !\n", __FUNCTION__);
                return 1;
        }
 
@@ -454,10 +304,6 @@ _e_keyrouter_cb_event_generic(void *data, int ev_type, void *event)
                        xev.xany.display = keyrouter.disp;
                        xev.xkey.time = evData->time;
 
-#ifdef __DEBUG__
-                       fprintf(stderr, "[keyrouter][%s] keycode=%d, type=%s\n", __FUNCTION__, xev.xkey.keycode, (xev.type==XI_KeyPress) ? "XI_KeyPress" : "XI_KeyRelease");
-#endif
-
                        if(!_e_keyrouter_is_waiting_key_list_empty(&xev))
                                return 1;
 
@@ -466,21 +312,6 @@ _e_keyrouter_cb_event_generic(void *data, int ev_type, void *event)
 
                        _e_keyrouter_hwkey_event_handler(&xev);
                        break;
-
-#ifdef _F_ENABLE_MOUSE_POPUP
-               case XI_ButtonRelease:
-                       if( evData->detail != 1 && evData->detail != 3 )
-                               break;
-
-                       if( keyrouter.popup && evData->child != keyrouter.popup->evas_win )
-                       {
-                               if( !keyrouter.rbutton_pressed_on_popup )
-                                       popup_destroy();
-                               else
-                                       keyrouter.rbutton_pressed_on_popup = 0;
-                       }
-                       break;
-#endif//_F_ENABLE_MOUSE_POPUP
        }
 
        return 1;
@@ -501,10 +332,6 @@ _e_keyrouter_cb_window_create(void *data, int ev_type, void *ev)
        XSelectInput(keyrouter.disp, e->win, att.event_mask.mine | PropertyChangeMask | StructureNotifyMask);
        XSync(keyrouter.disp, False);
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] TOP-level window ! (id=0x%x, parent=0x%x, override=%d)\n", __FUNCTION__, e->win, e->parent, e->override);
-#endif
-
        int ret = 0, count = 0;
        int i, result, keycode, grab_mode;
        unsigned int *prop_data = NULL;
@@ -521,10 +348,6 @@ _e_keyrouter_cb_window_create(void *data, int ev_type, void *ev)
                grab_mode = prop_data[i] & GRAB_MODE_MASK;
                keycode = prop_data[i] & (~GRAB_MODE_MASK);
 
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] prop_data[%d] = %d, keycode = %d(hex:%x), grab_mode = %d(hex:%x)\n", __FUNCTION__, i, (int)(prop_data[i]), keycode, keycode, grab_mode, grab_mode);
-#endif
-
                _e_keyrouter_update_key_delivery_list(e->win, keycode, grab_mode, 1);
        }
 
@@ -544,26 +367,6 @@ _e_keyrouter_cb_window_property(void *data, int ev_type, void *ev)
        int res = -1;
        unsigned int ret_val = 0;
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-       //check and rotate popup menu
-       if( e->atom == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE && e->win == keyrouter.rootWin )
-       {
-               res = ecore_x_window_prop_card32_get(e->win, ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE, &ret_val, 1);
-
-               if( res == 1 )
-               {
-                       if( keyrouter.popup_angle != ret_val )
-                       {
-                               keyrouter.popup_angle = ret_val;
-                               if( !keyrouter.popup ) goto out;
-                               popup_update();
-                       }
-               }
-
-               goto out;
-       }
-#endif // _F_ENABLE_MOUSE_POPUP
-
        if( e->atom == keyrouter.atomDeviceStatus && e->win == keyrouter.rootWin )
        {
                res = ecore_x_window_prop_card32_get(e->win, keyrouter.atomDeviceStatus, &ret_val, 1);
@@ -592,32 +395,17 @@ _e_keyrouter_cb_window_property(void *data, int ev_type, void *ev)
        if( e->atom != keyrouter.atomGrabKey)
                goto out;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] PropertyNotify received (Client Window = 0x%x, Atom = %d)\n", __FUNCTION__, e->win, e->atom);
-#endif
-
        //Get the window property using the atom
        ret = ecore_x_window_prop_property_get (e->win, e->atom, ECORE_X_ATOM_CARDINAL, 32, (unsigned char **)&prop_data, &count);
 
        if( !ret || !prop_data )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] Failed to get window property OR window property is empty ! (window = 0x%x)\n", __FUNCTION__, e->win);
-#endif
                RemoveWindowDeliveryList(e->win, 0, 0);
                goto out;
        }
 
-#ifdef __DEBUG__
-       PrintKeyDeliveryList();
-#endif
-
        RemoveWindowDeliveryList(e->win, 0, 0);
 
-#ifdef __DEBUG__
-       PrintKeyDeliveryList();
-#endif
-
        int i;
        int keycode;
        int grab_mode;
@@ -628,10 +416,6 @@ _e_keyrouter_cb_window_property(void *data, int ev_type, void *ev)
                grab_mode = prop_data[i] & GRAB_MODE_MASK;
                keycode = prop_data[i] & (~GRAB_MODE_MASK);
 
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] prop_data[%d] = %d, keycode = %d(hex:%x), grab_mode = %d(hex:%x)\n", __FUNCTION__, i, (int)(prop_data[i]), keycode, keycode, grab_mode, grab_mode);
-#endif
-
                _e_keyrouter_update_key_delivery_list(e->win, keycode, grab_mode, 1);
        }
 
@@ -648,31 +432,15 @@ _e_keyrouter_cb_e_border_stack(void *data, int ev_type, void *ev)
        if(!e->border)
                return 1;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] E_EVENT_BORDER_STACK received (e->border->win = 0x%x, Client window = 0x%x) !\n", __FUNCTION__, e->border->win, e->border->client.win);
-#endif
-
        keyrouter.isWindowStackChanged = 1;
 
        if( e->type == E_STACKING_ABOVE )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] == TOP == (window : 0x%x)\n", __FUNCTION__, e->border->client.win);
-#endif
                AdjustTopPositionDeliveryList(e->border->client.win, 1);
-#ifdef __DEBUG__
-               PrintKeyDeliveryList();
-#endif
        }
        else
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] == NO TOP == (window : 0x%x)\n", __FUNCTION__, e->border->client.win);
-#endif
                AdjustTopPositionDeliveryList(e->border->client.win, 0);
-#ifdef __DEBUG__
-               PrintKeyDeliveryList();
-#endif
        }
 
        return 1;
@@ -694,9 +462,6 @@ _e_keyrouter_cb_e_border_remove(void *data, int ev_type, void *ev)
 
                if( ret != 1 )
                {
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] E_EVENT_BORDER_REMOVE ! Client Window is destroyed !(window : 0x%x)\n", __FUNCTION__, e->border->client.win);
-#endif
                        keyrouter.isWindowStackChanged = 1;
                        RemoveWindowDeliveryList(e->border->client.win, 0, 1);
                        return 1;
@@ -704,9 +469,6 @@ _e_keyrouter_cb_e_border_remove(void *data, int ev_type, void *ev)
 
                if( ret_val == 1 )
                {
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] E_EVENT_BORDER_REMOVE ! Client Window is destroyed !(window : 0x%x)\n", __FUNCTION__, e->border->client.win);
-#endif
                        keyrouter.isWindowStackChanged = 1;
                        RemoveWindowDeliveryList(e->border->client.win, 0, 1);
                        return 1;
@@ -714,9 +476,6 @@ _e_keyrouter_cb_e_border_remove(void *data, int ev_type, void *ev)
 
                if( ret_val == 0 )
                {
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] E_EVENT_BORDER_REMOVE ! Client Window is hidden !(window : 0x%x)\n", __FUNCTION__, e->border->client.win);
-#endif
                        keyrouter.isWindowStackChanged = 1;
                        RemoveWindowDeliveryList(e->border->client.win, 0, 1);
                        return 1;
@@ -737,10 +496,6 @@ _e_keyrouter_cb_window_destroy(void *data, int ev_type, void *ev)
        if( bd )
                return 1;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] DestroyNotify received (Top-level Window = 0x%x, event_win = 0x%x) !\n", __FUNCTION__, e->win, e->event_win);
-#endif
-
        keyrouter.isWindowStackChanged = 1;
        RemoveWindowDeliveryList(e->win, 0, 1);
 
@@ -761,10 +516,6 @@ _e_keyrouter_cb_window_configure(void *data, int ev_type, void *ev)
        if( keyrouter.rootWin != e->event_win )
                return 1;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] ConfigureNotify received (Top-level Window = 0x%x, above win = 0x%x, event win = 0x%x, override = %d, from_wm = %d)\n", __FUNCTION__, e->win, e->abovewin, e->event_win, e->override, e->from_wm);
-#endif
-
        keyrouter.isWindowStackChanged = 1;
        AdjustTopPositionDeliveryList(e->win, !!e->abovewin);
 
@@ -800,7 +551,7 @@ _e_keyrouter_cb_client_message (void* data, int type, void* event)
                        break;
 
                default:
-                       fprintf(stderr, "[keyrouter][cb_client_message] Unknown event type ! (type=%d)\n", event_type);
+                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][cb_client_message] Unknown event type ! (type=%d)\n", event_type);
        }
 
        return 1;
@@ -820,10 +571,6 @@ _e_keyrouter_cb_window_stack(void *data, int ev_type, void *ev)
        if( keyrouter.rootWin != e->event_win )
                return 1;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] CirculateNotify received (Top-level Window = 0x%x, event_win = 0x%x, detail = %d)\n", __FUNCTION__, e->win, e->event_win, e->detail);
-#endif
-
        keyrouter.isWindowStackChanged = 1;
        AdjustTopPositionDeliveryList(e->win, !e->detail);
 
@@ -855,7 +602,7 @@ static void _e_keyrouter_do_bound_key_action(XEvent *xev)
 
        if( !keyrouter.HardKeys[keycode].bind )
        {
-               fprintf(stderr, "[keyrouter][do_bound_key_action] bind info of key(%d) is NULL !\n", keycode);
+               SECURE_SLOGD("[keyrouter][do_bound_key_action] bind info of key(%d) is NULL !\n", keycode);
                return;
        }
 
@@ -863,7 +610,7 @@ static void _e_keyrouter_do_bound_key_action(XEvent *xev)
 
        if( !ev )
        {
-               fprintf(stderr, "[keyrouter][do_bound_key_action] Failed to allocate memory for Ecore_Event_Key !\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][do_bound_key_action] Failed to allocate memory for Ecore_Event_Key !\n");
                return;
        }
 
@@ -873,7 +620,7 @@ static void _e_keyrouter_do_bound_key_action(XEvent *xev)
        if( !ev->keyname || !ev->key )
        {
                free(ev);
-               fprintf(stderr, "[keyrouter][do_bound_key_action] Failed to allocate memory for key name !\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][do_bound_key_action] Failed to allocate memory for key name !\n");
                return;
        }
 
@@ -929,20 +676,20 @@ static Eina_Bool _e_keyrouter_is_waiting_key_list_empty(XEvent *ev)
                return EINA_TRUE;
        }
 
-       fprintf(stderr, "[keyrouter][%s] waiting_key_list is NOT empty !\n", __FUNCTION__);
-       fprintf(stderr, "[keyrouter][%s] type=%s, keycode=%d", __FUNCTION__, (ev->xkey.type==KeyPress) ? "KeyPress" : "KeyRelease", ev->xkey.keycode);
+       SECURE_SLOGD("[keyrouter][%s] waiting_key_list is NOT empty !\n", __FUNCTION__);
+       SECURE_SLOGD("[keyrouter][%s] type=%s, keycode=%d", __FUNCTION__, (ev->xkey.type==KeyPress) ? "KeyPress" : "KeyRelease", ev->xkey.keycode);
 
        EINA_LIST_FOREACH(keyrouter.waiting_key_list, l, data)
        {
                if( data && ev->type == data->ev_type && ev->xkey.keycode == data->keycode )
                {
                        //found !!!
-                       fprintf(stderr, "[keyrouter][%s] found !!! (keycode:%d, type=%d)\n", __FUNCTION__, data->keycode, data->ev_type);
+                       SECURE_SLOGD("[keyrouter][%s] found !!! (keycode:%d, type=%d)\n", __FUNCTION__, data->keycode, data->ev_type);
                        goto found;
                }
        }
 
-       fprintf(stderr, "[keyrouter][%s] not found !!! (keycode:%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
+       SECURE_SLOGD("[keyrouter][%s] not found !!! (keycode:%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
 
        //If a key press is coming before the waiting_key_list is cleared,
        //put its release into ignored_list.
@@ -952,13 +699,13 @@ static Eina_Bool _e_keyrouter_is_waiting_key_list_empty(XEvent *ev)
                key_data->ev_type = KeyRelease;
                key_data->keycode = ev->xkey.keycode;
                keyrouter.ignored_key_list = eina_list_append(keyrouter.ignored_key_list, key_data);
-               fprintf(stderr, "[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
+               SECURE_SLOGD("[keyrouter][%s] ignored key added (keycode=%d, type=%d)\n", __FUNCTION__, key_data->keycode, key_data->ev_type);
        }
        else if(ev->type == KeyRelease)
        {
                //If a key release which is contained in ignored_key_list is coming,
                //remove it from ignored_key_list.
-               fprintf(stderr, "[keyrouter][%s] check a key is exiting in ignored key list (keycode=%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
+               SECURE_SLOGD("[keyrouter][%s] check a key is exiting in ignored key list (keycode=%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
                _e_keyrouter_is_key_in_ignored_list(ev);
        }
 
@@ -967,12 +714,12 @@ static Eina_Bool _e_keyrouter_is_waiting_key_list_empty(XEvent *ev)
 found:
        modkey_index = data->modkey_index;
        keyrouter.waiting_key_list = eina_list_remove(keyrouter.waiting_key_list, data);
-       fprintf(stderr, "[keyrouter][%s][%d] key was remove from waiting_key_list !(keycode:%d, type:%d)\n",
+       SECURE_SLOGD("[keyrouter][%s][%d] key was remove from waiting_key_list !(keycode:%d, type:%d)\n",
                __FUNCTION__, modkey_index, ev->xkey.keycode, ev->type);
 
        if(!keyrouter.waiting_key_list)
        {
-               fprintf(stderr, "[keyrouter][%s] Waiting conditions are satified !\n", __FUNCTION__);
+               SECURE_SLOGD("[keyrouter][%s] Waiting conditions are satified !\n", __FUNCTION__);
 
                //Do Action : ex> send ClientMessage to root window
                DoKeyCompositionAction(modkey_index, 0);
@@ -992,25 +739,25 @@ static Eina_Bool _e_keyrouter_is_key_in_ignored_list(XEvent *ev)
                return EINA_FALSE;
        }
 
-       fprintf(stderr, "[keyrouter][%s] ignored_key_list is NOT empty !\n", __FUNCTION__);
+       SECURE_SLOGD("[keyrouter][%s] ignored_key_list is NOT empty !\n", __FUNCTION__);
 
        EINA_LIST_FOREACH(keyrouter.ignored_key_list, l, data)
        {
                if( data && ev->type == data->ev_type && ev->xkey.keycode == data->keycode )
                {
                        //found !!!
-                       fprintf(stderr, "[keyrouter][%s] found !!! (keycode:%d, type=%d)\n", __FUNCTION__, data->keycode, data->ev_type);
+                       SECURE_SLOGD("[keyrouter][%s] found !!! (keycode:%d, type=%d)\n", __FUNCTION__, data->keycode, data->ev_type);
                        goto found;
                }
        }
 
-       fprintf(stderr, "[keyrouter][%s] not found !!! (keycode:%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
+       SECURE_SLOGD("[keyrouter][%s] not found !!! (keycode:%d, type=%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
 
        return EINA_FALSE;
 
 found:
        keyrouter.ignored_key_list = eina_list_remove(keyrouter.ignored_key_list, data);
-       fprintf(stderr, "[keyrouter][%s] key was remove from ignored_list !(keycode:%d, type:%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
+       SECURE_SLOGD("[keyrouter][%s] key was remove from ignored_list !(keycode:%d, type:%d)\n", __FUNCTION__, ev->xkey.keycode, ev->type);
 
        return EINA_TRUE;
 }
@@ -1027,7 +774,7 @@ static void _e_keyrouter_device_add(int id, int type)
        {
                if( (kdi) && (kdi->type==E_KEYROUTER_HWKEY) && (kdi->id == id) )
                {
-                       fprintf(stderr, "[keyrouter][%s] Slave key device (id=%d, name=%s) was added !\n", __FUNCTION__, id, kdi->name);
+                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Slave key device (id=%d, name=%s) was added !\n", __FUNCTION__, id, kdi->name);
                        detachSlave(id);
                        return;
                }
@@ -1039,7 +786,7 @@ static void _e_keyrouter_device_add(int id, int type)
 
                if( !info || ndevices <= 0 )
                {
-                       fprintf(stderr, "[keyrouter][%s] There is no queried XI device. (device id=%d, type=%d)\n", __FUNCTION__, id, type);
+                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] There is no queried XI device. (device id=%d, type=%d)\n", __FUNCTION__, id, type);
                        goto out;
                }
 
@@ -1055,7 +802,7 @@ static void _e_keyrouter_device_add(int id, int type)
 
                if( !data )
                {
-                       fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
+                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to allocate memory for device info !\n", __FUNCTION__);
                        goto out;
                }
 
@@ -1078,7 +825,7 @@ static void _e_keyrouter_device_remove(int id, int type)
 
        if( !keyrouter.device_list )
        {
-               fprintf(stderr, "[keyrouter][%s] device list is empty ! something's wrong ! (id=%d, type=%d)\n", __FUNCTION__, id, type);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] device list is empty ! something's wrong ! (id=%d, type=%d)\n", __FUNCTION__, id, type);
                goto out;
        }
 
@@ -1093,14 +840,14 @@ static void _e_keyrouter_device_remove(int id, int type)
 
                                case E_KEYROUTER_HOTPLUGGED:
                                case E_KEYROUTER_KEYBOARD:
-                                       fprintf(stderr, "[keyrouter][%s] Slave hotplugged key|keyboard device (id=%d, name=%s, type=%d) was removed/disabled !\n",
+                                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Slave hotplugged key|keyboard device (id=%d, name=%s, type=%d) was removed/disabled !\n",
                                                __FUNCTION__, id, data->name, type);
                                        keyrouter.device_list = eina_list_remove(keyrouter.device_list, data);
                                        free(data);
                                        goto out;
 
                                default:
-                                       fprintf(stderr, "[keyrouter][%s] Unknown type of device ! (id=%d, type=%d, name=%s, device type=%d)\n",
+                                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Unknown type of device ! (id=%d, type=%d, name=%s, device type=%d)\n",
                                                __FUNCTION__, data->id, type, data->name, data->type);
                                        keyrouter.device_list = eina_list_remove(keyrouter.device_list, data);
                                        free(data);
@@ -1159,7 +906,7 @@ int _e_keyrouter_init()
 
        if( !keyrouter.disp )
        {
-               fprintf(stderr, "\e[32m[keyrouter] Failed to open display..!\e[0m\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "\e[32m[keyrouter] Failed to open display..!\e[0m\n");
                ret = 0;
                goto out;
        }
@@ -1181,7 +928,7 @@ int _e_keyrouter_init()
 
        if(!keyrouter.input_window)
        {
-               fprintf(stderr, "[keyrouter] Failed to create input_window !\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter] Failed to create input_window !\n");
        }
        else
        {
@@ -1191,53 +938,33 @@ int _e_keyrouter_init()
        keyrouter.zone = _e_keyrouter_get_zone();
        if( !keyrouter.zone )
        {
-               fprintf(stderr, "[keyrouter] Failed to get zone !\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter] Failed to get zone !\n");
                ret = 0;
                goto out;
        }
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-       ecore_x_window_button_grab(keyrouter.rootWin, 3, ECORE_X_EVENT_MASK_MOUSE_DOWN |
-                                ECORE_X_EVENT_MASK_MOUSE_UP |
-                                ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
-#endif//_F_ENABLE_MOUSE_POPUP
-
-#ifndef _F_USE_XI_GRABDEVICE_
        grab_result = GrabKeyDevices(keyrouter.rootWin);
 
        if( !grab_result )
        {
-               fprintf(stderr, "\e[32m[keyrouter] Failed to GrabDevices() !\e[0m\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "\e[32m[keyrouter] Failed to GrabDevices() !\e[0m\n");
                ret = 0;
                goto out;
        }
 
        keyrouter.DeviceKeyPress = keyrouter.nInputEvent[INPUTEVENT_KEY_PRESS];
        keyrouter.DeviceKeyRelease = keyrouter.nInputEvent[INPUTEVENT_KEY_RELEASE];
-#else//_F_USE_XI_GRABDEVICE_
-       grab_result = GrabXIKeyDevices();
-
-       if( !grab_result )
-       {
-               fprintf(stderr, "\e[32m[keyrouter] Failed to GrabXIKeyDevices() !\e[0m\n");
-               ret = 0;
-               goto out;
-       }
-#endif//_F_USE_XI_GRABDEVICE_
 
        keyrouter.modkey = calloc(2, sizeof(ModifierKey));
 
        if(!keyrouter.modkey)
        {
-               fprintf(stderr, "\e[32m[keyrouter] Failed to allocate memory for key composition !\e[0m\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "\e[32m[keyrouter] Failed to allocate memory for key composition !\e[0m\n");
                ret = 0;
                goto out;
        }
 
        InitModKeys();
-#ifdef _F_ENABLE_MOUSE_POPUP
-       InitHardKeyCodes();
-#endif//_F_ENABLE_MOUSE_POPUP
        BuildKeyGrabList(keyrouter.rootWin);
 
 out:
@@ -1246,28 +973,19 @@ out:
 
 void _e_keyrouter_fini()
 {
-#ifndef _F_USE_XI_GRABDEVICE_
        UngrabKeyDevices();
-#else
-       UngrabXIKeyDevices();
-#endif
 }
 
 static void _e_keyrouter_structure_init()
 {
        memset(&keyrouter, 0L, sizeof(keyrouter));
 
-       keyrouter.fplog = stderr;
        keyrouter.DeviceKeyPress = -1;
        keyrouter.DeviceKeyRelease = -1;
        keyrouter.xi2_opcode = -1;
        keyrouter.isWindowStackChanged = 1;
        keyrouter.prev_sent_keycode = 0;
        keyrouter.resTopVisibleCheck = 0;
-#ifdef _F_ENABLE_MOUSE_POPUP
-       keyrouter.popup_angle = 0;
-       keyrouter.toggle = 0;
-#endif//_F_ENABLE_MOUSE_POPUP
        keyrouter.device_list = NULL;
        keyrouter.ignored_key_list = NULL;
        keyrouter.waiting_key_list = NULL;
@@ -1304,7 +1022,7 @@ static void _e_keyrouter_grab_hwkeys(int devid)
 
                if(!origkeymap)
                {
-                       fprintf(stderr, "[keyrouter] Failed to get keyboard mapping from X \n");
+                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter] Failed to get keyboard mapping from X \n");
                        return;
                }
 
@@ -1326,7 +1044,7 @@ static void _e_keyrouter_grab_hwkeys(int devid)
 
                        if(!hki)
                        {
-                               fprintf(stderr, "[keyrouter] Failed to allocate memory for HW keymap information !\n");
+                               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter] Failed to allocate memory for HW keymap information !\n");
                                XFree(origkeymap);
                                return;
                        }
@@ -1350,7 +1068,7 @@ static void _e_keyrouter_grab_hwkeys(int devid)
 
                        if(!keycodes)
                        {
-                               fprintf(stderr, "[keyrouter] Failed to allocate memory for keycode array !\n");
+                               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter] Failed to allocate memory for keycode array !\n");
                                XFree(origkeymap);
                                free(hki);
                                return;
@@ -1399,13 +1117,10 @@ static void _e_keyrouter_grab_hwkeys(int devid)
                        if(devid)
                        {
                                result = XIGrabKeycode(keyrouter.disp, devid, hkinfo->keycodes[k], keyrouter.rootWin, GrabModeAsync, GrabModeAsync, False, &mask, nmods, modifiers);
-#ifdef __DEBUG__
-                               fprintf(stderr, "[keyrouter][grab_hwkeys][k=%d] %s (keycode:%d) was grabbed (result=%d)!!\n", k, hkinfo->key_name, hkinfo->keycodes[k], result);
-#endif /* #ifdef __DEBUG__ */
-       
+
                                if(result < 0)
                                {
-                                       fprintf(stderr, "[keyrouter][grab_hwkeys] Failed to grab keycode (=%d) !\n", hkinfo->keycodes[k]);
+                                       SECURE_SLOGD("[keyrouter][grab_hwkeys] Failed to grab keycode (=%d) !\n", hkinfo->keycodes[k]);
                                        continue;
                                }
                        }
@@ -1454,9 +1169,6 @@ static void _e_keyrouter_bindings_init()
 
                        if( !keycode || keycode >= 255 )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "[keyrouter][%s] Failed to get keycode from keyname(=%s),(i=%d) !\n", __FUNCTION__, HWKeys[i], i);
-#endif//__DEBUG__
                                continue;
                        }
 
@@ -1465,9 +1177,6 @@ static void _e_keyrouter_bindings_init()
 
                        if( !keyrouter.HardKeys[keycode].bind || strcmp(keyrouter.HardKeys[keycode].bind->key, HWKeys[i]) )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "[keyrouter][%s] Failed to get bound key using e_bindings_key_find() (keyname=%s)!\n", __FUNCTION__, HWKeys[i]);
-#endif//__DEBUG__
                                continue;
                        }
 
@@ -1475,7 +1184,7 @@ static void _e_keyrouter_bindings_init()
                        ecore_x_window_key_ungrab(keyrouter.rootWin, keyrouter.HardKeys[keycode].bind->key,
                                       _e_keyrouter_modifiers(keyrouter.HardKeys[keycode].bind->mod), keyrouter.HardKeys[keycode].bind->any_mod);
 
-                       fprintf(stderr, "[keyrouter][bindings_init] %s (keycode:%d) was bound !!\n", keyrouter.HardKeys[keycode].bind->key, keycode);
+                       SECURE_SLOGD("[keyrouter][bindings_init] %s (keycode:%d) was bound !!\n", keyrouter.HardKeys[keycode].bind->key, keycode);
                }
                else
                        break;
@@ -1512,17 +1221,10 @@ _e_keyrouter_update_key_delivery_list(Ecore_X_Window win, int keycode, const int
 
                        for(c = 0 ; c < hkinfo->num_keycodes ; c++)
                        {
-#ifdef __DEBUG__
-                               PrintKeyDeliveryList();
-#endif
                                result = AddWindowToDeliveryList(win, hkinfo->keycodes[c], grab_mode, 1);
 
                                if( result )
-                                       fprintf(stderr, "\e[32m[keyrouter][%s] Failed to add window (0x%x) to delivery list ! keycode=%x, grab_mode=0x%X\e[0m\n", __FUNCTION__, win, hkinfo->keycodes[c], grab_mode);
-#ifdef __DEBUG__
-                               PrintKeyDeliveryList();
-#endif
-
+                                       SECURE_SLOGD("\e[32m[keyrouter][%s] Failed to add window (0x%x) to delivery list ! keycode=%x, grab_mode=0x%X\e[0m\n", __FUNCTION__, win, hkinfo->keycodes[c], grab_mode);
                        }
 
                        return;
@@ -1533,17 +1235,12 @@ _e_keyrouter_update_key_delivery_list(Ecore_X_Window win, int keycode, const int
 
 grab_a_keycode_only:
 
-#ifdef __DEBUG__
-               PrintKeyDeliveryList();
-#endif
                result = AddWindowToDeliveryList(win,  keycode, grab_mode, 1);
 
                if( result )
-                       fprintf(stderr, "\e[32m[keyrouter][%s] Failed to add window (0x%x) to delivery list ! keycode=%x, grab_mode=0x%X\e[0m\n", __FUNCTION__, win, keycode, grab_mode);
-
-#ifdef __DEBUG__
-               PrintKeyDeliveryList();
-#endif
+               {
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] Failed to add window (0x%x) to delivery list ! keycode=%x, grab_mode=0x%X\e[0m\n", __FUNCTION__, win, keycode, grab_mode);
+               }
 }
 
 static int GetItemFromWindow(Window win, const char* atom_name, unsigned int **key_list)
@@ -1584,9 +1281,6 @@ static void BuildKeyGrabList(Window root)
 
        for( i=0 ; i < num_children; i++ )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] window = 0x%X\n", __FUNCTION__, (int)(childwins[i]));
-#endif
                BuildKeyGrabList(childwins[i]);
 
                n_items = GetItemFromWindow(childwins[i], STR_ATOM_GRAB_KEY, &key_list);
@@ -1596,9 +1290,7 @@ static void BuildKeyGrabList(Window root)
                        {
                                grab_mode = key_list[j] & GRAB_MODE_MASK;
                                keycode = key_list[j] & (~GRAB_MODE_MASK);
-#ifdef __DEBUG__
-                               printf("[keyrouter][%s] window = 0x%x, grab_mode = 0x%X, keycode = %d\n", __FUNCTION__, (int)(childwins[i]), grab_mode, keycode);
-#endif
+
                                _e_keyrouter_update_key_delivery_list(childwins[i], keycode, grab_mode, 1);
                        }
                }
@@ -1613,7 +1305,6 @@ static void InitGrabKeyDevices()
        memset(keyrouter.HardKeys, (int)NULL, sizeof(keyrouter.HardKeys));
 }
 
-#ifndef _F_USE_XI_GRABDEVICE_
 //Function for getting device pointer through device name
 static int GrabKeyDevice(Window win,
                const char* DeviceName,
@@ -1629,7 +1320,7 @@ static int GrabKeyDevice(Window win,
 
        if( !pDev )
        {
-               fprintf(stderr, "[keyrouter][%s] Fail to open the device (id=%d) !\n", __FUNCTION__, DeviceID);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Fail to open the device (id=%d) !\n", __FUNCTION__, DeviceID);
                goto out;
        }
 
@@ -1643,7 +1334,7 @@ static int GrabKeyDevice(Window win,
 
        if( result )
        {
-               fprintf(stderr, "[keyrouter][%s] Fail to grab the device (error=%d, id=%d) !\n", __FUNCTION__, result, DeviceID);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Fail to grab the device (error=%d, id=%d) !\n", __FUNCTION__, result, DeviceID);
                if( pDev )      XCloseDevice(keyrouter.disp, pDev);
                goto out;
        }
@@ -1673,7 +1364,7 @@ static int GrabKeyDevices(Window win)
 
        if( !info )
        {
-               fprintf(stderr, "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
                return 0;
        }
 
@@ -1696,7 +1387,7 @@ static int GrabKeyDevices(Window win)
                                result = GrabKeyDevice(win, dev->name, dev->deviceid);
                                if(!result)
                                {
-                                       fprintf(stderr, "[keyrouter][%s] Failed to grab key device(name=%s, result=%d)\n", dev->name, result);
+                                       SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to grab key device(name=%s, result=%d)\n", dev->name, result);
                                        continue;
                                }
 
@@ -1750,7 +1441,7 @@ static void UngrabKeyDevices()
 
        if( !info )
        {
-               fprintf(stderr, "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
                return;
        }
 
@@ -1776,91 +1467,11 @@ static void UngrabKeyDevices()
 
        XIFreeDeviceInfo(info);
 }
-#else//_F_USE_XI_GRABDEVICE_
-static int GrabXIKeyDevices()
-{
-       int i, ndevices, result;
-       XIDeviceInfo *dev, *info = NULL;
-
-       info = XIQueryDevice(keyrouter.disp, XIAllDevices, &ndevices);
-
-       if( !info )
-       {
-               fprintf(stderr, "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
-               return 0;
-       }
-
-       XISelectEvents(keyrouter.disp, keyrouter.rootWin, &keyrouter.eventmask, 1);
-       for( i = 0; i < ndevices ; i++ )
-       {
-               dev = &info[i];
-
-               if( XISlaveKeyboard == dev->use )
-               {
-
-                       if( strcasestr(dev->name, "keyboard") || strcasestr(dev->name, "XTEST" ) )
-                               continue;
-
-                       result = XIGrabDevice(keyrouter.disp, dev->deviceid, keyrouter.rootWin, CurrentTime, None,
-                                       GrabModeAsync, GrabModeAsync, False, &keyrouter.eventmask);
-
-                       if( result )
-                       {
-                               fprintf(stderr, "[gesture][%s] Failed to grab xi device (id = %d, result = %d)\n", __FUNCTION__, dev->deviceid, result);
-                               continue;
-                       }
-               }
-       }
-
-       XIFreeDeviceInfo(info);
-
-       return 1;
-}
-
-static void UngrabXIKeyDevices()
-{
-       int i, ndevices, result;
-       XIDeviceInfo *dev, *info = NULL;
-
-       info = XIQueryDevice(keyrouter.disp, XIAllDevices, &ndevices);
-
-       if( !info )
-       {
-               fprintf(stderr, "[keyrouter][%s] There is no queried XI device.\n", __FUNCTION__);
-               return 0;
-       }
-
-       XISelectEvents(keyrouter.disp, keyrouter.rootWin, &keyrouter.eventmask_0, 1);
-       for( i = 0; i < ndevices ; i++ )
-       {
-               dev = &info[i];
-               if( XISlaveKeyboard == dev->use )
-               {
-                       if( strcasestr(dev->name, "keyboard") || strcasestr(dev->name, "XTEST" ) )
-                               continue;
-
-                       result = XIUngrabDevice(keyrouter.disp, dev->deviceid, CurrentTime);
-
-                       if( result )
-                       {
-                               fprintf(stderr, "[keyrouter][%s] Failed to ungrab xi device (id=%d, result=%d)\n", __FUNCTION__, dev->deviceid, result);
-                               continue;
-                       }
-               }
-       }
-
-       XIFreeDeviceInfo(info);
-}
-#endif
 
 static void PrintKeyDeliveryList()
 {
        int index;
 
-#ifdef __DEBUG__
-       printf("[keyrouter][%s] ============ start =================\n", __FUNCTION__);
-#endif
-
        for( index=0 ; index < MAX_HARDKEYS ; index++ )
        {
                const char *keyname;
@@ -1868,113 +1479,184 @@ static void PrintKeyDeliveryList()
                if( keyrouter.HardKeys[index].keycode == 0 )//empty
                        continue;
 
-               fprintf(keyrouter.fplog, "\n");
+               SECURE_SLOGD("\n");
                keyname = XKeysymToString(XKeycodeToKeysym(keyrouter.disp, index, 0));
 
                if( !keyname )
                {
-#ifdef __DEBUG__
-                       fprintf(keyrouter.fplog, "[keyrouter][%s] Failed to get string from xkeysym via xkeycode(%d) !\n", __FUNCTION__, index);
-#endif
                        continue;
                }
 
                if( !strncmp(keyname, KEY_VOLUMEDOWN, LEN_KEY_VOLUMEDOWN) )
-                       fprintf(keyrouter.fplog, "[ KEY_VOLUMEDOWN : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_VOLUMEDOWN : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_VOLUMEUP, LEN_KEY_VOLUMEUP) )
-                       fprintf(keyrouter.fplog, "[ KEY_VOLUMEUP : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_VOLUMEUP : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_PAUSE, LEN_KEY_PAUSE) )
-                       fprintf(keyrouter.fplog, "[ KEY_PAUSE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_PAUSE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_SEND, LEN_KEY_SEND) )
-                       fprintf(keyrouter.fplog, "[ KEY_SEND : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_SEND : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_SELECT, LEN_KEY_SELECT) )
-                       fprintf(keyrouter.fplog, "[ KEY_SELECT : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_SELECT : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_END, LEN_KEY_END) )
-                       fprintf(keyrouter.fplog, "[ KEY_END : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_END : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_POWER, LEN_KEY_POWER) )
-                       fprintf(keyrouter.fplog, "[ KEY_POWER : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_POWER : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_CAMERA, LEN_KEY_CAMERA) )
-                       fprintf(keyrouter.fplog, "[ KEY_CAMERA : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_CAMERA : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_CONFIG, LEN_KEY_CONFIG) )
-                       fprintf(keyrouter.fplog, "[ KEY_CONFIG : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_CONFIG : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_MEDIA, LEN_KEY_MEDIA) )
-                       fprintf(keyrouter.fplog, "[ KEY_MEDIA : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_MEDIA : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_PLAYCD, LEN_KEY_PLAYCD) )
-                       fprintf(keyrouter.fplog, "[ KEY_PLAYCD : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_PLAYCD : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_STOPCD, LEN_KEY_STOPCD) )
-                       fprintf(keyrouter.fplog, "[ KEY_STOPCD : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_STOPCD : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_PAUSECD, LEN_KEY_PAUSECD) )
-                       fprintf(keyrouter.fplog, "[ KEY_PAUSECD : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_PAUSECD : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_NEXTSONG, LEN_KEY_NEXTSONG) )
-                       fprintf(keyrouter.fplog, "[ KEY_NEXTSONG : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_NEXTSONG : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_PREVIOUSSONG, LEN_KEY_PREVIOUSSONG) )
-                       fprintf(keyrouter.fplog, "[ KEY_PREVIOUSSONG : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_PREVIOUSSONG : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_REWIND, LEN_KEY_REWIND) )
-                       fprintf(keyrouter.fplog, "[ KEY_REWIND : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_REWIND : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_FASTFORWARD, LEN_KEY_FASTFORWARD) )
-                       fprintf(keyrouter.fplog, "[ KEY_FASTFORWARD : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_FASTFORWARD : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_PLAYPAUSE, LEN_KEY_PLAYPAUSE) )
-                       fprintf(keyrouter.fplog, "[ KEY_PLAYPAUSE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_PLAYPAUSE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_MUTE, LEN_KEY_MUTE) )
-                       fprintf(keyrouter.fplog, "[ KEY_MUTE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_MUTE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_HOMEPAGE, LEN_KEY_HOMEPAGE) )
-                       fprintf(keyrouter.fplog, "[ KEY_HOMEPAGE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_HOMEPAGE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_WEBPAGE, LEN_KEY_WEBPAGE) )
-                       fprintf(keyrouter.fplog, "[ KEY_WEBPAGE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_WEBPAGE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_MAIL, LEN_KEY_MAIL) )
-                       fprintf(keyrouter.fplog, "[ KEY_MAIL : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_MAIL : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_SCREENSAVER, LEN_KEY_SCREENSAVER) )
-                       fprintf(keyrouter.fplog, "[ KEY_SCREENSAVER : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_SCREENSAVER : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_BRIGHTNESSUP, LEN_KEY_BRIGHTNESSUP) )
-                       fprintf(keyrouter.fplog, "[ KEY_BRIGHTNESSUP : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_BRIGHTNESSUP : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_BRIGHTNESSDOWN, LEN_KEY_BRIGHTNESSDOWN) )
-                       fprintf(keyrouter.fplog, "[ KEY_BRIGHTNESSDOWN : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_BRIGHTNESSDOWN : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_SOFTKBD, LEN_KEY_SOFTKBD) )
-                       fprintf(keyrouter.fplog, "[ KEY_SOFTKBD : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_SOFTKBD : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_QUICKPANEL, LEN_KEY_QUICKPANEL) )
-                       fprintf(keyrouter.fplog, "[ KEY_QUICKPANEL : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_QUICKPANEL : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_TASKSWITCH, LEN_KEY_TASKSWITCH) )
-                       fprintf(keyrouter.fplog, "[ KEY_TASKSWITCH : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_TASKSWITCH : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_APPS, LEN_KEY_APPS) )
-                       fprintf(keyrouter.fplog, "[ KEY_APPS : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_APPS : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_SEARCH, LEN_KEY_SEARCH) )
-                       fprintf(keyrouter.fplog, "[ KEY_SEARCH : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_SEARCH : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_VOICE, LEN_KEY_VOICE) )
-                       fprintf(keyrouter.fplog, "[ KEY_VOICE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_VOICE : %s : %d ]\n", keyname, index);
+               }
                else if( !strncmp(keyname, KEY_LANGUAGE, LEN_KEY_LANGUAGE) )
-                       fprintf(keyrouter.fplog, "[ KEY_LANGUAGE : %s : %d ]\n", keyname, index);
+               {
+                       SECURE_SLOGD("[ KEY_LANGUAGE : %s : %d ]\n", keyname, index);
+               }
                else
-                       fprintf(keyrouter.fplog, "[ UNKNOWN : %d ]\n", keyrouter.HardKeys[index].keycode);
+               {
+                       SECURE_SLOGD("[ UNKNOWN : %d ]\n", keyrouter.HardKeys[index].keycode);
+               }
 
                //Print EXCLUSIVE mode of grab
                if( NULL != keyrouter.HardKeys[index].excl_ptr )
-                       fprintf(keyrouter.fplog, "\e[32m== EXCLUSIVE : Window(0x%X)\e[0m\n", (int)(keyrouter.HardKeys[index].excl_ptr->wid));
+               {
+                       SECURE_SLOGD("\e[32m== EXCLUSIVE : Window(0x%X)\e[0m\n", (int)(keyrouter.HardKeys[index].excl_ptr->wid));
+               }
                else
-                       fprintf(keyrouter.fplog, "== EXCLUSIVE : None\n");
+               {
+                       SECURE_SLOGD("== EXCLUSIVE : None\n");
+               }
 
                //Print OR_EXCLUSIVE mode of grab
                if( NULL != keyrouter.HardKeys[index].or_excl_ptr )
-                       fprintf(keyrouter.fplog, "\e[32m== OR_EXCLUSIVE : Window(0x%X)\e[0m\n", (int)(keyrouter.HardKeys[index].or_excl_ptr->wid));
+               {
+                       SECURE_SLOGD("\e[32m== OR_EXCLUSIVE : Window(0x%X)\e[0m\n", (int)(keyrouter.HardKeys[index].or_excl_ptr->wid));
+               }
                else
-                       fprintf(keyrouter.fplog, "== OR_EXCLUSIVE : None\n");
+               {
+                       SECURE_SLOGD("== OR_EXCLUSIVE : None\n");
+               }
 
                //Print TOP_POSITION mode of grab
                if( NULL != keyrouter.HardKeys[index].top_ptr )
                {
                        keylist_node* top_ptr;
                        top_ptr = keyrouter.HardKeys[index].top_ptr;
-                       fprintf(keyrouter.fplog, "\e[32m== TOP_POSITION : ");
+                       SECURE_SLOGD("\e[32m== TOP_POSITION : ");
 
                        do
                        {
-                               fprintf(keyrouter.fplog, "Window(0x%X) -> ", (unsigned int)(top_ptr->wid));
+                               SECURE_SLOGD("Window(0x%X) -> ", (unsigned int)(top_ptr->wid));
                                top_ptr = top_ptr->next;
                        } while( top_ptr );
-                       fprintf(keyrouter.fplog, "None\e[0m\n");
+                       SECURE_SLOGD("None\e[0m\n");
                }
                else
                {
-                       fprintf(keyrouter.fplog, "== TOP_POSITION : None\n");
+                       SECURE_SLOGD("== TOP_POSITION : None\n");
                }
 
                //Print SHARED mode of grab
@@ -1982,18 +1664,18 @@ static void PrintKeyDeliveryList()
                {
                        keylist_node* shared_ptr;
                        shared_ptr = keyrouter.HardKeys[index].shared_ptr;
-                       fprintf(keyrouter.fplog, "\e[32m== SHARED : ");
+                       SECURE_SLOGD("\e[32m== SHARED : ");
 
                        do
                        {
-                               fprintf(keyrouter.fplog, "Window(0x%X) -> ", (unsigned int)(shared_ptr->wid));
+                               SECURE_SLOGD("Window(0x%X) -> ", (unsigned int)(shared_ptr->wid));
                                shared_ptr = shared_ptr->next;
                        } while( shared_ptr );
-                       fprintf(keyrouter.fplog, "None\e[0m\n");
+                       SECURE_SLOGD("None\e[0m\n");
                }
                else
                {
-                       fprintf(keyrouter.fplog, "== SHARED : None\n");
+                       SECURE_SLOGD("== SHARED : None\n");
                }
        }
 
@@ -2044,9 +1726,6 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                                                if( current )
                                                        free(current);
                                                flags = 1;
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].top_ptr (head) !\n", __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                        }
 
@@ -2068,9 +1747,6 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                                                if( next_current )
                                                        free(next_current);
                                                flags = 1;
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].top_ptr (normal node) !\n", __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                        }
 
@@ -2092,18 +1768,9 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                        {
                                if( win == keyrouter.HardKeys[index].excl_ptr->wid )
                                {
-#ifdef __DEBUG__
-                                       printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].excl_ptr !\n", __FUNCTION__, (int)win, index);
-#endif
                                        if( UnSetExclusiveProperty )
                                        {
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] Before call UnSetExclusiveGrabInfoToRootWindow() !\n", __FUNCTION__);
                                                UnSetExclusiveGrabInfoToRootWindow(keyrouter.HardKeys[index].keycode, EXCLUSIVE_GRAB);
-                                               printf("[keyrouter][%s] After call UnSetExclusiveGrabInfoToRootWindow() !\n", __FUNCTION__);
-#else
-                                               UnSetExclusiveGrabInfoToRootWindow(keyrouter.HardKeys[index].keycode, EXCLUSIVE_GRAB);
-#endif
                                        }
 
                                        if( keyrouter.HardKeys[index].excl_ptr )
@@ -2119,18 +1786,9 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                        {
                                if( win == keyrouter.HardKeys[index].or_excl_ptr->wid )
                                {
-#ifdef __DEBUG__
-                                       printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].or_excl_ptr !\n", __FUNCTION__, (int)win, index);
-#endif
                                        if( UnSetExclusiveProperty )
                                        {
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] Before call UnSetExclusiveGrabInfoToRootWindow() !\n", __FUNCTION__);
-                                               UnSetExclusiveGrabInfoToRootWindow(keyrouter.HardKeys[index].keycode, OR_EXCLUSIVE_GRAB);
-                                               printf("[keyrouter][%s] After call UnSetExclusiveGrabInfoToRootWindow() !\n", __FUNCTION__);
-#else
                                                UnSetExclusiveGrabInfoToRootWindow(keyrouter.HardKeys[index].keycode, OR_EXCLUSIVE_GRAB);
-#endif
                                        }
 
                                        if( keyrouter.HardKeys[index].or_excl_ptr )
@@ -2171,9 +1829,6 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                                                if( current )
                                                        free(current);
                                                flags = 1;
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].top_ptr (head) !\n", __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                        }
 
@@ -2195,9 +1850,6 @@ static int RemoveWindowDeliveryList(Window win, int isTopPositionMode, int UnSet
                                                if( next_current )
                                                        free(next_current);
                                                flags = 1;
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].top_ptr (normal node) !\n", __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                        }
 
@@ -2242,10 +1894,6 @@ null_top_ptr:
                                                     current = NULL;
                                                  }
                                                flags = 1;
-#ifdef __DEBUG__
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].shared_ptr (head) !\n",
-                                                      __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                             }
 
@@ -2267,10 +1915,6 @@ null_top_ptr:
                                                     next_current = NULL;
                                                  }
                                                flags = 1;
-#ifdef __DEBUG_
-                                               printf("[keyrouter][%s] window (0x%x) was found and removed @ keyrouter.HardKeys[%d].shared_ptr (normal node) !\n",
-                                                      __FUNCTION__, (int)win, index);
-#endif
                                                break;
                                             }
 
@@ -2328,7 +1972,6 @@ static void UnSetExclusiveGrabInfoToRootWindow(int keycode, int grab_mode)
 
        if (nr_item == 0)
        {
-               fprintf(stderr, "\e[32m[keyrouter][%s] keycode = %d\e[0m\n", __FUNCTION__, keycode);
                goto out;
        }
 
@@ -2341,10 +1984,6 @@ static void UnSetExclusiveGrabInfoToRootWindow(int keycode, int grab_mode)
                cnt++;
        }
 
-#ifdef __DEBUG__
-       fprintf(stderr, "[keyrouter][%s] cnt = %d, nr_item = %d\n", __FUNCTION__, cnt, (int)nr_item);
-#endif
-
        if( 0 < cnt )
        {
                new_key_list = malloc(sizeof(int)*cnt);
@@ -2355,7 +1994,6 @@ static void UnSetExclusiveGrabInfoToRootWindow(int keycode, int grab_mode)
 
        if( !new_key_list )
        {
-               //fprintf(stderr, "\e[32m[keyrouter][%s] Fail to allocation memory for new_key_list ! \e[0m\n", __FUNCTION__);
                XDeleteProperty(keyrouter.disp, keyrouter.rootWin, ex_grabwin);
                XSync(keyrouter.disp, False);
                goto out;
@@ -2391,7 +2029,7 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
 
        if( index >= MAX_HARDKEYS )
        {
-               fprintf(stderr, "[keyrouter][%s] Error ! index of keyrouter.HardKeys must be smaller than %d (index=%d)!)\n", __FUNCTION__, MAX_HARDKEYS, index);
+               SECURE_SLOGD("[keyrouter][%s] Error ! index of keyrouter.HardKeys must be smaller than %d (index=%d)!)\n", __FUNCTION__, MAX_HARDKEYS, index);
                ret = -1;
                goto out;
        }
@@ -2403,7 +2041,7 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                case EXCLUSIVE_GRAB:
                        if( NULL != keyrouter.HardKeys[index].excl_ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] keyrouter.HardKeys[%d].Keycode(%d) was EXCLUSIVELY grabbed already by window(0x%x) !\n", __FUNCTION__, index, keycode, (int)(keyrouter.HardKeys[index].excl_ptr->wid));
+                               SECURE_SLOGD("[keyrouter][%s] keyrouter.HardKeys[%d].Keycode(%d) was EXCLUSIVELY grabbed already by window(0x%x) !\n", __FUNCTION__, index, keycode, (int)(keyrouter.HardKeys[index].excl_ptr->wid));
                                ret = -1;
                                goto out;
                        }
@@ -2411,7 +2049,7 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                        ptr = (keylist_node*)malloc(sizeof(keylist_node));
                        if( !ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for adding excl_ptr!\n", __FUNCTION__);
+                               SECURE_SLOGD("[keyrouter][%s] Failed to allocate memory for adding excl_ptr!\n", __FUNCTION__);
                                ret = -1;
                                goto out;
                        }
@@ -2419,24 +2057,20 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                        ptr->wid = win;
                        ptr->next = NULL;
                        keyrouter.HardKeys[index].excl_ptr = ptr;
-
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] window(0x%x) was added to EXCLUSVE mode list (keyrouter.HardKeys[%d]) !\n", __FUNCTION__, (int)win, index);
-#endif
                        break;
 
                case OR_EXCLUSIVE_GRAB:
                        if( NULL != keyrouter.HardKeys[index].or_excl_ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] keyrouter.HardKeys[%d].Keycode(%d) was OR_EXCLUSIVELY grabbed already by window(0x%x) !\n", __FUNCTION__, index, keycode, (unsigned int)(keyrouter.HardKeys[index].or_excl_ptr->wid));
-                               fprintf(stderr, "[keyrouter][%s] Now it will be overridden by a new window(0x%x) !\n", __FUNCTION__, (unsigned int)win);
+                               SECURE_SLOGD("[keyrouter][%s] keyrouter.HardKeys[%d].Keycode(%d) was OR_EXCLUSIVELY grabbed already by window(0x%x) !\n", __FUNCTION__, index, keycode, (unsigned int)(keyrouter.HardKeys[index].or_excl_ptr->wid));
+                               SECURE_SLOGD("[keyrouter][%s] Now it will be overridden by a new window(0x%x) !\n", __FUNCTION__, (unsigned int)win);
                                backup_ptr = keyrouter.HardKeys[index].or_excl_ptr;
                        }
 
                        ptr = (keylist_node*)malloc(sizeof(keylist_node));
                        if( !ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for adding excl_ptr!\n", __FUNCTION__);
+                               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to allocate memory for adding excl_ptr!\n", __FUNCTION__);
                                ret = -1;
                                goto out;
                        }
@@ -2446,25 +2080,17 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                        keyrouter.HardKeys[index].or_excl_ptr = ptr;
                        if( backup_ptr )
                                free(backup_ptr);
-
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] window(0x%x) was added to OR_EXCLUSVE mode list (keyrouter.HardKeys[%d]) !\n", __FUNCTION__, (int)win, index);
-#endif
                        break;
 
                case TOP_POSITION_GRAB:
                        ptr = (keylist_node*)malloc(sizeof(keylist_node));
                        if( !ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for adding top_ptr!\n", __FUNCTION__);
+                               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to allocate memory for adding top_ptr!\n", __FUNCTION__);
                                ret = -1;
                                goto out;
                        }
 
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] window(0x%x) was added to TOP_POSITION mode list (keyrouter.HardKeys[%d]) !\n", __FUNCTION__, (int)win, index);
-#endif
-
                        ptr->wid = win;
                        ptr->next = NULL;
 
@@ -2490,7 +2116,7 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                        ptr = (keylist_node*)malloc(sizeof(keylist_node));
                        if( !ptr )
                        {
-                               fprintf(stderr, "[keyrouter][%s] Failed to allocate memory for adding shared_ptr!\n", __FUNCTION__);
+                               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to allocate memory for adding shared_ptr!\n", __FUNCTION__);
                                ret = -1;
                                goto out;
                        }
@@ -2506,13 +2132,10 @@ static int AddWindowToDeliveryList(Window win, int keycode, const int grab_mode,
                                ptr->next = NULL;
                                keyrouter.HardKeys[index].shared_ptr = ptr;
                        }
-#ifdef __DEBUG__
-                       printf("[keyrouter][%s] window(0x%x) was added to SHARED mode list (keyrouter.HardKeys[%d]) !\n", __FUNCTION__, (int)win, index);
-#endif
                        break;
 
                default:
-                       fprintf(stderr, "[keyrouter][%s] Unknown mode of grab ! (grab_mode=0x%X)\n", __FUNCTION__, grab_mode);
+                       SECURE_SLOGD("[keyrouter][%s] Unknown mode of grab ! (grab_mode=0x%X)\n", __FUNCTION__, grab_mode);
                        ret = -1;
                        break;
        }
@@ -2541,7 +2164,7 @@ static int AdjustTopPositionDeliveryList(Window win, int IsOnTop)
                                &ret_type, &ret_format, &nr_item,
                                &sz_remains_data,(unsigned char **)&key_list) ) )
        {
-               fprintf(stderr, "[keyrouter][%s] Failed to get window property from %s ! (result = %d)\n", __FUNCTION__, STR_ATOM_GRAB_KEY, result);
+               SLOG(LOG_DEBUG, "KEYROUTER", "[keyrouter][%s] Failed to get window property from %s ! (result = %d)\n", __FUNCTION__, STR_ATOM_GRAB_KEY, result);
                RemoveWindowDeliveryList(win, 1, 0);
                goto out;
        }
@@ -2577,51 +2200,33 @@ static int IsGrabbed(unsigned int keycode)
 
        if( keyrouter.HardKeys[index].keycode == 0 )//empty
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d].keycode is 0\n", __FUNCTION__, index);
-#endif
                goto out;
        }
 
        if( keyrouter.HardKeys[index].keycode != keycode )
        {
-               fprintf(stderr, "[keyrouter][%s] Error ! (keyrouter.HardKeys[%d].keycode must be equal to keycode(%d) !\n", __FUNCTION__, index, keycode);
+               SECURE_SLOGD("[keyrouter][%s] Error ! (keyrouter.HardKeys[%d].keycode must be equal to keycode(%d) !\n", __FUNCTION__, index, keycode);
                goto out;
        }
 
        if( NULL != keyrouter.HardKeys[index].excl_ptr )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d] is grabbed @ EXCLUSIVE mode by window(0x%x)\n", __FUNCTION__, index, (int)(keyrouter.HardKeys[index].excl_ptr->wid));
-#endif
                index |= EXCLUSIVE_GRAB;
        }
        else if( NULL != keyrouter.HardKeys[index].or_excl_ptr )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d] is grabbed @ OR_EXCLUSIVE mode by window(0x%x)\n", __FUNCTION__, index, (int)(keyrouter.HardKeys[index].or_excl_ptr->wid));
-#endif
                index |= OR_EXCLUSIVE_GRAB;
        }
        else if( NULL != keyrouter.HardKeys[index].top_ptr )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d] is grabbed @ TOP_POSITION mode by window(0x%x)\n", __FUNCTION__, index, (int)(keyrouter.HardKeys[index].top_ptr->wid));
-#endif
                index |= TOP_POSITION_GRAB;
        }
        else if( NULL != keyrouter.HardKeys[index].shared_ptr )
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d] is grabbed @ SHARED mode by window(0x%x)\n", __FUNCTION__, index, (int)(keyrouter.HardKeys[index].shared_ptr->wid));
-#endif
                index |= SHARED_GRAB;
        }
        else
        {
-#ifdef __DEBUG__
-               printf("[keyrouter][%s] keyrouter.HardKeys[%d] has keycode(%d) but not grabbed !\n", __FUNCTION__, index, keycode);
-#endif
                index = -1;
        }
        return index;
@@ -2642,7 +2247,7 @@ static int IsWindowTopVisibleWithoutInputFocus(Window win, Window focus)
 
        if( !XQueryTree(keyrouter.disp, keyrouter.rootWin, &root_win, &parent_win, &child_list, &num_children) )
        {
-               fprintf(stderr, "\e[32m[keyrouter][%s] Failed to query window tree !\e[0m\n", __FUNCTION__);
+               SLOG(LOG_DEBUG, "KEYROUTER", "\e[32m[keyrouter][%s] Failed to query window tree !\e[0m\n", __FUNCTION__);
                return 0;
        }
 
@@ -2662,11 +2267,6 @@ static int IsWindowTopVisibleWithoutInputFocus(Window win, Window focus)
 
                if( bd )//child_list[i] is border
                {//if the window is client window, check hint
-#ifdef __DEBUG__
-                       fprintf(stderr, "\e[32m[keyrouter][%s] bd is NOT NULL!(child_list[%d]=0x%x, bd->win=0x%x, bd->client.win=0x%x, win=0x%x)\e[0m\n",
-                               __FUNCTION__, i, (unsigned int)child_list[i], bd->win, bd->client.win, (unsigned int)win);
-#endif
-
                        if( !bd->visible )
                                continue;
                        if( (bd->x >= bd->zone->w) || (bd->y >= bd->zone->h) )
@@ -2676,44 +2276,27 @@ static int IsWindowTopVisibleWithoutInputFocus(Window win, Window focus)
 
                        if( bd->client.win == win )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s][CLIENTWIN] Target win(0x%x) is above focus win(0x%x)\e[0m\n", __FUNCTION__, (unsigned int)win, (unsigned int)focus);
-#endif
-                                XFree(child_list);
+                            XFree(child_list);
                                return 1;
                        }
 
                        if( bd->client.win == focus )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s][CLIENTWIN] Target win(0x%x) is below focus win(0x%x)\e[0m\n", __FUNCTION__, (unsigned int)win, (unsigned int)focus);
-#endif
-                                XFree(child_list);
+                            XFree(child_list);
                                return 0;
                        }
                }
                else//child_list[i] is override-redirected window
                {//if the window is not client window, it will be a border window or a override-redirected window then check the equality of the windows
-#ifdef __DEBUG__
-                       fprintf(stderr, "\e[32m[keyrouter][%s] bd is NULL!(child_list[%d]=0x%x, win=0x%x)\e[0m\n",
-                               __FUNCTION__, i, (unsigned int)child_list[i], (unsigned int)win);
-#endif
-
                        if( child_list[i] == win )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s][WIN] Target win(0x%x) is above focus win(0x%x)\e[0m\n", __FUNCTION__, (unsigned int)win, (unsigned int)focus);
-#endif
-                                XFree(child_list);
+                            XFree(child_list);
                                return 1;
                        }
 
                        if( child_list[i] == focus )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s][WIN] Target win(0x%x) is below focus win(0x%x)\e[0m\n", __FUNCTION__, (unsigned int)win, (unsigned int)focus);
-#endif
-                                XFree(child_list);
+                            XFree(child_list);
                                return 0;
                        }
                }
@@ -2723,205 +2306,6 @@ static int IsWindowTopVisibleWithoutInputFocus(Window win, Window focus)
        return 0;
 }
 
-#ifdef _F_USE_XI_GRABDEVICE_
-static void DeliverKeyEvents(XEvent *xev, XGenericEventCookie *cookie)
-{
-       int index, rel_index, count;
-       int revert_to_return;
-       Window focus_window;
-       keylist_node* ptr = NULL;
-       XIDeviceEvent *xiData = (XIDeviceEvent *)cookie->data;
-
-       index = IsGrabbed(xev->xkey.keycode);
-       rel_index = index & (~GRAB_MODE_MASK);
-       rel_index = xev->xkey.keycode;
-       XGetInputFocus(keyrouter.disp, &focus_window, &revert_to_return);
-
-       if( xev->type == KeyRelease )
-       {
-               switch( keyrouter.HardKeys[rel_index].lastmode )
-               {
-                       case NONE_GRAB_MODE:
-                               xiData->event = xev->xkey.window = keyrouter.HardKeys[rel_index].lastwid;
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                               fprintf(stderr, "\e[32m[keyrouter][%s] Non-grabbed key! Deliver KeyRelease/XI_KeyRelease (keycode:%d) to %s window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (xev->xkey.window==focus_window) ? "focus":"", xev->xkey.window);
-                               break;
-
-                       case EXCL_GRAB_MODE:
-                               xiData->event = xev->xkey.window = keyrouter.HardKeys[rel_index].lastwid;
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                               fprintf(stderr, "\e[32m[keyrouter][%s] EXCLUSIVE mode of grab ! Deliver KeyRelease/XI_KeyRelease (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               break;
-
-                       case OR_EXCL_GRAB_MODE:
-                               xiData->event = xev->xkey.window = keyrouter.HardKeys[rel_index].lastwid;
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                               fprintf(stderr, "\e[32m[keyrouter][%s] OR_EXCLUSIVE mode of grab ! Deliver KeyRelease/XI_KeyRelease (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               break;
-
-                       case TOP_GRAB_MODE:
-                               xiData->event = xev->xkey.window = keyrouter.HardKeys[rel_index].lastwid;
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                               fprintf(stderr, "\e[32m[keyrouter][%s] TOP_POSITION mode of grab ! Deliver KeyRelease/XI_KeyRelease (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               break;
-
-                       case SHARED_GRAB_MODE:
-                               if( !keyrouter.HardKeys[rel_index].num_shared_wins )
-                                       break;
-
-                               for( count = 0 ; count < keyrouter.HardKeys[rel_index].num_shared_wins ; count++ )
-                               {
-                                       xiData->event = xev->xkey.window = keyrouter.HardKeys[rel_index].shared_wins[count];
-                                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                                       fprintf(stderr, "\e[32m[keyrouter][%s] Non-grabbed or SHARED mode of grab ! Deliver KeyRelease/XI_KeyRelease (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               }
-                               break;
-
-                       default:
-                               fprintf(stderr, "[\e[32m[keyrouter][%s] Unknown case (keycode:%d)!\e[0m\n", __FUNCTION__, xev->xkey.keycode);
-               }
-
-               return;
-       }
-
-       // Is Grabbed ?
-       if( index < 0 )//Code for non-grabbed key
-       {
-               //Deliver to focus window
-               xiData->event = xev->xkey.window = focus_window;
-
-               if( xev->type == KeyPress )
-               {
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                       fprintf(stderr, "\e[32m[keyrouter][%s] Non-grabbed key! Deliver KeyPress/XI_KeyPress (keycode:%d) to focus window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)focus_window);
-
-                       keyrouter.HardKeys[xev->xkey.keycode].lastwid = xev->xkey.window;
-                       keyrouter.HardKeys[xev->xkey.keycode].lastmode = NONE_GRAB_MODE;
-               }
-
-               return;
-       }
-
-       int grab_mode = index & GRAB_MODE_MASK;
-       index &= ~GRAB_MODE_MASK;
-
-       switch( grab_mode )
-       {
-               case EXCLUSIVE_GRAB:
-                       // Is Grab Mode equal to EXCLUSIVE ?
-                       xiData->event = xev->xkey.window = keyrouter.HardKeys[index].excl_ptr->wid;
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-
-                       if( xev->type == KeyPress )
-                       {
-                               fprintf(stderr, "\e[32m[keyrouter][%s] EXCLUSIVE mode of grab ! Deliver KeyPress/XI_KeyPress (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               keyrouter.HardKeys[index].lastwid = xev->xkey.window;
-                               keyrouter.HardKeys[index].lastmode = EXCL_GRAB_MODE;
-                       }
-                       break;
-
-               case OR_EXCLUSIVE_GRAB:
-                       // Is Grab Mode equal to OR_EXCLUSIVE ?
-                       xiData->event = xev->xkey.window = keyrouter.HardKeys[index].or_excl_ptr->wid;
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-
-                       if( xev->type == KeyPress )
-                       {
-                               fprintf(stderr, "\e[32m[keyrouter][%s] OR_EXCLUSIVE mode of grab ! Deliver KeyPress/XI_KeyPress (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               keyrouter.HardKeys[index].lastwid = xev->xkey.window;
-                               keyrouter.HardKeys[index].lastmode = OR_EXCL_GRAB_MODE;
-                       }
-                       break;
-
-               case TOP_POSITION_GRAB:
-                       if( focus_window != keyrouter.HardKeys[index].top_ptr->wid )
-                       {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s] isWindowStackChanged = %d\e[0m\n", __FUNCTION__, isWindowStackChanged);
-#endif
-                               if( keyrouter.isWindowStackChanged || (keyrouter.prev_sent_keycode != xev->xkey.keycode) )
-                                       keyrouter.resTopVisibleCheck = IsWindowTopVisibleWithoutInputFocus(keyrouter.HardKeys[index].top_ptr->wid, focus_window);
-
-                               keyrouter.prev_sent_keycode = xev->xkey.keycode;
-
-                               if( !keyrouter.resTopVisibleCheck )
-                                       goto shared_delivery;
-
-                               if( keyrouter.isWindowStackChanged )
-                                       keyrouter.isWindowStackChanged = 0;
-                       }
-
-                       // Is Grab Mode equal to TOP_POSITION ?
-                       xiData->event = xev->xkey.window = keyrouter.HardKeys[index].top_ptr->wid;
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-
-                       if( xev->type == KeyPress )
-                       {
-                               fprintf(stderr, "\e[32m[keyrouter][%s] TOP_POSITION mode of grab ! Deliver KeyPress/XI_KeyPress (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                               keyrouter.HardKeys[index].lastwid = xev->xkey.window;
-                               keyrouter.HardKeys[index].lastmode = TOP_GRAB_MODE;
-                       }
-                       break;
-
-               case SHARED_GRAB:
-shared_delivery:
-                       keyrouter.HardKeys[index].lastwid = None;
-                       keyrouter.HardKeys[index].lastmode = SHARED_GRAB_MODE;
-                       for( ptr=keyrouter.HardKeys[index].shared_ptr ; (NULL != ptr) ; ptr=ptr->next )
-                       {
-                               xiData->event = xev->xkey.window = ptr->wid;
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                               XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-
-                               if( xev->type == KeyPress )
-                                       fprintf(stderr, "\e[32m[keyrouter][%s] SHARED mode of grab ! Deliver KeyPress/XI_KeyPress (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, xev->xkey.keycode, (int)xev->xkey.window);
-                       }
-
-                       for( ptr=keyrouter.HardKeys[index].shared_ptr ; (NULL != ptr) ; ptr=ptr->next )
-                       {
-                               if( ptr->wid == focus_window )
-                               {
-                                       is_focus_window_in_shared_list = 1;
-                                       break;
-                               }
-                       }
-
-                       if( !is_focus_window_in_shared_list )
-                       {
-                               xiData->event = xev->xkey.window = focus_window;
-                               if( keyrouter.isWindowStackChanged )
-                                       BackedupSharedWins(index, focus_window);
-
-                               if( xev->type == KeyPress )
-                               {
-                                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, xev);
-                                       XSendEvent(keyrouter.disp, xev->xkey.window, False, NoEventMask, cookie);//XI2
-                                       fprintf(stderr, "\e[32m[keyrouter][%s] Deliver KeyPress/XI_KeyPress (keycode:%d) to focus window (0x%x)!\e[0m\n", __FUNCTION__, xev->xkey.keycode, xev->xkey.window);
-                               }
-                       }
-                       else
-                               if( keyrouter.isWindowStackChanged )
-                                       BackedupSharedWins(index, None);
-
-                       if( keyrouter.isWindowStackChanged )
-                               keyrouter.isWindowStackChanged = 0;
-                       break;
-
-               default:
-                       fprintf(stderr, "\e[32m[keyrouter][%s] Unknown mode of grab (mode = %d, index = %d, keycode = %d)\e[0m\n", __FUNCTION__, grab_mode, index, xev->xkey.keycode);
-                       break;
-       }
-}
-#else//_F_USE_XI_GRABDEVICE_
 static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key)
 {
        int index;
@@ -2933,7 +2317,7 @@ static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key)
 
        if( index < 0 && keyrouter.HardKeys[xev->xkey.keycode].bind )
        {
-               fprintf(stderr, "[keyrouter][DeliverDeviceKeyEvents] key(keycode=%d, name=%s) was bound !\n",
+               SECURE_SLOGD("[keyrouter][DeliverDeviceKeyEvents] key(keycode=%d, name=%s) was bound !\n",
                        xev->xkey.keycode, keyrouter.HardKeys[xev->xkey.keycode].bind->key);
                _e_keyrouter_do_bound_key_action(xev);
                return;
@@ -2951,7 +2335,7 @@ static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key)
                xev->xkey.window = focus_window;
 
                XTestFakeKeyEvent(xev->xany.display, xev->xkey.keycode, (xev->type==KeyPress) ? True : False, CurrentTime);
-               fprintf(stderr, "\e[32m[keyrouter][%s] Non-grabbed key! Deliver %s (keycode:%d) to focus window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)focus_window);
+               SECURE_SLOGD("\e[32m[keyrouter][%s] Non-grabbed key! Deliver %s (keycode:%d) to focus window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)focus_window);
                return;
        }
 
@@ -2964,22 +2348,19 @@ static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key)
                        // Is Grab Mode equal to EXCLUSIVE ?
                        xev->xkey.window = keyrouter.HardKeys[index].excl_ptr->wid;
                        XSendEvent(xev->xany.display, xev->xkey.window, False, NoEventMask, xev);
-                       fprintf(stderr, "\e[32m[keyrouter][%s] EXCLUSIVE mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] EXCLUSIVE mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
                        break;
 
                case OR_EXCLUSIVE_GRAB:
                        // Is Grab Mode equal to OR_EXCLUSIVE ?
                        xev->xkey.window = keyrouter.HardKeys[index].or_excl_ptr->wid;
                        XSendEvent(xev->xany.display, xev->xkey.window, False, NoEventMask, xev);
-                       fprintf(stderr, "\e[32m[keyrouter][%s] OR_EXCLUSIVE mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] OR_EXCLUSIVE mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
                        break;
 
                case TOP_POSITION_GRAB:
                        if( focus_window != keyrouter.HardKeys[index].top_ptr->wid )
                        {
-#ifdef __DEBUG__
-                               fprintf(stderr, "\e[32m[keyrouter][%s] isWindowStackChanged = %d\e[0m\n", __FUNCTION__, keyrouter.isWindowStackChanged);
-#endif
                                if( keyrouter.isWindowStackChanged || (keyrouter.prev_sent_keycode != xev->xkey.keycode) )
                                        keyrouter.resTopVisibleCheck = IsWindowTopVisibleWithoutInputFocus(keyrouter.HardKeys[index].top_ptr->wid, focus_window);
 
@@ -2995,7 +2376,7 @@ static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key)
                        // Is Grab Mode equal to TOP_POSITION ?
                        xev->xkey.window = keyrouter.HardKeys[index].top_ptr->wid;
                        XSendEvent(xev->xany.display, xev->xkey.window, False, NoEventMask, xev);
-                       fprintf(stderr, "\e[32m[keyrouter][%s] TOP_POSITION mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] TOP_POSITION mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
                        break;
 
                case SHARED_GRAB:
@@ -3003,7 +2384,7 @@ shared_delivery:
                        //Deliver to focus_window first
                        xev->xkey.window = focus_window;
                        XTestFakeKeyEvent(xev->xany.display, xev->xkey.keycode, (xev->type==KeyPress) ? True : False, CurrentTime);
-                       fprintf(stderr, "\e[32m[keyrouter][%s] Deliver %s (keycode:%d) to focus window (0x%x)!\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (unsigned int)xev->xkey.window);
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] Deliver %s (keycode:%d) to focus window (0x%x)!\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (unsigned int)xev->xkey.window);
 
                        //Deliver to shared grabbed window(s)
                        for( ptr=keyrouter.HardKeys[index].shared_ptr ; (NULL != ptr) ; ptr=ptr->next )
@@ -3012,45 +2393,24 @@ shared_delivery:
                                        continue;
                                xev->xkey.window = ptr->wid;
                                XSendEvent(xev->xany.display, xev->xkey.window, False, NoEventMask, xev);
-                               fprintf(stderr, "\e[32m[keyrouter][%s] SHARED mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
+                               SECURE_SLOGD("\e[32m[keyrouter][%s] SHARED mode of grab ! Deliver %s (keycode:%d) to window (0x%x) !\e[0m\n", __FUNCTION__, (xev->type == KeyPress) ? "KeyPress" : "KeyRelease", xev->xkey.keycode, (int)xev->xkey.window);
                        }
                        break;
 
                default:
-                       fprintf(stderr, "\e[32m[keyrouter][%s] Unknown mode of grab (mode = %d, index = %d, keycode = %d)\e[0m\n", __FUNCTION__, grab_mode, index, xev->xkey.keycode);
+                       SECURE_SLOGD("\e[32m[keyrouter][%s] Unknown mode of grab (mode = %d, index = %d, keycode = %d)\e[0m\n", __FUNCTION__, grab_mode, index, xev->xkey.keycode);
                        break;
        }
 }
-#endif//_F_USE_XI_GRABDEVICE_
-
-#ifdef _F_ENABLE_MOUSE_POPUP
-static void _e_keyrouter_popup_btn_down_cb(void *data)
-{
-       char *label = (char*)data;
-       keyrouter.rbutton_pressed_on_popup = 1;
-       _e_keyrouter_do_hardkey_emulation(label, KeyPress, 0, 0, 0);
-}
-
-static void _e_keyrouter_popup_btn_up_cb(void *data)
-{
-       char *label = (char*)data;
-       keyrouter.rbutton_pressed_on_popup = 0;
-       _e_keyrouter_do_hardkey_emulation(label, KeyRelease, 1, 0, 0);
-}
-#endif//_F_ENABLE_MOUSE_POPUP
 
 static void _e_keyrouter_do_hardkey_emulation(const char *label, unsigned int key_event, unsigned int on_release, int keycode, int cancel)
 {
-#ifdef _F_ENABLE_MOUSE_POPUP
-       int i;
-       char buf[128];
-#endif//_F_ENABLE_MOUSE_POPUP
        XEvent xev;
 
        if( !label )
                goto normal_hardkey_handler;
        else
-               goto reserved_hardkey_handler;
+               goto out;
 
 normal_hardkey_handler:
        xev.xkey.display = keyrouter.disp;
@@ -3070,215 +2430,25 @@ normal_hardkey_handler:
                xev.xkey.time = CurrentTime;
                xev.xkey.type = KeyRelease;
                DeliverDeviceKeyEvents(&xev, keyrouter.cancel_key.keycode);
-               fprintf(stderr, "[keyrouter][do_hardkey_emulation] HWKeyEmulation Done !\n");
-               fprintf(stderr, "...( Cancel KeyPress + KeyRelease(keycode:%d) + Cancel KeyRelease )\n", xev.xkey.keycode);
+               SECURE_SLOGD("[keyrouter][do_hardkey_emulation] HWKeyEmulation Done !\n");
+               SECURE_SLOGD("...( Cancel KeyPress + KeyRelease(keycode:%d) + Cancel KeyRelease )\n", xev.xkey.keycode);
        }
        else
        {
                DeliverDeviceKeyEvents(&xev, 0);
-               fprintf(stderr, "[keyrouter][do_hardkey_emulation] HWKeyEmulation Done !\n");
-               fprintf(stderr, "...( %s(keycode=%d )\n", (xev.xkey.type==KeyPress) ? "KeyPress" : "KeyRelease", xev.xkey.keycode);
+               SECURE_SLOGD("[keyrouter][do_hardkey_emulation] HWKeyEmulation Done !\n");
+               SECURE_SLOGD("...( %s(keycode=%d )\n", (xev.xkey.type==KeyPress) ? "KeyPress" : "KeyRelease", xev.xkey.keycode);
        }
 
        return;
 
-reserved_hardkey_handler:
-#ifdef _F_ENABLE_MOUSE_POPUP
-       for( i = 0 ; i < 3 ; i++ )
-       {
-               if( !strcmp(label, btns_label[i]) )
-               {
-                       xev.xany.display = keyrouter.disp;
-                       xev.xkey.keycode = keyrouter.btn_keys[i];
-                       xev.xkey.time = 0;
-
-                       xev.xkey.type = key_event;
-                       DeliverDeviceKeyEvents(&xev, 0);
-                       goto out;
-               }
-       }
-
-       if( on_release && !strcmp(label, btns_label[3]) )//Rotate Screen
-       {
-               keyrouter.toggle %= 4;
-               sprintf(buf, "/usr/bin/vconftool set -t int memory/sensor/10001 %d", keyrouter.toggle+1);
-               fprintf(stderr, "[keyrouter][rotation] %s\n", buf);
-               system (buf);
-       }
-#endif//_F_ENABLE_MOUSE_POPUP
-
 out:
        return;
 }
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-static void InitHardKeyCodes()
-{
-       keyrouter.btn_keys[0] = XKeysymToKeycode(keyrouter.disp, XStringToKeysym(KEY_VOLUMEUP));
-       keyrouter.btn_keys[1] = XKeysymToKeycode(keyrouter.disp, XStringToKeysym(KEY_VOLUMEDOWN));
-       keyrouter.btn_keys[2] = XKeysymToKeycode(keyrouter.disp, XStringToKeysym(KEY_SELECT));
-}
-
-static void popup_destroy()
-{
-       if( !keyrouter.popup )
-               return;
-
-       ecore_x_pointer_ungrab();
-       XISelectEvents(keyrouter.disp, keyrouter.rootWin, &keyrouter.eventmask_part, 1);
-
-       e_popup_hide(keyrouter.popup);
-       e_object_del( E_OBJECT (keyrouter.popup));
-       keyrouter.popup = NULL;
-}
-
-static void popup_update()
-{
-       popup_destroy();
-       popup_show();
-}
-
-static void popup_show()
-{
-       if( keyrouter.popup )
-       {
-               fprintf(stderr, "[keyrouter][%s] popup is already displayed...\n", __FUNCTION__);
-               return;
-       }
-
-       if( !keyrouter.zone )
-       {
-               fprintf(stderr, "[keyrouter][%s] popup couldn't be displayed because zone is null !\n", __FUNCTION__);
-               return;
-       }
-
-       int i;
-       int posx, posy;
-       int state = 0;
-       static Ecore_X_Atom effect_state_atom = 0;
-
-       switch( keyrouter.popup_angle )
-       {
-               case 0:         keyrouter.toggle = 3;   break;
-               case 90:        keyrouter.toggle = 2;   break;
-               case 180:       keyrouter.toggle = 0;   break;
-               case 270:       keyrouter.toggle = 1;   break;
-       }
-
-       //creating and showing popup
-       if( keyrouter.popup_angle == 0 || keyrouter.popup_angle == 180 )
-               keyrouter.popup = e_popup_new(keyrouter.zone, 0, 0, POPUP_MENU_WIDTH, POPUP_MENU_HEIGHT);
-       else
-               keyrouter.popup = e_popup_new(keyrouter.zone, 0, 0, POPUP_MENU_HEIGHT, POPUP_MENU_WIDTH);
-
-       if( !keyrouter.popup )
-       {
-               fprintf(stderr, "[keyrouter][%s] Failed on e_popup_new() !\n", __FUNCTION__);
-               return;
-       }
-
-       keyrouter.popup_bg = evas_object_rectangle_add(keyrouter.popup->evas);
-
-       if( !keyrouter.popup_bg )
-       {
-               fprintf(stderr, "[keyrouter][%s] Fail to call evas_object_rectangle_add() !\n", __FUNCTION__);
-               popup_destroy();
-               return;
-       }
-
-       evas_object_resize(keyrouter.popup_bg, POPUP_MENU_WIDTH, POPUP_MENU_HEIGHT);
-       evas_object_color_set(keyrouter.popup_bg, 0, 0, 0, 255);
-       evas_object_show(keyrouter.popup_bg);
-
-       e_popup_name_set(keyrouter.popup, "R-Click Popup");
-       e_popup_layer_set(keyrouter.popup, 400);
-
-       posx = keyrouter.popup_rootx;
-       posy = keyrouter.popup_rooty;
-
-       if( keyrouter.popup_angle == 0 || keyrouter.popup_angle == 180 )
-       {
-               if( (keyrouter.popup_rootx+POPUP_MENU_WIDTH) >= keyrouter.zone->w )
-               {
-                       posx -= POPUP_MENU_WIDTH;
-                       keyrouter.rbutton_pressed_on_popup = 1;
-               }
-               if( (keyrouter.popup_rooty+POPUP_MENU_HEIGHT) >= keyrouter.zone->h )
-               {
-                       posy -= POPUP_MENU_HEIGHT;
-                       keyrouter.rbutton_pressed_on_popup = 1;
-               }
-               e_popup_move(keyrouter.popup, posx, posy);
-       }
-       else
-       {
-               if( (keyrouter.popup_rootx+POPUP_MENU_HEIGHT) >= keyrouter.zone->w )
-               {
-                       posx -= POPUP_MENU_HEIGHT;
-                       keyrouter.rbutton_pressed_on_popup = 1;
-               }
-               if( (keyrouter.popup_rooty+POPUP_MENU_WIDTH) >= keyrouter.zone->h )
-               {
-                       posy -= POPUP_MENU_WIDTH;
-                       keyrouter.rbutton_pressed_on_popup = 1;
-               }
-               e_popup_move(keyrouter.popup, posx, posy);
-       }
-
-       e_popup_show(keyrouter.popup);
-
-       XISelectEvents(keyrouter.disp, keyrouter.rootWin, &keyrouter.eventmask_all, 1);
-
-       if( !ecore_x_pointer_grab(keyrouter.popup->evas_win) )
-               fprintf(stderr, "[keyrouter][%s] Failed to grab pointer !\n", __FUNCTION__);
-
-       //effect disable for popup
-       effect_state_atom = ecore_x_atom_get ("_NET_CM_WINDOW_EFFECT_ENABLE");
-
-       if( !effect_state_atom)
-               fprintf(stderr, "[keyrouter][%s] Cannot find _NET_CM_WINDOW_EFFECT_ENABLE atom...\n", __FUNCTION__);
-
-       ecore_x_window_prop_property_set(keyrouter.popup->evas_win, effect_state_atom, ECORE_X_ATOM_CARDINAL, 32, &state, 1);
-
-       for( i = 0 ; i < 4 ; i++ )
-       {
-               keyrouter.popup_btns[i] = NULL;
-               //creating event handlers of contents of popup
-
-               keyrouter.popup_btns[i] = e_widget_button_add(evas_object_evas_get(keyrouter.popup_bg), btns_label[i], NULL, NULL, NULL, NULL);
-               evas_object_event_callback_add(keyrouter.popup_btns[i], EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_e_keyrouter_popup_btn_down_cb, btns_label[i]);
-               evas_object_event_callback_add(keyrouter.popup_btns[i], EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_e_keyrouter_popup_btn_up_cb, btns_label[i]);
-
-               evas_object_move(keyrouter.popup_btns[i], 0, i*30);
-               evas_object_resize(keyrouter.popup_btns[i], POPUP_MENU_WIDTH, 30);
-               evas_object_show(keyrouter.popup_btns[i]);
-       }
-
-       if( keyrouter.popup_angle != 0 )
-               ecore_evas_rotation_with_resize_set(keyrouter.popup->ecore_evas, keyrouter.popup_angle);
-
-       return;
-}
-#endif//_F_ENABLE_MOUSE_POPUP
-
 static void Device_Status(unsigned int val)
 {
-       if( 1 == val )
-       {
-               keyrouter.fplog = stderr;
-       }
-       else if( 2 == val )
-       {
-               keyrouter.fplog = fopen(KEYROUTER_LOG_FILE, "w+");
-
-               if( keyrouter.fplog == 0 )
-               {
-                       fprintf(stderr, "[keyrouter][Device_Status] Failed to open file (%s) !\n", KEYROUTER_LOG_FILE);
-                       keyrouter.fplog = (struct FILE *)stderr;
-               }
-       }
-
-       fprintf(keyrouter.fplog, "\n[keyrouter] - Device Status = Start =====================\n");
+       SLOG(LOG_DEBUG, "KEYROUTER", "\n[keyrouter] - Device Status = Start =====================\n");
 
        if( keyrouter.device_list )
        {
@@ -3289,69 +2459,40 @@ static void Device_Status(unsigned int val)
                {
                        if( data )
                        {
-                               fprintf(keyrouter.fplog, "Device id : %d Name : %s\n", data->id, data->name);
+                               SLOG(LOG_DEBUG, "KEYROUTER", "Device id : %d Name : %s\n", data->id, data->name);
                                switch( data->type )
                                {
                                        case E_KEYROUTER_HWKEY:
-                                               fprintf(keyrouter.fplog, "¦¦Device type : H/W Key Device\n");
+                                               SLOG(LOG_DEBUG, "KEYROUTER", "¦¦Device type : H/W Key Device\n");
                                                break;
 
                                        case E_KEYROUTER_HOTPLUGGED:
-                                               fprintf(keyrouter.fplog, "¦¦Device type : Hotplugged Key Device\n");
+                                               SLOG(LOG_DEBUG, "KEYROUTER", "¦¦Device type : Hotplugged Key Device\n");
                                                break;
 
                                        case E_KEYROUTER_KEYBOARD:
-                                               fprintf(keyrouter.fplog, "¦¦Device type : Hotplugged Keyboard Device\n");
+                                               SLOG(LOG_DEBUG, "KEYROUTER", "¦¦Device type : Hotplugged Keyboard Device\n");
                                                break;
 
                                        default:
-                                               fprintf(keyrouter.fplog, "¦¦Device type : Unknown\n");
+                                               SLOG(LOG_DEBUG, "KEYROUTER", "¦¦Device type : Unknown\n");
                                }
                        }
                }
        }
        else
        {
-               fprintf(keyrouter.fplog, "No input devices...\n");
+               SLOG(LOG_DEBUG, "KEYROUTER", "No input devices...\n");
        }
 
-       fprintf(keyrouter.fplog, "\n[keyrouter] - Device Status = End =====================\n");
-
-       if( keyrouter.fplog != stderr )
-       {
-               fflush(keyrouter.fplog);
-               fclose(keyrouter.fplog);
-               keyrouter.fplog = (struct FILE *)stderr;
-       }
+       SLOG(LOG_DEBUG, "KEYROUTER", "\n[keyrouter] - Device Status = End =====================\n");
 }
 
 static void Keygrab_Status(unsigned int val)
 {
-       if( 1 == val )
-       {
-               keyrouter.fplog = (struct FILE *)stderr;
-       }
-       else if( 2 == val )
-       {
-               keyrouter.fplog = fopen(KEYROUTER_LOG_FILE, "w+");
-
-               if( !keyrouter.fplog )
-               {
-                       fprintf(stderr, "[keyrouter][Keygrab_Status] Failed to open file (%s) !\n", KEYROUTER_LOG_FILE);
-                       keyrouter.fplog = (struct FILE *)stderr;
-               }
-       }
-
-       fprintf(keyrouter.fplog, "\n[keyrouter] - Grab Status = Start =====================\n");
+       SECURE_SLOGD("\n[keyrouter] - Grab Status = Start =====================\n");
        PrintKeyDeliveryList();
-       fprintf(keyrouter.fplog, "\n[keyrouter] - Grab Status = End =====================\n");
-
-       if( keyrouter.fplog != stderr )
-       {
-               fflush(keyrouter.fplog);
-               fclose(keyrouter.fplog);
-               keyrouter.fplog = (struct FILE *)stderr;
-       }
+       SECURE_SLOGD("\n[keyrouter] - Grab Status = End =====================\n");
 }
 
 static void InitModKeys()
@@ -3370,13 +2511,10 @@ static void InitModKeys()
        keyrouter.cancel_key.keysym = XStringToKeysym(KEY_CANCEL);
        keyrouter.cancel_key.keycode = XKeysymToKeycode(keyrouter.disp, keyrouter.cancel_key.keysym);
 
-       fprintf(stderr, "[keyrouter][%s][%d] Modifier Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_POWER, keyrouter.modkey[i].keys[0].keycode);
-       fprintf(stderr, "[keyrouter][%s][%d] Composited Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEDOWN, keyrouter.modkey[i].keys[1].keycode);
-       fprintf(stderr, "[keyrouter][%s][%d] Cancel Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_CANCEL, keyrouter.cancel_key.keycode);
-#ifdef __DEBUG__
-       fprintf(stderr, "[keyrouter][%s][%d] modkey.composited=%d, modkey.set=%d, modkey.time=%d\n", __FUNCTION__, i, keyrouter.modkey[i].composited, keyrouter.modkey[i].set, (int)keyrouter.modkey[i].time);
-       fprintf(stderr, "[keyrouter][%s][%d] modkey.idx_mod=%d, modkey.idx_comp=%d, press_only=%d\n", __FUNCTION__, i, keyrouter.modkey[i].idx_mod, keyrouter.modkey[i].idx_comp, keyrouter.modkey[i].press_only);
-#endif//__DEBUG__
+       SECURE_SLOGD("[keyrouter][%s][%d] Modifier Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_POWER, keyrouter.modkey[i].keys[0].keycode);
+       SECURE_SLOGD("[keyrouter][%s][%d] Composited Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEDOWN, keyrouter.modkey[i].keys[1].keycode);
+       SECURE_SLOGD("[keyrouter][%s][%d] Cancel Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_CANCEL, keyrouter.cancel_key.keycode);
+
        i++;
        keyrouter.modkey[i].keys[0].keysym = XStringToKeysym(KEY_VOLUMEUP);
        keyrouter.modkey[i].keys[0].keycode = XKeysymToKeycode(keyrouter.disp, keyrouter.modkey[i].keys[0].keysym);
@@ -3384,14 +2522,9 @@ static void InitModKeys()
        keyrouter.modkey[i].keys[1].keycode = XKeysymToKeycode(keyrouter.disp, keyrouter.modkey[i].keys[1].keysym);
        keyrouter.modkey[i].press_only = EINA_FALSE;
 
-       fprintf(stderr, "[keyrouter][%s][%d] Modifier Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEUP, keyrouter.modkey[i].keys[0].keycode);
-       fprintf(stderr, "[keyrouter][%s][%d] Composited Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEDOWN, keyrouter.modkey[i].keys[1].keycode);
-       fprintf(stderr, "[keyrouter][%s][%d] Cancel Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_CANCEL, keyrouter.cancel_key.keycode);
-#ifdef __DEBUG__
-       fprintf(stderr, "[keyrouter][%s][%d] modkey.composited=%d, modkey.set=%d, modkey.time=%d\n", __FUNCTION__, i, keyrouter.modkey[i].composited, keyrouter.modkey[i].set, (int)keyrouter.modkey[i].time);
-       fprintf(stderr, "[keyrouter][%s][%d] modkey.idx_mod=%d, modkey.idx_comp=%d, press_only=%d\n", __FUNCTION__, i, keyrouter.modkey[i].idx_mod, keyrouter.modkey[i].idx_comp, keyrouter.modkey[i].press_only);
-#endif//__DEBUG__
-
+       SECURE_SLOGD("[keyrouter][%s][%d] Modifier Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEUP, keyrouter.modkey[i].keys[0].keycode);
+       SECURE_SLOGD("[keyrouter][%s][%d] Composited Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_VOLUMEDOWN, keyrouter.modkey[i].keys[1].keycode);
+       SECURE_SLOGD("[keyrouter][%s][%d] Cancel Key=%s (keycode:%d)\n", __FUNCTION__, i, KEY_CANCEL, keyrouter.cancel_key.keycode);
 }
 
 static void ResetModKeyInfo()
@@ -3400,19 +2533,11 @@ static void ResetModKeyInfo()
 
        for(i=0 ; i < NUM_KEY_COMPOSITION_ACTIONS ; i++)
        {
-#ifdef __DEBUG__
-               fprintf(stderr, "[keyrouter][%s][%d] Current Mod Key Info\n", __FUNCTION__, i);
-               fprintf(stderr, "[keyrouter][%s][%d] modkey.set=%d, modkey.composited=%d, modkey.time=%d, modkey.idx_mod=%d, modkey.idx_comp=%d\n",
-                       __FUNCTION__, i, keyrouter.modkey[i].set, keyrouter.modkey[i].composited, (int)keyrouter.modkey[i].time, keyrouter.modkey[i].idx_mod, keyrouter.modkey[i].idx_comp);
-#endif
                keyrouter.modkey[i].set = keyrouter.modkey[i].composited = keyrouter.modkey[i].time = keyrouter.modkey[i].idx_mod = keyrouter.modkey[i].idx_comp = 0;
-#ifdef __DEBUG__
-               fprintf(stderr, "[keyrouter][%s][%d] Reset Mod Key Info\n", __FUNCTION__, i);
-#endif
        }
 
        keyrouter.modkey_set = 0;
-       fprintf(stderr, "[keyrouter][%s][%d] modkey_set=%d\n", __FUNCTION__, i, keyrouter.modkey_set);
+       SECURE_SLOGD("[keyrouter][%s][%d] modkey_set=%d\n", __FUNCTION__, i, keyrouter.modkey_set);
 }
 
 static int IsModKey(XEvent *ev, int index)
@@ -3470,7 +2595,7 @@ static void DoKeyCompositionAction(int index, int press)
        XSendEvent(keyrouter.disp, keyrouter.rootWin, False, StructureNotifyMask | SubstructureNotifyMask, &xev);
        XSync(keyrouter.disp, False);
 
-       fprintf(stderr, "\n[keyrouter][%s][%d] Do Key Composition Action : ClientMessage to RootWindow(0x%x)!: %s\n", __FUNCTION__, i, keyrouter.rootWin, press ? "Press" : "Release");
+       SECURE_SLOGD("\n[keyrouter][%s][%d] Do Key Composition Action : ClientMessage to RootWindow(0x%x)!: %s\n", __FUNCTION__, i, keyrouter.rootWin, press ? "Press" : "Release");
 }
 
 // End of a file
index 122b550..29b154f 100755 (executable)
 //maximum number of hardkeys
 #define MAX_HARDKEYS   255
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-#define POPUP_MENU_WIDTH       95
-#define POPUP_MENU_HEIGHT      120
-#endif//_F_ENABLE_MOUSE_POPUP
-
 //grab modes
 #define NONE_GRAB_MODE 0
 #define OR_EXCL_GRAB_MODE      1
@@ -117,15 +112,6 @@ typedef struct _ModifierKey
 } ModifierKey;
 typedef struct ModifierKey *ModifierKeyPtr;
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-const char *btns_label[] = {
-       "Volume Up",
-       "Volume Down",
-       "Go Home",
-       "Rotate"
-};
-#endif//_F_ENABLE_MOUSE_POPUP
-
 #define NUM_HWKEYS             33
 const char *HWKeys[] = {
        KEY_VOLUMEUP,
@@ -203,20 +189,6 @@ typedef struct _tag_keyrouter
 
        E_Zone *zone;
 
-#ifdef _F_ENABLE_MOUSE_POPUP
-       //mouse rbutton popup related variables
-       int toggle;
-       int rbutton_pressed_on_popup;
-       int popup_angle;
-       int popup_rootx;
-       int popup_rooty;
-
-       E_Popup     *popup;
-       Evas_Object *popup_btns[4];
-       Evas_Object* popup_bg;
-       unsigned int btn_keys[3];
-#endif//_F_ENABLE_MOUSE_POPUP
-
        //number of connected pointer and keyboard devices
        int num_hwkey_devices;
 
@@ -241,8 +213,6 @@ typedef struct _tag_keyrouter
        int resTopVisibleCheck;
        int prev_sent_keycode;
 
-       struct FILE *fplog;
-
        //atoms
        Atom atomHWKeyEmulation;
        Atom atomGrabKey;
@@ -251,11 +221,6 @@ typedef struct _tag_keyrouter
        Atom atomGrabExclWin;
        Atom atomGrabORExclWin;
 
-#ifdef _F_USE_XI_GRABDEVICE_
-       XEvent *gev;
-       XGenericEventCookie *gcookie;
-#endif
-
        //event handlers
        Ecore_Event_Handler *e_client_message_handler;
        Ecore_Event_Handler *e_window_property_handler;
@@ -265,12 +230,8 @@ typedef struct _tag_keyrouter
        Ecore_Event_Handler *e_window_destroy_handler;
        Ecore_Event_Handler *e_window_configure_handler;
        Ecore_Event_Handler *e_window_stack_handler;
-#ifdef _F_USE_XI_GRABDEVICE_
-       Ecore_Event_Handler *e_event_generic_handler;
-#else//_F_USE_XI_GRABDEVICE_
        Ecore_Event_Handler *e_event_generic_handler;
        Ecore_Event_Handler *e_event_any_handler;
-#endif//_F_USE_XI_GRABDEVICE_
 } KeyRouter;
 
 //function prototypes
@@ -289,13 +250,8 @@ static void _e_keyrouter_set_key_repeat(int key, int auto_repeat_mode);
 static void _e_keyrouter_hwkey_event_handler(XEvent *ev);
 
 //event handlers
-#ifdef _F_USE_XI_GRABDEVICE_
-static int _e_keyrouter_cb_event_generic(void *data, int ev_type, void *ev);
-#else//_F_USE_XI_GRABDEVICE_
 static int _e_keyrouter_cb_event_generic(void *data, int ev_type, void *event);
 static int _e_keyrouter_cb_event_any(void *data, int ev_type, void *ev);
-#endif//_F_USE_XI_GRABDEVICE_
-//static int _e_keyrouter_cb_e_border_add(void *data, int ev_type, void *ev);
 static int _e_keyrouter_cb_window_property(void *data, int ev_type, void *ev);
 static int _e_keyrouter_cb_e_border_stack(void *data, int ev_type, void *ev);
 static int _e_keyrouter_cb_e_border_remove(void *data, int ev_type, void *ev);
@@ -315,30 +271,14 @@ static void _e_keyrouter_update_key_delivery_list(Ecore_X_Window win, int keycod
 static int _e_keyrouter_modifiers(E_Binding_Modifier modifiers);
 static void _e_keyrouter_do_bound_key_action(XEvent *xev);
 
-#ifdef _F_USE_XI_GRABDEVICE_
-static void DeliverKeyEvents(XEvent *xev, XGenericEventCookie *cookie);
-#else//_F_USE_XI_GRABDEVICE_
-//static void DeliverDeviceKeyEvents(XEvent *xev);
 static void DeliverDeviceKeyEvents(XEvent *xev, int replace_key);
-#endif//_F_USE_XI_GRABDEVICE_
 
 static void InitGrabKeyDevices();
-#ifdef _F_USE_XI_GRABDEVICE_
-static int GrabXIKeyDevices();
-static void UngrabXIKeyDevices();
-#else//_F_USE_XI_GRABDEVICE_
 static int GrabKeyDevices(Window win);
 static void UngrabKeyDevices();
-#endif//_F_USE_XI_GRABDEVICE_
 
 //functions related to mouse rbutton popup
 static E_Zone* _e_keyrouter_get_zone();
-#ifdef _F_ENABLE_MOUSE_POPUP
-static void InitHardKeyCodes();
-static void popup_update();
-static void popup_show();
-static void popup_destroy();
-#endif//_F_ENABLE_MOUSE_POPUP
 static void _e_keyrouter_do_hardkey_emulation(const char *label, unsigned int key_event, unsigned int on_release, int keycode, int cancel);
 
 //functions related to key composition for screen capture
index b3b0f99..ada8832 100644 (file)
@@ -50,6 +50,8 @@ module_la_SOURCES      = e_mod_main.c \
                          e_mod_move_taskmanager.h \
                          e_mod_move_pwlock.c \
                          e_mod_move_pwlock.h \
+                         e_mod_move_setup_wizard.c \
+                         e_mod_move_setup_wizard.h \
                          e_mod_move_flick.c \
                          e_mod_move_flick.h \
                          e_mod_move_widget_object.c \
index 3f8221c..38f6f4e 100644 (file)
@@ -124,50 +124,31 @@ _e_mod_move_mouse_btn_dn(void    *data,
                          int type __UNUSED__,
                          void    *event)
 {
-   E_Move *m;
    Ecore_Event_Mouse_Button *ev = (Ecore_Event_Mouse_Button *)event;
    E_CHECK_RETURN(ev, ECORE_CALLBACK_PASS_ON);
 
-   m = e_mod_move_util_get();
-   if ((m) && (m->ev_log))
+   if (ev->multi.device == 0) // single mouse down
      {
-        E_Move_Event_Log *log = NULL;
-
-        log = E_NEW(E_Move_Event_Log, 1);
-        if (log)
-          {
-             if (ev->multi.device == 0) // single mouse down
-               {
-                  log->t = E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_DOWN;
-                  log->d.ec_sm.win = ev->window;
-                  log->d.ec_sm.x = ev->x;
-                  log->d.ec_sm.y = ev->y;
-                  log->d.ec_sm.btn = ev->buttons;
-               }
-             else if (ev->multi.device > 0) // multi mouse down
-               {
-                  log->t = E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_DOWN;
-                  log->d.ec_mm.win = ev->window;
-                  log->d.ec_mm.x = ev->multi.x;
-                  log->d.ec_mm.y = ev->multi.y;
-                  log->d.ec_mm.btn = ev->buttons;
-                  log->d.ec_mm.dev = ev->multi.device;
-               }
-             else
-               {
-                  log->t = E_MOVE_EVENT_LOG_UNKOWN;
-               }
-             // list check and append
-             if (eina_list_count(m->ev_logs) >= m->ev_log_cnt)
-               {
-                  // if log list is full, delete first log
-                  E_Move_Event_Log *first_log = (E_Move_Event_Log*)eina_list_nth(m->ev_logs, 0);
-                  m->ev_logs = eina_list_remove(m->ev_logs, first_log);
-                  memset(first_log, 0, sizeof(E_Move_Event_Log));
-                  E_FREE(first_log);
-               }
-             m->ev_logs = eina_list_append(m->ev_logs, log);
-          }
+        SECURE_SLOGD("%23s   w:0x%08x (%4d ,%4d )  btn:%d\n",
+                     "ECORE_SINGLE_MOUSE_DOWN",
+                     ev->window,
+                     ev->x,
+                     ev->y,
+                     ev->buttons);
+     }
+   else if (ev->multi.device > 0) // multi mouse down
+     {
+        SECURE_SLOGD("%23s   w:0x%08x (%5.1f,%5.1f)  btn:%d | dev:%d\n",
+                     "ECORE_MULTI_MOUSE_DOWN",
+                     ev->window,
+                     ev->multi.x,
+                     ev->multi.y,
+                     ev->buttons,
+                     ev->multi.device);
+     }
+   else
+     {
+        SECURE_SLOGD("%23s\n","EVENT_LOG_UNKOWN");
      }
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -177,50 +158,31 @@ _e_mod_move_mouse_btn_up(void    *data,
                          int type __UNUSED__,
                          void    *event)
 {
-   E_Move *m;
    Ecore_Event_Mouse_Button *ev = (Ecore_Event_Mouse_Button *)event;
    E_CHECK_RETURN(ev, ECORE_CALLBACK_PASS_ON);
 
-   m = e_mod_move_util_get();
-   if ((m) && (m->ev_log))
+   if (ev->multi.device == 0) // single mouse up
      {
-        E_Move_Event_Log *log = NULL;
-
-        log = E_NEW(E_Move_Event_Log, 1);
-        if (log)
-          {
-             if (ev->multi.device == 0) // single mouse up
-               {
-                  log->t = E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_UP;
-                  log->d.ec_sm.win = ev->window;
-                  log->d.ec_sm.x = ev->x;
-                  log->d.ec_sm.y = ev->y;
-                  log->d.ec_sm.btn = ev->buttons;
-               }
-             else if (ev->multi.device > 0) // multi mouse up
-               {
-                  log->t = E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_UP;
-                  log->d.ec_mm.win = ev->window;
-                  log->d.ec_mm.x = ev->multi.x;
-                  log->d.ec_mm.y = ev->multi.y;
-                  log->d.ec_mm.btn = ev->buttons;
-                  log->d.ec_mm.dev = ev->multi.device;
-               }
-             else
-               {
-                  log->t = E_MOVE_EVENT_LOG_UNKOWN;
-               }
-             // list check and append
-             if (eina_list_count(m->ev_logs) >= m->ev_log_cnt)
-               {
-                  // if log list is full, delete first log
-                  E_Move_Event_Log *first_log = (E_Move_Event_Log*)eina_list_nth(m->ev_logs, 0);
-                  m->ev_logs = eina_list_remove(m->ev_logs, first_log);
-                  memset(first_log, 0, sizeof(E_Move_Event_Log));
-                  E_FREE(first_log);
-               }
-             m->ev_logs = eina_list_append(m->ev_logs, log);
-          }
+        SECURE_SLOGD("%23s   w:0x%08x (%4d ,%4d )  btn:%d\n",
+                     "ECORE_SINGLE_MOUSE_UP",
+                     ev->window,
+                     ev->x,
+                     ev->y,
+                     ev->buttons);
+     }
+   else if (ev->multi.device > 0) // multi mouse up
+     {
+        SECURE_SLOGD("%23s   w:0x%08x (%5.1f,%5.1f)  btn:%d | dev:%d\n",
+                     "ECORE_MULTI_MOUSE_UP",
+                     ev->window,
+                     ev->multi.x,
+                     ev->multi.y,
+                     ev->buttons,
+                     ev->multi.device);
+     }
+   else
+     {
+        SECURE_SLOGD("%23s\n","EVENT_LOG_UNKOWN");
      }
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -294,9 +256,9 @@ _e_mod_move_message(void *data __UNUSED__,
 
    if (t == ATOM_WM_WINDOW_SHOW)
      {
-        LOG(LOG_DEBUG,
-            "WM_WINDOW_SHOW", "[e17:X_CLIENT_MESSAGE] w:0x%08x atom:%s",
-            ev->win,e_mod_move_atoms_name_get(t));
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+             "[e17:X_CLIENT_MESSAGE] w:0x%08x atom:%s",
+             ev->win,e_mod_move_atoms_name_get(t));
         _e_mod_move_msg_window_show(ev);
      }
    else if (t == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) _e_mod_move_msg_qp_state(ev);
@@ -897,6 +859,20 @@ _e_mod_move_bd_add_intern(E_Move_Border *mb)
         e_mod_move_util_prop_indicator_cmd_win_set(win, m);
         _e_mod_move_prop_indicator_geometry_get(win, m);
      }
+   else if (TYPE_SETUP_WIZARD_CHECK(mb))
+     {
+        E_Move_Mini_Apptray_Widget *mini_apptray_widget = NULL;
+        E_Move_Indicator_Widget *indi_widget = NULL;
+
+        if (!m->setup_wizard_state)
+          {
+             m->setup_wizard_state = EINA_TRUE;
+             indi_widget = e_mod_move_indicator_widget_get();
+             if (indi_widget) e_mod_move_indicator_widget_del(indi_widget);
+             mini_apptray_widget = e_mod_move_mini_apptray_widget_get();
+             if (mini_apptray_widget) e_mod_move_mini_apptray_widget_del(mini_apptray_widget);
+          }
+     }
 }
 
 static void
@@ -929,6 +905,17 @@ _e_mod_move_bd_del_intern(E_Move_Border *mb)
    _e_mod_move_bd_obj_del(mb);
    _e_mod_move_ctl_obj_del(mb);
    m->borders = eina_inlist_remove(m->borders, EINA_INLIST_GET(mb));
+
+   if (TYPE_SETUP_WIZARD_CHECK(mb))
+     {
+        if ((e_mod_move_setup_wizard_find() == NULL))
+          {
+             m->setup_wizard_state = EINA_FALSE;
+             if (m->elm_indicator_mode) e_mod_move_indicator_widget_apply();
+             e_mod_move_mini_apptray_widget_apply();
+          }
+     }
+
    memset(mb, 0, sizeof(E_Move_Border));
    free(mb);
 }
@@ -2208,7 +2195,7 @@ _e_mod_move_msg_window_show(Ecore_X_Event_Client_Message *ev)
                 e_mod_move_mini_apptray_objs_add(mini_at_mb);
 
              // send mini_apptray to "move start message".
-             LOG(LOG_DEBUG, "WM_WINDOW_SHOW", "[e17:X_CLIENT_MESSAGE:ApptrayShow:ANIMATION_START]");
+             SLOG(LOG_DEBUG, "E17_MOVE_MODULE","[e17:X_CLIENT_MESSAGE:ApptrayShow:ANIMATION_START]");
              e_mod_move_mini_apptray_anim_state_send(mini_at_mb, EINA_TRUE);
 
              e_mod_move_mini_apptray_e_border_move(mini_at_mb, x, y);
@@ -2318,7 +2305,7 @@ _e_mod_move_msg_window_show(Ecore_X_Event_Client_Message *ev)
              e_mod_move_apptray_anim_state_send(at_mb, EINA_TRUE);
 
              e_mod_move_apptray_e_border_move(at_mb, x, y);
-             LOG(LOG_DEBUG, "WM_WINDOW_SHOW", "[e17:X_CLIENT_MESSAGE:ApptrayHide:ANIMATION_START]");
+             SLOG(LOG_DEBUG, "E17_MOVE_MODULE","[e17:X_CLIENT_MESSAGE:ApptrayHide:ANIMATION_START]");
              e_mod_move_apptray_objs_animation_move(at_mb, x, y);
              L(LT_EVENT_X,
                "[MOVE] ev:%15.15s Apptray Hide %s():%d\n",
@@ -2361,10 +2348,10 @@ _e_mod_move_msg_window_show(Ecore_X_Event_Client_Message *ev)
      }
    else
      {
-        fprintf(stderr,
-                "[MOVE_MODULE] _NET_WM_WINDOW_SHOW error."
-                " w:0x%07x(state:%d) request:%d\n",
-                win, state, open);
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+             "[MOVE_MODULE] _NET_WM_WINDOW_SHOW error."
+             " w:0x%07x(state:%d) request:%d\n",
+             win, state, open);
      }
    return EINA_TRUE;
 }
@@ -2657,10 +2644,10 @@ _e_mod_move_msg_qp_state(Ecore_X_Event_Client_Message *ev)
      }
    else
      {
-        fprintf(stderr,
-                "[MOVE_MODULE] _E_ILLUME_QUICKPANEL_STATE error."
-                " w:0x%07x(state:%d) request:%d\n",
-                win, state, open);
+                SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+                                "[MOVE_MODULE] _E_ILLUME_QUICKPANEL_STATE error."
+                                " w:0x%07x(state:%d) request:%d\n",
+                                win, state, open);
      }
 
    return EINA_TRUE;
@@ -2703,12 +2690,16 @@ static E_Move *
 _e_mod_move_add(E_Manager *man)
 {
    E_Move *m;
+   E_Zone *zone;
    Ecore_X_Window *wins;
    int i, num;
 
    E_Move_Canvas *canvas;
    E_Border *bd;
 
+   zone = e_util_zone_current_get(man);
+   E_CHECK_RETURN(zone, NULL);
+
    m = E_NEW(E_Move, 1);
    E_CHECK_RETURN(m, NULL);
 
@@ -2737,8 +2728,6 @@ _e_mod_move_add(E_Manager *man)
    m->animation_duration = _move_mod->conf->animation_duration;
    m->dim_max_opacity = _move_mod->conf->dim_max_opacity;
    m->dim_min_opacity = _move_mod->conf->dim_min_opacity;
-   m->ev_log = _move_mod->conf->event_log;
-   m->ev_log_cnt = _move_mod->conf->event_log_count;
    m->elm_indicator_mode = _move_mod->conf->elm_indicator_mode;
    wins = ecore_x_window_children_get(m->man->root, &num);
 
@@ -2777,38 +2766,43 @@ _e_mod_move_add(E_Manager *man)
       = _move_mod->conf->indicator_widget_geometry[E_MOVE_ANGLE_270].h;
 
    // miniapp_tray widget gemometry setting
+   m->apptray_launch_by_flickup = _move_mod->conf->apptray_launch_by_flickup;
+
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].x
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].x;
+      = zone->x;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].y
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].y;
+      = zone->h - _move_mod->conf->apptray_widget_size.portrait;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].w
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].w;
+      = zone->w;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].h
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].h;
+      = _move_mod->conf->apptray_widget_size.portrait;
+
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].x
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].x;
+      = zone->w - _move_mod->conf->apptray_widget_size.landscape;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].y
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].y;
+      = zone->y;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].w
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].w;
+      = _move_mod->conf->apptray_widget_size.landscape;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].h
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].h;
+      =  zone->h;
+
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].x
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].x;
+      = zone->x;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].y
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].y;
+      = zone->y;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].w
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].w;
+      = zone->w;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].h
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].h;
+      = _move_mod->conf->apptray_widget_size.portrait;
+
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].x
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].x;
+      = zone->x;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].y
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].y;
+      = zone->y;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].w
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].w;
+      = _move_mod->conf->apptray_widget_size.landscape;
    m->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].h
-      = _move_mod->conf->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].h;
+      = zone->h;
 
    if (wins)
      {
@@ -2836,10 +2830,8 @@ _e_mod_move_add(E_Manager *man)
 static void
 _e_mod_move_del(E_Move *m)
 {
-   Eina_List *l;
    E_Move_Border *mb;
    E_Move_Canvas *canvas;
-   E_Move_Event_Log *log;
 
    E_CHECK(m);
    while (m->borders)
@@ -2852,13 +2844,6 @@ _e_mod_move_del(E_Move *m)
    EINA_LIST_FREE(m->canvases, canvas) e_mod_move_canvas_del(canvas);
    m->canvases = NULL;
 
-   EINA_LIST_FOREACH(m->ev_logs, l, log)
-     {
-        memset(log, 0, sizeof(E_Move_Event_Log));
-        E_FREE(log);
-     }
-   eina_list_free(m->ev_logs);
-
    if (m->borders_list) eina_list_free(m->borders_list);
 
    free(m);
index 208a2d0..ecea356 100644 (file)
@@ -118,10 +118,10 @@ _e_mod_move_apptray_cb_motion_move(void *data,
    info  = (E_Move_Event_Motion_Info *)event_info;
    if (!mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -181,10 +181,10 @@ _e_mod_move_apptray_cb_motion_end(void *data,
    if (mouse_up_event->button != 1)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -338,7 +338,7 @@ _e_mod_move_apptray_objs_animation_frame(void  *data,
           }
 
         // send apptray to "move end message".
-        LOG(LOG_DEBUG, "WM_WINDOW_SHOW", "[e17:X_CLIENT_MESSAGE:Apptray:ANIMATION_END]");
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE","[e17:X_CLIENT_MESSAGE:Apptray:ANIMATION_END]");
         e_mod_move_apptray_anim_state_send(mb, EINA_FALSE);
 
         e_mod_move_apptray_objs_del(mb);
index 804a83c..2e03b2d 100644 (file)
@@ -15,6 +15,7 @@ typedef enum _E_Move_Border_Class_Type
    E_MOVE_BORDER_CLASS_TYPE_INDICATOR,
    E_MOVE_BORDER_CLASS_TYPE_APPTRAY,
    E_MOVE_BORDER_CLASS_TYPE_MINI_APPTRAY,
+   E_MOVE_BORDER_CLASS_TYPE_SETUP_WIZARD,
    E_MOVE_BORDER_CLASS_TYPE_PWLOCK,
    E_MOVE_BORDER_CLASS_TYPE_BACKGROUND,
    E_MOVE_BORDER_CLASS_TYPE_ISF,
@@ -33,6 +34,7 @@ typedef enum _E_Move_Border_Name_Type
    E_MOVE_BORDER_NAME_TYPE_INDICATOR,
    E_MOVE_BORDER_NAME_TYPE_APPTRAY,
    E_MOVE_BORDER_NAME_TYPE_MINI_APPTRAY,
+   E_MOVE_BORDER_NAME_TYPE_SETUP_WIZARD,
    E_MOVE_BORDER_NAME_TYPE_PWLOCK,
    E_MOVE_BORDER_NAME_TYPE_BACKGROUND,
    E_MOVE_BORDER_NAME_TYPE_ISF_KEYBOARD,
@@ -55,6 +57,7 @@ static const char *border_class[] =
    "INDICATOR",
    "APP_TRAY",
    "MINIAPP_TRAY",
+   "SETUP_WIZARD",
    //"PW_LOCK",
    "pwlock",
    "BACKGROUND",
@@ -73,6 +76,7 @@ static const char *border_name[] =
    "INDICATOR",
    "APP_TRAY",
    "MINIAPP_TRAY",
+   "SETUP_WIZARD",
    //"PW_LOCK",
    "pwlock",
    "BACKGROUND",
@@ -111,6 +115,7 @@ static const char *type_names[] =
    "E_MOVE_BORDER_TYPE_INDICATOR",
    "E_MOVE_BORDER_TYPE_APPTRAY",
    "E_MOVE_BORDER_TYPE_MINI_APPTRAY",
+   "E_MOVE_BORDER_TYPE_SETUP_WIZARD",
    "E_MOVE_BORDER_TYPE_PWLOCK",
    "E_MOVE_BORDER_TYPE_BACKGROUND",
    "E_MOVE_BORDER_TYPE_ISF_KEYBOARD",
@@ -129,6 +134,7 @@ static E_Move_Border_Class_Type border_class_vals[] =
    E_MOVE_BORDER_CLASS_TYPE_INDICATOR,
    E_MOVE_BORDER_CLASS_TYPE_APPTRAY,
    E_MOVE_BORDER_CLASS_TYPE_MINI_APPTRAY,
+   E_MOVE_BORDER_CLASS_TYPE_SETUP_WIZARD,
    E_MOVE_BORDER_CLASS_TYPE_PWLOCK,
    E_MOVE_BORDER_CLASS_TYPE_BACKGROUND,
    E_MOVE_BORDER_CLASS_TYPE_ISF
@@ -146,6 +152,7 @@ static E_Move_Border_Class_Type border_name_vals[] =
    E_MOVE_BORDER_NAME_TYPE_INDICATOR,
    E_MOVE_BORDER_NAME_TYPE_APPTRAY,
    E_MOVE_BORDER_NAME_TYPE_MINI_APPTRAY,
+   E_MOVE_BORDER_NAME_TYPE_SETUP_WIZARD,
    E_MOVE_BORDER_NAME_TYPE_PWLOCK,
    E_MOVE_BORDER_NAME_TYPE_BACKGROUND,
    E_MOVE_BORDER_NAME_TYPE_ISF_KEYBOARD,
@@ -328,6 +335,9 @@ e_mod_move_border_type_setup(E_Move_Border *mb)
       case E_MOVE_BORDER_CLASS_TYPE_MINI_APPTRAY:
          if (ntype == E_MOVE_BORDER_NAME_TYPE_MINI_APPTRAY)
            res = E_MOVE_BORDER_TYPE_MINI_APPTRAY;
+      case E_MOVE_BORDER_CLASS_TYPE_SETUP_WIZARD:
+         if (ntype == E_MOVE_BORDER_NAME_TYPE_SETUP_WIZARD)
+           res = E_MOVE_BORDER_TYPE_SETUP_WIZARD;
       case E_MOVE_BORDER_CLASS_TYPE_PWLOCK:
          if (ntype == E_MOVE_BORDER_NAME_TYPE_PWLOCK)
            res = E_MOVE_BORDER_TYPE_PWLOCK;
index c8493e0..3fd1c0f 100644 (file)
@@ -34,6 +34,9 @@
 #define TYPE_NOTIFICATION_CHECK(a) \
    ((a)->type == E_MOVE_BORDER_TYPE_NOTIFICATION)
 
+#define TYPE_SETUP_WIZARD_CHECK(a) \
+   ((a)->type == E_MOVE_BORDER_TYPE_SETUP_WIZARD)
+
 typedef enum _E_Move_Border_Type
 {
    E_MOVE_BORDER_TYPE_UNKNOWN = 0,
@@ -61,6 +64,7 @@ typedef enum _E_Move_Border_Type
    E_MOVE_BORDER_TYPE_INDICATOR,
    E_MOVE_BORDER_TYPE_APPTRAY,
    E_MOVE_BORDER_TYPE_MINI_APPTRAY,
+   E_MOVE_BORDER_TYPE_SETUP_WIZARD,
    E_MOVE_BORDER_TYPE_PWLOCK,
    E_MOVE_BORDER_TYPE_BACKGROUND,
    E_MOVE_BORDER_TYPE_ISF_KEYBOARD,
index 2a402d3..d2d6019 100644 (file)
@@ -46,23 +46,10 @@ e_mod_move_cfdata_edd_init(E_Config_DD **conf_edd)
    E_CONFIG_VAL(D, T, indicator_widget_geometry[E_MOVE_ANGLE_270].y, INT);
    E_CONFIG_VAL(D, T, indicator_widget_geometry[E_MOVE_ANGLE_270].w, INT);
    E_CONFIG_VAL(D, T, indicator_widget_geometry[E_MOVE_ANGLE_270].h, INT);
-   // miniapp_tray widget gemometry setting
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_0].x, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_0].y, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_0].w, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_0].h, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_90].x, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_90].y, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_90].w, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_90].h, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_180].x, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_180].y, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_180].w, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_180].h, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_270].x, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_270].y, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_270].w, INT);
-   E_CONFIG_VAL(D, T, mini_apptray_widget_geometry[E_MOVE_ANGLE_270].h, INT);
+   // app_tray widget feature setting
+   E_CONFIG_VAL(D, T, apptray_launch_by_flickup, UCHAR);
+   E_CONFIG_VAL(D, T, apptray_widget_size.portrait, INT);
+   E_CONFIG_VAL(D, T, apptray_widget_size.landscape, INT);
 }
 
 EAPI Config *
@@ -107,23 +94,10 @@ e_mod_move_cfdata_config_new(void)
    cfg->indicator_widget_geometry[E_MOVE_ANGLE_270].y = 0;
    cfg->indicator_widget_geometry[E_MOVE_ANGLE_270].w = 50;
    cfg->indicator_widget_geometry[E_MOVE_ANGLE_270].h = 1280;
-   // mini_apptray widget gemometry setting
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].x = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].y = 1260;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].w = 720;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_0].h = 20;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].x = 700;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].y = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].w = 20;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_90].h = 1280;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].x = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].y = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].w = 720;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_180].h = 20;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].x = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].y = 0;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].w = 20;
-   cfg->mini_apptray_widget_geometry[E_MOVE_ANGLE_270].h = 1280;
+   // app_tray widget feature setting
+   cfg->apptray_launch_by_flickup = 1;
+   cfg->apptray_widget_size.portrait = 20;
+   cfg->apptray_widget_size.landscape = 20;
 
    return cfg;
 }
index 7727321..7a22cd4 100644 (file)
@@ -35,12 +35,13 @@ struct _Config
       int h;
    } indicator_widget_geometry[4]; //indicator widget's per angle geometry. [0]: angle 0, [1]: angle 90, [2]: angle 180, [3]: angle 270
 
+   unsigned char apptray_launch_by_flickup; // 1: apptray launch by flick up feature enable. 0: apptray launch by flick up feature disable
+
    struct {
-      int x;
-      int y;
-      int w;
-      int h;
-   } mini_apptray_widget_geometry[4]; //mini_apptray widget's per angle geometry. [0]: angle 0, [1]: angle 90, [2]: angle 180, [3]: angle 270
+      int portrait;
+      int landscape;
+   } apptray_widget_size; // apptray widget's size.
+
 };
 
 EAPI void    e_mod_move_cfdata_edd_init(E_Config_DD **conf_edd);
index 37cabfb..e11870f 100644 (file)
@@ -23,7 +23,7 @@ e_mod_move_ctl_obj_add(E_Move_Border *mb,
    mco->obj = evas_object_rectangle_add(canvas->evas);
    E_CHECK_GOTO(mco->obj, error_cleanup);
    evas_object_color_set(mco->obj, 0,0,0,0); // set color to fully transparency
-   evas_object_layer_set(mco->obj, EVAS_LAYER_MAX); // set layer to top. this object always on top layer.
+   evas_object_layer_set(mco->obj, EVAS_LAYER_MAX-2); // set layer to top. this object always on top layer.
    evas_object_event_callback_add(mco->obj, EVAS_CALLBACK_DEL,
                                   _e_mod_move_cb_control_object_del, mb);
    evas_object_data_set(mco->obj,"move_ctl_obj", mco->obj);
index 1d9effd..a20dac8 100644 (file)
@@ -17,7 +17,6 @@ static void _e_mod_move_debug_control_objects_info_dump(E_Move *m, E_Move_Canvas
 static void _e_mod_move_debug_canvas_info_dump(E_Move *m, E_Move_Canvas *canvas, FILE *fs);
 static void _e_mod_move_debug_evas_stack_dump(E_Move *m, E_Move_Canvas *canvas, FILE *fs);
 static void _e_mod_move_debug_dim_objects_info_dump(E_Move *m, E_Move_Canvas *canvas, FILE *fs);
-static void _e_mod_move_debug_event_logs_dump(E_Move *m, FILE *fs);
 static void _e_mod_move_debug_control_objects_visible_set(E_Move *m, E_Move_Canvas *canvas, Eina_Bool visi);
 static void _e_mod_move_debug_widget_objects_visible_set(E_Move *m, E_Move_Canvas *canvas, Eina_Bool visi);
 static void _e_mod_move_debug_objects_visible_set(Eina_Bool visi);
@@ -84,6 +83,7 @@ _e_mod_move_debug_borders_info_dump(E_Move *m,
    fprintf(fs, "E------------------------------------------------------------------------------------------------------------------------------------\n");
    fprintf(fs, "\nB-------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
    fprintf(fs, "   Screen Reader State: %d\n", m->screen_reader_state);
+   fprintf(fs, "   Setup Wizard  State: %d\n", m->setup_wizard_state);
    fprintf(fs, "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
 }
 
@@ -544,136 +544,6 @@ _e_mod_move_debug_dim_objects_info_dump(E_Move        *m,
 }
 
 static void
-_e_mod_move_debug_event_logs_dump(E_Move *m,
-                                  FILE   *fs)
-{
-   Eina_List *l;
-   E_Move_Event_Log *log;
-   int i = 1;
-   char obj_type[20];
-
-   E_CHECK(m);
-   E_CHECK(m->ev_log);
-
-   fprintf(fs, "\n\nB----------------------------------------------------------------------------------------\n");
-   fprintf(fs, "   <MOVE MODULE> EVENT LOG DUMP \n");
-   fprintf(fs, "-----------------------------------------------------------------------------------------\n");
-   fprintf(fs, "-----------------------------------------------------------------------------------------\n");
-   fprintf(fs, " NO         EVENT_TYPE            WID / OBJ    ( x , y )   Button | Additional Data\n");
-   fprintf(fs, "-----------------------------------------------------------------------------------------\n");
-
-   EINA_LIST_FOREACH(m->ev_logs, l, log)
-     {
-        if ((log->t == E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_DOWN)
-             || (log->t == E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_UP))
-          {
-             memset(obj_type, 0, sizeof(obj_type));
-             switch (log->d.eo_m.t)
-               {
-                case E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_QUICKPANEL:
-                   strncpy(obj_type, "QUICKPANEL", sizeof("QUICKPANEL"));
-                   break;
-                case E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_APPTRAY:
-                   strncpy(obj_type, "APPTRAY", sizeof("APPTRAY"));
-                   break;
-                case E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR:
-                   strncpy(obj_type, "INDICATOR", sizeof("INDICATOR"));
-                   break;
-                case E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN:
-                default:
-                   strncpy(obj_type, "UNKNOWN", sizeof("UNKNOWN"));
-                   break;
-               }
-          }
-
-        switch (log->t)
-          {
-           case E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_DOWN:
-              fprintf(fs,
-                      " %2d   %23s   w:0x%08x (%4d ,%4d )  btn:%d\n",
-                      i,
-                      "ECORE_SINGLE_MOUSE_DOWN",
-                      log->d.ec_sm.win,
-                      log->d.ec_sm.x,
-                      log->d.ec_sm.y,
-                      log->d.ec_sm.btn);
-              break;
-           case E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_UP:
-              fprintf(fs,
-                      " %2d   %23s   w:0x%08x (%4d ,%4d )  btn:%d\n",
-                      i,
-                      "ECORE_SINGLE_MOUSE_UP",
-                      log->d.ec_sm.win,
-                      log->d.ec_sm.x,
-                      log->d.ec_sm.y,
-                      log->d.ec_sm.btn);
-              break;
-           case E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_DOWN:
-              fprintf(fs,
-                      " %2d   %23s   w:0x%08x (%5.1f,%5.1f)  btn:%d | dev:%d\n",
-                      i,
-                      "ECORE_MULTI_MOUSE_DOWN",
-                      log->d.ec_mm.win,
-                      log->d.ec_mm.x,
-                      log->d.ec_mm.y,
-                      log->d.ec_mm.btn,
-                      log->d.ec_mm.dev);
-              break;
-           case E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_UP:
-              fprintf(fs,
-                      " %2d   %23s   w:0x%08x (%5.1f,%5.1f)  btn:%d | dev:%d\n",
-                      i,
-                      "ECORE_MULTI_MOUSE_UP",
-                      log->d.ec_mm.win,
-                      log->d.ec_mm.x,
-                      log->d.ec_mm.y,
-                      log->d.ec_mm.btn,
-                      log->d.ec_mm.dev);
-              break;
-           case E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_DOWN:
-              fprintf(fs,
-                      " %2d   %23s   obj:%p (%4d ,%4d )  btn:%d | %10s  eo_geo(%d,%d,%d,%d)\n",
-                      i,
-                      "EVAS_OBJECT_MOUSE_DOWN",
-                      log->d.eo_m.obj,
-                      log->d.eo_m.x,
-                      log->d.eo_m.y,
-                      log->d.eo_m.btn,
-                      obj_type,
-                      log->d.eo_m.ox,
-                      log->d.eo_m.oy,
-                      log->d.eo_m.ow,
-                      log->d.eo_m.oh);
-              break;
-           case E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_UP:
-              fprintf(fs,
-                      " %2d   %23s   obj:%p (%4d ,%4d )  btn:%d | %10s  eo_geo(%d,%d,%d,%d)\n",
-                      i,
-                      "EVAS_OBJECT_MOUSE_UP",
-                      log->d.eo_m.obj,
-                      log->d.eo_m.x,
-                      log->d.eo_m.y,
-                      log->d.eo_m.btn,
-                      obj_type,
-                      log->d.eo_m.ox,
-                      log->d.eo_m.oy,
-                      log->d.eo_m.ow,
-                      log->d.eo_m.oh);
-              break;
-           case E_MOVE_EVENT_LOG_UNKOWN:
-           default:
-              fprintf(fs,
-                      " %2d   %23s\n",
-                      i,
-                      "EVENT_LOG_UNKOWN");
-              break;
-          }
-        i++;
-     }
-   fprintf(fs, "E----------------------------------------------------------------------------------------\n");
-}
-
-static void
 _e_mod_move_debug_control_objects_visible_set(E_Move        *m,
                                               E_Move_Canvas *canvas,
                                               Eina_Bool      visi)
@@ -860,8 +730,6 @@ e_mod_move_debug_info_dump(Eina_Bool   to_file,
         _e_mod_move_debug_dim_objects_info_dump(m, canvas, fs);
      }
 
-   _e_mod_move_debug_event_logs_dump(m, fs);
-
    if (to_file)
      {
         fflush(fs);
index 9dfe2d4..a0472e5 100644 (file)
 
 extern EINTERN int logtype;
 
-# include <stdarg.h>
-# define L(t, f, x...) { \
-   if (logtype & t)      \
-     printf(f, ##x);     \
+#include <stdarg.h>
+#define LOG_TAG "E17_MOVE_MODULE"
+#include <dlog.h>
+
+#define L(t, f, x...) {                          \
+   if (logtype & t)                              \
+     SLOG(LOG_DEBUG, "E17_MOVE_MODULE", f, ##x); \
+}
+#define SL(t, f, x...) {   \
+   if (logtype & t)        \
+     SECURE_SLOGD(f, ##x); \
 }
 #else
 # define L(...) { ; }
+# define SL(...) { ; }
 #endif /* MOVE_LOG_BUILD_ENABLE */
 
-typedef enum _E_Move_Event_Log_Type
-{
-   E_MOVE_EVENT_LOG_UNKOWN = 0,
-   E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_DOWN,
-   E_MOVE_EVENT_LOG_ECORE_SINGLE_MOUSE_UP,
-   E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_DOWN,
-   E_MOVE_EVENT_LOG_ECORE_MULTI_MOUSE_UP,
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_DOWN,
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_UP,
-} E_Move_Event_Log_Type;
-
-typedef enum _E_Move_Event_Log_Evas_Object_Type
-{
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN = 0,
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_QUICKPANEL,
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR,
-   E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_APPTRAY
-} E_Move_Event_Log_Evas_Object_Type;
-
-typedef struct _E_Move_Event_Log
-{
-   E_Move_Event_Log_Type t; // type
-
-   union {
-     struct {
-        int x; // single touch x geomety position
-        int y; // single touch y geomety position
-        int btn; // Mouse button number
-        Ecore_X_Window win;
-     } ec_sm; // ecore sigle mouse data
-
-     struct {
-        double x; // multi touch x geomety position type is double
-        double y; // multi touch y geomety position type is double
-        int btn; // Mouse button number
-        int dev; // 0: normal mouse  1+: other mouse, multi touch
-        Ecore_X_Window win;
-     } ec_mm; // ecore multi mouse data
-
-     struct {
-        int x; // evas object mouse down x geomety position
-        int y;  // evas object mouse down y geomety position
-        int btn; // Mouse button number
-        int ox; // evas object geometry x
-        int oy; // evas object geometry y
-        int ow; // evas object geometry w
-        int oh; // evas object geometry h
-        Evas_Object *obj;
-        E_Move_Event_Log_Evas_Object_Type t; // evas object type
-     } eo_m; // evas object mouse data
-   } d; // data
-} E_Move_Event_Log;
-
 EINTERN Eina_Bool e_mod_move_debug_info_dump(Eina_Bool to_file, const char *name);
 EINTERN Eina_Bool e_mod_move_debug_prop_handle(Ecore_X_Event_Window_Property *ev);
 
index c26d1f8..86b56fd 100644 (file)
@@ -3,25 +3,9 @@
 #include "e_mod_move.h"
 
 /* local subsystem functions */
-static void _e_mod_move_cb_comp_object_restack(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _e_mod_move_cb_comp_object_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
 /* local subsystem functions */
-static void
-_e_mod_move_cb_comp_object_restack(void        *data,
-                                   Evas        *e,
-                                   Evas_Object *obj,
-                                   void        *event_info)
-{
-   E_Move_Dim_Object *mdo = (E_Move_Dim_Object *)data;
-   E_CHECK(mdo);
-
-   E_CHECK(mdo->obj);
-   E_CHECK(obj);
-
-   evas_object_stack_below(mdo->obj, obj); // dim object below comp_obj.
-}
-
 static void _e_mod_move_cb_comp_object_del(void        *data,
                                            Evas        *e,
                                            Evas_Object *obj,
@@ -45,12 +29,16 @@ e_mod_move_dim_obj_add(E_Move_Border *mb,
    Evas *evas = NULL;
    Evas_Object *comp_obj = NULL;
    E_Manager_Comp_Source *comp_src = NULL;
+   Evas_Object *ly = NULL;
 
    E_CHECK_RETURN(mb, 0);
    m = mb->m;
    E_CHECK_RETURN(m, 0);
    E_CHECK_RETURN(canvas, 0);
 
+   ly = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK_RETURN(ly, 0);
+
    evas = canvas->evas;
    E_CHECK_RETURN(evas, 0);
 
@@ -69,7 +57,8 @@ e_mod_move_dim_obj_add(E_Move_Border *mb,
         evas_object_move(mdo->obj, canvas->x, canvas->y);
         evas_object_resize(mdo->obj, canvas->w, canvas->h);
 
-        evas_object_stack_below(mdo->obj, comp_obj);
+        e_layout_pack(ly, mdo->obj);
+        e_layout_child_lower(mdo->obj);
 
         mdo->comp_obj = comp_obj;
         mdo->canvas = canvas;
@@ -77,23 +66,20 @@ e_mod_move_dim_obj_add(E_Move_Border *mb,
 
         evas_object_data_set(mdo->obj, "move_dim_obj", mdo->obj);
 
-        evas_object_event_callback_add(comp_obj, EVAS_CALLBACK_RESTACK,
-                                       _e_mod_move_cb_comp_object_restack,
-                                       mdo);
         if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
           {
-             fprintf(stderr,
-                     "[MOVE] ERROR: Callback registering failed! Aborting. %s():%d\n",
-                     __func__, __LINE__ );
+             SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+                  "[MOVE] ERROR: Callback registering failed! Aborting. %s():%d\n",
+                  __func__, __LINE__ );
           }
 
         evas_object_event_callback_add(comp_obj, EVAS_CALLBACK_DEL,
                                        _e_mod_move_cb_comp_object_del, mdo);
         if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
           {
-             fprintf(stderr,
-                     "[MOVE] ERROR: Callback registering failed! Aborting. %s():%d\n",
-                     __func__, __LINE__ );
+             SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+                  "[MOVE] ERROR: Callback registering failed! Aborting. %s():%d\n",
+                  __func__, __LINE__ );
           }
 
         return mdo;
@@ -108,20 +94,26 @@ error_cleanup:
 EINTERN void
 e_mod_move_dim_obj_del(E_Move_Dim_Object *mdo)
 {
+   E_Move *m = e_mod_move_util_get();
+   Evas_Object *ly = NULL;
+   E_CHECK(m);
    E_CHECK(mdo);
 
+   ly = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK(ly);
+
    if (mdo->comp_obj)
      {
         evas_object_event_callback_del(mdo->comp_obj,
-                                       EVAS_CALLBACK_RESTACK,
-                                       _e_mod_move_cb_comp_object_restack);
-        evas_object_event_callback_del(mdo->comp_obj,
                                        EVAS_CALLBACK_DEL,
                                        _e_mod_move_cb_comp_object_del);
      }
 
    if (mdo->obj)
-     evas_object_del(mdo->obj);
+     {
+        e_layout_unpack(mdo->obj);
+        evas_object_del(mdo->obj);
+     }
    memset(mdo, 0, sizeof(E_Move_Dim_Object));
    E_FREE(mdo);
 }
index 68f62b7..608fdeb 100644 (file)
@@ -139,75 +139,50 @@ _ev_cb_mouse_down(void            *data,
                   Evas_Object *obj __UNUSED__,
                   void            *event_info)
 {
-   E_Move *m;
    int ex, ey, ew, eh;
    Evas_Event_Mouse_Down *dn_info = NULL;
    E_Move_Event *ev;
    E_Move_Event_Motion_Info *motion;
+   E_Move_Border *mb = NULL;
+   char obj_name[255];
 
    ev = (E_Move_Event *)data;
    if (!event_info || !ev) return;
 
-   m = e_mod_move_util_get();
-   if ((m) && (m->ev_log))
-     {
-        E_Move_Event_Log *log = NULL;
-        E_Move_Border *mb = NULL;
-        if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
-          mb = (E_Move_Border *)(ev->fn[E_MOVE_EVENT_TYPE_MOTION_START].data);
+   if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
+     mb = (E_Move_Border *)(ev->fn[E_MOVE_EVENT_TYPE_MOTION_START].data);
 
-        dn_info = (Evas_Event_Mouse_Down*)event_info;
-        ex = 0; ey = 0; ew = 0; eh = 0;
-        evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
-        log = E_NEW(E_Move_Event_Log, 1);
-        if (log)
+   memset(obj_name, '\0', sizeof(obj_name));
+   if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
+     {
+        if (mb)
           {
-             log->t = E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_DOWN;
-             log->d.eo_m.x = dn_info->canvas.x;
-             log->d.eo_m.y = dn_info->canvas.y;
-             log->d.eo_m.btn = dn_info->button;
-             log->d.eo_m.ox = ex;
-             log->d.eo_m.oy = ey;
-             log->d.eo_m.ow = ew;
-             log->d.eo_m.oh = eh;
-             log->d.eo_m.obj = obj;
-
-             if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
-               {
-                  if (mb)
-                    {
-                       if (TYPE_APPTRAY_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_APPTRAY;
-                       else if (TYPE_INDICATOR_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR;
-                       else if (TYPE_QUICKPANEL_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_QUICKPANEL;
-                       else
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-                    }
-                  else
-                    log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-               }
-             else if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_WIDGET_INDICATOR)
-               {
-                  log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR;
-               }
+             if (TYPE_APPTRAY_CHECK(mb))
+                strncpy(obj_name, "APPTRAY", strlen("APPTRAY"));
+             else if (TYPE_INDICATOR_CHECK(mb))
+                strncpy(obj_name, "INDICATOR", strlen("INDICATOR"));
+             else if (TYPE_QUICKPANEL_CHECK(mb))
+                strncpy(obj_name, "QUICKPANEL", strlen("QUICKPANEL"));
              else
-               {
-                  log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-               }
-             // list check and append
-             if (eina_list_count(m->ev_logs) >= m->ev_log_cnt)
-               {
-                  // if log list is full, delete first log
-                  E_Move_Event_Log *first_log = (E_Move_Event_Log*)eina_list_nth(m->ev_logs, 0);
-                  m->ev_logs = eina_list_remove(m->ev_logs, first_log);
-                  memset(first_log, 0, sizeof(E_Move_Event_Log));
-                  E_FREE(first_log);
-               }
-             m->ev_logs = eina_list_append(m->ev_logs, log);
+                strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
           }
+        else
+           strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
      }
+   else if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_WIDGET_INDICATOR)
+      strncpy(obj_name, "INDICATOR", strlen("INDICATOR"));
+   else
+      strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
+
+   dn_info = (Evas_Event_Mouse_Down*)event_info;
+   ex = 0; ey = 0; ew = 0; eh = 0;
+   evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
+
+   SECURE_SLOGD(
+      "%23s   obj:%p (%4d ,%4d )  btn:%d | %10s  eo_geo(%d,%d,%d,%d)\n",
+      "EVAS_OBJECT_MOUSE_DOWN", obj, dn_info->canvas.x,
+      dn_info->canvas.y, dn_info->button,
+      obj_name, ex, ey, ew, eh);
 
 #if MOVE_LOG_BUILD_ENABLE
    if (logtype & LT_EVENT_OBJ)
@@ -215,11 +190,11 @@ _ev_cb_mouse_down(void            *data,
         dn_info = (Evas_Event_Mouse_Down*)event_info;
         ex = 0; ey = 0; ew = 0; eh = 0;
         evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
-        L(LT_EVENT_OBJ,
-          "[MOVE] ev:%15.15s Evas_Object: %p eo_geo (x: %d, y: %d, w: %d, h: %d), \
-          ev_output_pos (%d,%d) ev_canvas_pos (%d,%d) %s()\n",
-          "EVAS_OBJ", obj, ex, ey, ew, eh, dn_info->output.x, dn_info->output.y,
-          dn_info->canvas.x, dn_info->canvas.y, __func__);
+        SECURE_SLOGD(
+           "[MOVE] ev:%15.15s Evas_Object: %p eo_geo (x: %d, y: %d, w: %d, h: %d),\
+           ev_output_pos (%d,%d) ev_canvas_pos (%d,%d) %s()\n",
+           "EVAS_OBJ", obj, ex, ey, ew, eh, dn_info->output.x, dn_info->output.y,
+           dn_info->canvas.x, dn_info->canvas.y, __func__);
      }
 #endif
 
@@ -316,7 +291,7 @@ _ev_cb_mouse_move(void            *data,
         ex = 0; ey = 0; ew = 0; eh = 0;
         evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
 
-        L(LT_EVENT_OBJ,
+        SECURE_SLOGD(
           "[MOVE] ev:%15.15s Evas_Object: %p eo_geo (x: %d, y: %d, w: %d, h: %d), \
           ev_output_pos (%d,%d) ev_canvas_pos (%d,%d) %s()\n",
           "EVAS_OBJ", obj, ex, ey, ew, eh,
@@ -407,76 +382,50 @@ _ev_cb_mouse_up(void            *data,
                 Evas_Object *obj __UNUSED__,
                 void            *event_info)
 {
-   E_Move *m;
    int ex, ey, ew, eh;
    Evas_Event_Mouse_Up *up_info = NULL;
    E_Move_Event *ev;
    E_Move_Event_Motion_Info *motion = NULL;
+   E_Move_Border *mb = NULL;
+   char obj_name[255];
 
    ev = (E_Move_Event *)data;
    if (!event_info || !ev) return;
 
-   m = e_mod_move_util_get();
-   if ((m) && (m->ev_log))
-     {
-        E_Move_Event_Log *log = NULL;
-
-        E_Move_Border *mb = NULL;
-        if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
-          mb = (E_Move_Border *)(ev->fn[E_MOVE_EVENT_TYPE_MOTION_END].data);
+   if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
+     mb = (E_Move_Border *)(ev->fn[E_MOVE_EVENT_TYPE_MOTION_END].data);
 
-        up_info = (Evas_Event_Mouse_Up*)event_info;
-        ex = 0; ey = 0; ew = 0; eh = 0;
-        evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
-        log = E_NEW(E_Move_Event_Log, 1);
-        if (log)
+   memset(obj_name, '\0', sizeof(obj_name));
+   if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
+     {
+        if (mb)
           {
-             log->t = E_MOVE_EVENT_LOG_EVAS_OBJECT_MOUSE_UP;
-             log->d.eo_m.x = up_info->canvas.x;
-             log->d.eo_m.y = up_info->canvas.y;
-             log->d.eo_m.btn = up_info->button;
-             log->d.eo_m.ox = ex;
-             log->d.eo_m.oy = ey;
-             log->d.eo_m.ow = ew;
-             log->d.eo_m.oh = eh;
-             log->d.eo_m.obj = obj;
-
-             if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_BORDER)
-               {
-                  if (mb)
-                    {
-                       if (TYPE_APPTRAY_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_APPTRAY;
-                       else if (TYPE_INDICATOR_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR;
-                       else if (TYPE_QUICKPANEL_CHECK(mb))
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_QUICKPANEL;
-                       else
-                         log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-                    }
-                  else
-                    log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-               }
-             else if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_WIDGET_INDICATOR)
-               {
-                  log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_INDICATOR;
-               }
+             if (TYPE_APPTRAY_CHECK(mb))
+               strncpy(obj_name, "APPTRAY", strlen("APPTRAY"));
+             else if (TYPE_INDICATOR_CHECK(mb))
+               strncpy(obj_name, "INDICATOR", strlen("INDICATOR"));
+             else if (TYPE_QUICKPANEL_CHECK(mb))
+               strncpy(obj_name, "QUICKPANEL", strlen("QUICKPANEL"));
              else
-               {
-                  log->d.eo_m.t = E_MOVE_EVENT_LOG_EVAS_OBJECT_TYPE_UNKNOWN;
-               }
-             // list check and append
-             if (eina_list_count(m->ev_logs) >= m->ev_log_cnt)
-               {
-                  // if log list is full, delete first log
-                  E_Move_Event_Log *first_log = (E_Move_Event_Log*)eina_list_nth(m->ev_logs, 0);
-                  m->ev_logs = eina_list_remove(m->ev_logs, first_log);
-                  memset(first_log, 0, sizeof(E_Move_Event_Log));
-                  E_FREE(first_log);
-               }
-             m->ev_logs = eina_list_append(m->ev_logs, log);
+               strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
           }
+        else
+          strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
      }
+   else if (ev->data_type == E_MOVE_EVENT_DATA_TYPE_WIDGET_INDICATOR)
+     strncpy(obj_name, "INDICATOR", strlen("INDICATOR"));
+   else
+     strncpy(obj_name, "UNKNOWN", strlen("UNKNOWN"));
+
+   up_info = (Evas_Event_Mouse_Up*)event_info;
+   ex = 0; ey = 0; ew = 0; eh = 0;
+   evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
+
+   SECURE_SLOGD(
+      "%23s   obj:%p (%4d ,%4d )  btn:%d | %10s  eo_geo(%d,%d,%d,%d)\n",
+      "EVAS_OBJECT_MOUSE_UP", obj, up_info->canvas.x,
+      up_info->canvas.y, up_info->button,
+      obj_name, ex, ey, ew, eh);
 
 #if MOVE_LOG_BUILD_ENABLE
    if (logtype & LT_EVENT_OBJ)
@@ -485,7 +434,7 @@ _ev_cb_mouse_up(void            *data,
         ex = 0; ey = 0; ew = 0; eh = 0;
         evas_object_geometry_get(obj, &ex, &ey, &ew, &eh);
 
-        L(LT_EVENT_OBJ,
+        SECURE_SLOGD(
           "[MOVE] ev:%15.15s Evas_Object: %p eo_geo (x: %d, y: %d, w: %d, h: %d), \
           ev_output_pos (%d,%d) ev_canvas_pos (%d,%d) %s()\n",
           "EVAS_OBJ", obj, ex, ey, ew, eh, up_info->output.x, up_info->output.y,
@@ -685,10 +634,10 @@ e_mod_move_event_new(Ecore_X_Window win,
      (obj, EVAS_CALLBACK_MOUSE_DOWN, _ev_cb_mouse_down, ev);
    if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
      {
-        fprintf(stderr,
-                "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
-                "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_DOWN\n",
-                __func__, __LINE__, win, obj);
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+             "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
+             "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_DOWN\n",
+             __func__, __LINE__, win, obj);
         memset(ev, 0, sizeof(E_Move_Event));
         E_FREE(ev);
         ev = NULL;
@@ -701,10 +650,10 @@ e_mod_move_event_new(Ecore_X_Window win,
      {
         evas_object_event_callback_del
           (obj, EVAS_CALLBACK_MOUSE_DOWN, _ev_cb_mouse_down);
-        fprintf(stderr,
-                "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
-                "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_MOVE\n",
-                __func__, __LINE__, win, obj);
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+             "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
+             "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_MOVE\n",
+             __func__, __LINE__, win, obj);
         memset(ev, 0, sizeof(E_Move_Event));
         E_FREE(ev);
         ev = NULL;
@@ -719,10 +668,10 @@ e_mod_move_event_new(Ecore_X_Window win,
           (obj, EVAS_CALLBACK_MOUSE_DOWN, _ev_cb_mouse_down);
         evas_object_event_callback_del
           (obj, EVAS_CALLBACK_MOUSE_MOVE, _ev_cb_mouse_move);
-        fprintf(stderr,
-                "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
-                "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_UP\n",
-                __func__, __LINE__, win, obj);
+        SLOG(LOG_DEBUG, "E17_MOVE_MODULE",
+             "[E17-MOVE-ERR] %20.20s(%04d) Callback registering failed! "
+             "w:0x%07x obj:%p EVAS_CALLBACK_MOUSE_UP\n",
+             __func__, __LINE__, win, obj);
         memset(ev, 0, sizeof(E_Move_Event));
         E_FREE(ev);
         ev = NULL;
index c4fc8e7..7f691b4 100644 (file)
@@ -111,10 +111,10 @@ _e_mod_move_indicator_cb_motion_start(void *data,
 
    if (!m || !mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x INDI_MOTION_START (%4d,%4d)\n",
-     "EVAS_OBJ", mb->bd->win,
-     info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x INDI_MOTION_START (%4d,%4d)\n",
+      "EVAS_OBJ", mb->bd->win,
+      info->coord.x, info->coord.y);
 
    E_CHECK_RETURN(e_mod_move_indicator_scrollable_check(), EINA_FALSE);
 
@@ -232,10 +232,10 @@ _e_mod_move_indicator_cb_motion_move(void *data,
 
    if (!m || !mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x INDI_MOTION_MOVE a:%d (%4d,%4d)\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle,
-     info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x INDI_MOTION_MOVE a:%d (%4d,%4d)\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle,
+      info->coord.x, info->coord.y);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -411,10 +411,10 @@ _e_mod_move_indicator_cb_motion_end(void *data,
 
    if (!m || !mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -1035,9 +1035,9 @@ _e_mod_move_indicator_home_region_release_check(E_Move_Border *mb, /* indicator
          if (pos.x > region_check) ret = EINA_TRUE;
          break;
       default :
-         L(LT_EVENT_OBJ,
-           "[MOVE] ev:%15.15s , invalid angle:%d, (%d,%d)  %s()\n",
-           "EVAS_OBJ", angle, pos.x, pos.y,
+         SL(LT_EVENT_OBJ,
+            "[MOVE] ev:%15.15s , invalid angle:%d, (%d,%d)  %s()\n",
+            "EVAS_OBJ", angle, pos.x, pos.y,
             __func__)
          break;
      }
index a775ab1..c3e7c7e 100644 (file)
@@ -23,6 +23,7 @@ static Eina_Bool      _e_mod_move_indicator_widget_target_window_find_by_pointer
 static Ecore_X_Window _e_mod_move_indicator_widget_event_win_find(void *event_info);
 static Eina_Bool      _e_mod_move_indicator_widget_target_window_policy_check(E_Move_Border *mb);
 static Eina_Bool      _e_mod_move_indicator_widget_event_send_policy_check(E_Move_Indicator_Widget *indi_widget, Evas_Point pos);
+static void           _e_mod_move_indicator_widget_active_indicator_win_find_and_set(void);
 
 /* local subsystem functions */
 static Eina_Bool
@@ -340,9 +341,9 @@ _e_mod_move_indicator_widget_home_region_release_check(E_Move_Indicator_Widget *
          if (pos.x > region_check) ret = EINA_TRUE;
          break;
       default :
-         L(LT_EVENT_OBJ,
-           "[MOVE] ev:%15.15s , invalid angle:%d, (%d,%d)  %s()\n",
-           "EVAS_OBJ", angle, pos.x, pos.y,
+         SL(LT_EVENT_OBJ,
+            "[MOVE] ev:%15.15s , invalid angle:%d, (%d,%d)  %s()\n",
+            "EVAS_OBJ", angle, pos.x, pos.y,
             __func__)
          break;
      }
@@ -400,7 +401,7 @@ _e_mod_move_indicator_widget_cb_motion_start(void *data,
    if (clicked)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
+   SL(LT_EVENT_OBJ,
      "[MOVE] ev:%15.15s w:0x%08x INDI_WIDGET_MOTION_START (%4d,%4d)\n",
      "EVAS_OBJ", mb->bd->win,
      info->coord.x, info->coord.y);
@@ -519,10 +520,10 @@ _e_mod_move_indicator_widget_cb_motion_move(void *data,
 
    if (!m || !mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x INDI_WIDGET_MOTION_MOVE a:%d (%4d,%4d)\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle,
-     info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x INDI_WIDGET_MOTION_MOVE a:%d (%4d,%4d)\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle,
+      info->coord.x, info->coord.y);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -717,10 +718,10 @@ _e_mod_move_indicator_widget_cb_motion_end(void *data,
    if (mouse_up_event->button != 1)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -1146,14 +1147,11 @@ static Ecore_X_Window
 _e_mod_move_indicator_widget_event_win_find(void *event_info)
 {
    E_Move_Event_Motion_Info *info = NULL;
-   E_Border                 *find_bd = NULL;
    Ecore_X_Window            win = 0, res_win = 0;
    info  = (E_Move_Event_Motion_Info *)event_info;
 
    E_CHECK_RETURN(info, 0);
 
-   find_bd = e_mod_move_util_border_find_by_pointer(info->coord.x, info->coord.y);
-
    if (_e_mod_move_indicator_widget_target_window_find_by_pointer(&win,
                                                                   info->coord.x,
                                                                   info->coord.y))
@@ -1161,9 +1159,9 @@ _e_mod_move_indicator_widget_event_win_find(void *event_info)
          res_win = win;
      }
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s INDICATOR_WIDGET_EVENT_WIN_FIND w:0x%08x (%4d,%4d)\n",
-     "EVAS_OBJ", res_win, info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s INDICATOR_WIDGET_EVENT_WIN_FIND w:0x%08x (%4d,%4d)\n",
+      "EVAS_OBJ", res_win, info->coord.x, info->coord.y);
 
    return res_win;
 }
@@ -1211,6 +1209,32 @@ _e_mod_move_indicator_widget_event_send_policy_check(E_Move_Indicator_Widget *in
    return ret;
 }
 
+/* find active indicator window window and set property */
+static void
+_e_mod_move_indicator_widget_active_indicator_win_find_and_set(void)
+{
+   E_Move                  *m = NULL;
+   Ecore_X_Window           target_win;
+   E_Move_Border           *target_mb = NULL;
+
+   m = e_mod_move_util_get();
+   E_CHECK(m);
+
+   if (e_mod_move_indicator_widget_target_window_find(&target_win))
+     {
+        target_mb = e_mod_move_border_client_find(target_win);
+        E_CHECK(target_mb);
+        if (TYPE_NOTIFICATION_CHECK(target_mb)
+            && (target_mb->argb)
+            && (target_mb->indicator_state == E_MOVE_INDICATOR_STATE_NONE))
+          {
+             ;
+          }
+        else
+           e_mod_move_util_prop_active_indicator_win_set(target_win, m);
+     }
+}
+
 /* externally accessible functions */
 
 /* set current indicator widget */
@@ -1293,7 +1317,12 @@ e_mod_move_indicator_widget_apply(void)
 
    m = e_mod_move_util_get();
    E_CHECK(m);
-   if (m->screen_reader_state) return;
+   if (m->screen_reader_state)
+     {
+        _e_mod_move_indicator_widget_active_indicator_win_find_and_set();
+        return;
+     }
+   if (m->setup_wizard_state) return;
 
    if (e_mod_move_indicator_widget_target_window_find(&target_win))
      {
@@ -1310,9 +1339,10 @@ e_mod_move_indicator_widget_apply(void)
                   // then del previous indicator_widget and add new indicator widget.
                   e_mod_move_indicator_widget_del(indi_widget);
                   e_mod_move_indicator_widget_set(e_mod_move_indicator_widget_add(target_win));
-                  if (TYPE_NOTIFICATION_CHECK(target_mb)
-                      && (target_mb->argb)
-                      && (target_mb->indicator_state == E_MOVE_INDICATOR_STATE_NONE))
+                  if ((target_mb) &&
+                      (TYPE_NOTIFICATION_CHECK(target_mb)) &&
+                      (target_mb->argb) &&
+                      (target_mb->indicator_state == E_MOVE_INDICATOR_STATE_NONE))
                     {
                       ;
                     }
@@ -1406,7 +1436,7 @@ e_mod_move_indicator_widget_add(Ecore_X_Window win)
           }
         e_mod_move_widget_objs_move(indi_widget->objs, x, y);
         e_mod_move_widget_objs_resize(indi_widget->objs, w, h);
-        e_mod_move_widget_objs_layer_set(indi_widget->objs, EVAS_LAYER_MAX);
+        e_mod_move_widget_objs_layer_set(indi_widget->objs, EVAS_LAYER_MAX-2);
         e_mod_move_widget_objs_color_set(indi_widget->objs, 0, 0, 0, 0);
         e_mod_move_widget_objs_show(indi_widget->objs);
         e_mod_move_widget_objs_raise(indi_widget->objs);
index 7bb5951..30ade60 100644 (file)
@@ -114,10 +114,10 @@ _e_mod_move_mini_apptray_cb_motion_move(void *data,
    info  = (E_Move_Event_Motion_Info *)event_info;
    if (!mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -234,10 +234,10 @@ _e_mod_move_mini_apptray_cb_motion_end(void *data,
    if (mouse_up_event->button != 1)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -614,15 +614,25 @@ EINTERN Eina_Bool
 e_mod_move_mini_apptray_objs_add(E_Move_Border *mb)
 {
    Eina_Bool mirror = EINA_TRUE;
+   Evas_Object *ly = NULL;
    E_CHECK_RETURN(mb, EINA_FALSE);
    E_CHECK_RETURN(TYPE_MINI_APPTRAY_CHECK(mb), EINA_FALSE);
 
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK_RETURN(ly, EINA_FALSE);
+
    if (!(mb->objs))
      {
+        // Composite mode set true
+        e_mod_move_util_compositor_composite_mode_set(mb->m, EINA_TRUE);
         mb->objs = e_mod_move_bd_move_objs_add(mb, mirror);
         e_mod_move_bd_move_objs_move(mb, mb->x, mb->y);
         e_mod_move_bd_move_objs_resize(mb, mb->w, mb->h);
         e_mod_move_bd_move_objs_show(mb);
+
+        if (!evas_object_visible_get(ly))
+          evas_object_show(ly);
+
         if (mb->objs) e_mod_move_util_rotation_lock(mb->m);
      }
    return EINA_TRUE;
@@ -651,10 +661,17 @@ e_mod_move_mini_apptray_objs_add_with_pos(E_Move_Border *mb,
 EINTERN Eina_Bool
 e_mod_move_mini_apptray_objs_del(E_Move_Border *mb)
 {
+   Evas_Object *ly = NULL;
    E_CHECK_RETURN(mb, EINA_FALSE);
    E_CHECK_RETURN(TYPE_MINI_APPTRAY_CHECK(mb), EINA_FALSE);
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK_RETURN(ly, EINA_FALSE);
+   if (evas_object_visible_get(ly))
+     evas_object_hide(ly);
    e_mod_move_bd_move_objs_del(mb, mb->objs);
    e_mod_move_util_rotation_unlock(mb->m);
+   // Composite mode set False
+   e_mod_move_util_compositor_composite_mode_set(mb->m, EINA_FALSE);
    mb->objs = NULL;
    return EINA_TRUE;
 }
@@ -846,6 +863,9 @@ e_mod_move_mini_apptray_e_border_move(E_Move_Border *mb,
         e_border_focus_set(mb->bd, 0, 0);
      }
 
+   ELBF(ELBT_MOVE, 0, mb->bd->win,
+        "MINI APP_TRAY MOVE w:0x%08x c:0x%08x [%d,%d]",
+        mb->bd->win, mb->bd->client.win, x, y);
    e_border_move(mb->bd, x, y);
 
    return EINA_TRUE;
@@ -887,8 +907,6 @@ e_mod_move_mini_apptray_dim_show(E_Move_Border *mb)
      {
         mini_apptray_data = E_NEW(E_Move_Mini_Apptray_Data, 1);
         E_CHECK_RETURN(mini_apptray_data, NULL);
-        // Composite mode set true
-        e_mod_move_util_compositor_composite_mode_set(mb->m, EINA_TRUE);
 
         mini_apptray_data->x = mb->x;
         mini_apptray_data->y = mb->y;
@@ -901,9 +919,6 @@ e_mod_move_mini_apptray_dim_show(E_Move_Border *mb)
      {
         if (!(mini_apptray_data->dim_objs))
           {
-             // Composite mode set true
-             e_mod_move_util_compositor_composite_mode_set(mb->m, EINA_TRUE);
-
              mini_apptray_data->dim_objs = e_mod_move_bd_move_dim_objs_add(mb);
           }
         if (mini_apptray_data->dim_objs)
@@ -937,9 +952,6 @@ e_mod_move_mini_apptray_dim_hide(E_Move_Border *mb)
    mini_apptray_data->dim_objs = NULL;
    mini_apptray_data->opacity = dim_min;
 
-   // Composite mode set false
-   e_mod_move_util_compositor_composite_mode_set(mb->m, EINA_FALSE);
-
    L(LT_EVENT_OBJ,
      "[MOVE] ev:%15.15s w:0x%08x %s()\n",
      "EVAS_OBJ", ((mb->bd) ? mb->bd->win : NULL), __func__);
index b6804aa..3e6d4c2 100644 (file)
@@ -59,8 +59,9 @@ _e_mod_move_mini_apptray_widget_cb_motion_start_internal_mini_apptray_check(E_Mo
    EINA_INLIST_REVERSE_FOREACH(m->borders, find_mb)
      {
         if (TYPE_INDICATOR_CHECK(find_mb)) continue;
-        if (find_mb->visible
-             && REGION_INTERSECTS_WITH_ZONE(find_mb, mini_apptray_mb->bd->zone))
+        if ((find_mb->visible) &&
+            (mini_apptray_mb->bd) &&
+            (REGION_INTERSECTS_WITH_ZONE(find_mb, mini_apptray_mb->bd->zone)))
           {
               found = EINA_TRUE;
               break;
@@ -195,10 +196,10 @@ _e_mod_move_mini_apptray_widget_cb_motion_start(void *data,
    if (clicked)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x MINI_APPTRAY_WIDGET_MOTION_START (%4d,%4d)\n",
-     "EVAS_OBJ", mb->bd->win,
-     info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x MINI_APPTRAY_WIDGET_MOTION_START (%4d,%4d)\n",
+      "EVAS_OBJ", mb->bd->win,
+      info->coord.x, info->coord.y);
 
    _e_mod_move_mini_apptray_widget_mini_apptray_move_set(mini_apptray_widget, EINA_FALSE);
 
@@ -283,10 +284,10 @@ _e_mod_move_mini_apptray_widget_cb_motion_move(void *data,
 
    if (!m || !mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x MINI_APPTRAY_WIDGET_MOTION_MOVE a:%d (%4d,%4d)\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle,
-     info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x MINI_APPTRAY_WIDGET_MOTION_MOVE a:%d (%4d,%4d)\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle,
+      info->coord.x, info->coord.y);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -395,10 +396,10 @@ _e_mod_move_mini_apptray_widget_cb_motion_end(void *data,
    if (mouse_up_event->button != 1)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    angle = mb->angle;
    zone = mb->bd->zone;
@@ -556,9 +557,9 @@ _e_mod_move_mini_apptray_event_win_find(void *event_info)
    if (find_bd) win = find_bd->client.win;
    else win = 0;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s MINI_APPTRAY_EVENT_WIN_FIND w:0x%08x (%4d,%4d)\n",
-     "EVAS_OBJ", win, info->coord.x, info->coord.y);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s MINI_APPTRAY_EVENT_WIN_FIND w:0x%08x (%4d,%4d)\n",
+      "EVAS_OBJ", win, info->coord.x, info->coord.y);
 
    return win;
 }
@@ -695,7 +696,10 @@ e_mod_move_mini_apptray_widget_apply(void)
    m = e_mod_move_util_get();
    E_CHECK(m);
 
+   E_CHECK(m->apptray_launch_by_flickup);
+
    if (m->screen_reader_state) return;
+   if (m->setup_wizard_state) return;
 
    mini_apptray_mb = e_mod_move_mini_apptray_find();
    if (!mini_apptray_mb)
@@ -801,7 +805,7 @@ e_mod_move_mini_apptray_widget_add(Ecore_X_Window win)
           }
         e_mod_move_widget_objs_move(mini_apptray_widget->objs, x, y);
         e_mod_move_widget_objs_resize(mini_apptray_widget->objs, w, h);
-        e_mod_move_widget_objs_layer_set(mini_apptray_widget->objs, EVAS_LAYER_MAX);
+        e_mod_move_widget_objs_layer_set(mini_apptray_widget->objs, EVAS_LAYER_MAX-2);
         e_mod_move_widget_objs_color_set(mini_apptray_widget->objs, 0, 0, 0, 0);
         e_mod_move_widget_objs_show(mini_apptray_widget->objs);
         e_mod_move_widget_objs_raise(mini_apptray_widget->objs);
index c2a4225..39bd483 100644 (file)
@@ -16,11 +16,15 @@ e_mod_move_obj_add(E_Move_Border *mb,
    E_Move *m;
    E_Move_Object *mo;
    E_Manager_Comp_Source *comp_src = NULL;
+   Evas_Object *ly = NULL;
 
    E_CHECK_RETURN(mb, 0);
    m = mb->m;
    E_CHECK_RETURN(m, 0);
 
+   ly = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK_RETURN(ly, 0);
+
    mo = E_NEW(E_Move_Object, 1);
    E_CHECK_RETURN(mo, 0);
 
@@ -40,6 +44,8 @@ e_mod_move_obj_add(E_Move_Border *mb,
              mo->mirror = mirror;
              evas_object_data_set(mo->obj,"move_mirror_obj", mo->obj);
              e_mod_move_util_border_hidden_set(mb, EINA_TRUE);
+
+             e_layout_pack(ly, mo->obj);
           }
         else
           {
@@ -65,6 +71,10 @@ error_cleanup:
 EINTERN void
 e_mod_move_obj_del(E_Move_Object *mo)
 {
+   E_Move *m = e_mod_move_util_get();
+   E_CHECK(m);
+   Evas_Object *ly = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK(ly);
    E_CHECK(mo);
 
    if (mo->obj)
@@ -72,6 +82,7 @@ e_mod_move_obj_del(E_Move_Object *mo)
         if (mo->clipper)
           {
              evas_object_clip_unset(mo->obj);
+             e_layout_unpack(mo->clipper);
              evas_object_del(mo->clipper);
           }
 
@@ -79,6 +90,7 @@ e_mod_move_obj_del(E_Move_Object *mo)
           {
              evas_object_event_callback_del(mo->obj, EVAS_CALLBACK_DEL,
                                             _e_mod_move_cb_comp_mirror_object_del);
+             e_layout_unpack(mo->obj);
              evas_object_del(mo->obj);
           }
         else
@@ -170,7 +182,7 @@ e_mod_move_bd_move_objs_move(E_Move_Border *mb,
              zx = mo->zone->x;
              zy = mo->zone->y;
           }
-        evas_object_move(mo->obj, x - zx, y - zy);
+        e_layout_child_move(mo->obj, x - zx, y - zy);
 
         mo->geometry.x = x;
         mo->geometry.y = y;
@@ -189,7 +201,7 @@ e_mod_move_bd_move_objs_resize(E_Move_Border *mb,
      {
         if (!mo) continue;
         if (!mo->obj) continue;
-        evas_object_resize(mo->obj, w, h);
+        e_layout_child_resize(mo->obj, w, h);
 
         mo->geometry.w = w;
         mo->geometry.h = h;
@@ -265,7 +277,7 @@ e_mod_move_bd_move_objs_raise(E_Move_Border *mb)
    EINA_LIST_FOREACH(mb->objs, l, mo)
      {
         if (!mo) continue;
-        evas_object_raise(mo->obj);
+        e_layout_child_raise(mo->obj);
      }
 }
 
@@ -278,7 +290,7 @@ e_mod_move_bd_move_objs_lower(E_Move_Border *mb)
    EINA_LIST_FOREACH(mb->objs, l, mo)
      {
         if (!mo) continue;
-        evas_object_lower(mo->obj);
+        e_layout_child_lower(mo->obj);
      }
 }
 
@@ -295,7 +307,7 @@ e_mod_move_bd_move_objs_stack_above(E_Move_Border *mb,
         EINA_LIST_FOREACH(mb2->objs, ll, mo2)
           {
              if (mo->zone == mo2->zone)
-               evas_object_stack_above(mo->obj, mo2->obj);
+               e_layout_child_raise_above(mo->obj, mo2->obj);
           }
      }
 }
@@ -313,7 +325,7 @@ e_mod_move_bd_move_objs_stack_below(E_Move_Border *mb,
         EINA_LIST_FOREACH(mb2->objs, ll, mo2)
           {
              if (mo->zone == mo2->zone)
-               evas_object_stack_below(mo->obj, mo2->obj);
+               e_layout_child_lower_below(mo->obj, mo2->obj);
           }
      }
 }
@@ -323,9 +335,13 @@ e_mod_move_bd_move_objs_clipper_add(E_Move_Border *mb)
 {
    Eina_List     *l = NULL;
    E_Move_Object *mo = NULL;
+   Evas_Object *ly = NULL;
 
    E_CHECK(mb);
 
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK(ly);
+
    EINA_LIST_FOREACH(mb->objs, l, mo)
      {
         if (!mo) continue;
@@ -337,6 +353,7 @@ e_mod_move_bd_move_objs_clipper_add(E_Move_Border *mb)
         mo->clipper = evas_object_rectangle_add(mo->canvas->evas);
         if (mo->clipper)
           {
+             e_layout_pack(ly, mo->clipper);
              evas_object_color_set(mo->clipper, 255,255,255,255);
              evas_object_data_set(mo->clipper, "move_clipper_obj", mo->clipper);
              evas_object_clip_set(mo->obj, mo->clipper);
@@ -349,9 +366,13 @@ e_mod_move_bd_move_objs_clipper_del(E_Move_Border *mb)
 {
    Eina_List     *l = NULL;
    E_Move_Object *mo = NULL;
+   Evas_Object *ly = NULL;
 
    E_CHECK(mb);
 
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK(ly);
+
    EINA_LIST_FOREACH(mb->objs, l, mo)
      {
         if (!mo) continue;
@@ -359,6 +380,7 @@ e_mod_move_bd_move_objs_clipper_del(E_Move_Border *mb)
         if (!mo->clipper) continue;
 
         evas_object_clip_unset(mo->obj);
+        e_layout_unpack(mo->clipper);
         evas_object_del(mo->clipper);
         mo->clipper = NULL;
      }
@@ -413,7 +435,7 @@ e_mod_move_bd_move_objs_clipper_move(E_Move_Border *mb,
         if (!mo) continue;
         if (!mo->clipper) continue;
 
-        evas_object_move(mo->clipper, x, y);
+        e_layout_child_move(mo->clipper, x, y);
      }
 }
 
@@ -432,7 +454,7 @@ e_mod_move_bd_move_objs_clipper_resize(E_Move_Border *mb,
         if (!mo) continue;
         if (!mo->clipper) continue;
 
-        evas_object_resize(mo->clipper, w, h);
+        e_layout_child_resize(mo->clipper, w, h);
      }
 }
 
@@ -472,8 +494,12 @@ _e_mod_move_cb_comp_object_del(void            *data,
    E_Move_Border *mb = (E_Move_Border *)data;
    E_Move_Object *mo;
    Eina_List *l;
+   Evas_Object *ly = NULL;
    E_CHECK(mb);
 
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK(ly);
+
    L(LT_EVENT_BD,
      "[MOVE] ev:%15.15s w:0x%08x c:0x%08x\n", "COMP_OBJ_DEL",
      mb->bd->win, mb->bd->client.win);
@@ -482,6 +508,7 @@ _e_mod_move_cb_comp_object_del(void            *data,
      {
         if (mo->obj == obj)
           {
+             e_layout_unpack(mo->obj);
              // remove Move_Object pointer from list;
              mb->objs = eina_list_remove(mb->objs, mo);
              // free data
@@ -503,8 +530,12 @@ _e_mod_move_cb_comp_mirror_object_del(void            *data,
    E_Move_Border *mb = (E_Move_Border *)data;
    E_Move_Object *mo;
    Eina_List *l;
+   Evas_Object *ly = NULL;
    E_CHECK(mb);
 
+   ly = e_mod_move_util_comp_layer_get(mb->m, "move");
+   E_CHECK(ly);
+
    L(LT_EVENT_BD,
      "[MOVE] ev:%15.15s w:0x%08x c:0x%08x\n", "COMP_MIRROR_OBJ_DEL",
      mb->bd->win, mb->bd->client.win);
@@ -513,8 +544,14 @@ _e_mod_move_cb_comp_mirror_object_del(void            *data,
      {
         if (mo->obj == obj)
           {
+             e_layout_unpack(mo->obj);
+
              // if clipper exist, then delete clipper
-             if (mo->clipper) evas_object_del(mo->clipper);
+             if (mo->clipper)
+               {
+                  e_layout_unpack(mo->clipper);
+                  evas_object_del(mo->clipper);
+               }
              // remove Move_Object pointer from list;
              mb->objs = eina_list_remove(mb->objs, mo);
              // free data
index 8c404a5..0b56fb6 100644 (file)
@@ -38,6 +38,8 @@ static Eina_Bool          _e_mod_move_quickpanel_objs_check_on_screen(E_Move_Bor
 static Eina_Bool          _e_mod_move_quickpanel_objs_outside_movable_pos_get(E_Move_Border *mb, int *x, int *y);
 static Eina_Bool          _e_mod_move_quickpanel_animation_change_with_angle(E_Move_Border *mb);
 static Eina_Bool          _e_mod_move_quickpanel_fb_move_change_with_angle(E_Move_Border *mb);
+static Eina_Bool          _e_mod_move_quickpanel_comp_layer_obj_move(int x, int y);
+static Eina_Bool          _e_mod_move_quickpanel_comp_layer_obj_move_intern(int x, int y);
 
 /* local subsystem functions */
 static Eina_Bool
@@ -68,8 +70,8 @@ _e_mod_move_quickpanel_cb_motion_start(void *data,
    if (clicked)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x %s()\n", "EVAS_OBJ", mb->bd->win, __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x %s()\n", "EVAS_OBJ", mb->bd->win, __func__);
 
    if (e_mod_move_quickpanel_objs_animation_state_get(mb)) goto error_cleanup;
 
@@ -127,10 +129,10 @@ _e_mod_move_quickpanel_cb_motion_move(void *data,
    info  = (E_Move_Event_Motion_Info *)event_info;
    if (!mb || !info) return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    m = mb->m;
    angle = mb->angle;
@@ -254,10 +256,10 @@ _e_mod_move_quickpanel_cb_motion_end(void *data,
    if (mouse_up_event->button != 1)
      return EINA_FALSE;
 
-   L(LT_EVENT_OBJ,
-     "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
-     "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
-     __func__);
+   SL(LT_EVENT_OBJ,
+      "[MOVE] ev:%15.15s w:0x%08x ,angle:%d, (%d,%d)  %s()\n",
+      "EVAS_OBJ", mb->bd->win, mb->angle, info->coord.x, info->coord.y,
+      __func__);
 
    m = mb->m;
    angle = mb->angle;
@@ -672,13 +674,8 @@ _e_mod_move_quickpanel_objs_animation_frame(void  *data,
               ecore_x_e_illume_quickpanel_state_set(zone->black_win, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
            }
 
-         // if scroll with clipping use case, hold below windows until only animation is working
-         if (m->qp_scroll_with_visible_win &&
-             m->qp_scroll_with_clipping)
-           {
-              _e_mod_move_quickpanel_below_window_objs_del();
-              _e_mod_move_quickpanel_below_window_unset();
-           }
+         // restore comp layer's position
+         _e_mod_move_quickpanel_comp_layer_obj_move_intern(zone->x, zone->y);
 
          memset(anim_data, 0, sizeof(E_Move_Quickpanel_Animation_Data));
          E_FREE(anim_data);
@@ -1511,6 +1508,117 @@ _e_mod_move_quickpanel_fb_move_change_with_angle(E_Move_Border *mb)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_e_mod_move_quickpanel_comp_layer_obj_move(int x,
+                                           int y)
+{
+   E_Move *m;
+   E_Move_Border *qp_mb;
+   E_Zone *zone;
+   int angle;
+   int cx = 0, cy = 0, cw = 0, ch = 0;
+   int mx = 0, my = 0;
+   m = e_mod_move_util_get();
+   E_CHECK_RETURN(m, EINA_FALSE);
+   qp_mb = e_mod_move_quickpanel_find();
+   E_CHECK_RETURN(qp_mb, EINA_FALSE);
+   if (!m->qp_scroll_with_clipping
+        && !e_mod_move_border_contents_rect_get(qp_mb, &cx, &cy ,&cw, &ch))
+     return EINA_FALSE;
+
+   angle = qp_mb->angle;
+   zone = qp_mb->bd->zone;
+
+   switch (angle)
+     {
+      case   0:
+         mx = zone->x;
+         if (m->qp_scroll_with_clipping)
+            my = y + zone->y;
+         else
+            my = y + ch + zone->y;
+         break;
+      case  90:
+         if (m->qp_scroll_with_clipping)
+            mx = x + zone->x;
+         else
+            mx = x + cw + zone->x;
+         my = zone->y;
+         break;
+      case 180:
+         mx = zone->x;
+         if (m->qp_scroll_with_clipping)
+            my = zone->y - (zone->h - y);
+         else
+            my = y - ch + zone->y;
+         break;
+      case 270:
+         if (m->qp_scroll_with_clipping)
+            mx = zone->x - (zone->w - x);
+         else
+            mx = x - cw + zone->x;
+         my = zone->y;
+         break;
+      default :
+         break;
+     }
+
+   _e_mod_move_quickpanel_comp_layer_obj_move_intern(mx, my);
+
+   // if qp_scroll_with_clipping case, make cw / ch data for e_mod_move_util_fb_move()
+   if (m->qp_scroll_with_clipping)
+     {
+        switch (angle)
+          {
+           case 180:
+              ch = zone->h;
+              break;
+           case 270:
+              cw = zone->w;
+              break;
+           default:
+              break;
+          }
+     }
+
+   e_mod_move_util_fb_move(angle, cw, ch, x, y);
+
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_e_mod_move_quickpanel_comp_layer_obj_move_intern(int x,
+                                                  int y)
+{
+   E_Move *m = NULL;
+   Evas_Object *comp_layer = NULL;
+   Evas_Object *effect_layer = NULL;
+
+   m = e_mod_move_util_get();
+   E_CHECK_RETURN(m, EINA_FALSE);
+
+   comp_layer = e_mod_move_util_comp_layer_get(m, "comp");
+   if (comp_layer)
+     {
+         evas_object_move(comp_layer, x, y);
+         L(LT_EVENT_OBJ,
+           "[MOVE] ev:%15.15s comp_layer_obj:0x%x %s()  (%d,%d)\n",
+           "EVAS_OBJ", comp_layer, __func__, x, y);
+     }
+
+
+   effect_layer = e_mod_move_util_comp_layer_get(m, "effect");
+   if (effect_layer)
+     {
+         evas_object_move(effect_layer, x, y);
+         L(LT_EVENT_OBJ,
+           "[MOVE] ev:%15.15s effect_layer_obj:0x%x %s()  (%d,%d)\n",
+           "EVAS_OBJ", effect_layer, __func__, x, y);
+     }
+
+   return EINA_TRUE;
+}
+
 /* externally accessible functions */
 EINTERN void
 e_mod_move_quickpanel_ctl_obj_event_setup(E_Move_Border         *mb,
@@ -1619,11 +1727,15 @@ e_mod_move_quickpanel_objs_add(E_Move_Border *mb)
 {
    E_Move *m = NULL;
    Eina_Bool mirror = EINA_TRUE;
+   Evas_Object *move_layer = NULL;
    E_CHECK_RETURN(mb, EINA_FALSE);
    E_CHECK_RETURN(TYPE_QUICKPANEL_CHECK(mb), EINA_FALSE);
 
    m = mb->m;
 
+   move_layer = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK_RETURN(move_layer, EINA_FALSE);
+
    if (!(mb->objs))
      {
         mb->objs = e_mod_move_bd_move_objs_add(mb, mirror);
@@ -1631,19 +1743,17 @@ e_mod_move_quickpanel_objs_add(E_Move_Border *mb)
         e_mod_move_bd_move_objs_resize(mb, mb->w, mb->h);
         e_mod_move_bd_move_objs_show(mb);
 
+        e_mod_move_util_screen_input_block(m);
+
+        if (!evas_object_visible_get(move_layer))
+          evas_object_show(move_layer);
+
         if (mb->objs) e_mod_move_util_rotation_lock(mb->m);
 
         if (m->qp_scroll_with_clipping)
           {
              e_mod_move_quickpanel_objs_clipper_add(mb);
              _e_mod_move_quickpanel_handle_objs_add(mb);
-
-             // make below window's mirror object for animation
-             if (m->qp_scroll_with_visible_win)
-               {
-                  _e_mod_move_quickpanel_below_window_set();
-                  _e_mod_move_quickpanel_below_window_objs_add();
-               }
           }
      }
    return EINA_TRUE;
@@ -1653,10 +1763,17 @@ EINTERN Eina_Bool
 e_mod_move_quickpanel_objs_del(E_Move_Border *mb)
 {
    E_Move *m = NULL;
+   Evas_Object *move_layer = NULL;
    E_CHECK_RETURN(mb, EINA_FALSE);
    E_CHECK_RETURN(TYPE_QUICKPANEL_CHECK(mb), EINA_FALSE);
    m = mb->m;
 
+   move_layer = e_mod_move_util_comp_layer_get(m, "move");
+   E_CHECK_RETURN(move_layer, EINA_FALSE);
+
+    if (evas_object_visible_get(move_layer))
+      evas_object_hide(move_layer);
+
    if (m->qp_scroll_with_clipping)
      {
         e_mod_move_quickpanel_objs_clipper_del(mb);
@@ -1665,6 +1782,7 @@ e_mod_move_quickpanel_objs_del(E_Move_Border *mb)
 
    e_mod_move_bd_move_objs_del(mb, mb->objs);
    e_mod_move_util_rotation_unlock(mb->m);
+   e_mod_move_util_screen_input_unblock(mb->m);
 
    mb->objs = NULL;
 
@@ -1703,7 +1821,7 @@ e_mod_move_quickpanel_objs_move(E_Move_Border *mb,
         if (m->qp_scroll_with_visible_win)
           {
              if (POINT_INSIDE_ZONE(x, y, zone))
-               _e_mod_move_quickpanel_below_window_objs_move(x, y);
+               _e_mod_move_quickpanel_comp_layer_obj_move(x, y);
           }
      }
    else
@@ -1716,7 +1834,7 @@ e_mod_move_quickpanel_objs_move(E_Move_Border *mb,
              if (e_mod_move_border_contents_rect_get(mb, &cx, &cy ,&cw, &ch))
                {
                   if (E_INTERSECTS(x+cx, y+cy, cw, ch, zone->x, zone->y, zone->w, zone->h))
-                     _e_mod_move_quickpanel_below_window_objs_move(x, y);
+                    _e_mod_move_quickpanel_comp_layer_obj_move(x, y);
                }
           }
      }
@@ -2019,16 +2137,9 @@ e_mod_move_quickpanel_dim_show(E_Move_Border *mb)
           }
      }
 
-   //qp ux
-   if (m->qp_scroll_with_visible_win)
-     {
-        _e_mod_move_quickpanel_below_window_set();
-        _e_mod_move_quickpanel_below_window_objs_add();
-     }
-
    L(LT_EVENT_OBJ,
      "[MOVE] ev:%15.15s w:0x%08x %s()\n",
-     "EVAS_OBJ", mb->bd->win, __func__);
+     "EVAS_OBJ", mb->bd ? mb->bd->win : 0, __func__);
 
    return qp_data->dim_objs;
 }
@@ -2052,13 +2163,6 @@ e_mod_move_quickpanel_dim_hide(E_Move_Border *mb)
    qp_data->opacity = dim_min;
    m = mb->m;
 
-   //qp ux
-   if (m->qp_scroll_with_visible_win)
-     {
-        _e_mod_move_quickpanel_below_window_objs_del();
-        _e_mod_move_quickpanel_below_window_unset();
-     }
-
    L(LT_EVENT_OBJ,
      "[MOVE] ev:%15.15s w:0x%08x %s()\n",
      "EVAS_OBJ", ((mb->bd) ? mb->bd->win : NULL), __func__);
@@ -2169,16 +2273,6 @@ e_mod_move_quickpanel_below_window_reset(void)
 {
    E_Move *m = e_mod_move_util_get();
    E_CHECK_RETURN(m, EINA_FALSE);
-
-   if (m->qp_scroll_with_visible_win)
-     {
-        // remove below window objs & unset
-        _e_mod_move_quickpanel_below_window_objs_del();
-        _e_mod_move_quickpanel_below_window_unset();
-        // add below window set & objs
-        _e_mod_move_quickpanel_below_window_set();
-        _e_mod_move_quickpanel_below_window_objs_add();
-     }
    return EINA_TRUE;
 }
 
@@ -2275,13 +2369,6 @@ e_mod_move_quickpanel_stage_deinit(E_Move_Border *mb)
 
    m = mb->m;
 
-   //qp ux
-   if (m->qp_scroll_with_visible_win)
-     {
-        _e_mod_move_quickpanel_below_window_objs_del();
-        _e_mod_move_quickpanel_below_window_unset();
-     }
-
    // Composite mode set false
    e_mod_move_util_compositor_composite_mode_set(m, EINA_FALSE);
    return EINA_TRUE;
diff --git a/move-tizen/src/e_mod_move_setup_wizard.c b/move-tizen/src/e_mod_move_setup_wizard.c
new file mode 100644 (file)
index 0000000..4044738
--- /dev/null
@@ -0,0 +1,21 @@
+#include "e_mod_move_shared_types.h"
+#include "e_mod_move_debug.h"
+#include "e_mod_move.h"
+
+/* externally accessible functions */
+EINTERN E_Move_Border *
+e_mod_move_setup_wizard_find(void)
+{
+   E_Move *m;
+   E_Move_Border *mb;
+
+   m = e_mod_move_util_get();
+   E_CHECK_RETURN(m, 0);
+
+   EINA_INLIST_REVERSE_FOREACH(m->borders, mb)
+     {
+        if (TYPE_SETUP_WIZARD_CHECK(mb)) return mb;
+     }
+   return NULL;
+}
+
diff --git a/move-tizen/src/e_mod_move_setup_wizard.h b/move-tizen/src/e_mod_move_setup_wizard.h
new file mode 100644 (file)
index 0000000..e60c4da
--- /dev/null
@@ -0,0 +1,9 @@
+#ifdef E_TYPEDEFS
+#else
+#ifndef E_MOD_MOVE_SETUP_WIZARD_H
+#define E_MOD_MOVE_SETUP_WIZARD_H
+
+EINTERN E_Move_Border *e_mod_move_setup_wizard_find(void);
+
+#endif
+#endif
index b229281..57a7d2e 100644 (file)
@@ -30,13 +30,13 @@ typedef enum _E_Move_Mini_Apptray_State              E_Move_Mini_Apptray_State;
 #include "e_mod_move_lockscreen.h"
 #include "e_mod_move_taskmanager.h"
 #include "e_mod_move_pwlock.h"
+#include "e_mod_move_setup_wizard.h"
 #include "e_mod_move_flick.h"
 #include "e_mod_move_dim_object.h"
 #include "e_mod_move_evas_object.h"
 #include "e_mod_move_widget_object.h"
 #include "e_mod_move_indicator_widget.h"
 #include "e_mod_move_mini_apptray_widget.h"
-#include <dlog.h>
 
 enum _E_Move_Visibility_State
 {
@@ -123,13 +123,12 @@ struct _E_Move
    double                       animation_duration; // apptray / quickpanel move animation duration
    int                          dim_max_opacity; // dim max opacity
    int                          dim_min_opacity; // dim min opacity
-   Eina_Bool                    ev_log : 1; // 1 :ecore & evas_object debug event logging  0: do not log event
-   int                          ev_log_cnt; // ecore & evas_object debug event logging count
-   Eina_List                   *ev_logs; // debug_event_log list
    Eina_Bool                    elm_indicator_mode : 1; // 1: indicator widget mode / 0: indicator window mode
    E_Move_Indicator_Widget     *indicator_widget; // indicator widget data ( it contains widget object, internal data)
    E_Move_Mini_Apptray_Widget  *mini_apptray_widget; // mini_apptray widget data ( it contains widget object, internal data)
    Eina_Bool                    screen_reader_state : 1; // screen reader state  enabled  or disabled
+   Eina_Bool                    setup_wizard_state : 1; // setup wizard state  enabled  or disabled
+   int                          screen_input_block_id; // if id exists, that means screen's input is blocked.
 
    struct {
       int x;
@@ -138,12 +137,14 @@ struct _E_Move
       int h;
    } indicator_widget_geometry[4]; //indicator widget's per angle geometry. [0]: angle 0, [1]: angle 90, [2]: angle 180, [3]: angle 270
 
+   Eina_Bool                    apptray_launch_by_flickup : 1; // 1: apptray launch by flick up feature enable. 0: apptray launch by flick up feature disable
    struct {
       int x;
       int y;
       int w;
       int h;
    } mini_apptray_widget_geometry[4]; //mini_apptray widget's per angle geometry. [0]: angle 0, [1]: angle 90, [2]: angle 180, [3]: angle 270
+
 };
 
 struct _E_Move_Border
index 8d1bbb2..da21e2a 100644 (file)
@@ -708,3 +708,71 @@ e_mod_move_util_prop_active_indicator_win_set(Ecore_X_Window win,
      }
    return ret;
 }
+
+EINTERN Evas_Object*
+e_mod_move_util_comp_layer_get(E_Move *m, const char *name)
+{
+   E_Manager   *man = NULL;
+   E_Zone      *zone = NULL;
+
+   E_CHECK_RETURN(m, NULL);
+   E_CHECK_RETURN(name, NULL);
+
+   man = m->man;
+   E_CHECK_RETURN(man, NULL);
+
+   zone = e_util_zone_current_get(man);
+   E_CHECK_RETURN(zone, NULL);
+
+   return e_manager_comp_layer_get(man, zone, name);
+}
+
+EINTERN Eina_Bool
+e_mod_move_util_screen_input_block(E_Move *m)
+{
+   E_Zone    *zone = NULL;
+   E_Manager *man = NULL;
+   int        input_block_id = 0;
+   Eina_Bool  ret = EINA_FALSE;
+
+   E_CHECK_RETURN(m, EINA_FALSE);
+   if (m->screen_input_block_id) return EINA_FALSE;
+
+   man = m->man;
+   E_CHECK_RETURN(man, EINA_FALSE);
+
+   zone = e_util_zone_current_get(man);
+   E_CHECK_RETURN(zone, EINA_FALSE);
+
+   input_block_id = e_manager_comp_input_region_id_new(man);
+   if (input_block_id)
+     {
+        e_manager_comp_input_region_id_set(man,
+                                           input_block_id,
+                                           zone->x, zone->y, zone->w, zone->h);
+        m->screen_input_block_id = input_block_id;
+        ret = EINA_TRUE;
+     }
+
+   return ret;
+}
+
+EINTERN Eina_Bool
+e_mod_move_util_screen_input_unblock(E_Move *m)
+{
+   E_Manager *man = NULL;
+   Eina_Bool  ret = EINA_FALSE;
+
+   E_CHECK_RETURN(m, EINA_FALSE);
+
+   man = m->man;
+   E_CHECK_RETURN(man, EINA_FALSE);
+
+   if (m->screen_input_block_id)
+     {
+        e_manager_comp_input_region_id_del(man, m->screen_input_block_id);
+        m->screen_input_block_id = 0;
+        ret = EINA_TRUE;
+     }
+   return ret;
+}
index 72ffca4..5ecb530 100644 (file)
@@ -114,5 +114,8 @@ EINTERN Eina_Bool                      e_mod_move_util_prop_indicator_cmd_win_ge
 EINTERN Eina_Bool                      e_mod_move_util_prop_indicator_cmd_win_set(Ecore_X_Window win, E_Move *m);
 EINTERN Eina_Bool                      e_mod_move_util_prop_active_indicator_win_get(Ecore_X_Window *win, E_Move *m);
 EINTERN Eina_Bool                      e_mod_move_util_prop_active_indicator_win_set(Ecore_X_Window win, E_Move *m);
+EINTERN Evas_Object                   *e_mod_move_util_comp_layer_get(E_Move *m, const char *name);
+EINTERN Eina_Bool                      e_mod_move_util_screen_input_block(E_Move *m);
+EINTERN Eina_Bool                      e_mod_move_util_screen_input_unblock(E_Move *m);
 #endif
 #endif
index 67981e5..f936378 100755 (executable)
@@ -35,7 +35,7 @@ The E17 Extra Modules  The E17 extra modules consists of modules made by SAMSUNG
 
 %build
 
-%define DEF_SUBDIRS comp-tizen illume2-tizen keyrouter wmready accessibility move-tizen devicemgr extndialog screen-reader
+%define DEF_SUBDIRS comp-tizen illume2-tizen keyrouter wmready accessibility move-tizen devicemgr extndialog screen-reader devmode-tizen
 
 export CFLAGS+=" -Wall -g -fPIC -rdynamic"
 export LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed -Wl,--rpath=/usr/lib"
@@ -86,6 +86,7 @@ find  %{buildroot}/usr/lib/enlightenment/modules -name *.a | xargs rm
 %{_libdir}/enlightenment/modules/move-tizen
 %{_libdir}/enlightenment/modules/e17-extra-module-devicemgr
 %{_libdir}/enlightenment/modules/screen-reader
+%{_libdir}/enlightenment/modules/devmode-tizen
 %{_datadir}/enlightenment/data/*
 %{_bindir}/extndialog
 %{_bindir}/*
index cba856c..1522359 100644 (file)
@@ -30,6 +30,7 @@ typedef struct
    int             x, y, dx, dy, mx, my;
    int             mouse_history[HISTORY_MAX];
    unsigned int    dt;
+   unsigned int    n_taps;
    Eina_Inarray   *two_finger_move;
    Eina_Inlist    *history;
 
@@ -56,7 +57,8 @@ static Ecore_X_Window unfocused_win = 0;
 static Eina_List *covers = NULL;
 static Eina_List *handlers = NULL;
 static Ecore_Event_Handler *property_handler = NULL;
-static int multi_device[3];
+
+static void _move_module_enable_set(int enable);
 
 static void
 _mouse_in_win_get(Cover *cov, int x, int y)
@@ -117,6 +119,70 @@ _win_angle_get(Ecore_X_Window win)
 }
 
 static void
+_cov_data_reset(Cover *cov)
+{
+   cov->n_taps = 0;
+   cov->longpressed = EINA_FALSE;
+   cov->two_finger_down = EINA_FALSE;
+   cov->two_finger_move = EINA_FALSE;
+   cov->mouse_double_down = EINA_FALSE;
+   cov->three_finger_down = EINA_FALSE;
+   cov->lock_screen = EINA_FALSE;
+
+   if (cov->timer)
+     {
+        ecore_timer_del(cov->timer);
+        cov->timer = NULL;
+     }
+
+   if (cov->double_down_timer)
+     {
+        ecore_timer_del(cov->double_down_timer);
+        cov->double_down_timer = NULL;
+     }
+
+   if (cov->tap_timer)
+     {
+        ecore_timer_del(cov->tap_timer);
+        cov->tap_timer = NULL;
+     }
+}
+
+static void
+_screen_reader_support_check()
+{
+   int ret;
+   unsigned int val;
+   Eina_List *l;
+   Cover *cov;
+
+   ret = ecore_x_window_prop_card32_get
+      (target_win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1);
+
+   if ((ret >= 0) && (val == 2))
+     {
+        /* hide input window */
+        EINA_LIST_FOREACH(covers, l, cov)
+          {
+             ecore_x_window_hide(cov->win);
+             _cov_data_reset(cov);
+          }
+
+        _move_module_enable_set(EINA_FALSE);
+     }
+   else
+     {
+        /* show input window */
+        EINA_LIST_FOREACH(covers, l, cov)
+          {
+             ecore_x_window_show(cov->win);
+          }
+
+        _move_module_enable_set(EINA_TRUE);
+     }
+}
+
+static void
 _target_window_find()
 {
    Ecore_X_Window win;
@@ -362,7 +428,6 @@ _message_mouse_send(Cover *cov, int type)
    ecore_x_pointer_xy_get(cov->down_win, &x, &y);
    _coordinate_calibrate(cov->down_win, &x, &y);
 
-   INF("%d -> %x", type, cov->down_win);
    ecore_x_client_message32_send(cov->down_win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
                                  ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
                                  cov->down_win,
@@ -603,35 +668,58 @@ _mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
              /* get root window rotation */
              angle = _win_angle_get(target_win);
 
-             if (abs(dx) < abs(dy))
+             if (abs(dx) > abs(dy)) /* left or right */
                {
-                  if (dy > 0) /* down */
+                  if (dx > 0) /* right */
                     {
-                       INFO(cov, "three finger flick down");
+                       INFO(cov, "three finger swipe right");
                        switch (angle)
                          {
-                          case 90:
-                          case 180:
+                          case 270:
                             _app_tray_open(cov);
-                            break;
+                          break;
 
-                          case 270:
-                          default:
+                          case 90:
                             _quickpanel_open();
-                            break;
+                          break;
                          }
+
                     }
-                  else /* up */
+                  else /* left */
                     {
-                       INFO(cov, "three finger flick up");
+                       INFO(cov, "three finger swipe left");
                        switch (angle)
                          {
+                          case 270:
+                            _quickpanel_open();
+                          break;
+
                           case 90:
+                            _app_tray_open(cov);
+                          break;
+
+                         }
+                    }
+               }
+             else /* up or down */
+               {
+                  if (dy > 0) /* down */
+                    {
+                       INFO(cov, "three finger swipe down");
+                       switch (angle)
+                         {
                           case 180:
+                          default:
                             _quickpanel_open();
                           break;
-
-                          case 270:
+                         }
+                    }
+                  else /* up */
+                    {
+                       INFO(cov, "three finger swipe up");
+                       switch (angle)
+                         {
+                          case 180:
                           default:
                             _app_tray_open(cov);
                           break;
@@ -720,13 +808,15 @@ _mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
                   INFO(cov, "single flick right");
                   switch (angle)
                     {
-                     case 180:
                      case 270:
-                       ecore_x_e_illume_access_action_read_prev_send
-                                                        (target_win);
+                       ecore_x_e_illume_access_action_up_send(target_win);
                      break;
 
                      case 90:
+                       ecore_x_e_illume_access_action_down_send(target_win);
+                     break;
+
+                     case 180:
                      default:
                        ecore_x_e_illume_access_action_read_next_send
                                                         (target_win);
@@ -739,13 +829,15 @@ _mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
                   INFO(cov, "single flick left");
                   switch (angle)
                     {
-                     case 180:
                      case 270:
-                       ecore_x_e_illume_access_action_read_next_send
-                                                        (target_win);
+                       ecore_x_e_illume_access_action_down_send(target_win);
                      break;
 
                      case 90:
+                       ecore_x_e_illume_access_action_up_send(target_win);
+                     break;
+
+                     case 180:
                      default:
                        ecore_x_e_illume_access_action_read_prev_send
                                                         (target_win);
@@ -761,11 +853,16 @@ _mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
                   switch (angle)
                     {
                      case 90:
-                     case 180:
-                       ecore_x_e_illume_access_action_up_send(target_win);
+                       ecore_x_e_illume_access_action_read_prev_send
+                                                        (target_win);
                      break;
 
                      case 270:
+                       ecore_x_e_illume_access_action_read_next_send
+                                                        (target_win);
+                     break;
+
+                     case 180:
                      default:
                        ecore_x_e_illume_access_action_down_send(target_win);
                      break;
@@ -777,11 +874,16 @@ _mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
                   switch (angle)
                     {
                      case 90:
-                     case 180:
-                       ecore_x_e_illume_access_action_down_send(target_win);
+                       ecore_x_e_illume_access_action_read_next_send
+                                                        (target_win);
                      break;
 
                      case 270:
+                       ecore_x_e_illume_access_action_read_prev_send
+                                                        (target_win);
+                     break;
+
+                     case 180:
                      default:
                        ecore_x_e_illume_access_action_up_send(target_win);
                      break;
@@ -836,32 +938,24 @@ _cb_mouse_down(void    *data __UNUSED__,
    Ecore_Event_Mouse_Button *ev = event;
    Eina_List *l;
    Cover *cov;
-   int i = 0;
-
-   for (i = 0; i < 3; i++)
-     {
-        if (multi_device[i] == -1)
-          {
-             multi_device[i] = ev->multi.device;
-             break;
-          }
-        else if (multi_device[i] == ev->multi.device) break;
-     }
 
    EINA_LIST_FOREACH(covers, l, cov)
      {
+        /* sometimes the mouse down event has improper multi.device value */
+        cov->n_taps++;
+
         if (ev->window == cov->win)
           {
              //XXX change specific number
-             if (ev->multi.device == multi_device[0])
+             if (ev->multi.device == 0)
                {
                   _target_window_find();
                   _mouse_down(cov, ev);
                }
 
-             if (ev->multi.device == multi_device[1] &&
-                 !(cov->two_finger_down) &&
-                 !(cov->longpressed))
+             else if (cov->n_taps == 2 &&
+                      !(cov->two_finger_down) &&
+                      !(cov->longpressed))
                {
                   /* prevent longpress client message by two finger */
                   if (cov->timer)
@@ -879,9 +973,9 @@ _cb_mouse_down(void    *data __UNUSED__,
                   cov->two_finger_move = eina_inarray_new(sizeof(Ecore_Event_Mouse_Move), 0);
                }
 
-             if (ev->multi.device == multi_device[2] &&
-                 !(cov->three_finger_down) &&
-                 !(cov->longpressed))
+             else if (cov->n_taps == 3 &&
+                      !(cov->three_finger_down) &&
+                      !(cov->longpressed))
                {
                   cov->three_finger_down = EINA_TRUE;
 
@@ -912,11 +1006,13 @@ _cb_mouse_up(void    *data __UNUSED__,
 
    EINA_LIST_FOREACH(covers, l, cov)
      {
+        cov->n_taps--;
+
         if (ev->window == cov->win)
           {
              /* the first finger: 1, from the second finger: 0 */
-             if (ev->buttons == 1)
-               _mouse_up(cov, ev);
+             if (ev->buttons == 1) _mouse_up(cov, ev);
+
              return ECORE_CALLBACK_PASS_ON;
           }
      }
@@ -940,17 +1036,17 @@ _cb_mouse_move(void    *data __UNUSED__,
         if (ev->window == cov->win)
           {
              //if (ev->multi.device == multi_device[0] || ev->multi.device == multi_device[1])
-             if (cov->two_finger_down && ev->multi.device == multi_device[1])
+             if (cov->two_finger_down && cov->n_taps == 2)
                _mouse_move(cov, ev);
              else if (cov->longpressed && /* client message for moving is available only after long press is detected */
                       !(cov->mouse_double_down) && /* mouse move after double down should not send read message */
-                      !(cov->two_finger_down) && ev->multi.device == multi_device[0])
+                      !(cov->two_finger_down) && ev->multi.device == 0)
                {
                   INFO(cov, "read");
                   _message_read_send(cov);
                }
              else if (cov->mouse_double_down && /* client message for moving is available only after long press is detected */
-                      !(cov->two_finger_down) && ev->multi.device == multi_device[0])
+                      !(cov->two_finger_down) && ev->multi.device == 0)
                {
                   if (cov->longpressed)
                     {
@@ -1053,7 +1149,6 @@ _covers_init(void)
 {
    Eina_List *l, *l2, *l3;
    E_Manager *man;
-   int i = 0;
 
    EINA_LIST_FOREACH(e_manager_list(), l, man)
      {
@@ -1067,7 +1162,7 @@ _covers_init(void)
                   if (cov)
                     {
                        covers = eina_list_append(covers, cov);
-                       for (i = 0; i < HISTORY_MAX; i++) cov->mouse_history[i] = -1;
+                       cov->n_taps = 0;
 
                        cov->atom_control_panel_open = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_CONTROL_PANEL_OPEN_");
                        cov->atom_app_tray_open = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_APP_TRAY_OPEN_");
@@ -1144,8 +1239,6 @@ _cb_zone_move_resize(void    *data __UNUSED__,
 static void
 _events_init(void)
 {
-   int i = 0;
-
    handlers = eina_list_append
      (handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
                                         _cb_mouse_down, NULL));
@@ -1167,8 +1260,6 @@ _events_init(void)
    handlers = eina_list_append
      (handlers, ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
                                         _cb_zone_move_resize, NULL));
-
-   for (i = 0; i < 3; i++) multi_device[i] = -1;
 }
 
 static void
@@ -1185,10 +1276,22 @@ _cb_property_change(void *data __UNUSED__,
    E_Border *bd;
    Ecore_X_Event_Window_Property *event = ev;
 
+   if (!g_enable) return ECORE_CALLBACK_PASS_ON;
+
    if (event->atom == ECORE_X_ATOM_NET_ACTIVE_WINDOW)
      {
         bd = e_border_focused_get();
-        if (bd) target_win = bd->client.win;
+        if (bd)
+          {
+             target_win = bd->client.win;
+             _screen_reader_support_check();
+          }
+     }
+
+   if (event->atom == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL &&
+       event->win == target_win)
+     {
+        _screen_reader_support_check();
      }
 
    return ECORE_CALLBACK_PASS_ON;