e_policy: add e_policy files 19/317319/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 11 Jul 2024 10:51:05 +0000 (19:51 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 9 Sep 2024 03:14:32 +0000 (12:14 +0900)
Change-Id: Ie8c50e39cd6d19b6ace8a2b2f1cee5e9e89e785d

src/bin/Makefile.mk
src/bin/compmgr/e_comp_canvas.c
src/bin/core/e_intern.h
src/bin/windowmgr/e_policy.c
src/bin/windowmgr/e_policy_desk.c [new file with mode: 0644]
src/bin/windowmgr/e_policy_desk_area.c [new file with mode: 0644]
src/bin/windowmgr/e_policy_desk_area_intern.h [new file with mode: 0644]
src/bin/windowmgr/e_policy_desk_intern.h [new file with mode: 0644]
src/bin/windowmgr/e_policy_intern.h
src/bin/windowmgr/e_policy_zone.c [new file with mode: 0644]
src/bin/windowmgr/e_policy_zone_intern.h [new file with mode: 0644]

index 193ed8b..7f1c843 100644 (file)
@@ -204,6 +204,9 @@ src/bin/windowmgr/services/e_service_softkey.c \
 src/bin/windowmgr/services/e_service_taskbar.c \
 src/bin/windowmgr/services/e_service_kvm.c \
 src/bin/windowmgr/e_policy.c \
+src/bin/windowmgr/e_policy_zone.c \
+src/bin/windowmgr/e_policy_desk.c \
+src/bin/windowmgr/e_policy_desk_area.c \
 src/bin/windowmgr/e_policy_stack.c  \
 src/bin/windowmgr/e_policy_visibility.c \
 src/bin/windowmgr/e_policy_conformant.c \
index 6288d80..4239667 100644 (file)
 #include "e_view_intern.h"
 #include "e_view_edje_intern.h"
 
+#ifdef CONTAINER_POLICY
+#include "e_policy_zone_intern.h"
+#endif
+
 static Eina_List *handlers;
 static Eina_Bool _ev_freeze = EINA_FALSE;
 
+#ifdef CONTAINER_POLICY
+static Eina_List *g_policy_zones;
+#endif
+
 static void
 _e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
 {
@@ -93,6 +101,9 @@ e_comp_canvas_init(int w, int h)
    int color[4] = {0, 0, 0, 255};
    E_Zone *zone;
    E_Tizen_Screen *tizen_screen;
+#ifdef CONTAINER_POLICY
+   E_Policy_Zone *policy_zone;
+#endif
 
    TRACE_DS_BEGIN(COMP_CANVAS:INIT);
 
@@ -139,6 +150,10 @@ e_comp_canvas_init(int w, int h)
         EINA_LIST_FOREACH(screens, l, scr)
           {
              zone = e_zone_screen_new(scr->screen, scr->w, scr->h);
+#ifdef CONTAINER_POLICY
+             policy_zone = e_policy_zone_new(zone);
+             g_policy_zones = eina_list_append(g_policy_zones, policy_zone);
+#endif
              tizen_screen = e_tizen_screen_create(zone);
              if (scr->id) zone->output_id = strdup(scr->id);
              printf("@@@ NEW ZONE = %p, %p\n", zone, tizen_screen);
@@ -147,6 +162,10 @@ e_comp_canvas_init(int w, int h)
    else
      {
         zone = e_zone_screen_new(0, e_comp->w, e_comp->h);
+#ifdef CONTAINER_POLICY
+        policy_zone = e_policy_zone_new(zone);
+        g_policy_zones = eina_list_append(g_policy_zones, policy_zone);
+#endif
         tizen_screen = e_tizen_screen_create(zone);
         printf("@@@ NEW ZONE = %p, %p\n", zone, tizen_screen);
      }
@@ -300,6 +319,9 @@ e_comp_canvas_update(void)
    E_Tizen_Screen *tizen_screen;
    E_Screen *scr;
    Eina_Bool changed = EINA_FALSE;
+#ifdef CONTAINER_POLICY
+   E_Policy_Zone *policy_zone;
+#endif
 
    screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
 
@@ -338,6 +360,10 @@ e_comp_canvas_update(void)
              else
                {
                   zone = e_zone_screen_new(scr->screen, scr->w, scr->h);
+#ifdef CONTAINER_POLICY
+                  policy_zone = e_policy_zone_new(zone);
+                  g_policy_zones = eina_list_append(g_policy_zones, policy_zone);
+#endif
                   tizen_screen = e_tizen_screen_create(zone);
                   if (scr->id) zone->output_id = strdup(scr->id);
 
index 2879366..762e157 100644 (file)
@@ -20,6 +20,8 @@
 #include <Ecore.h>
 #include <Eina.h>
 
+#define CONTAINER_POLICY
+
 #define CHECKING_PRIMARY_ZPOS
 #define CLIENT_DEL_STACK_ISSUE
 
index 6318b06..885d231 100644 (file)
 #include "e_policy_stack_intern.h"
 #include "e_compositor_intern.h"
 
+#ifdef CONTAINER_POLICY
+#include "e_policy_desk_intern.h"
+#endif
+
 E_Policy *e_policy = NULL;
 Eina_Hash *hash_policy_desks = NULL;
 Eina_Hash *hash_policy_clients = NULL;
@@ -504,7 +508,11 @@ _e_policy_client_floating_policy_cancel(E_Policy_Client *pc)
    pc->flt_policy_state = EINA_FALSE;
 }
 
+#ifdef CONTAINER_POLICY
+EINTERN E_Config_Policy_Desk *
+#else
 E_Config_Policy_Desk *
+#endif
 _e_policy_desk_get_by_num(unsigned int zone_num, int x, int y)
 {
    Eina_List *l;
@@ -2399,11 +2407,13 @@ EINTERN int
 e_policy_init(void)
 {
    E_Policy *pol;
+#ifdef CONTAINER_POLICY
+#else
    E_Zone *zone;
    E_Config_Policy_Desk *d;
    const Eina_List *l;
    int i, n;
-
+#endif
    pol = E_NEW(E_Policy, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(pol, EINA_FALSE);
 
@@ -2418,6 +2428,8 @@ e_policy_init(void)
    e_policy_wl_init();
    e_policy_wl_aux_hint_init();
 
+#ifdef CONTAINER_POLICY
+#else
    EINA_LIST_FOREACH(e_comp->zones, l, zone)
      {
         n = zone->desk_y_count * zone->desk_x_count;
@@ -2435,6 +2447,7 @@ e_policy_init(void)
                e_policy_desk_add(zone->desks[i]);
           }
      }
+#endif
 
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD,                  _e_policy_cb_zone_add,                        NULL);
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL,                  _e_policy_cb_zone_del,                        NULL);
diff --git a/src/bin/windowmgr/e_policy_desk.c b/src/bin/windowmgr/e_policy_desk.c
new file mode 100644 (file)
index 0000000..247311a
--- /dev/null
@@ -0,0 +1,8 @@
+#include "e_policy_desk_intern.h"
+
+#ifdef CONTAINER_POLICY
+
+
+
+#endif
+
diff --git a/src/bin/windowmgr/e_policy_desk_area.c b/src/bin/windowmgr/e_policy_desk_area.c
new file mode 100644 (file)
index 0000000..6a55cd8
--- /dev/null
@@ -0,0 +1,10 @@
+#include "e_policy_desk_area_intern.h"
+
+#ifdef CONTAINER_POLICY
+
+struct _E_Policy_Desk_Area
+{
+   E_Desk_Area *desk_area;
+};
+
+#endif
diff --git a/src/bin/windowmgr/e_policy_desk_area_intern.h b/src/bin/windowmgr/e_policy_desk_area_intern.h
new file mode 100644 (file)
index 0000000..f56a070
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef E_POLICY_DESK_AREA_INTERN_H
+#define E_POLICY_DESK_AREA_INTERN_H
+
+#include "e_intern.h"
+#include "e_desk_area_intern.h"
+
+#endif
diff --git a/src/bin/windowmgr/e_policy_desk_intern.h b/src/bin/windowmgr/e_policy_desk_intern.h
new file mode 100644 (file)
index 0000000..956d385
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef E_POLICY_DESK_INTERN_H
+#define E_POLICY_DESK_INTERN_H
+
+#include "e_intern.h"
+#include "e_desk_intern.h"
+
+typedef struct _E_Policy_Desk E_Policy_Desk;
+
+#ifdef CONTAINER_POLICY
+struct _E_Policy_Desk
+{
+   E_Desk          *desk;
+   E_Zone          *zone;
+};
+#endif
+
+#endif
index 3cff32e..fcd57f7 100644 (file)
@@ -3,9 +3,15 @@
 
 #include "e_intern.h"
 #include "e_policy.h"
+#ifdef CONTAINER_POLICY
+#include "e_policy_desk_intern.h"
+#endif
 
 typedef struct _E_Policy               E_Policy;
+#ifdef CONTAINER_POLICY
+#else
 typedef struct _E_Policy_Desk          E_Policy_Desk;
+#endif
 typedef struct _E_Policy_Client        E_Policy_Client;
 typedef struct _E_Policy_System_Info   E_Policy_System_Info;
 
@@ -16,11 +22,14 @@ struct _E_Policy
    Eina_Inlist     *softkeys; /* softkey ui object per zone */
 };
 
+#ifdef CONTAINER_POLICY
+#else
 struct _E_Policy_Desk
 {
    E_Desk          *desk;
    E_Zone          *zone;
 };
+#endif
 
 struct _E_Policy_Client
 {
@@ -147,4 +156,8 @@ EINTERN void             e_policy_keyboard_layout_apply(E_Client *ec);
 EINTERN void             e_policy_interceptors_clean(void);
 EINTERN Eina_Bool        e_policy_interceptor_call(E_Policy_Intercept_Point ipoint, E_Client *ec, ...);
 
+#ifdef CONTAINER_POLICY
+EINTERN E_Config_Policy_Desk *_e_policy_desk_get_by_num(unsigned int zone_num, int x, int y);
+#endif
+
 #endif
diff --git a/src/bin/windowmgr/e_policy_zone.c b/src/bin/windowmgr/e_policy_zone.c
new file mode 100644 (file)
index 0000000..e1623ee
--- /dev/null
@@ -0,0 +1,58 @@
+#include "e_policy_zone_intern.h"
+#include "e_policy_intern.h"
+
+#ifdef CONTAINER_POLICY
+
+struct _E_Policy_Zone
+{
+   E_Zone *zone;
+
+   struct wl_listener zone_destroy;
+};
+
+static void
+_e_policy_zone_cb_zone_destroy(struct wl_listener *listener, void *data)
+{
+  E_Policy_Zone *policy_zone;
+
+  policy_zone = wl_container_of(listener, policy_zone, zone_destroy);
+
+  e_object_unref(E_OBJECT(policy_zone->zone));
+  policy_zone->zone = NULL;
+}
+
+EINTERN E_Policy_Zone *
+e_policy_zone_new(E_Zone *zone)
+{
+   E_Policy_Zone *policy_zone;
+   E_Config_Policy_Desk *d;
+   int n, i;
+
+   policy_zone = E_NEW(E_Policy_Zone, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(policy_zone, NULL);
+   policy_zone->zone = zone;
+   e_object_ref(E_OBJECT(zone));
+
+   n = zone->desk_y_count * zone->desk_x_count;
+   for (i = 0; i < n; i++)
+     {
+        if (e_config->use_configured_desks)
+          {
+             d = _e_policy_desk_get_by_num(zone->num,
+                                           zone->desks[i]->x,
+                                           zone->desks[i]->y);
+             if (d)
+               e_policy_desk_add(zone->desks[i]);
+          }
+        else
+          e_policy_desk_add(zone->desks[i]);
+     }
+
+   // zone listeners
+   policy_zone->zone_destroy.notify = _e_policy_zone_cb_zone_destroy;
+   e_zone_destroy_listener_add(zone, &policy_zone->zone_destroy);
+
+   return policy_zone;
+}
+
+#endif
diff --git a/src/bin/windowmgr/e_policy_zone_intern.h b/src/bin/windowmgr/e_policy_zone_intern.h
new file mode 100644 (file)
index 0000000..b4887c1
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef E_POLICY_ZONE_INTERN_H
+#define E_POLICY_ZONE_INTERN_H
+
+#include "e_intern.h"
+#include "e_zone_intern.h"
+
+typedef struct _E_Policy_Zone E_Policy_Zone;
+
+E_Policy_Zone *e_policy_zone_new(E_Zone *zone);
+
+#endif