Add first step of Zone_Window_Roation Feature 18/33418/1
authorMun, Gwan-gyeong <kk.moon@samsung.com>
Mon, 5 Jan 2015 12:48:55 +0000 (21:48 +0900)
committerMun, Gwan-gyeong <kk.moon@samsung.com>
Fri, 9 Jan 2015 07:44:53 +0000 (16:44 +0900)
Change-Id: Ife577b104b8bd665e50d066d2b450e26f6146ebd

configure.ac
src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_x.c
src/bin/e_config.c
src/bin/e_config.h
src/bin/e_zone.c
src/bin/e_zone.h

index 38f96c7a2466c9106ba06e05ab880924a2a3a128..295f7513ffaea1197e93a1e39357e8811691a9cd 100644 (file)
@@ -603,8 +603,8 @@ PKG_CHECK_MODULES(E_OPEN, [
 ])
 
 e_libs="$E_LIBS $LIBINTL $fnmatch_libs $execinfo_libs"
-e_cflags="-DUSE_E_CONFIG_H $E_CFLAGS"
-e_configflags="-DUSE_E_CONFIG_H"
+e_cflags="-DUSE_E_CONFIG_H $E_CFLAGS -D_F_ZONE_WINDOW_ROTATION_"
+e_configflags="-DUSE_E_CONFIG_H -D_F_ZONE_WINDOW_ROTATION_"
 
 AC_SUBST([e_libs])
 AC_SUBST([e_cflags])
index ff8afe26f919044d08297cbccef1b72098b41530..ed1395e6bf4b0ae91afaeeb354cdd091fb03f2bb 100644 (file)
@@ -19,6 +19,11 @@ EAPI int E_EVENT_CLIENT_FOCUS_OUT = -1;
 EAPI int E_EVENT_CLIENT_PROPERTY = -1;
 EAPI int E_EVENT_CLIENT_FULLSCREEN = -1;
 EAPI int E_EVENT_CLIENT_UNFULLSCREEN = -1;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+EAPI int E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN = -1;
+EAPI int E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL = -1;
+EAPI int E_EVENT_CLIENT_ROTATION_CHANGE_END = -1;
+#endif
 
 static Eina_Hash *clients_hash = NULL; // pixmap->client
 
@@ -530,7 +535,7 @@ _e_client_free(E_Client *ec)
    eina_stringshare_replace(&ec->netwm.icon_name, NULL);
    eina_stringshare_replace(&ec->internal_icon, NULL);
    eina_stringshare_replace(&ec->internal_icon_key, NULL);
-   
+
    focus_stack = eina_list_remove(focus_stack, ec);
    raise_stack = eina_list_remove(raise_stack, ec);
 
@@ -2350,6 +2355,11 @@ e_client_init(void)
    E_EVENT_CLIENT_PROPERTY = ecore_event_type_new();
    E_EVENT_CLIENT_FULLSCREEN = ecore_event_type_new();
    E_EVENT_CLIENT_UNFULLSCREEN = ecore_event_type_new();
+#ifdef _F_ZONE_WINDOW_ROTATION_
+   E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN = ecore_event_type_new();
+   E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL = ecore_event_type_new();
+   E_EVENT_CLIENT_ROTATION_CHANGE_END = ecore_event_type_new();
+#endif
 
    return (!!clients_hash);
 }
index 831b9c5fa1fe8ede8654b946767b9abfc5a6734c..f18fccc23be98058dabe9b1cc200e5694ec6312f 100644 (file)
@@ -131,6 +131,14 @@ typedef enum E_Client_Property
    E_CLIENT_PROPERTY_STICKY = (1 << 7),
 } E_Client_Property;
 
+#ifdef _F_ZONE_WINDOW_ROTATION_
+typedef enum _E_Client_Rotation_Type
+{
+   E_CLIENT_ROTATION_TYPE_NORMAL = 0,
+   E_CLIENT_ROTATION_TYPE_DEPENDENT = 1
+} E_Client_Rotation_Type;
+#endif
+
 typedef struct E_Client E_Client;
 
 typedef struct E_Event_Client E_Event_Client;
@@ -139,6 +147,11 @@ typedef struct _E_Client_Pending_Resize E_Client_Pending_Resize;
 typedef struct E_Event_Client_Zone_Set E_Event_Client_Zone_Set;
 typedef struct E_Event_Client_Desk_Set E_Event_Client_Desk_Set;
 typedef struct _E_Client_Hook E_Client_Hook;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+typedef struct E_Event_Client E_Event_Client_Rotation_Change_Begin;
