aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib')
-rw-r--r--libraries/ecore/src/lib/Makefile.am4
-rw-r--r--libraries/ecore/src/lib/Makefile.in33
-rw-r--r--libraries/ecore/src/lib/ecore/Ecore.h572
-rw-r--r--libraries/ecore/src/lib/ecore/Makefile.am1
-rw-r--r--libraries/ecore/src/lib/ecore/Makefile.in45
-rw-r--r--libraries/ecore/src/lib/ecore/ecore.c24
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_alloc.c132
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_anim.c19
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_events.c25
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_getopt.c11
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_glib.c8
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_idle_enterer.c9
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_idle_exiter.c7
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_idler.c7
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_job.c9
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_main.c33
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_pipe.c9
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_poll.c17
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_private.h29
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_thread.c15
-rw-r--r--libraries/ecore/src/lib/ecore/ecore_timer.c46
-rw-r--r--libraries/ecore/src/lib/ecore_cocoa/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_con/Ecore_Con.h124
-rw-r--r--libraries/ecore/src/lib/ecore_con/Makefile.am1
-rw-r--r--libraries/ecore/src/lib/ecore_con/Makefile.in38
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con.c646
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_alloc.c4
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_ares.c14
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_info.c9
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_local_win32.c29
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_private.h101
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_socks.c496
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_ssl.c471
-rw-r--r--libraries/ecore/src/lib/ecore_con/ecore_con_url.c734
-rw-r--r--libraries/ecore/src/lib/ecore_config/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_directfb/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_directfb/ecore_directfb.c70
-rw-r--r--libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h263
-rw-r--r--libraries/ecore/src/lib/ecore_evas/Makefile.am38
-rw-r--r--libraries/ecore/src/lib/ecore_evas/Makefile.in57
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas.c153
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c164
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c4
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c5
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c2152
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c22
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h52
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c46
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c3
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_util.c12
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c1131
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c1257
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c8
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c53
-rw-r--r--libraries/ecore/src/lib/ecore_fb/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_fb/ecore_fb_li.c8
-rw-r--r--libraries/ecore/src/lib/ecore_fb/ecore_fb_private.h3
-rw-r--r--libraries/ecore/src/lib/ecore_file/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_file/ecore_file.c17
-rw-r--r--libraries/ecore/src/lib/ecore_file/ecore_file_download.c3
-rw-r--r--libraries/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c1
-rw-r--r--libraries/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c1
-rw-r--r--libraries/ecore/src/lib/ecore_file/ecore_file_path.c3
-rw-r--r--libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h19
-rw-r--r--libraries/ecore/src/lib/ecore_imf/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c141
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h9
-rw-r--r--libraries/ecore/src/lib/ecore_imf_evas/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_input/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_input_evas/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_input_evas/ecore_input_evas.c1
-rw-r--r--libraries/ecore/src/lib/ecore_ipc/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c3
-rw-r--r--libraries/ecore/src/lib/ecore_psl1ght/Ecore_Psl1ght.h13
-rw-r--r--libraries/ecore/src/lib/ecore_psl1ght/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_psl1ght/ecore_psl1ght.c111
-rw-r--r--libraries/ecore/src/lib/ecore_sdl/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h123
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/Makefile.am31
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/Makefile.in829
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/ecore_wl.c1213
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/ecore_wl_private.h85
-rw-r--r--libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h36
-rw-r--r--libraries/ecore/src/lib/ecore_win32/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32.c61
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c192
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h19
-rw-r--r--libraries/ecore/src/lib/ecore_wince/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_x/Ecore_X.h7
-rw-r--r--libraries/ecore/src/lib/ecore_x/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_damage.c2
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c5
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dpms.c6
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c14
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_icccm.c3
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_randr.c45
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_window.c5
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c14
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/Makefile.in14
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c324
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c18
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c42
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c24
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c12
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c86
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c32
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c26
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_e.c232
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c36
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_events.c421
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c99
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c10
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gesture.c18
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c248
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_image.c100
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c10
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c424
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c40
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c49
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c339
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c46
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c9
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c40
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c24
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c333
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c30
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_test.c8
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c38
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window.c344
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c190
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c150
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c10
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c6
134 files changed, 12681 insertions, 3610 deletions
diff --git a/libraries/ecore/src/lib/Makefile.am b/libraries/ecore/src/lib/Makefile.am
index b13bc18..d43ad75 100644
--- a/libraries/ecore/src/lib/Makefile.am
+++ b/libraries/ecore/src/lib/Makefile.am
@@ -46,6 +46,10 @@ if BUILD_ECORE_COCOA
46SUBDIRS += ecore_cocoa 46SUBDIRS += ecore_cocoa
47endif 47endif
48 48
49if BUILD_ECORE_WAYLAND
50SUBDIRS += ecore_wayland
51endif
52
49if BUILD_ECORE_IPC 53if BUILD_ECORE_IPC
50SUBDIRS += ecore_ipc 54SUBDIRS += ecore_ipc
51endif 55endif
diff --git a/libraries/ecore/src/lib/Makefile.in b/libraries/ecore/src/lib/Makefile.in
index b351087..09271c2 100644
--- a/libraries/ecore/src/lib/Makefile.in
+++ b/libraries/ecore/src/lib/Makefile.in
@@ -44,12 +44,13 @@ host_triplet = @host@
44@BUILD_ECORE_SDL_TRUE@am__append_9 = ecore_sdl 44@BUILD_ECORE_SDL_TRUE@am__append_9 = ecore_sdl
45@BUILD_ECORE_PSL1GHT_TRUE@am__append_10 = ecore_psl1ght 45@BUILD_ECORE_PSL1GHT_TRUE@am__append_10 = ecore_psl1ght
46@BUILD_ECORE_COCOA_TRUE@am__append_11 = ecore_cocoa 46@BUILD_ECORE_COCOA_TRUE@am__append_11 = ecore_cocoa
47@BUILD_ECORE_IPC_TRUE@am__append_12 = ecore_ipc 47@BUILD_ECORE_WAYLAND_TRUE@am__append_12 = ecore_wayland
48@BUILD_ECORE_EVAS_TRUE@am__append_13 = ecore_evas 48@BUILD_ECORE_IPC_TRUE@am__append_13 = ecore_ipc
49@BUILD_ECORE_CONFIG_TRUE@am__append_14 = ecore_config 49@BUILD_ECORE_EVAS_TRUE@am__append_14 = ecore_evas
50@BUILD_ECORE_FILE_TRUE@am__append_15 = ecore_file 50@BUILD_ECORE_CONFIG_TRUE@am__append_15 = ecore_config
51@BUILD_ECORE_IMF_TRUE@am__append_16 = ecore_imf 51@BUILD_ECORE_FILE_TRUE@am__append_16 = ecore_file
52@BUILD_ECORE_IMF_EVAS_TRUE@am__append_17 = ecore_imf_evas 52@BUILD_ECORE_IMF_TRUE@am__append_17 = ecore_imf
53@BUILD_ECORE_IMF_EVAS_TRUE@am__append_18 = ecore_imf_evas
53subdir = src/lib 54subdir = src/lib
54DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 55DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
55ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 56ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -101,8 +102,8 @@ ETAGS = etags
101CTAGS = ctags 102CTAGS = ctags
102DIST_SUBDIRS = ecore ecore_input ecore_input_evas ecore_fb \ 103DIST_SUBDIRS = ecore ecore_input ecore_input_evas ecore_fb \
103 ecore_directfb ecore_con ecore_x ecore_win32 ecore_wince \ 104 ecore_directfb ecore_con ecore_x ecore_win32 ecore_wince \
104 ecore_sdl ecore_psl1ght ecore_cocoa ecore_ipc ecore_evas \ 105 ecore_sdl ecore_psl1ght ecore_cocoa ecore_wayland ecore_ipc \
105 ecore_config ecore_file ecore_imf ecore_imf_evas 106 ecore_evas ecore_config ecore_file ecore_imf ecore_imf_evas
106DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 107DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
107am__relativize = \ 108am__relativize = \
108 dir0=`pwd`; \ 109 dir0=`pwd`; \
@@ -247,10 +248,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
248PIXMAN_LIBS = @PIXMAN_LIBS@ 249PIXMAN_LIBS = @PIXMAN_LIBS@
249PKG_CONFIG = @PKG_CONFIG@ 250PKG_CONFIG = @PKG_CONFIG@
250PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
251PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
252POSUB = @POSUB@ 251POSUB = @POSUB@
253RANLIB = @RANLIB@ 252RANLIB = @RANLIB@
253SCIM_CFLAGS = @SCIM_CFLAGS@
254SCIM_LIBS = @SCIM_LIBS@
254SDL_CFLAGS = @SDL_CFLAGS@ 255SDL_CFLAGS = @SDL_CFLAGS@
255SDL_CONFIG = @SDL_CONFIG@ 256SDL_CONFIG = @SDL_CONFIG@
256SDL_LIBS = @SDL_LIBS@ 257SDL_LIBS = @SDL_LIBS@
@@ -269,6 +270,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
269USE_NLS = @USE_NLS@ 270USE_NLS = @USE_NLS@
270VERSION = @VERSION@ 271VERSION = @VERSION@
271VMAJ = @VMAJ@ 272VMAJ = @VMAJ@
273WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
274WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
275WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
276WAYLAND_LIBS = @WAYLAND_LIBS@
272WIN32_CFLAGS = @WIN32_CFLAGS@ 277WIN32_CFLAGS = @WIN32_CFLAGS@
273WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
274WIN32_LIBS = @WIN32_LIBS@ 279WIN32_LIBS = @WIN32_LIBS@
@@ -382,6 +387,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
382ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
383ecore_imf_evas_libs = @ecore_imf_evas_libs@ 388ecore_imf_evas_libs = @ecore_imf_evas_libs@
384ecore_imf_libs = @ecore_imf_libs@ 389ecore_imf_libs = @ecore_imf_libs@
390ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
391ecore_imf_scim_libs = @ecore_imf_scim_libs@
385ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 392ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
386ecore_imf_xim_libs = @ecore_imf_xim_libs@ 393ecore_imf_xim_libs = @ecore_imf_xim_libs@
387ecore_input_cflags = @ecore_input_cflags@ 394ecore_input_cflags = @ecore_input_cflags@
@@ -394,6 +401,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
394ecore_psl1ght_libs = @ecore_psl1ght_libs@ 401ecore_psl1ght_libs = @ecore_psl1ght_libs@
395ecore_sdl_cflags = @ecore_sdl_cflags@ 402ecore_sdl_cflags = @ecore_sdl_cflags@
396ecore_sdl_libs = @ecore_sdl_libs@ 403ecore_sdl_libs = @ecore_sdl_libs@
404ecore_wayland_cflags = @ecore_wayland_cflags@
405ecore_wayland_libs = @ecore_wayland_libs@
397ecore_win32_cflags = @ecore_win32_cflags@ 406ecore_win32_cflags = @ecore_win32_cflags@
398ecore_win32_libs = @ecore_win32_libs@ 407ecore_win32_libs = @ecore_win32_libs@
399ecore_wince_cflags = @ecore_wince_cflags@ 408ecore_wince_cflags = @ecore_wince_cflags@
@@ -438,12 +447,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
438requirements_ecore_file = @requirements_ecore_file@ 447requirements_ecore_file = @requirements_ecore_file@
439requirements_ecore_imf = @requirements_ecore_imf@ 448requirements_ecore_imf = @requirements_ecore_imf@
440requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 449requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
450requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
441requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 451requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
442requirements_ecore_input = @requirements_ecore_input@ 452requirements_ecore_input = @requirements_ecore_input@
443requirements_ecore_input_evas = @requirements_ecore_input_evas@ 453requirements_ecore_input_evas = @requirements_ecore_input_evas@
444requirements_ecore_ipc = @requirements_ecore_ipc@ 454requirements_ecore_ipc = @requirements_ecore_ipc@
445requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 455requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
446requirements_ecore_sdl = @requirements_ecore_sdl@ 456requirements_ecore_sdl = @requirements_ecore_sdl@
457requirements_ecore_wayland = @requirements_ecore_wayland@
447requirements_ecore_win32 = @requirements_ecore_win32@ 458requirements_ecore_win32 = @requirements_ecore_win32@
448requirements_ecore_wince = @requirements_ecore_wince@ 459requirements_ecore_wince = @requirements_ecore_wince@
449requirements_ecore_x = @requirements_ecore_x@ 460requirements_ecore_x = @requirements_ecore_x@
@@ -466,7 +477,7 @@ SUBDIRS = ecore $(am__append_1) $(am__append_2) $(am__append_3) \
466 $(am__append_7) $(am__append_8) $(am__append_9) \ 477 $(am__append_7) $(am__append_8) $(am__append_9) \
467 $(am__append_10) $(am__append_11) $(am__append_12) \ 478 $(am__append_10) $(am__append_11) $(am__append_12) \
468 $(am__append_13) $(am__append_14) $(am__append_15) \ 479 $(am__append_13) $(am__append_14) $(am__append_15) \
469 $(am__append_16) $(am__append_17) 480 $(am__append_16) $(am__append_17) $(am__append_18)
470all: all-recursive 481all: all-recursive
471 482
472.SUFFIXES: 483.SUFFIXES:
diff --git a/libraries/ecore/src/lib/ecore/Ecore.h b/libraries/ecore/src/lib/ecore/Ecore.h
index fe4e631..fbe4dda 100644
--- a/libraries/ecore/src/lib/ecore/Ecore.h
+++ b/libraries/ecore/src/lib/ecore/Ecore.h
@@ -95,13 +95,23 @@
95 @author Mike McCormack <mj.mccormack@samsung.com> 95 @author Mike McCormack <mj.mccormack@samsung.com>
96 @author Sangho Park <gouache95@gmail.com> 96 @author Sangho Park <gouache95@gmail.com>
97 @author Jihoon Kim <jihoon48.kim@samsung.com> <imfine98@gmail.com> 97 @author Jihoon Kim <jihoon48.kim@samsung.com> <imfine98@gmail.com>
98 @author PnB <Poor.NewBie@gmail.com>
98 @author Daniel Juyung Seo <seojuyung2@gmail.com> <juyung.seo@samsung.com> 99 @author Daniel Juyung Seo <seojuyung2@gmail.com> <juyung.seo@samsung.com>
100 @author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
101 @author ChunEon Park <hermet@hermet.pe.kr>
102 @author xlopez@igalia.com
103 @author Rafael Antognolli <antognolli@profusion.mobi>
104 @author Kim Yunhan <spbear@gmail.com>
105 @author Youness Alaoui <kakaroto@kakaroto.homelinux.net>
106 @author Bluezery <ohpowel@gmail.com>
107 @author Doyoun Kang <wayofmine@gmail.com> <doyoun.kang@samsung.com>
108 @author Haifeng Deng <haifeng.deng@samsung.com>
99 109
100 Please contact <enlightenment-devel@lists.sourceforge.net> to get in 110 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
101 contact with the developers and maintainers. 111 contact with the developers and maintainers.
102 */ 112 */
103 113
104/* 114/**
105 @page Ecore_Main_Loop_Page The Ecore Main Loop 115 @page Ecore_Main_Loop_Page The Ecore Main Loop
106 116
107 @section intro What is Ecore? 117 @section intro What is Ecore?
@@ -315,10 +325,8 @@ extern "C" {
315 * @{ 325 * @{
316 */ 326 */
317 327
318EAPI int 328EAPI int ecore_init(void);
319 ecore_init(void); 329EAPI int ecore_shutdown(void);
320EAPI int
321 ecore_shutdown(void);
322 330
323/** 331/**
324 * @} 332 * @}
@@ -390,28 +398,21 @@ EAPI extern Ecore_Version *ecore_version;
390typedef Eina_Bool (*Ecore_Task_Cb)(void *data); 398typedef Eina_Bool (*Ecore_Task_Cb)(void *data);
391 399
392/** 400/**
393 * @typedef Ecore_Eselect_Function Ecore_Eselect_Function 401 * @typedef Ecore_Eselect_Function
394 * A function which can be used to replace select() in the main loop 402 * A function which can be used to replace select() in the main loop
395 */ 403 */
396typedef int (*Ecore_Select_Function)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); 404typedef int (*Ecore_Select_Function)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
397 405
398EAPI void 406EAPI void ecore_main_loop_iterate(void);
399ecore_main_loop_iterate(void);
400 407
401EAPI void 408EAPI void ecore_main_loop_select_func_set(Ecore_Select_Function func);
402 ecore_main_loop_select_func_set(Ecore_Select_Function func); 409EAPI Ecore_Select_Function ecore_main_loop_select_func_get(void);
403EAPI Ecore_Select_Function
404 ecore_main_loop_select_func_get(void);
405 410
406EAPI Eina_Bool 411EAPI Eina_Bool ecore_main_loop_glib_integrate(void);
407 ecore_main_loop_glib_integrate(void); 412EAPI void ecore_main_loop_glib_always_integrate_disable(void);
408EAPI void
409 ecore_main_loop_glib_always_integrate_disable(void);
410 413
411EAPI void 414EAPI void ecore_main_loop_begin(void);
412 ecore_main_loop_begin(void); 415EAPI void ecore_main_loop_quit(void);
413EAPI void
414 ecore_main_loop_quit(void);
415 416
416/** 417/**
417 * @typedef Ecore_Cb Ecore_Cb 418 * @typedef Ecore_Cb Ecore_Cb
@@ -441,9 +442,7 @@ typedef void *(*Ecore_Data_Cb)(void *data);
441 * in the thread, it is owned by the main loop and your callback should take 442 * in the thread, it is owned by the main loop and your callback should take
442 * care of freeing it if necessary. 443 * care of freeing it if necessary.
443 */ 444 */
444EAPI void 445EAPI void ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data);
445ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
446 void *data);
447 446
448/** 447/**
449 * @brief Call callback synchronously in the main loop. 448 * @brief Call callback synchronously in the main loop.
@@ -460,9 +459,7 @@ ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
460 * Remember this function will block until the callback is executed in the 459 * Remember this function will block until the callback is executed in the
461 * main loop. It can take time and you have no guaranty about the timeline. 460 * main loop. It can take time and you have no guaranty about the timeline.
462 */ 461 */
463EAPI void * 462EAPI void *ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, void *data);
464ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
465 void *data);
466 463
467/** 464/**
468 * @brief This function suspend the main loop in a know state 465 * @brief This function suspend the main loop in a know state
@@ -482,8 +479,7 @@ ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
482 * We still advise you, when possible, to use ecore_main_loop_thread_safe_call_async() 479 * We still advise you, when possible, to use ecore_main_loop_thread_safe_call_async()
483 * as it will not block the thread nor the main loop. 480 * as it will not block the thread nor the main loop.
484 */ 481 */
485EAPI int 482EAPI int ecore_thread_main_loop_begin(void);
486ecore_thread_main_loop_begin(void);
487 483
488/** 484/**
489 * @brief Unlock the main loop. 485 * @brief Unlock the main loop.
@@ -496,8 +492,7 @@ ecore_thread_main_loop_begin(void);
496 * After a call to ecore_thread_main_loop_begin(), you need to absolutly 492 * After a call to ecore_thread_main_loop_begin(), you need to absolutly
497 * call ecore_thread_main_loop_end(), or you application will stay frozen. 493 * call ecore_thread_main_loop_end(), or you application will stay frozen.
498 */ 494 */
499EAPI int 495EAPI int ecore_thread_main_loop_end(void);
500ecore_thread_main_loop_end(void);
501 496
502/** 497/**
503 * @} 498 * @}
@@ -631,37 +626,17 @@ struct _Ecore_Event_Signal_Realtime /** Realtime event */
631#endif 626#endif
632}; 627};
633 628
634EAPI Ecore_Event_Handler * 629EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data);
635ecore_event_handler_add(int type, 630EAPI void *ecore_event_handler_del(Ecore_Event_Handler *event_handler);
636 Ecore_Event_Handler_Cb func, 631EAPI Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data);
637 const void *data); 632EAPI void *ecore_event_del(Ecore_Event *event);
638EAPI void * 633EAPI void *ecore_event_handler_data_get(Ecore_Event_Handler *eh);
639 ecore_event_handler_del(Ecore_Event_Handler *event_handler); 634EAPI void *ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void *data);
640EAPI Ecore_Event * 635EAPI int ecore_event_type_new(void);
641 ecore_event_add(int type, 636EAPI Ecore_Event_Filter *ecore_event_filter_add(Ecore_Data_Cb func_start, Ecore_Filter_Cb func_filter, Ecore_End_Cb func_end, const void *data);
642 void *ev, 637EAPI void *ecore_event_filter_del(Ecore_Event_Filter *ef);
643 Ecore_End_Cb func_free, 638EAPI int ecore_event_current_type_get(void);
644 void *data); 639EAPI void *ecore_event_current_event_get(void);
645EAPI void *
646 ecore_event_del(Ecore_Event *event);
647EAPI void *
648 ecore_event_handler_data_get(Ecore_Event_Handler *eh);
649EAPI void *
650 ecore_event_handler_data_set(Ecore_Event_Handler *eh,
651 const void *data);
652EAPI int
653 ecore_event_type_new(void);
654EAPI Ecore_Event_Filter *
655 ecore_event_filter_add(Ecore_Data_Cb func_start,
656 Ecore_Filter_Cb func_filter,
657 Ecore_End_Cb func_end,
658 const void *data);
659EAPI void *
660 ecore_event_filter_del(Ecore_Event_Filter *ef);
661EAPI int
662 ecore_event_current_type_get(void);
663EAPI void *
664 ecore_event_current_event_get(void);
665 640
666/** 641/**
667 * @} 642 * @}
@@ -702,11 +677,11 @@ typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
702 677
703enum _Ecore_Exe_Win32_Priority 678enum _Ecore_Exe_Win32_Priority
704{ 679{
705 ECORE_EXE_WIN32_PRIORITY_IDLE, /**< Idle priority, for monitoring the system */ 680 ECORE_EXE_WIN32_PRIORITY_IDLE, /**< Idle priority, for monitoring the system */
706 ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL, /**< Below default priority */ 681 ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL, /**< Below default priority */
707 ECORE_EXE_WIN32_PRIORITY_NORMAL, /**< Default priority */ 682 ECORE_EXE_WIN32_PRIORITY_NORMAL, /**< Default priority */
708 ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL, /**< Above default priority */ 683 ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL, /**< Above default priority */
709 ECORE_EXE_WIN32_PRIORITY_HIGH, /**< High priority, use with care as other threads in the system will not get processor time */ 684 ECORE_EXE_WIN32_PRIORITY_HIGH, /**< High priority, use with care as other threads in the system will not get processor time */
710 ECORE_EXE_WIN32_PRIORITY_REALTIME /**< Realtime priority, should be almost never used as it can interrupt system threads that manage mouse input, keyboard input, and background disk flushing */ 685 ECORE_EXE_WIN32_PRIORITY_REALTIME /**< Realtime priority, should be almost never used as it can interrupt system threads that manage mouse input, keyboard input, and background disk flushing */
711}; 686};
712typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority; 687typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority;
@@ -759,72 +734,32 @@ struct _Ecore_Exe_Event_Data /** Data from a child process event */
759 Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buffered, the last one has it's line member set to NULL */ 734 Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buffered, the last one has it's line member set to NULL */
760}; 735};
761 736
762EAPI void 737EAPI void ecore_exe_run_priority_set(int pri);
763 ecore_exe_run_priority_set(int pri); 738EAPI int ecore_exe_run_priority_get(void);
764EAPI int 739EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
765 ecore_exe_run_priority_get(void); 740EAPI Ecore_Exe *ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data);
766EAPI Ecore_Exe * 741EAPI void ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func);
767 ecore_exe_run(const char *exe_cmd, 742EAPI Eina_Bool ecore_exe_send(Ecore_Exe *exe, const void *data, int size);
768 const void *data); 743EAPI void ecore_exe_close_stdin(Ecore_Exe *exe);
769EAPI Ecore_Exe * 744EAPI void ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines);
770ecore_exe_pipe_run(const char *exe_cmd, 745EAPI Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags);
771 Ecore_Exe_Flags flags, 746EAPI void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data);
772 const void *data); 747EAPI void *ecore_exe_free(Ecore_Exe *exe);
773EAPI void 748EAPI pid_t ecore_exe_pid_get(const Ecore_Exe *exe);
774ecore_exe_callback_pre_free_set(Ecore_Exe *exe, 749EAPI void ecore_exe_tag_set(Ecore_Exe *exe, const char *tag);
775 Ecore_Exe_Cb func); 750EAPI const char *ecore_exe_tag_get(const Ecore_Exe *exe);
776EAPI Eina_Bool 751EAPI const char *ecore_exe_cmd_get(const Ecore_Exe *exe);
777ecore_exe_send(Ecore_Exe *exe, 752EAPI void *ecore_exe_data_get(const Ecore_Exe *exe);
778 const void *data, 753EAPI void *ecore_exe_data_set(Ecore_Exe *exe, void *data);
779 int size); 754EAPI Ecore_Exe_Flags ecore_exe_flags_get(const Ecore_Exe *exe);
780EAPI void 755EAPI void ecore_exe_pause(Ecore_Exe *exe);
781 ecore_exe_close_stdin(Ecore_Exe *exe); 756EAPI void ecore_exe_continue(Ecore_Exe *exe);
782EAPI void 757EAPI void ecore_exe_interrupt(Ecore_Exe *exe);
783 ecore_exe_auto_limits_set(Ecore_Exe *exe, 758EAPI void ecore_exe_quit(Ecore_Exe *exe);
784 int start_bytes, 759EAPI void ecore_exe_terminate(Ecore_Exe *exe);
785 int end_bytes, 760EAPI void ecore_exe_kill(Ecore_Exe *exe);
786 int start_lines, 761EAPI void ecore_exe_signal(Ecore_Exe *exe, int num);
787 int end_lines); 762EAPI void ecore_exe_hup(Ecore_Exe *exe);
788EAPI Ecore_Exe_Event_Data *
789ecore_exe_event_data_get(Ecore_Exe *exe,
790 Ecore_Exe_Flags flags);
791EAPI void
792 ecore_exe_event_data_free(Ecore_Exe_Event_Data *data);
793EAPI void *
794 ecore_exe_free(Ecore_Exe *exe);
795EAPI pid_t
796 ecore_exe_pid_get(const Ecore_Exe *exe);
797EAPI void
798 ecore_exe_tag_set(Ecore_Exe *exe,
799 const char *tag);
800EAPI const char *
801 ecore_exe_tag_get(const Ecore_Exe *exe);
802EAPI const char *
803 ecore_exe_cmd_get(const Ecore_Exe *exe);
804EAPI void *
805 ecore_exe_data_get(const Ecore_Exe *exe);
806EAPI void *
807 ecore_exe_data_set(Ecore_Exe *exe,
808 void *data);
809EAPI Ecore_Exe_Flags
810 ecore_exe_flags_get(const Ecore_Exe *exe);
811EAPI void
812 ecore_exe_pause(Ecore_Exe *exe);
813EAPI void
814 ecore_exe_continue(Ecore_Exe *exe);
815EAPI void
816 ecore_exe_interrupt(Ecore_Exe *exe);
817EAPI void
818 ecore_exe_quit(Ecore_Exe *exe);
819EAPI void
820 ecore_exe_terminate(Ecore_Exe *exe);
821EAPI void
822 ecore_exe_kill(Ecore_Exe *exe);
823EAPI void
824 ecore_exe_signal(Ecore_Exe *exe,
825 int num);
826EAPI void
827ecore_exe_hup(Ecore_Exe *exe);
828 763
829/** 764/**
830 * @} 765 * @}
@@ -839,7 +774,7 @@ ecore_exe_hup(Ecore_Exe *exe);
839 * for data available for reading, for the availability to write 774 * for data available for reading, for the availability to write
840 * without blocking, and for errors on the file descriptor. 775 * without blocking, and for errors on the file descriptor.
841 * 776 *
842 * ecore_main_fd_handler_add() is used to setup a handler for a 777 *ecore_main_fd_handler_add() is used to setup a handler for a
843 * given file descriptor. This file descriptor can be the standard 778 * given file descriptor. This file descriptor can be the standard
844 * input, a network socket, a stream received through some driver 779 * input, a network socket, a stream received through some driver
845 * of a hardware decoder, etc. Thus it can contain errors, like a 780 * of a hardware decoder, etc. Thus it can contain errors, like a
@@ -888,34 +823,15 @@ typedef void (*Ecore_Fd_Prep_Cb)(void *data, Ecore_Fd_Handler *fd_handler);
888 */ 823 */
889typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler *wh); 824typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler *wh);
890 825
891EAPI Ecore_Fd_Handler * 826EAPI Ecore_Fd_Handler *ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func, const void *data, Ecore_Fd_Cb buf_func, const void *buf_data);
892ecore_main_fd_handler_add(int fd, 827EAPI void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data);
893 Ecore_Fd_Handler_Flags flags, 828EAPI void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
894 Ecore_Fd_Cb func, 829EAPI int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler);
895 const void *data, 830EAPI Eina_Bool ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
896 Ecore_Fd_Cb buf_func, 831EAPI void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
897 const void *buf_data); 832
898EAPI void 833EAPI Ecore_Win32_Handler *ecore_main_win32_handler_add(void *h, Ecore_Win32_Handle_Cb func, const void *data);
899ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, 834EAPI void *ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
900 Ecore_Fd_Prep_Cb func,
901 const void *data);
902EAPI void *
903 ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
904EAPI int
905 ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler);
906EAPI Eina_Bool
907 ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler,
908 Ecore_Fd_Handler_Flags flags);
909EAPI void
910ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
911 Ecore_Fd_Handler_Flags flags);
912
913EAPI Ecore_Win32_Handler *
914ecore_main_win32_handler_add(void *h,
915 Ecore_Win32_Handle_Cb func,
916 const void *data);
917EAPI void *
918ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
919 835
920/** 836/**
921 * @} 837 * @}
@@ -930,7 +846,7 @@ ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
930 * areound a core poll interval. For now only 1 core poller type is 846 * areound a core poll interval. For now only 1 core poller type is
931 * supprted: ECORE_POLLER_CORE 847 * supprted: ECORE_POLLER_CORE
932 * 848 *
933 * Example of @ref Ecore_Poller: 849 * Example of @ref Ecore_Poller :
934 * @li @ref ecore_poller_example_c 850 * @li @ref ecore_poller_example_c
935 * 851 *
936 * @ingroup Ecore_Main_Loop_Group 852 * @ingroup Ecore_Main_Loop_Group
@@ -946,21 +862,11 @@ typedef enum _Ecore_Poller_Type Ecore_Poller_Type;
946 862
947typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */ 863typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */
948 864
949EAPI void 865EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time);
950ecore_poller_poll_interval_set(Ecore_Poller_Type type, 866EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type);
951 double poll_time); 867EAPI Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval);
952EAPI double 868EAPI int ecore_poller_poller_interval_get(Ecore_Poller *poller);
953 ecore_poller_poll_interval_get(Ecore_Poller_Type type); 869EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data);
954EAPI Eina_Bool
955 ecore_poller_poller_interval_set(Ecore_Poller *poller,
956 int interval);
957EAPI int
958 ecore_poller_poller_interval_get(Ecore_Poller *poller);
959EAPI Ecore_Poller *
960 ecore_poller_add(Ecore_Poller_Type type,
961 int interval,
962 Ecore_Task_Cb func,
963 const void *data);
964EAPI void *ecore_poller_del(Ecore_Poller *poller); 870EAPI void *ecore_poller_del(Ecore_Poller *poller);
965 871
966/** 872/**
@@ -984,14 +890,14 @@ EAPI void *ecore_poller_del(Ecore_Poller *poller);
984 * ... do some more animating ... 890 * ... do some more animating ...
985 * } 891 * }
986 * ... 892 * ...
987 * ecore_animator_timeline_add(2, _do_animation, my_evas_object); 893 *ecore_animator_timeline_add(2, _do_animation, my_evas_object);
988 * @endcode 894 * @endcode
989 * In the sample above we create an animation to move 895 * In the sample above we create an animation to move
990 * @c my_evas_object from position (0,0) to (100,100) in 2 seconds. 896 * @c my_evas_object from position (0,0) to (100,100) in 2 seconds.
991 * 897 *
992 * If your animation will run for an unspecified amount of time you 898 * If your animation will run for an unspecified amount of time you
993 * can use ecore_animator_add(), which is like using 899 * can use ecore_animator_add(), which is like using
994 * ecore_timer_add() with the interval being the 900 *ecore_timer_add() with the interval being the
995 * @ref ecore_animator_frametime_set "framerate". Note that this has 901 * @ref ecore_animator_frametime_set "framerate". Note that this has
996 * tangible benefits to creating a timer for each animation in terms 902 * tangible benefits to creating a timer for each animation in terms
997 * of performance. 903 * of performance.
@@ -1057,8 +963,7 @@ typedef Eina_Bool (*Ecore_Timeline_Cb)(void *data, double pos);
1057 * @see ecore_animator_timeline_add() 963 * @see ecore_animator_timeline_add()
1058 * @see ecore_animator_frametime_set() 964 * @see ecore_animator_frametime_set()
1059 */ 965 */
1060EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, 966EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, const void *data);
1061 const void *data);
1062/** 967/**
1063 * @brief Add a animator that runs for a limited time 968 * @brief Add a animator that runs for a limited time
1064 * 969 *
@@ -1086,10 +991,7 @@ EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func,
1086 * @see ecore_animator_pos_map() 991 * @see ecore_animator_pos_map()
1087 * @since 1.1.0 992 * @since 1.1.0
1088 */ 993 */
1089EAPI Ecore_Animator * 994EAPI Ecore_Animator *ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data);
1090ecore_animator_timeline_add(double runtime,
1091 Ecore_Timeline_Cb func,
1092 const void *data);
1093/** 995/**
1094 * @brief Delete the specified animator from the animator list. 996 * @brief Delete the specified animator from the animator list.
1095 * 997 *
@@ -1103,8 +1005,7 @@ ecore_animator_timeline_add(double runtime,
1103 * is invalid and should not be used again. It will not get called again after 1005 * is invalid and should not be used again. It will not get called again after
1104 * deletion. 1006 * deletion.
1105 */ 1007 */
1106EAPI void * 1008EAPI void *ecore_animator_del(Ecore_Animator *animator);
1107ecore_animator_del(Ecore_Animator *animator);
1108/** 1009/**
1109 * @brief Suspend the specified animator. 1010 * @brief Suspend the specified animator.
1110 * 1011 *
@@ -1115,12 +1016,11 @@ ecore_animator_del(Ecore_Animator *animator);
1115 * 1016 *
1116 * @warning Freezing an animator doesn't freeze accounting of how long that 1017 * @warning Freezing an animator doesn't freeze accounting of how long that
1117 * animator has been running. Therefore if the animator was created with 1018 * animator has been running. Therefore if the animator was created with
1118 * ecore_animator_timeline_add() the @p pos argument given to the callback 1019 *ecore_animator_timeline_add() the @p pos argument given to the callback
1119 * will increase as if the animator hadn't been frozen and the animator may 1020 * will increase as if the animator hadn't been frozen and the animator may
1120 * have it's execution halted if @p runtime elapsed. 1021 * have it's execution halted if @p runtime elapsed.
1121 */ 1022 */
1122EAPI void 1023EAPI void ecore_animator_freeze(Ecore_Animator *animator);
1123ecore_animator_freeze(Ecore_Animator *animator);
1124/** 1024/**
1125 * @brief Restore execution of the specified animator. 1025 * @brief Restore execution of the specified animator.
1126 * 1026 *
@@ -1129,8 +1029,7 @@ ecore_animator_freeze(Ecore_Animator *animator);
1129 * The specified @p animator will be put back in the set of animators that are 1029 * The specified @p animator will be put back in the set of animators that are
1130 * executed during main loop. 1030 * executed during main loop.
1131 */ 1031 */
1132EAPI void 1032EAPI void ecore_animator_thaw(Ecore_Animator *animator);
1133ecore_animator_thaw(Ecore_Animator *animator);
1134/** 1033/**
1135 * @brief Set the animator call interval in seconds. 1034 * @brief Set the animator call interval in seconds.
1136 * 1035 *
@@ -1144,8 +1043,7 @@ ecore_animator_thaw(Ecore_Animator *animator);
1144 * 1043 *
1145 * @note The default @p frametime value is 1/30th of a second. 1044 * @note The default @p frametime value is 1/30th of a second.
1146 */ 1045 */
1147EAPI void 1046EAPI void ecore_animator_frametime_set(double frametime);
1148ecore_animator_frametime_set(double frametime);
1149/** 1047/**
1150 * @brief Get the animator call interval in seconds. 1048 * @brief Get the animator call interval in seconds.
1151 * 1049 *
@@ -1155,8 +1053,7 @@ ecore_animator_frametime_set(double frametime);
1155 * 1053 *
1156 * @see ecore_animator_frametime_set() 1054 * @see ecore_animator_frametime_set()
1157 */ 1055 */
1158EAPI double 1056EAPI double ecore_animator_frametime_get(void);
1159ecore_animator_frametime_get(void);
1160/** 1057/**
1161 * @brief Maps an input position from 0.0 to 1.0 along a timeline to a 1058 * @brief Maps an input position from 0.0 to 1.0 along a timeline to a
1162 * position in a different curve. 1059 * position in a different curve.
@@ -1217,11 +1114,7 @@ ecore_animator_frametime_get(void);
1217 * 1114 *
1218 * @since 1.1.0 1115 * @since 1.1.0
1219 */ 1116 */
1220EAPI double 1117EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2);
1221ecore_animator_pos_map(double pos,
1222 Ecore_Pos_Map map,
1223 double v1,
1224 double v2);
1225/** 1118/**
1226 * @brief Set the source of animator ticks for the mainloop 1119 * @brief Set the source of animator ticks for the mainloop
1227 * 1120 *
@@ -1238,14 +1131,13 @@ ecore_animator_pos_map(double pos,
1238 * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some input 1131 * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some input
1239 * tick source (like another application via ipc, some vertical blanking 1132 * tick source (like another application via ipc, some vertical blanking
1240 * interrupt interrupt etc.) using 1133 * interrupt interrupt etc.) using
1241 * ecore_animator_custom_source_tick_begin_callback_set() and 1134 *ecore_animator_custom_source_tick_begin_callback_set() and
1242 * ecore_animator_custom_source_tick_end_callback_set() to set the functions 1135 *ecore_animator_custom_source_tick_end_callback_set() to set the functions
1243 * that will be called to start and stop the ticking source, which when it 1136 * that will be called to start and stop the ticking source, which when it
1244 * gets a "tick" should call ecore_animator_custom_tick() to make the "tick" over 1 1137 * gets a "tick" should call ecore_animator_custom_tick() to make the "tick" over 1
1245 * frame. 1138 * frame.
1246 */ 1139 */
1247EAPI void 1140EAPI void ecore_animator_source_set(Ecore_Animator_Source source);
1248ecore_animator_source_set(Ecore_Animator_Source source);
1249/** 1141/**
1250 * @brief Get the animator source currently set. 1142 * @brief Get the animator source currently set.
1251 * 1143 *
@@ -1255,8 +1147,7 @@ ecore_animator_source_set(Ecore_Animator_Source source);
1255 * 1147 *
1256 * @see ecore_animator_source_set() 1148 * @see ecore_animator_source_set()
1257 */ 1149 */
1258EAPI Ecore_Animator_Source 1150EAPI Ecore_Animator_Source ecore_animator_source_get(void);
1259ecore_animator_source_get(void);
1260/** 1151/**
1261 * @brief Set the function that begins a custom animator tick source 1152 * @brief Set the function that begins a custom animator tick source
1262 * 1153 *
@@ -1266,7 +1157,7 @@ ecore_animator_source_get(void);
1266 * The Ecore Animator infrastructure handles tracking if animators are needed 1157 * The Ecore Animator infrastructure handles tracking if animators are needed
1267 * or not and which ones need to be called and when, but when the tick source 1158 * or not and which ones need to be called and when, but when the tick source
1268 * is custom, you have to provide a tick source by calling 1159 * is custom, you have to provide a tick source by calling
1269 * ecore_animator_custom_tick() to indicate a frame tick happened. In order 1160 *ecore_animator_custom_tick() to indicate a frame tick happened. In order
1270 * to allow the source of ticks to be dynamically enabled or disabled as 1161 * to allow the source of ticks to be dynamically enabled or disabled as
1271 * needed, the @p func when set is called to enable the tick source to 1162 * needed, the @p func when set is called to enable the tick source to
1272 * produce tick events that call ecore_animator_custom_tick(). If @p func 1163 * produce tick events that call ecore_animator_custom_tick(). If @p func
@@ -1276,9 +1167,7 @@ ecore_animator_source_get(void);
1276 * @see ecore_animator_custom_source_tick_end_callback_set() 1167 * @see ecore_animator_custom_source_tick_end_callback_set()
1277 * @see ecore_animator_custom_tick() 1168 * @see ecore_animator_custom_tick()
1278 */ 1169 */
1279EAPI void 1170EAPI void ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data);
1280ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
1281 const void *data);
1282/** 1171/**
1283 * @brief Set the function that ends a custom animator tick source 1172 * @brief Set the function that ends a custom animator tick source
1284 * 1173 *
@@ -1286,18 +1175,16 @@ ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
1286 * @param data The data passed to the tick end function as its parameter 1175 * @param data The data passed to the tick end function as its parameter
1287 * 1176 *
1288 * This function is a matching pair to the function set by 1177 * This function is a matching pair to the function set by
1289 * ecore_animator_custom_source_tick_begin_callback_set() and is called 1178 *ecore_animator_custom_source_tick_begin_callback_set() and is called
1290 * when ticking is to stop. If @p func is NULL then no function will be 1179 * when ticking is to stop. If @p func is NULL then no function will be
1291 * called to stop ticking. For more information please see 1180 * called to stop ticking. For more information please see
1292 * ecore_animator_custom_source_tick_begin_callback_set(). 1181 *ecore_animator_custom_source_tick_begin_callback_set().
1293 * 1182 *
1294 * @see ecore_animator_source_set() 1183 * @see ecore_animator_source_set()
1295 * @see ecore_animator_custom_source_tick_begin_callback_set() 1184 * @see ecore_animator_custom_source_tick_begin_callback_set()
1296 * @see ecore_animator_custom_tick() 1185 * @see ecore_animator_custom_tick()
1297 */ 1186 */
1298EAPI void 1187EAPI void ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data);
1299ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
1300 const void *data);
1301/** 1188/**
1302 * @brief Trigger a custom animator tick 1189 * @brief Trigger a custom animator tick
1303 * 1190 *
@@ -1311,8 +1198,7 @@ ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
1311 * @see ecore_animator_custom_source_tick_begin_callback_set 1198 * @see ecore_animator_custom_source_tick_begin_callback_set
1312 * @see ecore_animator_custom_source_tick_end_callback_set()() 1199 * @see ecore_animator_custom_source_tick_end_callback_set()()
1313 */ 1200 */
1314EAPI void 1201EAPI void ecore_animator_custom_tick(void);
1315ecore_animator_custom_tick(void);
1316 1202
1317/** 1203/**
1318 * @} 1204 * @}
@@ -1338,43 +1224,23 @@ ecore_animator_custom_tick(void);
1338 1224
1339typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */ 1225typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */
1340 1226
1341EAPI double 1227EAPI double ecore_time_get(void);
1342 ecore_time_get(void); 1228EAPI double ecore_time_unix_get(void);
1343EAPI double 1229EAPI double ecore_loop_time_get(void);
1344 ecore_time_unix_get(void); 1230
1345EAPI double 1231EAPI Ecore_Timer *ecore_timer_add(double in, Ecore_Task_Cb func, const void *data);
1346 ecore_loop_time_get(void); 1232EAPI Ecore_Timer *ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data);
1347 1233EAPI void *ecore_timer_del(Ecore_Timer *timer);
1348EAPI Ecore_Timer * 1234EAPI void ecore_timer_interval_set(Ecore_Timer *timer, double in);
1349ecore_timer_add(double in, 1235EAPI double ecore_timer_interval_get(Ecore_Timer *timer);
1350 Ecore_Task_Cb func, 1236EAPI void ecore_timer_freeze(Ecore_Timer *timer);
1351 const void *data); 1237EAPI void ecore_timer_thaw(Ecore_Timer *timer);
1352EAPI Ecore_Timer * 1238EAPI void ecore_timer_delay(Ecore_Timer *timer, double add);
1353ecore_timer_loop_add(double in, 1239EAPI void ecore_timer_reset(Ecore_Timer *timer);
1354 Ecore_Task_Cb func, 1240EAPI double ecore_timer_pending_get(Ecore_Timer *timer);
1355 const void *data); 1241EAPI double ecore_timer_precision_get(void);
1356EAPI void * 1242EAPI void ecore_timer_precision_set(double precision);
1357 ecore_timer_del(Ecore_Timer *timer); 1243EAPI char *ecore_timer_dump(void);
1358EAPI void
1359 ecore_timer_interval_set(Ecore_Timer *timer,
1360 double in);
1361EAPI double
1362 ecore_timer_interval_get(Ecore_Timer *timer);
1363EAPI void
1364 ecore_timer_freeze(Ecore_Timer *timer);
1365EAPI void
1366 ecore_timer_thaw(Ecore_Timer *timer);
1367EAPI void
1368 ecore_timer_delay(Ecore_Timer *timer,
1369 double add);
1370EAPI double
1371 ecore_timer_pending_get(Ecore_Timer *timer);
1372EAPI double
1373 ecore_timer_precision_get(void);
1374EAPI void
1375 ecore_timer_precision_set(double precision);
1376EAPI char *
1377 ecore_timer_dump(void);
1378 1244
1379/** 1245/**
1380 * @} 1246 * @}
@@ -1443,9 +1309,7 @@ typedef struct _Ecore_Idle_Exiter Ecore_Idle_Exiter; /**< A handle for idle exi
1443 * 1309 *
1444 * Idlers are useful for progressively prossessing data without blocking. 1310 * Idlers are useful for progressively prossessing data without blocking.
1445 */ 1311 */
1446EAPI Ecore_Idler * 1312EAPI Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, const void *data);
1447ecore_idler_add(Ecore_Task_Cb func,
1448 const void *data);
1449 1313
1450/** 1314/**
1451 * Delete an idler callback from the list to be executed. 1315 * Delete an idler callback from the list to be executed.
@@ -1453,23 +1317,14 @@ ecore_idler_add(Ecore_Task_Cb func,
1453 * @return The data pointer passed to the idler callback on success. NULL 1317 * @return The data pointer passed to the idler callback on success. NULL
1454 * otherwise. 1318 * otherwise.
1455 */ 1319 */
1456EAPI void * 1320EAPI void *ecore_idler_del(Ecore_Idler *idler);
1457ecore_idler_del(Ecore_Idler *idler);
1458 1321
1459EAPI Ecore_Idle_Enterer * 1322EAPI Ecore_Idle_Enterer *ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data);
1460ecore_idle_enterer_add(Ecore_Task_Cb func, 1323EAPI Ecore_Idle_Enterer *ecore_idle_enterer_before_add(Ecore_Task_Cb func, const void *data);
1461 const void *data); 1324EAPI void *ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer);
1462EAPI Ecore_Idle_Enterer *
1463ecore_idle_enterer_before_add(Ecore_Task_Cb func,
1464 const void *data);
1465EAPI void *
1466ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer);
1467 1325
1468EAPI Ecore_Idle_Exiter * 1326EAPI Ecore_Idle_Exiter *ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data);
1469ecore_idle_exiter_add(Ecore_Task_Cb func, 1327EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
1470 const void *data);
1471EAPI void *
1472ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
1473 1328
1474/** 1329/**
1475 * @} 1330 * @}
@@ -1525,7 +1380,7 @@ ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
1525 * 1380 *
1526 * The worker function, that's the one running in the thread, also receives 1381 * The worker function, that's the one running in the thread, also receives
1527 * an ::Ecore_Thread handler that can be used with ecore_thread_cancel() and 1382 * an ::Ecore_Thread handler that can be used with ecore_thread_cancel() and
1528 * ecore_thread_check(), sharing the flag with the main loop. But this 1383 *ecore_thread_check(), sharing the flag with the main loop. But this
1529 * handler is also associated with the thread where the function is running. 1384 * handler is also associated with the thread where the function is running.
1530 * This has strong implications when working with thread local data. 1385 * This has strong implications when working with thread local data.
1531 * 1386 *
@@ -1611,7 +1466,7 @@ typedef void (*Ecore_Thread_Notify_Cb)(void *data, Ecore_Thread *thread, void *m
1611 * so here it's safe to use anything from the EFL freely. 1466 * so here it's safe to use anything from the EFL freely.
1612 * 1467 *
1613 * The thread can also be cancelled before its completion calling 1468 * The thread can also be cancelled before its completion calling
1614 * ecore_thread_cancel(), either from the main thread or @p func_blocking. 1469 *ecore_thread_cancel(), either from the main thread or @p func_blocking.
1615 * In this case, @p func_cancel will be called, also from the main thread 1470 * In this case, @p func_cancel will be called, also from the main thread
1616 * to inform of this happening. If the thread could not be created, this 1471 * to inform of this happening. If the thread could not be created, this
1617 * function will be called and it's @c thread parameter will be NULL. It's 1472 * function will be called and it's @c thread parameter will be NULL. It's
@@ -1636,11 +1491,7 @@ typedef void (*Ecore_Thread_Notify_Cb)(void *data, Ecore_Thread *thread, void *m
1636 * @see ecore_thread_reschedule() 1491 * @see ecore_thread_reschedule()
1637 * @see ecore_thread_max_set() 1492 * @see ecore_thread_max_set()
1638 */ 1493 */
1639EAPI Ecore_Thread * 1494EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Cb func_blocking, Ecore_Thread_Cb func_end, Ecore_Thread_Cb func_cancel, const void *data);
1640ecore_thread_run(Ecore_Thread_Cb func_blocking,
1641 Ecore_Thread_Cb func_end,
1642 Ecore_Thread_Cb func_cancel,
1643 const void *data);
1644/** 1495/**
1645 * Launch a thread to run a task than can talk back to the main thread 1496 * Launch a thread to run a task than can talk back to the main thread
1646 * 1497 *
@@ -1681,13 +1532,9 @@ ecore_thread_run(Ecore_Thread_Cb func_blocking,
1681 * @see ecore_thread_reschedule() 1532 * @see ecore_thread_reschedule()
1682 * @see ecore_thread_max_set() 1533 * @see ecore_thread_max_set()
1683 */ 1534 */
1684EAPI Ecore_Thread * 1535EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy, Ecore_Thread_Notify_Cb func_notify,
1685ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy, 1536 Ecore_Thread_Cb func_end, Ecore_Thread_Cb func_cancel,
1686 Ecore_Thread_Notify_Cb func_notify, 1537 const void *data, Eina_Bool try_no_queue);
1687 Ecore_Thread_Cb func_end,
1688 Ecore_Thread_Cb func_cancel,
1689 const void *data,
1690 Eina_Bool try_no_queue);
1691/** 1538/**
1692 * Cancel a running thread. 1539 * Cancel a running thread.
1693 * 1540 *
@@ -1709,9 +1556,9 @@ ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
1709 * @li The function ends and returns normally. If it hadn't been cancelled, 1556 * @li The function ends and returns normally. If it hadn't been cancelled,
1710 * @c func_end would be called here, but instead @c func_cancel will happen. 1557 * @c func_end would be called here, but instead @c func_cancel will happen.
1711 * @li The function returns after requesting to be rescheduled with 1558 * @li The function returns after requesting to be rescheduled with
1712 * ecore_thread_reschedule(). 1559 *ecore_thread_reschedule().
1713 * @li The function is prepared to leave early by checking if 1560 * @li The function is prepared to leave early by checking if
1714 * ecore_thread_check() returns EINA_TRUE. 1561 *ecore_thread_check() returns EINA_TRUE.
1715 * 1562 *
1716 * The user function can cancel itself by calling ecore_thread_cancel(), but 1563 * The user function can cancel itself by calling ecore_thread_cancel(), but
1717 * it should always use the ::Ecore_Thread handle passed to it and never 1564 * it should always use the ::Ecore_Thread handle passed to it and never
@@ -1723,8 +1570,7 @@ ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
1723 * 1570 *
1724 * @see ecore_thread_check() 1571 * @see ecore_thread_check()
1725 */ 1572 */
1726EAPI Eina_Bool 1573EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread);
1727ecore_thread_cancel(Ecore_Thread *thread);
1728/** 1574/**
1729 * Checks if a thread is pending cancellation 1575 * Checks if a thread is pending cancellation
1730 * 1576 *
@@ -1744,8 +1590,7 @@ ecore_thread_cancel(Ecore_Thread *thread);
1744 * 1590 *
1745 * @see ecore_thread_cancel() 1591 * @see ecore_thread_cancel()
1746 */ 1592 */
1747EAPI Eina_Bool 1593EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread);
1748ecore_thread_check(Ecore_Thread *thread);
1749/** 1594/**
1750 * Sends data from the worker thread to the main loop 1595 * Sends data from the worker thread to the main loop
1751 * 1596 *
@@ -1767,9 +1612,7 @@ ecore_thread_check(Ecore_Thread *thread);
1767 * 1612 *
1768 * @see ecore_thread_feedback_run() 1613 * @see ecore_thread_feedback_run()
1769 */ 1614 */
1770EAPI Eina_Bool 1615EAPI Eina_Bool ecore_thread_feedback(Ecore_Thread *thread, const void *msg_data);
1771ecore_thread_feedback(Ecore_Thread *thread,
1772 const void *msg_data);
1773/** 1616/**
1774 * Asks for the function in the thread to be called again at a later time 1617 * Asks for the function in the thread to be called again at a later time
1775 * 1618 *
@@ -1778,7 +1621,7 @@ ecore_thread_feedback(Ecore_Thread *thread,
1778 * EINA_FALSE if anything goes wrong. 1621 * EINA_FALSE if anything goes wrong.
1779 * 1622 *
1780 * This function should be called only from the same function represented 1623 * This function should be called only from the same function represented
1781 * by @pthread. 1624 * by @p thread.
1782 * 1625 *
1783 * Calling this function will mark the thread for a reschedule, so as soon 1626 * Calling this function will mark the thread for a reschedule, so as soon
1784 * as it returns, it will be added to the end of the list of pending tasks. 1627 * as it returns, it will be added to the end of the list of pending tasks.
@@ -1793,8 +1636,7 @@ ecore_thread_feedback(Ecore_Thread *thread,
1793 * Similarly, if the @p thread is cancelled, the reschedule will not take 1636 * Similarly, if the @p thread is cancelled, the reschedule will not take
1794 * effect. 1637 * effect.
1795 */ 1638 */
1796EAPI Eina_Bool 1639EAPI Eina_Bool ecore_thread_reschedule(Ecore_Thread *thread);
1797ecore_thread_reschedule(Ecore_Thread *thread);
1798/** 1640/**
1799 * Gets the number of active threads running jobs 1641 * Gets the number of active threads running jobs
1800 * 1642 *
@@ -1808,8 +1650,7 @@ ecore_thread_reschedule(Ecore_Thread *thread);
1808 * in the return of this function unless the thread creation fails and it 1650 * in the return of this function unless the thread creation fails and it
1809 * falls back to using one from the pool. 1651 * falls back to using one from the pool.
1810 */ 1652 */
1811EAPI int 1653EAPI int ecore_thread_active_get(void);
1812ecore_thread_active_get(void);
1813/** 1654/**
1814 * Gets the number of short jobs waiting for a thread to run 1655 * Gets the number of short jobs waiting for a thread to run
1815 * 1656 *
@@ -1818,8 +1659,7 @@ ecore_thread_active_get(void);
1818 * This returns the number of tasks started with ecore_thread_run() that are 1659 * This returns the number of tasks started with ecore_thread_run() that are
1819 * pending, waiting for a thread to become available to run them. 1660 * pending, waiting for a thread to become available to run them.
1820 */ 1661 */
1821EAPI int 1662EAPI int ecore_thread_pending_get(void);
1822ecore_thread_pending_get(void);
1823/** 1663/**
1824 * Gets the number of feedback jobs waiting for a thread to run 1664 * Gets the number of feedback jobs waiting for a thread to run
1825 * 1665 *
@@ -1828,18 +1668,16 @@ ecore_thread_pending_get(void);
1828 * This returns the number of tasks started with ecore_thread_feedback_run() 1668 * This returns the number of tasks started with ecore_thread_feedback_run()
1829 * that are pending, waiting for a thread to become available to run them. 1669 * that are pending, waiting for a thread to become available to run them.
1830 */ 1670 */
1831EAPI int 1671EAPI int ecore_thread_pending_feedback_get(void);
1832ecore_thread_pending_feedback_get(void);
1833/** 1672/**
1834 * Gets the total number of pending jobs 1673 * Gets the total number of pending jobs
1835 * 1674 *
1836 * @return Number of pending threads running jobs 1675 * @return Number of pending threads running jobs
1837 * 1676 *
1838 * Same as the sum of ecore_thread_pending_get() and 1677 * Same as the sum of ecore_thread_pending_get() and
1839 * ecore_thread_pending_feedback_get(). 1678 *ecore_thread_pending_feedback_get().
1840 */ 1679 */
1841EAPI int 1680EAPI int ecore_thread_pending_total_get(void);
1842ecore_thread_pending_total_get(void);
1843/** 1681/**
1844 * Gets the maximum number of threads that can run simultaneously 1682 * Gets the maximum number of threads that can run simultaneously
1845 * 1683 *
@@ -1847,7 +1685,7 @@ ecore_thread_pending_total_get(void);
1847 * 1685 *
1848 * This returns the maximum number of Ecore_Thread's that may be running at 1686 * This returns the maximum number of Ecore_Thread's that may be running at
1849 * the same time. If this number is reached, new jobs started by either 1687 * the same time. If this number is reached, new jobs started by either
1850 * ecore_thread_run() or ecore_thread_feedback_run() will be added to the 1688 *ecore_thread_run() or ecore_thread_feedback_run() will be added to the
1851 * respective pending queue until one of the running threads finishes its 1689 * respective pending queue until one of the running threads finishes its
1852 * task and becomes available to run a new one. 1690 * task and becomes available to run a new one.
1853 * 1691 *
@@ -1858,8 +1696,7 @@ ecore_thread_pending_total_get(void);
1858 * @see ecore_thread_max_set() 1696 * @see ecore_thread_max_set()
1859 * @see ecore_thread_max_reset() 1697 * @see ecore_thread_max_reset()
1860 */ 1698 */
1861EAPI int 1699EAPI int ecore_thread_max_get(void);
1862ecore_thread_max_get(void);
1863/** 1700/**
1864 * Sets the maximum number of threads allowed to run simultaneously 1701 * Sets the maximum number of threads allowed to run simultaneously
1865 * 1702 *
@@ -1872,8 +1709,7 @@ ecore_thread_max_get(void);
1872 * @see ecore_thread_max_get() 1709 * @see ecore_thread_max_get()
1873 * @see ecore_thread_max_reset() 1710 * @see ecore_thread_max_reset()
1874 */ 1711 */
1875EAPI void 1712EAPI void ecore_thread_max_set(int num);
1876ecore_thread_max_set(int num);
1877/** 1713/**
1878 * Resets the maximum number of concurrently running threads to the default 1714 * Resets the maximum number of concurrently running threads to the default
1879 * 1715 *
@@ -1883,8 +1719,7 @@ ecore_thread_max_set(int num);
1883 * @see ecore_thread_max_get() 1719 * @see ecore_thread_max_get()
1884 * @see ecore_thread_max_set() 1720 * @see ecore_thread_max_set()
1885 */ 1721 */
1886EAPI void 1722EAPI void ecore_thread_max_reset(void);
1887ecore_thread_max_reset(void);
1888/** 1723/**
1889 * Gets the number of threads available for running tasks 1724 * Gets the number of threads available for running tasks
1890 * 1725 *
@@ -1896,8 +1731,7 @@ ecore_thread_max_reset(void);
1896 * changed the maximum number of running threads while other tasks are 1731 * changed the maximum number of running threads while other tasks are
1897 * running. 1732 * running.
1898 */ 1733 */
1899EAPI int 1734EAPI int ecore_thread_available_get(void);
1900ecore_thread_available_get(void);
1901/** 1735/**
1902 * Adds some data to a hash local to the thread 1736 * Adds some data to a hash local to the thread
1903 * 1737 *
@@ -1970,7 +1804,7 @@ ecore_thread_available_get(void);
1970 * because @p thread was terminated and the hash destroyed. This parameter 1804 * because @p thread was terminated and the hash destroyed. This parameter
1971 * may be NULL, in which case @p value needs to be manually freed after 1805 * may be NULL, in which case @p value needs to be manually freed after
1972 * removing it from the hash with either ecore_thread_local_data_del() or 1806 * removing it from the hash with either ecore_thread_local_data_del() or
1973 * ecore_thread_local_data_set(), but it's very unlikely that this is what 1807 *ecore_thread_local_data_set(), but it's very unlikely that this is what
1974 * you want. 1808 * you want.
1975 * 1809 *
1976 * This function, and all of the others in the @c ecore_thread_local_data 1810 * This function, and all of the others in the @c ecore_thread_local_data
@@ -1982,12 +1816,8 @@ ecore_thread_available_get(void);
1982 * @see ecore_thread_local_data_find() 1816 * @see ecore_thread_local_data_find()
1983 * @see ecore_thread_local_data_del() 1817 * @see ecore_thread_local_data_del()
1984 */ 1818 */
1985EAPI Eina_Bool 1819EAPI Eina_Bool ecore_thread_local_data_add(Ecore_Thread *thread, const char *key, void *value,
1986ecore_thread_local_data_add(Ecore_Thread *thread, 1820 Eina_Free_Cb cb, Eina_Bool direct);
1987 const char *key,
1988 void *value,
1989 Eina_Free_Cb cb,
1990 Eina_Bool direct);
1991/** 1821/**
1992 * Sets some data in the hash local to the given thread 1822 * Sets some data in the hash local to the given thread
1993 * 1823 *
@@ -2015,11 +1845,7 @@ ecore_thread_local_data_add(Ecore_Thread *thread,
2015 * @see ecore_thread_local_data_del() 1845 * @see ecore_thread_local_data_del()
2016 * @see ecore_thread_local_data_find() 1846 * @see ecore_thread_local_data_find()
2017 */ 1847 */
2018EAPI void * 1848EAPI void *ecore_thread_local_data_set(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb);
2019ecore_thread_local_data_set(Ecore_Thread *thread,
2020 const char *key,
2021 void *value,
2022 Eina_Free_Cb cb);
2023/** 1849/**
2024 * Gets data stored in the hash local to the given thread 1850 * Gets data stored in the hash local to the given thread
2025 * 1851 *
@@ -2037,9 +1863,7 @@ ecore_thread_local_data_set(Ecore_Thread *thread,
2037 * @see ecore_thread_local_data_add() 1863 * @see ecore_thread_local_data_add()
2038 * @see ecore_thread_local_data_wait() 1864 * @see ecore_thread_local_data_wait()
2039 */ 1865 */
2040EAPI void * 1866EAPI void *ecore_thread_local_data_find(Ecore_Thread *thread, const char *key);
2041ecore_thread_local_data_find(Ecore_Thread *thread,
2042 const char *key);
2043/** 1867/**
2044 * Deletes from the thread's hash the data corresponding to the given key 1868 * Deletes from the thread's hash the data corresponding to the given key
2045 * 1869 *
@@ -2064,9 +1888,7 @@ ecore_thread_local_data_find(Ecore_Thread *thread,
2064 * 1888 *
2065 * @see ecore_thread_local_data_add() 1889 * @see ecore_thread_local_data_add()
2066 */ 1890 */
2067EAPI Eina_Bool 1891EAPI Eina_Bool ecore_thread_local_data_del(Ecore_Thread *thread, const char *key);
2068ecore_thread_local_data_del(Ecore_Thread *thread,
2069 const char *key);
2070 1892
2071/** 1893/**
2072 * Adds some data to a hash shared by all threads 1894 * Adds some data to a hash shared by all threads
@@ -2096,7 +1918,7 @@ ecore_thread_local_data_del(Ecore_Thread *thread,
2096 * because Ecore Thread was shut down and the hash destroyed. This parameter 1918 * because Ecore Thread was shut down and the hash destroyed. This parameter
2097 * may be NULL, in which case @p value needs to be manually freed after 1919 * may be NULL, in which case @p value needs to be manually freed after
2098 * removing it from the hash with either ecore_thread_global_data_del() or 1920 * removing it from the hash with either ecore_thread_global_data_del() or
2099 * ecore_thread_global_data_set(). 1921 *ecore_thread_global_data_set().
2100 * 1922 *
2101 * Manually freeing any data that was added to the hash with a @p cb function 1923 * Manually freeing any data that was added to the hash with a @p cb function
2102 * is likely to produce a segmentation fault, or any other strange 1924 * is likely to produce a segmentation fault, or any other strange
@@ -2106,11 +1928,7 @@ ecore_thread_local_data_del(Ecore_Thread *thread,
2106 * @see ecore_thread_global_data_set() 1928 * @see ecore_thread_global_data_set()
2107 * @see ecore_thread_global_data_find() 1929 * @see ecore_thread_global_data_find()
2108 */ 1930 */
2109EAPI Eina_Bool 1931EAPI Eina_Bool ecore_thread_global_data_add(const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct);
2110ecore_thread_global_data_add(const char *key,
2111 void *value,
2112 Eina_Free_Cb cb,
2113 Eina_Bool direct);
2114/** 1932/**
2115 * Sets some data in the hash shared by all threads 1933 * Sets some data in the hash shared by all threads
2116 * 1934 *
@@ -2132,10 +1950,7 @@ ecore_thread_global_data_add(const char *key,
2132 * @see ecore_thread_global_data_del() 1950 * @see ecore_thread_global_data_del()
2133 * @see ecore_thread_global_data_find() 1951 * @see ecore_thread_global_data_find()
2134 */ 1952 */
2135EAPI void * 1953EAPI void *ecore_thread_global_data_set(const char *key, void *value, Eina_Free_Cb cb);
2136ecore_thread_global_data_set(const char *key,
2137 void *value,
2138 Eina_Free_Cb cb);
2139/** 1954/**
2140 * Gets data stored in the hash shared by all threads 1955 * Gets data stored in the hash shared by all threads
2141 * 1956 *
@@ -2152,8 +1967,7 @@ ecore_thread_global_data_set(const char *key,
2152 * @see ecore_thread_global_data_add() 1967 * @see ecore_thread_global_data_add()
2153 * @see ecore_thread_global_data_wait() 1968 * @see ecore_thread_global_data_wait()
2154 */ 1969 */
2155EAPI void * 1970EAPI void *ecore_thread_global_data_find(const char *key);
2156ecore_thread_global_data_find(const char *key);
2157/** 1971/**
2158 * Deletes from the shared hash the data corresponding to the given key 1972 * Deletes from the shared hash the data corresponding to the given key
2159 * 1973 *
@@ -2176,8 +1990,7 @@ ecore_thread_global_data_find(const char *key);
2176 * 1990 *
2177 * @see ecore_thread_global_data_add() 1991 * @see ecore_thread_global_data_add()
2178 */ 1992 */
2179EAPI Eina_Bool 1993EAPI Eina_Bool ecore_thread_global_data_del(const char *key);
2180ecore_thread_global_data_del(const char *key);
2181/** 1994/**
2182 * Gets data stored in the shared hash, or wait for it if it doesn't exist 1995 * Gets data stored in the shared hash, or wait for it if it doesn't exist
2183 * 1996 *
@@ -2190,7 +2003,7 @@ ecore_thread_global_data_del(const char *key);
2190 * If there's nothing in the hash under the given @p key, the function 2003 * If there's nothing in the hash under the given @p key, the function
2191 * will block and wait up to @p seconds seconds for some other thread to 2004 * will block and wait up to @p seconds seconds for some other thread to
2192 * add it with either ecore_thread_global_data_add() or 2005 * add it with either ecore_thread_global_data_add() or
2193 * ecore_thread_global_data_set(). If after waiting there's still no data 2006 *ecore_thread_global_data_set(). If after waiting there's still no data
2194 * to get, NULL will be returned. 2007 * to get, NULL will be returned.
2195 * 2008 *
2196 * If @p seconds is 0, then no waiting will happen and this function works 2009 * If @p seconds is 0, then no waiting will happen and this function works
@@ -2205,9 +2018,7 @@ ecore_thread_global_data_del(const char *key);
2205 * @see ecore_thread_global_data_add() 2018 * @see ecore_thread_global_data_add()
2206 * @see ecore_thread_global_data_find() 2019 * @see ecore_thread_global_data_find()
2207 */ 2020 */
2208EAPI void * 2021EAPI void *ecore_thread_global_data_wait(const char *key, double seconds);
2209ecore_thread_global_data_wait(const char *key,
2210 double seconds);
2211 2022
2212/** 2023/**
2213 * @} 2024 * @}
@@ -2242,27 +2053,14 @@ typedef struct _Ecore_Pipe Ecore_Pipe; /**< A handle for pipes */
2242 */ 2053 */
2243typedef void (*Ecore_Pipe_Cb)(void *data, void *buffer, unsigned int nbyte); 2054typedef void (*Ecore_Pipe_Cb)(void *data, void *buffer, unsigned int nbyte);
2244 2055
2245EAPI Ecore_Pipe * 2056EAPI Ecore_Pipe *ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data);
2246ecore_pipe_add(Ecore_Pipe_Cb handler, 2057EAPI void *ecore_pipe_del(Ecore_Pipe *p);
2247 const void *data); 2058EAPI Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes);
2248EAPI void * 2059EAPI void ecore_pipe_write_close(Ecore_Pipe *p);
2249 ecore_pipe_del(Ecore_Pipe *p); 2060EAPI void ecore_pipe_read_close(Ecore_Pipe *p);
2250EAPI Eina_Bool 2061EAPI void ecore_pipe_thaw(Ecore_Pipe *p);
2251 ecore_pipe_write(Ecore_Pipe *p, 2062EAPI void ecore_pipe_freeze(Ecore_Pipe *p);
2252 const void *buffer, 2063EAPI int ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait);
2253 unsigned int nbytes);
2254EAPI void
2255 ecore_pipe_write_close(Ecore_Pipe *p);
2256EAPI void
2257 ecore_pipe_read_close(Ecore_Pipe *p);
2258EAPI void
2259 ecore_pipe_thaw(Ecore_Pipe *p);
2260EAPI void
2261 ecore_pipe_freeze(Ecore_Pipe *p);
2262EAPI int
2263 ecore_pipe_wait(Ecore_Pipe *p,
2264 int message_count,
2265 double wait);
2266 2064
2267/** 2065/**
2268 * @} 2066 * @}
@@ -2284,7 +2082,7 @@ EAPI int
2284 * will be processed first). This also gives the chance to other 2082 * will be processed first). This also gives the chance to other
2285 * actions in your program to cancel the job before it is started. 2083 * actions in your program to cancel the job before it is started.
2286 * 2084 *
2287 * Examples of using @ref Ecore_Job: 2085 * Examples of using @ref Ecore_Job :
2288 * @li @ref ecore_job_example_c 2086 * @li @ref ecore_job_example_c
2289 * 2087 *
2290 * @ingroup Ecore_Main_Loop_Group 2088 * @ingroup Ecore_Main_Loop_Group
@@ -2294,11 +2092,8 @@ EAPI int
2294 2092
2295typedef struct _Ecore_Job Ecore_Job; /**< A job handle */ 2093typedef struct _Ecore_Job Ecore_Job; /**< A job handle */
2296 2094
2297EAPI Ecore_Job * 2095EAPI Ecore_Job *ecore_job_add(Ecore_Cb func, const void *data);
2298ecore_job_add(Ecore_Cb func, 2096EAPI void *ecore_job_del(Ecore_Job *job);
2299 const void *data);
2300EAPI void *
2301ecore_job_del(Ecore_Job *job);
2302 2097
2303/** 2098/**
2304 * @} 2099 * @}
@@ -2310,14 +2105,9 @@ ecore_job_del(Ecore_Job *job);
2310 * @{ 2105 * @{
2311 */ 2106 */
2312 2107
2313EAPI void 2108EAPI void ecore_app_args_set(int argc, const char **argv);
2314ecore_app_args_set(int argc, 2109EAPI void ecore_app_args_get(int *argc, char ***argv);
2315 const char **argv); 2110EAPI void ecore_app_restart(void);
2316EAPI void
2317ecore_app_args_get(int *argc,
2318 char ***argv);
2319EAPI void
2320ecore_app_restart(void);
2321 2111
2322/** 2112/**
2323 * @} 2113 * @}
@@ -2331,10 +2121,8 @@ ecore_app_restart(void);
2331 * @{ 2121 * @{
2332 */ 2122 */
2333 2123
2334EAPI void 2124EAPI void ecore_throttle_adjust(double amount);
2335 ecore_throttle_adjust(double amount); 2125EAPI double ecore_throttle_get(void);
2336EAPI double
2337 ecore_throttle_get(void);
2338 2126
2339/** 2127/**
2340 * @} 2128 * @}
diff --git a/libraries/ecore/src/lib/ecore/Makefile.am b/libraries/ecore/src/lib/ecore/Makefile.am
index 2fb6a0a..ec3d99f 100644
--- a/libraries/ecore/src/lib/ecore/Makefile.am
+++ b/libraries/ecore/src/lib/ecore/Makefile.am
@@ -11,6 +11,7 @@ includesdir = $(includedir)/ecore-@VMAJ@
11 11
12libecore_la_SOURCES = \ 12libecore_la_SOURCES = \
13ecore.c \ 13ecore.c \
14ecore_alloc.c \
14ecore_anim.c \ 15ecore_anim.c \
15ecore_app.c \ 16ecore_app.c \
16ecore_events.c \ 17ecore_events.c \
diff --git a/libraries/ecore/src/lib/ecore/Makefile.in b/libraries/ecore/src/lib/ecore/Makefile.in
index e19bfde..66a25cd 100644
--- a/libraries/ecore/src/lib/ecore/Makefile.in
+++ b/libraries/ecore/src/lib/ecore/Makefile.in
@@ -91,8 +91,8 @@ am__base_list = \
91am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)" 91am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
92LTLIBRARIES = $(lib_LTLIBRARIES) 92LTLIBRARIES = $(lib_LTLIBRARIES)
93libecore_la_DEPENDENCIES = 93libecore_la_DEPENDENCIES =
94am__libecore_la_SOURCES_DIST = ecore.c ecore_anim.c ecore_app.c \ 94am__libecore_la_SOURCES_DIST = ecore.c ecore_alloc.c ecore_anim.c \
95 ecore_events.c ecore_getopt.c ecore_idle_enterer.c \ 95 ecore_app.c ecore_events.c ecore_getopt.c ecore_idle_enterer.c \
96 ecore_idle_exiter.c ecore_idler.c ecore_job.c ecore_main.c \ 96 ecore_idle_exiter.c ecore_idler.c ecore_job.c ecore_main.c \
97 ecore_pipe.c ecore_poll.c ecore_time.c ecore_timer.c \ 97 ecore_pipe.c ecore_poll.c ecore_time.c ecore_timer.c \
98 ecore_thread.c ecore_glib.c ecore_throttle.c ecore_exe_win32.c \ 98 ecore_thread.c ecore_glib.c ecore_throttle.c ecore_exe_win32.c \
@@ -102,13 +102,13 @@ am__libecore_la_SOURCES_DIST = ecore.c ecore_anim.c ecore_app.c \
102@ECORE_HAVE_PS3_TRUE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@am__objects_3 = ecore_exe_ps3.lo 102@ECORE_HAVE_PS3_TRUE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@am__objects_3 = ecore_exe_ps3.lo
103@ECORE_HAVE_PS3_FALSE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@am__objects_4 = ecore_signal.lo \ 103@ECORE_HAVE_PS3_FALSE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@am__objects_4 = ecore_signal.lo \
104@ECORE_HAVE_PS3_FALSE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@ ecore_exe.lo 104@ECORE_HAVE_PS3_FALSE@@ECORE_HAVE_WIN32_FALSE@@ECORE_HAVE_WINCE_FALSE@ ecore_exe.lo
105am_libecore_la_OBJECTS = ecore.lo ecore_anim.lo ecore_app.lo \ 105am_libecore_la_OBJECTS = ecore.lo ecore_alloc.lo ecore_anim.lo \
106 ecore_events.lo ecore_getopt.lo ecore_idle_enterer.lo \ 106 ecore_app.lo ecore_events.lo ecore_getopt.lo \
107 ecore_idle_exiter.lo ecore_idler.lo ecore_job.lo ecore_main.lo \ 107 ecore_idle_enterer.lo ecore_idle_exiter.lo ecore_idler.lo \
108 ecore_pipe.lo ecore_poll.lo ecore_time.lo ecore_timer.lo \ 108 ecore_job.lo ecore_main.lo ecore_pipe.lo ecore_poll.lo \
109 ecore_thread.lo ecore_glib.lo ecore_throttle.lo \ 109 ecore_time.lo ecore_timer.lo ecore_thread.lo ecore_glib.lo \
110 $(am__objects_1) $(am__objects_2) $(am__objects_3) \ 110 ecore_throttle.lo $(am__objects_1) $(am__objects_2) \
111 $(am__objects_4) 111 $(am__objects_3) $(am__objects_4)
112libecore_la_OBJECTS = $(am_libecore_la_OBJECTS) 112libecore_la_OBJECTS = $(am_libecore_la_OBJECTS)
113AM_V_lt = $(am__v_lt_$(V)) 113AM_V_lt = $(am__v_lt_$(V))
114am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) 114am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
@@ -266,10 +266,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
266PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 266PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
267PIXMAN_LIBS = @PIXMAN_LIBS@ 267PIXMAN_LIBS = @PIXMAN_LIBS@
268PKG_CONFIG = @PKG_CONFIG@ 268PKG_CONFIG = @PKG_CONFIG@
269PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
270PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
271POSUB = @POSUB@ 269POSUB = @POSUB@
272RANLIB = @RANLIB@ 270RANLIB = @RANLIB@
271SCIM_CFLAGS = @SCIM_CFLAGS@
272SCIM_LIBS = @SCIM_LIBS@
273SDL_CFLAGS = @SDL_CFLAGS@ 273SDL_CFLAGS = @SDL_CFLAGS@
274SDL_CONFIG = @SDL_CONFIG@ 274SDL_CONFIG = @SDL_CONFIG@
275SDL_LIBS = @SDL_LIBS@ 275SDL_LIBS = @SDL_LIBS@
@@ -288,6 +288,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
288USE_NLS = @USE_NLS@ 288USE_NLS = @USE_NLS@
289VERSION = @VERSION@ 289VERSION = @VERSION@
290VMAJ = @VMAJ@ 290VMAJ = @VMAJ@
291WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
292WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
293WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
294WAYLAND_LIBS = @WAYLAND_LIBS@
291WIN32_CFLAGS = @WIN32_CFLAGS@ 295WIN32_CFLAGS = @WIN32_CFLAGS@
292WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 296WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
293WIN32_LIBS = @WIN32_LIBS@ 297WIN32_LIBS = @WIN32_LIBS@
@@ -401,6 +405,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
401ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 405ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
402ecore_imf_evas_libs = @ecore_imf_evas_libs@ 406ecore_imf_evas_libs = @ecore_imf_evas_libs@
403ecore_imf_libs = @ecore_imf_libs@ 407ecore_imf_libs = @ecore_imf_libs@
408ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
409ecore_imf_scim_libs = @ecore_imf_scim_libs@
404ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 410ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
405ecore_imf_xim_libs = @ecore_imf_xim_libs@ 411ecore_imf_xim_libs = @ecore_imf_xim_libs@
406ecore_input_cflags = @ecore_input_cflags@ 412ecore_input_cflags = @ecore_input_cflags@
@@ -413,6 +419,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
413ecore_psl1ght_libs = @ecore_psl1ght_libs@ 419ecore_psl1ght_libs = @ecore_psl1ght_libs@
414ecore_sdl_cflags = @ecore_sdl_cflags@ 420ecore_sdl_cflags = @ecore_sdl_cflags@
415ecore_sdl_libs = @ecore_sdl_libs@ 421ecore_sdl_libs = @ecore_sdl_libs@
422ecore_wayland_cflags = @ecore_wayland_cflags@
423ecore_wayland_libs = @ecore_wayland_libs@
416ecore_win32_cflags = @ecore_win32_cflags@ 424ecore_win32_cflags = @ecore_win32_cflags@
417ecore_win32_libs = @ecore_win32_libs@ 425ecore_win32_libs = @ecore_win32_libs@
418ecore_wince_cflags = @ecore_wince_cflags@ 426ecore_wince_cflags = @ecore_wince_cflags@
@@ -457,12 +465,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
457requirements_ecore_file = @requirements_ecore_file@ 465requirements_ecore_file = @requirements_ecore_file@
458requirements_ecore_imf = @requirements_ecore_imf@ 466requirements_ecore_imf = @requirements_ecore_imf@
459requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 467requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
468requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
460requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 469requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
461requirements_ecore_input = @requirements_ecore_input@ 470requirements_ecore_input = @requirements_ecore_input@
462requirements_ecore_input_evas = @requirements_ecore_input_evas@ 471requirements_ecore_input_evas = @requirements_ecore_input_evas@
463requirements_ecore_ipc = @requirements_ecore_ipc@ 472requirements_ecore_ipc = @requirements_ecore_ipc@
464requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 473requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
465requirements_ecore_sdl = @requirements_ecore_sdl@ 474requirements_ecore_sdl = @requirements_ecore_sdl@
475requirements_ecore_wayland = @requirements_ecore_wayland@
466requirements_ecore_win32 = @requirements_ecore_win32@ 476requirements_ecore_win32 = @requirements_ecore_win32@
467requirements_ecore_wince = @requirements_ecore_wince@ 477requirements_ecore_wince = @requirements_ecore_wince@
468requirements_ecore_x = @requirements_ecore_x@ 478requirements_ecore_x = @requirements_ecore_x@
@@ -488,12 +498,12 @@ Ecore.h \
488Ecore_Getopt.h 498Ecore_Getopt.h
489 499
490includesdir = $(includedir)/ecore-@VMAJ@ 500includesdir = $(includedir)/ecore-@VMAJ@
491libecore_la_SOURCES = ecore.c ecore_anim.c ecore_app.c ecore_events.c \ 501libecore_la_SOURCES = ecore.c ecore_alloc.c ecore_anim.c ecore_app.c \
492 ecore_getopt.c ecore_idle_enterer.c ecore_idle_exiter.c \ 502 ecore_events.c ecore_getopt.c ecore_idle_enterer.c \
493 ecore_idler.c ecore_job.c ecore_main.c ecore_pipe.c \ 503 ecore_idle_exiter.c ecore_idler.c ecore_job.c ecore_main.c \
494 ecore_poll.c ecore_time.c ecore_timer.c ecore_thread.c \ 504 ecore_pipe.c ecore_poll.c ecore_time.c ecore_timer.c \
495 ecore_glib.c ecore_throttle.c $(am__append_1) $(am__append_2) \ 505 ecore_thread.c ecore_glib.c ecore_throttle.c $(am__append_1) \
496 $(am__append_3) $(am__append_4) 506 $(am__append_2) $(am__append_3) $(am__append_4)
497libecore_la_LIBADD = @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm 507libecore_la_LIBADD = @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm
498libecore_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ @EFL_PTHREAD_LIBS@ 508libecore_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ @EFL_PTHREAD_LIBS@
499EXTRA_DIST = ecore_private.h 509EXTRA_DIST = ecore_private.h
@@ -572,6 +582,7 @@ distclean-compile:
572 -rm -f *.tab.c 582 -rm -f *.tab.c
573 583
574@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore.Plo@am__quote@ 584@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore.Plo@am__quote@
585@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_alloc.Plo@am__quote@
575@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_anim.Plo@am__quote@ 586@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_anim.Plo@am__quote@
576@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_app.Plo@am__quote@ 587@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_app.Plo@am__quote@
577@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_events.Plo@am__quote@ 588@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_events.Plo@am__quote@
diff --git a/libraries/ecore/src/lib/ecore/ecore.c b/libraries/ecore/src/lib/ecore/ecore.c
index 99d79c1..7e0f973 100644
--- a/libraries/ecore/src/lib/ecore/ecore.c
+++ b/libraries/ecore/src/lib/ecore/ecore.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <sys/types.h> 7#include <sys/types.h>
7#include <sys/stat.h> 8#include <sys/stat.h>
@@ -159,6 +160,7 @@ ecore_init(void)
159 } 160 }
160 if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1; 161 if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
161 if (_ecore_fps_debug) _ecore_fps_debug_init(); 162 if (_ecore_fps_debug) _ecore_fps_debug_init();
163 if (!ecore_mempool_init()) goto shutdown_mempool;
162 _ecore_main_loop_init(); 164 _ecore_main_loop_init();
163 _ecore_signal_init(); 165 _ecore_signal_init();
164 _ecore_thread_init(); 166 _ecore_thread_init();
@@ -191,6 +193,8 @@ ecore_init(void)
191 193
192 return _ecore_init_count; 194 return _ecore_init_count;
193 195
196shutdown_mempool:
197 ecore_mempool_shutdown();
194shutdown_log_dom: 198shutdown_log_dom:
195 eina_shutdown(); 199 eina_shutdown();
196shutdown_evil: 200shutdown_evil:
@@ -219,8 +223,22 @@ ecore_shutdown(void)
219 _ecore_lock(); 223 _ecore_lock();
220 if (--_ecore_init_count != 0) 224 if (--_ecore_init_count != 0)
221 goto unlock; 225 goto unlock;
222 226
223 ecore_pipe_del(_thread_call); 227 /* this looks horrible - a hack for now, but something to note. as
228 * we delete the _thread_call pipe a thread COULD be doing
229 * ecore_pipe_write() or what not to it at the same time - we
230 * must ensure all possible users of this _thread_call are finished
231 * and exited before we delete it here */
232 /*
233 * ok - this causes other valgrind complaints regarding glib aquiring
234 * locks internally. so fix bug a or bug b. let's leave the original
235 * bug in then and leave this as a note for now
236 Ecore_Pipe *p;
237 p = _thread_call;
238 _thread_call = NULL;
239 ecore_pipe_wait(p, 1, 0.1);
240 ecore_pipe_del(p);
241 */
224 eina_lock_free(&_thread_safety); 242 eina_lock_free(&_thread_safety);
225 eina_condition_free(&_thread_cond); 243 eina_condition_free(&_thread_cond);
226 eina_lock_free(&_thread_mutex); 244 eina_lock_free(&_thread_mutex);
@@ -255,7 +273,7 @@ ecore_shutdown(void)
255 _ecore_memory_max_free); 273 _ecore_memory_max_free);
256 } 274 }
257#endif 275#endif
258 276 ecore_mempool_shutdown();
259 eina_log_domain_unregister(_ecore_log_dom); 277 eina_log_domain_unregister(_ecore_log_dom);
260 _ecore_log_dom = -1; 278 _ecore_log_dom = -1;
261 eina_shutdown(); 279 eina_shutdown();
diff --git a/libraries/ecore/src/lib/ecore/ecore_alloc.c b/libraries/ecore/src/lib/ecore/ecore_alloc.c
new file mode 100644
index 0000000..412c383
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore/ecore_alloc.c
@@ -0,0 +1,132 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdlib.h>
6
7#include <Eina.h>
8
9#include "Ecore.h"
10#include "ecore_private.h"
11
12typedef struct _Ecore_Mempool Ecore_Mempool;
13struct _Ecore_Mempool
14{
15 const char *name;
16 Eina_Mempool *mp;
17 size_t size;
18};
19
20#define GENERIC_ALLOC_FREE(TYPE, Type) \
21 extern size_t _ecore_sizeof_##TYPE; \
22 Ecore_Mempool Type##_mp = { #TYPE, NULL, 0 }; \
23 TYPE * \
24 Type##_calloc(unsigned int num) \
25 { \
26 return eina_mempool_calloc(Type##_mp.mp, \
27 num * _ecore_sizeof_##TYPE); \
28 } \
29 void \
30 Type##_mp_free(TYPE *e) \
31 { \
32 eina_mempool_free(Type##_mp.mp, e); \
33 }
34
35GENERIC_ALLOC_FREE(Ecore_Animator, ecore_animator);
36GENERIC_ALLOC_FREE(Ecore_Event_Handler, ecore_event_handler);
37GENERIC_ALLOC_FREE(Ecore_Event_Filter, ecore_event_filter);
38GENERIC_ALLOC_FREE(Ecore_Event, ecore_event);
39GENERIC_ALLOC_FREE(Ecore_Idle_Exiter, ecore_idle_exiter);
40GENERIC_ALLOC_FREE(Ecore_Idle_Enterer, ecore_idle_enterer);
41GENERIC_ALLOC_FREE(Ecore_Idler, ecore_idler);
42GENERIC_ALLOC_FREE(Ecore_Job, ecore_job);
43GENERIC_ALLOC_FREE(Ecore_Timer, ecore_timer);
44GENERIC_ALLOC_FREE(Ecore_Poller, ecore_poller);
45GENERIC_ALLOC_FREE(Ecore_Pipe, ecore_pipe);
46GENERIC_ALLOC_FREE(Ecore_Fd_Handler, ecore_fd_handler);
47#ifdef _WIN32
48GENERIC_ALLOC_FREE(Ecore_Win32_Handler, ecore_win32_handler);
49#endif
50
51static Ecore_Mempool *mempool_array[] = {
52 &ecore_animator_mp,
53 &ecore_event_handler_mp,
54 &ecore_event_filter_mp,
55 &ecore_event_mp,
56 &ecore_idle_exiter_mp,
57 &ecore_idle_enterer_mp,
58 &ecore_idler_mp,
59 &ecore_job_mp,
60 &ecore_timer_mp,
61 &ecore_poller_mp,
62 &ecore_pipe_mp,
63 &ecore_fd_handler_mp,
64#ifdef _WIN32
65 &ecore_win32_handler_mp
66#endif
67};
68
69Eina_Bool
70ecore_mempool_init(void)
71{
72 const char *choice;
73 unsigned int i;
74
75#define MP_SIZE_INIT(TYPE, Type) \
76 Type##_mp.size = _ecore_sizeof_##TYPE
77
78 MP_SIZE_INIT(Ecore_Animator, ecore_animator);
79 MP_SIZE_INIT(Ecore_Event_Handler, ecore_event_handler);
80 MP_SIZE_INIT(Ecore_Event_Filter, ecore_event_filter);
81 MP_SIZE_INIT(Ecore_Event, ecore_event);
82 MP_SIZE_INIT(Ecore_Idle_Exiter, ecore_idle_exiter);
83 MP_SIZE_INIT(Ecore_Idle_Enterer, ecore_idle_enterer);
84 MP_SIZE_INIT(Ecore_Idler, ecore_idler);
85 MP_SIZE_INIT(Ecore_Job, ecore_job);
86 MP_SIZE_INIT(Ecore_Timer, ecore_timer);
87 MP_SIZE_INIT(Ecore_Poller, ecore_poller);
88 MP_SIZE_INIT(Ecore_Pipe, ecore_pipe);
89 MP_SIZE_INIT(Ecore_Fd_Handler, ecore_fd_handler);
90#ifdef _WIN32
91 MP_SIZE_INIT(Ecore_Win32_Handler, ecore_win32_handler);
92#endif
93#undef MP_SIZE_INIT
94
95 choice = getenv("EINA_MEMPOOL");
96 if ((!choice) || (!choice[0]))
97 choice = "chained_mempool";
98
99 for (i = 0; i < sizeof (mempool_array) / sizeof (mempool_array[0]); ++i)
100 {
101 retry:
102 mempool_array[i]->mp = eina_mempool_add(choice, mempool_array[i]->name, NULL, mempool_array[i]->size, 64);
103 if (!mempool_array[i]->mp)
104 {
105 if (!strcmp(choice, "pass_through"))
106 {
107 ERR("Falling back to pass through ! Previously tried '%s' mempool.", choice);
108 choice = "pass_through";
109 goto retry;
110 }
111 else
112 {
113 ERR("Impossible to allocate mempool '%s' !", choice);
114 return EINA_FALSE;
115 }
116 }
117 }
118 return EINA_TRUE;
119}
120
121void
122ecore_mempool_shutdown(void)
123{
124 unsigned int i;
125
126 for (i = 0; i < sizeof (mempool_array) / sizeof (mempool_array[0]); ++i)
127 {
128 eina_mempool_del(mempool_array[i]->mp);
129 mempool_array[i]->mp = NULL;
130 }
131}
132
diff --git a/libraries/ecore/src/lib/ecore/ecore_anim.c b/libraries/ecore/src/lib/ecore/ecore_anim.c
index 9adaa77..78abad7 100644
--- a/libraries/ecore/src/lib/ecore/ecore_anim.c
+++ b/libraries/ecore/src/lib/ecore/ecore_anim.c
@@ -22,8 +22,11 @@ struct _Ecore_Animator
22 22
23 Eina_Bool delete_me : 1; 23 Eina_Bool delete_me : 1;
24 Eina_Bool suspended : 1; 24 Eina_Bool suspended : 1;
25 Eina_Bool just_added : 1;
25}; 26};
26 27
28GENERIC_ALLOC_SIZE_DECLARE(Ecore_Animator);
29
27static Eina_Bool _ecore_animator_run(void *data); 30static Eina_Bool _ecore_animator_run(void *data);
28static Eina_Bool _ecore_animator(void *data); 31static Eina_Bool _ecore_animator(void *data);
29 32
@@ -99,7 +102,13 @@ _do_tick(void)
99 102
100 EINA_INLIST_FOREACH(animators, animator) 103 EINA_INLIST_FOREACH(animators, animator)
101 { 104 {
102 if (!animator->delete_me && !animator->suspended) 105 animator->just_added = EINA_FALSE;
106 }
107 EINA_INLIST_FOREACH(animators, animator)
108 {
109 if ((!animator->delete_me) &&
110 (!animator->suspended) &&
111 (!animator->just_added))
103 { 112 {
104 if (!_ecore_call_task_cb(animator->func, animator->data)) 113 if (!_ecore_call_task_cb(animator->func, animator->data))
105 { 114 {
@@ -107,6 +116,7 @@ _do_tick(void)
107 animators_delete_me++; 116 animators_delete_me++;
108 } 117 }
109 } 118 }
119 else animator->just_added = EINA_FALSE;
110 } 120 }
111 if (animators_delete_me) 121 if (animators_delete_me)
112 { 122 {
@@ -121,7 +131,7 @@ _do_tick(void)
121 eina_inlist_remove(EINA_INLIST_GET(animators), 131 eina_inlist_remove(EINA_INLIST_GET(animators),
122 EINA_INLIST_GET(animator)); 132 EINA_INLIST_GET(animator));
123 ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE); 133 ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
124 free(animator); 134 ecore_animator_mp_free(animator);
125 animators_delete_me--; 135 animators_delete_me--;
126 if (animators_delete_me == 0) break; 136 if (animators_delete_me == 0) break;
127 } 137 }
@@ -142,11 +152,12 @@ _ecore_animator_add(Ecore_Task_Cb func,
142 Ecore_Animator *animator = NULL; 152 Ecore_Animator *animator = NULL;
143 153
144 if (!func) return animator; 154 if (!func) return animator;
145 animator = calloc(1, sizeof(Ecore_Animator)); 155 animator = ecore_animator_calloc(1);
146 if (!animator) return animator; 156 if (!animator) return animator;
147 ECORE_MAGIC_SET(animator, ECORE_MAGIC_ANIMATOR); 157 ECORE_MAGIC_SET(animator, ECORE_MAGIC_ANIMATOR);
148 animator->func = func; 158 animator->func = func;
149 animator->data = (void *)data; 159 animator->data = (void *)data;
160 animator->just_added = EINA_TRUE;
150 animators = (Ecore_Animator *)eina_inlist_append(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator)); 161 animators = (Ecore_Animator *)eina_inlist_append(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
151 _begin_tick(); 162 _begin_tick();
152 return animator; 163 return animator;
@@ -443,7 +454,7 @@ _ecore_animator_shutdown(void)
443 animator = animators; 454 animator = animators;
444 animators = (Ecore_Animator *)eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators)); 455 animators = (Ecore_Animator *)eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators));
445 ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE); 456 ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
446 free(animator); 457 ecore_animator_mp_free(animator);
447 } 458 }
448} 459}
449 460
diff --git a/libraries/ecore/src/lib/ecore/ecore_events.c b/libraries/ecore/src/lib/ecore/ecore_events.c
index f31baf8..0550224 100644
--- a/libraries/ecore/src/lib/ecore/ecore_events.c
+++ b/libraries/ecore/src/lib/ecore/ecore_events.c
@@ -19,6 +19,7 @@ struct _Ecore_Event_Handler
19 int references; 19 int references;
20 Eina_Bool delete_me : 1; 20 Eina_Bool delete_me : 1;
21}; 21};
22GENERIC_ALLOC_SIZE_DECLARE(Ecore_Event_Handler);
22 23
23struct _Ecore_Event_Filter 24struct _Ecore_Event_Filter
24{ 25{
@@ -32,6 +33,7 @@ struct _Ecore_Event_Filter
32 int references; 33 int references;
33 Eina_Bool delete_me : 1; 34 Eina_Bool delete_me : 1;
34}; 35};
36GENERIC_ALLOC_SIZE_DECLARE(Ecore_Event_Filter);
35 37
36struct _Ecore_Event 38struct _Ecore_Event
37{ 39{
@@ -44,6 +46,7 @@ struct _Ecore_Event
44 int references; 46 int references;
45 Eina_Bool delete_me : 1; 47 Eina_Bool delete_me : 1;
46}; 48};
49GENERIC_ALLOC_SIZE_DECLARE(Ecore_Event);
47 50
48static int events_num = 0; 51static int events_num = 0;
49static Ecore_Event *events = NULL; 52static Ecore_Event *events = NULL;
@@ -109,7 +112,7 @@ ecore_event_handler_add(int type,
109 112
110 if (!func) goto unlock; 113 if (!func) goto unlock;
111 if ((type <= ECORE_EVENT_NONE) || (type >= event_id_max)) goto unlock; 114 if ((type <= ECORE_EVENT_NONE) || (type >= event_id_max)) goto unlock;
112 eh = calloc(1, sizeof(Ecore_Event_Handler)); 115 eh = ecore_event_handler_calloc(1);
113 if (!eh) goto unlock; 116 if (!eh) goto unlock;
114 ECORE_MAGIC_SET(eh, ECORE_MAGIC_EVENT_HANDLER); 117 ECORE_MAGIC_SET(eh, ECORE_MAGIC_EVENT_HANDLER);
115 eh->type = type; 118 eh->type = type;
@@ -130,7 +133,7 @@ ecore_event_handler_add(int type,
130 new_handlers = realloc(event_handlers, event_handlers_alloc_num * sizeof(Ecore_Event_Handler *)); 133 new_handlers = realloc(event_handlers, event_handlers_alloc_num * sizeof(Ecore_Event_Handler *));
131 if (!new_handlers) 134 if (!new_handlers)
132 { 135 {
133 free(eh); 136 ecore_event_handler_mp_free(eh);
134 goto unlock; 137 goto unlock;
135 } 138 }
136 event_handlers = new_handlers; 139 event_handlers = new_handlers;
@@ -234,7 +237,7 @@ unlock:
234static void 237static void
235_ecore_event_generic_free(void *data __UNUSED__, 238_ecore_event_generic_free(void *data __UNUSED__,
236 void *event) 239 void *event)
237{ 240{ /* DO NOT MEMPOOL FREE THIS */
238 free (event); 241 free (event);
239} 242}
240 243
@@ -358,7 +361,7 @@ ecore_event_filter_add(Ecore_Data_Cb func_start,
358 361
359 _ecore_lock(); 362 _ecore_lock();
360 if (!func_filter) goto unlock; 363 if (!func_filter) goto unlock;
361 ef = calloc(1, sizeof(Ecore_Event_Filter)); 364 ef = ecore_event_filter_calloc(1);
362 if (!ef) goto unlock; 365 if (!ef) goto unlock;
363 ECORE_MAGIC_SET(ef, ECORE_MAGIC_EVENT_FILTER); 366 ECORE_MAGIC_SET(ef, ECORE_MAGIC_EVENT_FILTER);
364 ef->func_start = func_start; 367 ef->func_start = func_start;
@@ -469,11 +472,11 @@ _ecore_event_shutdown(void)
469 { 472 {
470 event_handlers[i] = (Ecore_Event_Handler *)eina_inlist_remove(EINA_INLIST_GET(event_handlers[i]), EINA_INLIST_GET(event_handlers[i])); 473 event_handlers[i] = (Ecore_Event_Handler *)eina_inlist_remove(EINA_INLIST_GET(event_handlers[i]), EINA_INLIST_GET(event_handlers[i]));
471 ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE); 474 ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
472 if (!eh->delete_me) free(eh); 475 if (!eh->delete_me) ecore_event_handler_mp_free(eh);
473 } 476 }
474 } 477 }
475 EINA_LIST_FREE(event_handlers_delete_list, eh) 478 EINA_LIST_FREE(event_handlers_delete_list, eh)
476 free(eh); 479 ecore_event_handler_mp_free(eh);
477 if (event_handlers) free(event_handlers); 480 if (event_handlers) free(event_handlers);
478 event_handlers = NULL; 481 event_handlers = NULL;
479 event_handlers_num = 0; 482 event_handlers_num = 0;
@@ -482,7 +485,7 @@ _ecore_event_shutdown(void)
482 { 485 {
483 event_filters = (Ecore_Event_Filter *)eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(event_filters)); 486 event_filters = (Ecore_Event_Filter *)eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(event_filters));
484 ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE); 487 ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
485 free(ef); 488 ecore_event_filter_mp_free(ef);
486 } 489 }
487 event_filters_delete_me = 0; 490 event_filters_delete_me = 0;
488 event_filter_current = NULL; 491 event_filter_current = NULL;
@@ -506,7 +509,7 @@ _ecore_event_add(int type,
506{ 509{
507 Ecore_Event *e; 510 Ecore_Event *e;
508 511
509 e = calloc(1, sizeof(Ecore_Event)); 512 e = ecore_event_calloc(1);
510 if (!e) return NULL; 513 if (!e) return NULL;
511 ECORE_MAGIC_SET(e, ECORE_MAGIC_EVENT); 514 ECORE_MAGIC_SET(e, ECORE_MAGIC_EVENT);
512 e->type = type; 515 e->type = type;
@@ -535,7 +538,7 @@ _ecore_event_del(Ecore_Event *event)
535 if (event->func_free) _ecore_call_end_cb(event->func_free, event->data, event->event); 538 if (event->func_free) _ecore_call_end_cb(event->func_free, event->data, event->event);
536 events = (Ecore_Event *)eina_inlist_remove(EINA_INLIST_GET(events), EINA_INLIST_GET(event)); 539 events = (Ecore_Event *)eina_inlist_remove(EINA_INLIST_GET(events), EINA_INLIST_GET(event));
537 ECORE_MAGIC_SET(event, ECORE_MAGIC_NONE); 540 ECORE_MAGIC_SET(event, ECORE_MAGIC_NONE);
538 free(event); 541 ecore_event_mp_free(event);
539 events_num--; 542 events_num--;
540 return data; 543 return data;
541} 544}
@@ -638,7 +641,7 @@ _ecore_event_filters_apply()
638 641
639 event_filters = (Ecore_Event_Filter *)eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef)); 642 event_filters = (Ecore_Event_Filter *)eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef));
640 ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE); 643 ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
641 free(ef); 644 ecore_event_filter_mp_free(ef);
642 } 645 }
643 } 646 }
644 if (!deleted_in_use) 647 if (!deleted_in_use)
@@ -742,7 +745,7 @@ _ecore_event_call(void)
742 745
743 event_handlers[eh->type] = (Ecore_Event_Handler *)eina_inlist_remove(EINA_INLIST_GET(event_handlers[eh->type]), EINA_INLIST_GET(eh)); 746 event_handlers[eh->type] = (Ecore_Event_Handler *)eina_inlist_remove(EINA_INLIST_GET(event_handlers[eh->type]), EINA_INLIST_GET(eh));
744 ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE); 747 ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
745 free(eh); 748 ecore_event_handler_mp_free(eh);
746 } 749 }
747} 750}
748 751
diff --git a/libraries/ecore/src/lib/ecore/ecore_getopt.c b/libraries/ecore/src/lib/ecore/ecore_getopt.c
index 0ce8f6e..76272d3 100644
--- a/libraries/ecore/src/lib/ecore/ecore_getopt.c
+++ b/libraries/ecore/src/lib/ecore/ecore_getopt.c
@@ -19,6 +19,7 @@ extern "C"
19void *alloca(size_t); 19void *alloca(size_t);
20#endif 20#endif
21 21
22#include <stdlib.h>
22#include <stdio.h> 23#include <stdio.h>
23#include <string.h> 24#include <string.h>
24#include <stdarg.h> 25#include <stdarg.h>
@@ -130,7 +131,7 @@ _ecore_getopt_help_line(FILE *fp,
130 todo = len; 131 todo = len;
131 132
132 for (i = 0; i < todo; i++) 133 for (i = 0; i < todo; i++)
133 if (isspace(text[i])) 134 if (isspace((unsigned char)text[i]))
134 { 135 {
135 space = text + i; 136 space = text + i;
136 break; 137 break;
@@ -1762,7 +1763,7 @@ _ecore_getopt_find_help(const Ecore_Getopt *parser)
1762 * will be applied on them if ecore was compiled with such support. 1763 * will be applied on them if ecore was compiled with such support.
1763 * 1764 *
1764 * @param parser description of how to work. 1765 * @param parser description of how to work.
1765 * @param value where to store values, it is assumed that this is a vector 1766 * @param values where to store values, it is assumed that this is a vector
1766 * of the same size as @c parser->descs. Values should be previously 1767 * of the same size as @c parser->descs. Values should be previously
1767 * initialized. 1768 * initialized.
1768 * @param argc how many elements in @a argv. If not provided it will be 1769 * @param argc how many elements in @a argv. If not provided it will be
@@ -1854,7 +1855,8 @@ ecore_getopt_list_free(Eina_List *list)
1854/** 1855/**
1855 * Helper ecore_getopt callback to parse geometry (x:y:w:h). 1856 * Helper ecore_getopt callback to parse geometry (x:y:w:h).
1856 * 1857 *
1857 * Storage must be a pointer to @c Eina_Rectangle and will be used to 1858 * @param str Geometry value
1859 * @param storage must be a pointer to @c Eina_Rectangle and will be used to
1858 * store the four values passed in the given string. 1860 * store the four values passed in the given string.
1859 * 1861 *
1860 * @c callback_data value is ignored, you can safely use @c NULL. 1862 * @c callback_data value is ignored, you can safely use @c NULL.
@@ -1880,7 +1882,8 @@ ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser __UNUSED__,
1880/** 1882/**
1881 * Helper ecore_getopt callback to parse geometry size (WxH). 1883 * Helper ecore_getopt callback to parse geometry size (WxH).
1882 * 1884 *
1883 * Storage must be a pointer to @c Eina_Rectangle and will be used to 1885 * @param str size value
1886 * @param storage must be a pointer to @c Eina_Rectangle and will be used to
1884 * store the two values passed in the given string and 0 in the x and y 1887 * store the two values passed in the given string and 0 in the x and y
1885 * fields. 1888 * fields.
1886 * 1889 *
diff --git a/libraries/ecore/src/lib/ecore/ecore_glib.c b/libraries/ecore/src/lib/ecore/ecore_glib.c
index 6ddcd36..7cea1c9 100644
--- a/libraries/ecore/src/lib/ecore/ecore_glib.c
+++ b/libraries/ecore/src/lib/ecore/ecore_glib.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6 7
7#include "Ecore.h" 8#include "Ecore.h"
@@ -189,7 +190,9 @@ _ecore_glib_select(int ecore_fds,
189 int ret; 190 int ret;
190 191
191 if (g_main_context_acquire(ctx)) 192 if (g_main_context_acquire(ctx))
192 g_mutex_lock(mutex); 193 {
194 if (mutex) g_mutex_lock(mutex);
195 }
193 else 196 else
194 { 197 {
195 if (!_ecore_glib_cond) 198 if (!_ecore_glib_cond)
@@ -202,8 +205,9 @@ _ecore_glib_select(int ecore_fds,
202 ret = _ecore_glib_select__locked 205 ret = _ecore_glib_select__locked
203 (ctx, ecore_fds, rfds, wfds, efds, ecore_timeout); 206 (ctx, ecore_fds, rfds, wfds, efds, ecore_timeout);
204 207
205 g_mutex_unlock(mutex); 208 if (mutex) g_mutex_unlock(mutex);
206 g_main_context_release(ctx); 209 g_main_context_release(ctx);
210 g_static_mutex_free(&lock);
207 211
208 return ret; 212 return ret;
209} 213}
diff --git a/libraries/ecore/src/lib/ecore/ecore_idle_enterer.c b/libraries/ecore/src/lib/ecore/ecore_idle_enterer.c
index 03cd1c4..8e4ae50 100644
--- a/libraries/ecore/src/lib/ecore/ecore_idle_enterer.c
+++ b/libraries/ecore/src/lib/ecore/ecore_idle_enterer.c
@@ -16,6 +16,7 @@ struct _Ecore_Idle_Enterer
16 int references; 16 int references;
17 Eina_Bool delete_me : 1; 17 Eina_Bool delete_me : 1;
18}; 18};
19GENERIC_ALLOC_SIZE_DECLARE(Ecore_Idle_Enterer);
19 20
20static Ecore_Idle_Enterer *idle_enterers = NULL; 21static Ecore_Idle_Enterer *idle_enterers = NULL;
21static Ecore_Idle_Enterer *idle_enterer_current = NULL; 22static Ecore_Idle_Enterer *idle_enterer_current = NULL;
@@ -49,7 +50,7 @@ ecore_idle_enterer_add(Ecore_Task_Cb func,
49 _ecore_lock(); 50 _ecore_lock();
50 51
51 if (!func) goto unlock; 52 if (!func) goto unlock;
52 ie = calloc(1, sizeof(Ecore_Idle_Enterer)); 53 ie = ecore_idle_enterer_calloc(1);
53 if (!ie) goto unlock; 54 if (!ie) goto unlock;
54 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_ENTERER); 55 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_ENTERER);
55 ie->func = func; 56 ie->func = func;
@@ -79,7 +80,7 @@ ecore_idle_enterer_before_add(Ecore_Task_Cb func,
79 _ecore_lock(); 80 _ecore_lock();
80 81
81 if (!func) goto unlock; 82 if (!func) goto unlock;
82 ie = calloc(1, sizeof(Ecore_Idle_Enterer)); 83 ie = ecore_idle_enterer_calloc(1);
83 if (!ie) goto unlock; 84 if (!ie) goto unlock;
84 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_ENTERER); 85 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_ENTERER);
85 ie->func = func; 86 ie->func = func;
@@ -134,7 +135,7 @@ _ecore_idle_enterer_shutdown(void)
134 { 135 {
135 idle_enterers = (Ecore_Idle_Enterer *)eina_inlist_remove(EINA_INLIST_GET(idle_enterers), EINA_INLIST_GET(idle_enterers)); 136 idle_enterers = (Ecore_Idle_Enterer *)eina_inlist_remove(EINA_INLIST_GET(idle_enterers), EINA_INLIST_GET(idle_enterers));
136 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 137 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
137 free(ie); 138 ecore_idle_enterer_mp_free(ie);
138 } 139 }
139 idle_enterers_delete_me = 0; 140 idle_enterers_delete_me = 0;
140 idle_enterer_current = NULL; 141 idle_enterer_current = NULL;
@@ -190,7 +191,7 @@ _ecore_idle_enterer_call(void)
190 191
191 idle_enterers = (Ecore_Idle_Enterer *)eina_inlist_remove(EINA_INLIST_GET(idle_enterers), EINA_INLIST_GET(ie)); 192 idle_enterers = (Ecore_Idle_Enterer *)eina_inlist_remove(EINA_INLIST_GET(idle_enterers), EINA_INLIST_GET(ie));
192 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 193 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
193 free(ie); 194 ecore_idle_enterer_mp_free(ie);
194 } 195 }
195 } 196 }
196 if (!deleted_idler_enterers_in_use) 197 if (!deleted_idler_enterers_in_use)
diff --git a/libraries/ecore/src/lib/ecore/ecore_idle_exiter.c b/libraries/ecore/src/lib/ecore/ecore_idle_exiter.c
index 70c6a7a..4e454e2 100644
--- a/libraries/ecore/src/lib/ecore/ecore_idle_exiter.c
+++ b/libraries/ecore/src/lib/ecore/ecore_idle_exiter.c
@@ -16,6 +16,7 @@ struct _Ecore_Idle_Exiter
16 int references; 16 int references;
17 Eina_Bool delete_me : 1; 17 Eina_Bool delete_me : 1;
18}; 18};
19GENERIC_ALLOC_SIZE_DECLARE(Ecore_Idle_Exiter);
19 20
20static Ecore_Idle_Exiter *idle_exiters = NULL; 21static Ecore_Idle_Exiter *idle_exiters = NULL;
21static Ecore_Idle_Exiter *idle_exiter_current = NULL; 22static Ecore_Idle_Exiter *idle_exiter_current = NULL;
@@ -47,7 +48,7 @@ ecore_idle_exiter_add(Ecore_Task_Cb func,
47 48
48 _ecore_lock(); 49 _ecore_lock();
49 if (!func) goto unlock; 50 if (!func) goto unlock;
50 ie = calloc(1, sizeof(Ecore_Idle_Exiter)); 51 ie = ecore_idle_exiter_calloc(1);
51 if (!ie) goto unlock; 52 if (!ie) goto unlock;
52 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_EXITER); 53 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLE_EXITER);
53 ie->func = func; 54 ie->func = func;
@@ -102,7 +103,7 @@ _ecore_idle_exiter_shutdown(void)
102 { 103 {
103 idle_exiters = (Ecore_Idle_Exiter *)eina_inlist_remove(EINA_INLIST_GET(idle_exiters), EINA_INLIST_GET(idle_exiters)); 104 idle_exiters = (Ecore_Idle_Exiter *)eina_inlist_remove(EINA_INLIST_GET(idle_exiters), EINA_INLIST_GET(idle_exiters));
104 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 105 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
105 free(ie); 106 ecore_idle_exiter_mp_free(ie);
106 } 107 }
107 idle_exiters_delete_me = 0; 108 idle_exiters_delete_me = 0;
108 idle_exiter_current = NULL; 109 idle_exiter_current = NULL;
@@ -159,7 +160,7 @@ _ecore_idle_exiter_call(void)
159 160
160 idle_exiters = (Ecore_Idle_Exiter *)eina_inlist_remove(EINA_INLIST_GET(idle_exiters), EINA_INLIST_GET(ie)); 161 idle_exiters = (Ecore_Idle_Exiter *)eina_inlist_remove(EINA_INLIST_GET(idle_exiters), EINA_INLIST_GET(ie));
161 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 162 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
162 free(ie); 163 ecore_idle_exiter_mp_free(ie);
163 } 164 }
164 } 165 }
165 if (!deleted_idler_exiters_in_use) 166 if (!deleted_idler_exiters_in_use)
diff --git a/libraries/ecore/src/lib/ecore/ecore_idler.c b/libraries/ecore/src/lib/ecore/ecore_idler.c
index 6c0cab8..5114654 100644
--- a/libraries/ecore/src/lib/ecore/ecore_idler.c
+++ b/libraries/ecore/src/lib/ecore/ecore_idler.c
@@ -16,6 +16,7 @@ struct _Ecore_Idler
16 int references; 16 int references;
17 Eina_Bool delete_me : 1; 17 Eina_Bool delete_me : 1;
18}; 18};
19GENERIC_ALLOC_SIZE_DECLARE(Ecore_Idler);
19 20
20static Ecore_Idler *idlers = NULL; 21static Ecore_Idler *idlers = NULL;
21static Ecore_Idler *idler_current = NULL; 22static Ecore_Idler *idler_current = NULL;
@@ -32,7 +33,7 @@ ecore_idler_add(Ecore_Task_Cb func,
32 33
33 _ecore_lock(); 34 _ecore_lock();
34 if (!func) goto unlock; 35 if (!func) goto unlock;
35 ie = calloc(1, sizeof(Ecore_Idler)); 36 ie = ecore_idler_calloc(1);
36 if (!ie) goto unlock; 37 if (!ie) goto unlock;
37 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLER); 38 ECORE_MAGIC_SET(ie, ECORE_MAGIC_IDLER);
38 ie->func = func; 39 ie->func = func;
@@ -86,7 +87,7 @@ _ecore_idler_shutdown(void)
86 { 87 {
87 idlers = (Ecore_Idler *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(idlers)); 88 idlers = (Ecore_Idler *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(idlers));
88 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 89 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
89 free(ie); 90 ecore_idler_mp_free(ie);
90 } 91 }
91 idlers_delete_me = 0; 92 idlers_delete_me = 0;
92 idler_current = NULL; 93 idler_current = NULL;
@@ -139,7 +140,7 @@ _ecore_idler_all_call(void)
139 140
140 idlers = (Ecore_Idler *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie)); 141 idlers = (Ecore_Idler *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie));
141 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE); 142 ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
142 free(ie); 143 ecore_idler_mp_free(ie);
143 } 144 }
144 } 145 }
145 if (!deleted_idlers_in_use) 146 if (!deleted_idlers_in_use)
diff --git a/libraries/ecore/src/lib/ecore/ecore_job.c b/libraries/ecore/src/lib/ecore/ecore_job.c
index 481c3f3..ac27c7a 100644
--- a/libraries/ecore/src/lib/ecore/ecore_job.c
+++ b/libraries/ecore/src/lib/ecore/ecore_job.c
@@ -23,6 +23,7 @@ struct _Ecore_Job
23 Ecore_Cb func; 23 Ecore_Cb func;
24 void *data; 24 void *data;
25}; 25};
26GENERIC_ALLOC_SIZE_DECLARE(Ecore_Job);
26 27
27void 28void
28_ecore_job_init(void) 29_ecore_job_init(void)
@@ -61,13 +62,13 @@ ecore_job_add(Ecore_Cb func,
61 62
62 if (!func) return NULL; 63 if (!func) return NULL;
63 64
64 job = calloc(1, sizeof(Ecore_Job)); 65 job = ecore_job_calloc(1);
65 if (!job) return NULL; 66 if (!job) return NULL;
66 ECORE_MAGIC_SET(job, ECORE_MAGIC_JOB); 67 ECORE_MAGIC_SET(job, ECORE_MAGIC_JOB);
67 job->event = ecore_event_add(ecore_event_job_type, job, _ecore_job_event_free, NULL); 68 job->event = ecore_event_add(ecore_event_job_type, job, _ecore_job_event_free, NULL);
68 if (!job->event) 69 if (!job->event)
69 { 70 {
70 free(job); 71 ecore_job_mp_free(job);
71 return NULL; 72 return NULL;
72 } 73 }
73 job->func = func; 74 job->func = func;
@@ -115,8 +116,8 @@ _ecore_job_event_handler(void *data __UNUSED__,
115 116
116static void 117static void
117_ecore_job_event_free(void *data __UNUSED__, 118_ecore_job_event_free(void *data __UNUSED__,
118 void *ev) 119 void *job)
119{ 120{
120 free(ev); 121 ecore_job_mp_free(job);
121} 122}
122 123
diff --git a/libraries/ecore/src/lib/ecore/ecore_main.c b/libraries/ecore/src/lib/ecore/ecore_main.c
index 152836a..76aced6 100644
--- a/libraries/ecore/src/lib/ecore/ecore_main.c
+++ b/libraries/ecore/src/lib/ecore/ecore_main.c
@@ -167,6 +167,7 @@ struct _Ecore_Fd_Handler
167 GPollFD gfd; 167 GPollFD gfd;
168#endif 168#endif
169}; 169};
170GENERIC_ALLOC_SIZE_DECLARE(Ecore_Fd_Handler);
170 171
171#ifdef _WIN32 172#ifdef _WIN32
172struct _Ecore_Win32_Handler 173struct _Ecore_Win32_Handler
@@ -179,6 +180,7 @@ struct _Ecore_Win32_Handler
179 int references; 180 int references;
180 Eina_Bool delete_me : 1; 181 Eina_Bool delete_me : 1;
181}; 182};
183GENERIC_ALLOC_SIZE_DECLARE(Ecore_Win32_Handler);
182#endif 184#endif
183 185
184#ifndef USE_G_MAIN_LOOP 186#ifndef USE_G_MAIN_LOOP
@@ -207,9 +209,7 @@ static void _ecore_main_win32_handlers_cleanup(void);
207#endif 209#endif
208 210
209static int in_main_loop = 0; 211static int in_main_loop = 0;
210#ifndef USE_G_MAIN_LOOP
211static int do_quit = 0; 212static int do_quit = 0;
212#endif
213static Ecore_Fd_Handler *fd_handlers = NULL; 213static Ecore_Fd_Handler *fd_handlers = NULL;
214static Ecore_Fd_Handler *fd_handler_current = NULL; 214static Ecore_Fd_Handler *fd_handler_current = NULL;
215static Eina_List *fd_handlers_with_prep = NULL; 215static Eina_List *fd_handlers_with_prep = NULL;
@@ -889,8 +889,13 @@ ecore_main_loop_begin(void)
889 in_main_loop--; 889 in_main_loop--;
890 _ecore_unlock(); 890 _ecore_unlock();
891#else 891#else
892 ecore_main_loop = g_main_loop_new(NULL, FALSE); 892 if (!do_quit)
893 g_main_loop_run(ecore_main_loop); 893 {
894 if (!ecore_main_loop)
895 ecore_main_loop = g_main_loop_new(NULL, FALSE);
896 g_main_loop_run(ecore_main_loop);
897 }
898 do_quit = 0;
894#endif 899#endif
895} 900}
896 901
@@ -904,10 +909,10 @@ ecore_main_loop_begin(void)
904EAPI void 909EAPI void
905ecore_main_loop_quit(void) 910ecore_main_loop_quit(void)
906{ 911{
907#ifndef USE_G_MAIN_LOOP
908 do_quit = 1; 912 do_quit = 1;
909#else 913#ifdef USE_G_MAIN_LOOP
910 g_main_loop_quit(ecore_main_loop); 914 if (ecore_main_loop)
915 g_main_loop_quit(ecore_main_loop);
911#endif 916#endif
912} 917}
913 918
@@ -987,7 +992,7 @@ ecore_main_fd_handler_add(int fd,
987 992
988 if ((fd < 0) || (flags == 0) || (!func)) goto unlock; 993 if ((fd < 0) || (flags == 0) || (!func)) goto unlock;
989 994
990 fdh = calloc(1, sizeof(Ecore_Fd_Handler)); 995 fdh = ecore_fd_handler_calloc(1);
991 if (!fdh) goto unlock; 996 if (!fdh) goto unlock;
992 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_FD_HANDLER); 997 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_FD_HANDLER);
993 fdh->next_ready = NULL; 998 fdh->next_ready = NULL;
@@ -997,7 +1002,7 @@ ecore_main_fd_handler_add(int fd,
997 { 1002 {
998 int err = errno; 1003 int err = errno;
999 ERR("Failed to add poll on fd %d (errno = %d: %s)!", fd, err, strerror(err)); 1004 ERR("Failed to add poll on fd %d (errno = %d: %s)!", fd, err, strerror(err));
1000 free(fdh); 1005 ecore_fd_handler_mp_free(fdh);
1001 fdh = NULL; 1006 fdh = NULL;
1002 goto unlock; 1007 goto unlock;
1003 } 1008 }
@@ -1030,7 +1035,7 @@ ecore_main_win32_handler_add(void *h,
1030 1035
1031 if (!h || !func) return NULL; 1036 if (!h || !func) return NULL;
1032 1037
1033 wh = calloc(1, sizeof(Ecore_Win32_Handler)); 1038 wh = ecore_win32_handler_calloc(1);
1034 if (!wh) return NULL; 1039 if (!wh) return NULL;
1035 ECORE_MAGIC_SET(wh, ECORE_MAGIC_WIN32_HANDLER); 1040 ECORE_MAGIC_SET(wh, ECORE_MAGIC_WIN32_HANDLER);
1036 wh->h = (HANDLE)h; 1041 wh->h = (HANDLE)h;
@@ -1260,7 +1265,7 @@ _ecore_main_shutdown(void)
1260 fd_handlers = (Ecore_Fd_Handler *)eina_inlist_remove(EINA_INLIST_GET(fd_handlers), 1265 fd_handlers = (Ecore_Fd_Handler *)eina_inlist_remove(EINA_INLIST_GET(fd_handlers),
1261 EINA_INLIST_GET(fdh)); 1266 EINA_INLIST_GET(fdh));
1262 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE); 1267 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE);
1263 free(fdh); 1268 ecore_fd_handler_mp_free(fdh);
1264 } 1269 }
1265 if (fd_handlers_with_buffer) 1270 if (fd_handlers_with_buffer)
1266 fd_handlers_with_buffer = eina_list_free(fd_handlers_with_buffer); 1271 fd_handlers_with_buffer = eina_list_free(fd_handlers_with_buffer);
@@ -1283,7 +1288,7 @@ _ecore_main_shutdown(void)
1283 win32_handlers = (Ecore_Win32_Handler *)eina_inlist_remove(EINA_INLIST_GET(win32_handlers), 1288 win32_handlers = (Ecore_Win32_Handler *)eina_inlist_remove(EINA_INLIST_GET(win32_handlers),
1284 EINA_INLIST_GET(wh)); 1289 EINA_INLIST_GET(wh));
1285 ECORE_MAGIC_SET(wh, ECORE_MAGIC_NONE); 1290 ECORE_MAGIC_SET(wh, ECORE_MAGIC_NONE);
1286 free(wh); 1291 ecore_win32_handler_mp_free(wh);
1287 } 1292 }
1288 win32_handlers_delete_me = EINA_FALSE; 1293 win32_handlers_delete_me = EINA_FALSE;
1289 win32_handler_current = NULL; 1294 win32_handler_current = NULL;
@@ -1524,7 +1529,7 @@ _ecore_main_fd_handlers_cleanup(void)
1524 fd_handlers = (Ecore_Fd_Handler *) 1529 fd_handlers = (Ecore_Fd_Handler *)
1525 eina_inlist_remove(EINA_INLIST_GET(fd_handlers), EINA_INLIST_GET(fdh)); 1530 eina_inlist_remove(EINA_INLIST_GET(fd_handlers), EINA_INLIST_GET(fdh));
1526 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE); 1531 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE);
1527 free(fdh); 1532 ecore_fd_handler_mp_free(fdh);
1528 fd_handlers_to_delete = eina_list_remove_list(fd_handlers_to_delete, l); 1533 fd_handlers_to_delete = eina_list_remove_list(fd_handlers_to_delete, l);
1529 } 1534 }
1530} 1535}
@@ -1555,7 +1560,7 @@ _ecore_main_win32_handlers_cleanup(void)
1555 eina_inlist_remove(EINA_INLIST_GET(win32_handlers), 1560 eina_inlist_remove(EINA_INLIST_GET(win32_handlers),
1556 EINA_INLIST_GET(wh)); 1561 EINA_INLIST_GET(wh));
1557 ECORE_MAGIC_SET(wh, ECORE_MAGIC_NONE); 1562 ECORE_MAGIC_SET(wh, ECORE_MAGIC_NONE);
1558 free(wh); 1563 ecore_win32_handler_mp_free(wh);
1559 } 1564 }
1560 } 1565 }
1561 if (!deleted_in_use) win32_handlers_delete_me = EINA_FALSE; 1566 if (!deleted_in_use) win32_handlers_delete_me = EINA_FALSE;
diff --git a/libraries/ecore/src/lib/ecore/ecore_pipe.c b/libraries/ecore/src/lib/ecore/ecore_pipe.c
index 0ab7dd0..aa640cd 100644
--- a/libraries/ecore/src/lib/ecore/ecore_pipe.c
+++ b/libraries/ecore/src/lib/ecore/ecore_pipe.c
@@ -95,6 +95,7 @@ struct _Ecore_Pipe
95 int message; 95 int message;
96 Eina_Bool delete_me : 1; 96 Eina_Bool delete_me : 1;
97}; 97};
98GENERIC_ALLOC_SIZE_DECLARE(Ecore_Pipe);
98 99
99static Eina_Bool _ecore_pipe_read(void *data, 100static Eina_Bool _ecore_pipe_read(void *data,
100 Ecore_Fd_Handler *fd_handler); 101 Ecore_Fd_Handler *fd_handler);
@@ -125,12 +126,12 @@ ecore_pipe_add(Ecore_Pipe_Cb handler,
125 126
126 if (!handler) return NULL; 127 if (!handler) return NULL;
127 128
128 p = (Ecore_Pipe *)calloc(1, sizeof(Ecore_Pipe)); 129 p = ecore_pipe_calloc(1);
129 if (!p) return NULL; 130 if (!p) return NULL;
130 131
131 if (pipe(fds)) 132 if (pipe(fds))
132 { 133 {
133 free(p); 134 ecore_pipe_mp_free(p);
134 return NULL; 135 return NULL;
135 } 136 }
136 137
@@ -171,7 +172,7 @@ ecore_pipe_del(Ecore_Pipe *p)
171 if (p->fd_read != PIPE_FD_INVALID) pipe_close(p->fd_read); 172 if (p->fd_read != PIPE_FD_INVALID) pipe_close(p->fd_read);
172 if (p->fd_write != PIPE_FD_INVALID) pipe_close(p->fd_write); 173 if (p->fd_write != PIPE_FD_INVALID) pipe_close(p->fd_write);
173 data = (void *)p->data; 174 data = (void *)p->data;
174 free(p); 175 ecore_pipe_mp_free(p);
175 return data; 176 return data;
176} 177}
177 178
@@ -535,7 +536,6 @@ _ecore_pipe_read(void *data,
535 else if ((ret == PIPE_FD_ERROR) && 536 else if ((ret == PIPE_FD_ERROR) &&
536 ((errno == EINTR) || (errno == EAGAIN))) 537 ((errno == EINTR) || (errno == EAGAIN)))
537 { 538 {
538 _ecore_pipe_unhandle(p);
539 return ECORE_CALLBACK_RENEW; 539 return ECORE_CALLBACK_RENEW;
540 } 540 }
541 else 541 else
@@ -543,7 +543,6 @@ _ecore_pipe_read(void *data,
543 ERR("An unhandled error (ret: %i errno: %i [%s])" 543 ERR("An unhandled error (ret: %i errno: %i [%s])"
544 "occurred while reading from the pipe the length", 544 "occurred while reading from the pipe the length",
545 (int)ret, errno, strerror(errno)); 545 (int)ret, errno, strerror(errno));
546 _ecore_pipe_unhandle(p);
547 return ECORE_CALLBACK_RENEW; 546 return ECORE_CALLBACK_RENEW;
548 } 547 }
549#else 548#else
diff --git a/libraries/ecore/src/lib/ecore/ecore_poll.c b/libraries/ecore/src/lib/ecore/ecore_poll.c
index a283cb5..732850b 100644
--- a/libraries/ecore/src/lib/ecore/ecore_poll.c
+++ b/libraries/ecore/src/lib/ecore/ecore_poll.c
@@ -16,6 +16,7 @@ struct _Ecore_Poller
16 Ecore_Task_Cb func; 16 Ecore_Task_Cb func;
17 void *data; 17 void *data;
18}; 18};
19GENERIC_ALLOC_SIZE_DECLARE(Ecore_Poller);
19 20
20static Ecore_Timer *timer = NULL; 21static Ecore_Timer *timer = NULL;
21static int min_interval = -1; 22static int min_interval = -1;
@@ -109,8 +110,8 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
109 110
110 at_tick++; 111 at_tick++;
111 last_tick = ecore_time_get(); 112 last_tick = ecore_time_get();
112 /* we have 16 counters - each incriments every time the poller counter 113 /* we have 16 counters - each increments every time the poller counter
113 * "ticks". it incriments by the minimum interval (which can be 1, 2, 4, 114 * "ticks". it increments by the minimum interval (which can be 1, 2, 4,
114 * 7, 16 etc. up to 32768) */ 115 * 7, 16 etc. up to 32768) */
115 for (i = 0; i < 15; i++) 116 for (i = 0; i < 15; i++)
116 { 117 {
@@ -159,7 +160,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
159 if (poller->delete_me) 160 if (poller->delete_me)
160 { 161 {
161 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller)); 162 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller));
162 free(poller); 163 ecore_poller_mp_free(poller);
163 poller_delete_count--; 164 poller_delete_count--;
164 changes++; 165 changes++;
165 if (poller_delete_count <= 0) break; 166 if (poller_delete_count <= 0) break;
@@ -179,7 +180,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
179 at_tick--; 180 at_tick--;
180 181
181 /* if the timer was deleted then there is no point returning 1 - ambiguous 182 /* if the timer was deleted then there is no point returning 1 - ambiguous
182 * if we do as it im plies "keep running me" but we have been deleted 183 * if we do as it implies keep running me" but we have been deleted
183 * anyway */ 184 * anyway */
184 if (!timer) return ECORE_CALLBACK_CANCEL; 185 if (!timer) return ECORE_CALLBACK_CANCEL;
185 186
@@ -215,7 +216,7 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
215 * @param type The ticker type to query 216 * @param type The ticker type to query
216 * @return The time in seconds between ticks of the ticker clock 217 * @return The time in seconds between ticks of the ticker clock
217 * 218 *
218 * This will get the time between ticks of the specifider ticker clock. 219 * This will get the time between ticks of the specified ticker clock.
219 */ 220 */
220EAPI double 221EAPI double
221ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__) 222ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
@@ -281,7 +282,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
281 if (!func) return NULL; 282 if (!func) return NULL;
282 if (interval < 1) interval = 1; 283 if (interval < 1) interval = 1;
283 284
284 poller = calloc(1, sizeof(Ecore_Poller)); 285 poller = ecore_poller_calloc(1);
285 if (!poller) return NULL; 286 if (!poller) return NULL;
286 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER); 287 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER);
287 /* interval MUST be a power of 2, so enforce it */ 288 /* interval MUST be a power of 2, so enforce it */
@@ -413,7 +414,7 @@ ecore_poller_del(Ecore_Poller *poller)
413 /* not in loop so safe - delete immediately */ 414 /* not in loop so safe - delete immediately */
414 data = poller->data; 415 data = poller->data;
415 pollers[poller->ibit] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller)); 416 pollers[poller->ibit] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
416 free(poller); 417 ecore_poller_mp_free(poller);
417 _ecore_poller_next_tick_eval(); 418 _ecore_poller_next_tick_eval();
418 return data; 419 return data;
419} 420}
@@ -433,7 +434,7 @@ _ecore_poller_shutdown(void)
433 while ((poller = pollers[i])) 434 while ((poller = pollers[i]))
434 { 435 {
435 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i])); 436 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i]));
436 free(poller); 437 ecore_poller_mp_free(poller);
437 } 438 }
438 } 439 }
439} 440}
diff --git a/libraries/ecore/src/lib/ecore/ecore_private.h b/libraries/ecore/src/lib/ecore/ecore_private.h
index f328605..50d502c 100644
--- a/libraries/ecore/src/lib/ecore/ecore_private.h
+++ b/libraries/ecore/src/lib/ecore/ecore_private.h
@@ -79,6 +79,7 @@ extern int _ecore_log_dom;
79#define ECORE_MAGIC_WIN32_HANDLER 0xf7e8f1a3 79#define ECORE_MAGIC_WIN32_HANDLER 0xf7e8f1a3
80#define ECORE_MAGIC_JOB 0x76543210 80#define ECORE_MAGIC_JOB 0x76543210
81 81
82typedef unsigned int Ecore_Magic;
82#define ECORE_MAGIC Ecore_Magic __magic 83#define ECORE_MAGIC Ecore_Magic __magic
83 84
84#define ECORE_MAGIC_SET(d, m) (d)->__magic = (m) 85#define ECORE_MAGIC_SET(d, m) (d)->__magic = (m)
@@ -116,8 +117,6 @@ ecore_print_warning(const char *function,
116 return; \ 117 return; \
117 } 118 }
118 119
119typedef unsigned int Ecore_Magic;
120
121EAPI void _ecore_magic_fail(const void *d, 120EAPI void _ecore_magic_fail(const void *d,
122 Ecore_Magic m, 121 Ecore_Magic m,
123 Ecore_Magic req_m, 122 Ecore_Magic req_m,
@@ -350,4 +349,30 @@ extern double _ecore_time_loop_time;
350extern Eina_Bool _ecore_glib_always_integrate; 349extern Eina_Bool _ecore_glib_always_integrate;
351extern Ecore_Select_Function main_loop_select; 350extern Ecore_Select_Function main_loop_select;
352 351
352Eina_Bool ecore_mempool_init(void);
353void ecore_mempool_shutdown(void);
354#define GENERIC_ALLOC_FREE_HEADER(TYPE, Type) \
355 TYPE *Type##_calloc(unsigned int); \
356 void Type##_mp_free(TYPE *e);
357#define GENERIC_ALLOC_SIZE_DECLARE(TYPE) \
358 size_t _ecore_sizeof_##TYPE = sizeof (TYPE);
359
360GENERIC_ALLOC_FREE_HEADER(Ecore_Animator, ecore_animator);
361GENERIC_ALLOC_FREE_HEADER(Ecore_Event_Handler, ecore_event_handler);
362GENERIC_ALLOC_FREE_HEADER(Ecore_Event_Filter, ecore_event_filter);
363GENERIC_ALLOC_FREE_HEADER(Ecore_Event, ecore_event);
364GENERIC_ALLOC_FREE_HEADER(Ecore_Idle_Exiter, ecore_idle_exiter);
365GENERIC_ALLOC_FREE_HEADER(Ecore_Idle_Enterer, ecore_idle_enterer);
366GENERIC_ALLOC_FREE_HEADER(Ecore_Idler, ecore_idler);
367GENERIC_ALLOC_FREE_HEADER(Ecore_Job, ecore_job);
368GENERIC_ALLOC_FREE_HEADER(Ecore_Timer, ecore_timer);
369GENERIC_ALLOC_FREE_HEADER(Ecore_Poller, ecore_poller);
370GENERIC_ALLOC_FREE_HEADER(Ecore_Pipe, ecore_pipe);
371GENERIC_ALLOC_FREE_HEADER(Ecore_Fd_Handler, ecore_fd_handler);
372#ifdef _WIN32
373GENERIC_ALLOC_FREE_HEADER(Ecore_Win32_Handler, ecore_win32_handler);
374#endif
375
376#undef GENERIC_ALLOC_FREE_HEADER
377
353#endif 378#endif
diff --git a/libraries/ecore/src/lib/ecore/ecore_thread.c b/libraries/ecore/src/lib/ecore/ecore_thread.c
index 2a8ea76..4444ad4 100644
--- a/libraries/ecore/src/lib/ecore/ecore_thread.c
+++ b/libraries/ecore/src/lib/ecore/ecore_thread.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <sys/time.h> 6#include <sys/time.h>
6#include <assert.h> 7#include <assert.h>
7#include <sys/types.h> 8#include <sys/types.h>
@@ -388,7 +389,7 @@ static void _ecore_thread_handler(void *data __UNUSED__,
388static Ecore_Pipe * 389static Ecore_Pipe *
389_ecore_thread_pipe_get(void) 390_ecore_thread_pipe_get(void)
390{ 391{
391 if (eina_array_count_get(_ecore_thread_pipe) > 0) 392 if (eina_array_count(_ecore_thread_pipe) > 0)
392 return eina_array_pop(_ecore_thread_pipe); 393 return eina_array_pop(_ecore_thread_pipe);
393 394
394 return ecore_pipe_add(_ecore_thread_handler, NULL); 395 return ecore_pipe_add(_ecore_thread_handler, NULL);
@@ -458,7 +459,7 @@ _ecore_thread_pipe_free(void *data __UNUSED__,
458{ 459{
459 Ecore_Pipe *p = event; 460 Ecore_Pipe *p = event;
460 461
461 if (eina_array_count_get(_ecore_thread_pipe) < 50) 462 if (eina_array_count(_ecore_thread_pipe) < 50)
462 eina_array_push(_ecore_thread_pipe, p); 463 eina_array_push(_ecore_thread_pipe, p);
463 else 464 else
464 ecore_pipe_del(p); 465 ecore_pipe_del(p);
@@ -544,7 +545,7 @@ _ecore_thread_kill(Ecore_Pthread_Worker *work)
544 LKD(work->mutex); 545 LKD(work->mutex);
545 if (work->hash) 546 if (work->hash)
546 eina_hash_free(work->hash); 547 eina_hash_free(work->hash);
547 free(work); 548 _ecore_thread_worker_free(work);
548} 549}
549 550
550static void 551static void
@@ -594,7 +595,8 @@ _ecore_notify_handler(void *data,
594} 595}
595 596
596static void 597static void
597_ecore_short_job(Ecore_Pipe *end_pipe) 598_ecore_short_job(Ecore_Pipe *end_pipe,
599 PH(thread))
598{ 600{
599 Ecore_Pthread_Worker *work; 601 Ecore_Pthread_Worker *work;
600 602
@@ -614,6 +616,7 @@ _ecore_short_job(Ecore_Pipe *end_pipe)
614 616
615 LKU(_ecore_pending_job_threads_mutex); 617 LKU(_ecore_pending_job_threads_mutex);
616 618
619 work->self = thread;
617 if (!work->cancel) 620 if (!work->cancel)
618 work->u.short_run.func_blocking((void *)work->data, (Ecore_Thread *)work); 621 work->u.short_run.func_blocking((void *)work->data, (Ecore_Thread *)work);
619 622
@@ -737,7 +740,7 @@ _ecore_thread_worker(Ecore_Pthread_Data *pth)
737 eina_sched_prio_drop(); 740 eina_sched_prio_drop();
738 741
739restart: 742restart:
740 if (_ecore_pending_job_threads) _ecore_short_job(pth->p); 743 if (_ecore_pending_job_threads) _ecore_short_job(pth->p, pth->thread);
741 if (_ecore_pending_job_threads_feedback) _ecore_feedback_job(pth->p, pth->thread); 744 if (_ecore_pending_job_threads_feedback) _ecore_feedback_job(pth->p, pth->thread);
742 745
743 /* FIXME: Check if there is feedback running task todo, and switch to feedback run handler. */ 746 /* FIXME: Check if there is feedback running task todo, and switch to feedback run handler. */
@@ -929,6 +932,7 @@ ecore_thread_run(Ecore_Thread_Cb func_blocking,
929 work->data = data; 932 work->data = data;
930 933
931#ifdef EFL_HAVE_THREADS 934#ifdef EFL_HAVE_THREADS
935 work->self = 0;
932 work->hash = NULL; 936 work->hash = NULL;
933 CDI(work->cond); 937 CDI(work->cond);
934 LKI(work->mutex); 938 LKI(work->mutex);
@@ -1114,6 +1118,7 @@ ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
1114 worker->feedback_run = EINA_TRUE; 1118 worker->feedback_run = EINA_TRUE;
1115 worker->kill = EINA_FALSE; 1119 worker->kill = EINA_FALSE;
1116 worker->reschedule = EINA_FALSE; 1120 worker->reschedule = EINA_FALSE;
1121 worker->self = 0;
1117 1122
1118 worker->u.feedback_run.send = 0; 1123 worker->u.feedback_run.send = 0;
1119 worker->u.feedback_run.received = 0; 1124 worker->u.feedback_run.received = 0;
diff --git a/libraries/ecore/src/lib/ecore/ecore_timer.c b/libraries/ecore/src/lib/ecore/ecore_timer.c
index 9c66545..cc19e3f 100644
--- a/libraries/ecore/src/lib/ecore/ecore_timer.c
+++ b/libraries/ecore/src/lib/ecore/ecore_timer.c
@@ -35,6 +35,7 @@ struct _Ecore_Timer
35 unsigned char just_added : 1; 35 unsigned char just_added : 1;
36 unsigned char frozen : 1; 36 unsigned char frozen : 1;
37}; 37};
38GENERIC_ALLOC_SIZE_DECLARE(Ecore_Timer);
38 39
39static void _ecore_timer_set(Ecore_Timer *timer, 40static void _ecore_timer_set(Ecore_Timer *timer,
40 double at, 41 double at,
@@ -140,7 +141,7 @@ ecore_timer_add(double in,
140 _ecore_lock(); 141 _ecore_lock();
141 if (!func) goto unlock; 142 if (!func) goto unlock;
142 if (in < 0.0) in = 0.0; 143 if (in < 0.0) in = 0.0;
143 timer = calloc(1, sizeof(Ecore_Timer)); 144 timer = ecore_timer_calloc(1);
144 if (!timer) goto unlock; 145 if (!timer) goto unlock;
145 ECORE_MAGIC_SET(timer, ECORE_MAGIC_TIMER); 146 ECORE_MAGIC_SET(timer, ECORE_MAGIC_TIMER);
146 now = ecore_time_get(); 147 now = ecore_time_get();
@@ -287,6 +288,37 @@ ecore_timer_delay(Ecore_Timer *timer,
287} 288}
288 289
289/** 290/**
291 * Reset a timer to its full interval
292 * This doesn't affect the interval of a timer
293 * @param timer The timer
294 * @since 1.2
295 * @note This is equivalent to (but faster than)
296 * @code
297 * ecore_timer_delay(timer, ecore_timer_interval_get(timer) - ecore_timer_pending_get(timer));
298 * @endcode
299 */
300EAPI void
301ecore_timer_reset(Ecore_Timer *timer)
302{
303 double now, add;
304 if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
305 {
306 ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
307 __func__);
308 return;
309 }
310 _ecore_lock();
311 now = ecore_time_get();
312
313 if (timer->frozen)
314 add = timer->pending;
315 else
316 add = timer->at - now;
317 _ecore_timer_delay(timer, timer->in - add);
318 _ecore_unlock();
319}
320
321/**
290 * Get the pending time regarding a timer. 322 * Get the pending time regarding a timer.
291 * 323 *
292 * @param timer The timer to learn from. 324 * @param timer The timer to learn from.
@@ -470,7 +502,7 @@ _ecore_timer_loop_add(double in,
470 502
471 if (!func) return timer; 503 if (!func) return timer;
472 if (in < 0.0) in = 0.0; 504 if (in < 0.0) in = 0.0;
473 timer = calloc(1, sizeof(Ecore_Timer)); 505 timer = ecore_timer_calloc(1);
474 if (!timer) return timer; 506 if (!timer) return timer;
475 ECORE_MAGIC_SET(timer, ECORE_MAGIC_TIMER); 507 ECORE_MAGIC_SET(timer, ECORE_MAGIC_TIMER);
476 now = ecore_loop_time_get(); 508 now = ecore_loop_time_get();
@@ -510,7 +542,7 @@ _ecore_timer_del(Ecore_Timer *timer)
510 if (timer->delete_me) 542 if (timer->delete_me)
511 timers_delete_me--; 543 timers_delete_me--;
512 544
513 free(timer); 545 ecore_timer_mp_free(timer);
514 return data; 546 return data;
515 } 547 }
516 548
@@ -529,14 +561,14 @@ _ecore_timer_shutdown(void)
529 { 561 {
530 timers = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timers)); 562 timers = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timers));
531 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE); 563 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE);
532 free(timer); 564 ecore_timer_mp_free(timer);
533 } 565 }
534 566
535 while ((timer = suspended)) 567 while ((timer = suspended))
536 { 568 {
537 suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(suspended)); 569 suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(suspended));
538 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE); 570 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE);
539 free(timer); 571 ecore_timer_mp_free(timer);
540 } 572 }
541 573
542 timer_current = NULL; 574 timer_current = NULL;
@@ -563,7 +595,7 @@ _ecore_timer_cleanup(void)
563 } 595 }
564 timers = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer)); 596 timers = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer));
565 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE); 597 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE);
566 free(timer); 598 ecore_timer_mp_free(timer);
567 timers_delete_me--; 599 timers_delete_me--;
568 done++; 600 done++;
569 if (timers_delete_me == 0) return; 601 if (timers_delete_me == 0) return;
@@ -583,7 +615,7 @@ _ecore_timer_cleanup(void)
583 } 615 }
584 suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer)); 616 suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer));
585 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE); 617 ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE);
586 free(timer); 618 ecore_timer_mp_free(timer);
587 timers_delete_me--; 619 timers_delete_me--;
588 done++; 620 done++;
589 if (timers_delete_me == 0) return; 621 if (timers_delete_me == 0) return;
diff --git a/libraries/ecore/src/lib/ecore_cocoa/Makefile.in b/libraries/ecore/src/lib/ecore_cocoa/Makefile.in
index ede48a2..15ce879 100644
--- a/libraries/ecore/src/lib/ecore_cocoa/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_cocoa/Makefile.in
@@ -247,10 +247,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
248PIXMAN_LIBS = @PIXMAN_LIBS@ 248PIXMAN_LIBS = @PIXMAN_LIBS@
249PKG_CONFIG = @PKG_CONFIG@ 249PKG_CONFIG = @PKG_CONFIG@
250PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
251PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
252POSUB = @POSUB@ 250POSUB = @POSUB@
253RANLIB = @RANLIB@ 251RANLIB = @RANLIB@
252SCIM_CFLAGS = @SCIM_CFLAGS@
253SCIM_LIBS = @SCIM_LIBS@
254SDL_CFLAGS = @SDL_CFLAGS@ 254SDL_CFLAGS = @SDL_CFLAGS@
255SDL_CONFIG = @SDL_CONFIG@ 255SDL_CONFIG = @SDL_CONFIG@
256SDL_LIBS = @SDL_LIBS@ 256SDL_LIBS = @SDL_LIBS@
@@ -269,6 +269,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
269USE_NLS = @USE_NLS@ 269USE_NLS = @USE_NLS@
270VERSION = @VERSION@ 270VERSION = @VERSION@
271VMAJ = @VMAJ@ 271VMAJ = @VMAJ@
272WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
273WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
274WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
275WAYLAND_LIBS = @WAYLAND_LIBS@
272WIN32_CFLAGS = @WIN32_CFLAGS@ 276WIN32_CFLAGS = @WIN32_CFLAGS@
273WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 277WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
274WIN32_LIBS = @WIN32_LIBS@ 278WIN32_LIBS = @WIN32_LIBS@
@@ -382,6 +386,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
382ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 386ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
383ecore_imf_evas_libs = @ecore_imf_evas_libs@ 387ecore_imf_evas_libs = @ecore_imf_evas_libs@
384ecore_imf_libs = @ecore_imf_libs@ 388ecore_imf_libs = @ecore_imf_libs@
389ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
390ecore_imf_scim_libs = @ecore_imf_scim_libs@
385ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 391ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
386ecore_imf_xim_libs = @ecore_imf_xim_libs@ 392ecore_imf_xim_libs = @ecore_imf_xim_libs@
387ecore_input_cflags = @ecore_input_cflags@ 393ecore_input_cflags = @ecore_input_cflags@
@@ -394,6 +400,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
394ecore_psl1ght_libs = @ecore_psl1ght_libs@ 400ecore_psl1ght_libs = @ecore_psl1ght_libs@
395ecore_sdl_cflags = @ecore_sdl_cflags@ 401ecore_sdl_cflags = @ecore_sdl_cflags@
396ecore_sdl_libs = @ecore_sdl_libs@ 402ecore_sdl_libs = @ecore_sdl_libs@
403ecore_wayland_cflags = @ecore_wayland_cflags@
404ecore_wayland_libs = @ecore_wayland_libs@
397ecore_win32_cflags = @ecore_win32_cflags@ 405ecore_win32_cflags = @ecore_win32_cflags@
398ecore_win32_libs = @ecore_win32_libs@ 406ecore_win32_libs = @ecore_win32_libs@
399ecore_wince_cflags = @ecore_wince_cflags@ 407ecore_wince_cflags = @ecore_wince_cflags@
@@ -438,12 +446,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
438requirements_ecore_file = @requirements_ecore_file@ 446requirements_ecore_file = @requirements_ecore_file@
439requirements_ecore_imf = @requirements_ecore_imf@ 447requirements_ecore_imf = @requirements_ecore_imf@
440requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 448requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
449requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
441requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 450requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
442requirements_ecore_input = @requirements_ecore_input@ 451requirements_ecore_input = @requirements_ecore_input@
443requirements_ecore_input_evas = @requirements_ecore_input_evas@ 452requirements_ecore_input_evas = @requirements_ecore_input_evas@
444requirements_ecore_ipc = @requirements_ecore_ipc@ 453requirements_ecore_ipc = @requirements_ecore_ipc@
445requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 454requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
446requirements_ecore_sdl = @requirements_ecore_sdl@ 455requirements_ecore_sdl = @requirements_ecore_sdl@
456requirements_ecore_wayland = @requirements_ecore_wayland@
447requirements_ecore_win32 = @requirements_ecore_win32@ 457requirements_ecore_win32 = @requirements_ecore_win32@
448requirements_ecore_wince = @requirements_ecore_wince@ 458requirements_ecore_wince = @requirements_ecore_wince@
449requirements_ecore_x = @requirements_ecore_x@ 459requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_con/Ecore_Con.h b/libraries/ecore/src/lib/ecore_con/Ecore_Con.h
index e3b68c4..c3af46a 100644
--- a/libraries/ecore/src/lib/ecore_con/Ecore_Con.h
+++ b/libraries/ecore/src/lib/ecore_con/Ecore_Con.h
@@ -234,6 +234,14 @@ typedef struct _Ecore_Con_Server Ecore_Con_Server;
234typedef struct _Ecore_Con_Client Ecore_Con_Client; 234typedef struct _Ecore_Con_Client Ecore_Con_Client;
235 235
236/** 236/**
237 * @typedef Ecore_Con_Socks
238 * An object representing a SOCKS proxy
239 * @ingroup Ecore_Con_Socks_Group
240 * @since 1.2
241 */
242typedef struct Ecore_Con_Socks Ecore_Con_Socks;
243
244/**
237 * @typedef Ecore_Con_Url 245 * @typedef Ecore_Con_Url
238 * A handle to an http upload/download object 246 * A handle to an http upload/download object
239 * @ingroup Ecore_Con_Url_Group 247 * @ingroup Ecore_Con_Url_Group
@@ -325,6 +333,13 @@ typedef struct _Ecore_Con_Event_Client_Write Ecore_Con_Event_Client_Write;
325typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write; 333typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write;
326 334
327/** 335/**
336 * @typedef Ecore_Con_Event_Proxy_Bind
337 * Used as the @p data param for the corresponding event
338 * @since 1.2
339 */
340typedef struct _Ecore_Con_Event_Proxy_Bind Ecore_Con_Event_Proxy_Bind;
341
342/**
328 * @typedef Ecore_Con_Event_Url_Data 343 * @typedef Ecore_Con_Event_Url_Data
329 * Used as the @p data param for the corresponding event 344 * Used as the @p data param for the corresponding event
330 * @ingroup Ecore_Con_Url_Group 345 * @ingroup Ecore_Con_Url_Group
@@ -464,6 +479,19 @@ struct _Ecore_Con_Event_Server_Write
464}; 479};
465 480
466/** 481/**
482 * @struct _Ecore_Con_Event_Proxy_Bind
483 * Used as the @p data param for the @ref ECORE_CON_EVENT_PROXY_BIND event
484 * @ingroup Ecore_Con_Socks_Group
485 * @since 1.2
486 */
487struct _Ecore_Con_Event_Proxy_Bind
488{
489 Ecore_Con_Server *server; /**< the server object connected to the proxy */
490 const char *ip; /**< the proxy-bound ip address */
491 int port; /**< the proxy-bound port */
492};
493
494/**
467 * @struct _Ecore_Con_Event_Url_Data 495 * @struct _Ecore_Con_Event_Url_Data
468 * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event 496 * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event
469 * @ingroup Ecore_Con_Url_Group 497 * @ingroup Ecore_Con_Url_Group
@@ -542,6 +570,10 @@ EAPI extern int ECORE_CON_EVENT_SERVER_WRITE;
542EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; 570EAPI extern int ECORE_CON_EVENT_CLIENT_DATA;
543/** A server connection object has data */ 571/** A server connection object has data */
544EAPI extern int ECORE_CON_EVENT_SERVER_DATA; 572EAPI extern int ECORE_CON_EVENT_SERVER_DATA;
573/** A server connection has successfully negotiated an ip:port binding
574 * @since 1.2
575 */
576EAPI extern int ECORE_CON_EVENT_PROXY_BIND;
545/** A URL object has data */ 577/** A URL object has data */
546EAPI extern int ECORE_CON_EVENT_URL_DATA; 578EAPI extern int ECORE_CON_EVENT_URL_DATA;
547/** A URL object has completed its transfer to and from the server and can be reused */ 579/** A URL object has completed its transfer to and from the server and can be reused */
@@ -605,7 +637,13 @@ typedef enum _Ecore_Con_Type
605 ECORE_CON_REMOTE_UDP = 5, 637 ECORE_CON_REMOTE_UDP = 5,
606 /** Remote broadcast using UDP */ 638 /** Remote broadcast using UDP */
607 ECORE_CON_REMOTE_BROADCAST = 6, 639 ECORE_CON_REMOTE_BROADCAST = 6,
640 /** Remote connection sending packets immediately */
608 ECORE_CON_REMOTE_NODELAY = 7, 641 ECORE_CON_REMOTE_NODELAY = 7,
642 /** Remote connection sending data in large chunks
643 * @note Only available on Linux
644 * @since 1.2
645 */
646 ECORE_CON_REMOTE_CORK = 8,
609 /** Use SSL2: UNSUPPORTED. **/ 647 /** Use SSL2: UNSUPPORTED. **/
610 ECORE_CON_USE_SSL2 = (1 << 4), 648 ECORE_CON_USE_SSL2 = (1 << 4),
611 /** Use SSL3 */ 649 /** Use SSL3 */
@@ -675,6 +713,8 @@ EAPI Eina_Bool ecore_con_ssl_server_crl_add(Ecore_Con_Server *svr, const
675EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *svr, const char *ca_file); 713EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *svr, const char *ca_file);
676EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr); 714EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr);
677EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *svr); 715EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *svr);
716EAPI void ecore_con_ssl_server_verify_name_set(Ecore_Con_Server *svr, const char *name);
717EAPI const char *ecore_con_ssl_server_verify_name_get(Ecore_Con_Server *svr);
678EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type compl_type); 718EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type compl_type);
679EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_Con_Type compl_type); 719EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_Con_Type compl_type);
680 720
@@ -682,6 +722,18 @@ EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_
682 * @} 722 * @}
683 */ 723 */
684 724
725EAPI Ecore_Con_Socks *ecore_con_socks4_remote_add(const char *ip, int port, const char *username);
726EAPI void ecore_con_socks4_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable);
727EAPI Eina_Bool ecore_con_socks4_lookup_get(Ecore_Con_Socks *ecs);
728EAPI Eina_Bool ecore_con_socks4_remote_exists(const char *ip, int port, const char *username);
729EAPI void ecore_con_socks4_remote_del(const char *ip, int port, const char *username);
730EAPI void ecore_con_socks_bind_set(Ecore_Con_Socks *ecs, Eina_Bool is_bind);
731EAPI Eina_Bool ecore_con_socks_bind_get(Ecore_Con_Socks *ecs);
732EAPI unsigned int ecore_con_socks_version_get(Ecore_Con_Socks *ecs);
733EAPI void ecore_con_socks_remote_del(Ecore_Con_Socks *ecs);
734EAPI void ecore_con_socks_apply_once(Ecore_Con_Socks *ecs);
735EAPI void ecore_con_socks_apply_always(Ecore_Con_Socks *ecs);
736
685/** 737/**
686 * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions 738 * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions
687 * 739 *
@@ -1185,6 +1237,8 @@ EAPI Eina_Bool ecore_con_client_connected_get(Ecore_Con_Client *cl);
1185 */ 1237 */
1186EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); 1238EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl);
1187 1239
1240
1241
1188/** 1242/**
1189 * @} 1243 * @}
1190 */ 1244 */
@@ -1583,7 +1637,7 @@ EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con,
1583 * modification time. 1637 * modification time.
1584 * 1638 *
1585 * @param url_con Ecore_Con_Url to act upon. 1639 * @param url_con Ecore_Con_Url to act upon.
1586 * @param condition Condition to use for HTTP requests. 1640 * @param time_condition Condition to use for HTTP requests.
1587 * @param timestamp Time since 1 Jan 1970 to use in the condition. 1641 * @param timestamp Time since 1 Jan 1970 to use in the condition.
1588 * 1642 *
1589 * This function may set the header "If-Modified-Since" or 1643 * This function may set the header "If-Modified-Since" or
@@ -1791,6 +1845,74 @@ EAPI int ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con,
1791 const char *ca_path); 1845 const char *ca_path);
1792 1846
1793/** 1847/**
1848 * Set HTTP proxy to use.
1849 *
1850 * The parameter should be a char * to a zero terminated string holding
1851 * the host name or dotted IP address. To specify port number in this string,
1852 * append :[port] to the end of the host name.
1853 * The proxy string may be prefixed with [protocol]:// since any such prefix
1854 * will be ignored.
1855 * The proxy's port number may optionally be specified with the separate option.
1856 * If not specified, libcurl will default to using port 1080 for proxies.
1857 *
1858 * @param url_con Connection object that will use the proxy.
1859 * @param proxy Porxy string or @c NULL to disable
1860 *
1861 * @return #EINA_TRUE on success, #EINA_FALSE on error.
1862 * @since 1.2
1863 */
1864EAPI Eina_Bool ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char *proxy);
1865
1866/**
1867 * Set zero terminated username to use for proxy.
1868 *
1869 * if socks protocol is used for proxy, protocol should be socks5 and above.
1870 *
1871 * @param url_con Connection object that will use the proxy.
1872 * @param username Username string.
1873 *
1874 * @return #EINA_TRUE on success, #EINA_FALSE on error.
1875 *
1876 * @see ecore_con_url_proxy_set()
1877 *
1878 * @since 1.2
1879 */
1880EAPI Eina_Bool ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, const char *username);
1881
1882/**
1883 * Set zero terminated password to use for proxy.
1884 *
1885 * if socks protocol is used for proxy, protocol should be socks5 and above.
1886 *
1887 * @param url_con Connection object that will use the proxy.
1888 * @param password Password string.
1889 *
1890 * @return #EINA_TRUE on success, #EINA_FALSE on error.
1891 *
1892 * @see ecore_con_url_proxy_set()
1893 *
1894 * @since 1.2
1895 */
1896EAPI Eina_Bool ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password);
1897
1898/**
1899 * Set timeout in seconds.
1900 *
1901 * the maximum time in seconds that you allow the ecore con url transfer
1902 * operation to take. Normally, name lookups can take a considerable time
1903 * and limiting operations to less than a few minutes risk aborting perfectly
1904 * normal operations.
1905 *
1906 * @param url_con Connection object that will use the timeout.
1907 * @param timeout time in seconds.
1908 *
1909 * @see ecore_con_url_cookies_jar_file_set()
1910 *
1911 * @since 1.2
1912 */
1913EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout);
1914
1915/**
1794 * @} 1916 * @}
1795 */ 1917 */
1796 1918
diff --git a/libraries/ecore/src/lib/ecore_con/Makefile.am b/libraries/ecore/src/lib/ecore_con/Makefile.am
index 300586d..929b30e 100644
--- a/libraries/ecore/src/lib/ecore_con/Makefile.am
+++ b/libraries/ecore/src/lib/ecore_con/Makefile.am
@@ -19,6 +19,7 @@ includesdir = $(includedir)/ecore-@VMAJ@
19 19
20libecore_con_la_SOURCES = \ 20libecore_con_la_SOURCES = \
21ecore_con.c \ 21ecore_con.c \
22ecore_con_socks.c \
22ecore_con_ssl.c \ 23ecore_con_ssl.c \
23ecore_con_url.c \ 24ecore_con_url.c \
24ecore_con_alloc.c 25ecore_con_alloc.c
diff --git a/libraries/ecore/src/lib/ecore_con/Makefile.in b/libraries/ecore/src/lib/ecore_con/Makefile.in
index 5940a83..58811da 100644
--- a/libraries/ecore/src/lib/ecore_con/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_con/Makefile.in
@@ -92,15 +92,17 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
92LTLIBRARIES = $(lib_LTLIBRARIES) 92LTLIBRARIES = $(lib_LTLIBRARIES)
93libecore_con_la_DEPENDENCIES = \ 93libecore_con_la_DEPENDENCIES = \
94 $(top_builddir)/src/lib/ecore/libecore.la 94 $(top_builddir)/src/lib/ecore/libecore.la
95am__libecore_con_la_SOURCES_DIST = ecore_con.c ecore_con_ssl.c \ 95am__libecore_con_la_SOURCES_DIST = ecore_con.c ecore_con_socks.c \
96 ecore_con_url.c ecore_con_alloc.c ecore_con_local_win32.c \ 96 ecore_con_ssl.c ecore_con_url.c ecore_con_alloc.c \
97 ecore_con_local.c ecore_con_ares.c ecore_con_info.c 97 ecore_con_local_win32.c ecore_con_local.c ecore_con_ares.c \
98 ecore_con_info.c
98@ECORE_HAVE_WIN32_TRUE@am__objects_1 = libecore_con_la-ecore_con_local_win32.lo 99@ECORE_HAVE_WIN32_TRUE@am__objects_1 = libecore_con_la-ecore_con_local_win32.lo
99@ECORE_HAVE_WIN32_FALSE@am__objects_2 = \ 100@ECORE_HAVE_WIN32_FALSE@am__objects_2 = \
100@ECORE_HAVE_WIN32_FALSE@ libecore_con_la-ecore_con_local.lo 101@ECORE_HAVE_WIN32_FALSE@ libecore_con_la-ecore_con_local.lo
101@HAVE_CARES_TRUE@am__objects_3 = libecore_con_la-ecore_con_ares.lo 102@HAVE_CARES_TRUE@am__objects_3 = libecore_con_la-ecore_con_ares.lo
102@HAVE_CARES_FALSE@am__objects_4 = libecore_con_la-ecore_con_info.lo 103@HAVE_CARES_FALSE@am__objects_4 = libecore_con_la-ecore_con_info.lo
103am_libecore_con_la_OBJECTS = libecore_con_la-ecore_con.lo \ 104am_libecore_con_la_OBJECTS = libecore_con_la-ecore_con.lo \
105 libecore_con_la-ecore_con_socks.lo \
104 libecore_con_la-ecore_con_ssl.lo \ 106 libecore_con_la-ecore_con_ssl.lo \
105 libecore_con_la-ecore_con_url.lo \ 107 libecore_con_la-ecore_con_url.lo \
106 libecore_con_la-ecore_con_alloc.lo $(am__objects_1) \ 108 libecore_con_la-ecore_con_alloc.lo $(am__objects_1) \
@@ -263,10 +265,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
263PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 265PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
264PIXMAN_LIBS = @PIXMAN_LIBS@ 266PIXMAN_LIBS = @PIXMAN_LIBS@
265PKG_CONFIG = @PKG_CONFIG@ 267PKG_CONFIG = @PKG_CONFIG@
266PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
267PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
268POSUB = @POSUB@ 268POSUB = @POSUB@
269RANLIB = @RANLIB@ 269RANLIB = @RANLIB@
270SCIM_CFLAGS = @SCIM_CFLAGS@
271SCIM_LIBS = @SCIM_LIBS@
270SDL_CFLAGS = @SDL_CFLAGS@ 272SDL_CFLAGS = @SDL_CFLAGS@
271SDL_CONFIG = @SDL_CONFIG@ 273SDL_CONFIG = @SDL_CONFIG@
272SDL_LIBS = @SDL_LIBS@ 274SDL_LIBS = @SDL_LIBS@
@@ -285,6 +287,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
285USE_NLS = @USE_NLS@ 287USE_NLS = @USE_NLS@
286VERSION = @VERSION@ 288VERSION = @VERSION@
287VMAJ = @VMAJ@ 289VMAJ = @VMAJ@
290WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
291WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
292WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
293WAYLAND_LIBS = @WAYLAND_LIBS@
288WIN32_CFLAGS = @WIN32_CFLAGS@ 294WIN32_CFLAGS = @WIN32_CFLAGS@
289WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 295WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
290WIN32_LIBS = @WIN32_LIBS@ 296WIN32_LIBS = @WIN32_LIBS@
@@ -398,6 +404,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
398ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 404ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
399ecore_imf_evas_libs = @ecore_imf_evas_libs@ 405ecore_imf_evas_libs = @ecore_imf_evas_libs@
400ecore_imf_libs = @ecore_imf_libs@ 406ecore_imf_libs = @ecore_imf_libs@
407ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
408ecore_imf_scim_libs = @ecore_imf_scim_libs@
401ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 409ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
402ecore_imf_xim_libs = @ecore_imf_xim_libs@ 410ecore_imf_xim_libs = @ecore_imf_xim_libs@
403ecore_input_cflags = @ecore_input_cflags@ 411ecore_input_cflags = @ecore_input_cflags@
@@ -410,6 +418,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
410ecore_psl1ght_libs = @ecore_psl1ght_libs@ 418ecore_psl1ght_libs = @ecore_psl1ght_libs@
411ecore_sdl_cflags = @ecore_sdl_cflags@ 419ecore_sdl_cflags = @ecore_sdl_cflags@
412ecore_sdl_libs = @ecore_sdl_libs@ 420ecore_sdl_libs = @ecore_sdl_libs@
421ecore_wayland_cflags = @ecore_wayland_cflags@
422ecore_wayland_libs = @ecore_wayland_libs@
413ecore_win32_cflags = @ecore_win32_cflags@ 423ecore_win32_cflags = @ecore_win32_cflags@
414ecore_win32_libs = @ecore_win32_libs@ 424ecore_win32_libs = @ecore_win32_libs@
415ecore_wince_cflags = @ecore_wince_cflags@ 425ecore_wince_cflags = @ecore_wince_cflags@
@@ -454,12 +464,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
454requirements_ecore_file = @requirements_ecore_file@ 464requirements_ecore_file = @requirements_ecore_file@
455requirements_ecore_imf = @requirements_ecore_imf@ 465requirements_ecore_imf = @requirements_ecore_imf@
456requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 466requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
467requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
457requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 468requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
458requirements_ecore_input = @requirements_ecore_input@ 469requirements_ecore_input = @requirements_ecore_input@
459requirements_ecore_input_evas = @requirements_ecore_input_evas@ 470requirements_ecore_input_evas = @requirements_ecore_input_evas@
460requirements_ecore_ipc = @requirements_ecore_ipc@ 471requirements_ecore_ipc = @requirements_ecore_ipc@
461requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 472requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
462requirements_ecore_sdl = @requirements_ecore_sdl@ 473requirements_ecore_sdl = @requirements_ecore_sdl@
474requirements_ecore_wayland = @requirements_ecore_wayland@
463requirements_ecore_win32 = @requirements_ecore_win32@ 475requirements_ecore_win32 = @requirements_ecore_win32@
464requirements_ecore_wince = @requirements_ecore_wince@ 476requirements_ecore_wince = @requirements_ecore_wince@
465requirements_ecore_x = @requirements_ecore_x@ 477requirements_ecore_x = @requirements_ecore_x@
@@ -493,9 +505,10 @@ AM_CPPFLAGS = \
493lib_LTLIBRARIES = libecore_con.la 505lib_LTLIBRARIES = libecore_con.la
494includes_HEADERS = Ecore_Con.h 506includes_HEADERS = Ecore_Con.h
495includesdir = $(includedir)/ecore-@VMAJ@ 507includesdir = $(includedir)/ecore-@VMAJ@
496libecore_con_la_SOURCES = ecore_con.c ecore_con_ssl.c ecore_con_url.c \ 508libecore_con_la_SOURCES = ecore_con.c ecore_con_socks.c \
497 ecore_con_alloc.c $(am__append_1) $(am__append_2) \ 509 ecore_con_ssl.c ecore_con_url.c ecore_con_alloc.c \
498 $(am__append_3) $(am__append_4) 510 $(am__append_1) $(am__append_2) $(am__append_3) \
511 $(am__append_4)
499libecore_con_la_CFLAGS = @WIN32_CFLAGS@ 512libecore_con_la_CFLAGS = @WIN32_CFLAGS@
500libecore_con_la_LIBADD = \ 513libecore_con_la_LIBADD = \
501$(top_builddir)/src/lib/ecore/libecore.la \ 514$(top_builddir)/src/lib/ecore/libecore.la \
@@ -583,6 +596,7 @@ distclean-compile:
583@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_info.Plo@am__quote@ 596@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_info.Plo@am__quote@
584@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_local.Plo@am__quote@ 597@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_local.Plo@am__quote@
585@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_local_win32.Plo@am__quote@ 598@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_local_win32.Plo@am__quote@
599@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_socks.Plo@am__quote@
586@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_ssl.Plo@am__quote@ 600@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_ssl.Plo@am__quote@
587@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_url.Plo@am__quote@ 601@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecore_con_la-ecore_con_url.Plo@am__quote@
588 602
@@ -618,6 +632,14 @@ libecore_con_la-ecore_con.lo: ecore_con.c
618@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 632@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
619@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -c -o libecore_con_la-ecore_con.lo `test -f 'ecore_con.c' || echo '$(srcdir)/'`ecore_con.c 633@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -c -o libecore_con_la-ecore_con.lo `test -f 'ecore_con.c' || echo '$(srcdir)/'`ecore_con.c
620 634
635libecore_con_la-ecore_con_socks.lo: ecore_con_socks.c
636@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -MT libecore_con_la-ecore_con_socks.lo -MD -MP -MF $(DEPDIR)/libecore_con_la-ecore_con_socks.Tpo -c -o libecore_con_la-ecore_con_socks.lo `test -f 'ecore_con_socks.c' || echo '$(srcdir)/'`ecore_con_socks.c
637@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libecore_con_la-ecore_con_socks.Tpo $(DEPDIR)/libecore_con_la-ecore_con_socks.Plo
638@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
639@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ecore_con_socks.c' object='libecore_con_la-ecore_con_socks.lo' libtool=yes @AMDEPBACKSLASH@
640@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
641@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -c -o libecore_con_la-ecore_con_socks.lo `test -f 'ecore_con_socks.c' || echo '$(srcdir)/'`ecore_con_socks.c
642
621libecore_con_la-ecore_con_ssl.lo: ecore_con_ssl.c 643libecore_con_la-ecore_con_ssl.lo: ecore_con_ssl.c
622@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -MT libecore_con_la-ecore_con_ssl.lo -MD -MP -MF $(DEPDIR)/libecore_con_la-ecore_con_ssl.Tpo -c -o libecore_con_la-ecore_con_ssl.lo `test -f 'ecore_con_ssl.c' || echo '$(srcdir)/'`ecore_con_ssl.c 644@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecore_con_la_CFLAGS) $(CFLAGS) -MT libecore_con_la-ecore_con_ssl.lo -MD -MP -MF $(DEPDIR)/libecore_con_la-ecore_con_ssl.Tpo -c -o libecore_con_la-ecore_con_ssl.lo `test -f 'ecore_con_ssl.c' || echo '$(srcdir)/'`ecore_con_ssl.c
623@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libecore_con_la-ecore_con_ssl.Tpo $(DEPDIR)/libecore_con_la-ecore_con_ssl.Plo 645@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libecore_con_la-ecore_con_ssl.Tpo $(DEPDIR)/libecore_con_la-ecore_con_ssl.Plo
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con.c b/libraries/ecore/src/lib/ecore_con/ecore_con.c
index 7bd0358..de291b3 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con.c
@@ -45,7 +45,6 @@
45 45
46static Eina_Bool _ecore_con_client_timer(Ecore_Con_Client *cl); 46static Eina_Bool _ecore_con_client_timer(Ecore_Con_Client *cl);
47static void _ecore_con_cl_timer_update(Ecore_Con_Client *cl); 47static void _ecore_con_cl_timer_update(Ecore_Con_Client *cl);
48
49static Eina_Bool _ecore_con_server_timer(Ecore_Con_Server *svr); 48static Eina_Bool _ecore_con_server_timer(Ecore_Con_Server *svr);
50static void _ecore_con_server_timer_update(Ecore_Con_Server *svr); 49static void _ecore_con_server_timer_update(Ecore_Con_Server *svr);
51 50
@@ -104,6 +103,45 @@ static void _ecore_con_lookup_done(void *data,
104 103
105static const char * _ecore_con_pretty_ip(struct sockaddr *client_addr); 104static const char * _ecore_con_pretty_ip(struct sockaddr *client_addr);
106 105
106
107void
108_ecore_con_client_kill(Ecore_Con_Client *cl)
109{
110 if (cl->delete_me)
111 DBG("Multi kill request for client %p", cl);
112 else
113 ecore_con_event_client_del(cl);
114 INF("Lost client %s", (cl->ip) ? cl->ip : "");
115 if (cl->fd_handler)
116 ecore_main_fd_handler_del(cl->fd_handler);
117
118 cl->fd_handler = NULL;
119}
120
121void
122_ecore_con_server_kill(Ecore_Con_Server *svr)
123{
124 if (svr->delete_me)
125 DBG("Multi kill request for svr %p", svr);
126 else
127 ecore_con_event_server_del(svr);
128
129 if (svr->fd_handler)
130 ecore_main_fd_handler_del(svr->fd_handler);
131
132 svr->fd_handler = NULL;
133}
134
135#define _ecore_con_server_kill(svr) do { \
136 DBG("KILL %p", (svr)); \
137 _ecore_con_server_kill((svr)); \
138} while (0)
139
140#define _ecore_con_client_kill(cl) do { \
141 DBG("KILL %p", (cl)); \
142 _ecore_con_client_kill((cl)); \
143} while (0)
144
107EAPI int ECORE_CON_EVENT_CLIENT_ADD = 0; 145EAPI int ECORE_CON_EVENT_CLIENT_ADD = 0;
108EAPI int ECORE_CON_EVENT_CLIENT_DEL = 0; 146EAPI int ECORE_CON_EVENT_CLIENT_DEL = 0;
109EAPI int ECORE_CON_EVENT_SERVER_ADD = 0; 147EAPI int ECORE_CON_EVENT_SERVER_ADD = 0;
@@ -114,11 +152,14 @@ EAPI int ECORE_CON_EVENT_CLIENT_WRITE = 0;
114EAPI int ECORE_CON_EVENT_SERVER_WRITE = 0; 152EAPI int ECORE_CON_EVENT_SERVER_WRITE = 0;
115EAPI int ECORE_CON_EVENT_CLIENT_ERROR = 0; 153EAPI int ECORE_CON_EVENT_CLIENT_ERROR = 0;
116EAPI int ECORE_CON_EVENT_SERVER_ERROR = 0; 154EAPI int ECORE_CON_EVENT_SERVER_ERROR = 0;
155EAPI int ECORE_CON_EVENT_PROXY_BIND = 0;
117 156
118static Eina_List *servers = NULL; 157static Eina_List *servers = NULL;
119static int _ecore_con_init_count = 0; 158static int _ecore_con_init_count = 0;
120static int _ecore_con_event_count = 0; 159static int _ecore_con_event_count = 0;
121int _ecore_con_log_dom = -1; 160int _ecore_con_log_dom = -1;
161Ecore_Con_Socks *_ecore_con_proxy_once = NULL;
162Ecore_Con_Socks *_ecore_con_proxy_global = NULL;
122 163
123EAPI int 164EAPI int
124ecore_con_init(void) 165ecore_con_init(void)
@@ -156,6 +197,7 @@ ecore_con_init(void)
156 ECORE_CON_EVENT_SERVER_WRITE = ecore_event_type_new(); 197 ECORE_CON_EVENT_SERVER_WRITE = ecore_event_type_new();
157 ECORE_CON_EVENT_CLIENT_ERROR = ecore_event_type_new(); 198 ECORE_CON_EVENT_CLIENT_ERROR = ecore_event_type_new();
158 ECORE_CON_EVENT_SERVER_ERROR = ecore_event_type_new(); 199 ECORE_CON_EVENT_SERVER_ERROR = ecore_event_type_new();
200 ECORE_CON_EVENT_PROXY_BIND = ecore_event_type_new();
159 201
160 202
161 eina_magic_string_set(ECORE_MAGIC_CON_SERVER, "Ecore_Con_Server"); 203 eina_magic_string_set(ECORE_MAGIC_CON_SERVER, "Ecore_Con_Server");
@@ -163,6 +205,7 @@ ecore_con_init(void)
163 eina_magic_string_set(ECORE_MAGIC_CON_URL, "Ecore_Con_Url"); 205 eina_magic_string_set(ECORE_MAGIC_CON_URL, "Ecore_Con_Url");
164 206
165 /* TODO Remember return value, if it fails, use gethostbyname() */ 207 /* TODO Remember return value, if it fails, use gethostbyname() */
208 ecore_con_socks_init();
166 ecore_con_ssl_init(); 209 ecore_con_ssl_init();
167 ecore_con_info_init(); 210 ecore_con_info_init();
168 211
@@ -182,13 +225,15 @@ ecore_con_shutdown(void)
182 { 225 {
183 Ecore_Con_Event_Server_Add *ev; 226 Ecore_Con_Event_Server_Add *ev;
184 227
185 svr->delete_me = svr->dead = EINA_TRUE; 228 svr->delete_me = EINA_TRUE;
229 INF("svr %p is dead", svr);
186 /* some pointer hacks here to prevent double frees if people are being stupid */ 230 /* some pointer hacks here to prevent double frees if people are being stupid */
187 EINA_LIST_FREE(svr->event_count, ev) 231 EINA_LIST_FREE(svr->event_count, ev)
188 ev->server = NULL; 232 ev->server = NULL;
189 _ecore_con_server_free(svr); 233 _ecore_con_server_free(svr);
190 } 234 }
191 235
236 ecore_con_socks_shutdown();
192 if (!_ecore_con_event_count) ecore_con_mempool_shutdown(); 237 if (!_ecore_con_event_count) ecore_con_mempool_shutdown();
193 238
194 ecore_con_info_shutdown(); 239 ecore_con_info_shutdown();
@@ -301,8 +346,7 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
301 svr->port = port; 346 svr->port = port;
302 svr->data = (void *)data; 347 svr->data = (void *)data;
303 svr->created = EINA_TRUE; 348 svr->created = EINA_TRUE;
304 if (compl_type & ECORE_CON_LOAD_CERT) 349 svr->use_cert = (compl_type & ECORE_CON_SSL & ECORE_CON_LOAD_CERT) == ECORE_CON_LOAD_CERT;
305 svr->use_cert = EINA_TRUE;
306 svr->reject_excess_clients = EINA_FALSE; 350 svr->reject_excess_clients = EINA_FALSE;
307 svr->client_limit = -1; 351 svr->client_limit = -1;
308 svr->clients = NULL; 352 svr->clients = NULL;
@@ -325,7 +369,8 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
325#endif 369#endif
326 370
327 if ((type == ECORE_CON_REMOTE_TCP) || 371 if ((type == ECORE_CON_REMOTE_TCP) ||
328 (type == ECORE_CON_REMOTE_NODELAY)) 372 (type == ECORE_CON_REMOTE_NODELAY) ||
373 (type == ECORE_CON_REMOTE_CORK))
329 { 374 {
330 /* TCP */ 375 /* TCP */
331 if (!ecore_con_info_tcp_listen(svr, _ecore_con_cb_tcp_listen, 376 if (!ecore_con_info_tcp_listen(svr, _ecore_con_cb_tcp_listen,
@@ -395,17 +440,36 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
395 svr->port = port; 440 svr->port = port;
396 svr->data = (void *)data; 441 svr->data = (void *)data;
397 svr->created = EINA_FALSE; 442 svr->created = EINA_FALSE;
398 svr->use_cert = (compl_type & ECORE_CON_LOAD_CERT); 443 svr->use_cert = (compl_type & ECORE_CON_SSL & ECORE_CON_LOAD_CERT) == ECORE_CON_LOAD_CERT;
399 svr->reject_excess_clients = EINA_FALSE; 444 svr->reject_excess_clients = EINA_FALSE;
400 svr->clients = NULL; 445 svr->clients = NULL;
401 svr->client_limit = -1; 446 svr->client_limit = -1;
402 if (ecore_con_ssl_server_prepare(svr, compl_type & ECORE_CON_SSL))
403 goto error;
404 447
405 type = compl_type & ECORE_CON_TYPE; 448 type = compl_type & ECORE_CON_TYPE;
406 449
450 if (type > ECORE_CON_LOCAL_ABSTRACT)
451 {
452 /* never use proxies on local connections */
453 if (_ecore_con_proxy_once)
454 svr->ecs = _ecore_con_proxy_once;
455 else if (_ecore_con_proxy_global)
456 svr->ecs = _ecore_con_proxy_global;
457 _ecore_con_proxy_once = NULL;
458 if (svr->ecs)
459 {
460 if ((!svr->ecs->lookup) &&
461 (!ecore_con_lookup(svr->name, (Ecore_Con_Dns_Cb)ecore_con_socks_dns_cb, svr)))
462 goto error;
463 if (svr->ecs->lookup)
464 svr->ecs_state = ECORE_CON_SOCKS_STATE_RESOLVED;
465 }
466 }
467 if (ecore_con_ssl_server_prepare(svr, compl_type & ECORE_CON_SSL))
468 goto error;
469
407 if (((type == ECORE_CON_REMOTE_TCP) || 470 if (((type == ECORE_CON_REMOTE_TCP) ||
408 (type == ECORE_CON_REMOTE_NODELAY) || 471 (type == ECORE_CON_REMOTE_NODELAY) ||
472 (type == ECORE_CON_REMOTE_CORK) ||
409 (type == ECORE_CON_REMOTE_UDP) || 473 (type == ECORE_CON_REMOTE_UDP) ||
410 (type == ECORE_CON_REMOTE_BROADCAST)) && 474 (type == ECORE_CON_REMOTE_BROADCAST)) &&
411 (port < 0)) 475 (port < 0))
@@ -424,7 +488,8 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
424#endif 488#endif
425 489
426 if ((type == ECORE_CON_REMOTE_TCP) || 490 if ((type == ECORE_CON_REMOTE_TCP) ||
427 (type == ECORE_CON_REMOTE_NODELAY)) 491 (type == ECORE_CON_REMOTE_NODELAY) ||
492 (type == ECORE_CON_REMOTE_CORK))
428 { 493 {
429 /* TCP */ 494 /* TCP */
430 if (!ecore_con_info_tcp_connect(svr, _ecore_con_cb_tcp_connect, 495 if (!ecore_con_info_tcp_connect(svr, _ecore_con_cb_tcp_connect,
@@ -492,8 +557,6 @@ ecore_con_server_timeout_get(Ecore_Con_Server *svr)
492EAPI void * 557EAPI void *
493ecore_con_server_del(Ecore_Con_Server *svr) 558ecore_con_server_del(Ecore_Con_Server *svr)
494{ 559{
495 void *data;
496
497 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) 560 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
498 { 561 {
499 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del"); 562 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del");
@@ -503,20 +566,8 @@ ecore_con_server_del(Ecore_Con_Server *svr)
503 if (svr->delete_me) 566 if (svr->delete_me)
504 return NULL; 567 return NULL;
505 568
506 data = svr->data; 569 _ecore_con_server_kill(svr);
507 svr->delete_me = EINA_TRUE; 570 return svr->data;
508 if (svr->event_count)
509 {
510 if (svr->fd_handler)
511 {
512 ecore_main_fd_handler_del(svr->fd_handler);
513 svr->fd_handler = NULL;
514 }
515 }
516 else
517 _ecore_con_server_free(svr);
518
519 return data;
520} 571}
521 572
522EAPI void * 573EAPI void *
@@ -524,9 +575,7 @@ ecore_con_server_data_get(Ecore_Con_Server *svr)
524{ 575{
525 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) 576 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
526 { 577 {
527 ECORE_MAGIC_FAIL(svr, 578 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_data_get");
528 ECORE_MAGIC_CON_SERVER,
529 "ecore_con_server_data_get");
530 return NULL; 579 return NULL;
531 } 580 }
532 581
@@ -541,9 +590,7 @@ ecore_con_server_data_set(Ecore_Con_Server *svr,
541 590
542 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) 591 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
543 { 592 {
544 ECORE_MAGIC_FAIL(svr, 593 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_data_get");
545 ECORE_MAGIC_CON_SERVER,
546 "ecore_con_server_data_get");
547 return NULL; 594 return NULL;
548 } 595 }
549 596
@@ -557,8 +604,7 @@ ecore_con_server_connected_get(Ecore_Con_Server *svr)
557{ 604{
558 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) 605 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
559 { 606 {
560 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, 607 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_connected_get");
561 "ecore_con_server_connected_get");
562 return EINA_FALSE; 608 return EINA_FALSE;
563 } 609 }
564 610
@@ -617,7 +663,7 @@ ecore_con_server_send(Ecore_Con_Server *svr,
617 return 0; 663 return 0;
618 } 664 }
619 665
620 EINA_SAFETY_ON_TRUE_RETURN_VAL(svr->dead, 0); 666 EINA_SAFETY_ON_TRUE_RETURN_VAL(svr->delete_me, 0);
621 667
622 EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0); 668 EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
623 669
@@ -630,6 +676,15 @@ ecore_con_server_send(Ecore_Con_Server *svr,
630 { 676 {
631 svr->buf = eina_binbuf_new(); 677 svr->buf = eina_binbuf_new();
632 EINA_SAFETY_ON_NULL_RETURN_VAL(svr->buf, 0); 678 EINA_SAFETY_ON_NULL_RETURN_VAL(svr->buf, 0);
679#ifdef TCP_CORK
680 if ((svr->fd >= 0) && ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
681 {
682 int state = 1;
683 if (setsockopt(svr->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
684 /* realistically this isn't anything serious so we can just log and continue */
685 ERR("corking failed! %s", strerror(errno));
686 }
687#endif
633 } 688 }
634 eina_binbuf_append_length(svr->buf, data, size); 689 eina_binbuf_append_length(svr->buf, data, size);
635 690
@@ -716,7 +771,7 @@ ecore_con_client_send(Ecore_Con_Client *cl,
716 return 0; 771 return 0;
717 } 772 }
718 773
719 EINA_SAFETY_ON_TRUE_RETURN_VAL(cl->dead, 0); 774 EINA_SAFETY_ON_TRUE_RETURN_VAL(cl->delete_me, 0);
720 775
721 EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0); 776 EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
722 777
@@ -732,6 +787,15 @@ ecore_con_client_send(Ecore_Con_Client *cl,
732 { 787 {
733 cl->buf = eina_binbuf_new(); 788 cl->buf = eina_binbuf_new();
734 EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0); 789 EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0);
790#ifdef TCP_CORK
791 if ((cl->fd >= 0) && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
792 {
793 int state = 1;
794 if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
795 /* realistically this isn't anything serious so we can just log and continue */
796 ERR("corking failed! %s", strerror(errno));
797 }
798#endif
735 } 799 }
736 eina_binbuf_append_length(cl->buf, data, size); 800 eina_binbuf_append_length(cl->buf, data, size);
737 801
@@ -761,7 +825,7 @@ ecore_con_client_connected_get(Ecore_Con_Client *cl)
761 return EINA_FALSE; 825 return EINA_FALSE;
762 } 826 }
763 827
764 return !cl->dead; 828 return !cl->delete_me;
765} 829}
766 830
767EAPI void 831EAPI void
@@ -795,36 +859,14 @@ ecore_con_client_timeout_get(Ecore_Con_Client *cl)
795EAPI void * 859EAPI void *
796ecore_con_client_del(Ecore_Con_Client *cl) 860ecore_con_client_del(Ecore_Con_Client *cl)
797{ 861{
798 void *data = NULL;
799
800 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) 862 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
801 { 863 {
802 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_del"); 864 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_del");
803 return NULL; 865 return NULL;
804 } 866 }
805 867
806 data = cl->data; 868 _ecore_con_client_kill(cl);
807 cl->delete_me = EINA_TRUE; 869 return cl->data;
808 if (cl->event_count)
809 {
810 if (cl->fd_handler)
811 {
812 ecore_main_fd_handler_del(cl->fd_handler);
813 cl->fd_handler = NULL;
814 }
815 }
816 else
817 {
818 if (cl->host_server)
819 {
820 cl->host_server->clients = eina_list_remove(cl->host_server->clients, cl);
821 --cl->host_server->client_count;
822 }
823
824 _ecore_con_client_free(cl);
825 }
826
827 return data;
828} 870}
829 871
830EAPI void 872EAPI void
@@ -833,9 +875,7 @@ ecore_con_client_data_set(Ecore_Con_Client *cl,
833{ 875{
834 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) 876 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
835 { 877 {
836 ECORE_MAGIC_FAIL(cl, 878 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_data_set");
837 ECORE_MAGIC_CON_CLIENT,
838 "ecore_con_client_data_set");
839 return; 879 return;
840 } 880 }
841 881
@@ -847,9 +887,7 @@ ecore_con_client_data_get(Ecore_Con_Client *cl)
847{ 887{
848 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) 888 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
849 { 889 {
850 ECORE_MAGIC_FAIL(cl, 890 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_data_get");
851 ECORE_MAGIC_CON_CLIENT,
852 "ecore_con_client_data_get");
853 return NULL; 891 return NULL;
854 } 892 }
855 893
@@ -939,6 +977,25 @@ ecore_con_client_fd_get(Ecore_Con_Client *cl)
939 */ 977 */
940 978
941void 979void
980ecore_con_event_proxy_bind(Ecore_Con_Server *svr)
981{
982 Ecore_Con_Event_Proxy_Bind *e;
983 int ev = ECORE_CON_EVENT_PROXY_BIND;
984
985 e = ecore_con_event_proxy_bind_alloc();
986 EINA_SAFETY_ON_NULL_RETURN(e);
987
988 svr->event_count = eina_list_append(svr->event_count, e);
989 _ecore_con_server_timer_update(svr);
990 e->server = svr;
991 e->ip = svr->proxyip;
992 e->port = svr->proxyport;
993 ecore_event_add(ev, e,
994 _ecore_con_event_server_add_free, NULL);
995 _ecore_con_event_count++;
996}
997
998void
942ecore_con_event_server_add(Ecore_Con_Server *svr) 999ecore_con_event_server_add(Ecore_Con_Server *svr)
943{ 1000{
944 /* we got our server! */ 1001 /* we got our server! */
@@ -948,6 +1005,8 @@ ecore_con_event_server_add(Ecore_Con_Server *svr)
948 e = ecore_con_event_server_add_alloc(); 1005 e = ecore_con_event_server_add_alloc();
949 EINA_SAFETY_ON_NULL_RETURN(e); 1006 EINA_SAFETY_ON_NULL_RETURN(e);
950 1007
1008 svr->connecting = EINA_FALSE;
1009 svr->start_time = ecore_time_get();
951 svr->event_count = eina_list_append(svr->event_count, e); 1010 svr->event_count = eina_list_append(svr->event_count, e);
952 _ecore_con_server_timer_update(svr); 1011 _ecore_con_server_timer_update(svr);
953 e->server = svr; 1012 e->server = svr;
@@ -962,12 +1021,20 @@ ecore_con_event_server_del(Ecore_Con_Server *svr)
962{ 1021{
963 Ecore_Con_Event_Server_Del *e; 1022 Ecore_Con_Event_Server_Del *e;
964 1023
1024 svr->delete_me = EINA_TRUE;
1025 INF("svr %p is dead", svr);
965 e = ecore_con_event_server_del_alloc(); 1026 e = ecore_con_event_server_del_alloc();
966 EINA_SAFETY_ON_NULL_RETURN(e); 1027 EINA_SAFETY_ON_NULL_RETURN(e);
967 1028
968 svr->event_count = eina_list_append(svr->event_count, e); 1029 svr->event_count = eina_list_append(svr->event_count, e);
969 _ecore_con_server_timer_update(svr); 1030 _ecore_con_server_timer_update(svr);
970 e->server = svr; 1031 e->server = svr;
1032 if (svr->ecs)
1033 {
1034 svr->ecs_state = svr->ecs->lookup ? ECORE_CON_SOCKS_STATE_RESOLVED : ECORE_CON_SOCKS_STATE_DONE;
1035 eina_stringshare_replace(&svr->proxyip, NULL);
1036 svr->proxyport = 0;
1037 }
971 ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e, 1038 ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e,
972 _ecore_con_event_server_del_free, NULL); 1039 _ecore_con_event_server_del_free, NULL);
973 _ecore_con_event_count++; 1040 _ecore_con_event_count++;
@@ -981,6 +1048,7 @@ ecore_con_event_server_write(Ecore_Con_Server *svr, int num)
981 e = ecore_con_event_server_write_alloc(); 1048 e = ecore_con_event_server_write_alloc();
982 EINA_SAFETY_ON_NULL_RETURN(e); 1049 EINA_SAFETY_ON_NULL_RETURN(e);
983 1050
1051 INF("Wrote %d bytes", num);
984 svr->event_count = eina_list_append(svr->event_count, e); 1052 svr->event_count = eina_list_append(svr->event_count, e);
985 e->server = svr; 1053 e->server = svr;
986 e->size = num; 1054 e->size = num;
@@ -1044,6 +1112,8 @@ ecore_con_event_client_del(Ecore_Con_Client *cl)
1044 Ecore_Con_Event_Client_Del *e; 1112 Ecore_Con_Event_Client_Del *e;
1045 1113
1046 if (!cl) return; 1114 if (!cl) return;
1115 cl->delete_me = EINA_TRUE;
1116 INF("cl %p is dead", cl);
1047 e = ecore_con_event_client_del_alloc(); 1117 e = ecore_con_event_client_del_alloc();
1048 EINA_SAFETY_ON_NULL_RETURN(e); 1118 EINA_SAFETY_ON_NULL_RETURN(e);
1049 cl->event_count = eina_list_append(cl->event_count, e); 1119 cl->event_count = eina_list_append(cl->event_count, e);
@@ -1112,7 +1182,7 @@ ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info)
1112} 1182}
1113 1183
1114void 1184void
1115ecore_con_event_server_error(Ecore_Con_Server *svr, const char *error) 1185_ecore_con_event_server_error(Ecore_Con_Server *svr, char *error, Eina_Bool duplicate)
1116{ 1186{
1117 Ecore_Con_Event_Server_Error *e; 1187 Ecore_Con_Event_Server_Error *e;
1118 1188
@@ -1120,7 +1190,7 @@ ecore_con_event_server_error(Ecore_Con_Server *svr, const char *error)
1120 EINA_SAFETY_ON_NULL_RETURN(e); 1190 EINA_SAFETY_ON_NULL_RETURN(e);
1121 1191
1122 e->server = svr; 1192 e->server = svr;
1123 e->error = strdup(error); 1193 e->error = duplicate ? strdup(error) : error;
1124 ERR("%s", error); 1194 ERR("%s", error);
1125 svr->event_count = eina_list_append(svr->event_count, e); 1195 svr->event_count = eina_list_append(svr->event_count, e);
1126 ecore_event_add(ECORE_CON_EVENT_SERVER_ERROR, e, (Ecore_End_Cb)_ecore_con_event_server_error_free, NULL); 1196 ecore_event_add(ECORE_CON_EVENT_SERVER_ERROR, e, (Ecore_End_Cb)_ecore_con_event_server_error_free, NULL);
@@ -1157,16 +1227,9 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
1157 ecore_con_info_data_clear(svr->infos->data); 1227 ecore_con_info_data_clear(svr->infos->data);
1158 svr->infos = eina_list_remove_list(svr->infos, svr->infos); 1228 svr->infos = eina_list_remove_list(svr->infos, svr->infos);
1159 } 1229 }
1160 if ((!svr->buf) && svr->delete_me && (!svr->dead) && (!svr->event_count))
1161 {
1162 /* this is a catch-all for cases when a server is not properly killed. */
1163 svr->dead = EINA_TRUE;
1164 ecore_con_event_server_del(svr);
1165 return;
1166 }
1167 1230
1168 t_start = ecore_time_get(); 1231 t_start = ecore_time_get();
1169 while (svr->buf && (!svr->dead)) 1232 while (svr->buf && (!svr->delete_me))
1170 { 1233 {
1171 _ecore_con_server_flush(svr); 1234 _ecore_con_server_flush(svr);
1172 t = ecore_time_get(); 1235 t = ecore_time_get();
@@ -1196,7 +1259,8 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
1196 /* some pointer hacks here to prevent double frees if people are being stupid */ 1259 /* some pointer hacks here to prevent double frees if people are being stupid */
1197 EINA_LIST_FREE(cl->event_count, ev) 1260 EINA_LIST_FREE(cl->event_count, ev)
1198 ev->server = NULL; 1261 ev->server = NULL;
1199 cl->delete_me = cl->dead = EINA_TRUE; 1262 cl->delete_me = EINA_TRUE;
1263 INF("cl %p is dead", cl);
1200 _ecore_con_client_free(cl); 1264 _ecore_con_client_free(cl);
1201 } 1265 }
1202 if ((svr->created) && (svr->path) && (svr->ppid == getpid())) 1266 if ((svr->created) && (svr->path) && (svr->ppid == getpid()))
@@ -1208,6 +1272,10 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
1208 free(svr->path); 1272 free(svr->path);
1209 1273
1210 eina_stringshare_del(svr->ip); 1274 eina_stringshare_del(svr->ip);
1275 eina_stringshare_del(svr->verify_name);
1276
1277 if (svr->ecs_buf) eina_binbuf_free(svr->ecs_buf);
1278 if (svr->ecs_recvbuf) eina_binbuf_free(svr->ecs_recvbuf);
1211 1279
1212 if (svr->fd_handler) 1280 if (svr->fd_handler)
1213 ecore_main_fd_handler_del(svr->fd_handler); 1281 ecore_main_fd_handler_del(svr->fd_handler);
@@ -1230,17 +1298,8 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
1230 1298
1231 if (cl->event_count) return; 1299 if (cl->event_count) return;
1232 1300
1233 if (cl->delete_me && (!cl->dead) && (!cl->event_count))
1234 {
1235 /* this is a catch-all for cases when a client is not properly killed. */
1236 cl->dead = EINA_TRUE;
1237 ecore_con_event_client_del(cl);
1238 return;
1239 }
1240
1241
1242 t_start = ecore_time_get(); 1301 t_start = ecore_time_get();
1243 while ((cl->buf) && (!cl->dead)) 1302 while ((cl->buf) && (!cl->delete_me))
1244 { 1303 {
1245 _ecore_con_client_flush(cl); 1304 _ecore_con_client_flush(cl);
1246 t = ecore_time_get(); 1305 t = ecore_time_get();
@@ -1284,19 +1343,6 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
1284 return; 1343 return;
1285} 1344}
1286 1345
1287static void
1288_ecore_con_server_kill(Ecore_Con_Server *svr)
1289{
1290 if (!svr->delete_me)
1291 ecore_con_event_server_del(svr);
1292
1293 svr->dead = EINA_TRUE;
1294 if (svr->fd_handler)
1295 ecore_main_fd_handler_del(svr->fd_handler);
1296
1297 svr->fd_handler = NULL;
1298}
1299
1300static Eina_Bool 1346static Eina_Bool
1301_ecore_con_server_timer(Ecore_Con_Server *svr) 1347_ecore_con_server_timer(Ecore_Con_Server *svr)
1302{ 1348{
@@ -1384,40 +1430,25 @@ _ecore_con_cb_tcp_listen(void *data,
1384{ 1430{
1385 Ecore_Con_Server *svr; 1431 Ecore_Con_Server *svr;
1386 struct linger lin; 1432 struct linger lin;
1433 const char *memerr = NULL;
1387 1434
1388 svr = data; 1435 svr = data;
1389 1436
1437 errno = 0;
1390 if (!net_info) /* error message has already been handled */ 1438 if (!net_info) /* error message has already been handled */
1391 goto error; 1439 goto error;
1392 1440
1393 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, 1441 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype,
1394 net_info->info.ai_protocol); 1442 net_info->info.ai_protocol);
1395 if (svr->fd < 0) 1443 if (svr->fd < 0) goto error;
1396 { 1444 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error;
1397 ecore_con_event_server_error(svr, strerror(errno)); 1445 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
1398 goto error;
1399 }
1400
1401 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
1402 {
1403 ecore_con_event_server_error(svr, strerror(errno));
1404 goto error;
1405 }
1406
1407 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
1408 {
1409 ecore_con_event_server_error(svr, strerror(errno));
1410 goto error;
1411 }
1412 1446
1413 lin.l_onoff = 1; 1447 lin.l_onoff = 1;
1414 lin.l_linger = 0; 1448 lin.l_linger = 0;
1415 if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin, 1449 if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin,
1416 sizeof(struct linger)) < 0) 1450 sizeof(struct linger)) < 0)
1417 { 1451 goto error;
1418 ecore_con_event_server_error(svr, strerror(errno));
1419 goto error;
1420 }
1421 1452
1422 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY) 1453 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
1423 { 1454 {
@@ -1428,34 +1459,27 @@ _ecore_con_cb_tcp_listen(void *data,
1428 sizeof(int)) < 0) 1459 sizeof(int)) < 0)
1429#endif 1460#endif
1430 { 1461 {
1431 ecore_con_event_server_error(svr, strerror(errno));
1432 goto error; 1462 goto error;
1433 } 1463 }
1434 } 1464 }
1435 1465
1436 if (bind(svr->fd, net_info->info.ai_addr, 1466 if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0)
1437 net_info->info.ai_addrlen) < 0) 1467 goto error;
1438 { 1468
1439 ecore_con_event_server_error(svr, strerror(errno)); 1469 if (listen(svr->fd, 4096) < 0) goto error;
1440 goto error;
1441 }
1442 if (listen(svr->fd, 4096) < 0)
1443 {
1444 ecore_con_event_server_error(svr, strerror(errno));
1445 goto error;
1446 }
1447 1470
1448 svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ, 1471 svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
1449 _ecore_con_svr_tcp_handler, svr, NULL, NULL); 1472 _ecore_con_svr_tcp_handler, svr, NULL, NULL);
1450 if (!svr->fd_handler) 1473 if (!svr->fd_handler)
1451 { 1474 {
1452 ecore_con_event_server_error(svr, "Memory allocation failure"); 1475 memerr = "Memory allocation failure";
1453 goto error; 1476 goto error;
1454 } 1477 }
1455 1478
1456 return; 1479 return;
1457 1480
1458error: 1481error:
1482 if (errno || memerr) ecore_con_event_server_error(svr, memerr ?: strerror(errno));
1459 ecore_con_ssl_server_shutdown(svr); 1483 ecore_con_ssl_server_shutdown(svr);
1460 _ecore_con_server_kill(svr); 1484 _ecore_con_server_kill(svr);
1461} 1485}
@@ -1471,21 +1495,19 @@ _ecore_con_cb_udp_listen(void *data,
1471 struct ipv6_mreq mreq6; 1495 struct ipv6_mreq mreq6;
1472#endif 1496#endif
1473 const int on = 1; 1497 const int on = 1;
1498 const char *memerr = NULL;
1474 1499
1475 svr = data; 1500 svr = data;
1476 type = svr->type; 1501 type = svr->type;
1477 type &= ECORE_CON_TYPE; 1502 type &= ECORE_CON_TYPE;
1478 1503
1504 errno = 0;
1479 if (!net_info) /* error message has already been handled */ 1505 if (!net_info) /* error message has already been handled */
1480 goto error; 1506 goto error;
1481 1507
1482 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, 1508 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype,
1483 net_info->info.ai_protocol); 1509 net_info->info.ai_protocol);
1484 if (svr->fd < 0) 1510 if (svr->fd < 0) goto error;
1485 {
1486 ecore_con_event_server_error(svr, strerror(errno));
1487 goto error;
1488 }
1489 1511
1490 if (type == ECORE_CON_REMOTE_MCAST) 1512 if (type == ECORE_CON_REMOTE_MCAST)
1491 { 1513 {
@@ -1493,69 +1515,41 @@ _ecore_con_cb_udp_listen(void *data,
1493 { 1515 {
1494 if (!inet_pton(net_info->info.ai_family, net_info->ip, 1516 if (!inet_pton(net_info->info.ai_family, net_info->ip,
1495 &mreq.imr_multiaddr)) 1517 &mreq.imr_multiaddr))
1496 { 1518 goto error;
1497 ecore_con_event_server_error(svr, strerror(errno));
1498 goto error;
1499 }
1500 1519
1501 mreq.imr_interface.s_addr = htonl(INADDR_ANY); 1520 mreq.imr_interface.s_addr = htonl(INADDR_ANY);
1502 if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, 1521 if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
1503 (const void *)&mreq, sizeof(mreq)) != 0) 1522 (const void *)&mreq, sizeof(mreq)) != 0)
1504 { 1523 goto error;
1505 ecore_con_event_server_error(svr, strerror(errno));
1506 goto error;
1507 }
1508 } 1524 }
1509#ifdef HAVE_IPV6 1525#ifdef HAVE_IPV6
1510 else if (net_info->info.ai_family == AF_INET6) 1526 else if (net_info->info.ai_family == AF_INET6)
1511 { 1527 {
1512 if (!inet_pton(net_info->info.ai_family, net_info->ip, 1528 if (!inet_pton(net_info->info.ai_family, net_info->ip,
1513 &mreq6.ipv6mr_multiaddr)) 1529 &mreq6.ipv6mr_multiaddr))
1514 { 1530 goto error;
1515 ecore_con_event_server_error(svr, strerror(errno));
1516 goto error;
1517 }
1518 mreq6.ipv6mr_interface = htonl(INADDR_ANY); 1531 mreq6.ipv6mr_interface = htonl(INADDR_ANY);
1519 if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, 1532 if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
1520 (const void *)&mreq6, sizeof(mreq6)) != 0) 1533 (const void *)&mreq6, sizeof(mreq6)) != 0)
1521 { 1534 goto error;
1522 ecore_con_event_server_error(svr, strerror(errno));
1523 goto error;
1524 }
1525 } 1535 }
1526#endif 1536#endif
1527 } 1537 }
1528 1538
1529 if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on)) != 0) 1539 if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on)) != 0)
1530 { 1540 goto error;
1531 ecore_con_event_server_error(svr, strerror(errno)); 1541 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error;
1532 goto error; 1542 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
1533 }
1534
1535 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
1536 {
1537 ecore_con_event_server_error(svr, strerror(errno));
1538 goto error;
1539 }
1540
1541 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
1542 {
1543 ecore_con_event_server_error(svr, strerror(errno));
1544 goto error;
1545 }
1546 1543
1547 if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) 1544 if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0)
1548 { 1545 goto error;
1549 ecore_con_event_server_error(svr, strerror(errno));
1550 goto error;
1551 }
1552 1546
1553 svr->fd_handler = 1547 svr->fd_handler =
1554 ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ, 1548 ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
1555 _ecore_con_svr_udp_handler, svr, NULL, NULL); 1549 _ecore_con_svr_udp_handler, svr, NULL, NULL);
1556 if (!svr->fd_handler) 1550 if (!svr->fd_handler)
1557 { 1551 {
1558 ecore_con_event_server_error(svr, "Memory allocation failure"); 1552 memerr = "Memory allocation failure";
1559 goto error; 1553 goto error;
1560 } 1554 }
1561 1555
@@ -1564,6 +1558,7 @@ _ecore_con_cb_udp_listen(void *data,
1564 return; 1558 return;
1565 1559
1566error: 1560error:
1561 if (errno || memerr) ecore_con_event_server_error(svr, memerr ?: strerror(errno));
1567 ecore_con_ssl_server_shutdown(svr); 1562 ecore_con_ssl_server_shutdown(svr);
1568 _ecore_con_server_kill(svr); 1563 _ecore_con_server_kill(svr);
1569} 1564}
@@ -1575,37 +1570,23 @@ _ecore_con_cb_tcp_connect(void *data,
1575 Ecore_Con_Server *svr; 1570 Ecore_Con_Server *svr;
1576 int res; 1571 int res;
1577 int curstate = 0; 1572 int curstate = 0;
1573 const char *memerr = NULL;
1578 1574
1579 svr = data; 1575 svr = data;
1580 1576
1577 errno = 0;
1581 if (!net_info) /* error message has already been handled */ 1578 if (!net_info) /* error message has already been handled */
1582 goto error; 1579 goto error;
1583 1580
1584 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, 1581 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype,
1585 net_info->info.ai_protocol); 1582 net_info->info.ai_protocol);
1586 if (svr->fd < 0) 1583 if (svr->fd < 0) goto error;
1587 {
1588 ecore_con_event_server_error(svr, strerror(errno));
1589 goto error;
1590 }
1591 1584
1592 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) 1585 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error;
1593 { 1586 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
1594 ecore_con_event_server_error(svr, strerror(errno));
1595 goto error;
1596 }
1597
1598 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
1599 {
1600 ecore_con_event_server_error(svr, strerror(errno));
1601 goto error;
1602 }
1603 1587
1604 if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0) 1588 if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0)
1605 { 1589 goto error;
1606 ecore_con_event_server_error(svr, strerror(errno));
1607 goto error;
1608 }
1609 1590
1610 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY) 1591 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
1611 { 1592 {
@@ -1615,7 +1596,6 @@ _ecore_con_cb_tcp_connect(void *data,
1615 if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0) 1596 if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0)
1616#endif 1597#endif
1617 { 1598 {
1618 ecore_con_event_server_error(svr, strerror(errno));
1619 goto error; 1599 goto error;
1620 } 1600 }
1621 } 1601 }
@@ -1625,17 +1605,19 @@ _ecore_con_cb_tcp_connect(void *data,
1625 if (res == SOCKET_ERROR) 1605 if (res == SOCKET_ERROR)
1626 { 1606 {
1627 if (WSAGetLastError() != WSAEINPROGRESS) 1607 if (WSAGetLastError() != WSAEINPROGRESS)
1628 goto error; /* FIXME: strerror on windows? */ 1608 {
1609 char *err;
1610 err = evil_format_message(WSAGetLastError());
1611 _ecore_con_event_server_error(svr, err, EINA_FALSE);
1612 ecore_con_ssl_server_shutdown(svr);
1613 _ecore_con_server_kill(svr);
1614 return;
1615 }
1629 1616
1630#else 1617#else
1631 if (res < 0) 1618 if (res < 0)
1632 { 1619 {
1633 if (errno != EINPROGRESS) 1620 if (errno != EINPROGRESS) goto error;
1634 {
1635 ecore_con_event_server_error(svr, strerror(errno));
1636 goto error;
1637 }
1638
1639#endif 1621#endif
1640 svr->connecting = EINA_TRUE; 1622 svr->connecting = EINA_TRUE;
1641 svr->fd_handler = 1623 svr->fd_handler =
@@ -1650,22 +1632,24 @@ _ecore_con_cb_tcp_connect(void *data,
1650 { 1632 {
1651 svr->handshaking = EINA_TRUE; 1633 svr->handshaking = EINA_TRUE;
1652 svr->ssl_state = ECORE_CON_SSL_STATE_INIT; 1634 svr->ssl_state = ECORE_CON_SSL_STATE_INIT;
1653 DBG("beginning ssl handshake"); 1635 DBG("%s ssl handshake", svr->ecs_state ? "Queuing" : "Beginning");
1654 if (ecore_con_ssl_server_init(svr)) 1636 if ((!svr->ecs_state) && ecore_con_ssl_server_init(svr))
1655 goto error; 1637 goto error;
1656 } 1638 }
1657 1639
1658 if (!svr->fd_handler) 1640 if (!svr->fd_handler)
1659 { 1641 {
1660 ecore_con_event_server_error(svr, "Memory allocation failure"); 1642 memerr = "Memory allocation failure";
1661 goto error; 1643 goto error;
1662 } 1644 }
1663 1645
1664 svr->ip = eina_stringshare_add(net_info->ip); 1646 if ((!svr->ecs) || (svr->ecs->lookup))
1647 svr->ip = eina_stringshare_add(net_info->ip);
1665 1648
1666 return; 1649 return;
1667 1650
1668error: 1651error:
1652 if (errno || memerr) ecore_con_event_server_error(svr, memerr ?: strerror(errno));
1669 ecore_con_ssl_server_shutdown(svr); 1653 ecore_con_ssl_server_shutdown(svr);
1670 _ecore_con_server_kill(svr); 1654 _ecore_con_server_kill(svr);
1671} 1655}
@@ -1677,68 +1661,50 @@ _ecore_con_cb_udp_connect(void *data,
1677 Ecore_Con_Server *svr; 1661 Ecore_Con_Server *svr;
1678 int curstate = 0; 1662 int curstate = 0;
1679 int broadcast = 1; 1663 int broadcast = 1;
1664 const char *memerr = NULL;
1680 svr = data; 1665 svr = data;
1681 1666
1667 errno = 0;
1682 if (!net_info) /* error message has already been handled */ 1668 if (!net_info) /* error message has already been handled */
1683 goto error; 1669 goto error;
1684 1670
1685 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, 1671 svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype,
1686 net_info->info.ai_protocol); 1672 net_info->info.ai_protocol);
1687 if (svr->fd < 0) 1673 if (svr->fd < 0) goto error;
1688 { 1674 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error;
1689 ecore_con_event_server_error(svr, strerror(errno)); 1675 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
1690 goto error;
1691 }
1692
1693 if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
1694 {
1695 ecore_con_event_server_error(svr, strerror(errno));
1696 goto error;
1697 }
1698
1699 if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
1700 {
1701 ecore_con_event_server_error(svr, strerror(errno));
1702 goto error;
1703 }
1704
1705 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_BROADCAST) 1676 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_BROADCAST)
1706 { 1677 {
1707 if (setsockopt(svr->fd, SOL_SOCKET, SO_BROADCAST, 1678 if (setsockopt(svr->fd, SOL_SOCKET, SO_BROADCAST,
1708 (const void *)&broadcast, 1679 (const void *)&broadcast,
1709 sizeof(broadcast)) < 0) 1680 sizeof(broadcast)) < 0)
1710 { 1681 {
1711 ecore_con_event_server_error(svr, strerror(errno));
1712 goto error; 1682 goto error;
1713 } 1683 }
1714 } 1684 }
1715 else if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, 1685 if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR,
1716 (const void *)&curstate, sizeof(curstate)) < 0) 1686 (const void *)&curstate, sizeof(curstate)) < 0)
1717 { 1687 goto error;
1718 ecore_con_event_server_error(svr, strerror(errno));
1719 goto error;
1720 }
1721 1688
1722 if (connect(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) 1689 if (connect(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0)
1723 { 1690 goto error;
1724 ecore_con_event_server_error(svr, strerror(errno));
1725 goto error;
1726 }
1727 1691
1728 svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ | ECORE_FD_WRITE, 1692 svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ | ECORE_FD_WRITE,
1729 _ecore_con_cl_udp_handler, svr, NULL, NULL); 1693 _ecore_con_cl_udp_handler, svr, NULL, NULL);
1730 1694
1731 if (!svr->fd_handler) 1695 if (!svr->fd_handler)
1732 { 1696 {
1733 ecore_con_event_server_error(svr, "Memory allocation failure"); 1697 memerr = "Memory allocation failure";
1734 goto error; 1698 goto error;
1735 } 1699 }
1736 1700
1737 svr->ip = eina_stringshare_add(net_info->ip); 1701 if ((!svr->ecs) || (svr->ecs->lookup))
1702 svr->ip = eina_stringshare_add(net_info->ip);
1738 1703
1739 return; 1704 return;
1740 1705
1741error: 1706error:
1707 if (errno || memerr) ecore_con_event_server_error(svr, memerr ?: strerror(errno));
1742 ecore_con_ssl_server_shutdown(svr); 1708 ecore_con_ssl_server_shutdown(svr);
1743 _ecore_con_server_kill(svr); 1709 _ecore_con_server_kill(svr);
1744} 1710}
@@ -1755,14 +1721,14 @@ svr_try_connect_plain(Ecore_Con_Server *svr)
1755 if (res == SOCKET_ERROR) 1721 if (res == SOCKET_ERROR)
1756 so_err = WSAGetLastError(); 1722 so_err = WSAGetLastError();
1757 1723
1758 if ((so_err == WSAEINPROGRESS) && !svr->dead) 1724 if ((so_err == WSAEINPROGRESS) && !svr->delete_me)
1759 return ECORE_CON_INPROGRESS; 1725 return ECORE_CON_INPROGRESS;
1760 1726
1761#else 1727#else
1762 if (res < 0) 1728 if (res < 0)
1763 so_err = errno; 1729 so_err = errno;
1764 1730
1765 if ((so_err == EINPROGRESS) && !svr->dead) 1731 if ((so_err == EINPROGRESS) && !svr->delete_me)
1766 return ECORE_CON_INPROGRESS; 1732 return ECORE_CON_INPROGRESS;
1767 1733
1768#endif 1734#endif
@@ -1778,15 +1744,19 @@ svr_try_connect_plain(Ecore_Con_Server *svr)
1778 1744
1779 if ((!svr->delete_me) && (!svr->handshaking) && svr->connecting) 1745 if ((!svr->delete_me) && (!svr->handshaking) && svr->connecting)
1780 { 1746 {
1781 svr->connecting = EINA_FALSE; 1747 if (svr->ecs)
1782 svr->start_time = ecore_time_get(); 1748 {
1783 ecore_con_event_server_add(svr); 1749 if (ecore_con_socks_svr_init(svr))
1750 return ECORE_CON_INPROGRESS;
1751 }
1752 else
1753 ecore_con_event_server_add(svr);
1784 } 1754 }
1785 1755
1786 if (svr->fd_handler && (!svr->buf)) 1756 if (svr->fd_handler && (!svr->buf))
1787 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ); 1757 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
1788 1758
1789 if (!svr->dead) 1759 if (!svr->delete_me)
1790 return ECORE_CON_CONNECTED; 1760 return ECORE_CON_CONNECTED;
1791 else 1761 else
1792 return ECORE_CON_DISCONNECTED; 1762 return ECORE_CON_DISCONNECTED;
@@ -1838,9 +1808,10 @@ _ecore_con_svr_tcp_handler(void *data,
1838 Ecore_Con_Client *cl = NULL; 1808 Ecore_Con_Client *cl = NULL;
1839 unsigned char client_addr[256]; 1809 unsigned char client_addr[256];
1840 unsigned int client_addr_len; 1810 unsigned int client_addr_len;
1811 const char *clerr = NULL;
1841 1812
1842 svr = data; 1813 svr = data;
1843 if (svr->dead) 1814 if (svr->delete_me)
1844 return ECORE_CALLBACK_RENEW; 1815 return ECORE_CALLBACK_RENEW;
1845 1816
1846 if (svr->delete_me) 1817 if (svr->delete_me)
@@ -1863,34 +1834,19 @@ _ecore_con_svr_tcp_handler(void *data,
1863 client_addr_len = sizeof(client_addr); 1834 client_addr_len = sizeof(client_addr);
1864 memset(&client_addr, 0, client_addr_len); 1835 memset(&client_addr, 0, client_addr_len);
1865 cl->fd = accept(svr->fd, (struct sockaddr *)&client_addr, (socklen_t *)&client_addr_len); 1836 cl->fd = accept(svr->fd, (struct sockaddr *)&client_addr, (socklen_t *)&client_addr_len);
1866 if (cl->fd < 0) 1837 if (cl->fd < 0) goto error;
1867 {
1868 ecore_con_event_server_error(svr, strerror(errno));
1869 goto free_cl;
1870 }
1871
1872 if ((svr->client_limit >= 0) && (svr->reject_excess_clients) && 1838 if ((svr->client_limit >= 0) && (svr->reject_excess_clients) &&
1873 (svr->client_count >= (unsigned int)svr->client_limit)) 1839 (svr->client_count >= (unsigned int)svr->client_limit))
1874 { 1840 {
1875 ecore_con_event_server_error(svr, "Maximum client limit reached"); 1841 clerr = "Maximum client limit reached";
1876 goto close_fd; 1842 goto error;
1877 } 1843 }
1878 1844
1879 if (fcntl(cl->fd, F_SETFL, O_NONBLOCK) < 0) 1845 if (fcntl(cl->fd, F_SETFL, O_NONBLOCK) < 0) goto error;
1880 { 1846 if (fcntl(cl->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
1881 ecore_con_event_server_error(svr, strerror(errno));
1882 goto close_fd;
1883 }
1884 if (fcntl(cl->fd, F_SETFD, FD_CLOEXEC) < 0)
1885 {
1886 ecore_con_event_server_error(svr, strerror(errno));
1887 goto close_fd;
1888 }
1889 cl->fd_handler = ecore_main_fd_handler_add(cl->fd, ECORE_FD_READ, 1847 cl->fd_handler = ecore_main_fd_handler_add(cl->fd, ECORE_FD_READ,
1890 _ecore_con_svr_cl_handler, cl, NULL, NULL); 1848 _ecore_con_svr_cl_handler, cl, NULL, NULL);
1891 if (!cl->fd_handler) 1849 if (!cl->fd_handler) goto error;
1892 goto close_fd;
1893
1894 ECORE_MAGIC_SET(cl, ECORE_MAGIC_CON_CLIENT); 1850 ECORE_MAGIC_SET(cl, ECORE_MAGIC_CON_CLIENT);
1895 1851
1896 if ((!svr->upgrade) && (svr->type & ECORE_CON_SSL)) 1852 if ((!svr->upgrade) && (svr->type & ECORE_CON_SSL))
@@ -1898,14 +1854,14 @@ _ecore_con_svr_tcp_handler(void *data,
1898 cl->handshaking = EINA_TRUE; 1854 cl->handshaking = EINA_TRUE;
1899 cl->ssl_state = ECORE_CON_SSL_STATE_INIT; 1855 cl->ssl_state = ECORE_CON_SSL_STATE_INIT;
1900 if (ecore_con_ssl_client_init(cl)) 1856 if (ecore_con_ssl_client_init(cl))
1901 goto del_handler; 1857 goto error;
1902 } 1858 }
1903 1859
1904 cl->client_addr = malloc(client_addr_len); 1860 cl->client_addr = malloc(client_addr_len);
1905 if (!cl->client_addr) 1861 if (!cl->client_addr)
1906 { 1862 {
1907 ecore_con_event_server_error(svr, "Memory allocation failure when attempting to add a new client"); 1863 clerr = "Memory allocation failure when attempting to add a new client";
1908 goto del_handler; 1864 goto error;
1909 } 1865 }
1910 cl->client_addr_len = client_addr_len; 1866 cl->client_addr_len = client_addr_len;
1911 memcpy(cl->client_addr, &client_addr, client_addr_len); 1867 memcpy(cl->client_addr, &client_addr, client_addr_len);
@@ -1918,29 +1874,28 @@ _ecore_con_svr_tcp_handler(void *data,
1918 1874
1919 return ECORE_CALLBACK_RENEW; 1875 return ECORE_CALLBACK_RENEW;
1920 1876
1921 del_handler: 1877error:
1922 ecore_main_fd_handler_del(cl->fd_handler); 1878 if (cl->fd_handler) ecore_main_fd_handler_del(cl->fd_handler);
1923 close_fd: 1879 if (cl->fd >= 0) close(cl->fd);
1924 close(cl->fd);
1925 free_cl:
1926 free(cl); 1880 free(cl);
1927 1881 if (clerr || errno) ecore_con_event_server_error(svr, clerr ?: strerror(errno));
1928 return ECORE_CALLBACK_RENEW; 1882 return ECORE_CALLBACK_RENEW;
1929} 1883}
1930 1884
1931static void 1885static void
1932_ecore_con_cl_read(Ecore_Con_Server *svr) 1886_ecore_con_cl_read(Ecore_Con_Server *svr)
1933{ 1887{
1934 DBG("svr=%p", svr);
1935 int num = 0; 1888 int num = 0;
1936 Eina_Bool lost_server = EINA_TRUE; 1889 Eina_Bool lost_server = EINA_TRUE;
1937 unsigned char buf[READBUFSIZ]; 1890 unsigned char buf[READBUFSIZ];
1938 1891
1892 DBG("svr=%p", svr);
1893
1939 /* only possible with non-ssl connections */ 1894 /* only possible with non-ssl connections */
1940 if (svr->connecting && (svr_try_connect_plain(svr) != ECORE_CON_CONNECTED)) 1895 if (svr->connecting && (svr_try_connect_plain(svr) != ECORE_CON_CONNECTED))
1941 return; 1896 return;
1942 1897
1943 if (svr->handshaking) 1898 if (svr->handshaking && (!svr->ecs_state))
1944 { 1899 {
1945 DBG("Continuing ssl handshake"); 1900 DBG("Continuing ssl handshake");
1946 if (!ecore_con_ssl_server_init(svr)) 1901 if (!ecore_con_ssl_server_init(svr))
@@ -1948,8 +1903,9 @@ _ecore_con_cl_read(Ecore_Con_Server *svr)
1948 _ecore_con_server_timer_update(svr); 1903 _ecore_con_server_timer_update(svr);
1949 } 1904 }
1950 1905
1951 if (!(svr->type & ECORE_CON_SSL)) 1906 if (svr->ecs_state || !(svr->type & ECORE_CON_SSL))
1952 { 1907 {
1908 errno = 0;
1953 num = read(svr->fd, buf, sizeof(buf)); 1909 num = read(svr->fd, buf, sizeof(buf));
1954 /* 0 is not a valid return value for a tcp socket */ 1910 /* 0 is not a valid return value for a tcp socket */
1955 if ((num > 0) || ((num < 0) && (errno == EAGAIN))) 1911 if ((num > 0) || ((num < 0) && (errno == EAGAIN)))
@@ -1966,7 +1922,12 @@ _ecore_con_cl_read(Ecore_Con_Server *svr)
1966 } 1922 }
1967 1923
1968 if ((!svr->delete_me) && (num > 0)) 1924 if ((!svr->delete_me) && (num > 0))
1969 ecore_con_event_server_data(svr, buf, num, EINA_TRUE); 1925 {
1926 if (svr->ecs_state)
1927 ecore_con_socks_read(svr, buf, num);
1928 else
1929 ecore_con_event_server_data(svr, buf, num, EINA_TRUE);
1930 }
1970 1931
1971 if (lost_server) 1932 if (lost_server)
1972 _ecore_con_server_kill(svr); 1933 _ecore_con_server_kill(svr);
@@ -1980,7 +1941,7 @@ _ecore_con_cl_handler(void *data,
1980 Eina_Bool want_read, want_write; 1941 Eina_Bool want_read, want_write;
1981 1942
1982 svr = data; 1943 svr = data;
1983 if (svr->dead) 1944 if (svr->delete_me)
1984 return ECORE_CALLBACK_RENEW; 1945 return ECORE_CALLBACK_RENEW;
1985 1946
1986 if (svr->delete_me) 1947 if (svr->delete_me)
@@ -1989,7 +1950,7 @@ _ecore_con_cl_handler(void *data,
1989 want_read = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ); 1950 want_read = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ);
1990 want_write = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE); 1951 want_write = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE);
1991 1952
1992 if (svr->handshaking && (want_read || want_write)) 1953 if ((!svr->ecs_state) && svr->handshaking && (want_read || want_write))
1993 { 1954 {
1994 DBG("Continuing ssl handshake: preparing to %s...", want_read ? "read" : "write"); 1955 DBG("Continuing ssl handshake: preparing to %s...", want_read ? "read" : "write");
1995#ifdef ISCOMFITOR 1956#ifdef ISCOMFITOR
@@ -2005,20 +1966,25 @@ _ecore_con_cl_handler(void *data,
2005 { 1966 {
2006 ERR("ssl handshaking failed!"); 1967 ERR("ssl handshaking failed!");
2007 svr->handshaking = EINA_FALSE; 1968 svr->handshaking = EINA_FALSE;
2008
2009 } 1969 }
2010 else if (!svr->ssl_state) 1970 else if (!svr->ssl_state)
1971 ecore_con_event_server_add(svr);
1972 return ECORE_CALLBACK_RENEW;
1973 }
1974 if (svr->ecs && svr->ecs_state && (svr->ecs_state < ECORE_CON_SOCKS_STATE_READ) && (!svr->ecs_buf))
1975 {
1976 if (svr->ecs_state < ECORE_CON_SOCKS_STATE_INIT)
2011 { 1977 {
2012 svr->connecting = EINA_FALSE; 1978 INF("PROXY STATE++");
2013 svr->start_time = ecore_time_get(); 1979 svr->ecs_state++;
2014 ecore_con_event_server_add(svr);
2015 } 1980 }
1981 if (ecore_con_socks_svr_init(svr)) return ECORE_CALLBACK_RENEW;
2016 } 1982 }
2017 else if (want_read) 1983 if (want_read)
2018 _ecore_con_cl_read(svr); 1984 _ecore_con_cl_read(svr);
2019 else if (want_write) /* only possible with non-ssl connections */ 1985 else if (want_write) /* only possible with non-ssl connections */
2020 { 1986 {
2021 if (svr->connecting && (!svr_try_connect_plain(svr))) 1987 if (svr->connecting && (!svr_try_connect_plain(svr)) && (!svr->ecs_state))
2022 return ECORE_CALLBACK_RENEW; 1988 return ECORE_CALLBACK_RENEW;
2023 1989
2024 _ecore_con_server_flush(svr); 1990 _ecore_con_server_flush(svr);
@@ -2040,7 +2006,7 @@ _ecore_con_cl_udp_handler(void *data,
2040 want_write = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE); 2006 want_write = ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE);
2041 2007
2042 svr = data; 2008 svr = data;
2043 if (svr->dead || svr->delete_me || ((!want_read) && (!want_write))) 2009 if (svr->delete_me || svr->delete_me || ((!want_read) && (!want_write)))
2044 return ECORE_CALLBACK_RENEW; 2010 return ECORE_CALLBACK_RENEW;
2045 2011
2046 if (want_write) 2012 if (want_write)
@@ -2076,7 +2042,7 @@ _ecore_con_svr_udp_handler(void *data,
2076 2042
2077 svr = data; 2043 svr = data;
2078 2044
2079 if (svr->delete_me || svr->dead) 2045 if (svr->delete_me)
2080 return ECORE_CALLBACK_RENEW; 2046 return ECORE_CALLBACK_RENEW;
2081 2047
2082 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE)) 2048 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE))
@@ -2106,9 +2072,7 @@ _ecore_con_svr_udp_handler(void *data,
2106 ecore_con_event_server_error(svr, strerror(errno)); 2072 ecore_con_event_server_error(svr, strerror(errno));
2107 if (!svr->delete_me) 2073 if (!svr->delete_me)
2108 ecore_con_event_client_del(NULL); 2074 ecore_con_event_client_del(NULL);
2109 2075 _ecore_con_server_kill(svr);
2110 svr->dead = EINA_TRUE;
2111 svr->fd_handler = NULL;
2112 return ECORE_CALLBACK_CANCEL; 2076 return ECORE_CALLBACK_CANCEL;
2113 } 2077 }
2114 2078
@@ -2177,18 +2141,7 @@ _ecore_con_svr_cl_read(Ecore_Con_Client *cl)
2177 if ((!cl->delete_me) && (num > 0)) 2141 if ((!cl->delete_me) && (num > 0))
2178 ecore_con_event_client_data(cl, buf, num, EINA_TRUE); 2142 ecore_con_event_client_data(cl, buf, num, EINA_TRUE);
2179 2143
2180 if (lost_client) 2144 if (lost_client) _ecore_con_client_kill(cl);
2181 {
2182 if (!cl->delete_me)
2183 ecore_con_event_client_del(cl);
2184 INF("Lost client %s", (cl->ip) ? cl->ip : "");
2185 cl->dead = EINA_TRUE;
2186 if (cl->fd_handler)
2187 ecore_main_fd_handler_del(cl->fd_handler);
2188
2189 cl->fd_handler = NULL;
2190 return;
2191 }
2192} 2145}
2193 2146
2194static Eina_Bool 2147static Eina_Bool
@@ -2198,9 +2151,6 @@ _ecore_con_svr_cl_handler(void *data,
2198 Ecore_Con_Client *cl; 2151 Ecore_Con_Client *cl;
2199 2152
2200 cl = data; 2153 cl = data;
2201 if (cl->dead)
2202 return ECORE_CALLBACK_RENEW;
2203
2204 if (cl->delete_me) 2154 if (cl->delete_me)
2205 return ECORE_CALLBACK_RENEW; 2155 return ECORE_CALLBACK_RENEW;
2206 2156
@@ -2209,10 +2159,8 @@ _ecore_con_svr_cl_handler(void *data,
2209 if (ecore_con_ssl_client_init(cl)) 2159 if (ecore_con_ssl_client_init(cl))
2210 { 2160 {
2211 ERR("ssl handshaking failed!"); 2161 ERR("ssl handshaking failed!");
2212 cl->handshaking = EINA_FALSE; 2162 _ecore_con_client_kill(cl);
2213 cl->dead = EINA_TRUE; 2163 return ECORE_CALLBACK_RENEW;
2214 INF("Lost client %s", (cl->ip) ? cl->ip : "");
2215 ecore_con_event_client_del(cl);
2216 } 2164 }
2217 else if (!cl->ssl_state) 2165 else if (!cl->ssl_state)
2218 ecore_con_event_client_add(cl); 2166 ecore_con_event_client_add(cl);
@@ -2230,19 +2178,25 @@ static void
2230_ecore_con_server_flush(Ecore_Con_Server *svr) 2178_ecore_con_server_flush(Ecore_Con_Server *svr)
2231{ 2179{
2232 int count, num; 2180 int count, num;
2181 size_t buf_len, buf_offset;
2182 const void *buf;
2233 2183
2184 DBG("(svr=%p,buf=%p)", svr, svr->buf);
2234#ifdef _WIN32 2185#ifdef _WIN32
2235 if (ecore_con_local_win32_server_flush(svr)) 2186 if (ecore_con_local_win32_server_flush(svr))
2236 return; 2187 return;
2237#endif 2188#endif
2238 2189
2239 if ((!svr->buf) && svr->fd_handler) 2190 if ((!svr->buf) && (!svr->ecs_buf) && svr->fd_handler)
2240 { 2191 {
2241 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ); 2192 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
2242 return; 2193 return;
2243 } 2194 }
2244 2195
2245 num = eina_binbuf_length_get(svr->buf) - svr->write_buf_offset; 2196 buf = svr->buf ? eina_binbuf_string_get(svr->buf) : eina_binbuf_string_get(svr->ecs_buf);
2197 buf_len = svr->buf ? eina_binbuf_length_get(svr->buf) : eina_binbuf_length_get(svr->ecs_buf);
2198 buf_offset = svr->buf ? svr->write_buf_offset : svr->ecs_buf_offset;
2199 num = buf_len - buf_offset;
2246 2200
2247 /* check whether we need to write anything at all. 2201 /* check whether we need to write anything at all.
2248 * we must not write zero bytes with SSL_write() since it 2202 * we must not write zero bytes with SSL_write() since it
@@ -2253,7 +2207,7 @@ _ecore_con_server_flush(Ecore_Con_Server *svr)
2253 */ 2207 */
2254 if (num <= 0) return; 2208 if (num <= 0) return;
2255 2209
2256 if (svr->handshaking) 2210 if ((!svr->ecs_state) && svr->handshaking)
2257 { 2211 {
2258 DBG("Continuing ssl handshake"); 2212 DBG("Continuing ssl handshake");
2259 if (ecore_con_ssl_server_init(svr)) 2213 if (ecore_con_ssl_server_init(svr))
@@ -2262,10 +2216,10 @@ _ecore_con_server_flush(Ecore_Con_Server *svr)
2262 return; 2216 return;
2263 } 2217 }
2264 2218
2265 if (!(svr->type & ECORE_CON_SSL)) 2219 if (svr->ecs_state || (!(svr->type & ECORE_CON_SSL)))
2266 count = write(svr->fd, eina_binbuf_string_get(svr->buf) + svr->write_buf_offset, num); 2220 count = write(svr->fd, buf + buf_offset, num);
2267 else 2221 else
2268 count = ecore_con_ssl_server_write(svr, eina_binbuf_string_get(svr->buf) + svr->write_buf_offset, num); 2222 count = ecore_con_ssl_server_write(svr, buf + buf_offset, num);
2269 2223
2270 if (count < 0) 2224 if (count < 0)
2271 { 2225 {
@@ -2277,13 +2231,36 @@ _ecore_con_server_flush(Ecore_Con_Server *svr)
2277 return; 2231 return;
2278 } 2232 }
2279 2233
2280 if (count) ecore_con_event_server_write(svr, count); 2234 if (count && (!svr->ecs_state)) ecore_con_event_server_write(svr, count);
2281 svr->write_buf_offset += count; 2235 if (svr->ecs_buf)
2282 if (svr->write_buf_offset >= eina_binbuf_length_get(svr->buf)) 2236 buf_offset = svr->ecs_buf_offset += count;
2237 else
2238 buf_offset = svr->write_buf_offset += count;
2239 if (buf_offset >= buf_len)
2283 { 2240 {
2284 svr->write_buf_offset = 0; 2241 if (svr->ecs_buf)
2285 eina_binbuf_free(svr->buf); 2242 {
2286 svr->buf = NULL; 2243 svr->ecs_buf_offset = 0;
2244 eina_binbuf_free(svr->ecs_buf);
2245 svr->ecs_buf = NULL;
2246 INF("PROXY STATE++");
2247 svr->ecs_state++;
2248 }
2249 else
2250 {
2251 svr->write_buf_offset = 0;
2252 eina_binbuf_free(svr->buf);
2253 svr->buf = NULL;
2254#ifdef TCP_CORK
2255 if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)
2256 {
2257 int state = 0;
2258 if (setsockopt(svr->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
2259 /* realistically this isn't anything serious so we can just log and continue */
2260 ERR("uncorking failed! %s", strerror(errno));
2261 }
2262#endif
2263 }
2287 if (svr->fd_handler) 2264 if (svr->fd_handler)
2288 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ); 2265 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ);
2289 } 2266 }
@@ -2330,13 +2307,7 @@ _ecore_con_client_flush(Ecore_Con_Client *cl)
2330 if ((errno != EAGAIN) && (errno != EINTR) && (!cl->delete_me)) 2307 if ((errno != EAGAIN) && (errno != EINTR) && (!cl->delete_me))
2331 { 2308 {
2332 ecore_con_event_client_error(cl, strerror(errno)); 2309 ecore_con_event_client_error(cl, strerror(errno));
2333 ecore_con_event_client_del(cl); 2310 _ecore_con_client_kill(cl);
2334 cl->dead = EINA_TRUE;
2335 INF("Lost client %s", (cl->ip) ? cl->ip : "");
2336 if (cl->fd_handler)
2337 ecore_main_fd_handler_del(cl->fd_handler);
2338
2339 cl->fd_handler = NULL;
2340 } 2311 }
2341 2312
2342 return; 2313 return;
@@ -2349,6 +2320,15 @@ _ecore_con_client_flush(Ecore_Con_Client *cl)
2349 cl->buf_offset = 0; 2320 cl->buf_offset = 0;
2350 eina_binbuf_free(cl->buf); 2321 eina_binbuf_free(cl->buf);
2351 cl->buf = NULL; 2322 cl->buf = NULL;
2323#ifdef TCP_CORK
2324 if ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)
2325 {
2326 int state = 0;
2327 if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
2328 /* realistically this isn't anything serious so we can just log and continue */
2329 ERR("uncorking failed! %s", strerror(errno));
2330 }
2331#endif
2352 if (cl->fd_handler) 2332 if (cl->fd_handler)
2353 ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ); 2333 ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ);
2354 } 2334 }
@@ -2398,7 +2378,7 @@ _ecore_con_event_client_del_free(Ecore_Con_Server *svr,
2398 if ((!svr->event_count) && (svr->delete_me)) 2378 if ((!svr->event_count) && (svr->delete_me))
2399 _ecore_con_server_free(svr); 2379 _ecore_con_server_free(svr);
2400 } 2380 }
2401 if ((!e->client->event_count) && (e->client->delete_me)) 2381 if (!e->client->event_count)
2402 ecore_con_client_del(e->client); 2382 ecore_con_client_del(e->client);
2403 } 2383 }
2404 ecore_con_event_client_del_free(e); 2384 ecore_con_event_client_del_free(e);
@@ -2490,7 +2470,7 @@ _ecore_con_event_server_del_free(void *data __UNUSED__,
2490 if (e->server) 2470 if (e->server)
2491 { 2471 {
2492 e->server->event_count = eina_list_remove(e->server->event_count, ev); 2472 e->server->event_count = eina_list_remove(e->server->event_count, ev);
2493 if ((!e->server->event_count) && (e->server->delete_me)) 2473 if (!e->server->event_count)
2494 _ecore_con_server_free(e->server); 2474 _ecore_con_server_free(e->server);
2495 } 2475 }
2496 ecore_con_event_server_del_free(e); 2476 ecore_con_event_server_del_free(e);
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_alloc.c b/libraries/ecore/src/lib/ecore_con/ecore_con_alloc.c
index 206948b..d922f20 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_alloc.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_alloc.c
@@ -40,6 +40,7 @@ GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Add, ecore_con_event_server_add);
40GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Del, ecore_con_event_server_del); 40GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Del, ecore_con_event_server_del);
41GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Write, ecore_con_event_server_write); 41GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Write, ecore_con_event_server_write);
42GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Data, ecore_con_event_server_data); 42GENERIC_ALLOC_FREE(Ecore_Con_Event_Server_Data, ecore_con_event_server_data);
43GENERIC_ALLOC_FREE(Ecore_Con_Event_Proxy_Bind, ecore_con_event_proxy_bind);
43 44
44static Ecore_Con_Mempool *mempool_array[] = { 45static Ecore_Con_Mempool *mempool_array[] = {
45 &ecore_con_event_client_add_mp, 46 &ecore_con_event_client_add_mp,
@@ -51,7 +52,8 @@ static Ecore_Con_Mempool *mempool_array[] = {
51 &ecore_con_event_server_add_mp, 52 &ecore_con_event_server_add_mp,
52 &ecore_con_event_server_del_mp, 53 &ecore_con_event_server_del_mp,
53 &ecore_con_event_server_write_mp, 54 &ecore_con_event_server_write_mp,
54 &ecore_con_event_server_data_mp 55 &ecore_con_event_server_data_mp,
56 &ecore_con_event_proxy_bind_mp
55}; 57};
56 58
57void 59void
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_ares.c b/libraries/ecore/src/lib/ecore_con/ecore_con_ares.c
index dd5a212..5dfe70b 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_ares.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_ares.c
@@ -309,7 +309,7 @@ ecore_con_info_get(Ecore_Con_Server *svr,
309 memcpy(&cares->hints, hints, sizeof(struct addrinfo)); 309 memcpy(&cares->hints, hints, sizeof(struct addrinfo));
310 } 310 }
311 311
312 if (inet_pton(AF_INET, svr->name, &cares->addr.v4) == 1) 312 if (inet_pton(AF_INET, svr->ecs ? svr->ecs->ip : svr->name, &cares->addr.v4) == 1)
313 { 313 {
314 cares->byaddr = EINA_TRUE; 314 cares->byaddr = EINA_TRUE;
315 cares->isv6 = EINA_FALSE; 315 cares->isv6 = EINA_FALSE;
@@ -320,7 +320,7 @@ ecore_con_info_get(Ecore_Con_Server *svr,
320 cares); 320 cares);
321 } 321 }
322#ifdef HAVE_IPV6 322#ifdef HAVE_IPV6
323 else if (inet_pton(AF_INET6, svr->name, &cares->addr.v6) == 1) 323 else if (inet_pton(AF_INET6, svr->ecs ? svr->ecs->ip : svr->name, &cares->addr.v6) == 1)
324 { 324 {
325 cares->byaddr = EINA_TRUE; 325 cares->byaddr = EINA_TRUE;
326 cares->isv6 = EINA_TRUE; 326 cares->isv6 = EINA_TRUE;
@@ -334,7 +334,7 @@ ecore_con_info_get(Ecore_Con_Server *svr,
334 else 334 else
335 { 335 {
336 cares->byaddr = EINA_FALSE; 336 cares->byaddr = EINA_FALSE;
337 ares_gethostbyname(info_channel, svr->name, ai_family, 337 ares_gethostbyname(info_channel, svr->ecs ? svr->ecs->ip : svr->name, ai_family,
338 (ares_host_callback)_ecore_con_info_ares_host_cb, 338 (ares_host_callback)_ecore_con_info_ares_host_cb,
339 cares); 339 cares);
340 } 340 }
@@ -457,7 +457,7 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg,
457 goto on_mem_error; 457 goto on_mem_error;
458 458
459 addri->sin_family = AF_INET; 459 addri->sin_family = AF_INET;
460 addri->sin_port = htons(arg->svr->port); 460 addri->sin_port = htons(arg->svr->ecs ? arg->svr->ecs->port : arg->svr->port);
461 461
462 memcpy(&addri->sin_addr.s_addr, 462 memcpy(&addri->sin_addr.s_addr,
463 hostent->h_addr_list[0], sizeof(struct in_addr)); 463 hostent->h_addr_list[0], sizeof(struct in_addr));
@@ -477,7 +477,7 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg,
477 goto on_mem_error; 477 goto on_mem_error;
478 478
479 addri6->sin6_family = AF_INET6; 479 addri6->sin6_family = AF_INET6;
480 addri6->sin6_port = htons(arg->svr->port); 480 addri6->sin6_port = htons(arg->svr->ecs ? arg->svr->ecs->port : arg->svr->port);
481 addri6->sin6_flowinfo = 0; 481 addri6->sin6_flowinfo = 0;
482 addri6->sin6_scope_id = 0; 482 addri6->sin6_scope_id = 0;
483 483
@@ -516,7 +516,7 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg,
516 goto on_mem_error; 516 goto on_mem_error;
517 517
518 addri6->sin6_family = AF_INET6; 518 addri6->sin6_family = AF_INET6;
519 addri6->sin6_port = htons(arg->svr->port); 519 addri6->sin6_port = htons(arg->svr->ecs ? arg->svr->ecs->port : arg->svr->port);
520 addri6->sin6_flowinfo = 0; 520 addri6->sin6_flowinfo = 0;
521 addri6->sin6_scope_id = 0; 521 addri6->sin6_scope_id = 0;
522 522
@@ -537,7 +537,7 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg,
537 goto on_mem_error; 537 goto on_mem_error;
538 538
539 addri->sin_family = AF_INET; 539 addri->sin_family = AF_INET;
540 addri->sin_port = htons(arg->svr->port); 540 addri->sin_port = htons(arg->svr->ecs ? arg->svr->ecs->port : arg->svr->port);
541 541
542 memcpy(&addri->sin_addr.s_addr, 542 memcpy(&addri->sin_addr.s_addr,
543 &arg->addr.v4, sizeof(struct in_addr)); 543 &arg->addr.v4, sizeof(struct in_addr));
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_info.c b/libraries/ecore/src/lib/ecore_con/ecore_con_info.c
index 4ece6b0..fdcf0b9 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_info.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_info.c
@@ -244,11 +244,10 @@ ecore_con_info_get(Ecore_Con_Server *svr,
244 unsigned char *tosend = NULL; 244 unsigned char *tosend = NULL;
245 int tosend_len; 245 int tosend_len;
246 int canonname_len = 0; 246 int canonname_len = 0;
247 int err;
248 247
249 eina_convert_itoa(svr->port, service); 248 eina_convert_itoa(svr->ecs ? svr->ecs->port : svr->port, service);
250 /* CHILD */ 249 /* CHILD */
251 if (!getaddrinfo(svr->name, service, hints, &result) && result) 250 if (!getaddrinfo(svr->ecs ? svr->ecs->ip : svr->name, service, hints, &result) && result)
252 { 251 {
253 if (result->ai_canonname) 252 if (result->ai_canonname)
254 canonname_len = strlen(result->ai_canonname) + 1; 253 canonname_len = strlen(result->ai_canonname) + 1;
@@ -281,13 +280,13 @@ ecore_con_info_get(Ecore_Con_Server *svr,
281 memcpy(container->service, sbuf, sizeof(container->service)); 280 memcpy(container->service, sbuf, sizeof(container->service));
282 } 281 }
283 282
284 err = write(fd[1], tosend, tosend_len); 283 if (write(fd[1], tosend, tosend_len) < 0) perror("write");
285 } 284 }
286 285
287 if (result) 286 if (result)
288 freeaddrinfo(result); 287 freeaddrinfo(result);
289 288
290 err = write(fd[1], "", 1); 289 if (write(fd[1], "", 1) < 0) perror("write");
291 close(fd[1]); 290 close(fd[1]);
292#if defined(__USE_ISOC99) && !defined(__UCLIBC__) 291#if defined(__USE_ISOC99) && !defined(__UCLIBC__)
293 _Exit(0); 292 _Exit(0);
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_local_win32.c b/libraries/ecore/src/lib/ecore_con/ecore_con_local_win32.c
index 858daa5..2b7e5c5 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_local_win32.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_local_win32.c
@@ -75,9 +75,7 @@ _ecore_con_local_win32_server_read_client_handler(void *data, Ecore_Win32_Handle
75 free(msg); 75 free(msg);
76 } 76 }
77#endif 77#endif
78 if (!cl->delete_me) 78 _ecore_con_client_kill(cl);
79 ecore_con_event_client_del(cl);
80 cl->dead = EINA_TRUE;
81 return ECORE_CALLBACK_CANCEL; 79 return ECORE_CALLBACK_CANCEL;
82 } 80 }
83 81
@@ -110,9 +108,7 @@ _ecore_con_local_win32_server_peek_client_handler(void *data, Ecore_Win32_Handle
110 free(msg); 108 free(msg);
111 } 109 }
112#endif 110#endif
113 if (!cl->host_server->delete_me) 111 _ecore_con_server_kill(cl->host_server);
114 ecore_con_event_server_del(cl->host_server);
115 cl->host_server->dead = EINA_TRUE;
116 return ECORE_CALLBACK_CANCEL; 112 return ECORE_CALLBACK_CANCEL;
117 113
118 ecore_main_win32_handler_del(wh); 114 ecore_main_win32_handler_del(wh);
@@ -140,9 +136,7 @@ _ecore_con_local_win32_client_peek_server_handler(void *data, Ecore_Win32_Handle
140 free(msg); 136 free(msg);
141 } 137 }
142#endif 138#endif
143 if (!svr->delete_me) 139 _ecore_con_server_kill(svr);
144 ecore_con_event_server_del(svr);
145 svr->dead = EINA_TRUE;
146 return ECORE_CALLBACK_CANCEL; 140 return ECORE_CALLBACK_CANCEL;
147 141
148 ecore_main_win32_handler_del(wh); 142 ecore_main_win32_handler_del(wh);
@@ -191,9 +185,7 @@ _ecore_con_local_win32_client_read_server_handler(void *data, Ecore_Win32_Handle
191 free(msg); 185 free(msg);
192 } 186 }
193#endif 187#endif
194 if (!svr->delete_me) 188 _ecore_con_server_kill(svr);
195 ecore_con_event_server_del(svr);
196 svr->dead = EINA_TRUE;
197 return ECORE_CALLBACK_CANCEL; 189 return ECORE_CALLBACK_CANCEL;
198 } 190 }
199 191
@@ -296,9 +288,6 @@ _ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh)
296 if (!svr->pipe) 288 if (!svr->pipe)
297 return ECORE_CALLBACK_CANCEL; 289 return ECORE_CALLBACK_CANCEL;
298 290
299 if (svr->dead)
300 return ECORE_CALLBACK_CANCEL;
301
302 if (svr->delete_me) 291 if (svr->delete_me)
303 return ECORE_CALLBACK_CANCEL; 292 return ECORE_CALLBACK_CANCEL;
304 293
@@ -698,16 +687,14 @@ ecore_con_local_win32_server_flush(Ecore_Con_Server *svr)
698 ecore_con_event_server_error(svr, msg); 687 ecore_con_event_server_error(svr, msg);
699 free(msg); 688 free(msg);
700 } 689 }
701 if (!svr->delete_me) 690 _ecore_con_server_kill(svr);
702 ecore_con_event_server_del(svr);
703 svr->dead = EINA_TRUE;
704 } 691 }
705 692
706 svr->write_buf_offset += written; 693 svr->write_buf_offset += written;
707 if (svr->write_buf_offset >= eina_binbuf_length_get(svr->buf)) 694 if (svr->write_buf_offset >= eina_binbuf_length_get(svr->buf))
708 { 695 {
709 svr->write_buf_offset = 0; 696 svr->write_buf_offset = 0;
710 eina_binbuf_free(svr->buf); 697 eina_binbuf_free(svr->buf);
711 svr->buf = NULL; 698 svr->buf = NULL;
712 svr->want_write = 0; 699 svr->want_write = 0;
713 } 700 }
@@ -749,9 +736,7 @@ ecore_con_local_win32_client_flush(Ecore_Con_Client *cl)
749 ecore_con_event_client_error(cl, msg); 736 ecore_con_event_client_error(cl, msg);
750 free(msg); 737 free(msg);
751 } 738 }
752 if (!cl->delete_me) 739 _ecore_con_client_kill(cl);
753 ecore_con_event_client_del(cl);
754 cl->dead = EINA_TRUE;
755 } 740 }
756 741
757 cl->buf_offset += written; 742 cl->buf_offset += written;
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_private.h b/libraries/ecore/src/lib/ecore_con/ecore_con_private.h
index f601465..35f2310 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_private.h
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_private.h
@@ -56,7 +56,8 @@ extern int _ecore_con_log_dom;
56 56
57typedef struct _Ecore_Con_Lookup Ecore_Con_Lookup; 57typedef struct _Ecore_Con_Lookup Ecore_Con_Lookup;
58typedef struct _Ecore_Con_Info Ecore_Con_Info; 58typedef struct _Ecore_Con_Info Ecore_Con_Info;
59 59typedef struct Ecore_Con_Socks_v4 Ecore_Con_Socks_v4;
60typedef struct Ecore_Con_Socks_v5 Ecore_Con_Socks_v5;
60typedef void (*Ecore_Con_Info_Cb)(void *data, Ecore_Con_Info *infos); 61typedef void (*Ecore_Con_Info_Cb)(void *data, Ecore_Con_Info *infos);
61 62
62typedef enum _Ecore_Con_State 63typedef enum _Ecore_Con_State
@@ -82,6 +83,14 @@ typedef enum _Ecore_Con_Ssl_Handshake
82 ECORE_CON_SSL_STATE_INIT 83 ECORE_CON_SSL_STATE_INIT
83} Ecore_Con_Ssl_State; 84} Ecore_Con_Ssl_State;
84 85
86typedef enum Ecore_Con_Socks_State
87{
88 ECORE_CON_SOCKS_STATE_DONE = 0,
89 ECORE_CON_SOCKS_STATE_RESOLVED,
90 ECORE_CON_SOCKS_STATE_INIT,
91 ECORE_CON_SOCKS_STATE_READ
92} Ecore_Con_Socks_State;
93
85struct _Ecore_Con_Client 94struct _Ecore_Con_Client
86{ 95{
87 ECORE_MAGIC; 96 ECORE_MAGIC;
@@ -107,9 +116,8 @@ struct _Ecore_Con_Client
107#endif 116#endif
108 Ecore_Con_Ssl_State ssl_state; 117 Ecore_Con_Ssl_State ssl_state;
109 Eina_Bool handshaking : 1; 118 Eina_Bool handshaking : 1;
110 Eina_Bool upgrade : 1; 119 Eina_Bool upgrade : 1; /* STARTTLS queued */
111 Eina_Bool dead : 1; 120 Eina_Bool delete_me : 1; /* del event has been queued */
112 Eina_Bool delete_me : 1;
113}; 121};
114 122
115struct _Ecore_Con_Server 123struct _Ecore_Con_Server
@@ -130,6 +138,18 @@ struct _Ecore_Con_Server
130 Eina_List *event_count; 138 Eina_List *event_count;
131 int client_limit; 139 int client_limit;
132 pid_t ppid; 140 pid_t ppid;
141 /* socks */
142 Ecore_Con_Socks *ecs;
143 Ecore_Con_Socks_State ecs_state;
144 int ecs_addrlen;
145 unsigned char ecs_addr[16];
146 unsigned int ecs_buf_offset;
147 Eina_Binbuf *ecs_buf;
148 Eina_Binbuf *ecs_recvbuf;
149 const char *proxyip;
150 int proxyport;
151 /* endsocks */
152 const char *verify_name;
133#if USE_GNUTLS 153#if USE_GNUTLS
134 gnutls_session_t session; 154 gnutls_session_t session;
135 gnutls_anon_client_credentials_t anoncred_c; 155 gnutls_anon_client_credentials_t anoncred_c;
@@ -149,18 +169,17 @@ struct _Ecore_Con_Server
149 double disconnect_time; 169 double disconnect_time;
150 double client_disconnect_time; 170 double client_disconnect_time;
151 const char *ip; 171 const char *ip;
152 Eina_Bool dead : 1;
153 Eina_Bool created : 1; /* EINA_TRUE if server is our listening server */ 172 Eina_Bool created : 1; /* EINA_TRUE if server is our listening server */
154 Eina_Bool connecting : 1; /* EINA_FALSE if just initialized or connected */ 173 Eina_Bool connecting : 1; /* EINA_FALSE if just initialized or connected */
155 Eina_Bool handshaking : 1; /* EINA_TRUE if server is ssl handshaking */ 174 Eina_Bool handshaking : 1; /* EINA_TRUE if server is ssl handshaking */
156 Eina_Bool upgrade : 1; 175 Eina_Bool upgrade : 1; /* STARTTLS queued */
157 Eina_Bool ssl_prepared : 1; 176 Eina_Bool ssl_prepared : 1;
158 Eina_Bool use_cert : 1; /* EINA_TRUE if using certificate auth */ 177 Eina_Bool use_cert : 1; /* EINA_TRUE if using certificate auth */
159 Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */ 178 Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */
160 Eina_Bool verify : 1; /* EINA_TRUE if certificates will be verified */ 179 Eina_Bool verify : 1; /* EINA_TRUE if certificates will be verified */
161 Eina_Bool verify_basic : 1; /* EINA_TRUE if certificates will be verified only against the hostname */ 180 Eina_Bool verify_basic : 1; /* EINA_TRUE if certificates will be verified only against the hostname */
162 Eina_Bool reject_excess_clients : 1; 181 Eina_Bool reject_excess_clients : 1;
163 Eina_Bool delete_me : 1; 182 Eina_Bool delete_me : 1; /* del event has been queued */
164#ifdef _WIN32 183#ifdef _WIN32
165 Eina_Bool want_write : 1; 184 Eina_Bool want_write : 1;
166 Eina_Bool read_stop : 1; 185 Eina_Bool read_stop : 1;
@@ -182,19 +201,18 @@ struct _Ecore_Con_Url
182 Eina_List *additional_headers; 201 Eina_List *additional_headers;
183 Eina_List *response_headers; 202 Eina_List *response_headers;
184 const char *url; 203 const char *url;
204 long proxy_type;
205
206 Ecore_Timer *timer;
185 207
186 Ecore_Con_Url_Time time_condition; 208 Ecore_Con_Url_Time time_condition;
187 double timestamp; 209 double timestamp;
188 void *data; 210 void *data;
189 211
190 Ecore_Fd_Handler *fd_handler; 212 void *post_data;
191 int fd;
192 int flags;
193 213
194 int received; 214 int received;
195 int write_fd; 215 int write_fd;
196
197 Eina_Bool active : 1;
198}; 216};
199#endif 217#endif
200 218
@@ -212,16 +230,68 @@ struct _Ecore_Con_Lookup
212 const void *data; 230 const void *data;
213}; 231};
214 232
233#define ECORE_CON_SOCKS_CAST_ELSE(X) \
234 Ecore_Con_Socks_v4 *v4 = NULL; \
235 Ecore_Con_Socks_v5 *v5 = NULL; \
236 if ((X) && ((X)->version == 4)) \
237 v4 = (Ecore_Con_Socks_v4*)(X); \
238 else if ((X) && ((X)->version == 5)) \
239 v5 = (Ecore_Con_Socks_v5*)(X); \
240 else
241
242struct Ecore_Con_Socks
243{
244 unsigned char version;
245
246 const char *ip;
247 int port;
248 const char *username;
249 Eina_Bool lookup : 1;
250 Eina_Bool bind : 1;
251};
252
253struct Ecore_Con_Socks_v4
254{
255 unsigned char version;
256
257 const char *ip;
258 int port;
259 const char *username;
260 Eina_Bool lookup : 1;
261 Eina_Bool bind : 1;
262};
263
264struct Ecore_Con_Socks_v5
265{
266 unsigned char version;
267
268 const char *ip;
269 int port;
270 const char *username;
271 Eina_Bool lookup : 1;
272 Eina_Bool bind : 1;
273};
274
275extern Ecore_Con_Socks *_ecore_con_proxy_once;
276extern Ecore_Con_Socks *_ecore_con_proxy_global;
277void ecore_con_socks_init(void);
278void ecore_con_socks_shutdown(void);
279Eina_Bool ecore_con_socks_svr_init(Ecore_Con_Server *svr);
280void ecore_con_socks_read(Ecore_Con_Server *svr, unsigned char *buf, int num);
281void ecore_con_socks_dns_cb(const char *canonname, const char *ip, struct sockaddr *addr, int addrlen, Ecore_Con_Server *svr);
215/* from ecore_con.c */ 282/* from ecore_con.c */
216void ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info); 283void ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info);
284void ecore_con_event_proxy_bind(Ecore_Con_Server *svr);
217void ecore_con_event_server_data(Ecore_Con_Server *svr, unsigned char *buf, int num, Eina_Bool duplicate); 285void ecore_con_event_server_data(Ecore_Con_Server *svr, unsigned char *buf, int num, Eina_Bool duplicate);
218void ecore_con_event_server_del(Ecore_Con_Server *svr); 286void ecore_con_event_server_del(Ecore_Con_Server *svr);
219void ecore_con_event_server_error(Ecore_Con_Server *svr, const char *error); 287#define ecore_con_event_server_error(svr, error) _ecore_con_event_server_error((svr), (char*)(error), EINA_TRUE)
288void _ecore_con_event_server_error(Ecore_Con_Server *svr, char *error, Eina_Bool duplicate);
220void ecore_con_event_client_add(Ecore_Con_Client *cl); 289void ecore_con_event_client_add(Ecore_Con_Client *cl);
221void ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int num, Eina_Bool duplicate); 290void ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int num, Eina_Bool duplicate);
222void ecore_con_event_client_del(Ecore_Con_Client *cl); 291void ecore_con_event_client_del(Ecore_Con_Client *cl);
223void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error); 292void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error);
224 293void _ecore_con_server_kill(Ecore_Con_Server *svr);
294void _ecore_con_client_kill(Ecore_Con_Client *cl);
225/* from ecore_local_win32.c */ 295/* from ecore_local_win32.c */
226#ifdef _WIN32 296#ifdef _WIN32
227Eina_Bool ecore_con_local_listen(Ecore_Con_Server *svr); 297Eina_Bool ecore_con_local_listen(Ecore_Con_Server *svr);
@@ -312,6 +382,7 @@ GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Add, ecore_con_event_server_add
312GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Del, ecore_con_event_server_del); 382GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Del, ecore_con_event_server_del);
313GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Write, ecore_con_event_server_write); 383GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Write, ecore_con_event_server_write);
314GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Data, ecore_con_event_server_data); 384GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Data, ecore_con_event_server_data);
385GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Proxy_Bind, ecore_con_event_proxy_bind);
315 386
316void ecore_con_mempool_init(void); 387void ecore_con_mempool_init(void);
317void ecore_con_mempool_shutdown(void); 388void ecore_con_mempool_shutdown(void);
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_socks.c b/libraries/ecore/src/lib/ecore_con/ecore_con_socks.c
new file mode 100644
index 0000000..aecaff0
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_socks.c
@@ -0,0 +1,496 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <string.h>
7#include <sys/types.h>
8#include <sys/stat.h>
9#include <errno.h>
10#include <unistd.h>
11#include <fcntl.h>
12
13#ifdef HAVE_NETINET_TCP_H
14# include <netinet/tcp.h>
15#endif
16
17#ifdef HAVE_NET_IF_H
18# include <net/if.h>
19#endif
20
21/* if net/if.h is not found or if an older versions of net/if.h is provided
22 which does not define IF_NAMESIZE. We must define it ourselves */
23#ifndef IF_NAMESIZE
24# ifdef IFNAMSIZ
25# define IF_NAMESIZE IFNAMSIZ
26# else
27# define IF_NAMESIZE 16
28# endif
29#endif
30
31#ifdef HAVE_NETINET_IN_H
32# include <netinet/in.h>
33#endif
34
35#ifdef HAVE_ARPA_INET_H
36# include <arpa/inet.h>
37#endif
38
39#ifdef HAVE_SYS_SOCKET_H
40# include <sys/socket.h>
41#endif
42
43#ifdef HAVE_SYS_UN_H
44# include <sys/un.h>
45#endif
46
47#ifdef HAVE_WS2TCPIP_H
48# include <ws2tcpip.h>
49#endif
50
51#ifdef HAVE_EVIL
52# include <Evil.h>
53#endif
54
55#include "Ecore.h"
56#include "ecore_private.h"
57#include "Ecore_Con.h"
58#include "ecore_con_private.h"
59
60#define _ecore_con_server_kill(svr) do { \
61 DBG("KILL %p", (svr)); \
62 _ecore_con_server_kill((svr)); \
63} while (0)
64
65Eina_List *ecore_con_socks_proxies = NULL;
66
67static Ecore_Con_Socks *
68_ecore_con_socks_find(unsigned char version, const char *ip, int port, const char *username)
69{
70 Eina_List *l;
71 Ecore_Con_Socks *ecs;
72
73 if (!ecore_con_socks_proxies) return NULL;
74
75 EINA_LIST_FOREACH(ecore_con_socks_proxies, l, ecs)
76 {
77 if (ecs->version != version) continue;
78 if (strcmp(ecs->ip, ip)) continue;
79 if ((port != -1) && (port != ecs->port)) continue;
80 if (username && strcmp(ecs->username, username)) continue;
81 return ecs;
82 }
83 return NULL;
84}
85
86static void
87_ecore_con_socks_free(Ecore_Con_Socks *ecs)
88{
89 ECORE_CON_SOCKS_CAST_ELSE(ecs) return;
90
91 if (_ecore_con_proxy_once == ecs) _ecore_con_proxy_once = NULL;
92 if (_ecore_con_proxy_global == ecs) _ecore_con_proxy_global = NULL;
93 eina_stringshare_del(ecs->ip);
94 eina_stringshare_del(ecs->username);
95 free(ecs);
96}
97/////////////////////////////////////////////////////////////////////////////////////
98void
99ecore_con_socks_shutdown(void)
100{
101 Ecore_Con_Socks *ecs;
102 EINA_LIST_FREE(ecore_con_socks_proxies, ecs)
103 _ecore_con_socks_free(ecs);
104 _ecore_con_proxy_once = NULL;
105 _ecore_con_proxy_global = NULL;
106}
107
108void
109ecore_con_socks_read(Ecore_Con_Server *svr, unsigned char *buf, int num)
110{
111 const unsigned char *data;
112 ECORE_CON_SOCKS_CAST_ELSE(svr->ecs) return;
113
114 if (svr->ecs_state != ECORE_CON_SOCKS_STATE_READ) return;
115
116 if (v4)
117 {
118 DBG("SOCKS: %d bytes", num);
119 if (num < 8)
120 {
121 if (!svr->ecs_recvbuf) svr->ecs_recvbuf = eina_binbuf_new();
122 if (!svr->ecs_recvbuf) goto error;
123 eina_binbuf_append_length(svr->ecs_recvbuf, buf, num);
124 /* the slowest connection on earth */
125 if (eina_binbuf_length_get(svr->ecs_recvbuf) != 8) return;
126 data = eina_binbuf_string_get(svr->ecs_recvbuf);
127 }
128 else if (num > 8) goto error;
129 else
130 data = buf;
131
132 /* http://ufasoft.com/doc/socks4_protocol.htm */
133 if (data[0]) goto error;
134 switch (data[1])
135 {
136 case 90:
137 /* success! */
138 break;
139 case 91:
140 ecore_con_event_server_error(svr, "proxy request rejected or failed");
141 goto error;
142 case 92:
143 ecore_con_event_server_error(svr, "proxying SOCKS server could not perform authentication");
144 goto error;
145 case 93:
146 ecore_con_event_server_error(svr, "proxy request authentication rejected");
147 goto error;
148 default:
149 ecore_con_event_server_error(svr, "garbage data from proxy");
150 goto error;
151 }
152 if (svr->ecs->bind)
153 {
154 unsigned int nport;
155 char naddr[IF_NAMESIZE];
156
157 memcpy(&nport, &data[2], 2);
158 svr->proxyport = ntohl(nport);
159
160 if (!inet_ntop(AF_INET, &data[4], naddr, sizeof(naddr))) goto error;
161 svr->proxyip = eina_stringshare_add(naddr);
162 ecore_con_event_proxy_bind(svr);
163 }
164 svr->ecs_state = ECORE_CON_SOCKS_STATE_DONE;
165 INF("PROXY CONNECTED");
166 if (svr->ecs_recvbuf) eina_binbuf_free(svr->ecs_recvbuf);
167 svr->ecs_recvbuf = NULL;
168 svr->ecs_buf_offset = svr->ecs_addrlen = 0;
169 memset(svr->ecs_addr, 0, sizeof(svr->ecs_addr));
170 if (!svr->ssl_state)
171 ecore_con_event_server_add(svr);
172 if (svr->ssl_state || (svr->buf && eina_binbuf_length_get(svr->buf)))
173 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
174 }
175 return;
176error:
177 _ecore_con_server_kill(svr);
178}
179
180Eina_Bool
181ecore_con_socks_svr_init(Ecore_Con_Server *svr)
182{
183 unsigned char *sbuf;
184 ECORE_CON_SOCKS_CAST_ELSE(svr->ecs) return EINA_FALSE;
185
186 if (!svr->ip) return EINA_FALSE;
187 if (svr->ecs_buf) return EINA_FALSE;
188 if (svr->ecs_state != ECORE_CON_SOCKS_STATE_INIT) return EINA_FALSE;
189 ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_WRITE);
190 if (v4)
191 {
192 size_t addrlen, buflen, ulen = 1;
193 addrlen = svr->ecs->lookup ? strlen(svr->name) + 1: 0;
194 if (svr->ecs->username) ulen += strlen(svr->ecs->username);
195 buflen = sizeof(char) * (8 + ulen + addrlen);
196 sbuf = malloc(buflen);
197 if (!sbuf)
198 {
199 ecore_con_event_server_error(svr, "Memory allocation failure!");
200 _ecore_con_server_kill(svr);
201 return EINA_FALSE;
202 }
203 /* http://en.wikipedia.org/wiki/SOCKS */
204 sbuf[0] = 4;
205 sbuf[1] = v4->bind ? 2 : 1;
206 sbuf[2] = svr->port >> 8;
207 sbuf[3] = svr->port & 0xff;
208 if (addrlen)
209 {
210 sbuf[4] = sbuf[5] = sbuf[6] = 0;
211 sbuf[7] = 1;
212 }
213 else
214 memcpy(sbuf + 4, svr->ecs_addr, 4);
215 if (svr->ecs->username)
216 memcpy(sbuf + 8, svr->ecs->username, ulen);
217 else
218 sbuf[8] = 0;
219 if (addrlen) memcpy(sbuf + 8 + ulen, svr->name, addrlen);
220
221 svr->ecs_buf = eina_binbuf_manage_new_length(sbuf, buflen);
222 }
223 return EINA_TRUE;
224}
225
226void
227ecore_con_socks_dns_cb(const char *canonname __UNUSED__, const char *ip, struct sockaddr *addr, int addrlen, Ecore_Con_Server *svr)
228{
229 svr->ip = eina_stringshare_add(ip);
230 svr->ecs_addrlen = addrlen;
231 svr->ecs_state++;
232 if (addr->sa_family == AF_INET)
233 memcpy(svr->ecs_addr, &((struct sockaddr_in *)addr)->sin_addr.s_addr, 4);
234#ifdef HAVE_IPV6
235 else
236 memcpy(svr->ecs_addr, &((struct sockaddr_in6 *)addr)->sin6_addr.s6_addr, addrlen);
237#endif
238 ecore_con_socks_svr_init(svr);
239}
240
241void
242ecore_con_socks_init(void)
243{
244 const char *socks;
245 char *u, *h, *p, *l;
246 char buf[64];
247 int port, lookup = 0;
248 Ecore_Con_Socks *ecs;
249 unsigned char addr[sizeof(struct in_addr)];
250
251 /* ECORE_CON_SOCKS_V4=user@host:port:[1|0] */
252 socks = getenv("ECORE_CON_SOCKS_V4");
253 if ((!socks) || (!socks[0]) || (strlen(socks) > 64)) return;
254 strncpy(buf, socks, sizeof(buf));
255 h = strchr(buf, '@');
256 u = NULL;
257 /* username */
258 if (h && (h - buf > 0)) *h++ = 0, u = buf;
259 else h = buf;
260
261 /* host ip; I ain't resolvin shit here */
262 p = strchr(h, ':');
263 if (!p) return;
264 *p++ = 0;
265 if (!inet_pton(AF_INET, h, addr)) return;
266
267 errno = 0;
268 port = strtol(p, &l, 10);
269 if (errno || (port < 0) || (port > 65535)) return;
270 if (l && (l[0] == ':'))
271 lookup = (l[1] == '1');
272 ecs = ecore_con_socks4_remote_add(h, port, u);
273 if (!ecs) return;
274 ecore_con_socks4_lookup_set(ecs, lookup);
275 ecore_con_socks_apply_always(ecs);
276 INF("Added global proxy server %s%s%s:%d - DNS lookup %s",
277 u ?: "", u ? "@" : "", h, port, lookup ? "ENABLED" : "DISABLED");
278}
279
280/////////////////////////////////////////////////////////////////////////////////////
281
282/**
283 * @defgroup Ecore_Con_Socks_Group Ecore Connection SOCKS functions
284 * @{
285 */
286
287/**
288 * Add a SOCKS v4 proxy to the proxy list
289 *
290 * Use this to create (or return, if previously added) a SOCKS proxy
291 * object which can be used by any ecore_con servers.
292 * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
293 * @param port The port to connect to on the proxy
294 * @param username The username to use for the proxy (OPTIONAL)
295 * @return An allocated proxy object, or NULL on failure
296 * @note This object NEVER needs to be explicitly freed.
297 * @since 1.2
298 */
299EAPI Ecore_Con_Socks *
300ecore_con_socks4_remote_add(const char *ip, int port, const char *username)
301{
302 Ecore_Con_Socks *ecs;
303
304 if ((!ip) || (!ip[0]) || (port < 0) || (port > 65535)) return NULL;
305
306 ecs = _ecore_con_socks_find(4, ip, port, username);
307 if (ecs) return ecs;
308
309 ecs = calloc(1, sizeof(Ecore_Con_Socks_v4));
310 if (!ecs) return NULL;
311
312 ecs->version = 4;
313 ecs->ip = eina_stringshare_add(ip);
314 ecs->port = port;
315 ecs->username = eina_stringshare_add(username);
316 ecore_con_socks_proxies = eina_list_append(ecore_con_socks_proxies, ecs);
317 return ecs;
318}
319
320/**
321 * Set DNS lookup mode on an existing SOCKS v4 proxy
322 *
323 * According to RFC, SOCKS v4 does not require that a proxy perform
324 * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
325 * for this. If you want to enable remote DNS lookup and are sure that your
326 * proxy supports it, use this function.
327 * @param ecs The proxy object
328 * @param enable If true, the proxy will perform the dns lookup
329 * @note By default, this setting is DISABLED.
330 * @since 1.2
331 */
332EAPI void
333ecore_con_socks4_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable)
334{
335 ECORE_CON_SOCKS_CAST_ELSE(ecs) return;
336 if (v4) v4->lookup = !!enable;
337}
338
339/**
340 * Get DNS lookup mode on an existing SOCKS v4 proxy
341 *
342 * According to RFC, SOCKS v4 does not require that a proxy perform
343 * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
344 * for this. This function returns whether lookups are enabled on a proxy object.
345 * @param ecs The proxy object
346 * @return If true, the proxy will perform the dns lookup
347 * @note By default, this setting is DISABLED.
348 * @since 1.2
349 */
350EAPI Eina_Bool
351ecore_con_socks4_lookup_get(Ecore_Con_Socks *ecs)
352{
353 ECORE_CON_SOCKS_CAST_ELSE(ecs) return EINA_FALSE;
354 return v4 ? v4->lookup : EINA_FALSE;
355}
356
357/**
358 * Find a SOCKS v4 proxy in the proxy list
359 *
360 * Use this to determine if a SOCKS proxy was previously added by checking
361 * the proxy list against the parameters given.
362 * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
363 * @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
364 * @param username The username used for the proxy (OPTIONAL)
365 * @return true only if a proxy exists matching the given params
366 * @note This function matches slightly more loosely than ecore_con_socks4_remote_add(), and
367 * ecore_con_socks4_remote_add() should be used to return the actual object.
368 * @since 1.2
369 */
370EAPI Eina_Bool
371ecore_con_socks4_remote_exists(const char *ip, int port, const char *username)
372{
373 if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0])))
374 return EINA_FALSE;
375 return !!_ecore_con_socks_find(4, ip, port, username);
376}
377
378/**
379 * Remove a SOCKS v4 proxy from the proxy list and delete it
380 *
381 * Use this to remove a SOCKS proxy from the proxy list by checking
382 * the list against the parameters given. The proxy will then be deleted.
383 * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
384 * @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
385 * @param username The username used for the proxy (OPTIONAL)
386 * @note This function matches in the same way as ecore_con_socks4_remote_exists().
387 * @warning Be aware that deleting a proxy which is being used WILL ruin your life.
388 * @since 1.2
389 */
390EAPI void
391ecore_con_socks4_remote_del(const char *ip, int port, const char *username)
392{
393 Ecore_Con_Socks_v4 *v4;
394
395 if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0]))) return;
396 if (!ecore_con_socks_proxies) return;
397
398 v4 = (Ecore_Con_Socks_v4*)_ecore_con_socks_find(4, ip, port, username);
399 if (!v4) return;
400 ecore_con_socks_proxies = eina_list_remove(ecore_con_socks_proxies, v4);
401 _ecore_con_socks_free((Ecore_Con_Socks*)v4);
402}
403
404/**
405 * Enable bind mode on a SOCKS proxy
406 *
407 * Use this function to enable binding a remote port for use with a remote server.
408 * For more information, see http://ufasoft.com/doc/socks4_protocol.htm
409 * @param ecs The proxy object
410 * @param is_bind If true, the connection established will be a port binding
411 * @warning Be aware that changing the operation mode of an active proxy may result in undefined behavior
412 * @since 1.2
413 */
414EAPI void
415ecore_con_socks_bind_set(Ecore_Con_Socks *ecs, Eina_Bool is_bind)
416{
417 EINA_SAFETY_ON_NULL_RETURN(ecs);
418 ecs->bind = !!is_bind;
419}
420
421/**
422 * Return bind mode of a SOCKS proxy
423 *
424 * Use this function to return bind mode of a proxy (binding a remote port for use with a remote server).
425 * For more information, see http://ufasoft.com/doc/socks4_protocol.htm
426 * @param ecs The proxy object
427 * @return If true, the connection established will be a port binding
428 * @since 1.2
429 */
430EAPI Eina_Bool
431ecore_con_socks_bind_get(Ecore_Con_Socks *ecs)
432{
433 EINA_SAFETY_ON_NULL_RETURN_VAL(ecs, EINA_FALSE);
434 return ecs->bind;
435}
436
437EAPI unsigned int
438ecore_con_socks_version_get(Ecore_Con_Socks *ecs)
439{
440 EINA_SAFETY_ON_NULL_RETURN_VAL(ecs, 0);
441 return ecs->version;
442}
443
444/**
445 * Remove a SOCKS v4 proxy from the proxy list and delete it
446 *
447 * Use this to remove a SOCKS proxy from the proxy list by directly deleting the object given.
448 * @param ecs The proxy object to delete
449 * @warning Be aware that deleting a proxy which is being used WILL ruin your life.
450 * @since 1.2
451 */
452EAPI void
453ecore_con_socks_remote_del(Ecore_Con_Socks *ecs)
454{
455 EINA_SAFETY_ON_NULL_RETURN(ecs);
456 if (!ecore_con_socks_proxies) return;
457
458 ecore_con_socks_proxies = eina_list_remove(ecore_con_socks_proxies, ecs);
459 _ecore_con_socks_free(ecs);
460}
461
462/**
463 * Set a proxy object to be used with the next server created with ecore_con_server_connect()
464 *
465 * This function sets a proxy for the next ecore_con connection. After the next server is created,
466 * the proxy will NEVER be applied again unless explicitly enabled.
467 * @param ecs The proxy object
468 * @see ecore_con_socks_apply_always()
469 * @since 1.2
470 */
471EAPI void
472ecore_con_socks_apply_once(Ecore_Con_Socks *ecs)
473{
474 _ecore_con_proxy_once = ecs;
475}
476
477/**
478 * Set a proxy object to be used with all servers created with ecore_con_server_connect()
479 *
480 * This function sets a proxy for all ecore_con connections. It will always be used.
481 * @param ecs The proxy object
482 * @see ecore_con_socks_apply_once()
483 * @since 1.2
484 * @note ecore-con supports setting this through environment variables like so:
485 * ECORE_CON_SOCKS_V4=[user@]server:port:lookup
486 * user is the OPTIONAL string that would be passed to the proxy as the username
487 * server is the IP_ADDRESS of the proxy server
488 * port is the port to connect to on the proxy server
489 * lookup is 1 if the proxy should perform all DNS lookups, otherwise 0 or omitted
490 */
491EAPI void
492ecore_con_socks_apply_always(Ecore_Con_Socks *ecs)
493{
494 _ecore_con_proxy_global = ecs;
495}
496/** @} */
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_ssl.c b/libraries/ecore/src/lib/ecore_con/ecore_con_ssl.c
index c352e94..6104632 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_ssl.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_ssl.c
@@ -16,6 +16,7 @@
16# include <ws2tcpip.h> 16# include <ws2tcpip.h>
17#endif 17#endif
18 18
19#include <sys/stat.h>
19#include "Ecore.h" 20#include "Ecore.h"
20#include "ecore_con_private.h" 21#include "ecore_con_private.h"
21 22
@@ -60,12 +61,34 @@ _gnutls_print_errors(void *conn, int type, int ret)
60 ecore_con_event_server_error(conn, buf); 61 ecore_con_event_server_error(conn, buf);
61} 62}
62 63
64static void
65_gnutls_print_session(const gnutls_datum_t *cert_list, unsigned int cert_list_size)
66{
67 char *c = NULL;
68 gnutls_x509_crt_t crt;
69 unsigned int x;
70
71 if (!eina_log_domain_level_check(_ecore_con_log_dom, EINA_LOG_LEVEL_DBG)) return;
72 for (x = 0; x < cert_list_size; x++)
73 {
74 gnutls_x509_crt_init(&crt);
75 gnutls_x509_crt_import(crt, &cert_list[x], GNUTLS_X509_FMT_DER);
76 gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_FULL, (gnutls_datum_t*)&c);
77 INF("CERTIFICATE:\n%s", c);
78 gnutls_free(c);
79 gnutls_x509_crt_deinit(crt);
80 crt = NULL;
81 }
82}
83
63#ifdef ISCOMFITOR 84#ifdef ISCOMFITOR
64static void 85static void
65_gnutls_log_func(int level, 86_gnutls_log_func(int level,
66 const char *str) 87 const char *str)
67{ 88{
68 DBG("|<%d>| %s", level, str); 89 char buf[128];
90 strncat(buf, str, strlen(str) - 1);
91 DBG("|<%d>| %s", level, buf);
69} 92}
70#endif 93#endif
71 94
@@ -116,6 +139,185 @@ SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status)
116#elif USE_OPENSSL 139#elif USE_OPENSSL
117 140
118static void 141static void
142_openssl_print_verify_error(int error)
143{
144 switch (error)
145 {
146#define ERROR(X) \
147 case (X): \
148 ERR("%s", #X); \
149 break
150#ifdef X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
151 ERROR(X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT);
152#endif
153#ifdef X509_V_ERR_UNABLE_TO_GET_CRL
154 ERROR(X509_V_ERR_UNABLE_TO_GET_CRL);
155#endif
156#ifdef X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE
157 ERROR(X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE);
158#endif
159#ifdef X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
160 ERROR(X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE);
161#endif
162#ifdef X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
163 ERROR(X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY);
164#endif
165#ifdef X509_V_ERR_CERT_SIGNATURE_FAILURE
166 ERROR(X509_V_ERR_CERT_SIGNATURE_FAILURE);
167#endif
168#ifdef X509_V_ERR_CRL_SIGNATURE_FAILURE
169 ERROR(X509_V_ERR_CRL_SIGNATURE_FAILURE);
170#endif
171#ifdef X509_V_ERR_CERT_NOT_YET_VALID
172 ERROR(X509_V_ERR_CERT_NOT_YET_VALID);
173#endif
174#ifdef X509_V_ERR_CERT_HAS_EXPIRED
175 ERROR(X509_V_ERR_CERT_HAS_EXPIRED);
176#endif
177#ifdef X509_V_ERR_CRL_NOT_YET_VALID
178 ERROR(X509_V_ERR_CRL_NOT_YET_VALID);
179#endif
180#ifdef X509_V_ERR_CRL_HAS_EXPIRED
181 ERROR(X509_V_ERR_CRL_HAS_EXPIRED);
182#endif
183#ifdef X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
184 ERROR(X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD);
185#endif
186#ifdef X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
187 ERROR(X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD);
188#endif
189#ifdef X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
190 ERROR(X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD);
191#endif
192#ifdef X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
193 ERROR(X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
194#endif
195#ifdef X509_V_ERR_OUT_OF_MEM
196 ERROR(X509_V_ERR_OUT_OF_MEM);
197#endif
198#ifdef X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
199 ERROR(X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
200#endif
201#ifdef X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
202 ERROR(X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN);
203#endif
204#ifdef X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
205 ERROR(X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY);
206#endif
207#ifdef X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
208 ERROR(X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE);
209#endif
210#ifdef X509_V_ERR_CERT_CHAIN_TOO_LONG
211 ERROR(X509_V_ERR_CERT_CHAIN_TOO_LONG);
212#endif
213#ifdef X509_V_ERR_CERT_REVOKED
214 ERROR(X509_V_ERR_CERT_REVOKED);
215#endif
216#ifdef X509_V_ERR_INVALID_CA
217 ERROR(X509_V_ERR_INVALID_CA);
218#endif
219#ifdef X509_V_ERR_PATH_LENGTH_EXCEEDED
220 ERROR(X509_V_ERR_PATH_LENGTH_EXCEEDED);
221#endif
222#ifdef X509_V_ERR_INVALID_PURPOSE
223 ERROR(X509_V_ERR_INVALID_PURPOSE);
224#endif
225#ifdef X509_V_ERR_CERT_UNTRUSTED
226 ERROR(X509_V_ERR_CERT_UNTRUSTED);
227#endif
228#ifdef X509_V_ERR_CERT_REJECTED
229 ERROR(X509_V_ERR_CERT_REJECTED);
230#endif
231 /* These are 'informational' when looking for issuer cert */
232#ifdef X509_V_ERR_SUBJECT_ISSUER_MISMATCH
233 ERROR(X509_V_ERR_SUBJECT_ISSUER_MISMATCH);
234#endif
235#ifdef X509_V_ERR_AKID_SKID_MISMATCH
236 ERROR(X509_V_ERR_AKID_SKID_MISMATCH);
237#endif
238#ifdef X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH
239 ERROR(X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH);
240#endif
241#ifdef X509_V_ERR_KEYUSAGE_NO_CERTSIGN
242 ERROR(X509_V_ERR_KEYUSAGE_NO_CERTSIGN);
243#endif
244
245#ifdef X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER
246 ERROR(X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER);
247#endif
248#ifdef X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION
249 ERROR(X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION);
250#endif
251#ifdef X509_V_ERR_KEYUSAGE_NO_CRL_SIGN
252 ERROR(X509_V_ERR_KEYUSAGE_NO_CRL_SIGN);
253#endif
254#ifdef X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION
255 ERROR(X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION);
256#endif
257#ifdef X509_V_ERR_INVALID_NON_CA
258 ERROR(X509_V_ERR_INVALID_NON_CA);
259#endif
260#ifdef X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED
261 ERROR(X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED);
262#endif
263#ifdef X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE
264 ERROR(X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE);
265#endif
266#ifdef X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED
267 ERROR(X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED);
268#endif
269
270#ifdef X509_V_ERR_INVALID_EXTENSION
271 ERROR(X509_V_ERR_INVALID_EXTENSION);
272#endif
273#ifdef X509_V_ERR_INVALID_POLICY_EXTENSION
274 ERROR(X509_V_ERR_INVALID_POLICY_EXTENSION);
275#endif
276#ifdef X509_V_ERR_NO_EXPLICIT_POLICY
277 ERROR(X509_V_ERR_NO_EXPLICIT_POLICY);
278#endif
279#ifdef X509_V_ERR_DIFFERENT_CRL_SCOPE
280 ERROR(X509_V_ERR_DIFFERENT_CRL_SCOPE);
281#endif
282#ifdef X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE
283 ERROR(X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE);
284#endif
285
286#ifdef X509_V_ERR_UNNESTED_RESOURCE
287 ERROR(X509_V_ERR_UNNESTED_RESOURCE);
288#endif
289
290#ifdef X509_V_ERR_PERMITTED_VIOLATION
291 ERROR(X509_V_ERR_PERMITTED_VIOLATION);
292#endif
293#ifdef X509_V_ERR_EXCLUDED_VIOLATION
294 ERROR(X509_V_ERR_EXCLUDED_VIOLATION);
295#endif
296#ifdef X509_V_ERR_SUBTREE_MINMAX
297 ERROR(X509_V_ERR_SUBTREE_MINMAX);
298#endif
299#ifdef X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE
300 ERROR(X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE);
301#endif
302#ifdef X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX
303 ERROR(X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX);
304#endif
305#ifdef X509_V_ERR_UNSUPPORTED_NAME_SYNTAX
306 ERROR(X509_V_ERR_UNSUPPORTED_NAME_SYNTAX);
307#endif
308#ifdef X509_V_ERR_CRL_PATH_VALIDATION_ERROR
309 ERROR(X509_V_ERR_CRL_PATH_VALIDATION_ERROR);
310#endif
311
312 /* The application is not happy */
313#ifdef X509_V_ERR_APPLICATION_VERIFICATION
314 ERROR(X509_V_ERR_APPLICATION_VERIFICATION);
315#endif
316 }
317#undef ERROR
318}
319
320static void
119_openssl_print_errors(void *conn, int type) 321_openssl_print_errors(void *conn, int type)
120{ 322{
121 char buf[1024]; 323 char buf[1024];
@@ -152,13 +354,57 @@ _openssl_name_verify(const char *name, const char *svrname)
152 EINA_SAFETY_ON_TRUE_RETURN_VAL(!s, EINA_FALSE); 354 EINA_SAFETY_ON_TRUE_RETURN_VAL(!s, EINA_FALSE);
153 /* same as above for the stored name */ 355 /* same as above for the stored name */
154 EINA_SAFETY_ON_TRUE_RETURN_VAL(!strchr(s + 1, '.'), EINA_FALSE); 356 EINA_SAFETY_ON_TRUE_RETURN_VAL(!strchr(s + 1, '.'), EINA_FALSE);
155 EINA_SAFETY_ON_TRUE_RETURN_VAL(strcasecmp(s, name + 1), EINA_FALSE); 357 if (strcasecmp(s, name + 1))
358 {
359 ERR("%s != %s", s, name + 1);
360 return EINA_FALSE;
361 }
156 } 362 }
157 else 363 else
158 EINA_SAFETY_ON_TRUE_RETURN_VAL(strcasecmp(name, svrname), EINA_FALSE); 364 if (strcasecmp(name, svrname))
365 {
366 ERR("%s != %s", name, svrname);
367 return EINA_FALSE;
368 }
159 return EINA_TRUE; 369 return EINA_TRUE;
160} 370}
161 371
372static void
373_openssl_print_session(SSL *ssl)
374{
375 /* print session info into DBG */
376 SSL_SESSION *s;
377 STACK_OF(X509) *sk;
378 BIO *b;
379 char log[4096], *p;
380 int x;
381
382 if (!eina_log_domain_level_check(_ecore_con_log_dom, EINA_LOG_LEVEL_DBG)) return;
383
384 memset(log, 0, sizeof(log));
385 b = BIO_new(BIO_s_mem());
386 sk = SSL_get_peer_cert_chain(ssl);
387 if (sk)
388 {
389 DBG("CERTIFICATES:");
390 for (x = 0; x < sk_X509_num(sk); x++)
391 {
392 p = X509_NAME_oneline(X509_get_subject_name(sk_X509_value(sk, x)), log, sizeof(log));
393 DBG("%2d s:%s", x, p);
394 p = X509_NAME_oneline(X509_get_issuer_name(sk_X509_value(sk, x)), log, sizeof(log));
395 DBG(" i:%s", p);
396 PEM_write_X509(stderr, sk_X509_value(sk, x));
397 }
398 }
399 s = SSL_get_session(ssl);
400 SSL_SESSION_print(b, s);
401 fprintf(stderr, "\n");
402 while (BIO_read(b, log, sizeof(log)) > 0)
403 fprintf(stderr, "%s", log);
404
405 BIO_free(b);
406}
407
162#endif 408#endif
163 409
164#define SSL_ERROR_CHECK_GOTO_ERROR(X) \ 410#define SSL_ERROR_CHECK_GOTO_ERROR(X) \
@@ -356,6 +602,51 @@ ecore_con_ssl_server_verify_basic(Ecore_Con_Server *svr)
356} 602}
357 603
358/** 604/**
605 * @brief Set the hostname to verify against in certificate verification
606 *
607 * Sometimes the certificate hostname will not match the hostname that you are
608 * connecting to, and will instead match a different name. An example of this is
609 * that if you connect to talk.google.com to use Google Talk, you receive Google's
610 * certificate for gmail.com. This certificate should be trusted, and so you must call
611 * this function with "gmail.com" as @p name.
612 * See RFC2818 for more details.
613 * @param svr The server object
614 * @param name The hostname to verify against
615 * @since 1.2
616 */
617EAPI void
618ecore_con_ssl_server_verify_name_set(Ecore_Con_Server *svr, const char *name)
619{
620 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
621 {
622 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __func__);
623 return;
624 }
625 eina_stringshare_replace(&svr->verify_name, name);
626}
627
628/**
629 * @brief Get the hostname to verify against in certificate verification
630 *
631 * This function returns the name which will be used to validate the SSL certificate
632 * common name (CN) or alt name (subjectAltName). It will default to the @p name
633 * param in ecore_con_server_connect(), but can be changed with ecore_con_ssl_server_verify_name_set().
634 * @param svr The server object
635 * @return The hostname which will be used
636 * @since 1.2
637 */
638EAPI const char *
639ecore_con_ssl_server_verify_name_get(Ecore_Con_Server *svr)
640{
641 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
642 {
643 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __func__);
644 return NULL;
645 }
646 return svr->verify_name ?: svr->name;
647}
648
649/**
359 * @brief Add an ssl certificate for use in ecore_con functions. 650 * @brief Add an ssl certificate for use in ecore_con functions.
360 * 651 *
361 * Use this function to add a SSL PEM certificate. 652 * Use this function to add a SSL PEM certificate.
@@ -375,6 +666,14 @@ ecore_con_ssl_server_cert_add(Ecore_Con_Server *svr,
375 return EINA_FALSE; 666 return EINA_FALSE;
376 } 667 }
377 668
669 if (!svr->ssl_prepared)
670 {
671 svr->use_cert = EINA_TRUE;
672 svr->type |= ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT;
673 if (ecore_con_ssl_server_prepare(svr, svr->type & ECORE_CON_SSL))
674 return EINA_FALSE;
675 }
676
378 return SSL_SUFFIX(_ecore_con_ssl_server_cert_add) (svr, cert); 677 return SSL_SUFFIX(_ecore_con_ssl_server_cert_add) (svr, cert);
379} 678}
380 679
@@ -386,6 +685,7 @@ ecore_con_ssl_server_cert_add(Ecore_Con_Server *svr,
386 * If there is an error loading the CAs, an error will automatically be logged. 685 * If there is an error loading the CAs, an error will automatically be logged.
387 * @param ca_file The path to the CA file. 686 * @param ca_file The path to the CA file.
388 * @return EINA_FALSE if the file cannot be loaded, otherwise EINA_TRUE. 687 * @return EINA_FALSE if the file cannot be loaded, otherwise EINA_TRUE.
688 * @note since 1.2, this function can load directores
389 */ 689 */
390 690
391EAPI Eina_Bool 691EAPI Eina_Bool
@@ -398,6 +698,14 @@ ecore_con_ssl_server_cafile_add(Ecore_Con_Server *svr,
398 return EINA_FALSE; 698 return EINA_FALSE;
399 } 699 }
400 700
701 if (!svr->ssl_prepared)
702 {
703 svr->use_cert = EINA_TRUE;
704 svr->type |= ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT;
705 if (ecore_con_ssl_server_prepare(svr, svr->type & ECORE_CON_SSL))
706 return EINA_FALSE;
707 }
708
401 return SSL_SUFFIX(_ecore_con_ssl_server_cafile_add) (svr, ca_file); 709 return SSL_SUFFIX(_ecore_con_ssl_server_cafile_add) (svr, ca_file);
402} 710}
403 711
@@ -422,6 +730,14 @@ ecore_con_ssl_server_privkey_add(Ecore_Con_Server *svr,
422 return EINA_FALSE; 730 return EINA_FALSE;
423 } 731 }
424 732
733 if (!svr->ssl_prepared)
734 {
735 svr->use_cert = EINA_TRUE;
736 svr->type |= ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT;
737 if (ecore_con_ssl_server_prepare(svr, svr->type & ECORE_CON_SSL))
738 return EINA_FALSE;
739 }
740
425 return SSL_SUFFIX(_ecore_con_ssl_server_privkey_add) (svr, key_file); 741 return SSL_SUFFIX(_ecore_con_ssl_server_privkey_add) (svr, key_file);
426} 742}
427 743
@@ -446,6 +762,14 @@ ecore_con_ssl_server_crl_add(Ecore_Con_Server *svr,
446 return EINA_FALSE; 762 return EINA_FALSE;
447 } 763 }
448 764
765 if (!svr->ssl_prepared)
766 {
767 svr->use_cert = EINA_TRUE;
768 svr->type |= ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT;
769 if (ecore_con_ssl_server_prepare(svr, svr->type & ECORE_CON_SSL))
770 return EINA_FALSE;
771 }
772
449 return SSL_SUFFIX(_ecore_con_ssl_server_crl_add) (svr, crl_file); 773 return SSL_SUFFIX(_ecore_con_ssl_server_crl_add) (svr, crl_file);
450} 774}
451 775
@@ -480,7 +804,8 @@ ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type ssl_type)
480 if (ecore_con_ssl_server_prepare(svr, ssl_type)) 804 if (ecore_con_ssl_server_prepare(svr, ssl_type))
481 return EINA_FALSE; 805 return EINA_FALSE;
482 } 806 }
483 svr->type |= ssl_type; 807 if (!svr->use_cert)
808 svr->type |= ssl_type;
484 svr->upgrade = EINA_TRUE; 809 svr->upgrade = EINA_TRUE;
485 svr->handshaking = EINA_TRUE; 810 svr->handshaking = EINA_TRUE;
486 svr->ssl_state = ECORE_CON_SSL_STATE_INIT; 811 svr->ssl_state = ECORE_CON_SSL_STATE_INIT;
@@ -494,7 +819,7 @@ ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type ssl_type)
494 * Once the upgrade has been completed, an ECORE_CON_EVENT_CLIENT_UPGRADE event will be emitted. 819 * Once the upgrade has been completed, an ECORE_CON_EVENT_CLIENT_UPGRADE event will be emitted.
495 * The connection should be treated as disconnected until the next event. 820 * The connection should be treated as disconnected until the next event.
496 * @param cl The client object 821 * @param cl The client object
497 * @param compl_type The SSL connection type (ONLY). 822 * @param ssl_type The SSL connection type (ONLY).
498 * @return EINA_FALSE if the connection cannot be upgraded, otherwise EINA_TRUE. 823 * @return EINA_FALSE if the connection cannot be upgraded, otherwise EINA_TRUE.
499 * @warning Setting a wrong value for @p compl_type WILL mess up your program. 824 * @warning Setting a wrong value for @p compl_type WILL mess up your program.
500 * @since 1.1 825 * @since 1.1
@@ -517,7 +842,8 @@ ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_Con_Type ssl_type)
517 if (ecore_con_ssl_server_prepare(cl->host_server, ssl_type)) 842 if (ecore_con_ssl_server_prepare(cl->host_server, ssl_type))
518 return EINA_FALSE; 843 return EINA_FALSE;
519 } 844 }
520 cl->host_server->type |= ssl_type; 845 if (!cl->host_server->use_cert)
846 cl->host_server->type |= ssl_type;
521 cl->upgrade = EINA_TRUE; 847 cl->upgrade = EINA_TRUE;
522 cl->host_server->upgrade = EINA_TRUE; 848 cl->host_server->upgrade = EINA_TRUE;
523 cl->handshaking = EINA_TRUE; 849 cl->handshaking = EINA_TRUE;
@@ -546,8 +872,11 @@ _ecore_con_ssl_init_gnutls(void)
546 return ECORE_CON_SSL_ERROR_INIT_FAILED; 872 return ECORE_CON_SSL_ERROR_INIT_FAILED;
547 873
548#ifdef ISCOMFITOR 874#ifdef ISCOMFITOR
549 gnutls_global_set_log_level(9); 875 if (eina_log_domain_level_check(_ecore_con_log_dom, EINA_LOG_LEVEL_DBG))
550 gnutls_global_set_log_function(_gnutls_log_func); 876 {
877 gnutls_global_set_log_level(9);
878 gnutls_global_set_log_function(_gnutls_log_func);
879 }
551#endif 880#endif
552 return ECORE_CON_SSL_ERROR_NONE; 881 return ECORE_CON_SSL_ERROR_NONE;
553} 882}
@@ -728,10 +1057,12 @@ _ecore_con_ssl_server_init_gnutls(Ecore_Con_Server *svr)
728 SSL_ERROR_CHECK_GOTO_ERROR(!(cert_list = gnutls_certificate_get_peers(svr->session, &cert_list_size))); 1057 SSL_ERROR_CHECK_GOTO_ERROR(!(cert_list = gnutls_certificate_get_peers(svr->session, &cert_list_size)));
729 SSL_ERROR_CHECK_GOTO_ERROR(!cert_list_size); 1058 SSL_ERROR_CHECK_GOTO_ERROR(!cert_list_size);
730 1059
1060 _gnutls_print_session(cert_list, cert_list_size);
1061
731 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_init(&cert)); 1062 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_init(&cert));
732 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER)); 1063 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER));
733 1064
734 SSL_ERROR_CHECK_GOTO_ERROR(!gnutls_x509_crt_check_hostname(cert, svr->name)); 1065 SSL_ERROR_CHECK_GOTO_ERROR(!gnutls_x509_crt_check_hostname(cert, svr->verify_name ?: svr->name));
735 gnutls_x509_crt_deinit(cert); 1066 gnutls_x509_crt_deinit(cert);
736 DBG("SSL certificate verification succeeded!"); 1067 DBG("SSL certificate verification succeeded!");
737 return ECORE_CON_SSL_ERROR_NONE; 1068 return ECORE_CON_SSL_ERROR_NONE;
@@ -755,10 +1086,32 @@ static Eina_Bool
755_ecore_con_ssl_server_cafile_add_gnutls(Ecore_Con_Server *svr, 1086_ecore_con_ssl_server_cafile_add_gnutls(Ecore_Con_Server *svr,
756 const char *ca_file) 1087 const char *ca_file)
757{ 1088{
758 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_certificate_set_x509_trust_file(svr->cert, ca_file, 1089 struct stat st;
759 GNUTLS_X509_FMT_PEM) < 1); 1090 Eina_Iterator *it;
1091 const char *file;
1092 Eina_Bool error = EINA_FALSE;
760 1093
761 return EINA_TRUE; 1094 if (stat(ca_file, &st)) return EINA_FALSE;
1095 if (S_ISDIR(st.st_mode))
1096 {
1097 it = eina_file_ls(ca_file);
1098 SSL_ERROR_CHECK_GOTO_ERROR(!it);
1099 EINA_ITERATOR_FOREACH(it, file)
1100 {
1101 if (!error)
1102 {
1103 if (gnutls_certificate_set_x509_trust_file(svr->cert, file, GNUTLS_X509_FMT_PEM) < 1)
1104 error++;
1105 }
1106 eina_stringshare_del(file);
1107 }
1108 eina_iterator_free(it);
1109 }
1110 else
1111 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_certificate_set_x509_trust_file(svr->cert, ca_file,
1112 GNUTLS_X509_FMT_PEM) < 1);
1113
1114 return !error;
762error: 1115error:
763 ERR("Could not load CA file!"); 1116 ERR("Could not load CA file!");
764 return EINA_FALSE; 1117 return EINA_FALSE;
@@ -1026,6 +1379,7 @@ _ecore_con_ssl_client_init_gnutls(Ecore_Con_Client *cl)
1026 SSL_ERROR_CHECK_GOTO_ERROR(!(cert_list = gnutls_certificate_get_peers(cl->session, &cert_list_size))); 1379 SSL_ERROR_CHECK_GOTO_ERROR(!(cert_list = gnutls_certificate_get_peers(cl->session, &cert_list_size)));
1027 SSL_ERROR_CHECK_GOTO_ERROR(!cert_list_size); 1380 SSL_ERROR_CHECK_GOTO_ERROR(!cert_list_size);
1028 1381
1382 _gnutls_print_session(cert_list, cert_list_size);
1029/* 1383/*
1030 gnutls_x509_crt_t cert = NULL; 1384 gnutls_x509_crt_t cert = NULL;
1031 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_init(&cert)); 1385 SSL_ERROR_CHECK_GOTO_ERROR(gnutls_x509_crt_init(&cert));
@@ -1282,23 +1636,7 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr)
1282 break; 1636 break;
1283 } 1637 }
1284 1638
1285#ifdef ISCOMFITOR 1639 _openssl_print_session(svr->ssl);
1286 {
1287 /* print session info into DBG */
1288 SSL_SESSION *s;
1289 BIO *b;
1290 char log[4096];
1291
1292 memset(log, 0, sizeof(log));
1293 s = SSL_get_session(svr->ssl);
1294 b = BIO_new(BIO_s_mem());
1295 SSL_SESSION_print(b, s);
1296 while (BIO_read(b, log, sizeof(log)) > 0)
1297 DBG("%s", log);
1298
1299 BIO_free(b);
1300 }
1301#endif
1302 if ((!svr->verify) && (!svr->verify_basic)) 1640 if ((!svr->verify) && (!svr->verify_basic))
1303 /* not verifying certificates, so we're done! */ 1641 /* not verifying certificates, so we're done! */
1304 return ECORE_CON_SSL_ERROR_NONE; 1642 return ECORE_CON_SSL_ERROR_NONE;
@@ -1310,17 +1648,29 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr)
1310 cert = SSL_get_peer_certificate(svr->ssl); 1648 cert = SSL_get_peer_certificate(svr->ssl);
1311 if (cert) 1649 if (cert)
1312 { 1650 {
1313 char buf[256] = {0}; 1651 char *c;
1652 int clen;
1653 int name = 0;
1654
1314 if (svr->verify) 1655 if (svr->verify)
1315 SSL_ERROR_CHECK_GOTO_ERROR(SSL_get_verify_result(svr->ssl));
1316 X509_NAME_get_text_by_NID(X509_get_subject_name(cert), NID_subject_alt_name, buf, sizeof(buf));
1317 if (buf[0])
1318 SSL_ERROR_CHECK_GOTO_ERROR(!_openssl_name_verify(buf, svr->name));
1319 else
1320 { 1656 {
1321 X509_NAME_get_text_by_NID(X509_get_subject_name(cert), NID_commonName, buf, sizeof(buf)); 1657 int err;
1322 SSL_ERROR_CHECK_GOTO_ERROR(!_openssl_name_verify(buf, svr->name)); 1658
1659 err = SSL_get_verify_result(svr->ssl);
1660 _openssl_print_verify_error(err);
1661 SSL_ERROR_CHECK_GOTO_ERROR(err);
1323 } 1662 }
1663 clen = X509_NAME_get_text_by_NID(X509_get_subject_name(cert), NID_subject_alt_name, NULL, 0);
1664 if (clen > 0)
1665 name = NID_subject_alt_name;
1666 else
1667 clen = X509_NAME_get_text_by_NID(X509_get_subject_name(cert), NID_commonName, NULL, 0);
1668 SSL_ERROR_CHECK_GOTO_ERROR(clen < 1);
1669 if (!name) name = NID_commonName;
1670 c = alloca(++clen);
1671 X509_NAME_get_text_by_NID(X509_get_subject_name(cert), name, c, clen);
1672 INF("CERT NAME: %s\n", c);
1673 SSL_ERROR_CHECK_GOTO_ERROR(!_openssl_name_verify(c, svr->verify_name ?: svr->name));
1324 } 1674 }
1325 } 1675 }
1326 1676
@@ -1338,7 +1688,13 @@ static Eina_Bool
1338_ecore_con_ssl_server_cafile_add_openssl(Ecore_Con_Server *svr, 1688_ecore_con_ssl_server_cafile_add_openssl(Ecore_Con_Server *svr,
1339 const char *ca_file) 1689 const char *ca_file)
1340{ 1690{
1341 SSL_ERROR_CHECK_GOTO_ERROR(!SSL_CTX_load_verify_locations(svr->ssl_ctx, ca_file, NULL)); 1691 struct stat st;
1692
1693 if (stat(ca_file, &st)) return EINA_FALSE;
1694 if (S_ISDIR(st.st_mode))
1695 SSL_ERROR_CHECK_GOTO_ERROR(!SSL_CTX_load_verify_locations(svr->ssl_ctx, NULL, ca_file));
1696 else
1697 SSL_ERROR_CHECK_GOTO_ERROR(!SSL_CTX_load_verify_locations(svr->ssl_ctx, ca_file, NULL));
1342 return EINA_TRUE; 1698 return EINA_TRUE;
1343 1699
1344error: 1700error:
@@ -1543,31 +1899,20 @@ _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *cl)
1543 break; 1899 break;
1544 } 1900 }
1545 1901
1546#ifdef ISCOMFITOR 1902 _openssl_print_session(cl->ssl);
1547 {
1548 /* print session info into DBG */
1549 SSL_SESSION *s;
1550 BIO *b;
1551 char log[4096];
1552
1553 memset(log, 0, sizeof(log));
1554 s = SSL_get_session(cl->ssl);
1555 b = BIO_new(BIO_s_mem());
1556 SSL_SESSION_print(b, s);
1557 while (BIO_read(b, log, sizeof(log)) > 0)
1558 DBG("%s", log);
1559
1560 BIO_free(b);
1561 }
1562#endif
1563
1564 if (!cl->host_server->verify) 1903 if (!cl->host_server->verify)
1565 /* not verifying certificates, so we're done! */ 1904 /* not verifying certificates, so we're done! */
1566 return ECORE_CON_SSL_ERROR_NONE; 1905 return ECORE_CON_SSL_ERROR_NONE;
1567 SSL_set_verify(cl->ssl, SSL_VERIFY_PEER, NULL); 1906 SSL_set_verify(cl->ssl, SSL_VERIFY_PEER, NULL);
1568 /* use CRL/CA lists to verify */ 1907 /* use CRL/CA lists to verify */
1569 if (SSL_get_peer_certificate(cl->ssl)) 1908 if (SSL_get_peer_certificate(cl->ssl))
1570 SSL_ERROR_CHECK_GOTO_ERROR(SSL_get_verify_result(cl->ssl)); 1909 {
1910 int err;
1911
1912 err = SSL_get_verify_result(cl->ssl);
1913 _openssl_print_verify_error(err);
1914 SSL_ERROR_CHECK_GOTO_ERROR(err);
1915 }
1571 1916
1572 return ECORE_CON_SSL_ERROR_NONE; 1917 return ECORE_CON_SSL_ERROR_NONE;
1573 1918
@@ -1679,12 +2024,6 @@ _ecore_con_ssl_server_prepare_none(Ecore_Con_Server *svr __UNUSED__,
1679} 2024}
1680 2025
1681static Ecore_Con_Ssl_Error 2026static Ecore_Con_Ssl_Error
1682_ecore_con_ssl_server_upgrade_none(Ecore_Con_Server *svr __UNUSED__)
1683{
1684 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED;
1685}
1686
1687static Ecore_Con_Ssl_Error
1688_ecore_con_ssl_server_init_none(Ecore_Con_Server *svr __UNUSED__) 2027_ecore_con_ssl_server_init_none(Ecore_Con_Server *svr __UNUSED__)
1689{ 2028{
1690 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED; 2029 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED;
@@ -1741,12 +2080,6 @@ _ecore_con_ssl_server_write_none(Ecore_Con_Server *svr __UNUSED__,
1741} 2080}
1742 2081
1743static Ecore_Con_Ssl_Error 2082static Ecore_Con_Ssl_Error
1744_ecore_con_ssl_client_upgrade_none(Ecore_Con_Client *cl __UNUSED__)
1745{
1746 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED;
1747}
1748
1749static Ecore_Con_Ssl_Error
1750_ecore_con_ssl_client_init_none(Ecore_Con_Client *cl __UNUSED__) 2083_ecore_con_ssl_client_init_none(Ecore_Con_Client *cl __UNUSED__)
1751{ 2084{
1752 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED; 2085 return ECORE_CON_SSL_ERROR_NOT_SUPPORTED;
diff --git a/libraries/ecore/src/lib/ecore_con/ecore_con_url.c b/libraries/ecore/src/lib/ecore_con/ecore_con_url.c
index cfcf095..709b554 100644
--- a/libraries/ecore/src/lib/ecore_con/ecore_con_url.c
+++ b/libraries/ecore/src/lib/ecore_con/ecore_con_url.c
@@ -35,8 +35,6 @@ int ECORE_CON_EVENT_URL_COMPLETE = 0;
35int ECORE_CON_EVENT_URL_PROGRESS = 0; 35int ECORE_CON_EVENT_URL_PROGRESS = 0;
36 36
37#ifdef HAVE_CURL 37#ifdef HAVE_CURL
38static Eina_Bool _ecore_con_url_fd_handler(void *data,
39 Ecore_Fd_Handler *fd_handler);
40static Eina_Bool _ecore_con_url_perform(Ecore_Con_Url *url_con); 38static Eina_Bool _ecore_con_url_perform(Ecore_Con_Url *url_con);
41static size_t _ecore_con_url_header_cb(void *ptr, 39static size_t _ecore_con_url_header_cb(void *ptr,
42 size_t size, 40 size_t size,
@@ -57,50 +55,18 @@ static size_t _ecore_con_url_read_cb(void *ptr,
57 void *stream); 55 void *stream);
58static void _ecore_con_event_url_free(void *data __UNUSED__, 56static void _ecore_con_event_url_free(void *data __UNUSED__,
59 void *ev); 57 void *ev);
60static int _ecore_con_url_process_completed_jobs(
61 Ecore_Con_Url *url_con_to_match);
62static Eina_Bool _ecore_con_url_idler_handler(void *data); 58static Eina_Bool _ecore_con_url_idler_handler(void *data);
59static Eina_Bool _ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__);
60static Eina_Bool _ecore_con_url_timeout_cb(void *data);
63 61
64static Ecore_Idler *_fd_idler_handler = NULL;
65static Eina_List *_url_con_list = NULL; 62static Eina_List *_url_con_list = NULL;
63static Eina_List *_fd_hd_list = NULL;
66static CURLM *_curlm = NULL; 64static CURLM *_curlm = NULL;
67static fd_set _current_fd_set; 65static fd_set _current_fd_set;
68static int _init_count = 0; 66static int _init_count = 0;
69static Ecore_Timer *_curl_timeout = NULL; 67static Ecore_Timer *_curl_timeout = NULL;
70static Eina_Bool pipelining = EINA_FALSE; 68static Eina_Bool pipelining = EINA_FALSE;
71 69
72typedef struct _Ecore_Con_Url_Event Ecore_Con_Url_Event;
73struct _Ecore_Con_Url_Event
74{
75 int type;
76 void *ev;
77};
78
79static Eina_Bool
80_url_complete_idler_cb(void *data)
81{
82 Ecore_Con_Url_Event *lev;
83
84 lev = data;
85 ecore_event_add(lev->type, lev->ev, _ecore_con_event_url_free, NULL);
86 free(lev);
87
88 return ECORE_CALLBACK_CANCEL;
89}
90
91static void
92_url_complete_push_event(int type,
93 void *ev)
94{
95 Ecore_Con_Url_Event *lev;
96
97 lev = malloc(sizeof(Ecore_Con_Url_Event));
98 lev->type = type;
99 lev->ev = ev;
100
101 ecore_idler_add(_url_complete_idler_cb, lev);
102}
103
104#endif 70#endif
105 71
106/** 72/**
@@ -113,51 +79,30 @@ EAPI int
113ecore_con_url_init(void) 79ecore_con_url_init(void)
114{ 80{
115#ifdef HAVE_CURL 81#ifdef HAVE_CURL
116 _init_count++; 82 if (++_init_count > 1) return _init_count;
117
118 if (_init_count > 1)
119 return _init_count;
120 83
121 if (!ECORE_CON_EVENT_URL_DATA) 84 if (!ECORE_CON_EVENT_URL_DATA) ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
122 { 85 if (!ECORE_CON_EVENT_URL_COMPLETE) ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
123 ECORE_CON_EVENT_URL_DATA = ecore_event_type_new(); 86 if (!ECORE_CON_EVENT_URL_PROGRESS) ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
124 ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
125 ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
126 }
127 87
128 if (!_curlm) 88 if (!_curlm)
129 { 89 {
130 long ms; 90 long ms;
131 91
132 FD_ZERO(&_current_fd_set); 92 // curl_global_init() is not thread safe!
133 if (curl_global_init(CURL_GLOBAL_ALL)) 93 if (curl_global_init(CURL_GLOBAL_ALL)) return --_init_count;
134 {
135 while (_url_con_list)
136 ecore_con_url_free(eina_list_data_get(_url_con_list));
137 return 0;
138 }
139 94
140 _curlm = curl_multi_init(); 95 _curlm = curl_multi_init();
141 if (!_curlm) 96 if (!_curlm) return --_init_count;
142 {
143 while (_url_con_list)
144 ecore_con_url_free(eina_list_data_get(_url_con_list));
145
146 _init_count--;
147 return 0;
148 }
149 97
150 curl_multi_timeout(_curlm, &ms); 98 curl_multi_timeout(_curlm, &ms);
151 if (ms <= 0) 99 if (ms <= 0) ms = 100;
152 ms = 1000;
153 100
154 _curl_timeout = 101 _curl_timeout = ecore_timer_add((double)ms / 1000, _ecore_con_url_idler_handler, (void *)0xACE);
155 ecore_timer_add((double)ms / 1000, _ecore_con_url_idler_handler,
156 (void *)0xACE);
157 ecore_timer_freeze(_curl_timeout); 102 ecore_timer_freeze(_curl_timeout);
158 } 103 }
159 104
160 return 1; 105 return _init_count;
161#else 106#else
162 return 0; 107 return 0;
163#endif 108#endif
@@ -167,34 +112,31 @@ EAPI int
167ecore_con_url_shutdown(void) 112ecore_con_url_shutdown(void)
168{ 113{
169#ifdef HAVE_CURL 114#ifdef HAVE_CURL
170 if (!_init_count) 115 if (_init_count == 0) return 0;
171 return 0;
172
173 _init_count--;
174 116
175 if (_init_count != 0) 117 if (--_init_count == 0)
176 return _init_count; 118 {
177 119 Ecore_Con_Url *con_url;
178 if (_fd_idler_handler) 120 Ecore_Fd_Handler *fd_handler;
179 ecore_idler_del(_fd_idler_handler);
180
181 _fd_idler_handler = NULL;
182
183 if (_curl_timeout)
184 ecore_timer_del(_curl_timeout);
185
186 _curl_timeout = NULL;
187 121
188 while (_url_con_list) 122 if (_curl_timeout)
189 ecore_con_url_free(eina_list_data_get(_url_con_list)); 123 {
124 ecore_timer_del(_curl_timeout);
125 _curl_timeout = NULL;
126 }
190 127
191 if (_curlm) 128 FD_ZERO(&_current_fd_set);
192 { 129 EINA_LIST_FREE(_url_con_list, con_url) ecore_con_url_free(con_url);
193 curl_multi_cleanup(_curlm); 130 EINA_LIST_FREE(_fd_hd_list, fd_handler) ecore_main_fd_handler_del(fd_handler);
194 _curlm = NULL;
195 }
196 131
197 curl_global_cleanup(); 132 if (_curlm)
133 {
134 curl_multi_cleanup(_curlm);
135 _curlm = NULL;
136 }
137 curl_global_cleanup();
138 }
139 return _init_count;
198#endif 140#endif
199 return 1; 141 return 1;
200} 142}
@@ -237,7 +179,6 @@ ecore_con_url_new(const char *url)
237 if (!url_con) 179 if (!url_con)
238 return NULL; 180 return NULL;
239 181
240 url_con->fd = -1;
241 url_con->write_fd = -1; 182 url_con->write_fd = -1;
242 183
243 url_con->curl_easy = curl_easy_init(); 184 url_con->curl_easy = curl_easy_init();
@@ -255,6 +196,24 @@ ecore_con_url_new(const char *url)
255 return NULL; 196 return NULL;
256 } 197 }
257 198
199 url_con->proxy_type = -1;
200 if (_ecore_con_proxy_global)
201 {
202 if (_ecore_con_proxy_global->ip)
203 {
204 char host[128];
205 if (_ecore_con_proxy_global->port > 0 &&
206 _ecore_con_proxy_global->port <= 65535)
207 snprintf(host, sizeof(host), "socks4://%s:%d",
208 _ecore_con_proxy_global->ip,
209 _ecore_con_proxy_global->port);
210 else
211 snprintf(host, sizeof(host), "socks4://%s",
212 _ecore_con_proxy_global->ip);
213 ecore_con_url_proxy_set(url_con, host);
214 }
215 }
216
258 ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_ENCODING, "gzip,deflate"); 217 ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_ENCODING, "gzip,deflate");
259 if (ret != CURLE_OK) 218 if (ret != CURLE_OK)
260 { 219 {
@@ -344,43 +303,30 @@ ecore_con_url_free(Ecore_Con_Url *url_con)
344 } 303 }
345 304
346 ECORE_MAGIC_SET(url_con, ECORE_MAGIC_NONE); 305 ECORE_MAGIC_SET(url_con, ECORE_MAGIC_NONE);
347 if(url_con->fd != -1)
348 {
349 FD_CLR(url_con->fd, &_current_fd_set);
350 if (url_con->fd_handler)
351 ecore_main_fd_handler_del(url_con->fd_handler);
352
353 url_con->fd = -1;
354 url_con->fd_handler = NULL;
355 }
356 306
357 if (url_con->curl_easy) 307 if (url_con->curl_easy)
358 { 308 {
359 // FIXME: For an unknown reason, progress continue to arrive after destruction
360 // this prevent any further call to the callback.
361 curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL); 309 curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL);
362 curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_TRUE); 310 curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_TRUE);
363 311
364 if (url_con->active) 312 if (eina_list_data_find(_url_con_list, url_con))
365 { 313 {
366 url_con->active = EINA_FALSE;
367
368 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy); 314 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
369 if (ret != CURLM_OK) 315 if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
370 ERR("curl_multi_remove_handle failed: %s", 316 _url_con_list = eina_list_remove(_url_con_list, url_con);
371 curl_multi_strerror(ret));
372 } 317 }
373 318
374 curl_easy_cleanup(url_con->curl_easy); 319 curl_easy_cleanup(url_con->curl_easy);
375 } 320 }
321 if (url_con->timer) ecore_timer_del(url_con->timer);
376 322
377 _url_con_list = eina_list_remove(_url_con_list, url_con);
378 curl_slist_free_all(url_con->headers); 323 curl_slist_free_all(url_con->headers);
379 EINA_LIST_FREE(url_con->additional_headers, s) 324 EINA_LIST_FREE(url_con->additional_headers, s)
380 free(s); 325 free(s);
381 EINA_LIST_FREE(url_con->response_headers, s) 326 EINA_LIST_FREE(url_con->response_headers, s)
382 free(s); 327 free(s);
383 eina_stringshare_del(url_con->url); 328 eina_stringshare_del(url_con->url);
329 if (url_con->post_data) free(url_con->post_data);
384 free(url_con); 330 free(url_con);
385#else 331#else
386 return; 332 return;
@@ -415,8 +361,7 @@ ecore_con_url_url_set(Ecore_Con_Url *url_con,
415 return EINA_FALSE; 361 return EINA_FALSE;
416 } 362 }
417 363
418 if (url_con->active) 364 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
419 return EINA_FALSE;
420 365
421 eina_stringshare_replace(&url_con->url, url); 366 eina_stringshare_replace(&url_con->url, url);
422 367
@@ -660,7 +605,7 @@ _ecore_con_url_send(Ecore_Con_Url *url_con,
660#ifdef HAVE_CURL 605#ifdef HAVE_CURL
661 Eina_List *l; 606 Eina_List *l;
662 const char *s; 607 const char *s;
663 char tmp[256]; 608 char tmp[512];
664 609
665 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) 610 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
666 { 611 {
@@ -668,8 +613,7 @@ _ecore_con_url_send(Ecore_Con_Url *url_con,
668 return EINA_FALSE; 613 return EINA_FALSE;
669 } 614 }
670 615
671 if (url_con->active) 616 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
672 return EINA_FALSE;
673 617
674 if (!url_con->url) 618 if (!url_con->url)
675 return EINA_FALSE; 619 return EINA_FALSE;
@@ -684,16 +628,24 @@ _ecore_con_url_send(Ecore_Con_Url *url_con,
684 628
685 if ((mode == MODE_POST) || (mode == MODE_AUTO)) 629 if ((mode == MODE_POST) || (mode == MODE_AUTO))
686 { 630 {
687 if (data) 631 if (url_con->post_data) free(url_con->post_data);
632 url_con->post_data = NULL;
633 if ((data) && (length > 0))
688 { 634 {
689 if ((content_type) && (strlen(content_type) < 200)) 635 url_con->post_data = malloc(length);
636 if (url_con->post_data)
690 { 637 {
691 snprintf(tmp, sizeof(tmp), "Content-Type: %s", content_type); 638 memcpy(url_con->post_data, data, length);
692 url_con->headers = curl_slist_append(url_con->headers, tmp); 639 if ((content_type) && (strlen(content_type) < 450))
640 {
641 snprintf(tmp, sizeof(tmp), "Content-Type: %s", content_type);
642 url_con->headers = curl_slist_append(url_con->headers, tmp);
643 }
644 curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, url_con->post_data);
645 curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length);
693 } 646 }
694 647 else
695 curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, data); 648 return EINA_FALSE;
696 curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length);
697 } 649 }
698 else curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, 0); 650 else curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, 0);
699 if (mode == MODE_POST) 651 if (mode == MODE_POST)
@@ -787,8 +739,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
787 return EINA_FALSE; 739 return EINA_FALSE;
788 } 740 }
789 741
790 if (url_con->active) 742 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
791 return EINA_FALSE;
792 743
793 if (!url_con->url) 744 if (!url_con->url)
794 return EINA_FALSE; 745 return EINA_FALSE;
@@ -1021,8 +972,7 @@ ecore_con_url_verbose_set(Ecore_Con_Url *url_con,
1021 return; 972 return;
1022 } 973 }
1023 974
1024 if (url_con->active) 975 if (eina_list_data_find(_url_con_list, url_con)) return;
1025 return;
1026 976
1027 if (!url_con->url) 977 if (!url_con->url)
1028 return; 978 return;
@@ -1047,8 +997,7 @@ ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con,
1047 return; 997 return;
1048 } 998 }
1049 999
1050 if (url_con->active) 1000 if (eina_list_data_find(_url_con_list, url_con)) return;
1051 return;
1052 1001
1053 if (!url_con->url) 1002 if (!url_con->url)
1054 return; 1003 return;
@@ -1085,8 +1034,7 @@ ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con,
1085 return; 1034 return;
1086 } 1035 }
1087 1036
1088 if (url_con->active) 1037 if (eina_list_data_find(_url_con_list, url_con)) return;
1089 return;
1090 1038
1091 if (!url_con->url) 1039 if (!url_con->url)
1092 return; 1040 return;
@@ -1129,7 +1077,7 @@ ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, const char *ca_path)
1129 return -1; 1077 return -1;
1130 } 1078 }
1131 1079
1132 if (url_con->active) return -1; 1080 if (eina_list_data_find(_url_con_list, url_con)) return -1;
1133 if (!url_con->url) return -1; 1081 if (!url_con->url) return -1;
1134 if (ca_path == NULL) 1082 if (ca_path == NULL)
1135 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, 0); 1083 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, 0);
@@ -1148,58 +1096,180 @@ ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, const char *ca_path)
1148 return res; 1096 return res;
1149} 1097}
1150 1098
1151 1099EAPI Eina_Bool
1152/** 1100ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char *proxy)
1153 * @}
1154 */
1155
1156#ifdef HAVE_CURL
1157static int
1158_ecore_con_url_suspend_fd_handler(void)
1159{ 1101{
1160 Eina_List *l; 1102#ifdef HAVE_CURL
1161 Ecore_Con_Url *url_con; 1103 int res = -1;
1162 int deleted = 0; 1104 curl_version_info_data *vers = NULL;
1163 1105
1164 if (!_url_con_list) 1106 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
1165 return 0; 1107 {
1108 ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_proxy_set");
1109 return EINA_FALSE;
1110 }
1166 1111
1167 EINA_LIST_FOREACH(_url_con_list, l, url_con) 1112 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
1113 if (!url_con->url) return EINA_FALSE;
1114
1115 if (!proxy) res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXY, "");
1116 else
1168 { 1117 {
1169 if (url_con->active && url_con->fd_handler) 1118 // before curl version 7.21.7, socks protocol:// prefix is not supported
1119 // (e.g. socks4://, socks4a://, socks5:// or socks5h://, etc.)
1120 vers = curl_version_info(CURLVERSION_NOW);
1121 if (vers->version_num < 0x71507)
1170 { 1122 {
1171 ecore_main_fd_handler_del(url_con->fd_handler); 1123 url_con->proxy_type = CURLPROXY_HTTP;
1172 url_con->fd_handler = NULL; 1124 if (strstr(proxy, "socks4")) url_con->proxy_type = CURLPROXY_SOCKS4;
1173 deleted++; 1125 else if (strstr(proxy, "socks4a")) url_con->proxy_type = CURLPROXY_SOCKS4A;
1126 else if (strstr(proxy, "socks5")) url_con->proxy_type = CURLPROXY_SOCKS5;
1127 else if (strstr(proxy, "socks5h")) url_con->proxy_type = CURLPROXY_SOCKS5_HOSTNAME;
1128 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXYTYPE, url_con->proxy_type);
1129 if (res != CURLE_OK)
1130 {
1131 ERR("curl proxy type setting failed: %s", curl_easy_strerror(res));
1132 url_con->proxy_type = -1;
1133 return EINA_FALSE;
1134 }
1174 } 1135 }
1136 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXY, proxy);
1137 }
1138 if (res != CURLE_OK)
1139 {
1140 ERR("curl proxy setting failed: %s", curl_easy_strerror(res));
1141 url_con->proxy_type = -1;
1142 return EINA_FALSE;
1143 }
1144 return EINA_TRUE;
1145#else
1146 return EINA_FALSE;
1147 (void)url_con;
1148 (void)proxy;
1149#endif
1150}
1151
1152EAPI void
1153ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout)
1154{
1155#ifdef HAVE_CURL
1156 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
1157 {
1158 ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_timeout_set");
1159 return;
1175 } 1160 }
1176 1161
1177 return deleted; 1162 if (eina_list_data_find(_url_con_list, url_con)) return;
1163 if (!url_con->url || timeout < 0) return;
1164 if (url_con->timer) ecore_timer_del(url_con->timer);
1165 url_con->timer = ecore_timer_add(timeout, _ecore_con_url_timeout_cb, url_con);
1166#else
1167 return;
1168 (void)url_con;
1169 (void)timeout;
1170#endif
1178} 1171}
1179 1172
1180static int 1173EAPI Eina_Bool
1181_ecore_con_url_restart_fd_handler(void) 1174ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, const char *username)
1182{ 1175{
1183 Eina_List *l; 1176#ifdef HAVE_CURL
1184 Ecore_Con_Url *url_con; 1177 int res = -1;
1185 int activated = 0; 1178 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
1179 {
1180 ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_proxy_username_set");
1181 return EINA_FALSE;
1182 }
1186 1183
1187 if (!_url_con_list) 1184 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
1188 return 0; 1185 if (!url_con->url) return EINA_FALSE;
1186 if (!username) return EINA_FALSE;
1187 if (url_con->proxy_type == CURLPROXY_SOCKS4 || url_con->proxy_type == CURLPROXY_SOCKS4A)
1188 {
1189 ERR("Proxy type should be socks5 and above");
1190 return EINA_FALSE;
1191 }
1189 1192
1190 EINA_LIST_FOREACH(_url_con_list, l, url_con) 1193 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_USERNAME, username);
1194 if (res != CURLE_OK)
1191 { 1195 {
1192 if (!url_con->fd_handler && url_con->fd != -1) 1196 ERR("curl_easy_setopt() failed: %s", curl_easy_strerror(res));
1193 { 1197 return EINA_FALSE;
1194 url_con->fd_handler = 1198 }
1195 ecore_main_fd_handler_add(url_con->fd, url_con->flags, 1199 return EINA_TRUE;
1196 _ecore_con_url_fd_handler, 1200#else
1197 NULL, NULL, NULL); 1201 return EINA_FALSE;
1198 activated++; 1202 (void)url_con;
1199 } 1203 (void)username;
1204#endif
1205}
1206
1207EAPI Eina_Bool
1208ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password)
1209{
1210#ifdef HAVE_CURL
1211 int res = -1;
1212 if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
1213 {
1214 ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_proxy_password_set");
1215 return EINA_FALSE;
1216 }
1217 if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
1218 if (!url_con->url) return EINA_FALSE;
1219 if (!password) return EINA_FALSE;
1220 if (url_con->proxy_type == CURLPROXY_SOCKS4 || url_con->proxy_type == CURLPROXY_SOCKS4A)
1221 {
1222 ERR("Proxy type should be socks5 and above");
1223 return EINA_FALSE;
1224 }
1225
1226 res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PASSWORD, password);
1227 if (res != CURLE_OK)
1228 {
1229 ERR("curl_easy_setopt() failed: %s", curl_easy_strerror(res));
1230 return EINA_FALSE;
1200 } 1231 }
1232 return EINA_TRUE;
1233#else
1234 return EINA_FALSE;
1235 (void)url_con;
1236 (void)password;
1237#endif
1238}
1239
1240/**
1241 * @}
1242 */
1201 1243
1202 return activated; 1244#ifdef HAVE_CURL
1245static Eina_Bool
1246_ecore_con_url_timeout_cb(void *data)
1247{
1248 Ecore_Con_Url *url_con = data;
1249 CURLMcode ret;
1250 Ecore_Con_Event_Url_Complete *e;
1251
1252 if (!url_con) return ECORE_CALLBACK_CANCEL;
1253 if (!url_con->curl_easy) return ECORE_CALLBACK_CANCEL;
1254 if (!eina_list_data_find(_url_con_list, url_con)) return ECORE_CALLBACK_CANCEL;
1255
1256 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
1257 if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
1258 _url_con_list = eina_list_remove(_url_con_list, url_con);
1259
1260 curl_slist_free_all(url_con->headers);
1261 url_con->headers = NULL;
1262
1263 url_con->timer = NULL;
1264
1265 e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
1266 if (e)
1267 {
1268 e->url_con = url_con;
1269 e->status = 0;
1270 ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
1271 }
1272 return ECORE_CALLBACK_CANCEL;
1203} 1273}
1204 1274
1205static size_t 1275static size_t
@@ -1235,8 +1305,7 @@ _ecore_con_url_data_cb(void *buffer,
1235 e->url_con = url_con; 1305 e->url_con = url_con;
1236 e->size = real_size; 1306 e->size = real_size;
1237 memcpy(e->data, buffer, real_size); 1307 memcpy(e->data, buffer, real_size);
1238 ecore_event_add(ECORE_CON_EVENT_URL_DATA, e, 1308 ecore_event_add(ECORE_CON_EVENT_URL_DATA, e, _ecore_con_event_url_free, NULL);
1239 _ecore_con_event_url_free, NULL);
1240 } 1309 }
1241 } 1310 }
1242 else 1311 else
@@ -1266,22 +1335,6 @@ _ecore_con_url_data_cb(void *buffer,
1266 return real_size; 1335 return real_size;
1267} 1336}
1268 1337
1269#define ECORE_CON_URL_TRANSMISSION(Transmit, Event, Url_con, Total, Now) \
1270 { \
1271 Ecore_Con_Event_Url_Progress *e; \
1272 if ((Total != 0) || (Now != 0)) \
1273 { \
1274 e = calloc(1, sizeof(Ecore_Con_Event_Url_Progress)); \
1275 if (e) \
1276 { \
1277 e->url_con = url_con; \
1278 e->total = Total; \
1279 e->now = Now; \
1280 ecore_event_add(Event, e, _ecore_con_event_url_free, NULL); \
1281 } \
1282 } \
1283 }
1284
1285static size_t 1338static size_t
1286_ecore_con_url_header_cb(void *ptr, 1339_ecore_con_url_header_cb(void *ptr,
1287 size_t size, 1340 size_t size,
@@ -1324,8 +1377,7 @@ _ecore_con_url_progress_cb(void *clientp,
1324 e->down.now = dlnow; 1377 e->down.now = dlnow;
1325 e->up.total = ultotal; 1378 e->up.total = ultotal;
1326 e->up.now = ulnow; 1379 e->up.now = ulnow;
1327 ecore_event_add(ECORE_CON_EVENT_URL_PROGRESS, e, 1380 ecore_event_add(ECORE_CON_EVENT_URL_PROGRESS, e, _ecore_con_event_url_free, NULL);
1328 _ecore_con_event_url_free, NULL);
1329 } 1381 }
1330 1382
1331 return 0; 1383 return 0;
@@ -1358,208 +1410,196 @@ _ecore_con_url_read_cb(void *ptr,
1358 return retcode; 1410 return retcode;
1359} 1411}
1360 1412
1361static Eina_Bool 1413static void
1362_ecore_con_url_perform(Ecore_Con_Url *url_con) 1414_ecore_con_url_info_read(void)
1363{ 1415{
1364 fd_set read_set, write_set, exc_set; 1416 CURLMsg *curlmsg;
1365 int fd_max, fd; 1417 int n_remaining;
1366 int flags, still_running;
1367 int completed_immediately = 0;
1368 CURLMcode ret;
1369
1370 _url_con_list = eina_list_append(_url_con_list, url_con);
1371
1372 url_con->active = EINA_TRUE;
1373 curl_multi_add_handle(_curlm, url_con->curl_easy);
1374 curl_multi_perform(_curlm, &still_running);
1375
1376 completed_immediately = _ecore_con_url_process_completed_jobs(url_con);
1377 1418
1378 if (!completed_immediately) 1419 while ((curlmsg = curl_multi_info_read(_curlm, &n_remaining)))
1379 { 1420 {
1380 if (url_con->fd_handler) 1421 if (curlmsg->msg == CURLMSG_DONE)
1381 ecore_main_fd_handler_del(url_con->fd_handler);
1382
1383 url_con->fd_handler = NULL;
1384
1385 /* url_con still active -- set up an fd_handler */
1386 FD_ZERO(&read_set);
1387 FD_ZERO(&write_set);
1388 FD_ZERO(&exc_set);
1389
1390 /* Stupid curl, why can't I get the fd to the current added job? */
1391 ret = curl_multi_fdset(_curlm, &read_set, &write_set, &exc_set,
1392 &fd_max);
1393 if (ret != CURLM_OK)
1394 { 1422 {
1395 ERR("curl_multi_fdset failed: %s", curl_multi_strerror(ret)); 1423 Eina_List *l, *ll;
1396 return EINA_FALSE; 1424 Ecore_Con_Url *url_con;
1397 }
1398 1425
1399 for (fd = 0; fd <= fd_max; fd++) 1426 EINA_LIST_FOREACH_SAFE(_url_con_list, l, ll, url_con)
1400 {
1401 if (!FD_ISSET(fd, &_current_fd_set))
1402 { 1427 {
1403 flags = 0; 1428 if (curlmsg->easy_handle == url_con->curl_easy)
1404 if (FD_ISSET(fd, &read_set)) 1429 {
1405 flags |= ECORE_FD_READ; 1430 CURLMcode ret;
1406 1431 Ecore_Con_Event_Url_Complete *e;
1407 if (FD_ISSET(fd, &write_set))
1408 flags |= ECORE_FD_WRITE;
1409 1432
1410 if (FD_ISSET(fd, &exc_set)) 1433 e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
1411 flags |= ECORE_FD_ERROR; 1434 if (e)
1435 {
1436 e->url_con = url_con;
1437 e->status = 0;
1438 if (curlmsg->data.result == CURLE_OK)
1439 {
1440 long status; /* curl API uses long, not int */
1441 status = 0;
1442 curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &status);
1443 e->status = status;
1444 }
1445 ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
1446 }
1412 1447
1413 if (flags) 1448 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
1414 { 1449 if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
1415 long ms = 0; 1450 _url_con_list = eina_list_remove(_url_con_list, url_con);
1416
1417 ret = curl_multi_timeout(_curlm, &ms);
1418 if (ret != CURLM_OK)
1419 ERR("curl_multi_timeout failed: %s",
1420 curl_multi_strerror(ret));
1421
1422 if (ms == 0)
1423 ms = 1000;
1424
1425 FD_SET(fd, &_current_fd_set);
1426 url_con->fd = fd;
1427 url_con->flags = flags;
1428 url_con->fd_handler =
1429 ecore_main_fd_handler_add(fd, flags,
1430 _ecore_con_url_fd_handler,
1431 NULL, NULL, NULL);
1432 break; 1451 break;
1433 } 1452 }
1434 } 1453 }
1435 } 1454 }
1436 if (!url_con->fd_handler)
1437 {
1438 /* Failed to set up an fd_handler */
1439 ecore_timer_freeze(_curl_timeout);
1440
1441 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
1442 if (ret != CURLM_OK)
1443 ERR("curl_multi_remove_handle failed: %s",
1444 curl_multi_strerror(ret));
1445
1446 url_con->active = EINA_FALSE;
1447 url_con->fd = -1;
1448 return EINA_FALSE;
1449 }
1450
1451 ecore_timer_thaw(_curl_timeout);
1452 } 1455 }
1453
1454 return EINA_TRUE;
1455} 1456}
1456 1457
1457static Eina_Bool 1458static void
1458_ecore_con_url_idler_handler(void *data) 1459_ecore_con_url_curl_clear(void)
1459{ 1460{
1460 int done, still_running; 1461 Ecore_Con_Url *url_con;
1461
1462 done = (curl_multi_perform(_curlm, &still_running) != CURLM_CALL_MULTI_PERFORM);
1463
1464 _ecore_con_url_process_completed_jobs(NULL);
1465 1462
1466 if (done) 1463 FD_ZERO(&_current_fd_set);
1464 if (_fd_hd_list)
1467 { 1465 {
1468 _ecore_con_url_restart_fd_handler(); 1466 Ecore_Fd_Handler *fd_handler;
1469 _fd_idler_handler = NULL; 1467 EINA_LIST_FREE(_fd_hd_list, fd_handler)
1468 {
1469 int fd = ecore_main_fd_handler_fd_get(fd_handler);
1470 FD_CLR(fd, &_current_fd_set);
1471 // FIXME: ecore_main_fd_handler_del() sometimes give errors
1472 // because curl do not make fd itself controlled by users, but it can be ignored.
1473 ecore_main_fd_handler_del(fd_handler);
1474 }
1475 }
1470 1476
1471 if (!_url_con_list) 1477 EINA_LIST_FREE(_url_con_list, url_con)
1472 ecore_timer_freeze(_curl_timeout); 1478 {
1479 CURLMcode ret;
1480 Ecore_Con_Event_Url_Complete *e;
1473 1481
1474 return data == 1482 e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
1475 (void *)0xACE ? ECORE_CALLBACK_RENEW : ECORE_CALLBACK_CANCEL; 1483 if (e)
1484 {
1485 e->url_con = url_con;
1486 e->status = 0;
1487 ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
1488 }
1489 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
1490 if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
1476 } 1491 }
1477
1478 return ECORE_CALLBACK_RENEW;
1479} 1492}
1480 1493
1481static Eina_Bool 1494static Eina_Bool
1482_ecore_con_url_fd_handler(void *data __UNUSED__, 1495_ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
1483 Ecore_Fd_Handler *fd_handler __UNUSED__)
1484{ 1496{
1485 _ecore_con_url_suspend_fd_handler(); 1497 if (_fd_hd_list)
1486 1498 {
1487 if (!_fd_idler_handler) 1499 Ecore_Fd_Handler *fd_handler;
1488 _fd_idler_handler = ecore_idler_add( 1500 EINA_LIST_FREE(_fd_hd_list, fd_handler)
1489 _ecore_con_url_idler_handler, NULL); 1501 {
1490 1502 int fd = ecore_main_fd_handler_fd_get(fd_handler);
1503 FD_CLR(fd, &_current_fd_set);
1504 // FIXME: ecore_main_fd_handler_del() sometimes give errors
1505 // because curl do not make fd itself controlled by users, but it can be ignored.
1506 ecore_main_fd_handler_del(fd_handler);
1507 }
1508 }
1509 ecore_timer_thaw(_curl_timeout);
1491 return ECORE_CALLBACK_RENEW; 1510 return ECORE_CALLBACK_RENEW;
1492} 1511}
1493 1512
1494static int 1513static void
1495_ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match) 1514_ecore_con_url_fdset(void)
1496{ 1515{
1497 Eina_List *l;
1498 Ecore_Con_Url *url_con;
1499 Ecore_Con_Event_Url_Complete *e;
1500 CURLMsg *curlmsg;
1501 CURLMcode ret; 1516 CURLMcode ret;
1502 int n_remaining; 1517 fd_set read_set, write_set, exc_set;
1503 int job_matched = 0; 1518 int fd, fd_max;
1519 Ecore_Fd_Handler *fd_handler;
1504 1520
1505 /* Loop jobs and check if any are done */ 1521 FD_ZERO(&read_set);
1506 while ((curlmsg = curl_multi_info_read(_curlm, &n_remaining))) 1522 FD_ZERO(&write_set);
1523 FD_ZERO(&exc_set);
1524
1525 ret = curl_multi_fdset(_curlm, &read_set, &write_set, &exc_set, &fd_max);
1526 if (ret != CURLM_OK)
1507 { 1527 {
1508 if (curlmsg->msg != CURLMSG_DONE) 1528 ERR("curl_multi_fdset failed: %s", curl_multi_strerror(ret));
1509 continue; 1529 return;
1530 }
1510 1531
1511 /* find the job which is done */ 1532 for (fd = 0; fd <= fd_max; fd++)
1512 EINA_LIST_FOREACH(_url_con_list, l, url_con) 1533 {
1534 int flags = 0;
1535 if (FD_ISSET(fd, &read_set)) flags |= ECORE_FD_READ;
1536 if (FD_ISSET(fd, &write_set)) flags |= ECORE_FD_WRITE;
1537 if (FD_ISSET(fd, &exc_set)) flags |= ECORE_FD_ERROR;
1538 if (flags)
1513 { 1539 {
1514 if (curlmsg->easy_handle == url_con->curl_easy) 1540 if (!FD_ISSET(fd, &_current_fd_set))
1515 { 1541 {
1516 if (url_con_to_match && 1542 FD_SET(fd, &_current_fd_set);
1517 (url_con == url_con_to_match)) 1543 fd_handler = ecore_main_fd_handler_add(fd, flags, _ecore_con_url_fd_handler, NULL, NULL, NULL);
1518 job_matched = 1; 1544 if (fd_handler) _fd_hd_list = eina_list_append(_fd_hd_list, fd_handler);
1519 1545 ecore_timer_freeze(_curl_timeout);
1520 if(url_con->fd != -1) 1546 }
1521 { 1547 }
1522 FD_CLR(url_con->fd, &_current_fd_set); 1548 }
1523 if (url_con->fd_handler) 1549}
1524 ecore_main_fd_handler_del(
1525 url_con->fd_handler);
1526 1550
1527 url_con->fd = -1; 1551static Eina_Bool
1528 url_con->fd_handler = NULL; 1552_ecore_con_url_idler_handler(void *data __UNUSED__)
1529 } 1553{
1554 int still_running;
1555 CURLMcode ret;
1530 1556
1531 _url_con_list = eina_list_remove(_url_con_list, url_con); 1557 ret = curl_multi_perform(_curlm, &still_running);
1532 url_con->active = EINA_FALSE; 1558 if (ret == CURLM_CALL_MULTI_PERFORM)
1533 e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete)); 1559 {
1534 if (e) 1560 DBG("Call multiperform again");
1535 { 1561 return ECORE_CALLBACK_RENEW;
1536 e->url_con = url_con; 1562 }
1537 e->status = 0; 1563 else if (ret != CURLM_OK)
1538 if (curlmsg->data.result == CURLE_OK) 1564 {
1539 { 1565 ERR("curl_multi_perform() failed: %s", curl_multi_strerror(ret));
1540 long status; /* curl API uses long, not int */ 1566 _ecore_con_url_curl_clear();
1567 ecore_timer_freeze(_curl_timeout);
1568 return ECORE_CALLBACK_RENEW;
1569 }
1541 1570
1542 status = 0; 1571 _ecore_con_url_info_read();
1543 curl_easy_getinfo(curlmsg->easy_handle, 1572 if (still_running)
1544 CURLINFO_RESPONSE_CODE, 1573 {
1545 &status); 1574 DBG("multiperform is still_running");
1546 e->status = status; 1575 _ecore_con_url_fdset();
1547 } 1576 }
1577 else
1578 {
1579 DBG("multiperform ended");
1580 _ecore_con_url_curl_clear();
1581 ecore_timer_freeze(_curl_timeout);
1582 }
1548 1583
1549 _url_complete_push_event(ECORE_CON_EVENT_URL_COMPLETE, e); 1584 return ECORE_CALLBACK_RENEW;
1550 } 1585}
1551 1586
1552 ret = curl_multi_remove_handle(_curlm, url_con->curl_easy); 1587static Eina_Bool
1553 if (ret != CURLM_OK) 1588_ecore_con_url_perform(Ecore_Con_Url *url_con)
1554 ERR("curl_multi_remove_handle failed: %s", 1589{
1555 curl_multi_strerror(ret)); 1590 CURLMcode ret;
1556 1591
1557 break; 1592 ret = curl_multi_add_handle(_curlm, url_con->curl_easy);
1558 } 1593 if (ret != CURLM_OK)
1559 } 1594 {
1595 ERR("curl_multi_add_handle() failed: %s", curl_multi_strerror(ret));
1596 return EINA_FALSE;
1560 } 1597 }
1561 1598
1562 return job_matched; 1599 _url_con_list = eina_list_append(_url_con_list, url_con);
1600 ecore_timer_thaw(_curl_timeout);
1601
1602 return EINA_TRUE;
1563} 1603}
1564 1604
1565static void 1605static void
diff --git a/libraries/ecore/src/lib/ecore_config/Makefile.in b/libraries/ecore/src/lib/ecore_config/Makefile.in
index 1732a34..6870d44 100644
--- a/libraries/ecore/src/lib/ecore_config/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_config/Makefile.in
@@ -260,10 +260,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
260PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 260PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
261PIXMAN_LIBS = @PIXMAN_LIBS@ 261PIXMAN_LIBS = @PIXMAN_LIBS@
262PKG_CONFIG = @PKG_CONFIG@ 262PKG_CONFIG = @PKG_CONFIG@
263PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
264PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
265POSUB = @POSUB@ 263POSUB = @POSUB@
266RANLIB = @RANLIB@ 264RANLIB = @RANLIB@
265SCIM_CFLAGS = @SCIM_CFLAGS@
266SCIM_LIBS = @SCIM_LIBS@
267SDL_CFLAGS = @SDL_CFLAGS@ 267SDL_CFLAGS = @SDL_CFLAGS@
268SDL_CONFIG = @SDL_CONFIG@ 268SDL_CONFIG = @SDL_CONFIG@
269SDL_LIBS = @SDL_LIBS@ 269SDL_LIBS = @SDL_LIBS@
@@ -282,6 +282,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
282USE_NLS = @USE_NLS@ 282USE_NLS = @USE_NLS@
283VERSION = @VERSION@ 283VERSION = @VERSION@
284VMAJ = @VMAJ@ 284VMAJ = @VMAJ@
285WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
286WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
287WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
288WAYLAND_LIBS = @WAYLAND_LIBS@
285WIN32_CFLAGS = @WIN32_CFLAGS@ 289WIN32_CFLAGS = @WIN32_CFLAGS@
286WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 290WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
287WIN32_LIBS = @WIN32_LIBS@ 291WIN32_LIBS = @WIN32_LIBS@
@@ -395,6 +399,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
395ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 399ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
396ecore_imf_evas_libs = @ecore_imf_evas_libs@ 400ecore_imf_evas_libs = @ecore_imf_evas_libs@
397ecore_imf_libs = @ecore_imf_libs@ 401ecore_imf_libs = @ecore_imf_libs@
402ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
403ecore_imf_scim_libs = @ecore_imf_scim_libs@
398ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 404ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
399ecore_imf_xim_libs = @ecore_imf_xim_libs@ 405ecore_imf_xim_libs = @ecore_imf_xim_libs@
400ecore_input_cflags = @ecore_input_cflags@ 406ecore_input_cflags = @ecore_input_cflags@
@@ -407,6 +413,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
407ecore_psl1ght_libs = @ecore_psl1ght_libs@ 413ecore_psl1ght_libs = @ecore_psl1ght_libs@
408ecore_sdl_cflags = @ecore_sdl_cflags@ 414ecore_sdl_cflags = @ecore_sdl_cflags@
409ecore_sdl_libs = @ecore_sdl_libs@ 415ecore_sdl_libs = @ecore_sdl_libs@
416ecore_wayland_cflags = @ecore_wayland_cflags@
417ecore_wayland_libs = @ecore_wayland_libs@
410ecore_win32_cflags = @ecore_win32_cflags@ 418ecore_win32_cflags = @ecore_win32_cflags@
411ecore_win32_libs = @ecore_win32_libs@ 419ecore_win32_libs = @ecore_win32_libs@
412ecore_wince_cflags = @ecore_wince_cflags@ 420ecore_wince_cflags = @ecore_wince_cflags@
@@ -451,12 +459,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
451requirements_ecore_file = @requirements_ecore_file@ 459requirements_ecore_file = @requirements_ecore_file@
452requirements_ecore_imf = @requirements_ecore_imf@ 460requirements_ecore_imf = @requirements_ecore_imf@
453requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 461requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
462requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
454requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 463requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
455requirements_ecore_input = @requirements_ecore_input@ 464requirements_ecore_input = @requirements_ecore_input@
456requirements_ecore_input_evas = @requirements_ecore_input_evas@ 465requirements_ecore_input_evas = @requirements_ecore_input_evas@
457requirements_ecore_ipc = @requirements_ecore_ipc@ 466requirements_ecore_ipc = @requirements_ecore_ipc@
458requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 467requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
459requirements_ecore_sdl = @requirements_ecore_sdl@ 468requirements_ecore_sdl = @requirements_ecore_sdl@
469requirements_ecore_wayland = @requirements_ecore_wayland@
460requirements_ecore_win32 = @requirements_ecore_win32@ 470requirements_ecore_win32 = @requirements_ecore_win32@
461requirements_ecore_wince = @requirements_ecore_wince@ 471requirements_ecore_wince = @requirements_ecore_wince@
462requirements_ecore_x = @requirements_ecore_x@ 472requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_directfb/Makefile.in b/libraries/ecore/src/lib/ecore_directfb/Makefile.in
index 51d113f..b7e1d29 100644
--- a/libraries/ecore/src/lib/ecore_directfb/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_directfb/Makefile.in
@@ -245,10 +245,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
245PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 245PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
246PIXMAN_LIBS = @PIXMAN_LIBS@ 246PIXMAN_LIBS = @PIXMAN_LIBS@
247PKG_CONFIG = @PKG_CONFIG@ 247PKG_CONFIG = @PKG_CONFIG@
248PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
249PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
250POSUB = @POSUB@ 248POSUB = @POSUB@
251RANLIB = @RANLIB@ 249RANLIB = @RANLIB@
250SCIM_CFLAGS = @SCIM_CFLAGS@
251SCIM_LIBS = @SCIM_LIBS@
252SDL_CFLAGS = @SDL_CFLAGS@ 252SDL_CFLAGS = @SDL_CFLAGS@
253SDL_CONFIG = @SDL_CONFIG@ 253SDL_CONFIG = @SDL_CONFIG@
254SDL_LIBS = @SDL_LIBS@ 254SDL_LIBS = @SDL_LIBS@
@@ -267,6 +267,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
267USE_NLS = @USE_NLS@ 267USE_NLS = @USE_NLS@
268VERSION = @VERSION@ 268VERSION = @VERSION@
269VMAJ = @VMAJ@ 269VMAJ = @VMAJ@
270WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
271WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
272WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
273WAYLAND_LIBS = @WAYLAND_LIBS@
270WIN32_CFLAGS = @WIN32_CFLAGS@ 274WIN32_CFLAGS = @WIN32_CFLAGS@
271WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 275WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
272WIN32_LIBS = @WIN32_LIBS@ 276WIN32_LIBS = @WIN32_LIBS@
@@ -380,6 +384,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
380ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 384ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
381ecore_imf_evas_libs = @ecore_imf_evas_libs@ 385ecore_imf_evas_libs = @ecore_imf_evas_libs@
382ecore_imf_libs = @ecore_imf_libs@ 386ecore_imf_libs = @ecore_imf_libs@
387ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
388ecore_imf_scim_libs = @ecore_imf_scim_libs@
383ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 389ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
384ecore_imf_xim_libs = @ecore_imf_xim_libs@ 390ecore_imf_xim_libs = @ecore_imf_xim_libs@
385ecore_input_cflags = @ecore_input_cflags@ 391ecore_input_cflags = @ecore_input_cflags@
@@ -392,6 +398,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
392ecore_psl1ght_libs = @ecore_psl1ght_libs@ 398ecore_psl1ght_libs = @ecore_psl1ght_libs@
393ecore_sdl_cflags = @ecore_sdl_cflags@ 399ecore_sdl_cflags = @ecore_sdl_cflags@
394ecore_sdl_libs = @ecore_sdl_libs@ 400ecore_sdl_libs = @ecore_sdl_libs@
401ecore_wayland_cflags = @ecore_wayland_cflags@
402ecore_wayland_libs = @ecore_wayland_libs@
395ecore_win32_cflags = @ecore_win32_cflags@ 403ecore_win32_cflags = @ecore_win32_cflags@
396ecore_win32_libs = @ecore_win32_libs@ 404ecore_win32_libs = @ecore_win32_libs@
397ecore_wince_cflags = @ecore_wince_cflags@ 405ecore_wince_cflags = @ecore_wince_cflags@
@@ -436,12 +444,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
436requirements_ecore_file = @requirements_ecore_file@ 444requirements_ecore_file = @requirements_ecore_file@
437requirements_ecore_imf = @requirements_ecore_imf@ 445requirements_ecore_imf = @requirements_ecore_imf@
438requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 446requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
447requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
439requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 448requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
440requirements_ecore_input = @requirements_ecore_input@ 449requirements_ecore_input = @requirements_ecore_input@
441requirements_ecore_input_evas = @requirements_ecore_input_evas@ 450requirements_ecore_input_evas = @requirements_ecore_input_evas@
442requirements_ecore_ipc = @requirements_ecore_ipc@ 451requirements_ecore_ipc = @requirements_ecore_ipc@
443requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 452requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
444requirements_ecore_sdl = @requirements_ecore_sdl@ 453requirements_ecore_sdl = @requirements_ecore_sdl@
454requirements_ecore_wayland = @requirements_ecore_wayland@
445requirements_ecore_win32 = @requirements_ecore_win32@ 455requirements_ecore_win32 = @requirements_ecore_win32@
446requirements_ecore_wince = @requirements_ecore_wince@ 456requirements_ecore_wince = @requirements_ecore_wince@
447requirements_ecore_x = @requirements_ecore_x@ 457requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_directfb/ecore_directfb.c b/libraries/ecore/src/lib/ecore_directfb/ecore_directfb.c
index f45b3c3..7c56b5d 100644
--- a/libraries/ecore/src/lib/ecore_directfb/ecore_directfb.c
+++ b/libraries/ecore/src/lib/ecore_directfb/ecore_directfb.c
@@ -80,7 +80,7 @@ _ecore_directfb_event_free_key_down(void *data __UNUSED__, void *ev)
80 free(e->key_compose); 80 free(e->key_compose);
81 81
82 free(e); 82 free(e);
83} /* _ecore_directfb_event_free_key_down */ 83}
84 84
85static void 85static void
86_ecore_directfb_event_free_key_up(void *data __UNUSED__, void *ev) 86_ecore_directfb_event_free_key_up(void *data __UNUSED__, void *ev)
@@ -98,7 +98,7 @@ _ecore_directfb_event_free_key_up(void *data __UNUSED__, void *ev)
98 free(e->key_compose); 98 free(e->key_compose);
99 99
100 free(e); 100 free(e);
101} /* _ecore_directfb_event_free_key_up */ 101}
102 102
103/* directfb window input events handler */ 103/* directfb window input events handler */
104/****************************************/ 104/****************************************/
@@ -131,7 +131,7 @@ _ecore_directfb_event_handle_motion(DFBEvent *evt)
131 131
132 default: 132 default:
133 return; 133 return;
134 } /* switch */ 134 }
135 e->win = _ecore_directfb_fullscreen_window_id; 135 e->win = _ecore_directfb_fullscreen_window_id;
136 e->time = 0; 136 e->time = 0;
137 break; 137 break;
@@ -146,9 +146,9 @@ _ecore_directfb_event_handle_motion(DFBEvent *evt)
146 146
147 default: 147 default:
148 break; 148 break;
149 } /* switch */ 149 }
150 ecore_event_add(ECORE_DIRECTFB_EVENT_MOTION, e, NULL, NULL); 150 ecore_event_add(ECORE_DIRECTFB_EVENT_MOTION, e, NULL, NULL);
151} /* _ecore_directfb_event_handle_motion */ 151}
152 152
153static void 153static void
154_ecore_directfb_event_handle_key_down(DFBEvent *evt) 154_ecore_directfb_event_handle_key_down(DFBEvent *evt)
@@ -197,10 +197,10 @@ _ecore_directfb_event_handle_key_down(DFBEvent *evt)
197 197
198 default: 198 default:
199 break; 199 break;
200 } /* switch */ 200 }
201 201
202 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, e, _ecore_directfb_event_free_key_down, NULL); 202 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, e, _ecore_directfb_event_free_key_down, NULL);
203} /* _ecore_directfb_event_handle_key_down */ 203}
204 204
205static void 205static void
206_ecore_directfb_event_handle_key_up(DFBEvent *evt) 206_ecore_directfb_event_handle_key_up(DFBEvent *evt)
@@ -249,9 +249,9 @@ _ecore_directfb_event_handle_key_up(DFBEvent *evt)
249 249
250 default: 250 default:
251 break; 251 break;
252 } /* switch */ 252 }
253 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_UP, e, _ecore_directfb_event_free_key_up, NULL); 253 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_UP, e, _ecore_directfb_event_free_key_up, NULL);
254} /* _ecore_directfb_event_handle_key_up */ 254}
255 255
256static void 256static void
257_ecore_directfb_event_handle_button_down(DFBEvent *evt) 257_ecore_directfb_event_handle_button_down(DFBEvent *evt)
@@ -283,10 +283,10 @@ _ecore_directfb_event_handle_button_down(DFBEvent *evt)
283 283
284 default: 284 default:
285 break; 285 break;
286 } /* switch */ 286 }
287 287
288 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, e, NULL, NULL); 288 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, e, NULL, NULL);
289} /* _ecore_directfb_event_handle_button_down */ 289}
290 290
291static void 291static void
292_ecore_directfb_event_handle_button_up(DFBEvent *evt) 292_ecore_directfb_event_handle_button_up(DFBEvent *evt)
@@ -317,9 +317,9 @@ _ecore_directfb_event_handle_button_up(DFBEvent *evt)
317 317
318 default: 318 default:
319 break; 319 break;
320 } /* switch */ 320 }
321 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, e, NULL, NULL); 321 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, e, NULL, NULL);
322} /* _ecore_directfb_event_handle_button_up */ 322}
323 323
324static void 324static void
325_ecore_directfb_event_handle_enter(DFBWindowEvent *evt) 325_ecore_directfb_event_handle_enter(DFBWindowEvent *evt)
@@ -334,7 +334,7 @@ _ecore_directfb_event_handle_enter(DFBWindowEvent *evt)
334 e->time = 0; 334 e->time = 0;
335 335
336 ecore_event_add(ECORE_DIRECTFB_EVENT_ENTER, e, NULL, NULL); 336 ecore_event_add(ECORE_DIRECTFB_EVENT_ENTER, e, NULL, NULL);
337} /* _ecore_directfb_event_handle_enter */ 337}
338 338
339static void 339static void
340_ecore_directfb_event_handle_leave(DFBWindowEvent *evt) 340_ecore_directfb_event_handle_leave(DFBWindowEvent *evt)
@@ -349,7 +349,7 @@ _ecore_directfb_event_handle_leave(DFBWindowEvent *evt)
349 e->time = 0; 349 e->time = 0;
350 350
351 ecore_event_add(ECORE_DIRECTFB_EVENT_LEAVE, e, NULL, NULL); 351 ecore_event_add(ECORE_DIRECTFB_EVENT_LEAVE, e, NULL, NULL);
352} /* _ecore_directfb_event_handle_leave */ 352}
353 353
354static void 354static void
355_ecore_directfb_event_handle_wheel(DFBWindowEvent *evt) 355_ecore_directfb_event_handle_wheel(DFBWindowEvent *evt)
@@ -365,7 +365,7 @@ _ecore_directfb_event_handle_wheel(DFBWindowEvent *evt)
365 e->time = 0; 365 e->time = 0;
366 366
367 ecore_event_add(ECORE_DIRECTFB_EVENT_WHEEL, e, NULL, NULL); 367 ecore_event_add(ECORE_DIRECTFB_EVENT_WHEEL, e, NULL, NULL);
368} /* _ecore_directfb_event_handle_wheel */ 368}
369 369
370static void 370static void
371_ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt) 371_ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt)
@@ -377,7 +377,7 @@ _ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt)
377 e->time = 0; 377 e->time = 0;
378 378
379 ecore_event_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, e, NULL, NULL); 379 ecore_event_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, e, NULL, NULL);
380} /* _ecore_directfb_event_handle_got_focus */ 380}
381 381
382static void 382static void
383_ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt) 383_ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
@@ -389,7 +389,7 @@ _ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
389 e->time = 0; 389 e->time = 0;
390 390
391 ecore_event_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, e, NULL, NULL); 391 ecore_event_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, e, NULL, NULL);
392} /* _ecore_directfb_event_handle_lost_focus */ 392}
393 393
394/* inputs and windows fds handlers */ 394/* inputs and windows fds handlers */
395/***********************************/ 395/***********************************/
@@ -428,7 +428,7 @@ _ecore_directfb_input_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *f
428 _ecore_directfb_event_handle_motion(&evt); 428 _ecore_directfb_event_handle_motion(&evt);
429 429
430 return EINA_TRUE; 430 return EINA_TRUE;
431} /* _ecore_directfb_input_event_fd_handler */ 431}
432 432
433static Eina_Bool 433static Eina_Bool
434_ecore_directfb_window_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *fd_handler __UNUSED__) 434_ecore_directfb_window_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *fd_handler __UNUSED__)
@@ -486,7 +486,7 @@ _ecore_directfb_window_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *
486 _ecore_directfb_event_handle_wheel(&evt.window); 486 _ecore_directfb_event_handle_wheel(&evt.window);
487 487
488 return EINA_TRUE; 488 return EINA_TRUE;
489} /* _ecore_directfb_window_event_fd_handler */ 489}
490 490
491/* api functions */ 491/* api functions */
492/*****************/ 492/*****************/
@@ -495,7 +495,7 @@ EAPI IDirectFB *
495ecore_directfb_interface_get(void) 495ecore_directfb_interface_get(void)
496{ 496{
497 return _dfb; 497 return _dfb;
498} /* ecore_directfb_interface_get */ 498}
499 499
500EAPI Ecore_DirectFB_Window * 500EAPI Ecore_DirectFB_Window *
501ecore_directfb_window_new(int x, int y, int w, int h) 501ecore_directfb_window_new(int x, int y, int w, int h)
@@ -530,7 +530,7 @@ ecore_directfb_window_new(int x, int y, int w, int h)
530 window->cursor = NULL; 530 window->cursor = NULL;
531 531
532 return window; 532 return window;
533} /* ecore_directfb_window_new */ 533}
534 534
535EAPI void 535EAPI void
536ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window) 536ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window)
@@ -538,37 +538,37 @@ ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window)
538 DFBCHECK(ecore_window->surface->Release(ecore_window->surface)); 538 DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
539 DFBCHECK(ecore_window->window->Release(ecore_window->window)); 539 DFBCHECK(ecore_window->window->Release(ecore_window->window));
540 free(ecore_window); 540 free(ecore_window);
541} /* ecore_directfb_window_free */ 541}
542 542
543EAPI void 543EAPI void
544ecore_directfb_window_move(Ecore_DirectFB_Window *ecore_window, int x, int y) 544ecore_directfb_window_move(Ecore_DirectFB_Window *ecore_window, int x, int y)
545{ 545{
546 DFBCHECK(ecore_window->window->MoveTo(ecore_window->window, x, y)); 546 DFBCHECK(ecore_window->window->MoveTo(ecore_window->window, x, y));
547} /* ecore_directfb_window_move */ 547}
548 548
549EAPI void 549EAPI void
550ecore_directfb_window_resize(Ecore_DirectFB_Window *ecore_window, int w, int h) 550ecore_directfb_window_resize(Ecore_DirectFB_Window *ecore_window, int w, int h)
551{ 551{
552 DFBCHECK(ecore_window->window->Resize(ecore_window->window, w, h)); 552 DFBCHECK(ecore_window->window->Resize(ecore_window->window, w, h));
553} /* ecore_directfb_window_resize */ 553}
554 554
555EAPI void 555EAPI void
556ecore_directfb_window_focus(Ecore_DirectFB_Window *ecore_window) 556ecore_directfb_window_focus(Ecore_DirectFB_Window *ecore_window)
557{ 557{
558 DFBCHECK(ecore_window->window->RequestFocus(ecore_window->window)); 558 DFBCHECK(ecore_window->window->RequestFocus(ecore_window->window));
559} /* ecore_directfb_window_focus */ 559}
560 560
561EAPI void 561EAPI void
562ecore_directfb_window_hide(Ecore_DirectFB_Window *ecore_window) 562ecore_directfb_window_hide(Ecore_DirectFB_Window *ecore_window)
563{ 563{
564 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0)); 564 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0));
565} /* ecore_directfb_window_hide */ 565}
566 566
567EAPI void 567EAPI void
568ecore_directfb_window_show(Ecore_DirectFB_Window *ecore_window) 568ecore_directfb_window_show(Ecore_DirectFB_Window *ecore_window)
569{ 569{
570 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0xFF)); 570 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0xFF));
571} /* ecore_directfb_window_show */ 571}
572 572
573EAPI void 573EAPI void
574ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool set) 574ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool set)
@@ -588,7 +588,7 @@ ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool
588 opts &= ~DWOP_ALPHACHANNEL; 588 opts &= ~DWOP_ALPHACHANNEL;
589 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts)); 589 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
590 } 590 }
591} /* ecore_directfb_window_shaped_set */ 591}
592 592
593EAPI void 593EAPI void
594ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool show) 594ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool show)
@@ -622,7 +622,7 @@ ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool
622 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0)); 622 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
623 } 623 }
624 } 624 }
625} /* ecore_directfb_window_cursor_show */ 625}
626 626
627EAPI void 627EAPI void
628ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_DirectFB_Cursor *cursor) 628ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_DirectFB_Cursor *cursor)
@@ -639,7 +639,7 @@ ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_Dire
639 ecore_window->cursor = cursor; 639 ecore_window->cursor = cursor;
640 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor->surface, cursor->hot_x, cursor->hot_y)); 640 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor->surface, cursor->hot_x, cursor->hot_y));
641 } 641 }
642} /* ecore_directfb_window_cursor_set */ 642}
643 643
644EAPI void 644EAPI void
645ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool on) 645ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool on)
@@ -666,14 +666,14 @@ ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_B
666 DFBCHECK(ecore_window->window->GetSurface(ecore_window->window, &ecore_window->surface)); 666 DFBCHECK(ecore_window->window->GetSurface(ecore_window->window, &ecore_window->surface));
667 _ecore_directfb_fullscreen_window_id = 0; 667 _ecore_directfb_fullscreen_window_id = 0;
668 } 668 }
669} /* ecore_directfb_window_fullscreen_set */ 669}
670 670
671EAPI void 671EAPI void
672ecore_directfb_window_size_get(Ecore_DirectFB_Window *ecore_window, int *w, int *h) 672ecore_directfb_window_size_get(Ecore_DirectFB_Window *ecore_window, int *w, int *h)
673{ 673{
674 DFBCHECK(ecore_window->surface->GetSize(ecore_window->surface,w,h)); 674 DFBCHECK(ecore_window->surface->GetSize(ecore_window->surface,w,h));
675 return; 675 return;
676} /* ecore_directfb_window_size_get */ 676}
677 677
678EAPI int 678EAPI int
679ecore_directfb_init(const char *name __UNUSED__) 679ecore_directfb_init(const char *name __UNUSED__)
@@ -730,7 +730,7 @@ ecore_directfb_init(const char *name __UNUSED__)
730 } 730 }
731 /* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */ 731 /* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */
732 return _ecore_directfb_init_count; 732 return _ecore_directfb_init_count;
733} /* ecore_directfb_init */ 733}
734 734
735EAPI int 735EAPI int
736ecore_directfb_shutdown(void) 736ecore_directfb_shutdown(void)
@@ -753,5 +753,5 @@ ecore_directfb_shutdown(void)
753 eina_log_domain_unregister(_ecore_directfb_log_dom); 753 eina_log_domain_unregister(_ecore_directfb_log_dom);
754 _ecore_directfb_log_dom = -1; 754 _ecore_directfb_log_dom = -1;
755 return _ecore_directfb_init_count; 755 return _ecore_directfb_init_count;
756} /* ecore_directfb_shutdown */ 756}
757 757
diff --git a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
index 256e57c..8d9abc4 100644
--- a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
+++ b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
@@ -81,6 +81,8 @@ extern "C" {
81#define HAVE_ECORE_EVAS_WINCE 1 81#define HAVE_ECORE_EVAS_WINCE 1
82#define HAVE_ECORE_EVAS_EWS 1 82#define HAVE_ECORE_EVAS_EWS 1
83#define HAVE_ECORE_EVAS_PSL1GHT 1 83#define HAVE_ECORE_EVAS_PSL1GHT 1
84#define HAVE_ECORE_EVAS_WAYLAND_SHM 1
85#define HAVE_ECORE_EVAS_WAYLAND_EGL 1
84 86
85typedef enum _Ecore_Evas_Engine_Type 87typedef enum _Ecore_Evas_Engine_Type
86{ 88{
@@ -104,7 +106,9 @@ typedef enum _Ecore_Evas_Engine_Type
104 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE, 106 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
105 ECORE_EVAS_ENGINE_OPENGL_SDL, 107 ECORE_EVAS_ENGINE_OPENGL_SDL,
106 ECORE_EVAS_ENGINE_EWS, 108 ECORE_EVAS_ENGINE_EWS,
107 ECORE_EVAS_ENGINE_PSL1GHT 109 ECORE_EVAS_ENGINE_PSL1GHT,
110 ECORE_EVAS_ENGINE_WAYLAND_SHM,
111 ECORE_EVAS_ENGINE_WAYLAND_EGL
108} Ecore_Evas_Engine_Type; 112} Ecore_Evas_Engine_Type;
109 113
110typedef enum _Ecore_Evas_Avoid_Damage_Type 114typedef enum _Ecore_Evas_Avoid_Damage_Type
@@ -689,6 +693,11 @@ EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int
689EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); 693EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
690EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); 694EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
691 695
696EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame);
697EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame);
698EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
699EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
700
692/** 701/**
693 * @brief Create a new @c Ecore_Evas canvas bound to the Evas 702 * @brief Create a new @c Ecore_Evas canvas bound to the Evas
694 * @b buffer engine 703 * @b buffer engine
@@ -818,7 +827,7 @@ EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
818 827
819/** 828/**
820 * @brief Create an Evas image object with image data <b>bound to an 829 * @brief Create an Evas image object with image data <b>bound to an
821 * own, internal @c Ecore_Evas canvas wrapper<b> 830 * own, internal @c Ecore_Evas canvas wrapper</b>
822 * 831 *
823 * @param ee_target @c Ecore_Evas to have the canvas receiving the new 832 * @param ee_target @c Ecore_Evas to have the canvas receiving the new
824 * image object 833 * image object
@@ -1320,7 +1329,7 @@ EAPI void ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h);
1320 * @param h The step height 1329 * @param h The step height
1321 * 1330 *
1322 * This function sets the size steps of @p ee to be @p w x @p h. This 1331 * This function sets the size steps of @p ee to be @p w x @p h. This
1323 * limits the size of this @cEcore_Evas window to be @b always an 1332 * limits the size of this @c Ecore_Evas window to be @b always an
1324 * integer multiple of the step size, for each axis. 1333 * integer multiple of the step size, for each axis.
1325 */ 1334 */
1326EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h); 1335EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
@@ -1450,6 +1459,9 @@ EAPI Eina_Bool ecore_evas_comp_sync_get(const Ecore_Evas *ee);
1450 */ 1459 */
1451EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h); 1460EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
1452 1461
1462EAPI void ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame);
1463EAPI Eina_Bool ecore_evas_draw_frame_get(const Ecore_Evas *ee);
1464
1453/** 1465/**
1454 * @brief Associate the given object to this ecore evas. 1466 * @brief Associate the given object to this ecore evas.
1455 * 1467 *
@@ -1625,29 +1637,238 @@ EAPI void ecore_evas_ews_manager_set(const void *manager);
1625 */ 1637 */
1626EAPI const void *ecore_evas_ews_manager_get(void); 1638EAPI const void *ecore_evas_ews_manager_get(void);
1627 1639
1628EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed */ 1640EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed @since 1.1 */
1629EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created */ 1641EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created @since 1.1 */
1630EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. */ 1642EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. @since 1.1 */
1631EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized */ 1643EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized @since 1.1 */
1632EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved */ 1644EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved @since 1.1 */
1633EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible */ 1645EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible @since 1.1 */
1634EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden */ 1646EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden @since 1.1 */
1635EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused */ 1647EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused @since 1.1 */
1636EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus */ 1648EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus @since 1.1 */
1637EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised */ 1649EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised @since 1.1 */
1638EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered */ 1650EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered @since 1.1 */
1639EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated */ 1651EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated @since 1.1 */
1640 1652
1641EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed */ 1653EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed @since 1.1 */
1642EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed */ 1654EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed @since 1.1 */
1643EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed */ 1655EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed @since 1.1 */
1644EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed */ 1656EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed @since 1.1 */
1645EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) */ 1657EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) @since 1.1 */
1646 1658
1647/** 1659/**
1648 * @} 1660 * @}
1649 */ 1661 */
1650 1662
1663/**
1664 * @defgroup Ecore_Evas_Extn External plug/socket infrastructure to remote canvases
1665 *
1666 * These functions allow 1 process to create a "socket" was pluged into which another
1667 * process can create a "plug" remotely to plug into.
1668 * Socket can provides content for several plugs.
1669 * This is best for small sized objects (about the size range
1670 * of a small icon up to a few large icons). Sine the plug is actually an
1671 * image object, you can fetch the pixel data
1672 *
1673 * @since 1.2
1674 * @{
1675 */
1676
1677EAPI extern int ECORE_EVAS_EXTN_CLIENT_ADD; /**< this event is received when a plug has connected to an extn socket @since 1.2 */
1678EAPI extern int ECORE_EVAS_EXTN_CLIENT_DEL; /**< this event is received when a plug has disconnected from an extn socket @since 1.2 */
1679
1680/**
1681 * @brief Create a new Ecore_Evas canvas for the new external ecore evas socket
1682 *
1683 * @param w The width of the canvas, in pixels
1684 * @param h The height of the canvas, in pixels
1685 * @return A new @c Ecore_Evas instance or @c NULL, on failure
1686 *
1687 * This creates a new extn_socket canvas wrapper, with image data array
1688 * @b bound to the ARGB format, 8 bits per pixel.
1689 *
1690 * If creation is successful, an Ecore_Evas handle is returned or NULL if creation
1691 * fails. Also focus, show, hide etc. callbacks
1692 * will also be called if the plug object is shown, or already visible on
1693 * connect, or if it is hidden later, focused or unfocused.
1694 *
1695 * This function has to be flowed by ecore_evas_extn_socket_listen(),
1696 * for starting ecore ipc service.
1697 *
1698 * @code
1699 * Eina_Bool res = EINA_FALSE;
1700 * Ecore_Evas *ee = ecore_evas_extn_socket_new(1, 1);
1701 *
1702 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
1703 * if (!res) return;
1704 * ecore_evas_resize(ee, 240, 400);
1705 * @endcode
1706 *
1707 * or
1708 *
1709 * @code
1710 * Eina_Bool res = EINA_FALSE;
1711 * Ecore_Evas *ee = ecore_evas_extn_socket_new(240, 400);
1712 *
1713 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
1714 * if (!res) return;
1715 * @endcode
1716 *
1717 * When a client(plug) connects, you will get the ECORE_EVAS_EXTN_CLIENT_ADD event
1718 * in the ecore event queue, with event_info being the image object pointer
1719 * passed as a void pointer. When a client disconnects you will get the
1720 * ECORE_EVAS_EXTN_CLIENT_DEL event.
1721 *
1722 * You can set up event handles for these events as follows:
1723 *
1724 * @code
1725 * static void client_add_cb(void *data, int event, void *event_info)
1726 * {
1727 * Evas_Object *obj = event_info;
1728 * printf("client added to image object %p\n", obj);
1729 * evas_object_show(obj);
1730 * }
1731 *
1732 * static void client_del_cb(void *data, int event, void *event_info)
1733 * {
1734 * Evas_Object *obj = event_info;
1735 * printf("client deleted from image object %p\n", obj);
1736 * evas_object_hide(obj);
1737 * }
1738 *
1739 * void setup(void)
1740 * {
1741 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_ADD,
1742 * client_add_cb, NULL);
1743 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_DEL,
1744 * client_del_cb, NULL);
1745 * }
1746 * @endcode
1747 *
1748 * Note that events come in later after the event happened. You may want to be
1749 * careful as data structures you had associated with the image object
1750 * may have been freed after deleting, but the object may still be around
1751 * awating cleanup and thus still be valid.You can change the size with something like:
1752 *
1753 * @see ecore_evas_extn_socket_listen()
1754 * @see ecore_evas_extn_plug_new()
1755 * @see ecore_evas_extn_plug_object_data_lock()
1756 * @see ecore_evas_extn_plug_object_data_unlock()
1757 *
1758 * @since 1.2
1759 */
1760EAPI Ecore_Evas *ecore_evas_extn_socket_new(int w, int h);
1761
1762/**
1763 * @brief Create a socket to provide the service for external ecore evas socket.
1764 *
1765 * @param svcname The name of the service to be advertised. ensure that it is unique (when combined with @p svcnum) otherwise creation may fail.
1766 * @param svcnum A number (any value, 0 beig the common default) to differentiate multiple instances of services with the same name.
1767 * @param svcsys A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ide that created the service.
1768 * @return EINA_TRUE if creation is successful, EINA_FALSE if it does not.
1769 *
1770 * This creates socket specified by @p svcname, @p svcnum and @p svcsys. If creation
1771 * is successful, EINA_TRUE is returned or EINA_FALSE if creation
1772 * fails.
1773 *
1774 * @see ecore_evas_extn_socket_new()
1775 * @see ecore_evas_extn_plug_new()
1776 * @see ecore_evas_extn_plug_object_data_lock()
1777 * @see ecore_evas_extn_plug_object_data_unlock()
1778 *
1779 * @since 1.2
1780 */
1781EAPI Eina_Bool ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
1782
1783/**
1784 * @brief Lock the pixel data so the socket cannot change it
1785 *
1786 * @param obj The image object returned by ecore_evas_extn_plug_new() to lock
1787 *
1788 * You may need to get the image pixel data with evas_object_image_data_get()
1789 * from the image object, but need to ensure that it does not change while
1790 * you are using the data. This function lets you set an advisory lock on the
1791 * image data so the external plug process will not render to it or alter it.
1792 *
1793 * You should only hold the lock for just as long as you need to read out the
1794 * image data or otherwise deal with it, and then unlokc it with
1795 * ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than
1796 * 1 iteration of the main ecore loop will be problematic, so avoid it. Also
1797 * forgetting to unlock may cause the socket process to freeze and thus create
1798 * odd behavior.
1799 *
1800 * @see ecore_evas_extn_plug_new()
1801 * @see ecore_evas_extn_plug_object_data_unlock()
1802 *
1803 * @since 1.2
1804 */
1805EAPI void ecore_evas_extn_plug_object_data_lock(Evas_Object *obj);
1806
1807/**
1808 * @brief Unlock the pixel data so the socket can change it again.
1809 *
1810 * @param obj The image object returned by ecore_evas_extn_plug_new() to unlock
1811 *
1812 * This unlocks after an advisor lock has been taken by
1813 * ecore_evas_extn_plug_object_data_lock().
1814 *
1815 * @see ecore_evas_extn_plug_new()
1816 * @see ecore_evas_extn_plug_object_data_lock()
1817 *
1818 * @since 1.2
1819 */
1820EAPI void ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj);
1821
1822/**
1823 * @brief Create a new external ecore evas plug
1824 *
1825 * @param ee_target The Ecore_Evas containing the canvas in which the new image object will live.
1826 * @return An evas image object that will contain the image output of a socket.
1827 *
1828 * This creates an image object that will contain the output of another
1829 * processes socket canvas when it connects. All input will be sent back to
1830 * this process as well, effectively swallowing or placing the socket process
1831 * in the canvas of the plug process in place of the image object. The image
1832 * object by default is created to be filled (equivalent of
1833 * evas_object_image_filled_add() on creation) so image content will scale
1834 * toi fill the image unless otherwise reconfigured. The Ecore_Evas size
1835 * of the plug is the master size and determines size in pixels of the
1836 * plug canvas. You can change the size with something like:
1837 *
1838 * @code
1839 * Eina_Bool res = EINA_FALSE;
1840 * Evas_Object *obj = ecore_evas_extn_plug_new(ee);
1841 *
1842 * res = ecore_evas_extn_plug_connect("svcname", 1, EINA_FALSE);
1843 * if (!res) return;
1844 * ecore_evas_resize(ee, 240, 400);
1845 * @endcode
1846 *
1847 * @see ecore_evas_extn_socket_new()
1848 * @see ecore_evas_extn_plug_connect()
1849 * @since 1.2
1850 */
1851EAPI Evas_Object *ecore_evas_extn_plug_new(Ecore_Evas *ee_target);
1852
1853/**
1854 * @brief Connect a external ecore evas plug to service provided by external ecore evas socket
1855 *
1856 * @param obj The Ecore_Evas containing the canvas in which the new image object will live.
1857 * @param svcname The service name to connect to set up by the socket.
1858 * @param svcnum The service number to connect to (set up by socket).
1859 * @param svcsys Booleain to set if the service is a system one or not (set up by socket).
1860 * @return EINA_TRUE if creation is successful, EINA_FALSE if it does not.
1861 *
1862 *
1863 * @see ecore_evas_extn_plug_new()
1864 *
1865 * @since 1.2
1866 */
1867EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
1868
1869/**
1870 * @}
1871 */
1651 1872
1652/** 1873/**
1653 * @} 1874 * @}
diff --git a/libraries/ecore/src/lib/ecore_evas/Makefile.am b/libraries/ecore/src/lib/ecore_evas/Makefile.am
index fbb7190..a1d9215 100644
--- a/libraries/ecore/src/lib/ecore_evas/Makefile.am
+++ b/libraries/ecore/src/lib/ecore_evas/Makefile.am
@@ -1,8 +1,8 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3if BUILD_ECORE_X 3if BUILD_ECORE_X
4ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@ @ECORE_XCB_CFLAGS@ 4ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@
5ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@ @ECORE_XCB_LIBS@ 5ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@
6else 6else
7ECORE_X_INC = 7ECORE_X_INC =
8ECORE_X_LIB = 8ECORE_X_LIB =
@@ -66,6 +66,24 @@ ECORE_PSL1GHT_INC =
66ECORE_PSL1GHT_LIB = 66ECORE_PSL1GHT_LIB =
67endif 67endif
68 68
69if BUILD_ECORE_WAYLAND
70ECORE_WAYLAND_INC = -I$(top_srcdir)/src/lib/ecore_wayland @WAYLAND_CFLAGS@
71ECORE_WAYLAND_LIB = $(top_builddir)/src/lib/ecore_wayland/libecore_wayland.la
72ECORE_WAYLAND_LIBADD = @WAYLAND_LIBS@ $(ECORE_WAYLAND_LIB)
73else
74ECORE_WAYLAND_INC =
75ECORE_WAYLAND_LIB =
76ECORE_WAYLAND_LIBADD =
77endif
78
79if BUILD_ECORE_IPC
80ECORE_IPC_INC= \
81-I$(top_srcdir)/src/lib/ecore_ipc \
82-I$(top_builddir)/src/lib/ecore_ipc
83
84ECORE_IPC_LIB=$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
85endif
86
69AM_CPPFLAGS = \ 87AM_CPPFLAGS = \
70-I$(top_srcdir)/src/lib/ecore \ 88-I$(top_srcdir)/src/lib/ecore \
71-I$(top_srcdir)/src/lib/ecore_evas \ 89-I$(top_srcdir)/src/lib/ecore_evas \
@@ -84,9 +102,12 @@ $(ECORE_SDL_INC) \
84$(ECORE_COCOA_INC) \ 102$(ECORE_COCOA_INC) \
85$(ECORE_WINCE_INC) \ 103$(ECORE_WINCE_INC) \
86$(ECORE_PSL1GHT_INC) \ 104$(ECORE_PSL1GHT_INC) \
105$(ECORE_WAYLAND_INC) \
106$(ECORE_IPC_INC) \
87@EVAS_CFLAGS@ \ 107@EVAS_CFLAGS@ \
88@EINA_CFLAGS@ \ 108@EINA_CFLAGS@ \
89@EVIL_CFLAGS@ 109@EVIL_CFLAGS@ \
110@WAYLAND_EGL_CFLAGS@
90 111
91AM_CFLAGS = @WIN32_CFLAGS@ 112AM_CFLAGS = @WIN32_CFLAGS@
92 113
@@ -106,7 +127,10 @@ ecore_evas_sdl.c \
106ecore_evas_cocoa.c \ 127ecore_evas_cocoa.c \
107ecore_evas_wince.c \ 128ecore_evas_wince.c \
108ecore_evas_ews.c \ 129ecore_evas_ews.c \
109ecore_evas_psl1ght.c 130ecore_evas_psl1ght.c \
131ecore_evas_wayland_shm.c \
132ecore_evas_wayland_egl.c \
133ecore_evas_extn.c
110 134
111libecore_evas_la_LIBADD = \ 135libecore_evas_la_LIBADD = \
112$(ECORE_X_LIB) \ 136$(ECORE_X_LIB) \
@@ -117,13 +141,17 @@ $(ECORE_SDL_LIB) \
117$(ECORE_SDL_LIBADD) \ 141$(ECORE_SDL_LIBADD) \
118$(ECORE_COCOA_LIB) \ 142$(ECORE_COCOA_LIB) \
119$(ECORE_WINCE_LIB) \ 143$(ECORE_WINCE_LIB) \
144$(ECORE_IPC_LIB) \
120$(ECORE_PSL1GHT_LIB) \ 145$(ECORE_PSL1GHT_LIB) \
146$(ECORE_WAYLAND_LIB) \
147$(ECORE_WAYLAND_LIBADD) \
121$(top_builddir)/src/lib/ecore_input/libecore_input.la \ 148$(top_builddir)/src/lib/ecore_input/libecore_input.la \
122$(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \ 149$(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \
123$(top_builddir)/src/lib/ecore/libecore.la \ 150$(top_builddir)/src/lib/ecore/libecore.la \
124@EVAS_LIBS@ \ 151@EVAS_LIBS@ \
125@EINA_LIBS@ \ 152@EINA_LIBS@ \
126@EVIL_LIBS@ 153@EVIL_LIBS@ \
154@WAYLAND_EGL_LIBS@
127 155
128libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ 156libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
129 157
diff --git a/libraries/ecore/src/lib/ecore_evas/Makefile.in b/libraries/ecore/src/lib/ecore_evas/Makefile.in
index 793e59d..a269b75 100644
--- a/libraries/ecore/src/lib/ecore_evas/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_evas/Makefile.in
@@ -95,11 +95,15 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
95@BUILD_ECORE_COCOA_TRUE@am__DEPENDENCIES_7 = $(top_builddir)/src/lib/ecore_cocoa/libecore_cocoa.la 95@BUILD_ECORE_COCOA_TRUE@am__DEPENDENCIES_7 = $(top_builddir)/src/lib/ecore_cocoa/libecore_cocoa.la
96@BUILD_ECORE_WINCE_TRUE@am__DEPENDENCIES_8 = $(top_builddir)/src/lib/ecore_wince/libecore_wince.la 96@BUILD_ECORE_WINCE_TRUE@am__DEPENDENCIES_8 = $(top_builddir)/src/lib/ecore_wince/libecore_wince.la
97@BUILD_ECORE_PSL1GHT_TRUE@am__DEPENDENCIES_9 = $(top_builddir)/src/lib/ecore_psl1ght/libecore_psl1ght.la 97@BUILD_ECORE_PSL1GHT_TRUE@am__DEPENDENCIES_9 = $(top_builddir)/src/lib/ecore_psl1ght/libecore_psl1ght.la
98@BUILD_ECORE_WAYLAND_TRUE@am__DEPENDENCIES_10 = $(top_builddir)/src/lib/ecore_wayland/libecore_wayland.la
99@BUILD_ECORE_WAYLAND_TRUE@am__DEPENDENCIES_11 = \
100@BUILD_ECORE_WAYLAND_TRUE@ $(am__DEPENDENCIES_10)
98libecore_evas_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ 101libecore_evas_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
99 $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ 102 $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
100 $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ 103 $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
101 $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_7) \ 104 $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_7) \
102 $(am__DEPENDENCIES_8) $(am__DEPENDENCIES_9) \ 105 $(am__DEPENDENCIES_8) $(ECORE_IPC_LIB) $(am__DEPENDENCIES_9) \
106 $(am__DEPENDENCIES_10) $(am__DEPENDENCIES_11) \
103 $(top_builddir)/src/lib/ecore_input/libecore_input.la \ 107 $(top_builddir)/src/lib/ecore_input/libecore_input.la \
104 $(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \ 108 $(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \
105 $(top_builddir)/src/lib/ecore/libecore.la 109 $(top_builddir)/src/lib/ecore/libecore.la
@@ -107,7 +111,8 @@ am_libecore_evas_la_OBJECTS = ecore_evas.lo ecore_evas_util.lo \
107 ecore_evas_x.lo ecore_evas_fb.lo ecore_evas_buffer.lo \ 111 ecore_evas_x.lo ecore_evas_fb.lo ecore_evas_buffer.lo \
108 ecore_evas_directfb.lo ecore_evas_win32.lo ecore_evas_sdl.lo \ 112 ecore_evas_directfb.lo ecore_evas_win32.lo ecore_evas_sdl.lo \
109 ecore_evas_cocoa.lo ecore_evas_wince.lo ecore_evas_ews.lo \ 113 ecore_evas_cocoa.lo ecore_evas_wince.lo ecore_evas_ews.lo \
110 ecore_evas_psl1ght.lo 114 ecore_evas_psl1ght.lo ecore_evas_wayland_shm.lo \
115 ecore_evas_wayland_egl.lo ecore_evas_extn.lo
111libecore_evas_la_OBJECTS = $(am_libecore_evas_la_OBJECTS) 116libecore_evas_la_OBJECTS = $(am_libecore_evas_la_OBJECTS)
112AM_V_lt = $(am__v_lt_$(V)) 117AM_V_lt = $(am__v_lt_$(V))
113am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) 118am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
@@ -266,10 +271,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
266PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 271PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
267PIXMAN_LIBS = @PIXMAN_LIBS@ 272PIXMAN_LIBS = @PIXMAN_LIBS@
268PKG_CONFIG = @PKG_CONFIG@ 273PKG_CONFIG = @PKG_CONFIG@
269PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
270PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
271POSUB = @POSUB@ 274POSUB = @POSUB@
272RANLIB = @RANLIB@ 275RANLIB = @RANLIB@
276SCIM_CFLAGS = @SCIM_CFLAGS@
277SCIM_LIBS = @SCIM_LIBS@
273SDL_CFLAGS = @SDL_CFLAGS@ 278SDL_CFLAGS = @SDL_CFLAGS@
274SDL_CONFIG = @SDL_CONFIG@ 279SDL_CONFIG = @SDL_CONFIG@
275SDL_LIBS = @SDL_LIBS@ 280SDL_LIBS = @SDL_LIBS@
@@ -288,6 +293,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
288USE_NLS = @USE_NLS@ 293USE_NLS = @USE_NLS@
289VERSION = @VERSION@ 294VERSION = @VERSION@
290VMAJ = @VMAJ@ 295VMAJ = @VMAJ@
296WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
297WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
298WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
299WAYLAND_LIBS = @WAYLAND_LIBS@
291WIN32_CFLAGS = @WIN32_CFLAGS@ 300WIN32_CFLAGS = @WIN32_CFLAGS@
292WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 301WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
293WIN32_LIBS = @WIN32_LIBS@ 302WIN32_LIBS = @WIN32_LIBS@
@@ -401,6 +410,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
401ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 410ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
402ecore_imf_evas_libs = @ecore_imf_evas_libs@ 411ecore_imf_evas_libs = @ecore_imf_evas_libs@
403ecore_imf_libs = @ecore_imf_libs@ 412ecore_imf_libs = @ecore_imf_libs@
413ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
414ecore_imf_scim_libs = @ecore_imf_scim_libs@
404ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 415ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
405ecore_imf_xim_libs = @ecore_imf_xim_libs@ 416ecore_imf_xim_libs = @ecore_imf_xim_libs@
406ecore_input_cflags = @ecore_input_cflags@ 417ecore_input_cflags = @ecore_input_cflags@
@@ -413,6 +424,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
413ecore_psl1ght_libs = @ecore_psl1ght_libs@ 424ecore_psl1ght_libs = @ecore_psl1ght_libs@
414ecore_sdl_cflags = @ecore_sdl_cflags@ 425ecore_sdl_cflags = @ecore_sdl_cflags@
415ecore_sdl_libs = @ecore_sdl_libs@ 426ecore_sdl_libs = @ecore_sdl_libs@
427ecore_wayland_cflags = @ecore_wayland_cflags@
428ecore_wayland_libs = @ecore_wayland_libs@
416ecore_win32_cflags = @ecore_win32_cflags@ 429ecore_win32_cflags = @ecore_win32_cflags@
417ecore_win32_libs = @ecore_win32_libs@ 430ecore_win32_libs = @ecore_win32_libs@
418ecore_wince_cflags = @ecore_wince_cflags@ 431ecore_wince_cflags = @ecore_wince_cflags@
@@ -457,12 +470,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
457requirements_ecore_file = @requirements_ecore_file@ 470requirements_ecore_file = @requirements_ecore_file@
458requirements_ecore_imf = @requirements_ecore_imf@ 471requirements_ecore_imf = @requirements_ecore_imf@
459requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 472requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
473requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
460requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 474requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
461requirements_ecore_input = @requirements_ecore_input@ 475requirements_ecore_input = @requirements_ecore_input@
462requirements_ecore_input_evas = @requirements_ecore_input_evas@ 476requirements_ecore_input_evas = @requirements_ecore_input_evas@
463requirements_ecore_ipc = @requirements_ecore_ipc@ 477requirements_ecore_ipc = @requirements_ecore_ipc@
464requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 478requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
465requirements_ecore_sdl = @requirements_ecore_sdl@ 479requirements_ecore_sdl = @requirements_ecore_sdl@
480requirements_ecore_wayland = @requirements_ecore_wayland@
466requirements_ecore_win32 = @requirements_ecore_win32@ 481requirements_ecore_win32 = @requirements_ecore_win32@
467requirements_ecore_wince = @requirements_ecore_wince@ 482requirements_ecore_wince = @requirements_ecore_wince@
468requirements_ecore_x = @requirements_ecore_x@ 483requirements_ecore_x = @requirements_ecore_x@
@@ -481,9 +496,9 @@ x_includes = @x_includes@
481x_libs = @x_libs@ 496x_libs = @x_libs@
482MAINTAINERCLEANFILES = Makefile.in 497MAINTAINERCLEANFILES = Makefile.in
483@BUILD_ECORE_X_FALSE@ECORE_X_INC = 498@BUILD_ECORE_X_FALSE@ECORE_X_INC =
484@BUILD_ECORE_X_TRUE@ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@ @ECORE_XCB_CFLAGS@ 499@BUILD_ECORE_X_TRUE@ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x @x_cflags@
485@BUILD_ECORE_X_FALSE@ECORE_X_LIB = 500@BUILD_ECORE_X_FALSE@ECORE_X_LIB =
486@BUILD_ECORE_X_TRUE@ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@ @ECORE_XCB_LIBS@ 501@BUILD_ECORE_X_TRUE@ECORE_X_LIB = $(top_builddir)/src/lib/ecore_x/libecore_x.la @x_libs@
487@BUILD_ECORE_FB_FALSE@ECORE_FB_INC = 502@BUILD_ECORE_FB_FALSE@ECORE_FB_INC =
488@BUILD_ECORE_FB_TRUE@ECORE_FB_INC = -I$(top_srcdir)/src/lib/ecore_fb 503@BUILD_ECORE_FB_TRUE@ECORE_FB_INC = -I$(top_srcdir)/src/lib/ecore_fb
489@BUILD_ECORE_FB_FALSE@ECORE_FB_LIB = 504@BUILD_ECORE_FB_FALSE@ECORE_FB_LIB =
@@ -514,6 +529,17 @@ MAINTAINERCLEANFILES = Makefile.in
514@BUILD_ECORE_PSL1GHT_TRUE@ECORE_PSL1GHT_INC = -I$(top_srcdir)/src/lib/ecore_psl1ght 529@BUILD_ECORE_PSL1GHT_TRUE@ECORE_PSL1GHT_INC = -I$(top_srcdir)/src/lib/ecore_psl1ght
515@BUILD_ECORE_PSL1GHT_FALSE@ECORE_PSL1GHT_LIB = 530@BUILD_ECORE_PSL1GHT_FALSE@ECORE_PSL1GHT_LIB =
516@BUILD_ECORE_PSL1GHT_TRUE@ECORE_PSL1GHT_LIB = $(top_builddir)/src/lib/ecore_psl1ght/libecore_psl1ght.la 531@BUILD_ECORE_PSL1GHT_TRUE@ECORE_PSL1GHT_LIB = $(top_builddir)/src/lib/ecore_psl1ght/libecore_psl1ght.la
532@BUILD_ECORE_WAYLAND_FALSE@ECORE_WAYLAND_INC =
533@BUILD_ECORE_WAYLAND_TRUE@ECORE_WAYLAND_INC = -I$(top_srcdir)/src/lib/ecore_wayland @WAYLAND_CFLAGS@
534@BUILD_ECORE_WAYLAND_FALSE@ECORE_WAYLAND_LIB =
535@BUILD_ECORE_WAYLAND_TRUE@ECORE_WAYLAND_LIB = $(top_builddir)/src/lib/ecore_wayland/libecore_wayland.la
536@BUILD_ECORE_WAYLAND_FALSE@ECORE_WAYLAND_LIBADD =
537@BUILD_ECORE_WAYLAND_TRUE@ECORE_WAYLAND_LIBADD = @WAYLAND_LIBS@ $(ECORE_WAYLAND_LIB)
538@BUILD_ECORE_IPC_TRUE@ECORE_IPC_INC = \
539@BUILD_ECORE_IPC_TRUE@-I$(top_srcdir)/src/lib/ecore_ipc \
540@BUILD_ECORE_IPC_TRUE@-I$(top_builddir)/src/lib/ecore_ipc
541
542@BUILD_ECORE_IPC_TRUE@ECORE_IPC_LIB = $(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
517AM_CPPFLAGS = \ 543AM_CPPFLAGS = \
518-I$(top_srcdir)/src/lib/ecore \ 544-I$(top_srcdir)/src/lib/ecore \
519-I$(top_srcdir)/src/lib/ecore_evas \ 545-I$(top_srcdir)/src/lib/ecore_evas \
@@ -532,9 +558,12 @@ $(ECORE_SDL_INC) \
532$(ECORE_COCOA_INC) \ 558$(ECORE_COCOA_INC) \
533$(ECORE_WINCE_INC) \ 559$(ECORE_WINCE_INC) \
534$(ECORE_PSL1GHT_INC) \ 560$(ECORE_PSL1GHT_INC) \
561$(ECORE_WAYLAND_INC) \
562$(ECORE_IPC_INC) \
535@EVAS_CFLAGS@ \ 563@EVAS_CFLAGS@ \
536@EINA_CFLAGS@ \ 564@EINA_CFLAGS@ \
537@EVIL_CFLAGS@ 565@EVIL_CFLAGS@ \
566@WAYLAND_EGL_CFLAGS@
538 567
539AM_CFLAGS = @WIN32_CFLAGS@ 568AM_CFLAGS = @WIN32_CFLAGS@
540lib_LTLIBRARIES = libecore_evas.la 569lib_LTLIBRARIES = libecore_evas.la
@@ -552,7 +581,10 @@ ecore_evas_sdl.c \
552ecore_evas_cocoa.c \ 581ecore_evas_cocoa.c \
553ecore_evas_wince.c \ 582ecore_evas_wince.c \
554ecore_evas_ews.c \ 583ecore_evas_ews.c \
555ecore_evas_psl1ght.c 584ecore_evas_psl1ght.c \
585ecore_evas_wayland_shm.c \
586ecore_evas_wayland_egl.c \
587ecore_evas_extn.c
556 588
557libecore_evas_la_LIBADD = \ 589libecore_evas_la_LIBADD = \
558$(ECORE_X_LIB) \ 590$(ECORE_X_LIB) \
@@ -563,13 +595,17 @@ $(ECORE_SDL_LIB) \
563$(ECORE_SDL_LIBADD) \ 595$(ECORE_SDL_LIBADD) \
564$(ECORE_COCOA_LIB) \ 596$(ECORE_COCOA_LIB) \
565$(ECORE_WINCE_LIB) \ 597$(ECORE_WINCE_LIB) \
598$(ECORE_IPC_LIB) \
566$(ECORE_PSL1GHT_LIB) \ 599$(ECORE_PSL1GHT_LIB) \
600$(ECORE_WAYLAND_LIB) \
601$(ECORE_WAYLAND_LIBADD) \
567$(top_builddir)/src/lib/ecore_input/libecore_input.la \ 602$(top_builddir)/src/lib/ecore_input/libecore_input.la \
568$(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \ 603$(top_builddir)/src/lib/ecore_input_evas/libecore_input_evas.la \
569$(top_builddir)/src/lib/ecore/libecore.la \ 604$(top_builddir)/src/lib/ecore/libecore.la \
570@EVAS_LIBS@ \ 605@EVAS_LIBS@ \
571@EINA_LIBS@ \ 606@EINA_LIBS@ \
572@EVIL_LIBS@ 607@EVIL_LIBS@ \
608@WAYLAND_EGL_LIBS@
573 609
574libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ 610libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
575EXTRA_DIST = \ 611EXTRA_DIST = \
@@ -654,10 +690,13 @@ distclean-compile:
654@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_cocoa.Plo@am__quote@ 690@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_cocoa.Plo@am__quote@
655@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_directfb.Plo@am__quote@ 691@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_directfb.Plo@am__quote@
656@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_ews.Plo@am__quote@ 692@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_ews.Plo@am__quote@
693@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_extn.Plo@am__quote@
657@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_fb.Plo@am__quote@ 694@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_fb.Plo@am__quote@
658@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_psl1ght.Plo@am__quote@ 695@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_psl1ght.Plo@am__quote@
659@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_sdl.Plo@am__quote@ 696@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_sdl.Plo@am__quote@
660@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_util.Plo@am__quote@ 697@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_util.Plo@am__quote@
698@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_wayland_egl.Plo@am__quote@
699@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_wayland_shm.Plo@am__quote@
661@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_win32.Plo@am__quote@ 700@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_win32.Plo@am__quote@
662@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_wince.Plo@am__quote@ 701@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_wince.Plo@am__quote@
663@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_x.Plo@am__quote@ 702@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_x.Plo@am__quote@
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
index dc42f92..2b04488 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
@@ -2,14 +2,21 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <string.h> 6#include <string.h>
6#include <sys/types.h> 7#include <sys/types.h>
7#include <errno.h> 8#include <errno.h>
9#include <sys/stat.h>
10#include <fcntl.h>
8 11
9#ifndef _MSC_VER 12#ifndef _MSC_VER
10# include <unistd.h> 13# include <unistd.h>
11#endif 14#endif
12 15
16#ifdef HAVE_SYS_MMAN_H
17# include <sys/mman.h>
18#endif
19
13#ifdef HAVE_EVIL 20#ifdef HAVE_EVIL
14# include <Evil.h> 21# include <Evil.h>
15#endif 22#endif
@@ -194,6 +201,18 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
194#else 201#else
195 return EINA_FALSE; 202 return EINA_FALSE;
196#endif 203#endif
204 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
205#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
206 return EINA_TRUE;
207#else
208 return EINA_FALSE;
209#endif
210 case ECORE_EVAS_ENGINE_WAYLAND_EGL:
211#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
212 return EINA_TRUE;
213#else
214 return EINA_FALSE;
215#endif
197 default: 216 default:
198 return EINA_FALSE; 217 return EINA_FALSE;
199 }; 218 };
@@ -237,6 +256,8 @@ ecore_evas_init(void)
237 _ecore_evas_ews_events_init(); 256 _ecore_evas_ews_events_init();
238#endif 257#endif
239 258
259 _ecore_evas_extn_init();
260
240 if (getenv("ECORE_EVAS_COMP_NOSYNC")) 261 if (getenv("ECORE_EVAS_COMP_NOSYNC"))
241 _ecore_evas_app_comp_sync = 0; 262 _ecore_evas_app_comp_sync = 0;
242 return _ecore_evas_init_count; 263 return _ecore_evas_init_count;
@@ -257,6 +278,8 @@ ecore_evas_shutdown(void)
257 278
258 while (ecore_evases) _ecore_evas_free(ecore_evases); 279 while (ecore_evases) _ecore_evas_free(ecore_evases);
259 280
281 _ecore_evas_extn_shutdown();
282
260 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown(); 283 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
261 ecore_idle_enterer_del(ecore_evas_idle_enterer); 284 ecore_idle_enterer_del(ecore_evas_idle_enterer);
262 ecore_evas_idle_enterer = NULL; 285 ecore_evas_idle_enterer = NULL;
@@ -282,6 +305,7 @@ ecore_evas_shutdown(void)
282#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE 305#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
283 while (_ecore_evas_wince_shutdown()); 306 while (_ecore_evas_wince_shutdown());
284#endif 307#endif
308
285 if (_ecore_evas_async_events_fd) 309 if (_ecore_evas_async_events_fd)
286 ecore_main_fd_handler_del(_ecore_evas_async_events_fd); 310 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
287 311
@@ -577,6 +601,40 @@ _ecore_evas_constructor_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h
577} 601}
578#endif 602#endif
579 603
604#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
605static Ecore_Evas *
606_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
607{
608 char *disp_name = NULL;
609 unsigned int frame = 0;
610 Ecore_Evas *ee;
611
612 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
613 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
614 ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame);
615 free(disp_name);
616
617 return ee;
618}
619#endif
620
621#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
622static Ecore_Evas *
623_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
624{
625 char *disp_name = NULL;
626 unsigned int frame = 0;
627 Ecore_Evas *ee;
628
629 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
630 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
631 ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame);
632 free(disp_name);
633
634 return ee;
635}
636#endif
637
580#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI 638#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
581static Ecore_Evas * 639static Ecore_Evas *
582_ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options) 640_ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
@@ -714,7 +772,16 @@ static const struct ecore_evas_engine _engines[] = {
714 {"psl1ght", _ecore_evas_constructor_psl1ght}, 772 {"psl1ght", _ecore_evas_constructor_psl1ght},
715#endif 773#endif
716 774
717 /* Last chance to have a window */ 775 /* Wayland */
776#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
777 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
778#endif
779
780#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
781 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
782#endif
783
784 /* Last chance to have a window */
718#ifdef BUILD_ECORE_EVAS_OPENGL_SDL 785#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
719 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl}, 786 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
720#endif 787#endif
@@ -1938,7 +2005,7 @@ ecore_evas_fullscreen_get(const Ecore_Evas *ee)
1938 * Set whether or not an Ecore_Evas' window should avoid damage 2005 * Set whether or not an Ecore_Evas' window should avoid damage
1939 * 2006 *
1940 * @param ee The Ecore_Evas 2007 * @param ee The Ecore_Evas
1941 * @param The type of the damage management 2008 * @param on The type of the damage management
1942 * 2009 *
1943 * This function causes @p ee to be drawn to a pixmap to avoid recalculations. 2010 * This function causes @p ee to be drawn to a pixmap to avoid recalculations.
1944 * On expose events it will copy from the pixmap to the window. 2011 * On expose events it will copy from the pixmap to the window.
@@ -2008,8 +2075,8 @@ ecore_evas_withdrawn_get(const Ecore_Evas *ee)
2008 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, 2075 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2009 "ecore_evas_withdrawn_get"); 2076 "ecore_evas_withdrawn_get");
2010 return EINA_FALSE; 2077 return EINA_FALSE;
2011 } else 2078 }
2012 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE; 2079 return ee->prop.withdrawn ? EINA_TRUE : EINA_FALSE;
2013} 2080}
2014 2081
2015/** 2082/**
@@ -2048,8 +2115,8 @@ ecore_evas_sticky_get(const Ecore_Evas *ee)
2048 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, 2115 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2049 "ecore_evas_sticky_get"); 2116 "ecore_evas_sticky_get");
2050 return EINA_FALSE; 2117 return EINA_FALSE;
2051 } else 2118 }
2052 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE; 2119 return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
2053} 2120}
2054 2121
2055EAPI void 2122EAPI void
@@ -2170,6 +2237,28 @@ ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int
2170 IFE; 2237 IFE;
2171} 2238}
2172 2239
2240EAPI void
2241ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame)
2242{
2243 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2244 {
2245 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_set");
2246 return;
2247 }
2248 ee->prop.draw_frame = draw_frame;
2249}
2250
2251EAPI Eina_Bool
2252ecore_evas_draw_frame_get(const Ecore_Evas *ee)
2253{
2254 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2255 {
2256 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_draw_frame_get");
2257 return EINA_FALSE;
2258 }
2259 return ee->prop.draw_frame;
2260}
2261
2173/* fps debug calls - for debugging how much time your app actually spends */ 2262/* fps debug calls - for debugging how much time your app actually spends */
2174/* rendering graphics... :) */ 2263/* rendering graphics... :) */
2175 2264
@@ -2586,3 +2675,55 @@ ecore_evas_input_event_unregister(Ecore_Evas *ee)
2586{ 2675{
2587 ecore_event_window_unregister((Ecore_Window)ee); 2676 ecore_event_window_unregister((Ecore_Window)ee);
2588} 2677}
2678
2679#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL)
2680EAPI void
2681ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
2682{
2683 if (!ee) return;
2684 if (!strcmp(ee->driver, "wayland_shm"))
2685 {
2686#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2687 _ecore_evas_wayland_shm_resize(ee, location);
2688#endif
2689 }
2690 else if (!strcmp(ee->driver, "wayland_egl"))
2691 {
2692#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2693 _ecore_evas_wayland_egl_resize(ee, location);
2694#endif
2695 }
2696}
2697
2698EAPI void
2699ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
2700{
2701 if ((!ee) || (!source)) return;
2702 if (!ee->engine.wl.surface) return;
2703
2704 if (!strcmp(ee->driver, "wayland_shm"))
2705 {
2706#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2707 _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source);
2708#endif
2709 }
2710 else if (!strcmp(ee->driver, "wayland_egl"))
2711 {
2712#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2713 _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source);
2714#endif
2715 }
2716}
2717#else
2718EAPI void
2719ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
2720{
2721
2722}
2723
2724EAPI void
2725ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__)
2726{
2727
2728}
2729#endif
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c
index a3e49d6..3f82efb 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar! 5// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
6#include <stdlib.h>
6 7
7#include <Ecore.h> 8#include <Ecore.h>
8#include "ecore_private.h" 9#include "ecore_private.h"
@@ -93,6 +94,12 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
93 if (ee->func.fn_resize) ee->func.fn_resize(ee); 94 if (ee->func.fn_resize) ee->func.fn_resize(ee);
94} 95}
95 96
97static void
98_ecore_evas_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int w, int h)
99{
100 _ecore_evas_resize(ee, w, h);
101}
102
96int 103int
97_ecore_evas_buffer_shutdown(void) 104_ecore_evas_buffer_shutdown(void)
98{ 105{
@@ -168,6 +175,14 @@ _ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
168 if (fw < 1) fw = 1; 175 if (fw < 1) fw = 1;
169 if (fh < 1) fh = 1; 176 if (fh < 1) fh = 1;
170 177
178 if (evas_object_map_get(ee->engine.buffer.image) &&
179 evas_object_map_enable_get(ee->engine.buffer.image))
180 {
181 fx = 0; fy = 0;
182 fw = ee->w; fh = ee->h;
183 ww = ee->w; hh = ee->h;
184 }
185
171 if ((fx == 0) && (fy == 0) && (fw == ww) && (fh == hh)) 186 if ((fx == 0) && (fy == 0) && (fw == ww) && (fh == hh))
172 { 187 {
173 *x = (ee->w * (*x - xx)) / fw; 188 *x = (ee->w * (*x - xx)) / fw;
@@ -188,51 +203,80 @@ _ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
188} 203}
189 204
190static void 205static void
191_ecore_evas_buffer_cb_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 206_ecore_evas_buffer_transfer_modifiers_locks(Evas *e, Evas *e2)
207{
208 const char *mods[] =
209 { "Shift", "Control", "Alt", "Meta", "Hyper", "Super", NULL };
210 const char *locks[] =
211 { "Scroll_Lock", "Num_Lock", "Caps_Lock", NULL };
212 int i;
213
214 for (i = 0; mods[i]; i++)
215 {
216 if (evas_key_modifier_is_set(evas_key_modifier_get(e), mods[i]))
217 evas_key_modifier_on(e2, mods[i]);
218 else
219 evas_key_modifier_off(e2, mods[i]);
220 }
221 for (i = 0; locks[i]; i++)
222 {
223 if (evas_key_lock_is_set(evas_key_lock_get(e), locks[i]))
224 evas_key_lock_on(e2, locks[i]);
225 else
226 evas_key_lock_off(e2, locks[i]);
227 }
228}
229
230static void
231_ecore_evas_buffer_cb_mouse_in(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
192{ 232{
193 Ecore_Evas *ee; 233 Ecore_Evas *ee;
194 Evas_Event_Mouse_In *ev; 234 Evas_Event_Mouse_In *ev;
195 235
196 ee = data; 236 ee = data;
197 ev = event_info; 237 ev = event_info;
238 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
198 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); 239 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
199} 240}
200 241
201static void 242static void
202_ecore_evas_buffer_cb_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 243_ecore_evas_buffer_cb_mouse_out(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
203{ 244{
204 Ecore_Evas *ee; 245 Ecore_Evas *ee;
205 Evas_Event_Mouse_Out *ev; 246 Evas_Event_Mouse_Out *ev;
206 247
207 ee = data; 248 ee = data;
208 ev = event_info; 249 ev = event_info;
250 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
209 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 251 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
210} 252}
211 253
212static void 254static void
213_ecore_evas_buffer_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 255_ecore_evas_buffer_cb_mouse_down(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
214{ 256{
215 Ecore_Evas *ee; 257 Ecore_Evas *ee;
216 Evas_Event_Mouse_Down *ev; 258 Evas_Event_Mouse_Down *ev;
217 259
218 ee = data; 260 ee = data;
219 ev = event_info; 261 ev = event_info;
262 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
220 evas_event_feed_mouse_down(ee->evas, ev->button, ev->flags, ev->timestamp, NULL); 263 evas_event_feed_mouse_down(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
221} 264}
222 265
223static void 266static void
224_ecore_evas_buffer_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 267_ecore_evas_buffer_cb_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
225{ 268{
226 Ecore_Evas *ee; 269 Ecore_Evas *ee;
227 Evas_Event_Mouse_Up *ev; 270 Evas_Event_Mouse_Up *ev;
228 271
229 ee = data; 272 ee = data;
230 ev = event_info; 273 ev = event_info;
274 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
231 evas_event_feed_mouse_up(ee->evas, ev->button, ev->flags, ev->timestamp, NULL); 275 evas_event_feed_mouse_up(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
232} 276}
233 277
234static void 278static void
235_ecore_evas_buffer_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 279_ecore_evas_buffer_cb_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
236{ 280{
237 Ecore_Evas *ee; 281 Ecore_Evas *ee;
238 Evas_Event_Mouse_Move *ev; 282 Evas_Event_Mouse_Move *ev;
@@ -243,22 +287,24 @@ _ecore_evas_buffer_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *ob
243 x = ev->cur.canvas.x; 287 x = ev->cur.canvas.x;
244 y = ev->cur.canvas.y; 288 y = ev->cur.canvas.y;
245 _ecore_evas_buffer_coord_translate(ee, &x, &y); 289 _ecore_evas_buffer_coord_translate(ee, &x, &y);
290 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
246 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp); 291 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
247} 292}
248 293
249static void 294static void
250_ecore_evas_buffer_cb_mouse_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 295_ecore_evas_buffer_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
251{ 296{
252 Ecore_Evas *ee; 297 Ecore_Evas *ee;
253 Evas_Event_Mouse_Wheel *ev; 298 Evas_Event_Mouse_Wheel *ev;
254 299
255 ee = data; 300 ee = data;
256 ev = event_info; 301 ev = event_info;
302 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
257 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, ev->timestamp, NULL); 303 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, ev->timestamp, NULL);
258} 304}
259 305
260static void 306static void
261_ecore_evas_buffer_cb_multi_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 307_ecore_evas_buffer_cb_multi_down(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
262{ 308{
263 Ecore_Evas *ee; 309 Ecore_Evas *ee;
264 Evas_Event_Multi_Down *ev; 310 Evas_Event_Multi_Down *ev;
@@ -274,11 +320,12 @@ _ecore_evas_buffer_cb_multi_down(void *data, Evas *e __UNUSED__, Evas_Object *ob
274 _ecore_evas_buffer_coord_translate(ee, &x, &y); 320 _ecore_evas_buffer_coord_translate(ee, &x, &y);
275 xf = (ev->canvas.xsub - (double)xx) + (double)x; 321 xf = (ev->canvas.xsub - (double)xx) + (double)x;
276 yf = (ev->canvas.ysub - (double)yy) + (double)y; 322 yf = (ev->canvas.ysub - (double)yy) + (double)y;
323 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
277 evas_event_feed_multi_down(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL); 324 evas_event_feed_multi_down(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL);
278} 325}
279 326
280static void 327static void
281_ecore_evas_buffer_cb_multi_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 328_ecore_evas_buffer_cb_multi_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
282{ 329{
283 Ecore_Evas *ee; 330 Ecore_Evas *ee;
284 Evas_Event_Multi_Up *ev; 331 Evas_Event_Multi_Up *ev;
@@ -294,11 +341,12 @@ _ecore_evas_buffer_cb_multi_up(void *data, Evas *e __UNUSED__, Evas_Object *obj
294 _ecore_evas_buffer_coord_translate(ee, &x, &y); 341 _ecore_evas_buffer_coord_translate(ee, &x, &y);
295 xf = (ev->canvas.xsub - (double)xx) + (double)x; 342 xf = (ev->canvas.xsub - (double)xx) + (double)x;
296 yf = (ev->canvas.ysub - (double)yy) + (double)y; 343 yf = (ev->canvas.ysub - (double)yy) + (double)y;
344 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
297 evas_event_feed_multi_up(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL); 345 evas_event_feed_multi_up(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL);
298} 346}
299 347
300static void 348static void
301_ecore_evas_buffer_cb_multi_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) 349_ecore_evas_buffer_cb_multi_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
302{ 350{
303 Ecore_Evas *ee; 351 Ecore_Evas *ee;
304 Evas_Event_Multi_Move *ev; 352 Evas_Event_Multi_Move *ev;
@@ -314,6 +362,7 @@ _ecore_evas_buffer_cb_multi_move(void *data, Evas *e __UNUSED__, Evas_Object *ob
314 _ecore_evas_buffer_coord_translate(ee, &x, &y); 362 _ecore_evas_buffer_coord_translate(ee, &x, &y);
315 xf = (ev->cur.canvas.xsub - (double)xx) + (double)x; 363 xf = (ev->cur.canvas.xsub - (double)xx) + (double)x;
316 yf = (ev->cur.canvas.ysub - (double)yy) + (double)y; 364 yf = (ev->cur.canvas.ysub - (double)yy) + (double)y;
365 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
317 evas_event_feed_multi_move(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->timestamp, NULL); 366 evas_event_feed_multi_move(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->timestamp, NULL);
318} 367}
319 368
@@ -334,42 +383,7 @@ _ecore_evas_buffer_cb_key_down(void *data, Evas *e, Evas_Object *obj __UNUSED__,
334 383
335 ee = data; 384 ee = data;
336 ev = event_info; 385 ev = event_info;
337 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Shift")) 386 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
338 evas_key_modifier_on(ee->evas, "Shift");
339 else
340 evas_key_modifier_off(ee->evas, "Shift");
341 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Control"))
342 evas_key_modifier_on(ee->evas, "Control");
343 else
344 evas_key_modifier_off(ee->evas, "Control");
345 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Alt"))
346 evas_key_modifier_on(ee->evas, "Alt");
347 else
348 evas_key_modifier_off(ee->evas, "Alt");
349 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Meta"))
350 evas_key_modifier_on(ee->evas, "Meta");
351 else
352 evas_key_modifier_off(ee->evas, "Meta");
353 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Hyper"))
354 evas_key_modifier_on(ee->evas, "Hyper");
355 else
356 evas_key_modifier_off(ee->evas, "Hyper");
357 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Super"))
358 evas_key_modifier_on(ee->evas, "Super");
359 else
360 evas_key_modifier_off(ee->evas, "Super");
361 if (evas_key_lock_is_set(evas_key_lock_get(e), "Scroll_Lock"))
362 evas_key_lock_on(ee->evas, "Scroll_Lock");
363 else
364 evas_key_lock_off(ee->evas, "Scroll_Lock");
365 if (evas_key_lock_is_set(evas_key_lock_get(e), "Num_Lock"))
366 evas_key_lock_on(ee->evas, "Num_Lock");
367 else
368 evas_key_lock_off(ee->evas, "Num_Lock");
369 if (evas_key_lock_is_set(evas_key_lock_get(e), "Caps_Lock"))
370 evas_key_lock_on(ee->evas, "Caps_Lock");
371 else
372 evas_key_lock_off(ee->evas, "Caps_Lock");
373 evas_event_feed_key_down(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL); 387 evas_event_feed_key_down(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
374} 388}
375 389
@@ -381,42 +395,7 @@ _ecore_evas_buffer_cb_key_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, v
381 395
382 ee = data; 396 ee = data;
383 ev = event_info; 397 ev = event_info;
384 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Shift")) 398 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
385 evas_key_modifier_on(ee->evas, "Shift");
386 else
387 evas_key_modifier_off(ee->evas, "Shift");
388 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Control"))
389 evas_key_modifier_on(ee->evas, "Control");
390 else
391 evas_key_modifier_off(ee->evas, "Control");
392 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Alt"))
393 evas_key_modifier_on(ee->evas, "Alt");
394 else
395 evas_key_modifier_off(ee->evas, "Alt");
396 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Meta"))
397 evas_key_modifier_on(ee->evas, "Meta");
398 else
399 evas_key_modifier_off(ee->evas, "Meta");
400 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Hyper"))
401 evas_key_modifier_on(ee->evas, "Hyper");
402 else
403 evas_key_modifier_off(ee->evas, "Hyper");
404 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Super"))
405 evas_key_modifier_on(ee->evas, "Super");
406 else
407 evas_key_modifier_off(ee->evas, "Super");
408 if (evas_key_lock_is_set(evas_key_lock_get(e), "Scroll_Lock"))
409 evas_key_lock_on(ee->evas, "Scroll_Lock");
410 else
411 evas_key_lock_off(ee->evas, "Scroll_Lock");
412 if (evas_key_lock_is_set(evas_key_lock_get(e), "Num_Lock"))
413 evas_key_lock_on(ee->evas, "Num_Lock");
414 else
415 evas_key_lock_off(ee->evas, "Num_Lock");
416 if (evas_key_lock_is_set(evas_key_lock_get(e), "Caps_Lock"))
417 evas_key_lock_on(ee->evas, "Caps_Lock");
418 else
419 evas_key_lock_off(ee->evas, "Caps_Lock");
420 evas_event_feed_key_up(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL); 399 evas_event_feed_key_up(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
421} 400}
422 401
@@ -469,6 +448,20 @@ _ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
469 ee->alpha = alpha; 448 ee->alpha = alpha;
470 if (ee->engine.buffer.image) 449 if (ee->engine.buffer.image)
471 evas_object_image_alpha_set(ee->engine.buffer.image, ee->alpha); 450 evas_object_image_alpha_set(ee->engine.buffer.image, ee->alpha);
451 else
452 {
453 Evas_Engine_Info_Buffer *einfo;
454
455 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
456 if (einfo)
457 {
458 if (ee->alpha)
459 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
460 else
461 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
462 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
463 }
464 }
472} 465}
473 466
474static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = 467static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
@@ -491,7 +484,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
491 NULL, 484 NULL,
492 NULL, 485 NULL,
493 _ecore_evas_resize, 486 _ecore_evas_resize,
494 NULL, 487 _ecore_evas_move_resize,
495 NULL, 488 NULL,
496 NULL, 489 NULL,
497 _ecore_evas_show, 490 _ecore_evas_show,
@@ -520,7 +513,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
520 _ecore_evas_buffer_alpha_set, 513 _ecore_evas_buffer_alpha_set,
521 NULL, //transparent 514 NULL, //transparent
522 515
523 NULL, // render 516 _ecore_evas_buffer_render,
524 NULL // screen_geometry_get 517 NULL // screen_geometry_get
525}; 518};
526#endif 519#endif
@@ -604,7 +597,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
604 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas); 597 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
605 if (einfo) 598 if (einfo)
606 { 599 {
607 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32; 600 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
608 einfo->info.dest_buffer = ee->engine.buffer.pixels; 601 einfo->info.dest_buffer = ee->engine.buffer.pixels;
609 einfo->info.dest_buffer_row_bytes = ee->w * sizeof(int); 602 einfo->info.dest_buffer_row_bytes = ee->w * sizeof(int);
610 einfo->info.use_color_key = 0; 603 einfo->info.use_color_key = 0;
@@ -636,7 +629,6 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
636 629
637 evas_event_feed_mouse_in(ee->evas, 0, NULL); 630 evas_event_feed_mouse_in(ee->evas, 0, NULL);
638 631
639 ee->engine.func->fn_render = _ecore_evas_buffer_render;
640 _ecore_evas_register(ee); 632 _ecore_evas_register(ee);
641 633
642 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 634 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
@@ -818,8 +810,6 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
818 810
819 ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee); 811 ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
820 812
821 ee->engine.func->fn_render = _ecore_evas_buffer_render;
822
823 return o; 813 return o;
824#else 814#else
825 return NULL; 815 return NULL;
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c
index 1f946d5..36d41f8 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c
@@ -568,7 +568,7 @@ ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
568#else 568#else
569 ERR("Cocoa support in ecore-evas not enabled"); 569 ERR("Cocoa support in ecore-evas not enabled");
570 return NULL; 570 return NULL;
571 parent = NULL; 571 (void) parent;
572 x = y = w = h = 0; 572 (void) x; (void) y; (void) w; (void) h;
573#endif 573#endif
574} 574}
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c
index e19fb05..eccf98b 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c
@@ -2,6 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
6#include <string.h>
7#include <sys/types.h>
8
9#include <Eina.h>
5#include <Ecore.h> 10#include <Ecore.h>
6#include "ecore_private.h" 11#include "ecore_private.h"
7#include <Ecore_Input.h> 12#include <Ecore_Input.h>
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c
new file mode 100644
index 0000000..e46ab4a
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c
@@ -0,0 +1,2152 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <unistd.h>
7
8#include <Ecore.h>
9#include "ecore_private.h"
10#include <Ecore_Input.h>
11
12#ifdef BUILD_ECORE_IPC
13# ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
14# define EXTN_ENABLED 1
15# endif
16#endif
17
18#include "ecore_evas_private.h"
19#include "Ecore_Evas.h"
20#ifdef EXTN_ENABLED
21#include "Ecore_Ipc.h"
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <sys/types.h>
26#include <unistd.h>
27#include <math.h>
28#include <time.h>
29#include <sys/mman.h>
30#include <sys/stat.h>
31#include <fcntl.h>
32#include <string.h>
33#include <sys/file.h>
34
35typedef struct _Shmfile Shmfile;
36
37struct _Shmfile
38{
39 int fd;
40 int size;
41 void *addr;
42 const char *file;
43};
44
45static int blank = 0x00000000;
46
47static Shmfile *
48shmfile_new(const char *base, int id, int size, Eina_Bool sys)
49{
50 Shmfile *sf;
51 char file[PATH_MAX];
52
53 sf = calloc(1, sizeof(Shmfile));
54 do
55 {
56 mode_t mode;
57
58 snprintf(file, sizeof(file), "/%s-%i-%i.%i.%i",
59 base, id, (int)time(NULL), (int)getpid(), (int)rand());
60 mode = S_IRUSR | S_IWUSR;
61 if (sys) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
62 sf->fd = shm_open(file, O_RDWR | O_CREAT | O_EXCL, mode);
63 }
64 while (sf->fd < 0);
65
66 sf->file = eina_stringshare_add(file);
67 if (!sf->file)
68 {
69 close(sf->fd);
70 shm_unlink(sf->file);
71 eina_stringshare_del(sf->file);
72 free(sf);
73 return NULL;
74 }
75 sf->size = size;
76 if (ftruncate(sf->fd, size) < 0)
77 {
78 close(sf->fd);
79 shm_unlink(sf->file);
80 eina_stringshare_del(sf->file);
81 free(sf);
82 return NULL;
83 }
84 sf->addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd, 0);
85 if (sf->addr == MAP_FAILED)
86 {
87 close(sf->fd);
88 shm_unlink(sf->file);
89 eina_stringshare_del(sf->file);
90 free(sf);
91 return NULL;
92 }
93 return sf;
94}
95
96void
97shmfile_free(Shmfile *sf)
98{
99 munmap(sf->addr, sf->size);
100 close(sf->fd);
101 shm_unlink(sf->file);
102 eina_stringshare_del(sf->file);
103 free(sf);
104}
105
106static Shmfile *
107shmfile_open(const char *ref, int size, Eina_Bool sys)
108{
109 Shmfile *sf;
110 mode_t mode;
111
112 sf = calloc(1, sizeof(Shmfile));
113 mode = S_IRUSR | S_IWUSR;
114 if (sys) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
115 sf->fd = shm_open(ref, O_RDWR, mode);
116 if (sf->fd < 0)
117 {
118 free(sf);
119 return NULL;
120 }
121 sf->file = eina_stringshare_add(ref);
122 if (!sf->file)
123 {
124 close(sf->fd);
125 eina_stringshare_del(sf->file);
126 free(sf);
127 return NULL;
128 }
129 sf->size = size;
130 sf->addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd, 0);
131 if (sf->addr == MAP_FAILED)
132 {
133 close(sf->fd);
134 eina_stringshare_del(sf->file);
135 free(sf);
136 return NULL;
137 }
138 return sf;
139}
140
141void
142shmfile_close(Shmfile *sf)
143{
144 munmap(sf->addr, sf->size);
145 close(sf->fd);
146 eina_stringshare_del(sf->file);
147 free(sf);
148}
149
150// procotol version - change this as needed
151#define MAJOR 0x1011
152
153enum // opcodes
154{
155 OP_RESIZE,
156 OP_SHOW,
157 OP_HIDE,
158 OP_FOCUS,
159 OP_UNFOCUS,
160 OP_UPDATE,
161 OP_UPDATE_DONE,
162 OP_LOCK_FILE,
163 OP_SHM_REF,
164 OP_EV_MOUSE_IN,
165 OP_EV_MOUSE_OUT,
166 OP_EV_MOUSE_UP,
167 OP_EV_MOUSE_DOWN,
168 OP_EV_MOUSE_MOVE,
169 OP_EV_MOUSE_WHEEL,
170 OP_EV_MULTI_UP,
171 OP_EV_MULTI_DOWN,
172 OP_EV_MULTI_MOVE,
173 OP_EV_KEY_UP,
174 OP_EV_KEY_DOWN,
175 OP_EV_HOLD
176};
177
178enum
179{
180 MOD_SHIFT = (1 << 0),
181 MOD_CTRL = (1 << 1),
182 MOD_ALT = (1 << 2),
183 MOD_META = (1 << 3),
184 MOD_HYPER = (1 << 4),
185 MOD_SUPER = (1 << 5),
186 MOD_CAPS = (1 << 6),
187 MOD_NUM = (1 << 7),
188 MOD_SCROLL = (1 << 8),
189};
190
191typedef struct _Ipc_Data_Resize Ipc_Data_Resize;
192typedef struct _Ipc_Data_Update Ipc_Data_Update;
193typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In;
194typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out;
195typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up;
196typedef struct _Ipc_Data_Ev_Mouse_Down Ipc_Data_Ev_Mouse_Down;
197typedef struct _Ipc_Data_Ev_Mouse_Move Ipc_Data_Ev_Mouse_Move;
198typedef struct _Ipc_Data_Ev_Mouse_Wheel Ipc_Data_Ev_Mouse_Wheel;
199typedef struct _Ipc_Data_Ev_Hold Ipc_Data_Ev_Hold;
200typedef struct _Ipc_Data_Ev_Multi_Up Ipc_Data_Ev_Multi_Up;
201typedef struct _Ipc_Data_Ev_Multi_Down Ipc_Data_Ev_Multi_Down;
202typedef struct _Ipc_Data_Ev_Multi_Move Ipc_Data_Ev_Multi_Move;
203typedef struct _Ipc_Data_Ev_Key_Up Ipc_Data_Ev_Key_Up;
204typedef struct _Ipc_Data_Ev_Key_Down Ipc_Data_Ev_Key_Down;
205
206struct _Ipc_Data_Resize
207{
208 int w, h;
209};
210
211struct _Ipc_Data_Update
212{
213 int x, w, y, h;
214};
215
216struct _Ipc_Data_Ev_Mouse_In
217{
218 unsigned int timestamp;
219 int mask;
220 Evas_Event_Flags event_flags;
221};
222
223struct _Ipc_Data_Ev_Mouse_Out
224{
225 unsigned int timestamp;
226 int mask;
227 Evas_Event_Flags event_flags;
228};
229
230struct _Ipc_Data_Ev_Mouse_Up
231{
232 int b;
233 Evas_Button_Flags flags;
234 int mask;
235 unsigned int timestamp;
236 Evas_Event_Flags event_flags;
237};
238
239struct _Ipc_Data_Ev_Mouse_Down
240{
241 int b;
242 Evas_Button_Flags flags;
243 int mask;
244 unsigned int timestamp;
245 Evas_Event_Flags event_flags;
246};
247
248struct _Ipc_Data_Ev_Mouse_Move
249{
250 int x, y;
251 Evas_Button_Flags flags;
252 int mask;
253 unsigned int timestamp;
254 Evas_Event_Flags event_flags;
255};
256
257struct _Ipc_Data_Ev_Mouse_Wheel
258{
259 int direction, z;
260 Evas_Button_Flags flags;
261 int mask;
262 unsigned int timestamp;
263 Evas_Event_Flags event_flags;
264};
265
266struct _Ipc_Data_Ev_Hold
267{
268 int hold;
269 unsigned int timestamp;
270 Evas_Event_Flags event_flags;
271};
272
273struct _Ipc_Data_Ev_Multi_Up
274{
275 Evas_Button_Flags flags;
276 int d, x, y;
277 double rad, radx, rady, pres, ang, fx, fy;
278 int mask;
279 unsigned int timestamp;
280 Evas_Event_Flags event_flags;
281};
282
283struct _Ipc_Data_Ev_Multi_Down
284{
285 Evas_Button_Flags flags;
286 int d, x, y;
287 double rad, radx, rady, pres, ang, fx, fy;
288 int mask;
289 unsigned int timestamp;
290 Evas_Event_Flags event_flags;
291};
292
293struct _Ipc_Data_Ev_Multi_Move
294{
295 int d, x, y;
296 double rad, radx, rady, pres, ang, fx, fy;
297 int mask;
298 unsigned int timestamp;
299 Evas_Event_Flags event_flags;
300};
301
302struct _Ipc_Data_Ev_Key_Up
303{
304 const char *keyname, *key, *string, *compose;
305 int mask;
306 unsigned int timestamp;
307 Evas_Event_Flags event_flags;
308};
309
310struct _Ipc_Data_Ev_Key_Down
311{
312 const char *keyname, *key, *string, *compose;
313 int mask;
314 unsigned int timestamp;
315 Evas_Event_Flags event_flags;
316};
317
318typedef struct _Extn Extn;
319
320struct _Extn
321{
322 struct {
323 Ecore_Ipc_Server *server;
324 Eina_List *clients;
325 Eina_List *handlers;
326 Eina_Bool am_server : 1;
327 } ipc;
328 struct {
329 const char *name;
330 int num;
331 Eina_Bool sys : 1;
332 } svc;
333 struct {
334 const char *lock;
335 int lockfd;
336 const char *shm;
337 int w, h;
338 Shmfile *shmfile;
339 Eina_List *updates;
340 Eina_Bool have_lock : 1;
341 } file;
342};
343
344static Eina_List *extn_ee_list = NULL;
345
346EAPI int ECORE_EVAS_EXTN_CLIENT_ADD = 0;
347EAPI int ECORE_EVAS_EXTN_CLIENT_DEL = 0;
348
349void
350_ecore_evas_extn_init(void)
351{
352 if (ECORE_EVAS_EXTN_CLIENT_ADD) return;
353 ECORE_EVAS_EXTN_CLIENT_ADD = ecore_event_type_new();
354 ECORE_EVAS_EXTN_CLIENT_DEL = ecore_event_type_new();
355}
356
357void
358_ecore_evas_extn_shutdown(void)
359{
360}
361
362static void
363_ecore_evas_extn_event_free(void *data, void *ev __UNUSED__)
364{
365 Ecore_Evas *ee = data;
366 if (ee->engine.buffer.image)
367 evas_object_unref(ee->engine.buffer.image);
368 _ecore_evas_unref(ee);
369}
370
371static void
372_ecore_evas_extn_event(Ecore_Evas *ee, int event)
373{
374 _ecore_evas_ref(ee);
375 if (ee->engine.buffer.image)
376 evas_object_ref(ee->engine.buffer.image);
377 ecore_event_add(event, ee->engine.buffer.image,
378 _ecore_evas_extn_event_free, ee);
379}
380
381static void
382_ecore_evas_socket_lock(Ecore_Evas *ee)
383{
384 Extn *extn;
385
386 extn = ee->engine.buffer.data;
387 if (!extn) return;
388 if (extn->file.lockfd < 0) return;
389 if (extn->file.have_lock) return;
390 flock(extn->file.lockfd, LOCK_EX);
391 extn->file.have_lock = EINA_TRUE;
392}
393
394static void
395_ecore_evas_socket_unlock(Ecore_Evas *ee)
396{
397 Extn *extn;
398
399 extn = ee->engine.buffer.data;
400 if (!extn) return;
401 if (extn->file.lockfd < 0) return;
402 if (!extn->file.have_lock) return;
403 flock(extn->file.lockfd, LOCK_UN);
404 extn->file.have_lock = EINA_FALSE;
405}
406
407static void
408_ecore_evas_extn_plug_targer_render_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
409{
410 Ecore_Evas *ee = data;
411 if (ee) _ecore_evas_socket_lock(ee);
412}
413
414static void
415_ecore_evas_extn_plug_targer_render_post(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
416{
417 Ecore_Evas *ee = data;
418 if (ee) _ecore_evas_socket_unlock(ee);
419}
420
421static void
422_ecore_evas_extn_plug_image_obj_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
423{
424 Ecore_Evas *ee = data;
425 if (ee) ecore_evas_free(ee);
426}
427
428static void
429_ecore_evas_extn_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
430{
431 Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
432
433 evas_object_geometry_get(ee->engine.buffer.image, &xx, &yy, &ww, &hh);
434 evas_object_image_fill_get(ee->engine.buffer.image, &fx, &fy, &fw, &fh);
435
436 if (fw < 1) fw = 1;
437 if (fh < 1) fh = 1;
438
439 if (evas_object_map_get(ee->engine.buffer.image) &&
440 evas_object_map_enable_get(ee->engine.buffer.image))
441 {
442 fx = 0; fy = 0;
443 fw = ee->w; fh = ee->h;
444 ww = ee->w; hh = ee->h;
445 }
446
447 if ((fx == 0) && (fy == 0) && (fw == ww) && (fh == hh))
448 {
449 *x = (ee->w * (*x - xx)) / fw;
450 *y = (ee->h * (*y - yy)) / fh;
451 }
452 else
453 {
454 xx = (*x - xx) - fx;
455 while (xx < 0) xx += fw;
456 while (xx > fw) xx -= fw;
457 *x = (ee->w * xx) / fw;
458
459 yy = (*y - yy) - fy;
460 while (yy < 0) yy += fh;
461 while (yy > fh) yy -= fh;
462 *y = (ee->h * yy) / fh;
463 }
464}
465
466static void
467_ecore_evas_extn_free(Ecore_Evas *ee)
468{
469 Extn *extn;
470 Ecore_Ipc_Client *client;
471
472 extn = ee->engine.buffer.data;
473 if (extn)
474 {
475 Ecore_Event_Handler *hdl;
476
477 if (extn->file.have_lock)
478 _ecore_evas_socket_unlock(ee);
479 if (extn->file.lockfd)
480 {
481 close(extn->file.lockfd);
482 if (extn->ipc.am_server)
483 {
484 if (extn->file.lock) unlink(extn->file.lock);
485 }
486 }
487 if (extn->svc.name) eina_stringshare_del(extn->svc.name);
488 if (extn->ipc.clients)
489 {
490 EINA_LIST_FREE(extn->ipc.clients, client)
491 ecore_ipc_client_del(client);
492 }
493 if (extn->ipc.server) ecore_ipc_server_del(extn->ipc.server);
494 if (extn->file.lock) eina_stringshare_del(extn->file.lock);
495 if (extn->file.shm) eina_stringshare_del(extn->file.shm);
496 if (extn->file.shmfile)
497 {
498 if (extn->ipc.am_server)
499 shmfile_free(extn->file.shmfile);
500 else
501 shmfile_close(extn->file.shmfile);
502 }
503
504 EINA_LIST_FREE(extn->ipc.handlers, hdl)
505 ecore_event_handler_del(hdl);
506 free(extn);
507 ecore_ipc_shutdown();
508 ee->engine.buffer.data = NULL;
509 }
510 if (ee->engine.buffer.image)
511 {
512 Ecore_Evas *ee2;
513
514 evas_object_event_callback_del_full(ee->engine.buffer.image,
515 EVAS_CALLBACK_DEL,
516 _ecore_evas_extn_plug_image_obj_del,
517 ee);
518 evas_event_callback_del_full(evas_object_evas_get(ee->engine.buffer.image),
519 EVAS_CALLBACK_RENDER_PRE,
520 _ecore_evas_extn_plug_targer_render_pre,
521 ee);
522 evas_event_callback_del_full(evas_object_evas_get(ee->engine.buffer.image),
523 EVAS_CALLBACK_RENDER_POST,
524 _ecore_evas_extn_plug_targer_render_post,
525 ee);
526 evas_object_del(ee->engine.buffer.image);
527 ee2 = evas_object_data_get(ee->engine.buffer.image, "Ecore_Evas_Parent");
528 if (ee2)
529 {
530 ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
531 }
532 }
533 extn_ee_list = eina_list_remove(extn_ee_list, ee);
534}
535
536static void
537_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
538{
539 if (w < 1) w = 1;
540 if (h < 1) h = 1;
541 ee->req.w = w;
542 ee->req.h = h;
543 if ((w == ee->w) && (h == ee->h)) return;
544 ee->w = w;
545 ee->h = h;
546
547 /*
548 * No need for it if not used later.
549 Extn *extn;
550
551 extn = ee->engine.buffer.data;
552 */
553 if (ee->engine.buffer.image)
554 evas_object_image_size_set(ee->engine.buffer.image, ee->w, ee->h);
555 /* Server can have many plugs, so I block resize comand from client to server *
556 if ((extn) && (extn->ipc.server))
557 {
558 Ipc_Data_Resize ipc;
559
560 ipc.w = ee->w;
561 ipc.h = ee->h;
562 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_RESIZE, 0, 0, 0, &ipc, sizeof(ipc));
563 }*/
564 if (ee->func.fn_resize) ee->func.fn_resize(ee);
565}
566
567static void
568_ecore_evas_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int w, int h)
569{
570 _ecore_evas_resize(ee, w, h);
571}
572
573static int
574_ecore_evas_modifiers_locks_mask_get(Evas *e)
575{
576 int mask = 0;
577
578 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Shift"))
579 mask |= MOD_SHIFT;
580 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Control"))
581 mask |= MOD_CTRL;
582 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Alt"))
583 mask |= MOD_ALT;
584 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Meta"))
585 mask |= MOD_META;
586 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Hyper"))
587 mask |= MOD_HYPER;
588 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Super"))
589 mask |= MOD_SUPER;
590 if (evas_key_lock_is_set(evas_key_lock_get(e), "Scroll_Lock"))
591 mask |= MOD_SCROLL;
592 if (evas_key_lock_is_set(evas_key_lock_get(e), "Num_Lock"))
593 mask |= MOD_NUM;
594 if (evas_key_lock_is_set(evas_key_lock_get(e), "Caps_Lock"))
595 mask |= MOD_CAPS;
596 return mask;
597}
598
599static void
600_ecore_evas_modifiers_locks_mask_set(Evas *e, int mask)
601{
602 if (mask & MOD_SHIFT) evas_key_modifier_on (e, "Shift");
603 else evas_key_modifier_off(e, "Shift");
604 if (mask & MOD_CTRL) evas_key_modifier_on (e, "Control");
605 else evas_key_modifier_off(e, "Control");
606 if (mask & MOD_ALT) evas_key_modifier_on (e, "Alt");
607 else evas_key_modifier_off(e, "Alt");
608 if (mask & MOD_META) evas_key_modifier_on (e, "Meta");
609 else evas_key_modifier_off(e, "Meta");
610 if (mask & MOD_HYPER) evas_key_modifier_on (e, "Hyper");
611 else evas_key_modifier_off(e, "Hyper");
612 if (mask & MOD_SUPER) evas_key_modifier_on (e, "Super");
613 else evas_key_modifier_off(e, "Super");
614 if (mask & MOD_SCROLL) evas_key_lock_on (e, "Scroll_Lock");
615 else evas_key_lock_off(e, "Scroll_Lock");
616 if (mask & MOD_NUM) evas_key_lock_on (e, "Num_Lock");
617 else evas_key_lock_off(e, "Num_Lock");
618 if (mask & MOD_CAPS) evas_key_lock_on (e, "Caps_Lock");
619 else evas_key_lock_off(e, "Caps_Lock");
620}
621
622static void
623_ecore_evas_extn_cb_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
624{
625 Ecore_Evas *ee = data;
626 Evas_Event_Mouse_In *ev = event_info;
627 Extn *extn;
628
629 extn = ee->engine.buffer.data;
630 if (!extn) return;
631 if (extn->ipc.server)
632 {
633 Ipc_Data_Ev_Mouse_In ipc;
634
635 ipc.timestamp = ev->timestamp;
636 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
637 ipc.event_flags = ev->event_flags;
638 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_IN, 0, 0, 0, &ipc, sizeof(ipc));
639 }
640}
641
642static void
643_ecore_evas_extn_cb_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
644{
645 Ecore_Evas *ee = data;
646 Evas_Event_Mouse_Out *ev = event_info;
647 Extn *extn;
648
649 extn = ee->engine.buffer.data;
650 if (!extn) return;
651 if (extn->ipc.server)
652 {
653 Ipc_Data_Ev_Mouse_Out ipc;
654
655 ipc.timestamp = ev->timestamp;
656 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
657 ipc.event_flags = ev->event_flags;
658 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_OUT, 0, 0, 0, &ipc, sizeof(ipc));
659 }
660}
661
662static void
663_ecore_evas_extn_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
664{
665 Ecore_Evas *ee = data;
666 Evas_Event_Mouse_Down *ev = event_info;
667 Extn *extn;
668
669 extn = ee->engine.buffer.data;
670 if (!extn) return;
671 if (extn->ipc.server)
672 {
673 Ipc_Data_Ev_Mouse_Down ipc;
674
675 ipc.b = ev->button;
676 ipc.flags = ev->flags;
677 ipc.timestamp = ev->timestamp;
678 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
679 ipc.event_flags = ev->event_flags;
680 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_DOWN, 0, 0, 0, &ipc, sizeof(ipc));
681 }
682}
683
684static void
685_ecore_evas_extn_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
686{
687 Ecore_Evas *ee = data;
688 Evas_Event_Mouse_Up *ev = event_info;
689 Extn *extn;
690
691 extn = ee->engine.buffer.data;
692 if (!extn) return;
693 if (extn->ipc.server)
694 {
695 Ipc_Data_Ev_Mouse_Up ipc;
696
697 ipc.b = ev->button;
698 ipc.flags = ev->flags;
699 ipc.timestamp = ev->timestamp;
700 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
701 ipc.event_flags = ev->event_flags;
702 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_UP, 0, 0, 0, &ipc, sizeof(ipc));
703 }
704}
705
706static void
707_ecore_evas_extn_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
708{
709 Ecore_Evas *ee = data;
710 Evas_Event_Mouse_Move *ev = event_info;
711 Extn *extn;
712
713 extn = ee->engine.buffer.data;
714 if (!extn) return;
715 if (extn->ipc.server)
716 {
717 Ipc_Data_Ev_Mouse_Move ipc;
718 Evas_Coord x, y;
719
720 x = ev->cur.canvas.x;
721 y = ev->cur.canvas.y;
722 _ecore_evas_extn_coord_translate(ee, &x, &y);
723 ipc.x = x;
724 ipc.y = y;
725 ipc.timestamp = ev->timestamp;
726 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
727 ipc.event_flags = ev->event_flags;
728 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_MOVE, 0, 0, 0, &ipc, sizeof(ipc));
729 }
730}
731
732static void
733_ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
734{
735 Ecore_Evas *ee = data;
736 Evas_Event_Mouse_Wheel *ev = event_info;
737 Extn *extn;
738
739 extn = ee->engine.buffer.data;
740 if (!extn) return;
741 if (extn->ipc.server)
742 {
743 Ipc_Data_Ev_Mouse_Wheel ipc;
744
745 ipc.direction = ev->direction;
746 ipc.z = ev->z;
747 ipc.timestamp = ev->timestamp;
748 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
749 ipc.event_flags = ev->event_flags;
750 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MOUSE_WHEEL, 0, 0, 0, &ipc, sizeof(ipc));
751 }
752}
753
754static void
755_ecore_evas_extn_cb_multi_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
756{
757 Ecore_Evas *ee = data;
758 Evas_Event_Multi_Down *ev = event_info;
759 Extn *extn;
760
761 extn = ee->engine.buffer.data;
762 if (!extn) return;
763 if (extn->ipc.server)
764 {
765 Ipc_Data_Ev_Multi_Down ipc;
766 Evas_Coord x, y;
767
768 ipc.d = ev->device;
769 x = ev->canvas.x;
770 y = ev->canvas.y;
771 _ecore_evas_extn_coord_translate(ee, &x, &y);
772 ipc.x = x;
773 ipc.y = y;
774 ipc.rad = ev->radius;
775 ipc.radx = ev->radius_x;
776 ipc.rady = ev->radius_y;
777 ipc.pres = ev->pressure;
778 ipc.ang = ev->angle;
779 ipc.fx = ev->canvas.xsub;
780 ipc.fy = ev->canvas.ysub;
781 ipc.flags = ev->flags;
782 ipc.timestamp = ev->timestamp;
783 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
784 ipc.event_flags = ev->event_flags;
785 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_DOWN, 0, 0, 0, &ipc, sizeof(ipc));
786 }
787}
788
789
790static void
791_ecore_evas_extn_cb_multi_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
792{
793 Ecore_Evas *ee = data;
794 Evas_Event_Multi_Up *ev = event_info;
795 Extn *extn;
796
797 extn = ee->engine.buffer.data;
798 if (!extn) return;
799 if (extn->ipc.server)
800 {
801 Ipc_Data_Ev_Multi_Up ipc;
802 Evas_Coord x, y;
803
804 ipc.d = ev->device;
805 x = ev->canvas.x;
806 y = ev->canvas.y;
807 _ecore_evas_extn_coord_translate(ee, &x, &y);
808 ipc.x = x;
809 ipc.y = y;
810 ipc.rad = ev->radius;
811 ipc.radx = ev->radius_x;
812 ipc.rady = ev->radius_y;
813 ipc.pres = ev->pressure;
814 ipc.ang = ev->angle;
815 ipc.fx = ev->canvas.xsub;
816 ipc.fy = ev->canvas.ysub;
817 ipc.flags = ev->flags;
818 ipc.timestamp = ev->timestamp;
819 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
820 ipc.event_flags = ev->event_flags;
821 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_UP, 0, 0, 0, &ipc, sizeof(ipc));
822 }
823}
824
825static void
826_ecore_evas_extn_cb_multi_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
827{
828 Ecore_Evas *ee = data;
829 Evas_Event_Multi_Move *ev = event_info;
830 Extn *extn;
831
832 extn = ee->engine.buffer.data;
833 if (!extn) return;
834 if (extn->ipc.server)
835 {
836 Ipc_Data_Ev_Multi_Move ipc;
837 Evas_Coord x, y;
838
839 ipc.d = ev->device;
840 x = ev->cur.canvas.x;
841 y = ev->cur.canvas.y;
842 _ecore_evas_extn_coord_translate(ee, &x, &y);
843 ipc.x = x;
844 ipc.y = y;
845 ipc.rad = ev->radius;
846 ipc.radx = ev->radius_x;
847 ipc.rady = ev->radius_y;
848 ipc.pres = ev->pressure;
849 ipc.ang = ev->angle;
850 ipc.fx = ev->cur.canvas.xsub;
851 ipc.fy = ev->cur.canvas.ysub;
852 ipc.timestamp = ev->timestamp;
853 ipc.mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
854 ipc.event_flags = ev->event_flags;
855 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_MULTI_MOVE, 0, 0, 0, &ipc, sizeof(ipc));
856 }
857}
858
859static void
860_ecore_evas_extn_cb_free(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
861{
862 Ecore_Evas *ee;
863
864 ee = data;
865 if (ee->driver) _ecore_evas_free(ee);
866}
867
868static void
869_ecore_evas_extn_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
870{
871 Ecore_Evas *ee = data;
872 Evas_Event_Key_Down *ev = event_info;
873 Extn *extn;
874
875 extn = ee->engine.buffer.data;
876 if (!extn) return;
877 if (extn->ipc.server)
878 {
879 Ipc_Data_Ev_Key_Down *ipc;
880 char *st, *p;
881 int len = 0;
882
883 len = sizeof(Ipc_Data_Ev_Key_Down);
884 if (ev->key) len += strlen(ev->key) + 1;
885 if (ev->keyname) len += strlen(ev->keyname) + 1;
886 if (ev->string) len += strlen(ev->string) + 1;
887 if (ev->compose) len += strlen(ev->compose) + 1;
888 len += 1;
889 st = alloca(len);
890 ipc = (Ipc_Data_Ev_Key_Down *)st;
891 memset(st, 0, len);
892 p = st + sizeof(Ipc_Data_Ev_Key_Down);
893 if (ev->key)
894 {
895 strcpy(p, ev->key);
896 ipc->key = p - (long)st;
897 p += strlen(p) + 1;
898 }
899 if (ev->keyname)
900 {
901 strcpy(p, ev->keyname);
902 ipc->keyname = p - (long)st;
903 p += strlen(p) + 1;
904 }
905 if (ev->string)
906 {
907 strcpy(p, ev->string);
908 ipc->string = p - (long)st;
909 p += strlen(p) + 1;
910 }
911 if (ev->compose)
912 {
913 strcpy(p, ev->compose);
914 ipc->compose = p - (long)st;
915 p += strlen(p) + 1;
916 }
917 ipc->timestamp = ev->timestamp;
918 ipc->mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
919 ipc->event_flags = ev->event_flags;
920 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_KEY_DOWN, 0, 0, 0, ipc, len);
921 }
922}
923
924static void
925_ecore_evas_extn_cb_key_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
926{
927 Ecore_Evas *ee = data;
928 Evas_Event_Key_Up *ev = event_info;
929 Extn *extn;
930
931 extn = ee->engine.buffer.data;
932 if (!extn) return;
933 if (extn->ipc.server)
934 {
935 Ipc_Data_Ev_Key_Up *ipc;
936 char *st, *p;
937 int len = 0;
938
939 len = sizeof(Ipc_Data_Ev_Key_Up);
940 if (ev->key) len += strlen(ev->key) + 1;
941 if (ev->keyname) len += strlen(ev->keyname) + 1;
942 if (ev->string) len += strlen(ev->string) + 1;
943 if (ev->compose) len += strlen(ev->compose) + 1;
944 len += 1;
945 st = alloca(len);
946 ipc = (Ipc_Data_Ev_Key_Up *)st;
947 memset(st, 0, len);
948 p = st + sizeof(Ipc_Data_Ev_Key_Down);
949 if (ev->key)
950 {
951 strcpy(p, ev->key);
952 ipc->key = p - (long)st;
953 p += strlen(p) + 1;
954 }
955 if (ev->keyname)
956 {
957 strcpy(p, ev->keyname);
958 ipc->keyname = p - (long)st;
959 p += strlen(p) + 1;
960 }
961 if (ev->string)
962 {
963 strcpy(p, ev->string);
964 ipc->string = p - (long)st;
965 p += strlen(p) + 1;
966 }
967 if (ev->compose)
968 {
969 strcpy(p, ev->compose);
970 ipc->compose = p - (long)st;
971 p += strlen(p) + 1;
972 }
973 ipc->timestamp = ev->timestamp;
974 ipc->mask = _ecore_evas_modifiers_locks_mask_get(ee->evas);
975 ipc->event_flags = ev->event_flags;
976 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_KEY_UP, 0, 0, 0, ipc, len);
977 }
978}
979
980static void
981_ecore_evas_extn_cb_hold(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
982{
983 Ecore_Evas *ee = data;
984 Evas_Event_Hold *ev = event_info;
985 Extn *extn;
986
987 extn = ee->engine.buffer.data;
988 if (!extn) return;
989 if (extn->ipc.server)
990 {
991 Ipc_Data_Ev_Hold ipc;
992
993 ipc.hold = ev->hold;
994 ipc.timestamp = ev->timestamp;
995 ipc.event_flags = ev->event_flags;
996 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_EV_HOLD, 0, 0, 0, &ipc, sizeof(ipc));
997 }
998}
999
1000static void
1001_ecore_evas_extn_cb_focus_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1002{
1003 Ecore_Evas *ee;
1004 Extn *extn;
1005
1006 ee = data;
1007 ee->prop.focused = 1;
1008 extn = ee->engine.buffer.data;
1009 if (!extn) return;
1010 if (!extn->ipc.server) return;
1011 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_FOCUS, 0, 0, 0, NULL, 0);
1012}
1013
1014static void
1015_ecore_evas_extn_cb_focus_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1016{
1017 Ecore_Evas *ee;
1018 Extn *extn;
1019
1020 ee = data;
1021 ee->prop.focused = 0;
1022 extn = ee->engine.buffer.data;
1023 if (!extn) return;
1024 if (!extn->ipc.server) return;
1025 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_UNFOCUS, 0, 0, 0, NULL, 0);
1026}
1027
1028static void
1029_ecore_evas_extn_cb_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1030{
1031 Ecore_Evas *ee;
1032 Extn *extn;
1033
1034 ee = data;
1035 ee->visible = 1;
1036 extn = ee->engine.buffer.data;
1037 if (!extn) return;
1038 if (!extn->ipc.server) return;
1039 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_SHOW, 0, 0, 0, NULL, 0);
1040}
1041
1042static void
1043_ecore_evas_extn_cb_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1044{
1045 Ecore_Evas *ee;
1046 Extn *extn;
1047
1048 ee = data;
1049 ee->visible = 0;
1050 extn = ee->engine.buffer.data;
1051 if (!extn) return;
1052 if (!extn->ipc.server) return;
1053 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
1054}
1055
1056static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
1057{
1058 _ecore_evas_extn_free,
1059 NULL,
1060 NULL,
1061 NULL,
1062 NULL,
1063 NULL,
1064 NULL,
1065 NULL,
1066 NULL,
1067 NULL,
1068 NULL,
1069 NULL,
1070 NULL,
1071 NULL,
1072 NULL,
1073 NULL,
1074 NULL,
1075 _ecore_evas_resize,
1076 _ecore_evas_move_resize,
1077 NULL,
1078 NULL,
1079 NULL,
1080 NULL,
1081 NULL,
1082 NULL,
1083 NULL,
1084 NULL,
1085 NULL,
1086 NULL,
1087 NULL,
1088 NULL,
1089 NULL,
1090 NULL,
1091 NULL,
1092 NULL,
1093 NULL,
1094 NULL,
1095 NULL,
1096 NULL,
1097 NULL,
1098 NULL,
1099 NULL,
1100 NULL,
1101 NULL,
1102 NULL,
1103 NULL, //transparent
1104
1105 NULL, // render
1106 NULL // screen_geometry_get
1107};
1108
1109static Eina_Bool
1110_ipc_server_add(void *data, int type __UNUSED__, void *event)
1111{
1112 Ecore_Ipc_Event_Server_Add *e = event;
1113 Ecore_Evas *ee = data;
1114 Extn *extn;
1115
1116 if (ee != ecore_ipc_server_data_get(e->server))
1117 return ECORE_CALLBACK_PASS_ON;
1118 if (!eina_list_data_find(extn_ee_list, ee))
1119 return ECORE_CALLBACK_PASS_ON;
1120 extn = ee->engine.buffer.data;
1121 if (!extn) return ECORE_CALLBACK_PASS_ON;
1122 //FIXME: find a way to let app know server there
1123 return ECORE_CALLBACK_PASS_ON;
1124}
1125
1126static Eina_Bool
1127_ipc_server_del(void *data, int type __UNUSED__, void *event)
1128{
1129 Ecore_Ipc_Event_Server_Del *e = event;
1130 Ecore_Evas *ee = data;
1131 Extn *extn;
1132
1133 extn = ee->engine.buffer.data;
1134 if (!extn) return ECORE_CALLBACK_PASS_ON;
1135 if (extn->ipc.server != e->server) return ECORE_CALLBACK_PASS_ON;
1136 evas_object_image_data_set(ee->engine.buffer.image, NULL);
1137 ee->engine.buffer.pixels = NULL;
1138 if (extn->file.shmfile)
1139 {
1140 shmfile_close(extn->file.shmfile);
1141 extn->file.shmfile = NULL;
1142 }
1143 if (extn->file.shm)
1144 {
1145 eina_stringshare_del(extn->file.shm);
1146 extn->file.shm = NULL;
1147 }
1148 extn->ipc.server = NULL;
1149 if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
1150 return ECORE_CALLBACK_PASS_ON;
1151}
1152
1153static Eina_Bool
1154_ipc_server_data(void *data, int type __UNUSED__, void *event)
1155{
1156 Ecore_Ipc_Event_Server_Data *e = event;
1157 Ecore_Evas *ee = data;
1158 Extn *extn;
1159
1160 if (ee != ecore_ipc_server_data_get(e->server))
1161 return ECORE_CALLBACK_PASS_ON;
1162 if (!eina_list_data_find(extn_ee_list, ee))
1163 return ECORE_CALLBACK_PASS_ON;
1164 extn = ee->engine.buffer.data;
1165 if (!extn) return ECORE_CALLBACK_PASS_ON;
1166 if (e->major != MAJOR)
1167 return ECORE_CALLBACK_PASS_ON;
1168 switch (e->minor)
1169 {
1170 case OP_UPDATE:
1171 // add rect to update list
1172 if (e->size >= (int)sizeof(Ipc_Data_Update))
1173 {
1174 Ipc_Data_Update *ipc = malloc(sizeof(Ipc_Data_Update));
1175 if (ipc)
1176 {
1177 memcpy(ipc, e->data, sizeof(Ipc_Data_Update));
1178 extn->file.updates = eina_list_append(extn->file.updates, ipc);
1179 }
1180 }
1181 break;
1182 case OP_UPDATE_DONE:
1183 // updates finished being sent - done now. frame ready
1184 {
1185 Ipc_Data_Update *ipc;
1186
1187 EINA_LIST_FREE(extn->file.updates, ipc)
1188 {
1189 if (ee->engine.buffer.image)
1190 evas_object_image_data_update_add(ee->engine.buffer.image,
1191 ipc->x, ipc->y,
1192 ipc->w, ipc->h);
1193 }
1194 }
1195 break;
1196 case OP_LOCK_FILE:
1197 if ((e->data) && (e->size > 0) &&
1198 (((unsigned char *)e->data)[e->size - 1] == 0))
1199 {
1200 if (extn->file.lockfd) close(extn->file.lockfd);
1201 if (extn->file.lock) eina_stringshare_del(extn->file.lock);
1202 extn->file.lock = eina_stringshare_add(e->data);
1203 extn->file.lockfd = open(extn->file.lock, O_RDONLY);
1204 }
1205 break;
1206 case OP_SHM_REF:
1207 // e->ref == w
1208 // e->ref_to == h
1209 // e->response == alpha
1210 // e->data = shm ref string + nul byte
1211 if ((e->data) && ((unsigned char *)e->data)[e->size - 1] == 0)
1212 {
1213 ee->engine.buffer.pixels = NULL;
1214 if (extn->file.shmfile)
1215 {
1216 shmfile_close(extn->file.shmfile);
1217 extn->file.shmfile = NULL;
1218 }
1219 if (extn->file.shm)
1220 {
1221 eina_stringshare_del(extn->file.shm);
1222 extn->file.shm = NULL;
1223 }
1224 if ((e->ref > 0) && (e->ref_to > 0))
1225 {
1226 extn->file.w = e->ref;
1227 extn->file.h = e->ref_to;
1228 extn->file.shm = eina_stringshare_add(e->data);
1229 extn->file.shmfile = shmfile_open(extn->file.shm,
1230 extn->file.w *
1231 extn->file.h * 4,
1232 EINA_TRUE);
1233 if (extn->file.shmfile)
1234 {
1235 ee->engine.buffer.pixels = extn->file.shmfile->addr;
1236 if (ee->engine.buffer.image)
1237 {
1238 if (e->response)
1239 evas_object_image_alpha_set(ee->engine.buffer.image,
1240 EINA_TRUE);
1241 else
1242 evas_object_image_alpha_set(ee->engine.buffer.image,
1243 EINA_FALSE);
1244 evas_object_image_size_set(ee->engine.buffer.image,
1245 extn->file.w,
1246 extn->file.h);
1247 evas_object_image_data_set(ee->engine.buffer.image,
1248 ee->engine.buffer.pixels);
1249 evas_object_image_data_update_add(ee->engine.buffer.image,
1250 0, 0,
1251 extn->file.w,
1252 extn->file.h);
1253 _ecore_evas_resize(ee,
1254 extn->file.w,
1255 extn->file.h);
1256 }
1257 else
1258 evas_object_image_data_set(ee->engine.buffer.image, NULL);
1259 }
1260 else
1261 evas_object_image_data_set(ee->engine.buffer.image, NULL);
1262 }
1263 else
1264 evas_object_image_data_set(ee->engine.buffer.image, NULL);
1265 }
1266 break;
1267 case OP_RESIZE:
1268 if ((e->data) && (e->size >= (int)sizeof(Ipc_Data_Resize)))
1269 {
1270 Ipc_Data_Resize *ipc = e->data;
1271 _ecore_evas_resize(ee, ipc->w, ipc->h);
1272 }
1273 break;
1274 default:
1275 break;
1276 }
1277 return ECORE_CALLBACK_PASS_ON;
1278}
1279#else
1280void
1281_ecore_evas_extn_init(void)
1282{
1283}
1284
1285void
1286_ecore_evas_extn_shutdown(void)
1287{
1288}
1289#endif
1290
1291EAPI Evas_Object *
1292ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
1293{
1294#ifdef EXTN_ENABLED
1295 Evas_Object *o;
1296 Ecore_Evas *ee;
1297 int w = 1, h = 1;
1298
1299 if (!ee_target) return NULL;
1300
1301 ee = calloc(1, sizeof(Ecore_Evas));
1302 if (!ee) return NULL;
1303
1304 o = evas_object_image_filled_add(ee_target->evas);
1305 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
1306 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
1307 evas_object_image_alpha_set(o, 1);
1308 evas_object_image_size_set(o, 1, 1);
1309 evas_object_image_data_set(o, &blank);
1310
1311 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
1312
1313 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_extn_plug_engine_func;
1314
1315 ee->driver = "extn_plug";
1316
1317 ee->rotation = 0;
1318 ee->visible = 0;
1319 ee->w = w;
1320 ee->h = h;
1321 ee->req.w = ee->w;
1322 ee->req.h = ee->h;
1323
1324 ee->prop.max.w = 0;
1325 ee->prop.max.h = 0;
1326 ee->prop.layer = 0;
1327 ee->prop.focused = 0;
1328 ee->prop.borderless = 1;
1329 ee->prop.override = 1;
1330 ee->prop.maximized = 0;
1331 ee->prop.fullscreen = 0;
1332 ee->prop.withdrawn = 0;
1333 ee->prop.sticky = 0;
1334
1335 ee->engine.buffer.image = o;
1336 evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas", ee);
1337 evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas_Parent", ee_target);
1338 evas_object_event_callback_add(ee->engine.buffer.image,
1339 EVAS_CALLBACK_MOUSE_IN,
1340 _ecore_evas_extn_cb_mouse_in, ee);
1341 evas_object_event_callback_add(ee->engine.buffer.image,
1342 EVAS_CALLBACK_MOUSE_OUT,
1343 _ecore_evas_extn_cb_mouse_out, ee);
1344 evas_object_event_callback_add(ee->engine.buffer.image,
1345 EVAS_CALLBACK_MOUSE_DOWN,
1346 _ecore_evas_extn_cb_mouse_down, ee);
1347 evas_object_event_callback_add(ee->engine.buffer.image,
1348 EVAS_CALLBACK_MOUSE_UP,
1349 _ecore_evas_extn_cb_mouse_up, ee);
1350 evas_object_event_callback_add(ee->engine.buffer.image,
1351 EVAS_CALLBACK_MOUSE_MOVE,
1352 _ecore_evas_extn_cb_mouse_move, ee);
1353 evas_object_event_callback_add(ee->engine.buffer.image,
1354 EVAS_CALLBACK_MOUSE_WHEEL,
1355 _ecore_evas_extn_cb_mouse_wheel, ee);
1356 evas_object_event_callback_add(ee->engine.buffer.image,
1357 EVAS_CALLBACK_MULTI_DOWN,
1358 _ecore_evas_extn_cb_multi_down, ee);
1359 evas_object_event_callback_add(ee->engine.buffer.image,
1360 EVAS_CALLBACK_MULTI_UP,
1361 _ecore_evas_extn_cb_multi_up, ee);
1362 evas_object_event_callback_add(ee->engine.buffer.image,
1363 EVAS_CALLBACK_MULTI_MOVE,
1364 _ecore_evas_extn_cb_multi_move, ee);
1365 evas_object_event_callback_add(ee->engine.buffer.image,
1366 EVAS_CALLBACK_FREE,
1367 _ecore_evas_extn_cb_free, ee);
1368 evas_object_event_callback_add(ee->engine.buffer.image,
1369 EVAS_CALLBACK_KEY_DOWN,
1370 _ecore_evas_extn_cb_key_down, ee);
1371 evas_object_event_callback_add(ee->engine.buffer.image,
1372 EVAS_CALLBACK_KEY_UP,
1373 _ecore_evas_extn_cb_key_up, ee);
1374 evas_object_event_callback_add(ee->engine.buffer.image,
1375 EVAS_CALLBACK_HOLD,
1376 _ecore_evas_extn_cb_hold, ee);
1377 evas_object_event_callback_add(ee->engine.buffer.image,
1378 EVAS_CALLBACK_FOCUS_IN,
1379 _ecore_evas_extn_cb_focus_in, ee);
1380 evas_object_event_callback_add(ee->engine.buffer.image,
1381 EVAS_CALLBACK_FOCUS_OUT,
1382 _ecore_evas_extn_cb_focus_out, ee);
1383 evas_object_event_callback_add(ee->engine.buffer.image,
1384 EVAS_CALLBACK_SHOW,
1385 _ecore_evas_extn_cb_show, ee);
1386 evas_object_event_callback_add(ee->engine.buffer.image,
1387 EVAS_CALLBACK_HIDE,
1388 _ecore_evas_extn_cb_hide, ee);
1389
1390 evas_object_event_callback_add(ee->engine.buffer.image,
1391 EVAS_CALLBACK_DEL,
1392 _ecore_evas_extn_plug_image_obj_del, ee);
1393
1394
1395 extn_ee_list = eina_list_append(extn_ee_list, ee);
1396 ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
1397
1398 evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_PRE,
1399 _ecore_evas_extn_plug_targer_render_pre, ee);
1400 evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_POST,
1401 _ecore_evas_extn_plug_targer_render_post, ee);
1402 return o;
1403#else
1404 return NULL;
1405#endif
1406}
1407
1408EAPI Eina_Bool
1409ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
1410{
1411#ifdef EXTN_ENABLED
1412 Extn *extn;
1413 Ecore_Evas *ee = NULL;
1414
1415 if (!obj) return EINA_FALSE;
1416
1417 ee = evas_object_data_get(obj, "Ecore_Evas");
1418 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) return EINA_FALSE;
1419
1420 extn = calloc(1, sizeof(Extn));
1421 if (!extn) return EINA_FALSE;
1422
1423 Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER;
1424
1425 ecore_ipc_init();
1426 extn->svc.name = eina_stringshare_add(svcname);
1427 extn->svc.num = svcnum;
1428 extn->svc.sys = svcsys;
1429
1430 if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM;
1431 extn->ipc.server = ecore_ipc_server_connect(ipctype, (char *)extn->svc.name,
1432 extn->svc.num, ee);
1433 if (!extn->ipc.server)
1434 {
1435 eina_stringshare_del(extn->svc.name);
1436 free(extn);
1437 ecore_ipc_shutdown();
1438 return EINA_FALSE;
1439 }
1440 ee->engine.buffer.data = extn;
1441 extn->ipc.handlers = eina_list_append
1442 (extn->ipc.handlers,
1443 ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
1444 _ipc_server_add, ee));
1445 extn->ipc.handlers = eina_list_append
1446 (extn->ipc.handlers,
1447 ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
1448 _ipc_server_del, ee));
1449 extn->ipc.handlers = eina_list_append
1450 (extn->ipc.handlers,
1451 ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
1452 _ipc_server_data, ee));
1453 return EINA_TRUE;
1454#else
1455 return EINA_FALSE;
1456#endif
1457}
1458
1459EAPI void
1460ecore_evas_extn_plug_object_data_lock(Evas_Object *obj)
1461{
1462#ifdef EXTN_ENABLED
1463 Ecore_Evas *ee;
1464
1465 ee = ecore_evas_object_ecore_evas_get(obj);
1466 if (!ee) return;
1467 _ecore_evas_socket_lock(ee);
1468#endif
1469}
1470
1471EAPI void
1472ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj)
1473{
1474#ifdef EXTN_ENABLED
1475 Ecore_Evas *ee;
1476
1477 ee = ecore_evas_object_ecore_evas_get(obj);
1478 if (!ee) return;
1479 _ecore_evas_socket_unlock(ee);
1480#endif
1481}
1482
1483#ifdef EXTN_ENABLED
1484static void
1485_ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
1486{
1487 Extn *extn;
1488 Evas_Engine_Info_Buffer *einfo;
1489 int stride = 0;
1490
1491 if (w < 1) w = 1;
1492 if (h < 1) h = 1;
1493 ee->req.w = w;
1494 ee->req.h = h;
1495 if ((w == ee->w) && (h == ee->h)) return;
1496 ee->w = w;
1497 ee->h = h;
1498 evas_output_size_set(ee->evas, ee->w, ee->h);
1499 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
1500 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1501 extn = ee->engine.buffer.data;
1502 if (extn)
1503 {
1504 if (extn->file.shmfile)
1505 shmfile_free(extn->file.shmfile);
1506 ee->engine.buffer.pixels = NULL;
1507 extn->file.shmfile = shmfile_new(extn->svc.name, extn->svc.num,
1508 ee->w * ee->h * 4, extn->svc.sys);
1509 if (extn->file.shmfile)
1510 ee->engine.buffer.pixels = extn->file.shmfile->addr;
1511
1512 stride = ee->w * 4;
1513 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
1514 if (einfo)
1515 {
1516 if (ee->alpha)
1517 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
1518 else
1519 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
1520 einfo->info.dest_buffer = ee->engine.buffer.pixels;
1521 einfo->info.dest_buffer_row_bytes = stride;
1522 einfo->info.use_color_key = 0;
1523 einfo->info.alpha_threshold = 0;
1524 einfo->info.func.new_update_region = NULL;
1525 einfo->info.func.free_update_region = NULL;
1526 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1527 {
1528 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1529 }
1530 }
1531
1532 if (extn->ipc.clients && extn->file.shmfile)
1533 {
1534 Ipc_Data_Resize ipc;
1535 Eina_List *l;
1536 Ecore_Ipc_Client *client;
1537
1538 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1539 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF,
1540 ee->w, ee->h, ee->alpha,
1541 extn->file.shmfile->file,
1542 strlen(extn->file.shmfile->file) + 1);
1543 ipc.w = ee->w;
1544 ipc.h = ee->h;
1545 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1546 ecore_ipc_client_send(client, MAJOR, OP_RESIZE,
1547 0, 0, 0, &ipc, sizeof(ipc));
1548 }
1549 }
1550 if (ee->func.fn_resize) ee->func.fn_resize(ee);
1551}
1552
1553static void
1554_ecore_evas_socket_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int w, int h)
1555{
1556 _ecore_evas_socket_resize(ee, w, h);
1557}
1558
1559int
1560_ecore_evas_extn_socket_render(Ecore_Evas *ee)
1561{
1562 Eina_List *updates = NULL, *l, *ll;
1563 Ecore_Evas *ee2;
1564 int rend = 0;
1565 Eina_Rectangle *r;
1566 Extn *extn;
1567 Ecore_Ipc_Client *client;
1568
1569 extn = ee->engine.buffer.data;
1570 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
1571 {
1572 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
1573 if (ee2->engine.func->fn_render)
1574 rend |= ee2->engine.func->fn_render(ee2);
1575 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
1576 }
1577 if (ee->engine.buffer.pixels)
1578 {
1579 _ecore_evas_socket_lock(ee);
1580 updates = evas_render_updates(ee->evas);
1581 _ecore_evas_socket_unlock(ee);
1582 }
1583 EINA_LIST_FOREACH(updates, l, r)
1584 {
1585 Ipc_Data_Update ipc;
1586
1587
1588 ipc.x = r->x;
1589 ipc.y = r->y;
1590 ipc.w = r->w;
1591 ipc.h = r->h;
1592 EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
1593 ecore_ipc_client_send(client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc, sizeof(ipc));
1594 }
1595 if (updates)
1596 {
1597 evas_render_updates_free(updates);
1598 _ecore_evas_idle_timeout_update(ee);
1599 EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
1600 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0);
1601 }
1602
1603 return updates ? 1 : rend;
1604}
1605
1606static Eina_Bool
1607_ipc_client_add(void *data, int type __UNUSED__, void *event)
1608{
1609 Ecore_Ipc_Event_Client_Add *e = event;
1610 Ecore_Evas *ee = data;
1611 Extn *extn;
1612
1613 if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
1614 return ECORE_CALLBACK_PASS_ON;
1615 if (!eina_list_data_find(extn_ee_list, ee))
1616 return ECORE_CALLBACK_PASS_ON;
1617 extn = ee->engine.buffer.data;
1618 if (!extn) return ECORE_CALLBACK_PASS_ON;
1619
1620 extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client);
1621 ecore_ipc_client_send(e->client, MAJOR, OP_LOCK_FILE, 0, 0, 0, extn->file.lock, strlen(extn->file.lock) + 1);
1622
1623 if (extn->file.shmfile)
1624 {
1625 Ipc_Data_Resize ipc;
1626
1627 ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF,
1628 ee->w, ee->h, ee->alpha,
1629 extn->file.shmfile->file,
1630 strlen(extn->file.shmfile->file) + 1);
1631 ipc.w = ee->w;
1632 ipc.h = ee->h;
1633
1634 ecore_ipc_client_send(e->client, MAJOR, OP_RESIZE,
1635 0, 0, 0, &ipc, sizeof(ipc));
1636 }
1637 _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD);
1638 return ECORE_CALLBACK_PASS_ON;
1639}
1640
1641static Eina_Bool
1642_ipc_client_del(void *data, int type __UNUSED__, void *event)
1643{
1644 Ecore_Ipc_Event_Client_Del *e = event;
1645 Ecore_Evas *ee = data;
1646 Extn *extn;
1647 extn = ee->engine.buffer.data;
1648 if (!extn) return ECORE_CALLBACK_PASS_ON;
1649 if (!eina_list_data_find(extn->ipc.clients, e->client)) return ECORE_CALLBACK_PASS_ON;
1650
1651 extn->ipc.clients = eina_list_remove(extn->ipc.clients, e->client);
1652
1653 _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_DEL);
1654 return ECORE_CALLBACK_PASS_ON;
1655}
1656
1657static Eina_Bool
1658_ipc_client_data(void *data, int type __UNUSED__, void *event)
1659{
1660 Ecore_Ipc_Event_Client_Data *e = event;
1661 Ecore_Evas *ee = data;
1662 Extn *extn;
1663
1664 if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
1665 return ECORE_CALLBACK_PASS_ON;
1666 if (!eina_list_data_find(extn_ee_list, ee))
1667 return ECORE_CALLBACK_PASS_ON;
1668 extn = ee->engine.buffer.data;
1669 if (!extn) return ECORE_CALLBACK_PASS_ON;
1670 if (e->major != MAJOR)
1671 return ECORE_CALLBACK_PASS_ON;
1672 switch (e->minor)
1673 {
1674 case OP_RESIZE:
1675 if ((e->data) && (e->size >= (int)sizeof(Ipc_Data_Resize)))
1676 {
1677
1678 Ipc_Data_Resize *ipc = e->data;
1679 /* create callbacke data size changed */
1680 _ecore_evas_socket_resize(ee, ipc->w, ipc->h);
1681 }
1682 break;
1683 case OP_SHOW:
1684 if (!ee->visible)
1685 {
1686 ee->visible = 1;
1687 if (ee->func.fn_show) ee->func.fn_show(ee);
1688 }
1689 break;
1690 case OP_HIDE:
1691 if (ee->visible)
1692 {
1693 ee->visible = 0;
1694 if (ee->func.fn_hide) ee->func.fn_hide(ee);
1695 }
1696 break;
1697 case OP_FOCUS:
1698 if (!ee->prop.focused)
1699 {
1700 ee->prop.focused = 1;
1701 evas_focus_in(ee->evas);
1702 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1703 }
1704 break;
1705 case OP_UNFOCUS:
1706 if (ee->prop.focused)
1707 {
1708 ee->prop.focused = 0;
1709 evas_focus_out(ee->evas);
1710 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
1711 }
1712 break;
1713 case OP_EV_MOUSE_IN:
1714 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_In))
1715 {
1716 Ipc_Data_Ev_Mouse_In *ipc = e->data;
1717 Evas_Event_Flags flags;
1718
1719 flags = evas_event_default_flags_get(ee->evas);
1720 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1721 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1722 evas_event_feed_mouse_in(ee->evas, ipc->timestamp, NULL);
1723 evas_event_default_flags_set(ee->evas, flags);
1724 }
1725 break;
1726 case OP_EV_MOUSE_OUT:
1727 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_Out))
1728 {
1729 Ipc_Data_Ev_Mouse_Out *ipc = e->data;
1730 Evas_Event_Flags flags;
1731
1732 flags = evas_event_default_flags_get(ee->evas);
1733 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1734 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1735 evas_event_feed_mouse_out(ee->evas, ipc->timestamp, NULL);
1736 evas_event_default_flags_set(ee->evas, flags);
1737 }
1738 break;
1739 case OP_EV_MOUSE_UP:
1740 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_Up))
1741 {
1742 Ipc_Data_Ev_Mouse_Up *ipc = e->data;
1743 Evas_Event_Flags flags;
1744
1745 flags = evas_event_default_flags_get(ee->evas);
1746 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1747 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1748 evas_event_feed_mouse_up(ee->evas, ipc->b, ipc->flags, ipc->timestamp, NULL);
1749 evas_event_default_flags_set(ee->evas, flags);
1750 }
1751 break;
1752 case OP_EV_MOUSE_DOWN:
1753 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_Down))
1754 {
1755 Ipc_Data_Ev_Mouse_Up *ipc = e->data;
1756 Evas_Event_Flags flags;
1757
1758 flags = evas_event_default_flags_get(ee->evas);
1759 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1760 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1761 evas_event_feed_mouse_down(ee->evas, ipc->b, ipc->flags, ipc->timestamp, NULL);
1762 evas_event_default_flags_set(ee->evas, flags);
1763 }
1764 break;
1765 case OP_EV_MOUSE_MOVE:
1766 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_Move))
1767 {
1768 Ipc_Data_Ev_Mouse_Move *ipc = e->data;
1769 Evas_Event_Flags flags;
1770
1771 flags = evas_event_default_flags_get(ee->evas);
1772 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1773 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1774 evas_event_feed_mouse_move(ee->evas, ipc->x, ipc->y, ipc->timestamp, NULL);
1775 evas_event_default_flags_set(ee->evas, flags);
1776 }
1777 break;
1778 case OP_EV_MOUSE_WHEEL:
1779 if (e->size >= (int)sizeof(Ipc_Data_Ev_Mouse_Wheel))
1780 {
1781 Ipc_Data_Ev_Mouse_Wheel *ipc = e->data;
1782 Evas_Event_Flags flags;
1783
1784 flags = evas_event_default_flags_get(ee->evas);
1785 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1786 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1787 evas_event_feed_mouse_wheel(ee->evas, ipc->direction, ipc->z, ipc->timestamp, NULL);
1788 evas_event_default_flags_set(ee->evas, flags);
1789 }
1790 break;
1791 case OP_EV_MULTI_UP:
1792 if (e->size >= (int)sizeof(Ipc_Data_Ev_Multi_Up))
1793 {
1794 Ipc_Data_Ev_Multi_Up *ipc = e->data;
1795 Evas_Event_Flags flags;
1796
1797 flags = evas_event_default_flags_get(ee->evas);
1798 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1799 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1800 evas_event_feed_multi_up(ee->evas, ipc->d, ipc->x, ipc->y, ipc->rad, ipc->radx, ipc->rady, ipc->pres, ipc->ang, ipc->fx, ipc->fy, ipc->flags, ipc->timestamp, NULL);
1801 evas_event_default_flags_set(ee->evas, flags);
1802 }
1803 break;
1804 case OP_EV_MULTI_DOWN:
1805 if (e->size >= (int)sizeof(Ipc_Data_Ev_Multi_Down))
1806 {
1807 Ipc_Data_Ev_Multi_Down *ipc = e->data;
1808 Evas_Event_Flags flags;
1809
1810 flags = evas_event_default_flags_get(ee->evas);
1811 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1812 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1813 evas_event_feed_multi_down(ee->evas, ipc->d, ipc->x, ipc->y, ipc->rad, ipc->radx, ipc->rady, ipc->pres, ipc->ang, ipc->fx, ipc->fy, ipc->flags, ipc->timestamp, NULL);
1814 evas_event_default_flags_set(ee->evas, flags);
1815 }
1816 break;
1817 case OP_EV_MULTI_MOVE:
1818 if (e->size >= (int)sizeof(Ipc_Data_Ev_Multi_Move))
1819 {
1820 Ipc_Data_Ev_Multi_Move *ipc = e->data;
1821 Evas_Event_Flags flags;
1822
1823 flags = evas_event_default_flags_get(ee->evas);
1824 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1825 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1826 evas_event_feed_multi_move(ee->evas, ipc->d, ipc->x, ipc->y, ipc->rad, ipc->radx, ipc->rady, ipc->pres, ipc->ang, ipc->fx, ipc->fy, ipc->timestamp, NULL);
1827 evas_event_default_flags_set(ee->evas, flags);
1828 }
1829 break;
1830
1831#define STRGET(val) \
1832 do { \
1833 if ((ipc->val) && (ipc->val < (char *)(e->size - 1))) \
1834 ipc->val = ((char *)ipc) + (long)ipc->val; \
1835 else \
1836 ipc->val = NULL; \
1837 } while (0)
1838
1839 case OP_EV_KEY_UP:
1840 if (e->size >= (int)sizeof(Ipc_Data_Ev_Key_Up))
1841 {
1842 if ((e->data) && (e->size > 0) &&
1843 (((unsigned char *)e->data)[e->size - 1] == 0))
1844 {
1845 Ipc_Data_Ev_Key_Up *ipc = e->data;
1846 Evas_Event_Flags flags;
1847
1848 STRGET(keyname);
1849 STRGET(key);
1850 STRGET(string);
1851 STRGET(compose);
1852 flags = evas_event_default_flags_get(ee->evas);
1853 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1854 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1855 evas_event_feed_key_up(ee->evas, ipc->keyname, ipc->key, ipc->string, ipc->compose, ipc->timestamp, NULL);
1856 evas_event_default_flags_set(ee->evas, flags);
1857 }
1858 }
1859 break;
1860 case OP_EV_KEY_DOWN:
1861 if (e->size >= (int)sizeof(Ipc_Data_Ev_Key_Down))
1862 {
1863 if ((e->data) && (e->size > 0) &&
1864 (((unsigned char *)e->data)[e->size - 1] == 0))
1865 {
1866 Ipc_Data_Ev_Key_Down *ipc = e->data;
1867 Evas_Event_Flags flags;
1868
1869 STRGET(keyname);
1870 STRGET(key);
1871 STRGET(string);
1872 STRGET(compose);
1873 flags = evas_event_default_flags_get(ee->evas);
1874 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1875 _ecore_evas_modifiers_locks_mask_set(ee->evas, ipc->mask);
1876 evas_event_feed_key_down(ee->evas, ipc->keyname, ipc->key, ipc->string, ipc->compose, ipc->timestamp, NULL);
1877 evas_event_default_flags_set(ee->evas, flags);
1878 }
1879 }
1880 break;
1881 case OP_EV_HOLD:
1882 if (e->size >= (int)sizeof(Ipc_Data_Ev_Hold))
1883 {
1884 Ipc_Data_Ev_Hold *ipc = e->data;
1885 Evas_Event_Flags flags;
1886
1887 flags = evas_event_default_flags_get(ee->evas);
1888 evas_event_default_flags_set(ee->evas, ipc->event_flags);
1889 evas_event_feed_hold(ee->evas, ipc->hold, ipc->timestamp, NULL);
1890 evas_event_default_flags_set(ee->evas, flags);
1891 }
1892 break;
1893 default:
1894 break;
1895 }
1896 return ECORE_CALLBACK_PASS_ON;
1897}
1898
1899static void
1900_ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
1901{
1902 Extn *extn;
1903 Eina_List *l;
1904 Ecore_Ipc_Client *client;
1905
1906 if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return;
1907 ee->alpha = alpha;
1908
1909 extn = ee->engine.buffer.data;
1910 if (extn)
1911 {
1912 Evas_Engine_Info_Buffer *einfo;
1913
1914 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
1915 if (einfo)
1916 {
1917 if (ee->alpha)
1918 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
1919 else
1920 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
1921 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
1922 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1923 }
1924 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1925 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF,
1926 ee->w, ee->h, ee->alpha,
1927 extn->file.shmfile->file,
1928 strlen(extn->file.shmfile->file) + 1);
1929 }
1930}
1931
1932static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
1933{
1934 _ecore_evas_extn_free,
1935 NULL,
1936 NULL,
1937 NULL,
1938 NULL,
1939 NULL,
1940 NULL,
1941 NULL,
1942 NULL,
1943 NULL,
1944 NULL,
1945 NULL,
1946 NULL,
1947 NULL,
1948 NULL,
1949 NULL,
1950 NULL,
1951 _ecore_evas_socket_resize,
1952 _ecore_evas_socket_move_resize,
1953 NULL,
1954 NULL,
1955 NULL,
1956 NULL,
1957 NULL,
1958 NULL,
1959 NULL,
1960 NULL,
1961 NULL,
1962 NULL,
1963 NULL,
1964 NULL,
1965 NULL,
1966 NULL,
1967 NULL,
1968 NULL,
1969 NULL,
1970 NULL,
1971 NULL,
1972 NULL,
1973 NULL,
1974 NULL,
1975 NULL,
1976 NULL,
1977 NULL,
1978 _ecore_evas_extn_socket_alpha_set,
1979 NULL, //transparent
1980
1981 _ecore_evas_extn_socket_render, // render
1982 NULL // screen_geometry_get
1983};
1984
1985#endif
1986
1987EAPI Ecore_Evas *
1988ecore_evas_extn_socket_new(int w, int h)
1989{
1990#ifdef EXTN_ENABLED
1991 Evas_Engine_Info_Buffer *einfo;
1992 Ecore_Evas *ee;
1993 int rmethod;
1994
1995 rmethod = evas_render_method_lookup("buffer");
1996 if (!rmethod) return NULL;
1997 ee = calloc(1, sizeof(Ecore_Evas));
1998 if (!ee) return NULL;
1999
2000 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
2001
2002 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_extn_socket_engine_func;
2003
2004 ee->driver = "extn_socket";
2005
2006 ee->rotation = 0;
2007 ee->visible = 0;
2008 ee->w = w;
2009 ee->h = h;
2010 ee->req.w = ee->w;
2011 ee->req.h = ee->h;
2012
2013 ee->prop.max.w = 0;
2014 ee->prop.max.h = 0;
2015 ee->prop.layer = 0;
2016 ee->prop.focused = 0;
2017 ee->prop.borderless = 1;
2018 ee->prop.override = 1;
2019 ee->prop.maximized = 0;
2020 ee->prop.fullscreen = 0;
2021 ee->prop.withdrawn = 0;
2022 ee->prop.sticky = 0;
2023
2024 /* init evas here */
2025 ee->evas = evas_new();
2026 evas_data_attach_set(ee->evas, ee);
2027 evas_output_method_set(ee->evas, rmethod);
2028 evas_output_size_set(ee->evas, w, h);
2029 evas_output_viewport_set(ee->evas, 0, 0, w, h);
2030
2031 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
2032 if (einfo)
2033 {
2034 if (ee->alpha)
2035 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
2036 else
2037 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
2038 einfo->info.dest_buffer = NULL;
2039 einfo->info.dest_buffer_row_bytes = 0;
2040 einfo->info.use_color_key = 0;
2041 einfo->info.alpha_threshold = 0;
2042 einfo->info.func.new_update_region = NULL;
2043 einfo->info.func.free_update_region = NULL;
2044 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2045 {
2046 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2047 ecore_evas_free(ee);
2048 return NULL;
2049 }
2050 }
2051 else
2052 {
2053 ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
2054 ecore_evas_free(ee);
2055 return NULL;
2056 }
2057 evas_key_modifier_add(ee->evas, "Shift");
2058 evas_key_modifier_add(ee->evas, "Control");
2059 evas_key_modifier_add(ee->evas, "Alt");
2060 evas_key_modifier_add(ee->evas, "Meta");
2061 evas_key_modifier_add(ee->evas, "Hyper");
2062 evas_key_modifier_add(ee->evas, "Super");
2063 evas_key_lock_add(ee->evas, "Caps_Lock");
2064 evas_key_lock_add(ee->evas, "Num_Lock");
2065 evas_key_lock_add(ee->evas, "Scroll_Lock");
2066
2067 extn_ee_list = eina_list_append(extn_ee_list, ee);
2068
2069 _ecore_evas_register(ee);
2070
2071 return ee;
2072#else
2073 return NULL;
2074#endif
2075}
2076
2077EAPI Eina_Bool
2078ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
2079{
2080#ifdef EXTN_ENABLED
2081 Extn *extn;
2082
2083 extn = calloc(1, sizeof(Extn));
2084 if (!extn)
2085 {
2086 return EINA_FALSE;
2087 }
2088 else
2089 {
2090 Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER;
2091 char buf[PATH_MAX];
2092
2093 ecore_ipc_init();
2094 extn->svc.name = eina_stringshare_add(svcname);
2095 extn->svc.num = svcnum;
2096 extn->svc.sys = svcsys;
2097
2098 snprintf(buf, sizeof(buf), "/tmp/ee-lock-XXXXXX");
2099 extn->file.lockfd = mkstemp(buf);
2100 if (extn->file.lockfd >= 0)
2101 extn->file.lock = eina_stringshare_add(buf);
2102 if ((extn->file.lockfd < 0) || (!extn->file.lock))
2103 {
2104 if (extn->file.lockfd)
2105 {
2106 close(extn->file.lockfd);
2107 unlink(buf);
2108 }
2109 eina_stringshare_del(extn->svc.name);
2110 if (extn->file.lock) eina_stringshare_del(extn->file.lock);
2111 free(extn);
2112 ecore_ipc_shutdown();
2113 return EINA_FALSE;
2114 }
2115
2116 if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM;
2117 extn->ipc.am_server = EINA_TRUE;
2118 extn->ipc.server = ecore_ipc_server_add(ipctype,
2119 (char *)extn->svc.name,
2120 extn->svc.num, ee);
2121 if (!extn->ipc.server)
2122 {
2123 if (extn->file.lockfd)
2124 {
2125 close(extn->file.lockfd);
2126 if (extn->file.lock) unlink(extn->file.lock);
2127 }
2128 eina_stringshare_del(extn->svc.name);
2129 eina_stringshare_del(extn->file.lock);
2130 free(extn);
2131 ecore_ipc_shutdown();
2132 return EINA_FALSE;
2133 }
2134 ee->engine.buffer.data = extn;
2135 extn->ipc.handlers = eina_list_append
2136 (extn->ipc.handlers,
2137 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
2138 _ipc_client_add, ee));
2139 extn->ipc.handlers = eina_list_append
2140 (extn->ipc.handlers,
2141 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL,
2142 _ipc_client_del, ee));
2143 extn->ipc.handlers = eina_list_append
2144 (extn->ipc.handlers,
2145 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,
2146 _ipc_client_data, ee));
2147 }
2148 return EINA_TRUE;
2149#else
2150 return EINA_FALSE;
2151#endif
2152}
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c
index 3ee913e..74caada 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <sys/types.h> 6#include <sys/types.h>
6#include <dirent.h> 7#include <dirent.h>
7 8
@@ -154,9 +155,9 @@ _ecore_evas_fb_render(Ecore_Evas *ee)
154 if (ee->visible) 155 if (ee->visible)
155 { 156 {
156 Eina_List *updates; 157 Eina_List *updates;
157
158 Eina_List *ll; 158 Eina_List *ll;
159 Ecore_Evas *ee2; 159 Ecore_Evas *ee2;
160
160 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); 161 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
161 162
162 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) 163 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
@@ -184,31 +185,26 @@ _ecore_evas_fb_render(Ecore_Evas *ee)
184static int 185static int
185_ecore_evas_fb_init(Ecore_Evas *ee, int w, int h) 186_ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
186{ 187{
188 Eina_File_Direct_Info *info;
189 Eina_Iterator *ls;
187 Ecore_Fb_Input_Device *device; 190 Ecore_Fb_Input_Device *device;
188 Ecore_Fb_Input_Device_Cap caps; 191 Ecore_Fb_Input_Device_Cap caps;
189 int mouse_handled = 0; 192 int mouse_handled = 0;
190 193
191 DIR *input_dir;
192 struct dirent *input_entry;
193
194 _ecore_evas_init_count++; 194 _ecore_evas_init_count++;
195 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count; 195 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
196 196
197 ecore_event_evas_init(); 197 ecore_event_evas_init();
198 198
199 /* register all input devices */ 199 /* register all input devices */
200 input_dir = opendir("/dev/input/"); 200 ls = eina_file_direct_ls("/dev/input/");
201 if (!input_dir) return _ecore_evas_init_count;
202 201
203 while ((input_entry = readdir(input_dir))) 202 EINA_ITERATOR_FOREACH(ls, info)
204 { 203 {
205 char device_path[256]; 204 if (strncmp(info->path + info->name_start, "event", 5) != 0)
206
207 if (strncmp(input_entry->d_name, "event", 5) != 0)
208 continue; 205 continue;
209 206
210 snprintf(device_path, 256, "/dev/input/%s", input_entry->d_name); 207 if (!(device = ecore_fb_input_device_open(info->path)))
211 if (!(device = ecore_fb_input_device_open(device_path)))
212 continue; 208 continue;
213 ecore_fb_input_device_window_set(device, ee); 209 ecore_fb_input_device_window_set(device, ee);
214 210
@@ -240,7 +236,7 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
240 ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device); 236 ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
241 } 237 }
242 } 238 }
243 closedir(input_dir); 239 eina_iterator_free(ls);
244 240
245 if (!mouse_handled) 241 if (!mouse_handled)
246 { 242 {
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h
index 2c20761..9a88a7a 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h
@@ -1,18 +1,6 @@
1#ifndef _ECORE_EVAS_PRIVATE_H 1#ifndef _ECORE_EVAS_PRIVATE_H
2#define _ECORE_EVAS_PRIVATE_H 2#define _ECORE_EVAS_PRIVATE_H
3 3
4#ifdef HAVE_CONFIG_H
5# include <config.h>
6#endif
7
8#include <sys/types.h>
9#include <sys/stat.h>
10#include <fcntl.h>
11
12#ifdef HAVE_SYS_MMAN_H
13# include <sys/mman.h>
14#endif
15
16#include <Evas.h> 4#include <Evas.h>
17#include <Ecore.h> 5#include <Ecore.h>
18#include <ecore_private.h> 6#include <ecore_private.h>
@@ -91,9 +79,17 @@
91# include <Evas_Engine_Gl_Cocoa.h> 79# include <Evas_Engine_Gl_Cocoa.h>
92#endif 80#endif
93 81
94/** 82#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
95 Log domain macros and variable 83# include "Ecore_Wayland.h"
96 **/ 84# include <Evas_Engine_Wayland_Shm.h>
85#endif
86
87#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
88# include "Ecore_Wayland.h"
89# include <Evas_Engine_Wayland_Egl.h>
90#endif
91
92/** Log domain macros and variables **/
97 93
98extern int _ecore_evas_log_dom; 94extern int _ecore_evas_log_dom;
99 95
@@ -272,6 +268,17 @@ struct _Ecore_Evas_Engine
272 } ews; 268 } ews;
273#endif 269#endif
274 270
271#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
272 struct
273 {
274 Evas_Object *frame;
275
276 struct wl_shell_surface *shell_surface;
277 struct wl_surface *surface;
278 struct wl_buffer *buffer;
279 } wl;
280#endif
281
275 Ecore_Timer *idle_flush_timer; 282 Ecore_Timer *idle_flush_timer;
276}; 283};
277 284
@@ -290,6 +297,7 @@ struct _Ecore_Evas
290 Eina_Bool should_be_visible : 1; 297 Eina_Bool should_be_visible : 1;
291 Eina_Bool alpha : 1; 298 Eina_Bool alpha : 1;
292 Eina_Bool transparent : 1; 299 Eina_Bool transparent : 1;
300 Eina_Bool in : 1;
293 301
294 Eina_Hash *data; 302 Eina_Hash *data;
295 303
@@ -334,6 +342,7 @@ struct _Ecore_Evas
334 char withdrawn : 1; 342 char withdrawn : 1;
335 char sticky : 1; 343 char sticky : 1;
336 char request_pos : 1; 344 char request_pos : 1;
345 char draw_frame : 1;
337 } prop; 346 } prop;
338 347
339 struct { 348 struct {
@@ -394,6 +403,16 @@ void _ecore_evas_ews_events_init(void);
394int _ecore_evas_ews_shutdown(void); 403int _ecore_evas_ews_shutdown(void);
395#endif 404#endif
396 405
406#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
407void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
408void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
409#endif
410
411#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
412void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
413void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
414#endif
415
397void _ecore_evas_fps_debug_init(void); 416void _ecore_evas_fps_debug_init(void);
398void _ecore_evas_fps_debug_shutdown(void); 417void _ecore_evas_fps_debug_shutdown(void);
399void _ecore_evas_fps_debug_rendertime_add(double t); 418void _ecore_evas_fps_debug_rendertime_add(double t);
@@ -430,4 +449,7 @@ void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
430 449
431extern Eina_Bool _ecore_evas_app_comp_sync; 450extern Eina_Bool _ecore_evas_app_comp_sync;
432 451
452void _ecore_evas_extn_init(void);
453void _ecore_evas_extn_shutdown(void);
454
433#endif 455#endif
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c
index 0849c79..be130ad 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c
@@ -16,7 +16,7 @@
16static int _ecore_evas_init_count = 0; 16static int _ecore_evas_init_count = 0;
17 17
18static Ecore_Evas *psl1ght_ee = NULL; 18static Ecore_Evas *psl1ght_ee = NULL;
19static Ecore_Event_Handler *ecore_evas_event_handlers[4] = { 19static Ecore_Event_Handler *ecore_evas_event_handlers[5] = {
20 NULL, NULL, NULL, NULL 20 NULL, NULL, NULL, NULL
21}; 21};
22 22
@@ -48,7 +48,7 @@ _ecore_evas_psl1ght_event_got_focus(void *data __UNUSED__, int type __UNUSED__,
48 ee->prop.focused = 1; 48 ee->prop.focused = 1;
49 evas_focus_in(ee->evas); 49 evas_focus_in(ee->evas);
50 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); 50 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
51 51
52 return ECORE_CALLBACK_PASS_ON; 52 return ECORE_CALLBACK_PASS_ON;
53} 53}
54 54
@@ -64,7 +64,7 @@ _ecore_evas_psl1ght_event_lost_focus(void *data __UNUSED__, int type __UNUSED__,
64 evas_focus_out(ee->evas); 64 evas_focus_out(ee->evas);
65 ee->prop.focused = 0; 65 ee->prop.focused = 0;
66 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); 66 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
67 67
68 return ECORE_CALLBACK_PASS_ON; 68 return ECORE_CALLBACK_PASS_ON;
69} 69}
70 70
@@ -98,6 +98,19 @@ _ecore_evas_psl1ght_event_key_modifiers(void *data __UNUSED__, int type __UNUSED
98 return ECORE_CALLBACK_PASS_ON; 98 return ECORE_CALLBACK_PASS_ON;
99} 99}
100 100
101static Eina_Bool
102_ecore_evas_psl1ght_event_quit (void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
103{
104 Ecore_Evas *ee;
105
106 ee = _ecore_evas_psl1ght_match();
107
108 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
109 if (ee->func.fn_delete_request)
110 ee->func.fn_delete_request(ee);
111 return ECORE_CALLBACK_PASS_ON;
112}
113
101static int 114static int
102_ecore_evas_render(Ecore_Evas *ee) 115_ecore_evas_render(Ecore_Evas *ee)
103{ 116{
@@ -170,10 +183,21 @@ _ecore_evas_psl1ght_init(int w __UNUSED__, int h __UNUSED__)
170 183
171 ecore_event_evas_init(); 184 ecore_event_evas_init();
172 185
173 ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS, _ecore_evas_psl1ght_event_got_focus, NULL); 186 ecore_evas_event_handlers[0] =
174 ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS, _ecore_evas_psl1ght_event_lost_focus, NULL); 187 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS,
175 ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_EXPOSE, _ecore_evas_psl1ght_event_video_expose, NULL); 188 _ecore_evas_psl1ght_event_got_focus, NULL);
176 ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS, _ecore_evas_psl1ght_event_key_modifiers, NULL); 189 ecore_evas_event_handlers[1] =
190 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS,
191 _ecore_evas_psl1ght_event_lost_focus, NULL);
192 ecore_evas_event_handlers[2] =
193 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_EXPOSE,
194 _ecore_evas_psl1ght_event_video_expose, NULL);
195 ecore_evas_event_handlers[3] =
196 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_KEY_MODIFIERS,
197 _ecore_evas_psl1ght_event_key_modifiers, NULL);
198 ecore_evas_event_handlers[4] =
199 ecore_event_handler_add(ECORE_PSL1GHT_EVENT_QUIT,
200 _ecore_evas_psl1ght_event_quit, NULL);
177 201
178 return _ecore_evas_init_count; 202 return _ecore_evas_init_count;
179} 203}
@@ -209,6 +233,12 @@ _ecore_evas_psl1ght_free(Ecore_Evas *ee)
209} 233}
210 234
211static void 235static void
236_ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
237{
238 ee->func.fn_delete_request = func;
239}
240
241static void
212_ecore_evas_screen_resized(Ecore_Evas *ee) 242_ecore_evas_screen_resized(Ecore_Evas *ee)
213{ 243{
214 int w, h; 244 int w, h;
@@ -324,7 +354,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
324 NULL, 354 NULL,
325 NULL, 355 NULL,
326 NULL, 356 NULL,
327 NULL, 357 _ecore_evas_psl1ght_callback_delete_request_set,
328 NULL, 358 NULL,
329 NULL, 359 NULL,
330 NULL, 360 NULL,
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c
index b333d96..a3be2c7 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c
@@ -15,6 +15,9 @@
15# endif 15# endif
16#endif 16#endif
17 17
18#include <stdlib.h>
19#include <string.h>
20
18#include "ecore_evas_private.h" 21#include "ecore_evas_private.h"
19#include "Ecore_Evas.h" 22#include "Ecore_Evas.h"
20 23
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_util.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_util.c
index 95b6d22..839f0c8 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_util.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_util.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <string.h> 6#include <string.h>
6 7
7#include <Ecore.h> 8#include <Ecore.h>
@@ -115,15 +116,16 @@ _ecore_evas_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj _
115} 116}
116 117
117static void 118static void
118_ecore_evas_obj_callback_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) 119_ecore_evas_obj_callback_resize(void *data, Evas *e, Evas_Object *obj, void *event_info __UNUSED__)
119{ 120{
120 Ecore_Evas *ee = data; 121 Ecore_Evas *ee = data;
121 Evas_Coord ow, oh, w, h; 122 Evas_Coord ow, oh, fw, fh;
122 123
123 evas_object_geometry_get(obj, NULL, NULL, &ow, &oh); 124 evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
124 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 125 evas_output_framespace_get(e, NULL, NULL, &fw, &fh);
125 /*if ((w != ow) || (h != oh))*/ /* avoid recursion on ecore_evas_resize side */ 126 ow += fw;
126 ecore_evas_resize(ee, ow, oh); 127 oh += fh;
128 ecore_evas_resize(ee, ow, oh);
127} 129}
128 130
129static void 131static void
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
new file mode 100644
index 0000000..72e8555
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -0,0 +1,1131 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#define LOGFNS 1
6
7#ifdef LOGFNS
8# include <stdio.h>
9# define LOGFN(fl, ln, fn) \
10 printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
11#else
12# define LOGFN(fl, ln, fn)
13#endif
14
15#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
16# include <stdlib.h>
17# include <string.h>
18# include <unistd.h>
19# include <sys/types.h>
20# include <sys/mman.h>
21#endif
22
23#include <Eina.h>
24#include <Evas.h>
25#include <Ecore.h>
26
27#include "ecore_evas_private.h"
28#include "Ecore_Evas.h"
29
30#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
31# include <wayland-egl.h>
32# include <Evas_Engine_Wayland_Egl.h>
33# include <Ecore_Wayland.h>
34
35/* local structures */
36typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
37struct _EE_Wl_Smart_Data
38{
39 Evas_Object *frame, *text;
40 Evas_Coord x, y, w, h;
41};
42
43/* local function prototypes */
44static int _ecore_evas_wl_init(void);
45static int _ecore_evas_wl_shutdown(void);
46static void _ecore_evas_wl_pre_free(Ecore_Evas *ee);
47static void _ecore_evas_wl_free(Ecore_Evas *ee);
48static void _ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
49static void _ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
50static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
51static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
52static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
53static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
54static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
55static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
56static void _ecore_evas_wl_show(Ecore_Evas *ee);
57static void _ecore_evas_wl_hide(Ecore_Evas *ee);
58static void _ecore_evas_wl_raise(Ecore_Evas *ee);
59static void _ecore_evas_wl_lower(Ecore_Evas *ee);
60static void _ecore_evas_wl_activate(Ecore_Evas *ee);
61static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t);
62static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
63static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
64static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
65static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
66static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
67static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
68static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
69static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
70static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__);
71static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
72static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
73static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__);
74static int _ecore_evas_wl_render(Ecore_Evas *ee);
75static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
76
77static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
78static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
79static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
80static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event);
81static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
82static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
83static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
84static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
85
86static void _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height);
87static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__);
88
89/* SMART stuff for frame */
90static Evas_Smart *_ecore_evas_wl_smart = NULL;
91
92static void _ecore_evas_wl_smart_init(void);
93static void _ecore_evas_wl_smart_add(Evas_Object *obj);
94static void _ecore_evas_wl_smart_del(Evas_Object *obj);
95static void _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
96static void _ecore_evas_wl_smart_show(Evas_Object *obj);
97static void _ecore_evas_wl_smart_hide(Evas_Object *obj);
98
99static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas);
100
101/* local variables */
102static int _ecore_evas_wl_init_count = 0;
103static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8];
104static uint32_t _ecore_evas_wl_btn_timestamp;
105static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener =
106{
107 _ecore_evas_wl_handle_configure,
108 _ecore_evas_wl_handle_popup_done
109};
110
111static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
112{
113 _ecore_evas_wl_free,
114 _ecore_evas_wl_callback_resize_set,
115 _ecore_evas_wl_callback_move_set,
116 NULL, // callback show set
117 NULL, // callback hide set
118 _ecore_evas_wl_callback_delete_request_set,
119 NULL, // callback destroy set
120 _ecore_evas_wl_callback_focus_in_set,
121 _ecore_evas_wl_callback_focus_out_set,
122 _ecore_evas_wl_callback_mouse_in_set,
123 NULL, // callback mouse out set
124 NULL, // callback sticky set
125 NULL, // callback unsticky set
126 NULL, // callback pre render set
127 NULL, // callback post render set
128 _ecore_evas_wl_move,
129 NULL, // func managed move
130 _ecore_evas_wl_resize,
131 NULL, // _ecore_evas_wl_move_resize,
132 NULL, // func rotation set
133 NULL, // func shaped set
134 _ecore_evas_wl_show,
135 _ecore_evas_wl_hide,
136 _ecore_evas_wl_raise,
137 _ecore_evas_wl_lower,
138 _ecore_evas_wl_activate,
139 _ecore_evas_wl_title_set,
140 _ecore_evas_wl_name_class_set,
141 _ecore_evas_wl_size_min_set,
142 _ecore_evas_wl_size_max_set,
143 _ecore_evas_wl_size_base_set,
144 _ecore_evas_wl_size_step_set,
145 _ecore_evas_wl_object_cursor_set,
146 _ecore_evas_wl_layer_set,
147 _ecore_evas_wl_focus_set,
148 _ecore_evas_wl_iconified_set,
149 NULL, // func borderless set
150 NULL, // func override set
151 _ecore_evas_wl_maximized_set,
152 _ecore_evas_wl_fullscreen_set,
153 NULL, // _ecore_evas_wl_avoid_damage_set,
154 NULL, // func withdrawn set
155 NULL, // func sticky set
156 NULL, // func ignore events set
157 NULL, // func alpha set
158 NULL, // func transparent set
159 _ecore_evas_wl_render,
160 _ecore_evas_wl_screen_geometry_get
161};
162
163#endif
164
165#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
166EAPI Ecore_Evas *
167ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame)
168{
169 Evas_Engine_Info_Wayland_Egl *einfo;
170 Ecore_Evas *ee;
171 int method = 0;
172 static int _win_id = 1;
173
174 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175
176 if (!(method = evas_render_method_lookup("wayland_egl")))
177 {
178 printf("Render method lookup failed for Wayland Egl");
179 return NULL;
180 }
181
182 if (!ecore_wl_init(disp_name))
183 {
184 printf("Failed to initialize Ecore Wayland");
185 return NULL;
186 }
187
188 if (!(ee = calloc(1, sizeof(Ecore_Evas))))
189 {
190 printf("Failed to allocate Ecore_Evas.");
191 ecore_wl_shutdown();
192 return NULL;
193 }
194
195 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
196
197 _ecore_evas_wl_init();
198
199 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
200
201 ee->driver = "wayland_egl";
202 if (disp_name) ee->name = strdup(disp_name);
203
204 if (w < 1) w = 1;
205 if (h < 1) h = 1;
206
207 ee->req.x = ee->x = x;
208 ee->req.y = ee->y = y;
209 ee->req.w = ee->w = w;
210 ee->req.h = ee->h = h;
211 ee->rotation = 0;
212 ee->prop.max.w = ee->prop.max.h = 32767;
213 ee->prop.layer = 4;
214 ee->prop.request_pos = 0;
215 ee->prop.sticky = 0;
216 ee->prop.draw_frame = frame;
217 ee->prop.window = _win_id++;
218
219 ee->evas = evas_new();
220 evas_data_attach_set(ee->evas, ee);
221 evas_output_method_set(ee->evas, method);
222 evas_output_size_set(ee->evas, ee->w, ee->h);
223 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
224
225 if (ee->prop.draw_frame)
226 evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
227
228 if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
229 {
230 einfo->info.display = ecore_wl_display_get();
231 einfo->info.rotation = ee->rotation;
232 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
233 {
234 printf("Failed to set Evas Engine Info for '%s'.", ee->driver);
235 ecore_evas_free(ee);
236 return NULL;
237 }
238 }
239 else
240 {
241 printf("Failed to get Evas Engine Info for '%s'.", ee->driver);
242 ecore_evas_free(ee);
243 return NULL;
244 }
245
246 /* NB: we need to be notified before 'free' so we can munmap the evas
247 * engine destination */
248 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
249
250 if (ee->prop.draw_frame)
251 {
252 ee->engine.wl.frame = _ecore_evas_wl_frame_add(ee->evas);
253 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
254 evas_object_move(ee->engine.wl.frame, 0, 0);
255 }
256
257 ecore_evas_input_event_register(ee);
258 _ecore_evas_register(ee);
259
260 ecore_event_window_register(ee->prop.window, ee, ee->evas,
261 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
262 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
263 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
264 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
265
266 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
267
268 return ee;
269}
270
271/* local functions */
272static int
273_ecore_evas_wl_init(void)
274{
275 LOGFN(__FILE__, __LINE__, __FUNCTION__);
276
277 if (++_ecore_evas_wl_init_count != 1)
278 return _ecore_evas_wl_init_count;
279
280 _ecore_evas_wl_event_handlers[0] =
281 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
282 _ecore_evas_wl_event_mouse_down, NULL);
283 _ecore_evas_wl_event_handlers[1] =
284 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
285 _ecore_evas_wl_event_mouse_up, NULL);
286 _ecore_evas_wl_event_handlers[2] =
287 ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
288 _ecore_evas_wl_event_mouse_move, NULL);
289 _ecore_evas_wl_event_handlers[3] =
290 ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
291 _ecore_evas_wl_event_mouse_wheel, NULL);
292 _ecore_evas_wl_event_handlers[4] =
293 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
294 _ecore_evas_wl_event_mouse_in, NULL);
295 _ecore_evas_wl_event_handlers[5] =
296 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
297 _ecore_evas_wl_event_mouse_out, NULL);
298 _ecore_evas_wl_event_handlers[6] =
299 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
300 _ecore_evas_wl_event_focus_in, NULL);
301 _ecore_evas_wl_event_handlers[7] =
302 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
303 _ecore_evas_wl_event_focus_out, NULL);
304
305 ecore_event_evas_init();
306
307 return _ecore_evas_wl_init_count;
308}
309
310static int
311_ecore_evas_wl_shutdown(void)
312{
313 unsigned int i = 0;
314
315 LOGFN(__FILE__, __LINE__, __FUNCTION__);
316
317 if (--_ecore_evas_wl_init_count != 0)
318 return _ecore_evas_wl_init_count;
319
320 for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++)
321 {
322 if (_ecore_evas_wl_event_handlers[i])
323 ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]);
324 }
325
326 ecore_event_evas_shutdown();
327
328 return _ecore_evas_wl_init_count;
329}
330
331static void
332_ecore_evas_wl_pre_free(Ecore_Evas *ee)
333{
334 LOGFN(__FILE__, __LINE__, __FUNCTION__);
335
336 if (!ee) return;
337 if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
338}
339
340static void
341_ecore_evas_wl_free(Ecore_Evas *ee)
342{
343 LOGFN(__FILE__, __LINE__, __FUNCTION__);
344
345 if (ee)
346 {
347 /* destroy shell surface */
348 if (ee->engine.wl.shell_surface)
349 wl_shell_surface_destroy(ee->engine.wl.shell_surface);
350 ee->engine.wl.shell_surface = NULL;
351
352 /* destroy surface */
353 if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
354 ee->engine.wl.surface = NULL;
355
356 ecore_event_window_unregister(ee->prop.window);
357 ecore_evas_input_event_unregister(ee);
358 }
359 _ecore_evas_wl_shutdown();
360 ecore_wl_shutdown();
361}
362
363static void
364_ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
365{
366 LOGFN(__FILE__, __LINE__, __FUNCTION__);
367
368 if (!ee) return;
369 ee->func.fn_resize = func;
370}
371
372static void
373_ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
374{
375 LOGFN(__FILE__, __LINE__, __FUNCTION__);
376
377 if (!ee) return;
378 ee->func.fn_move = func;
379}
380
381static void
382_ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
383{
384 LOGFN(__FILE__, __LINE__, __FUNCTION__);
385
386 if (!ee) return;
387 ee->func.fn_delete_request = func;
388}
389
390static void
391_ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
392{
393 LOGFN(__FILE__, __LINE__, __FUNCTION__);
394
395 if (!ee) return;
396 ee->func.fn_focus_in = func;
397}
398
399static void
400_ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
401{
402 LOGFN(__FILE__, __LINE__, __FUNCTION__);
403
404 if (!ee) return;
405 ee->func.fn_focus_out = func;
406}
407
408static void
409_ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
410{
411 LOGFN(__FILE__, __LINE__, __FUNCTION__);
412
413 if (!ee) return;
414 ee->func.fn_mouse_in = func;
415}
416
417static void
418_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
419{
420 LOGFN(__FILE__, __LINE__, __FUNCTION__);
421
422 if (!ee) return;
423// if ((ee->x == x) && (ee->y == y)) return;
424 ee->req.x = x;
425 ee->req.y = y;
426
427 ee->x = x;
428 ee->y = y;
429 if (ee->engine.wl.shell_surface)
430 {
431 wl_shell_surface_move(ee->engine.wl.shell_surface,
432 ecore_wl_input_device_get(),
433 _ecore_evas_wl_btn_timestamp);
434 }
435 if (ee->func.fn_move) ee->func.fn_move(ee);
436}
437
438static void
439_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
440{
441 LOGFN(__FILE__, __LINE__, __FUNCTION__);
442
443 if (!ee) return;
444 if (w < 1) w = 1;
445 if (h < 1) h = 1;
446 if ((ee->w == w) && (ee->h == h)) return;
447
448 ee->req.w = w;
449 ee->req.h = h;
450
451 /* if (ee->visible) */
452 /* { */
453 /* damage old surface, if it exists */
454
455 /* NB: This removes any lingering screen artifacts in the compositor.
456 * This may be a 'HACK' if the issue is actually in the wayland
457 * compositor, but for now lets implement this so we don't have screen
458 * artifacts laying around during a resize */
459 /* if (ee->engine.wl.surface) */
460 /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
461 /* } */
462
463 ee->w = w;
464 ee->h = h;
465
466// ecore_wl_flush();
467
468 evas_output_size_set(ee->evas, ee->w, ee->h);
469 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
470 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
471 if (ee->engine.wl.frame)
472 evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
473
474 /* if ((ee->visible) && (ee->engine.wl.surface)) */
475 /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
476
477 if (ee->func.fn_resize) ee->func.fn_resize(ee);
478}
479
480static void
481_ecore_evas_wl_show(Ecore_Evas *ee)
482{
483 Evas_Engine_Info_Wayland_Egl *einfo;
484
485 LOGFN(__FILE__, __LINE__, __FUNCTION__);
486
487 if (!ee) return;
488 if (ee->visible) return;
489
490 einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
491
492 /* create new surface */
493 ee->engine.wl.surface =
494 wl_compositor_create_surface(ecore_wl_compositor_get());
495 wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window);
496
497 /* create new shell surface */
498 ee->engine.wl.shell_surface =
499 wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface);
500
501 /* set the engine surface here. This should trigger an egl window create */
502 einfo->info.surface = ee->engine.wl.surface;
503 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
504
505 /* add listener for configure events (happen on shell surface resize) */
506 wl_shell_surface_add_listener(ee->engine.wl.shell_surface,
507 &_ecore_evas_wl_shell_surface_listener, ee);
508
509 /* Raise this surface to the top */
510 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
511
512 if (ee->engine.wl.frame)
513 {
514 evas_object_show(ee->engine.wl.frame);
515 evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
516 }
517
518 ecore_wl_flush();
519
520 ee->visible = 1;
521 if (ee->func.fn_show) ee->func.fn_show(ee);
522}
523
524static void
525_ecore_evas_wl_hide(Ecore_Evas *ee)
526{
527 Evas_Engine_Info_Wayland_Egl *einfo;
528
529 LOGFN(__FILE__, __LINE__, __FUNCTION__);
530
531 if (!ee) return;
532 if (!ee->visible) return;
533
534 /* get engine info */
535 einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
536 einfo->info.surface = NULL;
537 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
538
539 /* destroy shell surface */
540 if (ee->engine.wl.shell_surface)
541 wl_shell_surface_destroy(ee->engine.wl.shell_surface);
542 ee->engine.wl.shell_surface = NULL;
543
544 /* destroy surface */
545 if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
546 ee->engine.wl.surface = NULL;
547
548 ee->visible = 0;
549 ee->should_be_visible = 0;
550 if (ee->func.fn_hide) ee->func.fn_hide(ee);
551}
552
553static void
554_ecore_evas_wl_raise(Ecore_Evas *ee)
555{
556 LOGFN(__FILE__, __LINE__, __FUNCTION__);
557
558 if ((!ee) || (!ee->visible)) return;
559 if (!ee->engine.wl.shell_surface) return;
560 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
561}
562
563static void
564_ecore_evas_wl_lower(Ecore_Evas *ee)
565{
566 LOGFN(__FILE__, __LINE__, __FUNCTION__);
567
568 if ((!ee) || (!ee->visible)) return;
569 /* FIXME: Need a way to tell Wayland to lower */
570}
571
572static void
573_ecore_evas_wl_activate(Ecore_Evas *ee)
574{
575 LOGFN(__FILE__, __LINE__, __FUNCTION__);
576
577 if ((!ee) || (!ee->visible)) return;
578 if (!ee->engine.wl.shell_surface) return;
579 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
580}
581
582static void
583_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t)
584{
585 LOGFN(__FILE__, __LINE__, __FUNCTION__);
586
587 if (!ee) return;
588 if (ee->prop.title) free(ee->prop.title);
589 ee->prop.title = NULL;
590 if (t) ee->prop.title = strdup(t);
591
592 if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
593 {
594 EE_Wl_Smart_Data *sd;
595
596 if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
597 evas_object_text_text_set(sd->text, ee->prop.title);
598 }
599}
600
601static void
602_ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
603{
604 LOGFN(__FILE__, __LINE__, __FUNCTION__);
605
606 if (!ee) return;
607 if (ee->prop.name) free(ee->prop.name);
608 if (ee->prop.clas) free(ee->prop.clas);
609 ee->prop.name = NULL;
610 ee->prop.clas = NULL;
611 if (n) ee->prop.name = strdup(n);
612 if (c) ee->prop.clas = strdup(c);
613 /* FIXME: Forward these changes to Wayland somehow */
614}
615
616static void
617_ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h)
618{
619 LOGFN(__FILE__, __LINE__, __FUNCTION__);
620
621 if (!ee) return;
622 if (w < 0) w = 0;
623 if (h < 0) h = 0;
624 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
625 ee->prop.min.w = w;
626 ee->prop.min.h = h;
627}
628
629static void
630_ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h)
631{
632 LOGFN(__FILE__, __LINE__, __FUNCTION__);
633
634 if (!ee) return;
635 if (w < 0) w = 0;
636 if (h < 0) h = 0;
637 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
638 ee->prop.max.w = w;
639 ee->prop.max.h = h;
640}
641
642static void
643_ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h)
644{
645 LOGFN(__FILE__, __LINE__, __FUNCTION__);
646
647 if (!ee) return;
648 if (w < 0) w = 0;
649 if (h < 0) h = 0;
650 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
651 ee->prop.base.w = w;
652 ee->prop.base.h = h;
653}
654
655static void
656_ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h)
657{
658 LOGFN(__FILE__, __LINE__, __FUNCTION__);
659
660 if (!ee) return;
661 if (w < 0) w = 0;
662 if (h < 0) h = 0;
663 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
664 ee->prop.step.w = w;
665 ee->prop.step.h = h;
666}
667
668static void
669_ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
670{
671 int x = 0, y = 0;
672
673 LOGFN(__FILE__, __LINE__, __FUNCTION__);
674
675 if (!ee) return;
676 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
677 ee->prop.cursor.object = NULL;
678
679 if (!obj)
680 {
681 ee->prop.cursor.layer = 0;
682 ee->prop.cursor.hot.x = 0;
683 ee->prop.cursor.hot.y = 0;
684 return;
685 }
686
687 ee->prop.cursor.object = obj;
688 ee->prop.cursor.layer = layer;
689 ee->prop.cursor.hot.x = hot_x;
690 ee->prop.cursor.hot.y = hot_y;
691
692 evas_pointer_output_xy_get(ee->evas, &x, &y);
693 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
694 evas_object_move(ee->prop.cursor.object,
695 x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y);
696 evas_object_pass_events_set(ee->prop.cursor.object, 1);
697 if (evas_pointer_inside_get(ee->evas))
698 evas_object_show(ee->prop.cursor.object);
699
700 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
701 _ecore_evas_wl_object_cursor_del, ee);
702}
703
704static void
705_ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
706{
707 Ecore_Evas *ee;
708
709 if (!(ee = data)) return;
710 ee->prop.cursor.object = NULL;
711}
712
713static void
714_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
715{
716 LOGFN(__FILE__, __LINE__, __FUNCTION__);
717
718 if (!ee) return;
719 if (ee->prop.layer == layer) return;
720 if (layer < 1) layer = 1;
721 else if (layer > 255) layer = 255;
722 ee->prop.layer = layer;
723}
724
725static void
726_ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__)
727{
728 LOGFN(__FILE__, __LINE__, __FUNCTION__);
729
730 if ((!ee) || (!ee->visible)) return;
731 if (!ee->engine.wl.shell_surface) return;
732 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
733}
734
735static void
736_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
737{
738 LOGFN(__FILE__, __LINE__, __FUNCTION__);
739
740 if (!ee) return;
741 if (ee->prop.iconified == iconify) return;
742 ee->prop.iconified = iconify;
743 /* FIXME: Implement this in Wayland someshow */
744}
745
746static void
747_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
748{
749 LOGFN(__FILE__, __LINE__, __FUNCTION__);
750
751 if (!ee) return;
752 if (ee->prop.maximized == max) return;
753 ee->prop.maximized = max;
754 /* FIXME: Implement this in Wayland someshow */
755}
756
757static void
758_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__)
759{
760 LOGFN(__FILE__, __LINE__, __FUNCTION__);
761
762 if ((!ee) || (!ee->visible)) return;
763 if (!ee->engine.wl.shell_surface) return;
764 wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface);
765}
766
767static int
768_ecore_evas_wl_render(Ecore_Evas *ee)
769{
770 int rend = 0;
771
772 if (!ee) return 0;
773 if (!ee->visible)
774 evas_norender(ee->evas);
775 else
776 {
777 Eina_List *ll = NULL, *updates = NULL;
778 Ecore_Evas *ee2 = NULL;
779
780 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
781
782 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
783 {
784 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
785 if (ee2->engine.func->fn_render)
786 rend |= ee2->engine.func->fn_render(ee2);
787 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
788 }
789
790 if ((updates = evas_render_updates(ee->evas)))
791 {
792 /* if (ee->engine.wl.surface) */
793 /* { */
794 /* Eina_List *l = NULL; */
795 /* Eina_Rectangle *r; */
796
797 /* EINA_LIST_FOREACH(updates, l, r) */
798 /* wl_surface_damage(ee->engine.wl.surface, */
799 /* r->x, r->y, r->w, r->h); */
800 /* } */
801
802 evas_render_updates_free(updates);
803 _ecore_evas_idle_timeout_update(ee);
804 rend = 1;
805
806 ecore_wl_flush();
807 }
808
809 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
810 }
811
812 return rend;
813}
814
815static void
816_ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
817{
818 LOGFN(__FILE__, __LINE__, __FUNCTION__);
819
820 if (x) *x = 0;
821 if (y) *y = 0;
822 ecore_wl_screen_size_get(w, h);
823}
824
825static Eina_Bool
826_ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
827{
828 Ecore_Evas *ee;
829 Ecore_Event_Mouse_Button *ev;
830
831 LOGFN(__FILE__, __LINE__, __FUNCTION__);
832
833 ev = event;
834 _ecore_evas_wl_btn_timestamp = ev->timestamp;
835 ee = ecore_event_window_match(ev->window);
836 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
837 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
838 evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers,
839 ev->timestamp, NULL);
840 return ECORE_CALLBACK_PASS_ON;
841}
842
843static Eina_Bool
844_ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
845{
846 Ecore_Evas *ee;
847 Ecore_Event_Mouse_Button *ev;
848
849 LOGFN(__FILE__, __LINE__, __FUNCTION__);
850
851 ev = event;
852 ee = ecore_event_window_match(ev->window);
853 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
854 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
855 evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers,
856 ev->timestamp, NULL);
857 return ECORE_CALLBACK_PASS_ON;
858}
859
860static Eina_Bool
861_ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
862{
863 Ecore_Evas *ee;
864 Ecore_Event_Mouse_Move *ev;
865
866 ev = event;
867 ee = ecore_event_window_match(ev->window);
868 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
869 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
870 ee->mouse.x = ev->x;
871 ee->mouse.y = ev->y;
872 evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL);
873 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
874 return ECORE_CALLBACK_PASS_ON;
875}
876
877static Eina_Bool
878_ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
879{
880 Ecore_Evas *ee;
881 Ecore_Event_Mouse_Wheel *ev;
882
883 LOGFN(__FILE__, __LINE__, __FUNCTION__);
884
885 ev = event;
886 ee = ecore_event_window_match(ev->window);
887 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
888 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
889 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z,
890 ev->timestamp, NULL);
891 return ECORE_CALLBACK_PASS_ON;
892}
893
894static Eina_Bool
895_ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
896{
897 Ecore_Evas *ee;
898 Ecore_Wl_Event_Mouse_In *ev;
899
900 LOGFN(__FILE__, __LINE__, __FUNCTION__);
901
902 ev = event;
903 ee = ecore_event_window_match(ev->window);
904 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
905 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
906 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
907 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
908 evas_event_feed_mouse_in(ee->evas, ev->time, NULL);
909 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
910 return ECORE_CALLBACK_PASS_ON;
911}
912
913static Eina_Bool
914_ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
915{
916 Ecore_Evas *ee;
917 Ecore_Wl_Event_Mouse_Out *ev;
918
919 LOGFN(__FILE__, __LINE__, __FUNCTION__);
920
921 ev = event;
922 ee = ecore_event_window_match(ev->window);
923 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
924 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
925 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
926 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
927 evas_event_feed_mouse_out(ee->evas, ev->time, NULL);
928 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
929 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
930 return ECORE_CALLBACK_PASS_ON;
931}
932
933static Eina_Bool
934_ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
935{
936 Ecore_Evas *ee;
937 Ecore_Wl_Event_Focus_In *ev;
938
939 LOGFN(__FILE__, __LINE__, __FUNCTION__);
940
941 ev = event;
942 ee = ecore_event_window_match(ev->window);
943 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
944 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
945 ee->prop.focused = 1;
946 evas_focus_in(ee->evas);
947 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
948 return ECORE_CALLBACK_PASS_ON;
949}
950
951static Eina_Bool
952_ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
953{
954 Ecore_Evas *ee;
955 Ecore_Wl_Event_Focus_Out *ev;
956
957 LOGFN(__FILE__, __LINE__, __FUNCTION__);
958
959 ev = event;
960 ee = ecore_event_window_match(ev->window);
961 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
962 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
963 evas_focus_out(ee->evas);
964 ee->prop.focused = 0;
965 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
966 return ECORE_CALLBACK_PASS_ON;
967}
968
969static void
970_ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height)
971{
972 Ecore_Evas *ee;
973
974 /* NB: Trap to prevent compositor from crashing */
975 if ((width <= 0) || (height <= 0)) return;
976
977 if (!(ee = data)) return;
978
979 printf("EGL Handle Configure Message\n");
980 if ((shell_surface) && (ee->engine.wl.shell_surface))
981 {
982 if (ee->engine.wl.shell_surface != shell_surface) return;
983 ecore_evas_resize(ee, width, height);
984 }
985}
986
987static void
988_ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__)
989{
990
991}
992
993static void
994_ecore_evas_wl_smart_init(void)
995{
996 if (_ecore_evas_wl_smart) return;
997 {
998 static const Evas_Smart_Class sc =
999 {
1000 "ecore_evas_wl_frame", EVAS_SMART_CLASS_VERSION,
1001 _ecore_evas_wl_smart_add,
1002 _ecore_evas_wl_smart_del,
1003 NULL,
1004 _ecore_evas_wl_smart_resize,
1005 _ecore_evas_wl_smart_show,
1006 _ecore_evas_wl_smart_hide,
1007 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
1008 };
1009 _ecore_evas_wl_smart = evas_smart_class_new(&sc);
1010 }
1011}
1012
1013static void
1014_ecore_evas_wl_smart_add(Evas_Object *obj)
1015{
1016 EE_Wl_Smart_Data *sd;
1017 Evas *evas;
1018
1019 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1020
1021 if (!(sd = calloc(1, sizeof(EE_Wl_Smart_Data)))) return;
1022
1023 evas = evas_object_evas_get(obj);
1024
1025 sd->x = 0;
1026 sd->y = 0;
1027 sd->w = 1;
1028 sd->h = 1;
1029
1030 sd->frame = evas_object_rectangle_add(evas);
1031 evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
1032 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1033 evas_object_smart_member_add(sd->frame, obj);
1034
1035 sd->text = evas_object_text_add(evas);
1036 evas_object_color_set(sd->text, 0, 0, 0, 255);
1037 evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
1038 evas_object_text_font_set(sd->text, "Sans", 10);
1039 evas_object_text_text_set(sd->text, "Smart Test");
1040
1041 evas_object_smart_data_set(obj, sd);
1042}
1043
1044static void
1045_ecore_evas_wl_smart_del(Evas_Object *obj)
1046{
1047 EE_Wl_Smart_Data *sd;
1048
1049 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1050
1051 if (!(sd = evas_object_smart_data_get(obj))) return;
1052 evas_object_del(sd->text);
1053 evas_object_del(sd->frame);
1054 free(sd);
1055}
1056
1057static void
1058_ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1059{
1060 EE_Wl_Smart_Data *sd;
1061
1062 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1063
1064 if (!(sd = evas_object_smart_data_get(obj))) return;
1065 if ((sd->w == w) && (sd->h == h)) return;
1066 sd->w = w;
1067 sd->h = h;
1068 evas_object_resize(sd->frame, w, h);
1069}
1070
1071static void
1072_ecore_evas_wl_smart_show(Evas_Object *obj)
1073{
1074 EE_Wl_Smart_Data *sd;
1075
1076 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1077
1078 if (!(sd = evas_object_smart_data_get(obj))) return;
1079 evas_object_show(sd->frame);
1080 evas_object_show(sd->text);
1081}
1082
1083static void
1084_ecore_evas_wl_smart_hide(Evas_Object *obj)
1085{
1086 EE_Wl_Smart_Data *sd;
1087
1088 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1089
1090 if (!(sd = evas_object_smart_data_get(obj))) return;
1091 evas_object_hide(sd->text);
1092 evas_object_hide(sd->frame);
1093}
1094
1095static Evas_Object *
1096_ecore_evas_wl_frame_add(Evas *evas)
1097{
1098 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1099
1100 _ecore_evas_wl_smart_init();
1101 return evas_object_smart_add(evas, _ecore_evas_wl_smart);
1102}
1103
1104void
1105_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
1106{
1107 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1108
1109 if ((!ee) || (!ee->engine.wl.shell_surface)) return;
1110 wl_shell_surface_resize(ee->engine.wl.shell_surface,
1111 ecore_wl_input_device_get(),
1112 _ecore_evas_wl_btn_timestamp, location);
1113}
1114
1115void
1116_ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
1117{
1118 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1119
1120 if ((!ee) || (!ee->engine.wl.surface)) return;
1121 if ((!source) || (!drag_ee)) return;
1122 ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer);
1123}
1124
1125#else
1126EAPI Ecore_Evas *
1127ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)
1128{
1129 return NULL;
1130}
1131#endif
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
new file mode 100644
index 0000000..e3b15c8
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -0,0 +1,1257 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5//#define LOGFNS 1
6
7#ifdef LOGFNS
8# include <stdio.h>
9# define LOGFN(fl, ln, fn) \
10 printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
11#else
12# define LOGFN(fl, ln, fn)
13#endif
14
15#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
16# include <stdlib.h>
17# include <string.h>
18# include <unistd.h>
19# include <sys/types.h>
20# include <sys/mman.h>
21#endif
22
23# include <Eina.h>
24# include <Evas.h>
25# include <Ecore.h>
26
27# include "ecore_evas_private.h"
28# include "Ecore_Evas.h"
29
30#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
31# include <Evas_Engine_Wayland_Shm.h>
32# include <Ecore_Wayland.h>
33
34/* local structures */
35typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
36struct _EE_Wl_Smart_Data
37{
38 Evas_Object *frame;
39 Evas_Object *text;
40 Evas_Coord x, y, w, h;
41};
42
43/* local function prototypes */
44static int _ecore_evas_wl_init(void);
45static int _ecore_evas_wl_shutdown(void);
46static void _ecore_evas_wl_pre_free(Ecore_Evas *ee);
47static void _ecore_evas_wl_free(Ecore_Evas *ee);
48static void _ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
49static void _ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
50static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
51static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
52static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
53static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
54static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
55static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
56static void _ecore_evas_wl_show(Ecore_Evas *ee);
57static void _ecore_evas_wl_hide(Ecore_Evas *ee);
58static void _ecore_evas_wl_raise(Ecore_Evas *ee);
59static void _ecore_evas_wl_lower(Ecore_Evas *ee);
60static void _ecore_evas_wl_activate(Ecore_Evas *ee);
61static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t);
62static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
63static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
64static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
65static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
66static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
67static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
68static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
69static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
70static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__);
71static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
72static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
73static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__);
74static int _ecore_evas_wl_render(Ecore_Evas *ee);
75static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
76static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest);
77
78static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
79static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
80static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
81static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event);
82static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
83static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
84static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
85static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
86
87static void _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height);
88static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__);
89
90/* SMART stuff for frame */
91static Evas_Smart *_ecore_evas_wl_smart = NULL;
92
93static void _ecore_evas_wl_smart_init(void);
94static void _ecore_evas_wl_smart_add(Evas_Object *obj);
95static void _ecore_evas_wl_smart_del(Evas_Object *obj);
96static void _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
97static void _ecore_evas_wl_smart_show(Evas_Object *obj);
98static void _ecore_evas_wl_smart_hide(Evas_Object *obj);
99
100static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas);
101
102/* local variables */
103static int _ecore_evas_wl_init_count = 0;
104static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8];
105static uint32_t _ecore_evas_wl_btn_timestamp;
106static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener =
107{
108 _ecore_evas_wl_handle_configure,
109 _ecore_evas_wl_handle_popup_done
110};
111
112static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
113{
114 _ecore_evas_wl_free,
115 _ecore_evas_wl_callback_resize_set,
116 _ecore_evas_wl_callback_move_set,
117 NULL, // callback show set
118 NULL, // callback hide set
119 _ecore_evas_wl_callback_delete_request_set,
120 NULL, // callback destroy set
121 _ecore_evas_wl_callback_focus_in_set,
122 _ecore_evas_wl_callback_focus_out_set,
123 _ecore_evas_wl_callback_mouse_in_set,
124 NULL, // callback mouse out set
125 NULL, // callback sticky set
126 NULL, // callback unsticky set
127 NULL, // callback pre render set
128 NULL, // callback post render set
129 _ecore_evas_wl_move,
130 NULL, // func managed move
131 _ecore_evas_wl_resize,
132 NULL, // func move_resize
133 NULL, // func rotation set
134 NULL, // func shaped set
135 _ecore_evas_wl_show,
136 _ecore_evas_wl_hide,
137 _ecore_evas_wl_raise,
138 _ecore_evas_wl_lower,
139 _ecore_evas_wl_activate,
140 _ecore_evas_wl_title_set,
141 _ecore_evas_wl_name_class_set,
142 _ecore_evas_wl_size_min_set,
143 _ecore_evas_wl_size_max_set,
144 _ecore_evas_wl_size_base_set,
145 _ecore_evas_wl_size_step_set,
146 _ecore_evas_wl_object_cursor_set,
147 _ecore_evas_wl_layer_set,
148 _ecore_evas_wl_focus_set,
149 _ecore_evas_wl_iconified_set,
150 NULL, // func borderless set
151 NULL, // func override set
152 _ecore_evas_wl_maximized_set,
153 _ecore_evas_wl_fullscreen_set,
154 NULL, // func avoid_damage set
155 NULL, // func withdrawn set
156 NULL, // func sticky set
157 NULL, // func ignore_events set
158 NULL, // func alpha set
159 NULL, // func transparent set
160 _ecore_evas_wl_render,
161 _ecore_evas_wl_screen_geometry_get
162};
163
164/* external variables */
165#endif
166
167#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
168EAPI Ecore_Evas *
169ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame)
170{
171 Evas_Engine_Info_Wayland_Shm *einfo;
172 Ecore_Evas *ee;
173 int method = 0;
174 static int _win_id = 1;
175
176 LOGFN(__FILE__, __LINE__, __FUNCTION__);
177
178 if (!(method = evas_render_method_lookup("wayland_shm")))
179 {
180 ERR("Render method lookup failed.");
181 return NULL;
182 }
183
184 if (!(ecore_wl_init(disp_name)))
185 {
186 ERR("Failed to initialize Ecore Wayland.");
187 return NULL;
188 }
189
190 if (!(ee = calloc(1, sizeof(Ecore_Evas))))
191 {
192 ERR("Failed to allocate Ecore_Evas.");
193 ecore_wl_shutdown();
194 return NULL;
195 }
196
197 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
198
199 _ecore_evas_wl_init();
200
201 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
202
203 ee->driver = "wayland_shm";
204 if (disp_name) ee->name = strdup(disp_name);
205
206 if (w < 1) w = 1;
207 if (h < 1) h = 1;
208
209 ee->req.x = ee->x = x;
210 ee->req.y = ee->y = y;
211 ee->req.w = ee->w = w;
212 ee->req.h = ee->h = h;
213 ee->rotation = 0;
214 ee->prop.max.w = ee->prop.max.h = 32767;
215 ee->prop.layer = 4;
216 ee->prop.request_pos = 0;
217 ee->prop.sticky = 0;
218 ee->prop.draw_frame = frame;
219 ee->prop.window = _win_id++;
220
221 ee->evas = evas_new();
222 evas_data_attach_set(ee->evas, ee);
223 evas_output_method_set(ee->evas, method);
224 evas_output_size_set(ee->evas, ee->w, ee->h);
225 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
226
227 if (ee->prop.draw_frame)
228 evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
229
230 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
231 {
232 einfo->info.rotation = ee->rotation;
233 einfo->info.debug = EINA_FALSE;
234 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
235 {
236 ERR("Failed to set Evas Engine Info for '%s'.", ee->driver);
237 ecore_evas_free(ee);
238 return NULL;
239 }
240 }
241 else
242 {
243 ERR("Failed to get Evas Engine Info for '%s'.", ee->driver);
244 ecore_evas_free(ee);
245 return NULL;
246 }
247
248 /* NB: we need to be notified before 'free' so we can munmap the evas
249 * engine destination */
250 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
251
252 if (ee->prop.draw_frame)
253 {
254 ee->engine.wl.frame = _ecore_evas_wl_frame_add(ee->evas);
255 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
256 evas_object_move(ee->engine.wl.frame, 0, 0);
257 }
258
259 ecore_evas_input_event_register(ee);
260 _ecore_evas_register(ee);
261
262 ecore_event_window_register(ee->prop.window, ee, ee->evas,
263 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
264 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
265 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
266 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
267
268 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
269
270 return ee;
271}
272
273/* local functions */
274static int
275_ecore_evas_wl_init(void)
276{
277 LOGFN(__FILE__, __LINE__, __FUNCTION__);
278
279 if (++_ecore_evas_wl_init_count != 1)
280 return _ecore_evas_wl_init_count;
281
282 _ecore_evas_wl_event_handlers[0] =
283 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
284 _ecore_evas_wl_event_mouse_down, NULL);
285 _ecore_evas_wl_event_handlers[1] =
286 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
287 _ecore_evas_wl_event_mouse_up, NULL);
288 _ecore_evas_wl_event_handlers[2] =
289 ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
290 _ecore_evas_wl_event_mouse_move, NULL);
291 _ecore_evas_wl_event_handlers[3] =
292 ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
293 _ecore_evas_wl_event_mouse_wheel, NULL);
294 _ecore_evas_wl_event_handlers[4] =
295 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
296 _ecore_evas_wl_event_mouse_in, NULL);
297 _ecore_evas_wl_event_handlers[5] =
298 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
299 _ecore_evas_wl_event_mouse_out, NULL);
300 _ecore_evas_wl_event_handlers[6] =
301 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
302 _ecore_evas_wl_event_focus_in, NULL);
303 _ecore_evas_wl_event_handlers[7] =
304 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
305 _ecore_evas_wl_event_focus_out, NULL);
306
307 ecore_event_evas_init();
308
309 return _ecore_evas_wl_init_count;
310}
311
312static int
313_ecore_evas_wl_shutdown(void)
314{
315 unsigned int i = 0;
316
317 LOGFN(__FILE__, __LINE__, __FUNCTION__);
318
319 if (--_ecore_evas_wl_init_count != 0)
320 return _ecore_evas_wl_init_count;
321
322 for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++)
323 {
324 if (_ecore_evas_wl_event_handlers[i])
325 ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]);
326 }
327
328 ecore_event_evas_shutdown();
329
330 return _ecore_evas_wl_init_count;
331}
332
333static void
334_ecore_evas_wl_pre_free(Ecore_Evas *ee)
335{
336 Evas_Engine_Info_Wayland_Shm *einfo;
337
338 LOGFN(__FILE__, __LINE__, __FUNCTION__);
339
340 /* destroy frame */
341 if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
342
343 /* get engine info */
344 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
345 if ((einfo) && (einfo->info.dest))
346 {
347 int ret = 0;
348
349 /* munmap previous engine destination */
350 ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
351 }
352}
353
354static void
355_ecore_evas_wl_free(Ecore_Evas *ee)
356{
357 LOGFN(__FILE__, __LINE__, __FUNCTION__);
358
359 /* destroy buffer */
360 if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
361 ee->engine.wl.buffer = NULL;
362
363 /* destroy shell surface */
364 if (ee->engine.wl.shell_surface)
365 wl_shell_surface_destroy(ee->engine.wl.shell_surface);
366 ee->engine.wl.shell_surface = NULL;
367
368 /* destroy surface */
369 if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
370 ee->engine.wl.surface = NULL;
371
372 ecore_event_window_unregister(ee->prop.window);
373 ecore_evas_input_event_unregister(ee);
374
375 _ecore_evas_wl_shutdown();
376 ecore_wl_shutdown();
377}
378
379static void
380_ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
381{
382 LOGFN(__FILE__, __LINE__, __FUNCTION__);
383
384 if (!ee) return;
385 ee->func.fn_resize = func;
386}
387
388static void
389_ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
390{
391 LOGFN(__FILE__, __LINE__, __FUNCTION__);
392
393 if (!ee) return;
394 ee->func.fn_move = func;
395}
396
397static void
398_ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
399{
400 LOGFN(__FILE__, __LINE__, __FUNCTION__);
401
402 if (!ee) return;
403 ee->func.fn_delete_request = func;
404}
405
406static void
407_ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
408{
409 LOGFN(__FILE__, __LINE__, __FUNCTION__);
410
411 if (!ee) return;
412 ee->func.fn_focus_in = func;
413}
414
415static void
416_ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
417{
418 LOGFN(__FILE__, __LINE__, __FUNCTION__);
419
420 if (!ee) return;
421 ee->func.fn_focus_out = func;
422}
423
424static void
425_ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
426{
427 LOGFN(__FILE__, __LINE__, __FUNCTION__);
428
429 if (!ee) return;
430 ee->func.fn_mouse_in = func;
431}
432
433static void
434_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
435{
436 LOGFN(__FILE__, __LINE__, __FUNCTION__);
437
438 if (!ee) return;
439// if ((ee->x == x) && (ee->y == y)) return;
440 ee->req.x = x;
441 ee->req.y = y;
442
443 ee->x = x;
444 ee->y = y;
445
446 if (ee->engine.wl.shell_surface)
447 {
448 wl_shell_surface_move(ee->engine.wl.shell_surface,
449 ecore_wl_input_device_get(),
450 _ecore_evas_wl_btn_timestamp);
451 }
452
453 if (ee->func.fn_move) ee->func.fn_move(ee);
454}
455
456static void
457_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
458{
459 Evas_Engine_Info_Wayland_Shm *einfo;
460
461 LOGFN(__FILE__, __LINE__, __FUNCTION__);
462
463 if (!ee) return;
464 if (w < 1) w = 1;
465 if (h < 1) h = 1;
466 if ((ee->w == w) && (ee->h == h)) return;
467
468 ee->req.w = w;
469 ee->req.h = h;
470
471 if (ee->visible)
472 {
473 /* damage old surface, if it exists */
474
475 /* NB: This removes any lingering screen artifacts in the compositor.
476 * This may be a 'HACK' if the issue is actually in the wayland
477 * compositor, but for now lets implement this so we don't have screen
478 * artifacts laying around during a resize */
479 if (ee->engine.wl.surface)
480 wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h);
481 }
482
483 /* get engine info */
484 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
485 if (einfo->info.dest)
486 {
487 int ret = 0;
488
489 /* munmap previous engine destination */
490 ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
491 }
492
493 /* free old buffer */
494 if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
495 ee->engine.wl.buffer = NULL;
496
497 ee->w = w;
498 ee->h = h;
499
500 /* create buffer @ new size (also mmaps the new destination) */
501 _ecore_evas_wl_buffer_new(ee, &einfo->info.dest);
502
503 /* flush new buffer fd */
504 ecore_wl_flush();
505
506 /* change evas output & viewport sizes */
507 evas_output_size_set(ee->evas, ee->w, ee->h);
508 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
509 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
510 if (ee->engine.wl.frame)
511 evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
512
513 /* set new engine destination */
514 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
515
516 /* damage buffer */
517 wl_buffer_damage(ee->engine.wl.buffer, 0, 0, ee->w, ee->h);
518
519 if (ee->visible)
520 {
521 /* damage surface */
522 wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h);
523
524 /* if visible, attach to surface */
525 wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0);
526 }
527
528 if (ee->func.fn_resize) ee->func.fn_resize(ee);
529}
530
531static void
532_ecore_evas_wl_show(Ecore_Evas *ee)
533{
534 Evas_Engine_Info_Wayland_Shm *einfo;
535
536 LOGFN(__FILE__, __LINE__, __FUNCTION__);
537
538 if (!ee) return;
539 if (ee->visible) return;
540
541 /* get engine info */
542 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
543
544 /* create new surface */
545 ee->engine.wl.surface =
546 wl_compositor_create_surface(ecore_wl_compositor_get());
547 wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window);
548
549 /* get new shell surface */
550 ee->engine.wl.shell_surface =
551 wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface);
552
553 /* set toplevel */
554 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
555
556 /* create buffer @ new size (also mmaps the new destination) */
557 _ecore_evas_wl_buffer_new(ee, &einfo->info.dest);
558
559 if (ee->engine.wl.frame)
560 {
561 evas_object_show(ee->engine.wl.frame);
562 evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
563 }
564
565 /* set new engine destination */
566 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
567
568 /* add configure listener for wayland resize events */
569 wl_shell_surface_add_listener(ee->engine.wl.shell_surface,
570 &_ecore_evas_wl_shell_surface_listener, ee);
571
572 /* flush new buffer fd */
573 ecore_wl_flush();
574
575 /* attach buffer to surface */
576 wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0);
577
578 /* NB: No need to do a damage here. If we do, we end up w/ screen
579 * artifacts in the compositor */
580 /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
581
582 ee->visible = 1;
583 if (ee->func.fn_show) ee->func.fn_show(ee);
584}
585
586static void
587_ecore_evas_wl_hide(Ecore_Evas *ee)
588{
589 Evas_Engine_Info_Wayland_Shm *einfo;
590
591 LOGFN(__FILE__, __LINE__, __FUNCTION__);
592
593 if (!ee) return;
594 if (!ee->visible) return;
595
596 /* get engine info */
597 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
598 if (einfo->info.dest)
599 {
600 int ret = 0;
601
602 /* munmap previous engine destination */
603 ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
604 einfo->info.dest = NULL;
605 }
606
607 /* free old buffer */
608 if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
609 ee->engine.wl.buffer = NULL;
610
611 /* set new engine destination */
612 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
613
614 /* destroy shell surface */
615 if (ee->engine.wl.shell_surface)
616 wl_shell_surface_destroy(ee->engine.wl.shell_surface);
617 ee->engine.wl.shell_surface = NULL;
618
619 /* destroy surface */
620 if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
621 ee->engine.wl.surface = NULL;
622
623 ee->visible = 0;
624 ee->should_be_visible = 0;
625 if (ee->func.fn_hide) ee->func.fn_hide(ee);
626}
627
628static void
629_ecore_evas_wl_raise(Ecore_Evas *ee)
630{
631 LOGFN(__FILE__, __LINE__, __FUNCTION__);
632
633 if ((!ee) || (!ee->visible)) return;
634 if (!ee->engine.wl.shell_surface) return;
635 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
636}
637
638static void
639_ecore_evas_wl_lower(Ecore_Evas *ee)
640{
641 LOGFN(__FILE__, __LINE__, __FUNCTION__);
642
643 if ((!ee) || (!ee->visible)) return;
644 /* FIXME: Need a way to tell Wayland to lower */
645}
646
647static void
648_ecore_evas_wl_activate(Ecore_Evas *ee)
649{
650 LOGFN(__FILE__, __LINE__, __FUNCTION__);
651
652 if ((!ee) || (!ee->visible)) return;
653 if (!ee->engine.wl.shell_surface) return;
654 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
655}
656
657static void
658_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t)
659{
660 LOGFN(__FILE__, __LINE__, __FUNCTION__);
661
662 if (!ee) return;
663 if (ee->prop.title) free(ee->prop.title);
664 ee->prop.title = NULL;
665 if (t) ee->prop.title = strdup(t);
666
667 if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
668 {
669 EE_Wl_Smart_Data *sd;
670
671 if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
672 evas_object_text_text_set(sd->text, ee->prop.title);
673 }
674}
675
676static void
677_ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
678{
679 LOGFN(__FILE__, __LINE__, __FUNCTION__);
680
681 if (!ee) return;
682 if (ee->prop.name) free(ee->prop.name);
683 if (ee->prop.clas) free(ee->prop.clas);
684 ee->prop.name = NULL;
685 ee->prop.clas = NULL;
686 if (n) ee->prop.name = strdup(n);
687 if (c) ee->prop.clas = strdup(c);
688 /* FIXME: Forward these changes to Wayland somehow */
689}
690
691static void
692_ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h)
693{
694 LOGFN(__FILE__, __LINE__, __FUNCTION__);
695
696 if (!ee) return;
697 if (w < 0) w = 0;
698 if (h < 0) h = 0;
699 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
700 ee->prop.min.w = w;
701 ee->prop.min.h = h;
702}
703
704static void
705_ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h)
706{
707 LOGFN(__FILE__, __LINE__, __FUNCTION__);
708
709 if (!ee) return;
710 if (w < 0) w = 0;
711 if (h < 0) h = 0;
712 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
713 ee->prop.max.w = w;
714 ee->prop.max.h = h;
715}
716
717static void
718_ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h)
719{
720 LOGFN(__FILE__, __LINE__, __FUNCTION__);
721
722 if (!ee) return;
723 if (w < 0) w = 0;
724 if (h < 0) h = 0;
725 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
726 ee->prop.base.w = w;
727 ee->prop.base.h = h;
728}
729
730static void
731_ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h)
732{
733 LOGFN(__FILE__, __LINE__, __FUNCTION__);
734
735 if (!ee) return;
736 if (w < 0) w = 0;
737 if (h < 0) h = 0;
738 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
739 ee->prop.step.w = w;
740 ee->prop.step.h = h;
741}
742
743static void
744_ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
745{
746 int x = 0, y = 0;
747
748 LOGFN(__FILE__, __LINE__, __FUNCTION__);
749
750 if (!ee) return;
751 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
752 ee->prop.cursor.object = NULL;
753
754 if (!obj)
755 {
756 ee->prop.cursor.layer = 0;
757 ee->prop.cursor.hot.x = 0;
758 ee->prop.cursor.hot.y = 0;
759 return;
760 }
761
762 ee->prop.cursor.object = obj;
763 ee->prop.cursor.layer = layer;
764 ee->prop.cursor.hot.x = hot_x;
765 ee->prop.cursor.hot.y = hot_y;
766
767 evas_pointer_output_xy_get(ee->evas, &x, &y);
768 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
769 evas_object_move(ee->prop.cursor.object,
770 x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y);
771 evas_object_pass_events_set(ee->prop.cursor.object, 1);
772 if (evas_pointer_inside_get(ee->evas))
773 evas_object_show(ee->prop.cursor.object);
774
775 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
776 _ecore_evas_wl_object_cursor_del, ee);
777}
778
779static void
780_ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
781{
782 Ecore_Evas *ee;
783
784 if (!(ee = data)) return;
785 ee->prop.cursor.object = NULL;
786}
787
788static void
789_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
790{
791 LOGFN(__FILE__, __LINE__, __FUNCTION__);
792
793 if (!ee) return;
794 if (ee->prop.layer == layer) return;
795 if (layer < 1) layer = 1;
796 else if (layer > 255) layer = 255;
797 ee->prop.layer = layer;
798}
799
800static void
801_ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__)
802{
803 LOGFN(__FILE__, __LINE__, __FUNCTION__);
804
805 if ((!ee) || (!ee->visible)) return;
806 if (!ee->engine.wl.shell_surface) return;
807 wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
808}
809
810static void
811_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
812{
813 LOGFN(__FILE__, __LINE__, __FUNCTION__);
814
815 if (!ee) return;
816 if (ee->prop.iconified == iconify) return;
817 ee->prop.iconified = iconify;
818 /* FIXME: Implement this in Wayland someshow */
819}
820
821static void
822_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
823{
824 LOGFN(__FILE__, __LINE__, __FUNCTION__);
825
826 if (!ee) return;
827 if (ee->prop.maximized == max) return;
828 ee->prop.maximized = max;
829 /* FIXME: Implement this in Wayland someshow */
830}
831
832static void
833_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__)
834{
835 LOGFN(__FILE__, __LINE__, __FUNCTION__);
836
837 if ((!ee) || (!ee->visible)) return;
838 if (!ee->engine.wl.shell_surface) return;
839 wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface);
840}
841
842static int
843_ecore_evas_wl_render(Ecore_Evas *ee)
844{
845 int rend = 0;
846
847 if (!ee) return 0;
848 if (!ee->visible)
849 evas_norender(ee->evas);
850 else
851 {
852 Eina_List *ll = NULL, *updates = NULL;
853 Ecore_Evas *ee2 = NULL;
854
855 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
856
857 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
858 {
859 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
860 if (ee2->engine.func->fn_render)
861 rend |= ee2->engine.func->fn_render(ee2);
862 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
863 }
864
865 if ((updates = evas_render_updates(ee->evas)))
866 {
867 Eina_List *l = NULL;
868 Eina_Rectangle *r;
869
870 EINA_LIST_FOREACH(updates, l, r)
871 {
872 if (ee->engine.wl.buffer)
873 wl_buffer_damage(ee->engine.wl.buffer,
874 r->x, r->y, r->w, r->h);
875
876 if (ee->engine.wl.surface)
877 wl_surface_damage(ee->engine.wl.surface,
878 r->x, r->y, r->w, r->h);
879 }
880
881 evas_render_updates_free(updates);
882 _ecore_evas_idle_timeout_update(ee);
883 rend = 1;
884
885 ecore_wl_flush();
886 }
887
888 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
889 }
890
891 return rend;
892}
893
894static void
895_ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
896{
897 LOGFN(__FILE__, __LINE__, __FUNCTION__);
898
899 if (x) *x = 0;
900 if (y) *y = 0;
901 ecore_wl_screen_size_get(w, h);
902}
903
904static Eina_Bool
905_ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
906{
907 Ecore_Evas *ee;
908 Ecore_Event_Mouse_Button *ev;
909
910 LOGFN(__FILE__, __LINE__, __FUNCTION__);
911
912 ev = event;
913 _ecore_evas_wl_btn_timestamp = ev->timestamp;
914 ee = ecore_event_window_match(ev->window);
915 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
916 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
917 evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers,
918 ev->timestamp, NULL);
919 return ECORE_CALLBACK_PASS_ON;
920}
921
922static Eina_Bool
923_ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
924{
925 Ecore_Evas *ee;
926 Ecore_Event_Mouse_Button *ev;
927
928 LOGFN(__FILE__, __LINE__, __FUNCTION__);
929
930 ev = event;
931 ee = ecore_event_window_match(ev->window);
932 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
933 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
934 evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers,
935 ev->timestamp, NULL);
936 return ECORE_CALLBACK_PASS_ON;
937}
938
939static Eina_Bool
940_ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
941{
942 Ecore_Evas *ee;
943 Ecore_Event_Mouse_Move *ev;
944
945 ev = event;
946 ee = ecore_event_window_match(ev->window);
947 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
948 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
949 ee->mouse.x = ev->x;
950 ee->mouse.y = ev->y;
951 evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL);
952 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
953 return ECORE_CALLBACK_PASS_ON;
954}
955
956static Eina_Bool
957_ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
958{
959 Ecore_Evas *ee;
960 Ecore_Event_Mouse_Wheel *ev;
961
962 LOGFN(__FILE__, __LINE__, __FUNCTION__);
963
964 ev = event;
965 ee = ecore_event_window_match(ev->window);
966 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
967 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
968 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z,
969 ev->timestamp, NULL);
970 return ECORE_CALLBACK_PASS_ON;
971}
972
973static Eina_Bool
974_ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
975{
976 Ecore_Evas *ee;
977 Ecore_Wl_Event_Mouse_In *ev;
978
979 LOGFN(__FILE__, __LINE__, __FUNCTION__);
980
981 ev = event;
982 ee = ecore_event_window_match(ev->window);
983 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
984 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
985 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
986 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
987 evas_event_feed_mouse_in(ee->evas, ev->time, NULL);
988 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
989 return ECORE_CALLBACK_PASS_ON;
990}
991
992static Eina_Bool
993_ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
994{
995 Ecore_Evas *ee;
996 Ecore_Wl_Event_Mouse_Out *ev;
997
998 LOGFN(__FILE__, __LINE__, __FUNCTION__);
999
1000 ev = event;
1001 ee = ecore_event_window_match(ev->window);
1002 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1003 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1004 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
1005 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
1006 evas_event_feed_mouse_out(ee->evas, ev->time, NULL);
1007 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
1008 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1009 return ECORE_CALLBACK_PASS_ON;
1010}
1011
1012static Eina_Bool
1013_ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
1014{
1015 Ecore_Evas *ee;
1016 Ecore_Wl_Event_Focus_In *ev;
1017
1018 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1019
1020 ev = event;
1021 ee = ecore_event_window_match(ev->window);
1022 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1023 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1024 ee->prop.focused = 1;
1025 evas_focus_in(ee->evas);
1026 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1027 return ECORE_CALLBACK_PASS_ON;
1028}
1029
1030static Eina_Bool
1031_ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
1032{
1033 Ecore_Evas *ee;
1034 Ecore_Wl_Event_Focus_Out *ev;
1035
1036 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1037
1038 ev = event;
1039 ee = ecore_event_window_match(ev->window);
1040 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1041 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1042 evas_focus_out(ee->evas);
1043 ee->prop.focused = 0;
1044 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
1045 return ECORE_CALLBACK_PASS_ON;
1046}
1047
1048static void
1049_ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height)
1050{
1051 Ecore_Evas *ee;
1052
1053 /* NB: Trap to prevent compositor from crashing */
1054 if ((width <= 0) || (height <= 0)) return;
1055
1056 if (!(ee = data)) return;
1057
1058 if ((shell_surface) && (ee->engine.wl.shell_surface))
1059 {
1060 if (ee->engine.wl.shell_surface != shell_surface) return;
1061 ecore_evas_resize(ee, width, height);
1062 }
1063}
1064
1065static void
1066_ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__)
1067{
1068
1069}
1070
1071static void
1072_ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest)
1073{
1074 static unsigned int format;
1075 char tmp[PATH_MAX];
1076 int fd = -1, stride = 0, size = 0;
1077 void *ret;
1078
1079 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1080
1081 if (dest) *dest = NULL;
1082
1083 if (!format) format = ecore_wl_format_get();
1084
1085 strcpy(tmp, "/tmp/ecore-wayland_shm-XXXXXX");
1086 if ((fd = mkstemp(tmp)) < 0)
1087 {
1088 ERR("Could not create temporary file.");
1089 return;
1090 }
1091
1092 stride = (ee->w * sizeof(int));
1093 size = (stride * ee->h);
1094 if (ftruncate(fd, size) < 0)
1095 {
1096 ERR("Could not truncate temporary file.");
1097 close(fd);
1098 return;
1099 }
1100
1101 ret = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
1102 unlink(tmp);
1103
1104 if (ret == MAP_FAILED)
1105 {
1106 ERR("mmap of temporary file failed.");
1107 close(fd);
1108 return;
1109 }
1110
1111 if (dest) *dest = ret;
1112
1113 ee->engine.wl.buffer =
1114 wl_shm_create_buffer(ecore_wl_shm_get(), fd, ee->w, ee->h, stride, format);
1115
1116 close(fd);
1117}
1118
1119static void
1120_ecore_evas_wl_smart_init(void)
1121{
1122 if (_ecore_evas_wl_smart) return;
1123 {
1124 static const Evas_Smart_Class sc =
1125 {
1126 "ecore_evas_wl_frame", EVAS_SMART_CLASS_VERSION,
1127 _ecore_evas_wl_smart_add,
1128 _ecore_evas_wl_smart_del,
1129 NULL,
1130 _ecore_evas_wl_smart_resize,
1131 _ecore_evas_wl_smart_show,
1132 _ecore_evas_wl_smart_hide,
1133 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
1134 };
1135 _ecore_evas_wl_smart = evas_smart_class_new(&sc);
1136 }
1137}
1138
1139static void
1140_ecore_evas_wl_smart_add(Evas_Object *obj)
1141{
1142 EE_Wl_Smart_Data *sd;
1143 Evas *evas;
1144
1145 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1146
1147 if (!(sd = calloc(1, sizeof(EE_Wl_Smart_Data)))) return;
1148
1149 evas = evas_object_evas_get(obj);
1150
1151 sd->x = 0;
1152 sd->y = 0;
1153 sd->w = 1;
1154 sd->h = 1;
1155
1156 sd->frame = evas_object_rectangle_add(evas);
1157 evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
1158 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1159 evas_object_smart_member_add(sd->frame, obj);
1160
1161 sd->text = evas_object_text_add(evas);
1162 evas_object_color_set(sd->text, 0, 0, 0, 255);
1163 evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
1164 evas_object_text_font_set(sd->text, "Sans", 10);
1165 evas_object_text_text_set(sd->text, "Smart Test");
1166
1167 evas_object_smart_data_set(obj, sd);
1168}
1169
1170static void
1171_ecore_evas_wl_smart_del(Evas_Object *obj)
1172{
1173 EE_Wl_Smart_Data *sd;
1174
1175 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1176
1177 if (!(sd = evas_object_smart_data_get(obj))) return;
1178 evas_object_del(sd->text);
1179 evas_object_del(sd->frame);
1180 free(sd);
1181}
1182
1183static void
1184_ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1185{
1186 EE_Wl_Smart_Data *sd;
1187
1188 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1189
1190 if (!(sd = evas_object_smart_data_get(obj))) return;
1191 if ((sd->w == w) && (sd->h == h)) return;
1192 sd->w = w;
1193 sd->h = h;
1194 evas_object_resize(sd->frame, w, h);
1195}
1196
1197static void
1198_ecore_evas_wl_smart_show(Evas_Object *obj)
1199{
1200 EE_Wl_Smart_Data *sd;
1201
1202 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1203
1204 if (!(sd = evas_object_smart_data_get(obj))) return;
1205 evas_object_show(sd->frame);
1206 evas_object_show(sd->text);
1207}
1208
1209static void
1210_ecore_evas_wl_smart_hide(Evas_Object *obj)
1211{
1212 EE_Wl_Smart_Data *sd;
1213
1214 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1215
1216 if (!(sd = evas_object_smart_data_get(obj))) return;
1217 evas_object_hide(sd->text);
1218 evas_object_hide(sd->frame);
1219}
1220
1221static Evas_Object *
1222_ecore_evas_wl_frame_add(Evas *evas)
1223{
1224 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1225
1226 _ecore_evas_wl_smart_init();
1227 return evas_object_smart_add(evas, _ecore_evas_wl_smart);
1228}
1229
1230void
1231_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
1232{
1233 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1234
1235 if ((!ee) || (!ee->engine.wl.shell_surface)) return;
1236 wl_shell_surface_resize(ee->engine.wl.shell_surface,
1237 ecore_wl_input_device_get(),
1238 _ecore_evas_wl_btn_timestamp, location);
1239}
1240
1241void
1242_ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
1243{
1244 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1245
1246 if ((!ee) || (!ee->engine.wl.surface)) return;
1247 if ((!source) || (!drag_ee)) return;
1248 ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer);
1249}
1250
1251#else
1252EAPI Ecore_Evas *
1253ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)
1254{
1255 return NULL;
1256}
1257#endif
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c
index 2ca7cb0..cfec528 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c
@@ -147,9 +147,9 @@ _ecore_evas_win32_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, voi
147 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); 147 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
148 /* FIXME to do */ 148 /* FIXME to do */
149/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */ 149/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */
150 evas_event_feed_mouse_in(ee->evas, e->time, NULL); 150 evas_event_feed_mouse_in(ee->evas, e->timestamp, NULL);
151 evas_focus_in(ee->evas); 151 evas_focus_in(ee->evas);
152 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 152 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp);
153 153
154 return 1; 154 return 1;
155} 155}
@@ -169,9 +169,9 @@ _ecore_evas_win32_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, vo
169 169
170 /* FIXME to do */ 170 /* FIXME to do */
171/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */ 171/* _ecore_evas_x_modifier_locks_update(ee, e->modifiers); */
172 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 172 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp);
173 173
174 evas_event_feed_mouse_out(ee->evas, e->time, NULL); 174 evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL);
175 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 175 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
176 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 176 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
177 177
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c
index d9ccd6e..7d3af12 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c
@@ -1,4 +1,13 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
1#include <string.h> 6#include <string.h>
7
8#include <Eina.h>
9#include <Ecore.h>
10
2#include "ecore_evas_private.h" 11#include "ecore_evas_private.h"
3#include "Ecore_Evas.h" 12#include "Ecore_Evas.h"
4 13
@@ -731,10 +740,14 @@ _ecore_evas_x_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *e
731 // (e->mode == ECORE_X_EVENT_MODE_UNGRAB)) 740 // (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
732 // return 0; 741 // return 0;
733 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */ 742 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
734 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); 743 if (!ee->in)
735 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers); 744 {
736 evas_event_feed_mouse_in(ee->evas, e->time, NULL); 745 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
737 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 746 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
747 evas_event_feed_mouse_in(ee->evas, e->time, NULL);
748 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
749 ee->in = EINA_TRUE;
750 }
738 return ECORE_CALLBACK_PASS_ON; 751 return ECORE_CALLBACK_PASS_ON;
739} 752}
740 753
@@ -783,13 +796,23 @@ _ecore_evas_x_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *
783 // (e->mode == ECORE_X_EVENT_MODE_UNGRAB)) 796 // (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
784 // return 0; 797 // return 0;
785 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */ 798 /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
786 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers); 799// printf("OUT: ee->in=%i, e->mode=%i, e->detail=%i, dount_count=%i\n",
787 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 800// ee->in, e->mode, e->detail, evas_event_down_count_get(ee->evas));
788 if (e->mode == ECORE_X_EVENT_MODE_GRAB) 801 if (ee->in)
789 evas_event_feed_mouse_cancel(ee->evas, e->time, NULL); 802 {
790 evas_event_feed_mouse_out(ee->evas, e->time, NULL); 803 if ((evas_event_down_count_get(ee->evas) > 0) &&
791 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 804 (!((e->mode == ECORE_X_EVENT_MODE_GRAB) &&
792 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 805 (e->detail == ECORE_X_EVENT_DETAIL_NON_LINEAR))))
806 return ECORE_CALLBACK_PASS_ON;
807 ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
808 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
809 if (e->mode == ECORE_X_EVENT_MODE_GRAB)
810 evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
811 evas_event_feed_mouse_out(ee->evas, e->time, NULL);
812 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
813 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
814 ee->in = EINA_FALSE;
815 }
793 return ECORE_CALLBACK_PASS_ON; 816 return ECORE_CALLBACK_PASS_ON;
794} 817}
795 818
@@ -1023,6 +1046,14 @@ _ecore_evas_x_event_window_hide(void *data __UNUSED__, int type __UNUSED__, void
1023 ee = ecore_event_window_match(e->win); 1046 ee = ecore_event_window_match(e->win);
1024 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ 1047 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
1025 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 1048 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1049 if (ee->in)
1050 {
1051 evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
1052 evas_event_feed_mouse_out(ee->evas, e->time, NULL);
1053 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
1054 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1055 ee->in = EINA_FALSE;
1056 }
1026 if (!ee->visible) return ECORE_CALLBACK_PASS_ON; 1057 if (!ee->visible) return ECORE_CALLBACK_PASS_ON;
1027// if (!ee->visible) return ECORE_CALLBACK_DONE; 1058// if (!ee->visible) return ECORE_CALLBACK_DONE;
1028// printf("HIDE EVENT %p\n", ee); 1059// printf("HIDE EVENT %p\n", ee);
diff --git a/libraries/ecore/src/lib/ecore_fb/Makefile.in b/libraries/ecore/src/lib/ecore_fb/Makefile.in
index b37120f..c0c30a5 100644
--- a/libraries/ecore/src/lib/ecore_fb/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_fb/Makefile.in
@@ -249,10 +249,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
250PIXMAN_LIBS = @PIXMAN_LIBS@ 250PIXMAN_LIBS = @PIXMAN_LIBS@
251PKG_CONFIG = @PKG_CONFIG@ 251PKG_CONFIG = @PKG_CONFIG@
252PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
253PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
254POSUB = @POSUB@ 252POSUB = @POSUB@
255RANLIB = @RANLIB@ 253RANLIB = @RANLIB@
254SCIM_CFLAGS = @SCIM_CFLAGS@
255SCIM_LIBS = @SCIM_LIBS@
256SDL_CFLAGS = @SDL_CFLAGS@ 256SDL_CFLAGS = @SDL_CFLAGS@
257SDL_CONFIG = @SDL_CONFIG@ 257SDL_CONFIG = @SDL_CONFIG@
258SDL_LIBS = @SDL_LIBS@ 258SDL_LIBS = @SDL_LIBS@
@@ -271,6 +271,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
271USE_NLS = @USE_NLS@ 271USE_NLS = @USE_NLS@
272VERSION = @VERSION@ 272VERSION = @VERSION@
273VMAJ = @VMAJ@ 273VMAJ = @VMAJ@
274WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
275WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
276WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
277WAYLAND_LIBS = @WAYLAND_LIBS@
274WIN32_CFLAGS = @WIN32_CFLAGS@ 278WIN32_CFLAGS = @WIN32_CFLAGS@
275WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 279WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
276WIN32_LIBS = @WIN32_LIBS@ 280WIN32_LIBS = @WIN32_LIBS@
@@ -384,6 +388,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
384ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 388ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
385ecore_imf_evas_libs = @ecore_imf_evas_libs@ 389ecore_imf_evas_libs = @ecore_imf_evas_libs@
386ecore_imf_libs = @ecore_imf_libs@ 390ecore_imf_libs = @ecore_imf_libs@
391ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
392ecore_imf_scim_libs = @ecore_imf_scim_libs@
387ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 393ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
388ecore_imf_xim_libs = @ecore_imf_xim_libs@ 394ecore_imf_xim_libs = @ecore_imf_xim_libs@
389ecore_input_cflags = @ecore_input_cflags@ 395ecore_input_cflags = @ecore_input_cflags@
@@ -396,6 +402,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
396ecore_psl1ght_libs = @ecore_psl1ght_libs@ 402ecore_psl1ght_libs = @ecore_psl1ght_libs@
397ecore_sdl_cflags = @ecore_sdl_cflags@ 403ecore_sdl_cflags = @ecore_sdl_cflags@
398ecore_sdl_libs = @ecore_sdl_libs@ 404ecore_sdl_libs = @ecore_sdl_libs@
405ecore_wayland_cflags = @ecore_wayland_cflags@
406ecore_wayland_libs = @ecore_wayland_libs@
399ecore_win32_cflags = @ecore_win32_cflags@ 407ecore_win32_cflags = @ecore_win32_cflags@
400ecore_win32_libs = @ecore_win32_libs@ 408ecore_win32_libs = @ecore_win32_libs@
401ecore_wince_cflags = @ecore_wince_cflags@ 409ecore_wince_cflags = @ecore_wince_cflags@
@@ -440,12 +448,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
440requirements_ecore_file = @requirements_ecore_file@ 448requirements_ecore_file = @requirements_ecore_file@
441requirements_ecore_imf = @requirements_ecore_imf@ 449requirements_ecore_imf = @requirements_ecore_imf@
442requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 450requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
451requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
443requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 452requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
444requirements_ecore_input = @requirements_ecore_input@ 453requirements_ecore_input = @requirements_ecore_input@
445requirements_ecore_input_evas = @requirements_ecore_input_evas@ 454requirements_ecore_input_evas = @requirements_ecore_input_evas@
446requirements_ecore_ipc = @requirements_ecore_ipc@ 455requirements_ecore_ipc = @requirements_ecore_ipc@
447requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 456requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
448requirements_ecore_sdl = @requirements_ecore_sdl@ 457requirements_ecore_sdl = @requirements_ecore_sdl@
458requirements_ecore_wayland = @requirements_ecore_wayland@
449requirements_ecore_win32 = @requirements_ecore_win32@ 459requirements_ecore_win32 = @requirements_ecore_win32@
450requirements_ecore_wince = @requirements_ecore_wince@ 460requirements_ecore_wince = @requirements_ecore_wince@
451requirements_ecore_x = @requirements_ecore_x@ 461requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_fb/ecore_fb_li.c b/libraries/ecore/src/lib/ecore_fb/ecore_fb_li.c
index 4a196dd..3850792 100644
--- a/libraries/ecore/src/lib/ecore_fb/ecore_fb_li.c
+++ b/libraries/ecore/src/lib/ecore_fb/ecore_fb_li.c
@@ -2,6 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
6
5#include "Ecore_Fb.h" 7#include "Ecore_Fb.h"
6#include "ecore_fb_private.h" 8#include "ecore_fb_private.h"
7 9
@@ -452,9 +454,9 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
452#endif 454#endif
453 455
454/** 456/**
455 * @brief Associates an input device with the given @ref Ecore_Evas. 457 * @brief Associates an input device with the given @ref Ecore_Evas_Group.
456 * 458 *
457 * @param dev The input being associated with an @ref Ecore_Evas (not @c NULL). 459 * @param dev The input being associated with an @ref Ecore_Evas_Group (not @c NULL).
458 * @param window The window which this input is being associated to. 460 * @param window The window which this input is being associated to.
459 * @c NULL will remove any previous association. 461 * @c NULL will remove any previous association.
460 * 462 *
@@ -475,7 +477,7 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
475 * @endcode 477 * @endcode
476 * 478 *
477 * On the previous code, all input captured on the mentioned device will be 479 * On the previous code, all input captured on the mentioned device will be
478 * delivered to the @Ecore_Evas @c ee. 480 * delivered to the @c Ecore_Evas @c ee.
479 * 481 *
480 * @since 1.1 482 * @since 1.1
481 */ 483 */
diff --git a/libraries/ecore/src/lib/ecore_fb/ecore_fb_private.h b/libraries/ecore/src/lib/ecore_fb/ecore_fb_private.h
index 3e908a0..797f863 100644
--- a/libraries/ecore/src/lib/ecore_fb/ecore_fb_private.h
+++ b/libraries/ecore/src/lib/ecore_fb/ecore_fb_private.h
@@ -6,6 +6,7 @@
6#include "Ecore_Input.h" 6#include "Ecore_Input.h"
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <stdlib.h>
9#include <string.h> 10#include <string.h>
10#include <unistd.h> 11#include <unistd.h>
11#include <termios.h> 12#include <termios.h>
@@ -30,6 +31,8 @@
30#include <fcntl.h> 31#include <fcntl.h>
31#include <errno.h> 32#include <errno.h>
32 33
34#include <Ecore_Fb.h>
35
33/* ecore_fb_li.c */ 36/* ecore_fb_li.c */
34struct _Ecore_Fb_Input_Device 37struct _Ecore_Fb_Input_Device
35{ 38{
diff --git a/libraries/ecore/src/lib/ecore_file/Makefile.in b/libraries/ecore/src/lib/ecore_file/Makefile.in
index 34945b3..04e0bf1 100644
--- a/libraries/ecore/src/lib/ecore_file/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_file/Makefile.in
@@ -250,10 +250,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
250PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 250PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
251PIXMAN_LIBS = @PIXMAN_LIBS@ 251PIXMAN_LIBS = @PIXMAN_LIBS@
252PKG_CONFIG = @PKG_CONFIG@ 252PKG_CONFIG = @PKG_CONFIG@
253PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
254PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
255POSUB = @POSUB@ 253POSUB = @POSUB@
256RANLIB = @RANLIB@ 254RANLIB = @RANLIB@
255SCIM_CFLAGS = @SCIM_CFLAGS@
256SCIM_LIBS = @SCIM_LIBS@
257SDL_CFLAGS = @SDL_CFLAGS@ 257SDL_CFLAGS = @SDL_CFLAGS@
258SDL_CONFIG = @SDL_CONFIG@ 258SDL_CONFIG = @SDL_CONFIG@
259SDL_LIBS = @SDL_LIBS@ 259SDL_LIBS = @SDL_LIBS@
@@ -272,6 +272,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
272USE_NLS = @USE_NLS@ 272USE_NLS = @USE_NLS@
273VERSION = @VERSION@ 273VERSION = @VERSION@
274VMAJ = @VMAJ@ 274VMAJ = @VMAJ@
275WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
276WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
277WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
278WAYLAND_LIBS = @WAYLAND_LIBS@
275WIN32_CFLAGS = @WIN32_CFLAGS@ 279WIN32_CFLAGS = @WIN32_CFLAGS@
276WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 280WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
277WIN32_LIBS = @WIN32_LIBS@ 281WIN32_LIBS = @WIN32_LIBS@
@@ -385,6 +389,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
385ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 389ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
386ecore_imf_evas_libs = @ecore_imf_evas_libs@ 390ecore_imf_evas_libs = @ecore_imf_evas_libs@
387ecore_imf_libs = @ecore_imf_libs@ 391ecore_imf_libs = @ecore_imf_libs@
392ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
393ecore_imf_scim_libs = @ecore_imf_scim_libs@
388ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 394ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
389ecore_imf_xim_libs = @ecore_imf_xim_libs@ 395ecore_imf_xim_libs = @ecore_imf_xim_libs@
390ecore_input_cflags = @ecore_input_cflags@ 396ecore_input_cflags = @ecore_input_cflags@
@@ -397,6 +403,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
397ecore_psl1ght_libs = @ecore_psl1ght_libs@ 403ecore_psl1ght_libs = @ecore_psl1ght_libs@
398ecore_sdl_cflags = @ecore_sdl_cflags@ 404ecore_sdl_cflags = @ecore_sdl_cflags@
399ecore_sdl_libs = @ecore_sdl_libs@ 405ecore_sdl_libs = @ecore_sdl_libs@
406ecore_wayland_cflags = @ecore_wayland_cflags@
407ecore_wayland_libs = @ecore_wayland_libs@
400ecore_win32_cflags = @ecore_win32_cflags@ 408ecore_win32_cflags = @ecore_win32_cflags@
401ecore_win32_libs = @ecore_win32_libs@ 409ecore_win32_libs = @ecore_win32_libs@
402ecore_wince_cflags = @ecore_wince_cflags@ 410ecore_wince_cflags = @ecore_wince_cflags@
@@ -441,12 +449,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
441requirements_ecore_file = @requirements_ecore_file@ 449requirements_ecore_file = @requirements_ecore_file@
442requirements_ecore_imf = @requirements_ecore_imf@ 450requirements_ecore_imf = @requirements_ecore_imf@
443requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 451requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
452requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
444requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 453requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
445requirements_ecore_input = @requirements_ecore_input@ 454requirements_ecore_input = @requirements_ecore_input@
446requirements_ecore_input_evas = @requirements_ecore_input_evas@ 455requirements_ecore_input_evas = @requirements_ecore_input_evas@
447requirements_ecore_ipc = @requirements_ecore_ipc@ 456requirements_ecore_ipc = @requirements_ecore_ipc@
448requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 457requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
449requirements_ecore_sdl = @requirements_ecore_sdl@ 458requirements_ecore_sdl = @requirements_ecore_sdl@
459requirements_ecore_wayland = @requirements_ecore_wayland@
450requirements_ecore_win32 = @requirements_ecore_win32@ 460requirements_ecore_win32 = @requirements_ecore_win32@
451requirements_ecore_wince = @requirements_ecore_wince@ 461requirements_ecore_wince = @requirements_ecore_wince@
452requirements_ecore_x = @requirements_ecore_x@ 462requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_file/ecore_file.c b/libraries/ecore/src/lib/ecore_file/ecore_file.c
index 2546f2f..cfbf2b5 100644
--- a/libraries/ecore/src/lib/ecore_file/ecore_file.c
+++ b/libraries/ecore/src/lib/ecore_file/ecore_file.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <string.h> 7#include <string.h>
7 8
@@ -597,11 +598,7 @@ ecore_file_mv(const char *src, const char *dst)
597 dir, ecore_file_file_get(dst)); 598 dir, ecore_file_file_get(dst));
598 free(dir); 599 free(dir);
599 fd = mkstemp(buf); 600 fd = mkstemp(buf);
600 if (fd < 0) 601 if (fd < 0) goto FAIL;
601 {
602 perror("mkstemp");
603 goto FAIL;
604 }
605 close(fd); 602 close(fd);
606 603
607 // Copy to temp file 604 // Copy to temp file
@@ -761,7 +758,7 @@ ecore_file_can_write(const char *file)
761} 758}
762 759
763/** 760/**
764 * @bbrief Check if the given file can be executed. 761 * @brief Check if the given file can be executed.
765 * 762 *
766 * @param file The name of the file. 763 * @param file The name of the file.
767 * @return EINA_TRUE if the file can be executed, EINA_FALSE otherwise. 764 * @return EINA_TRUE if the file can be executed, EINA_FALSE otherwise.
@@ -859,7 +856,7 @@ ecore_file_app_exe_get(const char *app)
859 856
860 p = (char *)app; 857 p = (char *)app;
861restart: 858restart:
862 while ((*p) && (isspace(*p))) p++; 859 while ((*p) && (isspace((unsigned char)*p))) p++;
863 exe1 = p; 860 exe1 = p;
864 while (*p) 861 while (*p)
865 { 862 {
@@ -879,7 +876,7 @@ restart:
879 in_quot_sing = 1; 876 in_quot_sing = 1;
880 else if (*p == '\"') 877 else if (*p == '\"')
881 in_quot_dbl = 1; 878 in_quot_dbl = 1;
882 if ((isspace(*p)) && (!((p > app) && (p[-1] != '\\')))) 879 if ((isspace((unsigned char)*p)) && ((p <= app) || (p[-1] == '\\')))
883 break; 880 break;
884 } 881 }
885 p++; 882 p++;
@@ -974,7 +971,7 @@ restart:
974 in_quot_sing = 1; 971 in_quot_sing = 1;
975 else if (*p == '\"') 972 else if (*p == '\"')
976 in_quot_dbl = 1; 973 in_quot_dbl = 1;
977 else if (isspace(*p)) 974 else if (isspace((unsigned char)*p))
978 { 975 {
979 if (restart) 976 if (restart)
980 goto restart; 977 goto restart;
@@ -1040,7 +1037,7 @@ ecore_file_escape_name(const char *filename)
1040} 1037}
1041 1038
1042/** 1039/**
1043 * @bried Remove the extension from the given file name. 1040 * @brief Remove the extension from the given file name.
1044 * 1041 *
1045 * @param path The name of the file. 1042 * @param path The name of the file.
1046 * @return A newly allocated string with the extension stripped out or 1043 * @return A newly allocated string with the extension stripped out or
diff --git a/libraries/ecore/src/lib/ecore_file/ecore_file_download.c b/libraries/ecore/src/lib/ecore_file/ecore_file_download.c
index c7efc4d..c5e56bd 100644
--- a/libraries/ecore/src/lib/ecore_file/ecore_file_download.c
+++ b/libraries/ecore/src/lib/ecore_file/ecore_file_download.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <string.h> 7#include <string.h>
7 8
@@ -14,6 +15,7 @@
14#ifdef BUILD_ECORE_CON 15#ifdef BUILD_ECORE_CON
15 16
16#define ECORE_MAGIC_FILE_DOWNLOAD_JOB 0xf7427cb8 17#define ECORE_MAGIC_FILE_DOWNLOAD_JOB 0xf7427cb8
18#define ECORE_FILE_DOWNLOAD_TIMEOUT 30
17 19
18struct _Ecore_File_Download_Job 20struct _Ecore_File_Download_Job
19{ 21{
@@ -360,6 +362,7 @@ _ecore_file_download_curl(const char *url, const char *dst,
360 } 362 }
361 363
362 if (headers) eina_hash_foreach(headers, _ecore_file_download_headers_foreach_cb, job); 364 if (headers) eina_hash_foreach(headers, _ecore_file_download_headers_foreach_cb, job);
365 ecore_con_url_timeout_set(job->url_con, ECORE_FILE_DOWNLOAD_TIMEOUT);
363 ecore_con_url_fd_set(job->url_con, fileno(job->file)); 366 ecore_con_url_fd_set(job->url_con, fileno(job->file));
364 ecore_con_url_data_set(job->url_con, data); 367 ecore_con_url_data_set(job->url_con, data);
365 368
diff --git a/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c b/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c
index c3533ad..efdd8c2 100644
--- a/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c
+++ b/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <string.h> 7#include <string.h>
7#include <sys/types.h> 8#include <sys/types.h>
diff --git a/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c b/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c
index 1f71b55..49bfcb6 100644
--- a/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c
+++ b/libraries/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <string.h> 7#include <string.h>
7 8
diff --git a/libraries/ecore/src/lib/ecore_file/ecore_file_path.c b/libraries/ecore/src/lib/ecore_file/ecore_file_path.c
index ade3bc6..f5294b7 100644
--- a/libraries/ecore/src/lib/ecore_file/ecore_file_path.c
+++ b/libraries/ecore/src/lib/ecore_file/ecore_file_path.c
@@ -20,6 +20,7 @@ extern "C"
20void *alloca (size_t); 20void *alloca (size_t);
21#endif 21#endif
22 22
23#include <stdlib.h>
23#include <stdio.h> 24#include <stdio.h>
24#include <string.h> 25#include <string.h>
25 26
@@ -85,7 +86,7 @@ _ecore_file_path_from_env(const char *env)
85/** 86/**
86 * @brief Check if the given directory is in PATH. 87 * @brief Check if the given directory is in PATH.
87 * 88 *
88 * @param The name of the directory to search in PATH. 89 * @param in_dir The name of the directory to search in PATH.
89 * @return EINA_TRUE if the directory exist in PATH, EINA_FALSE otherwise. 90 * @return EINA_TRUE if the directory exist in PATH, EINA_FALSE otherwise.
90 * 91 *
91 * This function checks if @p in_dir is in the environment variable 92 * This function checks if @p in_dir is in the environment variable
diff --git a/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h b/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h
index 21df2a0..adea35d 100644
--- a/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h
+++ b/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h
@@ -64,6 +64,17 @@ EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
64EAPI extern int ECORE_IMF_EVENT_COMMIT; 64EAPI extern int ECORE_IMF_EVENT_COMMIT;
65EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING; 65EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
66 66
67typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
68
69typedef enum
70{
71 ECORE_IMF_CALLBACK_PREEDIT_START,
72 ECORE_IMF_CALLBACK_PREEDIT_END,
73 ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
74 ECORE_IMF_CALLBACK_COMMIT,
75 ECORE_IMF_CALLBACK_DELETE_SURROUNDING
76} Ecore_IMF_Callback_Type;
77
67typedef enum 78typedef enum
68{ 79{
69 ECORE_IMF_EVENT_MOUSE_DOWN, 80 ECORE_IMF_EVENT_MOUSE_DOWN,
@@ -138,7 +149,10 @@ typedef enum
138 ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ 149 ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
139 ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ 150 ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
140 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ 151 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
141 ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID 152 ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */
153 ECORE_IMF_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */
154 ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout @since 1.2 */
155 ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
142} Ecore_IMF_Input_Panel_Layout; 156} Ecore_IMF_Input_Panel_Layout;
143 157
144typedef enum 158typedef enum
@@ -385,6 +399,9 @@ EAPI void ecore_imf_context_preedit_end_event_add(Ecore
385EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); 399EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
386EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); 400EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
387EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars); 401EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
402EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data);
403EAPI void *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
404EAPI void ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
388EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction); 405EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
389EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx); 406EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
390EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); 407EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
diff --git a/libraries/ecore/src/lib/ecore_imf/Makefile.in b/libraries/ecore/src/lib/ecore_imf/Makefile.in
index adf8dea..9f91360 100644
--- a/libraries/ecore/src/lib/ecore_imf/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_imf/Makefile.in
@@ -248,10 +248,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
249PIXMAN_LIBS = @PIXMAN_LIBS@ 249PIXMAN_LIBS = @PIXMAN_LIBS@
250PKG_CONFIG = @PKG_CONFIG@ 250PKG_CONFIG = @PKG_CONFIG@
251PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253POSUB = @POSUB@ 251POSUB = @POSUB@
254RANLIB = @RANLIB@ 252RANLIB = @RANLIB@
253SCIM_CFLAGS = @SCIM_CFLAGS@
254SCIM_LIBS = @SCIM_LIBS@
255SDL_CFLAGS = @SDL_CFLAGS@ 255SDL_CFLAGS = @SDL_CFLAGS@
256SDL_CONFIG = @SDL_CONFIG@ 256SDL_CONFIG = @SDL_CONFIG@
257SDL_LIBS = @SDL_LIBS@ 257SDL_LIBS = @SDL_LIBS@
@@ -270,6 +270,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
270USE_NLS = @USE_NLS@ 270USE_NLS = @USE_NLS@
271VERSION = @VERSION@ 271VERSION = @VERSION@
272VMAJ = @VMAJ@ 272VMAJ = @VMAJ@
273WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
274WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
275WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
276WAYLAND_LIBS = @WAYLAND_LIBS@
273WIN32_CFLAGS = @WIN32_CFLAGS@ 277WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275WIN32_LIBS = @WIN32_LIBS@ 279WIN32_LIBS = @WIN32_LIBS@
@@ -383,6 +387,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
383ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
384ecore_imf_evas_libs = @ecore_imf_evas_libs@ 388ecore_imf_evas_libs = @ecore_imf_evas_libs@
385ecore_imf_libs = @ecore_imf_libs@ 389ecore_imf_libs = @ecore_imf_libs@
390ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
391ecore_imf_scim_libs = @ecore_imf_scim_libs@
386ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 392ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
387ecore_imf_xim_libs = @ecore_imf_xim_libs@ 393ecore_imf_xim_libs = @ecore_imf_xim_libs@
388ecore_input_cflags = @ecore_input_cflags@ 394ecore_input_cflags = @ecore_input_cflags@
@@ -395,6 +401,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
395ecore_psl1ght_libs = @ecore_psl1ght_libs@ 401ecore_psl1ght_libs = @ecore_psl1ght_libs@
396ecore_sdl_cflags = @ecore_sdl_cflags@ 402ecore_sdl_cflags = @ecore_sdl_cflags@
397ecore_sdl_libs = @ecore_sdl_libs@ 403ecore_sdl_libs = @ecore_sdl_libs@
404ecore_wayland_cflags = @ecore_wayland_cflags@
405ecore_wayland_libs = @ecore_wayland_libs@
398ecore_win32_cflags = @ecore_win32_cflags@ 406ecore_win32_cflags = @ecore_win32_cflags@
399ecore_win32_libs = @ecore_win32_libs@ 407ecore_win32_libs = @ecore_win32_libs@
400ecore_wince_cflags = @ecore_wince_cflags@ 408ecore_wince_cflags = @ecore_wince_cflags@
@@ -439,12 +447,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
439requirements_ecore_file = @requirements_ecore_file@ 447requirements_ecore_file = @requirements_ecore_file@
440requirements_ecore_imf = @requirements_ecore_imf@ 448requirements_ecore_imf = @requirements_ecore_imf@
441requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 449requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
450requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
442requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 451requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
443requirements_ecore_input = @requirements_ecore_input@ 452requirements_ecore_input = @requirements_ecore_input@
444requirements_ecore_input_evas = @requirements_ecore_input_evas@ 453requirements_ecore_input_evas = @requirements_ecore_input_evas@
445requirements_ecore_ipc = @requirements_ecore_ipc@ 454requirements_ecore_ipc = @requirements_ecore_ipc@
446requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 455requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
447requirements_ecore_sdl = @requirements_ecore_sdl@ 456requirements_ecore_sdl = @requirements_ecore_sdl@
457requirements_ecore_wayland = @requirements_ecore_wayland@
448requirements_ecore_win32 = @requirements_ecore_win32@ 458requirements_ecore_win32 = @requirements_ecore_win32@
449requirements_ecore_wince = @requirements_ecore_wince@ 459requirements_ecore_wince = @requirements_ecore_wince@
450requirements_ecore_x = @requirements_ecore_x@ 460requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c b/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c
index 417fad3..b65ee26 100644
--- a/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c
@@ -223,6 +223,8 @@ ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
223EAPI void 223EAPI void
224ecore_imf_context_del(Ecore_IMF_Context *ctx) 224ecore_imf_context_del(Ecore_IMF_Context *ctx)
225{ 225{
226 Ecore_IMF_Func_Node *fn;
227
226 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) 228 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
227 { 229 {
228 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, 230 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
@@ -230,6 +232,13 @@ ecore_imf_context_del(Ecore_IMF_Context *ctx)
230 return; 232 return;
231 } 233 }
232 if (ctx->klass->del) ctx->klass->del(ctx); 234 if (ctx->klass->del) ctx->klass->del(ctx);
235
236 if (ctx->callbacks)
237 {
238 EINA_LIST_FREE(ctx->callbacks, fn)
239 free(fn);
240 }
241
233 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE); 242 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
234 free(ctx); 243 free(ctx);
235} 244}
@@ -529,7 +538,7 @@ ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
529 538
530/** 539/**
531 * Set whether the IM context should use the preedit string 540 * Set whether the IM context should use the preedit string
532 * to display feedback. If @use_preedit is EINA_FALSE (default 541 * to display feedback. If @c use_preedit is EINA_FALSE (default
533 * is EINA_TRUE), then the IM context may use some other method to display 542 * is EINA_TRUE), then the IM context may use some other method to display
534 * feedback, such as displaying it in a child of the root window. 543 * feedback, such as displaying it in a child of the root window.
535 * 544 *
@@ -551,7 +560,7 @@ ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
551 560
552/** 561/**
553 * Set whether the IM context should allow to use the text prediction. 562 * Set whether the IM context should allow to use the text prediction.
554 * If @prediction is EINA_FALSE (default is EINA_TRUE), then the IM context will not display the text prediction window. 563 * If @c prediction is EINA_FALSE (default is EINA_TRUE), then the IM context will not display the text prediction window.
555 * 564 *
556 * @param ctx An #Ecore_IMF_Context. 565 * @param ctx An #Ecore_IMF_Context.
557 * @param prediction Whether the IM context should allow to use the text prediction. 566 * @param prediction Whether the IM context should allow to use the text prediction.
@@ -1016,6 +1025,134 @@ ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offse
1016} 1025}
1017 1026
1018/** 1027/**
1028 * Add (register) a callback function to a given context event.
1029 *
1030 * This function adds a function callback to the context @p ctx when the
1031 * event of type @p type occurs on it. The function pointer is @p
1032 * func.
1033 *
1034 * The event type @p type to trigger the function may be one of
1035 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1036 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and
1037 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING.
1038 *
1039 * @param ctx Ecore_IMF_Context to attach a callback to.
1040 * @param type The type of event that will trigger the callback
1041 * @param func The (callback) function to be called when the event is
1042 * triggered
1043 * @param data The data pointer to be passed to @p func
1044 * @ingroup Ecore_IMF_Context_Module_Group
1045 * @since 1.2.0
1046 */
1047EAPI void
1048ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)
1049{
1050 Ecore_IMF_Func_Node *fn = NULL;
1051
1052 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1053 {
1054 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1055 "ecore_imf_context_event_callback_add");
1056 return;
1057 }
1058
1059 if (!func) return;
1060
1061 fn = calloc(1, sizeof (Ecore_IMF_Func_Node));
1062 if (!fn) return;
1063
1064 fn->func = func;
1065 fn->data = data;
1066 fn->type = type;
1067
1068 ctx->callbacks = eina_list_append(ctx->callbacks, fn);
1069}
1070
1071/**
1072 * Delete (unregister) a callback function registered to a given
1073 * context event.
1074 *
1075 * This function removes a function callback from the context @p ctx when the
1076 * event of type @p type occurs on it. The function pointer is @p
1077 * func.
1078 *
1079 * @see ecore_imf_context_event_callback_add() for more details
1080 *
1081 * @param ctx Ecore_IMF_Context to remove a callback from.
1082 * @param type The type of event that was trigerring the callback
1083 * @param func The (callback) function that was to be called when the event was triggered
1084 * @return the data pointer
1085 * @ingroup Ecore_IMF_Context_Module_Group
1086 * @since 1.2.0
1087 */
1088EAPI void *
1089ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func)
1090{
1091 Eina_List *l = NULL;
1092 Eina_List *l_next = NULL;
1093 Ecore_IMF_Func_Node *fn = NULL;
1094
1095 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1096 {
1097 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1098 "ecore_imf_context_event_callback_del");
1099 return;
1100 }
1101
1102 if (!func) return NULL;
1103 if (!ctx->callbacks) return NULL;
1104
1105 EINA_LIST_FOREACH_SAFE(ctx->callbacks, l, l_next, fn)
1106 {
1107 if ((fn) && (fn->func == func) && (fn->type == type))
1108 {
1109 void *tmp = fn->data;
1110 free(fn);
1111 ctx->callbacks = eina_list_remove_list(ctx->callbacks, l);
1112 return tmp;
1113 }
1114 }
1115 return NULL;
1116}
1117
1118/**
1119 * Call a given callback on the context @p ctx.
1120 *
1121 * ecore_imf_context_preedit_start_event_add, ecore_imf_context_preedit_end_event_add,
1122 * ecore_imf_context_preedit_changed_event_add, ecore_imf_context_commit_event_add and
1123 * ecore_imf_context_delete_surrounding_event_add APIs are asynchronous
1124 * because those API adds each event to the event queue.
1125 *
1126 * This API provides the way to call each callback function immediately.
1127 *
1128 * @param ctx Ecore_IMF_Context.
1129 * @param type The type of event that will trigger the callback
1130 * @param event_info The pointer to event specific struct or information to
1131 * pass to the callback functions registered on this event
1132 * @ingroup Ecore_IMF_Context_Module_Group
1133 * @since 1.2.0
1134 */
1135EAPI void
1136ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info)
1137{
1138 Ecore_IMF_Func_Node *fn = NULL;
1139 Eina_List *l = NULL;
1140
1141 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1142 {
1143 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1144 "ecore_imf_context_event_callback_call");
1145 return;
1146 }
1147
1148 EINA_LIST_FOREACH(ctx->callbacks, l, fn)
1149 {
1150 if ((fn) && (fn->type == type) && (fn->func))
1151 fn->func(fn->data, ctx, event_info);
1152 }
1153}
1154
1155/**
1019 * Ask the Input Method Context to show the control panel of using Input Method. 1156 * Ask the Input Method Context to show the control panel of using Input Method.
1020 * 1157 *
1021 * @param ctx An #Ecore_IMF_Context. 1158 * @param ctx An #Ecore_IMF_Context.
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h b/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h
index 07a5b09..d9dae80 100644
--- a/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h
@@ -35,6 +35,7 @@ extern int _ecore_imf_log_dom;
35#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_imf_log_dom, __VA_ARGS__) 35#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_imf_log_dom, __VA_ARGS__)
36 36
37typedef struct _Ecore_IMF_Module Ecore_IMF_Module; 37typedef struct _Ecore_IMF_Module Ecore_IMF_Module;
38typedef struct _Ecore_IMF_Func_Node Ecore_IMF_Func_Node;
38 39
39struct _Ecore_IMF_Context 40struct _Ecore_IMF_Context
40{ 41{
@@ -47,6 +48,7 @@ struct _Ecore_IMF_Context
47 void *client_canvas; 48 void *client_canvas;
48 Eina_Bool (*retrieve_surrounding_func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos); 49 Eina_Bool (*retrieve_surrounding_func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
49 void *retrieve_surrounding_data; 50 void *retrieve_surrounding_data;
51 Eina_List *callbacks;
50 Ecore_IMF_Autocapital_Type autocapital_type; 52 Ecore_IMF_Autocapital_Type autocapital_type;
51 Ecore_IMF_Input_Panel_Layout input_panel_layout; 53 Ecore_IMF_Input_Panel_Layout input_panel_layout;
52 Ecore_IMF_Input_Panel_Lang input_panel_lang; 54 Ecore_IMF_Input_Panel_Lang input_panel_lang;
@@ -61,6 +63,13 @@ struct _Ecore_IMF_Module
61 Ecore_IMF_Context *(*exit)(void); 63 Ecore_IMF_Context *(*exit)(void);
62}; 64};
63 65
66struct _Ecore_IMF_Func_Node
67{
68 void (*func) ();
69 const void *data;
70 Ecore_IMF_Callback_Type type;
71};
72
64void ecore_imf_module_init(void); 73void ecore_imf_module_init(void);
65void ecore_imf_module_shutdown(void); 74void ecore_imf_module_shutdown(void);
66Eina_List *ecore_imf_module_available_get(void); 75Eina_List *ecore_imf_module_available_get(void);
diff --git a/libraries/ecore/src/lib/ecore_imf_evas/Makefile.in b/libraries/ecore/src/lib/ecore_imf_evas/Makefile.in
index 9b26915..ab6503b 100644
--- a/libraries/ecore/src/lib/ecore_imf_evas/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_imf_evas/Makefile.in
@@ -247,10 +247,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
248PIXMAN_LIBS = @PIXMAN_LIBS@ 248PIXMAN_LIBS = @PIXMAN_LIBS@
249PKG_CONFIG = @PKG_CONFIG@ 249PKG_CONFIG = @PKG_CONFIG@
250PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
251PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
252POSUB = @POSUB@ 250POSUB = @POSUB@
253RANLIB = @RANLIB@ 251RANLIB = @RANLIB@
252SCIM_CFLAGS = @SCIM_CFLAGS@
253SCIM_LIBS = @SCIM_LIBS@
254SDL_CFLAGS = @SDL_CFLAGS@ 254SDL_CFLAGS = @SDL_CFLAGS@
255SDL_CONFIG = @SDL_CONFIG@ 255SDL_CONFIG = @SDL_CONFIG@
256SDL_LIBS = @SDL_LIBS@ 256SDL_LIBS = @SDL_LIBS@
@@ -269,6 +269,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
269USE_NLS = @USE_NLS@ 269USE_NLS = @USE_NLS@
270VERSION = @VERSION@ 270VERSION = @VERSION@
271VMAJ = @VMAJ@ 271VMAJ = @VMAJ@
272WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
273WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
274WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
275WAYLAND_LIBS = @WAYLAND_LIBS@
272WIN32_CFLAGS = @WIN32_CFLAGS@ 276WIN32_CFLAGS = @WIN32_CFLAGS@
273WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 277WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
274WIN32_LIBS = @WIN32_LIBS@ 278WIN32_LIBS = @WIN32_LIBS@
@@ -382,6 +386,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
382ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 386ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
383ecore_imf_evas_libs = @ecore_imf_evas_libs@ 387ecore_imf_evas_libs = @ecore_imf_evas_libs@
384ecore_imf_libs = @ecore_imf_libs@ 388ecore_imf_libs = @ecore_imf_libs@
389ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
390ecore_imf_scim_libs = @ecore_imf_scim_libs@
385ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 391ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
386ecore_imf_xim_libs = @ecore_imf_xim_libs@ 392ecore_imf_xim_libs = @ecore_imf_xim_libs@
387ecore_input_cflags = @ecore_input_cflags@ 393ecore_input_cflags = @ecore_input_cflags@
@@ -394,6 +400,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
394ecore_psl1ght_libs = @ecore_psl1ght_libs@ 400ecore_psl1ght_libs = @ecore_psl1ght_libs@
395ecore_sdl_cflags = @ecore_sdl_cflags@ 401ecore_sdl_cflags = @ecore_sdl_cflags@
396ecore_sdl_libs = @ecore_sdl_libs@ 402ecore_sdl_libs = @ecore_sdl_libs@
403ecore_wayland_cflags = @ecore_wayland_cflags@
404ecore_wayland_libs = @ecore_wayland_libs@
397ecore_win32_cflags = @ecore_win32_cflags@ 405ecore_win32_cflags = @ecore_win32_cflags@
398ecore_win32_libs = @ecore_win32_libs@ 406ecore_win32_libs = @ecore_win32_libs@
399ecore_wince_cflags = @ecore_wince_cflags@ 407ecore_wince_cflags = @ecore_wince_cflags@
@@ -438,12 +446,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
438requirements_ecore_file = @requirements_ecore_file@ 446requirements_ecore_file = @requirements_ecore_file@
439requirements_ecore_imf = @requirements_ecore_imf@ 447requirements_ecore_imf = @requirements_ecore_imf@
440requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 448requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
449requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
441requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 450requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
442requirements_ecore_input = @requirements_ecore_input@ 451requirements_ecore_input = @requirements_ecore_input@
443requirements_ecore_input_evas = @requirements_ecore_input_evas@ 452requirements_ecore_input_evas = @requirements_ecore_input_evas@
444requirements_ecore_ipc = @requirements_ecore_ipc@ 453requirements_ecore_ipc = @requirements_ecore_ipc@
445requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 454requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
446requirements_ecore_sdl = @requirements_ecore_sdl@ 455requirements_ecore_sdl = @requirements_ecore_sdl@
456requirements_ecore_wayland = @requirements_ecore_wayland@
447requirements_ecore_win32 = @requirements_ecore_win32@ 457requirements_ecore_win32 = @requirements_ecore_win32@
448requirements_ecore_wince = @requirements_ecore_wince@ 458requirements_ecore_wince = @requirements_ecore_wince@
449requirements_ecore_x = @requirements_ecore_x@ 459requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_input/Makefile.in b/libraries/ecore/src/lib/ecore_input/Makefile.in
index dd4d663..f9fc99a 100644
--- a/libraries/ecore/src/lib/ecore_input/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_input/Makefile.in
@@ -247,10 +247,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 247PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
248PIXMAN_LIBS = @PIXMAN_LIBS@ 248PIXMAN_LIBS = @PIXMAN_LIBS@
249PKG_CONFIG = @PKG_CONFIG@ 249PKG_CONFIG = @PKG_CONFIG@
250PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
251PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
252POSUB = @POSUB@ 250POSUB = @POSUB@
253RANLIB = @RANLIB@ 251RANLIB = @RANLIB@
252SCIM_CFLAGS = @SCIM_CFLAGS@
253SCIM_LIBS = @SCIM_LIBS@
254SDL_CFLAGS = @SDL_CFLAGS@ 254SDL_CFLAGS = @SDL_CFLAGS@
255SDL_CONFIG = @SDL_CONFIG@ 255SDL_CONFIG = @SDL_CONFIG@
256SDL_LIBS = @SDL_LIBS@ 256SDL_LIBS = @SDL_LIBS@
@@ -269,6 +269,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
269USE_NLS = @USE_NLS@ 269USE_NLS = @USE_NLS@
270VERSION = @VERSION@ 270VERSION = @VERSION@
271VMAJ = @VMAJ@ 271VMAJ = @VMAJ@
272WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
273WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
274WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
275WAYLAND_LIBS = @WAYLAND_LIBS@
272WIN32_CFLAGS = @WIN32_CFLAGS@ 276WIN32_CFLAGS = @WIN32_CFLAGS@
273WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 277WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
274WIN32_LIBS = @WIN32_LIBS@ 278WIN32_LIBS = @WIN32_LIBS@
@@ -382,6 +386,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
382ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 386ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
383ecore_imf_evas_libs = @ecore_imf_evas_libs@ 387ecore_imf_evas_libs = @ecore_imf_evas_libs@
384ecore_imf_libs = @ecore_imf_libs@ 388ecore_imf_libs = @ecore_imf_libs@
389ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
390ecore_imf_scim_libs = @ecore_imf_scim_libs@
385ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 391ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
386ecore_imf_xim_libs = @ecore_imf_xim_libs@ 392ecore_imf_xim_libs = @ecore_imf_xim_libs@
387ecore_input_cflags = @ecore_input_cflags@ 393ecore_input_cflags = @ecore_input_cflags@
@@ -394,6 +400,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
394ecore_psl1ght_libs = @ecore_psl1ght_libs@ 400ecore_psl1ght_libs = @ecore_psl1ght_libs@
395ecore_sdl_cflags = @ecore_sdl_cflags@ 401ecore_sdl_cflags = @ecore_sdl_cflags@
396ecore_sdl_libs = @ecore_sdl_libs@ 402ecore_sdl_libs = @ecore_sdl_libs@
403ecore_wayland_cflags = @ecore_wayland_cflags@
404ecore_wayland_libs = @ecore_wayland_libs@
397ecore_win32_cflags = @ecore_win32_cflags@ 405ecore_win32_cflags = @ecore_win32_cflags@
398ecore_win32_libs = @ecore_win32_libs@ 406ecore_win32_libs = @ecore_win32_libs@
399ecore_wince_cflags = @ecore_wince_cflags@ 407ecore_wince_cflags = @ecore_wince_cflags@
@@ -438,12 +446,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
438requirements_ecore_file = @requirements_ecore_file@ 446requirements_ecore_file = @requirements_ecore_file@
439requirements_ecore_imf = @requirements_ecore_imf@ 447requirements_ecore_imf = @requirements_ecore_imf@
440requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 448requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
449requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
441requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 450requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
442requirements_ecore_input = @requirements_ecore_input@ 451requirements_ecore_input = @requirements_ecore_input@
443requirements_ecore_input_evas = @requirements_ecore_input_evas@ 452requirements_ecore_input_evas = @requirements_ecore_input_evas@
444requirements_ecore_ipc = @requirements_ecore_ipc@ 453requirements_ecore_ipc = @requirements_ecore_ipc@
445requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 454requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
446requirements_ecore_sdl = @requirements_ecore_sdl@ 455requirements_ecore_sdl = @requirements_ecore_sdl@
456requirements_ecore_wayland = @requirements_ecore_wayland@
447requirements_ecore_win32 = @requirements_ecore_win32@ 457requirements_ecore_win32 = @requirements_ecore_win32@
448requirements_ecore_wince = @requirements_ecore_wince@ 458requirements_ecore_wince = @requirements_ecore_wince@
449requirements_ecore_x = @requirements_ecore_x@ 459requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_input_evas/Makefile.in b/libraries/ecore/src/lib/ecore_input_evas/Makefile.in
index 9097992..d0ac95e 100644
--- a/libraries/ecore/src/lib/ecore_input_evas/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_input_evas/Makefile.in
@@ -248,10 +248,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
249PIXMAN_LIBS = @PIXMAN_LIBS@ 249PIXMAN_LIBS = @PIXMAN_LIBS@
250PKG_CONFIG = @PKG_CONFIG@ 250PKG_CONFIG = @PKG_CONFIG@
251PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253POSUB = @POSUB@ 251POSUB = @POSUB@
254RANLIB = @RANLIB@ 252RANLIB = @RANLIB@
253SCIM_CFLAGS = @SCIM_CFLAGS@
254SCIM_LIBS = @SCIM_LIBS@
255SDL_CFLAGS = @SDL_CFLAGS@ 255SDL_CFLAGS = @SDL_CFLAGS@
256SDL_CONFIG = @SDL_CONFIG@ 256SDL_CONFIG = @SDL_CONFIG@
257SDL_LIBS = @SDL_LIBS@ 257SDL_LIBS = @SDL_LIBS@
@@ -270,6 +270,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
270USE_NLS = @USE_NLS@ 270USE_NLS = @USE_NLS@
271VERSION = @VERSION@ 271VERSION = @VERSION@
272VMAJ = @VMAJ@ 272VMAJ = @VMAJ@
273WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
274WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
275WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
276WAYLAND_LIBS = @WAYLAND_LIBS@
273WIN32_CFLAGS = @WIN32_CFLAGS@ 277WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275WIN32_LIBS = @WIN32_LIBS@ 279WIN32_LIBS = @WIN32_LIBS@
@@ -383,6 +387,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
383ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
384ecore_imf_evas_libs = @ecore_imf_evas_libs@ 388ecore_imf_evas_libs = @ecore_imf_evas_libs@
385ecore_imf_libs = @ecore_imf_libs@ 389ecore_imf_libs = @ecore_imf_libs@
390ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
391ecore_imf_scim_libs = @ecore_imf_scim_libs@
386ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 392ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
387ecore_imf_xim_libs = @ecore_imf_xim_libs@ 393ecore_imf_xim_libs = @ecore_imf_xim_libs@
388ecore_input_cflags = @ecore_input_cflags@ 394ecore_input_cflags = @ecore_input_cflags@
@@ -395,6 +401,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
395ecore_psl1ght_libs = @ecore_psl1ght_libs@ 401ecore_psl1ght_libs = @ecore_psl1ght_libs@
396ecore_sdl_cflags = @ecore_sdl_cflags@ 402ecore_sdl_cflags = @ecore_sdl_cflags@
397ecore_sdl_libs = @ecore_sdl_libs@ 403ecore_sdl_libs = @ecore_sdl_libs@
404ecore_wayland_cflags = @ecore_wayland_cflags@
405ecore_wayland_libs = @ecore_wayland_libs@
398ecore_win32_cflags = @ecore_win32_cflags@ 406ecore_win32_cflags = @ecore_win32_cflags@
399ecore_win32_libs = @ecore_win32_libs@ 407ecore_win32_libs = @ecore_win32_libs@
400ecore_wince_cflags = @ecore_wince_cflags@ 408ecore_wince_cflags = @ecore_wince_cflags@
@@ -439,12 +447,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
439requirements_ecore_file = @requirements_ecore_file@ 447requirements_ecore_file = @requirements_ecore_file@
440requirements_ecore_imf = @requirements_ecore_imf@ 448requirements_ecore_imf = @requirements_ecore_imf@
441requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 449requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
450requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
442requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 451requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
443requirements_ecore_input = @requirements_ecore_input@ 452requirements_ecore_input = @requirements_ecore_input@
444requirements_ecore_input_evas = @requirements_ecore_input_evas@ 453requirements_ecore_input_evas = @requirements_ecore_input_evas@
445requirements_ecore_ipc = @requirements_ecore_ipc@ 454requirements_ecore_ipc = @requirements_ecore_ipc@
446requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 455requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
447requirements_ecore_sdl = @requirements_ecore_sdl@ 456requirements_ecore_sdl = @requirements_ecore_sdl@
457requirements_ecore_wayland = @requirements_ecore_wayland@
448requirements_ecore_win32 = @requirements_ecore_win32@ 458requirements_ecore_win32 = @requirements_ecore_win32@
449requirements_ecore_wince = @requirements_ecore_wince@ 459requirements_ecore_wince = @requirements_ecore_wince@
450requirements_ecore_x = @requirements_ecore_x@ 460requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_input_evas/ecore_input_evas.c b/libraries/ecore/src/lib/ecore_input_evas/ecore_input_evas.c
index 0cfe20a..53d206e 100644
--- a/libraries/ecore/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/libraries/ecore/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#include <string.h> 5#include <string.h>
6#include <stdlib.h>
6 7
7#include "Ecore.h" 8#include "Ecore.h"
8#include "Ecore_Input.h" 9#include "Ecore_Input.h"
diff --git a/libraries/ecore/src/lib/ecore_ipc/Makefile.in b/libraries/ecore/src/lib/ecore_ipc/Makefile.in
index 189e069..ac2cf6f 100644
--- a/libraries/ecore/src/lib/ecore_ipc/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_ipc/Makefile.in
@@ -248,10 +248,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
249PIXMAN_LIBS = @PIXMAN_LIBS@ 249PIXMAN_LIBS = @PIXMAN_LIBS@
250PKG_CONFIG = @PKG_CONFIG@ 250PKG_CONFIG = @PKG_CONFIG@
251PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253POSUB = @POSUB@ 251POSUB = @POSUB@
254RANLIB = @RANLIB@ 252RANLIB = @RANLIB@
253SCIM_CFLAGS = @SCIM_CFLAGS@
254SCIM_LIBS = @SCIM_LIBS@
255SDL_CFLAGS = @SDL_CFLAGS@ 255SDL_CFLAGS = @SDL_CFLAGS@
256SDL_CONFIG = @SDL_CONFIG@ 256SDL_CONFIG = @SDL_CONFIG@
257SDL_LIBS = @SDL_LIBS@ 257SDL_LIBS = @SDL_LIBS@
@@ -270,6 +270,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
270USE_NLS = @USE_NLS@ 270USE_NLS = @USE_NLS@
271VERSION = @VERSION@ 271VERSION = @VERSION@
272VMAJ = @VMAJ@ 272VMAJ = @VMAJ@
273WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
274WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
275WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
276WAYLAND_LIBS = @WAYLAND_LIBS@
273WIN32_CFLAGS = @WIN32_CFLAGS@ 277WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275WIN32_LIBS = @WIN32_LIBS@ 279WIN32_LIBS = @WIN32_LIBS@
@@ -383,6 +387,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
383ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
384ecore_imf_evas_libs = @ecore_imf_evas_libs@ 388ecore_imf_evas_libs = @ecore_imf_evas_libs@
385ecore_imf_libs = @ecore_imf_libs@ 389ecore_imf_libs = @ecore_imf_libs@
390ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
391ecore_imf_scim_libs = @ecore_imf_scim_libs@
386ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 392ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
387ecore_imf_xim_libs = @ecore_imf_xim_libs@ 393ecore_imf_xim_libs = @ecore_imf_xim_libs@
388ecore_input_cflags = @ecore_input_cflags@ 394ecore_input_cflags = @ecore_input_cflags@
@@ -395,6 +401,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
395ecore_psl1ght_libs = @ecore_psl1ght_libs@ 401ecore_psl1ght_libs = @ecore_psl1ght_libs@
396ecore_sdl_cflags = @ecore_sdl_cflags@ 402ecore_sdl_cflags = @ecore_sdl_cflags@
397ecore_sdl_libs = @ecore_sdl_libs@ 403ecore_sdl_libs = @ecore_sdl_libs@
404ecore_wayland_cflags = @ecore_wayland_cflags@
405ecore_wayland_libs = @ecore_wayland_libs@
398ecore_win32_cflags = @ecore_win32_cflags@ 406ecore_win32_cflags = @ecore_win32_cflags@
399ecore_win32_libs = @ecore_win32_libs@ 407ecore_win32_libs = @ecore_win32_libs@
400ecore_wince_cflags = @ecore_wince_cflags@ 408ecore_wince_cflags = @ecore_wince_cflags@
@@ -439,12 +447,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
439requirements_ecore_file = @requirements_ecore_file@ 447requirements_ecore_file = @requirements_ecore_file@
440requirements_ecore_imf = @requirements_ecore_imf@ 448requirements_ecore_imf = @requirements_ecore_imf@
441requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 449requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
450requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
442requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 451requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
443requirements_ecore_input = @requirements_ecore_input@ 452requirements_ecore_input = @requirements_ecore_input@
444requirements_ecore_input_evas = @requirements_ecore_input_evas@ 453requirements_ecore_input_evas = @requirements_ecore_input_evas@
445requirements_ecore_ipc = @requirements_ecore_ipc@ 454requirements_ecore_ipc = @requirements_ecore_ipc@
446requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 455requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
447requirements_ecore_sdl = @requirements_ecore_sdl@ 456requirements_ecore_sdl = @requirements_ecore_sdl@
457requirements_ecore_wayland = @requirements_ecore_wayland@
448requirements_ecore_win32 = @requirements_ecore_win32@ 458requirements_ecore_win32 = @requirements_ecore_win32@
449requirements_ecore_wince = @requirements_ecore_wince@ 459requirements_ecore_wince = @requirements_ecore_wince@
450requirements_ecore_x = @requirements_ecore_x@ 460requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c
index c17cadd..e27134d 100644
--- a/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -926,7 +926,7 @@ ecore_ipc_client_data_get(Ecore_Ipc_Client *cl)
926/** 926/**
927 * Sets the max data payload size for an Ipc message in bytes 927 * Sets the max data payload size for an Ipc message in bytes
928 * 928 *
929 * @param client The given client. 929 * @param cl The given client.
930 * @param size The maximum data payload size in bytes. 930 * @param size The maximum data payload size in bytes.
931 * @ingroup Ecore_Ipc_Client_Group 931 * @ingroup Ecore_Ipc_Client_Group
932 */ 932 */
@@ -946,7 +946,6 @@ ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size)
946 * Sets the max data payload size for an Ipc message in bytes 946 * Sets the max data payload size for an Ipc message in bytes
947 * 947 *
948 * @param cl The given client. 948 * @param cl The given client.
949 * @param size The maximum data payload size in bytes.
950 * @ingroup Ecore_Ipc_Client_Group 949 * @ingroup Ecore_Ipc_Client_Group
951 */ 950 */
952EAPI int 951EAPI int
diff --git a/libraries/ecore/src/lib/ecore_psl1ght/Ecore_Psl1ght.h b/libraries/ecore/src/lib/ecore_psl1ght/Ecore_Psl1ght.h
index 39331f7..c6300fd 100644
--- a/libraries/ecore/src/lib/ecore_psl1ght/Ecore_Psl1ght.h
+++ b/libraries/ecore/src/lib/ecore_psl1ght/Ecore_Psl1ght.h
@@ -28,6 +28,7 @@ EAPI extern int ECORE_PSL1GHT_EVENT_KEY_MODIFIERS;
28EAPI extern int ECORE_PSL1GHT_EVENT_GOT_FOCUS; 28EAPI extern int ECORE_PSL1GHT_EVENT_GOT_FOCUS;
29EAPI extern int ECORE_PSL1GHT_EVENT_LOST_FOCUS; 29EAPI extern int ECORE_PSL1GHT_EVENT_LOST_FOCUS;
30EAPI extern int ECORE_PSL1GHT_EVENT_EXPOSE; 30EAPI extern int ECORE_PSL1GHT_EVENT_EXPOSE;
31EAPI extern int ECORE_PSL1GHT_EVENT_QUIT;
31 32
32typedef struct _Ecore_Psl1ght_Event_Key_Modifiers Ecore_Psl1ght_Event_Key_Modifiers; 33typedef struct _Ecore_Psl1ght_Event_Key_Modifiers Ecore_Psl1ght_Event_Key_Modifiers;
33struct _Ecore_Psl1ght_Event_Key_Modifiers /** PSL1GHT Key Modifier event */ 34struct _Ecore_Psl1ght_Event_Key_Modifiers /** PSL1GHT Key Modifier event */
@@ -105,14 +106,10 @@ struct _Ecore_Psl1ght_Event_Mouse_Wheel /** PSL1GHT Mouse Wheel event */
105 unsigned int time; 106 unsigned int time;
106}; 107};
107 108
108EAPI int 109EAPI int ecore_psl1ght_init(const char *name);
109 ecore_psl1ght_init(const char *name); 110EAPI int ecore_psl1ght_shutdown(void);
110EAPI int 111EAPI void ecore_psl1ght_resolution_set(int width, int height);
111 ecore_psl1ght_shutdown(void); 112EAPI void ecore_psl1ght_poll_events(void);
112EAPI void
113 ecore_psl1ght_resolution_set(int width, int height);
114EAPI void
115 ecore_psl1ght_poll_events(void);
116 113
117EAPI void ecore_psl1ght_screen_resolution_get(int *w, int *h); 114EAPI void ecore_psl1ght_screen_resolution_get(int *w, int *h);
118EAPI void ecore_psl1ght_optimal_screen_resolution_get(int *w, int *h); 115EAPI void ecore_psl1ght_optimal_screen_resolution_get(int *w, int *h);
diff --git a/libraries/ecore/src/lib/ecore_psl1ght/Makefile.in b/libraries/ecore/src/lib/ecore_psl1ght/Makefile.in
index 9b75b74..487231b 100644
--- a/libraries/ecore/src/lib/ecore_psl1ght/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_psl1ght/Makefile.in
@@ -249,10 +249,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
250PIXMAN_LIBS = @PIXMAN_LIBS@ 250PIXMAN_LIBS = @PIXMAN_LIBS@
251PKG_CONFIG = @PKG_CONFIG@ 251PKG_CONFIG = @PKG_CONFIG@
252PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
253PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
254POSUB = @POSUB@ 252POSUB = @POSUB@
255RANLIB = @RANLIB@ 253RANLIB = @RANLIB@
254SCIM_CFLAGS = @SCIM_CFLAGS@
255SCIM_LIBS = @SCIM_LIBS@
256SDL_CFLAGS = @SDL_CFLAGS@ 256SDL_CFLAGS = @SDL_CFLAGS@
257SDL_CONFIG = @SDL_CONFIG@ 257SDL_CONFIG = @SDL_CONFIG@
258SDL_LIBS = @SDL_LIBS@ 258SDL_LIBS = @SDL_LIBS@
@@ -271,6 +271,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
271USE_NLS = @USE_NLS@ 271USE_NLS = @USE_NLS@
272VERSION = @VERSION@ 272VERSION = @VERSION@
273VMAJ = @VMAJ@ 273VMAJ = @VMAJ@
274WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
275WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
276WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
277WAYLAND_LIBS = @WAYLAND_LIBS@
274WIN32_CFLAGS = @WIN32_CFLAGS@ 278WIN32_CFLAGS = @WIN32_CFLAGS@
275WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 279WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
276WIN32_LIBS = @WIN32_LIBS@ 280WIN32_LIBS = @WIN32_LIBS@
@@ -384,6 +388,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
384ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 388ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
385ecore_imf_evas_libs = @ecore_imf_evas_libs@ 389ecore_imf_evas_libs = @ecore_imf_evas_libs@
386ecore_imf_libs = @ecore_imf_libs@ 390ecore_imf_libs = @ecore_imf_libs@
391ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
392ecore_imf_scim_libs = @ecore_imf_scim_libs@
387ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 393ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
388ecore_imf_xim_libs = @ecore_imf_xim_libs@ 394ecore_imf_xim_libs = @ecore_imf_xim_libs@
389ecore_input_cflags = @ecore_input_cflags@ 395ecore_input_cflags = @ecore_input_cflags@
@@ -396,6 +402,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
396ecore_psl1ght_libs = @ecore_psl1ght_libs@ 402ecore_psl1ght_libs = @ecore_psl1ght_libs@
397ecore_sdl_cflags = @ecore_sdl_cflags@ 403ecore_sdl_cflags = @ecore_sdl_cflags@
398ecore_sdl_libs = @ecore_sdl_libs@ 404ecore_sdl_libs = @ecore_sdl_libs@
405ecore_wayland_cflags = @ecore_wayland_cflags@
406ecore_wayland_libs = @ecore_wayland_libs@
399ecore_win32_cflags = @ecore_win32_cflags@ 407ecore_win32_cflags = @ecore_win32_cflags@
400ecore_win32_libs = @ecore_win32_libs@ 408ecore_win32_libs = @ecore_win32_libs@
401ecore_wince_cflags = @ecore_wince_cflags@ 409ecore_wince_cflags = @ecore_wince_cflags@
@@ -440,12 +448,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
440requirements_ecore_file = @requirements_ecore_file@ 448requirements_ecore_file = @requirements_ecore_file@
441requirements_ecore_imf = @requirements_ecore_imf@ 449requirements_ecore_imf = @requirements_ecore_imf@
442requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 450requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
451requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
443requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 452requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
444requirements_ecore_input = @requirements_ecore_input@ 453requirements_ecore_input = @requirements_ecore_input@
445requirements_ecore_input_evas = @requirements_ecore_input_evas@ 454requirements_ecore_input_evas = @requirements_ecore_input_evas@
446requirements_ecore_ipc = @requirements_ecore_ipc@ 455requirements_ecore_ipc = @requirements_ecore_ipc@
447requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 456requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
448requirements_ecore_sdl = @requirements_ecore_sdl@ 457requirements_ecore_sdl = @requirements_ecore_sdl@
458requirements_ecore_wayland = @requirements_ecore_wayland@
449requirements_ecore_win32 = @requirements_ecore_win32@ 459requirements_ecore_win32 = @requirements_ecore_win32@
450requirements_ecore_wince = @requirements_ecore_wince@ 460requirements_ecore_wince = @requirements_ecore_wince@
451requirements_ecore_x = @requirements_ecore_x@ 461requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_psl1ght/ecore_psl1ght.c b/libraries/ecore/src/lib/ecore_psl1ght/ecore_psl1ght.c
index 64cef9f..16487ad 100644
--- a/libraries/ecore/src/lib/ecore_psl1ght/ecore_psl1ght.c
+++ b/libraries/ecore/src/lib/ecore_psl1ght/ecore_psl1ght.c
@@ -31,6 +31,7 @@ EAPI int ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = 0;
31EAPI int ECORE_PSL1GHT_EVENT_GOT_FOCUS = 0; 31EAPI int ECORE_PSL1GHT_EVENT_GOT_FOCUS = 0;
32EAPI int ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0; 32EAPI int ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0;
33EAPI int ECORE_PSL1GHT_EVENT_EXPOSE = 0; 33EAPI int ECORE_PSL1GHT_EVENT_EXPOSE = 0;
34EAPI int ECORE_PSL1GHT_EVENT_QUIT = 0;
34 35
35static int _ecore_psl1ght_init_count = 0; 36static int _ecore_psl1ght_init_count = 0;
36static int window_width = 0; 37static int window_width = 0;
@@ -47,6 +48,7 @@ static KbMkey keyboard_mods = {{0}};
47static u16 keyboard_old_key = 0; 48static u16 keyboard_old_key = 0;
48/* Pad support */ 49/* Pad support */
49static padData pad_data; 50static padData pad_data;
51static padData old_pad_data = {0};
50static int pad_old_x = 0; 52static int pad_old_x = 0;
51static int pad_old_o = 0; 53static int pad_old_o = 0;
52/* Move support */ 54/* Move support */
@@ -148,6 +150,7 @@ ecore_psl1ght_init(const char *name __UNUSED__)
148 ECORE_PSL1GHT_EVENT_LOST_FOCUS = ecore_event_type_new(); 150 ECORE_PSL1GHT_EVENT_LOST_FOCUS = ecore_event_type_new();
149 ECORE_PSL1GHT_EVENT_EXPOSE = ecore_event_type_new(); 151 ECORE_PSL1GHT_EVENT_EXPOSE = ecore_event_type_new();
150 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = ecore_event_type_new(); 152 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = ecore_event_type_new();
153 ECORE_PSL1GHT_EVENT_QUIT = ecore_event_type_new();
151 154
152 mouse_x = 0; 155 mouse_x = 0;
153 mouse_y = 0; 156 mouse_y = 0;
@@ -175,6 +178,7 @@ ecore_psl1ght_shutdown(void)
175 ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0; 178 ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0;
176 ECORE_PSL1GHT_EVENT_EXPOSE = 0; 179 ECORE_PSL1GHT_EVENT_EXPOSE = 0;
177 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = 0; 180 ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = 0;
181 ECORE_PSL1GHT_EVENT_QUIT = 0;
178 182
179 ioPadEnd(); 183 ioPadEnd();
180 ioMouseEnd(); 184 ioMouseEnd();
@@ -354,7 +358,6 @@ _ecore_psl1ght_event_key(u16 key)
354 ev->event_window = 0; 358 ev->event_window = 0;
355 ev->modifiers = _ecore_psl1ght_get_modifiers(); 359 ev->modifiers = _ecore_psl1ght_get_modifiers();
356 360
357 printf ("Key is %X\n", key);
358 key &= ~KB_KEYPAD; 361 key &= ~KB_KEYPAD;
359 for (i = 0; i < sizeof(keystable) / sizeof(struct _ecore_psl1ght_keys_s); ++i) 362 for (i = 0; i < sizeof(keystable) / sizeof(struct _ecore_psl1ght_keys_s); ++i)
360 if (keystable[i].code == key) 363 if (keystable[i].code == key)
@@ -364,13 +367,11 @@ _ecore_psl1ght_event_key(u16 key)
364 ev->string = keystable[i].compose; 367 ev->string = keystable[i].compose;
365 ev->compose = keystable[i].compose; 368 ev->compose = keystable[i].compose;
366 369
367 printf ("Found key '%s' in the table\n", ev->keyname);
368 return ev; 370 return ev;
369 } 371 }
370 372
371 utf16 = ioKbCnvRawCode (KB_MAPPING_101, keyboard_mods, keyboard_leds, key); 373 utf16 = ioKbCnvRawCode (KB_MAPPING_101, keyboard_mods, keyboard_leds, key);
372 unicodeToUtf8(utf16, utf8); 374 unicodeToUtf8(utf16, utf8);
373 printf ("Converting to utf16 : %X - utf8 : %s\n", utf16, utf8);
374 ev->keyname = ev->key = ev->string = ev->compose = strdup (utf8); 375 ev->keyname = ev->key = ev->string = ev->compose = strdup (utf8);
375 376
376 return ev; 377 return ev;
@@ -460,6 +461,30 @@ _ecore_psl1ght_mouse_wheel(s8 wheel, s8 tilt)
460 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL); 461 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
461} 462}
462 463
464static void
465_ecore_psl1ght_pad_button (const char *name, int pressed)
466{
467 Ecore_Event_Key *ev = NULL;
468
469 ev = malloc(sizeof(Ecore_Event_Key));
470 if (!ev) return;
471
472 ev->timestamp = _ecore_psl1ght_get_time ();
473 ev->window = 0;
474 ev->event_window = 0;
475 ev->modifiers = 0;
476
477 ev->keyname = name;
478 ev->key = name;
479 ev->string = "";
480 ev->compose = "";
481
482 if (pressed)
483 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
484 else
485 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
486}
487
463#define PAD_STICK_DEADZONE 0x20 488#define PAD_STICK_DEADZONE 0x20
464 489
465static void 490static void
@@ -502,15 +527,44 @@ _ecore_psl1ght_poll_joypad(void)
502 if (analog_h != 0 || analog_v != 0) 527 if (analog_h != 0 || analog_v != 0)
503 _ecore_psl1ght_mouse_move (analog_h, analog_v); 528 _ecore_psl1ght_mouse_move (analog_h, analog_v);
504 529
505 if (pad_old_x != pad_data.BTN_CROSS) 530 if (old_pad_data.BTN_CROSS ^ pad_data.BTN_CROSS) {
531 _ecore_psl1ght_pad_button ("Cross", pad_data.BTN_CROSS);
506 _ecore_psl1ght_mouse_button (1, pad_data.BTN_CROSS); 532 _ecore_psl1ght_mouse_button (1, pad_data.BTN_CROSS);
507 if (pad_old_o != pad_data.BTN_CIRCLE) 533 }
534 if (old_pad_data.BTN_CIRCLE ^ pad_data.BTN_CIRCLE) {
535 _ecore_psl1ght_pad_button ("Circle", pad_data.BTN_CIRCLE);
508 _ecore_psl1ght_mouse_button (3, pad_data.BTN_CIRCLE); 536 _ecore_psl1ght_mouse_button (3, pad_data.BTN_CIRCLE);
509 537 }
510 pad_old_x = pad_data.BTN_CROSS; 538 if (old_pad_data.BTN_SQUARE ^ pad_data.BTN_SQUARE)
511 pad_old_o = pad_data.BTN_CIRCLE; 539 _ecore_psl1ght_pad_button ("Square", pad_data.BTN_SQUARE);
512 540 if (old_pad_data.BTN_TRIANGLE ^ pad_data.BTN_TRIANGLE)
513 //pad_buttons = paddata.buttons; 541 _ecore_psl1ght_pad_button ("Triangle", pad_data.BTN_TRIANGLE);
542 if (old_pad_data.BTN_UP ^ pad_data.BTN_UP)
543 _ecore_psl1ght_pad_button ("Up", pad_data.BTN_UP);
544 if (old_pad_data.BTN_DOWN ^ pad_data.BTN_DOWN)
545 _ecore_psl1ght_pad_button ("Down", pad_data.BTN_DOWN);
546 if (old_pad_data.BTN_LEFT ^ pad_data.BTN_LEFT)
547 _ecore_psl1ght_pad_button ("Left", pad_data.BTN_LEFT);
548 if (old_pad_data.BTN_RIGHT ^ pad_data.BTN_RIGHT)
549 _ecore_psl1ght_pad_button ("Right", pad_data.BTN_RIGHT);
550 if (old_pad_data.BTN_L1 ^ pad_data.BTN_L1)
551 _ecore_psl1ght_pad_button ("L1", pad_data.BTN_L1);
552 if (old_pad_data.BTN_L2 ^ pad_data.BTN_L2)
553 _ecore_psl1ght_pad_button ("L2", pad_data.BTN_L2);
554 if (old_pad_data.BTN_L3 ^ pad_data.BTN_L3)
555 _ecore_psl1ght_pad_button ("L3", pad_data.BTN_L3);
556 if (old_pad_data.BTN_R1 ^ pad_data.BTN_R1)
557 _ecore_psl1ght_pad_button ("R1", pad_data.BTN_R1);
558 if (old_pad_data.BTN_R2 ^ pad_data.BTN_R2)
559 _ecore_psl1ght_pad_button ("R2", pad_data.BTN_R2);
560 if (old_pad_data.BTN_R3 ^ pad_data.BTN_R3)
561 _ecore_psl1ght_pad_button ("R3", pad_data.BTN_R3);
562 if (old_pad_data.BTN_START ^ pad_data.BTN_START)
563 _ecore_psl1ght_pad_button ("Start", pad_data.BTN_START);
564 if (old_pad_data.BTN_SELECT ^ pad_data.BTN_SELECT)
565 _ecore_psl1ght_pad_button ("Select", pad_data.BTN_SELECT);
566
567 old_pad_data = pad_data;
514 } 568 }
515 } 569 }
516} 570}
@@ -602,7 +656,7 @@ _ecore_psl1ght_poll_move(void)
602 656
603 case 4: 657 case 4:
604 // Move button 658 // Move button
605 printf ("Calibrating\n"); 659 //printf ("Calibrating\n");
606 gemCalibrate (0); 660 gemCalibrate (0);
607 calibrated = 1; 661 calibrated = 1;
608 break; 662 break;
@@ -717,23 +771,24 @@ _ecore_psl1ght_poll_keyboard(void)
717static void 771static void
718xmb_event_handler(u64 status, u64 param, void *user_data) 772xmb_event_handler(u64 status, u64 param, void *user_data)
719{ 773{
720 printf ("Received event %lX\n", status); 774 //printf ("Received event %lX\n", status);
721 if (status == SYSUTIL_EXIT_GAME) 775 switch (status) {
722 { 776 case SYSUTIL_EXIT_GAME:
723 ecore_main_loop_quit(); 777 ecore_event_add(ECORE_PSL1GHT_EVENT_QUIT, NULL, NULL, NULL);
724 } 778 break;
725 else if (status == SYSUTIL_MENU_OPEN) 779 case SYSUTIL_DRAW_BEGIN:
726 { 780 ecore_event_add(ECORE_PSL1GHT_EVENT_EXPOSE, NULL, NULL, NULL);
727 } 781 case SYSUTIL_MENU_OPEN:
728 else if (status == SYSUTIL_MENU_CLOSE) 782 ecore_event_add(ECORE_PSL1GHT_EVENT_LOST_FOCUS, NULL, NULL, NULL);
729 { 783 break;
730 } 784 case SYSUTIL_DRAW_END:
731 else if (status == SYSUTIL_DRAW_BEGIN) 785 ecore_event_add(ECORE_PSL1GHT_EVENT_EXPOSE, NULL, NULL, NULL);
732 { 786 case SYSUTIL_MENU_CLOSE:
733 } 787 ecore_event_add(ECORE_PSL1GHT_EVENT_GOT_FOCUS, NULL, NULL, NULL);
734 else if (status == SYSUTIL_DRAW_END) 788 break;
735 { 789 default:
736 } 790 break;
791 }
737} 792}
738 793
739EAPI void 794EAPI void
diff --git a/libraries/ecore/src/lib/ecore_sdl/Makefile.in b/libraries/ecore/src/lib/ecore_sdl/Makefile.in
index 0141ebe..c0312b0 100644
--- a/libraries/ecore/src/lib/ecore_sdl/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_sdl/Makefile.in
@@ -248,10 +248,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
249PIXMAN_LIBS = @PIXMAN_LIBS@ 249PIXMAN_LIBS = @PIXMAN_LIBS@
250PKG_CONFIG = @PKG_CONFIG@ 250PKG_CONFIG = @PKG_CONFIG@
251PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253POSUB = @POSUB@ 251POSUB = @POSUB@
254RANLIB = @RANLIB@ 252RANLIB = @RANLIB@
253SCIM_CFLAGS = @SCIM_CFLAGS@
254SCIM_LIBS = @SCIM_LIBS@
255SDL_CFLAGS = @SDL_CFLAGS@ 255SDL_CFLAGS = @SDL_CFLAGS@
256SDL_CONFIG = @SDL_CONFIG@ 256SDL_CONFIG = @SDL_CONFIG@
257SDL_LIBS = @SDL_LIBS@ 257SDL_LIBS = @SDL_LIBS@
@@ -270,6 +270,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
270USE_NLS = @USE_NLS@ 270USE_NLS = @USE_NLS@
271VERSION = @VERSION@ 271VERSION = @VERSION@
272VMAJ = @VMAJ@ 272VMAJ = @VMAJ@
273WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
274WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
275WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
276WAYLAND_LIBS = @WAYLAND_LIBS@
273WIN32_CFLAGS = @WIN32_CFLAGS@ 277WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275WIN32_LIBS = @WIN32_LIBS@ 279WIN32_LIBS = @WIN32_LIBS@
@@ -383,6 +387,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
383ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
384ecore_imf_evas_libs = @ecore_imf_evas_libs@ 388ecore_imf_evas_libs = @ecore_imf_evas_libs@
385ecore_imf_libs = @ecore_imf_libs@ 389ecore_imf_libs = @ecore_imf_libs@
390ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
391ecore_imf_scim_libs = @ecore_imf_scim_libs@
386ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 392ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
387ecore_imf_xim_libs = @ecore_imf_xim_libs@ 393ecore_imf_xim_libs = @ecore_imf_xim_libs@
388ecore_input_cflags = @ecore_input_cflags@ 394ecore_input_cflags = @ecore_input_cflags@
@@ -395,6 +401,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
395ecore_psl1ght_libs = @ecore_psl1ght_libs@ 401ecore_psl1ght_libs = @ecore_psl1ght_libs@
396ecore_sdl_cflags = @ecore_sdl_cflags@ 402ecore_sdl_cflags = @ecore_sdl_cflags@
397ecore_sdl_libs = @ecore_sdl_libs@ 403ecore_sdl_libs = @ecore_sdl_libs@
404ecore_wayland_cflags = @ecore_wayland_cflags@
405ecore_wayland_libs = @ecore_wayland_libs@
398ecore_win32_cflags = @ecore_win32_cflags@ 406ecore_win32_cflags = @ecore_win32_cflags@
399ecore_win32_libs = @ecore_win32_libs@ 407ecore_win32_libs = @ecore_win32_libs@
400ecore_wince_cflags = @ecore_wince_cflags@ 408ecore_wince_cflags = @ecore_wince_cflags@
@@ -439,12 +447,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
439requirements_ecore_file = @requirements_ecore_file@ 447requirements_ecore_file = @requirements_ecore_file@
440requirements_ecore_imf = @requirements_ecore_imf@ 448requirements_ecore_imf = @requirements_ecore_imf@
441requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 449requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
450requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
442requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 451requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
443requirements_ecore_input = @requirements_ecore_input@ 452requirements_ecore_input = @requirements_ecore_input@
444requirements_ecore_input_evas = @requirements_ecore_input_evas@ 453requirements_ecore_input_evas = @requirements_ecore_input_evas@
445requirements_ecore_ipc = @requirements_ecore_ipc@ 454requirements_ecore_ipc = @requirements_ecore_ipc@
446requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 455requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
447requirements_ecore_sdl = @requirements_ecore_sdl@ 456requirements_ecore_sdl = @requirements_ecore_sdl@
457requirements_ecore_wayland = @requirements_ecore_wayland@
448requirements_ecore_win32 = @requirements_ecore_win32@ 458requirements_ecore_win32 = @requirements_ecore_win32@
449requirements_ecore_wince = @requirements_ecore_wince@ 459requirements_ecore_wince = @requirements_ecore_wince@
450requirements_ecore_x = @requirements_ecore_x@ 460requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h b/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
new file mode 100644
index 0000000..fdf6314
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -0,0 +1,123 @@
1#ifndef _ECORE_WAYLAND_H_
2# define _ECORE_WAYLAND_H_
3
4# include <Eina.h>
5# include <wayland-client.h>
6
7# ifdef EAPI
8# undef EAPI
9# endif
10
11# ifdef __GNUC__
12# if __GNUC__ >= 4
13# define EAPI __attribute__ ((visibility("default")))
14# else
15# define EAPI
16# endif
17# else
18# define EAPI
19# endif
20
21typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In;
22typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out;
23typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In;
24typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out;
25
26typedef struct _Ecore_Wl_Drag_Source Ecore_Wl_Drag_Source;
27
28typedef struct _Ecore_Wl_Event_Drag_Start Ecore_Wl_Event_Drag_Start;
29typedef struct _Ecore_Wl_Event_Drag_Stop Ecore_Wl_Event_Drag_Stop;
30
31struct _Ecore_Wl_Event_Mouse_In
32{
33 int modifiers;
34 int x, y;
35
36 struct
37 {
38 int x, y;
39 } root;
40
41 unsigned int window;
42
43 unsigned int time;
44};
45
46struct _Ecore_Wl_Event_Mouse_Out
47{
48 int modifiers;
49 int x, y;
50
51 struct
52 {
53 int x, y;
54 } root;
55
56 unsigned int window;
57
58 unsigned int time;
59};
60
61struct _Ecore_Wl_Event_Focus_In
62{
63 unsigned int window;
64 /* TODO: mode & detail */
65 unsigned int time;
66};
67
68struct _Ecore_Wl_Event_Focus_Out
69{
70 unsigned int window;
71 /* TODO: mode & detail */
72 unsigned int time;
73};
74
75struct _Ecore_Wl_Event_Drag_Start
76{
77 struct wl_data_device *device;
78 struct wl_surface *surface;
79 const char *mime_type;
80 uint32_t timestamp;
81};
82
83struct _Ecore_Wl_Event_Drag_Stop
84{
85
86};
87
88/**
89 * @file
90 * @brief Ecore functions for dealing with the Wayland window system
91 *
92 * Ecore_Wl provides a wrapper and convenience functions for using the
93 * Wayland window system. Function groups for this part of the library
94 * include the following:
95 * @li @ref Ecore_Wl_Init_Group
96 */
97
98EAPI int ecore_wl_init(const char *name);
99EAPI int ecore_wl_shutdown(void);
100
101EAPI struct wl_display *ecore_wl_display_get(void);
102EAPI struct wl_shm *ecore_wl_shm_get(void);
103EAPI struct wl_compositor *ecore_wl_compositor_get(void);
104EAPI struct wl_shell *ecore_wl_shell_get(void);
105EAPI struct wl_input_device *ecore_wl_input_device_get(void);
106EAPI void ecore_wl_screen_size_get(int *w, int *h);
107EAPI unsigned int ecore_wl_format_get(void);
108EAPI void ecore_wl_flush(void);
109EAPI void ecore_wl_sync(void);
110EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
111
112EAPI Ecore_Wl_Drag_Source *ecore_wl_drag_source_create(int hotspot_x, int hotspot_y, int offset_x, int offset_y, const char *mimetype, unsigned int timestamp, void *data);
113EAPI void ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer);
114EAPI void ecore_wl_drag_stop(void);
115
116EAPI extern int ECORE_WL_EVENT_MOUSE_IN;
117EAPI extern int ECORE_WL_EVENT_MOUSE_OUT;
118EAPI extern int ECORE_WL_EVENT_FOCUS_IN;
119EAPI extern int ECORE_WL_EVENT_FOCUS_OUT;
120EAPI extern int ECORE_WL_EVENT_DRAG_START;
121EAPI extern int ECORE_WL_EVENT_DRAG_STOP;
122
123#endif
diff --git a/libraries/ecore/src/lib/ecore_wayland/Makefile.am b/libraries/ecore/src/lib/ecore_wayland/Makefile.am
new file mode 100644
index 0000000..ea005b2
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_wayland/Makefile.am
@@ -0,0 +1,31 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_srcdir)/src/lib/ecore_input \
6-I$(top_builddir)/src/lib/ecore \
7-I$(top_builddir)/src/lib/ecore_input \
8@WAYLAND_CFLAGS@ \
9@EVAS_CFLAGS@ \
10@EINA_CFLAGS@
11
12lib_LTLIBRARIES = libecore_wayland.la
13includes_HEADERS = Ecore_Wayland.h
14includesdir = $(includedir)/ecore-@VMAJ@
15
16libecore_wayland_la_SOURCES = \
17ecore_wl.c
18
19## ecore_wl_window.c
20
21libecore_wayland_la_LIBADD = \
22$(top_builddir)/src/lib/ecore/libecore.la \
23$(top_builddir)/src/lib/ecore_input/libecore_input.la \
24@WAYLAND_LIBS@ \
25@EVAS_LIBS@ \
26@EINA_LIBS@
27
28libecore_wayland_la_LDFLAGS = -version-info @version_info@ @release_info@
29libecore_wayland_la_DEPENDENCIES = $(top_builddir)/src/lib/ecore/libecore.la
30
31EXTRA_DIST = ecore_wl_private.h
diff --git a/libraries/ecore/src/lib/ecore_wayland/Makefile.in b/libraries/ecore/src/lib/ecore_wayland/Makefile.in
new file mode 100644
index 0000000..411da19
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_wayland/Makefile.in
@@ -0,0 +1,829 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38subdir = src/lib/ecore_wayland
39DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
40 $(srcdir)/Makefile.in
41ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
43 $(top_srcdir)/m4/ac_path_generic.m4 \
44 $(top_srcdir)/m4/check_x_extension.m4 \
45 $(top_srcdir)/m4/ecore_check_module.m4 \
46 $(top_srcdir)/m4/ecore_check_options.m4 \
47 $(top_srcdir)/m4/efl_compiler_flag.m4 \
48 $(top_srcdir)/m4/efl_doxygen.m4 \
49 $(top_srcdir)/m4/efl_examples.m4 \
50 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
51 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
52 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
53 $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \
54 $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
55 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
56 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
57 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
58 $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
59 $(top_srcdir)/configure.ac
60am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
61 $(ACLOCAL_M4)
62mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
63CONFIG_HEADER = $(top_builddir)/config.h
64CONFIG_CLEAN_FILES =
65CONFIG_CLEAN_VPATH_FILES =
66am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
67am__vpath_adj = case $$p in \
68 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
69 *) f=$$p;; \
70 esac;
71am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
72am__install_max = 40
73am__nobase_strip_setup = \
74 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
75am__nobase_strip = \
76 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
77am__nobase_list = $(am__nobase_strip_setup); \
78 for p in $$list; do echo "$$p $$p"; done | \
79 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
80 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
81 if (++n[$$2] == $(am__install_max)) \
82 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
83 END { for (dir in files) print dir, files[dir] }'
84am__base_list = \
85 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
86 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
87am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
88LTLIBRARIES = $(lib_LTLIBRARIES)
89am_libecore_wayland_la_OBJECTS = ecore_wl.lo
90libecore_wayland_la_OBJECTS = $(am_libecore_wayland_la_OBJECTS)
91AM_V_lt = $(am__v_lt_$(V))
92am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
93am__v_lt_0 = --silent
94libecore_wayland_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
95 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
96 $(AM_CFLAGS) $(CFLAGS) $(libecore_wayland_la_LDFLAGS) \
97 $(LDFLAGS) -o $@
98DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
99depcomp = $(SHELL) $(top_srcdir)/depcomp
100am__depfiles_maybe = depfiles
101am__mv = mv -f
102COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
103 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
104LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
105 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
106 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
107 $(AM_CFLAGS) $(CFLAGS)
108AM_V_CC = $(am__v_CC_$(V))
109am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
110am__v_CC_0 = @echo " CC " $@;
111AM_V_at = $(am__v_at_$(V))
112am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
113am__v_at_0 = @
114CCLD = $(CC)
115LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
116 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
117 $(AM_LDFLAGS) $(LDFLAGS) -o $@
118AM_V_CCLD = $(am__v_CCLD_$(V))
119am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
120am__v_CCLD_0 = @echo " CCLD " $@;
121AM_V_GEN = $(am__v_GEN_$(V))
122am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
123am__v_GEN_0 = @echo " GEN " $@;
124SOURCES = $(libecore_wayland_la_SOURCES)
125DIST_SOURCES = $(libecore_wayland_la_SOURCES)
126HEADERS = $(includes_HEADERS)
127ETAGS = etags
128CTAGS = ctags
129DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
130ACLOCAL = @ACLOCAL@
131ALLOCA = @ALLOCA@
132AMTAR = @AMTAR@
133AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
134AR = @AR@
135AS = @AS@
136AUTOCONF = @AUTOCONF@
137AUTOHEADER = @AUTOHEADER@
138AUTOMAKE = @AUTOMAKE@
139AWK = @AWK@
140CARES_CFLAGS = @CARES_CFLAGS@
141CARES_LIBS = @CARES_LIBS@
142CC = @CC@
143CCDEPMODE = @CCDEPMODE@
144CFLAGS = @CFLAGS@
145CHECK_CFLAGS = @CHECK_CFLAGS@
146CHECK_LIBS = @CHECK_LIBS@
147CPP = @CPP@
148CPPFLAGS = @CPPFLAGS@
149CURL_CFLAGS = @CURL_CFLAGS@
150CURL_LIBS = @CURL_LIBS@
151CXX = @CXX@
152CXXCPP = @CXXCPP@
153CXXDEPMODE = @CXXDEPMODE@
154CXXFLAGS = @CXXFLAGS@
155CYGPATH_W = @CYGPATH_W@
156DEFS = @DEFS@
157DEPDIR = @DEPDIR@
158DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
159DIRECTFB_LIBS = @DIRECTFB_LIBS@
160DLLTOOL = @DLLTOOL@
161DSYMUTIL = @DSYMUTIL@
162DUMPBIN = @DUMPBIN@
163ECHO_C = @ECHO_C@
164ECHO_N = @ECHO_N@
165ECHO_T = @ECHO_T@
166ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@
167ECORE_XCB_LIBS = @ECORE_XCB_LIBS@
168EFL_ECORE_BUILD = @EFL_ECORE_BUILD@
169EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@
170EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@
171EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@
172EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@
173EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@
174EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@
175EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@
176EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@
177EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@
178EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@
179EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@
180EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@
181EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
182EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
183EGREP = @EGREP@
184EINA_CFLAGS = @EINA_CFLAGS@
185EINA_LIBS = @EINA_LIBS@
186ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
187ESCAPE_LIBS = @ESCAPE_LIBS@
188EVAS_CFLAGS = @EVAS_CFLAGS@
189EVAS_LIBS = @EVAS_LIBS@
190EVIL_CFLAGS = @EVIL_CFLAGS@
191EVIL_LIBS = @EVIL_LIBS@
192EXEEXT = @EXEEXT@
193FGREP = @FGREP@
194GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
195GLIB_CFLAGS = @GLIB_CFLAGS@
196GLIB_LIBS = @GLIB_LIBS@
197GMSGFMT = @GMSGFMT@
198GMSGFMT_015 = @GMSGFMT_015@
199GREP = @GREP@
200INSTALL = @INSTALL@
201INSTALL_DATA = @INSTALL_DATA@
202INSTALL_PROGRAM = @INSTALL_PROGRAM@
203INSTALL_SCRIPT = @INSTALL_SCRIPT@
204INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
205INTLLIBS = @INTLLIBS@
206INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
207KEYSYMDEFS = @KEYSYMDEFS@
208LD = @LD@
209LDFLAGS = @LDFLAGS@
210LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
211LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
212LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
213LIBICONV = @LIBICONV@
214LIBINTL = @LIBINTL@
215LIBOBJS = @LIBOBJS@
216LIBS = @LIBS@
217LIBTOOL = @LIBTOOL@
218LIPO = @LIPO@
219LN_S = @LN_S@
220LTLIBICONV = @LTLIBICONV@
221LTLIBINTL = @LTLIBINTL@
222LTLIBOBJS = @LTLIBOBJS@
223MAKEINFO = @MAKEINFO@
224MKDIR_P = @MKDIR_P@
225MSGFMT = @MSGFMT@
226MSGFMT_015 = @MSGFMT_015@
227MSGMERGE = @MSGMERGE@
228NM = @NM@
229NMEDIT = @NMEDIT@
230OBJC = @OBJC@
231OBJCDEPMODE = @OBJCDEPMODE@
232OBJCFLAGS = @OBJCFLAGS@
233OBJDUMP = @OBJDUMP@
234OBJEXT = @OBJEXT@
235OTOOL = @OTOOL@
236OTOOL64 = @OTOOL64@
237PACKAGE = @PACKAGE@
238PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
239PACKAGE_NAME = @PACKAGE_NAME@
240PACKAGE_STRING = @PACKAGE_STRING@
241PACKAGE_TARNAME = @PACKAGE_TARNAME@
242PACKAGE_URL = @PACKAGE_URL@
243PACKAGE_VERSION = @PACKAGE_VERSION@
244PATH_SEPARATOR = @PATH_SEPARATOR@
245PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
246PIXMAN_LIBS = @PIXMAN_LIBS@
247PKG_CONFIG = @PKG_CONFIG@
248POSUB = @POSUB@
249RANLIB = @RANLIB@
250SCIM_CFLAGS = @SCIM_CFLAGS@
251SCIM_LIBS = @SCIM_LIBS@
252SDL_CFLAGS = @SDL_CFLAGS@
253SDL_CONFIG = @SDL_CONFIG@
254SDL_LIBS = @SDL_LIBS@
255SED = @SED@
256SET_MAKE = @SET_MAKE@
257SHELL = @SHELL@
258SSL_CFLAGS = @SSL_CFLAGS@
259SSL_LIBS = @SSL_LIBS@
260STRIP = @STRIP@
261TLS2_CFLAGS = @TLS2_CFLAGS@
262TLS2_LIBS = @TLS2_LIBS@
263TLS_CFLAGS = @TLS_CFLAGS@
264TLS_LIBS = @TLS_LIBS@
265TSLIB_CFLAGS = @TSLIB_CFLAGS@
266TSLIB_LIBS = @TSLIB_LIBS@
267USE_NLS = @USE_NLS@
268VERSION = @VERSION@
269VMAJ = @VMAJ@
270WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
271WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
272WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
273WAYLAND_LIBS = @WAYLAND_LIBS@
274WIN32_CFLAGS = @WIN32_CFLAGS@
275WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
276WIN32_LIBS = @WIN32_LIBS@
277XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@
278XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@
279XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@
280XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@
281XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@
282XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@
283XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@
284XCB_DPMS_LIBS = @XCB_DPMS_LIBS@
285XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@
286XCB_RANDR_LIBS = @XCB_RANDR_LIBS@
287XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@
288XCB_RENDER_LIBS = @XCB_RENDER_LIBS@
289XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@
290XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@
291XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@
292XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@
293XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@
294XCB_SYNC_LIBS = @XCB_SYNC_LIBS@
295XCB_X11_CFLAGS = @XCB_X11_CFLAGS@
296XCB_X11_LIBS = @XCB_X11_LIBS@
297XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@
298XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@
299XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@
300XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@
301XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@
302XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@
303XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@
304XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@
305XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@
306XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@
307XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@
308XCB_XTEST_LIBS = @XCB_XTEST_LIBS@
309XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@
310XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
311XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
312XDAMAGE_LIBS = @XDAMAGE_LIBS@
313XDPMS_CFLAGS = @XDPMS_CFLAGS@
314XDPMS_LIBS = @XDPMS_LIBS@
315XFIXES_CFLAGS = @XFIXES_CFLAGS@
316XFIXES_LIBS = @XFIXES_LIBS@
317XGESTURE_CFLAGS = @XGESTURE_CFLAGS@
318XGESTURE_LIBS = @XGESTURE_LIBS@
319XGETTEXT = @XGETTEXT@
320XGETTEXT_015 = @XGETTEXT_015@
321XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
322XI2_CFLAGS = @XI2_CFLAGS@
323XI2_LIBS = @XI2_LIBS@
324XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
325XINERAMA_LIBS = @XINERAMA_LIBS@
326XKB_CFLAGS = @XKB_CFLAGS@
327XKB_LIBS = @XKB_LIBS@
328XMKMF = @XMKMF@
329XPRINT_CFLAGS = @XPRINT_CFLAGS@
330XPRINT_LIBS = @XPRINT_LIBS@
331XRANDR_CFLAGS = @XRANDR_CFLAGS@
332XRANDR_LIBS = @XRANDR_LIBS@
333XRENDER_CFLAGS = @XRENDER_CFLAGS@
334XRENDER_LIBS = @XRENDER_LIBS@
335XSS_CFLAGS = @XSS_CFLAGS@
336XSS_LIBS = @XSS_LIBS@
337XTEST_CFLAGS = @XTEST_CFLAGS@
338XTEST_LIBS = @XTEST_LIBS@
339X_CFLAGS = @X_CFLAGS@
340X_EXTRA_LIBS = @X_EXTRA_LIBS@
341X_LIBS = @X_LIBS@
342X_PRE_LIBS = @X_PRE_LIBS@
343Xcursor_cflags = @Xcursor_cflags@
344Xcursor_libs = @Xcursor_libs@
345abs_builddir = @abs_builddir@
346abs_srcdir = @abs_srcdir@
347abs_top_builddir = @abs_top_builddir@
348abs_top_srcdir = @abs_top_srcdir@
349ac_ct_CC = @ac_ct_CC@
350ac_ct_CXX = @ac_ct_CXX@
351ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
352ac_ct_OBJC = @ac_ct_OBJC@
353am__include = @am__include@
354am__leading_dot = @am__leading_dot@
355am__quote = @am__quote@
356am__tar = @am__tar@
357am__untar = @am__untar@
358bindir = @bindir@
359build = @build@
360build_alias = @build_alias@
361build_cpu = @build_cpu@
362build_os = @build_os@
363build_vendor = @build_vendor@
364builddir = @builddir@
365cocoa_ldflags = @cocoa_ldflags@
366datadir = @datadir@
367datarootdir = @datarootdir@
368dlopen_libs = @dlopen_libs@
369docdir = @docdir@
370dvidir = @dvidir@
371ecore_cocoa_cflags = @ecore_cocoa_cflags@
372ecore_cocoa_libs = @ecore_cocoa_libs@
373ecore_con_cflags = @ecore_con_cflags@
374ecore_con_libs = @ecore_con_libs@
375ecore_directfb_cflags = @ecore_directfb_cflags@
376ecore_directfb_libs = @ecore_directfb_libs@
377ecore_evas_cflags = @ecore_evas_cflags@
378ecore_evas_libs = @ecore_evas_libs@
379ecore_fb_cflags = @ecore_fb_cflags@
380ecore_fb_libs = @ecore_fb_libs@
381ecore_file_cflags = @ecore_file_cflags@
382ecore_file_libs = @ecore_file_libs@
383ecore_imf_cflags = @ecore_imf_cflags@
384ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
385ecore_imf_evas_libs = @ecore_imf_evas_libs@
386ecore_imf_libs = @ecore_imf_libs@
387ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
388ecore_imf_scim_libs = @ecore_imf_scim_libs@
389ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
390ecore_imf_xim_libs = @ecore_imf_xim_libs@
391ecore_input_cflags = @ecore_input_cflags@
392ecore_input_evas_cflags = @ecore_input_evas_cflags@
393ecore_input_evas_libs = @ecore_input_evas_libs@
394ecore_input_libs = @ecore_input_libs@
395ecore_ipc_cflags = @ecore_ipc_cflags@
396ecore_ipc_libs = @ecore_ipc_libs@
397ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
398ecore_psl1ght_libs = @ecore_psl1ght_libs@
399ecore_sdl_cflags = @ecore_sdl_cflags@
400ecore_sdl_libs = @ecore_sdl_libs@
401ecore_wayland_cflags = @ecore_wayland_cflags@
402ecore_wayland_libs = @ecore_wayland_libs@
403ecore_win32_cflags = @ecore_win32_cflags@
404ecore_win32_libs = @ecore_win32_libs@
405ecore_wince_cflags = @ecore_wince_cflags@
406ecore_wince_libs = @ecore_wince_libs@
407ecore_x_cflags = @ecore_x_cflags@
408ecore_x_libs = @ecore_x_libs@
409ecore_x_libs_private = @ecore_x_libs_private@
410efl_doxygen = @efl_doxygen@
411efl_have_doxygen = @efl_have_doxygen@
412exec_prefix = @exec_prefix@
413have_ecore_x_xcb_define = @have_ecore_x_xcb_define@
414host = @host@
415host_alias = @host_alias@
416host_cpu = @host_cpu@
417host_os = @host_os@
418host_vendor = @host_vendor@
419htmldir = @htmldir@
420includedir = @includedir@
421infodir = @infodir@
422install_sh = @install_sh@
423libdir = @libdir@
424libexecdir = @libexecdir@
425localedir = @localedir@
426localstatedir = @localstatedir@
427lt_ECHO = @lt_ECHO@
428lt_enable_auto_import = @lt_enable_auto_import@
429mandir = @mandir@
430mkdir_p = @mkdir_p@
431oldincludedir = @oldincludedir@
432pdfdir = @pdfdir@
433pkgconfig_requires_private = @pkgconfig_requires_private@
434prefix = @prefix@
435program_transform_name = @program_transform_name@
436psdir = @psdir@
437release_info = @release_info@
438requirements_ecore = @requirements_ecore@
439requirements_ecore_cocoa = @requirements_ecore_cocoa@
440requirements_ecore_con = @requirements_ecore_con@
441requirements_ecore_directfb = @requirements_ecore_directfb@
442requirements_ecore_evas = @requirements_ecore_evas@
443requirements_ecore_fb = @requirements_ecore_fb@
444requirements_ecore_file = @requirements_ecore_file@
445requirements_ecore_imf = @requirements_ecore_imf@
446requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
447requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
448requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
449requirements_ecore_input = @requirements_ecore_input@
450requirements_ecore_input_evas = @requirements_ecore_input_evas@
451requirements_ecore_ipc = @requirements_ecore_ipc@
452requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
453requirements_ecore_sdl = @requirements_ecore_sdl@
454requirements_ecore_wayland = @requirements_ecore_wayland@
455requirements_ecore_win32 = @requirements_ecore_win32@
456requirements_ecore_wince = @requirements_ecore_wince@
457requirements_ecore_x = @requirements_ecore_x@
458rt_libs = @rt_libs@
459sbindir = @sbindir@
460sharedstatedir = @sharedstatedir@
461srcdir = @srcdir@
462sysconfdir = @sysconfdir@
463target_alias = @target_alias@
464top_build_prefix = @top_build_prefix@
465top_builddir = @top_builddir@
466top_srcdir = @top_srcdir@
467version_info = @version_info@
468x_cflags = @x_cflags@
469x_includes = @x_includes@
470x_libs = @x_libs@
471MAINTAINERCLEANFILES = Makefile.in
472AM_CPPFLAGS = \
473-I$(top_srcdir)/src/lib/ecore \
474-I$(top_srcdir)/src/lib/ecore_input \
475-I$(top_builddir)/src/lib/ecore \
476-I$(top_builddir)/src/lib/ecore_input \
477@WAYLAND_CFLAGS@ \
478@EVAS_CFLAGS@ \
479@EINA_CFLAGS@
480
481lib_LTLIBRARIES = libecore_wayland.la
482includes_HEADERS = Ecore_Wayland.h
483includesdir = $(includedir)/ecore-@VMAJ@
484libecore_wayland_la_SOURCES = \
485ecore_wl.c
486
487libecore_wayland_la_LIBADD = \
488$(top_builddir)/src/lib/ecore/libecore.la \
489$(top_builddir)/src/lib/ecore_input/libecore_input.la \
490@WAYLAND_LIBS@ \
491@EVAS_LIBS@ \
492@EINA_LIBS@
493
494libecore_wayland_la_LDFLAGS = -version-info @version_info@ @release_info@
495libecore_wayland_la_DEPENDENCIES = $(top_builddir)/src/lib/ecore/libecore.la
496EXTRA_DIST = ecore_wl_private.h
497all: all-am
498
499.SUFFIXES:
500.SUFFIXES: .c .lo .o .obj
501$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
502 @for dep in $?; do \
503 case '$(am__configure_deps)' in \
504 *$$dep*) \
505 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
506 && { if test -f $@; then exit 0; else break; fi; }; \
507 exit 1;; \
508 esac; \
509 done; \
510 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/ecore_wayland/Makefile'; \
511 $(am__cd) $(top_srcdir) && \
512 $(AUTOMAKE) --gnu src/lib/ecore_wayland/Makefile
513.PRECIOUS: Makefile
514Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
515 @case '$?' in \
516 *config.status*) \
517 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
518 *) \
519 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
520 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
521 esac;
522
523$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
524 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
525
526$(top_srcdir)/configure: $(am__configure_deps)
527 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
528$(ACLOCAL_M4): $(am__aclocal_m4_deps)
529 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
530$(am__aclocal_m4_deps):
531install-libLTLIBRARIES: $(lib_LTLIBRARIES)
532 @$(NORMAL_INSTALL)
533 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
534 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
535 list2=; for p in $$list; do \
536 if test -f $$p; then \
537 list2="$$list2 $$p"; \
538 else :; fi; \
539 done; \
540 test -z "$$list2" || { \
541 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
542 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
543 }
544
545uninstall-libLTLIBRARIES:
546 @$(NORMAL_UNINSTALL)
547 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
548 for p in $$list; do \
549 $(am__strip_dir) \
550 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
551 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
552 done
553
554clean-libLTLIBRARIES:
555 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
556 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
557 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
558 test "$$dir" != "$$p" || dir=.; \
559 echo "rm -f \"$${dir}/so_locations\""; \
560 rm -f "$${dir}/so_locations"; \
561 done
562libecore_wayland.la: $(libecore_wayland_la_OBJECTS) $(libecore_wayland_la_DEPENDENCIES)
563 $(AM_V_CCLD)$(libecore_wayland_la_LINK) -rpath $(libdir) $(libecore_wayland_la_OBJECTS) $(libecore_wayland_la_LIBADD) $(LIBS)
564
565mostlyclean-compile:
566 -rm -f *.$(OBJEXT)
567
568distclean-compile:
569 -rm -f *.tab.c
570
571@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_wl.Plo@am__quote@
572
573.c.o:
574@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
575@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
576@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
577@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
578@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
579@am__fastdepCC_FALSE@ $(COMPILE) -c $<
580
581.c.obj:
582@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
583@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
584@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
585@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
586@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
587@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
588
589.c.lo:
590@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
591@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
592@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
593@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
594@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
595@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
596
597mostlyclean-libtool:
598 -rm -f *.lo
599
600clean-libtool:
601 -rm -rf .libs _libs
602install-includesHEADERS: $(includes_HEADERS)
603 @$(NORMAL_INSTALL)
604 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
605 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
606 for p in $$list; do \
607 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
608 echo "$$d$$p"; \
609 done | $(am__base_list) | \
610 while read files; do \
611 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
612 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
613 done
614
615uninstall-includesHEADERS:
616 @$(NORMAL_UNINSTALL)
617 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
618 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
619 test -n "$$files" || exit 0; \
620 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
621 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
622
623ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
624 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
625 unique=`for i in $$list; do \
626 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
627 done | \
628 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
629 END { if (nonempty) { for (i in files) print i; }; }'`; \
630 mkid -fID $$unique
631tags: TAGS
632
633TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
634 $(TAGS_FILES) $(LISP)
635 set x; \
636 here=`pwd`; \
637 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
638 unique=`for i in $$list; do \
639 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
640 done | \
641 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
642 END { if (nonempty) { for (i in files) print i; }; }'`; \
643 shift; \
644 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
645 test -n "$$unique" || unique=$$empty_fix; \
646 if test $$# -gt 0; then \
647 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
648 "$$@" $$unique; \
649 else \
650 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
651 $$unique; \
652 fi; \
653 fi
654ctags: CTAGS
655CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
656 $(TAGS_FILES) $(LISP)
657 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
658 unique=`for i in $$list; do \
659 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
660 done | \
661 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
662 END { if (nonempty) { for (i in files) print i; }; }'`; \
663 test -z "$(CTAGS_ARGS)$$unique" \
664 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
665 $$unique
666
667GTAGS:
668 here=`$(am__cd) $(top_builddir) && pwd` \
669 && $(am__cd) $(top_srcdir) \
670 && gtags -i $(GTAGS_ARGS) "$$here"
671
672distclean-tags:
673 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
674
675distdir: $(DISTFILES)
676 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
677 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
678 list='$(DISTFILES)'; \
679 dist_files=`for file in $$list; do echo $$file; done | \
680 sed -e "s|^$$srcdirstrip/||;t" \
681 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
682 case $$dist_files in \
683 */*) $(MKDIR_P) `echo "$$dist_files" | \
684 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
685 sort -u` ;; \
686 esac; \
687 for file in $$dist_files; do \
688 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
689 if test -d $$d/$$file; then \
690 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
691 if test -d "$(distdir)/$$file"; then \
692 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
693 fi; \
694 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
695 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
696 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
697 fi; \
698 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
699 else \
700 test -f "$(distdir)/$$file" \
701 || cp -p $$d/$$file "$(distdir)/$$file" \
702 || exit 1; \
703 fi; \
704 done
705check-am: all-am
706check: check-am
707all-am: Makefile $(LTLIBRARIES) $(HEADERS)
708installdirs:
709 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
710 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
711 done
712install: install-am
713install-exec: install-exec-am
714install-data: install-data-am
715uninstall: uninstall-am
716
717install-am: all-am
718 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
719
720installcheck: installcheck-am
721install-strip:
722 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
723 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
724 `test -z '$(STRIP)' || \
725 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
726mostlyclean-generic:
727
728clean-generic:
729
730distclean-generic:
731 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
732 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
733
734maintainer-clean-generic:
735 @echo "This command is intended for maintainers to use"
736 @echo "it deletes files that may require special tools to rebuild."
737 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
738clean: clean-am
739
740clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
741 mostlyclean-am
742
743distclean: distclean-am
744 -rm -rf ./$(DEPDIR)
745 -rm -f Makefile
746distclean-am: clean-am distclean-compile distclean-generic \
747 distclean-tags
748
749dvi: dvi-am
750
751dvi-am:
752
753html: html-am
754
755html-am:
756
757info: info-am
758
759info-am:
760
761install-data-am: install-includesHEADERS
762
763install-dvi: install-dvi-am
764
765install-dvi-am:
766
767install-exec-am: install-libLTLIBRARIES
768
769install-html: install-html-am
770
771install-html-am:
772
773install-info: install-info-am
774
775install-info-am:
776
777install-man:
778
779install-pdf: install-pdf-am
780
781install-pdf-am:
782
783install-ps: install-ps-am
784
785install-ps-am:
786
787installcheck-am:
788
789maintainer-clean: maintainer-clean-am
790 -rm -rf ./$(DEPDIR)
791 -rm -f Makefile
792maintainer-clean-am: distclean-am maintainer-clean-generic
793
794mostlyclean: mostlyclean-am
795
796mostlyclean-am: mostlyclean-compile mostlyclean-generic \
797 mostlyclean-libtool
798
799pdf: pdf-am
800
801pdf-am:
802
803ps: ps-am
804
805ps-am:
806
807uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
808
809.MAKE: install-am install-strip
810
811.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
812 clean-libLTLIBRARIES clean-libtool ctags distclean \
813 distclean-compile distclean-generic distclean-libtool \
814 distclean-tags distdir dvi dvi-am html html-am info info-am \
815 install install-am install-data install-data-am install-dvi \
816 install-dvi-am install-exec install-exec-am install-html \
817 install-html-am install-includesHEADERS install-info \
818 install-info-am install-libLTLIBRARIES install-man install-pdf \
819 install-pdf-am install-ps install-ps-am install-strip \
820 installcheck installcheck-am installdirs maintainer-clean \
821 maintainer-clean-generic mostlyclean mostlyclean-compile \
822 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
823 tags uninstall uninstall-am uninstall-includesHEADERS \
824 uninstall-libLTLIBRARIES
825
826
827# Tell versions [3.59,3.63) of GNU make to not export all variables.
828# Otherwise a system limit (for SysV at least) may be exceeded.
829.NOEXPORT:
diff --git a/libraries/ecore/src/lib/ecore_wayland/ecore_wl.c b/libraries/ecore/src/lib/ecore_wayland/ecore_wl.c
new file mode 100644
index 0000000..f62503b
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_wayland/ecore_wl.c
@@ -0,0 +1,1213 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "Ecore.h"
6#include "ecore_private.h"
7#include "Ecore_Input.h"
8#include "ecore_wl_private.h"
9#include "Ecore_Wayland.h"
10
11/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ...
12 * What about other OSs ?? */
13#include <fcntl.h>
14#ifdef __linux__
15# include <linux/input.h>
16#else
17# define BTN_LEFT 0x110
18# define BTN_RIGHT 0x111
19# define BTN_MIDDLE 0x112
20# define BTN_SIDE 0x113
21# define BTN_EXTRA 0x114
22# define BTN_FORWARD 0x115
23# define BTN_BACK 0x116
24#endif
25
26#include <X11/extensions/XKBcommon.h>
27
28/* local function prototypes */
29static Eina_Bool _ecore_wl_shutdown(Eina_Bool close_display);
30static void _ecore_wl_cb_disp_handle_global(struct wl_display *disp, uint32_t id, const char *interface, uint32_t version __UNUSED__, void *data __UNUSED__);
31static int _ecore_wl_cb_disp_event_mask_update(uint32_t mask, void *data __UNUSED__);
32static void _ecore_wl_cb_disp_handle_geometry(void *data __UNUSED__, struct wl_output *output __UNUSED__, int x, int y, int pw __UNUSED__, int ph __UNUSED__, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__);
33static void _ecore_wl_cb_disp_handle_mode(void *data __UNUSED__, struct wl_output *output __UNUSED__, uint32_t flags, int w, int h, int refresh __UNUSED__);
34static Eina_Bool _ecore_wl_cb_fd_handle(void *data, Ecore_Fd_Handler *hdl __UNUSED__);
35static void _ecore_wl_cb_handle_motion(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, int32_t x, int32_t y, int32_t sx, int32_t sy);
36static void _ecore_wl_cb_handle_button(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, uint32_t btn, uint32_t state);
37static void _ecore_wl_cb_handle_key(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t __UNUSED__, uint32_t key, uint32_t state);
38static void _ecore_wl_cb_handle_pointer_focus(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, struct wl_surface *surface, int32_t x, int32_t y, int32_t sx, int32_t sy);
39static void _ecore_wl_cb_handle_keyboard_focus(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t __UNUSED__, struct wl_surface *surface, struct wl_array *keys);
40static void _ecore_wl_cb_handle_touch_down(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, struct wl_surface *surface, int32_t id, int32_t x, int32_t y);
41static void _ecore_wl_cb_handle_touch_up(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id);
42static void _ecore_wl_cb_handle_touch_motion(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id, int32_t x, int32_t y);
43static void _ecore_wl_cb_handle_touch_frame(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__);
44static void _ecore_wl_cb_handle_touch_cancel(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__);
45static void _ecore_wl_cb_source_target(void *data, struct wl_data_source *source __UNUSED__, const char *mime_type __UNUSED__);
46static void _ecore_wl_cb_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd);
47static void _ecore_wl_cb_source_cancelled(void *data, struct wl_data_source *source __UNUSED__);
48static void _ecore_wl_cb_source_offer(void *data, struct wl_data_offer *offer __UNUSED__, const char *type);
49static void _ecore_wl_cb_data_offer(void *data, struct wl_data_device *data_dev, uint32_t id);
50static void _ecore_wl_cb_data_enter(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, struct wl_surface *surface, int32_t x, int32_t y, struct wl_data_offer *offer);
51static void _ecore_wl_cb_data_leave(void *data __UNUSED__, struct wl_data_device *data_dev);
52static void _ecore_wl_cb_data_motion(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, int32_t x, int32_t y);
53static void _ecore_wl_cb_data_drop(void *data __UNUSED__, struct wl_data_device *data_dev);
54static void _ecore_wl_cb_data_selection(void *data, struct wl_data_device *data_dev, struct wl_data_offer *offer);
55
56static void _ecore_wl_mouse_move_send(uint32_t timestamp);
57static void _ecore_wl_mouse_out_send(struct wl_surface *surface, uint32_t timestamp);
58static void _ecore_wl_mouse_in_send(struct wl_surface *surface, uint32_t timestamp);
59static void _ecore_wl_mouse_up_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp);
60static void _ecore_wl_mouse_down_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp);
61static void _ecore_wl_focus_out_send(struct wl_surface *surface, uint32_t timestamp);
62static void _ecore_wl_focus_in_send(struct wl_surface *surface, uint32_t timestamp);
63
64/* local variables */
65static int _ecore_wl_init_count = 0;
66static struct wl_display *_ecore_wl_disp = NULL;
67static uint32_t _ecore_wl_disp_mask = 0;
68static uint32_t _ecore_wl_disp_format = WL_SHM_FORMAT_ARGB8888;
69static Eina_Rectangle _ecore_wl_screen;
70static Ecore_Fd_Handler *_ecore_wl_fd_hdl = NULL;
71static int _ecore_wl_screen_x = 0;
72static int _ecore_wl_screen_y = 0;
73static int _ecore_wl_surface_x = 0;
74static int _ecore_wl_surface_y = 0;
75static int _ecore_wl_touch_x = 0;
76static int _ecore_wl_touch_y = 0;
77static int _ecore_wl_input_modifiers = 0;
78static struct xkb_desc *_ecore_wl_xkb;
79static uint32_t _ecore_wl_input_button = 0;
80
81static struct wl_compositor *_ecore_wl_comp;
82static struct wl_shm *_ecore_wl_shm;
83static struct wl_shell *_ecore_wl_shell;
84static struct wl_output *_ecore_wl_output;
85static struct wl_input_device *_ecore_wl_input_dev;
86static struct wl_surface *_ecore_wl_input_surface;
87static struct wl_surface *_ecore_wl_touch_surface;
88static struct wl_data_device_manager *_ecore_wl_data_manager;
89static struct wl_data_device *_ecore_wl_data_dev;
90
91static const struct wl_output_listener _ecore_wl_output_listener =
92{
93 _ecore_wl_cb_disp_handle_geometry,
94 _ecore_wl_cb_disp_handle_mode
95};
96static const struct wl_input_device_listener _ecore_wl_input_listener =
97{
98 _ecore_wl_cb_handle_motion,
99 _ecore_wl_cb_handle_button,
100 _ecore_wl_cb_handle_key,
101 _ecore_wl_cb_handle_pointer_focus,
102 _ecore_wl_cb_handle_keyboard_focus,
103 _ecore_wl_cb_handle_touch_down,
104 _ecore_wl_cb_handle_touch_up,
105 _ecore_wl_cb_handle_touch_motion,
106 _ecore_wl_cb_handle_touch_frame,
107 _ecore_wl_cb_handle_touch_cancel,
108};
109static const struct wl_data_source_listener _ecore_wl_source_listener =
110{
111 _ecore_wl_cb_source_target,
112 _ecore_wl_cb_source_send,
113 _ecore_wl_cb_source_cancelled
114};
115static const struct wl_data_device_listener _ecore_wl_data_listener =
116{
117 _ecore_wl_cb_data_offer,
118 _ecore_wl_cb_data_enter,
119 _ecore_wl_cb_data_leave,
120 _ecore_wl_cb_data_motion,
121 _ecore_wl_cb_data_drop,
122 _ecore_wl_cb_data_selection
123};
124static const struct wl_data_offer_listener _ecore_wl_offer_listener =
125{
126 _ecore_wl_cb_source_offer,
127};
128
129/* external variables */
130int _ecore_wl_log_dom = -1;
131EAPI int ECORE_WL_EVENT_MOUSE_IN = 0;
132EAPI int ECORE_WL_EVENT_MOUSE_OUT = 0;
133EAPI int ECORE_WL_EVENT_FOCUS_IN = 0;
134EAPI int ECORE_WL_EVENT_FOCUS_OUT = 0;
135EAPI int ECORE_WL_EVENT_DRAG_START = 0;
136EAPI int ECORE_WL_EVENT_DRAG_STOP = 0;
137
138EAPI int
139ecore_wl_init(const char *name)
140{
141 struct xkb_rule_names xkb_names;
142 int fd = 0;
143
144 if (++_ecore_wl_init_count != 1)
145 return _ecore_wl_init_count;
146
147 LOGFN(__FILE__, __LINE__, __FUNCTION__);
148
149 if (!eina_init()) return --_ecore_wl_init_count;
150
151 _ecore_wl_log_dom =
152 eina_log_domain_register("ecore_wl", ECORE_WL_DEFAULT_LOG_COLOR);
153 if (_ecore_wl_log_dom < 0)
154 {
155 EINA_LOG_ERR("Cannot create a log domain for Ecore Wayland.");
156 eina_shutdown();
157 return --_ecore_wl_init_count;
158 }
159
160 if (!ecore_init())
161 {
162 eina_log_domain_unregister(_ecore_wl_log_dom);
163 _ecore_wl_log_dom = -1;
164 eina_shutdown();
165 return --_ecore_wl_init_count;
166 }
167
168 if (!ecore_event_init())
169 {
170 eina_log_domain_unregister(_ecore_wl_log_dom);
171 _ecore_wl_log_dom = -1;
172 ecore_shutdown();
173 eina_shutdown();
174 return --_ecore_wl_init_count;
175 }
176
177 if (!ECORE_WL_EVENT_MOUSE_IN)
178 {
179 ECORE_WL_EVENT_MOUSE_IN = ecore_event_type_new();
180 ECORE_WL_EVENT_MOUSE_OUT = ecore_event_type_new();
181 ECORE_WL_EVENT_FOCUS_IN = ecore_event_type_new();
182 ECORE_WL_EVENT_FOCUS_OUT = ecore_event_type_new();
183 ECORE_WL_EVENT_DRAG_START = ecore_event_type_new();
184 ECORE_WL_EVENT_DRAG_STOP = ecore_event_type_new();
185 }
186
187 /* init xkb */
188 /* FIXME: Somehow make this portable to other languages/countries */
189 xkb_names.rules = "evdev";
190 xkb_names.model = "evdev";
191 xkb_names.layout = "us";
192 xkb_names.variant = "";
193 xkb_names.options = "";
194 if (!(_ecore_wl_xkb = xkb_compile_keymap_from_rules(&xkb_names)))
195 {
196 ERR("Could not compile keymap");
197 eina_log_domain_unregister(_ecore_wl_log_dom);
198 _ecore_wl_log_dom = -1;
199 ecore_event_shutdown();
200 ecore_shutdown();
201 eina_shutdown();
202 return --_ecore_wl_init_count;
203 }
204
205 /* connect to the wayland display */
206 if (!(_ecore_wl_disp = wl_display_connect(name)))
207 {
208 eina_log_domain_unregister(_ecore_wl_log_dom);
209 _ecore_wl_log_dom = -1;
210 ecore_event_shutdown();
211 ecore_shutdown();
212 eina_shutdown();
213 return --_ecore_wl_init_count;
214 }
215
216 /* setup handler for wayland interfaces */
217 wl_display_add_global_listener(_ecore_wl_disp,
218 _ecore_wl_cb_disp_handle_global, NULL);
219
220 /* process connection events */
221 wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
222
223 fd = wl_display_get_fd(_ecore_wl_disp,
224 _ecore_wl_cb_disp_event_mask_update, NULL);
225
226 _ecore_wl_fd_hdl =
227 ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_wl_cb_fd_handle,
228 _ecore_wl_disp, NULL, NULL);
229 if (!_ecore_wl_fd_hdl)
230 {
231 wl_display_destroy(_ecore_wl_disp);
232 _ecore_wl_disp = NULL;
233 eina_log_domain_unregister(_ecore_wl_log_dom);
234 _ecore_wl_log_dom = -1;
235 ecore_event_shutdown();
236 ecore_shutdown();
237 eina_shutdown();
238 return --_ecore_wl_init_count;
239 }
240
241 return _ecore_wl_init_count;
242}
243
244EAPI int
245ecore_wl_shutdown(void)
246{
247 return _ecore_wl_shutdown(EINA_TRUE);
248}
249
250EAPI struct wl_display *
251ecore_wl_display_get(void)
252{
253 return _ecore_wl_disp;
254}
255
256EAPI struct wl_shm *
257ecore_wl_shm_get(void)
258{
259 return _ecore_wl_shm;
260}
261
262EAPI struct wl_compositor *
263ecore_wl_compositor_get(void)
264{
265 return _ecore_wl_comp;
266}
267
268EAPI struct wl_shell *
269ecore_wl_shell_get(void)
270{
271 return _ecore_wl_shell;
272}
273
274EAPI struct wl_input_device *
275ecore_wl_input_device_get(void)
276{
277 return _ecore_wl_input_dev;
278}
279
280EAPI void
281ecore_wl_screen_size_get(int *w, int *h)
282{
283 if (w) *w = _ecore_wl_screen.w;
284 if (h) *h = _ecore_wl_screen.h;
285}
286
287EAPI unsigned int
288ecore_wl_format_get(void)
289{
290 return _ecore_wl_disp_format;
291}
292
293EAPI void
294ecore_wl_flush(void)
295{
296 wl_display_flush(_ecore_wl_disp);
297}
298
299EAPI void
300ecore_wl_sync(void)
301{
302 wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
303}
304
305EAPI void
306ecore_wl_pointer_xy_get(int *x, int *y)
307{
308 if (x) *x = _ecore_wl_screen_x;
309 if (y) *y = _ecore_wl_screen_y;
310}
311
312EAPI Ecore_Wl_Drag_Source *
313ecore_wl_drag_source_create(int hotspot_x, int hotspot_y, int offset_x, int offset_y, const char *mimetype, unsigned int timestamp, void *data)
314{
315 Ecore_Wl_Drag_Source *source;
316
317 if (!(source = calloc(1, sizeof(Ecore_Wl_Drag_Source)))) return NULL;
318
319 source->data_dev = _ecore_wl_data_dev;
320 source->hotspot_x = hotspot_x;
321 source->hotspot_y = hotspot_y;
322 source->offset_x = offset_x;
323 source->offset_y = offset_y;
324 source->mimetype = mimetype;
325 source->timestamp = timestamp;
326 source->data = data;
327
328 source->data_source =
329 wl_data_device_manager_create_data_source(_ecore_wl_data_manager);
330
331 wl_data_source_add_listener(source->data_source,
332 &_ecore_wl_source_listener, source);
333
334 wl_data_source_offer(source->data_source, source->mimetype);
335
336 /* NB: Do we add some default mimetypes here ?? */
337 /* text/plain, etc */
338
339 return source;
340}
341
342EAPI void
343ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer)
344{
345 source->buffer = buffer;
346
347 wl_data_device_start_drag(source->data_dev, source->data_source,
348 surface, source->timestamp);
349}
350
351EAPI void
352ecore_wl_drag_stop(void)
353{
354
355}
356
357/* local functions */
358static Eina_Bool
359_ecore_wl_shutdown(Eina_Bool close_display)
360{
361 LOGFN(__FILE__, __LINE__, __FUNCTION__);
362
363 if (--_ecore_wl_init_count != 0)
364 return _ecore_wl_init_count;
365
366 if (!_ecore_wl_disp) return _ecore_wl_init_count;
367
368 if (_ecore_wl_xkb) free(_ecore_wl_xkb);
369
370 if (_ecore_wl_fd_hdl) ecore_main_fd_handler_del(_ecore_wl_fd_hdl);
371 _ecore_wl_fd_hdl = NULL;
372
373 if (close_display)
374 {
375 if (_ecore_wl_data_dev) wl_data_device_destroy(_ecore_wl_data_dev);
376 if (_ecore_wl_input_dev) wl_input_device_destroy(_ecore_wl_input_dev);
377 if (_ecore_wl_data_manager)
378 wl_data_device_manager_destroy(_ecore_wl_data_manager);
379 if (_ecore_wl_shell) wl_shell_destroy(_ecore_wl_shell);
380 if (_ecore_wl_shm) wl_shm_destroy(_ecore_wl_shm);
381 if (_ecore_wl_comp) wl_compositor_destroy(_ecore_wl_comp);
382 if (_ecore_wl_disp)
383 {
384 wl_display_flush(_ecore_wl_disp);
385 wl_display_destroy(_ecore_wl_disp);
386 }
387 _ecore_wl_disp = NULL;
388 }
389
390 eina_log_domain_unregister(_ecore_wl_log_dom);
391 _ecore_wl_log_dom = -1;
392
393 ecore_event_shutdown();
394 ecore_shutdown();
395 eina_shutdown();
396
397 return _ecore_wl_init_count;
398}
399
400static void
401_ecore_wl_cb_disp_handle_global(struct wl_display *disp, uint32_t id, const char *interface, uint32_t version __UNUSED__, void *data __UNUSED__)
402{
403// LOGFN(__FILE__, __LINE__, __FUNCTION__);
404
405 if (disp != _ecore_wl_disp) return;
406 if (!strcmp(interface, "wl_compositor"))
407 {
408 _ecore_wl_comp =
409 wl_display_bind(_ecore_wl_disp, id, &wl_compositor_interface);
410 }
411 else if (!strcmp(interface, "wl_shm"))
412 {
413 _ecore_wl_shm =
414 wl_display_bind(_ecore_wl_disp, id, &wl_shm_interface);
415 }
416 else if (!strcmp(interface, "wl_output"))
417 {
418 _ecore_wl_output =
419 wl_display_bind(_ecore_wl_disp, id, &wl_output_interface);
420 wl_output_add_listener(_ecore_wl_output,
421 &_ecore_wl_output_listener, NULL);
422 }
423 else if (!strcmp(interface, "wl_shell"))
424 {
425 _ecore_wl_shell =
426 wl_display_bind(_ecore_wl_disp, id, &wl_shell_interface);
427 }
428 else if (!strcmp(interface, "wl_input_device"))
429 {
430 _ecore_wl_input_dev =
431 wl_display_bind(_ecore_wl_disp, id, &wl_input_device_interface);
432 wl_input_device_add_listener(_ecore_wl_input_dev,
433 &_ecore_wl_input_listener, NULL);
434 }
435 else if (!strcmp(interface, "wl_data_device_manager"))
436 {
437 _ecore_wl_data_manager =
438 wl_display_bind(_ecore_wl_disp, id,
439 &wl_data_device_manager_interface);
440 }
441
442 if ((_ecore_wl_input_dev) && (_ecore_wl_data_manager) && (!_ecore_wl_data_dev))
443 {
444 _ecore_wl_data_dev =
445 wl_data_device_manager_get_data_device(_ecore_wl_data_manager,
446 _ecore_wl_input_dev);
447 wl_data_device_add_listener(_ecore_wl_data_dev,
448 &_ecore_wl_data_listener, NULL);
449 }
450}
451
452static int
453_ecore_wl_cb_disp_event_mask_update(uint32_t mask, void *data __UNUSED__)
454{
455// LOGFN(__FILE__, __LINE__, __FUNCTION__);
456
457 _ecore_wl_disp_mask = mask;
458
459 return 0;
460}
461
462static void
463_ecore_wl_cb_disp_handle_geometry(void *data __UNUSED__, struct wl_output *output __UNUSED__, int x, int y, int pw __UNUSED__, int ph __UNUSED__, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__)
464{
465 _ecore_wl_screen.x = x;
466 _ecore_wl_screen.y = y;
467}
468
469static void
470_ecore_wl_cb_disp_handle_mode(void *data __UNUSED__, struct wl_output *output __UNUSED__, uint32_t flags, int w, int h, int refresh __UNUSED__)
471{
472 if (flags & WL_OUTPUT_MODE_CURRENT)
473 {
474 _ecore_wl_screen.w = w;
475 _ecore_wl_screen.h = h;
476 }
477}
478
479static Eina_Bool
480_ecore_wl_cb_fd_handle(void *data, Ecore_Fd_Handler *hdl __UNUSED__)
481{
482 struct wl_display *disp;
483
484// LOGFN(__FILE__, __LINE__, __FUNCTION__);
485
486 if (!(disp = data)) return ECORE_CALLBACK_RENEW;
487 if (disp != _ecore_wl_disp) return ECORE_CALLBACK_RENEW;
488
489 if (_ecore_wl_disp_mask & WL_DISPLAY_WRITABLE)
490 wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_WRITABLE);
491
492 if (_ecore_wl_disp_mask & WL_DISPLAY_READABLE)
493 wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
494
495 return ECORE_CALLBACK_RENEW;
496}
497
498static void
499_ecore_wl_cb_handle_motion(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, int32_t x, int32_t y, int32_t sx, int32_t sy)
500{
501 if (dev != _ecore_wl_input_dev) return;
502
503 _ecore_wl_screen_x = x;
504 _ecore_wl_screen_y = y;
505 _ecore_wl_surface_x = sx;
506 _ecore_wl_surface_y = sy;
507
508 _ecore_wl_mouse_move_send(t);
509}
510
511static void
512_ecore_wl_cb_handle_button(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, uint32_t btn, uint32_t state)
513{
514 if (dev != _ecore_wl_input_dev) return;
515
516 if ((btn >= BTN_SIDE) && (btn <= BTN_BACK))
517 {
518 Ecore_Event_Mouse_Wheel *ev;
519
520 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return;
521
522 ev->timestamp = t;
523 ev->x = _ecore_wl_surface_x;
524 ev->y = _ecore_wl_surface_y;
525 ev->root.x = _ecore_wl_screen_x;
526 ev->root.y = _ecore_wl_screen_y;
527 ev->modifiers = _ecore_wl_input_modifiers;
528 ev->direction = 0;
529
530 if (_ecore_wl_input_surface)
531 {
532 unsigned int id = 0;
533
534 if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_input_surface)))
535 {
536 ev->window = id;
537 ev->event_window = id;
538 }
539 }
540
541 /* NB: (FIXME) Currently Wayland provides no measure of how much the
542 * wheel has scrolled (read: delta of movement). So for now, we will
543 * just assume that the amount scrolled is 1 */
544 if ((btn == BTN_EXTRA) || (btn == BTN_FORWARD)) // down
545 ev->z = 1;
546 else if ((btn == BTN_SIDE) || (btn == BTN_BACK)) // up
547 ev->z = -1;
548
549 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
550 }
551 else
552 {
553 if (state)
554 {
555 _ecore_wl_input_button = btn;
556 _ecore_wl_mouse_down_send(_ecore_wl_input_surface, btn, t);
557 /* NB: Ideally, this is not the place to check for drags.
558 * IMO, drags should be handled by the client. EG: we raise the
559 * mouse_down to the client, and the client can 'request' a
560 * drag_start from ecore_wl */
561 if ((_ecore_wl_input_surface) || (_ecore_wl_touch_surface))
562 {
563 /* record item which was grabbed.
564 * create drag source. start drag */
565 }
566 }
567 else
568 {
569 if ((_ecore_wl_input_surface) || (_ecore_wl_touch_surface))
570 {
571 /* release grabbed button and finish drag */
572 if ((_ecore_wl_input_button) &&
573 (_ecore_wl_input_button == btn))
574 {
575
576 }
577 }
578 _ecore_wl_input_button = 0;
579 _ecore_wl_mouse_up_send(_ecore_wl_input_surface, btn, t);
580 }
581 }
582}
583
584static void
585_ecore_wl_cb_handle_key(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t __UNUSED__, uint32_t key, uint32_t state)
586{
587 unsigned int keycode = 0;
588
589 if (dev != _ecore_wl_input_dev) return;
590
591 keycode = key + _ecore_wl_xkb->min_key_code;
592
593 if (state)
594 _ecore_wl_input_modifiers |= _ecore_wl_xkb->map->modmap[keycode];
595 else
596 _ecore_wl_input_modifiers &= ~_ecore_wl_xkb->map->modmap[keycode];
597}
598
599static void
600_ecore_wl_cb_handle_pointer_focus(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, struct wl_surface *surface, int32_t x, int32_t y, int32_t sx, int32_t sy)
601{
602 if (dev != _ecore_wl_input_dev) return;
603
604 /* NB: Wayland pointer focus is weird. It's not pointer focus in the normal
605 * sense...Wayland 'moving/resizing' (and maybe other stuff) has a habit
606 * of stealing the pointer focus and thus this cannot be used to control
607 * normal pointer focus. On mouse down, the 'active' surface is stolen
608 * by Wayland for the grab, so 'surface' here ends up being NULL. When a
609 * move or resize is finished, we get this event again, but this time
610 * with an active surface */
611 _ecore_wl_screen_x = x;
612 _ecore_wl_screen_y = y;
613 _ecore_wl_surface_x = sx;
614 _ecore_wl_surface_y = sy;
615
616 if ((_ecore_wl_input_surface) && (_ecore_wl_input_surface != surface))
617 {
618 if (!_ecore_wl_input_button)
619 _ecore_wl_mouse_out_send(_ecore_wl_input_surface, t);
620 }
621
622 if (surface)
623 {
624 if (_ecore_wl_input_button)
625 {
626 _ecore_wl_mouse_up_send(surface, _ecore_wl_input_button, t);
627 _ecore_wl_input_button = 0;
628 }
629 else
630 _ecore_wl_mouse_in_send(surface, t);
631 }
632}
633
634static void
635_ecore_wl_cb_handle_keyboard_focus(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, struct wl_surface *surface, struct wl_array *keys)
636{
637 unsigned int *keyend = 0, *i = 0;
638
639 if (dev != _ecore_wl_input_dev) return;
640
641 /* NB: Remove old keyboard focus */
642 if ((_ecore_wl_input_surface) && (_ecore_wl_input_surface != surface))
643 _ecore_wl_focus_out_send(_ecore_wl_input_surface, t);
644
645 _ecore_wl_input_surface = NULL;
646
647 keyend = keys->data + keys->size;
648 _ecore_wl_input_modifiers = 0;
649 for (i = keys->data; i < keyend; i++)
650 _ecore_wl_input_modifiers |= _ecore_wl_xkb->map->modmap[*i];
651
652 if (surface)
653 {
654 /* set new input surface */
655 _ecore_wl_input_surface = surface;
656
657 /* send mouse in to new surface */
658 /* _ecore_wl_mouse_in_send(surface, t); */
659
660 /* send focus to new surface */
661 _ecore_wl_focus_in_send(surface, t);
662 }
663}
664
665static void
666_ecore_wl_cb_handle_touch_down(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, struct wl_surface *surface, int32_t id, int32_t x, int32_t y)
667{
668 Ecore_Event_Mouse_Button *ev;
669
670 LOGFN(__FILE__, __LINE__, __FUNCTION__);
671
672 _ecore_wl_touch_surface = surface;
673 _ecore_wl_touch_x = x;
674 _ecore_wl_touch_y = y;
675
676 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
677
678 ev->timestamp = timestamp;
679
680 /* NB: Need to verify using x,y for these */
681 ev->x = x;
682 ev->y = y;
683 ev->root.x = x;
684 ev->root.y = y;
685 ev->modifiers = 0;
686 ev->buttons = 0;
687 ev->same_screen = 1;
688
689 /* FIXME: Need to get these from Wayland somehow */
690 ev->double_click = 0;
691 ev->triple_click = 0;
692
693 ev->multi.device = id;
694 ev->multi.radius = 1;
695 ev->multi.radius_x = 1;
696 ev->multi.radius_y = 1;
697 ev->multi.pressure = 1.0;
698 ev->multi.angle = 0.0;
699 /* NB: Need to verify using x,y for these */
700 ev->multi.x = x;
701 ev->multi.y = y;
702 ev->multi.root.x = x;
703 ev->multi.root.y = y;
704
705 {
706 unsigned int id = 0;
707
708 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
709 {
710 ev->window = id;
711 ev->event_window = id;
712 }
713 }
714
715 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
716}
717
718static void
719_ecore_wl_cb_handle_touch_up(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id)
720{
721 Ecore_Event_Mouse_Button *ev;
722
723 LOGFN(__FILE__, __LINE__, __FUNCTION__);
724
725 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
726
727 ev->timestamp = timestamp;
728
729 /* TODO: Need to verify using x,y for these */
730 ev->x = _ecore_wl_touch_x;
731 ev->y = _ecore_wl_touch_y;
732 ev->root.x = _ecore_wl_touch_x;
733 ev->root.y = _ecore_wl_touch_y;
734 ev->modifiers = 0;
735 ev->buttons = 0;
736 ev->same_screen = 1;
737
738 /* FIXME: Need to get these from Wayland somehow */
739 ev->double_click = 0;
740 ev->triple_click = 0;
741
742 ev->multi.device = id;
743 ev->multi.radius = 1;
744 ev->multi.radius_x = 1;
745 ev->multi.radius_y = 1;
746 ev->multi.pressure = 1.0;
747 ev->multi.angle = 0.0;
748
749 /* TODO: Need to verify using x,y for these */
750 ev->multi.x = _ecore_wl_touch_x;
751 ev->multi.y = _ecore_wl_touch_y;
752 ev->multi.root.x = _ecore_wl_touch_x;
753 ev->multi.root.y = _ecore_wl_touch_y;
754
755 {
756 unsigned int id = 0;
757
758 if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_touch_surface)))
759 {
760 ev->window = id;
761 ev->event_window = id;
762 }
763 }
764
765 _ecore_wl_touch_surface = NULL;
766
767 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
768}
769
770static void
771_ecore_wl_cb_handle_touch_motion(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id, int32_t x, int32_t y)
772{
773 Ecore_Event_Mouse_Move *ev;
774
775 LOGFN(__FILE__, __LINE__, __FUNCTION__);
776
777 if (!_ecore_wl_touch_surface) return;
778
779 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Move)))) return;
780
781 ev->timestamp = timestamp;
782 /* TODO: Need to verify using x,y for these */
783 ev->x = x;
784 ev->y = y;
785 ev->root.x = x;
786 ev->root.y = y;
787 ev->modifiers = 0; //_ecore_wl_input_modifiers;
788 ev->same_screen = 1;
789
790 ev->multi.device = id;
791 ev->multi.radius = 1;
792 ev->multi.radius_x = 1;
793 ev->multi.radius_y = 1;
794 ev->multi.pressure = 1.0;
795 ev->multi.angle = 0.0;
796
797 /* TODO: Need to verify using x,y for these */
798 ev->multi.x = x;
799 ev->multi.y = y;
800 ev->multi.root.x = x;
801 ev->multi.root.y = y;
802
803 {
804 unsigned int id = 0;
805
806 if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_touch_surface)))
807 {
808 ev->window = id;
809 ev->event_window = id;
810 }
811 }
812
813 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
814}
815
816static void
817_ecore_wl_cb_handle_touch_frame(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__)
818{
819 LOGFN(__FILE__, __LINE__, __FUNCTION__);
820
821 /* FIXME: Need to get a device and actually test what happens here */
822}
823
824static void
825_ecore_wl_cb_handle_touch_cancel(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__)
826{
827 LOGFN(__FILE__, __LINE__, __FUNCTION__);
828
829 /* FIXME: Need to get a device and actually test what happens here */
830 _ecore_wl_touch_surface = NULL;
831}
832
833static void
834_ecore_wl_cb_source_target(void *data, struct wl_data_source *source __UNUSED__, const char *mime_type __UNUSED__)
835{
836 Ecore_Wl_Drag_Source *s;
837
838 LOGFN(__FILE__, __LINE__, __FUNCTION__);
839
840 printf("Ecore_Wl Source Target\n");
841 if (!(s = data)) return;
842 printf("\tHave Drag Source\n");
843
844 /* FIXME: buffer here should really be the mouse cursor buffer */
845 wl_data_device_attach(s->data_dev, s->timestamp, s->buffer,
846 s->hotspot_x, s->hotspot_y);
847}
848
849static void
850_ecore_wl_cb_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd)
851{
852 Ecore_Wl_Drag_Source *s;
853
854 LOGFN(__FILE__, __LINE__, __FUNCTION__);
855
856 printf("Ecore_Wl Source Send\n");
857 if (!(s = data)) return;
858 printf("\tHave Drag Source\n");
859
860 /* FIXME: write message to fd */
861
862 /* NB: Wayland really sucks in this regard. Why should selection stuff
863 * require an 'fd' ?? */
864}
865
866static void
867_ecore_wl_cb_source_cancelled(void *data, struct wl_data_source *source __UNUSED__)
868{
869 Ecore_Wl_Drag_Source *s;
870
871 LOGFN(__FILE__, __LINE__, __FUNCTION__);
872
873 /* The cancelled event usually means source is no longer in use by
874 * the drag (or selection). */
875
876 printf("Ecore_Wl Source Cancel\n");
877 if (!(s = data)) return;
878 printf("\tHave Drag Source\n");
879
880 /* FIXME: raise this to ecore_evas so the surface/buffer
881 * of the drag can be destroyed */
882
883 if (s->data_source) wl_data_source_destroy(s->data_source);
884 s->data_source = NULL;
885
886 free(s);
887}
888
889static void
890_ecore_wl_cb_source_offer(void *data, struct wl_data_offer *offer __UNUSED__, const char *type)
891{
892 Ecore_Wl_Dnd_Source *s;
893
894 if (!(s = data)) return;
895 eina_array_push(s->types, strdup(type));
896}
897
898static void
899_ecore_wl_cb_data_offer(void *data, struct wl_data_device *data_dev, uint32_t id)
900{
901 Ecore_Wl_Dnd_Source *source;
902
903 /* create a new 'data offer' structure and setup a listener for it */
904 if (!(source = calloc(1, sizeof(Ecore_Wl_Dnd_Source)))) return;
905
906 source->types = eina_array_new(1);
907 source->data = data;
908 source->refs = 1;
909
910 /* FIXME: This will need to change when Wayland has typesafe wrappers for this */
911 source->offer = (struct wl_data_offer *)
912 wl_proxy_create_for_id((struct wl_proxy *)data_dev,
913 id, &wl_data_offer_interface);
914
915 wl_data_device_set_user_data(data_dev, source);
916 wl_data_offer_add_listener(source->offer, &_ecore_wl_offer_listener, source);
917}
918
919static void
920_ecore_wl_cb_data_enter(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, struct wl_surface *surface, int32_t x, int32_t y, struct wl_data_offer *offer)
921{
922 Ecore_Wl_Dnd_Source *source;
923
924 if (!(source = wl_data_device_get_user_data(data_dev))) return;
925
926 /* TODO: maybe set pointer focus here ?? */
927
928 source->timestamp = timestamp;
929}
930
931static void
932_ecore_wl_cb_data_leave(void *data __UNUSED__, struct wl_data_device *data_dev)
933{
934 Ecore_Wl_Dnd_Source *source;
935
936 if (!(source = wl_data_device_get_user_data(data_dev))) return;
937
938 /* destroy drag offer */
939 wl_data_offer_destroy(source->offer);
940
941 while (eina_array_count(source->types))
942 free(eina_array_pop(source->types));
943
944 eina_array_free(source->types);
945 free(source);
946
947 wl_data_device_set_user_data(data_dev, NULL);
948}
949
950static void
951_ecore_wl_cb_data_motion(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, int32_t x, int32_t y)
952{
953 Ecore_Wl_Dnd_Source *source;
954
955 if (!(source = wl_data_device_get_user_data(data_dev))) return;
956 /* TODO: Here we should raise motion events for dragging */
957}
958
959static void
960_ecore_wl_cb_data_drop(void *data __UNUSED__, struct wl_data_device *data_dev)
961{
962 Ecore_Wl_Dnd_Source *source;
963
964 if (!(source = wl_data_device_get_user_data(data_dev))) return;
965
966 /* TODO: Raise event for drop */
967
968 wl_data_offer_accept(source->offer, source->timestamp, NULL);
969// eina_array_data_get(source->types, 0));
970}
971
972static void
973_ecore_wl_cb_data_selection(void *data, struct wl_data_device *data_dev, struct wl_data_offer *offer)
974{
975 Ecore_Wl_Dnd_Source *source;
976
977 printf("Ecore_Wl Data Selection\n");
978 if ((source = wl_data_device_get_user_data(data_dev)))
979 {
980 /* destroy old source */
981 wl_data_offer_destroy(source->offer);
982
983 while (eina_array_count(source->types))
984 free(eina_array_pop(source->types));
985
986 eina_array_free(source->types);
987 free(source);
988
989 wl_data_device_set_user_data(data_dev, NULL);
990 }
991}
992
993static void
994_ecore_wl_mouse_move_send(uint32_t timestamp)
995{
996 Ecore_Event_Mouse_Move *ev;
997
998// if (!_ecore_wl_input_surface) return;
999
1000 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Move)))) return;
1001
1002 ev->timestamp = timestamp;
1003 ev->x = _ecore_wl_surface_x;
1004 ev->y = _ecore_wl_surface_y;
1005 ev->root.x = _ecore_wl_screen_x;
1006 ev->root.y = _ecore_wl_screen_y;
1007 ev->modifiers = _ecore_wl_input_modifiers;
1008
1009 ev->multi.device = 0;
1010 ev->multi.radius = 1;
1011 ev->multi.radius_x = 1;
1012 ev->multi.radius_y = 1;
1013 ev->multi.pressure = 1.0;
1014 ev->multi.angle = 0.0;
1015 ev->multi.x = _ecore_wl_surface_x;
1016 ev->multi.y = _ecore_wl_surface_y;
1017 ev->multi.root.x = _ecore_wl_screen_x;
1018 ev->multi.root.y = _ecore_wl_screen_y;
1019
1020 {
1021 unsigned int id = 0;
1022
1023 if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_input_surface)))
1024 {
1025 ev->window = id;
1026 ev->event_window = id;
1027 }
1028 }
1029
1030 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
1031}
1032
1033static void
1034_ecore_wl_mouse_out_send(struct wl_surface *surface, uint32_t timestamp)
1035{
1036 Ecore_Wl_Event_Mouse_Out *ev;
1037
1038 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_Out)))) return;
1039
1040 ev->x = _ecore_wl_surface_x;
1041 ev->y = _ecore_wl_surface_y;
1042 ev->root.x = _ecore_wl_screen_x;
1043 ev->root.y = _ecore_wl_screen_y;
1044 ev->modifiers = _ecore_wl_input_modifiers;
1045 ev->time = timestamp;
1046
1047 if (surface)
1048 {
1049 unsigned int id = 0;
1050
1051 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1052 ev->window = id;
1053 }
1054
1055 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
1056}
1057
1058static void
1059_ecore_wl_mouse_in_send(struct wl_surface *surface, uint32_t timestamp)
1060{
1061 Ecore_Wl_Event_Mouse_In *ev;
1062
1063 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_In)))) return;
1064
1065 ev->x = _ecore_wl_surface_x;
1066 ev->y = _ecore_wl_surface_y;
1067 ev->root.x = _ecore_wl_screen_x;
1068 ev->root.y = _ecore_wl_screen_y;
1069 ev->modifiers = _ecore_wl_input_modifiers;
1070 ev->time = timestamp;
1071
1072 if (surface)
1073 {
1074 unsigned int id = 0;
1075
1076 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1077 ev->window = id;
1078 }
1079
1080 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
1081}
1082
1083static void
1084_ecore_wl_mouse_up_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp)
1085{
1086 Ecore_Event_Mouse_Button *ev;
1087
1088 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
1089
1090 if (button == BTN_LEFT)
1091 ev->buttons = 1;
1092 else if (button == BTN_MIDDLE)
1093 ev->buttons = 2;
1094 else if (button == BTN_RIGHT)
1095 ev->buttons = 3;
1096
1097 ev->timestamp = timestamp;
1098 ev->x = _ecore_wl_surface_x;
1099 ev->y = _ecore_wl_surface_y;
1100 ev->root.x = _ecore_wl_screen_x;
1101 ev->root.y = _ecore_wl_screen_y;
1102 ev->modifiers = _ecore_wl_input_modifiers;
1103
1104 /* FIXME: Need to get these from Wayland somehow */
1105 ev->double_click = 0;
1106 ev->triple_click = 0;
1107
1108 ev->multi.device = 0;
1109 ev->multi.radius = 1;
1110 ev->multi.radius_x = 1;
1111 ev->multi.radius_y = 1;
1112 ev->multi.pressure = 1.0;
1113 ev->multi.angle = 0.0;
1114 ev->multi.x = _ecore_wl_surface_x;
1115 ev->multi.y = _ecore_wl_surface_y;
1116 ev->multi.root.x = _ecore_wl_screen_x;
1117 ev->multi.root.y = _ecore_wl_screen_y;
1118
1119 {
1120 unsigned int id = 0;
1121
1122 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1123 {
1124 ev->window = id;
1125 ev->event_window = id;
1126 }
1127 }
1128
1129 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
1130}
1131
1132static void
1133_ecore_wl_mouse_down_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp)
1134{
1135 Ecore_Event_Mouse_Button *ev;
1136
1137 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
1138
1139 if (button == BTN_LEFT)
1140 ev->buttons = 1;
1141 else if (button == BTN_MIDDLE)
1142 ev->buttons = 2;
1143 else if (button == BTN_RIGHT)
1144 ev->buttons = 3;
1145
1146 ev->timestamp = timestamp;
1147 ev->x = _ecore_wl_surface_x;
1148 ev->y = _ecore_wl_surface_y;
1149 ev->root.x = _ecore_wl_screen_x;
1150 ev->root.y = _ecore_wl_screen_y;
1151 ev->modifiers = _ecore_wl_input_modifiers;
1152
1153 /* FIXME: Need to get these from Wayland somehow */
1154 ev->double_click = 0;
1155 ev->triple_click = 0;
1156
1157 ev->multi.device = 0;
1158 ev->multi.radius = 1;
1159 ev->multi.radius_x = 1;
1160 ev->multi.radius_y = 1;
1161 ev->multi.pressure = 1.0;
1162 ev->multi.angle = 0.0;
1163 ev->multi.x = _ecore_wl_surface_x;
1164 ev->multi.y = _ecore_wl_surface_y;
1165 ev->multi.root.x = _ecore_wl_screen_x;
1166 ev->multi.root.y = _ecore_wl_screen_y;
1167
1168 {
1169 unsigned int id = 0;
1170
1171 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1172 {
1173 ev->window = id;
1174 ev->event_window = id;
1175 }
1176 }
1177
1178 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
1179}
1180
1181static void
1182_ecore_wl_focus_out_send(struct wl_surface *surface, uint32_t timestamp)
1183{
1184 Ecore_Wl_Event_Focus_Out *ev;
1185
1186 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_Out)))) return;
1187 ev->time = timestamp;
1188 if (surface)
1189 {
1190 unsigned int id = 0;
1191
1192 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1193 ev->window = id;
1194 }
1195 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
1196}
1197
1198static void
1199_ecore_wl_focus_in_send(struct wl_surface *surface, uint32_t timestamp)
1200{
1201 Ecore_Wl_Event_Focus_In *ev;
1202
1203 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_In)))) return;
1204 ev->time = timestamp;
1205 if (surface)
1206 {
1207 unsigned int id = 0;
1208
1209 if ((id = (unsigned int)wl_surface_get_user_data(surface)))
1210 ev->window = id;
1211 }
1212 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
1213}
diff --git a/libraries/ecore/src/lib/ecore_wayland/ecore_wl_private.h b/libraries/ecore/src/lib/ecore_wayland/ecore_wl_private.h
new file mode 100644
index 0000000..eec5ffe
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_wayland/ecore_wl_private.h
@@ -0,0 +1,85 @@
1#ifndef _ECORE_WAYLAND_PRIVATE_H
2# define _ECORE_WAYLAND_PRIVATE_H
3
4# include <limits.h>
5
6//# define LOGFNS 1
7
8# ifdef LOGFNS
9# include <stdio.h>
10# define LOGFN(fl, ln, fn) printf("-ECORE-WL: %25s: %5i - %s\n", fl, ln, fn);
11# else
12# define LOGFN(fl, ln, fn)
13# endif
14
15extern int _ecore_wl_log_dom;
16
17# ifdef ECORE_WL_DEFAULT_LOG_COLOR
18# undef ECORE_WL_DEFAULT_LOG_COLOR
19# endif
20# define ECORE_WL_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
21
22# ifdef ERR
23# undef ERR
24# endif
25# define ERR(...) EINA_LOG_DOM_ERR(_ecore_wl_log_dom, __VA_ARGS__)
26
27# ifdef DBG
28# undef DBG
29# endif
30# define DBG(...) EINA_LOG_DOM_DBG(_ecore_wl_log_dom, __VA_ARGS__)
31
32# ifdef INF
33# undef INF
34# endif
35# define INF(...) EINA_LOG_DOM_INFO(_ecore_wl_log_dom, __VA_ARGS__)
36
37# ifdef WRN
38# undef WRN
39# endif
40# define WRN(...) EINA_LOG_DOM_WARN(_ecore_wl_log_dom, __VA_ARGS__)
41
42# ifdef CRIT
43# undef CRIT
44# endif
45# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
46
47typedef struct _Ecore_Wl_Dnd_Source
48{
49 struct wl_data_offer *offer;
50 int refs;
51
52 Eina_Array *types;
53
54 uint32_t timestamp;
55 void *data;
56} Ecore_Wl_Dnd_Source;
57
58typedef struct _Ecore_Wl_Dnd_Target
59{
60 /* NB: These are not the real fields for this structure,
61 * and it is Bound to change....soon */
62 struct wl_data_offer *offer;
63 int refs;
64
65 Eina_Array *types;
66
67 uint32_t timestamp;
68 void *data;
69} Ecore_Wl_Dnd_Target;
70
71struct _Ecore_Wl_Drag_Source
72{
73 struct wl_data_device *data_dev;
74 struct wl_buffer *buffer;
75
76 int32_t hotspot_x, hotspot_y;
77 int32_t offset_x, offset_y;
78 const char *mimetype;
79 uint32_t timestamp;
80 void *data;
81
82 struct wl_data_source *data_source;
83};
84
85#endif
diff --git a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h b/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h
index bdfb1c8..95e3749 100644
--- a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h
+++ b/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h
@@ -221,7 +221,7 @@ struct _Ecore_Win32_Event_Mouse_In
221 Ecore_Win32_Window *window; /**< The window that received the event */ 221 Ecore_Win32_Window *window; /**< The window that received the event */
222 int x; /**< The x coordinate where the mouse leaved */ 222 int x; /**< The x coordinate where the mouse leaved */
223 int y; /**< The y coordinate where the mouse entered */ 223 int y; /**< The y coordinate where the mouse entered */
224 long time; /**< The time the event occurred */ 224 unsigned long timestamp; /**< The time the event occurred */
225}; 225};
226 226
227/** 227/**
@@ -233,7 +233,7 @@ struct _Ecore_Win32_Event_Mouse_Out
233 Ecore_Win32_Window *window; /**< The window that received the event */ 233 Ecore_Win32_Window *window; /**< The window that received the event */
234 int x; /**< The x coordinate where the mouse leaved */ 234 int x; /**< The x coordinate where the mouse leaved */
235 int y; /**< The y coordinate where the mouse leaved */ 235 int y; /**< The y coordinate where the mouse leaved */
236 long time; /**< The time the event occurred */ 236 unsigned long timestamp; /**< The time the event occurred */
237}; 237};
238 238
239/** 239/**
@@ -243,7 +243,7 @@ struct _Ecore_Win32_Event_Mouse_Out
243struct _Ecore_Win32_Event_Window_Focus_In 243struct _Ecore_Win32_Event_Window_Focus_In
244{ 244{
245 Ecore_Win32_Window *window; /**< The window that received the event */ 245 Ecore_Win32_Window *window; /**< The window that received the event */
246 long long time; /**< The time the event occurred */ 246 unsigned long timestamp; /**< The time the event occurred */
247}; 247};
248 248
249/** 249/**
@@ -253,7 +253,7 @@ struct _Ecore_Win32_Event_Window_Focus_In
253struct _Ecore_Win32_Event_Window_Focus_Out 253struct _Ecore_Win32_Event_Window_Focus_Out
254{ 254{
255 Ecore_Win32_Window *window; /**< The window that received the event */ 255 Ecore_Win32_Window *window; /**< The window that received the event */
256 long time; /**< The time the event occurred */ 256 unsigned long timestamp; /**< The time the event occurred */
257}; 257};
258 258
259/** 259/**
@@ -267,7 +267,7 @@ struct _Ecore_Win32_Event_Window_Damage
267 int y; /**< The y coordinate of the top left corner of the damaged region */ 267 int y; /**< The y coordinate of the top left corner of the damaged region */
268 int width; /**< The width of the damaged region */ 268 int width; /**< The width of the damaged region */
269 int height; /**< The time the event occurred */ 269 int height; /**< The time the event occurred */
270 long time; /**< The time the event occurred */ 270 unsigned long timestamp; /**< The time the event occurred */
271}; 271};
272 272
273/** 273/**
@@ -277,7 +277,7 @@ struct _Ecore_Win32_Event_Window_Damage
277struct _Ecore_Win32_Event_Window_Create 277struct _Ecore_Win32_Event_Window_Create
278{ 278{
279 Ecore_Win32_Window *window; /**< The window that received the event */ 279 Ecore_Win32_Window *window; /**< The window that received the event */
280 long time; /**< The time the event occurred */ 280 unsigned long timestamp; /**< The time the event occurred */
281}; 281};
282 282
283/** 283/**
@@ -287,7 +287,7 @@ struct _Ecore_Win32_Event_Window_Create
287struct _Ecore_Win32_Event_Window_Destroy 287struct _Ecore_Win32_Event_Window_Destroy
288{ 288{
289 Ecore_Win32_Window *window; /**< The window that received the event */ 289 Ecore_Win32_Window *window; /**< The window that received the event */
290 long time; /**< The time the event occurred */ 290 unsigned long timestamp; /**< The time the event occurred */
291}; 291};
292 292
293/** 293/**
@@ -297,7 +297,7 @@ struct _Ecore_Win32_Event_Window_Destroy
297struct _Ecore_Win32_Event_Window_Hide 297struct _Ecore_Win32_Event_Window_Hide
298{ 298{
299 Ecore_Win32_Window *window; /**< The window that received the event */ 299 Ecore_Win32_Window *window; /**< The window that received the event */
300 long time; /**< The time the event occurred */ 300 unsigned long timestamp; /**< The time the event occurred */
301}; 301};
302 302
303/** 303/**
@@ -307,7 +307,7 @@ struct _Ecore_Win32_Event_Window_Hide
307struct _Ecore_Win32_Event_Window_Show 307struct _Ecore_Win32_Event_Window_Show
308{ 308{
309 Ecore_Win32_Window *window; /**< The window that received the event */ 309 Ecore_Win32_Window *window; /**< The window that received the event */
310 long time; /**< The time the event occurred */ 310 unsigned long timestamp; /**< The time the event occurred */
311}; 311};
312 312
313/** 313/**
@@ -322,7 +322,7 @@ struct _Ecore_Win32_Event_Window_Configure
322 int y; /**< The new y coordinate of the top left corner */ 322 int y; /**< The new y coordinate of the top left corner */
323 int width; /**< The new width */ 323 int width; /**< The new width */
324 int height; /**< The new height */ 324 int height; /**< The new height */
325 long time; /**< The time the event occurred */ 325 unsigned long timestamp; /**< The time the event occurred */
326}; 326};
327 327
328/** 328/**
@@ -334,7 +334,7 @@ struct _Ecore_Win32_Event_Window_Resize
334 Ecore_Win32_Window *window; /**< The window that received the event */ 334 Ecore_Win32_Window *window; /**< The window that received the event */
335 int width; /**< The new width */ 335 int width; /**< The new width */
336 int height; /**< The new height */ 336 int height; /**< The new height */
337 long time; /**< The time the event occurred */ 337 unsigned long timestamp; /**< The time the event occurred */
338}; 338};
339 339
340/** 340/**
@@ -344,7 +344,7 @@ struct _Ecore_Win32_Event_Window_Resize
344struct _Ecore_Win32_Event_Window_Delete_Request 344struct _Ecore_Win32_Event_Window_Delete_Request
345{ 345{
346 Ecore_Win32_Window *window; /**< The window that received the event */ 346 Ecore_Win32_Window *window; /**< The window that received the event */
347 long time; /**< The time the event occurred */ 347 unsigned long timestamp; /**< The time the event occurred */
348}; 348};
349 349
350/** 350/**
@@ -369,12 +369,12 @@ EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for th
369 369
370/* Core */ 370/* Core */
371 371
372EAPI int ecore_win32_init(); 372EAPI int ecore_win32_init();
373EAPI int ecore_win32_shutdown(); 373EAPI int ecore_win32_shutdown();
374EAPI int ecore_win32_screen_depth_get(); 374EAPI int ecore_win32_screen_depth_get();
375EAPI void ecore_win32_double_click_time_set(double t); 375EAPI void ecore_win32_double_click_time_set(double t);
376EAPI double ecore_win32_double_click_time_get(void); 376EAPI double ecore_win32_double_click_time_get(void);
377EAPI long ecore_win32_current_time_get(void); 377EAPI unsigned long ecore_win32_current_time_get(void);
378 378
379/* Window */ 379/* Window */
380 380
diff --git a/libraries/ecore/src/lib/ecore_win32/Makefile.in b/libraries/ecore/src/lib/ecore_win32/Makefile.in
index 4e4f363..9994ee7 100644
--- a/libraries/ecore/src/lib/ecore_win32/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_win32/Makefile.in
@@ -268,10 +268,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
268PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 268PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
269PIXMAN_LIBS = @PIXMAN_LIBS@ 269PIXMAN_LIBS = @PIXMAN_LIBS@
270PKG_CONFIG = @PKG_CONFIG@ 270PKG_CONFIG = @PKG_CONFIG@
271PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
272PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
273POSUB = @POSUB@ 271POSUB = @POSUB@
274RANLIB = @RANLIB@ 272RANLIB = @RANLIB@
273SCIM_CFLAGS = @SCIM_CFLAGS@
274SCIM_LIBS = @SCIM_LIBS@
275SDL_CFLAGS = @SDL_CFLAGS@ 275SDL_CFLAGS = @SDL_CFLAGS@
276SDL_CONFIG = @SDL_CONFIG@ 276SDL_CONFIG = @SDL_CONFIG@
277SDL_LIBS = @SDL_LIBS@ 277SDL_LIBS = @SDL_LIBS@
@@ -290,6 +290,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
290USE_NLS = @USE_NLS@ 290USE_NLS = @USE_NLS@
291VERSION = @VERSION@ 291VERSION = @VERSION@
292VMAJ = @VMAJ@ 292VMAJ = @VMAJ@
293WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
294WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
295WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
296WAYLAND_LIBS = @WAYLAND_LIBS@
293WIN32_CFLAGS = @WIN32_CFLAGS@ 297WIN32_CFLAGS = @WIN32_CFLAGS@
294WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 298WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
295WIN32_LIBS = @WIN32_LIBS@ 299WIN32_LIBS = @WIN32_LIBS@
@@ -403,6 +407,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
403ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 407ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
404ecore_imf_evas_libs = @ecore_imf_evas_libs@ 408ecore_imf_evas_libs = @ecore_imf_evas_libs@
405ecore_imf_libs = @ecore_imf_libs@ 409ecore_imf_libs = @ecore_imf_libs@
410ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
411ecore_imf_scim_libs = @ecore_imf_scim_libs@
406ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 412ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
407ecore_imf_xim_libs = @ecore_imf_xim_libs@ 413ecore_imf_xim_libs = @ecore_imf_xim_libs@
408ecore_input_cflags = @ecore_input_cflags@ 414ecore_input_cflags = @ecore_input_cflags@
@@ -415,6 +421,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
415ecore_psl1ght_libs = @ecore_psl1ght_libs@ 421ecore_psl1ght_libs = @ecore_psl1ght_libs@
416ecore_sdl_cflags = @ecore_sdl_cflags@ 422ecore_sdl_cflags = @ecore_sdl_cflags@
417ecore_sdl_libs = @ecore_sdl_libs@ 423ecore_sdl_libs = @ecore_sdl_libs@
424ecore_wayland_cflags = @ecore_wayland_cflags@
425ecore_wayland_libs = @ecore_wayland_libs@
418ecore_win32_cflags = @ecore_win32_cflags@ 426ecore_win32_cflags = @ecore_win32_cflags@
419ecore_win32_libs = @ecore_win32_libs@ 427ecore_win32_libs = @ecore_win32_libs@
420ecore_wince_cflags = @ecore_wince_cflags@ 428ecore_wince_cflags = @ecore_wince_cflags@
@@ -459,12 +467,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
459requirements_ecore_file = @requirements_ecore_file@ 467requirements_ecore_file = @requirements_ecore_file@
460requirements_ecore_imf = @requirements_ecore_imf@ 468requirements_ecore_imf = @requirements_ecore_imf@
461requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 469requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
470requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
462requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 471requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
463requirements_ecore_input = @requirements_ecore_input@ 472requirements_ecore_input = @requirements_ecore_input@
464requirements_ecore_input_evas = @requirements_ecore_input_evas@ 473requirements_ecore_input_evas = @requirements_ecore_input_evas@
465requirements_ecore_ipc = @requirements_ecore_ipc@ 474requirements_ecore_ipc = @requirements_ecore_ipc@
466requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 475requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
467requirements_ecore_sdl = @requirements_ecore_sdl@ 476requirements_ecore_sdl = @requirements_ecore_sdl@
477requirements_ecore_wayland = @requirements_ecore_wayland@
468requirements_ecore_win32 = @requirements_ecore_win32@ 478requirements_ecore_win32 = @requirements_ecore_win32@
469requirements_ecore_wince = @requirements_ecore_wince@ 479requirements_ecore_wince = @requirements_ecore_wince@
470requirements_ecore_x = @requirements_ecore_x@ 480requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
index 19ca3ed..b571d74 100644
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
+++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
@@ -73,18 +73,44 @@ _ecore_win32_window_procedure(HWND window,
73 data->message = message; 73 data->message = message;
74 data->window_param = window_param; 74 data->window_param = window_param;
75 data->data_param = data_param; 75 data->data_param = data_param;
76 data->time = GetMessageTime(); 76 data->timestamp = GetMessageTime();
77 coord = GetMessagePos(); 77 coord = GetMessagePos();
78 point = MAKEPOINTS(coord); 78 point = MAKEPOINTS(coord);
79 data->x = point.x; 79 data->x = point.x;
80 data->y = point.y; 80 data->y = point.y;
81 data->discard_ctrl = EINA_FALSE;
81 82
82 switch (data->message) 83 switch (data->message)
83 { 84 {
84 /* Keyboard input notifications */ 85 /* Keyboard input notifications */
85 case WM_KEYDOWN: 86 case WM_KEYDOWN:
86 case WM_SYSKEYDOWN: 87 case WM_SYSKEYDOWN:
87 INF("keydown message"); 88 if ((data->message == WM_KEYDOWN) &&
89 (data->window_param == VK_CONTROL) &&
90 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
91 {
92 /* Ctrl left key is pressed */
93 BOOL res;
94 MSG next_msg;
95
96 /*
97 * we check if the next message
98 * - is a WM_KEYDOWN
99 * - has the same timestamp than the Ctrl one
100 * - is the key press of the right Alt key
101 */
102 res = PeekMessage(&next_msg, data->window,
103 WM_KEYDOWN, WM_KEYDOWN,
104 PM_NOREMOVE);
105 if (res &&
106 (next_msg.wParam == VK_MENU) &&
107 (next_msg.time == data->timestamp) &&
108 (HIWORD(next_msg.lParam) & KF_EXTENDED))
109 {
110 INF("discard left Ctrl key press (sent by AltGr key press)");
111 data->discard_ctrl = EINA_TRUE;
112 }
113 }
88 _ecore_win32_event_handle_key_press(data, 1); 114 _ecore_win32_event_handle_key_press(data, 1);
89 return 0; 115 return 0;
90 case WM_CHAR: 116 case WM_CHAR:
@@ -95,6 +121,33 @@ _ecore_win32_window_procedure(HWND window,
95 case WM_KEYUP: 121 case WM_KEYUP:
96 case WM_SYSKEYUP: 122 case WM_SYSKEYUP:
97 INF("keyup message"); 123 INF("keyup message");
124 if ((data->window_param == VK_CONTROL) &&
125 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
126 {
127 /* Ctrl left key is pressed */
128 BOOL res;
129 MSG next_msg;
130
131 /*
132 * we check if the next message
133 * - is a WM_KEYUP or WM_SYSKEYUP
134 * - has the same timestamp than the Ctrl one
135 * - is the key release of the right Alt key
136 */
137 res = PeekMessage(&next_msg, data->window,
138 WM_KEYUP, WM_SYSKEYUP,
139 PM_NOREMOVE);
140 if (res &&
141 ((next_msg.message == WM_KEYUP) ||
142 (next_msg.message == WM_SYSKEYUP)) &&
143 (next_msg.wParam == VK_MENU) &&
144 (next_msg.time == data->timestamp) &&
145 (HIWORD(next_msg.lParam) & KF_EXTENDED))
146 {
147 INF("discard left Ctrl key release (sent by AltGr key release)");
148 data->discard_ctrl = EINA_TRUE;
149 }
150 }
98 _ecore_win32_event_handle_key_release(data); 151 _ecore_win32_event_handle_key_release(data);
99 return 0; 152 return 0;
100 case WM_SETFOCUS: 153 case WM_SETFOCUS:
@@ -492,7 +545,7 @@ _ecore_win32_window_procedure(HWND window,
492 545
493HINSTANCE _ecore_win32_instance = NULL; 546HINSTANCE _ecore_win32_instance = NULL;
494double _ecore_win32_double_click_time = 0.25; 547double _ecore_win32_double_click_time = 0.25;
495long _ecore_win32_event_last_time = 0; 548unsigned long _ecore_win32_event_last_time = 0;
496Ecore_Win32_Window *_ecore_win32_event_last_window = NULL; 549Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
497int _ecore_win32_log_dom_global = -1; 550int _ecore_win32_log_dom_global = -1;
498 551
@@ -777,7 +830,7 @@ ecore_win32_double_click_time_get(void)
777 * 830 *
778 * This function returns the last event time. 831 * This function returns the last event time.
779 */ 832 */
780EAPI long 833EAPI unsigned long
781ecore_win32_current_time_get(void) 834ecore_win32_current_time_get(void)
782{ 835{
783 return _ecore_win32_event_last_time; 836 return _ecore_win32_event_last_time;
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c
index 63356d3..388776c 100644
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c
+++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c
@@ -45,18 +45,18 @@ static void _ecore_win32_event_free_key_down(void *data,
45static void _ecore_win32_event_free_key_up(void *data, 45static void _ecore_win32_event_free_key_up(void *data,
46 void *ev); 46 void *ev);
47 47
48static int _ecore_win32_event_keystroke_get(int key, 48static int _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
49 int is_extended, 49 Eina_Bool is_down,
50 Eina_Bool is_down, 50 char **keyname,
51 char **keyname, 51 char **keysymbol,
52 char **keysymbol, 52 char **keycompose,
53 char **keycompose, 53 unsigned int *modifiers);
54 unsigned int *modifiers);
55 54
56static int _ecore_win32_event_char_get(int key, 55static int _ecore_win32_event_char_get(int key,
57 char **keyname, 56 char **keyname,
58 char **keysymbol, 57 char **keysymbol,
59 char **keycompose); 58 char **keycompose,
59 unsigned int *modifiers);
60 60
61 61
62/***** Global functions definitions *****/ 62/***** Global functions definitions *****/
@@ -74,8 +74,7 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg,
74 74
75 if (is_keystroke) 75 if (is_keystroke)
76 { 76 {
77 if (!_ecore_win32_event_keystroke_get(msg->window_param, 77 if (!_ecore_win32_event_keystroke_get(msg,
78 msg->data_param & 0x01000000,
79 EINA_TRUE, 78 EINA_TRUE,
80 (char **)&e->keyname, 79 (char **)&e->keyname,
81 (char **)&e->key, 80 (char **)&e->key,
@@ -91,7 +90,8 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg,
91 if (!_ecore_win32_event_char_get(LOWORD(msg->window_param), 90 if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
92 (char **)&e->keyname, 91 (char **)&e->keyname,
93 (char **)&e->key, 92 (char **)&e->key,
94 (char **)&e->string)) 93 (char **)&e->string,
94 &e->modifiers))
95 { 95 {
96 free(e); 96 free(e);
97 return; 97 return;
@@ -105,7 +105,7 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg,
105 return; 105 return;
106 } 106 }
107 e->event_window = e->window; 107 e->event_window = e->window;
108 e->timestamp = msg->time; 108 e->timestamp = msg->timestamp;
109 109
110 _ecore_win32_event_last_time = e->timestamp; 110 _ecore_win32_event_last_time = e->timestamp;
111 111
@@ -122,18 +122,19 @@ _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg)
122 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key)); 122 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
123 if (!e) return; 123 if (!e) return;
124 124
125 if (!_ecore_win32_event_keystroke_get(LOWORD(msg->window_param), 125 if (!_ecore_win32_event_keystroke_get(msg,
126 msg->data_param & 0x01000000,
127 EINA_FALSE, 126 EINA_FALSE,
128 (char **)&e->keyname, 127 (char **)&e->keyname,
129 (char **)&e->key, 128 (char **)&e->key,
130 (char **)&e->string, 129 (char **)&e->string,
131 &e->modifiers)) 130 &e->modifiers))
132 { 131 {
133 if (!_ecore_win32_event_char_get(LOWORD(msg->window_param), 132 if (msg->discard_ctrl ||
133 !_ecore_win32_event_char_get(LOWORD(msg->window_param),
134 (char **)&e->keyname, 134 (char **)&e->keyname,
135 (char **)&e->key, 135 (char **)&e->key,
136 (char **)&e->string)) 136 (char **)&e->string,
137 &e->modifiers))
137 { 138 {
138 free(e); 139 free(e);
139 return; 140 return;
@@ -147,7 +148,7 @@ _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg)
147 return; 148 return;
148 } 149 }
149 e->event_window = e->window; 150 e->event_window = e->window;
150 e->timestamp = msg->time; 151 e->timestamp = msg->timestamp;
151 152
152 _ecore_win32_event_last_time = e->timestamp; 153 _ecore_win32_event_last_time = e->timestamp;
153 154
@@ -178,7 +179,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
178 e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1; 179 e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1;
179 e->x = GET_X_LPARAM(msg->data_param); 180 e->x = GET_X_LPARAM(msg->data_param);
180 e->y = GET_Y_LPARAM(msg->data_param); 181 e->y = GET_Y_LPARAM(msg->data_param);
181 e->timestamp = msg->time; 182 e->timestamp = msg->timestamp;
182 183
183 _ecore_win32_event_last_time = e->timestamp; 184 _ecore_win32_event_last_time = e->timestamp;
184 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window; 185 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
@@ -197,7 +198,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
197 e->event_window = e->window; 198 e->event_window = e->window;
198 e->x = GET_X_LPARAM(msg->data_param); 199 e->x = GET_X_LPARAM(msg->data_param);
199 e->y = GET_Y_LPARAM(msg->data_param); 200 e->y = GET_Y_LPARAM(msg->data_param);
200 e->timestamp = msg->time; 201 e->timestamp = msg->timestamp;
201 202
202 _ecore_win32_event_last_time = e->timestamp; 203 _ecore_win32_event_last_time = e->timestamp;
203 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window; 204 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
@@ -224,7 +225,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
224 e->buttons = button; 225 e->buttons = button;
225 e->x = GET_X_LPARAM(msg->data_param); 226 e->x = GET_X_LPARAM(msg->data_param);
226 e->y = GET_Y_LPARAM(msg->data_param); 227 e->y = GET_Y_LPARAM(msg->data_param);
227 e->timestamp = msg->time; 228 e->timestamp = msg->timestamp;
228 229
229 if (((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) && 230 if (((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) &&
230 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window)) 231 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window))
@@ -279,7 +280,7 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
279 e->event_window = e->window; 280 e->event_window = e->window;
280 e->x = GET_X_LPARAM(msg->data_param); 281 e->x = GET_X_LPARAM(msg->data_param);
281 e->y = GET_Y_LPARAM(msg->data_param); 282 e->y = GET_Y_LPARAM(msg->data_param);
282 e->timestamp = msg->time; 283 e->timestamp = msg->timestamp;
283 284
284 _ecore_win32_event_last_time = e->timestamp; 285 _ecore_win32_event_last_time = e->timestamp;
285 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window; 286 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
@@ -298,7 +299,7 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
298 e->buttons = button; 299 e->buttons = button;
299 e->x = GET_X_LPARAM(msg->data_param); 300 e->x = GET_X_LPARAM(msg->data_param);
300 e->y = GET_Y_LPARAM(msg->data_param); 301 e->y = GET_Y_LPARAM(msg->data_param);
301 e->timestamp = msg->time; 302 e->timestamp = msg->timestamp;
302 303
303 _ecore_win32_mouse_up_count++; 304 _ecore_win32_mouse_up_count++;
304 305
@@ -334,7 +335,7 @@ _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg)
334 e->event_window = e->window; 335 e->event_window = e->window;
335 e->x = GET_X_LPARAM(msg->data_param); 336 e->x = GET_X_LPARAM(msg->data_param);
336 e->y = GET_Y_LPARAM(msg->data_param); 337 e->y = GET_Y_LPARAM(msg->data_param);
337 e->timestamp = msg->time; 338 e->timestamp = msg->timestamp;
338 339
339 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL); 340 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
340} 341}
@@ -354,7 +355,7 @@ _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg)
354 e->event_window = e->window; 355 e->event_window = e->window;
355 e->x = msg->x; 356 e->x = msg->x;
356 e->y = msg->y; 357 e->y = msg->y;
357 e->timestamp = msg->time; 358 e->timestamp = msg->timestamp;
358 359
359 _ecore_win32_event_last_time = e->timestamp; 360 _ecore_win32_event_last_time = e->timestamp;
360 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window; 361 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
@@ -371,9 +372,9 @@ _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg)
371 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 372 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
372 e->x = msg->x; 373 e->x = msg->x;
373 e->y = msg->y; 374 e->y = msg->y;
374 e->time = msg->time ; 375 e->timestamp = msg->timestamp ;
375 376
376 _ecore_win32_event_last_time = e->time; 377 _ecore_win32_event_last_time = e->timestamp;
377 378
378 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_IN, e, NULL, NULL); 379 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_IN, e, NULL, NULL);
379 } 380 }
@@ -394,7 +395,7 @@ _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
394 e->event_window = e->window; 395 e->event_window = e->window;
395 e->x = msg->x; 396 e->x = msg->x;
396 e->y = msg->y; 397 e->y = msg->y;
397 e->timestamp = msg->time; 398 e->timestamp = msg->timestamp;
398 399
399 _ecore_win32_event_last_time = e->timestamp; 400 _ecore_win32_event_last_time = e->timestamp;
400 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window; 401 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
@@ -411,9 +412,9 @@ _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
411 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 412 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
412 e->x = msg->x; 413 e->x = msg->x;
413 e->y = msg->y; 414 e->y = msg->y;
414 e->time = msg->time; 415 e->timestamp = msg->timestamp;
415 416
416 _ecore_win32_event_last_time = e->time; 417 _ecore_win32_event_last_time = e->timestamp;
417 418
418 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL); 419 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL);
419 } 420 }
@@ -431,8 +432,8 @@ _ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg)
431 432
432 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 433 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
433 434
434 e->time = _ecore_win32_event_last_time; 435 e->timestamp = _ecore_win32_event_last_time;
435 _ecore_win32_event_last_time = e->time; 436 _ecore_win32_event_last_time = e->timestamp;
436 437
437 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL); 438 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
438} 439}
@@ -449,8 +450,8 @@ _ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg)
449 450
450 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 451 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
451 452
452 e->time = _ecore_win32_event_last_time; 453 e->timestamp = _ecore_win32_event_last_time;
453 _ecore_win32_event_last_time = e->time; 454 _ecore_win32_event_last_time = e->timestamp;
454 455
455 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL); 456 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
456} 457}
@@ -472,7 +473,7 @@ _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg)
472 e->width = msg->update.right - msg->update.left; 473 e->width = msg->update.right - msg->update.left;
473 e->height = msg->update.bottom - msg->update.top; 474 e->height = msg->update.bottom - msg->update.top;
474 475
475 e->time = _ecore_win32_event_last_time; 476 e->timestamp = _ecore_win32_event_last_time;
476 477
477 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DAMAGE, e, NULL, NULL); 478 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
478} 479}
@@ -489,7 +490,7 @@ _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg)
489 490
490 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 491 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
491 492
492 e->time = _ecore_win32_event_last_time; 493 e->timestamp = _ecore_win32_event_last_time;
493 494
494 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CREATE, e, NULL, NULL); 495 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CREATE, e, NULL, NULL);
495} 496}
@@ -506,7 +507,7 @@ _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg)
506 507
507 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 508 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
508 509
509 e->time = _ecore_win32_event_last_time; 510 e->timestamp = _ecore_win32_event_last_time;
510 if (e->window == _ecore_win32_event_last_window) _ecore_win32_event_last_window = NULL; 511 if (e->window == _ecore_win32_event_last_window) _ecore_win32_event_last_window = NULL;
511 512
512 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DESTROY, e, NULL, NULL); 513 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DESTROY, e, NULL, NULL);
@@ -524,7 +525,7 @@ _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg)
524 525
525 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 526 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
526 527
527 e->time = _ecore_win32_event_last_time; 528 e->timestamp = _ecore_win32_event_last_time;
528 529
529 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_SHOW, e, NULL, NULL); 530 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_SHOW, e, NULL, NULL);
530} 531}
@@ -541,7 +542,7 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
541 542
542 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 543 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
543 544
544 e->time = _ecore_win32_event_last_time; 545 e->timestamp = _ecore_win32_event_last_time;
545 546
546 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_HIDE, e, NULL, NULL); 547 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_HIDE, e, NULL, NULL);
547} 548}
@@ -572,7 +573,7 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
572 e->y = wi.rcClient.top; 573 e->y = wi.rcClient.top;
573 e->width = wi.rcClient.right - wi.rcClient.left; 574 e->width = wi.rcClient.right - wi.rcClient.left;
574 e->height = wi.rcClient.bottom - wi.rcClient.top; 575 e->height = wi.rcClient.bottom - wi.rcClient.top;
575 e->time = _ecore_win32_event_last_time; 576 e->timestamp = _ecore_win32_event_last_time;
576 577
577 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL); 578 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
578} 579}
@@ -594,7 +595,7 @@ _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg)
594 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 595 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
595 e->width = rect.right - rect.left; 596 e->width = rect.right - rect.left;
596 e->height = rect.bottom - rect.top; 597 e->height = rect.bottom - rect.top;
597 e->time = _ecore_win32_event_last_time; 598 e->timestamp = _ecore_win32_event_last_time;
598 599
599 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_RESIZE, e, NULL, NULL); 600 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_RESIZE, e, NULL, NULL);
600} 601}
@@ -610,7 +611,7 @@ _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg)
610 if (!e) return; 611 if (!e) return;
611 612
612 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 613 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
613 e->time = _ecore_win32_event_last_time; 614 e->timestamp = _ecore_win32_event_last_time;
614 615
615 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL); 616 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
616} 617}
@@ -645,24 +646,28 @@ _ecore_win32_event_free_key_up(void *data __UNUSED__,
645} 646}
646 647
647static int 648static int
648_ecore_win32_event_keystroke_get(int key, 649_ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
649 int is_extended,
650 Eina_Bool is_down, 650 Eina_Bool is_down,
651 char **keyname, 651 char **keyname,
652 char **keysymbol, 652 char **keysymbol,
653 char **keycompose, 653 char **keycompose,
654 unsigned int *modifiers) 654 unsigned int *modifiers)
655{ 655{
656 WCHAR buf[3];
657 char delete_string[2] = { 0x7f, 0 };
656 char *kn = NULL; 658 char *kn = NULL;
657 char *ks = NULL; 659 char *ks = NULL;
658 char *kc = NULL; 660 char *kc = NULL;
661 int key;
662 int is_extended;
663
664 key = msg->window_param;
665 is_extended = msg->data_param & 0x01000000;
659 666
660 *keyname = NULL; 667 *keyname = NULL;
661 *keysymbol = NULL; 668 *keysymbol = NULL;
662 *keycompose = NULL; 669 *keycompose = NULL;
663 670
664
665 printf("vk key 0x%x\n", key);
666 switch (key) 671 switch (key)
667 { 672 {
668 /* Keystroke */ 673 /* Keystroke */
@@ -751,7 +756,6 @@ _ecore_win32_event_keystroke_get(int key,
751 } 756 }
752 break; 757 break;
753 case VK_RIGHT: 758 case VK_RIGHT:
754 printf("vk val 0x%x (right)\n", VK_RIGHT);
755 if (is_extended) 759 if (is_extended)
756 { 760 {
757 kn = "Right"; 761 kn = "Right";
@@ -798,8 +802,7 @@ _ecore_win32_event_keystroke_get(int key,
798 { 802 {
799 kn = "Delete"; 803 kn = "Delete";
800 ks = "Delete"; 804 ks = "Delete";
801 /* FIXME: kc is wrong, here */ 805 kc = delete_string;
802 kc = "Delete";
803 } 806 }
804 else 807 else
805 { 808 {
@@ -830,7 +833,7 @@ _ecore_win32_event_keystroke_get(int key,
830 ks = "Shift_R"; 833 ks = "Shift_R";
831 kc = ""; 834 kc = "";
832 } 835 }
833 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT; 836 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
834 } 837 }
835 else /* is_up */ 838 else /* is_up */
836 { 839 {
@@ -852,7 +855,7 @@ _ecore_win32_event_keystroke_get(int key,
852 kc = ""; 855 kc = "";
853 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RSHIFT; 856 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RSHIFT;
854 } 857 }
855 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT; 858 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
856 } 859 }
857 break; 860 break;
858 } 861 }
@@ -860,6 +863,9 @@ _ecore_win32_event_keystroke_get(int key,
860 { 863 {
861 SHORT res; 864 SHORT res;
862 865
866 if (msg->discard_ctrl)
867 return 0;
868
863 if (is_down) 869 if (is_down)
864 { 870 {
865 res = GetKeyState(VK_LCONTROL); 871 res = GetKeyState(VK_LCONTROL);
@@ -1113,11 +1119,53 @@ _ecore_win32_event_keystroke_get(int key,
1113 kc = ""; 1119 kc = "";
1114 break; 1120 break;
1115 default: 1121 default:
1116 /* other non keystroke characters */ 1122 {
1117 return 0; 1123 /* other non keystroke characters */
1124 BYTE kbd_state[256];
1125 int res;
1126
1127 if (is_down)
1128 return 0;
1129
1130 if (!GetKeyboardState(kbd_state))
1131 return 0;
1132
1133 res = ToUnicode(msg->window_param,
1134 MapVirtualKey(msg->window_param, 2),
1135 kbd_state, buf, 3, 0);
1136 if (res == 1)
1137 {
1138 /* FIXME: might be troublesome for non european languages */
1139 /* in that case, UNICODE should be used, I guess */
1140 buf[1] = '\0';
1141 kn = (char *)buf;
1142 ks = (char *)buf;
1143 kc = (char *)buf;
1144
1145 res = GetAsyncKeyState(VK_SHIFT);
1146 if (res & 0x8000)
1147 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
1148 else
1149 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
1150
1151 res = GetKeyState(VK_CONTROL);
1152 if (res & 0x8000)
1153 *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
1154 else
1155 *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
1156
1157 res = GetKeyState(VK_MENU);
1158 if (res & 0x8000)
1159 *modifiers |= ECORE_EVENT_MODIFIER_ALT;
1160 else
1161 *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
1162
1163 break;
1164 }
1165 return 0;
1166 }
1118 } 1167 }
1119 1168
1120 printf("sortie...\n");
1121 *keyname = strdup(kn); 1169 *keyname = strdup(kn);
1122 if (!*keyname) return 0; 1170 if (!*keyname) return 0;
1123 *keysymbol = strdup(ks); 1171 *keysymbol = strdup(ks);
@@ -1141,28 +1189,27 @@ _ecore_win32_event_keystroke_get(int key,
1141 return 0; 1189 return 0;
1142 } 1190 }
1143 } 1191 }
1144 printf("sortie 2 ...\n");
1145 1192
1146 return 1; 1193 return 1;
1147} 1194}
1148 1195
1149static int 1196static int
1150_ecore_win32_event_char_get(int key, 1197_ecore_win32_event_char_get(int key,
1151 char **keyname, 1198 char **keyname,
1152 char **keysymbol, 1199 char **keysymbol,
1153 char **keycompose) 1200 char **keycompose,
1201 unsigned int *modifiers)
1154{ 1202{
1155 char *kn = NULL; 1203 char *kn = NULL;
1156 char *ks = NULL; 1204 char *ks = NULL;
1157 char *kc = NULL; 1205 char *kc = NULL;
1158 char buf[2]; 1206 char buf[2];
1207 SHORT res;
1159 1208
1160 *keyname = NULL; 1209 *keyname = NULL;
1161 *keysymbol = NULL; 1210 *keysymbol = NULL;
1162 *keycompose = NULL; 1211 *keycompose = NULL;
1163 1212
1164 printf("char key 0x%x\n", key);
1165
1166 switch (key) 1213 switch (key)
1167 { 1214 {
1168 case VK_PROCESSKEY: 1215 case VK_PROCESSKEY:
@@ -1200,7 +1247,6 @@ _ecore_win32_event_char_get(int key,
1200 break; 1247 break;
1201 default: 1248 default:
1202 /* displayable characters */ 1249 /* displayable characters */
1203 printf (" * key : %d\n", key);
1204 buf[0] = key; 1250 buf[0] = key;
1205 buf[1] = '\0'; 1251 buf[1] = '\0';
1206 kn = buf; 1252 kn = buf;
@@ -1227,5 +1273,23 @@ _ecore_win32_event_char_get(int key,
1227 return 0; 1273 return 0;
1228 } 1274 }
1229 1275
1276 res = GetAsyncKeyState(VK_SHIFT);
1277 if (res & 0x8000)
1278 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
1279 else
1280 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
1281
1282 res = GetKeyState(VK_CONTROL);
1283 if (res & 0x8000)
1284 *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
1285 else
1286 *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
1287
1288 res = GetKeyState(VK_MENU);
1289 if (res & 0x8000)
1290 *modifiers |= ECORE_EVENT_MODIFIER_ALT;
1291 else
1292 *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
1293
1230 return 1; 1294 return 1;
1231} 1295}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h
index 4533169..ab54763 100644
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h
+++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h
@@ -49,14 +49,15 @@ typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
49 49
50struct _Ecore_Win32_Callback_Data 50struct _Ecore_Win32_Callback_Data
51{ 51{
52 RECT update; 52 RECT update;
53 HWND window; 53 HWND window;
54 unsigned int message; 54 unsigned int message;
55 WPARAM window_param; 55 WPARAM window_param;
56 LPARAM data_param; 56 LPARAM data_param;
57 long time; 57 unsigned long timestamp;
58 int x; 58 int x;
59 int y; 59 int y;
60 Eina_Bool discard_ctrl;
60}; 61};
61 62
62struct _Ecore_Win32_Window 63struct _Ecore_Win32_Window
@@ -130,7 +131,7 @@ struct _Ecore_Win32_Window
130 131
131extern HINSTANCE _ecore_win32_instance; 132extern HINSTANCE _ecore_win32_instance;
132extern double _ecore_win32_double_click_time; 133extern double _ecore_win32_double_click_time;
133extern long _ecore_win32_event_last_time; 134extern unsigned long _ecore_win32_event_last_time;
134extern Ecore_Win32_Window *_ecore_win32_event_last_window; 135extern Ecore_Win32_Window *_ecore_win32_event_last_window;
135 136
136 137
diff --git a/libraries/ecore/src/lib/ecore_wince/Makefile.in b/libraries/ecore/src/lib/ecore_wince/Makefile.in
index 0610122..d23bf51 100644
--- a/libraries/ecore/src/lib/ecore_wince/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_wince/Makefile.in
@@ -249,10 +249,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 249PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
250PIXMAN_LIBS = @PIXMAN_LIBS@ 250PIXMAN_LIBS = @PIXMAN_LIBS@
251PKG_CONFIG = @PKG_CONFIG@ 251PKG_CONFIG = @PKG_CONFIG@
252PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
253PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
254POSUB = @POSUB@ 252POSUB = @POSUB@
255RANLIB = @RANLIB@ 253RANLIB = @RANLIB@
254SCIM_CFLAGS = @SCIM_CFLAGS@
255SCIM_LIBS = @SCIM_LIBS@
256SDL_CFLAGS = @SDL_CFLAGS@ 256SDL_CFLAGS = @SDL_CFLAGS@
257SDL_CONFIG = @SDL_CONFIG@ 257SDL_CONFIG = @SDL_CONFIG@
258SDL_LIBS = @SDL_LIBS@ 258SDL_LIBS = @SDL_LIBS@
@@ -271,6 +271,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
271USE_NLS = @USE_NLS@ 271USE_NLS = @USE_NLS@
272VERSION = @VERSION@ 272VERSION = @VERSION@
273VMAJ = @VMAJ@ 273VMAJ = @VMAJ@
274WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
275WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
276WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
277WAYLAND_LIBS = @WAYLAND_LIBS@
274WIN32_CFLAGS = @WIN32_CFLAGS@ 278WIN32_CFLAGS = @WIN32_CFLAGS@
275WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 279WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
276WIN32_LIBS = @WIN32_LIBS@ 280WIN32_LIBS = @WIN32_LIBS@
@@ -384,6 +388,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
384ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 388ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
385ecore_imf_evas_libs = @ecore_imf_evas_libs@ 389ecore_imf_evas_libs = @ecore_imf_evas_libs@
386ecore_imf_libs = @ecore_imf_libs@ 390ecore_imf_libs = @ecore_imf_libs@
391ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
392ecore_imf_scim_libs = @ecore_imf_scim_libs@
387ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 393ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
388ecore_imf_xim_libs = @ecore_imf_xim_libs@ 394ecore_imf_xim_libs = @ecore_imf_xim_libs@
389ecore_input_cflags = @ecore_input_cflags@ 395ecore_input_cflags = @ecore_input_cflags@
@@ -396,6 +402,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
396ecore_psl1ght_libs = @ecore_psl1ght_libs@ 402ecore_psl1ght_libs = @ecore_psl1ght_libs@
397ecore_sdl_cflags = @ecore_sdl_cflags@ 403ecore_sdl_cflags = @ecore_sdl_cflags@
398ecore_sdl_libs = @ecore_sdl_libs@ 404ecore_sdl_libs = @ecore_sdl_libs@
405ecore_wayland_cflags = @ecore_wayland_cflags@
406ecore_wayland_libs = @ecore_wayland_libs@
399ecore_win32_cflags = @ecore_win32_cflags@ 407ecore_win32_cflags = @ecore_win32_cflags@
400ecore_win32_libs = @ecore_win32_libs@ 408ecore_win32_libs = @ecore_win32_libs@
401ecore_wince_cflags = @ecore_wince_cflags@ 409ecore_wince_cflags = @ecore_wince_cflags@
@@ -440,12 +448,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
440requirements_ecore_file = @requirements_ecore_file@ 448requirements_ecore_file = @requirements_ecore_file@
441requirements_ecore_imf = @requirements_ecore_imf@ 449requirements_ecore_imf = @requirements_ecore_imf@
442requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 450requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
451requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
443requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 452requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
444requirements_ecore_input = @requirements_ecore_input@ 453requirements_ecore_input = @requirements_ecore_input@
445requirements_ecore_input_evas = @requirements_ecore_input_evas@ 454requirements_ecore_input_evas = @requirements_ecore_input_evas@
446requirements_ecore_ipc = @requirements_ecore_ipc@ 455requirements_ecore_ipc = @requirements_ecore_ipc@
447requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 456requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
448requirements_ecore_sdl = @requirements_ecore_sdl@ 457requirements_ecore_sdl = @requirements_ecore_sdl@
458requirements_ecore_wayland = @requirements_ecore_wayland@
449requirements_ecore_win32 = @requirements_ecore_win32@ 459requirements_ecore_win32 = @requirements_ecore_win32@
450requirements_ecore_wince = @requirements_ecore_wince@ 460requirements_ecore_wince = @requirements_ecore_wince@
451requirements_ecore_x = @requirements_ecore_x@ 461requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_x/Ecore_X.h b/libraries/ecore/src/lib/ecore_x/Ecore_X.h
index 6588a75..b5d2c3f 100644
--- a/libraries/ecore/src/lib/ecore_x/Ecore_X.h
+++ b/libraries/ecore/src/lib/ecore_x/Ecore_X.h
@@ -1181,6 +1181,8 @@ EAPI int
1181 ecore_x_error_request_get(void); 1181 ecore_x_error_request_get(void);
1182EAPI int 1182EAPI int
1183 ecore_x_error_code_get(void); 1183 ecore_x_error_code_get(void);
1184EAPI Ecore_X_ID
1185ecore_x_error_resource_id_get(void);
1184 1186
1185EAPI void 1187EAPI void
1186ecore_x_event_mask_set(Ecore_X_Window w, 1188ecore_x_event_mask_set(Ecore_X_Window w,
@@ -3114,7 +3116,10 @@ EAPI Ecore_X_Randr_Edid_Display_Interface_Type
3114ecore_x_randr_edid_display_interface_type_get(unsigned char *edid, 3116ecore_x_randr_edid_display_interface_type_get(unsigned char *edid,
3115 unsigned long edid_length); 3117 unsigned long edid_length);
3116 3118
3117/* ecore_x_randr_13.c */ 3119/* ecore_x_randr_12.c */
3120
3121EAPI Eina_Bool
3122ecore_x_randr_output_backlight_available(void);
3118EAPI void 3123EAPI void
3119ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root, 3124ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root,
3120 double level); 3125 double level);
diff --git a/libraries/ecore/src/lib/ecore_x/Makefile.in b/libraries/ecore/src/lib/ecore_x/Makefile.in
index d5f4247..3b53cfe 100644
--- a/libraries/ecore/src/lib/ecore_x/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_x/Makefile.in
@@ -279,10 +279,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
279PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 279PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
280PIXMAN_LIBS = @PIXMAN_LIBS@ 280PIXMAN_LIBS = @PIXMAN_LIBS@
281PKG_CONFIG = @PKG_CONFIG@ 281PKG_CONFIG = @PKG_CONFIG@
282PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
283PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
284POSUB = @POSUB@ 282POSUB = @POSUB@
285RANLIB = @RANLIB@ 283RANLIB = @RANLIB@
284SCIM_CFLAGS = @SCIM_CFLAGS@
285SCIM_LIBS = @SCIM_LIBS@
286SDL_CFLAGS = @SDL_CFLAGS@ 286SDL_CFLAGS = @SDL_CFLAGS@
287SDL_CONFIG = @SDL_CONFIG@ 287SDL_CONFIG = @SDL_CONFIG@
288SDL_LIBS = @SDL_LIBS@ 288SDL_LIBS = @SDL_LIBS@
@@ -301,6 +301,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
301USE_NLS = @USE_NLS@ 301USE_NLS = @USE_NLS@
302VERSION = @VERSION@ 302VERSION = @VERSION@
303VMAJ = @VMAJ@ 303VMAJ = @VMAJ@
304WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
305WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
306WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
307WAYLAND_LIBS = @WAYLAND_LIBS@
304WIN32_CFLAGS = @WIN32_CFLAGS@ 308WIN32_CFLAGS = @WIN32_CFLAGS@
305WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 309WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
306WIN32_LIBS = @WIN32_LIBS@ 310WIN32_LIBS = @WIN32_LIBS@
@@ -414,6 +418,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
414ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 418ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
415ecore_imf_evas_libs = @ecore_imf_evas_libs@ 419ecore_imf_evas_libs = @ecore_imf_evas_libs@
416ecore_imf_libs = @ecore_imf_libs@ 420ecore_imf_libs = @ecore_imf_libs@
421ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
422ecore_imf_scim_libs = @ecore_imf_scim_libs@
417ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 423ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
418ecore_imf_xim_libs = @ecore_imf_xim_libs@ 424ecore_imf_xim_libs = @ecore_imf_xim_libs@
419ecore_input_cflags = @ecore_input_cflags@ 425ecore_input_cflags = @ecore_input_cflags@
@@ -426,6 +432,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
426ecore_psl1ght_libs = @ecore_psl1ght_libs@ 432ecore_psl1ght_libs = @ecore_psl1ght_libs@
427ecore_sdl_cflags = @ecore_sdl_cflags@ 433ecore_sdl_cflags = @ecore_sdl_cflags@
428ecore_sdl_libs = @ecore_sdl_libs@ 434ecore_sdl_libs = @ecore_sdl_libs@
435ecore_wayland_cflags = @ecore_wayland_cflags@
436ecore_wayland_libs = @ecore_wayland_libs@
429ecore_win32_cflags = @ecore_win32_cflags@ 437ecore_win32_cflags = @ecore_win32_cflags@
430ecore_win32_libs = @ecore_win32_libs@ 438ecore_win32_libs = @ecore_win32_libs@
431ecore_wince_cflags = @ecore_wince_cflags@ 439ecore_wince_cflags = @ecore_wince_cflags@
@@ -470,12 +478,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
470requirements_ecore_file = @requirements_ecore_file@ 478requirements_ecore_file = @requirements_ecore_file@
471requirements_ecore_imf = @requirements_ecore_imf@ 479requirements_ecore_imf = @requirements_ecore_imf@
472requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 480requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
481requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
473requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 482requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
474requirements_ecore_input = @requirements_ecore_input@ 483requirements_ecore_input = @requirements_ecore_input@
475requirements_ecore_input_evas = @requirements_ecore_input_evas@ 484requirements_ecore_input_evas = @requirements_ecore_input_evas@
476requirements_ecore_ipc = @requirements_ecore_ipc@ 485requirements_ecore_ipc = @requirements_ecore_ipc@
477requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 486requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
478requirements_ecore_sdl = @requirements_ecore_sdl@ 487requirements_ecore_sdl = @requirements_ecore_sdl@
488requirements_ecore_wayland = @requirements_ecore_wayland@
479requirements_ecore_win32 = @requirements_ecore_win32@ 489requirements_ecore_win32 = @requirements_ecore_win32@
480requirements_ecore_wince = @requirements_ecore_wince@ 490requirements_ecore_wince = @requirements_ecore_wince@
481requirements_ecore_x = @requirements_ecore_x@ 491requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in b/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
index 0213aea..9108f23 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_x/xcb/Makefile.in
@@ -261,10 +261,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
261PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 261PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
262PIXMAN_LIBS = @PIXMAN_LIBS@ 262PIXMAN_LIBS = @PIXMAN_LIBS@
263PKG_CONFIG = @PKG_CONFIG@ 263PKG_CONFIG = @PKG_CONFIG@
264PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
265PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
266POSUB = @POSUB@ 264POSUB = @POSUB@
267RANLIB = @RANLIB@ 265RANLIB = @RANLIB@
266SCIM_CFLAGS = @SCIM_CFLAGS@
267SCIM_LIBS = @SCIM_LIBS@
268SDL_CFLAGS = @SDL_CFLAGS@ 268SDL_CFLAGS = @SDL_CFLAGS@
269SDL_CONFIG = @SDL_CONFIG@ 269SDL_CONFIG = @SDL_CONFIG@
270SDL_LIBS = @SDL_LIBS@ 270SDL_LIBS = @SDL_LIBS@
@@ -283,6 +283,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
283USE_NLS = @USE_NLS@ 283USE_NLS = @USE_NLS@
284VERSION = @VERSION@ 284VERSION = @VERSION@
285VMAJ = @VMAJ@ 285VMAJ = @VMAJ@
286WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
287WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
288WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
289WAYLAND_LIBS = @WAYLAND_LIBS@
286WIN32_CFLAGS = @WIN32_CFLAGS@ 290WIN32_CFLAGS = @WIN32_CFLAGS@
287WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 291WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
288WIN32_LIBS = @WIN32_LIBS@ 292WIN32_LIBS = @WIN32_LIBS@
@@ -396,6 +400,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
396ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 400ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
397ecore_imf_evas_libs = @ecore_imf_evas_libs@ 401ecore_imf_evas_libs = @ecore_imf_evas_libs@
398ecore_imf_libs = @ecore_imf_libs@ 402ecore_imf_libs = @ecore_imf_libs@
403ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
404ecore_imf_scim_libs = @ecore_imf_scim_libs@
399ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 405ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
400ecore_imf_xim_libs = @ecore_imf_xim_libs@ 406ecore_imf_xim_libs = @ecore_imf_xim_libs@
401ecore_input_cflags = @ecore_input_cflags@ 407ecore_input_cflags = @ecore_input_cflags@
@@ -408,6 +414,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
408ecore_psl1ght_libs = @ecore_psl1ght_libs@ 414ecore_psl1ght_libs = @ecore_psl1ght_libs@
409ecore_sdl_cflags = @ecore_sdl_cflags@ 415ecore_sdl_cflags = @ecore_sdl_cflags@
410ecore_sdl_libs = @ecore_sdl_libs@ 416ecore_sdl_libs = @ecore_sdl_libs@
417ecore_wayland_cflags = @ecore_wayland_cflags@
418ecore_wayland_libs = @ecore_wayland_libs@
411ecore_win32_cflags = @ecore_win32_cflags@ 419ecore_win32_cflags = @ecore_win32_cflags@
412ecore_win32_libs = @ecore_win32_libs@ 420ecore_win32_libs = @ecore_win32_libs@
413ecore_wince_cflags = @ecore_wince_cflags@ 421ecore_wince_cflags = @ecore_wince_cflags@
@@ -452,12 +460,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
452requirements_ecore_file = @requirements_ecore_file@ 460requirements_ecore_file = @requirements_ecore_file@
453requirements_ecore_imf = @requirements_ecore_imf@ 461requirements_ecore_imf = @requirements_ecore_imf@
454requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 462requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
463requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
455requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 464requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
456requirements_ecore_input = @requirements_ecore_input@ 465requirements_ecore_input = @requirements_ecore_input@
457requirements_ecore_input_evas = @requirements_ecore_input_evas@ 466requirements_ecore_input_evas = @requirements_ecore_input_evas@
458requirements_ecore_ipc = @requirements_ecore_ipc@ 467requirements_ecore_ipc = @requirements_ecore_ipc@
459requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 468requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
460requirements_ecore_sdl = @requirements_ecore_sdl@ 469requirements_ecore_sdl = @requirements_ecore_sdl@
470requirements_ecore_wayland = @requirements_ecore_wayland@
461requirements_ecore_win32 = @requirements_ecore_win32@ 471requirements_ecore_win32 = @requirements_ecore_win32@
462requirements_ecore_wince = @requirements_ecore_wince@ 472requirements_ecore_wince = @requirements_ecore_wince@
463requirements_ecore_x = @requirements_ecore_x@ 473requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_damage.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_damage.c
index d0ffde1..bbab308 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_damage.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_damage.c
@@ -99,7 +99,7 @@ ecore_x_damage_new(Ecore_X_Drawable drawable,
99/** 99/**
100 * Destroy a damage object 100 * Destroy a damage object
101 * 101 *
102 * @param The damage object to destroy 102 * @param damage The damage object to destroy
103 * 103 *
104 * Destroys the damage object @p damage 104 * Destroys the damage object @p damage
105 * 105 *
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c
index 677de38..177e61d 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c
@@ -422,9 +422,8 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
422 * @param data User data. 422 * @param data User data.
423 */ 423 */
424EAPI void 424EAPI void
425ecore_x_dnd_callback_pos_update_set(void (*cb)(void *, 425ecore_x_dnd_callback_pos_update_set(void (*cb)(void *, Ecore_X_Xdnd_Position *data),
426 Ecore_X_Xdnd_Position *data), 426 const void *data)
427 const void *data)
428{ 427{
429 _posupdatecb = cb; 428 _posupdatecb = cb;
430 _posupdatedata = (void *)data; 429 _posupdatedata = (void *)data;
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dpms.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dpms.c
index 63b7f1e..324717c 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dpms.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_dpms.c
@@ -270,7 +270,7 @@ ecore_x_dpms_timeout_off_get(void)
270 270
271/** 271/**
272 * Sets the standby timeout (in unit of seconds). 272 * Sets the standby timeout (in unit of seconds).
273 * @param new_standby Amount of time of inactivity before standby mode will be invoked. 273 * @param new_timeout Amount of time of inactivity before standby mode will be invoked.
274 * @ingroup Ecore_X_DPMS_Group 274 * @ingroup Ecore_X_DPMS_Group
275 */ 275 */
276EAPI void 276EAPI void
@@ -286,7 +286,7 @@ ecore_x_dpms_timeout_standby_set(unsigned int new_timeout)
286 286
287/** 287/**
288 * Sets the suspend timeout (in unit of seconds). 288 * Sets the suspend timeout (in unit of seconds).
289 * @param suspend Amount of time of inactivity before the screen is placed into suspend mode. 289 * @param new_timeout Amount of time of inactivity before the screen is placed into suspend mode.
290 * @ingroup Ecore_X_DPMS_Group 290 * @ingroup Ecore_X_DPMS_Group
291 */ 291 */
292EAPI void 292EAPI void
@@ -302,7 +302,7 @@ ecore_x_dpms_timeout_suspend_set(unsigned int new_timeout)
302 302
303/** 303/**
304 * Sets the off timeout (in unit of seconds). 304 * Sets the off timeout (in unit of seconds).
305 * @param off Amount of time of inactivity before the monitor is shut off. 305 * @param new_timeout Amount of time of inactivity before the monitor is shut off.
306 * @ingroup Ecore_X_DPMS_Group 306 * @ingroup Ecore_X_DPMS_Group
307 */ 307 */
308EAPI void 308EAPI void
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c
index bbd9c2a..fc32926 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c
@@ -8,6 +8,7 @@ static void (*_io_error_func)(void *data) = NULL;
8static void *_io_error_data = NULL; 8static void *_io_error_data = NULL;
9static int _error_request_code = 0; 9static int _error_request_code = 0;
10static int _error_code = 0; 10static int _error_code = 0;
11static Ecore_X_ID _error_resource_id = 0;
11 12
12/** 13/**
13 * Set the error handler. 14 * Set the error handler.
@@ -63,6 +64,18 @@ ecore_x_error_code_get(void)
63 return _error_code; 64 return _error_code;
64} 65}
65 66
67/**
68 * Get the resource id that caused the error.
69 * @return The resource id causing the X error
70 *
71 * Return the X resource id that caused the last X error
72 */
73EAPI Ecore_X_ID
74ecore_x_error_resource_id_get(void)
75{
76 return _error_resource_id;
77}
78
66int 79int
67_ecore_xcb_error_handle(xcb_generic_error_t *err) 80_ecore_xcb_error_handle(xcb_generic_error_t *err)
68{ 81{
@@ -84,6 +97,7 @@ _ecore_xcb_error_handle(xcb_generic_error_t *err)
84 97
85 _error_request_code = err->sequence; 98 _error_request_code = err->sequence;
86 _error_code = err->error_code; 99 _error_code = err->error_code;
100 _error_resource_id = err->resource_id;
87 if (_error_func) 101 if (_error_func)
88 _error_func(_error_data); 102 _error_func(_error_data);
89 103
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_icccm.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
index 6459db7..8dea861 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
@@ -396,7 +396,7 @@ ecore_x_icccm_transient_for_set(Ecore_X_Window win,
396 396
397/** 397/**
398 * Remove the transient_for setting from a window. 398 * Remove the transient_for setting from a window.
399 * @param The window 399 * @param win The window
400 */ 400 */
401EAPI void 401EAPI void
402ecore_x_icccm_transient_for_unset(Ecore_X_Window win) 402ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
@@ -1452,6 +1452,7 @@ ecore_x_icccm_take_focus_send(Ecore_X_Window win,
1452 Ecore_X_Time t) 1452 Ecore_X_Time t)
1453{ 1453{
1454 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1454 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1455 CHECK_XCB_CONN;
1455 1456
1456 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS, 1457 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
1457 XCB_EVENT_MASK_NO_EVENT, 1458 XCB_EVENT_MASK_NO_EVENT,
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 510da49..62f7618 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
@@ -1528,9 +1528,9 @@ ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
1528 1528
1529/** 1529/**
1530 * @brief sets a CRTC relative to another one. 1530 * @brief sets a CRTC relative to another one.
1531 * @param crtc_r1 the CRTC to be positioned. 1531 * @param crtc1 the CRTC to be positioned.
1532 * @param crtc_r2 the CRTC the position should be relative to 1532 * @param crtc2 the CRTC the position should be relative to
1533 * @param position the relation between the crtcs 1533 * @param policy the relation between the crtcs
1534 * @param alignment in case CRTCs size differ, aligns CRTC1 accordingly at CRTC2's 1534 * @param alignment in case CRTCs size differ, aligns CRTC1 accordingly at CRTC2's
1535 * borders 1535 * borders
1536 * @return EINA_TRUE if crtc could be successfully positioned. EINA_FALSE if 1536 * @return EINA_TRUE if crtc could be successfully positioned. EINA_FALSE if
@@ -2449,6 +2449,45 @@ ecore_x_randr_output_backlight_level_set(Ecore_X_Window root,
2449 return EINA_FALSE; 2449 return EINA_FALSE;
2450} 2450}
2451 2451
2452/*
2453 * @brief check if a backlight is available
2454 * @return whether a blacklight is available
2455 */
2456EAPI Eina_Bool
2457ecore_x_randr_output_backlight_available(void)
2458{
2459#ifdef ECORE_XCB_RANDR
2460 Ecore_X_Atom _backlight;
2461 xcb_intern_atom_cookie_t acookie;
2462 xcb_intern_atom_reply_t *areply;
2463#endif
2464
2465 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2466 CHECK_XCB_CONN;
2467
2468#ifdef ECORE_XCB_RANDR
2469 RANDR_CHECK_1_2_RET(EINA_FALSE);
2470
2471 acookie =
2472 xcb_intern_atom_unchecked(_ecore_xcb_conn, 1,
2473 strlen("Backlight"), "Backlight");
2474 areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
2475
2476 if (!areply)
2477 {
2478 ERR("Backlight property is not suppported on this server or driver");
2479 return EINA_FALSE;
2480 }
2481 else
2482 {
2483 _backlight = areply->atom;
2484 free(areply);
2485 return EINA_TRUE;
2486 }
2487#endif
2488 return EINA_FALSE;
2489}
2490
2452EAPI int 2491EAPI int
2453ecore_x_randr_edid_version_get(unsigned char *edid, unsigned long edid_length) 2492ecore_x_randr_edid_version_get(unsigned char *edid, unsigned long edid_length)
2454{ 2493{
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 2616c93..27bceaf 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
@@ -783,13 +783,14 @@ ecore_x_window_focus(Ecore_X_Window win)
783 */ 783 */
784EAPI void 784EAPI void
785ecore_x_window_focus_at_time(Ecore_X_Window win, 785ecore_x_window_focus_at_time(Ecore_X_Window win,
786 Ecore_X_Time time) 786 Ecore_X_Time time __UNUSED__)
787{ 787{
788 LOGFN(__FILE__, __LINE__, __FUNCTION__); 788 LOGFN(__FILE__, __LINE__, __FUNCTION__);
789 CHECK_XCB_CONN; 789 CHECK_XCB_CONN;
790 790
791 if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root; 791 if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
792 xcb_set_input_focus(_ecore_xcb_conn, XCB_INPUT_FOCUS_PARENT, win, time); 792 xcb_set_input_focus(_ecore_xcb_conn,
793 XCB_INPUT_FOCUS_PARENT, win, XCB_CURRENT_TIME);
793// ecore_x_flush(); 794// ecore_x_flush();
794} 795}
795 796
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c
index bf9d5ee..bbca2a5 100644
--- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c
@@ -178,7 +178,7 @@ ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
178 178
179/** 179/**
180 * Create a region from a window. 180 * Create a region from a window.
181 * @param window The window used to initialize the region. 181 * @param win The window used to initialize the region.
182 * @param type The type of the region. 182 * @param type The type of the region.
183 * @return The newly created region. 183 * @return The newly created region.
184 * 184 *
@@ -609,8 +609,8 @@ ecore_x_region_expand(Ecore_X_Region dest,
609 * Change clip-mask in a graphic context to the specified region. 609 * Change clip-mask in a graphic context to the specified region.
610 * @param region The region to change. 610 * @param region The region to change.
611 * @param gc The clip-mask graphic context. 611 * @param gc The clip-mask graphic context.
612 * @param x_origin The horizontal translation. 612 * @param x The horizontal translation.
613 * @param y_origin The vertical translation. 613 * @param y The vertical translation.
614 * 614 *
615 * Changes clip-mask in @p gc to the specified @p region and 615 * Changes clip-mask in @p gc to the specified @p region and
616 * sets the clip origin with the values of @p x_origin and @p y_origin. 616 * sets the clip origin with the values of @p x_origin and @p y_origin.
@@ -643,8 +643,8 @@ ecore_x_region_gc_clip_set(Ecore_X_Region region,
643 * @param region The region. 643 * @param region The region.
644 * @param dest The window whose shape is changed. 644 * @param dest The window whose shape is changed.
645 * @param type The kind of shape. 645 * @param type The kind of shape.
646 * @param x_offset The horizontal offset. 646 * @param x The horizontal offset.
647 * @param y_offset The vertical offset. 647 * @param y The vertical offset.
648 * 648 *
649 * Set the specified Shape extension region of @p window to @p region, 649 * Set the specified Shape extension region of @p window to @p region,
650 * offset by @p x_offset and @p y_offset. Future changes to region 650 * offset by @p x_offset and @p y_offset. Future changes to region
@@ -673,8 +673,8 @@ ecore_x_region_window_shape_set(Ecore_X_Region region,
673 * Change clip-mask in picture to the specified region. 673 * Change clip-mask in picture to the specified region.
674 * @param region The region. 674 * @param region The region.
675 * @param picture The picture. 675 * @param picture The picture.
676 * @param x_origin The X coordinate of the origin. 676 * @param x The X coordinate of the origin.
677 * @param y_origin The Y coordinate of the origin. 677 * @param y The Y coordinate of the origin.
678 * 678 *
679 * Changes clip-mask in picture to the specified @p region 679 * Changes clip-mask in picture to the specified @p region
680 * and sets the clip origin. Input and output will be clipped to 680 * and sets the clip origin. Input and output will be clipped to
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/Makefile.in b/libraries/ecore/src/lib/ecore_x/xlib/Makefile.in
index e1026e5..27a2841 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/Makefile.in
+++ b/libraries/ecore/src/lib/ecore_x/xlib/Makefile.in
@@ -252,10 +252,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
252PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 252PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
253PIXMAN_LIBS = @PIXMAN_LIBS@ 253PIXMAN_LIBS = @PIXMAN_LIBS@
254PKG_CONFIG = @PKG_CONFIG@ 254PKG_CONFIG = @PKG_CONFIG@
255PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
256PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
257POSUB = @POSUB@ 255POSUB = @POSUB@
258RANLIB = @RANLIB@ 256RANLIB = @RANLIB@
257SCIM_CFLAGS = @SCIM_CFLAGS@
258SCIM_LIBS = @SCIM_LIBS@
259SDL_CFLAGS = @SDL_CFLAGS@ 259SDL_CFLAGS = @SDL_CFLAGS@
260SDL_CONFIG = @SDL_CONFIG@ 260SDL_CONFIG = @SDL_CONFIG@
261SDL_LIBS = @SDL_LIBS@ 261SDL_LIBS = @SDL_LIBS@
@@ -274,6 +274,10 @@ TSLIB_LIBS = @TSLIB_LIBS@
274USE_NLS = @USE_NLS@ 274USE_NLS = @USE_NLS@
275VERSION = @VERSION@ 275VERSION = @VERSION@
276VMAJ = @VMAJ@ 276VMAJ = @VMAJ@
277WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
278WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
279WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
280WAYLAND_LIBS = @WAYLAND_LIBS@
277WIN32_CFLAGS = @WIN32_CFLAGS@ 281WIN32_CFLAGS = @WIN32_CFLAGS@
278WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 282WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
279WIN32_LIBS = @WIN32_LIBS@ 283WIN32_LIBS = @WIN32_LIBS@
@@ -387,6 +391,8 @@ ecore_imf_cflags = @ecore_imf_cflags@
387ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ 391ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
388ecore_imf_evas_libs = @ecore_imf_evas_libs@ 392ecore_imf_evas_libs = @ecore_imf_evas_libs@
389ecore_imf_libs = @ecore_imf_libs@ 393ecore_imf_libs = @ecore_imf_libs@
394ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
395ecore_imf_scim_libs = @ecore_imf_scim_libs@
390ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ 396ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
391ecore_imf_xim_libs = @ecore_imf_xim_libs@ 397ecore_imf_xim_libs = @ecore_imf_xim_libs@
392ecore_input_cflags = @ecore_input_cflags@ 398ecore_input_cflags = @ecore_input_cflags@
@@ -399,6 +405,8 @@ ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
399ecore_psl1ght_libs = @ecore_psl1ght_libs@ 405ecore_psl1ght_libs = @ecore_psl1ght_libs@
400ecore_sdl_cflags = @ecore_sdl_cflags@ 406ecore_sdl_cflags = @ecore_sdl_cflags@
401ecore_sdl_libs = @ecore_sdl_libs@ 407ecore_sdl_libs = @ecore_sdl_libs@
408ecore_wayland_cflags = @ecore_wayland_cflags@
409ecore_wayland_libs = @ecore_wayland_libs@
402ecore_win32_cflags = @ecore_win32_cflags@ 410ecore_win32_cflags = @ecore_win32_cflags@
403ecore_win32_libs = @ecore_win32_libs@ 411ecore_win32_libs = @ecore_win32_libs@
404ecore_wince_cflags = @ecore_wince_cflags@ 412ecore_wince_cflags = @ecore_wince_cflags@
@@ -443,12 +451,14 @@ requirements_ecore_fb = @requirements_ecore_fb@
443requirements_ecore_file = @requirements_ecore_file@ 451requirements_ecore_file = @requirements_ecore_file@
444requirements_ecore_imf = @requirements_ecore_imf@ 452requirements_ecore_imf = @requirements_ecore_imf@
445requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ 453requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
454requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
446requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ 455requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
447requirements_ecore_input = @requirements_ecore_input@ 456requirements_ecore_input = @requirements_ecore_input@
448requirements_ecore_input_evas = @requirements_ecore_input_evas@ 457requirements_ecore_input_evas = @requirements_ecore_input_evas@
449requirements_ecore_ipc = @requirements_ecore_ipc@ 458requirements_ecore_ipc = @requirements_ecore_ipc@
450requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ 459requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
451requirements_ecore_sdl = @requirements_ecore_sdl@ 460requirements_ecore_sdl = @requirements_ecore_sdl@
461requirements_ecore_wayland = @requirements_ecore_wayland@
452requirements_ecore_win32 = @requirements_ecore_win32@ 462requirements_ecore_win32 = @requirements_ecore_win32@
453requirements_ecore_wince = @requirements_ecore_wince@ 463requirements_ecore_wince = @requirements_ecore_wince@
454requirements_ecore_x = @requirements_ecore_x@ 464requirements_ecore_x = @requirements_ecore_x@
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c
index 844ab04..6d275bc 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c
@@ -19,9 +19,9 @@
19#include "Ecore_X_Atoms.h" 19#include "Ecore_X_Atoms.h"
20#include "Ecore_Input.h" 20#include "Ecore_Input.h"
21 21
22static Eina_Bool _ecore_x_fd_handler(void *data, 22static Eina_Bool _ecore_x_fd_handler(void *data,
23 Ecore_Fd_Handler *fd_handler); 23 Ecore_Fd_Handler *fd_handler);
24static Eina_Bool _ecore_x_fd_handler_buf(void *data, 24static Eina_Bool _ecore_x_fd_handler_buf(void *data,
25 Ecore_Fd_Handler *fd_handler); 25 Ecore_Fd_Handler *fd_handler);
26static int _ecore_x_key_mask_get(KeySym sym); 26static int _ecore_x_key_mask_get(KeySym sym);
27static int _ecore_x_event_modifier(unsigned int state); 27static int _ecore_x_event_modifier(unsigned int state);
@@ -139,9 +139,9 @@ EAPI int ECORE_X_LOCK_SHIFT = 0;
139#ifdef LOGRT 139#ifdef LOGRT
140static double t0 = 0.0; 140static double t0 = 0.0;
141static Status (*_logrt_real_reply)(Display *disp, 141static Status (*_logrt_real_reply)(Display *disp,
142 void *rep, 142 void *rep,
143 int extra, 143 int extra,
144 Bool discard) = NULL; 144 Bool discard) = NULL;
145static void 145static void
146_logrt_init(void) 146_logrt_init(void)
147{ 147{
@@ -159,13 +159,13 @@ _logrt_init(void)
159 159
160 _logrt_real_reply = dlsym(lib, "_XReply"); 160 _logrt_real_reply = dlsym(lib, "_XReply");
161 t0 = ecore_time_get(); 161 t0 = ecore_time_get();
162} /* _logrt_init */ 162}
163 163
164Status 164Status
165_XReply(Display *disp, 165_XReply(Display *disp,
166 void *rep, 166 void *rep,
167 int extra, 167 int extra,
168 Bool discard) 168 Bool discard)
169{ 169{
170 void *bt[128]; 170 void *bt[128];
171 int i, n; 171 int i, n;
@@ -207,7 +207,7 @@ _XReply(Display *disp,
207 207
208 // fixme: logme 208 // fixme: logme
209 return _logrt_real_reply(disp, rep, extra, discard); 209 return _logrt_real_reply(disp, rep, extra, discard);
210} /* _XReply */ 210}
211 211
212#endif /* ifdef LOGRT */ 212#endif /* ifdef LOGRT */
213 213
@@ -215,35 +215,35 @@ void
215_ecore_x_modifiers_get(void) 215_ecore_x_modifiers_get(void)
216{ 216{
217 /* everything has these... unless its like a pda... :) */ 217 /* everything has these... unless its like a pda... :) */
218 ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L); 218 ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L);
219 ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L); 219 ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L);
220 220
221 /* apple's xdarwin has no alt!!!! */ 221 /* apple's xdarwin has no alt!!!! */
222 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L); 222 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L);
223 if (!ECORE_X_MODIFIER_ALT) 223 if (!ECORE_X_MODIFIER_ALT)
224 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Meta_L); 224 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Meta_L);
225 225
226 if (!ECORE_X_MODIFIER_ALT) 226 if (!ECORE_X_MODIFIER_ALT)
227 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Super_L); 227 ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Super_L);
228 228
229 /* the windows key... a valid modifier :) */ 229 /* the windows key... a valid modifier :) */
230 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L); 230 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L);
231 if (!ECORE_X_MODIFIER_WIN) 231 if (!ECORE_X_MODIFIER_WIN)
232 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch); 232 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch);
233 233
234 if (!ECORE_X_MODIFIER_WIN) 234 if (!ECORE_X_MODIFIER_WIN)
235 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L); 235 ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L);
236 236
237 if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT) 237 if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT)
238 ECORE_X_MODIFIER_WIN = 0; 238 ECORE_X_MODIFIER_WIN = 0;
239 239
240 if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL) 240 if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL)
241 ECORE_X_MODIFIER_ALT = 0; 241 ECORE_X_MODIFIER_ALT = 0;
242 242
243 ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock); 243 ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock);
244 ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock); 244 ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock);
245 ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock); 245 ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock);
246 ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock); 246 ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock);
247} 247}
248 248
249/** 249/**
@@ -300,7 +300,7 @@ ecore_x_init(const char *name)
300 eina_init(); 300 eina_init();
301 _ecore_xlib_log_dom = eina_log_domain_register 301 _ecore_xlib_log_dom = eina_log_domain_register
302 ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR); 302 ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR);
303 if(_ecore_xlib_log_dom < 0) 303 if (_ecore_xlib_log_dom < 0)
304 { 304 {
305 EINA_LOG_ERR( 305 EINA_LOG_ERR(
306 "Impossible to create a log domain for the Ecore Xlib module."); 306 "Impossible to create a log domain for the Ecore Xlib module.");
@@ -375,7 +375,7 @@ ecore_x_init(const char *name)
375 375
376#ifdef ECORE_XGESTURE 376#ifdef ECORE_XGESTURE
377 if (XGestureQueryExtension(_ecore_x_disp, &gesture_base, &gesture_err_base)) 377 if (XGestureQueryExtension(_ecore_x_disp, &gesture_base, &gesture_err_base))
378 _ecore_x_event_gesture_id = gesture_base; 378 _ecore_x_event_gesture_id = gesture_base;
379 379
380 ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents); 380 ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents);
381#endif /* ifdef ECORE_XGESTURE */ 381#endif /* ifdef ECORE_XGESTURE */
@@ -497,20 +497,20 @@ ecore_x_init(const char *name)
497#ifdef ECORE_XGESTURE 497#ifdef ECORE_XGESTURE
498 if (_ecore_x_event_gesture_id) 498 if (_ecore_x_event_gesture_id)
499 { 499 {
500 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyFlick] = 500 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyFlick] =
501 _ecore_x_event_handle_gesture_notify_flick; 501 _ecore_x_event_handle_gesture_notify_flick;
502 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPan] = 502 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPan] =
503 _ecore_x_event_handle_gesture_notify_pan; 503 _ecore_x_event_handle_gesture_notify_pan;
504 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPinchRotation] = 504 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPinchRotation] =
505 _ecore_x_event_handle_gesture_notify_pinchrotation; 505 _ecore_x_event_handle_gesture_notify_pinchrotation;
506 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTap] = 506 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTap] =
507 _ecore_x_event_handle_gesture_notify_tap; 507 _ecore_x_event_handle_gesture_notify_tap;
508 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTapNHold] = 508 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTapNHold] =
509 _ecore_x_event_handle_gesture_notify_tapnhold; 509 _ecore_x_event_handle_gesture_notify_tapnhold;
510 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyHold] = 510 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyHold] =
511 _ecore_x_event_handle_gesture_notify_hold; 511 _ecore_x_event_handle_gesture_notify_hold;
512 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyGroup] = 512 _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyGroup] =
513 _ecore_x_event_handle_gesture_notify_group; 513 _ecore_x_event_handle_gesture_notify_group;
514 } 514 }
515 515
516#endif /* ifdef ECORE_XGESTURE */ 516#endif /* ifdef ECORE_XGESTURE */
@@ -641,7 +641,7 @@ shutdown_eina:
641 eina_shutdown(); 641 eina_shutdown();
642 642
643 return --_ecore_x_init_count; 643 return --_ecore_x_init_count;
644} /* ecore_x_init */ 644}
645 645
646static int 646static int
647_ecore_x_shutdown(int close_display) 647_ecore_x_shutdown(int close_display)
@@ -683,7 +683,7 @@ _ecore_x_shutdown(int close_display)
683 eina_shutdown(); 683 eina_shutdown();
684 684
685 return _ecore_x_init_count; 685 return _ecore_x_init_count;
686} /* _ecore_x_shutdown */ 686}
687 687
688/** 688/**
689 * Shuts down the Ecore X library. 689 * Shuts down the Ecore X library.
@@ -699,7 +699,7 @@ EAPI int
699ecore_x_shutdown(void) 699ecore_x_shutdown(void)
700{ 700{
701 return _ecore_x_shutdown(1); 701 return _ecore_x_shutdown(1);
702} /* ecore_x_shutdown */ 702}
703 703
704/** 704/**
705 * Shuts down the Ecore X library. 705 * Shuts down the Ecore X library.
@@ -712,7 +712,7 @@ EAPI int
712ecore_x_disconnect(void) 712ecore_x_disconnect(void)
713{ 713{
714 return _ecore_x_shutdown(0); 714 return _ecore_x_shutdown(0);
715} /* ecore_x_disconnect */ 715}
716 716
717/** 717/**
718 * @defgroup Ecore_X_Display_Attr_Group X Display Attributes 718 * @defgroup Ecore_X_Display_Attr_Group X Display Attributes
@@ -729,7 +729,7 @@ EAPI Ecore_X_Display *
729ecore_x_display_get(void) 729ecore_x_display_get(void)
730{ 730{
731 return (Ecore_X_Display *)_ecore_x_disp; 731 return (Ecore_X_Display *)_ecore_x_disp;
732} /* ecore_x_display_get */ 732}
733 733
734/** 734/**
735 * Retrieves the X display file descriptor. 735 * Retrieves the X display file descriptor.
@@ -741,7 +741,7 @@ ecore_x_fd_get(void)
741{ 741{
742 LOGFN(__FILE__, __LINE__, __FUNCTION__); 742 LOGFN(__FILE__, __LINE__, __FUNCTION__);
743 return ConnectionNumber(_ecore_x_disp); 743 return ConnectionNumber(_ecore_x_disp);
744} /* ecore_x_fd_get */ 744}
745 745
746/** 746/**
747 * Retrieves the Ecore_X_Screen handle used for the current X connection. 747 * Retrieves the Ecore_X_Screen handle used for the current X connection.
@@ -753,7 +753,7 @@ ecore_x_default_screen_get(void)
753{ 753{
754 LOGFN(__FILE__, __LINE__, __FUNCTION__); 754 LOGFN(__FILE__, __LINE__, __FUNCTION__);
755 return (Ecore_X_Screen *)DefaultScreenOfDisplay(_ecore_x_disp); 755 return (Ecore_X_Screen *)DefaultScreenOfDisplay(_ecore_x_disp);
756} /* ecore_x_default_screen_get */ 756}
757 757
758/** 758/**
759 * Retrieves the size of an Ecore_X_Screen. 759 * Retrieves the size of an Ecore_X_Screen.
@@ -767,8 +767,8 @@ ecore_x_default_screen_get(void)
767 */ 767 */
768EAPI void 768EAPI void
769ecore_x_screen_size_get(const Ecore_X_Screen *screen, 769ecore_x_screen_size_get(const Ecore_X_Screen *screen,
770 int *w, 770 int *w,
771 int *h) 771 int *h)
772{ 772{
773 Screen *s = (Screen *)screen; 773 Screen *s = (Screen *)screen;
774 LOGFN(__FILE__, __LINE__, __FUNCTION__); 774 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -840,7 +840,7 @@ ecore_x_double_click_time_set(double t)
840 t = 0.0; 840 t = 0.0;
841 841
842 _ecore_x_double_click_time = t; 842 _ecore_x_double_click_time = t;
843} /* ecore_x_double_click_time_set */ 843}
844 844
845/** 845/**
846 * Retrieves the double and triple click flag timeout. 846 * Retrieves the double and triple click flag timeout.
@@ -854,7 +854,7 @@ EAPI double
854ecore_x_double_click_time_get(void) 854ecore_x_double_click_time_get(void)
855{ 855{
856 return _ecore_x_double_click_time; 856 return _ecore_x_double_click_time;
857} /* ecore_x_double_click_time_get */ 857}
858 858
859/** 859/**
860 * @defgroup Ecore_X_Flush_Group X Synchronization Functions 860 * @defgroup Ecore_X_Flush_Group X Synchronization Functions
@@ -872,7 +872,7 @@ ecore_x_flush(void)
872{ 872{
873 LOGFN(__FILE__, __LINE__, __FUNCTION__); 873 LOGFN(__FILE__, __LINE__, __FUNCTION__);
874 XFlush(_ecore_x_disp); 874 XFlush(_ecore_x_disp);
875} /* ecore_x_flush */ 875}
876 876
877/** 877/**
878 * Flushes the command buffer and waits until all requests have been 878 * Flushes the command buffer and waits until all requests have been
@@ -884,7 +884,7 @@ ecore_x_sync(void)
884{ 884{
885 LOGFN(__FILE__, __LINE__, __FUNCTION__); 885 LOGFN(__FILE__, __LINE__, __FUNCTION__);
886 XSync(_ecore_x_disp, False); 886 XSync(_ecore_x_disp, False);
887} /* ecore_x_sync */ 887}
888 888
889/** 889/**
890 * Kill all clients with subwindows under a given window. 890 * Kill all clients with subwindows under a given window.
@@ -920,7 +920,7 @@ ecore_x_killall(Ecore_X_Window root)
920 } 920 }
921 XUngrabServer(_ecore_x_disp); 921 XUngrabServer(_ecore_x_disp);
922 XSync(_ecore_x_disp, False); 922 XSync(_ecore_x_disp, False);
923} /* ecore_x_killall */ 923}
924 924
925/** 925/**
926 * Kill a specific client 926 * Kill a specific client
@@ -934,7 +934,7 @@ ecore_x_kill(Ecore_X_Window win)
934{ 934{
935 LOGFN(__FILE__, __LINE__, __FUNCTION__); 935 LOGFN(__FILE__, __LINE__, __FUNCTION__);
936 XKillClient(_ecore_x_disp, win); 936 XKillClient(_ecore_x_disp, win);
937} /* ecore_x_kill */ 937}
938 938
939/** 939/**
940 * Return the last event time 940 * Return the last event time
@@ -943,7 +943,7 @@ EAPI Ecore_X_Time
943ecore_x_current_time_get(void) 943ecore_x_current_time_get(void)
944{ 944{
945 return _ecore_x_event_last_time; 945 return _ecore_x_event_last_time;
946} /* ecore_x_current_time_get */ 946}
947 947
948/** 948/**
949 * Return the screen DPI 949 * Return the screen DPI
@@ -965,7 +965,7 @@ ecore_x_dpi_get(void)
965 return 75; 965 return 75;
966 966
967 return (((s->width * 254) / s->mwidth) + 5) / 10; 967 return (((s->width * 254) / s->mwidth) + 5) / 10;
968} /* ecore_x_dpi_get */ 968}
969 969
970/** 970/**
971 * Invoke the standard system beep to alert users 971 * Invoke the standard system beep to alert users
@@ -989,10 +989,10 @@ ecore_x_bell(int percent)
989 return EINA_FALSE; 989 return EINA_FALSE;
990 990
991 return EINA_TRUE; 991 return EINA_TRUE;
992} /* ecore_x_bell */ 992}
993 993
994static Eina_Bool 994static Eina_Bool
995_ecore_x_fd_handler(void *data, 995_ecore_x_fd_handler(void *data,
996 Ecore_Fd_Handler *fd_handler __UNUSED__) 996 Ecore_Fd_Handler *fd_handler __UNUSED__)
997{ 997{
998 Display *d; 998 Display *d;
@@ -1021,10 +1021,10 @@ _ecore_x_fd_handler(void *data,
1021 } 1021 }
1022 } 1022 }
1023 return ECORE_CALLBACK_RENEW; 1023 return ECORE_CALLBACK_RENEW;
1024} /* _ecore_x_fd_handler */ 1024}
1025 1025
1026static Eina_Bool 1026static Eina_Bool
1027_ecore_x_fd_handler_buf(void *data, 1027_ecore_x_fd_handler_buf(void *data,
1028 Ecore_Fd_Handler *fd_handler __UNUSED__) 1028 Ecore_Fd_Handler *fd_handler __UNUSED__)
1029{ 1029{
1030 Display *d; 1030 Display *d;
@@ -1034,7 +1034,7 @@ _ecore_x_fd_handler_buf(void *data,
1034 return ECORE_CALLBACK_RENEW; 1034 return ECORE_CALLBACK_RENEW;
1035 1035
1036 return ECORE_CALLBACK_CANCEL; 1036 return ECORE_CALLBACK_CANCEL;
1037} /* _ecore_x_fd_handler_buf */ 1037}
1038 1038
1039static int 1039static int
1040_ecore_x_key_mask_get(KeySym sym) 1040_ecore_x_key_mask_get(KeySym sym)
@@ -1080,7 +1080,7 @@ _ecore_x_key_mask_get(KeySym sym)
1080 } 1080 }
1081 1081
1082 return 0; 1082 return 0;
1083} /* _ecore_x_key_mask_get */ 1083}
1084 1084
1085/*****************************************************************************/ 1085/*****************************************************************************/
1086/*****************************************************************************/ 1086/*****************************************************************************/
@@ -1132,7 +1132,7 @@ ecore_x_window_root_list(int *num_ret)
1132 overlap++; 1132 overlap++;
1133 } 1133 }
1134 } 1134 }
1135 roots = malloc((num - overlap) * sizeof(Window)); 1135 roots = malloc(MAX((num - overlap) * sizeof(Window), 1));
1136 if (roots) 1136 if (roots)
1137 { 1137 {
1138 int k; 1138 int k;
@@ -1195,7 +1195,7 @@ ecore_x_window_root_list(int *num_ret)
1195 roots[i] = RootWindow(_ecore_x_disp, i); 1195 roots[i] = RootWindow(_ecore_x_disp, i);
1196#endif /* ifdef ECORE_XPRINT */ 1196#endif /* ifdef ECORE_XPRINT */
1197 return roots; 1197 return roots;
1198} /* ecore_x_window_root_list */ 1198}
1199 1199
1200EAPI Ecore_X_Window 1200EAPI Ecore_X_Window
1201ecore_x_window_root_first_get(void) 1201ecore_x_window_root_first_get(void)
@@ -1217,7 +1217,7 @@ ecore_x_window_root_first_get(void)
1217 free(roots); 1217 free(roots);
1218 return root; 1218 return root;
1219 */ 1219 */
1220} /* ecore_x_window_root_first_get */ 1220}
1221 1221
1222static void _ecore_x_window_manage_error(void *data); 1222static void _ecore_x_window_manage_error(void *data);
1223 1223
@@ -1228,7 +1228,7 @@ _ecore_x_window_manage_error(void *data __UNUSED__)
1228 if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) && 1228 if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) &&
1229 (ecore_x_error_code_get() == BadAccess)) 1229 (ecore_x_error_code_get() == BadAccess))
1230 _ecore_x_window_manage_failed = 1; 1230 _ecore_x_window_manage_failed = 1;
1231} /* _ecore_x_window_manage_error */ 1231}
1232 1232
1233EAPI Eina_Bool 1233EAPI Eina_Bool
1234ecore_x_window_manage(Ecore_X_Window win) 1234ecore_x_window_manage(Ecore_X_Window win)
@@ -1262,7 +1262,7 @@ ecore_x_window_manage(Ecore_X_Window win)
1262 } 1262 }
1263 1263
1264 return EINA_TRUE; 1264 return EINA_TRUE;
1265} /* ecore_x_window_manage */ 1265}
1266 1266
1267EAPI void 1267EAPI void
1268ecore_x_window_container_manage(Ecore_X_Window win) 1268ecore_x_window_container_manage(Ecore_X_Window win)
@@ -1271,7 +1271,7 @@ ecore_x_window_container_manage(Ecore_X_Window win)
1271 XSelectInput(_ecore_x_disp, win, 1271 XSelectInput(_ecore_x_disp, win,
1272 SubstructureRedirectMask | 1272 SubstructureRedirectMask |
1273 SubstructureNotifyMask); 1273 SubstructureNotifyMask);
1274} /* ecore_x_window_container_manage */ 1274}
1275 1275
1276EAPI void 1276EAPI void
1277ecore_x_window_client_manage(Ecore_X_Window win) 1277ecore_x_window_client_manage(Ecore_X_Window win)
@@ -1287,7 +1287,7 @@ ecore_x_window_client_manage(Ecore_X_Window win)
1287 SubstructureNotifyMask 1287 SubstructureNotifyMask
1288 ); 1288 );
1289 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 1289 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
1290} /* ecore_x_window_client_manage */ 1290}
1291 1291
1292EAPI void 1292EAPI void
1293ecore_x_window_sniff(Ecore_X_Window win) 1293ecore_x_window_sniff(Ecore_X_Window win)
@@ -1296,7 +1296,7 @@ ecore_x_window_sniff(Ecore_X_Window win)
1296 XSelectInput(_ecore_x_disp, win, 1296 XSelectInput(_ecore_x_disp, win,
1297 PropertyChangeMask | 1297 PropertyChangeMask |
1298 SubstructureNotifyMask); 1298 SubstructureNotifyMask);
1299} /* ecore_x_window_sniff */ 1299}
1300 1300
1301EAPI void 1301EAPI void
1302ecore_x_window_client_sniff(Ecore_X_Window win) 1302ecore_x_window_client_sniff(Ecore_X_Window win)
@@ -1310,10 +1310,10 @@ ecore_x_window_client_sniff(Ecore_X_Window win)
1310 StructureNotifyMask | 1310 StructureNotifyMask |
1311 SubstructureNotifyMask); 1311 SubstructureNotifyMask);
1312 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 1312 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
1313} /* ecore_x_window_client_sniff */ 1313}
1314 1314
1315EAPI Eina_Bool 1315EAPI Eina_Bool
1316ecore_x_window_attributes_get(Ecore_X_Window win, 1316ecore_x_window_attributes_get(Ecore_X_Window win,
1317 Ecore_X_Window_Attributes *att_ret) 1317 Ecore_X_Window_Attributes *att_ret)
1318{ 1318{
1319 XWindowAttributes att; 1319 XWindowAttributes att;
@@ -1353,25 +1353,25 @@ ecore_x_window_attributes_get(Ecore_X_Window win,
1353 att_ret->colormap = att.colormap; 1353 att_ret->colormap = att.colormap;
1354 att_ret->visual = att.visual; 1354 att_ret->visual = att.visual;
1355 return EINA_TRUE; 1355 return EINA_TRUE;
1356} /* ecore_x_window_attributes_get */ 1356}
1357 1357
1358EAPI void 1358EAPI void
1359ecore_x_window_save_set_add(Ecore_X_Window win) 1359ecore_x_window_save_set_add(Ecore_X_Window win)
1360{ 1360{
1361 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1361 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1362 XAddToSaveSet(_ecore_x_disp, win); 1362 XAddToSaveSet(_ecore_x_disp, win);
1363} /* ecore_x_window_save_set_add */ 1363}
1364 1364
1365EAPI void 1365EAPI void
1366ecore_x_window_save_set_del(Ecore_X_Window win) 1366ecore_x_window_save_set_del(Ecore_X_Window win)
1367{ 1367{
1368 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1368 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1369 XRemoveFromSaveSet(_ecore_x_disp, win); 1369 XRemoveFromSaveSet(_ecore_x_disp, win);
1370} /* ecore_x_window_save_set_del */ 1370}
1371 1371
1372EAPI Ecore_X_Window * 1372EAPI Ecore_X_Window *
1373ecore_x_window_children_get(Ecore_X_Window win, 1373ecore_x_window_children_get(Ecore_X_Window win,
1374 int *num) 1374 int *num)
1375{ 1375{
1376 Ecore_X_Window *windows = NULL; 1376 Ecore_X_Window *windows = NULL;
1377 Window root_ret = 0, parent_ret = 0, *children_ret = NULL; 1377 Window root_ret = 0, parent_ret = 0, *children_ret = NULL;
@@ -1398,7 +1398,7 @@ ecore_x_window_children_get(Ecore_X_Window win,
1398 } 1398 }
1399 1399
1400 return windows; 1400 return windows;
1401} /* ecore_x_window_children_get */ 1401}
1402 1402
1403EAPI Eina_Bool 1403EAPI Eina_Bool
1404ecore_x_pointer_control_set(int accel_num, 1404ecore_x_pointer_control_set(int accel_num,
@@ -1408,7 +1408,7 @@ ecore_x_pointer_control_set(int accel_num,
1408 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1408 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1409 return XChangePointerControl(_ecore_x_disp, 1, 1, 1409 return XChangePointerControl(_ecore_x_disp, 1, 1,
1410 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; 1410 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE;
1411} /* ecore_x_pointer_control_set */ 1411}
1412 1412
1413EAPI Eina_Bool 1413EAPI Eina_Bool
1414ecore_x_pointer_control_get(int *accel_num, 1414ecore_x_pointer_control_get(int *accel_num,
@@ -1418,23 +1418,23 @@ ecore_x_pointer_control_get(int *accel_num,
1418 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1418 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1419 return XGetPointerControl(_ecore_x_disp, 1419 return XGetPointerControl(_ecore_x_disp,
1420 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; 1420 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE;
1421} /* ecore_x_pointer_control_get */ 1421}
1422 1422
1423EAPI Eina_Bool 1423EAPI Eina_Bool
1424ecore_x_pointer_mapping_set(unsigned char *map, 1424ecore_x_pointer_mapping_set(unsigned char *map,
1425 int nmap) 1425 int nmap)
1426{ 1426{
1427 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1427 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1428 return XSetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; 1428 return XSetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE;
1429} /* ecore_x_pointer_mapping_set */ 1429}
1430 1430
1431EAPI Eina_Bool 1431EAPI Eina_Bool
1432ecore_x_pointer_mapping_get(unsigned char *map, 1432ecore_x_pointer_mapping_get(unsigned char *map,
1433 int nmap) 1433 int nmap)
1434{ 1434{
1435 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1435 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1436 return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; 1436 return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE;
1437} /* ecore_x_pointer_mapping_get */ 1437}
1438 1438
1439EAPI Eina_Bool 1439EAPI Eina_Bool
1440ecore_x_pointer_grab(Ecore_X_Window win) 1440ecore_x_pointer_grab(Ecore_X_Window win)
@@ -1448,7 +1448,7 @@ ecore_x_pointer_grab(Ecore_X_Window win)
1448 return EINA_TRUE; 1448 return EINA_TRUE;
1449 1449
1450 return EINA_FALSE; 1450 return EINA_FALSE;
1451} /* ecore_x_pointer_grab */ 1451}
1452 1452
1453EAPI Eina_Bool 1453EAPI Eina_Bool
1454ecore_x_pointer_confine_grab(Ecore_X_Window win) 1454ecore_x_pointer_confine_grab(Ecore_X_Window win)
@@ -1462,23 +1462,23 @@ ecore_x_pointer_confine_grab(Ecore_X_Window win)
1462 return EINA_TRUE; 1462 return EINA_TRUE;
1463 1463
1464 return EINA_FALSE; 1464 return EINA_FALSE;
1465} /* ecore_x_pointer_confine_grab */ 1465}
1466 1466
1467EAPI void 1467EAPI void
1468ecore_x_pointer_ungrab(void) 1468ecore_x_pointer_ungrab(void)
1469{ 1469{
1470 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1470 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1471 XUngrabPointer(_ecore_x_disp, CurrentTime); 1471 XUngrabPointer(_ecore_x_disp, CurrentTime);
1472} /* ecore_x_pointer_ungrab */ 1472}
1473 1473
1474EAPI Eina_Bool 1474EAPI Eina_Bool
1475ecore_x_pointer_warp(Ecore_X_Window win, 1475ecore_x_pointer_warp(Ecore_X_Window win,
1476 int x, 1476 int x,
1477 int y) 1477 int y)
1478{ 1478{
1479 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1479 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1480 return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE; 1480 return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE;
1481} /* ecore_x_pointer_warp */ 1481}
1482 1482
1483EAPI Eina_Bool 1483EAPI Eina_Bool
1484ecore_x_keyboard_grab(Ecore_X_Window win) 1484ecore_x_keyboard_grab(Ecore_X_Window win)
@@ -1490,14 +1490,14 @@ ecore_x_keyboard_grab(Ecore_X_Window win)
1490 return EINA_TRUE; 1490 return EINA_TRUE;
1491 1491
1492 return EINA_FALSE; 1492 return EINA_FALSE;
1493} /* ecore_x_keyboard_grab */ 1493}
1494 1494
1495EAPI void 1495EAPI void
1496ecore_x_keyboard_ungrab(void) 1496ecore_x_keyboard_ungrab(void)
1497{ 1497{
1498 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1498 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1499 XUngrabKeyboard(_ecore_x_disp, CurrentTime); 1499 XUngrabKeyboard(_ecore_x_disp, CurrentTime);
1500} /* ecore_x_keyboard_ungrab */ 1500}
1501 1501
1502EAPI void 1502EAPI void
1503ecore_x_grab(void) 1503ecore_x_grab(void)
@@ -1506,7 +1506,7 @@ ecore_x_grab(void)
1506 _ecore_x_grab_count++; 1506 _ecore_x_grab_count++;
1507 if (_ecore_x_grab_count == 1) 1507 if (_ecore_x_grab_count == 1)
1508 XGrabServer(_ecore_x_disp); 1508 XGrabServer(_ecore_x_disp);
1509} /* ecore_x_grab */ 1509}
1510 1510
1511EAPI void 1511EAPI void
1512ecore_x_ungrab(void) 1512ecore_x_ungrab(void)
@@ -1518,32 +1518,32 @@ ecore_x_ungrab(void)
1518 1518
1519 if (_ecore_x_grab_count == 0) 1519 if (_ecore_x_grab_count == 0)
1520 XUngrabServer(_ecore_x_disp); 1520 XUngrabServer(_ecore_x_disp);
1521} /* ecore_x_ungrab */ 1521}
1522 1522
1523int _ecore_window_grabs_num = 0; 1523int _ecore_window_grabs_num = 0;
1524Window *_ecore_window_grabs = NULL; 1524Window *_ecore_window_grabs = NULL;
1525Eina_Bool (*_ecore_window_grab_replay_func)(void *data, 1525Eina_Bool (*_ecore_window_grab_replay_func)(void *data,
1526 int event_type, 1526 int event_type,
1527 void *event); 1527 void *event);
1528void *_ecore_window_grab_replay_data; 1528void *_ecore_window_grab_replay_data;
1529 1529
1530EAPI void 1530EAPI void
1531ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data, 1531ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data,
1532 int event_type, 1532 int event_type,
1533 void *event), 1533 void *event),
1534 void *data) 1534 void *data)
1535{ 1535{
1536 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1536 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1537 _ecore_window_grab_replay_func = func; 1537 _ecore_window_grab_replay_func = func;
1538 _ecore_window_grab_replay_data = data; 1538 _ecore_window_grab_replay_data = data;
1539} /* ecore_x_passive_grab_replay_func_set */ 1539}
1540 1540
1541EAPI void 1541EAPI void
1542ecore_x_window_button_grab(Ecore_X_Window win, 1542ecore_x_window_button_grab(Ecore_X_Window win,
1543 int button, 1543 int button,
1544 Ecore_X_Event_Mask event_mask, 1544 Ecore_X_Event_Mask event_mask,
1545 int mod, 1545 int mod,
1546 int any_mod) 1546 int any_mod)
1547{ 1547{
1548 unsigned int b; 1548 unsigned int b;
1549 unsigned int m; 1549 unsigned int m;
@@ -1578,10 +1578,10 @@ ecore_x_window_button_grab(Ecore_X_Window win,
1578 if (!t) return; 1578 if (!t) return;
1579 _ecore_window_grabs = t; 1579 _ecore_window_grabs = t;
1580 _ecore_window_grabs[_ecore_window_grabs_num - 1] = win; 1580 _ecore_window_grabs[_ecore_window_grabs_num - 1] = win;
1581} /* ecore_x_window_button_grab */ 1581}
1582 1582
1583void 1583void
1584_ecore_x_sync_magic_send(int val, 1584_ecore_x_sync_magic_send(int val,
1585 Ecore_X_Window swin) 1585 Ecore_X_Window swin)
1586{ 1586{
1587 XEvent xev; 1587 XEvent xev;
@@ -1597,7 +1597,7 @@ _ecore_x_sync_magic_send(int val,
1597 xev.xclient.data.l[1] = 0x10000000 + val; 1597 xev.xclient.data.l[1] = 0x10000000 + val;
1598 xev.xclient.data.l[2] = swin; 1598 xev.xclient.data.l[2] = swin;
1599 XSendEvent(_ecore_x_disp, _ecore_x_private_win, False, NoEventMask, &xev); 1599 XSendEvent(_ecore_x_disp, _ecore_x_private_win, False, NoEventMask, &xev);
1600} /* _ecore_x_sync_magic_send */ 1600}
1601 1601
1602void 1602void
1603_ecore_x_window_grab_remove(Ecore_X_Window win) 1603_ecore_x_window_grab_remove(Ecore_X_Window win)
@@ -1631,13 +1631,13 @@ _ecore_x_window_grab_remove(Ecore_X_Window win)
1631 _ecore_window_grabs = t; 1631 _ecore_window_grabs = t;
1632 } 1632 }
1633 } 1633 }
1634} /* _ecore_x_window_grab_remove */ 1634}
1635 1635
1636EAPI void 1636EAPI void
1637ecore_x_window_button_ungrab(Ecore_X_Window win, 1637ecore_x_window_button_ungrab(Ecore_X_Window win,
1638 int button, 1638 int button,
1639 int mod, 1639 int mod,
1640 int any_mod) 1640 int any_mod)
1641{ 1641{
1642 unsigned int b; 1642 unsigned int b;
1643 unsigned int m; 1643 unsigned int m;
@@ -1664,16 +1664,16 @@ ecore_x_window_button_ungrab(Ecore_X_Window win,
1664 for (i = 0; i < 8; i++) 1664 for (i = 0; i < 8; i++)
1665 XUngrabButton(_ecore_x_disp, b, m | locks[i], win); 1665 XUngrabButton(_ecore_x_disp, b, m | locks[i], win);
1666 _ecore_x_sync_magic_send(1, win); 1666 _ecore_x_sync_magic_send(1, win);
1667} /* ecore_x_window_button_ungrab */ 1667}
1668 1668
1669int _ecore_key_grabs_num = 0; 1669int _ecore_key_grabs_num = 0;
1670Window *_ecore_key_grabs = NULL; 1670Window *_ecore_key_grabs = NULL;
1671 1671
1672EAPI void 1672EAPI void
1673ecore_x_window_key_grab(Ecore_X_Window win, 1673ecore_x_window_key_grab(Ecore_X_Window win,
1674 const char *key, 1674 const char *key,
1675 int mod, 1675 int mod,
1676 int any_mod) 1676 int any_mod)
1677{ 1677{
1678 KeyCode keycode = 0; 1678 KeyCode keycode = 0;
1679 KeySym keysym; 1679 KeySym keysym;
@@ -1718,7 +1718,7 @@ ecore_x_window_key_grab(Ecore_X_Window win,
1718 if (!t) return; 1718 if (!t) return;
1719 _ecore_key_grabs = t; 1719 _ecore_key_grabs = t;
1720 _ecore_key_grabs[_ecore_key_grabs_num - 1] = win; 1720 _ecore_key_grabs[_ecore_key_grabs_num - 1] = win;
1721} /* ecore_x_window_key_grab */ 1721}
1722 1722
1723void 1723void
1724_ecore_x_key_grab_remove(Ecore_X_Window win) 1724_ecore_x_key_grab_remove(Ecore_X_Window win)
@@ -1751,13 +1751,13 @@ _ecore_x_key_grab_remove(Ecore_X_Window win)
1751 _ecore_key_grabs = t; 1751 _ecore_key_grabs = t;
1752 } 1752 }
1753 } 1753 }
1754} /* _ecore_x_key_grab_remove */ 1754}
1755 1755
1756EAPI void 1756EAPI void
1757ecore_x_window_key_ungrab(Ecore_X_Window win, 1757ecore_x_window_key_ungrab(Ecore_X_Window win,
1758 const char *key, 1758 const char *key,
1759 int mod, 1759 int mod,
1760 int any_mod) 1760 int any_mod)
1761{ 1761{
1762 KeyCode keycode = 0; 1762 KeyCode keycode = 0;
1763 KeySym keysym; 1763 KeySym keysym;
@@ -1795,7 +1795,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win,
1795 for (i = 0; i < 8; i++) 1795 for (i = 0; i < 8; i++)
1796 XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win); 1796 XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win);
1797 _ecore_x_sync_magic_send(2, win); 1797 _ecore_x_sync_magic_send(2, win);
1798} /* ecore_x_window_key_ungrab */ 1798}
1799 1799
1800/** 1800/**
1801 * Send client message with given type and format 32. 1801 * Send client message with given type and format 32.
@@ -1811,14 +1811,14 @@ ecore_x_window_key_ungrab(Ecore_X_Window win,
1811 * @return EINA_TRUE on success EINA_FALSE otherwise. 1811 * @return EINA_TRUE on success EINA_FALSE otherwise.
1812 */ 1812 */
1813EAPI Eina_Bool 1813EAPI Eina_Bool
1814ecore_x_client_message32_send(Ecore_X_Window win, 1814ecore_x_client_message32_send(Ecore_X_Window win,
1815 Ecore_X_Atom type, 1815 Ecore_X_Atom type,
1816 Ecore_X_Event_Mask mask, 1816 Ecore_X_Event_Mask mask,
1817 long d0, 1817 long d0,
1818 long d1, 1818 long d1,
1819 long d2, 1819 long d2,
1820 long d3, 1820 long d3,
1821 long d4) 1821 long d4)
1822{ 1822{
1823 XEvent xev; 1823 XEvent xev;
1824 1824
@@ -1834,7 +1834,7 @@ ecore_x_client_message32_send(Ecore_X_Window win,
1834 xev.xclient.data.l[4] = d4; 1834 xev.xclient.data.l[4] = d4;
1835 1835
1836 return XSendEvent(_ecore_x_disp, win, False, mask, &xev) ? EINA_TRUE : EINA_FALSE; 1836 return XSendEvent(_ecore_x_disp, win, False, mask, &xev) ? EINA_TRUE : EINA_FALSE;
1837} /* ecore_x_client_message32_send */ 1837}
1838 1838
1839/** 1839/**
1840 * Send client message with given type and format 8. 1840 * Send client message with given type and format 8.
@@ -1848,9 +1848,9 @@ ecore_x_client_message32_send(Ecore_X_Window win,
1848 */ 1848 */
1849EAPI Eina_Bool 1849EAPI Eina_Bool
1850ecore_x_client_message8_send(Ecore_X_Window win, 1850ecore_x_client_message8_send(Ecore_X_Window win,
1851 Ecore_X_Atom type, 1851 Ecore_X_Atom type,
1852 const void *data, 1852 const void *data,
1853 int len) 1853 int len)
1854{ 1854{
1855 XEvent xev; 1855 XEvent xev;
1856 1856
@@ -1866,12 +1866,12 @@ ecore_x_client_message8_send(Ecore_X_Window win,
1866 memset(xev.xclient.data.b + len, 0, 20 - len); 1866 memset(xev.xclient.data.b + len, 0, 20 - len);
1867 1867
1868 return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev) ? EINA_TRUE : EINA_FALSE; 1868 return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev) ? EINA_TRUE : EINA_FALSE;
1869} /* ecore_x_client_message8_send */ 1869}
1870 1870
1871EAPI Eina_Bool 1871EAPI Eina_Bool
1872ecore_x_mouse_move_send(Ecore_X_Window win, 1872ecore_x_mouse_move_send(Ecore_X_Window win,
1873 int x, 1873 int x,
1874 int y) 1874 int y)
1875{ 1875{
1876 XEvent xev; 1876 XEvent xev;
1877 XWindowAttributes att; 1877 XWindowAttributes att;
@@ -1894,13 +1894,13 @@ ecore_x_mouse_move_send(Ecore_X_Window win,
1894 xev.xmotion.is_hint = 0; 1894 xev.xmotion.is_hint = 0;
1895 xev.xmotion.same_screen = 1; 1895 xev.xmotion.same_screen = 1;
1896 return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev) ? EINA_TRUE : EINA_FALSE; 1896 return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev) ? EINA_TRUE : EINA_FALSE;
1897} /* ecore_x_mouse_move_send */ 1897}
1898 1898
1899EAPI Eina_Bool 1899EAPI Eina_Bool
1900ecore_x_mouse_down_send(Ecore_X_Window win, 1900ecore_x_mouse_down_send(Ecore_X_Window win,
1901 int x, 1901 int x,
1902 int y, 1902 int y,
1903 int b) 1903 int b)
1904{ 1904{
1905 XEvent xev; 1905 XEvent xev;
1906 XWindowAttributes att; 1906 XWindowAttributes att;
@@ -1923,13 +1923,13 @@ ecore_x_mouse_down_send(Ecore_X_Window win,
1923 xev.xbutton.button = b; 1923 xev.xbutton.button = b;
1924 xev.xbutton.same_screen = 1; 1924 xev.xbutton.same_screen = 1;
1925 return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev) ? EINA_TRUE : EINA_FALSE; 1925 return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev) ? EINA_TRUE : EINA_FALSE;
1926} /* ecore_x_mouse_down_send */ 1926}
1927 1927
1928EAPI Eina_Bool 1928EAPI Eina_Bool
1929ecore_x_mouse_up_send(Ecore_X_Window win, 1929ecore_x_mouse_up_send(Ecore_X_Window win,
1930 int x, 1930 int x,
1931 int y, 1931 int y,
1932 int b) 1932 int b)
1933{ 1933{
1934 XEvent xev; 1934 XEvent xev;
1935 XWindowAttributes att; 1935 XWindowAttributes att;
@@ -1952,21 +1952,21 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
1952 xev.xbutton.button = b; 1952 xev.xbutton.button = b;
1953 xev.xbutton.same_screen = 1; 1953 xev.xbutton.same_screen = 1;
1954 return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE; 1954 return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE;
1955} /* ecore_x_mouse_up_send */ 1955}
1956 1956
1957EAPI void 1957EAPI void
1958ecore_x_focus_reset(void) 1958ecore_x_focus_reset(void)
1959{ 1959{
1960 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1960 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1961 XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime); 1961 XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime);
1962} /* ecore_x_focus_reset */ 1962}
1963 1963
1964EAPI void 1964EAPI void
1965ecore_x_events_allow_all(void) 1965ecore_x_events_allow_all(void)
1966{ 1966{
1967 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1967 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1968 XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime); 1968 XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime);
1969} /* ecore_x_events_allow_all */ 1969}
1970 1970
1971EAPI void 1971EAPI void
1972ecore_x_pointer_last_xy_get(int *x, 1972ecore_x_pointer_last_xy_get(int *x,
@@ -1977,12 +1977,12 @@ ecore_x_pointer_last_xy_get(int *x,
1977 1977
1978 if (y) 1978 if (y)
1979 *y = _ecore_x_event_last_root_y; 1979 *y = _ecore_x_event_last_root_y;
1980} /* ecore_x_pointer_last_xy_get */ 1980}
1981 1981
1982EAPI void 1982EAPI void
1983ecore_x_pointer_xy_get(Ecore_X_Window win, 1983ecore_x_pointer_xy_get(Ecore_X_Window win,
1984 int *x, 1984 int *x,
1985 int *y) 1985 int *y)
1986{ 1986{
1987 Window rwin, cwin; 1987 Window rwin, cwin;
1988 int rx, ry, wx, wy, ret; 1988 int rx, ry, wx, wy, ret;
@@ -1996,7 +1996,7 @@ ecore_x_pointer_xy_get(Ecore_X_Window win,
1996 1996
1997 if (x) *x = wx; 1997 if (x) *x = wx;
1998 if (y) *y = wy; 1998 if (y) *y = wy;
1999} /* ecore_x_pointer_xy_get */ 1999}
2000 2000
2001/** 2001/**
2002 * Retrieve the Visual ID from a given Visual. 2002 * Retrieve the Visual ID from a given Visual.
@@ -2023,7 +2023,7 @@ ecore_x_visual_id_get(Ecore_X_Visual visual)
2023 */ 2023 */
2024EAPI Ecore_X_Visual 2024EAPI Ecore_X_Visual
2025ecore_x_default_visual_get(Ecore_X_Display *disp, 2025ecore_x_default_visual_get(Ecore_X_Display *disp,
2026 Ecore_X_Screen *screen) 2026 Ecore_X_Screen *screen)
2027{ 2027{
2028 return DefaultVisual(disp, ecore_x_screen_index_get(screen)); 2028 return DefaultVisual(disp, ecore_x_screen_index_get(screen));
2029} 2029}
@@ -2039,7 +2039,7 @@ ecore_x_default_visual_get(Ecore_X_Display *disp,
2039 */ 2039 */
2040EAPI Ecore_X_Colormap 2040EAPI Ecore_X_Colormap
2041ecore_x_default_colormap_get(Ecore_X_Display *disp, 2041ecore_x_default_colormap_get(Ecore_X_Display *disp,
2042 Ecore_X_Screen *screen) 2042 Ecore_X_Screen *screen)
2043{ 2043{
2044 return DefaultColormap(disp, ecore_x_screen_index_get(screen)); 2044 return DefaultColormap(disp, ecore_x_screen_index_get(screen));
2045} 2045}
@@ -2055,7 +2055,7 @@ ecore_x_default_colormap_get(Ecore_X_Display *disp,
2055 */ 2055 */
2056EAPI int 2056EAPI int
2057ecore_x_default_depth_get(Ecore_X_Display *disp, 2057ecore_x_default_depth_get(Ecore_X_Display *disp,
2058 Ecore_X_Screen *screen) 2058 Ecore_X_Screen *screen)
2059{ 2059{
2060 return DefaultDepth(disp, ecore_x_screen_index_get(screen)); 2060 return DefaultDepth(disp, ecore_x_screen_index_get(screen));
2061} 2061}
@@ -2094,5 +2094,5 @@ _ecore_x_event_modifier(unsigned int state)
2094 xmodifiers |= ECORE_X_LOCK_SHIFT; 2094 xmodifiers |= ECORE_X_LOCK_SHIFT;
2095 2095
2096 return xmodifiers; 2096 return xmodifiers;
2097} /* _ecore_x_event_modifier */ 2097}
2098 2098
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
index fd96d5c..ee981fe 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
@@ -291,10 +291,12 @@ _ecore_x_atoms_init(void)
291 num = sizeof(items) / sizeof(Atom_Item); 291 num = sizeof(items) / sizeof(Atom_Item);
292 atoms = alloca(num * sizeof(Atom)); 292 atoms = alloca(num * sizeof(Atom));
293 names = alloca(num * sizeof(char *)); 293 names = alloca(num * sizeof(char *));
294 for (i = 0; i < num; i++) names[i] = (char *)items[i].name; 294 for (i = 0; i < num; i++)
295 names[i] = (char *)items[i].name;
295 XInternAtoms(_ecore_x_disp, names, num, False, atoms); 296 XInternAtoms(_ecore_x_disp, names, num, False, atoms);
296 for (i = 0; i < num; i++) *(items[i].atom) = atoms[i]; 297 for (i = 0; i < num; i++)
297} /* _ecore_x_atoms_init */ 298 *(items[i].atom) = atoms[i];
299}
298 300
299/** 301/**
300 * Retrieves the atom value associated with the given name. 302 * Retrieves the atom value associated with the given name.
@@ -309,11 +311,11 @@ ecore_x_atom_get(const char *name)
309 311
310 LOGFN(__FILE__, __LINE__, __FUNCTION__); 312 LOGFN(__FILE__, __LINE__, __FUNCTION__);
311 return XInternAtom(_ecore_x_disp, name, False); 313 return XInternAtom(_ecore_x_disp, name, False);
312} /* ecore_x_atom_get */ 314}
313 315
314EAPI void 316EAPI void
315ecore_x_atoms_get(const char **names, 317ecore_x_atoms_get(const char **names,
316 int num, 318 int num,
317 Ecore_X_Atom *atoms) 319 Ecore_X_Atom *atoms)
318{ 320{
319 Atom *atoms_int; 321 Atom *atoms_int;
@@ -327,7 +329,7 @@ ecore_x_atoms_get(const char **names,
327 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int); 329 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int);
328 for (i = 0; i < num; i++) 330 for (i = 0; i < num; i++)
329 atoms[i] = atoms_int[i]; 331 atoms[i] = atoms_int[i];
330} /* ecore_x_atoms_get */ 332}
331 333
332EAPI char * 334EAPI char *
333ecore_x_atom_name_get(Ecore_X_Atom atom) 335ecore_x_atom_name_get(Ecore_X_Atom atom)
@@ -348,5 +350,5 @@ ecore_x_atom_name_get(Ecore_X_Atom atom)
348 XFree(xname); 350 XFree(xname);
349 351
350 return name; 352 return name;
351} /* ecore_x_atom_name_get */ 353}
352 354
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
index 43153ff..b919db9 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
@@ -30,24 +30,24 @@ _ecore_x_composite_init(void)
30# endif 30# endif
31 } 31 }
32#endif 32#endif
33} /* _ecore_x_composite_init */ 33}
34 34
35EAPI Eina_Bool 35EAPI Eina_Bool
36ecore_x_composite_query(void) 36ecore_x_composite_query(void)
37{ 37{
38 LOGFN(__FILE__, __LINE__, __FUNCTION__); 38 LOGFN(__FILE__, __LINE__, __FUNCTION__);
39 return _composite_available; 39 return _composite_available;
40} /* ecore_x_composite_query */ 40}
41 41
42EAPI void 42EAPI void
43ecore_x_composite_redirect_window(Ecore_X_Window win, 43ecore_x_composite_redirect_window(Ecore_X_Window win,
44 Ecore_X_Composite_Update_Type type) 44 Ecore_X_Composite_Update_Type type)
45{ 45{
46#ifdef ECORE_XCOMPOSITE 46#ifdef ECORE_XCOMPOSITE
47 int update = CompositeRedirectAutomatic; 47 int update = CompositeRedirectAutomatic;
48 48
49 LOGFN(__FILE__, __LINE__, __FUNCTION__); 49 LOGFN(__FILE__, __LINE__, __FUNCTION__);
50 switch(type) 50 switch (type)
51 { 51 {
52 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: 52 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
53 update = CompositeRedirectAutomatic; 53 update = CompositeRedirectAutomatic;
@@ -56,20 +56,20 @@ ecore_x_composite_redirect_window(Ecore_X_Window win,
56 case ECORE_X_COMPOSITE_UPDATE_MANUAL: 56 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
57 update = CompositeRedirectManual; 57 update = CompositeRedirectManual;
58 break; 58 break;
59 } /* switch */ 59 }
60 XCompositeRedirectWindow(_ecore_x_disp, win, update); 60 XCompositeRedirectWindow(_ecore_x_disp, win, update);
61#endif /* ifdef ECORE_XCOMPOSITE */ 61#endif /* ifdef ECORE_XCOMPOSITE */
62} /* ecore_x_composite_redirect_window */ 62}
63 63
64EAPI void 64EAPI void
65ecore_x_composite_redirect_subwindows(Ecore_X_Window win, 65ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
66 Ecore_X_Composite_Update_Type type) 66 Ecore_X_Composite_Update_Type type)
67{ 67{
68#ifdef ECORE_XCOMPOSITE 68#ifdef ECORE_XCOMPOSITE
69 int update = CompositeRedirectAutomatic; 69 int update = CompositeRedirectAutomatic;
70 70
71 LOGFN(__FILE__, __LINE__, __FUNCTION__); 71 LOGFN(__FILE__, __LINE__, __FUNCTION__);
72 switch(type) 72 switch (type)
73 { 73 {
74 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: 74 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
75 update = CompositeRedirectAutomatic; 75 update = CompositeRedirectAutomatic;
@@ -78,20 +78,20 @@ ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
78 case ECORE_X_COMPOSITE_UPDATE_MANUAL: 78 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
79 update = CompositeRedirectManual; 79 update = CompositeRedirectManual;
80 break; 80 break;
81 } /* switch */ 81 }
82 XCompositeRedirectSubwindows(_ecore_x_disp, win, update); 82 XCompositeRedirectSubwindows(_ecore_x_disp, win, update);
83#endif /* ifdef ECORE_XCOMPOSITE */ 83#endif /* ifdef ECORE_XCOMPOSITE */
84} /* ecore_x_composite_redirect_subwindows */ 84}
85 85
86EAPI void 86EAPI void
87ecore_x_composite_unredirect_window(Ecore_X_Window win, 87ecore_x_composite_unredirect_window(Ecore_X_Window win,
88 Ecore_X_Composite_Update_Type type) 88 Ecore_X_Composite_Update_Type type)
89{ 89{
90#ifdef ECORE_XCOMPOSITE 90#ifdef ECORE_XCOMPOSITE
91 int update = CompositeRedirectAutomatic; 91 int update = CompositeRedirectAutomatic;
92 92
93 LOGFN(__FILE__, __LINE__, __FUNCTION__); 93 LOGFN(__FILE__, __LINE__, __FUNCTION__);
94 switch(type) 94 switch (type)
95 { 95 {
96 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: 96 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
97 update = CompositeRedirectAutomatic; 97 update = CompositeRedirectAutomatic;
@@ -100,20 +100,20 @@ ecore_x_composite_unredirect_window(Ecore_X_Window win,
100 case ECORE_X_COMPOSITE_UPDATE_MANUAL: 100 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
101 update = CompositeRedirectManual; 101 update = CompositeRedirectManual;
102 break; 102 break;
103 } /* switch */ 103 }
104 XCompositeUnredirectWindow(_ecore_x_disp, win, update); 104 XCompositeUnredirectWindow(_ecore_x_disp, win, update);
105#endif /* ifdef ECORE_XCOMPOSITE */ 105#endif /* ifdef ECORE_XCOMPOSITE */
106} /* ecore_x_composite_unredirect_window */ 106}
107 107
108EAPI void 108EAPI void
109ecore_x_composite_unredirect_subwindows(Ecore_X_Window win, 109ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
110 Ecore_X_Composite_Update_Type type) 110 Ecore_X_Composite_Update_Type type)
111{ 111{
112#ifdef ECORE_XCOMPOSITE 112#ifdef ECORE_XCOMPOSITE
113 int update = CompositeRedirectAutomatic; 113 int update = CompositeRedirectAutomatic;
114 114
115 LOGFN(__FILE__, __LINE__, __FUNCTION__); 115 LOGFN(__FILE__, __LINE__, __FUNCTION__);
116 switch(type) 116 switch (type)
117 { 117 {
118 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: 118 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
119 update = CompositeRedirectAutomatic; 119 update = CompositeRedirectAutomatic;
@@ -122,10 +122,10 @@ ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
122 case ECORE_X_COMPOSITE_UPDATE_MANUAL: 122 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
123 update = CompositeRedirectManual; 123 update = CompositeRedirectManual;
124 break; 124 break;
125 } /* switch */ 125 }
126 XCompositeUnredirectSubwindows(_ecore_x_disp, win, update); 126 XCompositeUnredirectSubwindows(_ecore_x_disp, win, update);
127#endif /* ifdef ECORE_XCOMPOSITE */ 127#endif /* ifdef ECORE_XCOMPOSITE */
128} /* ecore_x_composite_unredirect_subwindows */ 128}
129 129
130EAPI Ecore_X_Pixmap 130EAPI Ecore_X_Pixmap
131ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win) 131ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
@@ -136,7 +136,7 @@ ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
136 pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win); 136 pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win);
137#endif /* ifdef ECORE_XCOMPOSITE */ 137#endif /* ifdef ECORE_XCOMPOSITE */
138 return pixmap; 138 return pixmap;
139} /* ecore_x_composite_name_window_pixmap_get */ 139}
140 140
141EAPI void 141EAPI void
142ecore_x_composite_window_events_disable(Ecore_X_Window win) 142ecore_x_composite_window_events_disable(Ecore_X_Window win)
@@ -163,7 +163,7 @@ ecore_x_composite_render_window_enable(Ecore_X_Window root)
163 ecore_x_composite_window_events_disable(win); 163 ecore_x_composite_window_events_disable(win);
164#endif /* ifdef ECORE_XCOMPOSITE */ 164#endif /* ifdef ECORE_XCOMPOSITE */
165 return win; 165 return win;
166} /* ecore_x_composite_render_window_enable */ 166}
167 167
168EAPI void 168EAPI void
169ecore_x_composite_render_window_disable(Ecore_X_Window root) 169ecore_x_composite_render_window_disable(Ecore_X_Window root)
@@ -172,5 +172,5 @@ ecore_x_composite_render_window_disable(Ecore_X_Window root)
172 LOGFN(__FILE__, __LINE__, __FUNCTION__); 172 LOGFN(__FILE__, __LINE__, __FUNCTION__);
173 XCompositeReleaseOverlayWindow(_ecore_x_disp, root); 173 XCompositeReleaseOverlayWindow(_ecore_x_disp, root);
174#endif /* ifdef ECORE_XCOMPOSITE */ 174#endif /* ifdef ECORE_XCOMPOSITE */
175} /* ecore_x_composite_render_window_disable */ 175}
176 176
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
index 434505c..a968c56 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
@@ -10,15 +10,15 @@ EAPI Eina_Bool
10ecore_x_cursor_color_supported_get(void) 10ecore_x_cursor_color_supported_get(void)
11{ 11{
12 return _ecore_x_xcursor; 12 return _ecore_x_xcursor;
13} /* ecore_x_cursor_color_supported_get */ 13}
14 14
15EAPI Ecore_X_Cursor 15EAPI Ecore_X_Cursor
16ecore_x_cursor_new(Ecore_X_Window win, 16ecore_x_cursor_new(Ecore_X_Window win,
17 int *pixels, 17 int *pixels,
18 int w, 18 int w,
19 int h, 19 int h,
20 int hot_x, 20 int hot_x,
21 int hot_y) 21 int hot_y)
22{ 22{
23#ifdef ECORE_XCURSOR 23#ifdef ECORE_XCURSOR
24 LOGFN(__FILE__, __LINE__, __FUNCTION__); 24 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -43,7 +43,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
43// r = (((pixels[i] >> 16) & 0xff) * a) / 0xff; 43// r = (((pixels[i] >> 16) & 0xff) * a) / 0xff;
44// g = (((pixels[i] >> 8 ) & 0xff) * a) / 0xff; 44// g = (((pixels[i] >> 8 ) & 0xff) * a) / 0xff;
45// b = (((pixels[i] ) & 0xff) * a) / 0xff; 45// b = (((pixels[i] ) & 0xff) * a) / 0xff;
46 xci->pixels[i] = pixels[i]; 46 xci->pixels[i] = pixels[i];
47// (a << 24) | (r << 16) | (g << 8) | (b); 47// (a << 24) | (r << 16) | (g << 8) | (b);
48 } 48 }
49 c = XcursorImageLoadCursor(_ecore_x_disp, xci); 49 c = XcursorImageLoadCursor(_ecore_x_disp, xci);
@@ -200,14 +200,14 @@ ecore_x_cursor_new(Ecore_X_Window win,
200 } 200 }
201 201
202 return 0; 202 return 0;
203} /* ecore_x_cursor_new */ 203}
204 204
205EAPI void 205EAPI void
206ecore_x_cursor_free(Ecore_X_Cursor c) 206ecore_x_cursor_free(Ecore_X_Cursor c)
207{ 207{
208 LOGFN(__FILE__, __LINE__, __FUNCTION__); 208 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFreeCursor(_ecore_x_disp, c); 209 XFreeCursor(_ecore_x_disp, c);
210} /* ecore_x_cursor_free */ 210}
211 211
212/* 212/*
213 * Returns the cursor for the given shape. 213 * Returns the cursor for the given shape.
@@ -220,7 +220,7 @@ ecore_x_cursor_shape_get(int shape)
220 LOGFN(__FILE__, __LINE__, __FUNCTION__); 220 LOGFN(__FILE__, __LINE__, __FUNCTION__);
221 /* Shapes are defined in Ecore_X_Cursor.h */ 221 /* Shapes are defined in Ecore_X_Cursor.h */
222 return XCreateFontCursor(_ecore_x_disp, shape); 222 return XCreateFontCursor(_ecore_x_disp, shape);
223} /* ecore_x_cursor_shape_get */ 223}
224 224
225EAPI void 225EAPI void
226ecore_x_cursor_size_set(int size) 226ecore_x_cursor_size_set(int size)
@@ -231,7 +231,7 @@ ecore_x_cursor_size_set(int size)
231#else /* ifdef ECORE_XCURSOR */ 231#else /* ifdef ECORE_XCURSOR */
232 size = 0; 232 size = 0;
233#endif /* ifdef ECORE_XCURSOR */ 233#endif /* ifdef ECORE_XCURSOR */
234} /* ecore_x_cursor_size_set */ 234}
235 235
236EAPI int 236EAPI int
237ecore_x_cursor_size_get(void) 237ecore_x_cursor_size_get(void)
@@ -242,5 +242,5 @@ ecore_x_cursor_size_get(void)
242#else /* ifdef ECORE_XCURSOR */ 242#else /* ifdef ECORE_XCURSOR */
243 return 0; 243 return 0;
244#endif /* ifdef ECORE_XCURSOR */ 244#endif /* ifdef ECORE_XCURSOR */
245} /* ecore_x_cursor_size_get */ 245}
246 246
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
index 5e44d07..b094f85 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
@@ -26,16 +26,16 @@ _ecore_x_damage_init(void)
26#else /* ifdef ECORE_XDAMAGE */ 26#else /* ifdef ECORE_XDAMAGE */
27 _damage_available = EINA_FALSE; 27 _damage_available = EINA_FALSE;
28#endif /* ifdef ECORE_XDAMAGE */ 28#endif /* ifdef ECORE_XDAMAGE */
29} /* _ecore_x_damage_init */ 29}
30 30
31EAPI Eina_Bool 31EAPI Eina_Bool
32ecore_x_damage_query(void) 32ecore_x_damage_query(void)
33{ 33{
34 return _damage_available; 34 return _damage_available;
35} /* ecore_x_damage_query */ 35}
36 36
37EAPI Ecore_X_Damage 37EAPI Ecore_X_Damage
38ecore_x_damage_new(Ecore_X_Drawable d, 38ecore_x_damage_new(Ecore_X_Drawable d,
39 Ecore_X_Damage_Report_Level level) 39 Ecore_X_Damage_Report_Level level)
40{ 40{
41#ifdef ECORE_XDAMAGE 41#ifdef ECORE_XDAMAGE
@@ -47,7 +47,7 @@ ecore_x_damage_new(Ecore_X_Drawable d,
47#else /* ifdef ECORE_XDAMAGE */ 47#else /* ifdef ECORE_XDAMAGE */
48 return 0; 48 return 0;
49#endif /* ifdef ECORE_XDAMAGE */ 49#endif /* ifdef ECORE_XDAMAGE */
50} /* ecore_x_damage_new */ 50}
51 51
52EAPI void 52EAPI void
53ecore_x_damage_free(Ecore_X_Damage damage) 53ecore_x_damage_free(Ecore_X_Damage damage)
@@ -56,7 +56,7 @@ ecore_x_damage_free(Ecore_X_Damage damage)
56 LOGFN(__FILE__, __LINE__, __FUNCTION__); 56 LOGFN(__FILE__, __LINE__, __FUNCTION__);
57 XDamageDestroy(_ecore_x_disp, damage); 57 XDamageDestroy(_ecore_x_disp, damage);
58#endif /* ifdef ECORE_XDAMAGE */ 58#endif /* ifdef ECORE_XDAMAGE */
59} /* ecore_x_damage_free */ 59}
60 60
61EAPI void 61EAPI void
62ecore_x_damage_subtract(Ecore_X_Damage damage, 62ecore_x_damage_subtract(Ecore_X_Damage damage,
@@ -67,5 +67,5 @@ ecore_x_damage_subtract(Ecore_X_Damage damage,
67 LOGFN(__FILE__, __LINE__, __FUNCTION__); 67 LOGFN(__FILE__, __LINE__, __FUNCTION__);
68 XDamageSubtract(_ecore_x_disp, damage, repair, parts); 68 XDamageSubtract(_ecore_x_disp, damage, repair, parts);
69#endif /* ifdef ECORE_XDAMAGE */ 69#endif /* ifdef ECORE_XDAMAGE */
70} /* ecore_x_damage_subtract */ 70}
71 71
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
index 7908584..372470a 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
@@ -65,7 +65,7 @@ _ecore_x_dnd_init(void)
65 } 65 }
66 66
67 _ecore_x_dnd_init_count++; 67 _ecore_x_dnd_init_count++;
68} /* _ecore_x_dnd_init */ 68}
69 69
70void 70void
71_ecore_x_dnd_shutdown(void) 71_ecore_x_dnd_shutdown(void)
@@ -85,16 +85,16 @@ _ecore_x_dnd_shutdown(void)
85 _target = NULL; 85 _target = NULL;
86 86
87 _ecore_x_dnd_init_count = 0; 87 _ecore_x_dnd_init_count = 0;
88} /* _ecore_x_dnd_shutdown */ 88}
89 89
90static Eina_Bool 90static Eina_Bool
91_ecore_x_dnd_converter_copy(char *target __UNUSED__, 91_ecore_x_dnd_converter_copy(char *target __UNUSED__,
92 void *data, 92 void *data,
93 int size, 93 int size,
94 void **data_ret, 94 void **data_ret,
95 int *size_ret, 95 int *size_ret,
96 Ecore_X_Atom *tprop __UNUSED__, 96 Ecore_X_Atom *tprop __UNUSED__,
97 int *count __UNUSED__) 97 int *count __UNUSED__)
98{ 98{
99 XTextProperty text_prop; 99 XTextProperty text_prop;
100 char *mystr; 100 char *mystr;
@@ -130,11 +130,11 @@ _ecore_x_dnd_converter_copy(char *target __UNUSED__,
130 free(mystr); 130 free(mystr);
131 return EINA_FALSE; 131 return EINA_FALSE;
132 } 132 }
133} /* _ecore_x_dnd_converter_copy */ 133}
134 134
135EAPI void 135EAPI void
136ecore_x_dnd_aware_set(Ecore_X_Window win, 136ecore_x_dnd_aware_set(Ecore_X_Window win,
137 Eina_Bool on) 137 Eina_Bool on)
138{ 138{
139 Ecore_X_Atom prop_data = ECORE_X_DND_VERSION; 139 Ecore_X_Atom prop_data = ECORE_X_DND_VERSION;
140 140
@@ -144,7 +144,7 @@ ecore_x_dnd_aware_set(Ecore_X_Window win,
144 XA_ATOM, 32, &prop_data, 1); 144 XA_ATOM, 32, &prop_data, 1);
145 else 145 else
146 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE); 146 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE);
147} /* ecore_x_dnd_aware_set */ 147}
148 148
149EAPI int 149EAPI int
150ecore_x_dnd_version_get(Ecore_X_Window win) 150ecore_x_dnd_version_get(Ecore_X_Window win)
@@ -208,11 +208,11 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
208 } 208 }
209 209
210 return 0; 210 return 0;
211} /* ecore_x_dnd_version_get */ 211}
212 212
213EAPI Eina_Bool 213EAPI Eina_Bool
214ecore_x_dnd_type_isset(Ecore_X_Window win, 214ecore_x_dnd_type_isset(Ecore_X_Window win,
215 const char *type) 215 const char *type)
216{ 216{
217 int num, i, ret = EINA_FALSE; 217 int num, i, ret = EINA_FALSE;
218 unsigned char *data; 218 unsigned char *data;
@@ -237,12 +237,12 @@ ecore_x_dnd_type_isset(Ecore_X_Window win,
237 237
238 XFree(data); 238 XFree(data);
239 return ret; 239 return ret;
240} /* ecore_x_dnd_type_isset */ 240}
241 241
242EAPI void 242EAPI void
243ecore_x_dnd_type_set(Ecore_X_Window win, 243ecore_x_dnd_type_set(Ecore_X_Window win,
244 const char *type, 244 const char *type,
245 Eina_Bool on) 245 Eina_Bool on)
246{ 246{
247 Ecore_X_Atom atom; 247 Ecore_X_Atom atom;
248 Ecore_X_Atom *oldset = NULL, *newset = NULL; 248 Ecore_X_Atom *oldset = NULL, *newset = NULL;
@@ -305,12 +305,12 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
305 305
306 XFree(oldset); 306 XFree(oldset);
307 free(newset); 307 free(newset);
308} /* ecore_x_dnd_type_set */ 308}
309 309
310EAPI void 310EAPI void
311ecore_x_dnd_types_set(Ecore_X_Window win, 311ecore_x_dnd_types_set(Ecore_X_Window win,
312 const char **types, 312 const char **types,
313 unsigned int num_types) 313 unsigned int num_types)
314{ 314{
315 Ecore_X_Atom *newset = NULL; 315 Ecore_X_Atom *newset = NULL;
316 unsigned int i; 316 unsigned int i;
@@ -336,12 +336,12 @@ ecore_x_dnd_types_set(Ecore_X_Window win,
336 XA_ATOM, 32, data, num_types); 336 XA_ATOM, 32, data, num_types);
337 free(newset); 337 free(newset);
338 } 338 }
339} /* ecore_x_dnd_types_set */ 339}
340 340
341EAPI void 341EAPI void
342ecore_x_dnd_actions_set(Ecore_X_Window win, 342ecore_x_dnd_actions_set(Ecore_X_Window win,
343 Ecore_X_Atom *actions, 343 Ecore_X_Atom *actions,
344 unsigned int num_actions) 344 unsigned int num_actions)
345{ 345{
346 unsigned int i; 346 unsigned int i;
347 unsigned char *data = NULL; 347 unsigned char *data = NULL;
@@ -360,7 +360,7 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
360 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_ACTION_LIST, 360 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_ACTION_LIST,
361 XA_ATOM, 32, data, num_actions); 361 XA_ATOM, 32, data, num_actions);
362 } 362 }
363} /* ecore_x_dnd_actions_set */ 363}
364 364
365/** 365/**
366 * The DND position update cb is called Ecore_X sends a DND position to a 366 * The DND position update cb is called Ecore_X sends a DND position to a
@@ -378,9 +378,9 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
378 */ 378 */
379EAPI void 379EAPI void
380ecore_x_dnd_callback_pos_update_set( 380ecore_x_dnd_callback_pos_update_set(
381 void (*cb)(void *, 381 void (*cb)(void *,
382 Ecore_X_Xdnd_Position *data), 382 Ecore_X_Xdnd_Position *data),
383 const void *data) 383 const void *data)
384{ 384{
385 _posupdatecb = cb; 385 _posupdatecb = cb;
386 _posupdatedata = (void *)data; /* Discard the const early */ 386 _posupdatedata = (void *)data; /* Discard the const early */
@@ -390,18 +390,18 @@ Ecore_X_DND_Source *
390_ecore_x_dnd_source_get(void) 390_ecore_x_dnd_source_get(void)
391{ 391{
392 return _source; 392 return _source;
393} /* _ecore_x_dnd_source_get */ 393}
394 394
395Ecore_X_DND_Target * 395Ecore_X_DND_Target *
396_ecore_x_dnd_target_get(void) 396_ecore_x_dnd_target_get(void)
397{ 397{
398 return _target; 398 return _target;
399} /* _ecore_x_dnd_target_get */ 399}
400 400
401EAPI Eina_Bool 401EAPI Eina_Bool
402ecore_x_dnd_begin(Ecore_X_Window source, 402ecore_x_dnd_begin(Ecore_X_Window source,
403 unsigned char *data, 403 unsigned char *data,
404 int size) 404 int size)
405{ 405{
406 LOGFN(__FILE__, __LINE__, __FUNCTION__); 406 LOGFN(__FILE__, __LINE__, __FUNCTION__);
407 if (!ecore_x_dnd_version_get(source)) 407 if (!ecore_x_dnd_version_get(source))
@@ -433,7 +433,7 @@ ecore_x_dnd_begin(Ecore_X_Window source,
433 _source->dest = None; 433 _source->dest = None;
434 434
435 return EINA_TRUE; 435 return EINA_TRUE;
436} /* ecore_x_dnd_begin */ 436}
437 437
438EAPI Eina_Bool 438EAPI Eina_Bool
439ecore_x_dnd_drop(void) 439ecore_x_dnd_drop(void)
@@ -471,8 +471,8 @@ ecore_x_dnd_drop(void)
471 else 471 else
472 { 472 {
473 /* Dropping on nothing */ 473 /* Dropping on nothing */
474 ecore_x_selection_xdnd_clear(); 474 ecore_x_selection_xdnd_clear();
475 _source->state = ECORE_X_DND_SOURCE_IDLE; 475 _source->state = ECORE_X_DND_SOURCE_IDLE;
476 } 476 }
477 477
478 ecore_x_window_ignore_set(_source->win, 0); 478 ecore_x_window_ignore_set(_source->win, 0);
@@ -480,13 +480,13 @@ ecore_x_dnd_drop(void)
480 _source->prev.window = 0; 480 _source->prev.window = 0;
481 481
482 return status; 482 return status;
483} /* ecore_x_dnd_drop */ 483}
484 484
485EAPI void 485EAPI void
486ecore_x_dnd_send_status(Eina_Bool will_accept, 486ecore_x_dnd_send_status(Eina_Bool will_accept,
487 Eina_Bool suppress, 487 Eina_Bool suppress,
488 Ecore_X_Rectangle rectangle, 488 Ecore_X_Rectangle rectangle,
489 Ecore_X_Atom action) 489 Ecore_X_Atom action)
490{ 490{
491 XEvent xev; 491 XEvent xev;
492 492
@@ -532,7 +532,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
532 } 532 }
533 533
534 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 534 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
535} /* ecore_x_dnd_send_status */ 535}
536 536
537EAPI void 537EAPI void
538ecore_x_dnd_send_finished(void) 538ecore_x_dnd_send_finished(void)
@@ -561,7 +561,7 @@ ecore_x_dnd_send_finished(void)
561 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 561 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
562 562
563 _target->state = ECORE_X_DND_TARGET_IDLE; 563 _target->state = ECORE_X_DND_TARGET_IDLE;
564} /* ecore_x_dnd_send_finished */ 564}
565 565
566EAPI void 566EAPI void
567ecore_x_dnd_source_action_set(Ecore_X_Atom action) 567ecore_x_dnd_source_action_set(Ecore_X_Atom action)
@@ -569,18 +569,18 @@ ecore_x_dnd_source_action_set(Ecore_X_Atom action)
569 _source->action = action; 569 _source->action = action;
570 if (_source->prev.window) 570 if (_source->prev.window)
571 _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y); 571 _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
572} /* ecore_x_dnd_source_action_set */ 572}
573 573
574EAPI Ecore_X_Atom 574EAPI Ecore_X_Atom
575ecore_x_dnd_source_action_get(void) 575ecore_x_dnd_source_action_get(void)
576{ 576{
577 return _source->action; 577 return _source->action;
578} /* ecore_x_dnd_source_action_get */ 578}
579 579
580void 580void
581_ecore_x_dnd_drag(Ecore_X_Window root, 581_ecore_x_dnd_drag(Ecore_X_Window root,
582 int x, 582 int x,
583 int y) 583 int y)
584{ 584{
585 XEvent xev; 585 XEvent xev;
586 Ecore_X_Window win; 586 Ecore_X_Window win;
@@ -701,6 +701,6 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
701 _source->prev.y = y; 701 _source->prev.y = y;
702 _source->prev.window = root; 702 _source->prev.window = root;
703 _source->dest = win; 703 _source->dest = win;
704} /* _ecore_x_dnd_drag */ 704}
705 705
706/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 706/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
index 74d5344..23349f4 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
@@ -23,7 +23,7 @@ _ecore_x_dpms_init(void)
23#else /* ifdef ECORE_XDPMS */ 23#else /* ifdef ECORE_XDPMS */
24 _dpms_available = EINA_FALSE; 24 _dpms_available = EINA_FALSE;
25#endif /* ifdef ECORE_XDPMS */ 25#endif /* ifdef ECORE_XDPMS */
26} /* _ecore_x_dpms_init */ 26}
27 27
28/** 28/**
29 * @defgroup Ecore_X_DPMS_Group X DPMS Extension Functions 29 * @defgroup Ecore_X_DPMS_Group X DPMS Extension Functions
@@ -40,7 +40,7 @@ EAPI Eina_Bool
40ecore_x_dpms_query(void) 40ecore_x_dpms_query(void)
41{ 41{
42 return _dpms_available; 42 return _dpms_available;
43} /* ecore_x_dpms_query */ 43}
44 44
45/** 45/**
46 * Checks if the X server is capable of DPMS. 46 * Checks if the X server is capable of DPMS.
@@ -56,7 +56,7 @@ ecore_x_dpms_capable_get(void)
56#else /* ifdef ECORE_XDPMS */ 56#else /* ifdef ECORE_XDPMS */
57 return EINA_FALSE; 57 return EINA_FALSE;
58#endif /* ifdef ECORE_XDPMS */ 58#endif /* ifdef ECORE_XDPMS */
59} /* ecore_x_dpms_capable_get */ 59}
60 60
61/** 61/**
62 * Checks the DPMS state of the display. 62 * Checks the DPMS state of the display.
@@ -76,7 +76,7 @@ ecore_x_dpms_enabled_get(void)
76#else /* ifdef ECORE_XDPMS */ 76#else /* ifdef ECORE_XDPMS */
77 return EINA_FALSE; 77 return EINA_FALSE;
78#endif /* ifdef ECORE_XDPMS */ 78#endif /* ifdef ECORE_XDPMS */
79} /* ecore_x_dpms_enabled_get */ 79}
80 80
81/** 81/**
82 * Sets the DPMS state of the display. 82 * Sets the DPMS state of the display.
@@ -94,7 +94,7 @@ ecore_x_dpms_enabled_set(int enabled)
94 DPMSDisable(_ecore_x_disp); 94 DPMSDisable(_ecore_x_disp);
95 95
96#endif /* ifdef ECORE_XDPMS */ 96#endif /* ifdef ECORE_XDPMS */
97} /* ecore_x_dpms_enabled_set */ 97}
98 98
99/** 99/**
100 * Gets the timeouts. The values are in unit of seconds. 100 * Gets the timeouts. The values are in unit of seconds.
@@ -113,7 +113,7 @@ ecore_x_dpms_timeouts_get(unsigned int *standby,
113 DPMSGetTimeouts(_ecore_x_disp, (unsigned short *)standby, 113 DPMSGetTimeouts(_ecore_x_disp, (unsigned short *)standby,
114 (unsigned short *)suspend, (unsigned short *)off); 114 (unsigned short *)suspend, (unsigned short *)off);
115#endif /* ifdef ECORE_XDPMS */ 115#endif /* ifdef ECORE_XDPMS */
116} /* ecore_x_dpms_timeouts_get */ 116}
117 117
118/** 118/**
119 * Sets the timeouts. The values are in unit of seconds. 119 * Sets the timeouts. The values are in unit of seconds.
@@ -133,7 +133,7 @@ ecore_x_dpms_timeouts_set(unsigned int standby,
133#else /* ifdef ECORE_XDPMS */ 133#else /* ifdef ECORE_XDPMS */
134 return EINA_FALSE; 134 return EINA_FALSE;
135#endif /* ifdef ECORE_XDPMS */ 135#endif /* ifdef ECORE_XDPMS */
136} /* ecore_x_dpms_timeouts_set */ 136}
137 137
138/** 138/**
139 * Returns the amount of time of inactivity before standby mode is invoked. 139 * Returns the amount of time of inactivity before standby mode is invoked.
@@ -152,7 +152,7 @@ ecore_x_dpms_timeout_standby_get(void)
152#else /* ifdef ECORE_XDPMS */ 152#else /* ifdef ECORE_XDPMS */
153 return 0; 153 return 0;
154#endif /* ifdef ECORE_XDPMS */ 154#endif /* ifdef ECORE_XDPMS */
155} /* ecore_x_dpms_timeout_standby_get */ 155}
156 156
157/** 157/**
158 * Returns the amount of time of inactivity before the second level of 158 * Returns the amount of time of inactivity before the second level of
@@ -172,7 +172,7 @@ ecore_x_dpms_timeout_suspend_get(void)
172#else /* ifdef ECORE_XDPMS */ 172#else /* ifdef ECORE_XDPMS */
173 return 0; 173 return 0;
174#endif /* ifdef ECORE_XDPMS */ 174#endif /* ifdef ECORE_XDPMS */
175} /* ecore_x_dpms_timeout_suspend_get */ 175}
176 176
177/** 177/**
178 * Returns the amount of time of inactivity before the third and final 178 * Returns the amount of time of inactivity before the third and final
@@ -192,11 +192,11 @@ ecore_x_dpms_timeout_off_get(void)
192#else /* ifdef ECORE_XDPMS */ 192#else /* ifdef ECORE_XDPMS */
193 return 0; 193 return 0;
194#endif /* ifdef ECORE_XDPMS */ 194#endif /* ifdef ECORE_XDPMS */
195} /* ecore_x_dpms_timeout_off_get */ 195}
196 196
197/** 197/**
198 * Sets the standby timeout (in unit of seconds). 198 * Sets the standby timeout (in unit of seconds).
199 * @param new_standby Amount of time of inactivity before standby mode will be invoked. 199 * @param new_timeout Amount of time of inactivity before standby mode will be invoked.
200 * @ingroup Ecore_X_DPMS_Group 200 * @ingroup Ecore_X_DPMS_Group
201 */ 201 */
202EAPI void 202EAPI void
@@ -209,11 +209,11 @@ ecore_x_dpms_timeout_standby_set(unsigned int new_timeout)
209 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off); 209 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
210 DPMSSetTimeouts(_ecore_x_disp, new_timeout, suspend, off); 210 DPMSSetTimeouts(_ecore_x_disp, new_timeout, suspend, off);
211#endif /* ifdef ECORE_XDPMS */ 211#endif /* ifdef ECORE_XDPMS */
212} /* ecore_x_dpms_timeout_standby_set */ 212}
213 213
214/** 214/**
215 * Sets the suspend timeout (in unit of seconds). 215 * Sets the suspend timeout (in unit of seconds).
216 * @param suspend Amount of time of inactivity before the screen is placed into suspend mode. 216 * @param new_timeout Amount of time of inactivity before the screen is placed into suspend mode.
217 * @ingroup Ecore_X_DPMS_Group 217 * @ingroup Ecore_X_DPMS_Group
218 */ 218 */
219EAPI void 219EAPI void
@@ -226,11 +226,11 @@ ecore_x_dpms_timeout_suspend_set(unsigned int new_timeout)
226 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off); 226 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
227 DPMSSetTimeouts(_ecore_x_disp, standby, new_timeout, off); 227 DPMSSetTimeouts(_ecore_x_disp, standby, new_timeout, off);
228#endif /* ifdef ECORE_XDPMS */ 228#endif /* ifdef ECORE_XDPMS */
229} /* ecore_x_dpms_timeout_suspend_set */ 229}
230 230
231/** 231/**
232 * Sets the off timeout (in unit of seconds). 232 * Sets the off timeout (in unit of seconds).
233 * @param off Amount of time of inactivity before the monitor is shut off. 233 * @param new_timeout Amount of time of inactivity before the monitor is shut off.
234 * @ingroup Ecore_X_DPMS_Group 234 * @ingroup Ecore_X_DPMS_Group
235 */ 235 */
236EAPI void 236EAPI void
@@ -243,5 +243,5 @@ ecore_x_dpms_timeout_off_set(unsigned int new_timeout)
243 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off); 243 DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
244 DPMSSetTimeouts(_ecore_x_disp, standby, suspend, new_timeout); 244 DPMSSetTimeouts(_ecore_x_disp, standby, suspend, new_timeout);
245#endif /* ifdef ECORE_XDPMS */ 245#endif /* ifdef ECORE_XDPMS */
246} /* ecore_x_dpms_timeout_off_set */ 246}
247 247
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
index a64060b..d1b4111 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
@@ -21,10 +21,10 @@
21 */ 21 */
22EAPI void 22EAPI void
23ecore_x_drawable_geometry_get(Ecore_X_Drawable d, 23ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
24 int *x, 24 int *x,
25 int *y, 25 int *y,
26 int *w, 26 int *w,
27 int *h) 27 int *h)
28{ 28{
29 Window dummy_win; 29 Window dummy_win;
30 int ret_x, ret_y; 30 int ret_x, ret_y;
@@ -51,7 +51,7 @@ ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
51 51
52 if (h) 52 if (h)
53 *h = (int)ret_h; 53 *h = (int)ret_h;
54} /* ecore_x_drawable_geometry_get */ 54}
55 55
56/** 56/**
57 * Retrieves the width of the border of the given drawable. 57 * Retrieves the width of the border of the given drawable.
@@ -72,7 +72,7 @@ ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
72 border_ret = 0; 72 border_ret = 0;
73 73
74 return (int)border_ret; 74 return (int)border_ret;
75} /* ecore_x_drawable_border_width_get */ 75}
76 76
77/** 77/**
78 * Retrieves the depth of the given drawable. 78 * Retrieves the depth of the given drawable.
@@ -93,7 +93,7 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d)
93 depth_ret = 0; 93 depth_ret = 0;
94 94
95 return (int)depth_ret; 95 return (int)depth_ret;
96} /* ecore_x_drawable_depth_get */ 96}
97 97
98/** 98/**
99 * Fill the specified rectangle on a drawable. 99 * Fill the specified rectangle on a drawable.
@@ -106,13 +106,13 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d)
106 */ 106 */
107EAPI void 107EAPI void
108ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d, 108ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d,
109 Ecore_X_GC gc, 109 Ecore_X_GC gc,
110 int x, 110 int x,
111 int y, 111 int y,
112 int width, 112 int width,
113 int height) 113 int height)
114{ 114{
115 LOGFN(__FILE__, __LINE__, __FUNCTION__); 115 LOGFN(__FILE__, __LINE__, __FUNCTION__);
116 XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height); 116 XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height);
117} /* ecore_x_drawable_rectangle_fill */ 117}
118 118
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_e.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
index d357c9b..5966bbd 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -14,14 +14,14 @@
14EAPI void 14EAPI void
15ecore_x_e_init(void) 15ecore_x_e_init(void)
16{ 16{
17} /* ecore_x_e_init */ 17}
18 18
19EAPI void 19EAPI void
20ecore_x_e_frame_size_set(Ecore_X_Window win, 20ecore_x_e_frame_size_set(Ecore_X_Window win,
21 int fl, 21 int fl,
22 int fr, 22 int fr,
23 int ft, 23 int ft,
24 int fb) 24 int fb)
25{ 25{
26 unsigned int frames[4]; 26 unsigned int frames[4];
27 27
@@ -31,16 +31,16 @@ ecore_x_e_frame_size_set(Ecore_X_Window win,
31 frames[2] = ft; 31 frames[2] = ft;
32 frames[3] = fb; 32 frames[3] = fb;
33 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_FRAME_SIZE, frames, 4); 33 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_FRAME_SIZE, frames, 4);
34} /* ecore_x_e_frame_size_set */ 34}
35 35
36EAPI void 36EAPI void
37ecore_x_e_virtual_keyboard_set(Ecore_X_Window win, 37ecore_x_e_virtual_keyboard_set(Ecore_X_Window win,
38 unsigned int is_keyboard) 38 unsigned int is_keyboard)
39{ 39{
40 LOGFN(__FILE__, __LINE__, __FUNCTION__); 40 LOGFN(__FILE__, __LINE__, __FUNCTION__);
41 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD, 41 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
42 &is_keyboard, 1); 42 &is_keyboard, 1);
43} /* ecore_x_e_virtual_keyboard_set */ 43}
44 44
45EAPI Eina_Bool 45EAPI Eina_Bool
46ecore_x_e_virtual_keyboard_get(Ecore_X_Window win) 46ecore_x_e_virtual_keyboard_get(Ecore_X_Window win)
@@ -53,7 +53,7 @@ ecore_x_e_virtual_keyboard_get(Ecore_X_Window win)
53 return EINA_FALSE; 53 return EINA_FALSE;
54 54
55 return val ? EINA_TRUE : EINA_FALSE; 55 return val ? EINA_TRUE : EINA_FALSE;
56} /* ecore_x_e_virtual_keyboard_get */ 56}
57 57
58static Ecore_X_Virtual_Keyboard_State 58static Ecore_X_Virtual_Keyboard_State
59_ecore_x_e_vkbd_state_get(Ecore_X_Atom atom) 59_ecore_x_e_vkbd_state_get(Ecore_X_Atom atom)
@@ -104,7 +104,7 @@ _ecore_x_e_vkbd_state_get(Ecore_X_Atom atom)
104 return ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME; 104 return ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME;
105 105
106 return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; 106 return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN;
107} /* _ecore_x_e_vkbd_state_get */ 107}
108 108
109static Ecore_X_Atom 109static Ecore_X_Atom
110_ecore_x_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state) 110_ecore_x_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state)
@@ -157,12 +157,12 @@ _ecore_x_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state)
157 return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME; 157 return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME;
158 158
159 default: break; 159 default: break;
160 } /* switch */ 160 }
161 return 0; 161 return 0;
162} /* _ecore_x_e_vkbd_atom_get */ 162}
163 163
164EAPI void 164EAPI void
165ecore_x_e_virtual_keyboard_state_set(Ecore_X_Window win, 165ecore_x_e_virtual_keyboard_state_set(Ecore_X_Window win,
166 Ecore_X_Virtual_Keyboard_State state) 166 Ecore_X_Virtual_Keyboard_State state)
167{ 167{
168 Ecore_X_Atom atom = 0; 168 Ecore_X_Atom atom = 0;
@@ -171,7 +171,7 @@ ecore_x_e_virtual_keyboard_state_set(Ecore_X_Window win,
171 atom = _ecore_x_e_vkbd_atom_get(state); 171 atom = _ecore_x_e_vkbd_atom_get(state);
172 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE, 172 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE,
173 &atom, 1); 173 &atom, 1);
174} /* ecore_x_e_virtual_keyboard_state_set */ 174}
175 175
176EAPI Ecore_X_Virtual_Keyboard_State 176EAPI Ecore_X_Virtual_Keyboard_State
177ecore_x_e_virtual_keyboard_state_get(Ecore_X_Window win) 177ecore_x_e_virtual_keyboard_state_get(Ecore_X_Window win)
@@ -184,10 +184,10 @@ ecore_x_e_virtual_keyboard_state_get(Ecore_X_Window win)
184 return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; 184 return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN;
185 185
186 return _ecore_x_e_vkbd_state_get(atom); 186 return _ecore_x_e_vkbd_state_get(atom);
187} /* ecore_x_e_virtual_keyboard_state_get */ 187}
188 188
189EAPI void 189EAPI void
190ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window win, 190ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window win,
191 Ecore_X_Virtual_Keyboard_State state) 191 Ecore_X_Virtual_Keyboard_State state)
192{ 192{
193 LOGFN(__FILE__, __LINE__, __FUNCTION__); 193 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -195,7 +195,7 @@ ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window win,
195 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 195 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
196 _ecore_x_e_vkbd_atom_get(state), 196 _ecore_x_e_vkbd_atom_get(state),
197 0, 0, 0, 0); 197 0, 0, 0, 0);
198} /* ecore_x_e_virtual_keyboard_state_send */ 198}
199 199
200static Ecore_X_Atom 200static Ecore_X_Atom
201_ecore_x_e_illume_atom_get(Ecore_X_Illume_Mode mode) 201_ecore_x_e_illume_atom_get(Ecore_X_Illume_Mode mode)
@@ -213,9 +213,9 @@ _ecore_x_e_illume_atom_get(Ecore_X_Illume_Mode mode)
213 213
214 default: 214 default:
215 break; 215 break;
216 } /* switch */ 216 }
217 return ECORE_X_ILLUME_MODE_UNKNOWN; 217 return ECORE_X_ILLUME_MODE_UNKNOWN;
218} /* _ecore_x_e_illume_atom_get */ 218}
219 219
220static Ecore_X_Illume_Mode 220static Ecore_X_Illume_Mode
221_ecore_x_e_illume_mode_get(Ecore_X_Atom atom) 221_ecore_x_e_illume_mode_get(Ecore_X_Atom atom)
@@ -230,7 +230,7 @@ _ecore_x_e_illume_mode_get(Ecore_X_Atom atom)
230 return ECORE_X_ILLUME_MODE_DUAL_LEFT; 230 return ECORE_X_ILLUME_MODE_DUAL_LEFT;
231 231
232 return ECORE_X_ILLUME_MODE_UNKNOWN; 232 return ECORE_X_ILLUME_MODE_UNKNOWN;
233} /* _ecore_x_e_illume_mode_get */ 233}
234 234
235EAPI void 235EAPI void
236ecore_x_e_illume_zone_set(Ecore_X_Window win, 236ecore_x_e_illume_zone_set(Ecore_X_Window win,
@@ -239,7 +239,7 @@ ecore_x_e_illume_zone_set(Ecore_X_Window win,
239 LOGFN(__FILE__, __LINE__, __FUNCTION__); 239 LOGFN(__FILE__, __LINE__, __FUNCTION__);
240 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE, 240 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE,
241 &zone, 1); 241 &zone, 1);
242} /* ecore_x_e_illume_zone_set */ 242}
243 243
244EAPI Ecore_X_Window 244EAPI Ecore_X_Window
245ecore_x_e_illume_zone_get(Ecore_X_Window win) 245ecore_x_e_illume_zone_get(Ecore_X_Window win)
@@ -252,26 +252,26 @@ ecore_x_e_illume_zone_get(Ecore_X_Window win)
252 return 0; 252 return 0;
253 253
254 return zone; 254 return zone;
255} /* ecore_x_e_illume_zone_get */ 255}
256 256
257EAPI void 257EAPI void
258ecore_x_e_illume_zone_list_set(Ecore_X_Window win, 258ecore_x_e_illume_zone_list_set(Ecore_X_Window win,
259 Ecore_X_Window *zones, 259 Ecore_X_Window *zones,
260 unsigned int n_zones) 260 unsigned int n_zones)
261{ 261{
262 LOGFN(__FILE__, __LINE__, __FUNCTION__); 262 LOGFN(__FILE__, __LINE__, __FUNCTION__);
263 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE_LIST, 263 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE_LIST,
264 zones, n_zones); 264 zones, n_zones);
265} /* ecore_x_e_illume_zone_list_set */ 265}
266 266
267EAPI void 267EAPI void
268ecore_x_e_illume_conformant_set(Ecore_X_Window win, 268ecore_x_e_illume_conformant_set(Ecore_X_Window win,
269 unsigned int is_conformant) 269 unsigned int is_conformant)
270{ 270{
271 LOGFN(__FILE__, __LINE__, __FUNCTION__); 271 LOGFN(__FILE__, __LINE__, __FUNCTION__);
272 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT, 272 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
273 &is_conformant, 1); 273 &is_conformant, 1);
274} /* ecore_x_e_illume_conformant_set */ 274}
275 275
276EAPI Eina_Bool 276EAPI Eina_Bool
277ecore_x_e_illume_conformant_get(Ecore_X_Window win) 277ecore_x_e_illume_conformant_get(Ecore_X_Window win)
@@ -284,10 +284,10 @@ ecore_x_e_illume_conformant_get(Ecore_X_Window win)
284 return EINA_FALSE; 284 return EINA_FALSE;
285 285
286 return val ? EINA_TRUE : EINA_FALSE; 286 return val ? EINA_TRUE : EINA_FALSE;
287} /* ecore_x_e_illume_conformant_get */ 287}
288 288
289EAPI void 289EAPI void
290ecore_x_e_illume_mode_set(Ecore_X_Window win, 290ecore_x_e_illume_mode_set(Ecore_X_Window win,
291 Ecore_X_Illume_Mode mode) 291 Ecore_X_Illume_Mode mode)
292{ 292{
293 Ecore_X_Atom atom = 0; 293 Ecore_X_Atom atom = 0;
@@ -296,7 +296,7 @@ ecore_x_e_illume_mode_set(Ecore_X_Window win,
296 atom = _ecore_x_e_illume_atom_get(mode); 296 atom = _ecore_x_e_illume_atom_get(mode);
297 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_MODE, 297 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_MODE,
298 &atom, 1); 298 &atom, 1);
299} /* ecore_x_e_illume_mode_set */ 299}
300 300
301EAPI Ecore_X_Illume_Mode 301EAPI Ecore_X_Illume_Mode
302ecore_x_e_illume_mode_get(Ecore_X_Window win) 302ecore_x_e_illume_mode_get(Ecore_X_Window win)
@@ -308,10 +308,10 @@ ecore_x_e_illume_mode_get(Ecore_X_Window win)
308 return ECORE_X_ILLUME_MODE_UNKNOWN; 308 return ECORE_X_ILLUME_MODE_UNKNOWN;
309 309
310 return _ecore_x_e_illume_mode_get(atom); 310 return _ecore_x_e_illume_mode_get(atom);
311} /* ecore_x_e_illume_mode_get */ 311}
312 312
313EAPI void 313EAPI void
314ecore_x_e_illume_mode_send(Ecore_X_Window win, 314ecore_x_e_illume_mode_send(Ecore_X_Window win,
315 Ecore_X_Illume_Mode mode) 315 Ecore_X_Illume_Mode mode)
316{ 316{
317 LOGFN(__FILE__, __LINE__, __FUNCTION__); 317 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -319,7 +319,7 @@ ecore_x_e_illume_mode_send(Ecore_X_Window win,
319 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 319 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
320 _ecore_x_e_illume_atom_get(mode), 320 _ecore_x_e_illume_atom_get(mode),
321 0, 0, 0, 0); 321 0, 0, 0, 0);
322} /* ecore_x_e_illume_mode_send */ 322}
323 323
324EAPI void 324EAPI void
325ecore_x_e_illume_focus_back_send(Ecore_X_Window win) 325ecore_x_e_illume_focus_back_send(Ecore_X_Window win)
@@ -328,7 +328,7 @@ ecore_x_e_illume_focus_back_send(Ecore_X_Window win)
328 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_BACK, 328 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_BACK,
329 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 329 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
330 1, 0, 0, 0, 0); 330 1, 0, 0, 0, 0);
331} /* ecore_x_e_illume_focus_back_send */ 331}
332 332
333EAPI void 333EAPI void
334ecore_x_e_illume_focus_forward_send(Ecore_X_Window win) 334ecore_x_e_illume_focus_forward_send(Ecore_X_Window win)
@@ -337,7 +337,7 @@ ecore_x_e_illume_focus_forward_send(Ecore_X_Window win)
337 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_FORWARD, 337 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_FORWARD,
338 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 338 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
339 1, 0, 0, 0, 0); 339 1, 0, 0, 0, 0);
340} /* ecore_x_e_illume_focus_forward_send */ 340}
341 341
342EAPI void 342EAPI void
343ecore_x_e_illume_focus_home_send(Ecore_X_Window win) 343ecore_x_e_illume_focus_home_send(Ecore_X_Window win)
@@ -346,7 +346,7 @@ ecore_x_e_illume_focus_home_send(Ecore_X_Window win)
346 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_HOME, 346 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_HOME,
347 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 347 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
348 1, 0, 0, 0, 0); 348 1, 0, 0, 0, 0);
349} /* ecore_x_e_illume_focus_home_send */ 349}
350 350
351EAPI void 351EAPI void
352ecore_x_e_illume_close_send(Ecore_X_Window win) 352ecore_x_e_illume_close_send(Ecore_X_Window win)
@@ -355,7 +355,7 @@ ecore_x_e_illume_close_send(Ecore_X_Window win)
355 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_CLOSE, 355 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_CLOSE,
356 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 356 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
357 1, 0, 0, 0, 0); 357 1, 0, 0, 0, 0);
358} /* ecore_x_e_illume_close_send */ 358}
359 359
360EAPI void 360EAPI void
361ecore_x_e_illume_home_new_send(Ecore_X_Window win) 361ecore_x_e_illume_home_new_send(Ecore_X_Window win)
@@ -364,7 +364,7 @@ ecore_x_e_illume_home_new_send(Ecore_X_Window win)
364 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_NEW, 364 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_NEW,
365 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 365 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
366 1, 0, 0, 0, 0); 366 1, 0, 0, 0, 0);
367} /* ecore_x_e_illume_home_new_send */ 367}
368 368
369EAPI void 369EAPI void
370ecore_x_e_illume_home_del_send(Ecore_X_Window win) 370ecore_x_e_illume_home_del_send(Ecore_X_Window win)
@@ -373,15 +373,15 @@ ecore_x_e_illume_home_del_send(Ecore_X_Window win)
373 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_DEL, 373 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_DEL,
374 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 374 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
375 1, 0, 0, 0, 0); 375 1, 0, 0, 0, 0);
376} /* ecore_x_e_illume_home_del_send */ 376}
377 377
378EAPI void 378EAPI void
379ecore_x_e_illume_drag_set(Ecore_X_Window win, 379ecore_x_e_illume_drag_set(Ecore_X_Window win,
380 unsigned int drag) 380 unsigned int drag)
381{ 381{
382 LOGFN(__FILE__, __LINE__, __FUNCTION__); 382 LOGFN(__FILE__, __LINE__, __FUNCTION__);
383 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG, &drag, 1); 383 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG, &drag, 1);
384} /* ecore_x_e_illume_drag_set */ 384}
385 385
386EAPI Eina_Bool 386EAPI Eina_Bool
387ecore_x_e_illume_drag_get(Ecore_X_Window win) 387ecore_x_e_illume_drag_get(Ecore_X_Window win)
@@ -393,16 +393,16 @@ ecore_x_e_illume_drag_get(Ecore_X_Window win)
393 return EINA_FALSE; 393 return EINA_FALSE;
394 394
395 return val ? EINA_TRUE : EINA_FALSE; 395 return val ? EINA_TRUE : EINA_FALSE;
396} /* ecore_x_e_illume_drag_get */ 396}
397 397
398EAPI void 398EAPI void
399ecore_x_e_illume_drag_locked_set(Ecore_X_Window win, 399ecore_x_e_illume_drag_locked_set(Ecore_X_Window win,
400 unsigned int is_locked) 400 unsigned int is_locked)
401{ 401{
402 LOGFN(__FILE__, __LINE__, __FUNCTION__); 402 LOGFN(__FILE__, __LINE__, __FUNCTION__);
403 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED, 403 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
404 &is_locked, 1); 404 &is_locked, 1);
405} /* ecore_x_e_illume_drag_locked_set */ 405}
406 406
407EAPI Eina_Bool 407EAPI Eina_Bool
408ecore_x_e_illume_drag_locked_get(Ecore_X_Window win) 408ecore_x_e_illume_drag_locked_get(Ecore_X_Window win)
@@ -415,7 +415,7 @@ ecore_x_e_illume_drag_locked_get(Ecore_X_Window win)
415 return EINA_FALSE; 415 return EINA_FALSE;
416 416
417 return val ? EINA_TRUE : EINA_FALSE; 417 return val ? EINA_TRUE : EINA_FALSE;
418} /* ecore_x_e_illume_drag_locked_get */ 418}
419 419
420EAPI void 420EAPI void
421ecore_x_e_illume_drag_start_send(Ecore_X_Window win) 421ecore_x_e_illume_drag_start_send(Ecore_X_Window win)
@@ -424,7 +424,7 @@ ecore_x_e_illume_drag_start_send(Ecore_X_Window win)
424 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_START, 424 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_START,
425 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 425 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
426 1, 0, 0, 0, 0); 426 1, 0, 0, 0, 0);
427} /* ecore_x_e_illume_drag_start_send */ 427}
428 428
429EAPI void 429EAPI void
430ecore_x_e_illume_drag_end_send(Ecore_X_Window win) 430ecore_x_e_illume_drag_end_send(Ecore_X_Window win)
@@ -433,14 +433,14 @@ ecore_x_e_illume_drag_end_send(Ecore_X_Window win)
433 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_END, 433 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_END,
434 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 434 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
435 1, 0, 0, 0, 0); 435 1, 0, 0, 0, 0);
436} /* ecore_x_e_illume_drag_end_send */ 436}
437 437
438EAPI void 438EAPI void
439ecore_x_e_illume_indicator_geometry_set(Ecore_X_Window win, 439ecore_x_e_illume_indicator_geometry_set(Ecore_X_Window win,
440 int x, 440 int x,
441 int y, 441 int y,
442 int w, 442 int w,
443 int h) 443 int h)
444{ 444{
445 unsigned int geom[4]; 445 unsigned int geom[4];
446 446
@@ -451,14 +451,14 @@ ecore_x_e_illume_indicator_geometry_set(Ecore_X_Window win,
451 geom[3] = h; 451 geom[3] = h;
452 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY, 452 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY,
453 geom, 4); 453 geom, 4);
454} /* ecore_x_e_illume_indicator_geometry_set */ 454}
455 455
456EAPI Eina_Bool 456EAPI Eina_Bool
457ecore_x_e_illume_indicator_geometry_get(Ecore_X_Window win, 457ecore_x_e_illume_indicator_geometry_get(Ecore_X_Window win,
458 int *x, 458 int *x,
459 int *y, 459 int *y,
460 int *w, 460 int *w,
461 int *h) 461 int *h)
462{ 462{
463 int ret = 0; 463 int ret = 0;
464 unsigned int geom[4]; 464 unsigned int geom[4];
@@ -484,14 +484,14 @@ ecore_x_e_illume_indicator_geometry_get(Ecore_X_Window win,
484 *h = geom[3]; 484 *h = geom[3];
485 485
486 return EINA_TRUE; 486 return EINA_TRUE;
487} /* ecore_x_e_illume_indicator_geometry_get */ 487}
488 488
489EAPI void 489EAPI void
490ecore_x_e_illume_softkey_geometry_set(Ecore_X_Window win, 490ecore_x_e_illume_softkey_geometry_set(Ecore_X_Window win,
491 int x, 491 int x,
492 int y, 492 int y,
493 int w, 493 int w,
494 int h) 494 int h)
495{ 495{
496 unsigned int geom[4]; 496 unsigned int geom[4];
497 497
@@ -502,14 +502,14 @@ ecore_x_e_illume_softkey_geometry_set(Ecore_X_Window win,
502 geom[3] = h; 502 geom[3] = h;
503 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY, 503 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY,
504 geom, 4); 504 geom, 4);
505} /* ecore_x_e_illume_softkey_geometry_set */ 505}
506 506
507EAPI Eina_Bool 507EAPI Eina_Bool
508ecore_x_e_illume_softkey_geometry_get(Ecore_X_Window win, 508ecore_x_e_illume_softkey_geometry_get(Ecore_X_Window win,
509 int *x, 509 int *x,
510 int *y, 510 int *y,
511 int *w, 511 int *w,
512 int *h) 512 int *h)
513{ 513{
514 int ret = 0; 514 int ret = 0;
515 unsigned int geom[4]; 515 unsigned int geom[4];
@@ -535,14 +535,14 @@ ecore_x_e_illume_softkey_geometry_get(Ecore_X_Window win,
535 *h = geom[3]; 535 *h = geom[3];
536 536
537 return EINA_TRUE; 537 return EINA_TRUE;
538} /* ecore_x_e_illume_softkey_geometry_get */ 538}
539 539
540EAPI void 540EAPI void
541ecore_x_e_illume_keyboard_geometry_set(Ecore_X_Window win, 541ecore_x_e_illume_keyboard_geometry_set(Ecore_X_Window win,
542 int x, 542 int x,
543 int y, 543 int y,
544 int w, 544 int w,
545 int h) 545 int h)
546{ 546{
547 unsigned int geom[4]; 547 unsigned int geom[4];
548 548
@@ -553,14 +553,14 @@ ecore_x_e_illume_keyboard_geometry_set(Ecore_X_Window win,
553 geom[3] = h; 553 geom[3] = h;
554 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY, 554 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY,
555 geom, 4); 555 geom, 4);
556} /* ecore_x_e_illume_keyboard_geometry_set */ 556}
557 557
558EAPI Eina_Bool 558EAPI Eina_Bool
559ecore_x_e_illume_keyboard_geometry_get(Ecore_X_Window win, 559ecore_x_e_illume_keyboard_geometry_get(Ecore_X_Window win,
560 int *x, 560 int *x,
561 int *y, 561 int *y,
562 int *w, 562 int *w,
563 int *h) 563 int *h)
564{ 564{
565 int ret = 0; 565 int ret = 0;
566 unsigned int geom[4]; 566 unsigned int geom[4];
@@ -586,7 +586,7 @@ ecore_x_e_illume_keyboard_geometry_get(Ecore_X_Window win,
586 *h = geom[3]; 586 *h = geom[3];
587 587
588 return EINA_TRUE; 588 return EINA_TRUE;
589} /* ecore_x_e_illume_keyboard_geometry_get */ 589}
590 590
591static Ecore_X_Atom 591static Ecore_X_Atom
592_ecore_x_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state) 592_ecore_x_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state)
@@ -601,9 +601,9 @@ _ecore_x_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state)
601 601
602 default: 602 default:
603 break; 603 break;
604 } /* switch */ 604 }
605 return 0; 605 return 0;
606} /* _ecore_x_e_quickpanel_atom_get */ 606}
607 607
608static Ecore_X_Illume_Quickpanel_State 608static Ecore_X_Illume_Quickpanel_State
609_ecore_x_e_quickpanel_state_get(Ecore_X_Atom atom) 609_ecore_x_e_quickpanel_state_get(Ecore_X_Atom atom)
@@ -615,16 +615,16 @@ _ecore_x_e_quickpanel_state_get(Ecore_X_Atom atom)
615 return ECORE_X_ILLUME_QUICKPANEL_STATE_OFF; 615 return ECORE_X_ILLUME_QUICKPANEL_STATE_OFF;
616 616
617 return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN; 617 return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN;
618} /* _ecore_x_e_quickpanel_state_get */ 618}
619 619
620EAPI void 620EAPI void
621ecore_x_e_illume_quickpanel_set(Ecore_X_Window win, 621ecore_x_e_illume_quickpanel_set(Ecore_X_Window win,
622 unsigned int is_quickpanel) 622 unsigned int is_quickpanel)
623{ 623{
624 LOGFN(__FILE__, __LINE__, __FUNCTION__); 624 LOGFN(__FILE__, __LINE__, __FUNCTION__);
625 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL, 625 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
626 &is_quickpanel, 1); 626 &is_quickpanel, 1);
627} /* ecore_x_e_illume_quickpanel_set */ 627}
628 628
629EAPI Eina_Bool 629EAPI Eina_Bool
630ecore_x_e_illume_quickpanel_get(Ecore_X_Window win) 630ecore_x_e_illume_quickpanel_get(Ecore_X_Window win)
@@ -637,10 +637,10 @@ ecore_x_e_illume_quickpanel_get(Ecore_X_Window win)
637 return EINA_FALSE; 637 return EINA_FALSE;
638 638
639 return val ? EINA_TRUE : EINA_FALSE; 639 return val ? EINA_TRUE : EINA_FALSE;
640} /* ecore_x_e_illume_quickpanel_get */ 640}
641 641
642EAPI void 642EAPI void
643ecore_x_e_illume_quickpanel_state_set(Ecore_X_Window win, 643ecore_x_e_illume_quickpanel_state_set(Ecore_X_Window win,
644 Ecore_X_Illume_Quickpanel_State state) 644 Ecore_X_Illume_Quickpanel_State state)
645{ 645{
646 Ecore_X_Atom atom = 0; 646 Ecore_X_Atom atom = 0;
@@ -649,7 +649,7 @@ ecore_x_e_illume_quickpanel_state_set(Ecore_X_Window win,
649 atom = _ecore_x_e_quickpanel_atom_get(state); 649 atom = _ecore_x_e_quickpanel_atom_get(state);
650 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE, 650 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE,
651 &atom, 1); 651 &atom, 1);
652} /* ecore_x_e_illume_quickpanel_state_set */ 652}
653 653
654EAPI Ecore_X_Illume_Quickpanel_State 654EAPI Ecore_X_Illume_Quickpanel_State
655ecore_x_e_illume_quickpanel_state_get(Ecore_X_Window win) 655ecore_x_e_illume_quickpanel_state_get(Ecore_X_Window win)
@@ -663,10 +663,10 @@ ecore_x_e_illume_quickpanel_state_get(Ecore_X_Window win)
663 return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN; 663 return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN;
664 664
665 return _ecore_x_e_quickpanel_state_get(atom); 665 return _ecore_x_e_quickpanel_state_get(atom);
666} /* ecore_x_e_illume_quickpanel_state_get */ 666}
667 667
668EAPI void 668EAPI void
669ecore_x_e_illume_quickpanel_state_send(Ecore_X_Window win, 669ecore_x_e_illume_quickpanel_state_send(Ecore_X_Window win,
670 Ecore_X_Illume_Quickpanel_State state) 670 Ecore_X_Illume_Quickpanel_State state)
671{ 671{
672 LOGFN(__FILE__, __LINE__, __FUNCTION__); 672 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -674,7 +674,7 @@ ecore_x_e_illume_quickpanel_state_send(Ecore_X_Window win,
674 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 674 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
675 _ecore_x_e_quickpanel_atom_get(state), 675 _ecore_x_e_quickpanel_atom_get(state),
676 0, 0, 0, 0); 676 0, 0, 0, 0);
677} /* ecore_x_e_illume_quickpanel_state_send */ 677}
678 678
679EAPI void 679EAPI void
680ecore_x_e_illume_quickpanel_state_toggle(Ecore_X_Window win) 680ecore_x_e_illume_quickpanel_state_toggle(Ecore_X_Window win)
@@ -684,17 +684,17 @@ ecore_x_e_illume_quickpanel_state_toggle(Ecore_X_Window win)
684 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE_TOGGLE, 684 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE_TOGGLE,
685 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 685 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
686 0, 0, 0, 0, 0); 686 0, 0, 0, 0, 0);
687} /* ecore_x_e_illume_quickpanel_state_toggle */ 687}
688 688
689EAPI void 689EAPI void
690ecore_x_e_illume_quickpanel_priority_major_set(Ecore_X_Window win, 690ecore_x_e_illume_quickpanel_priority_major_set(Ecore_X_Window win,
691 unsigned int priority) 691 unsigned int priority)
692{ 692{
693 LOGFN(__FILE__, __LINE__, __FUNCTION__); 693 LOGFN(__FILE__, __LINE__, __FUNCTION__);
694 ecore_x_window_prop_card32_set(win, 694 ecore_x_window_prop_card32_set(win,
695 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR, 695 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR,
696 &priority, 1); 696 &priority, 1);
697} /* ecore_x_e_illume_quickpanel_priority_major_set */ 697}
698 698
699EAPI int 699EAPI int
700ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win) 700ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win)
@@ -708,17 +708,17 @@ ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win)
708 return 0; 708 return 0;
709 709
710 return val; 710 return val;
711} /* ecore_x_e_illume_quickpanel_priority_major_get */ 711}
712 712
713EAPI void 713EAPI void
714ecore_x_e_illume_quickpanel_priority_minor_set(Ecore_X_Window win, 714ecore_x_e_illume_quickpanel_priority_minor_set(Ecore_X_Window win,
715 unsigned int priority) 715 unsigned int priority)
716{ 716{
717 LOGFN(__FILE__, __LINE__, __FUNCTION__); 717 LOGFN(__FILE__, __LINE__, __FUNCTION__);
718 ecore_x_window_prop_card32_set(win, 718 ecore_x_window_prop_card32_set(win,
719 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR, 719 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR,
720 &priority, 1); 720 &priority, 1);
721} /* ecore_x_e_illume_quickpanel_priority_minor_set */ 721}
722 722
723EAPI int 723EAPI int
724ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win) 724ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
@@ -732,17 +732,17 @@ ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
732 return 0; 732 return 0;
733 733
734 return val; 734 return val;
735} /* ecore_x_e_illume_quickpanel_priority_minor_get */ 735}
736 736
737EAPI void 737EAPI void
738ecore_x_e_illume_quickpanel_zone_set(Ecore_X_Window win, 738ecore_x_e_illume_quickpanel_zone_set(Ecore_X_Window win,
739 unsigned int zone) 739 unsigned int zone)
740{ 740{
741 LOGFN(__FILE__, __LINE__, __FUNCTION__); 741 LOGFN(__FILE__, __LINE__, __FUNCTION__);
742 ecore_x_window_prop_card32_set(win, 742 ecore_x_window_prop_card32_set(win,
743 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE, 743 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE,
744 &zone, 1); 744 &zone, 1);
745} /* ecore_x_e_illume_quickpanel_zone_set */ 745}
746 746
747EAPI int 747EAPI int
748ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win) 748ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win)
@@ -756,7 +756,7 @@ ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win)
756 return 0; 756 return 0;
757 757
758 return val; 758 return val;
759} /* ecore_x_e_illume_quickpanel_zone_get */ 759}
760 760
761EAPI void 761EAPI void
762ecore_x_e_illume_quickpanel_position_update_send(Ecore_X_Window win) 762ecore_x_e_illume_quickpanel_position_update_send(Ecore_X_Window win)
@@ -766,10 +766,10 @@ ecore_x_e_illume_quickpanel_position_update_send(Ecore_X_Window win)
766 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE, 766 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE,
767 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 767 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
768 1, 0, 0, 0, 0); 768 1, 0, 0, 0, 0);
769} /* ecore_x_e_illume_quickpanel_position_update_send */ 769}
770 770
771EAPI void 771EAPI void
772ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, 772ecore_x_e_comp_sync_counter_set(Ecore_X_Window win,
773 Ecore_X_Sync_Counter counter) 773 Ecore_X_Sync_Counter counter)
774{ 774{
775 LOGFN(__FILE__, __LINE__, __FUNCTION__); 775 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -778,7 +778,7 @@ ecore_x_e_comp_sync_counter_set(Ecore_X_Window win,
778 ECORE_X_ATOM_CARDINAL, &counter, 1); 778 ECORE_X_ATOM_CARDINAL, &counter, 1);
779 else 779 else
780 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER); 780 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER);
781} /* ecore_x_e_comp_sync_counter_set */ 781}
782 782
783EAPI Ecore_X_Sync_Counter 783EAPI Ecore_X_Sync_Counter
784ecore_x_e_comp_sync_counter_get(Ecore_X_Window win) 784ecore_x_e_comp_sync_counter_get(Ecore_X_Window win)
@@ -796,7 +796,7 @@ ecore_x_e_comp_sync_counter_get(Ecore_X_Window win)
796 return 0; 796 return 0;
797 797
798 return counter; 798 return counter;
799} /* ecore_x_e_comp_sync_counter_get */ 799}
800 800
801EAPI void 801EAPI void
802ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, 802ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
@@ -822,13 +822,13 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
822 XSendEvent(_ecore_x_disp, root, False, 822 XSendEvent(_ecore_x_disp, root, False,
823 SubstructureRedirectMask | SubstructureNotifyMask, 823 SubstructureRedirectMask | SubstructureNotifyMask,
824 &xev); 824 &xev);
825} /* ecore_x_e_comp_sync_draw_done_send */ 825}
826 826
827EAPI void 827EAPI void
828ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, 828ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
829 Ecore_X_Window win, 829 Ecore_X_Window win,
830 int w, 830 int w,
831 int h) 831 int h)
832{ 832{
833 XEvent xev; 833 XEvent xev;
834 834
@@ -850,11 +850,11 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
850 XSendEvent(_ecore_x_disp, root, False, 850 XSendEvent(_ecore_x_disp, root, False,
851 SubstructureRedirectMask | SubstructureNotifyMask, 851 SubstructureRedirectMask | SubstructureNotifyMask,
852 &xev); 852 &xev);
853} /* ecore_x_e_comp_sync_draw_done_send */ 853}
854 854
855EAPI void 855EAPI void
856ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, 856ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
857 Eina_Bool enabled) 857 Eina_Bool enabled)
858{ 858{
859 Ecore_X_Window win; 859 Ecore_X_Window win;
860 860
@@ -887,7 +887,7 @@ ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
887 ecore_x_window_free(win); 887 ecore_x_window_free(win);
888 } 888 }
889 } 889 }
890} /* ecore_x_e_comp_sync_supported_set */ 890}
891 891
892EAPI Eina_Bool 892EAPI Eina_Bool
893ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) 893ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
@@ -916,7 +916,7 @@ ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
916 } 916 }
917 917
918 return EINA_FALSE; 918 return EINA_FALSE;
919} /* ecore_x_e_comp_sync_supported_get */ 919}
920 920
921EAPI void 921EAPI void
922ecore_x_e_comp_sync_begin_send(Ecore_X_Window win) 922ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
@@ -938,7 +938,7 @@ ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
938 XSendEvent(_ecore_x_disp, win, False, 938 XSendEvent(_ecore_x_disp, win, False,
939 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 939 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
940 &xev); 940 &xev);
941} /* ecore_x_e_comp_sync_begin_send */ 941}
942 942
943EAPI void 943EAPI void
944ecore_x_e_comp_sync_end_send(Ecore_X_Window win) 944ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
@@ -960,7 +960,7 @@ ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
960 XSendEvent(_ecore_x_disp, win, False, 960 XSendEvent(_ecore_x_disp, win, False,
961 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 961 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
962 &xev); 962 &xev);
963} /* ecore_x_e_comp_sync_end_send */ 963}
964 964
965EAPI void 965EAPI void
966ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win) 966ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
@@ -982,7 +982,7 @@ ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
982 XSendEvent(_ecore_x_disp, win, False, 982 XSendEvent(_ecore_x_disp, win, False,
983 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 983 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
984 &xev); 984 &xev);
985} /* ecore_x_e_comp_sync_cancel_send */ 985}
986 986
987EAPI void 987EAPI void
988ecore_x_e_comp_flush_send(Ecore_X_Window win) 988ecore_x_e_comp_flush_send(Ecore_X_Window win)
@@ -1004,7 +1004,7 @@ ecore_x_e_comp_flush_send(Ecore_X_Window win)
1004 XSendEvent(_ecore_x_disp, win, False, 1004 XSendEvent(_ecore_x_disp, win, False,
1005 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1005 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1006 &xev); 1006 &xev);
1007} /* ecore_x_e_comp_flush_send */ 1007}
1008 1008
1009EAPI void 1009EAPI void
1010ecore_x_e_comp_dump_send(Ecore_X_Window win) 1010ecore_x_e_comp_dump_send(Ecore_X_Window win)
@@ -1026,7 +1026,7 @@ ecore_x_e_comp_dump_send(Ecore_X_Window win)
1026 XSendEvent(_ecore_x_disp, win, False, 1026 XSendEvent(_ecore_x_disp, win, False,
1027 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1027 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1028 &xev); 1028 &xev);
1029} /* ecore_x_e_comp_dump_send */ 1029}
1030 1030
1031EAPI void 1031EAPI void
1032ecore_x_e_comp_pixmap_set(Ecore_X_Window win, 1032ecore_x_e_comp_pixmap_set(Ecore_X_Window win,
@@ -1038,7 +1038,7 @@ ecore_x_e_comp_pixmap_set(Ecore_X_Window win,
1038 ECORE_X_ATOM_PIXMAP, &pixmap, 1); 1038 ECORE_X_ATOM_PIXMAP, &pixmap, 1);
1039 else 1039 else
1040 ecore_x_window_prop_property_del(win, pixmap); 1040 ecore_x_window_prop_property_del(win, pixmap);
1041} /* ecore_x_e_comp_pixmap_set */ 1041}
1042 1042
1043EAPI Ecore_X_Pixmap 1043EAPI Ecore_X_Pixmap
1044ecore_x_e_comp_pixmap_get(Ecore_X_Window win) 1044ecore_x_e_comp_pixmap_get(Ecore_X_Window win)
@@ -1056,5 +1056,5 @@ ecore_x_e_comp_pixmap_get(Ecore_X_Window win)
1056 return 0; 1056 return 0;
1057 1057
1058 return pixmap; 1058 return pixmap;
1059} /* ecore_x_e_comp_pixmap_get */ 1059}
1060 1060
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
index 837ff53..11e9f20 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
@@ -9,7 +9,7 @@
9#include "ecore_x_private.h" 9#include "ecore_x_private.h"
10#include "Ecore_X.h" 10#include "Ecore_X.h"
11 11
12static int _ecore_x_error_handle(Display *d, 12static int _ecore_x_error_handle(Display *d,
13 XErrorEvent *ev); 13 XErrorEvent *ev);
14static int _ecore_x_io_error_handle(Display *d); 14static int _ecore_x_io_error_handle(Display *d);
15 15
@@ -19,6 +19,7 @@ static void (*_io_error_func)(void *data) = NULL;
19static void *_io_error_data = NULL; 19static void *_io_error_data = NULL;
20static int _error_request_code = 0; 20static int _error_request_code = 0;
21static int _error_code = 0; 21static int _error_code = 0;
22static Ecore_X_ID _error_resource_id = 0;
22 23
23/** 24/**
24 * Set the error handler. 25 * Set the error handler.
@@ -28,12 +29,12 @@ static int _error_code = 0;
28 * Set the X error handler function 29 * Set the X error handler function
29 */ 30 */
30EAPI void 31EAPI void
31ecore_x_error_handler_set(void (*func)(void *data), 32ecore_x_error_handler_set(void (*func)(void *data),
32 const void *data) 33 const void *data)
33{ 34{
34 _error_func = func; 35 _error_func = func;
35 _error_data = (void *)data; 36 _error_data = (void *)data;
36} /* ecore_x_error_handler_set */ 37}
37 38
38/** 39/**
39 * Set the I/O error handler. 40 * Set the I/O error handler.
@@ -43,12 +44,12 @@ ecore_x_error_handler_set(void (*func)(void *data),
43 * Set the X I/O error handler function 44 * Set the X I/O error handler function
44 */ 45 */
45EAPI void 46EAPI void
46ecore_x_io_error_handler_set(void (*func)(void *data), 47ecore_x_io_error_handler_set(void (*func)(void *data),
47 const void *data) 48 const void *data)
48{ 49{
49 _io_error_func = func; 50 _io_error_func = func;
50 _io_error_data = (void *)data; 51 _io_error_data = (void *)data;
51} /* ecore_x_io_error_handler_set */ 52}
52 53
53/** 54/**
54 * Get the request code that caused the error. 55 * Get the request code that caused the error.
@@ -60,7 +61,7 @@ EAPI int
60ecore_x_error_request_get(void) 61ecore_x_error_request_get(void)
61{ 62{
62 return _error_request_code; 63 return _error_request_code;
63} /* ecore_x_error_request_get */ 64}
64 65
65/** 66/**
66 * Get the error code from the error. 67 * Get the error code from the error.
@@ -72,28 +73,41 @@ EAPI int
72ecore_x_error_code_get(void) 73ecore_x_error_code_get(void)
73{ 74{
74 return _error_code; 75 return _error_code;
75} /* ecore_x_error_code_get */ 76}
77
78/**
79 * Get the resource id that caused the error.
80 * @return The resource id causing the X error
81 *
82 * Return the X resource id that caused the last X error
83 */
84EAPI Ecore_X_ID
85ecore_x_error_resource_id_get(void)
86{
87 return _error_resource_id;
88}
76 89
77void 90void
78_ecore_x_error_handler_init(void) 91_ecore_x_error_handler_init(void)
79{ 92{
80 XSetErrorHandler((XErrorHandler)_ecore_x_error_handle); 93 XSetErrorHandler((XErrorHandler)_ecore_x_error_handle);
81 XSetIOErrorHandler((XIOErrorHandler)_ecore_x_io_error_handle); 94 XSetIOErrorHandler((XIOErrorHandler)_ecore_x_io_error_handle);
82} /* _ecore_x_error_handler_init */ 95}
83 96
84static int 97static int
85_ecore_x_error_handle(Display *d, 98_ecore_x_error_handle(Display *d,
86 XErrorEvent *ev) 99 XErrorEvent *ev)
87{ 100{
88 if (d == _ecore_x_disp) 101 if (d == _ecore_x_disp)
89 { 102 {
90 _error_request_code = ev->request_code; 103 _error_request_code = ev->request_code;
91 _error_code = ev->error_code; 104 _error_code = ev->error_code;
105 _error_resource_id = ev->resourceid;
92 if (_error_func) 106 if (_error_func)
93 _error_func(_error_data); 107 _error_func(_error_data);
94 } 108 }
95 return 0; 109 return 0;
96} /* _ecore_x_error_handle */ 110}
97 111
98static int 112static int
99_ecore_x_io_error_handle(Display *d) 113_ecore_x_io_error_handle(Display *d)
@@ -107,5 +121,5 @@ _ecore_x_io_error_handle(Display *d)
107 } 121 }
108 122
109 return 0; 123 return 0;
110} /* _ecore_x_io_error_handle */ 124}
111 125
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_events.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
index 136cd63..0b06a79 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -100,10 +100,10 @@ _ecore_x_event_free_mouse_move(void *data __UNUSED__,
100 } 100 }
101 101
102 free(e); 102 free(e);
103} /* _ecore_x_event_free_mouse_move */ 103}
104 104
105EAPI void 105EAPI void
106ecore_x_event_mask_set(Ecore_X_Window w, 106ecore_x_event_mask_set(Ecore_X_Window w,
107 Ecore_X_Event_Mask mask) 107 Ecore_X_Event_Mask mask)
108{ 108{
109 XWindowAttributes attr; 109 XWindowAttributes attr;
@@ -117,10 +117,10 @@ ecore_x_event_mask_set(Ecore_X_Window w,
117 XGetWindowAttributes(_ecore_x_disp, w, &attr); 117 XGetWindowAttributes(_ecore_x_disp, w, &attr);
118 s_attr.event_mask = mask | attr.your_event_mask; 118 s_attr.event_mask = mask | attr.your_event_mask;
119 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr); 119 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
120} /* ecore_x_event_mask_set */ 120}
121 121
122EAPI void 122EAPI void
123ecore_x_event_mask_unset(Ecore_X_Window w, 123ecore_x_event_mask_unset(Ecore_X_Window w,
124 Ecore_X_Event_Mask mask) 124 Ecore_X_Event_Mask mask)
125{ 125{
126 XWindowAttributes attr; 126 XWindowAttributes attr;
@@ -134,7 +134,7 @@ ecore_x_event_mask_unset(Ecore_X_Window w,
134 XGetWindowAttributes(_ecore_x_disp, w, &attr); 134 XGetWindowAttributes(_ecore_x_disp, w, &attr);
135 s_attr.event_mask = attr.your_event_mask & ~mask; 135 s_attr.event_mask = attr.your_event_mask & ~mask;
136 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr); 136 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
137} /* ecore_x_event_mask_unset */ 137}
138 138
139static void 139static void
140_ecore_x_event_free_xdnd_enter(void *data __UNUSED__, 140_ecore_x_event_free_xdnd_enter(void *data __UNUSED__,
@@ -148,7 +148,7 @@ _ecore_x_event_free_xdnd_enter(void *data __UNUSED__,
148 XFree(e->types[i]); 148 XFree(e->types[i]);
149 free(e->types); 149 free(e->types);
150 free(e); 150 free(e);
151} /* _ecore_x_event_free_xdnd_enter */ 151}
152 152
153static void 153static void
154_ecore_x_event_free_selection_notify(void *data __UNUSED__, 154_ecore_x_event_free_selection_notify(void *data __UNUSED__,
@@ -164,7 +164,7 @@ _ecore_x_event_free_selection_notify(void *data __UNUSED__,
164 164
165 free(e->target); 165 free(e->target);
166 free(e); 166 free(e);
167} /* _ecore_x_event_free_selection_notify */ 167}
168 168
169static unsigned int 169static unsigned int
170_ecore_x_event_modifiers(unsigned int state) 170_ecore_x_event_modifiers(unsigned int state)
@@ -196,28 +196,28 @@ _ecore_x_event_modifiers(unsigned int state)
196 modifiers |= ECORE_EVENT_LOCK_SHIFT; 196 modifiers |= ECORE_EVENT_LOCK_SHIFT;
197 197
198 return modifiers; 198 return modifiers;
199} /* _ecore_x_event_modifiers */ 199}
200 200
201void 201void
202_ecore_mouse_move(unsigned int timestamp, 202_ecore_mouse_move(unsigned int timestamp,
203 unsigned int xmodifiers, 203 unsigned int xmodifiers,
204 int x, 204 int x,
205 int y, 205 int y,
206 int x_root, 206 int x_root,
207 int y_root, 207 int y_root,
208 unsigned int event_window, 208 unsigned int event_window,
209 unsigned int window, 209 unsigned int window,
210 unsigned int root_win, 210 unsigned int root_win,
211 int same_screen, 211 int same_screen,
212 int dev, 212 int dev,
213 double radx, 213 double radx,
214 double rady, 214 double rady,
215 double pressure, 215 double pressure,
216 double angle, 216 double angle,
217 double mx, 217 double mx,
218 double my, 218 double my,
219 double mrx, 219 double mrx,
220 double mry) 220 double mry)
221{ 221{
222 Ecore_Event_Mouse_Move *e; 222 Ecore_Event_Mouse_Move *e;
223 Ecore_Event *event; 223 Ecore_Event *event;
@@ -260,10 +260,10 @@ _ecore_mouse_move(unsigned int timestamp,
260 _ecore_x_event_last_root_y = y_root; 260 _ecore_x_event_last_root_y = y_root;
261 261
262 _ecore_x_last_event_mouse_move_event = event; 262 _ecore_x_last_event_mouse_move_event = event;
263} /* _ecore_mouse_move */ 263}
264 264
265static void 265static void
266_ecore_key_press(int event, 266_ecore_key_press(int event,
267 XKeyEvent *xevent) 267 XKeyEvent *xevent)
268{ 268{
269 Ecore_Event_Key *e; 269 Ecore_Event_Key *e;
@@ -343,30 +343,30 @@ _ecore_key_press(int event,
343on_error: 343on_error:
344 if (tmp) 344 if (tmp)
345 free(tmp); 345 free(tmp);
346} /* _ecore_key_press */ 346}
347 347
348Ecore_Event_Mouse_Button * 348Ecore_Event_Mouse_Button *
349_ecore_mouse_button(int event, 349_ecore_mouse_button(int event,
350 unsigned int timestamp, 350 unsigned int timestamp,
351 unsigned int xmodifiers, 351 unsigned int xmodifiers,
352 unsigned int buttons, 352 unsigned int buttons,
353 int x, 353 int x,
354 int y, 354 int y,
355 int x_root, 355 int x_root,
356 int y_root, 356 int y_root,
357 unsigned int event_window, 357 unsigned int event_window,
358 unsigned int window, 358 unsigned int window,
359 unsigned int root_win, 359 unsigned int root_win,
360 int same_screen, 360 int same_screen,
361 int dev, 361 int dev,
362 double radx, 362 double radx,
363 double rady, 363 double rady,
364 double pressure, 364 double pressure,
365 double angle, 365 double angle,
366 double mx, 366 double mx,
367 double my, 367 double my,
368 double mrx, 368 double mrx,
369 double mry) 369 double mry)
370{ 370{
371 Ecore_Event_Mouse_Button *e; 371 Ecore_Event_Mouse_Button *e;
372 372
@@ -407,37 +407,37 @@ _ecore_mouse_button(int event,
407 { 407 {
408 if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN) 408 if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN)
409 { 409 {
410 //Check Double Clicked 410 //Check Double Clicked
411 if (((int)(timestamp - down_info->last_time) <= 411 if (((int)(timestamp - down_info->last_time) <=
412 (int)(1000 * _ecore_x_double_click_time)) && 412 (int)(1000 * _ecore_x_double_click_time)) &&
413 (window == down_info->last_win) && 413 (window == down_info->last_win) &&
414 (event_window == down_info->last_event_win)) 414 (event_window == down_info->last_event_win))
415 { 415 {
416 e->double_click = 1; 416 e->double_click = 1;
417 down_info->did_double = EINA_TRUE; 417 down_info->did_double = EINA_TRUE;
418 } 418 }
419 else 419 else
420 { 420 {
421 down_info->did_double = EINA_FALSE; 421 down_info->did_double = EINA_FALSE;
422 down_info->did_triple = EINA_FALSE; 422 down_info->did_triple = EINA_FALSE;
423 } 423 }
424 424
425 //Check Triple Clicked 425 //Check Triple Clicked
426 if (((int)(timestamp - down_info->last_last_time) <= 426 if (((int)(timestamp - down_info->last_last_time) <=
427 (int)(2 * 1000 * _ecore_x_double_click_time)) && 427 (int)(2 * 1000 * _ecore_x_double_click_time)) &&
428 (window == down_info->last_win) && 428 (window == down_info->last_win) &&
429 (window == down_info->last_last_win) && 429 (window == down_info->last_last_win) &&
430 (event_window == down_info->last_event_win) && 430 (event_window == down_info->last_event_win) &&
431 (event_window == down_info->last_last_event_win) 431 (event_window == down_info->last_last_event_win)
432 ) 432 )
433 { 433 {
434 e->triple_click = 1; 434 e->triple_click = 1;
435 down_info->did_triple = EINA_TRUE; 435 down_info->did_triple = EINA_TRUE;
436 } 436 }
437 else 437 else
438 { 438 {
439 down_info->did_triple = EINA_FALSE; 439 down_info->did_triple = EINA_FALSE;
440 } 440 }
441 } 441 }
442 else 442 else
443 { 443 {
@@ -491,7 +491,7 @@ _ecore_mouse_button(int event,
491 } 491 }
492 492
493 return e; 493 return e;
494} /* _ecore_mouse_button */ 494}
495 495
496void 496void
497_ecore_x_event_handle_any_event(XEvent *xevent) 497_ecore_x_event_handle_any_event(XEvent *xevent)
@@ -500,19 +500,19 @@ _ecore_x_event_handle_any_event(XEvent *xevent)
500 if (!ev) return; 500 if (!ev) return;
501 memcpy(ev, xevent, sizeof(XEvent)); 501 memcpy(ev, xevent, sizeof(XEvent));
502 ecore_event_add(ECORE_X_EVENT_ANY, ev, NULL, NULL); 502 ecore_event_add(ECORE_X_EVENT_ANY, ev, NULL, NULL);
503} /* _ecore_x_event_handle_any_event */ 503}
504 504
505void 505void
506_ecore_x_event_handle_key_press(XEvent *xevent) 506_ecore_x_event_handle_key_press(XEvent *xevent)
507{ 507{
508 _ecore_key_press(ECORE_EVENT_KEY_DOWN, (XKeyEvent *)xevent); 508 _ecore_key_press(ECORE_EVENT_KEY_DOWN, (XKeyEvent *)xevent);
509} /* _ecore_x_event_handle_key_press */ 509}
510 510
511void 511void
512_ecore_x_event_handle_key_release(XEvent *xevent) 512_ecore_x_event_handle_key_release(XEvent *xevent)
513{ 513{
514 _ecore_key_press(ECORE_EVENT_KEY_UP, (XKeyEvent *)xevent); 514 _ecore_key_press(ECORE_EVENT_KEY_UP, (XKeyEvent *)xevent);
515} /* _ecore_x_event_handle_key_release */ 515}
516 516
517void 517void
518_ecore_x_event_handle_button_press(XEvent *xevent) 518_ecore_x_event_handle_button_press(XEvent *xevent)
@@ -541,7 +541,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
541 case 7: e->direction = 1; e->z = 1; break; 541 case 7: e->direction = 1; e->z = 1; break;
542 542
543 default: e->direction = 0; e->z = 0; break; 543 default: e->direction = 0; e->z = 0; break;
544 } /* switch */ 544 }
545 545
546 e->x = xevent->xbutton.x; 546 e->x = xevent->xbutton.x;
547 e->y = xevent->xbutton.y; 547 e->y = xevent->xbutton.y;
@@ -663,7 +663,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
663 } 663 }
664 } 664 }
665 } 665 }
666} /* _ecore_x_event_handle_button_press */ 666}
667 667
668void 668void
669_ecore_x_event_handle_button_release(XEvent *xevent) 669_ecore_x_event_handle_button_release(XEvent *xevent)
@@ -702,7 +702,7 @@ _ecore_x_event_handle_button_release(XEvent *xevent)
702 xevent->xbutton.x, xevent->xbutton.y, 702 xevent->xbutton.x, xevent->xbutton.y,
703 xevent->xbutton.x_root, xevent->xbutton.y_root); 703 xevent->xbutton.x_root, xevent->xbutton.y_root);
704 } 704 }
705} /* _ecore_x_event_handle_button_release */ 705}
706 706
707void 707void
708_ecore_x_event_handle_motion_notify(XEvent *xevent) 708_ecore_x_event_handle_motion_notify(XEvent *xevent)
@@ -715,27 +715,27 @@ _ecore_x_event_handle_motion_notify(XEvent *xevent)
715 _ecore_x_last_event_mouse_move_event = NULL; 715 _ecore_x_last_event_mouse_move_event = NULL;
716 } 716 }
717 */ 717 */
718 _ecore_mouse_move(xevent->xmotion.time, xevent->xmotion.state, 718 _ecore_mouse_move(xevent->xmotion.time, xevent->xmotion.state,
719 xevent->xmotion.x, xevent->xmotion.y, 719 xevent->xmotion.x, xevent->xmotion.y,
720 xevent->xmotion.x_root, xevent->xmotion.y_root, 720 xevent->xmotion.x_root, xevent->xmotion.y_root,
721 xevent->xmotion.window, 721 xevent->xmotion.window,
722 (xevent->xmotion.subwindow ? xevent->xmotion.subwindow : 722 (xevent->xmotion.subwindow ? xevent->xmotion.subwindow :
723 xevent->xmotion.window), 723 xevent->xmotion.window),
724 xevent->xmotion.root, 724 xevent->xmotion.root,
725 xevent->xmotion.same_screen, 725 xevent->xmotion.same_screen,
726 0, 1, 1, 726 0, 1, 1,
727 1.0, // pressure 727 1.0, // pressure
728 0.0, // angle 728 0.0, // angle
729 xevent->xmotion.x, xevent->xmotion.y, 729 xevent->xmotion.x, xevent->xmotion.y,
730 xevent->xmotion.x_root, xevent->xmotion.y_root); 730 xevent->xmotion.x_root, xevent->xmotion.y_root);
731 731
732 _ecore_x_last_event_mouse_move = 1; 732 _ecore_x_last_event_mouse_move = 1;
733 733
734 /* Xdnd handling */ 734 /* Xdnd handling */
735 _ecore_x_dnd_drag(xevent->xmotion.root, 735 _ecore_x_dnd_drag(xevent->xmotion.root,
736 xevent->xmotion.x_root, 736 xevent->xmotion.x_root,
737 xevent->xmotion.y_root); 737 xevent->xmotion.y_root);
738} /* _ecore_x_event_handle_motion_notify */ 738}
739 739
740void 740void
741_ecore_x_event_handle_enter_notify(XEvent *xevent) 741_ecore_x_event_handle_enter_notify(XEvent *xevent)
@@ -799,7 +799,7 @@ _ecore_x_event_handle_enter_notify(XEvent *xevent)
799 _ecore_x_event_last_time = e->time; 799 _ecore_x_event_last_time = e->time;
800 ecore_event_add(ECORE_X_EVENT_MOUSE_IN, e, NULL, NULL); 800 ecore_event_add(ECORE_X_EVENT_MOUSE_IN, e, NULL, NULL);
801 } 801 }
802} /* _ecore_x_event_handle_enter_notify */ 802}
803 803
804void 804void
805_ecore_x_event_handle_leave_notify(XEvent *xevent) 805_ecore_x_event_handle_leave_notify(XEvent *xevent)
@@ -866,7 +866,7 @@ _ecore_x_event_handle_leave_notify(XEvent *xevent)
866 _ecore_x_event_last_root_y = e->root.y; 866 _ecore_x_event_last_root_y = e->root.y;
867 ecore_event_add(ECORE_X_EVENT_MOUSE_OUT, e, NULL, NULL); 867 ecore_event_add(ECORE_X_EVENT_MOUSE_OUT, e, NULL, NULL);
868 } 868 }
869} /* _ecore_x_event_handle_leave_notify */ 869}
870 870
871void 871void
872_ecore_x_event_handle_focus_in(XEvent *xevent) 872_ecore_x_event_handle_focus_in(XEvent *xevent)
@@ -910,7 +910,7 @@ _ecore_x_event_handle_focus_in(XEvent *xevent)
910 e->time = _ecore_x_event_last_time; 910 e->time = _ecore_x_event_last_time;
911 _ecore_x_event_last_time = e->time; 911 _ecore_x_event_last_time = e->time;
912 ecore_event_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL); 912 ecore_event_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
913} /* _ecore_x_event_handle_focus_in */ 913}
914 914
915void 915void
916_ecore_x_event_handle_focus_out(XEvent *xevent) 916_ecore_x_event_handle_focus_out(XEvent *xevent)
@@ -954,14 +954,14 @@ _ecore_x_event_handle_focus_out(XEvent *xevent)
954 e->time = _ecore_x_event_last_time; 954 e->time = _ecore_x_event_last_time;
955 _ecore_x_event_last_time = e->time; 955 _ecore_x_event_last_time = e->time;
956 ecore_event_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL); 956 ecore_event_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
957} /* _ecore_x_event_handle_focus_out */ 957}
958 958
959void 959void
960_ecore_x_event_handle_keymap_notify(XEvent *xevent __UNUSED__) 960_ecore_x_event_handle_keymap_notify(XEvent *xevent __UNUSED__)
961{ 961{
962 _ecore_x_last_event_mouse_move = 0; 962 _ecore_x_last_event_mouse_move = 0;
963 /* FIXME: handle this event type */ 963 /* FIXME: handle this event type */
964} /* _ecore_x_event_handle_keymap_notify */ 964}
965 965
966void 966void
967_ecore_x_event_handle_expose(XEvent *xevent) 967_ecore_x_event_handle_expose(XEvent *xevent)
@@ -981,7 +981,7 @@ _ecore_x_event_handle_expose(XEvent *xevent)
981 e->h = xevent->xexpose.height; 981 e->h = xevent->xexpose.height;
982 e->count = xevent->xexpose.count; 982 e->count = xevent->xexpose.count;
983 ecore_event_add(ECORE_X_EVENT_WINDOW_DAMAGE, e, NULL, NULL); 983 ecore_event_add(ECORE_X_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
984} /* _ecore_x_event_handle_expose */ 984}
985 985
986void 986void
987_ecore_x_event_handle_graphics_expose(XEvent *xevent) 987_ecore_x_event_handle_graphics_expose(XEvent *xevent)
@@ -1001,7 +1001,7 @@ _ecore_x_event_handle_graphics_expose(XEvent *xevent)
1001 e->h = xevent->xgraphicsexpose.height; 1001 e->h = xevent->xgraphicsexpose.height;
1002 e->count = xevent->xgraphicsexpose.count; 1002 e->count = xevent->xgraphicsexpose.count;
1003 ecore_event_add(ECORE_X_EVENT_WINDOW_DAMAGE, e, NULL, NULL); 1003 ecore_event_add(ECORE_X_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
1004} /* _ecore_x_event_handle_graphics_expose */ 1004}
1005 1005
1006void 1006void
1007_ecore_x_event_handle_visibility_notify(XEvent *xevent) 1007_ecore_x_event_handle_visibility_notify(XEvent *xevent)
@@ -1024,7 +1024,7 @@ _ecore_x_event_handle_visibility_notify(XEvent *xevent)
1024 1024
1025 ecore_event_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, e, NULL, NULL); 1025 ecore_event_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, e, NULL, NULL);
1026 } 1026 }
1027} /* _ecore_x_event_handle_visibility_notify */ 1027}
1028 1028
1029void 1029void
1030_ecore_x_event_handle_create_notify(XEvent *xevent) 1030_ecore_x_event_handle_create_notify(XEvent *xevent)
@@ -1050,7 +1050,7 @@ _ecore_x_event_handle_create_notify(XEvent *xevent)
1050 e->border = xevent->xcreatewindow.border_width; 1050 e->border = xevent->xcreatewindow.border_width;
1051 e->time = _ecore_x_event_last_time; 1051 e->time = _ecore_x_event_last_time;
1052 ecore_event_add(ECORE_X_EVENT_WINDOW_CREATE, e, NULL, NULL); 1052 ecore_event_add(ECORE_X_EVENT_WINDOW_CREATE, e, NULL, NULL);
1053} /* _ecore_x_event_handle_create_notify */ 1053}
1054 1054
1055void 1055void
1056_ecore_x_event_handle_destroy_notify(XEvent *xevent) 1056_ecore_x_event_handle_destroy_notify(XEvent *xevent)
@@ -1069,7 +1069,7 @@ _ecore_x_event_handle_destroy_notify(XEvent *xevent)
1069 _ecore_x_event_last_win = 0; 1069 _ecore_x_event_last_win = 0;
1070 1070
1071 ecore_event_add(ECORE_X_EVENT_WINDOW_DESTROY, e, NULL, NULL); 1071 ecore_event_add(ECORE_X_EVENT_WINDOW_DESTROY, e, NULL, NULL);
1072} /* _ecore_x_event_handle_destroy_notify */ 1072}
1073 1073
1074void 1074void
1075_ecore_x_event_handle_unmap_notify(XEvent *xevent) 1075_ecore_x_event_handle_unmap_notify(XEvent *xevent)
@@ -1085,7 +1085,7 @@ _ecore_x_event_handle_unmap_notify(XEvent *xevent)
1085 e->event_win = xevent->xunmap.event; 1085 e->event_win = xevent->xunmap.event;
1086 e->time = _ecore_x_event_last_time; 1086 e->time = _ecore_x_event_last_time;
1087 ecore_event_add(ECORE_X_EVENT_WINDOW_HIDE, e, NULL, NULL); 1087 ecore_event_add(ECORE_X_EVENT_WINDOW_HIDE, e, NULL, NULL);
1088} /* _ecore_x_event_handle_unmap_notify */ 1088}
1089 1089
1090void 1090void
1091_ecore_x_event_handle_map_notify(XEvent *xevent) 1091_ecore_x_event_handle_map_notify(XEvent *xevent)
@@ -1101,7 +1101,7 @@ _ecore_x_event_handle_map_notify(XEvent *xevent)
1101 e->event_win = xevent->xmap.event; 1101 e->event_win = xevent->xmap.event;
1102 e->time = _ecore_x_event_last_time; 1102 e->time = _ecore_x_event_last_time;
1103 ecore_event_add(ECORE_X_EVENT_WINDOW_SHOW, e, NULL, NULL); 1103 ecore_event_add(ECORE_X_EVENT_WINDOW_SHOW, e, NULL, NULL);
1104} /* _ecore_x_event_handle_map_notify */ 1104}
1105 1105
1106void 1106void
1107_ecore_x_event_handle_map_request(XEvent *xevent) 1107_ecore_x_event_handle_map_request(XEvent *xevent)
@@ -1117,7 +1117,7 @@ _ecore_x_event_handle_map_request(XEvent *xevent)
1117 e->time = _ecore_x_event_last_time; 1117 e->time = _ecore_x_event_last_time;
1118 e->parent = xevent->xmaprequest.parent; 1118 e->parent = xevent->xmaprequest.parent;
1119 ecore_event_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, e, NULL, NULL); 1119 ecore_event_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, e, NULL, NULL);
1120} /* _ecore_x_event_handle_map_request */ 1120}
1121 1121
1122void 1122void
1123_ecore_x_event_handle_reparent_notify(XEvent *xevent) 1123_ecore_x_event_handle_reparent_notify(XEvent *xevent)
@@ -1134,7 +1134,7 @@ _ecore_x_event_handle_reparent_notify(XEvent *xevent)
1134 e->parent = xevent->xreparent.parent; 1134 e->parent = xevent->xreparent.parent;
1135 e->time = _ecore_x_event_last_time; 1135 e->time = _ecore_x_event_last_time;
1136 ecore_event_add(ECORE_X_EVENT_WINDOW_REPARENT, e, NULL, NULL); 1136 ecore_event_add(ECORE_X_EVENT_WINDOW_REPARENT, e, NULL, NULL);
1137} /* _ecore_x_event_handle_reparent_notify */ 1137}
1138 1138
1139void 1139void
1140_ecore_x_event_handle_configure_notify(XEvent *xevent) 1140_ecore_x_event_handle_configure_notify(XEvent *xevent)
@@ -1158,7 +1158,7 @@ _ecore_x_event_handle_configure_notify(XEvent *xevent)
1158 e->from_wm = xevent->xconfigure.send_event; 1158 e->from_wm = xevent->xconfigure.send_event;
1159 e->time = _ecore_x_event_last_time; 1159 e->time = _ecore_x_event_last_time;
1160 ecore_event_add(ECORE_X_EVENT_WINDOW_CONFIGURE, e, NULL, NULL); 1160 ecore_event_add(ECORE_X_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
1161} /* _ecore_x_event_handle_configure_notify */ 1161}
1162 1162
1163void 1163void
1164_ecore_x_event_handle_configure_request(XEvent *xevent) 1164_ecore_x_event_handle_configure_request(XEvent *xevent)
@@ -1193,14 +1193,14 @@ _ecore_x_event_handle_configure_request(XEvent *xevent)
1193 e->detail = ECORE_X_WINDOW_STACK_OPPOSITE; 1193 e->detail = ECORE_X_WINDOW_STACK_OPPOSITE;
1194 1194
1195 ecore_event_add(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, e, NULL, NULL); 1195 ecore_event_add(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, e, NULL, NULL);
1196} /* _ecore_x_event_handle_configure_request */ 1196}
1197 1197
1198void 1198void
1199_ecore_x_event_handle_gravity_notify(XEvent *xevent __UNUSED__) 1199_ecore_x_event_handle_gravity_notify(XEvent *xevent __UNUSED__)
1200{ 1200{
1201 _ecore_x_last_event_mouse_move = 0; 1201 _ecore_x_last_event_mouse_move = 0;
1202 /* FIXME: handle this event type */ 1202 /* FIXME: handle this event type */
1203} /* _ecore_x_event_handle_gravity_notify */ 1203}
1204 1204
1205void 1205void
1206_ecore_x_event_handle_resize_request(XEvent *xevent) 1206_ecore_x_event_handle_resize_request(XEvent *xevent)
@@ -1217,7 +1217,7 @@ _ecore_x_event_handle_resize_request(XEvent *xevent)
1217 e->h = xevent->xresizerequest.height; 1217 e->h = xevent->xresizerequest.height;
1218 e->time = _ecore_x_event_last_time; 1218 e->time = _ecore_x_event_last_time;
1219 ecore_event_add(ECORE_X_EVENT_WINDOW_RESIZE_REQUEST, e, NULL, NULL); 1219 ecore_event_add(ECORE_X_EVENT_WINDOW_RESIZE_REQUEST, e, NULL, NULL);
1220} /* _ecore_x_event_handle_resize_request */ 1220}
1221 1221
1222void 1222void
1223_ecore_x_event_handle_circulate_notify(XEvent *xevent) 1223_ecore_x_event_handle_circulate_notify(XEvent *xevent)
@@ -1238,7 +1238,7 @@ _ecore_x_event_handle_circulate_notify(XEvent *xevent)
1238 1238
1239 e->time = _ecore_x_event_last_time; 1239 e->time = _ecore_x_event_last_time;
1240 ecore_event_add(ECORE_X_EVENT_WINDOW_STACK, e, NULL, NULL); 1240 ecore_event_add(ECORE_X_EVENT_WINDOW_STACK, e, NULL, NULL);
1241} /* _ecore_x_event_handle_circulate_notify */ 1241}
1242 1242
1243void 1243void
1244_ecore_x_event_handle_circulate_request(XEvent *xevent) 1244_ecore_x_event_handle_circulate_request(XEvent *xevent)
@@ -1259,7 +1259,7 @@ _ecore_x_event_handle_circulate_request(XEvent *xevent)
1259 1259
1260 e->time = _ecore_x_event_last_time; 1260 e->time = _ecore_x_event_last_time;
1261 ecore_event_add(ECORE_X_EVENT_WINDOW_STACK_REQUEST, e, NULL, NULL); 1261 ecore_event_add(ECORE_X_EVENT_WINDOW_STACK_REQUEST, e, NULL, NULL);
1262} /* _ecore_x_event_handle_circulate_request */ 1262}
1263 1263
1264void 1264void
1265_ecore_x_event_handle_property_notify(XEvent *xevent) 1265_ecore_x_event_handle_property_notify(XEvent *xevent)
@@ -1278,17 +1278,17 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
1278 _ecore_x_event_last_time = e->time; 1278 _ecore_x_event_last_time = e->time;
1279 ecore_event_add(ECORE_X_EVENT_WINDOW_PROPERTY, e, NULL, NULL); 1279 ecore_event_add(ECORE_X_EVENT_WINDOW_PROPERTY, e, NULL, NULL);
1280 } 1280 }
1281} /* _ecore_x_event_handle_property_notify */ 1281}
1282 1282
1283void 1283void
1284_ecore_x_event_handle_selection_clear(XEvent *xevent) 1284_ecore_x_event_handle_selection_clear(XEvent *xevent)
1285{ 1285{
1286// Ecore_X_Selection_Intern *d; 1286// Ecore_X_Selection_Intern *d;
1287 Ecore_X_Event_Selection_Clear *e; 1287 Ecore_X_Event_Selection_Clear *e;
1288 Ecore_X_Atom sel; 1288 Ecore_X_Atom sel;
1289 1289
1290 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1290 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1291 _ecore_x_last_event_mouse_move = 0; 1291 _ecore_x_last_event_mouse_move = 0;
1292/* errr..... why? paranoia. 1292/* errr..... why? paranoia.
1293 d = _ecore_x_selection_get(xevent->xselectionclear.selection); 1293 d = _ecore_x_selection_get(xevent->xselectionclear.selection);
1294 if (d && (xevent->xselectionclear.time > d->time)) 1294 if (d && (xevent->xselectionclear.time > d->time))
@@ -1298,21 +1298,21 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent)
1298 } 1298 }
1299 */ 1299 */
1300/* Generate event for app cleanup */ 1300/* Generate event for app cleanup */
1301 e = malloc(sizeof(Ecore_X_Event_Selection_Clear)); 1301 e = malloc(sizeof(Ecore_X_Event_Selection_Clear));
1302 e->win = xevent->xselectionclear.window; 1302 e->win = xevent->xselectionclear.window;
1303 e->time = xevent->xselectionclear.time; 1303 e->time = xevent->xselectionclear.time;
1304 e->atom = sel = xevent->xselectionclear.selection; 1304 e->atom = sel = xevent->xselectionclear.selection;
1305 if (sel == ECORE_X_ATOM_SELECTION_PRIMARY) 1305 if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
1306 e->selection = ECORE_X_SELECTION_PRIMARY; 1306 e->selection = ECORE_X_SELECTION_PRIMARY;
1307 else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY) 1307 else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
1308 e->selection = ECORE_X_SELECTION_SECONDARY; 1308 e->selection = ECORE_X_SELECTION_SECONDARY;
1309 else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD) 1309 else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD)
1310 e->selection = ECORE_X_SELECTION_CLIPBOARD; 1310 e->selection = ECORE_X_SELECTION_CLIPBOARD;
1311 else 1311 else
1312 e->selection = ECORE_X_SELECTION_OTHER; 1312 e->selection = ECORE_X_SELECTION_OTHER;
1313 1313
1314 ecore_event_add(ECORE_X_EVENT_SELECTION_CLEAR, e, NULL, NULL); 1314 ecore_event_add(ECORE_X_EVENT_SELECTION_CLEAR, e, NULL, NULL);
1315} /* _ecore_x_event_handle_selection_clear */ 1315}
1316 1316
1317void 1317void
1318_ecore_x_event_handle_selection_request(XEvent *xevent) 1318_ecore_x_event_handle_selection_request(XEvent *xevent)
@@ -1360,17 +1360,17 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
1360 property = None; 1360 property = None;
1361 else if (data) 1361 else if (data)
1362 { 1362 {
1363 /* FIXME: This does not properly handle large data transfers */ 1363 /* FIXME: This does not properly handle large data transfers */
1364 ecore_x_window_prop_property_set( 1364 ecore_x_window_prop_property_set(
1365 xevent->xselectionrequest.requestor, 1365 xevent->xselectionrequest.requestor,
1366 xevent->xselectionrequest. 1366 xevent->xselectionrequest.
1367 property, 1367 property,
1368 type, 1368 type,
1369 typesize, 1369 typesize,
1370 data, 1370 data,
1371 len); 1371 len);
1372 property = xevent->xselectionrequest.property; 1372 property = xevent->xselectionrequest.property;
1373 free(data); 1373 free(data);
1374 } 1374 }
1375 1375
1376 ecore_x_selection_notify_send(xevent->xselectionrequest.requestor, 1376 ecore_x_selection_notify_send(xevent->xselectionrequest.requestor,
@@ -1380,7 +1380,7 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
1380 xevent->xselectionrequest.time); 1380 xevent->xselectionrequest.time);
1381 } 1381 }
1382 } 1382 }
1383} /* _ecore_x_event_handle_selection_request */ 1383}
1384 1384
1385void 1385void
1386_ecore_x_event_handle_selection_notify(XEvent *xevent) 1386_ecore_x_event_handle_selection_notify(XEvent *xevent)
@@ -1436,7 +1436,7 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
1436 1436
1437 ecore_event_add(ECORE_X_EVENT_SELECTION_NOTIFY, e, 1437 ecore_event_add(ECORE_X_EVENT_SELECTION_NOTIFY, e,
1438 _ecore_x_event_free_selection_notify, NULL); 1438 _ecore_x_event_free_selection_notify, NULL);
1439} /* _ecore_x_event_handle_selection_notify */ 1439}
1440 1440
1441void 1441void
1442_ecore_x_event_handle_colormap_notify(XEvent *xevent) 1442_ecore_x_event_handle_colormap_notify(XEvent *xevent)
@@ -1457,7 +1457,7 @@ _ecore_x_event_handle_colormap_notify(XEvent *xevent)
1457 e->installed = EINA_FALSE; 1457 e->installed = EINA_FALSE;
1458 1458
1459 ecore_event_add(ECORE_X_EVENT_WINDOW_COLORMAP, e, NULL, NULL); 1459 ecore_event_add(ECORE_X_EVENT_WINDOW_COLORMAP, e, NULL, NULL);
1460} /* _ecore_x_event_handle_colormap_notify */ 1460}
1461 1461
1462void 1462void
1463_ecore_x_event_handle_client_message(XEvent *xevent) 1463_ecore_x_event_handle_client_message(XEvent *xevent)
@@ -1528,32 +1528,32 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1528 if (xevent->xclient.data.l[1] & 0x1UL) 1528 if (xevent->xclient.data.l[1] & 0x1UL)
1529 { 1529 {
1530 /* source supports more than 3 types, fetch property */ 1530 /* source supports more than 3 types, fetch property */
1531 unsigned char *data; 1531 unsigned char *data;
1532 Ecore_X_Atom *types; 1532 Ecore_X_Atom *types;
1533 int i, num_ret; 1533 int i, num_ret;
1534 1534
1535 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1535 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1536 if (!(ecore_x_window_prop_property_get(target->source, 1536 if (!(ecore_x_window_prop_property_get(target->source,
1537 ECORE_X_ATOM_XDND_TYPE_LIST, 1537 ECORE_X_ATOM_XDND_TYPE_LIST,
1538 XA_ATOM, 1538 XA_ATOM,
1539 32, &data, &num_ret))) 1539 32, &data, &num_ret)))
1540 { 1540 {
1541 WRN( 1541 WRN(
1542 "DND: Could not fetch data type list from source window, aborting."); 1542 "DND: Could not fetch data type list from source window, aborting.");
1543 free(e); 1543 free(e);
1544 return; 1544 return;
1545 } 1545 }
1546 1546
1547 types = (Ecore_X_Atom *)data; 1547 types = (Ecore_X_Atom *)data;
1548 e->types = calloc(num_ret, sizeof(char *)); 1548 e->types = calloc(num_ret, sizeof(char *));
1549 if (e->types) 1549 if (e->types)
1550 { 1550 {
1551 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1551 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1552 for (i = 0; i < num_ret; i++) 1552 for (i = 0; i < num_ret; i++)
1553 e->types[i] = XGetAtomName(_ecore_x_disp, types[i]); 1553 e->types[i] = XGetAtomName(_ecore_x_disp, types[i]);
1554 } 1554 }
1555 1555
1556 e->num_types = num_ret; 1556 e->num_types = num_ret;
1557 } 1557 }
1558 else 1558 else
1559 { 1559 {
@@ -1774,7 +1774,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1774 if (e->state[0] == ECORE_X_WINDOW_STATE_UNKNOWN) 1774 if (e->state[0] == ECORE_X_WINDOW_STATE_UNKNOWN)
1775 { 1775 {
1776// char *name; 1776// char *name;
1777 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1777 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1778 1778
1779// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[1]); 1779// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[1]);
1780// if (name) ERR("Unknown state: %s", name); 1780// if (name) ERR("Unknown state: %s", name);
@@ -1784,7 +1784,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1784 if (e->state[1] == ECORE_X_WINDOW_STATE_UNKNOWN) 1784 if (e->state[1] == ECORE_X_WINDOW_STATE_UNKNOWN)
1785 { 1785 {
1786// char *name; 1786// char *name;
1787 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1787 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1788 1788
1789// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[2]); 1789// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[2]);
1790// if (name) ERR("Unknown state: %s", name); 1790// if (name) ERR("Unknown state: %s", name);
@@ -1888,10 +1888,10 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1888 && (xevent->xclient.window == _ecore_x_private_win)) 1888 && (xevent->xclient.window == _ecore_x_private_win))
1889 { 1889 {
1890 /* a grab sync marker */ 1890 /* a grab sync marker */
1891 if (xevent->xclient.data.l[1] == 0x10000001) 1891 if (xevent->xclient.data.l[1] == 0x10000001)
1892 _ecore_x_window_grab_remove(xevent->xclient.data.l[2]); 1892 _ecore_x_window_grab_remove(xevent->xclient.data.l[2]);
1893 else if (xevent->xclient.data.l[1] == 0x10000002) 1893 else if (xevent->xclient.data.l[1] == 0x10000002)
1894 _ecore_x_key_grab_remove(xevent->xclient.data.l[2]); 1894 _ecore_x_key_grab_remove(xevent->xclient.data.l[2]);
1895 } 1895 }
1896 else 1896 else
1897 { 1897 {
@@ -1910,7 +1910,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1910 1910
1911 ecore_event_add(ECORE_X_EVENT_CLIENT_MESSAGE, e, NULL, NULL); 1911 ecore_event_add(ECORE_X_EVENT_CLIENT_MESSAGE, e, NULL, NULL);
1912 } 1912 }
1913} /* _ecore_x_event_handle_client_message */ 1913}
1914 1914
1915void 1915void
1916_ecore_x_event_handle_mapping_notify(XEvent *xevent) 1916_ecore_x_event_handle_mapping_notify(XEvent *xevent)
@@ -1940,7 +1940,7 @@ _ecore_x_event_handle_mapping_notify(XEvent *xevent)
1940 e->keycode = xevent->xmapping.first_keycode; 1940 e->keycode = xevent->xmapping.first_keycode;
1941 e->num = xevent->xmapping.count; 1941 e->num = xevent->xmapping.count;
1942 ecore_event_add(ECORE_X_EVENT_MAPPING_CHANGE, e, NULL, NULL); 1942 ecore_event_add(ECORE_X_EVENT_MAPPING_CHANGE, e, NULL, NULL);
1943} /* _ecore_x_event_handle_mapping_notify */ 1943}
1944 1944
1945void 1945void
1946_ecore_x_event_handle_shape_change(XEvent *xevent) 1946_ecore_x_event_handle_shape_change(XEvent *xevent)
@@ -1979,7 +1979,7 @@ _ecore_x_event_handle_shape_change(XEvent *xevent)
1979 e->h = shape_event->height; 1979 e->h = shape_event->height;
1980 e->shaped = shape_event->shaped; 1980 e->shaped = shape_event->shaped;
1981 ecore_event_add(ECORE_X_EVENT_WINDOW_SHAPE, e, NULL, NULL); 1981 ecore_event_add(ECORE_X_EVENT_WINDOW_SHAPE, e, NULL, NULL);
1982} /* _ecore_x_event_handle_shape_change */ 1982}
1983 1983
1984void 1984void
1985_ecore_x_event_handle_screensaver_notify(XEvent *xevent) 1985_ecore_x_event_handle_screensaver_notify(XEvent *xevent)
@@ -2005,7 +2005,7 @@ _ecore_x_event_handle_screensaver_notify(XEvent *xevent)
2005#else /* ifdef ECORE_XSS */ 2005#else /* ifdef ECORE_XSS */
2006 xevent = NULL; 2006 xevent = NULL;
2007#endif /* ifdef ECORE_XSS */ 2007#endif /* ifdef ECORE_XSS */
2008} /* _ecore_x_event_handle_screensaver_notify */ 2008}
2009 2009
2010void 2010void
2011_ecore_x_event_handle_sync_counter(XEvent *xevent) 2011_ecore_x_event_handle_sync_counter(XEvent *xevent)
@@ -2021,7 +2021,7 @@ _ecore_x_event_handle_sync_counter(XEvent *xevent)
2021 2021
2022 e->time = sync_counter_event->time; 2022 e->time = sync_counter_event->time;
2023 ecore_event_add(ECORE_X_EVENT_SYNC_COUNTER, e, NULL, NULL); 2023 ecore_event_add(ECORE_X_EVENT_SYNC_COUNTER, e, NULL, NULL);
2024} /* _ecore_x_event_handle_sync_counter */ 2024}
2025 2025
2026void 2026void
2027_ecore_x_event_handle_sync_alarm(XEvent *xevent) 2027_ecore_x_event_handle_sync_alarm(XEvent *xevent)
@@ -2039,7 +2039,7 @@ _ecore_x_event_handle_sync_alarm(XEvent *xevent)
2039 e->time = sync_alarm_event->time; 2039 e->time = sync_alarm_event->time;
2040 e->alarm = sync_alarm_event->alarm; 2040 e->alarm = sync_alarm_event->alarm;
2041 ecore_event_add(ECORE_X_EVENT_SYNC_ALARM, e, NULL, NULL); 2041 ecore_event_add(ECORE_X_EVENT_SYNC_ALARM, e, NULL, NULL);
2042} /* _ecore_x_event_handle_sync_alarm */ 2042}
2043 2043
2044#ifdef ECORE_XRANDR 2044#ifdef ECORE_XRANDR
2045void 2045void
@@ -2068,7 +2068,7 @@ _ecore_x_event_handle_randr_change(XEvent *xevent)
2068 e->orientation = randr_event->rotation; 2068 e->orientation = randr_event->rotation;
2069 e->subpixel_order = randr_event->subpixel_order; 2069 e->subpixel_order = randr_event->subpixel_order;
2070 ecore_event_add(ECORE_X_EVENT_SCREEN_CHANGE, e, NULL, NULL); 2070 ecore_event_add(ECORE_X_EVENT_SCREEN_CHANGE, e, NULL, NULL);
2071} /* _ecore_x_event_handle_randr_change */ 2071}
2072 2072
2073static void 2073static void
2074_ecore_x_event_handle_randr_notify_crtc_change(const XRRNotifyEvent *xevent) 2074_ecore_x_event_handle_randr_notify_crtc_change(const XRRNotifyEvent *xevent)
@@ -2091,7 +2091,7 @@ _ecore_x_event_handle_randr_notify_crtc_change(const XRRNotifyEvent *xevent)
2091 e->geo.w = randr_event->width; 2091 e->geo.w = randr_event->width;
2092 e->geo.h = randr_event->height; 2092 e->geo.h = randr_event->height;
2093 ecore_event_add(ECORE_X_EVENT_RANDR_CRTC_CHANGE, e, NULL, NULL); 2093 ecore_event_add(ECORE_X_EVENT_RANDR_CRTC_CHANGE, e, NULL, NULL);
2094} /* _ecore_x_event_handle_randr_notify_crtc_change */ 2094}
2095 2095
2096static void 2096static void
2097_ecore_x_event_handle_randr_notify_output_change(const XRRNotifyEvent *xevent) 2097_ecore_x_event_handle_randr_notify_output_change(const XRRNotifyEvent *xevent)
@@ -2113,7 +2113,7 @@ _ecore_x_event_handle_randr_notify_output_change(const XRRNotifyEvent *xevent)
2113 e->connection = randr_event->connection; 2113 e->connection = randr_event->connection;
2114 e->subpixel_order = randr_event->subpixel_order; 2114 e->subpixel_order = randr_event->subpixel_order;
2115 ecore_event_add(ECORE_X_EVENT_RANDR_OUTPUT_CHANGE, e, NULL, NULL); 2115 ecore_event_add(ECORE_X_EVENT_RANDR_OUTPUT_CHANGE, e, NULL, NULL);
2116} /* _ecore_x_event_handle_randr_notify_output_change */ 2116}
2117 2117
2118static void 2118static void
2119_ecore_x_event_handle_randr_notify_output_property(const XRRNotifyEvent *xevent) 2119_ecore_x_event_handle_randr_notify_output_property(const XRRNotifyEvent *xevent)
@@ -2136,7 +2136,7 @@ _ecore_x_event_handle_randr_notify_output_property(const XRRNotifyEvent *xevent)
2136 else 2136 else
2137 e->state = ECORE_X_RANDR_PROPERTY_CHANGE_DEL; 2137 e->state = ECORE_X_RANDR_PROPERTY_CHANGE_DEL;
2138 ecore_event_add(ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY, e, NULL, NULL); 2138 ecore_event_add(ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY, e, NULL, NULL);
2139} /* _ecore_x_event_handle_randr_notify_output_property */ 2139}
2140 2140
2141void 2141void
2142_ecore_x_event_handle_randr_notify(XEvent *xevent) 2142_ecore_x_event_handle_randr_notify(XEvent *xevent)
@@ -2164,8 +2164,8 @@ _ecore_x_event_handle_randr_notify(XEvent *xevent)
2164 ERR("Unknown XRandR RRNotify subtype: %d.", 2164 ERR("Unknown XRandR RRNotify subtype: %d.",
2165 randr_event->subtype); 2165 randr_event->subtype);
2166 break; 2166 break;
2167 } /* switch */ 2167 }
2168} /* _ecore_x_event_handle_randr_notify */ 2168}
2169 2169
2170#endif /* ifdef ECORE_XRANDR */ 2170#endif /* ifdef ECORE_XRANDR */
2171 2171
@@ -2201,7 +2201,7 @@ _ecore_x_event_handle_fixes_selection_notify(XEvent *event)
2201 e->reason = notify_event->subtype; 2201 e->reason = notify_event->subtype;
2202 2202
2203 ecore_event_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, e, NULL, NULL); 2203 ecore_event_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, e, NULL, NULL);
2204} /* _ecore_x_event_handle_fixes_selection_notify */ 2204}
2205 2205
2206#endif /* ifdef ECORE_XFIXES */ 2206#endif /* ifdef ECORE_XFIXES */
2207 2207
@@ -2234,7 +2234,7 @@ _ecore_x_event_handle_damage_notify(XEvent *event)
2234 e->geometry.height = damage_event->geometry.height; 2234 e->geometry.height = damage_event->geometry.height;
2235 2235
2236 ecore_event_add(ECORE_X_EVENT_DAMAGE_NOTIFY, e, NULL, NULL); 2236 ecore_event_add(ECORE_X_EVENT_DAMAGE_NOTIFY, e, NULL, NULL);
2237} /* _ecore_x_event_handle_damage_notify */ 2237}
2238 2238
2239#endif /* ifdef ECORE_XDAMAGE */ 2239#endif /* ifdef ECORE_XDAMAGE */
2240 2240
@@ -2256,7 +2256,7 @@ _ecore_x_event_free_generic_event(void *data,
2256 return; 2256 return;
2257 data = NULL; ev = NULL; 2257 data = NULL; ev = NULL;
2258#endif /* ifdef ECORE_XI2 */ 2258#endif /* ifdef ECORE_XI2 */
2259} /* _ecore_x_event_free_generic_event */ 2259}
2260 2260
2261void 2261void
2262_ecore_x_event_handle_generic_event(XEvent *event) 2262_ecore_x_event_handle_generic_event(XEvent *event)
@@ -2300,7 +2300,7 @@ _ecore_x_event_handle_generic_event(XEvent *event)
2300 return; 2300 return;
2301 event = NULL; 2301 event = NULL;
2302#endif /* ifdef ECORE_XI2 */ 2302#endif /* ifdef ECORE_XI2 */
2303} /* _ecore_x_event_handle_generic_event */ 2303}
2304 2304
2305#ifdef ECORE_XGESTURE 2305#ifdef ECORE_XGESTURE
2306void 2306void
@@ -2315,7 +2315,7 @@ _ecore_x_event_handle_gesture_notify_flick(XEvent *xevent)
2315 xfe = (XGestureNotifyFlickEvent *)xevent; 2315 xfe = (XGestureNotifyFlickEvent *)xevent;
2316 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Flick)); 2316 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Flick));
2317 if (!e) 2317 if (!e)
2318 return; 2318 return;
2319 2319
2320 e->win = xfe->window; 2320 e->win = xfe->window;
2321 e->time = xfe->time; 2321 e->time = xfe->time;
@@ -2341,7 +2341,7 @@ _ecore_x_event_handle_gesture_notify_pan(XEvent *xevent)
2341 xpe = (XGestureNotifyPanEvent *)xevent; 2341 xpe = (XGestureNotifyPanEvent *)xevent;
2342 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Pan)); 2342 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Pan));
2343 if (!e) 2343 if (!e)
2344 return; 2344 return;
2345 2345
2346 e->win = xpe->window; 2346 e->win = xpe->window;
2347 e->time = xpe->time; 2347 e->time = xpe->time;
@@ -2368,7 +2368,7 @@ _ecore_x_event_handle_gesture_notify_pinchrotation(XEvent *xevent)
2368 xpre = (XGestureNotifyPinchRotationEvent *)xevent; 2368 xpre = (XGestureNotifyPinchRotationEvent *)xevent;
2369 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_PinchRotation)); 2369 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_PinchRotation));
2370 if (!e) 2370 if (!e)
2371 return; 2371 return;
2372 2372
2373 e->win = xpre->window; 2373 e->win = xpre->window;
2374 e->time = xpre->time; 2374 e->time = xpre->time;
@@ -2395,7 +2395,7 @@ _ecore_x_event_handle_gesture_notify_tap(XEvent *xevent)
2395 xte = (XGestureNotifyTapEvent *)xevent; 2395 xte = (XGestureNotifyTapEvent *)xevent;
2396 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Tap)); 2396 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Tap));
2397 if (!e) 2397 if (!e)
2398 return; 2398 return;
2399 2399
2400 e->win = xte->window; 2400 e->win = xte->window;
2401 e->time = xte->time; 2401 e->time = xte->time;
@@ -2421,7 +2421,7 @@ _ecore_x_event_handle_gesture_notify_tapnhold(XEvent *xevent)
2421 xthe = (XGestureNotifyTapNHoldEvent *)xevent; 2421 xthe = (XGestureNotifyTapNHoldEvent *)xevent;
2422 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_TapNHold)); 2422 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_TapNHold));
2423 if (!e) 2423 if (!e)
2424 return; 2424 return;
2425 2425
2426 e->win = xthe->window; 2426 e->win = xthe->window;
2427 e->time = xthe->time; 2427 e->time = xthe->time;
@@ -2436,7 +2436,7 @@ _ecore_x_event_handle_gesture_notify_tapnhold(XEvent *xevent)
2436} 2436}
2437 2437
2438void 2438void
2439 _ecore_x_event_handle_gesture_notify_hold(XEvent *xevent) 2439_ecore_x_event_handle_gesture_notify_hold(XEvent *xevent)
2440{ 2440{
2441 XGestureNotifyHoldEvent *xhe; 2441 XGestureNotifyHoldEvent *xhe;
2442 Ecore_X_Event_Gesture_Notify_Hold *e; 2442 Ecore_X_Event_Gesture_Notify_Hold *e;
@@ -2447,7 +2447,7 @@ void
2447 xhe = (XGestureNotifyHoldEvent *)xevent; 2447 xhe = (XGestureNotifyHoldEvent *)xevent;
2448 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Hold)); 2448 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Hold));
2449 if (!e) 2449 if (!e)
2450 return; 2450 return;
2451 2451
2452 e->win = xhe->window; 2452 e->win = xhe->window;
2453 e->time = xhe->time; 2453 e->time = xhe->time;
@@ -2461,7 +2461,7 @@ void
2461} 2461}
2462 2462
2463void 2463void
2464 _ecore_x_event_handle_gesture_notify_group(XEvent *xevent) 2464_ecore_x_event_handle_gesture_notify_group(XEvent *xevent)
2465{ 2465{
2466 XGestureNotifyGroupEvent *xge; 2466 XGestureNotifyGroupEvent *xge;
2467 Ecore_X_Event_Gesture_Notify_Group *e; 2467 Ecore_X_Event_Gesture_Notify_Group *e;
@@ -2472,7 +2472,7 @@ void
2472 xge = (XGestureNotifyGroupEvent *)xevent; 2472 xge = (XGestureNotifyGroupEvent *)xevent;
2473 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Group)); 2473 e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Group));
2474 if (!e) 2474 if (!e)
2475 return; 2475 return;
2476 2476
2477 e->win = xge->window; 2477 e->win = xge->window;
2478 e->time = xge->time; 2478 e->time = xge->time;
@@ -2482,5 +2482,6 @@ void
2482 2482
2483 ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_GROUP, e, NULL, NULL); 2483 ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_GROUP, e, NULL, NULL);
2484} 2484}
2485
2485#endif /* ifdef ECORE_XGESTURE */ 2486#endif /* ifdef ECORE_XGESTURE */
2486 2487
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
index e81af13..da0a6c3 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
@@ -32,13 +32,13 @@ _ecore_x_fixes_init(void)
32#else /* ifdef ECORE_XFIXES */ 32#else /* ifdef ECORE_XFIXES */
33 _fixes_available = 0; 33 _fixes_available = 0;
34#endif /* ifdef ECORE_XFIXES */ 34#endif /* ifdef ECORE_XFIXES */
35} /* _ecore_x_fixes_init */ 35}
36 36
37#ifdef ECORE_XFIXES 37#ifdef ECORE_XFIXES
38/* I don't know what to call this function. */ 38/* I don't know what to call this function. */
39static XRectangle * 39static XRectangle *
40_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects, 40_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
41 int num) 41 int num)
42{ 42{
43 XRectangle *xrect; 43 XRectangle *xrect;
44 int i; 44 int i;
@@ -58,11 +58,11 @@ _ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
58 xrect[i].height = rects[i].height; 58 xrect[i].height = rects[i].height;
59 } 59 }
60 return xrect; 60 return xrect;
61} /* _ecore_x_rectangle_ecore_to_x */ 61}
62 62
63static Ecore_X_Rectangle * 63static Ecore_X_Rectangle *
64_ecore_x_rectangle_x_to_ecore(XRectangle *xrect, 64_ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
65 int num) 65 int num)
66{ 66{
67 Ecore_X_Rectangle *rects; 67 Ecore_X_Rectangle *rects;
68 int i; 68 int i;
@@ -82,7 +82,7 @@ _ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
82 rects[i].height = xrect[i].height; 82 rects[i].height = xrect[i].height;
83 } 83 }
84 return rects; 84 return rects;
85} /* _ecore_x_rectangle_x_to_ecore */ 85}
86 86
87#endif /* ifdef ECORE_XFIXES */ 87#endif /* ifdef ECORE_XFIXES */
88 88
@@ -106,7 +106,7 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
106 106
107EAPI Ecore_X_Region 107EAPI Ecore_X_Region
108ecore_x_region_new(Ecore_X_Rectangle *rects, 108ecore_x_region_new(Ecore_X_Rectangle *rects,
109 int num) 109 int num)
110{ 110{
111#ifdef ECORE_XFIXES 111#ifdef ECORE_XFIXES
112 Ecore_X_Region region; 112 Ecore_X_Region region;
@@ -120,7 +120,7 @@ ecore_x_region_new(Ecore_X_Rectangle *rects,
120#else /* ifdef ECORE_XFIXES */ 120#else /* ifdef ECORE_XFIXES */
121 return 0; 121 return 0;
122#endif /* ifdef ECORE_XFIXES */ 122#endif /* ifdef ECORE_XFIXES */
123} /* ecore_x_region_new */ 123}
124 124
125EAPI Ecore_X_Region 125EAPI Ecore_X_Region
126ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap) 126ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
@@ -134,10 +134,10 @@ ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
134#else /* ifdef ECORE_XFIXES */ 134#else /* ifdef ECORE_XFIXES */
135 return 0; 135 return 0;
136#endif /* ifdef ECORE_XFIXES */ 136#endif /* ifdef ECORE_XFIXES */
137} /* ecore_x_region_new_from_bitmap */ 137}
138 138
139EAPI Ecore_X_Region 139EAPI Ecore_X_Region
140ecore_x_region_new_from_window(Ecore_X_Window win, 140ecore_x_region_new_from_window(Ecore_X_Window win,
141 Ecore_X_Region_Type type) 141 Ecore_X_Region_Type type)
142{ 142{
143#ifdef ECORE_XFIXES 143#ifdef ECORE_XFIXES
@@ -149,7 +149,7 @@ ecore_x_region_new_from_window(Ecore_X_Window win,
149#else /* ifdef ECORE_XFIXES */ 149#else /* ifdef ECORE_XFIXES */
150 return 0; 150 return 0;
151#endif /* ifdef ECORE_XFIXES */ 151#endif /* ifdef ECORE_XFIXES */
152} /* ecore_x_region_new_from_window */ 152}
153 153
154EAPI Ecore_X_Region 154EAPI Ecore_X_Region
155ecore_x_region_new_from_gc(Ecore_X_GC gc) 155ecore_x_region_new_from_gc(Ecore_X_GC gc)
@@ -163,7 +163,7 @@ ecore_x_region_new_from_gc(Ecore_X_GC gc)
163#else /* ifdef ECORE_XFIXES */ 163#else /* ifdef ECORE_XFIXES */
164 return 0; 164 return 0;
165#endif /* ifdef ECORE_XFIXES */ 165#endif /* ifdef ECORE_XFIXES */
166} /* ecore_x_region_new_from_gc */ 166}
167 167
168EAPI Ecore_X_Region 168EAPI Ecore_X_Region
169ecore_x_region_new_from_picture(Ecore_X_Picture picture) 169ecore_x_region_new_from_picture(Ecore_X_Picture picture)
@@ -177,7 +177,7 @@ ecore_x_region_new_from_picture(Ecore_X_Picture picture)
177#else /* ifdef ECORE_XFIXES */ 177#else /* ifdef ECORE_XFIXES */
178 return 0; 178 return 0;
179#endif /* ifdef ECORE_XFIXES */ 179#endif /* ifdef ECORE_XFIXES */
180} /* ecore_x_region_new_from_picture */ 180}
181 181
182EAPI void 182EAPI void
183ecore_x_region_free(Ecore_X_Region region) 183ecore_x_region_free(Ecore_X_Region region)
@@ -186,19 +186,19 @@ ecore_x_region_free(Ecore_X_Region region)
186 LOGFN(__FILE__, __LINE__, __FUNCTION__); 186 LOGFN(__FILE__, __LINE__, __FUNCTION__);
187 XFixesDestroyRegion(_ecore_x_disp, region); 187 XFixesDestroyRegion(_ecore_x_disp, region);
188#endif /* ifdef ECORE_XFIXES */ 188#endif /* ifdef ECORE_XFIXES */
189} /* ecore_x_region_free */ 189}
190 190
191EAPI void 191EAPI void
192ecore_x_region_set(Ecore_X_Region region, 192ecore_x_region_set(Ecore_X_Region region,
193 Ecore_X_Rectangle *rects, 193 Ecore_X_Rectangle *rects,
194 int num) 194 int num)
195{ 195{
196#ifdef ECORE_XFIXES 196#ifdef ECORE_XFIXES
197 XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num); 197 XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
198 LOGFN(__FILE__, __LINE__, __FUNCTION__); 198 LOGFN(__FILE__, __LINE__, __FUNCTION__);
199 XFixesSetRegion(_ecore_x_disp, region, xrect, num); 199 XFixesSetRegion(_ecore_x_disp, region, xrect, num);
200#endif /* ifdef ECORE_XFIXES */ 200#endif /* ifdef ECORE_XFIXES */
201} /* ecore_x_region_set */ 201}
202 202
203EAPI void 203EAPI void
204ecore_x_region_copy(Ecore_X_Region dest, 204ecore_x_region_copy(Ecore_X_Region dest,
@@ -208,7 +208,7 @@ ecore_x_region_copy(Ecore_X_Region dest,
208 LOGFN(__FILE__, __LINE__, __FUNCTION__); 208 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFixesCopyRegion(_ecore_x_disp, dest, source); 209 XFixesCopyRegion(_ecore_x_disp, dest, source);
210#endif /* ifdef ECORE_XFIXES */ 210#endif /* ifdef ECORE_XFIXES */
211} /* ecore_x_region_copy */ 211}
212 212
213EAPI void 213EAPI void
214ecore_x_region_combine(Ecore_X_Region dest, 214ecore_x_region_combine(Ecore_X_Region dest,
@@ -219,7 +219,7 @@ ecore_x_region_combine(Ecore_X_Region dest,
219 LOGFN(__FILE__, __LINE__, __FUNCTION__); 219 LOGFN(__FILE__, __LINE__, __FUNCTION__);
220 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2); 220 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2);
221#endif /* ifdef ECORE_XFIXES */ 221#endif /* ifdef ECORE_XFIXES */
222} /* ecore_x_region_combine */ 222}
223 223
224EAPI void 224EAPI void
225ecore_x_region_intersect(Ecore_X_Region dest, 225ecore_x_region_intersect(Ecore_X_Region dest,
@@ -230,7 +230,7 @@ ecore_x_region_intersect(Ecore_X_Region dest,
230 LOGFN(__FILE__, __LINE__, __FUNCTION__); 230 LOGFN(__FILE__, __LINE__, __FUNCTION__);
231 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2); 231 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2);
232#endif /* ifdef ECORE_XFIXES */ 232#endif /* ifdef ECORE_XFIXES */
233} /* ecore_x_region_intersect */ 233}
234 234
235EAPI void 235EAPI void
236ecore_x_region_subtract(Ecore_X_Region dest, 236ecore_x_region_subtract(Ecore_X_Region dest,
@@ -241,35 +241,36 @@ ecore_x_region_subtract(Ecore_X_Region dest,
241 LOGFN(__FILE__, __LINE__, __FUNCTION__); 241 LOGFN(__FILE__, __LINE__, __FUNCTION__);
242 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2); 242 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2);
243#endif /* ifdef ECORE_XFIXES */ 243#endif /* ifdef ECORE_XFIXES */
244} /* ecore_x_region_subtract */ 244}
245 245
246EAPI void 246EAPI void
247ecore_x_region_invert(Ecore_X_Region dest, 247ecore_x_region_invert(Ecore_X_Region dest,
248 Ecore_X_Rectangle *bounds, 248 Ecore_X_Rectangle *bounds,
249 Ecore_X_Region source) 249 Ecore_X_Region source)
250{ 250{
251#ifdef ECORE_XFIXES 251#ifdef ECORE_XFIXES
252 XRectangle *xbound; 252 XRectangle *xbound;
253 int num = 0; 253 int num = 0;
254 254
255 LOGFN(__FILE__, __LINE__, __FUNCTION__); 255 LOGFN(__FILE__, __LINE__, __FUNCTION__);
256 while (bounds + num) num++; 256 while (bounds + num)
257 num++;
257 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num); 258 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num);
258 259
259 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source); 260 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source);
260#endif /* ifdef ECORE_XFIXES */ 261#endif /* ifdef ECORE_XFIXES */
261} /* ecore_x_region_invert */ 262}
262 263
263EAPI void 264EAPI void
264ecore_x_region_translate(Ecore_X_Region region, 265ecore_x_region_translate(Ecore_X_Region region,
265 int dx, 266 int dx,
266 int dy) 267 int dy)
267{ 268{
268#ifdef ECORE_XFIXES 269#ifdef ECORE_XFIXES
269 LOGFN(__FILE__, __LINE__, __FUNCTION__); 270 LOGFN(__FILE__, __LINE__, __FUNCTION__);
270 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy); 271 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy);
271#endif /* ifdef ECORE_XFIXES */ 272#endif /* ifdef ECORE_XFIXES */
272} /* ecore_x_region_translate */ 273}
273 274
274EAPI void 275EAPI void
275ecore_x_region_extents(Ecore_X_Region dest, 276ecore_x_region_extents(Ecore_X_Region dest,
@@ -279,11 +280,11 @@ ecore_x_region_extents(Ecore_X_Region dest,
279 LOGFN(__FILE__, __LINE__, __FUNCTION__); 280 LOGFN(__FILE__, __LINE__, __FUNCTION__);
280 XFixesRegionExtents(_ecore_x_disp, dest, source); 281 XFixesRegionExtents(_ecore_x_disp, dest, source);
281#endif /* ifdef ECORE_XFIXES */ 282#endif /* ifdef ECORE_XFIXES */
282} /* ecore_x_region_extents */ 283}
283 284
284EAPI Ecore_X_Rectangle * 285EAPI Ecore_X_Rectangle *
285ecore_x_region_fetch(Ecore_X_Region region, 286ecore_x_region_fetch(Ecore_X_Region region,
286 int *num, 287 int *num,
287 Ecore_X_Rectangle *bounds){ 288 Ecore_X_Rectangle *bounds){
288#ifdef ECORE_XFIXES 289#ifdef ECORE_XFIXES
289 Ecore_X_Rectangle *rects; 290 Ecore_X_Rectangle *rects;
@@ -300,40 +301,40 @@ ecore_x_region_fetch(Ecore_X_Region region,
300#else /* ifdef ECORE_XFIXES */ 301#else /* ifdef ECORE_XFIXES */
301 return NULL; 302 return NULL;
302#endif /* ifdef ECORE_XFIXES */ 303#endif /* ifdef ECORE_XFIXES */
303} /* ecore_x_region_fetch */ 304}
304 305
305EAPI void 306EAPI void
306ecore_x_region_expand(Ecore_X_Region dest, 307ecore_x_region_expand(Ecore_X_Region dest,
307 Ecore_X_Region source, 308 Ecore_X_Region source,
308 unsigned int left, 309 unsigned int left,
309 unsigned int right, 310 unsigned int right,
310 unsigned int top, 311 unsigned int top,
311 unsigned int bottom) 312 unsigned int bottom)
312{ 313{
313#ifdef ECORE_XFIXES 314#ifdef ECORE_XFIXES
314 LOGFN(__FILE__, __LINE__, __FUNCTION__); 315 LOGFN(__FILE__, __LINE__, __FUNCTION__);
315 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom); 316 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom);
316#endif /* ifdef ECORE_XFIXES */ 317#endif /* ifdef ECORE_XFIXES */
317} /* ecore_x_region_expand */ 318}
318 319
319EAPI void 320EAPI void
320ecore_x_region_gc_clip_set(Ecore_X_Region region, 321ecore_x_region_gc_clip_set(Ecore_X_Region region,
321 Ecore_X_GC gc, 322 Ecore_X_GC gc,
322 int x_origin, 323 int x_origin,
323 int y_origin) 324 int y_origin)
324{ 325{
325#ifdef ECORE_XFIXES 326#ifdef ECORE_XFIXES
326 LOGFN(__FILE__, __LINE__, __FUNCTION__); 327 LOGFN(__FILE__, __LINE__, __FUNCTION__);
327 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region); 328 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region);
328#endif /* ifdef ECORE_XFIXES */ 329#endif /* ifdef ECORE_XFIXES */
329} /* ecore_x_region_gc_clip_set */ 330}
330 331
331EAPI void 332EAPI void
332ecore_x_region_window_shape_set(Ecore_X_Region region, 333ecore_x_region_window_shape_set(Ecore_X_Region region,
333 Ecore_X_Window win, 334 Ecore_X_Window win,
334 Ecore_X_Shape_Type type, 335 Ecore_X_Shape_Type type,
335 int x_offset, 336 int x_offset,
336 int y_offset) 337 int y_offset)
337{ 338{
338#ifdef ECORE_XFIXES 339#ifdef ECORE_XFIXES
339 LOGFN(__FILE__, __LINE__, __FUNCTION__); 340 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -344,13 +345,13 @@ ecore_x_region_window_shape_set(Ecore_X_Region region,
344 y_offset, 345 y_offset,
345 region); 346 region);
346#endif /* ifdef ECORE_XFIXES */ 347#endif /* ifdef ECORE_XFIXES */
347} /* ecore_x_region_window_shape_set */ 348}
348 349
349EAPI void 350EAPI void
350ecore_x_region_picture_clip_set(Ecore_X_Region region, 351ecore_x_region_picture_clip_set(Ecore_X_Region region,
351 Ecore_X_Picture picture, 352 Ecore_X_Picture picture,
352 int x_origin, 353 int x_origin,
353 int y_origin) 354 int y_origin)
354{ 355{
355#ifdef ECORE_XFIXES 356#ifdef ECORE_XFIXES
356 LOGFN(__FILE__, __LINE__, __FUNCTION__); 357 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -360,5 +361,5 @@ ecore_x_region_picture_clip_set(Ecore_X_Region region,
360 y_origin, 361 y_origin,
361 region); 362 region);
362#endif /* ifdef ECORE_XFIXES */ 363#endif /* ifdef ECORE_XFIXES */
363} /* ecore_x_region_picture_clip_set */ 364}
364 365
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
index 10b807b..5396366 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
@@ -19,9 +19,9 @@
19 * @return The new default graphics context. 19 * @return The new default graphics context.
20 */ 20 */
21EAPI Ecore_X_GC 21EAPI Ecore_X_GC
22ecore_x_gc_new(Ecore_X_Drawable draw, 22ecore_x_gc_new(Ecore_X_Drawable draw,
23 Ecore_X_GC_Value_Mask value_mask, 23 Ecore_X_GC_Value_Mask value_mask,
24 const unsigned int *value_list) 24 const unsigned int *value_list)
25{ 25{
26 XGCValues gcv; 26 XGCValues gcv;
27 int mask; 27 int mask;
@@ -152,11 +152,11 @@ ecore_x_gc_new(Ecore_X_Drawable draw,
152 gcv.arc_mode = value_list[idx]; 152 gcv.arc_mode = value_list[idx];
153 idx++; 153 idx++;
154 break; 154 break;
155 } /* switch */ 155 }
156 } 156 }
157 157
158 return XCreateGC(_ecore_x_disp, draw, value_mask, &gcv); 158 return XCreateGC(_ecore_x_disp, draw, value_mask, &gcv);
159} /* ecore_x_gc_new */ 159}
160 160
161/** 161/**
162 * Deletes and frees the given graphics context. 162 * Deletes and frees the given graphics context.
@@ -167,5 +167,5 @@ ecore_x_gc_free(Ecore_X_GC gc)
167{ 167{
168 LOGFN(__FILE__, __LINE__, __FUNCTION__); 168 LOGFN(__FILE__, __LINE__, __FUNCTION__);
169 XFreeGC(_ecore_x_disp, gc); 169 XFreeGC(_ecore_x_disp, gc);
170} /* ecore_x_gc_free */ 170}
171 171
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gesture.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gesture.c
index e1dc75c..e89421b 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gesture.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_gesture.c
@@ -26,7 +26,7 @@ _ecore_x_gesture_init(void)
26 _gesture_available = EINA_TRUE; 26 _gesture_available = EINA_TRUE;
27 } 27 }
28 else 28 else
29 _gesture_available = EINA_FALSE; 29 _gesture_available = EINA_FALSE;
30#else /* ifdef ECORE_XGESTURE */ 30#else /* ifdef ECORE_XGESTURE */
31 _gesture_available = EINA_FALSE; 31 _gesture_available = EINA_FALSE;
32#endif /* ifdef ECORE_XGESTURE */ 32#endif /* ifdef ECORE_XGESTURE */
@@ -48,11 +48,11 @@ ecore_x_gesture_events_select(Ecore_X_Window win,
48{ 48{
49#ifdef ECORE_XGESTURE 49#ifdef ECORE_XGESTURE
50 if (!_gesture_available) 50 if (!_gesture_available)
51 return EINA_FALSE; 51 return EINA_FALSE;
52 52
53 LOGFN(__FILE__, __LINE__, __FUNCTION__); 53 LOGFN(__FILE__, __LINE__, __FUNCTION__);
54 XGestureSelectEvents(_ecore_x_disp, win, mask); 54 XGestureSelectEvents(_ecore_x_disp, win, mask);
55 55
56 return EINA_TRUE; 56 return EINA_TRUE;
57#else /* ifdef ECORE_XGESTURE */ 57#else /* ifdef ECORE_XGESTURE */
58 return EINA_FALSE; 58 return EINA_FALSE;
@@ -68,7 +68,7 @@ ecore_x_gesture_events_selected_get(Ecore_X_Window win)
68 Ecore_X_Gesture_Event_Mask mask; 68 Ecore_X_Gesture_Event_Mask mask;
69 69
70 if (!_gesture_available) 70 if (!_gesture_available)
71 return ECORE_X_GESTURE_EVENT_MASK_NONE; 71 return ECORE_X_GESTURE_EVENT_MASK_NONE;
72 72
73 LOGFN(__FILE__, __LINE__, __FUNCTION__); 73 LOGFN(__FILE__, __LINE__, __FUNCTION__);
74 if (GestureSuccess != XGestureGetSelectedEvents(_ecore_x_disp, win, &mask)) 74 if (GestureSuccess != XGestureGetSelectedEvents(_ecore_x_disp, win, &mask))
@@ -76,7 +76,7 @@ ecore_x_gesture_events_selected_get(Ecore_X_Window win)
76 mask = ECORE_X_GESTURE_EVENT_MASK_NONE; 76 mask = ECORE_X_GESTURE_EVENT_MASK_NONE;
77 return mask; 77 return mask;
78 } 78 }
79 79
80 return mask; 80 return mask;
81#else /* ifdef ECORE_XGESTURE */ 81#else /* ifdef ECORE_XGESTURE */
82 return ECORE_X_GESTURE_EVENT_MASK_NONE; 82 return ECORE_X_GESTURE_EVENT_MASK_NONE;
@@ -91,14 +91,14 @@ ecore_x_gesture_event_grab(Ecore_X_Window win,
91{ 91{
92#ifdef ECORE_XGESTURE 92#ifdef ECORE_XGESTURE
93 if (!_gesture_available) 93 if (!_gesture_available)
94 return EINA_FALSE; 94 return EINA_FALSE;
95 95
96 LOGFN(__FILE__, __LINE__, __FUNCTION__); 96 LOGFN(__FILE__, __LINE__, __FUNCTION__);
97 if (GestureGrabSuccess != XGestureGrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime)) 97 if (GestureGrabSuccess != XGestureGrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime))
98 { 98 {
99 return EINA_FALSE; 99 return EINA_FALSE;
100 } 100 }
101 101
102 return EINA_TRUE; 102 return EINA_TRUE;
103#else /* ifdef ECORE_XGESTURE */ 103#else /* ifdef ECORE_XGESTURE */
104 return EINA_FALSE; 104 return EINA_FALSE;
@@ -117,14 +117,14 @@ ecore_x_gesture_event_ungrab(Ecore_X_Window win,
117 Ecore_X_Gesture_Event_Mask mask; 117 Ecore_X_Gesture_Event_Mask mask;
118 118
119 if (!_gesture_available) 119 if (!_gesture_available)
120 return EINA_FALSE; 120 return EINA_FALSE;
121 121
122 LOGFN(__FILE__, __LINE__, __FUNCTION__); 122 LOGFN(__FILE__, __LINE__, __FUNCTION__);
123 if (GestureUngrabSuccess != XGestureUngrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime)) 123 if (GestureUngrabSuccess != XGestureUngrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime))
124 { 124 {
125 return EINA_FALSE; 125 return EINA_FALSE;
126 } 126 }
127 127
128 return EINA_TRUE; 128 return EINA_TRUE;
129#else /* ifdef ECORE_XGESTURE */ 129#else /* ifdef ECORE_XGESTURE */
130 return EINA_FALSE; 130 return EINA_FALSE;
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
index 3899651..8d6ea1f 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
@@ -21,10 +21,10 @@ EAPI void
21ecore_x_icccm_init(void) 21ecore_x_icccm_init(void)
22{ 22{
23 LOGFN(__FILE__, __LINE__, __FUNCTION__); 23 LOGFN(__FILE__, __LINE__, __FUNCTION__);
24} /* ecore_x_icccm_init */ 24}
25 25
26EAPI void 26EAPI void
27ecore_x_icccm_state_set(Ecore_X_Window win, 27ecore_x_icccm_state_set(Ecore_X_Window win,
28 Ecore_X_Window_State_Hint state) 28 Ecore_X_Window_State_Hint state)
29{ 29{
30 unsigned long c[2]; 30 unsigned long c[2];
@@ -41,7 +41,7 @@ ecore_x_icccm_state_set(Ecore_X_Window win,
41 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE, 41 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
42 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace, 42 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
43 (unsigned char *)c, 2); 43 (unsigned char *)c, 2);
44} /* ecore_x_icccm_state_set */ 44}
45 45
46EAPI Ecore_X_Window_State_Hint 46EAPI Ecore_X_Window_State_Hint
47ecore_x_icccm_state_get(Ecore_X_Window win) 47ecore_x_icccm_state_get(Ecore_X_Window win)
@@ -72,47 +72,47 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
72 XFree(prop_ret); 72 XFree(prop_ret);
73 73
74 return hint; 74 return hint;
75} /* ecore_x_icccm_state_get */ 75}
76 76
77EAPI void 77EAPI void
78ecore_x_icccm_delete_window_send(Ecore_X_Window win, 78ecore_x_icccm_delete_window_send(Ecore_X_Window win,
79 Ecore_X_Time t) 79 Ecore_X_Time t)
80{ 80{
81 LOGFN(__FILE__, __LINE__, __FUNCTION__); 81 LOGFN(__FILE__, __LINE__, __FUNCTION__);
82 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS, 82 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
83 ECORE_X_EVENT_MASK_NONE, 83 ECORE_X_EVENT_MASK_NONE,
84 ECORE_X_ATOM_WM_DELETE_WINDOW, 84 ECORE_X_ATOM_WM_DELETE_WINDOW,
85 t, 0, 0, 0); 85 t, 0, 0, 0);
86} /* ecore_x_icccm_delete_window_send */ 86}
87 87
88EAPI void 88EAPI void
89ecore_x_icccm_take_focus_send(Ecore_X_Window win, 89ecore_x_icccm_take_focus_send(Ecore_X_Window win,
90 Ecore_X_Time t) 90 Ecore_X_Time t)
91{ 91{
92 LOGFN(__FILE__, __LINE__, __FUNCTION__); 92 LOGFN(__FILE__, __LINE__, __FUNCTION__);
93 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS, 93 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
94 ECORE_X_EVENT_MASK_NONE, 94 ECORE_X_EVENT_MASK_NONE,
95 ECORE_X_ATOM_WM_TAKE_FOCUS, 95 ECORE_X_ATOM_WM_TAKE_FOCUS,
96 t, 0, 0, 0); 96 t, 0, 0, 0);
97} /* ecore_x_icccm_take_focus_send */ 97}
98 98
99EAPI void 99EAPI void
100ecore_x_icccm_save_yourself_send(Ecore_X_Window win, 100ecore_x_icccm_save_yourself_send(Ecore_X_Window win,
101 Ecore_X_Time t) 101 Ecore_X_Time t)
102{ 102{
103 LOGFN(__FILE__, __LINE__, __FUNCTION__); 103 LOGFN(__FILE__, __LINE__, __FUNCTION__);
104 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS, 104 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
105 ECORE_X_EVENT_MASK_NONE, 105 ECORE_X_EVENT_MASK_NONE,
106 ECORE_X_ATOM_WM_SAVE_YOURSELF, 106 ECORE_X_ATOM_WM_SAVE_YOURSELF,
107 t, 0, 0, 0); 107 t, 0, 0, 0);
108} /* ecore_x_icccm_save_yourself_send */ 108}
109 109
110EAPI void 110EAPI void
111ecore_x_icccm_move_resize_send(Ecore_X_Window win, 111ecore_x_icccm_move_resize_send(Ecore_X_Window win,
112 int x, 112 int x,
113 int y, 113 int y,
114 int w, 114 int w,
115 int h) 115 int h)
116{ 116{
117 XEvent ev; 117 XEvent ev;
118 118
@@ -129,17 +129,17 @@ ecore_x_icccm_move_resize_send(Ecore_X_Window win,
129 ev.xconfigure.above = None; 129 ev.xconfigure.above = None;
130 ev.xconfigure.override_redirect = False; 130 ev.xconfigure.override_redirect = False;
131 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev); 131 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
132} /* ecore_x_icccm_move_resize_send */ 132}
133 133
134EAPI void 134EAPI void
135ecore_x_icccm_hints_set(Ecore_X_Window win, 135ecore_x_icccm_hints_set(Ecore_X_Window win,
136 Eina_Bool accepts_focus, 136 Eina_Bool accepts_focus,
137 Ecore_X_Window_State_Hint initial_state, 137 Ecore_X_Window_State_Hint initial_state,
138 Ecore_X_Pixmap icon_pixmap, 138 Ecore_X_Pixmap icon_pixmap,
139 Ecore_X_Pixmap icon_mask, 139 Ecore_X_Pixmap icon_mask,
140 Ecore_X_Window icon_window, 140 Ecore_X_Window icon_window,
141 Ecore_X_Window window_group, 141 Ecore_X_Window window_group,
142 Eina_Bool is_urgent) 142 Eina_Bool is_urgent)
143{ 143{
144 XWMHints *hints; 144 XWMHints *hints;
145 145
@@ -186,17 +186,17 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
186 186
187 XSetWMHints(_ecore_x_disp, win, hints); 187 XSetWMHints(_ecore_x_disp, win, hints);
188 XFree(hints); 188 XFree(hints);
189} /* ecore_x_icccm_hints_set */ 189}
190 190
191EAPI Eina_Bool 191EAPI Eina_Bool
192ecore_x_icccm_hints_get(Ecore_X_Window win, 192ecore_x_icccm_hints_get(Ecore_X_Window win,
193 Eina_Bool *accepts_focus, 193 Eina_Bool *accepts_focus,
194 Ecore_X_Window_State_Hint *initial_state, 194 Ecore_X_Window_State_Hint *initial_state,
195 Ecore_X_Pixmap *icon_pixmap, 195 Ecore_X_Pixmap *icon_pixmap,
196 Ecore_X_Pixmap *icon_mask, 196 Ecore_X_Pixmap *icon_mask,
197 Ecore_X_Window *icon_window, 197 Ecore_X_Window *icon_window,
198 Ecore_X_Window *window_group, 198 Ecore_X_Window *window_group,
199 Eina_Bool *is_urgent) 199 Eina_Bool *is_urgent)
200{ 200{
201 XWMHints *hints; 201 XWMHints *hints;
202 202
@@ -263,22 +263,22 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
263 } 263 }
264 264
265 return EINA_FALSE; 265 return EINA_FALSE;
266} /* ecore_x_icccm_hints_get */ 266}
267 267
268EAPI void 268EAPI void
269ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win, 269ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
270 Eina_Bool request_pos, 270 Eina_Bool request_pos,
271 Ecore_X_Gravity gravity, 271 Ecore_X_Gravity gravity,
272 int min_w, 272 int min_w,
273 int min_h, 273 int min_h,
274 int max_w, 274 int max_w,
275 int max_h, 275 int max_h,
276 int base_w, 276 int base_w,
277 int base_h, 277 int base_h,
278 int step_x, 278 int step_x,
279 int step_y, 279 int step_y,
280 double min_aspect, 280 double min_aspect,
281 double max_aspect) 281 double max_aspect)
282{ 282{
283 XSizeHints hint; 283 XSizeHints hint;
284 long mask; 284 long mask;
@@ -335,22 +335,22 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
335 } 335 }
336 336
337 XSetWMNormalHints(_ecore_x_disp, win, &hint); 337 XSetWMNormalHints(_ecore_x_disp, win, &hint);
338} /* ecore_x_icccm_size_pos_hints_set */ 338}
339 339
340EAPI Eina_Bool 340EAPI Eina_Bool
341ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win, 341ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
342 Eina_Bool *request_pos, 342 Eina_Bool *request_pos,
343 Ecore_X_Gravity *gravity, 343 Ecore_X_Gravity *gravity,
344 int *min_w, 344 int *min_w,
345 int *min_h, 345 int *min_h,
346 int *max_w, 346 int *max_w,
347 int *max_h, 347 int *max_h,
348 int *base_w, 348 int *base_w,
349 int *base_h, 349 int *base_h,
350 int *step_x, 350 int *step_x,
351 int *step_y, 351 int *step_y,
352 double *min_aspect, 352 double *min_aspect,
353 double *max_aspect) 353 double *max_aspect)
354{ 354{
355 XSizeHints hint; 355 XSizeHints hint;
356 long mask; 356 long mask;
@@ -460,11 +460,11 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
460 *max_aspect = maxa; 460 *max_aspect = maxa;
461 461
462 return EINA_TRUE; 462 return EINA_TRUE;
463} /* ecore_x_icccm_size_pos_hints_get */ 463}
464 464
465EAPI void 465EAPI void
466ecore_x_icccm_title_set(Ecore_X_Window win, 466ecore_x_icccm_title_set(Ecore_X_Window win,
467 const char *t) 467 const char *t)
468{ 468{
469 char *list[1]; 469 char *list[1];
470 XTextProperty xprop; 470 XTextProperty xprop;
@@ -500,7 +500,7 @@ ecore_x_icccm_title_set(Ecore_X_Window win,
500 } 500 }
501 501
502 free(list[0]); 502 free(list[0]);
503} /* ecore_x_icccm_title_set */ 503}
504 504
505EAPI char * 505EAPI char *
506ecore_x_icccm_title_get(Ecore_X_Window win) 506ecore_x_icccm_title_get(Ecore_X_Window win)
@@ -522,23 +522,23 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
522 t = strdup((char *)xprop.value); 522 t = strdup((char *)xprop.value);
523 else 523 else
524 { 524 {
525 /* convert to utf8 */ 525 /* convert to utf8 */
526#ifdef X_HAVE_UTF8_STRING 526#ifdef X_HAVE_UTF8_STRING
527 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop, 527 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
528 &list, &num); 528 &list, &num);
529#else /* ifdef X_HAVE_UTF8_STRING */ 529#else /* ifdef X_HAVE_UTF8_STRING */
530 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop, 530 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
531 &list, &num); 531 &list, &num);
532#endif /* ifdef X_HAVE_UTF8_STRING */ 532#endif /* ifdef X_HAVE_UTF8_STRING */
533 533
534 if ((ret == XLocaleNotSupported) || 534 if ((ret == XLocaleNotSupported) ||
535 (ret == XNoMemory) || (ret == XConverterNotFound)) 535 (ret == XNoMemory) || (ret == XConverterNotFound))
536 t = strdup((char *)xprop.value); 536 t = strdup((char *)xprop.value);
537 else if ((ret >= Success) && (num > 0)) 537 else if ((ret >= Success) && (num > 0))
538 t = strdup(list[0]); 538 t = strdup(list[0]);
539 539
540 if (list) 540 if (list)
541 XFreeStringList(list); 541 XFreeStringList(list);
542 } 542 }
543 543
544 if (xprop.value) 544 if (xprop.value)
@@ -549,7 +549,7 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
549 } 549 }
550 550
551 return NULL; 551 return NULL;
552} /* ecore_x_icccm_title_get */ 552}
553 553
554/** 554/**
555 * Set protocol atoms explicitly 555 * Set protocol atoms explicitly
@@ -559,15 +559,15 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
559 */ 559 */
560EAPI void 560EAPI void
561ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win, 561ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
562 Ecore_X_Atom *protos, 562 Ecore_X_Atom *protos,
563 int num) 563 int num)
564{ 564{
565 LOGFN(__FILE__, __LINE__, __FUNCTION__); 565 LOGFN(__FILE__, __LINE__, __FUNCTION__);
566 if (num > 0) 566 if (num > 0)
567 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num); 567 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
568 else 568 else
569 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS); 569 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
570} /* ecore_x_icccm_protocol_atoms_set */ 570}
571 571
572/** 572/**
573 * Set or unset a wm protocol property. 573 * Set or unset a wm protocol property.
@@ -576,9 +576,9 @@ ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
576 * @param on On/Off 576 * @param on On/Off
577 */ 577 */
578EAPI void 578EAPI void
579ecore_x_icccm_protocol_set(Ecore_X_Window win, 579ecore_x_icccm_protocol_set(Ecore_X_Window win,
580 Ecore_X_WM_Protocol protocol, 580 Ecore_X_WM_Protocol protocol,
581 Eina_Bool on) 581 Eina_Bool on)
582{ 582{
583 Atom *protos = NULL; 583 Atom *protos = NULL;
584 Atom proto; 584 Atom proto;
@@ -653,7 +653,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
653leave: 653leave:
654 if (protos) 654 if (protos)
655 XFree(protos); 655 XFree(protos);
656} /* ecore_x_icccm_protocol_set */ 656}
657 657
658/** 658/**
659 * Determines whether a protocol is set for a window. 659 * Determines whether a protocol is set for a window.
@@ -662,7 +662,7 @@ leave:
662 * @return 1 if the protocol is set, else 0. 662 * @return 1 if the protocol is set, else 0.
663 */ 663 */
664EAPI Eina_Bool 664EAPI Eina_Bool
665ecore_x_icccm_protocol_isset(Ecore_X_Window win, 665ecore_x_icccm_protocol_isset(Ecore_X_Window win,
666 Ecore_X_WM_Protocol protocol) 666 Ecore_X_WM_Protocol protocol)
667{ 667{
668 Atom proto, *protos = NULL; 668 Atom proto, *protos = NULL;
@@ -690,7 +690,7 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
690 XFree(protos); 690 XFree(protos);
691 691
692 return ret; 692 return ret;
693} /* ecore_x_icccm_protocol_isset */ 693}
694 694
695/** 695/**
696 * Set a window name & class. 696 * Set a window name & class.
@@ -702,8 +702,8 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
702 */ 702 */
703EAPI void 703EAPI void
704ecore_x_icccm_name_class_set(Ecore_X_Window win, 704ecore_x_icccm_name_class_set(Ecore_X_Window win,
705 const char *n, 705 const char *n,
706 const char *c) 706 const char *c)
707{ 707{
708 XClassHint *xch; 708 XClassHint *xch;
709 709
@@ -716,7 +716,7 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win,
716 xch->res_class = (char *)c; 716 xch->res_class = (char *)c;
717 XSetClassHint(_ecore_x_disp, win, xch); 717 XSetClassHint(_ecore_x_disp, win, xch);
718 XFree(xch); 718 XFree(xch);
719} /* ecore_x_icccm_name_class_set */ 719}
720 720
721/** 721/**
722 * Get a window name & class. 722 * Get a window name & class.
@@ -728,8 +728,8 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win,
728 */ 728 */
729EAPI void 729EAPI void
730ecore_x_icccm_name_class_get(Ecore_X_Window win, 730ecore_x_icccm_name_class_get(Ecore_X_Window win,
731 char **n, 731 char **n,
732 char **c) 732 char **c)
733{ 733{
734 XClassHint xch; 734 XClassHint xch;
735 735
@@ -755,7 +755,7 @@ ecore_x_icccm_name_class_get(Ecore_X_Window win,
755 XFree(xch.res_name); 755 XFree(xch.res_name);
756 XFree(xch.res_class); 756 XFree(xch.res_class);
757 } 757 }
758} /* ecore_x_icccm_name_class_get */ 758}
759 759
760/** 760/**
761 * Get a window client machine string. 761 * Get a window client machine string.
@@ -772,7 +772,7 @@ ecore_x_icccm_client_machine_get(Ecore_X_Window win)
772 LOGFN(__FILE__, __LINE__, __FUNCTION__); 772 LOGFN(__FILE__, __LINE__, __FUNCTION__);
773 name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE); 773 name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE);
774 return name; 774 return name;
775} /* ecore_x_icccm_client_machine_get */ 775}
776 776
777/** 777/**
778 * Sets the WM_COMMAND property for @a win. 778 * Sets the WM_COMMAND property for @a win.
@@ -783,12 +783,12 @@ ecore_x_icccm_client_machine_get(Ecore_X_Window win)
783 */ 783 */
784EAPI void 784EAPI void
785ecore_x_icccm_command_set(Ecore_X_Window win, 785ecore_x_icccm_command_set(Ecore_X_Window win,
786 int argc, 786 int argc,
787 char **argv) 787 char **argv)
788{ 788{
789 LOGFN(__FILE__, __LINE__, __FUNCTION__); 789 LOGFN(__FILE__, __LINE__, __FUNCTION__);
790 XSetCommand(_ecore_x_disp, win, argv, argc); 790 XSetCommand(_ecore_x_disp, win, argv, argc);
791} /* ecore_x_icccm_command_set */ 791}
792 792
793/** 793/**
794 * Get the WM_COMMAND property for @a win. 794 * Get the WM_COMMAND property for @a win.
@@ -801,8 +801,8 @@ ecore_x_icccm_command_set(Ecore_X_Window win,
801 */ 801 */
802EAPI void 802EAPI void
803ecore_x_icccm_command_get(Ecore_X_Window win, 803ecore_x_icccm_command_get(Ecore_X_Window win,
804 int *argc, 804 int *argc,
805 char ***argv) 805 char ***argv)
806{ 806{
807 int i, c; 807 int i, c;
808 char **v; 808 char **v;
@@ -850,7 +850,7 @@ ecore_x_icccm_command_get(Ecore_X_Window win,
850 } 850 }
851 851
852 XFreeStringList(v); 852 XFreeStringList(v);
853} /* ecore_x_icccm_command_get */ 853}
854 854
855/** 855/**
856 * Set a window icon name. 856 * Set a window icon name.
@@ -861,7 +861,7 @@ ecore_x_icccm_command_get(Ecore_X_Window win,
861 */ 861 */
862EAPI void 862EAPI void
863ecore_x_icccm_icon_name_set(Ecore_X_Window win, 863ecore_x_icccm_icon_name_set(Ecore_X_Window win,
864 const char *t) 864 const char *t)
865{ 865{
866 char *list[1]; 866 char *list[1];
867 XTextProperty xprop; 867 XTextProperty xprop;
@@ -892,7 +892,7 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win,
892 } 892 }
893 893
894 free(list[0]); 894 free(list[0]);
895} /* ecore_x_icccm_icon_name_set */ 895}
896 896
897/** 897/**
898 * Get a window icon name. 898 * Get a window icon name.
@@ -921,26 +921,26 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
921 t = strdup((char *)xprop.value); 921 t = strdup((char *)xprop.value);
922 else 922 else
923 { 923 {
924 /* convert to utf8 */ 924 /* convert to utf8 */
925#ifdef X_HAVE_UTF8_STRING 925#ifdef X_HAVE_UTF8_STRING
926 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop, 926 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
927 &list, &num); 927 &list, &num);
928#else /* ifdef X_HAVE_UTF8_STRING */ 928#else /* ifdef X_HAVE_UTF8_STRING */
929 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop, 929 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
930 &list, &num); 930 &list, &num);
931#endif /* ifdef X_HAVE_UTF8_STRING */ 931#endif /* ifdef X_HAVE_UTF8_STRING */
932 932
933 if ((ret == XLocaleNotSupported) || 933 if ((ret == XLocaleNotSupported) ||
934 (ret == XNoMemory) || (ret == XConverterNotFound)) 934 (ret == XNoMemory) || (ret == XConverterNotFound))
935 t = strdup((char *)xprop.value); 935 t = strdup((char *)xprop.value);
936 else if (ret >= Success) 936 else if (ret >= Success)
937 { 937 {
938 if ((num >= 1) && (list)) 938 if ((num >= 1) && (list))
939 t = strdup(list[0]); 939 t = strdup(list[0]);
940 940
941 if (list) 941 if (list)
942 XFreeStringList(list); 942 XFreeStringList(list);
943 } 943 }
944 } 944 }
945 945
946 if (xprop.value) 946 if (xprop.value)
@@ -951,7 +951,7 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
951 } 951 }
952 952
953 return NULL; 953 return NULL;
954} /* ecore_x_icccm_icon_name_get */ 954}
955 955
956/** 956/**
957 * Add a subwindow to the list of windows that need a different colormap installed. 957 * Add a subwindow to the list of windows that need a different colormap installed.
@@ -1014,7 +1014,7 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
1014 ECORE_X_ATOM_WM_COLORMAP_WINDOWS, 1014 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
1015 XA_WINDOW, 32, data, num); 1015 XA_WINDOW, 32, data, num);
1016 free(newset); 1016 free(newset);
1017} /* ecore_x_icccm_colormap_window_set */ 1017}
1018 1018
1019/** 1019/**
1020 * Remove a window from the list of colormap windows. 1020 * Remove a window from the list of colormap windows.
@@ -1079,7 +1079,7 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win,
1079 1079
1080 if (old_data) 1080 if (old_data)
1081 XFree(old_data); 1081 XFree(old_data);
1082} /* ecore_x_icccm_colormap_window_unset */ 1082}
1083 1083
1084/** 1084/**
1085 * Specify that a window is transient for another top-level window and should be handled accordingly. 1085 * Specify that a window is transient for another top-level window and should be handled accordingly.
@@ -1092,18 +1092,18 @@ ecore_x_icccm_transient_for_set(Ecore_X_Window win,
1092{ 1092{
1093 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1093 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1094 XSetTransientForHint(_ecore_x_disp, win, forwin); 1094 XSetTransientForHint(_ecore_x_disp, win, forwin);
1095} /* ecore_x_icccm_transient_for_set */ 1095}
1096 1096
1097/** 1097/**
1098 * Remove the transient_for setting from a window. 1098 * Remove the transient_for setting from a window.
1099 * @param The window 1099 * @param win The window
1100 */ 1100 */
1101EAPI void 1101EAPI void
1102ecore_x_icccm_transient_for_unset(Ecore_X_Window win) 1102ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
1103{ 1103{
1104 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1104 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1105 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR); 1105 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
1106} /* ecore_x_icccm_transient_for_unset */ 1106}
1107 1107
1108/** 1108/**
1109 * Get the window this window is transient for, if any. 1109 * Get the window this window is transient for, if any.
@@ -1120,7 +1120,7 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
1120 return (Ecore_X_Window)forwin; 1120 return (Ecore_X_Window)forwin;
1121 else 1121 else
1122 return 0; 1122 return 0;
1123} /* ecore_x_icccm_transient_for_get */ 1123}
1124 1124
1125/** 1125/**
1126 * Set the window role hint. 1126 * Set the window role hint.
@@ -1129,12 +1129,12 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
1129 */ 1129 */
1130EAPI void 1130EAPI void
1131ecore_x_icccm_window_role_set(Ecore_X_Window win, 1131ecore_x_icccm_window_role_set(Ecore_X_Window win,
1132 const char *role) 1132 const char *role)
1133{ 1133{
1134 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1134 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1135 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE, 1135 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE,
1136 (char *)role); 1136 (char *)role);
1137} /* ecore_x_icccm_window_role_set */ 1137}
1138 1138
1139/** 1139/**
1140 * Get the window role. 1140 * Get the window role.
@@ -1146,7 +1146,7 @@ ecore_x_icccm_window_role_get(Ecore_X_Window win)
1146{ 1146{
1147 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1147 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1148 return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE); 1148 return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE);
1149} /* ecore_x_icccm_window_role_get */ 1149}
1150 1150
1151/** 1151/**
1152 * Set the window's client leader. 1152 * Set the window's client leader.
@@ -1163,7 +1163,7 @@ ecore_x_icccm_client_leader_set(Ecore_X_Window win,
1163 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1163 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1164 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_WM_CLIENT_LEADER, 1164 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
1165 &l, 1); 1165 &l, 1);
1166} /* ecore_x_icccm_client_leader_set */ 1166}
1167 1167
1168/** 1168/**
1169 * Get the window's client leader. 1169 * Get the window's client leader.
@@ -1180,7 +1180,7 @@ ecore_x_icccm_client_leader_get(Ecore_X_Window win)
1180 return l; 1180 return l;
1181 1181
1182 return 0; 1182 return 0;
1183} /* ecore_x_icccm_client_leader_get */ 1183}
1184 1184
1185EAPI void 1185EAPI void
1186ecore_x_icccm_iconic_request_send(Ecore_X_Window win, 1186ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
@@ -1206,7 +1206,7 @@ ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
1206 1206
1207 XSendEvent(_ecore_x_disp, root, False, 1207 XSendEvent(_ecore_x_disp, root, False,
1208 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1208 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1209} /* ecore_x_icccm_iconic_request_send */ 1209}
1210 1210
1211/* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */ 1211/* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */
1212/* hints. each should go in their own file/section so we know which */ 1212/* hints. each should go in their own file/section so we know which */
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_image.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
index 2de5319..b8e720c 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
@@ -1,26 +1,28 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2# include <config.h> 2# include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */ 3#endif
4
5#include <stdlib.h>
6#include <string.h>
7#include <sys/ipc.h>
8#include <sys/shm.h>
4 9
5#include "ecore_x_private.h" 10#include "ecore_x_private.h"
6#include "Ecore_X.h" 11#include "Ecore_X.h"
7 12
8#include <X11/extensions/XShm.h> 13#include <X11/extensions/XShm.h>
9#include <X11/Xutil.h> 14#include <X11/Xutil.h>
10#include <sys/ipc.h>
11#include <sys/shm.h>
12#include <string.h>
13 15
14static int _ecore_x_image_shm_can = -1; 16static int _ecore_x_image_shm_can = -1;
15static int _ecore_x_image_err = 0; 17static int _ecore_x_image_err = 0;
16 18
17static int 19static int
18_ecore_x_image_error_handler(Display *d __UNUSED__, 20_ecore_x_image_error_handler(Display *d __UNUSED__,
19 XErrorEvent *ev __UNUSED__) 21 XErrorEvent *ev __UNUSED__)
20{ 22{
21 _ecore_x_image_err = 1; 23 _ecore_x_image_err = 1;
22 return 0; 24 return 0;
23} /* _ecore_x_image_error_handler */ 25}
24 26
25static void 27static void
26_ecore_x_image_shm_check(void) 28_ecore_x_image_shm_check(void)
@@ -90,7 +92,7 @@ _ecore_x_image_shm_check(void)
90 shmctl(shminfo.shmid, IPC_RMID, 0); 92 shmctl(shminfo.shmid, IPC_RMID, 0);
91 93
92 _ecore_x_image_shm_can = 1; 94 _ecore_x_image_shm_can = 1;
93} /* _ecore_x_image_shm_check */ 95}
94 96
95struct _Ecore_X_Image 97struct _Ecore_X_Image
96{ 98{
@@ -105,10 +107,10 @@ struct _Ecore_X_Image
105}; 107};
106 108
107EAPI Ecore_X_Image * 109EAPI Ecore_X_Image *
108ecore_x_image_new(int w, 110ecore_x_image_new(int w,
109 int h, 111 int h,
110 Ecore_X_Visual vis, 112 Ecore_X_Visual vis,
111 int depth) 113 int depth)
112{ 114{
113 Ecore_X_Image *im; 115 Ecore_X_Image *im;
114 116
@@ -124,7 +126,7 @@ ecore_x_image_new(int w,
124 _ecore_x_image_shm_check(); 126 _ecore_x_image_shm_check();
125 im->shm = _ecore_x_image_shm_can; 127 im->shm = _ecore_x_image_shm_can;
126 return im; 128 return im;
127} /* ecore_x_image_new */ 129}
128 130
129EAPI void 131EAPI void
130ecore_x_image_free(Ecore_X_Image *im) 132ecore_x_image_free(Ecore_X_Image *im)
@@ -148,7 +150,7 @@ ecore_x_image_free(Ecore_X_Image *im)
148 } 150 }
149 151
150 free(im); 152 free(im);
151} /* ecore_x_image_free */ 153}
152 154
153static void 155static void
154_ecore_x_image_shm_create(Ecore_X_Image *im) 156_ecore_x_image_shm_create(Ecore_X_Image *im)
@@ -192,17 +194,17 @@ _ecore_x_image_shm_create(Ecore_X_Image *im)
192 im->bpp = 2; 194 im->bpp = 2;
193 else 195 else
194 im->bpp = 4; 196 im->bpp = 4;
195} /* _ecore_x_image_shm_create */ 197}
196 198
197EAPI Eina_Bool 199EAPI Eina_Bool
198ecore_x_image_get(Ecore_X_Image *im, 200ecore_x_image_get(Ecore_X_Image *im,
199 Ecore_X_Drawable draw, 201 Ecore_X_Drawable draw,
200 int x, 202 int x,
201 int y, 203 int y,
202 int sx, 204 int sx,
203 int sy, 205 int sy,
204 int w, 206 int w,
205 int h) 207 int h)
206{ 208{
207 Eina_Bool ret = EINA_TRUE; 209 Eina_Bool ret = EINA_TRUE;
208 XErrorHandler ph; 210 XErrorHandler ph;
@@ -278,18 +280,18 @@ ecore_x_image_get(Ecore_X_Image *im,
278 } 280 }
279 281
280 return ret; 282 return ret;
281} /* ecore_x_image_get */ 283}
282 284
283EAPI void 285EAPI void
284ecore_x_image_put(Ecore_X_Image *im, 286ecore_x_image_put(Ecore_X_Image *im,
285 Ecore_X_Drawable draw, 287 Ecore_X_Drawable draw,
286 Ecore_X_GC gc, 288 Ecore_X_GC gc,
287 int x, 289 int x,
288 int y, 290 int y,
289 int sx, 291 int sx,
290 int sy, 292 int sy,
291 int w, 293 int w,
292 int h) 294 int h)
293{ 295{
294 Ecore_X_GC tgc = 0; 296 Ecore_X_GC tgc = 0;
295 297
@@ -306,13 +308,13 @@ ecore_x_image_put(Ecore_X_Image *im,
306 if (im->xim) 308 if (im->xim)
307 XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False); 309 XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False);
308 if (tgc) ecore_x_gc_free(tgc); 310 if (tgc) ecore_x_gc_free(tgc);
309} /* ecore_x_image_put */ 311}
310 312
311EAPI void * 313EAPI void *
312ecore_x_image_data_get(Ecore_X_Image *im, 314ecore_x_image_data_get(Ecore_X_Image *im,
313 int *bpl, 315 int *bpl,
314 int *rows, 316 int *rows,
315 int *bpp) 317 int *bpp)
316{ 318{
317 LOGFN(__FILE__, __LINE__, __FUNCTION__); 319 LOGFN(__FILE__, __LINE__, __FUNCTION__);
318 if (!im->xim) _ecore_x_image_shm_create(im); 320 if (!im->xim) _ecore_x_image_shm_create(im);
@@ -321,7 +323,7 @@ ecore_x_image_data_get(Ecore_X_Image *im,
321 if (rows) *rows = im->rows; 323 if (rows) *rows = im->rows;
322 if (bpp) *bpp = im->bpp; 324 if (bpp) *bpp = im->bpp;
323 return im->data; 325 return im->data;
324} /* ecore_x_image_data_get */ 326}
325 327
326EAPI Eina_Bool 328EAPI Eina_Bool
327ecore_x_image_is_argb32_get(Ecore_X_Image *im) 329ecore_x_image_is_argb32_get(Ecore_X_Image *im)
@@ -345,19 +347,19 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
345} 347}
346 348
347EAPI Eina_Bool 349EAPI Eina_Bool
348ecore_x_image_to_argb_convert(void *src, 350ecore_x_image_to_argb_convert(void *src,
349 int sbpp, 351 int sbpp,
350 int sbpl, 352 int sbpl,
351 Ecore_X_Colormap c, 353 Ecore_X_Colormap c,
352 Ecore_X_Visual v, 354 Ecore_X_Visual v,
353 int x, 355 int x,
354 int y, 356 int y,
355 int w, 357 int w,
356 int h, 358 int h,
357 unsigned int *dst, 359 unsigned int *dst,
358 int dbpl, 360 int dbpl,
359 int dx, 361 int dx,
360 int dy) 362 int dy)
361{ 363{
362 Visual *vis = v; 364 Visual *vis = v;
363 XColor *cols = NULL; 365 XColor *cols = NULL;
@@ -411,9 +413,9 @@ ecore_x_image_to_argb_convert(void *src,
411 else if ((vis->class == TrueColor) || 413 else if ((vis->class == TrueColor) ||
412 (vis->class == DirectColor)) 414 (vis->class == DirectColor))
413 { 415 {
414 if ((vis->red_mask == 0x00ff0000) && 416 if ((vis->red_mask == 0x00ff0000) &&
415 (vis->green_mask == 0x0000ff00) && 417 (vis->green_mask == 0x0000ff00) &&
416 (vis->blue_mask == 0x000000ff)) 418 (vis->blue_mask == 0x000000ff))
417 mode = argbx888; 419 mode = argbx888;
418 else if ((vis->red_mask == 0x000000ff) && 420 else if ((vis->red_mask == 0x000000ff) &&
419 (vis->green_mask == 0x0000ff00) && 421 (vis->green_mask == 0x0000ff00) &&
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
index 7459a8b..7812cc2 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
@@ -32,8 +32,8 @@ typedef struct _mwmhints
32MWMHints; 32MWMHints;
33 33
34EAPI Eina_Bool 34EAPI Eina_Bool
35ecore_x_mwm_hints_get(Ecore_X_Window win, 35ecore_x_mwm_hints_get(Ecore_X_Window win,
36 Ecore_X_MWM_Hint_Func *fhint, 36 Ecore_X_MWM_Hint_Func *fhint,
37 Ecore_X_MWM_Hint_Decor *dhint, 37 Ecore_X_MWM_Hint_Decor *dhint,
38 Ecore_X_MWM_Hint_Input *ihint) 38 Ecore_X_MWM_Hint_Input *ihint)
39{ 39{
@@ -86,11 +86,11 @@ ecore_x_mwm_hints_get(Ecore_X_Window win,
86 } 86 }
87 87
88 return ret; 88 return ret;
89} /* ecore_x_mwm_hints_get */ 89}
90 90
91EAPI void 91EAPI void
92ecore_x_mwm_borderless_set(Ecore_X_Window win, 92ecore_x_mwm_borderless_set(Ecore_X_Window win,
93 Eina_Bool borderless) 93 Eina_Bool borderless)
94{ 94{
95 unsigned int data[5] = {0, 0, 0, 0, 0}; 95 unsigned int data[5] = {0, 0, 0, 0, 0};
96 96
@@ -102,5 +102,5 @@ ecore_x_mwm_borderless_set(Ecore_X_Window win,
102 ECORE_X_ATOM_MOTIF_WM_HINTS, 102 ECORE_X_ATOM_MOTIF_WM_HINTS,
103 ECORE_X_ATOM_MOTIF_WM_HINTS, 103 ECORE_X_ATOM_MOTIF_WM_HINTS,
104 32, (void *)data, 5); 104 32, (void *)data, 5);
105} /* ecore_x_mwm_borderless_set */ 105}
106 106
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 1a6fc9a..9fc428a 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -4,8 +4,9 @@
4 4
5#ifdef HAVE_CONFIG_H 5#ifdef HAVE_CONFIG_H
6# include <config.h> 6# include <config.h>
7#endif /* ifdef HAVE_CONFIG_H */ 7#endif
8 8
9#include <stdlib.h>
9#include <stdio.h> 10#include <stdio.h>
10#include <string.h> 11#include <string.h>
11 12
@@ -39,17 +40,17 @@ struct _Ecore_X_Startup_Info
39 int silent; 40 int silent;
40}; 41};
41 42
42static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, 43static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
43 Ecore_X_Atom atom, 44 Ecore_X_Atom atom,
44 const char *str); 45 const char *str);
45static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, 46static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
46 Ecore_X_Atom atom); 47 Ecore_X_Atom atom);
47#if 0 /* Unused */ 48#if 0 /* Unused */
48static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info); 49static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info);
49static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, 50static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
50 char *data); 51 char *data);
51#endif /* if 0 */ 52#endif /* if 0 */
52static void _ecore_x_netwm_startup_info_free(void *data); 53static void _ecore_x_netwm_startup_info_free(void *data);
53 54
54/* 55/*
55 * Convenience macros 56 * Convenience macros
@@ -76,7 +77,7 @@ ecore_x_netwm_init(void)
76 LOGFN(__FILE__, __LINE__, __FUNCTION__); 77 LOGFN(__FILE__, __LINE__, __FUNCTION__);
77 startup_info = eina_hash_string_superfast_new( 78 startup_info = eina_hash_string_superfast_new(
78 _ecore_x_netwm_startup_info_free); 79 _ecore_x_netwm_startup_info_free);
79} /* ecore_x_netwm_init */ 80}
80 81
81EAPI void 82EAPI void
82ecore_x_netwm_shutdown(void) 83ecore_x_netwm_shutdown(void)
@@ -86,7 +87,7 @@ ecore_x_netwm_shutdown(void)
86 eina_hash_free(startup_info); 87 eina_hash_free(startup_info);
87 88
88 startup_info = NULL; 89 startup_info = NULL;
89} /* ecore_x_netwm_shutdown */ 90}
90 91
91/* 92/*
92 * WM identification 93 * WM identification
@@ -94,7 +95,7 @@ ecore_x_netwm_shutdown(void)
94EAPI void 95EAPI void
95ecore_x_netwm_wm_identify(Ecore_X_Window root, 96ecore_x_netwm_wm_identify(Ecore_X_Window root,
96 Ecore_X_Window check, 97 Ecore_X_Window check,
97 const char *wm_name) 98 const char *wm_name)
98{ 99{
99 LOGFN(__FILE__, __LINE__, __FUNCTION__); 100 LOGFN(__FILE__, __LINE__, __FUNCTION__);
100 ecore_x_window_prop_window_set(root, 101 ecore_x_window_prop_window_set(root,
@@ -112,27 +113,27 @@ ecore_x_netwm_wm_identify(Ecore_X_Window root,
112 _ecore_x_window_prop_string_utf8_set(root, 113 _ecore_x_window_prop_string_utf8_set(root,
113 ECORE_X_ATOM_NET_WM_NAME, 114 ECORE_X_ATOM_NET_WM_NAME,
114 wm_name); 115 wm_name);
115} /* ecore_x_netwm_wm_identify */ 116}
116 117
117/* 118/*
118 * Set supported atoms 119 * Set supported atoms
119 */ 120 */
120EAPI void 121EAPI void
121ecore_x_netwm_supported_set(Ecore_X_Window root, 122ecore_x_netwm_supported_set(Ecore_X_Window root,
122 Ecore_X_Atom *supported, 123 Ecore_X_Atom *supported,
123 int num) 124 int num)
124{ 125{
125 LOGFN(__FILE__, __LINE__, __FUNCTION__); 126 LOGFN(__FILE__, __LINE__, __FUNCTION__);
126 ecore_x_window_prop_atom_set(root, 127 ecore_x_window_prop_atom_set(root,
127 ECORE_X_ATOM_NET_SUPPORTED, 128 ECORE_X_ATOM_NET_SUPPORTED,
128 supported, 129 supported,
129 num); 130 num);
130} /* ecore_x_netwm_supported_set */ 131}
131 132
132EAPI Eina_Bool 133EAPI Eina_Bool
133ecore_x_netwm_supported_get(Ecore_X_Window root, 134ecore_x_netwm_supported_get(Ecore_X_Window root,
134 Ecore_X_Atom **supported, 135 Ecore_X_Atom **supported,
135 int *num) 136 int *num)
136{ 137{
137 int num_ret; 138 int num_ret;
138 139
@@ -152,36 +153,36 @@ ecore_x_netwm_supported_get(Ecore_X_Window root,
152 *num = num_ret; 153 *num = num_ret;
153 154
154 return EINA_TRUE; 155 return EINA_TRUE;
155} /* ecore_x_netwm_supported_get */ 156}
156 157
157/* 158/*
158 * Desktop configuration and status 159 * Desktop configuration and status
159 */ 160 */
160EAPI void 161EAPI void
161ecore_x_netwm_desk_count_set(Ecore_X_Window root, 162ecore_x_netwm_desk_count_set(Ecore_X_Window root,
162 unsigned int n_desks) 163 unsigned int n_desks)
163{ 164{
164 LOGFN(__FILE__, __LINE__, __FUNCTION__); 165 LOGFN(__FILE__, __LINE__, __FUNCTION__);
165 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS, 166 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
166 &n_desks, 1); 167 &n_desks, 1);
167} /* ecore_x_netwm_desk_count_set */ 168}
168 169
169EAPI void 170EAPI void
170ecore_x_netwm_desk_roots_set(Ecore_X_Window root, 171ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
171 Ecore_X_Window *vroots, 172 Ecore_X_Window *vroots,
172 unsigned int n_desks) 173 unsigned int n_desks)
173{ 174{
174 LOGFN(__FILE__, __LINE__, __FUNCTION__); 175 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175 ecore_x_window_prop_window_set(root, 176 ecore_x_window_prop_window_set(root,
176 ECORE_X_ATOM_NET_VIRTUAL_ROOTS, 177 ECORE_X_ATOM_NET_VIRTUAL_ROOTS,
177 vroots, 178 vroots,
178 n_desks); 179 n_desks);
179} /* ecore_x_netwm_desk_roots_set */ 180}
180 181
181EAPI void 182EAPI void
182ecore_x_netwm_desk_names_set(Ecore_X_Window root, 183ecore_x_netwm_desk_names_set(Ecore_X_Window root,
183 const char **names, 184 const char **names,
184 unsigned int n_desks) 185 unsigned int n_desks)
185{ 186{
186 char ss[32], *buf, *t; 187 char ss[32], *buf, *t;
187 const char *s; 188 const char *s;
@@ -198,8 +199,8 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
198 if (!s) 199 if (!s)
199 { 200 {
200 /* Default to "Desk-<number>" */ 201 /* Default to "Desk-<number>" */
201 sprintf(ss, "Desk-%d", i); 202 sprintf(ss, "Desk-%d", i);
202 s = ss; 203 s = ss;
203 } 204 }
204 205
205 l = strlen(s) + 1; 206 l = strlen(s) + 1;
@@ -215,12 +216,12 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
215 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len); 216 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len);
216 217
217 free(buf); 218 free(buf);
218} /* ecore_x_netwm_desk_names_set */ 219}
219 220
220EAPI void 221EAPI void
221ecore_x_netwm_desk_size_set(Ecore_X_Window root, 222ecore_x_netwm_desk_size_set(Ecore_X_Window root,
222 unsigned int width, 223 unsigned int width,
223 unsigned int height) 224 unsigned int height)
224{ 225{
225 unsigned int size[2]; 226 unsigned int size[2];
226 227
@@ -229,24 +230,24 @@ ecore_x_netwm_desk_size_set(Ecore_X_Window root,
229 size[1] = height; 230 size[1] = height;
230 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, size, 231 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, size,
231 2); 232 2);
232} /* ecore_x_netwm_desk_size_set */ 233}
233 234
234EAPI void 235EAPI void
235ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, 236ecore_x_netwm_desk_viewports_set(Ecore_X_Window root,
236 unsigned int *origins, 237 unsigned int *origins,
237 unsigned int n_desks) 238 unsigned int n_desks)
238{ 239{
239 LOGFN(__FILE__, __LINE__, __FUNCTION__); 240 LOGFN(__FILE__, __LINE__, __FUNCTION__);
240 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT, 241 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
241 origins, 2 * n_desks); 242 origins, 2 * n_desks);
242} /* ecore_x_netwm_desk_viewports_set */ 243}
243 244
244EAPI void 245EAPI void
245ecore_x_netwm_desk_layout_set(Ecore_X_Window root, 246ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
246 int orientation, 247 int orientation,
247 int columns, 248 int columns,
248 int rows, 249 int rows,
249 int starting_corner) 250 int starting_corner)
250{ 251{
251 unsigned int layout[4]; 252 unsigned int layout[4];
252 253
@@ -257,26 +258,26 @@ ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
257 layout[3] = starting_corner; 258 layout[3] = starting_corner;
258 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT, 259 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT,
259 layout, 4); 260 layout, 4);
260} /* ecore_x_netwm_desk_layout_set */ 261}
261 262
262EAPI void 263EAPI void
263ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, 264ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
264 unsigned int *areas, 265 unsigned int *areas,
265 unsigned int n_desks) 266 unsigned int n_desks)
266{ 267{
267 LOGFN(__FILE__, __LINE__, __FUNCTION__); 268 LOGFN(__FILE__, __LINE__, __FUNCTION__);
268 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas, 269 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
269 4 * n_desks); 270 4 * n_desks);
270} /* ecore_x_netwm_desk_workareas_set */ 271}
271 272
272EAPI unsigned int * 273EAPI unsigned int *
273ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks) 274ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
274{ 275{
275 int ret; 276 int ret;
276 unsigned int *areas = NULL; 277 unsigned int *areas = NULL;
277 278
278 if (!root) root = DefaultRootWindow(_ecore_x_disp); 279 if (!root) root = DefaultRootWindow(_ecore_x_disp);
279 280
280 ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA, 281 ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA,
281 &areas); 282 &areas);
282 if (!areas) 283 if (!areas)
@@ -290,16 +291,16 @@ ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
290 291
291EAPI void 292EAPI void
292ecore_x_netwm_desk_current_set(Ecore_X_Window root, 293ecore_x_netwm_desk_current_set(Ecore_X_Window root,
293 unsigned int desk) 294 unsigned int desk)
294{ 295{
295 LOGFN(__FILE__, __LINE__, __FUNCTION__); 296 LOGFN(__FILE__, __LINE__, __FUNCTION__);
296 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk, 297 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk,
297 1); 298 1);
298} /* ecore_x_netwm_desk_current_set */ 299}
299 300
300EAPI void 301EAPI void
301ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, 302ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
302 Eina_Bool on) 303 Eina_Bool on)
303{ 304{
304 unsigned int val; 305 unsigned int val;
305 306
@@ -307,7 +308,7 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
307 val = (on) ? 1 : 0; 308 val = (on) ? 1 : 0;
308 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP, &val, 309 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP, &val,
309 1); 310 1);
310} /* ecore_x_netwm_showing_desktop_set */ 311}
311 312
312/* 313/*
313 * Client status 314 * Client status
@@ -315,25 +316,25 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
315 316
316/* Mapping order */ 317/* Mapping order */
317EAPI void 318EAPI void
318ecore_x_netwm_client_list_set(Ecore_X_Window root, 319ecore_x_netwm_client_list_set(Ecore_X_Window root,
319 Ecore_X_Window *p_clients, 320 Ecore_X_Window *p_clients,
320 unsigned int n_clients) 321 unsigned int n_clients)
321{ 322{
322 LOGFN(__FILE__, __LINE__, __FUNCTION__); 323 LOGFN(__FILE__, __LINE__, __FUNCTION__);
323 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST, 324 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST,
324 p_clients, n_clients); 325 p_clients, n_clients);
325} /* ecore_x_netwm_client_list_set */ 326}
326 327
327/* Stacking order */ 328/* Stacking order */
328EAPI void 329EAPI void
329ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, 330ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root,
330 Ecore_X_Window *p_clients, 331 Ecore_X_Window *p_clients,
331 unsigned int n_clients) 332 unsigned int n_clients)
332{ 333{
333 LOGFN(__FILE__, __LINE__, __FUNCTION__); 334 LOGFN(__FILE__, __LINE__, __FUNCTION__);
334 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING, 335 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING,
335 p_clients, n_clients); 336 p_clients, n_clients);
336} /* ecore_x_netwm_client_list_stacking_set */ 337}
337 338
338EAPI void 339EAPI void
339ecore_x_netwm_client_active_set(Ecore_X_Window root, 340ecore_x_netwm_client_active_set(Ecore_X_Window root,
@@ -342,12 +343,12 @@ ecore_x_netwm_client_active_set(Ecore_X_Window root,
342 LOGFN(__FILE__, __LINE__, __FUNCTION__); 343 LOGFN(__FILE__, __LINE__, __FUNCTION__);
343 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW, 344 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW,
344 &win, 1); 345 &win, 1);
345} /* ecore_x_netwm_client_active_set */ 346}
346 347
347EAPI void 348EAPI void
348ecore_x_netwm_client_active_request(Ecore_X_Window root, 349ecore_x_netwm_client_active_request(Ecore_X_Window root,
349 Ecore_X_Window win, 350 Ecore_X_Window win,
350 int type, 351 int type,
351 Ecore_X_Window current_win) 352 Ecore_X_Window current_win)
352{ 353{
353 XEvent xev; 354 XEvent xev;
@@ -369,19 +370,19 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
369 370
370 XSendEvent(_ecore_x_disp, root, False, 371 XSendEvent(_ecore_x_disp, root, False,
371 SubstructureRedirectMask | SubstructureNotifyMask, &xev); 372 SubstructureRedirectMask | SubstructureNotifyMask, &xev);
372} /* ecore_x_netwm_client_active_request */ 373}
373 374
374EAPI void 375EAPI void
375ecore_x_netwm_name_set(Ecore_X_Window win, 376ecore_x_netwm_name_set(Ecore_X_Window win,
376 const char *name) 377 const char *name)
377{ 378{
378 LOGFN(__FILE__, __LINE__, __FUNCTION__); 379 LOGFN(__FILE__, __LINE__, __FUNCTION__);
379 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name); 380 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name);
380} /* ecore_x_netwm_name_set */ 381}
381 382
382EAPI int 383EAPI int
383ecore_x_netwm_name_get(Ecore_X_Window win, 384ecore_x_netwm_name_get(Ecore_X_Window win,
384 char **name) 385 char **name)
385{ 386{
386 LOGFN(__FILE__, __LINE__, __FUNCTION__); 387 LOGFN(__FILE__, __LINE__, __FUNCTION__);
387 if (name) 388 if (name)
@@ -389,19 +390,19 @@ ecore_x_netwm_name_get(Ecore_X_Window win,
389 ECORE_X_ATOM_NET_WM_NAME); 390 ECORE_X_ATOM_NET_WM_NAME);
390 391
391 return 1; 392 return 1;
392} /* ecore_x_netwm_name_get */ 393}
393 394
394EAPI void 395EAPI void
395ecore_x_netwm_startup_id_set(Ecore_X_Window win, 396ecore_x_netwm_startup_id_set(Ecore_X_Window win,
396 const char *id) 397 const char *id)
397{ 398{
398 LOGFN(__FILE__, __LINE__, __FUNCTION__); 399 LOGFN(__FILE__, __LINE__, __FUNCTION__);
399 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id); 400 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id);
400} /* ecore_x_netwm_startup_id_set */ 401}
401 402
402EAPI int 403EAPI int
403ecore_x_netwm_startup_id_get(Ecore_X_Window win, 404ecore_x_netwm_startup_id_get(Ecore_X_Window win,
404 char **id) 405 char **id)
405{ 406{
406 LOGFN(__FILE__, __LINE__, __FUNCTION__); 407 LOGFN(__FILE__, __LINE__, __FUNCTION__);
407 if (id) 408 if (id)
@@ -409,20 +410,20 @@ ecore_x_netwm_startup_id_get(Ecore_X_Window win,
409 ECORE_X_ATOM_NET_STARTUP_ID); 410 ECORE_X_ATOM_NET_STARTUP_ID);
410 411
411 return 1; 412 return 1;
412} /* ecore_x_netwm_startup_id_get */ 413}
413 414
414EAPI void 415EAPI void
415ecore_x_netwm_visible_name_set(Ecore_X_Window win, 416ecore_x_netwm_visible_name_set(Ecore_X_Window win,
416 const char *name) 417 const char *name)
417{ 418{
418 LOGFN(__FILE__, __LINE__, __FUNCTION__); 419 LOGFN(__FILE__, __LINE__, __FUNCTION__);
419 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME, 420 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
420 name); 421 name);
421} /* ecore_x_netwm_visible_name_set */ 422}
422 423
423EAPI int 424EAPI int
424ecore_x_netwm_visible_name_get(Ecore_X_Window win, 425ecore_x_netwm_visible_name_get(Ecore_X_Window win,
425 char **name) 426 char **name)
426{ 427{
427 LOGFN(__FILE__, __LINE__, __FUNCTION__); 428 LOGFN(__FILE__, __LINE__, __FUNCTION__);
428 if (name) 429 if (name)
@@ -431,20 +432,20 @@ ecore_x_netwm_visible_name_get(Ecore_X_Window win,
431 ECORE_X_ATOM_NET_WM_VISIBLE_NAME); 432 ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
432 433
433 return 1; 434 return 1;
434} /* ecore_x_netwm_visible_name_get */ 435}
435 436
436EAPI void 437EAPI void
437ecore_x_netwm_icon_name_set(Ecore_X_Window win, 438ecore_x_netwm_icon_name_set(Ecore_X_Window win,
438 const char *name) 439 const char *name)
439{ 440{
440 LOGFN(__FILE__, __LINE__, __FUNCTION__); 441 LOGFN(__FILE__, __LINE__, __FUNCTION__);
441 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, 442 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
442 name); 443 name);
443} /* ecore_x_netwm_icon_name_set */ 444}
444 445
445EAPI int 446EAPI int
446ecore_x_netwm_icon_name_get(Ecore_X_Window win, 447ecore_x_netwm_icon_name_get(Ecore_X_Window win,
447 char **name) 448 char **name)
448{ 449{
449 LOGFN(__FILE__, __LINE__, __FUNCTION__); 450 LOGFN(__FILE__, __LINE__, __FUNCTION__);
450 if (name) 451 if (name)
@@ -453,21 +454,21 @@ ecore_x_netwm_icon_name_get(Ecore_X_Window win,
453 ECORE_X_ATOM_NET_WM_ICON_NAME); 454 ECORE_X_ATOM_NET_WM_ICON_NAME);
454 455
455 return 1; 456 return 1;
456} /* ecore_x_netwm_icon_name_get */ 457}
457 458
458EAPI void 459EAPI void
459ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, 460ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win,
460 const char *name) 461 const char *name)
461{ 462{
462 LOGFN(__FILE__, __LINE__, __FUNCTION__); 463 LOGFN(__FILE__, __LINE__, __FUNCTION__);
463 _ecore_x_window_prop_string_utf8_set(win, 464 _ecore_x_window_prop_string_utf8_set(win,
464 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME, 465 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
465 name); 466 name);
466} /* ecore_x_netwm_visible_icon_name_set */ 467}
467 468
468EAPI int 469EAPI int
469ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, 470ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
470 char **name) 471 char **name)
471{ 472{
472 LOGFN(__FILE__, __LINE__, __FUNCTION__); 473 LOGFN(__FILE__, __LINE__, __FUNCTION__);
473 if (name) 474 if (name)
@@ -476,19 +477,19 @@ ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
476 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME); 477 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
477 478
478 return 1; 479 return 1;
479} /* ecore_x_netwm_visible_icon_name_get */ 480}
480 481
481EAPI void 482EAPI void
482ecore_x_netwm_desktop_set(Ecore_X_Window win, 483ecore_x_netwm_desktop_set(Ecore_X_Window win,
483 unsigned int desk) 484 unsigned int desk)
484{ 485{
485 LOGFN(__FILE__, __LINE__, __FUNCTION__); 486 LOGFN(__FILE__, __LINE__, __FUNCTION__);
486 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1); 487 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1);
487} /* ecore_x_netwm_desktop_set */ 488}
488 489
489EAPI Eina_Bool 490EAPI Eina_Bool
490ecore_x_netwm_desktop_get(Ecore_X_Window win, 491ecore_x_netwm_desktop_get(Ecore_X_Window win,
491 unsigned int *desk) 492 unsigned int *desk)
492{ 493{
493 int ret; 494 int ret;
494 unsigned int tmp; 495 unsigned int tmp;
@@ -501,17 +502,17 @@ ecore_x_netwm_desktop_get(Ecore_X_Window win,
501 *desk = tmp; 502 *desk = tmp;
502 503
503 return ret == 1 ? EINA_TRUE : EINA_FALSE; 504 return ret == 1 ? EINA_TRUE : EINA_FALSE;
504} /* ecore_x_netwm_desktop_get */ 505}
505 506
506/* 507/*
507 * _NET_WM_STRUT is deprecated 508 * _NET_WM_STRUT is deprecated
508 */ 509 */
509EAPI void 510EAPI void
510ecore_x_netwm_strut_set(Ecore_X_Window win, 511ecore_x_netwm_strut_set(Ecore_X_Window win,
511 int left, 512 int left,
512 int right, 513 int right,
513 int top, 514 int top,
514 int bottom) 515 int bottom)
515{ 516{
516 unsigned int strut[4]; 517 unsigned int strut[4];
517 518
@@ -521,17 +522,17 @@ ecore_x_netwm_strut_set(Ecore_X_Window win,
521 strut[2] = top; 522 strut[2] = top;
522 strut[3] = bottom; 523 strut[3] = bottom;
523 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4); 524 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4);
524} /* ecore_x_netwm_strut_set */ 525}
525 526
526/* 527/*
527 * _NET_WM_STRUT is deprecated 528 * _NET_WM_STRUT is deprecated
528 */ 529 */
529EAPI Eina_Bool 530EAPI Eina_Bool
530ecore_x_netwm_strut_get(Ecore_X_Window win, 531ecore_x_netwm_strut_get(Ecore_X_Window win,
531 int *left, 532 int *left,
532 int *right, 533 int *right,
533 int *top, 534 int *top,
534 int *bottom) 535 int *bottom)
535{ 536{
536 int ret = 0; 537 int ret = 0;
537 unsigned int strut[4]; 538 unsigned int strut[4];
@@ -557,22 +558,22 @@ ecore_x_netwm_strut_get(Ecore_X_Window win,
557 *bottom = strut[3]; 558 *bottom = strut[3];
558 559
559 return EINA_TRUE; 560 return EINA_TRUE;
560} /* ecore_x_netwm_strut_get */ 561}
561 562
562EAPI void 563EAPI void
563ecore_x_netwm_strut_partial_set(Ecore_X_Window win, 564ecore_x_netwm_strut_partial_set(Ecore_X_Window win,
564 int left, 565 int left,
565 int right, 566 int right,
566 int top, 567 int top,
567 int bottom, 568 int bottom,
568 int left_start_y, 569 int left_start_y,
569 int left_end_y, 570 int left_end_y,
570 int right_start_y, 571 int right_start_y,
571 int right_end_y, 572 int right_end_y,
572 int top_start_x, 573 int top_start_x,
573 int top_end_x, 574 int top_end_x,
574 int bottom_start_x, 575 int bottom_start_x,
575 int bottom_end_x) 576 int bottom_end_x)
576{ 577{
577 unsigned int strut[12]; 578 unsigned int strut[12];
578 579
@@ -593,22 +594,22 @@ ecore_x_netwm_strut_partial_set(Ecore_X_Window win,
593 ECORE_X_ATOM_NET_WM_STRUT_PARTIAL, 594 ECORE_X_ATOM_NET_WM_STRUT_PARTIAL,
594 strut, 595 strut,
595 12); 596 12);
596} /* ecore_x_netwm_strut_partial_set */ 597}
597 598
598EAPI Eina_Bool 599EAPI Eina_Bool
599ecore_x_netwm_strut_partial_get(Ecore_X_Window win, 600ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
600 int *left, 601 int *left,
601 int *right, 602 int *right,
602 int *top, 603 int *top,
603 int *bottom, 604 int *bottom,
604 int *left_start_y, 605 int *left_start_y,
605 int *left_end_y, 606 int *left_end_y,
606 int *right_start_y, 607 int *right_start_y,
607 int *right_end_y, 608 int *right_end_y,
608 int *top_start_x, 609 int *top_start_x,
609 int *top_end_x, 610 int *top_end_x,
610 int *bottom_start_x, 611 int *bottom_start_x,
611 int *bottom_end_x) 612 int *bottom_end_x)
612{ 613{
613 int ret = 0; 614 int ret = 0;
614 unsigned int strut[12]; 615 unsigned int strut[12];
@@ -658,12 +659,12 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
658 *bottom_end_x = strut[11]; 659 *bottom_end_x = strut[11];
659 660
660 return EINA_TRUE; 661 return EINA_TRUE;
661} /* ecore_x_netwm_strut_partial_get */ 662}
662 663
663EAPI Eina_Bool 664EAPI Eina_Bool
664ecore_x_netwm_icons_get(Ecore_X_Window win, 665ecore_x_netwm_icons_get(Ecore_X_Window win,
665 Ecore_X_Icon **icon, 666 Ecore_X_Icon **icon,
666 int *num) 667 int *num)
667{ 668{
668 unsigned int *data, *p; 669 unsigned int *data, *p;
669 unsigned int *src; 670 unsigned int *src;
@@ -767,14 +768,14 @@ ecore_x_netwm_icons_get(Ecore_X_Window win,
767 free(data); 768 free(data);
768 769
769 return EINA_TRUE; 770 return EINA_TRUE;
770} /* ecore_x_netwm_icons_get */ 771}
771 772
772EAPI void 773EAPI void
773ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, 774ecore_x_netwm_icon_geometry_set(Ecore_X_Window win,
774 int x, 775 int x,
775 int y, 776 int y,
776 int width, 777 int width,
777 int height) 778 int height)
778{ 779{
779 unsigned int geometry[4]; 780 unsigned int geometry[4];
780 781
@@ -787,14 +788,14 @@ ecore_x_netwm_icon_geometry_set(Ecore_X_Window win,
787 ECORE_X_ATOM_NET_WM_ICON_GEOMETRY, 788 ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
788 geometry, 789 geometry,
789 4); 790 4);
790} /* ecore_x_netwm_icon_geometry_set */ 791}
791 792
792EAPI Eina_Bool 793EAPI Eina_Bool
793ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, 794ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
794 int *x, 795 int *x,
795 int *y, 796 int *y,
796 int *width, 797 int *width,
797 int *height) 798 int *height)
798{ 799{
799 int ret; 800 int ret;
800 unsigned int geometry[4]; 801 unsigned int geometry[4];
@@ -820,11 +821,11 @@ ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
820 *height = geometry[3]; 821 *height = geometry[3];
821 822
822 return EINA_TRUE; 823 return EINA_TRUE;
823} /* ecore_x_netwm_icon_geometry_get */ 824}
824 825
825EAPI void 826EAPI void
826ecore_x_netwm_pid_set(Ecore_X_Window win, 827ecore_x_netwm_pid_set(Ecore_X_Window win,
827 int pid) 828 int pid)
828{ 829{
829 unsigned int tmp; 830 unsigned int tmp;
830 831
@@ -832,11 +833,11 @@ ecore_x_netwm_pid_set(Ecore_X_Window win,
832 tmp = pid; 833 tmp = pid;
833 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_PID, 834 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_PID,
834 &tmp, 1); 835 &tmp, 1);
835} /* ecore_x_netwm_pid_set */ 836}
836 837
837EAPI Eina_Bool 838EAPI Eina_Bool
838ecore_x_netwm_pid_get(Ecore_X_Window win, 839ecore_x_netwm_pid_get(Ecore_X_Window win,
839 int *pid) 840 int *pid)
840{ 841{
841 int ret; 842 int ret;
842 unsigned int tmp; 843 unsigned int tmp;
@@ -848,7 +849,7 @@ ecore_x_netwm_pid_get(Ecore_X_Window win,
848 *pid = tmp; 849 *pid = tmp;
849 850
850 return ret == 1 ? EINA_TRUE : EINA_FALSE; 851 return ret == 1 ? EINA_TRUE : EINA_FALSE;
851} /* ecore_x_netwm_pid_get */ 852}
852 853
853EAPI void 854EAPI void
854ecore_x_netwm_handled_icons_set(Ecore_X_Window win) 855ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
@@ -856,7 +857,7 @@ ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
856 LOGFN(__FILE__, __LINE__, __FUNCTION__); 857 LOGFN(__FILE__, __LINE__, __FUNCTION__);
857 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS, 858 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
858 NULL, 0); 859 NULL, 0);
859} /* ecore_x_netwm_handled_icons_set */ 860}
860 861
861EAPI Eina_Bool 862EAPI Eina_Bool
862ecore_x_netwm_handled_icons_get(Ecore_X_Window win) 863ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
@@ -866,20 +867,20 @@ ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
866 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS, 867 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
867 NULL, 0); 868 NULL, 0);
868 return ret == 0 ? EINA_TRUE : EINA_FALSE; 869 return ret == 0 ? EINA_TRUE : EINA_FALSE;
869} /* ecore_x_netwm_handled_icons_get */ 870}
870 871
871EAPI void 872EAPI void
872ecore_x_netwm_user_time_set(Ecore_X_Window win, 873ecore_x_netwm_user_time_set(Ecore_X_Window win,
873 unsigned int tim) 874 unsigned int tim)
874{ 875{
875 LOGFN(__FILE__, __LINE__, __FUNCTION__); 876 LOGFN(__FILE__, __LINE__, __FUNCTION__);
876 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME, 877 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME,
877 &tim, 1); 878 &tim, 1);
878} /* ecore_x_netwm_user_time_set */ 879}
879 880
880EAPI Eina_Bool 881EAPI Eina_Bool
881ecore_x_netwm_user_time_get(Ecore_X_Window win, 882ecore_x_netwm_user_time_get(Ecore_X_Window win,
882 unsigned int *tim) 883 unsigned int *tim)
883{ 884{
884 int ret; 885 int ret;
885 unsigned int tmp; 886 unsigned int tmp;
@@ -891,7 +892,7 @@ ecore_x_netwm_user_time_get(Ecore_X_Window win,
891 *tim = tmp; 892 *tim = tmp;
892 893
893 return ret == 1 ? EINA_TRUE : EINA_FALSE; 894 return ret == 1 ? EINA_TRUE : EINA_FALSE;
894} /* ecore_x_netwm_user_time_get */ 895}
895 896
896Ecore_X_Window_State 897Ecore_X_Window_State
897_ecore_x_netwm_state_get(Ecore_X_Atom a) 898_ecore_x_netwm_state_get(Ecore_X_Atom a)
@@ -922,12 +923,12 @@ _ecore_x_netwm_state_get(Ecore_X_Atom a)
922 return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION; 923 return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
923 else 924 else
924 return ECORE_X_WINDOW_STATE_UNKNOWN; 925 return ECORE_X_WINDOW_STATE_UNKNOWN;
925} /* _ecore_x_netwm_state_get */ 926}
926 927
927static Ecore_X_Atom 928static Ecore_X_Atom
928_ecore_x_netwm_state_atom_get(Ecore_X_Window_State s) 929_ecore_x_netwm_state_atom_get(Ecore_X_Window_State s)
929{ 930{
930 switch(s) 931 switch (s)
931 { 932 {
932 case ECORE_X_WINDOW_STATE_MODAL: 933 case ECORE_X_WINDOW_STATE_MODAL:
933 return ECORE_X_ATOM_NET_WM_STATE_MODAL; 934 return ECORE_X_ATOM_NET_WM_STATE_MODAL;
@@ -967,13 +968,13 @@ _ecore_x_netwm_state_atom_get(Ecore_X_Window_State s)
967 968
968 default: 969 default:
969 return 0; 970 return 0;
970 } /* switch */ 971 }
971} /* _ecore_x_netwm_state_atom_get */ 972}
972 973
973EAPI void 974EAPI void
974ecore_x_netwm_window_state_set(Ecore_X_Window win, 975ecore_x_netwm_window_state_set(Ecore_X_Window win,
975 Ecore_X_Window_State *state, 976 Ecore_X_Window_State *state,
976 unsigned int num) 977 unsigned int num)
977{ 978{
978 Ecore_X_Atom *set; 979 Ecore_X_Atom *set;
979 unsigned int i; 980 unsigned int i;
@@ -995,12 +996,12 @@ ecore_x_netwm_window_state_set(Ecore_X_Window win,
995 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num); 996 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num);
996 997
997 free(set); 998 free(set);
998} /* ecore_x_netwm_window_state_set */ 999}
999 1000
1000EAPI Eina_Bool 1001EAPI Eina_Bool
1001ecore_x_netwm_window_state_get(Ecore_X_Window win, 1002ecore_x_netwm_window_state_get(Ecore_X_Window win,
1002 Ecore_X_Window_State **state, 1003 Ecore_X_Window_State **state,
1003 unsigned int *num) 1004 unsigned int *num)
1004{ 1005{
1005 int num_ret, i; 1006 int num_ret, i;
1006 Ecore_X_Atom *atoms; 1007 Ecore_X_Atom *atoms;
@@ -1030,7 +1031,7 @@ ecore_x_netwm_window_state_get(Ecore_X_Window win,
1030 1031
1031 free(atoms); 1032 free(atoms);
1032 return EINA_TRUE; 1033 return EINA_TRUE;
1033} /* ecore_x_netwm_window_state_get */ 1034}
1034 1035
1035static Ecore_X_Window_Type 1036static Ecore_X_Window_Type
1036_ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom) 1037_ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom)
@@ -1065,7 +1066,7 @@ _ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom)
1065 return ECORE_X_WINDOW_TYPE_DND; 1066 return ECORE_X_WINDOW_TYPE_DND;
1066 else 1067 else
1067 return ECORE_X_WINDOW_TYPE_UNKNOWN; 1068 return ECORE_X_WINDOW_TYPE_UNKNOWN;
1068} /* _ecore_x_netwm_window_type_type_get */ 1069}
1069 1070
1070static Ecore_X_Atom 1071static Ecore_X_Atom
1071_ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type) 1072_ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
@@ -1116,15 +1117,15 @@ _ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
1116 1117
1117 default: 1118 default:
1118 return 0; 1119 return 0;
1119 } /* switch */ 1120 }
1120} /* _ecore_x_netwm_window_type_atom_get */ 1121}
1121 1122
1122/* 1123/*
1123 * FIXME: We should set WM_TRANSIENT_FOR if type is ECORE_X_WINDOW_TYPE_TOOLBAR 1124 * FIXME: We should set WM_TRANSIENT_FOR if type is ECORE_X_WINDOW_TYPE_TOOLBAR
1124 * , ECORE_X_WINDOW_TYPE_MENU or ECORE_X_WINDOW_TYPE_DIALOG 1125 * , ECORE_X_WINDOW_TYPE_MENU or ECORE_X_WINDOW_TYPE_DIALOG
1125 */ 1126 */
1126EAPI void 1127EAPI void
1127ecore_x_netwm_window_type_set(Ecore_X_Window win, 1128ecore_x_netwm_window_type_set(Ecore_X_Window win,
1128 Ecore_X_Window_Type type) 1129 Ecore_X_Window_Type type)
1129{ 1130{
1130 Ecore_X_Atom atom; 1131 Ecore_X_Atom atom;
@@ -1133,11 +1134,11 @@ ecore_x_netwm_window_type_set(Ecore_X_Window win,
1133 atom = _ecore_x_netwm_window_type_atom_get(type); 1134 atom = _ecore_x_netwm_window_type_atom_get(type);
1134 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE, 1135 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
1135 &atom, 1); 1136 &atom, 1);
1136} /* ecore_x_netwm_window_type_set */ 1137}
1137 1138
1138/* FIXME: Maybe return 0 on some conditions? */ 1139/* FIXME: Maybe return 0 on some conditions? */
1139EAPI Eina_Bool 1140EAPI Eina_Bool
1140ecore_x_netwm_window_type_get(Ecore_X_Window win, 1141ecore_x_netwm_window_type_get(Ecore_X_Window win,
1141 Ecore_X_Window_Type *type) 1142 Ecore_X_Window_Type *type)
1142{ 1143{
1143 int num; 1144 int num;
@@ -1158,10 +1159,10 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win,
1158 return EINA_TRUE; 1159 return EINA_TRUE;
1159 1160
1160 return EINA_FALSE; 1161 return EINA_FALSE;
1161} /* ecore_x_netwm_window_type_get */ 1162}
1162 1163
1163EAPI int 1164EAPI int
1164ecore_x_netwm_window_types_get(Ecore_X_Window win, 1165ecore_x_netwm_window_types_get(Ecore_X_Window win,
1165 Ecore_X_Window_Type **types) 1166 Ecore_X_Window_Type **types)
1166{ 1167{
1167 int num, i; 1168 int num, i;
@@ -1196,7 +1197,7 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win,
1196 free(atoms2); 1197 free(atoms2);
1197 1198
1198 return num; 1199 return num;
1199} /* ecore_x_netwm_window_types_get */ 1200}
1200 1201
1201static Ecore_X_Atom 1202static Ecore_X_Atom
1202_ecore_x_netwm_action_atom_get(Ecore_X_Action action) 1203_ecore_x_netwm_action_atom_get(Ecore_X_Action action)
@@ -1241,8 +1242,8 @@ _ecore_x_netwm_action_atom_get(Ecore_X_Action action)
1241 1242
1242 default: 1243 default:
1243 return 0; 1244 return 0;
1244 } /* switch */ 1245 }
1245} /* _ecore_x_netwm_action_atom_get */ 1246}
1246 1247
1247/* FIXME: Get complete list */ 1248/* FIXME: Get complete list */
1248EAPI Eina_Bool 1249EAPI Eina_Bool
@@ -1272,13 +1273,13 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win,
1272 1273
1273 free(atoms); 1274 free(atoms);
1274 return ret; 1275 return ret;
1275} /* ecore_x_netwm_allowed_action_isset */ 1276}
1276 1277
1277/* FIXME: Set complete list */ 1278/* FIXME: Set complete list */
1278EAPI void 1279EAPI void
1279ecore_x_netwm_allowed_action_set(Ecore_X_Window win, 1280ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
1280 Ecore_X_Action *action, 1281 Ecore_X_Action *action,
1281 unsigned int num) 1282 unsigned int num)
1282{ 1283{
1283 Ecore_X_Atom *set; 1284 Ecore_X_Atom *set;
1284 unsigned int i; 1285 unsigned int i;
@@ -1304,12 +1305,12 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
1304 num); 1305 num);
1305 1306
1306 free(set); 1307 free(set);
1307} /* ecore_x_netwm_allowed_action_set */ 1308}
1308 1309
1309EAPI Eina_Bool 1310EAPI Eina_Bool
1310ecore_x_netwm_allowed_action_get(Ecore_X_Window win, 1311ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
1311 Ecore_X_Action **action, 1312 Ecore_X_Action **action,
1312 unsigned int *num) 1313 unsigned int *num)
1313{ 1314{
1314 int num_ret, i; 1315 int num_ret, i;
1315 Ecore_X_Atom *atoms; 1316 Ecore_X_Atom *atoms;
@@ -1341,20 +1342,20 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
1341 1342
1342 free(atoms); 1343 free(atoms);
1343 return EINA_TRUE; 1344 return EINA_TRUE;
1344} /* ecore_x_netwm_allowed_action_get */ 1345}
1345 1346
1346EAPI void 1347EAPI void
1347ecore_x_netwm_opacity_set(Ecore_X_Window win, 1348ecore_x_netwm_opacity_set(Ecore_X_Window win,
1348 unsigned int opacity) 1349 unsigned int opacity)
1349{ 1350{
1350 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1351 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1351 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY, 1352 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
1352 &opacity, 1); 1353 &opacity, 1);
1353} /* ecore_x_netwm_opacity_set */ 1354}
1354 1355
1355EAPI Eina_Bool 1356EAPI Eina_Bool
1356ecore_x_netwm_opacity_get(Ecore_X_Window win, 1357ecore_x_netwm_opacity_get(Ecore_X_Window win,
1357 unsigned int *opacity) 1358 unsigned int *opacity)
1358{ 1359{
1359 int ret; 1360 int ret;
1360 unsigned int tmp; 1361 unsigned int tmp;
@@ -1366,14 +1367,14 @@ ecore_x_netwm_opacity_get(Ecore_X_Window win,
1366 *opacity = tmp; 1367 *opacity = tmp;
1367 1368
1368 return ret == 1 ? EINA_TRUE : EINA_FALSE; 1369 return ret == 1 ? EINA_TRUE : EINA_FALSE;
1369} /* ecore_x_netwm_opacity_get */ 1370}
1370 1371
1371EAPI void 1372EAPI void
1372ecore_x_netwm_frame_size_set(Ecore_X_Window win, 1373ecore_x_netwm_frame_size_set(Ecore_X_Window win,
1373 int fl, 1374 int fl,
1374 int fr, 1375 int fr,
1375 int ft, 1376 int ft,
1376 int fb) 1377 int fb)
1377{ 1378{
1378 unsigned int frames[4]; 1379 unsigned int frames[4];
1379 1380
@@ -1386,14 +1387,14 @@ ecore_x_netwm_frame_size_set(Ecore_X_Window win,
1386 ECORE_X_ATOM_NET_FRAME_EXTENTS, 1387 ECORE_X_ATOM_NET_FRAME_EXTENTS,
1387 frames, 1388 frames,
1388 4); 1389 4);
1389} /* ecore_x_netwm_frame_size_set */ 1390}
1390 1391
1391EAPI Eina_Bool 1392EAPI Eina_Bool
1392ecore_x_netwm_frame_size_get(Ecore_X_Window win, 1393ecore_x_netwm_frame_size_get(Ecore_X_Window win,
1393 int *fl, 1394 int *fl,
1394 int *fr, 1395 int *fr,
1395 int *ft, 1396 int *ft,
1396 int *fb) 1397 int *fb)
1397{ 1398{
1398 int ret = 0; 1399 int ret = 0;
1399 unsigned int frames[4]; 1400 unsigned int frames[4];
@@ -1419,10 +1420,10 @@ ecore_x_netwm_frame_size_get(Ecore_X_Window win,
1419 *fb = frames[3]; 1420 *fb = frames[3];
1420 1421
1421 return EINA_TRUE; 1422 return EINA_TRUE;
1422} /* ecore_x_netwm_frame_size_get */ 1423}
1423 1424
1424EAPI Eina_Bool 1425EAPI Eina_Bool
1425ecore_x_netwm_sync_counter_get(Ecore_X_Window win, 1426ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
1426 Ecore_X_Sync_Counter *counter) 1427 Ecore_X_Sync_Counter *counter)
1427{ 1428{
1428 int ret; 1429 int ret;
@@ -1439,7 +1440,7 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
1439 *counter = tmp; 1440 *counter = tmp;
1440 1441
1441 return ret == 1 ? EINA_TRUE : EINA_FALSE; 1442 return ret == 1 ? EINA_TRUE : EINA_FALSE;
1442} /* ecore_x_netwm_sync_counter_get */ 1443}
1443 1444
1444EAPI void 1445EAPI void
1445ecore_x_netwm_ping_send(Ecore_X_Window win) 1446ecore_x_netwm_ping_send(Ecore_X_Window win)
@@ -1462,11 +1463,11 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
1462 xev.xclient.data.l[4] = 0; 1463 xev.xclient.data.l[4] = 0;
1463 1464
1464 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1465 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1465} /* ecore_x_netwm_ping_send */ 1466}
1466 1467
1467EAPI void 1468EAPI void
1468ecore_x_netwm_sync_request_send(Ecore_X_Window win, 1469ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1469 unsigned int serial) 1470 unsigned int serial)
1470{ 1471{
1471 XSyncValue value; 1472 XSyncValue value;
1472 XEvent xev; 1473 XEvent xev;
@@ -1489,14 +1490,14 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1489 xev.xclient.data.l[4] = 0; 1490 xev.xclient.data.l[4] = 0;
1490 1491
1491 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1492 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1492} /* ecore_x_netwm_sync_request_send */ 1493}
1493 1494
1494EAPI void 1495EAPI void
1495ecore_x_netwm_state_request_send(Ecore_X_Window win, 1496ecore_x_netwm_state_request_send(Ecore_X_Window win,
1496 Ecore_X_Window root, 1497 Ecore_X_Window root,
1497 Ecore_X_Window_State s1, 1498 Ecore_X_Window_State s1,
1498 Ecore_X_Window_State s2, 1499 Ecore_X_Window_State s2,
1499 Eina_Bool set) 1500 Eina_Bool set)
1500{ 1501{
1501 XEvent xev; 1502 XEvent xev;
1502 1503
@@ -1524,12 +1525,12 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
1524 1525
1525 XSendEvent(_ecore_x_disp, root, False, 1526 XSendEvent(_ecore_x_disp, root, False,
1526 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1527 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1527} /* ecore_x_netwm_state_request_send */ 1528}
1528 1529
1529EAPI void 1530EAPI void
1530ecore_x_netwm_desktop_request_send(Ecore_X_Window win, 1531ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1531 Ecore_X_Window root, 1532 Ecore_X_Window root,
1532 unsigned int desktop) 1533 unsigned int desktop)
1533{ 1534{
1534 XEvent xev; 1535 XEvent xev;
1535 1536
@@ -1551,11 +1552,11 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1551 1552
1552 XSendEvent(_ecore_x_disp, root, False, 1553 XSendEvent(_ecore_x_disp, root, False,
1553 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1554 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1554} /* ecore_x_netwm_desktop_request_send */ 1555}
1555 1556
1556int 1557int
1557_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__, 1558_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
1558 char *data __UNUSED__) 1559 char *data __UNUSED__)
1559{ 1560{
1560#if 0 1561#if 0
1561 Ecore_X_Startup_Info *info; 1562 Ecore_X_Startup_Info *info;
@@ -1600,11 +1601,11 @@ _ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
1600 1601
1601#endif /* if 0 */ 1602#endif /* if 0 */
1602 return 1; 1603 return 1;
1603} /* _ecore_x_netwm_startup_info_begin */ 1604}
1604 1605
1605int 1606int
1606_ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__, 1607_ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
1607 char *data __UNUSED__) 1608 char *data __UNUSED__)
1608{ 1609{
1609#if 0 1610#if 0
1610 Ecore_X_Startup_Info *info; 1611 Ecore_X_Startup_Info *info;
@@ -1639,26 +1640,26 @@ _ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
1639 1640
1640#endif /* if 0 */ 1641#endif /* if 0 */
1641 return 1; 1642 return 1;
1642} /* _ecore_x_netwm_startup_info */ 1643}
1643 1644
1644/* 1645/*
1645 * Set UTF-8 string property 1646 * Set UTF-8 string property
1646 */ 1647 */
1647static void 1648static void
1648_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, 1649_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
1649 Ecore_X_Atom atom, 1650 Ecore_X_Atom atom,
1650 const char *str) 1651 const char *str)
1651{ 1652{
1652 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8, 1653 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8,
1653 PropModeReplace, (unsigned char *)str, strlen(str)); 1654 PropModeReplace, (unsigned char *)str, strlen(str));
1654} /* _ecore_x_window_prop_string_utf8_set */ 1655}
1655 1656
1656/* 1657/*
1657 * Get UTF-8 string property 1658 * Get UTF-8 string property
1658 */ 1659 */
1659static char * 1660static char *
1660_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, 1661_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
1661 Ecore_X_Atom atom) 1662 Ecore_X_Atom atom)
1662{ 1663{
1663 char *str; 1664 char *str;
1664 unsigned char *prop_ret; 1665 unsigned char *prop_ret;
@@ -1685,7 +1686,7 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
1685 XFree(prop_ret); 1686 XFree(prop_ret);
1686 1687
1687 return str; 1688 return str;
1688} /* _ecore_x_window_prop_string_utf8_get */ 1689}
1689 1690
1690#if 0 /* Unused */ 1691#if 0 /* Unused */
1691/* 1692/*
@@ -1758,19 +1759,19 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
1758 else 1759 else
1759 { 1760 {
1760 /* Discard buffer */ 1761 /* Discard buffer */
1761 info->length = 0; 1762 info->length = 0;
1762 info->buffer[0] = 0; 1763 info->buffer[0] = 0;
1763 } 1764 }
1764 1765
1765 return 1; 1766 return 1;
1766} /* _ecore_x_netwm_startup_info_process */ 1767}
1767 1768
1768/* 1769/*
1769 * Parse startup info 1770 * Parse startup info
1770 */ 1771 */
1771static int 1772static int
1772_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, 1773_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1773 char *data) 1774 char *data)
1774{ 1775{
1775 while (*data) 1776 while (*data)
1776 { 1777 {
@@ -1780,7 +1781,8 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1780 char value[1024]; 1781 char value[1024];
1781 1782
1782 /* Skip space */ 1783 /* Skip space */
1783 while (*data == ' ') data++; 1784 while (*data == ' ')
1785 data++;
1784 /* Get key */ 1786 /* Get key */
1785 key = data; 1787 key = data;
1786 data = strchr(key, '='); 1788 data = strchr(key, '=');
@@ -1920,7 +1922,7 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1920 return 0; 1922 return 0;
1921 1923
1922 return 1; 1924 return 1;
1923} /* _ecore_x_netwm_startup_info_parse */ 1925}
1924 1926
1925#endif /* if 0 */ 1927#endif /* if 0 */
1926 1928
@@ -1958,7 +1960,7 @@ _ecore_x_netwm_startup_info_free(void *data)
1958 free(info->wmclass); 1960 free(info->wmclass);
1959 1961
1960 free(info); 1962 free(info);
1961} /* _ecore_x_netwm_startup_info_free */ 1963}
1962 1964
1963/* 1965/*
1964 * Is screen composited? 1966 * Is screen composited?
@@ -1981,10 +1983,10 @@ ecore_x_screen_is_composited(int screen)
1981 win = XGetSelectionOwner(_ecore_x_disp, atom); 1983 win = XGetSelectionOwner(_ecore_x_disp, atom);
1982 1984
1983 return (win != None) ? EINA_TRUE : EINA_FALSE; 1985 return (win != None) ? EINA_TRUE : EINA_FALSE;
1984} /* ecore_x_screen_is_composited */ 1986}
1985 1987
1986EAPI void 1988EAPI void
1987ecore_x_screen_is_composited_set(int screen, 1989ecore_x_screen_is_composited_set(int screen,
1988 Ecore_X_Window win) 1990 Ecore_X_Window win)
1989{ 1991{
1990 static Ecore_X_Atom atom = None; 1992 static Ecore_X_Atom atom = None;
@@ -1999,5 +2001,5 @@ ecore_x_screen_is_composited_set(int screen,
1999 return; 2001 return;
2000 2002
2001 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time); 2003 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
2002} /* ecore_x_screen_is_composited_set */ 2004}
2003 2005
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
index b81d06c..7b13615 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
@@ -26,9 +26,9 @@
26 */ 26 */
27EAPI Ecore_X_Pixmap 27EAPI Ecore_X_Pixmap
28ecore_x_pixmap_new(Ecore_X_Window win, 28ecore_x_pixmap_new(Ecore_X_Window win,
29 int w, 29 int w,
30 int h, 30 int h,
31 int dep) 31 int dep)
32{ 32{
33 LOGFN(__FILE__, __LINE__, __FUNCTION__); 33 LOGFN(__FILE__, __LINE__, __FUNCTION__);
34 if (win == 0) 34 if (win == 0)
@@ -38,7 +38,7 @@ ecore_x_pixmap_new(Ecore_X_Window win,
38 dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp)); 38 dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
39 39
40 return XCreatePixmap(_ecore_x_disp, win, w, h, dep); 40 return XCreatePixmap(_ecore_x_disp, win, w, h, dep);
41} /* ecore_x_pixmap_new */ 41}
42 42
43/** 43/**
44 * Deletes the reference to the given pixmap. 44 * Deletes the reference to the given pixmap.
@@ -54,7 +54,7 @@ ecore_x_pixmap_free(Ecore_X_Pixmap pmap)
54{ 54{
55 LOGFN(__FILE__, __LINE__, __FUNCTION__); 55 LOGFN(__FILE__, __LINE__, __FUNCTION__);
56 XFreePixmap(_ecore_x_disp, pmap); 56 XFreePixmap(_ecore_x_disp, pmap);
57} /* ecore_x_pixmap_free */ 57}
58 58
59/** 59/**
60 * Pastes a rectangular area of the given pixmap onto the given drawable. 60 * Pastes a rectangular area of the given pixmap onto the given drawable.
@@ -71,19 +71,19 @@ ecore_x_pixmap_free(Ecore_X_Pixmap pmap)
71 * @ingroup Ecore_X_Pixmap_Group 71 * @ingroup Ecore_X_Pixmap_Group
72 */ 72 */
73EAPI void 73EAPI void
74ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, 74ecore_x_pixmap_paste(Ecore_X_Pixmap pmap,
75 Ecore_X_Drawable dest, 75 Ecore_X_Drawable dest,
76 Ecore_X_GC gc, 76 Ecore_X_GC gc,
77 int sx, 77 int sx,
78 int sy, 78 int sy,
79 int w, 79 int w,
80 int h, 80 int h,
81 int dx, 81 int dx,
82 int dy) 82 int dy)
83{ 83{
84 LOGFN(__FILE__, __LINE__, __FUNCTION__); 84 LOGFN(__FILE__, __LINE__, __FUNCTION__);
85 XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy); 85 XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy);
86} /* ecore_x_pixmap_paste */ 86}
87 87
88/** 88/**
89 * Retrieves the size of the given pixmap. 89 * Retrieves the size of the given pixmap.
@@ -96,15 +96,15 @@ ecore_x_pixmap_paste(Ecore_X_Pixmap pmap,
96 */ 96 */
97EAPI void 97EAPI void
98ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap, 98ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap,
99 int *x, 99 int *x,
100 int *y, 100 int *y,
101 int *w, 101 int *w,
102 int *h) 102 int *h)
103{ 103{
104 LOGFN(__FILE__, __LINE__, __FUNCTION__); 104 LOGFN(__FILE__, __LINE__, __FUNCTION__);
105 if (pmap) 105 if (pmap)
106 ecore_x_drawable_geometry_get(pmap, x, y, w, h); 106 ecore_x_drawable_geometry_get(pmap, x, y, w, h);
107} /* ecore_x_pixmap_geometry_get */ 107}
108 108
109/** 109/**
110 * Retrieves the depth of the given pixmap. 110 * Retrieves the depth of the given pixmap.
@@ -117,5 +117,5 @@ ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap)
117{ 117{
118 LOGFN(__FILE__, __LINE__, __FUNCTION__); 118 LOGFN(__FILE__, __LINE__, __FUNCTION__);
119 return ecore_x_drawable_depth_get(pmap); 119 return ecore_x_drawable_depth_get(pmap);
120} /* ecore_x_pixmap_depth_get */ 120}
121 121
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
index a6bafb6..816f8d5 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
@@ -8,6 +8,10 @@
8 8
9#include "ecore_x_private.h" 9#include "ecore_x_private.h"
10#include "ecore_x_randr.h" 10#include "ecore_x_randr.h"
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <string.h>
11 15
12#define Ecore_X_Randr_None 0 16#define Ecore_X_Randr_None 0
13#ifdef ECORE_XRANDR 17#ifdef ECORE_XRANDR
@@ -18,7 +22,8 @@
18 root) ((screen = \ 22 root) ((screen = \
19 XRRRootToScreen(_ecore_x_disp, \ 23 XRRRootToScreen(_ecore_x_disp, \
20 root)) != -1) 24 root)) != -1)
21#define RANDR_CHECK_1_1_RET(ret) if(_randr_version < RANDR_1_1) return ret 25#define RANDR_CHECK_1_1_RET(ret) if (_randr_version < RANDR_1_1) \
26 return ret
22 27
23extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display * 28extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
24 dpy, 29 dpy,
@@ -44,7 +49,7 @@ ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root)
44#else /* ifdef ECORE_XRANDR */ 49#else /* ifdef ECORE_XRANDR */
45 return Ecore_X_Randr_None; 50 return Ecore_X_Randr_None;
46#endif /* ifdef ECORE_XRANDR */ 51#endif /* ifdef ECORE_XRANDR */
47} /* ecore_x_randr_screen_primary_output_orientations_get */ 52}
48 53
49/* 54/*
50 * @param root window which's primary output will be queried 55 * @param root window which's primary output will be queried
@@ -61,7 +66,7 @@ ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root)
61#else /* ifdef ECORE_XRANDR */ 66#else /* ifdef ECORE_XRANDR */
62 return Ecore_X_Randr_None; 67 return Ecore_X_Randr_None;
63#endif /* ifdef ECORE_XRANDR */ 68#endif /* ifdef ECORE_XRANDR */
64} /* ecore_x_randr_screen_primary_output_orientation_get */ 69}
65 70
66/* 71/*
67 * @brief sets a given screen's primary output's orientation 72 * @brief sets a given screen's primary output's orientation
@@ -95,7 +100,7 @@ ecore_x_randr_screen_primary_output_orientation_set(
95#else /* ifdef ECORE_XRANDR */ 100#else /* ifdef ECORE_XRANDR */
96 return EINA_FALSE; 101 return EINA_FALSE;
97#endif /* ifdef ECORE_XRANDR */ 102#endif /* ifdef ECORE_XRANDR */
98} /* ecore_x_randr_screen_primary_output_orientation_set */ 103}
99 104
100/* 105/*
101 * @brief gets a screen's primary output's possible sizes 106 * @brief gets a screen's primary output's possible sizes
@@ -105,7 +110,7 @@ ecore_x_randr_screen_primary_output_orientation_set(
105 */ 110 */
106EAPI Ecore_X_Randr_Screen_Size_MM * 111EAPI Ecore_X_Randr_Screen_Size_MM *
107ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root, 112ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
108 int *num) 113 int *num)
109{ 114{
110#ifdef ECORE_XRANDR 115#ifdef ECORE_XRANDR
111 Ecore_X_Randr_Screen_Size_MM *ret = NULL; 116 Ecore_X_Randr_Screen_Size_MM *ret = NULL;
@@ -135,7 +140,7 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
135#else /* ifdef ECORE_XRANDR */ 140#else /* ifdef ECORE_XRANDR */
136 return NULL; 141 return NULL;
137#endif /* ifdef ECORE_XRANDR */ 142#endif /* ifdef ECORE_XRANDR */
138} /* ecore_x_randr_screen_primary_output_sizes_get */ 143}
139 144
140/* 145/*
141 * @brief get the current set size of a given screen's primary output 146 * @brief get the current set size of a given screen's primary output
@@ -148,11 +153,11 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
148 */ 153 */
149EAPI void 154EAPI void
150ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root, 155ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
151 int *w, 156 int *w,
152 int *h, 157 int *h,
153 int *w_mm, 158 int *w_mm,
154 int *h_mm, 159 int *h_mm,
155 int *size_index) 160 int *size_index)
156{ 161{
157#ifdef ECORE_XRANDR 162#ifdef ECORE_XRANDR
158 XRRScreenSize *sizes; 163 XRRScreenSize *sizes;
@@ -192,7 +197,7 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
192 197
193 XRRFreeScreenConfigInfo(sc); 198 XRRFreeScreenConfigInfo(sc);
194#endif /* ifdef ECORE_XRANDR */ 199#endif /* ifdef ECORE_XRANDR */
195} /* ecore_x_randr_screen_primary_output_current_size_get */ 200}
196 201
197/* 202/*
198 * @brief sets a given screen's primary output size, but disables all other outputs at the same time 203 * @brief sets a given screen's primary output size, but disables all other outputs at the same time
@@ -202,18 +207,16 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
202 */ 207 */
203EAPI Eina_Bool 208EAPI Eina_Bool
204ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root, 209ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
205 int size_index) 210 int size_index)
206{ 211{
207#ifdef ECORE_XRANDR 212#ifdef ECORE_XRANDR
208 XRRScreenConfiguration *sc = NULL; 213 XRRScreenConfiguration *sc = NULL;
209 XRRScreenSize *sizes;
210 Eina_Bool ret = EINA_FALSE; 214 Eina_Bool ret = EINA_FALSE;
211 int nsizes = 0; 215 int nsizes = 0;
212 216
213 if (size_index >= 0 && _ecore_x_randr_root_validate(root)) 217 if (size_index >= 0 && _ecore_x_randr_root_validate(root))
214 { 218 {
215 sizes = 219 XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
216 XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
217 root), &nsizes); 220 root), &nsizes);
218 221
219 if (size_index < nsizes) 222 if (size_index < nsizes)
@@ -235,7 +238,7 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
235#else /* ifdef ECORE_XRANDR */ 238#else /* ifdef ECORE_XRANDR */
236 return EINA_FALSE; 239 return EINA_FALSE;
237#endif /* ifdef ECORE_XRANDR */ 240#endif /* ifdef ECORE_XRANDR */
238} /* ecore_x_randr_screen_primary_output_size_set */ 241}
239 242
240/* 243/*
241 * @param root window which's primary output will be queried 244 * @param root window which's primary output will be queried
@@ -261,7 +264,7 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(
261#else /* ifdef ECORE_XRANDR */ 264#else /* ifdef ECORE_XRANDR */
262 return 0.0; 265 return 0.0;
263#endif /* ifdef ECORE_XRANDR */ 266#endif /* ifdef ECORE_XRANDR */
264} /* ecore_x_randr_screen_primary_output_current_refresh_rate_get */ 267}
265 268
266/* 269/*
267 * @param root window which's primary output will be queried 270 * @param root window which's primary output will be queried
@@ -270,8 +273,8 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(
270 */ 273 */
271EAPI Ecore_X_Randr_Refresh_Rate * 274EAPI Ecore_X_Randr_Refresh_Rate *
272ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root, 275ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
273 int size_index, 276 int size_index,
274 int *num) 277 int *num)
275{ 278{
276#ifdef ECORE_XRANDR 279#ifdef ECORE_XRANDR
277 Ecore_X_Randr_Refresh_Rate *ret = NULL, *rates = NULL; 280 Ecore_X_Randr_Refresh_Rate *ret = NULL, *rates = NULL;
@@ -293,7 +296,7 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
293#else /* ifdef ECORE_XRANDR */ 296#else /* ifdef ECORE_XRANDR */
294 return NULL; 297 return NULL;
295#endif /* ifdef ECORE_XRANDR */ 298#endif /* ifdef ECORE_XRANDR */
296} /* ecore_x_randr_screen_primary_output_refresh_rates_get */ 299}
297 300
298//>= 1.1 301//>= 1.1
299/* 302/*
@@ -306,7 +309,7 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
306EAPI Eina_Bool 309EAPI Eina_Bool
307ecore_x_randr_screen_primary_output_refresh_rate_set( 310ecore_x_randr_screen_primary_output_refresh_rate_set(
308 Ecore_X_Window root, 311 Ecore_X_Window root,
309 int size_index, 312 int size_index,
310 Ecore_X_Randr_Refresh_Rate 313 Ecore_X_Randr_Refresh_Rate
311 rate) 314 rate)
312{ 315{
@@ -328,5 +331,5 @@ ecore_x_randr_screen_primary_output_refresh_rate_set(
328#else /* ifdef ECORE_XRANDR */ 331#else /* ifdef ECORE_XRANDR */
329 return EINA_FALSE; 332 return EINA_FALSE;
330#endif /* ifdef ECORE_XRANDR */ 333#endif /* ifdef ECORE_XRANDR */
331} /* ecore_x_randr_screen_primary_output_refresh_rate_set */ 334}
332 335
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
index fb607d1..38218a5 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
@@ -8,6 +8,10 @@
8 8
9#include "ecore_x_private.h" 9#include "ecore_x_private.h"
10#include "ecore_x_randr.h" 10#include "ecore_x_randr.h"
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <string.h>
11 15
12#define Ecore_X_Randr_None (Ecore_X_Randr_Crtc)0 16#define Ecore_X_Randr_None (Ecore_X_Randr_Crtc)0
13#define Ecore_X_Randr_Unset (Ecore_X_Randr_Crtc) - 1 17#define Ecore_X_Randr_Unset (Ecore_X_Randr_Crtc) - 1
@@ -19,7 +23,8 @@
19#define RANDR_VALIDATE_ROOT(screen, root) \ 23#define RANDR_VALIDATE_ROOT(screen, root) \
20 ((screen = XRRRootToScreen(_ecore_x_disp, root)) != -1) 24 ((screen = XRRRootToScreen(_ecore_x_disp, root)) != -1)
21 25
22#define RANDR_CHECK_1_2_RET(ret) if(_randr_version < RANDR_1_2) return ret 26#define RANDR_CHECK_1_2_RET(ret) if (_randr_version < RANDR_1_2) \
27 return ret
23 28
24#define RANDR_PROPERTY_EDID "EDID" 29#define RANDR_PROPERTY_EDID "EDID"
25#define RANDR_PROPERTY_BACKLIGHT "Backlight" 30#define RANDR_PROPERTY_BACKLIGHT "Backlight"
@@ -45,7 +50,7 @@ extern int _randr_version;
45 */ 50 */
46EAPI void 51EAPI void
47ecore_x_randr_events_select(Ecore_X_Window win, 52ecore_x_randr_events_select(Ecore_X_Window win,
48 Eina_Bool on) 53 Eina_Bool on)
49{ 54{
50#ifdef ECORE_XRANDR 55#ifdef ECORE_XRANDR
51 int mask; 56 int mask;
@@ -73,7 +78,7 @@ ecore_x_randr_events_select(Ecore_X_Window win,
73 * @return in case it is found EINA_TRUE will be returned. Else EINA_FALSE is returned. 78 * @return in case it is found EINA_TRUE will be returned. Else EINA_FALSE is returned.
74 */ 79 */
75static inline Eina_Bool 80static inline Eina_Bool
76_ecore_x_randr_crtc_validate(Ecore_X_Window root, 81_ecore_x_randr_crtc_validate(Ecore_X_Window root,
77 Ecore_X_Randr_Crtc crtc) 82 Ecore_X_Randr_Crtc crtc)
78{ 83{
79#ifdef ECORE_XRANDR 84#ifdef ECORE_XRANDR
@@ -108,7 +113,7 @@ _ecore_x_randr_crtc_validate(Ecore_X_Window root,
108} 113}
109 114
110Eina_Bool 115Eina_Bool
111_ecore_x_randr_output_validate(Ecore_X_Window root, 116_ecore_x_randr_output_validate(Ecore_X_Window root,
112 Ecore_X_Randr_Output output) 117 Ecore_X_Randr_Output output)
113{ 118{
114#ifdef ECORE_XRANDR 119#ifdef ECORE_XRANDR
@@ -139,7 +144,7 @@ _ecore_x_randr_output_validate(Ecore_X_Window root,
139} 144}
140 145
141static inline Eina_Bool 146static inline Eina_Bool
142_ecore_x_randr_mode_validate(Ecore_X_Window root, 147_ecore_x_randr_mode_validate(Ecore_X_Window root,
143 Ecore_X_Randr_Mode mode) 148 Ecore_X_Randr_Mode mode)
144{ 149{
145#ifdef ECORE_XRANDR 150#ifdef ECORE_XRANDR
@@ -175,10 +180,10 @@ _ecore_x_randr_mode_validate(Ecore_X_Window root,
175 */ 180 */
176EAPI void 181EAPI void
177ecore_x_randr_screen_current_size_get(Ecore_X_Window root, 182ecore_x_randr_screen_current_size_get(Ecore_X_Window root,
178 int *w, 183 int *w,
179 int *h, 184 int *h,
180 int *w_mm, 185 int *w_mm,
181 int *h_mm) 186 int *h_mm)
182{ 187{
183#ifdef ECORE_XRANDR 188#ifdef ECORE_XRANDR
184 RANDR_CHECK_1_2_RET(); 189 RANDR_CHECK_1_2_RET();
@@ -211,10 +216,10 @@ ecore_x_randr_screen_current_size_get(Ecore_X_Window root,
211 */ 216 */
212EAPI void 217EAPI void
213ecore_x_randr_screen_size_range_get(Ecore_X_Window root, 218ecore_x_randr_screen_size_range_get(Ecore_X_Window root,
214 int *wmin, 219 int *wmin,
215 int *hmin, 220 int *hmin,
216 int *wmax, 221 int *wmax,
217 int *hmax) 222 int *hmax)
218{ 223{
219#ifdef ECORE_XRANDR 224#ifdef ECORE_XRANDR
220 RANDR_CHECK_1_2_RET(); 225 RANDR_CHECK_1_2_RET();
@@ -249,10 +254,10 @@ ecore_x_randr_screen_size_range_get(Ecore_X_Window root,
249 */ 254 */
250EAPI Eina_Bool 255EAPI Eina_Bool
251ecore_x_randr_screen_current_size_set(Ecore_X_Window root, 256ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
252 int w, 257 int w,
253 int h, 258 int h,
254 int w_mm, 259 int w_mm,
255 int h_mm) 260 int h_mm)
256{ 261{
257#ifdef ECORE_XRANDR 262#ifdef ECORE_XRANDR
258 RANDR_CHECK_1_2_RET(EINA_FALSE); 263 RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -281,14 +286,14 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
281 if (h <= 0) 286 if (h <= 0)
282 h = DisplayHeight(_ecore_x_disp, scr); 287 h = DisplayHeight(_ecore_x_disp, scr);
283 288
284 if(w_mm <= 0) 289 if (w_mm <= 0)
285 w_mm = 290 w_mm =
286 (int)(((double)(DisplayWidthMM(_ecore_x_disp, 291 (int)(((double)(DisplayWidthMM(_ecore_x_disp,
287 scr) / 292 scr) /
288 (double)DisplayWidth(_ecore_x_disp, 293 (double)DisplayWidth(_ecore_x_disp,
289 scr))) * (double)w); 294 scr))) * (double)w);
290 295
291 if(h_mm <= 0) 296 if (h_mm <= 0)
292 h_mm = 297 h_mm =
293 (int)(((double)(DisplayHeightMM(_ecore_x_disp, 298 (int)(((double)(DisplayHeightMM(_ecore_x_disp,
294 scr) / 299 scr) /
@@ -310,7 +315,7 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
310 */ 315 */
311EAPI Ecore_X_Randr_Mode_Info ** 316EAPI Ecore_X_Randr_Mode_Info **
312ecore_x_randr_modes_info_get(Ecore_X_Window root, 317ecore_x_randr_modes_info_get(Ecore_X_Window root,
313 int *num) 318 int *num)
314{ 319{
315#ifdef ECORE_XRANDR 320#ifdef ECORE_XRANDR
316 RANDR_CHECK_1_2_RET(NULL); 321 RANDR_CHECK_1_2_RET(NULL);
@@ -353,7 +358,7 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root,
353 } 358 }
354 else 359 else
355 { 360 {
356 while(i > 0) 361 while (i > 0)
357 free(ret[--i]); 362 free(ret[--i]);
358 free(ret); 363 free(ret);
359 ret = NULL; 364 ret = NULL;
@@ -381,7 +386,7 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root,
381 * @return mode's detailed information 386 * @return mode's detailed information
382 */ 387 */
383EAPI Ecore_X_Randr_Mode_Info * 388EAPI Ecore_X_Randr_Mode_Info *
384ecore_x_randr_mode_info_get(Ecore_X_Window root, 389ecore_x_randr_mode_info_get(Ecore_X_Window root,
385 Ecore_X_Randr_Mode mode) 390 Ecore_X_Randr_Mode mode)
386{ 391{
387#ifdef ECORE_XRANDR 392#ifdef ECORE_XRANDR
@@ -461,7 +466,7 @@ ecore_x_randr_mode_info_free(Ecore_X_Randr_Mode_Info *mode_info)
461 */ 466 */
462EAPI Ecore_X_Randr_Crtc * 467EAPI Ecore_X_Randr_Crtc *
463ecore_x_randr_crtcs_get(Ecore_X_Window root, 468ecore_x_randr_crtcs_get(Ecore_X_Window root,
464 int *num) 469 int *num)
465{ 470{
466#ifdef ECORE_XRANDR 471#ifdef ECORE_XRANDR
467 RANDR_CHECK_1_2_RET(NULL); 472 RANDR_CHECK_1_2_RET(NULL);
@@ -488,7 +493,7 @@ ecore_x_randr_crtcs_get(Ecore_X_Window root,
488 493
489EAPI Ecore_X_Randr_Output * 494EAPI Ecore_X_Randr_Output *
490ecore_x_randr_outputs_get(Ecore_X_Window root, 495ecore_x_randr_outputs_get(Ecore_X_Window root,
491 int *num) 496 int *num)
492{ 497{
493#ifdef ECORE_XRANDR 498#ifdef ECORE_XRANDR
494 RANDR_CHECK_1_2_RET(NULL); 499 RANDR_CHECK_1_2_RET(NULL);
@@ -523,9 +528,9 @@ ecore_x_randr_outputs_get(Ecore_X_Window root,
523 * @param num number of outputs referenced by given CRTC 528 * @param num number of outputs referenced by given CRTC
524 */ 529 */
525EAPI Ecore_X_Randr_Output * 530EAPI Ecore_X_Randr_Output *
526ecore_x_randr_crtc_outputs_get(Ecore_X_Window root, 531ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
527 Ecore_X_Randr_Crtc crtc, 532 Ecore_X_Randr_Crtc crtc,
528 int *num) 533 int *num)
529{ 534{
530#ifdef ECORE_XRANDR 535#ifdef ECORE_XRANDR
531 RANDR_CHECK_1_2_RET(NULL); 536 RANDR_CHECK_1_2_RET(NULL);
@@ -567,9 +572,9 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
567 * @param num number of possible outputs referenced by given CRTC 572 * @param num number of possible outputs referenced by given CRTC
568 */ 573 */
569EAPI Ecore_X_Randr_Output * 574EAPI Ecore_X_Randr_Output *
570ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root, 575ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
571 Ecore_X_Randr_Crtc crtc, 576 Ecore_X_Randr_Crtc crtc,
572 int *num) 577 int *num)
573{ 578{
574#ifdef ECORE_XRANDR 579#ifdef ECORE_XRANDR
575 RANDR_CHECK_1_2_RET(NULL); 580 RANDR_CHECK_1_2_RET(NULL);
@@ -581,7 +586,7 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
581 crtc) && 586 crtc) &&
582 (res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root))) 587 (res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
583 { 588 {
584 if((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc))) 589 if ((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
585 { 590 {
586 if ((ret = 591 if ((ret =
587 malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible))) 592 malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
@@ -605,12 +610,12 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
605} 610}
606 611
607EAPI void 612EAPI void
608ecore_x_randr_crtc_geometry_get(Ecore_X_Window root, 613ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
609 Ecore_X_Randr_Crtc crtc, 614 Ecore_X_Randr_Crtc crtc,
610 int *x, 615 int *x,
611 int *y, 616 int *y,
612 int *w, 617 int *w,
613 int *h) 618 int *h)
614{ 619{
615#ifdef ECORE_XRANDR 620#ifdef ECORE_XRANDR
616 RANDR_CHECK_1_2_RET(); 621 RANDR_CHECK_1_2_RET();
@@ -652,10 +657,10 @@ ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
652 * @return EINA_TRUE if position could be successfully be altered. 657 * @return EINA_TRUE if position could be successfully be altered.
653 */ 658 */
654EAPI Eina_Bool 659EAPI Eina_Bool
655ecore_x_randr_crtc_pos_set(Ecore_X_Window root, 660ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
656 Ecore_X_Randr_Crtc crtc, 661 Ecore_X_Randr_Crtc crtc,
657 int x, 662 int x,
658 int y) 663 int y)
659{ 664{
660#ifdef ECORE_XRANDR 665#ifdef ECORE_XRANDR
661 RANDR_CHECK_1_2_RET(EINA_FALSE); 666 RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -706,7 +711,7 @@ ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
706 * Ecore_X_Randr_Unset 711 * Ecore_X_Randr_Unset
707 */ 712 */
708EAPI Ecore_X_Randr_Mode 713EAPI Ecore_X_Randr_Mode
709ecore_x_randr_crtc_mode_get(Ecore_X_Window root, 714ecore_x_randr_crtc_mode_get(Ecore_X_Window root,
710 Ecore_X_Randr_Crtc crtc) 715 Ecore_X_Randr_Crtc crtc)
711{ 716{
712#ifdef ECORE_XRANDR 717#ifdef ECORE_XRANDR
@@ -746,11 +751,11 @@ ecore_x_randr_crtc_mode_get(Ecore_X_Window root,
746 * @return EINA_TRUE if mode setting was successful. Else EINA_FALSE 751 * @return EINA_TRUE if mode setting was successful. Else EINA_FALSE
747 */ 752 */
748EAPI Eina_Bool 753EAPI Eina_Bool
749ecore_x_randr_crtc_mode_set(Ecore_X_Window root, 754ecore_x_randr_crtc_mode_set(Ecore_X_Window root,
750 Ecore_X_Randr_Crtc crtc, 755 Ecore_X_Randr_Crtc crtc,
751 Ecore_X_Randr_Output *outputs, 756 Ecore_X_Randr_Output *outputs,
752 int noutputs, 757 int noutputs,
753 Ecore_X_Randr_Mode mode) 758 Ecore_X_Randr_Mode mode)
754{ 759{
755#ifdef ECORE_XRANDR 760#ifdef ECORE_XRANDR
756 RANDR_CHECK_1_2_RET(EINA_FALSE); 761 RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -772,10 +777,10 @@ ecore_x_randr_crtc_mode_set(Ecore_X_Window root,
772} 777}
773 778
774EAPI void 779EAPI void
775ecore_x_randr_crtc_size_get(Ecore_X_Window root, 780ecore_x_randr_crtc_size_get(Ecore_X_Window root,
776 Ecore_X_Randr_Crtc crtc, 781 Ecore_X_Randr_Crtc crtc,
777 int *w, 782 int *w,
778 int *h) 783 int *h)
779{ 784{
780#ifdef ECORE_XRANDR 785#ifdef ECORE_XRANDR
781 RANDR_CHECK_1_2_RET(); 786 RANDR_CHECK_1_2_RET();
@@ -784,7 +789,7 @@ ecore_x_randr_crtc_size_get(Ecore_X_Window root,
784} 789}
785 790
786EAPI Ecore_X_Randr_Refresh_Rate 791EAPI Ecore_X_Randr_Refresh_Rate
787ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root, 792ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
788 Ecore_X_Randr_Crtc crtc, 793 Ecore_X_Randr_Crtc crtc,
789 Ecore_X_Randr_Mode mode) 794 Ecore_X_Randr_Mode mode)
790{ 795{
@@ -824,7 +829,7 @@ ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
824} 829}
825 830
826EAPI Ecore_X_Randr_Orientation 831EAPI Ecore_X_Randr_Orientation
827ecore_x_randr_crtc_orientations_get(Ecore_X_Window root, 832ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
828 Ecore_X_Randr_Crtc crtc) 833 Ecore_X_Randr_Crtc crtc)
829{ 834{
830#ifdef ECORE_XRANDR 835#ifdef ECORE_XRANDR
@@ -855,7 +860,7 @@ ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
855} 860}
856 861
857EAPI Ecore_X_Randr_Orientation 862EAPI Ecore_X_Randr_Orientation
858ecore_x_randr_crtc_orientation_get(Ecore_X_Window root, 863ecore_x_randr_crtc_orientation_get(Ecore_X_Window root,
859 Ecore_X_Randr_Crtc crtc) 864 Ecore_X_Randr_Crtc crtc)
860{ 865{
861#ifdef ECORE_XRANDR 866#ifdef ECORE_XRANDR
@@ -886,8 +891,8 @@ ecore_x_randr_crtc_orientation_get(Ecore_X_Window root,
886} 891}
887 892
888EAPI Eina_Bool 893EAPI Eina_Bool
889ecore_x_randr_crtc_orientation_set(Ecore_X_Window root, 894ecore_x_randr_crtc_orientation_set(Ecore_X_Window root,
890 Ecore_X_Randr_Crtc crtc, 895 Ecore_X_Randr_Crtc crtc,
891 Ecore_X_Randr_Orientation orientation) 896 Ecore_X_Randr_Orientation orientation)
892{ 897{
893#ifdef ECORE_XRANDR 898#ifdef ECORE_XRANDR
@@ -913,10 +918,10 @@ ecore_x_randr_crtc_orientation_set(Ecore_X_Window root,
913} 918}
914 919
915EAPI void 920EAPI void
916ecore_x_randr_crtc_pos_get(Ecore_X_Window root, 921ecore_x_randr_crtc_pos_get(Ecore_X_Window root,
917 Ecore_X_Randr_Crtc crtc, 922 Ecore_X_Randr_Crtc crtc,
918 int *x, 923 int *x,
919 int *y) 924 int *y)
920{ 925{
921#ifdef ECORE_XRANDR 926#ifdef ECORE_XRANDR
922 RANDR_CHECK_1_2_RET(); 927 RANDR_CHECK_1_2_RET();
@@ -926,7 +931,7 @@ ecore_x_randr_crtc_pos_get(Ecore_X_Window root,
926} 931}
927 932
928EAPI Eina_Bool 933EAPI Eina_Bool
929ecore_x_randr_crtc_clone_set(Ecore_X_Window root, 934ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
930 Ecore_X_Randr_Crtc original, 935 Ecore_X_Randr_Crtc original,
931 Ecore_X_Randr_Crtc clon) 936 Ecore_X_Randr_Crtc clon)
932{ 937{
@@ -993,13 +998,13 @@ ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
993 * EINA_FALSE 998 * EINA_FALSE
994 */ 999 */
995EAPI Eina_Bool 1000EAPI Eina_Bool
996ecore_x_randr_crtc_settings_set(Ecore_X_Window root, 1001ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
997 Ecore_X_Randr_Crtc crtc, 1002 Ecore_X_Randr_Crtc crtc,
998 Ecore_X_Randr_Output *outputs, 1003 Ecore_X_Randr_Output *outputs,
999 int noutputs, 1004 int noutputs,
1000 int x, 1005 int x,
1001 int y, 1006 int y,
1002 Ecore_X_Randr_Mode mode, 1007 Ecore_X_Randr_Mode mode,
1003 Ecore_X_Randr_Orientation orientation) 1008 Ecore_X_Randr_Orientation orientation)
1004{ 1009{
1005#ifdef ECORE_XRANDR 1010#ifdef ECORE_XRANDR
@@ -1059,17 +1064,17 @@ ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
1059 * @brief sets a CRTC relative to another one. 1064 * @brief sets a CRTC relative to another one.
1060 * @param crtc_r1 the CRTC to be positioned. 1065 * @param crtc_r1 the CRTC to be positioned.
1061 * @param crtc_r2 the CRTC the position should be relative to 1066 * @param crtc_r2 the CRTC the position should be relative to
1062 * @param position the relation between the crtcs 1067 * @param policy the relation between the crtcs
1063 * @param alignment in case CRTCs size differ, aligns CRTC1 accordingly at CRTC2's 1068 * @param alignment in case CRTCs size differ, aligns CRTC1 accordingly at CRTC2's
1064 * borders 1069 * borders
1065 * @return EINA_TRUE if crtc could be successfully positioned. EINA_FALSE if 1070 * @return EINA_TRUE if crtc could be successfully positioned. EINA_FALSE if
1066 * repositioning failed or if position of new crtc would be out of given screen's min/max bounds. 1071 * repositioning failed or if position of new crtc would be out of given screen's min/max bounds.
1067 */ 1072 */
1068EAPI Eina_Bool 1073EAPI Eina_Bool
1069ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root, 1074ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
1070 Ecore_X_Randr_Crtc crtc_r1, 1075 Ecore_X_Randr_Crtc crtc_r1,
1071 Ecore_X_Randr_Crtc crtc_r2, 1076 Ecore_X_Randr_Crtc crtc_r2,
1072 Ecore_X_Randr_Output_Policy policy, 1077 Ecore_X_Randr_Output_Policy policy,
1073 Ecore_X_Randr_Relative_Alignment alignment) 1078 Ecore_X_Randr_Relative_Alignment alignment)
1074{ 1079{
1075#ifdef ECORE_XRANDR 1080#ifdef ECORE_XRANDR
@@ -1360,10 +1365,10 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
1360} 1365}
1361 1366
1362EAPI Ecore_X_Randr_Mode * 1367EAPI Ecore_X_Randr_Mode *
1363ecore_x_randr_output_modes_get(Ecore_X_Window root, 1368ecore_x_randr_output_modes_get(Ecore_X_Window root,
1364 Ecore_X_Randr_Output output, 1369 Ecore_X_Randr_Output output,
1365 int *num, 1370 int *num,
1366 int *npreferred) 1371 int *npreferred)
1367{ 1372{
1368#ifdef ECORE_XRANDR 1373#ifdef ECORE_XRANDR
1369 RANDR_CHECK_1_2_RET(NULL); 1374 RANDR_CHECK_1_2_RET(NULL);
@@ -1401,9 +1406,9 @@ ecore_x_randr_output_modes_get(Ecore_X_Window root,
1401} 1406}
1402 1407
1403EAPI Ecore_X_Randr_Crtc * 1408EAPI Ecore_X_Randr_Crtc *
1404ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root, 1409ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root,
1405 Ecore_X_Randr_Output output, 1410 Ecore_X_Randr_Output output,
1406 int *num) 1411 int *num)
1407{ 1412{
1408#ifdef ECORE_XRANDR 1413#ifdef ECORE_XRANDR
1409 RANDR_CHECK_1_2_RET(NULL); 1414 RANDR_CHECK_1_2_RET(NULL);
@@ -1441,9 +1446,9 @@ ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root,
1441 * @param num number of possible clones 1446 * @param num number of possible clones
1442 */ 1447 */
1443EAPI Ecore_X_Randr_Output * 1448EAPI Ecore_X_Randr_Output *
1444ecore_x_randr_output_clones_get(Ecore_X_Window root, 1449ecore_x_randr_output_clones_get(Ecore_X_Window root,
1445 Ecore_X_Randr_Output output, 1450 Ecore_X_Randr_Output output,
1446 int *num) 1451 int *num)
1447{ 1452{
1448#ifdef ECORE_XRANDR 1453#ifdef ECORE_XRANDR
1449 RANDR_CHECK_1_2_RET(NULL); 1454 RANDR_CHECK_1_2_RET(NULL);
@@ -1474,7 +1479,7 @@ ecore_x_randr_output_clones_get(Ecore_X_Window root,
1474} 1479}
1475 1480
1476EAPI Ecore_X_Randr_Crtc 1481EAPI Ecore_X_Randr_Crtc
1477ecore_x_randr_output_crtc_get(Ecore_X_Window root, 1482ecore_x_randr_output_crtc_get(Ecore_X_Window root,
1478 Ecore_X_Randr_Output output) 1483 Ecore_X_Randr_Output output)
1479{ 1484{
1480#ifdef ECORE_XRANDR 1485#ifdef ECORE_XRANDR
@@ -1509,9 +1514,9 @@ ecore_x_randr_output_crtc_get(Ecore_X_Window root,
1509 * @return name of the output as reported by X 1514 * @return name of the output as reported by X
1510 */ 1515 */
1511EAPI char * 1516EAPI char *
1512ecore_x_randr_output_name_get(Ecore_X_Window root, 1517ecore_x_randr_output_name_get(Ecore_X_Window root,
1513 Ecore_X_Randr_Output output, 1518 Ecore_X_Randr_Output output,
1514 int *len) 1519 int *len)
1515{ 1520{
1516#ifdef ECORE_XRANDR 1521#ifdef ECORE_XRANDR
1517 RANDR_CHECK_1_2_RET(NULL); 1522 RANDR_CHECK_1_2_RET(NULL);
@@ -1532,10 +1537,10 @@ ecore_x_randr_output_name_get(Ecore_X_Window root,
1532 * *len = output_info->nameLen; 1537 * *len = output_info->nameLen;
1533 * 1538 *
1534 */ 1539 */
1535 if ((ret = strdup(output_info->name)) && len) 1540 if ((ret = strdup(output_info->name)) && len)
1536 *len = strlen(ret); 1541 *len = strlen(ret);
1537 1542
1538 XRRFreeOutputInfo(output_info); 1543 XRRFreeOutputInfo(output_info);
1539 } 1544 }
1540 1545
1541 if (res) 1546 if (res)
@@ -1554,10 +1559,10 @@ ecore_x_randr_output_name_get(Ecore_X_Window root,
1554 * @param h height of given mode in px 1559 * @param h height of given mode in px
1555 */ 1560 */
1556EAPI void 1561EAPI void
1557ecore_x_randr_mode_size_get(Ecore_X_Window root, 1562ecore_x_randr_mode_size_get(Ecore_X_Window root,
1558 Ecore_X_Randr_Mode mode, 1563 Ecore_X_Randr_Mode mode,
1559 int *w, 1564 int *w,
1560 int *h) 1565 int *h)
1561{ 1566{
1562#ifdef ECORE_XRANDR 1567#ifdef ECORE_XRANDR
1563 RANDR_CHECK_1_2_RET(); 1568 RANDR_CHECK_1_2_RET();
@@ -1598,9 +1603,9 @@ ecore_x_randr_mode_size_get(Ecore_X_Window root,
1598 * @param length length of the byte-array. If NULL, request will fail. 1603 * @param length length of the byte-array. If NULL, request will fail.
1599 */ 1604 */
1600EAPI unsigned char * 1605EAPI unsigned char *
1601ecore_x_randr_output_edid_get(Ecore_X_Window root, 1606ecore_x_randr_output_edid_get(Ecore_X_Window root,
1602 Ecore_X_Randr_Output output, 1607 Ecore_X_Randr_Output output,
1603 unsigned long *length) 1608 unsigned long *length)
1604{ 1609{
1605#ifdef ECORE_XRANDR 1610#ifdef ECORE_XRANDR
1606 RANDR_CHECK_1_2_RET(NULL); 1611 RANDR_CHECK_1_2_RET(NULL);
@@ -1613,18 +1618,18 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root,
1613 if (!length || !_ecore_x_randr_output_validate(root, output)) 1618 if (!length || !_ecore_x_randr_output_validate(root, output))
1614 return NULL; 1619 return NULL;
1615 1620
1616 if(XRRGetOutputProperty (_ecore_x_disp, output, name, 1621 if (XRRGetOutputProperty (_ecore_x_disp, output, name,
1617 0, 100, False, False, 1622 0, 100, False, False,
1618 AnyPropertyType, 1623 AnyPropertyType,
1619 &actual_type, &actual_format, 1624 &actual_type, &actual_format,
1620 &nitems, &bytes_after, &prop_data) == Success) 1625 &nitems, &bytes_after, &prop_data) == Success)
1621 { 1626 {
1622 if (actual_type == XA_INTEGER && actual_format == 8) 1627 if (actual_type == XA_INTEGER && actual_format == 8)
1623 { 1628 {
1624 if ((ret = malloc(nitems * sizeof(unsigned char)))) 1629 if ((ret = malloc(nitems * sizeof(unsigned char))))
1625 { 1630 {
1626 if(length && 1631 if (length &&
1627 (memcpy(ret, prop_data, (nitems * sizeof(unsigned char))))) 1632 (memcpy(ret, prop_data, (nitems * sizeof(unsigned char)))))
1628 *length = nitems; 1633 *length = nitems;
1629 1634
1630 return ret; 1635 return ret;
@@ -1639,7 +1644,7 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root,
1639} 1644}
1640 1645
1641EAPI Ecore_X_Randr_Connection_Status 1646EAPI Ecore_X_Randr_Connection_Status
1642ecore_x_randr_output_connection_status_get(Ecore_X_Window root, 1647ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
1643 Ecore_X_Randr_Output output) 1648 Ecore_X_Randr_Output output)
1644{ 1649{
1645#ifdef ECORE_XRANDR 1650#ifdef ECORE_XRANDR
@@ -1669,10 +1674,10 @@ ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
1669} 1674}
1670 1675
1671EAPI void 1676EAPI void
1672ecore_x_randr_output_size_mm_get(Ecore_X_Window root, 1677ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
1673 Ecore_X_Randr_Output output, 1678 Ecore_X_Randr_Output output,
1674 int *w_mm, 1679 int *w_mm,
1675 int *h_mm) 1680 int *h_mm)
1676{ 1681{
1677#ifdef ECORE_XRANDR 1682#ifdef ECORE_XRANDR
1678 RANDR_CHECK_1_2_RET(); 1683 RANDR_CHECK_1_2_RET();
@@ -1701,11 +1706,11 @@ ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
1701} 1706}
1702 1707
1703EAPI Eina_Bool 1708EAPI Eina_Bool
1704ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root, 1709ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
1705 const Ecore_X_Randr_Crtc *not_moved, 1710 const Ecore_X_Randr_Crtc *not_moved,
1706 int nnot_moved, 1711 int nnot_moved,
1707 int dx, 1712 int dx,
1708 int dy) 1713 int dy)
1709{ 1714{
1710#ifdef ECORE_XRANDR 1715#ifdef ECORE_XRANDR
1711 Ecore_X_Randr_Crtc *crtcs_to_be_moved = NULL; 1716 Ecore_X_Randr_Crtc *crtcs_to_be_moved = NULL;
@@ -1754,11 +1759,11 @@ ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
1754 * @return EINA_TRUE if all crtcs could be moved successfully. 1759 * @return EINA_TRUE if all crtcs could be moved successfully.
1755 */ 1760 */
1756EAPI Eina_Bool 1761EAPI Eina_Bool
1757ecore_x_randr_move_crtcs(Ecore_X_Window root, 1762ecore_x_randr_move_crtcs(Ecore_X_Window root,
1758 const Ecore_X_Randr_Crtc *crtcs, 1763 const Ecore_X_Randr_Crtc *crtcs,
1759 int ncrtc, 1764 int ncrtc,
1760 int dx, 1765 int dx,
1761 int dy) 1766 int dy)
1762{ 1767{
1763#ifdef ECORE_XRANDR 1768#ifdef ECORE_XRANDR
1764 RANDR_CHECK_1_2_RET(EINA_FALSE); 1769 RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -1821,18 +1826,18 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root,
1821 { 1826 {
1822 //something went wrong, let's try to move the already moved crtcs 1827 //something went wrong, let's try to move the already moved crtcs
1823 //back. 1828 //back.
1824 while ((i--) >= 0) 1829 while ((i--) >= 0)
1825 { 1830 {
1826 if (crtc_info[i]) 1831 if (crtc_info[i])
1827 ecore_x_randr_crtc_settings_set(root, 1832 ecore_x_randr_crtc_settings_set(root,
1828 crtcs[i], 1833 crtcs[i],
1829 NULL, 1834 NULL,
1830 Ecore_X_Randr_Unset, 1835 Ecore_X_Randr_Unset,
1831 (crtc_info[i]->x - dx), 1836 (crtc_info[i]->x - dx),
1832 (crtc_info[i]->y - dy), 1837 (crtc_info[i]->y - dy),
1833 crtc_info[i]->mode, 1838 crtc_info[i]->mode,
1834 crtc_info[i]->rotation); 1839 crtc_info[i]->rotation);
1835 } 1840 }
1836 } 1841 }
1837 1842
1838 for (i = 0; i < ncrtc; i++) 1843 for (i = 0; i < ncrtc; i++)
@@ -1923,7 +1928,7 @@ ecore_x_randr_screen_reset(Ecore_X_Window root)
1923 1928
1924EAPI void 1929EAPI void
1925ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root, 1930ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root,
1926 double level) 1931 double level)
1927{ 1932{
1928#ifdef ECORE_XRANDR 1933#ifdef ECORE_XRANDR
1929 RANDR_CHECK_1_2_RET(); 1934 RANDR_CHECK_1_2_RET();
@@ -1965,6 +1970,26 @@ ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root,
1965} 1970}
1966 1971
1967/* 1972/*
1973 * @brief check if a backlight is available
1974 * @return whether a blacklight is available
1975 */
1976
1977EAPI Eina_Bool
1978ecore_x_randr_output_backlight_available(void)
1979{
1980#ifdef ECORE_XRANDR
1981 RANDR_CHECK_1_2_RET(-1);
1982 Atom _backlight;
1983
1984 _backlight = XInternAtom(_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True);
1985
1986 return (_backlight == None) ? EINA_FALSE : EINA_TRUE;
1987
1988#endif
1989 return EINA_FALSE;
1990}
1991
1992/*
1968 * @brief get the backlight level of the given output 1993 * @brief get the backlight level of the given output
1969 * @param root window which's screen should be queried 1994 * @param root window which's screen should be queried
1970 * @param output from which the backlight level should be retrieved 1995 * @param output from which the backlight level should be retrieved
@@ -1972,7 +1997,7 @@ ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root,
1972 */ 1997 */
1973 1998
1974EAPI double 1999EAPI double
1975ecore_x_randr_output_backlight_level_get(Ecore_X_Window root, 2000ecore_x_randr_output_backlight_level_get(Ecore_X_Window root,
1976 Ecore_X_Randr_Output output) 2001 Ecore_X_Randr_Output output)
1977{ 2002{
1978#ifdef ECORE_XRANDR 2003#ifdef ECORE_XRANDR
@@ -2025,9 +2050,9 @@ ecore_x_randr_output_backlight_level_get(Ecore_X_Window root,
2025 if ((info->range) && (info->num_values == 2)) 2050 if ((info->range) && (info->num_values == 2))
2026 { 2051 {
2027 /* finally convert the current value in the interval [0..1] */ 2052 /* finally convert the current value in the interval [0..1] */
2028 min = info->values[0]; 2053 min = info->values[0];
2029 max = info->values[1]; 2054 max = info->values[1];
2030 dvalue = ((double)(value - min)) / ((double)(max - min)); 2055 dvalue = ((double)(value - min)) / ((double)(max - min));
2031 } 2056 }
2032 free(info); 2057 free(info);
2033 return dvalue; 2058 return dvalue;
@@ -2045,9 +2070,9 @@ ecore_x_randr_output_backlight_level_get(Ecore_X_Window root,
2045 */ 2070 */
2046 2071
2047EAPI Eina_Bool 2072EAPI Eina_Bool
2048ecore_x_randr_output_backlight_level_set(Ecore_X_Window root, 2073ecore_x_randr_output_backlight_level_set(Ecore_X_Window root,
2049 Ecore_X_Randr_Output output, 2074 Ecore_X_Randr_Output output,
2050 double level) 2075 double level)
2051{ 2076{
2052#ifdef ECORE_XRANDR 2077#ifdef ECORE_XRANDR
2053 RANDR_CHECK_1_2_RET(EINA_FALSE); 2078 RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -2107,7 +2132,7 @@ ecore_x_randr_output_backlight_level_set(Ecore_X_Window root,
2107 2132
2108EAPI Ecore_X_Randr_Output * 2133EAPI Ecore_X_Randr_Output *
2109ecore_x_randr_window_outputs_get(Ecore_X_Window window, 2134ecore_x_randr_window_outputs_get(Ecore_X_Window window,
2110 int *num) 2135 int *num)
2111{ 2136{
2112#ifdef ECORE_XRANDR 2137#ifdef ECORE_XRANDR
2113 Ecore_X_Window root; 2138 Ecore_X_Window root;
@@ -2136,39 +2161,39 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window,
2136 for (i = 0; i < ncrtcs; i++) 2161 for (i = 0; i < ncrtcs; i++)
2137 { 2162 {
2138 /* if crtc is not enabled, don't bother about it any further */ 2163 /* if crtc is not enabled, don't bother about it any further */
2139 mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]); 2164 mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
2140 if (mode == Ecore_X_Randr_None) continue; 2165 if (mode == Ecore_X_Randr_None) continue;
2141 2166
2142 ecore_x_randr_crtc_geometry_get(root, crtcs[i], 2167 ecore_x_randr_crtc_geometry_get(root, crtcs[i],
2143 &c_geo.x, &c_geo.y, 2168 &c_geo.x, &c_geo.y,
2144 &c_geo.w, &c_geo.h); 2169 &c_geo.w, &c_geo.h);
2145 if (eina_rectangles_intersect(&w_geo, &c_geo)) 2170 if (eina_rectangles_intersect(&w_geo, &c_geo))
2146 { 2171 {
2147 outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i], 2172 outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
2148 &noutputs); 2173 &noutputs);
2149 /* The case below should be impossible, but for safety reasons 2174 /* The case below should be impossible, but for safety reasons
2150 * remains */ 2175 * remains */
2151 if (!outputs) 2176 if (!outputs)
2152 { 2177 {
2153 if (num) *num = 0; 2178 if (num) *num = 0;
2154 free(ret); 2179 free(ret);
2155 free(crtcs); 2180 free(crtcs);
2156 return NULL; 2181 return NULL;
2157 } 2182 }
2158 tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output))); 2183 tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output)));
2159 if (!tret) 2184 if (!tret)
2160 { 2185 {
2161 if (num) *num = 0; 2186 if (num) *num = 0;
2162 free(outputs); 2187 free(outputs);
2163 free(ret); 2188 free(ret);
2164 free(crtcs); 2189 free(crtcs);
2165 return NULL; 2190 return NULL;
2166 } 2191 }
2167 ret = tret; 2192 ret = tret;
2168 memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output))); 2193 memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
2169 nret += noutputs; 2194 nret += noutputs;
2170 free(outputs); 2195 free(outputs);
2171 } 2196 }
2172 } 2197 }
2173 free(crtcs); 2198 free(crtcs);
2174 2199
@@ -2192,7 +2217,7 @@ _ecore_x_randr_current_output_get_fail:
2192 2217
2193EINA_DEPRECATED EAPI Ecore_X_Randr_Output * 2218EINA_DEPRECATED EAPI Ecore_X_Randr_Output *
2194ecore_x_randr_current_output_get(Ecore_X_Window window, 2219ecore_x_randr_current_output_get(Ecore_X_Window window,
2195 int *num) 2220 int *num)
2196{ 2221{
2197 return ecore_x_randr_window_outputs_get(window, num); 2222 return ecore_x_randr_window_outputs_get(window, num);
2198} 2223}
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
index d434f2f..5bda332 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
@@ -23,6 +23,10 @@
23/* Heavily modified by: Leif Middelschulte <leif.middelschulte@gmail.com> */ 23/* Heavily modified by: Leif Middelschulte <leif.middelschulte@gmail.com> */
24 24
25#include "Ecore_X.h" 25#include "Ecore_X.h"
26#include <stdio.h>
27#include <stdlib.h>
28#include <unistd.h>
29#include <string.h>
26 30
27/* TODO: 31/* TODO:
28 * - see other TODO's within this file. 32 * - see other TODO's within this file.
@@ -100,7 +104,7 @@ typedef enum _Ecore_X_Randr_Edid_Aspect_Ratio_Preferred {
100 104
101EAPI Eina_Bool 105EAPI Eina_Bool
102ecore_x_randr_edid_has_valid_header(unsigned char *edid, 106ecore_x_randr_edid_has_valid_header(unsigned char *edid,
103 unsigned long edid_length) 107 unsigned long edid_length)
104{ 108{
105 const unsigned char header[] = 109 const unsigned char header[] =
106 { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; 110 { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
@@ -112,7 +116,7 @@ ecore_x_randr_edid_has_valid_header(unsigned char *edid,
112 116
113EAPI int 117EAPI int
114ecore_x_randr_edid_version_get(unsigned char *edid, 118ecore_x_randr_edid_version_get(unsigned char *edid,
115 unsigned long edid_length) 119 unsigned long edid_length)
116{ 120{
117 if ((edid_length > _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR) && 121 if ((edid_length > _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR) &&
118 (ecore_x_randr_edid_has_valid_header(edid, edid_length))) 122 (ecore_x_randr_edid_has_valid_header(edid, edid_length)))
@@ -123,7 +127,7 @@ ecore_x_randr_edid_version_get(unsigned char *edid,
123 127
124EAPI int 128EAPI int
125ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid, 129ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid,
126 unsigned long edid_length) 130 unsigned long edid_length)
127{ 131{
128 if ((edid_length > 0x0b) && 132 if ((edid_length > 0x0b) &&
129 (ecore_x_randr_edid_has_valid_header(edid, edid_length))) 133 (ecore_x_randr_edid_has_valid_header(edid, edid_length)))
@@ -133,7 +137,7 @@ ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid,
133 137
134EAPI int 138EAPI int
135ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid, 139ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid,
136 unsigned long edid_length) 140 unsigned long edid_length)
137{ 141{
138 if ((edid_length > 0x0f) && 142 if ((edid_length > 0x0f) &&
139 (ecore_x_randr_edid_has_valid_header(edid, edid_length))) 143 (ecore_x_randr_edid_has_valid_header(edid, edid_length)))
@@ -144,7 +148,7 @@ ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid,
144 148
145EAPI char * 149EAPI char *
146ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, 150ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid,
147 unsigned long edid_length) 151 unsigned long edid_length)
148{ 152{
149 if ((edid_length > (_ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER + 1)) && 153 if ((edid_length > (_ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER + 1)) &&
150 (ecore_x_randr_edid_has_valid_header(edid, edid_length))) 154 (ecore_x_randr_edid_has_valid_header(edid, edid_length)))
@@ -166,7 +170,7 @@ ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid,
166 170
167EAPI char * 171EAPI char *
168ecore_x_randr_edid_display_name_get(unsigned char *edid, 172ecore_x_randr_edid_display_name_get(unsigned char *edid,
169 unsigned long edid_length) 173 unsigned long edid_length)
170{ 174{
171 unsigned char *block = NULL; 175 unsigned char *block = NULL;
172 int version = ecore_x_randr_edid_version_get(edid, edid_length); 176 int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -196,7 +200,7 @@ ecore_x_randr_edid_display_name_get(unsigned char *edid,
196 200
197EAPI Ecore_X_Randr_Edid_Aspect_Ratio 201EAPI Ecore_X_Randr_Edid_Aspect_Ratio
198ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid, 202ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid,
199 unsigned long edid_length) 203 unsigned long edid_length)
200{ 204{
201 unsigned char *block = NULL; 205 unsigned char *block = NULL;
202 int version = ecore_x_randr_edid_version_get(edid, edid_length); 206 int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -238,7 +242,7 @@ ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid,
238 242
239EAPI Ecore_X_Randr_Edid_Aspect_Ratio 243EAPI Ecore_X_Randr_Edid_Aspect_Ratio
240ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, 244ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid,
241 unsigned long edid_length) 245 unsigned long edid_length)
242{ 246{
243 Ecore_X_Randr_Edid_Aspect_Ratio ret = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; 247 Ecore_X_Randr_Edid_Aspect_Ratio ret = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
244 unsigned char *block = NULL; 248 unsigned char *block = NULL;
@@ -267,7 +271,7 @@ ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid,
267 271
268EAPI char * 272EAPI char *
269ecore_x_randr_edid_display_ascii_get(unsigned char *edid, 273ecore_x_randr_edid_display_ascii_get(unsigned char *edid,
270 unsigned long edid_length) 274 unsigned long edid_length)
271{ 275{
272 unsigned char *block = NULL; 276 unsigned char *block = NULL;
273 int version = ecore_x_randr_edid_version_get(edid, edid_length); 277 int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -300,7 +304,7 @@ ecore_x_randr_edid_display_ascii_get(unsigned char *edid,
300 304
301EAPI char * 305EAPI char *
302ecore_x_randr_edid_display_serial_get(unsigned char *edid, 306ecore_x_randr_edid_display_serial_get(unsigned char *edid,
303 unsigned long edid_length) 307 unsigned long edid_length)
304{ 308{
305 unsigned char *block = NULL; 309 unsigned char *block = NULL;
306 int version = ecore_x_randr_edid_version_get(edid, edid_length); 310 int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -333,7 +337,7 @@ ecore_x_randr_edid_display_serial_get(unsigned char *edid,
333 337
334EAPI Eina_Bool 338EAPI Eina_Bool
335ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, 339ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid,
336 unsigned long edid_length) 340 unsigned long edid_length)
337{ 341{
338 unsigned char *cea_block_iter = NULL; 342 unsigned char *cea_block_iter = NULL;
339 char sum = 0; 343 char sum = 0;
@@ -344,13 +348,15 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid,
344 if (edid_length < 128) return EINA_FALSE; 348 if (edid_length < 128) return EINA_FALSE;
345 349
346 /* Check the EDID block itself */ 350 /* Check the EDID block itself */
347 for (i = 0; i < 128; i++) sum += edid[i]; 351 for (i = 0; i < 128; i++)
352 sum += edid[i];
348 if (sum) return EINA_FALSE; 353 if (sum) return EINA_FALSE;
349 354
350 /* Check the cea extension blocks */ 355 /* Check the cea extension blocks */
351 _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) 356 _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter)
352 { 357 {
353 for (i = 0, sum = 0; i < 128; i++) sum += cea_block_iter[i]; 358 for (i = 0, sum = 0; i < 128; i++)
359 sum += cea_block_iter[i];
354 } 360 }
355 if (sum) return EINA_FALSE; 361 if (sum) return EINA_FALSE;
356 return EINA_TRUE; 362 return EINA_TRUE;
@@ -358,7 +364,7 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid,
358 364
359EAPI Eina_Bool 365EAPI Eina_Bool
360ecore_x_randr_edid_dpms_available_get(unsigned char *edid, 366ecore_x_randr_edid_dpms_available_get(unsigned char *edid,
361 unsigned long edid_length) 367 unsigned long edid_length)
362{ 368{
363 int version = ecore_x_randr_edid_version_get(edid, edid_length); 369 int version = ecore_x_randr_edid_version_get(edid, edid_length);
364 370
@@ -369,7 +375,7 @@ ecore_x_randr_edid_dpms_available_get(unsigned char *edid,
369 375
370EAPI Eina_Bool 376EAPI Eina_Bool
371ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid, 377ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid,
372 unsigned long edid_length) 378 unsigned long edid_length)
373{ 379{
374 int version = ecore_x_randr_edid_version_get(edid, edid_length); 380 int version = ecore_x_randr_edid_version_get(edid, edid_length);
375 381
@@ -382,7 +388,7 @@ ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid,
382 388
383EAPI Eina_Bool 389EAPI Eina_Bool
384ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid, 390ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid,
385 unsigned long edid_length) 391 unsigned long edid_length)
386{ 392{
387 int version = ecore_x_randr_edid_version_get(edid, edid_length); 393 int version = ecore_x_randr_edid_version_get(edid, edid_length);
388 394
@@ -395,7 +401,7 @@ ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid,
395 401
396EAPI Eina_Bool 402EAPI Eina_Bool
397ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid, 403ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid,
398 unsigned long edid_length) 404 unsigned long edid_length)
399{ 405{
400 int version = ecore_x_randr_edid_version_get(edid, edid_length); 406 int version = ecore_x_randr_edid_version_get(edid, edid_length);
401 407
@@ -408,7 +414,7 @@ ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid,
408 414
409EAPI Eina_Bool 415EAPI Eina_Bool
410ecore_x_randr_edid_display_type_digital_get(unsigned char *edid, 416ecore_x_randr_edid_display_type_digital_get(unsigned char *edid,
411 unsigned long edid_length) 417 unsigned long edid_length)
412{ 418{
413 int version = ecore_x_randr_edid_version_get(edid, edid_length); 419 int version = ecore_x_randr_edid_version_get(edid, edid_length);
414 420
@@ -419,7 +425,7 @@ ecore_x_randr_edid_display_type_digital_get(unsigned char *edid,
419 425
420EAPI Ecore_X_Randr_Edid_Display_Colorscheme 426EAPI Ecore_X_Randr_Edid_Display_Colorscheme
421ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, 427ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid,
422 unsigned long edid_length) 428 unsigned long edid_length)
423{ 429{
424 Ecore_X_Randr_Edid_Display_Colorscheme colorscheme = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; 430 Ecore_X_Randr_Edid_Display_Colorscheme colorscheme = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
425 int version = ecore_x_randr_edid_version_get(edid, edid_length); 431 int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -442,7 +448,7 @@ ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid,
442 448
443EAPI Ecore_X_Randr_Edid_Display_Interface_Type 449EAPI Ecore_X_Randr_Edid_Display_Interface_Type
444ecore_x_randr_edid_display_interface_type_get(unsigned char *edid, 450ecore_x_randr_edid_display_interface_type_get(unsigned char *edid,
445 unsigned long edid_length) 451 unsigned long edid_length)
446{ 452{
447 Ecore_X_Randr_Edid_Display_Interface_Type type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; 453 Ecore_X_Randr_Edid_Display_Interface_Type type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
448 int version = ecore_x_randr_edid_version_get(edid, edid_length); 454 int version = ecore_x_randr_edid_version_get(edid, edid_length);
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
index ab242f7..5d1c8e9 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
@@ -8,6 +8,10 @@
8 8
9#include "ecore_x_private.h" 9#include "ecore_x_private.h"
10#include "ecore_x_randr.h" 10#include "ecore_x_randr.h"
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <string.h>
11 15
12#define Ecore_X_Randr_None 0 16#define Ecore_X_Randr_None 0
13#define Ecore_X_Randr_Unset -1 17#define Ecore_X_Randr_Unset -1
@@ -15,7 +19,8 @@
15#ifdef ECORE_XRANDR 19#ifdef ECORE_XRANDR
16 20
17#define RANDR_1_3 ((1 << 16) | 3) 21#define RANDR_1_3 ((1 << 16) | 3)
18#define RANDR_CHECK_1_3_RET(ret) if(_randr_version < RANDR_1_3) return ret 22#define RANDR_CHECK_1_3_RET(ret) if (_randr_version < RANDR_1_3) \
23 return ret
19 24
20extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display * 25extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
21 dpy, 26 dpy,
@@ -47,7 +52,7 @@ ecore_x_randr_primary_output_get(Ecore_X_Window root)
47 * @param output that should be set as given root window's screen primary output 52 * @param output that should be set as given root window's screen primary output
48 */ 53 */
49EAPI void 54EAPI void
50ecore_x_randr_primary_output_set(Ecore_X_Window root, 55ecore_x_randr_primary_output_set(Ecore_X_Window root,
51 Ecore_X_Randr_Output output) 56 Ecore_X_Randr_Output output)
52{ 57{
53#ifdef ECORE_XRANDR 58#ifdef ECORE_XRANDR
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
index 7cc66e3..81d7eea 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
@@ -32,7 +32,7 @@ ecore_x_xregion_new()
32{ 32{
33 LOGFN(__FILE__, __LINE__, __FUNCTION__); 33 LOGFN(__FILE__, __LINE__, __FUNCTION__);
34 return (Ecore_X_XRegion *)XCreateRegion(); 34 return (Ecore_X_XRegion *)XCreateRegion();
35} /* ecore_x_xregion_new */ 35}
36 36
37EAPI void 37EAPI void
38ecore_x_xregion_free(Ecore_X_XRegion *region) 38ecore_x_xregion_free(Ecore_X_XRegion *region)
@@ -42,20 +42,20 @@ ecore_x_xregion_free(Ecore_X_XRegion *region)
42 return; 42 return;
43 43
44 XDestroyRegion((Region)region); 44 XDestroyRegion((Region)region);
45} /* ecore_x_xregion_free */ 45}
46 46
47EAPI Eina_Bool 47EAPI Eina_Bool
48ecore_x_xregion_set(Ecore_X_XRegion *region, 48ecore_x_xregion_set(Ecore_X_XRegion *region,
49 Ecore_X_GC gc) 49 Ecore_X_GC gc)
50{ 50{
51 LOGFN(__FILE__, __LINE__, __FUNCTION__); 51 LOGFN(__FILE__, __LINE__, __FUNCTION__);
52 return XSetRegion(_ecore_x_disp, gc, (Region)region) ? EINA_TRUE : EINA_FALSE; 52 return XSetRegion(_ecore_x_disp, gc, (Region)region) ? EINA_TRUE : EINA_FALSE;
53} /* ecore_x_xregion_set */ 53}
54 54
55EAPI void 55EAPI void
56ecore_x_xregion_translate(Ecore_X_XRegion *region, 56ecore_x_xregion_translate(Ecore_X_XRegion *region,
57 int x, 57 int x,
58 int y) 58 int y)
59{ 59{
60 LOGFN(__FILE__, __LINE__, __FUNCTION__); 60 LOGFN(__FILE__, __LINE__, __FUNCTION__);
61 if (!region) 61 if (!region)
@@ -63,7 +63,7 @@ ecore_x_xregion_translate(Ecore_X_XRegion *region,
63 63
64 /* return value not used */ 64 /* return value not used */
65 XOffsetRegion((Region)region, x, y); 65 XOffsetRegion((Region)region, x, y);
66} /* ecore_x_xregion_translate */ 66}
67 67
68EAPI Eina_Bool 68EAPI Eina_Bool
69ecore_x_xregion_intersect(Ecore_X_XRegion *dst, 69ecore_x_xregion_intersect(Ecore_X_XRegion *dst,
@@ -72,7 +72,7 @@ ecore_x_xregion_intersect(Ecore_X_XRegion *dst,
72{ 72{
73 LOGFN(__FILE__, __LINE__, __FUNCTION__); 73 LOGFN(__FILE__, __LINE__, __FUNCTION__);
74 return XIntersectRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE; 74 return XIntersectRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE;
75} /* ecore_x_xregion_intersect */ 75}
76 76
77EAPI Eina_Bool 77EAPI Eina_Bool
78ecore_x_xregion_union(Ecore_X_XRegion *dst, 78ecore_x_xregion_union(Ecore_X_XRegion *dst,
@@ -81,11 +81,11 @@ ecore_x_xregion_union(Ecore_X_XRegion *dst,
81{ 81{
82 LOGFN(__FILE__, __LINE__, __FUNCTION__); 82 LOGFN(__FILE__, __LINE__, __FUNCTION__);
83 return XUnionRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE; 83 return XUnionRegion((Region)r1, (Region)r2, (Region)dst) ? EINA_TRUE : EINA_FALSE;
84} /* ecore_x_xregion_union */ 84}
85 85
86EAPI Eina_Bool 86EAPI Eina_Bool
87ecore_x_xregion_union_rect(Ecore_X_XRegion *dst, 87ecore_x_xregion_union_rect(Ecore_X_XRegion *dst,
88 Ecore_X_XRegion *src, 88 Ecore_X_XRegion *src,
89 Ecore_X_Rectangle *rect) 89 Ecore_X_Rectangle *rect)
90{ 90{
91 XRectangle xr; 91 XRectangle xr;
@@ -97,7 +97,7 @@ ecore_x_xregion_union_rect(Ecore_X_XRegion *dst,
97 xr.height = rect->height; 97 xr.height = rect->height;
98 98
99 return XUnionRectWithRegion(&xr, (Region)src, (Region)dst) ? EINA_TRUE : EINA_FALSE; 99 return XUnionRectWithRegion(&xr, (Region)src, (Region)dst) ? EINA_TRUE : EINA_FALSE;
100} /* ecore_x_xregion_union_rect */ 100}
101 101
102EAPI Eina_Bool 102EAPI Eina_Bool
103ecore_x_xregion_subtract(Ecore_X_XRegion *dst, 103ecore_x_xregion_subtract(Ecore_X_XRegion *dst,
@@ -106,7 +106,7 @@ ecore_x_xregion_subtract(Ecore_X_XRegion *dst,
106{ 106{
107 LOGFN(__FILE__, __LINE__, __FUNCTION__); 107 LOGFN(__FILE__, __LINE__, __FUNCTION__);
108 return XSubtractRegion((Region)rm, (Region)rs, (Region)dst) ? EINA_TRUE : EINA_FALSE; 108 return XSubtractRegion((Region)rm, (Region)rs, (Region)dst) ? EINA_TRUE : EINA_FALSE;
109} /* ecore_x_xregion_subtract */ 109}
110 110
111EAPI Eina_Bool 111EAPI Eina_Bool
112ecore_x_xregion_is_empty(Ecore_X_XRegion *region) 112ecore_x_xregion_is_empty(Ecore_X_XRegion *region)
@@ -116,7 +116,7 @@ ecore_x_xregion_is_empty(Ecore_X_XRegion *region)
116 116
117 LOGFN(__FILE__, __LINE__, __FUNCTION__); 117 LOGFN(__FILE__, __LINE__, __FUNCTION__);
118 return XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE; 118 return XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE;
119} /* ecore_x_xregion_is_empty */ 119}
120 120
121EAPI Eina_Bool 121EAPI Eina_Bool
122ecore_x_xregion_is_equal(Ecore_X_XRegion *r1, 122ecore_x_xregion_is_equal(Ecore_X_XRegion *r1,
@@ -127,22 +127,22 @@ ecore_x_xregion_is_equal(Ecore_X_XRegion *r1,
127 127
128 LOGFN(__FILE__, __LINE__, __FUNCTION__); 128 LOGFN(__FILE__, __LINE__, __FUNCTION__);
129 return XEqualRegion((Region)r1, (Region)r1) ? EINA_TRUE : EINA_FALSE; 129 return XEqualRegion((Region)r1, (Region)r1) ? EINA_TRUE : EINA_FALSE;
130} /* ecore_x_xregion_is_equal */ 130}
131 131
132EAPI Eina_Bool 132EAPI Eina_Bool
133ecore_x_xregion_point_contain(Ecore_X_XRegion *region, 133ecore_x_xregion_point_contain(Ecore_X_XRegion *region,
134 int x, 134 int x,
135 int y) 135 int y)
136{ 136{
137 if (!region) 137 if (!region)
138 return EINA_FALSE; 138 return EINA_FALSE;
139 139
140 LOGFN(__FILE__, __LINE__, __FUNCTION__); 140 LOGFN(__FILE__, __LINE__, __FUNCTION__);
141 return XPointInRegion((Region)region, x, y) ? EINA_TRUE : EINA_FALSE; 141 return XPointInRegion((Region)region, x, y) ? EINA_TRUE : EINA_FALSE;
142} /* ecore_x_xregion_point_contain */ 142}
143 143
144EAPI Eina_Bool 144EAPI Eina_Bool
145ecore_x_xregion_rect_contain(Ecore_X_XRegion *region, 145ecore_x_xregion_rect_contain(Ecore_X_XRegion *region,
146 Ecore_X_Rectangle *rect) 146 Ecore_X_Rectangle *rect)
147{ 147{
148 if (!region || !rect) 148 if (!region || !rect)
@@ -154,5 +154,5 @@ ecore_x_xregion_rect_contain(Ecore_X_XRegion *region,
154 rect->y, 154 rect->y,
155 rect->width, 155 rect->width,
156 rect->height) ? EINA_TRUE : EINA_FALSE; 156 rect->height) ? EINA_TRUE : EINA_FALSE;
157} /* ecore_x_xregion_rect_contain */ 157}
158 158
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
index a3bca67..40dd738 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
@@ -36,7 +36,7 @@ ecore_x_screensaver_event_available_get(void)
36 _screensaver_available = 0; 36 _screensaver_available = 0;
37#endif /* ifdef ECORE_XSS */ 37#endif /* ifdef ECORE_XSS */
38 return _screensaver_available; 38 return _screensaver_available;
39} /* ecore_x_screensaver_event_available_get */ 39}
40 40
41EAPI int 41EAPI int
42ecore_x_screensaver_idle_time_get(void) 42ecore_x_screensaver_idle_time_get(void)
@@ -57,7 +57,7 @@ ecore_x_screensaver_idle_time_get(void)
57#else 57#else
58 return 0; 58 return 0;
59#endif /* ifdef ECORE_XSS */ 59#endif /* ifdef ECORE_XSS */
60} /* ecore_x_screensaver_idle_time_get */ 60}
61 61
62EAPI void 62EAPI void
63ecore_x_screensaver_set(int timeout, 63ecore_x_screensaver_set(int timeout,
@@ -71,7 +71,7 @@ ecore_x_screensaver_set(int timeout,
71 interval, 71 interval,
72 prefer_blanking, 72 prefer_blanking,
73 allow_exposures); 73 allow_exposures);
74} /* ecore_x_screensaver_set */ 74}
75 75
76EAPI void 76EAPI void
77ecore_x_screensaver_timeout_set(int timeout) 77ecore_x_screensaver_timeout_set(int timeout)
@@ -81,7 +81,7 @@ ecore_x_screensaver_timeout_set(int timeout)
81 LOGFN(__FILE__, __LINE__, __FUNCTION__); 81 LOGFN(__FILE__, __LINE__, __FUNCTION__);
82 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 82 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
83 XSetScreenSaver(_ecore_x_disp, timeout, pint, pblank, pexpo); 83 XSetScreenSaver(_ecore_x_disp, timeout, pint, pblank, pexpo);
84} /* ecore_x_screensaver_timeout_set */ 84}
85 85
86EAPI int 86EAPI int
87ecore_x_screensaver_timeout_get(void) 87ecore_x_screensaver_timeout_get(void)
@@ -91,7 +91,7 @@ ecore_x_screensaver_timeout_get(void)
91 LOGFN(__FILE__, __LINE__, __FUNCTION__); 91 LOGFN(__FILE__, __LINE__, __FUNCTION__);
92 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 92 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
93 return pto; 93 return pto;
94} /* ecore_x_screensaver_timeout_get */ 94}
95 95
96EAPI void 96EAPI void
97ecore_x_screensaver_blank_set(int blank) 97ecore_x_screensaver_blank_set(int blank)
@@ -101,7 +101,7 @@ ecore_x_screensaver_blank_set(int blank)
101 LOGFN(__FILE__, __LINE__, __FUNCTION__); 101 LOGFN(__FILE__, __LINE__, __FUNCTION__);
102 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 102 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
103 XSetScreenSaver(_ecore_x_disp, pto, pint, blank, pexpo); 103 XSetScreenSaver(_ecore_x_disp, pto, pint, blank, pexpo);
104} /* ecore_x_screensaver_blank_set */ 104}
105 105
106EAPI int 106EAPI int
107ecore_x_screensaver_blank_get(void) 107ecore_x_screensaver_blank_get(void)
@@ -111,7 +111,7 @@ ecore_x_screensaver_blank_get(void)
111 LOGFN(__FILE__, __LINE__, __FUNCTION__); 111 LOGFN(__FILE__, __LINE__, __FUNCTION__);
112 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 112 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
113 return pblank; 113 return pblank;
114} /* ecore_x_screensaver_blank_get */ 114}
115 115
116EAPI void 116EAPI void
117ecore_x_screensaver_expose_set(int expose) 117ecore_x_screensaver_expose_set(int expose)
@@ -121,7 +121,7 @@ ecore_x_screensaver_expose_set(int expose)
121 LOGFN(__FILE__, __LINE__, __FUNCTION__); 121 LOGFN(__FILE__, __LINE__, __FUNCTION__);
122 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 122 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
123 XSetScreenSaver(_ecore_x_disp, pto, pint, pblank, expose); 123 XSetScreenSaver(_ecore_x_disp, pto, pint, pblank, expose);
124} /* ecore_x_screensaver_expose_set */ 124}
125 125
126EAPI int 126EAPI int
127ecore_x_screensaver_expose_get(void) 127ecore_x_screensaver_expose_get(void)
@@ -131,7 +131,7 @@ ecore_x_screensaver_expose_get(void)
131 LOGFN(__FILE__, __LINE__, __FUNCTION__); 131 LOGFN(__FILE__, __LINE__, __FUNCTION__);
132 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 132 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
133 return pexpo; 133 return pexpo;
134} /* ecore_x_screensaver_expose_get */ 134}
135 135
136EAPI void 136EAPI void
137ecore_x_screensaver_interval_set(int interval) 137ecore_x_screensaver_interval_set(int interval)
@@ -141,7 +141,7 @@ ecore_x_screensaver_interval_set(int interval)
141 LOGFN(__FILE__, __LINE__, __FUNCTION__); 141 LOGFN(__FILE__, __LINE__, __FUNCTION__);
142 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 142 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
143 XSetScreenSaver(_ecore_x_disp, pto, interval, pblank, pexpo); 143 XSetScreenSaver(_ecore_x_disp, pto, interval, pblank, pexpo);
144} /* ecore_x_screensaver_interval_set */ 144}
145 145
146EAPI int 146EAPI int
147ecore_x_screensaver_interval_get(void) 147ecore_x_screensaver_interval_get(void)
@@ -151,7 +151,7 @@ ecore_x_screensaver_interval_get(void)
151 LOGFN(__FILE__, __LINE__, __FUNCTION__); 151 LOGFN(__FILE__, __LINE__, __FUNCTION__);
152 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo); 152 XGetScreenSaver(_ecore_x_disp, &pto, &pint, &pblank, &pexpo);
153 return pint; 153 return pint;
154} /* ecore_x_screensaver_interval_get */ 154}
155 155
156EAPI void 156EAPI void
157ecore_x_screensaver_event_listen_set(Eina_Bool on) 157ecore_x_screensaver_event_listen_set(Eina_Bool on)
@@ -169,5 +169,5 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
169 return; 169 return;
170 on = EINA_FALSE; 170 on = EINA_FALSE;
171#endif /* ifdef ECORE_XSS */ 171#endif /* ifdef ECORE_XSS */
172} /* ecore_x_screensaver_event_listen_set */ 172}
173 173
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
index b1aa611..fa177c3 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -15,29 +15,29 @@ static Ecore_X_Selection_Intern selections[4];
15static Ecore_X_Selection_Converter *converters = NULL; 15static Ecore_X_Selection_Converter *converters = NULL;
16static Ecore_X_Selection_Parser *parsers = NULL; 16static Ecore_X_Selection_Parser *parsers = NULL;
17 17
18static Eina_Bool _ecore_x_selection_converter_text(char *target, 18static Eina_Bool _ecore_x_selection_converter_text(char *target,
19 void *data, 19 void *data,
20 int size, 20 int size,
21 void **data_ret, 21 void **data_ret,
22 int *size_ret, 22 int *size_ret,
23 Ecore_X_Atom *tprop, 23 Ecore_X_Atom *tprop,
24 int *); 24 int *);
25static int _ecore_x_selection_data_default_free(void *data); 25static int _ecore_x_selection_data_default_free(void *data);
26static void *_ecore_x_selection_parser_files(const char *target, 26static void *_ecore_x_selection_parser_files(const char *target,
27 void *data, 27 void *data,
28 int size, 28 int size,
29 int format); 29 int format);
30static int _ecore_x_selection_data_files_free(void *data); 30static int _ecore_x_selection_data_files_free(void *data);
31static void *_ecore_x_selection_parser_text(const char *target, 31static void *_ecore_x_selection_parser_text(const char *target,
32 void *data, 32 void *data,
33 int size, 33 int size,
34 int format); 34 int format);
35static int _ecore_x_selection_data_text_free(void *data); 35static int _ecore_x_selection_data_text_free(void *data);
36static void *_ecore_x_selection_parser_targets(const char *target, 36static void *_ecore_x_selection_parser_targets(const char *target,
37 void *data, 37 void *data,
38 int size, 38 int size,
39 int format); 39 int format);
40static int _ecore_x_selection_data_targets_free(void *data); 40static int _ecore_x_selection_data_targets_free(void *data);
41 41
42#define ECORE_X_SELECTION_DATA(x) ((Ecore_X_Selection_Data *)(x)) 42#define ECORE_X_SELECTION_DATA(x) ((Ecore_X_Selection_Data *)(x))
43 43
@@ -45,32 +45,32 @@ void
45_ecore_x_selection_data_init(void) 45_ecore_x_selection_data_init(void)
46{ 46{
47 /* Initialize global data */ 47 /* Initialize global data */
48 memset(selections, 0, sizeof(selections)); 48 memset(selections, 0, sizeof(selections));
49 49
50 /* Initialize converters */ 50 /* Initialize converters */
51 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT, 51 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT,
52 _ecore_x_selection_converter_text); 52 _ecore_x_selection_converter_text);
53#ifdef X_HAVE_UTF8_STRING 53#ifdef X_HAVE_UTF8_STRING
54 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING, 54 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING,
55 _ecore_x_selection_converter_text); 55 _ecore_x_selection_converter_text);
56#endif /* ifdef X_HAVE_UTF8_STRING */ 56#endif /* ifdef X_HAVE_UTF8_STRING */
57 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT, 57 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT,
58 _ecore_x_selection_converter_text); 58 _ecore_x_selection_converter_text);
59 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING, 59 ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING,
60 _ecore_x_selection_converter_text); 60 _ecore_x_selection_converter_text);
61 61
62 /* Initialize parsers */ 62 /* Initialize parsers */
63 ecore_x_selection_parser_add("text/plain", 63 ecore_x_selection_parser_add("text/plain",
64 _ecore_x_selection_parser_text); 64 _ecore_x_selection_parser_text);
65 ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_UTF8_STRING, 65 ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_UTF8_STRING,
66 _ecore_x_selection_parser_text); 66 _ecore_x_selection_parser_text);
67 ecore_x_selection_parser_add("text/uri-list", 67 ecore_x_selection_parser_add("text/uri-list",
68 _ecore_x_selection_parser_files); 68 _ecore_x_selection_parser_files);
69 ecore_x_selection_parser_add("_NETSCAPE_URL", 69 ecore_x_selection_parser_add("_NETSCAPE_URL",
70 _ecore_x_selection_parser_files); 70 _ecore_x_selection_parser_files);
71 ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_TARGETS, 71 ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_TARGETS,
72 _ecore_x_selection_parser_targets); 72 _ecore_x_selection_parser_targets);
73} /* _ecore_x_selection_data_init */ 73}
74 74
75void 75void
76_ecore_x_selection_shutdown(void) 76_ecore_x_selection_shutdown(void)
@@ -102,7 +102,7 @@ _ecore_x_selection_shutdown(void)
102 free(tmp); 102 free(tmp);
103 } 103 }
104 parsers = NULL; 104 parsers = NULL;
105} /* _ecore_x_selection_shutdown */ 105}
106 106
107Ecore_X_Selection_Intern * 107Ecore_X_Selection_Intern *
108_ecore_x_selection_get(Ecore_X_Atom selection) 108_ecore_x_selection_get(Ecore_X_Atom selection)
@@ -117,12 +117,12 @@ _ecore_x_selection_get(Ecore_X_Atom selection)
117 return &selections[3]; 117 return &selections[3];
118 else 118 else
119 return NULL; 119 return NULL;
120} /* _ecore_x_selection_get */ 120}
121 121
122Eina_Bool 122Eina_Bool
123_ecore_x_selection_set(Window w, 123_ecore_x_selection_set(Window w,
124 const void *data, 124 const void *data,
125 int size, 125 int size,
126 Ecore_X_Atom selection) 126 Ecore_X_Atom selection)
127{ 127{
128 int in; 128 int in;
@@ -162,7 +162,7 @@ _ecore_x_selection_set(Window w,
162 } 162 }
163 163
164 return EINA_TRUE; 164 return EINA_TRUE;
165} /* _ecore_x_selection_set */ 165}
166 166
167/** 167/**
168 * Claim ownership of the PRIMARY selection and set its data. 168 * Claim ownership of the PRIMARY selection and set its data.
@@ -174,12 +174,12 @@ _ecore_x_selection_set(Window w,
174 */ 174 */
175EAPI Eina_Bool 175EAPI Eina_Bool
176ecore_x_selection_primary_set(Ecore_X_Window w, 176ecore_x_selection_primary_set(Ecore_X_Window w,
177 const void *data, 177 const void *data,
178 int size) 178 int size)
179{ 179{
180 LOGFN(__FILE__, __LINE__, __FUNCTION__); 180 LOGFN(__FILE__, __LINE__, __FUNCTION__);
181 return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_PRIMARY); 181 return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_PRIMARY);
182} /* ecore_x_selection_primary_set */ 182}
183 183
184/** 184/**
185 * Release ownership of the primary selection 185 * Release ownership of the primary selection
@@ -192,7 +192,7 @@ ecore_x_selection_primary_clear(void)
192{ 192{
193 LOGFN(__FILE__, __LINE__, __FUNCTION__); 193 LOGFN(__FILE__, __LINE__, __FUNCTION__);
194 return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_PRIMARY); 194 return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_PRIMARY);
195} /* ecore_x_selection_primary_clear */ 195}
196 196
197/** 197/**
198 * Claim ownership of the SECONDARY selection and set its data. 198 * Claim ownership of the SECONDARY selection and set its data.
@@ -204,15 +204,15 @@ ecore_x_selection_primary_clear(void)
204 */ 204 */
205EAPI Eina_Bool 205EAPI Eina_Bool
206ecore_x_selection_secondary_set(Ecore_X_Window w, 206ecore_x_selection_secondary_set(Ecore_X_Window w,
207 const void *data, 207 const void *data,
208 int size) 208 int size)
209{ 209{
210 LOGFN(__FILE__, __LINE__, __FUNCTION__); 210 LOGFN(__FILE__, __LINE__, __FUNCTION__);
211 return _ecore_x_selection_set(w, 211 return _ecore_x_selection_set(w,
212 data, 212 data,
213 size, 213 size,
214 ECORE_X_ATOM_SELECTION_SECONDARY); 214 ECORE_X_ATOM_SELECTION_SECONDARY);
215} /* ecore_x_selection_secondary_set */ 215}
216 216
217/** 217/**
218 * Release ownership of the secondary selection 218 * Release ownership of the secondary selection
@@ -228,7 +228,7 @@ ecore_x_selection_secondary_clear(void)
228 NULL, 228 NULL,
229 0, 229 0,
230 ECORE_X_ATOM_SELECTION_SECONDARY); 230 ECORE_X_ATOM_SELECTION_SECONDARY);
231} /* ecore_x_selection_secondary_clear */ 231}
232 232
233/** 233/**
234 * Claim ownership of the XDND selection and set its data. 234 * Claim ownership of the XDND selection and set its data.
@@ -240,12 +240,12 @@ ecore_x_selection_secondary_clear(void)
240 */ 240 */
241EAPI Eina_Bool 241EAPI Eina_Bool
242ecore_x_selection_xdnd_set(Ecore_X_Window w, 242ecore_x_selection_xdnd_set(Ecore_X_Window w,
243 const void *data, 243 const void *data,
244 int size) 244 int size)
245{ 245{
246 LOGFN(__FILE__, __LINE__, __FUNCTION__); 246 LOGFN(__FILE__, __LINE__, __FUNCTION__);
247 return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_XDND); 247 return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_XDND);
248} /* ecore_x_selection_xdnd_set */ 248}
249 249
250/** 250/**
251 * Release ownership of the XDND selection 251 * Release ownership of the XDND selection
@@ -258,7 +258,7 @@ ecore_x_selection_xdnd_clear(void)
258{ 258{
259 LOGFN(__FILE__, __LINE__, __FUNCTION__); 259 LOGFN(__FILE__, __LINE__, __FUNCTION__);
260 return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_XDND); 260 return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_XDND);
261} /* ecore_x_selection_xdnd_clear */ 261}
262 262
263/** 263/**
264 * Claim ownership of the CLIPBOARD selection and set its data. 264 * Claim ownership of the CLIPBOARD selection and set its data.
@@ -273,15 +273,15 @@ ecore_x_selection_xdnd_clear(void)
273 */ 273 */
274EAPI Eina_Bool 274EAPI Eina_Bool
275ecore_x_selection_clipboard_set(Ecore_X_Window w, 275ecore_x_selection_clipboard_set(Ecore_X_Window w,
276 const void *data, 276 const void *data,
277 int size) 277 int size)
278{ 278{
279 LOGFN(__FILE__, __LINE__, __FUNCTION__); 279 LOGFN(__FILE__, __LINE__, __FUNCTION__);
280 return _ecore_x_selection_set(w, 280 return _ecore_x_selection_set(w,
281 data, 281 data,
282 size, 282 size,
283 ECORE_X_ATOM_SELECTION_CLIPBOARD); 283 ECORE_X_ATOM_SELECTION_CLIPBOARD);
284} /* ecore_x_selection_clipboard_set */ 284}
285 285
286/** 286/**
287 * Release ownership of the clipboard selection 287 * Release ownership of the clipboard selection
@@ -297,7 +297,7 @@ ecore_x_selection_clipboard_clear(void)
297 NULL, 297 NULL,
298 0, 298 0,
299 ECORE_X_ATOM_SELECTION_CLIPBOARD); 299 ECORE_X_ATOM_SELECTION_CLIPBOARD);
300} /* ecore_x_selection_clipboard_clear */ 300}
301 301
302Ecore_X_Atom 302Ecore_X_Atom
303_ecore_x_selection_target_atom_get(const char *target) 303_ecore_x_selection_target_atom_get(const char *target)
@@ -318,29 +318,29 @@ _ecore_x_selection_target_atom_get(const char *target)
318 x_target = ecore_x_atom_get(target); 318 x_target = ecore_x_atom_get(target);
319 319
320 return x_target; 320 return x_target;
321} /* _ecore_x_selection_target_atom_get */ 321}
322 322
323char * 323char *
324_ecore_x_selection_target_get(Ecore_X_Atom target) 324_ecore_x_selection_target_get(Ecore_X_Atom target)
325{ 325{
326 /* FIXME: Should not return mem allocated with strdup or X mixed, 326 /* FIXME: Should not return mem allocated with strdup or X mixed,
327 * one should use free to free, the other XFree */ 327 * one should use free to free, the other XFree */
328 if (target == ECORE_X_ATOM_FILE_NAME) 328 if (target == ECORE_X_ATOM_FILE_NAME)
329 return strdup(ECORE_X_SELECTION_TARGET_FILENAME); 329 return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
330 else if (target == ECORE_X_ATOM_STRING) 330 else if (target == ECORE_X_ATOM_STRING)
331 return strdup(ECORE_X_SELECTION_TARGET_STRING); 331 return strdup(ECORE_X_SELECTION_TARGET_STRING);
332 else if (target == ECORE_X_ATOM_UTF8_STRING) 332 else if (target == ECORE_X_ATOM_UTF8_STRING)
333 return strdup(ECORE_X_SELECTION_TARGET_UTF8_STRING); 333 return strdup(ECORE_X_SELECTION_TARGET_UTF8_STRING);
334 else if (target == ECORE_X_ATOM_TEXT) 334 else if (target == ECORE_X_ATOM_TEXT)
335 return strdup(ECORE_X_SELECTION_TARGET_TEXT); 335 return strdup(ECORE_X_SELECTION_TARGET_TEXT);
336 else 336 else
337 return XGetAtomName(_ecore_x_disp, target); 337 return XGetAtomName(_ecore_x_disp, target);
338} /* _ecore_x_selection_target_get */ 338}
339 339
340static void 340static void
341_ecore_x_selection_request(Ecore_X_Window w, 341_ecore_x_selection_request(Ecore_X_Window w,
342 Ecore_X_Atom selection, 342 Ecore_X_Atom selection,
343 const char *target_str) 343 const char *target_str)
344{ 344{
345 Ecore_X_Atom target, prop; 345 Ecore_X_Atom target, prop;
346 346
@@ -357,27 +357,27 @@ _ecore_x_selection_request(Ecore_X_Window w,
357 357
358 XConvertSelection(_ecore_x_disp, selection, target, prop, 358 XConvertSelection(_ecore_x_disp, selection, target, prop,
359 w, CurrentTime); 359 w, CurrentTime);
360} /* _ecore_x_selection_request */ 360}
361 361
362EAPI void 362EAPI void
363ecore_x_selection_primary_request(Ecore_X_Window w, 363ecore_x_selection_primary_request(Ecore_X_Window w,
364 const char *target) 364 const char *target)
365{ 365{
366 LOGFN(__FILE__, __LINE__, __FUNCTION__); 366 LOGFN(__FILE__, __LINE__, __FUNCTION__);
367 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_PRIMARY, target); 367 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_PRIMARY, target);
368} /* ecore_x_selection_primary_request */ 368}
369 369
370EAPI void 370EAPI void
371ecore_x_selection_secondary_request(Ecore_X_Window w, 371ecore_x_selection_secondary_request(Ecore_X_Window w,
372 const char *target) 372 const char *target)
373{ 373{
374 LOGFN(__FILE__, __LINE__, __FUNCTION__); 374 LOGFN(__FILE__, __LINE__, __FUNCTION__);
375 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_SECONDARY, target); 375 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_SECONDARY, target);
376} /* ecore_x_selection_secondary_request */ 376}
377 377
378EAPI void 378EAPI void
379ecore_x_selection_xdnd_request(Ecore_X_Window w, 379ecore_x_selection_xdnd_request(Ecore_X_Window w,
380 const char *target) 380 const char *target)
381{ 381{
382 Ecore_X_Atom atom; 382 Ecore_X_Atom atom;
383 Ecore_X_DND_Target *_target; 383 Ecore_X_DND_Target *_target;
@@ -388,25 +388,25 @@ ecore_x_selection_xdnd_request(Ecore_X_Window w,
388 XConvertSelection(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND, atom, 388 XConvertSelection(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND, atom,
389 ECORE_X_ATOM_SELECTION_PROP_XDND, w, 389 ECORE_X_ATOM_SELECTION_PROP_XDND, w,
390 _target->time); 390 _target->time);
391} /* ecore_x_selection_xdnd_request */ 391}
392 392
393EAPI void 393EAPI void
394ecore_x_selection_clipboard_request(Ecore_X_Window w, 394ecore_x_selection_clipboard_request(Ecore_X_Window w,
395 const char *target) 395 const char *target)
396{ 396{
397 LOGFN(__FILE__, __LINE__, __FUNCTION__); 397 LOGFN(__FILE__, __LINE__, __FUNCTION__);
398 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_CLIPBOARD, target); 398 _ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_CLIPBOARD, target);
399} /* ecore_x_selection_clipboard_request */ 399}
400 400
401EAPI void 401EAPI void
402ecore_x_selection_converter_atom_add(Ecore_X_Atom target, 402ecore_x_selection_converter_atom_add(Ecore_X_Atom target,
403 Eina_Bool (*func)(char *target, 403 Eina_Bool (*func)(char *target,
404 void *data, 404 void *data,
405 int size, 405 int size,
406 void **data_ret, 406 void **data_ret,
407 int *size_ret, 407 int *size_ret,
408 Ecore_X_Atom *ttype, 408 Ecore_X_Atom *ttype,
409 int *tsize)) 409 int *tsize))
410{ 410{
411 Ecore_X_Selection_Converter *cnv; 411 Ecore_X_Selection_Converter *cnv;
412 412
@@ -441,17 +441,17 @@ ecore_x_selection_converter_atom_add(Ecore_X_Atom
441 441
442 cnv->target = target; 442 cnv->target = target;
443 cnv->convert = func; 443 cnv->convert = func;
444} /* ecore_x_selection_converter_atom_add */ 444}
445 445
446EAPI void 446EAPI void
447ecore_x_selection_converter_add(char *target, 447ecore_x_selection_converter_add(char *target,
448 Eina_Bool (*func)(char *target, 448 Eina_Bool (*func)(char *target,
449 void *data, 449 void *data,
450 int size, 450 int size,
451 void **data_ret, 451 void **data_ret,
452 int *size_ret, 452 int *size_ret,
453 Ecore_X_Atom *, 453 Ecore_X_Atom *,
454 int *)) 454 int *))
455{ 455{
456 Ecore_X_Atom x_target; 456 Ecore_X_Atom x_target;
457 457
@@ -462,7 +462,7 @@ ecore_x_selection_converter_add(char *target,
462 x_target = _ecore_x_selection_target_atom_get(target); 462 x_target = _ecore_x_selection_target_atom_get(target);
463 463
464 ecore_x_selection_converter_atom_add(x_target, func); 464 ecore_x_selection_converter_atom_add(x_target, func);
465} /* ecore_x_selection_converter_add */ 465}
466 466
467EAPI void 467EAPI void
468ecore_x_selection_converter_atom_del(Ecore_X_Atom target) 468ecore_x_selection_converter_atom_del(Ecore_X_Atom target)
@@ -492,7 +492,7 @@ ecore_x_selection_converter_atom_del(Ecore_X_Atom target)
492 prev_cnv = cnv; 492 prev_cnv = cnv;
493 cnv = cnv->next; 493 cnv = cnv->next;
494 } 494 }
495} /* ecore_x_selection_converter_atom_del */ 495}
496 496
497EAPI void 497EAPI void
498ecore_x_selection_converter_del(char *target) 498ecore_x_selection_converter_del(char *target)
@@ -505,14 +505,14 @@ ecore_x_selection_converter_del(char *target)
505 LOGFN(__FILE__, __LINE__, __FUNCTION__); 505 LOGFN(__FILE__, __LINE__, __FUNCTION__);
506 x_target = _ecore_x_selection_target_atom_get(target); 506 x_target = _ecore_x_selection_target_atom_get(target);
507 ecore_x_selection_converter_atom_del(x_target); 507 ecore_x_selection_converter_atom_del(x_target);
508} /* ecore_x_selection_converter_del */ 508}
509 509
510EAPI Eina_Bool 510EAPI Eina_Bool
511ecore_x_selection_notify_send(Ecore_X_Window requestor, 511ecore_x_selection_notify_send(Ecore_X_Window requestor,
512 Ecore_X_Atom selection, 512 Ecore_X_Atom selection,
513 Ecore_X_Atom target, 513 Ecore_X_Atom target,
514 Ecore_X_Atom property, 514 Ecore_X_Atom property,
515 Ecore_X_Time tim) 515 Ecore_X_Time tim)
516{ 516{
517 XEvent xev; 517 XEvent xev;
518 XSelectionEvent xnotify; 518 XSelectionEvent xnotify;
@@ -530,16 +530,16 @@ ecore_x_selection_notify_send(Ecore_X_Window requestor,
530 530
531 xev.xselection = xnotify; 531 xev.xselection = xnotify;
532 return (XSendEvent(_ecore_x_disp, requestor, False, 0, &xev) > 0) ? EINA_TRUE : EINA_FALSE; 532 return (XSendEvent(_ecore_x_disp, requestor, False, 0, &xev) > 0) ? EINA_TRUE : EINA_FALSE;
533} /* ecore_x_selection_notify_send */ 533}
534 534
535/* Locate and run conversion callback for specified selection target */ 535/* Locate and run conversion callback for specified selection target */
536EAPI Eina_Bool 536EAPI Eina_Bool
537ecore_x_selection_convert(Ecore_X_Atom selection, 537ecore_x_selection_convert(Ecore_X_Atom selection,
538 Ecore_X_Atom target, 538 Ecore_X_Atom target,
539 void **data_ret, 539 void **data_ret,
540 int *size, 540 int *size,
541 Ecore_X_Atom *targtype, 541 Ecore_X_Atom *targtype,
542 int *typesize) 542 int *typesize)
543{ 543{
544 Ecore_X_Selection_Intern *sel; 544 Ecore_X_Selection_Intern *sel;
545 Ecore_X_Selection_Converter *cnv; 545 Ecore_X_Selection_Converter *cnv;
@@ -572,24 +572,24 @@ ecore_x_selection_convert(Ecore_X_Atom selection,
572 return EINA_FALSE; 572 return EINA_FALSE;
573 573
574 /* Default, just return the data 574 /* Default, just return the data
575 *data_ret = malloc(sel->length); 575 * data_ret = malloc(sel->length);
576 memcpy(*data_ret, sel->data, sel->length); 576 memcpy(*data_ret, sel->data, sel->length);
577 free(tgt_str); 577 free(tgt_str);
578 return 1; 578 return 1;
579 */ 579 */
580} /* ecore_x_selection_convert */ 580}
581 581
582/* TODO: We need to work out a mechanism for automatic conversion to any requested 582/* TODO: We need to work out a mechanism for automatic conversion to any requested
583 * locale using Ecore_Txt functions */ 583 * locale using Ecore_Txt functions */
584/* Converter for standard non-utf8 text targets */ 584/* Converter for standard non-utf8 text targets */
585static Eina_Bool 585static Eina_Bool
586_ecore_x_selection_converter_text(char *target, 586_ecore_x_selection_converter_text(char *target,
587 void *data, 587 void *data,
588 int size, 588 int size,
589 void **data_ret, 589 void **data_ret,
590 int *size_ret, 590 int *size_ret,
591 Ecore_X_Atom *targprop __UNUSED__, 591 Ecore_X_Atom *targprop __UNUSED__,
592 int *s __UNUSED__) 592 int *s __UNUSED__)
593{ 593{
594 XTextProperty text_prop; 594 XTextProperty text_prop;
595 char *mystr; 595 char *mystr;
@@ -651,7 +651,7 @@ _ecore_x_selection_converter_text(char *target,
651 { 651 {
652 return EINA_TRUE; 652 return EINA_TRUE;
653 } 653 }
654} /* _ecore_x_selection_converter_text */ 654}
655 655
656EAPI void 656EAPI void
657ecore_x_selection_parser_add(const char *target, 657ecore_x_selection_parser_add(const char *target,
@@ -692,7 +692,7 @@ ecore_x_selection_parser_add(const char *target,
692 692
693 prs->target = strdup(target); 693 prs->target = strdup(target);
694 prs->parse = func; 694 prs->parse = func;
695} /* ecore_x_selection_parser_add */ 695}
696 696
697EAPI void 697EAPI void
698ecore_x_selection_parser_del(const char *target) 698ecore_x_selection_parser_del(const char *target)
@@ -726,19 +726,19 @@ ecore_x_selection_parser_del(const char *target)
726 prev_prs = prs; 726 prev_prs = prs;
727 prs = prs->next; 727 prs = prs->next;
728 } 728 }
729} /* ecore_x_selection_parser_del */ 729}
730 730
731/** 731/**
732 * Change the owner and last-change time for the specified selection. 732 * Change the owner and last-change time for the specified selection.
733 * @param win The owner of the specified atom. 733 * @param win The owner of the specified atom.
734 * @param atom The selection atom 734 * @param atom The selection atom
735 * @param time Specifies the time 735 * @param tim Specifies the time
736 * @since 1.1.0 736 * @since 1.1.0
737 */ 737 */
738EAPI void 738EAPI void
739ecore_x_selection_owner_set(Ecore_X_Window win, 739ecore_x_selection_owner_set(Ecore_X_Window win,
740 Ecore_X_Atom atom, 740 Ecore_X_Atom atom,
741 Ecore_X_Time tim) 741 Ecore_X_Time tim)
742{ 742{
743 XSetSelectionOwner(_ecore_x_disp, atom, win, tim); 743 XSetSelectionOwner(_ecore_x_disp, atom, win, tim);
744} 744}
@@ -760,9 +760,9 @@ ecore_x_selection_owner_get(Ecore_X_Atom atom)
760/* Locate and run conversion callback for specified selection target */ 760/* Locate and run conversion callback for specified selection target */
761void * 761void *
762_ecore_x_selection_parse(const char *target, 762_ecore_x_selection_parse(const char *target,
763 void *data, 763 void *data,
764 int size, 764 int size,
765 int format) 765 int format)
766{ 766{
767 Ecore_X_Selection_Parser *prs; 767 Ecore_X_Selection_Parser *prs;
768 Ecore_X_Selection_Data *sel; 768 Ecore_X_Selection_Data *sel;
@@ -784,7 +784,7 @@ _ecore_x_selection_parse(const char *target,
784 sel->format = format; 784 sel->format = format;
785 sel->data = data; 785 sel->data = data;
786 return sel; 786 return sel;
787} /* _ecore_x_selection_parse */ 787}
788 788
789static int 789static int
790_ecore_x_selection_data_default_free(void *data) 790_ecore_x_selection_data_default_free(void *data)
@@ -795,13 +795,13 @@ _ecore_x_selection_data_default_free(void *data)
795 free(sel->data); 795 free(sel->data);
796 free(sel); 796 free(sel);
797 return 1; 797 return 1;
798} /* _ecore_x_selection_data_default_free */ 798}
799 799
800static void * 800static void *
801_ecore_x_selection_parser_files(const char *target, 801_ecore_x_selection_parser_files(const char *target,
802 void *_data, 802 void *_data,
803 int size, 803 int size,
804 int format __UNUSED__) 804 int format __UNUSED__)
805{ 805{
806 Ecore_X_Selection_Data_Files *sel; 806 Ecore_X_Selection_Data_Files *sel;
807 char *t, *data = _data; 807 char *t, *data = _data;
@@ -820,15 +820,15 @@ _ecore_x_selection_parser_files(const char *target,
820 if (data[size - 1]) 820 if (data[size - 1])
821 { 821 {
822 /* Isn't nul terminated */ 822 /* Isn't nul terminated */
823 size++; 823 size++;
824 t = realloc(data, size); 824 t = realloc(data, size);
825 if (!t) 825 if (!t)
826 { 826 {
827 free(sel); 827 free(sel);
828 return NULL; 828 return NULL;
829 } 829 }
830 data = t; 830 data = t;
831 data[size - 1] = 0; 831 data[size - 1] = 0;
832 } 832 }
833 833
834 tmp = malloc(size); 834 tmp = malloc(size);
@@ -850,7 +850,8 @@ _ecore_x_selection_parser_files(const char *target,
850 tmp[i++] = data[is++]; 850 tmp[i++] = data[is++];
851 else 851 else
852 { 852 {
853 while ((data[is] == '\r') || (data[is] == '\n')) is++; 853 while ((data[is] == '\r') || (data[is] == '\n'))
854 is++;
854 tmp[i] = 0; 855 tmp[i] = 0;
855 sel->num_files++; 856 sel->num_files++;
856 t2 = realloc(sel->files, sel->num_files * sizeof(char *)); 857 t2 = realloc(sel->files, sel->num_files * sizeof(char *));
@@ -883,7 +884,7 @@ _ecore_x_selection_parser_files(const char *target,
883 ECORE_X_SELECTION_DATA(sel)->length = sel->num_files; 884 ECORE_X_SELECTION_DATA(sel)->length = sel->num_files;
884 885
885 return ECORE_X_SELECTION_DATA(sel); 886 return ECORE_X_SELECTION_DATA(sel);
886} /* _ecore_x_selection_parser_files */ 887}
887 888
888static int 889static int
889_ecore_x_selection_data_files_free(void *data) 890_ecore_x_selection_data_files_free(void *data)
@@ -901,13 +902,13 @@ _ecore_x_selection_data_files_free(void *data)
901 902
902 free(sel); 903 free(sel);
903 return 0; 904 return 0;
904} /* _ecore_x_selection_data_files_free */ 905}
905 906
906static void * 907static void *
907_ecore_x_selection_parser_text(const char *target __UNUSED__, 908_ecore_x_selection_parser_text(const char *target __UNUSED__,
908 void *_data, 909 void *_data,
909 int size, 910 int size,
910 int format __UNUSED__) 911 int format __UNUSED__)
911{ 912{
912 Ecore_X_Selection_Data_Text *sel; 913 Ecore_X_Selection_Data_Text *sel;
913 unsigned char *data = _data; 914 unsigned char *data = _data;
@@ -918,15 +919,15 @@ _ecore_x_selection_parser_text(const char *target __UNUSED__,
918 if (data[size - 1]) 919 if (data[size - 1])
919 { 920 {
920 /* Isn't nul terminated */ 921 /* Isn't nul terminated */
921 size++; 922 size++;
922 t = realloc(data, size); 923 t = realloc(data, size);
923 if (!t) 924 if (!t)
924 { 925 {
925 free(sel); 926 free(sel);
926 return NULL; 927 return NULL;
927 } 928 }
928 data = t; 929 data = t;
929 data[size - 1] = 0; 930 data[size - 1] = 0;
930 } 931 }
931 932
932 sel->text = (char *)data; 933 sel->text = (char *)data;
@@ -935,7 +936,7 @@ _ecore_x_selection_parser_text(const char *target __UNUSED__,
935 ECORE_X_SELECTION_DATA(sel)->data = data; 936 ECORE_X_SELECTION_DATA(sel)->data = data;
936 ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_text_free; 937 ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_text_free;
937 return sel; 938 return sel;
938} /* _ecore_x_selection_parser_text */ 939}
939 940
940static int 941static int
941_ecore_x_selection_data_text_free(void *data) 942_ecore_x_selection_data_text_free(void *data)
@@ -946,13 +947,13 @@ _ecore_x_selection_data_text_free(void *data)
946 free(sel->text); 947 free(sel->text);
947 free(sel); 948 free(sel);
948 return 1; 949 return 1;
949} /* _ecore_x_selection_data_text_free */ 950}
950 951
951static void * 952static void *
952_ecore_x_selection_parser_targets(const char *target __UNUSED__, 953_ecore_x_selection_parser_targets(const char *target __UNUSED__,
953 void *data, 954 void *data,
954 int size, 955 int size,
955 int format __UNUSED__) 956 int format __UNUSED__)
956{ 957{
957 Ecore_X_Selection_Data_Targets *sel; 958 Ecore_X_Selection_Data_Targets *sel;
958 unsigned long *targets; 959 unsigned long *targets;
@@ -977,7 +978,7 @@ _ecore_x_selection_parser_targets(const char *target __UNUSED__,
977 ECORE_X_SELECTION_DATA(sel)->length = size; 978 ECORE_X_SELECTION_DATA(sel)->length = size;
978 ECORE_X_SELECTION_DATA(sel)->data = data; 979 ECORE_X_SELECTION_DATA(sel)->data = data;
979 return sel; 980 return sel;
980} /* _ecore_x_selection_parser_targets */ 981}
981 982
982static int 983static int
983_ecore_x_selection_data_targets_free(void *data) 984_ecore_x_selection_data_targets_free(void *data)
@@ -997,5 +998,5 @@ _ecore_x_selection_data_targets_free(void *data)
997 free(ECORE_X_SELECTION_DATA(sel)->data); 998 free(ECORE_X_SELECTION_DATA(sel)->data);
998 free(sel); 999 free(sel);
999 return 1; 1000 return 1;
1000} /* _ecore_x_selection_data_targets_free */ 1001}
1001 1002
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
index e49fede..0c7f546 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
@@ -42,18 +42,18 @@ ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter)
42 42
43 ecore_x_sync(); 43 ecore_x_sync();
44 return alarm; 44 return alarm;
45} /* ecore_x_sync_alarm_new */ 45}
46 46
47EAPI Eina_Bool 47EAPI Eina_Bool
48ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm) 48ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm)
49{ 49{
50 LOGFN(__FILE__, __LINE__, __FUNCTION__); 50 LOGFN(__FILE__, __LINE__, __FUNCTION__);
51 return XSyncDestroyAlarm(_ecore_x_disp, alarm); 51 return XSyncDestroyAlarm(_ecore_x_disp, alarm);
52} /* ecore_x_sync_alarm_free */ 52}
53 53
54EAPI Eina_Bool 54EAPI Eina_Bool
55ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter, 55ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter,
56 unsigned int *val) 56 unsigned int *val)
57{ 57{
58 XSyncValue value; 58 XSyncValue value;
59 59
@@ -65,7 +65,7 @@ ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter,
65 } 65 }
66 66
67 return EINA_FALSE; 67 return EINA_FALSE;
68} /* ecore_x_sync_counter_query */ 68}
69 69
70EAPI Ecore_X_Sync_Counter 70EAPI Ecore_X_Sync_Counter
71ecore_x_sync_counter_new(int val) 71ecore_x_sync_counter_new(int val)
@@ -77,29 +77,29 @@ ecore_x_sync_counter_new(int val)
77 XSyncIntToValue(&v, val); 77 XSyncIntToValue(&v, val);
78 counter = XSyncCreateCounter(_ecore_x_disp, v); 78 counter = XSyncCreateCounter(_ecore_x_disp, v);
79 return counter; 79 return counter;
80} /* ecore_x_sync_counter_new */ 80}
81 81
82EAPI void 82EAPI void
83ecore_x_sync_counter_free(Ecore_X_Sync_Counter counter) 83ecore_x_sync_counter_free(Ecore_X_Sync_Counter counter)
84{ 84{
85 LOGFN(__FILE__, __LINE__, __FUNCTION__); 85 LOGFN(__FILE__, __LINE__, __FUNCTION__);
86 XSyncDestroyCounter(_ecore_x_disp, counter); 86 XSyncDestroyCounter(_ecore_x_disp, counter);
87} /* ecore_x_sync_counter_free */ 87}
88 88
89EAPI void 89EAPI void
90ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter, 90ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter,
91 int by) 91 int by)
92{ 92{
93 XSyncValue v; 93 XSyncValue v;
94 94
95 LOGFN(__FILE__, __LINE__, __FUNCTION__); 95 LOGFN(__FILE__, __LINE__, __FUNCTION__);
96 XSyncIntToValue(&v, by); 96 XSyncIntToValue(&v, by);
97 XSyncChangeCounter(_ecore_x_disp, counter, v); 97 XSyncChangeCounter(_ecore_x_disp, counter, v);
98} /* ecore_x_sync_counter_inc */ 98}
99 99
100EAPI void 100EAPI void
101ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter, 101ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter,
102 int val) 102 int val)
103{ 103{
104 XSyncWaitCondition cond; 104 XSyncWaitCondition cond;
105 XSyncValue v, v2; 105 XSyncValue v, v2;
@@ -115,11 +115,11 @@ ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter,
115 cond.event_threshold = v2; 115 cond.event_threshold = v2;
116 XSyncAwait(_ecore_x_disp, &cond, 1); 116 XSyncAwait(_ecore_x_disp, &cond, 1);
117// XSync(_ecore_x_disp, False); // dont need this 117// XSync(_ecore_x_disp, False); // dont need this
118} /* ecore_x_sync_counter_val_wait */ 118}
119 119
120EAPI void 120EAPI void
121ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter, 121ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter,
122 int val) 122 int val)
123{ 123{
124 XSyncValue v; 124 XSyncValue v;
125 125
@@ -130,8 +130,8 @@ ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter,
130 130
131EAPI void 131EAPI void
132ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter, 132ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter,
133 int val_hi, 133 int val_hi,
134 unsigned int val_lo) 134 unsigned int val_lo)
135{ 135{
136 XSyncValue v; 136 XSyncValue v;
137 137
@@ -142,8 +142,8 @@ ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter,
142 142
143EAPI Eina_Bool 143EAPI Eina_Bool
144ecore_x_sync_counter_2_query(Ecore_X_Sync_Counter counter, 144ecore_x_sync_counter_2_query(Ecore_X_Sync_Counter counter,
145 int *val_hi, 145 int *val_hi,
146 unsigned int *val_lo) 146 unsigned int *val_lo)
147{ 147{
148 XSyncValue value; 148 XSyncValue value;
149 149
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_test.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
index c4576f9..c8c04e4 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
@@ -42,7 +42,7 @@ ecore_x_test_fake_key_down(const char *key __UNUSED__)
42#else /* ifdef ECORE_XTEST */ 42#else /* ifdef ECORE_XTEST */
43 return EINA_FALSE; 43 return EINA_FALSE;
44#endif /* ifdef ECORE_XTEST */ 44#endif /* ifdef ECORE_XTEST */
45} /* ecore_x_test_fake_key_down */ 45}
46 46
47EAPI Eina_Bool 47EAPI Eina_Bool
48#ifdef ECORE_XTEST 48#ifdef ECORE_XTEST
@@ -74,7 +74,7 @@ ecore_x_test_fake_key_up(const char *key __UNUSED__)
74#else /* ifdef ECORE_XTEST */ 74#else /* ifdef ECORE_XTEST */
75 return EINA_FALSE; 75 return EINA_FALSE;
76#endif /* ifdef ECORE_XTEST */ 76#endif /* ifdef ECORE_XTEST */
77} /* ecore_x_test_fake_key_up */ 77}
78 78
79EAPI Eina_Bool 79EAPI Eina_Bool
80#ifdef ECORE_XTEST 80#ifdef ECORE_XTEST
@@ -145,11 +145,11 @@ ecore_x_test_fake_key_press(const char *key __UNUSED__)
145#else /* ifdef ECORE_XTEST */ 145#else /* ifdef ECORE_XTEST */
146 return EINA_FALSE; 146 return EINA_FALSE;
147#endif /* ifdef ECORE_XTEST */ 147#endif /* ifdef ECORE_XTEST */
148} /* ecore_x_test_fake_key_press */ 148}
149 149
150EAPI const char * 150EAPI const char *
151ecore_x_keysym_string_get(int keysym) 151ecore_x_keysym_string_get(int keysym)
152{ 152{
153 return XKeysymToString(keysym); 153 return XKeysymToString(keysym);
154} /* ecore_x_keysym_string_get */ 154}
155 155
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
index f054298..4296bb2 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -61,40 +61,40 @@ typedef union _drmVBlank
61typedef struct _drmEventContext 61typedef struct _drmEventContext
62{ 62{
63 int version; 63 int version;
64 void (*vblank_handler)(int fd, 64 void (*vblank_handler)(int fd,
65 unsigned int sequence, 65 unsigned int sequence,
66 unsigned int tv_sec, 66 unsigned int tv_sec,
67 unsigned int tv_usec, 67 unsigned int tv_usec,
68 void *user_data); 68 void *user_data);
69 void (*page_flip_handler)(int fd, 69 void (*page_flip_handler)(int fd,
70 unsigned int sequence, 70 unsigned int sequence,
71 unsigned int tv_sec, 71 unsigned int tv_sec,
72 unsigned int tv_usec, 72 unsigned int tv_usec,
73 void *user_data); 73 void *user_data);
74} drmEventContext; 74} drmEventContext;
75 75
76static int (*sym_drmClose)(int fd) = NULL; 76static int (*sym_drmClose)(int fd) = NULL;
77static int (*sym_drmGetMagic)(int fd, 77static int (*sym_drmGetMagic)(int fd,
78 drm_magic_t *magic) = NULL; 78 drm_magic_t *magic) = NULL;
79static int (*sym_drmWaitVBlank)(int fd, 79static int (*sym_drmWaitVBlank)(int fd,
80 drmVBlank *vbl) = NULL; 80 drmVBlank *vbl) = NULL;
81static int (*sym_drmHandleEvent)(int fd, 81static int (*sym_drmHandleEvent)(int fd,
82 drmEventContext *evctx) = NULL; 82 drmEventContext *evctx) = NULL;
83 83
84//// dri 84//// dri
85 85
86static Bool (*sym_DRI2QueryExtension)(Display *display, 86static Bool (*sym_DRI2QueryExtension)(Display *display,
87 int *eventBase, 87 int *eventBase,
88 int *errorBase) = NULL; 88 int *errorBase) = NULL;
89static Bool (*sym_DRI2QueryVersion)(Display *display, 89static Bool (*sym_DRI2QueryVersion)(Display *display,
90 int *major, 90 int *major,
91 int *minor) = NULL; 91 int *minor) = NULL;
92static Bool (*sym_DRI2Connect)(Display *display, 92static Bool (*sym_DRI2Connect)(Display *display,
93 XID window, 93 XID window,
94 char **driverName, 94 char **driverName,
95 char **deviceName) = NULL; 95 char **deviceName) = NULL;
96static Bool (*sym_DRI2Authenticate)(Display *display, 96static Bool (*sym_DRI2Authenticate)(Display *display,
97 XID window, 97 XID window,
98 drm_magic_t magic) = NULL; 98 drm_magic_t magic) = NULL;
99 99
100//// dri/drm data needed 100//// dri/drm data needed
@@ -142,18 +142,18 @@ _dri_drm_tick_end(void *data __UNUSED__)
142} 142}
143 143
144static void 144static void
145_dri_drm_vblank_handler(int fd __UNUSED__, 145_dri_drm_vblank_handler(int fd __UNUSED__,
146 unsigned int frame __UNUSED__, 146 unsigned int frame __UNUSED__,
147 unsigned int sec __UNUSED__, 147 unsigned int sec __UNUSED__,
148 unsigned int usec __UNUSED__, 148 unsigned int usec __UNUSED__,
149 void *data __UNUSED__) 149 void *data __UNUSED__)
150{ 150{
151 ecore_animator_custom_tick(); 151 ecore_animator_custom_tick();
152 if (drm_event_is_busy) _dri_drm_tick_schedule(); 152 if (drm_event_is_busy) _dri_drm_tick_schedule();
153} 153}
154 154
155static Eina_Bool 155static Eina_Bool
156_dri_drm_cb(void *data __UNUSED__, 156_dri_drm_cb(void *data __UNUSED__,
157 Ecore_Fd_Handler *fd_handler __UNUSED__) 157 Ecore_Fd_Handler *fd_handler __UNUSED__)
158{ 158{
159 sym_drmHandleEvent(drm_fd, &drm_evctx); 159 sym_drmHandleEvent(drm_fd, &drm_evctx);
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
index 76670d3..1adb36b 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
@@ -33,10 +33,10 @@ static Ecore_X_Window *ignore_list = NULL;
33 */ 33 */
34EAPI Ecore_X_Window 34EAPI Ecore_X_Window
35ecore_x_window_new(Ecore_X_Window parent, 35ecore_x_window_new(Ecore_X_Window parent,
36 int x, 36 int x,
37 int y, 37 int y,
38 int w, 38 int w,
39 int h) 39 int h)
40{ 40{
41 Window win; 41 Window win;
42 XSetWindowAttributes attr; 42 XSetWindowAttributes attr;
@@ -87,7 +87,7 @@ ecore_x_window_new(Ecore_X_Window parent,
87 ecore_x_window_defaults_set(win); 87 ecore_x_window_defaults_set(win);
88 88
89 return win; 89 return win;
90} /* ecore_x_window_new */ 90}
91 91
92/** 92/**
93 * Creates a window with the override redirect attribute set to @c True. 93 * Creates a window with the override redirect attribute set to @c True.
@@ -102,10 +102,10 @@ ecore_x_window_new(Ecore_X_Window parent,
102 */ 102 */
103EAPI Ecore_X_Window 103EAPI Ecore_X_Window
104ecore_x_window_override_new(Ecore_X_Window parent, 104ecore_x_window_override_new(Ecore_X_Window parent,
105 int x, 105 int x,
106 int y, 106 int y,
107 int w, 107 int w,
108 int h) 108 int h)
109{ 109{
110 Window win; 110 Window win;
111 XSetWindowAttributes attr; 111 XSetWindowAttributes attr;
@@ -152,7 +152,7 @@ ecore_x_window_override_new(Ecore_X_Window parent,
152 CWWinGravity, 152 CWWinGravity,
153 &attr); 153 &attr);
154 return win; 154 return win;
155} /* ecore_x_window_override_new */ 155}
156 156
157/** 157/**
158 * Creates a new input window. 158 * Creates a new input window.
@@ -167,10 +167,10 @@ ecore_x_window_override_new(Ecore_X_Window parent,
167 */ 167 */
168EAPI Ecore_X_Window 168EAPI Ecore_X_Window
169ecore_x_window_input_new(Ecore_X_Window parent, 169ecore_x_window_input_new(Ecore_X_Window parent,
170 int x, 170 int x,
171 int y, 171 int y,
172 int w, 172 int w,
173 int h) 173 int h)
174{ 174{
175 Window win; 175 Window win;
176 XSetWindowAttributes attr; 176 XSetWindowAttributes attr;
@@ -209,7 +209,7 @@ ecore_x_window_input_new(Ecore_X_Window parent,
209 } 209 }
210 210
211 return win; 211 return win;
212} /* ecore_x_window_input_new */ 212}
213 213
214/** 214/**
215 * @defgroup Ecore_X_Window_Properties_Group X Window Property Functions 215 * @defgroup Ecore_X_Window_Properties_Group X Window Property Functions
@@ -263,18 +263,18 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
263 263
264 ecore_app_args_get(&argc, &argv); 264 ecore_app_args_get(&argc, &argv);
265 ecore_x_icccm_command_set(win, argc, argv); 265 ecore_x_icccm_command_set(win, argc, argv);
266} /* ecore_x_window_defaults_set */ 266}
267 267
268EAPI void 268EAPI void
269ecore_x_window_configure(Ecore_X_Window win, 269ecore_x_window_configure(Ecore_X_Window win,
270 Ecore_X_Window_Configure_Mask mask, 270 Ecore_X_Window_Configure_Mask mask,
271 int x, 271 int x,
272 int y, 272 int y,
273 int w, 273 int w,
274 int h, 274 int h,
275 int border_width, 275 int border_width,
276 Ecore_X_Window sibling, 276 Ecore_X_Window sibling,
277 int stack_mode) 277 int stack_mode)
278{ 278{
279 XWindowChanges xwc; 279 XWindowChanges xwc;
280 280
@@ -292,7 +292,7 @@ ecore_x_window_configure(Ecore_X_Window win,
292 xwc.stack_mode = stack_mode; 292 xwc.stack_mode = stack_mode;
293 293
294 XConfigureWindow(_ecore_x_disp, win, mask, &xwc); 294 XConfigureWindow(_ecore_x_disp, win, mask, &xwc);
295} /* ecore_x_window_configure */ 295}
296 296
297/** 297/**
298 * @defgroup Ecore_X_Window_Destroy_Group X Window Destroy Functions 298 * @defgroup Ecore_X_Window_Destroy_Group X Window Destroy Functions
@@ -311,10 +311,10 @@ ecore_x_window_free(Ecore_X_Window win)
311 /* sorry sir, deleting the root window doesn't sound like 311 /* sorry sir, deleting the root window doesn't sound like
312 * a smart idea. 312 * a smart idea.
313 */ 313 */
314 LOGFN(__FILE__, __LINE__, __FUNCTION__); 314 LOGFN(__FILE__, __LINE__, __FUNCTION__);
315 if (win) 315 if (win)
316 XDestroyWindow(_ecore_x_disp, win); 316 XDestroyWindow(_ecore_x_disp, win);
317} /* ecore_x_window_free */ 317}
318 318
319/** 319/**
320 * Set if a window should be ignored. 320 * Set if a window should be ignored.
@@ -323,7 +323,7 @@ ecore_x_window_free(Ecore_X_Window win)
323 */ 323 */
324EAPI void 324EAPI void
325ecore_x_window_ignore_set(Ecore_X_Window win, 325ecore_x_window_ignore_set(Ecore_X_Window win,
326 int ignore) 326 int ignore)
327{ 327{
328 int i, j, cnt; 328 int i, j, cnt;
329 Ecore_X_Window *t; 329 Ecore_X_Window *t;
@@ -373,7 +373,7 @@ ecore_x_window_ignore_set(Ecore_X_Window win,
373 t = realloc(ignore_list, ignore_num * sizeof(Ecore_X_Window)); 373 t = realloc(ignore_list, ignore_num * sizeof(Ecore_X_Window));
374 if (t) ignore_list = t; 374 if (t) ignore_list = t;
375 } 375 }
376} /* ecore_x_window_ignore_set */ 376}
377 377
378/** 378/**
379 * Get the ignore list 379 * Get the ignore list
@@ -387,7 +387,7 @@ ecore_x_window_ignore_list(int *num)
387 *num = ignore_num; 387 *num = ignore_num;
388 388
389 return ignore_list; 389 return ignore_list;
390} /* ecore_x_window_ignore_list */ 390}
391 391
392/** 392/**
393 * Sends a delete request to the given window. 393 * Sends a delete request to the given window.
@@ -415,7 +415,7 @@ ecore_x_window_delete_request_send(Ecore_X_Window win)
415 xev.xclient.data.l[1] = CurrentTime; 415 xev.xclient.data.l[1] = CurrentTime;
416 416
417 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 417 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
418} /* ecore_x_window_delete_request_send */ 418}
419 419
420/** 420/**
421 * @defgroup Ecore_X_Window_Visibility_Group X Window Visibility Functions 421 * @defgroup Ecore_X_Window_Visibility_Group X Window Visibility Functions
@@ -436,7 +436,7 @@ ecore_x_window_show(Ecore_X_Window win)
436{ 436{
437 LOGFN(__FILE__, __LINE__, __FUNCTION__); 437 LOGFN(__FILE__, __LINE__, __FUNCTION__);
438 XMapWindow(_ecore_x_disp, win); 438 XMapWindow(_ecore_x_disp, win);
439} /* ecore_x_window_show */ 439}
440 440
441/** 441/**
442 * Hides a window. 442 * Hides a window.
@@ -480,7 +480,7 @@ ecore_x_window_hide(Ecore_X_Window win)
480 XSendEvent(_ecore_x_disp, xev.xunmap.event, False, 480 XSendEvent(_ecore_x_disp, xev.xunmap.event, False,
481 SubstructureRedirectMask | SubstructureNotifyMask, &xev); 481 SubstructureRedirectMask | SubstructureNotifyMask, &xev);
482 XUnmapWindow(_ecore_x_disp, win); 482 XUnmapWindow(_ecore_x_disp, win);
483} /* ecore_x_window_hide */ 483}
484 484
485/** 485/**
486 * @defgroup Ecore_X_Window_Geometry_Group X Window Geometry Functions 486 * @defgroup Ecore_X_Window_Geometry_Group X Window Geometry Functions
@@ -501,12 +501,12 @@ ecore_x_window_hide(Ecore_X_Window win)
501 */ 501 */
502EAPI void 502EAPI void
503ecore_x_window_move(Ecore_X_Window win, 503ecore_x_window_move(Ecore_X_Window win,
504 int x, 504 int x,
505 int y) 505 int y)
506{ 506{
507 LOGFN(__FILE__, __LINE__, __FUNCTION__); 507 LOGFN(__FILE__, __LINE__, __FUNCTION__);
508 XMoveWindow(_ecore_x_disp, win, x, y); 508 XMoveWindow(_ecore_x_disp, win, x, y);
509} /* ecore_x_window_move */ 509}
510 510
511/** 511/**
512 * Resizes a window. 512 * Resizes a window.
@@ -517,8 +517,8 @@ ecore_x_window_move(Ecore_X_Window win,
517 */ 517 */
518EAPI void 518EAPI void
519ecore_x_window_resize(Ecore_X_Window win, 519ecore_x_window_resize(Ecore_X_Window win,
520 int w, 520 int w,
521 int h) 521 int h)
522{ 522{
523 LOGFN(__FILE__, __LINE__, __FUNCTION__); 523 LOGFN(__FILE__, __LINE__, __FUNCTION__);
524 if (w < 1) 524 if (w < 1)
@@ -528,7 +528,7 @@ ecore_x_window_resize(Ecore_X_Window win,
528 h = 1; 528 h = 1;
529 529
530 XResizeWindow(_ecore_x_disp, win, w, h); 530 XResizeWindow(_ecore_x_disp, win, w, h);
531} /* ecore_x_window_resize */ 531}
532 532
533/** 533/**
534 * Moves and resizes a window. 534 * Moves and resizes a window.
@@ -541,10 +541,10 @@ ecore_x_window_resize(Ecore_X_Window win,
541 */ 541 */
542EAPI void 542EAPI void
543ecore_x_window_move_resize(Ecore_X_Window win, 543ecore_x_window_move_resize(Ecore_X_Window win,
544 int x, 544 int x,
545 int y, 545 int y,
546 int w, 546 int w,
547 int h) 547 int h)
548{ 548{
549 LOGFN(__FILE__, __LINE__, __FUNCTION__); 549 LOGFN(__FILE__, __LINE__, __FUNCTION__);
550 if (w < 1) 550 if (w < 1)
@@ -554,7 +554,7 @@ ecore_x_window_move_resize(Ecore_X_Window win,
554 h = 1; 554 h = 1;
555 555
556 XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h); 556 XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h);
557} /* ecore_x_window_move_resize */ 557}
558 558
559/** 559/**
560 * @defgroup Ecore_X_Window_Focus_Functions X Window Focus Functions 560 * @defgroup Ecore_X_Window_Focus_Functions X Window Focus Functions
@@ -576,7 +576,7 @@ ecore_x_window_focus(Ecore_X_Window win)
576 576
577// XSetInputFocus(_ecore_x_disp, win, RevertToPointerRoot, CurrentTime); 577// XSetInputFocus(_ecore_x_disp, win, RevertToPointerRoot, CurrentTime);
578 XSetInputFocus(_ecore_x_disp, win, RevertToParent, CurrentTime); 578 XSetInputFocus(_ecore_x_disp, win, RevertToParent, CurrentTime);
579} /* ecore_x_window_focus */ 579}
580 580
581/** 581/**
582 * Sets the focus to the given window at a specific time. 582 * Sets the focus to the given window at a specific time.
@@ -586,7 +586,7 @@ ecore_x_window_focus(Ecore_X_Window win)
586 */ 586 */
587EAPI void 587EAPI void
588ecore_x_window_focus_at_time(Ecore_X_Window win, 588ecore_x_window_focus_at_time(Ecore_X_Window win,
589 Ecore_X_Time t) 589 Ecore_X_Time t)
590{ 590{
591 LOGFN(__FILE__, __LINE__, __FUNCTION__); 591 LOGFN(__FILE__, __LINE__, __FUNCTION__);
592 if (win == 0) 592 if (win == 0)
@@ -594,7 +594,7 @@ ecore_x_window_focus_at_time(Ecore_X_Window win,
594 594
595// XSetInputFocus(_ecore_x_disp, win, PointerRoot, t); 595// XSetInputFocus(_ecore_x_disp, win, PointerRoot, t);
596 XSetInputFocus(_ecore_x_disp, win, RevertToParent, t); 596 XSetInputFocus(_ecore_x_disp, win, RevertToParent, t);
597} /* ecore_x_window_focus_at_time */ 597}
598 598
599/** 599/**
600 * gets the focus to the window @p win. 600 * gets the focus to the window @p win.
@@ -611,7 +611,7 @@ ecore_x_window_focus_get(void)
611 win = 0; 611 win = 0;
612 XGetInputFocus(_ecore_x_disp, &win, &revert_mode); 612 XGetInputFocus(_ecore_x_disp, &win, &revert_mode);
613 return win; 613 return win;
614} /* ecore_x_window_focus_get */ 614}
615 615
616/** 616/**
617 * @defgroup Ecore_X_Window_Z_Order_Group X Window Z Order Functions 617 * @defgroup Ecore_X_Window_Z_Order_Group X Window Z Order Functions
@@ -629,7 +629,7 @@ ecore_x_window_raise(Ecore_X_Window win)
629{ 629{
630 LOGFN(__FILE__, __LINE__, __FUNCTION__); 630 LOGFN(__FILE__, __LINE__, __FUNCTION__);
631 XRaiseWindow(_ecore_x_disp, win); 631 XRaiseWindow(_ecore_x_disp, win);
632} /* ecore_x_window_raise */ 632}
633 633
634/** 634/**
635 * Lowers the given window. 635 * Lowers the given window.
@@ -641,7 +641,7 @@ ecore_x_window_lower(Ecore_X_Window win)
641{ 641{
642 LOGFN(__FILE__, __LINE__, __FUNCTION__); 642 LOGFN(__FILE__, __LINE__, __FUNCTION__);
643 XLowerWindow(_ecore_x_disp, win); 643 XLowerWindow(_ecore_x_disp, win);
644} /* ecore_x_window_lower */ 644}
645 645
646/** 646/**
647 * @defgroup Ecore_X_Window_Parent_Group X Window Parent Functions 647 * @defgroup Ecore_X_Window_Parent_Group X Window Parent Functions
@@ -660,15 +660,15 @@ ecore_x_window_lower(Ecore_X_Window win)
660EAPI void 660EAPI void
661ecore_x_window_reparent(Ecore_X_Window win, 661ecore_x_window_reparent(Ecore_X_Window win,
662 Ecore_X_Window new_parent, 662 Ecore_X_Window new_parent,
663 int x, 663 int x,
664 int y) 664 int y)
665{ 665{
666 LOGFN(__FILE__, __LINE__, __FUNCTION__); 666 LOGFN(__FILE__, __LINE__, __FUNCTION__);
667 if (new_parent == 0) 667 if (new_parent == 0)
668 new_parent = DefaultRootWindow(_ecore_x_disp); 668 new_parent = DefaultRootWindow(_ecore_x_disp);
669 669
670 XReparentWindow(_ecore_x_disp, win, new_parent, x, y); 670 XReparentWindow(_ecore_x_disp, win, new_parent, x, y);
671} /* ecore_x_window_reparent */ 671}
672 672
673/** 673/**
674 * Retrieves the size of the given window. 674 * Retrieves the size of the given window.
@@ -679,8 +679,8 @@ ecore_x_window_reparent(Ecore_X_Window win,
679 */ 679 */
680EAPI void 680EAPI void
681ecore_x_window_size_get(Ecore_X_Window win, 681ecore_x_window_size_get(Ecore_X_Window win,
682 int *w, 682 int *w,
683 int *h) 683 int *h)
684{ 684{
685 int dummy_x, dummy_y; 685 int dummy_x, dummy_y;
686 686
@@ -689,7 +689,7 @@ ecore_x_window_size_get(Ecore_X_Window win,
689 win = DefaultRootWindow(_ecore_x_disp); 689 win = DefaultRootWindow(_ecore_x_disp);
690 690
691 ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h); 691 ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h);
692} /* ecore_x_window_size_get */ 692}
693 693
694/** 694/**
695 * Retrieves the geometry of the given window. 695 * Retrieves the geometry of the given window.
@@ -709,17 +709,17 @@ ecore_x_window_size_get(Ecore_X_Window win,
709 */ 709 */
710EAPI void 710EAPI void
711ecore_x_window_geometry_get(Ecore_X_Window win, 711ecore_x_window_geometry_get(Ecore_X_Window win,
712 int *x, 712 int *x,
713 int *y, 713 int *y,
714 int *w, 714 int *w,
715 int *h) 715 int *h)
716{ 716{
717 LOGFN(__FILE__, __LINE__, __FUNCTION__); 717 LOGFN(__FILE__, __LINE__, __FUNCTION__);
718 if (!win) 718 if (!win)
719 win = DefaultRootWindow(_ecore_x_disp); 719 win = DefaultRootWindow(_ecore_x_disp);
720 720
721 ecore_x_drawable_geometry_get(win, x, y, w, h); 721 ecore_x_drawable_geometry_get(win, x, y, w, h);
722} /* ecore_x_window_geometry_get */ 722}
723 723
724/** 724/**
725 * Retrieves the width of the border of the given window. 725 * Retrieves the width of the border of the given window.
@@ -736,7 +736,7 @@ ecore_x_window_border_width_get(Ecore_X_Window win)
736 return 0; 736 return 0;
737 737
738 return ecore_x_drawable_border_width_get(win); 738 return ecore_x_drawable_border_width_get(win);
739} /* ecore_x_window_border_width_get */ 739}
740 740
741/** 741/**
742 * Sets the width of the border of the given window. 742 * Sets the width of the border of the given window.
@@ -746,7 +746,7 @@ ecore_x_window_border_width_get(Ecore_X_Window win)
746 */ 746 */
747EAPI void 747EAPI void
748ecore_x_window_border_width_set(Ecore_X_Window win, 748ecore_x_window_border_width_set(Ecore_X_Window win,
749 int width) 749 int width)
750{ 750{
751 LOGFN(__FILE__, __LINE__, __FUNCTION__); 751 LOGFN(__FILE__, __LINE__, __FUNCTION__);
752 /* doesn't make sense to call this on a root window */ 752 /* doesn't make sense to call this on a root window */
@@ -754,7 +754,7 @@ ecore_x_window_border_width_set(Ecore_X_Window win,
754 return; 754 return;
755 755
756 XSetWindowBorderWidth (_ecore_x_disp, win, width); 756 XSetWindowBorderWidth (_ecore_x_disp, win, width);
757} /* ecore_x_window_border_width_set */ 757}
758 758
759/** 759/**
760 * Retrieves the depth of the given window. 760 * Retrieves the depth of the given window.
@@ -766,7 +766,7 @@ ecore_x_window_depth_get(Ecore_X_Window win)
766{ 766{
767 LOGFN(__FILE__, __LINE__, __FUNCTION__); 767 LOGFN(__FILE__, __LINE__, __FUNCTION__);
768 return ecore_x_drawable_depth_get(win); 768 return ecore_x_drawable_depth_get(win);
769} /* ecore_x_window_depth_get */ 769}
770 770
771/** 771/**
772 * To be documented. 772 * To be documented.
@@ -775,7 +775,7 @@ ecore_x_window_depth_get(Ecore_X_Window win)
775 */ 775 */
776EAPI void 776EAPI void
777ecore_x_window_cursor_show(Ecore_X_Window win, 777ecore_x_window_cursor_show(Ecore_X_Window win,
778 Eina_Bool show) 778 Eina_Bool show)
779{ 779{
780 LOGFN(__FILE__, __LINE__, __FUNCTION__); 780 LOGFN(__FILE__, __LINE__, __FUNCTION__);
781 if (win == 0) 781 if (win == 0)
@@ -803,7 +803,7 @@ ecore_x_window_cursor_show(Ecore_X_Window win,
803 } 803 }
804 else 804 else
805 XDefineCursor(_ecore_x_disp, win, 0); 805 XDefineCursor(_ecore_x_disp, win, 0);
806} /* ecore_x_window_cursor_show */ 806}
807 807
808EAPI void 808EAPI void
809ecore_x_window_cursor_set(Ecore_X_Window win, 809ecore_x_window_cursor_set(Ecore_X_Window win,
@@ -814,7 +814,7 @@ ecore_x_window_cursor_set(Ecore_X_Window win,
814 XUndefineCursor(_ecore_x_disp, win); 814 XUndefineCursor(_ecore_x_disp, win);
815 else 815 else
816 XDefineCursor(_ecore_x_disp, win, c); 816 XDefineCursor(_ecore_x_disp, win, c);
817} /* ecore_x_window_cursor_set */ 817}
818 818
819/** 819/**
820 * Finds out whether the given window is currently visible. 820 * Finds out whether the given window is currently visible.
@@ -830,7 +830,7 @@ ecore_x_window_visible_get(Ecore_X_Window win)
830 LOGFN(__FILE__, __LINE__, __FUNCTION__); 830 LOGFN(__FILE__, __LINE__, __FUNCTION__);
831 return XGetWindowAttributes(_ecore_x_disp, win, &attr) && 831 return XGetWindowAttributes(_ecore_x_disp, win, &attr) &&
832 (attr.map_state == IsViewable); 832 (attr.map_state == IsViewable);
833} /* ecore_x_window_visible_get */ 833}
834 834
835typedef struct _Shadow Shadow; 835typedef struct _Shadow Shadow;
836struct _Shadow 836struct _Shadow
@@ -914,7 +914,7 @@ _ecore_x_window_tree_walk(Window win)
914 XFree(list); 914 XFree(list);
915 915
916 return s; 916 return s;
917} /* _ecore_x_window_tree_walk */ 917}
918 918
919static void 919static void
920_ecore_x_window_tree_shadow_free1(Shadow *s) 920_ecore_x_window_tree_shadow_free1(Shadow *s)
@@ -935,7 +935,7 @@ _ecore_x_window_tree_shadow_free1(Shadow *s)
935 } 935 }
936 936
937 free(s); 937 free(s);
938} /* _ecore_x_window_tree_shadow_free1 */ 938}
939 939
940static void 940static void
941_ecore_x_window_tree_shadow_free(void) 941_ecore_x_window_tree_shadow_free(void)
@@ -955,7 +955,7 @@ _ecore_x_window_tree_shadow_free(void)
955 free(shadow_base); 955 free(shadow_base);
956 shadow_base = NULL; 956 shadow_base = NULL;
957 shadow_num = 0; 957 shadow_num = 0;
958} /* _ecore_x_window_tree_shadow_free */ 958}
959 959
960static void 960static void
961_ecore_x_window_tree_shadow_populate(void) 961_ecore_x_window_tree_shadow_populate(void)
@@ -976,7 +976,7 @@ _ecore_x_window_tree_shadow_populate(void)
976 976
977 free(roots); 977 free(roots);
978 } 978 }
979} /* _ecore_x_window_tree_shadow_populate */ 979}
980 980
981/* 981/*
982 static int shadow_count = 0; 982 static int shadow_count = 0;
@@ -1000,7 +1000,7 @@ _ecore_x_window_tree_shadow_populate(void)
1000 1000
1001static Shadow * 1001static Shadow *
1002_ecore_x_window_shadow_tree_find_shadow(Shadow *s, 1002_ecore_x_window_shadow_tree_find_shadow(Shadow *s,
1003 Window win) 1003 Window win)
1004{ 1004{
1005 Shadow *ss; 1005 Shadow *ss;
1006 int i; 1006 int i;
@@ -1020,7 +1020,7 @@ _ecore_x_window_shadow_tree_find_shadow(Shadow *s,
1020 } 1020 }
1021 1021
1022 return NULL; 1022 return NULL;
1023} /* _ecore_x_window_shadow_tree_find_shadow */ 1023}
1024 1024
1025static Shadow * 1025static Shadow *
1026_ecore_x_window_shadow_tree_find(Window base) 1026_ecore_x_window_shadow_tree_find(Window base)
@@ -1037,16 +1037,16 @@ _ecore_x_window_shadow_tree_find(Window base)
1037 return s; 1037 return s;
1038 } 1038 }
1039 return NULL; 1039 return NULL;
1040} /* _ecore_x_window_shadow_tree_find */ 1040}
1041 1041
1042static int 1042static int
1043_inside_rects(Shadow *s, 1043_inside_rects(Shadow *s,
1044 int x, 1044 int x,
1045 int y, 1045 int y,
1046 int bx, 1046 int bx,
1047 int by, 1047 int by,
1048 Ecore_X_Rectangle *rects, 1048 Ecore_X_Rectangle *rects,
1049 int num) 1049 int num)
1050{ 1050{
1051 int i, inside; 1051 int i, inside;
1052 1052
@@ -1068,13 +1068,13 @@ _inside_rects(Shadow *s,
1068} 1068}
1069 1069
1070static Window 1070static Window
1071_ecore_x_window_shadow_tree_at_xy_get_shadow(Shadow *s, 1071_ecore_x_window_shadow_tree_at_xy_get_shadow(Shadow *s,
1072 int bx, 1072 int bx,
1073 int by, 1073 int by,
1074 int x, 1074 int x,
1075 int y, 1075 int y,
1076 Ecore_X_Window *skip, 1076 Ecore_X_Window *skip,
1077 int skip_num) 1077 int skip_num)
1078{ 1078{
1079 Window child; 1079 Window child;
1080 int i, j; 1080 int i, j;
@@ -1131,16 +1131,16 @@ onward:
1131 } 1131 }
1132 1132
1133 return s->win; 1133 return s->win;
1134} /* _ecore_x_window_shadow_tree_at_xy_get_shadow */ 1134}
1135 1135
1136static Window 1136static Window
1137_ecore_x_window_shadow_tree_at_xy_get(Window base, 1137_ecore_x_window_shadow_tree_at_xy_get(Window base,
1138 int bx, 1138 int bx,
1139 int by, 1139 int by,
1140 int x, 1140 int x,
1141 int y, 1141 int y,
1142 Ecore_X_Window *skip, 1142 Ecore_X_Window *skip,
1143 int skip_num) 1143 int skip_num)
1144{ 1144{
1145 Shadow *s; 1145 Shadow *s;
1146 1146
@@ -1162,7 +1162,7 @@ _ecore_x_window_shadow_tree_at_xy_get(Window base,
1162 y, 1162 y,
1163 skip, 1163 skip,
1164 skip_num); 1164 skip_num);
1165} /* _ecore_x_window_shadow_tree_at_xy_get */ 1165}
1166 1166
1167/** 1167/**
1168 * Retrieves the top, visible window at the given location, 1168 * Retrieves the top, visible window at the given location,
@@ -1177,11 +1177,11 @@ _ecore_x_window_shadow_tree_at_xy_get(Window base,
1177 * @ingroup Ecore_X_Window_Geometry_Group 1177 * @ingroup Ecore_X_Window_Geometry_Group
1178 */ 1178 */
1179EAPI Ecore_X_Window 1179EAPI Ecore_X_Window
1180ecore_x_window_shadow_tree_at_xy_with_skip_get(Ecore_X_Window base, 1180ecore_x_window_shadow_tree_at_xy_with_skip_get(Ecore_X_Window base,
1181 int x, 1181 int x,
1182 int y, 1182 int y,
1183 Ecore_X_Window *skip, 1183 Ecore_X_Window *skip,
1184 int skip_num) 1184 int skip_num)
1185{ 1185{
1186 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1186 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1187 return _ecore_x_window_shadow_tree_at_xy_get(base, 1187 return _ecore_x_window_shadow_tree_at_xy_get(base,
@@ -1191,7 +1191,7 @@ ecore_x_window_shadow_tree_at_xy_with_skip_get(Ecore_X_Window base,
1191 y, 1191 y,
1192 skip, 1192 skip,
1193 skip_num); 1193 skip_num);
1194} /* ecore_x_window_shadow_tree_at_xy_with_skip_get */ 1194}
1195 1195
1196/** 1196/**
1197 * Retrieves the parent window a given window has. This uses the shadow window 1197 * Retrieves the parent window a given window has. This uses the shadow window
@@ -1231,7 +1231,7 @@ ecore_x_window_shadow_parent_get(Ecore_X_Window root __UNUSED__,
1231 } 1231 }
1232 } 1232 }
1233 return 0; 1233 return 0;
1234} /* ecore_x_window_shadow_parent_get */ 1234}
1235 1235
1236/** 1236/**
1237 * Flushes the window shadow tree so nothing is stored. 1237 * Flushes the window shadow tree so nothing is stored.
@@ -1242,7 +1242,7 @@ ecore_x_window_shadow_tree_flush(void)
1242{ 1242{
1243 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1243 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1244 _ecore_x_window_tree_shadow_free(); 1244 _ecore_x_window_tree_shadow_free();
1245} /* ecore_x_window_shadow_tree_flush */ 1245}
1246 1246
1247/** 1247/**
1248 * Retrieves the root window a given window is on. 1248 * Retrieves the root window a given window is on.
@@ -1260,16 +1260,16 @@ ecore_x_window_root_get(Ecore_X_Window win)
1260 return 0; 1260 return 0;
1261 1261
1262 return att.root; 1262 return att.root;
1263} /* ecore_x_window_root_get */ 1263}
1264 1264
1265static Window 1265static Window
1266_ecore_x_window_at_xy_get(Window base, 1266_ecore_x_window_at_xy_get(Window base,
1267 int bx, 1267 int bx,
1268 int by, 1268 int by,
1269 int x, 1269 int x,
1270 int y, 1270 int y,
1271 Ecore_X_Window *skip, 1271 Ecore_X_Window *skip,
1272 int skip_num) 1272 int skip_num)
1273{ 1273{
1274 Window *list = NULL; 1274 Window *list = NULL;
1275 Window parent_win = 0, child = 0, root_win = 0; 1275 Window parent_win = 0, child = 0, root_win = 0;
@@ -1324,7 +1324,7 @@ onward:
1324 } 1324 }
1325 1325
1326 return base; 1326 return base;
1327} /* _ecore_x_window_at_xy_get */ 1327}
1328 1328
1329/** 1329/**
1330 * Retrieves the top, visible window at the given location. 1330 * Retrieves the top, visible window at the given location.
@@ -1349,7 +1349,7 @@ ecore_x_window_at_xy_get(int x,
1349 ecore_x_ungrab(); 1349 ecore_x_ungrab();
1350 1350
1351 return win ? win : root; 1351 return win ? win : root;
1352} /* ecore_x_window_at_xy_get */ 1352}
1353 1353
1354/** 1354/**
1355 * Retrieves the top, visible window at the given location, 1355 * Retrieves the top, visible window at the given location,
@@ -1360,10 +1360,10 @@ ecore_x_window_at_xy_get(int x,
1360 * @ingroup Ecore_X_Window_Geometry_Group 1360 * @ingroup Ecore_X_Window_Geometry_Group
1361 */ 1361 */
1362EAPI Ecore_X_Window 1362EAPI Ecore_X_Window
1363ecore_x_window_at_xy_with_skip_get(int x, 1363ecore_x_window_at_xy_with_skip_get(int x,
1364 int y, 1364 int y,
1365 Ecore_X_Window *skip, 1365 Ecore_X_Window *skip,
1366 int skip_num) 1366 int skip_num)
1367{ 1367{
1368 Ecore_X_Window win, root; 1368 Ecore_X_Window win, root;
1369 1369
@@ -1377,12 +1377,12 @@ ecore_x_window_at_xy_with_skip_get(int x,
1377 ecore_x_ungrab(); 1377 ecore_x_ungrab();
1378 1378
1379 return win ? win : root; 1379 return win ? win : root;
1380} /* ecore_x_window_at_xy_with_skip_get */ 1380}
1381 1381
1382EAPI Ecore_X_Window 1382EAPI Ecore_X_Window
1383ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, 1383ecore_x_window_at_xy_begin_get(Ecore_X_Window begin,
1384 int x, 1384 int x,
1385 int y) 1385 int y)
1386{ 1386{
1387 Ecore_X_Window win; 1387 Ecore_X_Window win;
1388 1388
@@ -1392,7 +1392,7 @@ ecore_x_window_at_xy_begin_get(Ecore_X_Window begin,
1392 ecore_x_ungrab(); 1392 ecore_x_ungrab();
1393 1393
1394 return win ? win : begin; 1394 return win ? win : begin;
1395} /* ecore_x_window_at_xy_begin_get */ 1395}
1396 1396
1397/** 1397/**
1398 * Retrieves the parent window of the given window. 1398 * Retrieves the parent window of the given window.
@@ -1414,7 +1414,7 @@ ecore_x_window_parent_get(Ecore_X_Window win)
1414 XFree(children); 1414 XFree(children);
1415 1415
1416 return parent; 1416 return parent;
1417} /* ecore_x_window_parent_get */ 1417}
1418 1418
1419/** 1419/**
1420 * Sets the background color of the given window. 1420 * Sets the background color of the given window.
@@ -1443,10 +1443,10 @@ ecore_x_window_background_color_set(Ecore_X_Window win,
1443 1443
1444 attr.background_pixel = col.pixel; 1444 attr.background_pixel = col.pixel;
1445 XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr); 1445 XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
1446} /* ecore_x_window_background_color_set */ 1446}
1447 1447
1448EAPI void 1448EAPI void
1449ecore_x_window_gravity_set(Ecore_X_Window win, 1449ecore_x_window_gravity_set(Ecore_X_Window win,
1450 Ecore_X_Gravity grav) 1450 Ecore_X_Gravity grav)
1451{ 1451{
1452 XSetWindowAttributes att; 1452 XSetWindowAttributes att;
@@ -1454,10 +1454,10 @@ ecore_x_window_gravity_set(Ecore_X_Window win,
1454 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1454 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1455 att.win_gravity = grav; 1455 att.win_gravity = grav;
1456 XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att); 1456 XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att);
1457} /* ecore_x_window_gravity_set */ 1457}
1458 1458
1459EAPI void 1459EAPI void
1460ecore_x_window_pixel_gravity_set(Ecore_X_Window win, 1460ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
1461 Ecore_X_Gravity grav) 1461 Ecore_X_Gravity grav)
1462{ 1462{
1463 XSetWindowAttributes att; 1463 XSetWindowAttributes att;
@@ -1465,7 +1465,7 @@ ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
1465 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1465 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1466 att.bit_gravity = grav; 1466 att.bit_gravity = grav;
1467 XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att); 1467 XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att);
1468} /* ecore_x_window_pixel_gravity_set */ 1468}
1469 1469
1470EAPI void 1470EAPI void
1471ecore_x_window_pixmap_set(Ecore_X_Window win, 1471ecore_x_window_pixmap_set(Ecore_X_Window win,
@@ -1473,50 +1473,50 @@ ecore_x_window_pixmap_set(Ecore_X_Window win,
1473{ 1473{
1474 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1474 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1475 XSetWindowBackgroundPixmap(_ecore_x_disp, win, pmap); 1475 XSetWindowBackgroundPixmap(_ecore_x_disp, win, pmap);
1476} /* ecore_x_window_pixmap_set */ 1476}
1477 1477
1478EAPI void 1478EAPI void
1479ecore_x_window_area_clear(Ecore_X_Window win, 1479ecore_x_window_area_clear(Ecore_X_Window win,
1480 int x, 1480 int x,
1481 int y, 1481 int y,
1482 int w, 1482 int w,
1483 int h) 1483 int h)
1484{ 1484{
1485 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1485 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1486 XClearArea(_ecore_x_disp, win, x, y, w, h, False); 1486 XClearArea(_ecore_x_disp, win, x, y, w, h, False);
1487} /* ecore_x_window_area_clear */ 1487}
1488 1488
1489EAPI void 1489EAPI void
1490ecore_x_window_area_expose(Ecore_X_Window win, 1490ecore_x_window_area_expose(Ecore_X_Window win,
1491 int x, 1491 int x,
1492 int y, 1492 int y,
1493 int w, 1493 int w,
1494 int h) 1494 int h)
1495{ 1495{
1496 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1496 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1497 XClearArea(_ecore_x_disp, win, x, y, w, h, True); 1497 XClearArea(_ecore_x_disp, win, x, y, w, h, True);
1498} /* ecore_x_window_area_expose */ 1498}
1499 1499
1500EAPI void 1500EAPI void
1501ecore_x_window_override_set(Ecore_X_Window win, 1501ecore_x_window_override_set(Ecore_X_Window win,
1502 Eina_Bool override) 1502 Eina_Bool override)
1503{ 1503{
1504 XSetWindowAttributes att; 1504 XSetWindowAttributes att;
1505 1505
1506 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1506 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1507 att.override_redirect = override; 1507 att.override_redirect = override;
1508 XChangeWindowAttributes(_ecore_x_disp, win, CWOverrideRedirect, &att); 1508 XChangeWindowAttributes(_ecore_x_disp, win, CWOverrideRedirect, &att);
1509} /* ecore_x_window_override_set */ 1509}
1510 1510
1511#ifdef ECORE_XRENDER 1511#ifdef ECORE_XRENDER
1512static Ecore_X_Window 1512static Ecore_X_Window
1513_ecore_x_window_argb_internal_new(Ecore_X_Window parent, 1513_ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1514 int x, 1514 int x,
1515 int y, 1515 int y,
1516 int w, 1516 int w,
1517 int h, 1517 int h,
1518 Eina_Bool override, 1518 Eina_Bool override,
1519 Eina_Bool saveunder) 1519 Eina_Bool saveunder)
1520{ 1520{
1521 Window win; 1521 Window win;
1522 XSetWindowAttributes attr; 1522 XSetWindowAttributes attr;
@@ -1535,15 +1535,15 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1535 else 1535 else
1536 { 1536 {
1537 /* ewww - round trip */ 1537 /* ewww - round trip */
1538 XGetWindowAttributes(_ecore_x_disp, parent, &att); 1538 XGetWindowAttributes(_ecore_x_disp, parent, &att);
1539 for (i = 0; i < ScreenCount(_ecore_x_disp); i++) 1539 for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
1540 { 1540 {
1541 if (att.screen == ScreenOfDisplay(_ecore_x_disp, i)) 1541 if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
1542 { 1542 {
1543 scr = i; 1543 scr = i;
1544 break; 1544 break;
1545 } 1545 }
1546 } 1546 }
1547 } 1547 }
1548 1548
1549 vi_in.screen = scr; 1549 vi_in.screen = scr;
@@ -1615,7 +1615,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1615 ecore_x_window_defaults_set(win); 1615 ecore_x_window_defaults_set(win);
1616 1616
1617 return win; 1617 return win;
1618} /* _ecore_x_window_argb_internal_new */ 1618}
1619 1619
1620#endif /* ifdef ECORE_XRENDER */ 1620#endif /* ifdef ECORE_XRENDER */
1621 1621
@@ -1641,7 +1641,7 @@ ecore_x_window_argb_get(Ecore_X_Window win)
1641#else /* ifdef ECORE_XRENDER */ 1641#else /* ifdef ECORE_XRENDER */
1642 return 0; 1642 return 0;
1643#endif /* ifdef ECORE_XRENDER */ 1643#endif /* ifdef ECORE_XRENDER */
1644} /* ecore_x_window_argb_get */ 1644}
1645 1645
1646/** 1646/**
1647 * Creates a new window. 1647 * Creates a new window.
@@ -1656,10 +1656,10 @@ ecore_x_window_argb_get(Ecore_X_Window win)
1656 */ 1656 */
1657EAPI Ecore_X_Window 1657EAPI Ecore_X_Window
1658ecore_x_window_manager_argb_new(Ecore_X_Window parent, 1658ecore_x_window_manager_argb_new(Ecore_X_Window parent,
1659 int x, 1659 int x,
1660 int y, 1660 int y,
1661 int w, 1661 int w,
1662 int h) 1662 int h)
1663{ 1663{
1664#ifdef ECORE_XRENDER 1664#ifdef ECORE_XRENDER
1665 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1665 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1667,7 +1667,7 @@ ecore_x_window_manager_argb_new(Ecore_X_Window parent,
1667#else /* ifdef ECORE_XRENDER */ 1667#else /* ifdef ECORE_XRENDER */
1668 return 0; 1668 return 0;
1669#endif /* ifdef ECORE_XRENDER */ 1669#endif /* ifdef ECORE_XRENDER */
1670} /* ecore_x_window_manager_argb_new */ 1670}
1671 1671
1672/** 1672/**
1673 * Creates a new window. 1673 * Creates a new window.
@@ -1682,10 +1682,10 @@ ecore_x_window_manager_argb_new(Ecore_X_Window parent,
1682 */ 1682 */
1683EAPI Ecore_X_Window 1683EAPI Ecore_X_Window
1684ecore_x_window_argb_new(Ecore_X_Window parent, 1684ecore_x_window_argb_new(Ecore_X_Window parent,
1685 int x, 1685 int x,
1686 int y, 1686 int y,
1687 int w, 1687 int w,
1688 int h) 1688 int h)
1689{ 1689{
1690#ifdef ECORE_XRENDER 1690#ifdef ECORE_XRENDER
1691 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1691 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1693,7 +1693,7 @@ ecore_x_window_argb_new(Ecore_X_Window parent,
1693#else /* ifdef ECORE_XRENDER */ 1693#else /* ifdef ECORE_XRENDER */
1694 return 0; 1694 return 0;
1695#endif /* ifdef ECORE_XRENDER */ 1695#endif /* ifdef ECORE_XRENDER */
1696} /* ecore_x_window_argb_new */ 1696}
1697 1697
1698/** 1698/**
1699 * Creates a window with the override redirect attribute set to @c True. 1699 * Creates a window with the override redirect attribute set to @c True.
@@ -1708,10 +1708,10 @@ ecore_x_window_argb_new(Ecore_X_Window parent,
1708 */ 1708 */
1709EAPI Ecore_X_Window 1709EAPI Ecore_X_Window
1710ecore_x_window_override_argb_new(Ecore_X_Window parent, 1710ecore_x_window_override_argb_new(Ecore_X_Window parent,
1711 int x, 1711 int x,
1712 int y, 1712 int y,
1713 int w, 1713 int w,
1714 int h) 1714 int h)
1715{ 1715{
1716#ifdef ECORE_XRENDER 1716#ifdef ECORE_XRENDER
1717 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1717 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1719,5 +1719,5 @@ ecore_x_window_override_argb_new(Ecore_X_Window parent,
1719#else /* ifdef ECORE_XRENDER */ 1719#else /* ifdef ECORE_XRENDER */
1720 return 0; 1720 return 0;
1721#endif /* ifdef ECORE_XRENDER */ 1721#endif /* ifdef ECORE_XRENDER */
1722} /* ecore_x_window_override_argb_new */ 1722}
1723 1723
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
index 8d5c757..b581a0e 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
@@ -21,9 +21,9 @@
21 */ 21 */
22EAPI void 22EAPI void
23ecore_x_window_prop_card32_set(Ecore_X_Window win, 23ecore_x_window_prop_card32_set(Ecore_X_Window win,
24 Ecore_X_Atom atom, 24 Ecore_X_Atom atom,
25 unsigned int *val, 25 unsigned int *val,
26 unsigned int num) 26 unsigned int num)
27{ 27{
28#if SIZEOF_INT == SIZEOF_LONG 28#if SIZEOF_INT == SIZEOF_LONG
29 _ATOM_SET_CARD32(win, atom, val, num); 29 _ATOM_SET_CARD32(win, atom, val, num);
@@ -41,7 +41,7 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win,
41 _ATOM_SET_CARD32(win, atom, v2, num); 41 _ATOM_SET_CARD32(win, atom, v2, num);
42 free(v2); 42 free(v2);
43#endif /* if SIZEOF_INT == SIZEOF_LONG */ 43#endif /* if SIZEOF_INT == SIZEOF_LONG */
44} /* ecore_x_window_prop_card32_set */ 44}
45 45
46/* 46/*
47 * Get CARD32 (array) property 47 * Get CARD32 (array) property
@@ -53,9 +53,9 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win,
53 */ 53 */
54EAPI int 54EAPI int
55ecore_x_window_prop_card32_get(Ecore_X_Window win, 55ecore_x_window_prop_card32_get(Ecore_X_Window win,
56 Ecore_X_Atom atom, 56 Ecore_X_Atom atom,
57 unsigned int *val, 57 unsigned int *val,
58 unsigned int len) 58 unsigned int len)
59{ 59{
60 unsigned char *prop_ret; 60 unsigned char *prop_ret;
61 Atom type_ret; 61 Atom type_ret;
@@ -89,7 +89,7 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win,
89 XFree(prop_ret); 89 XFree(prop_ret);
90 90
91 return num; 91 return num;
92} /* ecore_x_window_prop_card32_get */ 92}
93 93
94/* 94/*
95 * Get CARD32 (array) property of any length 95 * Get CARD32 (array) property of any length
@@ -100,7 +100,7 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win,
100 */ 100 */
101EAPI int 101EAPI int
102ecore_x_window_prop_card32_list_get(Ecore_X_Window win, 102ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
103 Ecore_X_Atom atom, 103 Ecore_X_Atom atom,
104 unsigned int **plst) 104 unsigned int **plst)
105{ 105{
106 unsigned char *prop_ret; 106 unsigned char *prop_ret;
@@ -125,7 +125,7 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
125 else 125 else
126 { 126 {
127 val = malloc(num_ret * sizeof(unsigned int)); 127 val = malloc(num_ret * sizeof(unsigned int));
128 if (!val) 128 if (!val)
129 { 129 {
130 if (prop_ret) XFree(prop_ret); 130 if (prop_ret) XFree(prop_ret);
131 return -1; 131 return -1;
@@ -140,17 +140,17 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
140 XFree(prop_ret); 140 XFree(prop_ret);
141 141
142 return num; 142 return num;
143} /* ecore_x_window_prop_card32_list_get */ 143}
144 144
145/* 145/*
146 * Set X ID (array) property 146 * Set X ID (array) property
147 */ 147 */
148EAPI void 148EAPI void
149ecore_x_window_prop_xid_set(Ecore_X_Window win, 149ecore_x_window_prop_xid_set(Ecore_X_Window win,
150 Ecore_X_Atom atom, 150 Ecore_X_Atom atom,
151 Ecore_X_Atom type, 151 Ecore_X_Atom type,
152 Ecore_X_ID *lst, 152 Ecore_X_ID *lst,
153 unsigned int num) 153 unsigned int num)
154{ 154{
155#if SIZEOF_INT == SIZEOF_LONG 155#if SIZEOF_INT == SIZEOF_LONG
156 XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace, 156 XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
@@ -170,7 +170,7 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win,
170 (unsigned char *)pl, num); 170 (unsigned char *)pl, num);
171 free(pl); 171 free(pl);
172#endif /* if SIZEOF_INT == SIZEOF_LONG */ 172#endif /* if SIZEOF_INT == SIZEOF_LONG */
173} /* ecore_x_window_prop_xid_set */ 173}
174 174
175/* 175/*
176 * Get X ID (array) property 176 * Get X ID (array) property
@@ -182,10 +182,10 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win,
182 */ 182 */
183EAPI int 183EAPI int
184ecore_x_window_prop_xid_get(Ecore_X_Window win, 184ecore_x_window_prop_xid_get(Ecore_X_Window win,
185 Ecore_X_Atom atom, 185 Ecore_X_Atom atom,
186 Ecore_X_Atom type, 186 Ecore_X_Atom type,
187 Ecore_X_ID *lst, 187 Ecore_X_ID *lst,
188 unsigned int len) 188 unsigned int len)
189{ 189{
190 unsigned char *prop_ret; 190 unsigned char *prop_ret;
191 Atom type_ret; 191 Atom type_ret;
@@ -219,7 +219,7 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win,
219 XFree(prop_ret); 219 XFree(prop_ret);
220 220
221 return num; 221 return num;
222} /* ecore_x_window_prop_xid_get */ 222}
223 223
224/* 224/*
225 * Get X ID (array) property 225 * Get X ID (array) property
@@ -231,9 +231,9 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win,
231 */ 231 */
232EAPI int 232EAPI int
233ecore_x_window_prop_xid_list_get(Ecore_X_Window win, 233ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
234 Ecore_X_Atom atom, 234 Ecore_X_Atom atom,
235 Ecore_X_Atom type, 235 Ecore_X_Atom type,
236 Ecore_X_ID **val) 236 Ecore_X_ID **val)
237{ 237{
238 unsigned char *prop_ret; 238 unsigned char *prop_ret;
239 Atom type_ret; 239 Atom type_ret;
@@ -268,17 +268,17 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
268 XFree(prop_ret); 268 XFree(prop_ret);
269 269
270 return num; 270 return num;
271} /* ecore_x_window_prop_xid_list_get */ 271}
272 272
273/* 273/*
274 * Remove/add/toggle X ID list item. 274 * Remove/add/toggle X ID list item.
275 */ 275 */
276EAPI void 276EAPI void
277ecore_x_window_prop_xid_list_change(Ecore_X_Window win, 277ecore_x_window_prop_xid_list_change(Ecore_X_Window win,
278 Ecore_X_Atom atom, 278 Ecore_X_Atom atom,
279 Ecore_X_Atom type, 279 Ecore_X_Atom type,
280 Ecore_X_ID item, 280 Ecore_X_ID item,
281 int op) 281 int op)
282{ 282{
283 Ecore_X_ID *lst; 283 Ecore_X_ID *lst;
284 int i, num; 284 int i, num;
@@ -300,22 +300,22 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win,
300 if (i < num) 300 if (i < num)
301 { 301 {
302 /* Was in list */ 302 /* Was in list */
303 if (op == ECORE_X_PROP_LIST_ADD) 303 if (op == ECORE_X_PROP_LIST_ADD)
304 goto done; /* Remove it */ 304 goto done; /* Remove it */
305 305
306 num--; 306 num--;
307 for (; i < num; i++) 307 for (; i < num; i++)
308 lst[i] = lst[i + 1]; 308 lst[i] = lst[i + 1];
309 } 309 }
310 else 310 else
311 { 311 {
312 /* Was not in list */ 312 /* Was not in list */
313 if (op == ECORE_X_PROP_LIST_REMOVE) 313 if (op == ECORE_X_PROP_LIST_REMOVE)
314 goto done; /* Add it */ 314 goto done; /* Add it */
315 315
316 num++; 316 num++;
317 lst = realloc(lst, num * sizeof(Ecore_X_ID)); 317 lst = realloc(lst, num * sizeof(Ecore_X_ID));
318 lst[i] = item; 318 lst[i] = item;
319 } 319 }
320 320
321 ecore_x_window_prop_xid_set(win, atom, type, lst, num); 321 ecore_x_window_prop_xid_set(win, atom, type, lst, num);
@@ -323,20 +323,20 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win,
323done: 323done:
324 if (lst) 324 if (lst)
325 free(lst); 325 free(lst);
326} /* ecore_x_window_prop_xid_list_change */ 326}
327 327
328/* 328/*
329 * Set Atom (array) property 329 * Set Atom (array) property
330 */ 330 */
331EAPI void 331EAPI void
332ecore_x_window_prop_atom_set(Ecore_X_Window win, 332ecore_x_window_prop_atom_set(Ecore_X_Window win,
333 Ecore_X_Atom atom, 333 Ecore_X_Atom atom,
334 Ecore_X_Atom *lst, 334 Ecore_X_Atom *lst,
335 unsigned int num) 335 unsigned int num)
336{ 336{
337 LOGFN(__FILE__, __LINE__, __FUNCTION__); 337 LOGFN(__FILE__, __LINE__, __FUNCTION__);
338 ecore_x_window_prop_xid_set(win, atom, XA_ATOM, lst, num); 338 ecore_x_window_prop_xid_set(win, atom, XA_ATOM, lst, num);
339} /* ecore_x_window_prop_atom_set */ 339}
340 340
341/* 341/*
342 * Get Atom (array) property 342 * Get Atom (array) property
@@ -348,13 +348,13 @@ ecore_x_window_prop_atom_set(Ecore_X_Window win,
348 */ 348 */
349EAPI int 349EAPI int
350ecore_x_window_prop_atom_get(Ecore_X_Window win, 350ecore_x_window_prop_atom_get(Ecore_X_Window win,
351 Ecore_X_Atom atom, 351 Ecore_X_Atom atom,
352 Ecore_X_Atom *lst, 352 Ecore_X_Atom *lst,
353 unsigned int len) 353 unsigned int len)
354{ 354{
355 LOGFN(__FILE__, __LINE__, __FUNCTION__); 355 LOGFN(__FILE__, __LINE__, __FUNCTION__);
356 return ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len); 356 return ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len);
357} /* ecore_x_window_prop_atom_get */ 357}
358 358
359/* 359/*
360 * Get Atom (array) property 360 * Get Atom (array) property
@@ -366,38 +366,38 @@ ecore_x_window_prop_atom_get(Ecore_X_Window win,
366 */ 366 */
367EAPI int 367EAPI int
368ecore_x_window_prop_atom_list_get(Ecore_X_Window win, 368ecore_x_window_prop_atom_list_get(Ecore_X_Window win,
369 Ecore_X_Atom atom, 369 Ecore_X_Atom atom,
370 Ecore_X_Atom **plst) 370 Ecore_X_Atom **plst)
371{ 371{
372 LOGFN(__FILE__, __LINE__, __FUNCTION__); 372 LOGFN(__FILE__, __LINE__, __FUNCTION__);
373 return ecore_x_window_prop_xid_list_get(win, atom, XA_ATOM, plst); 373 return ecore_x_window_prop_xid_list_get(win, atom, XA_ATOM, plst);
374} /* ecore_x_window_prop_atom_list_get */ 374}
375 375
376/* 376/*
377 * Remove/add/toggle atom list item. 377 * Remove/add/toggle atom list item.
378 */ 378 */
379EAPI void 379EAPI void
380ecore_x_window_prop_atom_list_change(Ecore_X_Window win, 380ecore_x_window_prop_atom_list_change(Ecore_X_Window win,
381 Ecore_X_Atom atom, 381 Ecore_X_Atom atom,
382 Ecore_X_Atom item, 382 Ecore_X_Atom item,
383 int op) 383 int op)
384{ 384{
385 LOGFN(__FILE__, __LINE__, __FUNCTION__); 385 LOGFN(__FILE__, __LINE__, __FUNCTION__);
386 ecore_x_window_prop_xid_list_change(win, atom, XA_ATOM, item, op); 386 ecore_x_window_prop_xid_list_change(win, atom, XA_ATOM, item, op);
387} /* ecore_x_window_prop_atom_list_change */ 387}
388 388
389/* 389/*
390 * Set Window (array) property 390 * Set Window (array) property
391 */ 391 */
392EAPI void 392EAPI void
393ecore_x_window_prop_window_set(Ecore_X_Window win, 393ecore_x_window_prop_window_set(Ecore_X_Window win,
394 Ecore_X_Atom atom, 394 Ecore_X_Atom atom,
395 Ecore_X_Window *lst, 395 Ecore_X_Window *lst,
396 unsigned int num) 396 unsigned int num)
397{ 397{
398 LOGFN(__FILE__, __LINE__, __FUNCTION__); 398 LOGFN(__FILE__, __LINE__, __FUNCTION__);
399 ecore_x_window_prop_xid_set(win, atom, XA_WINDOW, lst, num); 399 ecore_x_window_prop_xid_set(win, atom, XA_WINDOW, lst, num);
400} /* ecore_x_window_prop_window_set */ 400}
401 401
402/* 402/*
403 * Get Window (array) property 403 * Get Window (array) property
@@ -408,14 +408,14 @@ ecore_x_window_prop_window_set(Ecore_X_Window win,
408 * Note: Return value 0 means that the property exists but has no elements. 408 * Note: Return value 0 means that the property exists but has no elements.
409 */ 409 */
410EAPI int 410EAPI int
411ecore_x_window_prop_window_get(Ecore_X_Window win, 411ecore_x_window_prop_window_get(Ecore_X_Window win,
412 Ecore_X_Atom atom, 412 Ecore_X_Atom atom,
413 Ecore_X_Window *lst, 413 Ecore_X_Window *lst,
414 unsigned int len) 414 unsigned int len)
415{ 415{
416 LOGFN(__FILE__, __LINE__, __FUNCTION__); 416 LOGFN(__FILE__, __LINE__, __FUNCTION__);
417 return ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len); 417 return ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len);
418} /* ecore_x_window_prop_window_get */ 418}
419 419
420/* 420/*
421 * Get Window (array) property 421 * Get Window (array) property
@@ -426,13 +426,13 @@ ecore_x_window_prop_window_get(Ecore_X_Window win,
426 * Note: Return value 0 means that the property exists but has no elements. 426 * Note: Return value 0 means that the property exists but has no elements.
427 */ 427 */
428EAPI int 428EAPI int
429ecore_x_window_prop_window_list_get(Ecore_X_Window win, 429ecore_x_window_prop_window_list_get(Ecore_X_Window win,
430 Ecore_X_Atom atom, 430 Ecore_X_Atom atom,
431 Ecore_X_Window **plst) 431 Ecore_X_Window **plst)
432{ 432{
433 LOGFN(__FILE__, __LINE__, __FUNCTION__); 433 LOGFN(__FILE__, __LINE__, __FUNCTION__);
434 return ecore_x_window_prop_xid_list_get(win, atom, XA_WINDOW, plst); 434 return ecore_x_window_prop_xid_list_get(win, atom, XA_WINDOW, plst);
435} /* ecore_x_window_prop_window_list_get */ 435}
436 436
437/** 437/**
438 * To be documented. 438 * To be documented.
@@ -443,7 +443,7 @@ EAPI Ecore_X_Atom
443ecore_x_window_prop_any_type(void) 443ecore_x_window_prop_any_type(void)
444{ 444{
445 return AnyPropertyType; 445 return AnyPropertyType;
446} /* ecore_x_window_prop_any_type */ 446}
447 447
448/** 448/**
449 * To be documented. 449 * To be documented.
@@ -452,11 +452,11 @@ ecore_x_window_prop_any_type(void)
452 */ 452 */
453EAPI void 453EAPI void
454ecore_x_window_prop_property_set(Ecore_X_Window win, 454ecore_x_window_prop_property_set(Ecore_X_Window win,
455 Ecore_X_Atom property, 455 Ecore_X_Atom property,
456 Ecore_X_Atom type, 456 Ecore_X_Atom type,
457 int size, 457 int size,
458 void *data, 458 void *data,
459 int number) 459 int number)
460{ 460{
461 LOGFN(__FILE__, __LINE__, __FUNCTION__); 461 LOGFN(__FILE__, __LINE__, __FUNCTION__);
462 if (win == 0) 462 if (win == 0)
@@ -479,13 +479,14 @@ ecore_x_window_prop_property_set(Ecore_X_Window win,
479 dat = malloc(sizeof(unsigned long) * number); 479 dat = malloc(sizeof(unsigned long) * number);
480 if (dat) 480 if (dat)
481 { 481 {
482 for (ptr = (int *)data, i = 0; i < number; i++) dat[i] = ptr[i]; 482 for (ptr = (int *)data, i = 0; i < number; i++)
483 dat[i] = ptr[i];
483 XChangeProperty(_ecore_x_disp, win, property, type, size, 484 XChangeProperty(_ecore_x_disp, win, property, type, size,
484 PropModeReplace, (unsigned char *)dat, number); 485 PropModeReplace, (unsigned char *)dat, number);
485 free(dat); 486 free(dat);
486 } 487 }
487 } 488 }
488} /* ecore_x_window_prop_property_set */ 489}
489 490
490/** 491/**
491 * To be documented. 492 * To be documented.
@@ -493,12 +494,12 @@ ecore_x_window_prop_property_set(Ecore_X_Window win,
493 * FIXME: To be fixed. 494 * FIXME: To be fixed.
494 */ 495 */
495EAPI int 496EAPI int
496ecore_x_window_prop_property_get(Ecore_X_Window win, 497ecore_x_window_prop_property_get(Ecore_X_Window win,
497 Ecore_X_Atom property, 498 Ecore_X_Atom property,
498 Ecore_X_Atom type, 499 Ecore_X_Atom type,
499 int size __UNUSED__, 500 int size __UNUSED__,
500 unsigned char **data, 501 unsigned char **data,
501 int *num) 502 int *num)
502{ 503{
503 Atom type_ret = 0; 504 Atom type_ret = 0;
504 int ret, size_ret = 0; 505 int ret, size_ret = 0;
@@ -552,7 +553,7 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
552 for (i = 0; i < num_ret; i++) 553 for (i = 0; i < num_ret; i++)
553 ((unsigned int *)*data)[i] = ((unsigned long *)prop_ret)[i]; 554 ((unsigned int *)*data)[i] = ((unsigned long *)prop_ret)[i];
554 break; 555 break;
555 } /* switch */ 556 }
556 557
557 XFree(prop_ret); 558 XFree(prop_ret);
558 559
@@ -560,19 +561,19 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
560 *num = num_ret; 561 *num = num_ret;
561 562
562 return size_ret; 563 return size_ret;
563} /* ecore_x_window_prop_property_get */ 564}
564 565
565EAPI void 566EAPI void
566ecore_x_window_prop_property_del(Ecore_X_Window win, 567ecore_x_window_prop_property_del(Ecore_X_Window win,
567 Ecore_X_Atom property) 568 Ecore_X_Atom property)
568{ 569{
569 LOGFN(__FILE__, __LINE__, __FUNCTION__); 570 LOGFN(__FILE__, __LINE__, __FUNCTION__);
570 XDeleteProperty(_ecore_x_disp, win, property); 571 XDeleteProperty(_ecore_x_disp, win, property);
571} /* ecore_x_window_prop_property_del */ 572}
572 573
573EAPI Ecore_X_Atom * 574EAPI Ecore_X_Atom *
574ecore_x_window_prop_list(Ecore_X_Window win, 575ecore_x_window_prop_list(Ecore_X_Window win,
575 int *num_ret) 576 int *num_ret)
576{ 577{
577 Ecore_X_Atom *atoms; 578 Ecore_X_Atom *atoms;
578 Atom *atom_ret; 579 Atom *atom_ret;
@@ -589,14 +590,15 @@ ecore_x_window_prop_list(Ecore_X_Window win,
589 atoms = malloc(num * sizeof(Ecore_X_Atom)); 590 atoms = malloc(num * sizeof(Ecore_X_Atom));
590 if (atoms) 591 if (atoms)
591 { 592 {
592 for (i = 0; i < num; i++) atoms[i] = atom_ret[i]; 593 for (i = 0; i < num; i++)
594 atoms[i] = atom_ret[i];
593 if (num_ret) 595 if (num_ret)
594 *num_ret = num; 596 *num_ret = num;
595 } 597 }
596 598
597 XFree(atom_ret); 599 XFree(atom_ret);
598 return atoms; 600 return atoms;
599} /* ecore_x_window_prop_list */ 601}
600 602
601/** 603/**
602 * Set a window string property. 604 * Set a window string property.
@@ -608,8 +610,8 @@ ecore_x_window_prop_list(Ecore_X_Window win,
608 */ 610 */
609EAPI void 611EAPI void
610ecore_x_window_prop_string_set(Ecore_X_Window win, 612ecore_x_window_prop_string_set(Ecore_X_Window win,
611 Ecore_X_Atom type, 613 Ecore_X_Atom type,
612 const char *str) 614 const char *str)
613{ 615{
614 XTextProperty xtp; 616 XTextProperty xtp;
615 617
@@ -622,7 +624,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win,
622 xtp.encoding = ECORE_X_ATOM_UTF8_STRING; 624 xtp.encoding = ECORE_X_ATOM_UTF8_STRING;
623 xtp.nitems = strlen(str); 625 xtp.nitems = strlen(str);
624 XSetTextProperty(_ecore_x_disp, win, &xtp, type); 626 XSetTextProperty(_ecore_x_disp, win, &xtp, type);
625} /* ecore_x_window_prop_string_set */ 627}
626 628
627/** 629/**
628 * Get a window string property. 630 * Get a window string property.
@@ -633,7 +635,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win,
633 */ 635 */
634EAPI char * 636EAPI char *
635ecore_x_window_prop_string_get(Ecore_X_Window win, 637ecore_x_window_prop_string_get(Ecore_X_Window win,
636 Ecore_X_Atom type) 638 Ecore_X_Atom type)
637{ 639{
638 XTextProperty xtp; 640 XTextProperty xtp;
639 char *str = NULL; 641 char *str = NULL;
@@ -673,10 +675,10 @@ ecore_x_window_prop_string_get(Ecore_X_Window win,
673 } 675 }
674 676
675 return str; 677 return str;
676} /* ecore_x_window_prop_string_get */ 678}
677 679
678EAPI Eina_Bool 680EAPI Eina_Bool
679ecore_x_window_prop_protocol_isset(Ecore_X_Window win, 681ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
680 Ecore_X_WM_Protocol protocol) 682 Ecore_X_WM_Protocol protocol)
681{ 683{
682 Atom proto, *protos = NULL; 684 Atom proto, *protos = NULL;
@@ -703,7 +705,7 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
703 XFree(protos); 705 XFree(protos);
704 706
705 return ret; 707 return ret;
706} /* ecore_x_window_prop_protocol_isset */ 708}
707 709
708/** 710/**
709 * To be documented. 711 * To be documented.
@@ -712,7 +714,7 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
712 */ 714 */
713EAPI Ecore_X_WM_Protocol * 715EAPI Ecore_X_WM_Protocol *
714ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, 716ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
715 int *num_ret) 717 int *num_ret)
716{ 718{
717 Atom *protos = NULL; 719 Atom *protos = NULL;
718 int i, protos_count = 0; 720 int i, protos_count = 0;
@@ -746,5 +748,5 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
746 XFree(protos); 748 XFree(protos);
747 *num_ret = protos_count; 749 *num_ret = protos_count;
748 return prot_ret; 750 return prot_ret;
749} /* ecore_x_window_prop_protocol_list_get */ 751}
750 752
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
index 2e8f8ce..71718cf 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
@@ -28,7 +28,7 @@ ecore_x_window_shape_mask_set(Ecore_X_Window win,
28{ 28{
29 LOGFN(__FILE__, __LINE__, __FUNCTION__); 29 LOGFN(__FILE__, __LINE__, __FUNCTION__);
30 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet); 30 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
31} /* ecore_x_window_shape_mask_set */ 31}
32 32
33/** 33/**
34 * Sets the input shape of the given window to that given by the pixmap @p mask. 34 * Sets the input shape of the given window to that given by the pixmap @p mask.
@@ -48,7 +48,7 @@ ecore_x_window_shape_input_mask_set(Ecore_X_Window win,
48 return; 48 return;
49 win = mask = 0; 49 win = mask = 0;
50#endif /* ifdef ShapeInput */ 50#endif /* ifdef ShapeInput */
51} /* ecore_x_window_shape_input_mask_set */ 51}
52 52
53EAPI void 53EAPI void
54ecore_x_window_shape_window_set(Ecore_X_Window win, 54ecore_x_window_shape_window_set(Ecore_X_Window win,
@@ -63,7 +63,7 @@ ecore_x_window_shape_window_set(Ecore_X_Window win,
63 shape_win, 63 shape_win,
64 ShapeBounding, 64 ShapeBounding,
65 ShapeSet); 65 ShapeSet);
66} /* ecore_x_window_shape_window_set */ 66}
67 67
68EAPI void 68EAPI void
69ecore_x_window_shape_input_window_set(Ecore_X_Window win, 69ecore_x_window_shape_input_window_set(Ecore_X_Window win,
@@ -83,13 +83,13 @@ ecore_x_window_shape_input_window_set(Ecore_X_Window win,
83 return; 83 return;
84 win = shape_win = 0; 84 win = shape_win = 0;
85#endif 85#endif
86} /* ecore_x_window_shape_input_window_set */ 86}
87 87
88EAPI void 88EAPI void
89ecore_x_window_shape_window_set_xy(Ecore_X_Window win, 89ecore_x_window_shape_window_set_xy(Ecore_X_Window win,
90 Ecore_X_Window shape_win, 90 Ecore_X_Window shape_win,
91 int x, 91 int x,
92 int y) 92 int y)
93{ 93{
94 LOGFN(__FILE__, __LINE__, __FUNCTION__); 94 LOGFN(__FILE__, __LINE__, __FUNCTION__);
95 XShapeCombineShape(_ecore_x_disp, 95 XShapeCombineShape(_ecore_x_disp,
@@ -100,13 +100,13 @@ ecore_x_window_shape_window_set_xy(Ecore_X_Window win,
100 shape_win, 100 shape_win,
101 ShapeBounding, 101 ShapeBounding,
102 ShapeSet); 102 ShapeSet);
103} /* ecore_x_window_shape_window_set_xy */ 103}
104 104
105EAPI void 105EAPI void
106ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win, 106ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win,
107 Ecore_X_Window shape_win, 107 Ecore_X_Window shape_win,
108 int x, 108 int x,
109 int y) 109 int y)
110{ 110{
111#ifdef ShapeInput 111#ifdef ShapeInput
112 LOGFN(__FILE__, __LINE__, __FUNCTION__); 112 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -122,14 +122,14 @@ ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win,
122 return; 122 return;
123 win = shape_win = x = y = 0; 123 win = shape_win = x = y = 0;
124#endif 124#endif
125} /* ecore_x_window_shape_input_window_set_xy */ 125}
126 126
127EAPI void 127EAPI void
128ecore_x_window_shape_rectangle_set(Ecore_X_Window win, 128ecore_x_window_shape_rectangle_set(Ecore_X_Window win,
129 int x, 129 int x,
130 int y, 130 int y,
131 int w, 131 int w,
132 int h) 132 int h)
133{ 133{
134 XRectangle rect; 134 XRectangle rect;
135 135
@@ -147,14 +147,14 @@ ecore_x_window_shape_rectangle_set(Ecore_X_Window win,
147 1, 147 1,
148 ShapeSet, 148 ShapeSet,
149 Unsorted); 149 Unsorted);
150} /* ecore_x_window_shape_rectangle_set */ 150}
151 151
152EAPI void 152EAPI void
153ecore_x_window_shape_input_rectangle_set(Ecore_X_Window win, 153ecore_x_window_shape_input_rectangle_set(Ecore_X_Window win,
154 int x, 154 int x,
155 int y, 155 int y,
156 int w, 156 int w,
157 int h) 157 int h)
158{ 158{
159#ifdef ShapeInput 159#ifdef ShapeInput
160 XRectangle rect; 160 XRectangle rect;
@@ -177,12 +177,12 @@ ecore_x_window_shape_input_rectangle_set(Ecore_X_Window win,
177 return; 177 return;
178 win = x = y = w = h = 0; 178 win = x = y = w = h = 0;
179#endif 179#endif
180} /* ecore_x_window_shape_input_rectangle_set */ 180}
181 181
182EAPI void 182EAPI void
183ecore_x_window_shape_rectangles_set(Ecore_X_Window win, 183ecore_x_window_shape_rectangles_set(Ecore_X_Window win,
184 Ecore_X_Rectangle *rects, 184 Ecore_X_Rectangle *rects,
185 int num) 185 int num)
186{ 186{
187#ifdef ShapeInput 187#ifdef ShapeInput
188 XRectangle *rect = NULL; 188 XRectangle *rect = NULL;
@@ -216,12 +216,12 @@ ecore_x_window_shape_rectangles_set(Ecore_X_Window win,
216 return; 216 return;
217 win = rects = num = 0; 217 win = rects = num = 0;
218#endif 218#endif
219} /* ecore_x_window_shape_rectangles_set */ 219}
220 220
221EAPI void 221EAPI void
222ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win, 222ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win,
223 Ecore_X_Rectangle *rects, 223 Ecore_X_Rectangle *rects,
224 int num) 224 int num)
225{ 225{
226#ifdef ShapeInput 226#ifdef ShapeInput
227 XRectangle *rect = NULL; 227 XRectangle *rect = NULL;
@@ -255,14 +255,14 @@ ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win,
255 return; 255 return;
256 win = rects = num = 0; 256 win = rects = num = 0;
257#endif 257#endif
258} /* ecore_x_window_shape_input_rectangles_set */ 258}
259 259
260EAPI void 260EAPI void
261ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win, 261ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win,
262 int x, 262 int x,
263 int y, 263 int y,
264 int w, 264 int w,
265 int h) 265 int h)
266{ 266{
267 XRectangle rect; 267 XRectangle rect;
268 268
@@ -280,14 +280,14 @@ ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win,
280 1, 280 1,
281 ShapeSubtract, 281 ShapeSubtract,
282 Unsorted); 282 Unsorted);
283} /* ecore_x_window_shape_rectangle_subtract */ 283}
284 284
285EAPI void 285EAPI void
286ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win, 286ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win,
287 int x, 287 int x,
288 int y, 288 int y,
289 int w, 289 int w,
290 int h) 290 int h)
291{ 291{
292#ifdef ShapeInput 292#ifdef ShapeInput
293 XRectangle rect; 293 XRectangle rect;
@@ -310,7 +310,7 @@ ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win,
310 return; 310 return;
311 win = x = y = w = h = 0; 311 win = x = y = w = h = 0;
312#endif 312#endif
313} /* ecore_x_window_shape_input_rectangle_subtract */ 313}
314 314
315EAPI void 315EAPI void
316ecore_x_window_shape_window_add(Ecore_X_Window win, 316ecore_x_window_shape_window_add(Ecore_X_Window win,
@@ -325,13 +325,13 @@ ecore_x_window_shape_window_add(Ecore_X_Window win,
325 shape_win, 325 shape_win,
326 ShapeBounding, 326 ShapeBounding,
327 ShapeUnion); 327 ShapeUnion);
328} /* ecore_x_window_shape_window_add */ 328}
329 329
330EAPI void 330EAPI void
331ecore_x_window_shape_window_add_xy(Ecore_X_Window win, 331ecore_x_window_shape_window_add_xy(Ecore_X_Window win,
332 Ecore_X_Window shape_win, 332 Ecore_X_Window shape_win,
333 int x, 333 int x,
334 int y) 334 int y)
335{ 335{
336 LOGFN(__FILE__, __LINE__, __FUNCTION__); 336 LOGFN(__FILE__, __LINE__, __FUNCTION__);
337 XShapeCombineShape(_ecore_x_disp, 337 XShapeCombineShape(_ecore_x_disp,
@@ -342,13 +342,13 @@ ecore_x_window_shape_window_add_xy(Ecore_X_Window win,
342 shape_win, 342 shape_win,
343 ShapeBounding, 343 ShapeBounding,
344 ShapeUnion); 344 ShapeUnion);
345} /* ecore_x_window_shape_window_add_xy */ 345}
346 346
347EAPI void 347EAPI void
348ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win, 348ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win,
349 Ecore_X_Window shape_win, 349 Ecore_X_Window shape_win,
350 int x, 350 int x,
351 int y) 351 int y)
352{ 352{
353#ifdef ShapeInput 353#ifdef ShapeInput
354 LOGFN(__FILE__, __LINE__, __FUNCTION__); 354 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -364,14 +364,14 @@ ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win,
364 return; 364 return;
365 win = shape_win = x = y = 0; 365 win = shape_win = x = y = 0;
366#endif 366#endif
367} /* ecore_x_window_shape_input_window_add_xy */ 367}
368 368
369EAPI void 369EAPI void
370ecore_x_window_shape_rectangle_add(Ecore_X_Window win, 370ecore_x_window_shape_rectangle_add(Ecore_X_Window win,
371 int x, 371 int x,
372 int y, 372 int y,
373 int w, 373 int w,
374 int h) 374 int h)
375{ 375{
376 XRectangle rect; 376 XRectangle rect;
377 377
@@ -389,14 +389,14 @@ ecore_x_window_shape_rectangle_add(Ecore_X_Window win,
389 1, 389 1,
390 ShapeUnion, 390 ShapeUnion,
391 Unsorted); 391 Unsorted);
392} /* ecore_x_window_shape_rectangle_add */ 392}
393 393
394EAPI void 394EAPI void
395ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win, 395ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win,
396 int x, 396 int x,
397 int y, 397 int y,
398 int w, 398 int w,
399 int h) 399 int h)
400{ 400{
401#ifdef ShapeInput 401#ifdef ShapeInput
402 XRectangle rect; 402 XRectangle rect;
@@ -419,14 +419,14 @@ ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win,
419 return; 419 return;
420 win = x = y = w = h = 0; 420 win = x = y = w = h = 0;
421#endif 421#endif
422} /* ecore_x_window_shape_input_rectangle_add */ 422}
423 423
424EAPI void 424EAPI void
425ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, 425ecore_x_window_shape_rectangle_clip(Ecore_X_Window win,
426 int x, 426 int x,
427 int y, 427 int y,
428 int w, 428 int w,
429 int h) 429 int h)
430{ 430{
431 XRectangle rect; 431 XRectangle rect;
432 432
@@ -444,14 +444,14 @@ ecore_x_window_shape_rectangle_clip(Ecore_X_Window win,
444 1, 444 1,
445 ShapeIntersect, 445 ShapeIntersect,
446 Unsorted); 446 Unsorted);
447} /* ecore_x_window_shape_rectangle_clip */ 447}
448 448
449EAPI void 449EAPI void
450ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win, 450ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win,
451 int x, 451 int x,
452 int y, 452 int y,
453 int w, 453 int w,
454 int h) 454 int h)
455{ 455{
456#ifdef ShapeInput 456#ifdef ShapeInput
457 XRectangle rect; 457 XRectangle rect;
@@ -474,12 +474,12 @@ ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win,
474 return; 474 return;
475 win = x = y = w = h = 0; 475 win = x = y = w = h = 0;
476#endif 476#endif
477} /* ecore_x_window_shape_input_rectangle_clip */ 477}
478 478
479EAPI void 479EAPI void
480ecore_x_window_shape_rectangles_add(Ecore_X_Window win, 480ecore_x_window_shape_rectangles_add(Ecore_X_Window win,
481 Ecore_X_Rectangle *rects, 481 Ecore_X_Rectangle *rects,
482 int num) 482 int num)
483{ 483{
484 XRectangle *rect = NULL; 484 XRectangle *rect = NULL;
485 int i; 485 int i;
@@ -508,12 +508,12 @@ ecore_x_window_shape_rectangles_add(Ecore_X_Window win,
508 ShapeUnion, 508 ShapeUnion,
509 Unsorted); 509 Unsorted);
510 if (rect) free(rect); 510 if (rect) free(rect);
511} /* ecore_x_window_shape_rectangles_add */ 511}
512 512
513EAPI void 513EAPI void
514ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win, 514ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win,
515 Ecore_X_Rectangle *rects, 515 Ecore_X_Rectangle *rects,
516 int num) 516 int num)
517{ 517{
518#ifdef ShapeInput 518#ifdef ShapeInput
519 XRectangle *rect = NULL; 519 XRectangle *rect = NULL;
@@ -547,11 +547,11 @@ ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win,
547 return; 547 return;
548 win = rects = num = 0; 548 win = rects = num = 0;
549#endif 549#endif
550} /* ecore_x_window_shape_input_rectangles_add */ 550}
551 551
552EAPI Ecore_X_Rectangle * 552EAPI Ecore_X_Rectangle *
553ecore_x_window_shape_rectangles_get(Ecore_X_Window win, 553ecore_x_window_shape_rectangles_get(Ecore_X_Window win,
554 int *num_ret) 554 int *num_ret)
555{ 555{
556 XRectangle *rect; 556 XRectangle *rect;
557 Ecore_X_Rectangle *rects = NULL; 557 Ecore_X_Rectangle *rects = NULL;
@@ -585,11 +585,11 @@ ecore_x_window_shape_rectangles_get(Ecore_X_Window win,
585 } 585 }
586 if (num_ret) *num_ret = num; 586 if (num_ret) *num_ret = num;
587 return rects; 587 return rects;
588} /* ecore_x_window_shape_rectangles_get */ 588}
589 589
590EAPI Ecore_X_Rectangle * 590EAPI Ecore_X_Rectangle *
591ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, 591ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
592 int *num_ret) 592 int *num_ret)
593{ 593{
594 Ecore_X_Rectangle *rects = NULL; 594 Ecore_X_Rectangle *rects = NULL;
595#ifdef ShapeInput 595#ifdef ShapeInput
@@ -643,16 +643,16 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
643 if (num_ret) *num_ret = 1; 643 if (num_ret) *num_ret = 1;
644 return rects; 644 return rects;
645#endif 645#endif
646} /* ecore_x_window_shape_input_rectangles_get */ 646}
647 647
648EAPI void 648EAPI void
649ecore_x_window_shape_events_select(Ecore_X_Window win, 649ecore_x_window_shape_events_select(Ecore_X_Window win,
650 Eina_Bool on) 650 Eina_Bool on)
651{ 651{
652 LOGFN(__FILE__, __LINE__, __FUNCTION__); 652 LOGFN(__FILE__, __LINE__, __FUNCTION__);
653 if (on) 653 if (on)
654 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 654 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
655 else 655 else
656 XShapeSelectInput(_ecore_x_disp, win, 0); 656 XShapeSelectInput(_ecore_x_disp, win, 0);
657} /* ecore_x_window_shape_events_select */ 657}
658 658
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
index 38a81dd..fbfbd43 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -46,7 +46,7 @@ _ecore_x_input_init(void)
46 _ecore_x_xi2_devs = XIQueryDevice(_ecore_x_disp, XIAllDevices, 46 _ecore_x_xi2_devs = XIQueryDevice(_ecore_x_disp, XIAllDevices,
47 &_ecore_x_xi2_num); 47 &_ecore_x_xi2_num);
48#endif /* ifdef ECORE_XI2 */ 48#endif /* ifdef ECORE_XI2 */
49} /* _ecore_x_input_init */ 49}
50 50
51void 51void
52_ecore_x_input_shutdown(void) 52_ecore_x_input_shutdown(void)
@@ -61,7 +61,7 @@ _ecore_x_input_shutdown(void)
61 _ecore_x_xi2_num = 0; 61 _ecore_x_xi2_num = 0;
62 _ecore_x_xi2_opcode = -1; 62 _ecore_x_xi2_opcode = -1;
63#endif /* ifdef ECORE_XI2 */ 63#endif /* ifdef ECORE_XI2 */
64} /* _ecore_x_input_shutdown */ 64}
65 65
66void 66void
67_ecore_x_input_handler(XEvent *xevent) 67_ecore_x_input_handler(XEvent *xevent)
@@ -205,9 +205,9 @@ _ecore_x_input_handler(XEvent *xevent)
205#endif 205#endif
206 default: 206 default:
207 break; 207 break;
208 } /* switch */ 208 }
209#endif /* ifdef ECORE_XI2 */ 209#endif /* ifdef ECORE_XI2 */
210} /* _ecore_x_input_handler */ 210}
211 211
212EAPI Eina_Bool 212EAPI Eina_Bool
213ecore_x_input_multi_select(Ecore_X_Window win) 213ecore_x_input_multi_select(Ecore_X_Window win)
@@ -279,5 +279,5 @@ ecore_x_input_multi_select(Ecore_X_Window win)
279#else /* ifdef ECORE_XI2 */ 279#else /* ifdef ECORE_XI2 */
280 return EINA_FALSE; 280 return EINA_FALSE;
281#endif /* ifdef ECORE_XI2 */ 281#endif /* ifdef ECORE_XI2 */
282} /* ecore_x_input_multi_select */ 282}
283 283
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
index 1d956b7..f49a4d3 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
@@ -36,10 +36,10 @@ ecore_x_xinerama_screen_count_get(void)
36 36
37#endif /* ifdef ECORE_XINERAMA */ 37#endif /* ifdef ECORE_XINERAMA */
38 return 0; 38 return 0;
39} /* ecore_x_xinerama_screen_count_get */ 39}
40 40
41EAPI Eina_Bool 41EAPI Eina_Bool
42ecore_x_xinerama_screen_geometry_get(int screen, 42ecore_x_xinerama_screen_geometry_get(int screen,
43 int *x, 43 int *x,
44 int *y, 44 int *y,
45 int *w, 45 int *w,
@@ -87,5 +87,5 @@ ecore_x_xinerama_screen_geometry_get(int screen,
87 87
88 return EINA_FALSE; 88 return EINA_FALSE;
89 screen = 0; 89 screen = 0;
90} /* ecore_x_xinerama_screen_geometry_get */ 90}
91 91