aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xcb
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-04-22 09:19:23 +1000
committerDavid Walter Seikel2012-04-22 09:19:23 +1000
commitc963d75dfdeec11f82e79e727062fbf89afa2c04 (patch)
tree895633dbf641110be46f117c29890c49b3ffc0bd /libraries/ecore/src/lib/ecore_x/xcb
parentAdding the new extantz viewer and grid manager. (diff)
downloadSledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip
SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz
SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2
SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz
Update EFL to latest beta.
Diffstat (limited to '')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/Makefile.in20
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_atoms.c15
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c236
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_keymap.c8
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c50
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c294
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c4
7 files changed, 562 insertions, 65 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in b/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
index 9108f23..ff2227c 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
@@ -48,16 +48,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
48 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ 48 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
49 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ 49 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
50 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ 50 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
51 $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ 51 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
52 $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ 52 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
53 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ 53 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
54 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ 54 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
55 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ 55 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
56 $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ 56 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
57 $(top_srcdir)/configure.ac
58am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 57am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
59 $(ACLOCAL_M4) 58 $(ACLOCAL_M4)
60mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 59mkinstalldirs = $(install_sh) -d
61CONFIG_HEADER = $(top_builddir)/config.h 60CONFIG_HEADER = $(top_builddir)/config.h
62CONFIG_CLEAN_FILES = 61CONFIG_CLEAN_FILES =
63CONFIG_CLEAN_VPATH_FILES = 62CONFIG_CLEAN_VPATH_FILES =
@@ -206,6 +205,8 @@ EVAS_LIBS = @EVAS_LIBS@
206EVIL_CFLAGS = @EVIL_CFLAGS@ 205EVIL_CFLAGS = @EVIL_CFLAGS@
207EVIL_LIBS = @EVIL_LIBS@ 206EVIL_LIBS = @EVIL_LIBS@
208EXEEXT = @EXEEXT@ 207EXEEXT = @EXEEXT@
208EXOTIC_CFLAGS = @EXOTIC_CFLAGS@
209EXOTIC_LIBS = @EXOTIC_LIBS@
209FGREP = @FGREP@ 210FGREP = @FGREP@
210GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ 211GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
211GLIB_CFLAGS = @GLIB_CFLAGS@ 212GLIB_CFLAGS = @GLIB_CFLAGS@
@@ -261,6 +262,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
261PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 262PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
262PIXMAN_LIBS = @PIXMAN_LIBS@ 263PIXMAN_LIBS = @PIXMAN_LIBS@
263PKG_CONFIG = @PKG_CONFIG@ 264PKG_CONFIG = @PKG_CONFIG@
265PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
266PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
264POSUB = @POSUB@ 267POSUB = @POSUB@
265RANLIB = @RANLIB@ 268RANLIB = @RANLIB@
266SCIM_CFLAGS = @SCIM_CFLAGS@ 269SCIM_CFLAGS = @SCIM_CFLAGS@
@@ -271,6 +274,7 @@ SDL_LIBS = @SDL_LIBS@
271SED = @SED@ 274SED = @SED@
272SET_MAKE = @SET_MAKE@ 275SET_MAKE = @SET_MAKE@
273SHELL = @SHELL@ 276SHELL = @SHELL@
277SHM_OPEN_LIBS = @SHM_OPEN_LIBS@
274SSL_CFLAGS = @SSL_CFLAGS@ 278SSL_CFLAGS = @SSL_CFLAGS@
275SSL_LIBS = @SSL_LIBS@ 279SSL_LIBS = @SSL_LIBS@
276STRIP = @STRIP@ 280STRIP = @STRIP@
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_atoms.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_atoms.c
index 769ffac..ec2daaf 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_atoms.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_atoms.c
@@ -249,7 +249,20 @@ static Xcb_Atom atoms[] =
249 { "_E_ILLUME_QUICKPANEL_ZONE", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE }, 249 { "_E_ILLUME_QUICKPANEL_ZONE", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE },
250 { "_E_ILLUME_QUICKPANEL_POSITION_UPDATE", 250 { "_E_ILLUME_QUICKPANEL_POSITION_UPDATE",
251 &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE }, 251 &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE },
252 252 { "_E_ILLUME_INDICATOR_STATE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE },
253 { "_E_ILLUME_INDICATOR_ON", &ECORE_X_ATOM_E_ILLUME_INDICATOR_ON },
254 { "_E_ILLUME_INDICATOR_OFF", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF },
255 { "_E_ILLUME_INDICATOR_OPACITY_MODE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE },
256 { "_E_ILLUME_INDICATOR_OPAQUE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE },
257 { "_E_ILLUME_INDICATOR_TRANSLUCENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT },
258 { "_E_ILLUME_INDICATOR_TRANSPARENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT },
259 { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
260 { "_E_ILLUME_ROTATE_WINDOW_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
261 { "_E_ILLUME_ROTATE_ROOT_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE },
262 { "_E_ILLUME_CLIPBOARD_STATE", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE },
263 { "_E_ILLUME_CLIPBOARD_ON", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON },
264 { "_E_ILLUME_CLIPBOARD_OFF", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF },
265 { "_E_ILLUME_CLIPBOARD_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY },
253 { "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER }, 266 { "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER },
254 { "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE }, 267 { "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE },
255 { "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED }, 268 { "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED },
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c
index c868f5e..60bfc9c 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c
@@ -7,6 +7,8 @@ static Ecore_X_Atom _ecore_xcb_e_quickpanel_atom_get(Ecore_X_
7static Ecore_X_Illume_Quickpanel_State _ecore_xcb_e_quickpanel_state_get(Ecore_X_Atom atom); 7static Ecore_X_Illume_Quickpanel_State _ecore_xcb_e_quickpanel_state_get(Ecore_X_Atom atom);
8static Ecore_X_Atom _ecore_xcb_e_illume_atom_get(Ecore_X_Illume_Mode mode); 8static Ecore_X_Atom _ecore_xcb_e_illume_atom_get(Ecore_X_Illume_Mode mode);
9static Ecore_X_Illume_Mode _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom); 9static Ecore_X_Illume_Mode _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom);
10static Ecore_X_Atom _ecore_xcb_e_indicator_atom_get(Ecore_X_Illume_Indicator_State state);
11static Ecore_X_Illume_Indicator_State _ecore_xcb_e_indicator_state_get(Ecore_X_Atom atom);
10 12
11EAPI void 13EAPI void
12ecore_x_e_init(void) 14ecore_x_e_init(void)
@@ -719,6 +721,99 @@ ecore_x_e_illume_quickpanel_state_toggle(Ecore_X_Window win)
719 0, 0, 0, 0, 0); 721 0, 0, 0, 0, 0);
720} 722}
721 723
724static Ecore_X_Atom
725_ecore_xcb_e_clipboard_atom_get(Ecore_X_Illume_Clipboard_State state)
726{
727 switch (state)
728 {
729 case ECORE_X_ILLUME_CLIPBOARD_STATE_ON:
730 return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON;
731 case ECORE_X_ILLUME_CLIPBOARD_STATE_OFF:
732 return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF;
733 default:
734 break;
735 }
736 return 0;
737}
738
739static Ecore_X_Illume_Clipboard_State
740_ecore_xcb_e_clipboard_state_get(Ecore_X_Atom atom)
741{
742 if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON)
743 return ECORE_X_ILLUME_CLIPBOARD_STATE_ON;
744
745 if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF)
746 return ECORE_X_ILLUME_CLIPBOARD_STATE_OFF;
747
748 return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
749}
750
751EAPI void
752ecore_x_e_illume_clipboard_state_set(Ecore_X_Window win,
753 Ecore_X_Illume_Clipboard_State state)
754{
755 Ecore_X_Atom atom = 0;
756
757 LOGFN(__FILE__, __LINE__, __FUNCTION__);
758 atom = _ecore_xcb_e_clipboard_atom_get(state);
759
760 ecore_x_window_prop_atom_set(win,
761 ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
762 &atom, 1);
763}
764
765EAPI Ecore_X_Illume_Clipboard_State
766ecore_x_e_illume_clipboard_state_get(Ecore_X_Window win)
767{
768 Ecore_X_Atom atom = 0;
769
770 LOGFN(__FILE__, __LINE__, __FUNCTION__);
771
772 if (!ecore_x_window_prop_atom_get(win,
773 ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
774 &atom, 1))
775 return ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN;
776 return _ecore_xcb_e_clipboard_state_get(atom);
777}
778
779EAPI void
780ecore_x_e_illume_clipboard_geometry_set(Ecore_X_Window win,
781 int x, int y, int w, int h)
782{
783 unsigned int geom[4];
784
785 LOGFN(__FILE__, __LINE__, __FUNCTION__);
786 geom[0] = x;
787 geom[1] = y;
788 geom[2] = w;
789 geom[3] = h;
790 ecore_x_window_prop_card32_set(win,
791 ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
792 geom, 4);
793}
794
795EAPI Eina_Bool
796ecore_x_e_illume_clipboard_geometry_get(Ecore_X_Window win,
797 int *x, int *y, int *w, int *h)
798{
799 int ret = 0;
800 unsigned int geom[4];
801
802 LOGFN(__FILE__, __LINE__, __FUNCTION__);
803 ret =
804 ecore_x_window_prop_card32_get(win,
805 ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
806 geom, 4);
807 if (ret != 4) return EINA_FALSE;
808
809 if (x) *x = geom[0];
810 if (y) *y = geom[1];
811 if (w) *w = geom[2];
812 if (h) *h = geom[3];
813
814 return EINA_TRUE;
815}
816
722EAPI void 817EAPI void
723ecore_x_e_illume_mode_set(Ecore_X_Window win, 818ecore_x_e_illume_mode_set(Ecore_X_Window win,
724 Ecore_X_Illume_Mode mode) 819 Ecore_X_Illume_Mode mode)
@@ -1069,3 +1164,144 @@ _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom)
1069 return ECORE_X_ILLUME_MODE_UNKNOWN; 1164 return ECORE_X_ILLUME_MODE_UNKNOWN;
1070} 1165}
1071 1166
1167static Ecore_X_Atom
1168_ecore_xcb_e_indicator_atom_get(Ecore_X_Illume_Indicator_State state)
1169{
1170 switch (state)
1171 {
1172 case ECORE_X_ILLUME_INDICATOR_STATE_ON:
1173 return ECORE_X_ATOM_E_ILLUME_INDICATOR_ON;
1174
1175 case ECORE_X_ILLUME_INDICATOR_STATE_OFF:
1176 return ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF;
1177
1178 default:
1179 break;
1180 }
1181 return 0;
1182}
1183
1184static Ecore_X_Illume_Indicator_State
1185_ecore_xcb_e_indicator_state_get(Ecore_X_Atom atom)
1186{
1187 if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_ON)
1188 return ECORE_X_ILLUME_INDICATOR_STATE_ON;
1189 if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF)
1190 return ECORE_X_ILLUME_INDICATOR_STATE_OFF;
1191
1192 return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
1193}
1194
1195EAPI void
1196ecore_x_e_illume_indicator_state_set(Ecore_X_Window win,
1197 Ecore_X_Illume_Indicator_State state)
1198{
1199 Ecore_X_Atom atom = 0;
1200
1201 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1202
1203 atom = _ecore_xcb_e_indicator_atom_get(state);
1204 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
1205 &atom, 1);
1206}
1207
1208EAPI Ecore_X_Illume_Indicator_State
1209ecore_x_e_illume_indicator_state_get(Ecore_X_Window win)
1210{
1211 Ecore_X_Atom atom = 0;
1212
1213 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1214
1215 if (!ecore_x_window_prop_atom_get(win,
1216 ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
1217 &atom, 1))
1218 return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
1219
1220 return _ecore_xcb_e_indicator_state_get(atom);
1221}
1222
1223EAPI void
1224ecore_x_e_illume_indicator_state_send(Ecore_X_Window win,
1225 Ecore_X_Illume_Indicator_State state)
1226{
1227 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1228 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
1229 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
1230 _ecore_xcb_e_indicator_atom_get(state),
1231 0, 0, 0, 0);
1232}
1233
1234static Ecore_X_Atom
1235_ecore_x_e_indicator_opacity_atom_get(Ecore_X_Illume_Indicator_Opacity_Mode mode)
1236{
1237 switch (mode)
1238 {
1239 case ECORE_X_ILLUME_INDICATOR_OPAQUE:
1240 return ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
1241
1242 case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT:
1243 return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
1244
1245 case ECORE_X_ILLUME_INDICATOR_TRANSPARENT:
1246 return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
1247
1248 default:
1249 break;
1250 }
1251 return 0;
1252}
1253
1254static Ecore_X_Illume_Indicator_Opacity_Mode
1255_ecore_x_e_indicator_opacity_get(Ecore_X_Atom atom)
1256{
1257 if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE)
1258 return ECORE_X_ILLUME_INDICATOR_OPAQUE;
1259
1260 if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT)
1261 return ECORE_X_ILLUME_INDICATOR_TRANSLUCENT;
1262
1263 if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT)
1264 return ECORE_X_ILLUME_INDICATOR_TRANSPARENT;
1265
1266 return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
1267}
1268
1269EAPI void
1270ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
1271 Ecore_X_Illume_Indicator_Opacity_Mode mode)
1272{
1273 Ecore_X_Atom atom = 0;
1274
1275 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1276 atom = _ecore_x_e_indicator_opacity_atom_get(mode);
1277 ecore_x_window_prop_atom_set(win,
1278 ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
1279 &atom, 1);
1280}
1281
1282EAPI Ecore_X_Illume_Indicator_Opacity_Mode
1283ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win)
1284{
1285 Ecore_X_Atom atom;
1286
1287 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1288 if (!ecore_x_window_prop_atom_get(win,
1289 ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
1290 &atom, 1))
1291 return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
1292
1293 return _ecore_x_e_indicator_opacity_get(atom);
1294}
1295
1296EAPI void
1297ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
1298 Ecore_X_Illume_Indicator_Opacity_Mode mode)
1299{
1300 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1301 ecore_x_client_message32_send(win,
1302 ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
1303 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
1304 _ecore_x_e_indicator_opacity_atom_get(mode),
1305 0, 0, 0, 0);
1306}
1307
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_keymap.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_keymap.c
index 40304df..b1c7528 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_keymap.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_keymap.c
@@ -279,6 +279,14 @@ ecore_x_keysym_string_get(int keysym)
279 return _ecore_xcb_keymap_keysym_to_string(keysym); 279 return _ecore_xcb_keymap_keysym_to_string(keysym);
280} 280}
281 281
282EAPI int
283ecore_x_keysym_keycode_get(const char *keyname)
284{
285 LOGFN(__FILE__, __LINE__, __FUNCTION__);
286
287 return _ecore_xcb_keymap_string_to_keycode(keyname);
288}
289
282/* local functions */ 290/* local functions */
283static int 291static int
284_ecore_xcb_keymap_mask_get(void *reply, 292_ecore_xcb_keymap_mask_get(void *reply,
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
index 0a523b9..b1e0622 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
@@ -838,6 +838,56 @@ ecore_x_netwm_icon_name_set(Ecore_X_Window win,
838 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, name); 838 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, name);
839} 839}
840 840
841EAPI void
842ecore_x_netwm_icons_set(Ecore_X_Window win,
843 Ecore_X_Icon *icon,
844 int num)
845{
846 unsigned int *data, *p, *p2;
847 unsigned int i, size, x, y;
848
849 LOGFN(__FILE__, __LINE__, __FUNCTION__);
850 size = 0;
851 for (i = 0; i < (unsigned int)num; i++)
852 {
853 size += 2 + (icon[i].width * icon[i].height);
854 }
855 data = malloc(size * sizeof(unsigned int));
856 if (!data) return;
857 p = data;
858 for (i = 0; i < (unsigned int)num; i++)
859 {
860 p[0] = icon[i].width;
861 p[1] = icon[i].height;
862 p += 2;
863 p2 = icon[i].data;
864 for (y = 0; y < icon[i].height; y++)
865 {
866 for (x = 0; x < icon[i].width; x++)
867 {
868 unsigned int r, g, b, a;
869
870 a = (*p2 >> 24) & 0xff;
871 r = (*p2 >> 16) & 0xff;
872 g = (*p2 >> 8 ) & 0xff;
873 b = (*p2 ) & 0xff;
874 if ((a > 0) && (a < 255))
875 {
876 r = (r * 255) / a;
877 g = (g * 255) / a;
878 b = (b * 255) / a;
879 }
880 *p = (a << 24) | (r << 16) | (g << 8) | b;
881 p++;
882 p2++;
883 }
884 }
885 }
886 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON,
887 data, size);
888 free(data);
889}
890
841EAPI Eina_Bool 891EAPI Eina_Bool
842ecore_x_netwm_icons_get(Ecore_X_Window win, 892ecore_x_netwm_icons_get(Ecore_X_Window win,
843 Ecore_X_Icon **icon, 893 Ecore_X_Icon **icon,
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index 62f7618..81a7c3f 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -1,7 +1,6 @@
1/* TODO: List of missing functions 1/* TODO: List of missing functions
2 * 2 *
3 * ecore_x_randr_crtc_clone_set 3 * ecore_x_randr_crtc_clone_set
4 * ecore_x_randr_output_size_mm_get
5 * ecore_x_randr_output_crtc_set 4 * ecore_x_randr_output_crtc_set
6 * ecore_x_randr_edid_version_get 5 * ecore_x_randr_edid_version_get
7 * ecore_x_randr_edid_info_has_valid_checksum 6 * ecore_x_randr_edid_info_has_valid_checksum
@@ -776,6 +775,24 @@ ecore_x_randr_output_modes_get(Ecore_X_Window root,
776 return modes; 775 return modes;
777} 776}
778 777
778EAPI Eina_Bool
779ecore_x_randr_output_mode_add(Ecore_X_Randr_Output output, Ecore_X_Randr_Mode mode)
780{
781 LOGFN(__FILE__, __LINE__, __FUNCTION__);
782 CHECK_XCB_CONN;
783
784#ifdef ECORE_XCB_RANDR
785 RANDR_CHECK_1_2_RET(EINA_FALSE);
786
787 if ((output == Ecore_X_Randr_None) || (mode == Ecore_X_Randr_None))
788 return EINA_FALSE;
789
790 xcb_randr_add_output_mode(_ecore_xcb_conn, output, mode);
791 return EINA_TRUE;
792#endif
793 return EINA_FALSE;
794}
795
779/* 796/*
780 * @brief get detailed information for a given mode id 797 * @brief get detailed information for a given mode id
781 * @param root window which's screen's ressources are queried 798 * @param root window which's screen's ressources are queried
@@ -805,6 +822,63 @@ ecore_x_randr_mode_info_get(Ecore_X_Window root,
805} 822}
806 823
807/* 824/*
825 * @brief add a mode to a display
826 * @param root window to which's screen's ressources are added
827 * @param mode_info
828 * @return Ecore_X_Randr_Mode of the added mode. Ecore_X_Randr_None if mode
829 * adding failed.
830 * @since 1.2.0
831 */
832EAPI Ecore_X_Randr_Mode
833ecore_x_randr_mode_info_add(Ecore_X_Window root, Ecore_X_Randr_Mode_Info *mode_info)
834{
835#ifdef ECORE_XCB_RANDR
836 Ecore_X_Randr_Mode mode = Ecore_X_Randr_None;
837 xcb_randr_create_mode_cookie_t cookie;
838 xcb_randr_create_mode_reply_t *reply;
839 xcb_randr_mode_info_t info;
840 int namelen = 0;
841#endif
842
843 LOGFN(__FILE__, __LINE__, __FUNCTION__);
844 CHECK_XCB_CONN;
845
846#ifdef ECORE_XCB_RANDR
847 RANDR_CHECK_1_2_RET(EINA_FALSE);
848
849 if (!mode_info) return Ecore_X_Randr_None;
850 if (!_ecore_xcb_randr_root_validate(root)) return Ecore_X_Randr_None;
851
852 namelen = strlen(mode_info->name);
853
854 memset(&info, 0, sizeof(info));
855 info.width = mode_info->width;
856 info.height = mode_info->height;
857 info.dot_clock = mode_info->dotClock;
858 info.hsync_start = mode_info->hSyncStart;
859 info.hsync_end = mode_info->hSyncEnd;
860 info.htotal = mode_info->hTotal;
861 info.hskew = mode_info->hSkew;
862 info.vsync_start = mode_info->vSyncStart;
863 info.vsync_end = mode_info->vSyncEnd;
864 info.vtotal = mode_info->vTotal;
865 info.mode_flags = mode_info->modeFlags;
866 info.name_len = namelen;
867
868 cookie =
869 xcb_randr_create_mode_unchecked(_ecore_xcb_conn, root, info,
870 namelen, mode_info->name);
871 reply = xcb_randr_create_mode_reply(_ecore_xcb_conn, cookie, NULL);
872 if (reply)
873 {
874 mode = mode_info->xid;
875 free(reply);
876 }
877#endif
878 return mode;
879}
880
881/*
808 * @brief get detailed information for all modes related to a root window's screen 882 * @brief get detailed information for all modes related to a root window's screen
809 * @param root window which's screen's ressources are queried 883 * @param root window which's screen's ressources are queried
810 * @param num number of modes returned 884 * @param num number of modes returned
@@ -1057,6 +1131,53 @@ ecore_x_randr_output_crtc_get(Ecore_X_Window root,
1057 return Ecore_X_Randr_None; 1131 return Ecore_X_Randr_None;
1058} 1132}
1059 1133
1134EAPI void
1135ecore_x_randr_output_size_mm_get(Ecore_X_Window root, Ecore_X_Randr_Output output, int *w_mm, int *h_mm)
1136{
1137#ifdef ECORE_XCB_RANDR
1138 xcb_randr_get_output_info_cookie_t ocookie;
1139 xcb_randr_get_output_info_reply_t *oreply;
1140 xcb_timestamp_t timestamp = 0;
1141#endif
1142
1143 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1144 CHECK_XCB_CONN;
1145
1146 if (w_mm) *w_mm = 0;
1147 if (h_mm) *h_mm = 0;
1148
1149#ifdef ECORE_XCB_RANDR
1150 RANDR_CHECK_1_2_RET();
1151
1152 if ((output != Ecore_X_Randr_None) && (_randr_version >= RANDR_1_3))
1153 {
1154 xcb_randr_get_screen_resources_current_reply_t *reply;
1155
1156 reply = _ecore_xcb_randr_13_get_resources(root);
1157 timestamp = reply->config_timestamp;
1158 free(reply);
1159 }
1160 else if ((output != Ecore_X_Randr_None) && (_randr_version == RANDR_1_2))
1161 {
1162 xcb_randr_get_screen_resources_reply_t *reply;
1163
1164 reply = _ecore_xcb_randr_12_get_resources(root);
1165 timestamp = reply->config_timestamp;
1166 free(reply);
1167 }
1168
1169 ocookie =
1170 xcb_randr_get_output_info_unchecked(_ecore_xcb_conn, output, timestamp);
1171 oreply = xcb_randr_get_output_info_reply(_ecore_xcb_conn, ocookie, NULL);
1172 if (oreply)
1173 {
1174 if (w_mm) *w_mm = oreply->mm_width;
1175 if (h_mm) *h_mm = oreply->mm_height;
1176 free(oreply);
1177 }
1178#endif
1179}
1180
1060/** 1181/**
1061 * @brief sets the demanded parameters for a given CRTC. Note that the CRTC is 1182 * @brief sets the demanded parameters for a given CRTC. Note that the CRTC is
1062 * auto enabled in it's preferred mode, when it was disabled before. 1183 * auto enabled in it's preferred mode, when it was disabled before.
@@ -1439,6 +1560,87 @@ ecore_x_randr_crtcs_get(Ecore_X_Window root,
1439} 1560}
1440 1561
1441/* 1562/*
1563 * @deprecated bad naming. Use ecore_x_randr_window_crtcs_get instead.
1564 * @brief get the CRTCs, which display a certain window
1565 * @param window window the displaying CRTCs shall be found for
1566 * @param num the number of CRTCs displaying the window
1567 * @return array of CRTCs that display a certain window. NULL if no CRTCs
1568 * was found that displays the specified window.
1569 */
1570EAPI Ecore_X_Randr_Crtc *
1571ecore_x_randr_current_crtc_get(Ecore_X_Window window,
1572 int *num)
1573{
1574 return ecore_x_randr_window_crtcs_get(window, num);
1575}
1576
1577/*
1578 * @brief get the CRTCs, which display a certain window
1579 * @param window window the displaying crtcs shall be found for
1580 * @param num the number of crtcs displaying the window
1581 * @return array of crtcs that display a certain window. NULL if no crtcs
1582 * was found that displays the specified window.
1583 * @since 1.2.0
1584 */
1585EAPI Ecore_X_Randr_Crtc *
1586ecore_x_randr_window_crtcs_get(Ecore_X_Window window,
1587 int *num)
1588{
1589#ifdef ECORE_XCB_RANDR
1590 Ecore_X_Window root;
1591 Eina_Rectangle w_geo, c_geo;
1592 Ecore_X_Randr_Crtc *crtcs, *ret = NULL;
1593 Ecore_X_Randr_Mode mode;
1594 int ncrtcs, i, nret = 0;
1595 xcb_translate_coordinates_cookie_t cookie;
1596 xcb_translate_coordinates_reply_t *trans;
1597#endif
1598
1599 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1600 CHECK_XCB_CONN;
1601
1602#ifdef ECORE_XCB_RANDR
1603 RANDR_CHECK_1_2_RET(NULL);
1604
1605 ecore_x_window_geometry_get(window, &w_geo.x, &w_geo.y, &w_geo.w, &w_geo.h);
1606
1607 root = ecore_x_window_root_get(window);
1608 crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs);
1609 if (!crtcs) return NULL;
1610
1611 /* now get window RELATIVE to root window - thats what matters. */
1612 cookie = xcb_translate_coordinates(_ecore_xcb_conn, window, root, 0, 0);
1613 trans = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
1614 w_geo.x = trans->dst_x;
1615 w_geo.y = trans->dst_y;
1616 free(trans);
1617
1618 for (i = 0, nret = 0; i < ncrtcs; i++)
1619 {
1620 /* if crtc is not enabled, don't bother about it any further */
1621 mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
1622 if (mode == Ecore_X_Randr_None) continue;
1623
1624 ecore_x_randr_crtc_geometry_get(root, crtcs[i], &c_geo.x, &c_geo.y,
1625 &c_geo.w, &c_geo.h);
1626 if (eina_rectangles_intersect(&w_geo, &c_geo))
1627 {
1628 ret = realloc(ret, (++nret *
1629 sizeof(Ecore_X_Randr_Output)));
1630 ret[nret] = crtcs[i];
1631 }
1632 }
1633 free(crtcs);
1634
1635 if (num) *num = nret;
1636 return ret;
1637
1638#endif
1639 if (num) *num = 0;
1640 return NULL;
1641}
1642
1643/*
1442 * @brief get a CRTC's outputs. 1644 * @brief get a CRTC's outputs.
1443 * @param root the root window which's screen will be queried 1645 * @param root the root window which's screen will be queried
1444 * @param num number of outputs referenced by given CRTC 1646 * @param num number of outputs referenced by given CRTC
@@ -2172,6 +2374,22 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
2172} 2374}
2173 2375
2174/* 2376/*
2377 * @deprecated bad naming. Use ecore_x_randr_window_outputs_get instead.
2378 * @brief get the outputs, which display a certain window
2379 * @param window window the displaying outputs shall be found for
2380 * @param num the number of outputs displaying the window
2381 * @return array of outputs that display a certain window. NULL if no outputs
2382 * was found that displays the specified window.
2383 */
2384
2385Ecore_X_Randr_Output *
2386ecore_x_randr_current_output_get(Ecore_X_Window window,
2387 int *num)
2388{
2389 return ecore_x_randr_window_outputs_get(window, num);
2390}
2391
2392/*
2175 * @brief get the outputs, which display a certain window 2393 * @brief get the outputs, which display a certain window
2176 * @param window window the displaying outputs shall be found for 2394 * @param window window the displaying outputs shall be found for
2177 * @param num the number of outputs displaying the window 2395 * @param num the number of outputs displaying the window
@@ -2184,13 +2402,9 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window,
2184{ 2402{
2185#ifdef ECORE_XCB_RANDR 2403#ifdef ECORE_XCB_RANDR
2186 Ecore_X_Window root; 2404 Ecore_X_Window root;
2187 Eina_Rectangle w_geo, c_geo;
2188 Ecore_X_Randr_Crtc *crtcs; 2405 Ecore_X_Randr_Crtc *crtcs;
2189 Ecore_X_Randr_Mode mode; 2406 Ecore_X_Randr_Output *outputs, *ret = NULL;
2190 Ecore_X_Randr_Output *outputs, *ret = NULL, *tret;
2191 int ncrtcs, noutputs, i, nret = 0; 2407 int ncrtcs, noutputs, i, nret = 0;
2192 xcb_translate_coordinates_cookie_t cookie;
2193 xcb_translate_coordinates_reply_t *trans;
2194#endif 2408#endif
2195 2409
2196 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2410 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2199,64 +2413,36 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window,
2199 if (num) *num = 0; 2413 if (num) *num = 0;
2200 2414
2201#ifdef ECORE_XCB_RANDR 2415#ifdef ECORE_XCB_RANDR
2202 RANDR_CHECK_1_2_RET(NULL); 2416 if (_randr_version < RANDR_1_2) goto _ecore_x_randr_current_output_get_fail;
2203
2204 ecore_x_window_geometry_get(window, &w_geo.x, &w_geo.y, &w_geo.w, &w_geo.h);
2205 2417
2206 root = ecore_x_window_root_get(window); 2418 root = ecore_x_window_root_get(window);
2207 crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs); 2419 if (!(crtcs = ecore_x_randr_window_crtcs_get(window, &ncrtcs)))
2208 if (!crtcs) return NULL; 2420 goto _ecore_x_randr_current_output_get_fail;
2209 2421
2210 /* now get window RELATIVE to root window - thats what matters. */ 2422 for (i = 0, nret = 0; i < ncrtcs; i++)
2211 cookie = xcb_translate_coordinates(_ecore_xcb_conn, window, root, 0, 0);
2212 trans = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
2213 w_geo.x = trans->dst_x;
2214 w_geo.y = trans->dst_y;
2215 free(trans);
2216
2217 for (i = 0; i < ncrtcs; i++)
2218 { 2423 {
2219 /* if crtc is not enabled, don't bother about it any further */
2220 mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
2221 if (mode == Ecore_X_Randr_None) continue;
2222 2424
2223 ecore_x_randr_crtc_geometry_get(root, crtcs[i], &c_geo.x, &c_geo.y, 2425 outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
2224 &c_geo.w, &c_geo.h); 2426 &noutputs);
2225 if (eina_rectangles_intersect(&w_geo, &c_geo)) 2427 if (!outputs)
2226 { 2428 goto _ecore_x_randr_current_output_get_fail_free;
2227 outputs = 2429 nret += noutputs;
2228 ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs); 2430 ret = realloc(ret, (nret * sizeof(Ecore_X_Randr_Output)));
2229 /* The case below should be impossible, but for safety reasons 2431 memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
2230 * remains */ 2432 free(outputs);
2231 if (!outputs)
2232 {
2233 if (num) *num = 0;
2234 free(ret);
2235 free(crtcs);
2236 return NULL;
2237 }
2238 tret = realloc(ret, ((nret + noutputs) *
2239 sizeof(Ecore_X_Randr_Output)));
2240 if (!tret)
2241 {
2242 if (num) *num = 0;
2243 free(outputs);
2244 free(ret);
2245 free(crtcs);
2246 return NULL;
2247 }
2248 ret = tret;
2249 memcpy(&ret[nret], outputs,
2250 (noutputs * sizeof(Ecore_X_Randr_Output)));
2251 nret += noutputs;
2252 free(outputs);
2253 }
2254 } 2433 }
2255 free(crtcs); 2434 free(crtcs);
2256 2435
2257 if (num) *num = nret; 2436 if (num)
2437 *num = nret;
2438
2258 return ret; 2439 return ret;
2259 2440
2441_ecore_x_randr_current_output_get_fail_free:
2442 free(outputs);
2443 free(crtcs);
2444 free(ret);
2445_ecore_x_randr_current_output_get_fail:
2260#endif 2446#endif
2261 if (num) *num = 0; 2447 if (num) *num = 0;
2262 return NULL; 2448 return NULL;
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
index 27bceaf..3458729 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c
@@ -651,7 +651,7 @@ ecore_x_window_depth_get(Ecore_X_Window win)
651 * @c _NET_WM_PID. 651 * @c _NET_WM_PID.
652 * 652 *
653 * @param win The given window. 653 * @param win The given window.
654 * @ingroup Ecore_X_Window_Properties_Groups 654 * @ingroup Ecore_X_Window_Properties_Group
655 */ 655 */
656EAPI void 656EAPI void
657ecore_x_window_defaults_set(Ecore_X_Window win) 657ecore_x_window_defaults_set(Ecore_X_Window win)
@@ -1119,7 +1119,7 @@ ecore_x_window_save_set_del(Ecore_X_Window win)
1119} 1119}
1120 1120
1121/** 1121/**
1122 * gets the focus to the window @p win. 1122 * gets the window that has focus.
1123 * @return The window that has focus. 1123 * @return The window that has focus.
1124 * @ingroup Ecore_X_Window_Focus_Functions 1124 * @ingroup Ecore_X_Window_Focus_Functions
1125 */ 1125 */