+typedef struct E_Event_Client E_Event_Client_Rotation_Change_Cancel;
+typedef struct E_Event_Client E_Event_Client_Rotation_Change_End;
+#endif
 
 typedef enum _E_Client_Hook_Point
 {
@@ -515,10 +528,46 @@ struct E_Client
          } profile;
          unsigned char  centered : 1;
          unsigned char  video : 1;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+         struct
+         {
+            E_Client_Rotation_Type type;
+            struct
+              {
+                 int prev, curr, next, reserve;
+              } ang;
+            struct
+              {
+                 int x, y, w, h;
+              } geom[4];
+            unsigned char support : 1;
+            unsigned char geom_hint: 1;
+            unsigned char pending_change_request : 1;
+            unsigned char pending_show : 1;  // newly created window that has to be rotated will be show after rotating done.
+                                             // so, it will be used pending e_border_show called at main eval time.
+            unsigned char wait_for_done: 1;
+            unsigned char app_set : 1;    // app wants to communicate with the window manager
+            int           rot;            // decided rotation by the window manager
+            int           preferred_rot;  // app specified rotation
+            int          *available_rots; // app specified available rotations
+            unsigned int  count;          // number of elements of available rotations
+         } rot;
+#endif
       } state;
 
       struct
       {
+#ifdef _F_ZONE_WINDOW_ROTATION_
+         struct
+         {
+            unsigned char support : 1;
+            unsigned char geom_hint : 1;
+            unsigned char app_set : 1;        // app wants to communicate with the window manager
+            unsigned char preferred_rot : 1;  // app specified rotation
+            unsigned char available_rots : 1; // app specified available rotations
+            unsigned char need_rotation : 1;
+         } rot;
+#endif
          unsigned char state : 1;
          unsigned char video_parent : 1;
          unsigned char video_position : 1;
@@ -570,6 +619,9 @@ struct E_Client
       Eina_Bool internal_state : 1;
       Eina_Bool need_maximize : 1;
       Eina_Bool need_unmaximize : 1;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+      Eina_Bool rotation : 1;
+#endif
    } changes;
 
    unsigned int       visible : 1; // client is set to be visible by display server (never use this)
@@ -739,7 +791,11 @@ EAPI extern int E_EVENT_CLIENT_FOCUS_OUT;
 EAPI extern int E_EVENT_CLIENT_PROPERTY;
 EAPI extern int E_EVENT_CLIENT_FULLSCREEN;
 EAPI extern int E_EVENT_CLIENT_UNFULLSCREEN;
-
+#ifdef _F_ZONE_WINDOW_ROTATION_
+EAPI extern int E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN;
+EAPI extern int E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL;
+EAPI extern int E_EVENT_CLIENT_ROTATION_CHANGE_END;
+#endif
 
 EINTERN void e_client_idler_before(void);
 EINTERN Eina_Bool e_client_init(void);
index ff89c993cada1bf0e7d96a52a2d7052a5638236c..328075ffd4c9dd3aec06a8113dee5b4ea0bfc85d 100644 (file)
@@ -5102,6 +5102,13 @@ _e_comp_x_screens_setup(void)
         c->comp_type = E_PIXMAP_TYPE_X;
         success = _e_comp_x_setup(c, root, rw, rh);
         if (!success) break;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+        if (e_config->wm_win_rotation)
+          {
+             ecore_x_e_window_rotation_supported_set(roots[i],
+                                                     e_config->wm_win_rotation);
+          }
+#endif
      }
    free(roots);
    return success;
index de632f775d9b5011429f929b9ec039b9b7b23e1c..ddc1ddf14083a73aa944d77307651ba34dd704e7 100644 (file)
@@ -764,6 +764,9 @@ _e_config_edd_init(Eina_Bool old)
    E_CONFIG_VAL(D, T, exe_always_single_instance, UCHAR);
 
    E_CONFIG_VAL(D, T, use_desktop_window_profile, INT);
+#ifdef _F_ZONE_WINDOW_ROTATION_
+   E_CONFIG_VAL(D, T, wm_win_rotation, UCHAR);
+#endif
 }
 
 /* externally accessible functions */
index 43ee599522379895d9c9f6e3c9b029479fc74818..ad712451a12e1e82b6eed484f3d58bac1ccdd4ce 100644 (file)
@@ -436,6 +436,9 @@ struct _E_Config
    Eina_List  *menu_applications;
    unsigned char exe_always_single_instance; // GUI
    int           use_desktop_window_profile; // GUI
+#ifdef _F_ZONE_WINDOW_ROTATION_
+   unsigned char wm_win_rotation;
+#endif
 };
 
 struct E_Config_Bindings
