summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-07-03 07:36:55 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-07-03 07:36:55 +0000
commitbf69d7dcc6290024c1a0221b08f0931128aadc07 (patch)
treeec734e4cdcc1253d205938aaec33797e47bf3099 /legacy/ecore/src/lib/ecore_x/xlib
parent478e94a71d6a70e76963551e74dd38e1dc342408 (diff)
Ecore_X: Merge Tizen changes to upstream EFL.
SVN revision: 73203
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c250
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c27
2 files changed, 277 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
index 3930c41..2998c5d 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -927,6 +927,83 @@ ecore_x_e_illume_clipboard_geometry_get(Ecore_X_Window win,
927 return EINA_TRUE; 927 return EINA_TRUE;
928} 928}
929 929
930/* for sliding window */
931EAPI void
932ecore_x_e_illume_sliding_win_state_set(Ecore_X_Window win,
933 unsigned int is_visible)
934{
935 LOGFN(__FILE__, __LINE__, __FUNCTION__);
936 ecore_x_window_prop_card32_set(win,
937 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE,
938 &is_visible, 1);
939} /* ecore_x_e_illume_sliding_win_state_set */
940
941EAPI int
942ecore_x_e_illume_sliding_win_state_get(Ecore_X_Window win)
943{
944 unsigned int is_visible = 0;
945
946 LOGFN(__FILE__, __LINE__, __FUNCTION__);
947 if (!ecore_x_window_prop_card32_get(win,
948 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE,
949 &is_visible, 1))
950 return 0;
951
952 return is_visible;
953}
954
955EAPI void
956ecore_x_e_illume_sliding_win_geometry_set(Ecore_X_Window win,
957 int x,
958 int y,
959 int w,
960 int h)
961{
962 unsigned int geom[4];
963
964 LOGFN(__FILE__, __LINE__, __FUNCTION__);
965 geom[0] = x;
966 geom[1] = y;
967 geom[2] = w;
968 geom[3] = h;
969 ecore_x_window_prop_card32_set(win,
970 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_GEOMETRY,
971 geom, 4);
972} /* ecore_x_e_illume_sliding_win_geometry_set */
973
974EAPI int
975ecore_x_e_illume_sliding_win_geometry_get(Ecore_X_Window win,
976 int *x,
977 int *y,
978 int *w,
979 int *h)
980{
981 int ret = 0;
982 unsigned int geom[4];
983
984 LOGFN(__FILE__, __LINE__, __FUNCTION__);
985 ret =
986 ecore_x_window_prop_card32_get(win,
987 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_GEOMETRY,
988 geom, 4);
989 if (ret != 4)
990 return 0;
991
992 if (x)
993 *x = geom[0];
994
995 if (y)
996 *y = geom[1];
997
998 if (w)
999 *w = geom[2];
1000
1001 if (h)
1002 *h = geom[3];
1003
1004 return 1;
1005}/* ecore_x_e_illume_sliding_win_geometry_get */
1006
930EAPI void 1007EAPI void
931ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, 1008ecore_x_e_comp_sync_counter_set(Ecore_X_Window win,
932 Ecore_X_Sync_Counter counter) 1009 Ecore_X_Sync_Counter counter)
@@ -1012,6 +1089,124 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
1012} 1089}
1013 1090
1014EAPI void 1091EAPI void
1092ecore_x_e_window_profile_list_set(Ecore_X_Window win,
1093 const char **profiles,
1094 unsigned int num_profiles)
1095{
1096 Ecore_X_Atom *atoms;
1097
1098 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1099 if (!win)
1100 return;
1101
1102 if (!num_profiles)
1103 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE_LIST);
1104 else
1105 {
1106 atoms = alloca(num_profiles * sizeof(Ecore_X_Atom));
1107 ecore_x_atoms_get(profiles, num_profiles, atoms);
1108 ecore_x_window_prop_property_set(win,
1109 ECORE_X_ATOM_E_PROFILE_LIST,
1110 XA_ATOM, 32, (void *)atoms,
1111 num_profiles);
1112 }
1113}
1114
1115EAPI Eina_Bool
1116ecore_x_e_window_profile_list_get(Ecore_X_Window win,
1117 const char ***profiles,
1118 int *ret_num)
1119{
1120 unsigned char *data;
1121 Ecore_X_Atom *atoms;
1122 int num, i;
1123
1124 if (ret_num)
1125 *ret_num = 0;
1126
1127 if (profiles)
1128 *profiles = NULL;
1129
1130 if (!win)
1131 return EINA_FALSE;
1132
1133 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1134 if (!ecore_x_window_prop_property_get(win,
1135 ECORE_X_ATOM_E_PROFILE_LIST,
1136 XA_ATOM, 32, &data, &num))
1137 return EINA_FALSE;
1138
1139 if (ret_num)
1140 *ret_num = num;
1141
1142 if (profiles)
1143 {
1144 (*profiles) = calloc(num, sizeof(char *));
1145 if (!(*profiles))
1146 {
1147 if (ret_num)
1148 *ret_num = 0;
1149
1150 if (data)
1151 free(data);
1152
1153 return EINA_FALSE;
1154 }
1155
1156 atoms = (Ecore_X_Atom *)data;
1157 for (i = 0; i < num; i++)
1158 (*profiles)[i] = ecore_x_atom_name_get(atoms[i]);
1159 }
1160
1161 if (data)
1162 XFree(data);
1163
1164 return EINA_TRUE;
1165}
1166
1167EAPI void
1168ecore_x_e_window_profile_set(Ecore_X_Window win,
1169 const char *profile)
1170{
1171 Ecore_X_Atom atom;
1172
1173 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1174 if (!win)
1175 return;
1176
1177 if (!profile)
1178 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_PROFILE);
1179 else
1180 {
1181 atom = ecore_x_atom_get(profile);
1182 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_E_PROFILE,
1183 XA_ATOM, 32, (void *)&atom, 1);
1184 }
1185}
1186
1187EAPI char *
1188ecore_x_e_window_profile_get(Ecore_X_Window win)
1189{
1190 Ecore_X_Atom *atom = NULL;
1191 unsigned char *data;
1192 char *profile = NULL;
1193 int num;
1194
1195 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1196 if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_PROFILE,
1197 XA_ATOM, 32, &data, &num))
1198 return NULL;
1199
1200 if (data)
1201 atom = (Ecore_X_Atom *)data;
1202
1203 if (atom)
1204 profile = ecore_x_atom_name_get(atom[0]);
1205
1206 return profile;
1207}
1208
1209EAPI void
1015ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, 1210ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
1016 Eina_Bool enabled) 1211 Eina_Bool enabled)
1017{ 1212{
@@ -1357,3 +1552,58 @@ ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
1357 0, 0, 0, 0); 1552 0, 0, 0, 0);
1358} 1553}
1359 1554
1555static Ecore_X_Atom
1556_ecore_x_e_illume_window_state_atom_get(Ecore_X_Illume_Window_State state)
1557{
1558 switch (state)
1559 {
1560 case ECORE_X_ILLUME_WINDOW_STATE_NORMAL:
1561 return ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL;
1562
1563 case ECORE_X_ILLUME_WINDOW_STATE_FLOATING:
1564 return ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_FLOATING;
1565
1566 default:
1567 break;
1568 }
1569 return 0;
1570}
1571
1572static Ecore_X_Illume_Window_State
1573_ecore_x_e_illume_window_state_get(Ecore_X_Atom atom)
1574{
1575 if (atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL)
1576 return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
1577
1578 if (atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_FLOATING)
1579 return ECORE_X_ILLUME_WINDOW_STATE_FLOATING;
1580
1581 return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
1582}
1583
1584EAPI void
1585ecore_x_e_illume_window_state_set(Ecore_X_Window win,
1586 Ecore_X_Illume_Window_State state)
1587{
1588 Ecore_X_Atom atom = 0;
1589
1590 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1591 atom = _ecore_x_e_illume_window_state_atom_get(state);
1592 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
1593 &atom, 1);
1594}
1595
1596EAPI Ecore_X_Illume_Window_State
1597ecore_x_e_illume_window_state_get(Ecore_X_Window win)
1598{
1599 Ecore_X_Atom atom;
1600
1601 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1602 if (!ecore_x_window_prop_atom_get(win,
1603 ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
1604 &atom, 1))
1605 return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
1606
1607 return _ecore_x_e_illume_window_state_get(atom);
1608}
1609
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 5fc580e..5a23a1b 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -1605,6 +1605,33 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1605 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1605 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1606} 1606}
1607 1607
1608EAPI void
1609ecore_x_netwm_moveresize_request_send(Ecore_X_Window win,
1610 int x,
1611 int y,
1612 Ecore_X_Netwm_Direction direction,
1613 unsigned int button)
1614{
1615 XEvent xev;
1616
1617 if (!win)
1618 return;
1619
1620 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1621 xev.xclient.window = win;
1622 xev.xclient.type = ClientMessage;
1623 xev.xclient.message_type = ECORE_X_ATOM_NET_WM_MOVERESIZE;
1624 xev.xclient.format = 32;
1625 xev.xclient.data.l[0] = x;
1626 xev.xclient.data.l[1] = y;
1627 xev.xclient.data.l[2] = direction;
1628 xev.xclient.data.l[3] = button;
1629 xev.xclient.data.l[4] = 1;
1630
1631 XSendEvent(_ecore_x_disp, win, False,
1632 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1633}
1634
1608int 1635int
1609_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__, 1636_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
1610 char *data __UNUSED__) 1637 char *data __UNUSED__)