summaryrefslogtreecommitdiff
path: root/src
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
parent25ea899dfae39b155f7f0f2b7cafc456cfd1f1d8 (diff)
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 '')
-rw-r--r--src/lib/ecore/Ecore.h1
-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
-rw-r--r--src/lib/ecore_x/Ecore_X.h112
-rw-r--r--src/lib/ecore_x/Ecore_X_Atoms.h8
-rw-r--r--src/lib/ecore_x/ecore_x_atoms_decl.h21
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_e.c281
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_e.c257
21 files changed, 1167 insertions, 53 deletions
diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h
index 5a02211526..f73bcae3fe 100644
--- a/src/lib/ecore/Ecore.h
+++ b/src/lib/ecore/Ecore.h
@@ -122,6 +122,7 @@ sudo make install
122 @author Haifeng Deng <haifeng.deng@samsung.com> 122 @author Haifeng Deng <haifeng.deng@samsung.com>
123 @author Jérémy Zurcher <jeremy@asynk.ch> 123 @author Jérémy Zurcher <jeremy@asynk.ch>
124 @author Vikram Narayanan <vikram186@gmail.com> 124 @author Vikram Narayanan <vikram186@gmail.com>
125 @author Gwanglim Lee <gl77.lee@samsung.com> <gwanglim@gmail.com>
125 126
126 Please contact <enlightenment-devel@lists.sourceforge.net> to get in 127 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
127 contact with the developers and maintainers. 128 contact with the developers and maintainers.
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);
662 */ 662 */
663EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee); 663EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee);
664/** 664/**
665 * @brief Query if the underlying windowing system supports the window profile.
666 *
667 * @param ee The Ecore_Evas
668 * @return @c EINA_TRUE if the window profile is supported, @c EINA_FALSE otherwise.
669 *
670 * @warning Support for this depends on the underlying windowing system.
671 * @since 1.8.0
672 */
673EAPI Eina_Bool ecore_evas_window_profile_supported_get(const Ecore_Evas *ee);
674/**
675 * @brief Set the window profile
676 *
677 * @param ee The Ecore_Evas to set
678 * @param profile The string value of the window profile
679 *
680 * @warning Support for this depends on the underlying windowing system.
681 * @since 1.8.0
682 */
683EAPI void ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile);
684/**
685 * @brief Get the window profile
686 *
687 * @param ee The Ecore_Evas to get the window profile from.
688 * @return The string value of the window profile, or NULL if none exists
689 *
690 * @warning Support for this depends on the underlying windowing system.
691 * @since 1.8.0
692 */
693EAPI const char *ecore_evas_window_profile_get(const Ecore_Evas *ee);
694/**
695 * @brief Set the array of available window profiles
696 *
697 * @param ee The Ecore_Evas to set
698 * @param profiles The string array of available window profiels
699 * @param count The number of members in profiles
700 *
701 * @warning Support for this depends on the underlying windowing system.
702 * @since 1.8.0
703 */
704EAPI void ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count);
705/**
706 * @brief Get the array of available window profiles
707 *
708 * @param ee The Ecore_Evas to get available window profiles from.
709 * @param profiles Where to return the string array of available window profiles
710 * @param count Where to return the number of members in profiles
711 * @return EINA_TRUE if available window profiles exist, EINA_FALSE otherwise
712 *
713 * @warning Support for this depends on the underlying windowing system.
714 * @since 1.8.0
715 */
716EAPI Eina_Bool ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count);
717/**
665 * @brief Move an Ecore_Evas. 718 * @brief Move an Ecore_Evas.
666 * 719 *
667 * @param ee The Ecore_Evas to move 720 * @param ee The Ecore_Evas to move
@@ -1886,6 +1939,13 @@ EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Get
1886 * just deleting the list. 1939 * just deleting the list.
1887 */ 1940 */
1888EAPI Eina_List *ecore_evas_ecore_evas_list_get(void); 1941EAPI Eina_List *ecore_evas_ecore_evas_list_get(void);
1942/**
1943 * @brief Get a list of all the sub ecore_evases.
1944 *
1945 * @param ee Ecore_Evas to get the list from.
1946 * @return A list of sub ecore_evases, or @c NULL if there is no sub ecore_evases.
1947 */
1948EAPI Eina_List *ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee);
1889 1949
1890/* specific calls to an x11 environment ecore_evas */ 1950/* specific calls to an x11 environment ecore_evas */
1891EAPI void ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win); 1951EAPI 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)
1859 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE; 1859 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
1860} 1860}
1861 1861
1862EAPI Eina_Bool
1863ecore_evas_window_profile_supported_get(const Ecore_Evas *ee)
1864{
1865 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1866 {
1867 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1868 "ecore_evas_window_profile_supported_get");
1869 return EINA_FALSE;
1870 }
1871 return ee->profile_supported ? EINA_TRUE : EINA_FALSE;
1872}
1873
1874EAPI void
1875ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile)
1876{
1877 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1878 {
1879 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1880 "ecore_evas_window_profile_set");
1881 return;
1882 }
1883 IFC(ee, fn_profile_set) (ee, profile);
1884 IFE;
1885}
1886
1887EAPI const char *
1888ecore_evas_window_profile_get(const Ecore_Evas *ee)
1889{
1890 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1891 {
1892 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1893 "ecore_evas_window_profile_get");
1894 return NULL;
1895 }
1896 return ee->prop.profile.name;
1897}
1898
1899EAPI void
1900ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count)
1901{
1902 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1903 {
1904 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1905 "ecore_evas_window_available_profiles_set");
1906 return;
1907 }
1908 IFC(ee, fn_profiles_set) (ee, profiles, count);
1909 IFE;
1910}
1911
1912EAPI Eina_Bool
1913ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count)
1914{
1915 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1916 {
1917 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1918 "ecore_evas_window_available_profiles_get");
1919 return EINA_FALSE;
1920 }
1921
1922 if ((ee->prop.profile.available_list) &&
1923 (ee->prop.profile.count >= 1))
1924 {
1925 if (profiles) *profiles = ee->prop.profile.available_list;
1926 if (count) *count = ee->prop.profile.count;
1927 return EINA_TRUE;
1928 }
1929 else
1930 return EINA_FALSE;
1931}
1932
1862EAPI void 1933EAPI void
1863ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on) 1934ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1864{ 1935{
@@ -2433,6 +2504,10 @@ _ecore_evas_free(Ecore_Evas *ee)
2433 ee->prop.name = NULL; 2504 ee->prop.name = NULL;
2434 if (ee->prop.clas) free(ee->prop.clas); 2505 if (ee->prop.clas) free(ee->prop.clas);
2435 ee->prop.clas = NULL; 2506 ee->prop.clas = NULL;
2507 _ecore_evas_window_profile_free(ee);
2508 ee->prop.profile.name = NULL;
2509 _ecore_evas_window_available_profiles_free(ee);
2510 ee->prop.profile.available_list = NULL;
2436 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); 2511 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2437 ee->prop.cursor.object = NULL; 2512 ee->prop.cursor.object = NULL;
2438 if (ee->evas) evas_free(ee->evas); 2513 if (ee->evas) evas_free(ee->evas);
@@ -2662,6 +2737,31 @@ _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2662 flags, timestamp, NULL); 2737 flags, timestamp, NULL);
2663} 2738}
2664 2739
2740void
2741_ecore_evas_window_profile_free(Ecore_Evas *ee)
2742{
2743 if (ee->prop.profile.name)
2744 eina_stringshare_del(ee->prop.profile.name);
2745}
2746
2747void
2748_ecore_evas_window_available_profiles_free(Ecore_Evas *ee)
2749{
2750 if (ee->prop.profile.available_list)
2751 {
2752 int i;
2753 for (i = 0; i < ee->prop.profile.count; i++)
2754 {
2755 if (ee->prop.profile.available_list[i])
2756 {
2757 eina_stringshare_del(ee->prop.profile.available_list[i]);
2758 ee->prop.profile.available_list[i] = NULL;
2759 }
2760 }
2761 free(ee->prop.profile.available_list);
2762 }
2763}
2764
2665EAPI Eina_List * 2765EAPI Eina_List *
2666ecore_evas_ecore_evas_list_get(void) 2766ecore_evas_ecore_evas_list_get(void)
2667{ 2767{
@@ -2676,6 +2776,18 @@ ecore_evas_ecore_evas_list_get(void)
2676 return l; 2776 return l;
2677} 2777}
2678 2778
2779EAPI Eina_List *
2780ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee)
2781{
2782 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2783 {
2784 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2785 "ecore_evas_sub_ecore_evas_list_get");
2786 return NULL;
2787 }
2788 return ee->sub_ecore_evas;
2789}
2790
2679EAPI void 2791EAPI void
2680ecore_evas_input_event_register(Ecore_Evas *ee) 2792ecore_evas_input_event_register(Ecore_Evas *ee)
2681{ 2793{
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)
467 } 467 }
468} 468}
469 469
470static void
471_ecore_evas_buffer_profile_set(Ecore_Evas *ee, const char *profile)
472{
473 _ecore_evas_window_profile_free(ee);
474 ee->prop.profile.name = NULL;
475
476 if (profile)
477 {
478 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
479
480 /* just change ee's state.*/
481 if (ee->func.fn_state_change)
482 ee->func.fn_state_change(ee);
483 }
484}
485
470static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = 486static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
471{ 487{
472 _ecore_evas_buffer_free, 488 _ecore_evas_buffer_free,
@@ -516,6 +532,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
516 _ecore_evas_buffer_alpha_set, 532 _ecore_evas_buffer_alpha_set,
517 NULL, //transparent 533 NULL, //transparent
518 NULL, // profiles_set 534 NULL, // profiles_set
535 _ecore_evas_buffer_profile_set,
519 536
520 NULL, 537 NULL,
521 NULL, 538 NULL,
@@ -583,6 +600,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
583 ee->h = h; 600 ee->h = h;
584 ee->req.w = ee->w; 601 ee->req.w = ee->w;
585 ee->req.h = ee->h; 602 ee->req.h = ee->h;
603 ee->profile_supported = 1;
586 604
587 ee->prop.max.w = 0; 605 ee->prop.max.w = 0;
588 ee->prop.max.h = 0; 606 ee->prop.max.h = 0;
@@ -722,6 +740,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
722 ee->h = h; 740 ee->h = h;
723 ee->req.w = ee->w; 741 ee->req.w = ee->w;
724 ee->req.h = ee->h; 742 ee->req.h = ee->h;
743 ee->profile_supported = 1;
725 744
726 ee->prop.max.w = 0; 745 ee->prop.max.w = 0;
727 ee->prop.max.h = 0; 746 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 =
464 NULL, 464 NULL,
465 NULL, //transparent 465 NULL, //transparent
466 NULL, // profiles_set 466 NULL, // profiles_set
467 NULL, // profile_set
467 468
468 NULL, 469 NULL,
469 NULL, 470 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 =
490 NULL, /* alpha */ 490 NULL, /* alpha */
491 NULL, //transparent 491 NULL, //transparent
492 NULL, // profiles_set 492 NULL, // profiles_set
493 NULL, // profile_set
493 494
494 NULL, 495 NULL,
495 NULL, 496 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 =
684 _ecore_evas_ews_alpha_set, 684 _ecore_evas_ews_alpha_set,
685 _ecore_evas_ews_transparent_set, 685 _ecore_evas_ews_transparent_set,
686 NULL, // profiles_set 686 NULL, // profiles_set
687 NULL, // profile_set
687 688
688 NULL, 689 NULL,
689 NULL, 690 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
189 OP_UPDATE_DONE, 189 OP_UPDATE_DONE,
190 OP_LOCK_FILE, 190 OP_LOCK_FILE,
191 OP_SHM_REF, 191 OP_SHM_REF,
192 OP_PROFILE_CHANGE_REQUEST,
193 OP_PROFILE_CHANGE_DONE,
192 OP_EV_MOUSE_IN, 194 OP_EV_MOUSE_IN,
193 OP_EV_MOUSE_OUT, 195 OP_EV_MOUSE_OUT,
194 OP_EV_MOUSE_UP, 196 OP_EV_MOUSE_UP,
@@ -218,6 +220,7 @@ enum
218 220
219typedef struct _Ipc_Data_Resize Ipc_Data_Resize; 221typedef struct _Ipc_Data_Resize Ipc_Data_Resize;
220typedef struct _Ipc_Data_Update Ipc_Data_Update; 222typedef struct _Ipc_Data_Update Ipc_Data_Update;
223typedef struct _Ipc_Data_Profile Ipc_Data_Profile;
221typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In; 224typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In;
222typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out; 225typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out;
223typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up; 226typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up;
@@ -241,6 +244,11 @@ struct _Ipc_Data_Update
241 int x, w, y, h; 244 int x, w, y, h;
242}; 245};
243 246
247struct _Ipc_Data_Profile
248{
249 const char *name;
250};
251
244struct _Ipc_Data_Ev_Mouse_In 252struct _Ipc_Data_Ev_Mouse_In
245{ 253{
246 unsigned int timestamp; 254 unsigned int timestamp;
@@ -368,6 +376,9 @@ struct _Extn
368 Eina_Bool have_lock : 1; 376 Eina_Bool have_lock : 1;
369 Eina_Bool have_real_lock : 1; 377 Eina_Bool have_real_lock : 1;
370 } file; 378 } file;
379 struct {
380 Eina_Bool done : 1; /* need to send change done event to the client(plug) */
381 } profile;
371}; 382};
372 383
373static Eina_List *extn_ee_list = NULL; 384static 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_
1136 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0); 1147 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
1137} 1148}
1138 1149
1150static void
1151_ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile)
1152{
1153 Extn *extn;
1154
1155 _ecore_evas_window_profile_free(ee);
1156 ee->prop.profile.name = NULL;
1157
1158 extn = ee->engine.buffer.data;
1159 if (!extn) return;
1160
1161 if (profile)
1162 {
1163 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
1164 if (extn->ipc.server)
1165 {
1166 Ipc_Data_Profile *ipc;
1167 char *st, *p;
1168 int len = 0;
1169
1170 len += sizeof(Ipc_Data_Profile);
1171 len += strlen(ee->prop.profile.name) + 1;
1172 len += 1;
1173
1174 st = alloca(len);
1175 ipc = (Ipc_Data_Profile *)st;
1176 memset(st, 0, len);
1177 p = st + sizeof(Ipc_Data_Profile);
1178
1179 strcpy(p, ee->prop.profile.name);
1180 ipc->name = p - (long)st;
1181 p += strlen(p) + 1;
1182
1183 /* send window profile change request to the server(socket)
1184 * and wait for profile change done from the server
1185 */
1186 ecore_ipc_server_send(extn->ipc.server, MAJOR,
1187 OP_PROFILE_CHANGE_REQUEST,
1188 0, 0, 0, ipc, len);
1189 }
1190 }
1191}
1192
1139static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func = 1193static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
1140{ 1194{
1141 _ecore_evas_extn_free, 1195 _ecore_evas_extn_free,
@@ -1185,6 +1239,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
1185 NULL, 1239 NULL,
1186 NULL, //transparent 1240 NULL, //transparent
1187 NULL, // profiles_set 1241 NULL, // profiles_set
1242 _ecore_evas_extn_plug_profile_set,
1188 NULL, 1243 NULL,
1189 NULL, 1244 NULL,
1190 NULL, 1245 NULL,
@@ -1363,6 +1418,10 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
1363 _ecore_evas_resize(ee, ipc->w, ipc->h); 1418 _ecore_evas_resize(ee, ipc->w, ipc->h);
1364 } 1419 }
1365 break; 1420 break;
1421 case OP_PROFILE_CHANGE_DONE:
1422 /* profile change finished being sent - done now. */
1423 /* do something here */
1424 break;
1366 default: 1425 default:
1367 break; 1426 break;
1368 } 1427 }
@@ -1414,6 +1473,7 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
1414 ee->h = h; 1473 ee->h = h;
1415 ee->req.w = ee->w; 1474 ee->req.w = ee->w;
1416 ee->req.h = ee->h; 1475 ee->req.h = ee->h;
1476 ee->profile_supported = 1;
1417 1477
1418 ee->prop.max.w = 0; 1478 ee->prop.max.w = 0;
1419 ee->prop.max.h = 0; 1479 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
1657 _ecore_evas_socket_resize(ee, w, h); 1717 _ecore_evas_socket_resize(ee, w, h);
1658} 1718}
1659 1719
1720static void
1721_ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee)
1722{
1723 Extn *extn;
1724 Ecore_Ipc_Client *client;
1725 Eina_List *l = NULL;
1726 Ipc_Data_Profile *ipc;
1727 char *st, *p;
1728 int len = 0;
1729
1730 extn = ee->engine.buffer.data;
1731 if (!extn) return;
1732
1733 len += sizeof(Ipc_Data_Profile);
1734 len += strlen(ee->prop.profile.name) + 1;
1735 len += 1;
1736
1737 st = alloca(len);
1738 ipc = (Ipc_Data_Profile *)st;
1739 memset(st, 0, len);
1740 p = st + sizeof(Ipc_Data_Profile);
1741
1742 strcpy(p, ee->prop.profile.name);
1743 ipc->name = p - (long)st;
1744 p += strlen(p) + 1;
1745
1746 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1747 {
1748 ecore_ipc_client_send(client, MAJOR,
1749 OP_PROFILE_CHANGE_DONE,
1750 0, 0, 0, ipc, len);
1751 }
1752}
1753
1660int 1754int
1661_ecore_evas_extn_socket_render(Ecore_Evas *ee) 1755_ecore_evas_extn_socket_render(Ecore_Evas *ee)
1662{ 1756{
@@ -1702,6 +1796,11 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
1702 _ecore_evas_idle_timeout_update(ee); 1796 _ecore_evas_idle_timeout_update(ee);
1703 EINA_LIST_FOREACH(extn->ipc.clients, ll, client) 1797 EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
1704 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0); 1798 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0);
1799 if (extn->profile.done)
1800 {
1801 _ecore_evas_extn_socket_window_profile_change_done_send(ee);
1802 extn->profile.done = EINA_FALSE;
1803 }
1705 } 1804 }
1706 1805
1707 if (ee->func.fn_post_render) ee->func.fn_post_render(ee); 1806 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)
1995 evas_event_default_flags_set(ee->evas, flags); 2094 evas_event_default_flags_set(ee->evas, flags);
1996 } 2095 }
1997 break; 2096 break;
2097 case OP_PROFILE_CHANGE_REQUEST:
2098 if (e->size >= (int)sizeof(Ipc_Data_Profile))
2099 {
2100 if ((e->data) && (e->size > 0) &&
2101 (((unsigned char *)e->data)[e->size - 1] == 0))
2102 {
2103 Ipc_Data_Profile *ipc = e->data;
2104 STRGET(name);
2105 if (ipc->name)
2106 {
2107 _ecore_evas_window_profile_free(ee);
2108 ee->prop.profile.name = (char *)eina_stringshare_add(ipc->name);
2109
2110 if (ee->func.fn_state_change)
2111 ee->func.fn_state_change(ee);
2112
2113 extn->profile.done = EINA_TRUE;
2114 }
2115 }
2116 }
2117 break;
1998 default: 2118 default:
1999 break; 2119 break;
2000 } 2120 }
@@ -2034,6 +2154,43 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
2034 } 2154 }
2035} 2155}
2036 2156
2157static void
2158_ecore_evas_extn_socket_profile_set(Ecore_Evas *ee, const char *profile)
2159{
2160 _ecore_evas_window_profile_free(ee);
2161 ee->prop.profile.name = NULL;
2162
2163 if (profile)
2164 {
2165 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
2166
2167 if (ee->func.fn_state_change)
2168 ee->func.fn_state_change(ee);
2169 }
2170}
2171
2172static void
2173_ecore_evas_extn_socket_available_profiles_set(Ecore_Evas *ee, const char **plist, int n)
2174{
2175 int i;
2176 _ecore_evas_window_available_profiles_free(ee);
2177 ee->prop.profile.available_list = NULL;
2178
2179 if ((plist) && (n >= 1))
2180 {
2181 ee->prop.profile.available_list = calloc(n, sizeof(char *));
2182 if (ee->prop.profile.available_list)
2183 {
2184 for (i = 0; i < n; i++)
2185 ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
2186 ee->prop.profile.count = n;
2187
2188 if (ee->func.fn_state_change)
2189 ee->func.fn_state_change(ee);
2190 }
2191 }
2192}
2193
2037static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func = 2194static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
2038{ 2195{
2039 _ecore_evas_extn_free, 2196 _ecore_evas_extn_free,
@@ -2082,7 +2239,8 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
2082 NULL, 2239 NULL,
2083 _ecore_evas_extn_socket_alpha_set, 2240 _ecore_evas_extn_socket_alpha_set,
2084 NULL, //transparent 2241 NULL, //transparent
2085 NULL, // profiles_set 2242 _ecore_evas_extn_socket_available_profiles_set,
2243 _ecore_evas_extn_socket_profile_set,
2086 2244
2087 NULL, 2245 NULL,
2088 NULL, 2246 NULL,
@@ -2123,6 +2281,7 @@ ecore_evas_extn_socket_new(int w, int h)
2123 ee->h = h; 2281 ee->h = h;
2124 ee->req.w = ee->w; 2282 ee->req.w = ee->w;
2125 ee->req.h = ee->h; 2283 ee->req.h = ee->h;
2284 ee->profile_supported = 1; /* to accept the profile change request from the client(plug) */
2126 2285
2127 ee->prop.max.w = 0; 2286 ee->prop.max.w = 0;
2128 ee->prop.max.h = 0; 2287 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 =
552 NULL, 552 NULL,
553 NULL, //transparent 553 NULL, //transparent
554 NULL, // profiles_set 554 NULL, // profiles_set
555 NULL, // profile_set
555 556
556 NULL, 557 NULL,
557 NULL, 558 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
163 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore); 163 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
164 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha); 164 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
165 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent); 165 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
166 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles); 166 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int count);
167 void (*fn_profile_set) (Ecore_Evas *ee, const char *profile);
167 168
168 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group); 169 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
169 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect); 170 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
@@ -218,6 +219,11 @@ struct _Ecore_Evas_Engine
218 unsigned char above : 1; 219 unsigned char above : 1;
219 unsigned char below : 1; 220 unsigned char below : 1;
220 } state; 221 } state;
222 struct {
223 unsigned char available : 1; // need to setup available profiles in a window
224 unsigned char change : 1; // need to send change event to the WM
225 unsigned char done : 1; // need to send change done event to the WM
226 } profile;
221 Ecore_X_Window win_shaped_input; 227 Ecore_X_Window win_shaped_input;
222 } x; 228 } x;
223#endif 229#endif
@@ -310,7 +316,11 @@ struct _Ecore_Evas
310 char *title; 316 char *title;
311 char *name; 317 char *name;
312 char *clas; 318 char *clas;
313 char *profile; 319 struct {
320 char *name;
321 char **available_list;
322 int count;
323 } profile;
314 struct { 324 struct {
315 int w, h; 325 int w, h;
316 } min, 326 } min,
@@ -378,6 +388,7 @@ struct _Ecore_Evas
378 unsigned char semi_sync : 1; 388 unsigned char semi_sync : 1;
379 unsigned char deleted : 1; 389 unsigned char deleted : 1;
380 int gl_sync_draw_done; // added by gl77.lee 390 int gl_sync_draw_done; // added by gl77.lee
391 unsigned char profile_supported : 1;
381}; 392};
382 393
383void _ecore_evas_ref(Ecore_Evas *ee); 394void _ecore_evas_ref(Ecore_Evas *ee);
@@ -487,4 +498,18 @@ extern Eina_Bool _ecore_evas_app_comp_sync;
487void _ecore_evas_extn_init(void); 498void _ecore_evas_extn_init(void);
488void _ecore_evas_extn_shutdown(void); 499void _ecore_evas_extn_shutdown(void);
489 500
501/**
502 * @brief Free the string of the window profile.
503 *
504 * This is a helper function to free window profile.
505 */
506void _ecore_evas_window_profile_free(Ecore_Evas *ee);
507
508/**
509 * @brief Free the string array of available window profiles.
510 *
511 * This is a helper function to free available window profiles.
512 */
513void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
514
490#endif 515#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 =
396 NULL, 396 NULL,
397 NULL, //transparent 397 NULL, //transparent
398 NULL, // profiles_set 398 NULL, // profiles_set
399 NULL, // profile_set
399 400
400 NULL, 401 NULL,
401 NULL, 402 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 =
438 NULL, 438 NULL,
439 NULL, //transparent 439 NULL, //transparent
440 NULL, // profiles_set 440 NULL, // profiles_set
441 NULL, // profile_set
441 442
442 NULL, 443 NULL,
443 NULL, 444 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 =
85 _ecore_evas_wl_alpha_set, 85 _ecore_evas_wl_alpha_set,
86 _ecore_evas_wl_transparent_set, 86 _ecore_evas_wl_transparent_set,
87 NULL, // func profiles set 87 NULL, // func profiles set
88 NULL, // func profile set
88 NULL, // window group set 89 NULL, // window group set
89 NULL, // aspect set 90 NULL, // aspect set
90 NULL, // urgent set 91 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 =
101 _ecore_evas_wl_alpha_set, 101 _ecore_evas_wl_alpha_set,
102 _ecore_evas_wl_transparent_set, 102 _ecore_evas_wl_transparent_set,
103 NULL, // func profiles set 103 NULL, // func profiles set
104 NULL, // func profile set
104 NULL, // window group set 105 NULL, // window group set
105 NULL, // aspect set 106 NULL, // aspect set
106 NULL, // urgent set 107 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 =
1111 _ecore_evas_win32_alpha_set, 1111 _ecore_evas_win32_alpha_set,
1112 NULL, //transparent 1112 NULL, //transparent
1113 NULL, // profiles_set 1113 NULL, // profiles_set
1114 NULL, // profile_set
1114 1115
1115 NULL, 1116 NULL,
1116 NULL, 1117 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)
133 ee->engine.x.sync_counter = 0; 133 ee->engine.x.sync_counter = 0;
134} 134}
135 135
136static void
137_ecore_evas_x_window_profile_protocol_set(Ecore_Evas *ee)
138{
139 /* check and set profile protocol hint */
140 if (ecore_x_e_window_profile_supported_get(ee->engine.x.win_root))
141 {
142 unsigned int v = 1;
143 ecore_x_window_prop_card32_set
144 (ee->prop.window,
145 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
146 &v, 1);
147
148 ee->profile_supported = 1;
149 }
150 else
151 ee->profile_supported = 0;
152}
153
154static void
155_ecore_evas_x_window_profile_set(Ecore_Evas *ee)
156{
157 if (((ee->should_be_visible) || (ee->visible)) &&
158 (ee->profile_supported))
159 {
160 if (ee->engine.x.profile.available)
161 {
162 ecore_x_e_window_available_profiles_set
163 (ee->prop.window,
164 (const char **)ee->prop.profile.available_list,
165 (const int)ee->prop.profile.count);
166
167 ee->engine.x.profile.available = 0;
168 }
169
170 if (ee->engine.x.profile.change)
171 {
172 if (ee->prop.profile.name)
173 {
174 /* We need to keep the profile as an x property to let the WM.
175 * Then the WM reads it when creating the border window.
176 */
177 Ecore_X_Atom a = ecore_x_atom_get(ee->prop.profile.name);
178 ecore_x_window_prop_atom_set
179 (ee->prop.window,
180 ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE,
181 &a, 1);
182
183 ecore_x_e_window_profile_change_send
184 (ee->engine.x.win_root,
185 ee->prop.window,
186 ee->prop.profile.name);
187 }
188 ee->engine.x.profile.change = 0;
189 }
190 }
191}
192
136# ifdef BUILD_ECORE_EVAS_OPENGL_X11 193# ifdef BUILD_ECORE_EVAS_OPENGL_X11
137static Ecore_X_Window 194static Ecore_X_Window
138_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) 195_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
650 break; 707 break;
651 } 708 }
652 } 709 }
653 else if (e->atom == ECORE_X_ATOM_E_PROFILE)
654 {
655 char *p = ecore_x_e_window_profile_get(e->win);
656 if ((p) && (ee->prop.profile))
657 {
658 if (strcmp(p, ee->prop.profile) != 0)
659 {
660 free(ee->prop.profile);
661 ee->prop.profile = strdup(p);
662 state_change = 1;
663 }
664 }
665 else if ((!p) && (ee->prop.profile))
666 {
667 free(ee->prop.profile);
668 ee->prop.profile = NULL;
669 state_change = 1;
670 }
671 else if ((p) && (!ee->prop.profile))
672 {
673 ee->prop.profile = strdup(p);
674 state_change = 1;
675 }
676
677 if (p)
678 free(p);
679 }
680
681 if (state_change) 710 if (state_change)
682 { 711 {
683 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 712 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,
757 ee->engine.x.netwm_sync_val_hi = (int)e->data.l[3]; 786 ee->engine.x.netwm_sync_val_hi = (int)e->data.l[3];
758 ee->engine.x.netwm_sync_set = 1; 787 ee->engine.x.netwm_sync_set = 1;
759 } 788 }
789 else if ((e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST))
790 {
791 ee = ecore_event_window_match(e->win);
792 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
793 if (ee->profile_supported)
794 {
795 char *p = ecore_x_atom_name_get(e->data.l[1]);
796 if (p)
797 {
798 _ecore_evas_window_profile_free(ee);
799 ee->prop.profile.name = (char *)eina_stringshare_add(p);
800
801 /* window profiles of each sub_ecore_evas will be changed
802 * in fn_state_change callback.
803 */
804 if (ee->func.fn_state_change)
805 ee->func.fn_state_change(ee);
806
807 ee->engine.x.profile.done = 1;
808 free(p);
809 }
810 }
811 }
760 return ECORE_CALLBACK_PASS_ON; 812 return ECORE_CALLBACK_PASS_ON;
761} 813}
762 814
@@ -1879,6 +1931,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
1879 _ecore_evas_x_group_leader_update(ee); 1931 _ecore_evas_x_group_leader_update(ee);
1880 ecore_x_window_defaults_set(ee->prop.window); 1932 ecore_x_window_defaults_set(ee->prop.window);
1881 _ecore_evas_x_protocols_set(ee); 1933 _ecore_evas_x_protocols_set(ee);
1934 _ecore_evas_x_window_profile_protocol_set(ee);
1882 _ecore_evas_x_sync_set(ee); 1935 _ecore_evas_x_sync_set(ee);
1883 _ecore_evas_x_size_pos_hints_update(ee); 1936 _ecore_evas_x_size_pos_hints_update(ee);
1884#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 1937#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
@@ -1999,6 +2052,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
1999 _ecore_evas_x_group_leader_update(ee); 2052 _ecore_evas_x_group_leader_update(ee);
2000 ecore_x_window_defaults_set(ee->prop.window); 2053 ecore_x_window_defaults_set(ee->prop.window);
2001 _ecore_evas_x_protocols_set(ee); 2054 _ecore_evas_x_protocols_set(ee);
2055 _ecore_evas_x_window_profile_protocol_set(ee);
2002 _ecore_evas_x_sync_set(ee); 2056 _ecore_evas_x_sync_set(ee);
2003 _ecore_evas_x_size_pos_hints_update(ee); 2057 _ecore_evas_x_size_pos_hints_update(ee);
2004#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ 2058#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
@@ -2128,6 +2182,7 @@ _ecore_evas_x_show(Ecore_Evas *ee)
2128 if (ee->prop.avoid_damage) 2182 if (ee->prop.avoid_damage)
2129 _ecore_evas_x_render(ee); 2183 _ecore_evas_x_render(ee);
2130 _ecore_evas_x_sync_set(ee); 2184 _ecore_evas_x_sync_set(ee);
2185 _ecore_evas_x_window_profile_set(ee);
2131 ecore_x_window_show(ee->prop.window); 2186 ecore_x_window_show(ee->prop.window);
2132 if (ee->prop.fullscreen) 2187 if (ee->prop.fullscreen)
2133 ecore_x_window_focus(ee->prop.window); 2188 ecore_x_window_focus(ee->prop.window);
@@ -2436,10 +2491,36 @@ _ecore_evas_x_fullscreen_set(Ecore_Evas *ee, int on)
2436} 2491}
2437 2492
2438static void 2493static void
2494_ecore_evas_x_profile_set(Ecore_Evas *ee, const char *profile)
2495{
2496 _ecore_evas_window_profile_free(ee);
2497 ee->prop.profile.name = NULL;
2498
2499 if (profile)
2500 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
2501 ee->engine.x.profile.change = 1;
2502 _ecore_evas_x_window_profile_set(ee);
2503}
2504
2505static void
2439_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n) 2506_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n)
2440{ 2507{
2441 /* Ecore_Evas's profile will be updated when WM sets the E_PROFILE. */ 2508 int i;
2442 ecore_x_e_window_profile_list_set(ee->prop.window, plist, n); 2509 _ecore_evas_window_available_profiles_free(ee);
2510 ee->prop.profile.available_list = NULL;
2511
2512 if ((plist) && (n >= 1))
2513 {
2514 ee->prop.profile.available_list = calloc(n, sizeof(char *));
2515 if (ee->prop.profile.available_list)
2516 {
2517 for (i = 0; i < n; i++)
2518 ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
2519 ee->prop.profile.count = n;
2520 }
2521 }
2522 ee->engine.x.profile.available = 1;
2523 _ecore_evas_x_window_profile_set(ee);
2443} 2524}
2444 2525
2445static void 2526static void
@@ -2648,6 +2729,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
2648 _ecore_evas_x_alpha_set, 2729 _ecore_evas_x_alpha_set,
2649 _ecore_evas_x_transparent_set, 2730 _ecore_evas_x_transparent_set,
2650 _ecore_evas_x_profiles_set, 2731 _ecore_evas_x_profiles_set,
2732 _ecore_evas_x_profile_set,
2651 2733
2652 _ecore_evas_x_window_group_set, 2734 _ecore_evas_x_window_group_set,
2653 _ecore_evas_x_aspect_set, 2735 _ecore_evas_x_aspect_set,
@@ -2717,6 +2799,12 @@ _ecore_evas_x_flush_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_
2717 ee->engine.x.netwm_sync_val_lo); 2799 ee->engine.x.netwm_sync_val_lo);
2718 ee->engine.x.netwm_sync_set = 0; 2800 ee->engine.x.netwm_sync_set = 0;
2719 } 2801 }
2802 if (ee->engine.x.profile.done)
2803 {
2804 ecore_x_e_window_profile_change_done_send
2805 (ee->engine.x.win_root, ee->prop.window,ee->prop.profile.name);
2806 ee->engine.x.profile.done = 0;
2807 }
2720} 2808}
2721#endif 2809#endif
2722 2810
@@ -2898,6 +2986,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
2898 _ecore_evas_x_group_leader_set(ee); 2986 _ecore_evas_x_group_leader_set(ee);
2899 ecore_x_window_defaults_set(ee->prop.window); 2987 ecore_x_window_defaults_set(ee->prop.window);
2900 _ecore_evas_x_protocols_set(ee); 2988 _ecore_evas_x_protocols_set(ee);
2989 _ecore_evas_x_window_profile_protocol_set(ee);
2901 _ecore_evas_x_sync_set(ee); 2990 _ecore_evas_x_sync_set(ee);
2902 2991
2903 ee->engine.func->fn_render = _ecore_evas_x_render; 2992 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,
3147 _ecore_evas_x_group_leader_set(ee); 3236 _ecore_evas_x_group_leader_set(ee);
3148 ecore_x_window_defaults_set(ee->prop.window); 3237 ecore_x_window_defaults_set(ee->prop.window);
3149 _ecore_evas_x_protocols_set(ee); 3238 _ecore_evas_x_protocols_set(ee);
3239 _ecore_evas_x_window_profile_protocol_set(ee);
3150 _ecore_evas_x_sync_set(ee); 3240 _ecore_evas_x_sync_set(ee);
3151 3241
3152 ee->engine.func->fn_render = _ecore_evas_x_render; 3242 ee->engine.func->fn_render = _ecore_evas_x_render;
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index b3fc0fabab..a072103cc6 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -1682,10 +1682,122 @@ EAPI void ecore_x_e_comp_dump_send(Ecore_X_Window win
1682EAPI void ecore_x_e_comp_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap); 1682EAPI void ecore_x_e_comp_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap);
1683EAPI Ecore_X_Pixmap ecore_x_e_comp_pixmap_get(Ecore_X_Window win); 1683EAPI Ecore_X_Pixmap ecore_x_e_comp_pixmap_get(Ecore_X_Window win);
1684 1684
1685/**
1686 * @brief Get the window profile
1687 *
1688 * @param win The client x window
1689 * @return The string value of the window profile, or NULL if none exists
1690 */
1685EAPI char *ecore_x_e_window_profile_get(Ecore_X_Window win); 1691EAPI char *ecore_x_e_window_profile_get(Ecore_X_Window win);
1692/**
1693 * @brief Set the window profile
1694 *
1695 * @param win The client x window
1696 * @param profile The string value of the window profile
1697 */
1686EAPI void ecore_x_e_window_profile_set(Ecore_X_Window win, const char *profile); 1698EAPI void ecore_x_e_window_profile_set(Ecore_X_Window win, const char *profile);
1699/**
1700 * @brief Set the array of window profiles
1701 *
1702 * @param win The client x window
1703 * @param profiles The string array of window profiles
1704 * @param num_profiles The number of window profiles
1705 *
1706 * @deprecated use ecore_x_e_window_available_profiles_set
1707 */
1687EAPI void ecore_x_e_window_profile_list_set(Ecore_X_Window win, const char **profiles, unsigned int num_profiles); 1708EAPI void ecore_x_e_window_profile_list_set(Ecore_X_Window win, const char **profiles, unsigned int num_profiles);
1709/**
1710 * @brief Get the array of window profiles
1711 *
1712 * @param win The client x window
1713 * @param profiles Where to return the string array of window profiles
1714 * @param ret_num Where to return the number of window profiles
1715 * @return EINA_TRUE if window profiles exist, EINA_FALSE otherwise
1716 *
1717 * @deprecated use ecore_x_e_window_available_profiles_get
1718 */
1688EAPI Eina_Bool ecore_x_e_window_profile_list_get(Ecore_X_Window win, const char ***profiles, int *ret_num); 1719EAPI Eina_Bool ecore_x_e_window_profile_list_get(Ecore_X_Window win, const char ***profiles, int *ret_num);
1720/**
1721 * @brief Set the status for the window profile support
1722 *
1723 * @param root The root window
1724 * @param enabled The enabled value for the window profile support
1725 *
1726 * @since 1.8
1727 */
1728EAPI void ecore_x_e_window_profile_supported_set(Ecore_X_Window root, Eina_Bool enabled);
1729/**
1730 * @brief Query if the window profile is supported
1731 *
1732 * @param root The root window
1733 * @return EINA_TRUE if it is supported, EINA_FALSE otherwise
1734 *
1735 * @since 1.8
1736 */
1737EAPI Eina_Bool ecore_x_e_window_profile_supported_get(Ecore_X_Window root);
1738/**
1739 * @brief Set the array of available window profiles
1740 *
1741 * @param win The client x window
1742 * @param profiles The string array of available window profiles
1743 * @param count The number of available window profiles
1744 *
1745 * @since 1.8
1746 */
1747EAPI void ecore_x_e_window_available_profiles_set(Ecore_X_Window win, const char **profiles, unsigned int count);
1748/**
1749 * @brief Get the array of avaialbe window profiles
1750 *
1751 * @param win The client x window
1752 * @param profiles Where to return the string array of available window profiles
1753 * @param count Where to return the number of members in profiles
1754 * @return EINA_TRUE if available window profiles exist, EINA_FALSE otherwise
1755 *
1756 * @since 1.8
1757 */
1758EAPI Eina_Bool ecore_x_e_window_available_profiles_get(Ecore_X_Window win, const char ***profiles, int *count);
1759/**
1760 * @brief Send a profile change event to the window manager
1761 *
1762 * This function sends a request to the window manager to change the profile.
1763 * If honored by the window manager, the client will receive a profile change
1764 * request event back. If the client has replied, the window manager will move
1765 * the client window on the virtual desktop associated with changed profile.
1766 *
1767 * @param root The root x window
1768 * @param win The client x window
1769 * @param profile The string value of the window profile
1770 *
1771 * @since 1.8
1772 */
1773EAPI void ecore_x_e_window_profile_change_send(Ecore_X_Window root, Ecore_X_Window win, const char *profile);
1774/**
1775 * @brief Send a profile change request event to the client
1776 *
1777 * This function sends a request to the client to change the profile.
1778 * If the client has replied, the window manager will move the client window
1779 * on the virtual desktop associated with changed profile.
1780 *
1781 * @param win The client x window
1782 * @param profile The string value of the window profile
1783 *
1784 * @since 1.8
1785 */
1786EAPI void ecore_x_e_window_profile_change_request_send(Ecore_X_Window win, const char *profile);
1787/**
1788 * @brief Send a profile change done event to the window manager
1789 *
1790 * This function sends a profile change done event to the window manager.
1791 * Upon receiving, the window manager will move the client window
1792 * on the virtual desktop associated with changed profile.
1793 *
1794 * @param root The root x window
1795 * @param win The client x window
1796 * @param profile The string value of the window profile
1797 *
1798 * @since 1.8
1799 */
1800EAPI void ecore_x_e_window_profile_change_done_send(Ecore_X_Window root, Ecore_X_Window win, const char *profile);
1689 1801
1690EAPI Ecore_X_Sync_Alarm ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter); 1802EAPI Ecore_X_Sync_Alarm ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter);
1691EAPI Eina_Bool ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm); 1803EAPI Eina_Bool ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm);
diff --git a/src/lib/ecore_x/Ecore_X_Atoms.h b/src/lib/ecore_x/Ecore_X_Atoms.h
index ca6351d839..22a3ff9bd4 100644
--- a/src/lib/ecore_x/Ecore_X_Atoms.h
+++ b/src/lib/ecore_x/Ecore_X_Atoms.h
@@ -279,8 +279,16 @@ EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_PARENT;
279EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_POSITION; 279EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_POSITION;
280 280
281/* currently elementary and E specific extension */ 281/* currently elementary and E specific extension */
282/* @deprecated use ECORE_X_ATOM_E_WINDOW_PROFILE */
282EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_PROFILE; 283EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_PROFILE;
284/* @deprecated use ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST */
283EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_PROFILE_LIST; 285EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_PROFILE_LIST;
286EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED;
287EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE;
288EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE;
289EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST;
290EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST;
291EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE;
284 292
285/* for sliding window */ 293/* for sliding window */
286EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE; 294EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE;
diff --git a/src/lib/ecore_x/ecore_x_atoms_decl.h b/src/lib/ecore_x/ecore_x_atoms_decl.h
index 155283efe6..46311e0eb4 100644
--- a/src/lib/ecore_x/ecore_x_atoms_decl.h
+++ b/src/lib/ecore_x/ecore_x_atoms_decl.h
@@ -315,8 +315,17 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_CONNECT = 0;
315EAPI Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_DISCONNECT = 0; 315EAPI Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_DISCONNECT = 0;
316 316
317/* currently elementary and E specific extension */ 317/* currently elementary and E specific extension */
318EAPI Ecore_X_Atom ECORE_X_ATOM_E_PROFILE = 0; 318/* @deprecated use ECORE_X_ATOM_E_WINDOW_PROFILE */
319EAPI Ecore_X_Atom ECORE_X_ATOM_E_PROFILE_LIST = 0; 319EINA_DEPRECATED EAPI Ecore_X_Atom ECORE_X_ATOM_E_PROFILE = 0;
320/* @deprecated use ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST */
321EINA_DEPRECATED EAPI Ecore_X_Atom ECORE_X_ATOM_E_PROFILE_LIST = 0;
322
323EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED = 0;
324EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE = 0;
325EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE = 0;
326EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST = 0;
327EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST = 0;
328EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE = 0;
320 329
321typedef struct _Atom_Item Atom_Item; 330typedef struct _Atom_Item Atom_Item;
322 331
@@ -597,6 +606,12 @@ const Atom_Item atom_items[] =
597 { "_E_COMP_DUMP", &ECORE_X_ATOM_E_COMP_DUMP }, 606 { "_E_COMP_DUMP", &ECORE_X_ATOM_E_COMP_DUMP },
598 { "_E_COMP_PIXMAP", &ECORE_X_ATOM_E_COMP_PIXMAP }, 607 { "_E_COMP_PIXMAP", &ECORE_X_ATOM_E_COMP_PIXMAP },
599 { "_E_VIDEO_PARENT", &ECORE_X_ATOM_E_VIDEO_PARENT }, 608 { "_E_VIDEO_PARENT", &ECORE_X_ATOM_E_VIDEO_PARENT },
600 { "_E_VIDEO_POSITION", &ECORE_X_ATOM_E_VIDEO_POSITION } 609 { "_E_VIDEO_POSITION", &ECORE_X_ATOM_E_VIDEO_POSITION },
610 { "_E_WINDOW_PROFILE_SUPPORTED", &ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED },
611 { "_E_WINDOW_PROFILE", &ECORE_X_ATOM_E_WINDOW_PROFILE },
612 { "_E_WINDOW_PROFILE_CHANGE", &ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE },
613 { "_E_WINDOW_PROFILE_AVAILABLE_LIST", &ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST },
614 { "_E_WINDOW_PROFILE_CHANGE_REQUEST", &ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST },
615 { "_E_WINDOW_PROFILE_CHANGE_DONE", &ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE }
601}; 616};
602 617
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_e.c b/src/lib/ecore_x/xcb/ecore_xcb_e.c
index 82d94b634f..9862a9d2ad 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_e.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_e.c
@@ -125,6 +125,10 @@ ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
125 return EINA_FALSE; 125 return EINA_FALSE;
126} 126}
127 127
128/*
129 * @since 1.3
130 * @deprecated use ecore_x_e_window_available_profiles_set
131 */
128EAPI void 132EAPI void
129ecore_x_e_window_profile_list_set(Ecore_X_Window win, 133ecore_x_e_window_profile_list_set(Ecore_X_Window win,
130 const char **profiles, 134 const char **profiles,
@@ -133,22 +137,28 @@ ecore_x_e_window_profile_list_set(Ecore_X_Window win,
133 Ecore_X_Atom *atoms; 137 Ecore_X_Atom *atoms;
134 138
135 LOGFN(__FILE__, __LINE__, __FUNCTION__); 139 LOGFN(__FILE__, __LINE__, __FUNCTION__);
140 CHECK_XCB_CONN;
141
136 if (!win) 142 if (!win)
137 return; 143 return;
138 144
139 if (!num_profiles) 145 if ((!profiles) || (num_profiles <= 0))
140 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE_LIST); 146 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST);
141 else 147 else
142 { 148 {
143 atoms = alloca(num_profiles * sizeof(Ecore_X_Atom)); 149 atoms = alloca(num_profiles * sizeof(Ecore_X_Atom));
144 ecore_x_atoms_get(profiles, num_profiles, atoms); 150 ecore_x_atoms_get(profiles, num_profiles, atoms);
145 ecore_x_window_prop_property_set(win, 151 ecore_x_window_prop_property_set(win,
146 ECORE_X_ATOM_E_PROFILE_LIST, 152 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
147 ECORE_X_ATOM_ATOM, 32, (void *)atoms, 153 ECORE_X_ATOM_ATOM, 32, (void *)atoms,
148 num_profiles); 154 num_profiles);
149 } 155 }
150} 156}
151 157
158/*
159 * @since 1.3
160 * @deprecated use ecore_x_e_window_available_profiles_get
161 */
152EAPI Eina_Bool 162EAPI Eina_Bool
153ecore_x_e_window_profile_list_get(Ecore_X_Window win, 163ecore_x_e_window_profile_list_get(Ecore_X_Window win,
154 const char ***profiles, 164 const char ***profiles,
@@ -158,6 +168,9 @@ ecore_x_e_window_profile_list_get(Ecore_X_Window win,
158 Ecore_X_Atom *atoms; 168 Ecore_X_Atom *atoms;
159 int num, i; 169 int num, i;
160 170
171 LOGFN(__FILE__, __LINE__, __FUNCTION__);
172 CHECK_XCB_CONN;
173
161 if (ret_num) 174 if (ret_num)
162 *ret_num = 0; 175 *ret_num = 0;
163 176
@@ -167,9 +180,8 @@ ecore_x_e_window_profile_list_get(Ecore_X_Window win,
167 if (!win) 180 if (!win)
168 return EINA_FALSE; 181 return EINA_FALSE;
169 182
170 LOGFN(__FILE__, __LINE__, __FUNCTION__);
171 if (!ecore_x_window_prop_property_get(win, 183 if (!ecore_x_window_prop_property_get(win,
172 ECORE_X_ATOM_E_PROFILE_LIST, 184 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
173 ECORE_X_ATOM_ATOM, 32, &data, &num)) 185 ECORE_X_ATOM_ATOM, 32, &data, &num))
174 return EINA_FALSE; 186 return EINA_FALSE;
175 187
@@ -208,15 +220,17 @@ ecore_x_e_window_profile_set(Ecore_X_Window win,
208 Ecore_X_Atom atom; 220 Ecore_X_Atom atom;
209 221
210 LOGFN(__FILE__, __LINE__, __FUNCTION__); 222 LOGFN(__FILE__, __LINE__, __FUNCTION__);
223 CHECK_XCB_CONN;
224
211 if (!win) 225 if (!win)
212 return; 226 return;
213 227
214 if (!profile) 228 if (!profile)
215 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE); 229 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE);
216 else 230 else
217 { 231 {
218 atom = ecore_x_atom_get(profile); 232 atom = ecore_x_atom_get(profile);
219 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_E_PROFILE, 233 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
220 ECORE_X_ATOM_ATOM, 32, (void *)&atom, 1); 234 ECORE_X_ATOM_ATOM, 32, (void *)&atom, 1);
221 } 235 }
222} 236}
@@ -230,7 +244,8 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
230 int num; 244 int num;
231 245
232 LOGFN(__FILE__, __LINE__, __FUNCTION__); 246 LOGFN(__FILE__, __LINE__, __FUNCTION__);
233 if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_PROFILE, 247 CHECK_XCB_CONN;
248 if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
234 ECORE_X_ATOM_ATOM, 32, &data, &num)) 249 ECORE_X_ATOM_ATOM, 32, &data, &num))
235 return NULL; 250 return NULL;
236 251
@@ -244,6 +259,256 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
244} 259}
245 260
246EAPI void 261EAPI void
262ecore_x_e_window_profile_supported_set(Ecore_X_Window root,
263 Eina_Bool enabled)
264{
265 Ecore_X_Window win;
266
267 LOGFN(__FILE__, __LINE__, __FUNCTION__);
268 CHECK_XCB_CONN;
269
270 if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
271
272 if (enabled)
273 {
274 win = ecore_x_window_new(root, 1, 2, 3, 4);
275 ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
276 ECORE_X_ATOM_WINDOW, &win, 1);
277 ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
278 ECORE_X_ATOM_WINDOW, &win, 1);
279 }
280 else
281 {
282 int ret = 0;
283
284 ret = ecore_x_window_prop_xid_get(root,
285 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
286 ECORE_X_ATOM_WINDOW, &win, 1);
287 if ((ret == 1) && (win))
288 {
289 ecore_x_window_prop_property_del(root,
290 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED);
291 ecore_x_window_free(win);
292 }
293 }
294}
295
296EAPI Eina_Bool
297ecore_x_e_window_profile_supported_get(Ecore_X_Window root)
298{
299 Ecore_X_Window win, win2;
300 int ret = 0;
301
302 LOGFN(__FILE__, __LINE__, __FUNCTION__);
303 CHECK_XCB_CONN;
304
305 if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
306
307 ret =
308 ecore_x_window_prop_xid_get(root,
309 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
310 ECORE_X_ATOM_WINDOW,
311 &win, 1);
312 if ((ret == 1) && (win))
313 {
314 ret =
315 ecore_x_window_prop_xid_get(win,
316 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
317 ECORE_X_ATOM_WINDOW,
318 &win2, 1);
319 if ((ret == 1) && (win2 == win))
320 return EINA_TRUE;
321 }
322 return EINA_FALSE;
323}
324
325EAPI void
326ecore_x_e_window_available_profiles_set(Ecore_X_Window win,
327 const char **profiles,
328 unsigned int count)
329{
330 Ecore_X_Atom *atoms;
331
332 LOGFN(__FILE__, __LINE__, __FUNCTION__);
333 CHECK_XCB_CONN;
334
335 if (!win)
336 return;
337
338 if ((!profiles) || (count <= 0))
339 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST);
340 else
341 {
342 atoms = alloca(count * sizeof(Ecore_X_Atom));
343 ecore_x_atoms_get(profiles, count, atoms);
344 ecore_x_window_prop_property_set(win,
345 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
346 ECORE_X_ATOM_ATOM, 32, (void *)atoms,
347 count);
348 }
349}
350
351EAPI Eina_Bool
352ecore_x_e_window_available_profiles_get(Ecore_X_Window win,
353 const char ***profiles,
354 int *count)
355{
356 unsigned char *data = NULL;
357 Ecore_X_Atom *atoms;
358 int num, i;
359
360 LOGFN(__FILE__, __LINE__, __FUNCTION__);
361 CHECK_XCB_CONN;
362
363 if (count)
364 *count = 0;
365
366 if (profiles)
367 *profiles = NULL;
368
369 if (!win)
370 return EINA_FALSE;
371
372 if (!ecore_x_window_prop_property_get(win,
373 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
374 ECORE_X_ATOM_ATOM, 32, &data, &num))
375 return EINA_FALSE;
376
377 if (count)
378 *count = num;
379
380 if (profiles)
381 {
382 (*profiles) = calloc(num, sizeof(char *));
383 if (!(*profiles))
384 {
385 if (count)
386 *count = 0;
387
388 if (data)
389 free(data);
390
391 return EINA_FALSE;
392 }
393
394 atoms = (Ecore_X_Atom *)data;
395 for (i = 0; i < num; i++)
396 (*profiles)[i] = ecore_x_atom_name_get(atoms[i]);
397 }
398
399 if (data)
400 free(data);
401
402 return EINA_TRUE;
403}
404
405EAPI void
406ecore_x_e_window_profile_change_send(Ecore_X_Window root,
407 Ecore_X_Window win,
408 const char *profile)
409{
410 xcb_client_message_event_t ev;
411 Ecore_X_Atom atom;
412
413 LOGFN(__FILE__, __LINE__, __FUNCTION__);
414 CHECK_XCB_CONN;
415
416 if (!root)
417 root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
418
419 if (!win)
420 return;
421
422 memset(&ev, 0, sizeof(xcb_client_message_event_t));
423
424 atom = ecore_x_atom_get(profile);
425
426 ev.response_type = XCB_CLIENT_MESSAGE;
427 ev.format = 32;
428 ev.window = win;
429 ev.type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE;
430 ev.data.data32[0] = win;
431 ev.data.data32[1] = atom;
432 ev.data.data32[2] = 0; // later
433 ev.data.data32[3] = 0; // later
434 ev.data.data32[4] = 0; // later
435
436 xcb_send_event(_ecore_xcb_conn, 0, root,
437 (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
438 XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY),
439 (const char *)&ev);
440}
441
442EAPI void
443ecore_x_e_window_profile_change_request_send(Ecore_X_Window win,
444 const char *profile)
445{
446 xcb_client_message_event_t ev;
447 Ecore_X_Atom atom;
448
449 LOGFN(__FILE__, __LINE__, __FUNCTION__);
450 CHECK_XCB_CONN;
451
452 if (!win)
453 return;
454
455 memset(&ev, 0, sizeof(xcb_client_message_event_t));
456
457 atom = ecore_x_atom_get(profile);
458
459 ev.response_type = XCB_CLIENT_MESSAGE;
460 ev.format = 32;
461 ev.window = win;
462 ev.type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST;
463 ev.data.data32[0] = win;
464 ev.data.data32[1] = atom;
465 ev.data.data32[2] = 0; // later
466 ev.data.data32[3] = 0; // later
467 ev.data.data32[4] = 0; // later
468
469 xcb_send_event(_ecore_xcb_conn, 0, win,
470 XCB_EVENT_MASK_NO_EVENT,
471 (const char *)&ev);
472}
473
474EAPI void
475ecore_x_e_window_profile_change_done_send(Ecore_X_Window root,
476 Ecore_X_Window win,
477 const char *profile)
478{
479 xcb_client_message_event_t ev;
480 Ecore_X_Atom atom;
481
482 LOGFN(__FILE__, __LINE__, __FUNCTION__);
483 CHECK_XCB_CONN;
484
485 if (!root)
486 root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
487
488 if (!win)
489 return;
490
491 memset(&ev, 0, sizeof(xcb_client_message_event_t));
492
493 atom = ecore_x_atom_get(profile);
494
495 ev.response_type = XCB_CLIENT_MESSAGE;
496 ev.format = 32;
497 ev.window = win;
498 ev.type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE;
499 ev.data.data32[0] = win;
500 ev.data.data32[1] = atom;
501 ev.data.data32[2] = 0; // later
502 ev.data.data32[3] = 0; // later
503 ev.data.data32[4] = 0; // later
504
505 xcb_send_event(_ecore_xcb_conn, 0, root,
506 (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
507 XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY),
508 (const char *)&ev);
509}
510
511EAPI void
247ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, 512ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
248 Eina_Bool enabled) 513 Eina_Bool enabled)
249{ 514{
diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c
index 430b24b117..586a972e08 100644
--- a/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -1138,7 +1138,7 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
1138 1138
1139/* 1139/*
1140 * @since 1.3 1140 * @since 1.3
1141 * 1141 * @deprecated use ecore_x_e_window_available_profiles_set
1142 */ 1142 */
1143EAPI void 1143EAPI void
1144ecore_x_e_window_profile_list_set(Ecore_X_Window win, 1144ecore_x_e_window_profile_list_set(Ecore_X_Window win,
@@ -1151,14 +1151,14 @@ ecore_x_e_window_profile_list_set(Ecore_X_Window win,
1151 if (!win) 1151 if (!win)
1152 return; 1152 return;
1153 1153
1154 if (!num_profiles) 1154 if ((!profiles) || (num_profiles <= 0))
1155 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE_LIST); 1155 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST);
1156 else 1156 else
1157 { 1157 {
1158 atoms = alloca(num_profiles * sizeof(Ecore_X_Atom)); 1158 atoms = alloca(num_profiles * sizeof(Ecore_X_Atom));
1159 ecore_x_atoms_get(profiles, num_profiles, atoms); 1159 ecore_x_atoms_get(profiles, num_profiles, atoms);
1160 ecore_x_window_prop_property_set(win, 1160 ecore_x_window_prop_property_set(win,
1161 ECORE_X_ATOM_E_PROFILE_LIST, 1161 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
1162 XA_ATOM, 32, (void *)atoms, 1162 XA_ATOM, 32, (void *)atoms,
1163 num_profiles); 1163 num_profiles);
1164 } 1164 }
@@ -1166,6 +1166,7 @@ ecore_x_e_window_profile_list_set(Ecore_X_Window win,
1166 1166
1167/* 1167/*
1168 * @since 1.3 1168 * @since 1.3
1169 * @deprecated use ecore_x_e_window_available_profiles_get
1169 */ 1170 */
1170EAPI Eina_Bool 1171EAPI Eina_Bool
1171ecore_x_e_window_profile_list_get(Ecore_X_Window win, 1172ecore_x_e_window_profile_list_get(Ecore_X_Window win,
@@ -1176,6 +1177,8 @@ ecore_x_e_window_profile_list_get(Ecore_X_Window win,
1176 Ecore_X_Atom *atoms; 1177 Ecore_X_Atom *atoms;
1177 int num, i; 1178 int num, i;
1178 1179
1180 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1181
1179 if (ret_num) 1182 if (ret_num)
1180 *ret_num = 0; 1183 *ret_num = 0;
1181 1184
@@ -1185,9 +1188,8 @@ ecore_x_e_window_profile_list_get(Ecore_X_Window win,
1185 if (!win) 1188 if (!win)
1186 return EINA_FALSE; 1189 return EINA_FALSE;
1187 1190
1188 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1189 if (!ecore_x_window_prop_property_get(win, 1191 if (!ecore_x_window_prop_property_get(win,
1190 ECORE_X_ATOM_E_PROFILE_LIST, 1192 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
1191 XA_ATOM, 32, &data, &num)) 1193 XA_ATOM, 32, &data, &num))
1192 return EINA_FALSE; 1194 return EINA_FALSE;
1193 1195
@@ -1233,11 +1235,11 @@ ecore_x_e_window_profile_set(Ecore_X_Window win,
1233 return; 1235 return;
1234 1236
1235 if (!profile) 1237 if (!profile)
1236 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE); 1238 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE);
1237 else 1239 else
1238 { 1240 {
1239 atom = ecore_x_atom_get(profile); 1241 atom = ecore_x_atom_get(profile);
1240 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_E_PROFILE, 1242 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
1241 XA_ATOM, 32, (void *)&atom, 1); 1243 XA_ATOM, 32, (void *)&atom, 1);
1242 } 1244 }
1243} 1245}
@@ -1254,7 +1256,7 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
1254 int num; 1256 int num;
1255 1257
1256 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1258 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1257 if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_PROFILE, 1259 if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
1258 XA_ATOM, 32, &data, &num)) 1260 XA_ATOM, 32, &data, &num))
1259 return NULL; 1261 return NULL;
1260 1262
@@ -1268,6 +1270,243 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
1268} 1270}
1269 1271
1270EAPI void 1272EAPI void
1273ecore_x_e_window_profile_supported_set(Ecore_X_Window root,
1274 Eina_Bool enabled)
1275{
1276 Ecore_X_Window win;
1277
1278 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1279
1280 if (!root)
1281 root = DefaultRootWindow(_ecore_x_disp);
1282
1283 if (enabled)
1284 {
1285 win = ecore_x_window_new(root, 1, 2, 3, 4);
1286 ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
1287 ECORE_X_ATOM_WINDOW, &win, 1);
1288 ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
1289 ECORE_X_ATOM_WINDOW, &win, 1);
1290 }
1291 else
1292 {
1293 int ret;
1294
1295 ret =
1296 ecore_x_window_prop_xid_get(root,
1297 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
1298 ECORE_X_ATOM_WINDOW,
1299 &win, 1);
1300 if ((ret == 1) && (win))
1301 {
1302 ecore_x_window_prop_property_del(
1303 root,
1304 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED);
1305 ecore_x_window_free(win);
1306 }
1307 }
1308}
1309
1310EAPI Eina_Bool
1311ecore_x_e_window_profile_supported_get(Ecore_X_Window root)
1312{
1313 Ecore_X_Window win, win2;
1314 int ret;
1315
1316 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1317
1318 if (!root)
1319 root = DefaultRootWindow(_ecore_x_disp);
1320
1321 ret =
1322 ecore_x_window_prop_xid_get(root,
1323 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
1324 ECORE_X_ATOM_WINDOW,
1325 &win, 1);
1326 if ((ret == 1) && (win))
1327 {
1328 ret =
1329 ecore_x_window_prop_xid_get(win,
1330 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
1331 ECORE_X_ATOM_WINDOW,
1332 &win2, 1);
1333 if ((ret == 1) && (win2 == win))
1334 return EINA_TRUE;
1335 }
1336
1337 return EINA_FALSE;
1338}
1339
1340EAPI void
1341ecore_x_e_window_available_profiles_set(Ecore_X_Window win,
1342 const char **profiles,
1343 unsigned int count)
1344{
1345 Ecore_X_Atom *atoms;
1346
1347 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1348
1349 if (!win)
1350 return;
1351
1352 if ((!profiles) || (count <= 0))
1353 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST);
1354 else
1355 {
1356 atoms = alloca(count * sizeof(Ecore_X_Atom));
1357 ecore_x_atoms_get(profiles, count, atoms);
1358 ecore_x_window_prop_property_set(win,
1359 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
1360 XA_ATOM, 32, (void *)atoms,
1361 count);
1362 }
1363}
1364
1365EAPI Eina_Bool
1366ecore_x_e_window_available_profiles_get(Ecore_X_Window win,
1367 const char ***profiles,
1368 int *count)
1369{
1370 unsigned char *data;
1371 Ecore_X_Atom *atoms;
1372 int num, i;
1373
1374 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1375
1376 if (count)
1377 *count = 0;
1378
1379 if (profiles)
1380 *profiles = NULL;
1381
1382 if (!win)
1383 return EINA_FALSE;
1384
1385 if (!ecore_x_window_prop_property_get(win,
1386 ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST,
1387 XA_ATOM, 32, &data, &num))
1388 return EINA_FALSE;
1389
1390 if (count)
1391 *count = num;
1392
1393 if (profiles)
1394 {
1395 (*profiles) = calloc(num, sizeof(char *));
1396 if (!(*profiles))
1397 {
1398 if (count)
1399 *count = 0;
1400
1401 if (data)
1402 free(data);
1403
1404 return EINA_FALSE;
1405 }
1406
1407 atoms = (Ecore_X_Atom *)data;
1408 for (i = 0; i < num; i++)
1409 (*profiles)[i] = ecore_x_atom_name_get(atoms[i]);
1410 }
1411
1412 if (data)
1413 XFree(data);
1414
1415 return EINA_TRUE;
1416}
1417
1418EAPI void
1419ecore_x_e_window_profile_change_send(Ecore_X_Window root,
1420 Ecore_X_Window win,
1421 const char *profile)
1422{
1423 XEvent xev;
1424 Ecore_X_Atom atom;
1425
1426 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1427 if (!root)
1428 root = DefaultRootWindow(_ecore_x_disp);
1429
1430 if (!win)
1431 return;
1432
1433 atom = ecore_x_atom_get(profile);
1434
1435 xev.xclient.type = ClientMessage;
1436 xev.xclient.display = _ecore_x_disp;
1437 xev.xclient.window = win;
1438 xev.xclient.message_type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE;
1439 xev.xclient.format = 32;
1440 xev.xclient.data.l[0] = win;
1441 xev.xclient.data.l[1] = atom;
1442 xev.xclient.data.l[2] = 0; // later
1443 xev.xclient.data.l[3] = 0; // later
1444 xev.xclient.data.l[4] = 0; // later
1445
1446 XSendEvent(_ecore_x_disp, root, False,
1447 SubstructureRedirectMask | SubstructureNotifyMask,
1448 &xev);
1449}
1450
1451EAPI void
1452ecore_x_e_window_profile_change_request_send(Ecore_X_Window win,
1453 const char *profile)
1454{
1455 XEvent xev;
1456 Ecore_X_Atom atom;
1457
1458 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1459 if (!win)
1460 return;
1461
1462 atom = ecore_x_atom_get(profile);
1463
1464 xev.xclient.type = ClientMessage;
1465 xev.xclient.display = _ecore_x_disp;
1466 xev.xclient.window = win;
1467 xev.xclient.message_type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST;
1468 xev.xclient.format = 32;
1469 xev.xclient.data.l[0] = win;
1470 xev.xclient.data.l[1] = atom;
1471 xev.xclient.data.l[2] = 0; // later
1472 xev.xclient.data.l[3] = 0; // later
1473 xev.xclient.data.l[4] = 0; // later
1474
1475 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1476}
1477
1478
1479EAPI void
1480ecore_x_e_window_profile_change_done_send(Ecore_X_Window root,
1481 Ecore_X_Window win,
1482 const char *profile)
1483{
1484 XEvent xev;
1485 Ecore_X_Atom atom;
1486
1487 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1488 if (!root)
1489 root = DefaultRootWindow(_ecore_x_disp);
1490
1491 atom = ecore_x_atom_get(profile);
1492
1493 xev.xclient.type = ClientMessage;
1494 xev.xclient.display = _ecore_x_disp;
1495 xev.xclient.window = win;
1496 xev.xclient.message_type = ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE;
1497 xev.xclient.format = 32;
1498 xev.xclient.data.l[0] = win;
1499 xev.xclient.data.l[1] = atom;
1500 xev.xclient.data.l[2] = 0; // later
1501 xev.xclient.data.l[3] = 0; // later
1502 xev.xclient.data.l[4] = 0; // later
1503
1504 XSendEvent(_ecore_x_disp, root, False,
1505 SubstructureRedirectMask | SubstructureNotifyMask,
1506 &xev);
1507}
1508
1509EAPI void
1271ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, 1510ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
1272 Eina_Bool enabled) 1511 Eina_Bool enabled)
1273{ 1512{