aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorGwanglim Lee <gl77.lee@samsung.com>2012-12-05 06:48:46 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-12-05 06:48:46 +0000
commit74cdf85ea9a1931e508703ddd1cfb1c9ce68f3c1 (patch)
tree642d82752f5aef6f25a56dab07629a32c25bd30b /src/lib/ecore_evas
parentSome KlocWork fixes. (diff)
downloadefl-74cdf85ea9a1931e508703ddd1cfb1c9ce68f3c1.tar.gz
From: Gwanglim Lee <gl77.lee@samsung.com>
Subject: Re: Re: Re: [E-devel] [RFC] Virtual desktop window profile I've attached 4th patch. May the 4th be with you. ecore patch has been merged with efl and all files are based on r80123. Thanks & Regards, Gwanglim ------- Original Message ------- Sender : Daniel Juyung Seo<seojuyung2@gmail.com> Date : 2012-12-04 01:55 (GMT+09:00) Title : Re: Re: [E-devel] [RFC] Virtual desktop window profile It looks ok to me. Sorry but can you re-generate the patch according to the recent ecore merge to efl single tree? Daniel Juyung Seo (SeoZ) On Thu, Nov 29, 2012 at 12:29 AM, Gwanglim Lee <gl77.lee@samsung.com> wrote: Dear Raster and Daniel Juyung Seo, I've attached 3rd patches and test_config according to your reviews. These are based on r79782. [elementary & ecore] 1. "profile,set" -> "profile,changed" - done 2. spaces after EINA_LIST_FOREACH - done 3. variable type - keep 4. author - done 5. removing deprecated marking in patch - done 6. add elm_win_available_profiles_get to test_config for the debugging purpose - done 7. check whether a given profile is present in an available profiles. otherwise window profile will be one of the item in available profiles. - newly added thing to the elm_win 8. merge with EO - done. :( Any comments would be appreciated. SVN revision: 80214
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h60
-rw-r--r--src/lib/ecore_evas/ecore_evas.c112
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c19
-rw-r--r--src/lib/ecore_evas/ecore_evas_cocoa.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_directfb.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_extn.c161
-rw-r--r--src/lib/ecore_evas/ecore_evas_fb.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h29
-rw-r--r--src/lib/ecore_evas/ecore_evas_psl1ght.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_sdl.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_egl.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_shm.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_win32.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_x.c150
15 files changed, 507 insertions, 33 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 3c59c80c84..b701aeec8f 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -662,6 +662,59 @@ EAPI void ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on);
*/
EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee);
/**
+ * @brief Query if the underlying windowing system supports the window profile.
+ *
+ * @param ee The Ecore_Evas
+ * @return @c EINA_TRUE if the window profile is supported, @c EINA_FALSE otherwise.
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.8.0
+ */
+EAPI Eina_Bool ecore_evas_window_profile_supported_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the window profile
+ *
+ * @param ee The Ecore_Evas to set
+ * @param profile The string value of the window profile
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.8.0
+ */
+EAPI void ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile);
+/**
+ * @brief Get the window profile
+ *
+ * @param ee The Ecore_Evas to get the window profile from.
+ * @return The string value of the window profile, or NULL if none exists
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.8.0
+ */
+EAPI const char *ecore_evas_window_profile_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the array of available window profiles
+ *
+ * @param ee The Ecore_Evas to set
+ * @param profiles The string array of available window profiels
+ * @param count The number of members in profiles
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.8.0
+ */
+EAPI void ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count);
+/**
+ * @brief Get the array of available window profiles
+ *
+ * @param ee The Ecore_Evas to get available window profiles from.
+ * @param profiles Where to return the string array of available window profiles
+ * @param count Where to return the number of members in profiles
+ * @return EINA_TRUE if available window profiles exist, EINA_FALSE otherwise
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.8.0
+ */
+EAPI Eina_Bool ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count);
+/**
* @brief Move an Ecore_Evas.
*
* @param ee The Ecore_Evas to move
@@ -1886,6 +1939,13 @@ EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Get
* just deleting the list.
*/
EAPI Eina_List *ecore_evas_ecore_evas_list_get(void);
+/**
+ * @brief Get a list of all the sub ecore_evases.
+ *
+ * @param ee Ecore_Evas to get the list from.
+ * @return A list of sub ecore_evases, or @c NULL if there is no sub ecore_evases.
+ */
+EAPI Eina_List *ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee);
/* specific calls to an x11 environment ecore_evas */
EAPI void ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win);
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 3d841e7db6..9a665fd581 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -1859,6 +1859,77 @@ ecore_evas_maximized_get(const Ecore_Evas *ee)
return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
}
+EAPI Eina_Bool
+ecore_evas_window_profile_supported_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_window_profile_supported_get");
+ return EINA_FALSE;
+ }
+ return ee->profile_supported ? EINA_TRUE : EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_window_profile_set");
+ return;
+ }
+ IFC(ee, fn_profile_set) (ee, profile);
+ IFE;
+}
+
+EAPI const char *
+ecore_evas_window_profile_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_window_profile_get");
+ return NULL;
+ }
+ return ee->prop.profile.name;
+}
+
+EAPI void
+ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_window_available_profiles_set");
+ return;
+ }
+ IFC(ee, fn_profiles_set) (ee, profiles, count);
+ IFE;
+}
+
+EAPI Eina_Bool
+ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_window_available_profiles_get");
+ return EINA_FALSE;
+ }
+
+ if ((ee->prop.profile.available_list) &&
+ (ee->prop.profile.count >= 1))
+ {
+ if (profiles) *profiles = ee->prop.profile.available_list;
+ if (count) *count = ee->prop.profile.count;
+ return EINA_TRUE;
+ }
+ else
+ return EINA_FALSE;
+}
+
EAPI void
ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
{
@@ -2433,6 +2504,10 @@ _ecore_evas_free(Ecore_Evas *ee)
ee->prop.name = NULL;
if (ee->prop.clas) free(ee->prop.clas);
ee->prop.clas = NULL;
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = NULL;
+ _ecore_evas_window_available_profiles_free(ee);
+ ee->prop.profile.available_list = NULL;
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
ee->prop.cursor.object = NULL;
if (ee->evas) evas_free(ee->evas);
@@ -2662,6 +2737,31 @@ _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
flags, timestamp, NULL);
}
+void
+_ecore_evas_window_profile_free(Ecore_Evas *ee)
+{
+ if (ee->prop.profile.name)
+ eina_stringshare_del(ee->prop.profile.name);
+}
+
+void
+_ecore_evas_window_available_profiles_free(Ecore_Evas *ee)
+{
+ if (ee->prop.profile.available_list)
+ {
+ int i;
+ for (i = 0; i < ee->prop.profile.count; i++)
+ {
+ if (ee->prop.profile.available_list[i])
+ {
+ eina_stringshare_del(ee->prop.profile.available_list[i]);
+ ee->prop.profile.available_list[i] = NULL;
+ }
+ }
+ free(ee->prop.profile.available_list);
+ }
+}
+
EAPI Eina_List *
ecore_evas_ecore_evas_list_get(void)
{
@@ -2676,6 +2776,18 @@ ecore_evas_ecore_evas_list_get(void)
return l;
}
+EAPI Eina_List *
+ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_sub_ecore_evas_list_get");
+ return NULL;
+ }
+ return ee->sub_ecore_evas;
+}
+
EAPI void
ecore_evas_input_event_register(Ecore_Evas *ee)
{
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 26f48ce336..8dcd71442e 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -467,6 +467,22 @@ _ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
}
}
+static void
+_ecore_evas_buffer_profile_set(Ecore_Evas *ee, const char *profile)
+{
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = NULL;
+
+ if (profile)
+ {
+ ee->prop.profile.name = (char *)eina_stringshare_add(profile);
+
+ /* just change ee's state.*/
+ if (ee->func.fn_state_change)
+ ee->func.fn_state_change(ee);
+ }
+}
+
static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
{
_ecore_evas_buffer_free,
@@ -516,6 +532,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
_ecore_evas_buffer_alpha_set,
NULL, //transparent
NULL, // profiles_set
+ _ecore_evas_buffer_profile_set,
NULL,
NULL,
@@ -583,6 +600,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
ee->h = h;
ee->req.w = ee->w;
ee->req.h = ee->h;
+ ee->profile_supported = 1;
ee->prop.max.w = 0;
ee->prop.max.h = 0;
@@ -722,6 +740,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
ee->h = h;
ee->req.w = ee->w;
ee->req.h = ee->h;
+ ee->profile_supported = 1;
ee->prop.max.w = 0;
ee->prop.max.h = 0;
diff --git a/src/lib/ecore_evas/ecore_evas_cocoa.c b/src/lib/ecore_evas/ecore_evas_cocoa.c
index bf88e5e33f..32acb57ccb 100644
--- a/src/lib/ecore_evas/ecore_evas_cocoa.c
+++ b/src/lib/ecore_evas/ecore_evas_cocoa.c
@@ -464,6 +464,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
NULL,
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_directfb.c b/src/lib/ecore_evas/ecore_evas_directfb.c
index f3567341b1..caeed21def 100644
--- a/src/lib/ecore_evas/ecore_evas_directfb.c
+++ b/src/lib/ecore_evas/ecore_evas_directfb.c
@@ -490,6 +490,7 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
NULL, /* alpha */
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index ceffd663e6..37f445612b 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -684,6 +684,7 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
_ecore_evas_ews_alpha_set,
_ecore_evas_ews_transparent_set,
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_extn.c b/src/lib/ecore_evas/ecore_evas_extn.c
index 61840723c7..41bdb665e3 100644
--- a/src/lib/ecore_evas/ecore_evas_extn.c
+++ b/src/lib/ecore_evas/ecore_evas_extn.c
@@ -189,6 +189,8 @@ enum // opcodes
OP_UPDATE_DONE,
OP_LOCK_FILE,
OP_SHM_REF,
+ OP_PROFILE_CHANGE_REQUEST,
+ OP_PROFILE_CHANGE_DONE,
OP_EV_MOUSE_IN,
OP_EV_MOUSE_OUT,
OP_EV_MOUSE_UP,
@@ -218,6 +220,7 @@ enum
typedef struct _Ipc_Data_Resize Ipc_Data_Resize;
typedef struct _Ipc_Data_Update Ipc_Data_Update;
+typedef struct _Ipc_Data_Profile Ipc_Data_Profile;
typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In;
typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out;
typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up;
@@ -241,6 +244,11 @@ struct _Ipc_Data_Update
int x, w, y, h;
};
+struct _Ipc_Data_Profile
+{
+ const char *name;
+};
+
struct _Ipc_Data_Ev_Mouse_In
{
unsigned int timestamp;
@@ -368,6 +376,9 @@ struct _Extn
Eina_Bool have_lock : 1;
Eina_Bool have_real_lock : 1;
} file;
+ struct {
+ Eina_Bool done : 1; /* need to send change done event to the client(plug) */
+ } profile;
};
static Eina_List *extn_ee_list = NULL;
@@ -1136,6 +1147,49 @@ _ecore_evas_extn_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
}
+static void
+_ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile)
+{
+ Extn *extn;
+
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = NULL;
+
+ extn = ee->engine.buffer.data;
+ if (!extn) return;
+
+ if (profile)
+ {
+ ee->prop.profile.name = (char *)eina_stringshare_add(profile);
+ if (extn->ipc.server)
+ {
+ Ipc_Data_Profile *ipc;
+ char *st, *p;
+ int len = 0;
+
+ len += sizeof(Ipc_Data_Profile);
+ len += strlen(ee->prop.profile.name) + 1;
+ len += 1;
+
+ st = alloca(len);
+ ipc = (Ipc_Data_Profile *)st;
+ memset(st, 0, len);
+ p = st + sizeof(Ipc_Data_Profile);
+
+ strcpy(p, ee->prop.profile.name);
+ ipc->name = p - (long)st;
+ p += strlen(p) + 1;
+
+ /* send window profile change request to the server(socket)
+ * and wait for profile change done from the server
+ */
+ ecore_ipc_server_send(extn->ipc.server, MAJOR,
+ OP_PROFILE_CHANGE_REQUEST,
+ 0, 0, 0, ipc, len);
+ }
+ }
+}
+
static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
{
_ecore_evas_extn_free,
@@ -1185,6 +1239,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
NULL,
NULL, //transparent
NULL, // profiles_set
+ _ecore_evas_extn_plug_profile_set,
NULL,
NULL,
NULL,
@@ -1363,6 +1418,10 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
_ecore_evas_resize(ee, ipc->w, ipc->h);
}
break;
+ case OP_PROFILE_CHANGE_DONE:
+ /* profile change finished being sent - done now. */
+ /* do something here */
+ break;
default:
break;
}
@@ -1414,6 +1473,7 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
ee->h = h;
ee->req.w = ee->w;
ee->req.h = ee->h;
+ ee->profile_supported = 1;
ee->prop.max.w = 0;
ee->prop.max.h = 0;
@@ -1657,6 +1717,40 @@ _ecore_evas_socket_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNU
_ecore_evas_socket_resize(ee, w, h);
}
+static void
+_ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee)
+{
+ Extn *extn;
+ Ecore_Ipc_Client *client;
+ Eina_List *l = NULL;
+ Ipc_Data_Profile *ipc;
+ char *st, *p;
+ int len = 0;
+
+ extn = ee->engine.buffer.data;
+ if (!extn) return;
+
+ len += sizeof(Ipc_Data_Profile);
+ len += strlen(ee->prop.profile.name) + 1;
+ len += 1;
+
+ st = alloca(len);
+ ipc = (Ipc_Data_Profile *)st;
+ memset(st, 0, len);
+ p = st + sizeof(Ipc_Data_Profile);
+
+ strcpy(p, ee->prop.profile.name);
+ ipc->name = p - (long)st;
+ p += strlen(p) + 1;
+
+ EINA_LIST_FOREACH(extn->ipc.clients, l, client)
+ {
+ ecore_ipc_client_send(client, MAJOR,
+ OP_PROFILE_CHANGE_DONE,
+ 0, 0, 0, ipc, len);
+ }
+}
+
int
_ecore_evas_extn_socket_render(Ecore_Evas *ee)
{
@@ -1702,6 +1796,11 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
_ecore_evas_idle_timeout_update(ee);
EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0);
+ if (extn->profile.done)
+ {
+ _ecore_evas_extn_socket_window_profile_change_done_send(ee);
+ extn->profile.done = EINA_FALSE;
+ }
}
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
@@ -1995,6 +2094,27 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
evas_event_default_flags_set(ee->evas, flags);
}
break;
+ case OP_PROFILE_CHANGE_REQUEST:
+ if (e->size >= (int)sizeof(Ipc_Data_Profile))
+ {
+ if ((e->data) && (e->size > 0) &&
+ (((unsigned char *)e->data)[e->size - 1] == 0))
+ {
+ Ipc_Data_Profile *ipc = e->data;
+ STRGET(name);
+ if (ipc->name)
+ {
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = (char *)eina_stringshare_add(ipc->name);
+
+ if (ee->func.fn_state_change)
+ ee->func.fn_state_change(ee);
+
+ extn->profile.done = EINA_TRUE;
+ }
+ }
+ }
+ break;
default:
break;
}
@@ -2034,6 +2154,43 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
}
}
+static void
+_ecore_evas_extn_socket_profile_set(Ecore_Evas *ee, const char *profile)
+{
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = NULL;
+
+ if (profile)
+ {
+ ee->prop.profile.name = (char *)eina_stringshare_add(profile);
+
+ if (ee->func.fn_state_change)
+ ee->func.fn_state_change(ee);
+ }
+}
+
+static void
+_ecore_evas_extn_socket_available_profiles_set(Ecore_Evas *ee, const char **plist, int n)
+{
+ int i;
+ _ecore_evas_window_available_profiles_free(ee);
+ ee->prop.profile.available_list = NULL;
+
+ if ((plist) && (n >= 1))
+ {
+ ee->prop.profile.available_list = calloc(n, sizeof(char *));
+ if (ee->prop.profile.available_list)
+ {
+ for (i = 0; i < n; i++)
+ ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
+ ee->prop.profile.count = n;
+
+ if (ee->func.fn_state_change)
+ ee->func.fn_state_change(ee);
+ }
+ }
+}
+
static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
{
_ecore_evas_extn_free,
@@ -2082,7 +2239,8 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
NULL,
_ecore_evas_extn_socket_alpha_set,
NULL, //transparent
- NULL, // profiles_set
+ _ecore_evas_extn_socket_available_profiles_set,
+ _ecore_evas_extn_socket_profile_set,
NULL,
NULL,
@@ -2123,6 +2281,7 @@ ecore_evas_extn_socket_new(int w, int h)
ee->h = h;
ee->req.w = ee->w;
ee->req.h = ee->h;
+ ee->profile_supported = 1; /* to accept the profile change request from the client(plug) */
ee->prop.max.w = 0;
ee->prop.max.h = 0;
diff --git a/src/lib/ecore_evas/ecore_evas_fb.c b/src/lib/ecore_evas/ecore_evas_fb.c
index 0f98e62d06..8b36e8b825 100644
--- a/src/lib/ecore_evas/ecore_evas_fb.c
+++ b/src/lib/ecore_evas/ecore_evas_fb.c
@@ -552,6 +552,7 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
NULL,
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 0c7b03043d..2d9cb016b8 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -163,7 +163,8 @@ struct _Ecore_Evas_Engine_Func
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
- void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles);
+ void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int count);
+ void (*fn_profile_set) (Ecore_Evas *ee, const char *profile);
void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
@@ -218,6 +219,11 @@ struct _Ecore_Evas_Engine
unsigned char above : 1;
unsigned char below : 1;
} state;
+ struct {
+ unsigned char available : 1; // need to setup available profiles in a window
+ unsigned char change : 1; // need to send change event to the WM
+ unsigned char done : 1; // need to send change done event to the WM
+ } profile;
Ecore_X_Window win_shaped_input;
} x;
#endif
@@ -310,7 +316,11 @@ struct _Ecore_Evas
char *title;
char *name;
char *clas;
- char *profile;
+ struct {
+ char *name;
+ char **available_list;
+ int count;
+ } profile;
struct {
int w, h;
} min,
@@ -378,6 +388,7 @@ struct _Ecore_Evas
unsigned char semi_sync : 1;
unsigned char deleted : 1;
int gl_sync_draw_done; // added by gl77.lee
+ unsigned char profile_supported : 1;
};
void _ecore_evas_ref(Ecore_Evas *ee);
@@ -487,4 +498,18 @@ extern Eina_Bool _ecore_evas_app_comp_sync;
void _ecore_evas_extn_init(void);
void _ecore_evas_extn_shutdown(void);
+/**
+ * @brief Free the string of the window profile.
+ *
+ * This is a helper function to free window profile.
+ */
+void _ecore_evas_window_profile_free(Ecore_Evas *ee);
+
+/**
+ * @brief Free the string array of available window profiles.
+ *
+ * This is a helper function to free available window profiles.
+ */
+void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
+
#endif
diff --git a/src/lib/ecore_evas/ecore_evas_psl1ght.c b/src/lib/ecore_evas/ecore_evas_psl1ght.c
index 35252a3703..c9f62e4702 100644
--- a/src/lib/ecore_evas/ecore_evas_psl1ght.c
+++ b/src/lib/ecore_evas/ecore_evas_psl1ght.c
@@ -396,6 +396,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
NULL,
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_sdl.c b/src/lib/ecore_evas/ecore_evas_sdl.c
index 90b348ef2c..e609b1a60f 100644
--- a/src/lib/ecore_evas/ecore_evas_sdl.c
+++ b/src/lib/ecore_evas/ecore_evas_sdl.c
@@ -438,6 +438,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
NULL,
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index ed176e8b6e..61d0f89e35 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -85,6 +85,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
_ecore_evas_wl_alpha_set,
_ecore_evas_wl_transparent_set,
NULL, // func profiles set
+ NULL, // func profile set
NULL, // window group set
NULL, // aspect set
NULL, // urgent set
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index 24e349534a..470ac6ddda 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -101,6 +101,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
_ecore_evas_wl_alpha_set,
_ecore_evas_wl_transparent_set,
NULL, // func profiles set
+ NULL, // func profile set
NULL, // window group set
NULL, // aspect set
NULL, // urgent set
diff --git a/src/lib/ecore_evas/ecore_evas_win32.c b/src/lib/ecore_evas/ecore_evas_win32.c
index 32ecc46de4..4a2eff7f4f 100644
--- a/src/lib/ecore_evas/ecore_evas_win32.c
+++ b/src/lib/ecore_evas/ecore_evas_win32.c
@@ -1111,6 +1111,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
_ecore_evas_win32_alpha_set,
NULL, //transparent
NULL, // profiles_set
+ NULL, // profile_set
NULL,
NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c
index d94f055319..4608d56860 100644
--- a/src/lib/ecore_evas/ecore_evas_x.c
+++ b/src/lib/ecore_evas/ecore_evas_x.c
@@ -133,6 +133,63 @@ _ecore_evas_x_sync_clear(Ecore_Evas *ee)
ee->engine.x.sync_counter = 0;
}
+static void
+_ecore_evas_x_window_profile_protocol_set(Ecore_Evas *ee)
+{
+ /* check and set profile protocol hint */
+ if (ecore_x_e_window_profile_supported_get(ee->engine.x.win_root))
+ {
+ unsigned int v = 1;
+ ecore_x_window_prop_card32_set
+ (ee->prop.window,
+ ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
+ &v, 1);
+
+ ee->profile_supported = 1;
+ }
+ else
+ ee->profile_supported = 0;
+}
+
+static void
+_ecore_evas_x_window_profile_set(Ecore_Evas *ee)
+{
+ if (((ee->should_be_visible) || (ee->visible)) &&
+ (ee->profile_supported))
+ {
+ if (ee->engine.x.profile.available)
+ {
+ ecore_x_e_window_available_profiles_set
+ (ee->prop.window,
+ (const char **)ee->prop.profile.available_list,
+ (const int)ee->prop.profile.count);
+
+ ee->engine.x.profile.available = 0;
+ }
+
+ if (ee->engine.x.profile.change)
+ {
+ if (ee->prop.profile.name)
+ {
+ /* We need to keep the profile as an x property to let the WM.
+ * Then the WM reads it when creating the border window.
+ */
+ Ecore_X_Atom a = ecore_x_atom_get(ee->prop.profile.name);
+ ecore_x_window_prop_atom_set
+ (ee->prop.window,
+ ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE,
+ &a, 1);
+
+ ecore_x_e_window_profile_change_send
+ (ee->engine.x.win_root,
+ ee->prop.window,
+ ee->prop.profile.name);
+ }
+ ee->engine.x.profile.change = 0;
+ }
+ }
+}
+
# ifdef BUILD_ECORE_EVAS_OPENGL_X11
static Ecore_X_Window
_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override, int argb, const int *opt)
@@ -650,34 +707,6 @@ _ecore_evas_x_event_property_change(void *data EINA_UNUSED, int type EINA_UNUSED
break;
}
}
- else if (e->atom == ECORE_X_ATOM_E_PROFILE)
- {
- char *p = ecore_x_e_window_profile_get(e->win);
- if ((p) && (ee->prop.profile))
- {
- if (strcmp(p, ee->prop.profile) != 0)
- {
- free(ee->prop.profile);
- ee->prop.profile = strdup(p);
- state_change = 1;
- }
- }
- else if ((!p) && (ee->prop.profile))
- {
- free(ee->prop.profile);
- ee->prop.profile = NULL;
- state_change = 1;
- }
- else if ((p) && (!ee->prop.profile))
- {
- ee->prop.profile = strdup(p);
- state_change = 1;
- }
-
- if (p)
- free(p);
- }
-
if (state_change)
{
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
@@ -757,6 +786,29 @@ _ecore_evas_x_event_client_message(void *data EINA_UNUSED, int type EINA_UNUSED,
ee->engine.x.netwm_sync_val_hi = (int)e->data.l[3];
ee->engine.x.netwm_sync_set = 1;
}
+ else if ((e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST))
+ {
+ ee = ecore_event_window_match(e->win);
+ if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
+ if (ee->profile_supported)
+ {
+ char *p = ecore_x_atom_name_get(e->data.l[1]);
+ if (p)
+ {
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = (char *)eina_stringshare_add(p);
+
+ /* window profiles of each sub_ecore_evas will be changed
+ * in fn_state_change callback.
+ */
+ if (ee->func.fn_state_change)
+ ee->func.fn_state_change(ee);
+
+ ee->engine.x.profile.done = 1;
+ free(p);
+ }
+ }
+ }
return ECORE_CALLBACK_PASS_ON;
}
@@ -1879,6 +1931,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
+ _ecore_evas_x_window_profile_protocol_set(ee);
_ecore_evas_x_sync_set(ee);
_ecore_evas_x_size_pos_hints_update(ee);
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
@@ -1999,6 +2052,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
+ _ecore_evas_x_window_profile_protocol_set(ee);
_ecore_evas_x_sync_set(ee);
_ecore_evas_x_size_pos_hints_update(ee);
#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
@@ -2128,6 +2182,7 @@ _ecore_evas_x_show(Ecore_Evas *ee)
if (ee->prop.avoid_damage)
_ecore_evas_x_render(ee);
_ecore_evas_x_sync_set(ee);
+ _ecore_evas_x_window_profile_set(ee);
ecore_x_window_show(ee->prop.window);
if (ee->prop.fullscreen)
ecore_x_window_focus(ee->prop.window);
@@ -2436,10 +2491,36 @@ _ecore_evas_x_fullscreen_set(Ecore_Evas *ee, int on)
}
static void
+_ecore_evas_x_profile_set(Ecore_Evas *ee, const char *profile)
+{
+ _ecore_evas_window_profile_free(ee);
+ ee->prop.profile.name = NULL;
+
+ if (profile)
+ ee->prop.profile.name = (char *)eina_stringshare_add(profile);
+ ee->engine.x.profile.change = 1;
+ _ecore_evas_x_window_profile_set(ee);
+}
+
+static void
_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n)
{
- /* Ecore_Evas's profile will be updated when WM sets the E_PROFILE. */
- ecore_x_e_window_profile_list_set(ee->prop.window, plist, n);
+ int i;
+ _ecore_evas_window_available_profiles_free(ee);
+ ee->prop.profile.available_list = NULL;
+
+ if ((plist) && (n >= 1))
+ {
+ ee->prop.profile.available_list = calloc(n, sizeof(char *));
+ if (ee->prop.profile.available_list)
+ {
+ for (i = 0; i < n; i++)
+ ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
+ ee->prop.profile.count = n;
+ }
+ }
+ ee->engine.x.profile.available = 1;
+ _ecore_evas_x_window_profile_set(ee);
}
static void
@@ -2648,6 +2729,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
_ecore_evas_x_alpha_set,
_ecore_evas_x_transparent_set,
_ecore_evas_x_profiles_set,
+ _ecore_evas_x_profile_set,
_ecore_evas_x_window_group_set,
_ecore_evas_x_aspect_set,
@@ -2717,6 +2799,12 @@ _ecore_evas_x_flush_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_
ee->engine.x.netwm_sync_val_lo);
ee->engine.x.netwm_sync_set = 0;
}
+ if (ee->engine.x.profile.done)
+ {
+ ecore_x_e_window_profile_change_done_send
+ (ee->engine.x.win_root, ee->prop.window,ee->prop.profile.name);
+ ee->engine.x.profile.done = 0;
+ }
}
#endif
@@ -2898,6 +2986,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
+ _ecore_evas_x_window_profile_protocol_set(ee);
_ecore_evas_x_sync_set(ee);
ee->engine.func->fn_render = _ecore_evas_x_render;
@@ -3147,6 +3236,7 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent,
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
+ _ecore_evas_x_window_profile_protocol_set(ee);
_ecore_evas_x_sync_set(ee);
ee->engine.func->fn_render = _ecore_evas_x_render;