index 6ac950a8a00b5c0dd865a9d01edb9373903e28e8..d32567cc5dfd44068c2ab6f5a2c0b05518cc3c67 100644 (file)
@@ -34,6 +34,11 @@ EAPI int E_EVENT_ZONE_DEL = 0;
 EAPI int E_EVENT_ZONE_EDGE_IN = 0;
 EAPI int E_EVENT_ZONE_EDGE_OUT = 0;
 EAPI int E_EVENT_ZONE_EDGE_MOVE = 0;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+EAPI int E_EVENT_ZONE_ROTATION_CHANGE_BEGIN = 0;
+EAPI int E_EVENT_ZONE_ROTATION_CHANGE_CANCEL = 0;
+EAPI int E_EVENT_ZONE_ROTATION_CHANGE_END = 0;
+#endif
 
 #define E_ZONE_FLIP_LEFT(zone)  (((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0)) && (zone)->edge.left)
 #define E_ZONE_FLIP_RIGHT(zone) (((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count)) && (zone)->edge.right)
@@ -53,6 +58,11 @@ e_zone_init(void)
    E_EVENT_ZONE_EDGE_IN = ecore_event_type_new();
    E_EVENT_ZONE_EDGE_OUT = ecore_event_type_new();
    E_EVENT_ZONE_EDGE_MOVE = ecore_event_type_new();
+#ifdef _F_ZONE_WINDOW_ROTATION_
+   E_EVENT_ZONE_ROTATION_CHANGE_BEGIN = ecore_event_type_new();
+   E_EVENT_ZONE_ROTATION_CHANGE_CANCEL = ecore_event_type_new();
+   E_EVENT_ZONE_ROTATION_CHANGE_END = ecore_event_type_new();
+#endif
    return 1;
 }
 
index a56f771600a9010359b02d37f500de364f5e0e82..f18733495a562888438f5ae68f9ee82789263cf0 100644 (file)
@@ -22,6 +22,11 @@ typedef struct _E_Event_Zone_Del            E_Event_Zone_Del;
 /* TODO: Move this to a general place? */
 typedef struct _E_Event_Pointer_Warp        E_Event_Pointer_Warp;
 typedef struct _E_Event_Zone_Edge           E_Event_Zone_Edge;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+typedef struct _E_Event_Zone_Rotation_Change_Begin  E_Event_Zone_Rotation_Change_Begin;
+typedef struct _E_Event_Zone_Rotation_Change_Cancel E_Event_Zone_Rotation_Change_Cancel;
+typedef struct _E_Event_Zone_Rotation_Change_End    E_Event_Zone_Rotation_Change_End;
+#endif
 
 #else
 #ifndef E_ZONE_H
@@ -87,6 +92,17 @@ struct _E_Zone
       int       x, y, w, h;
       Eina_Bool dirty : 1;
    } useful_geometry;
+#ifdef _F_ZONE_WINDOW_ROTATION_
+   struct
+   {
+      int       prev, curr, next, sub;
+      int       block_count;
+
+      Eina_Bool wait_for_done : 1;
+      Eina_Bool pending : 1;
+      Eina_Bool unknown_state : 1;
+   } rot;
+#endif
 };
 
 struct _E_Event_Zone_Desk_Count_Set
@@ -131,6 +147,23 @@ struct _E_Event_Zone_Edge
    Eina_Bool  drag : 1;
 };
 
+#ifdef _F_ZONE_WINDOW_ROTATION_
+struct _E_Event_Zone_Rotation_Change_Begin
+{
+   E_Zone     *zone;
+};
+
+struct _E_Event_Zone_Rotation_Change_Cancel
+{
+   E_Zone     *zone;
+};
+
+struct _E_Event_Zone_Rotation_Change_End
+{
+   E_Zone     *zone;
+};
+#endif
+
 EINTERN int    e_zone_init(void);
 EINTERN int    e_zone_shutdown(void);
 EAPI E_Zone   *e_zone_new(E_Comp *con, int num, int id, int x, int y, int w, int h);
@@ -171,5 +204,11 @@ extern EAPI int E_EVENT_ZONE_EDGE_IN;
 extern EAPI int E_EVENT_ZONE_EDGE_OUT;
 extern EAPI int E_EVENT_ZONE_EDGE_MOVE;
 
+#ifdef _F_ZONE_WINDOW_ROTATION_
+extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE_BEGIN;
+extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE_CANCEL;
+extern EAPI int E_EVENT_ZONE_ROTATION_CHANGE_END;
+#endif
+
 #endif
 #endif